@capgo/cli 8.58.0 → 8.60.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import{createRequire as Af}from"node:module";var wf=Object.create;var{getPrototypeOf:Of,defineProperty:d2,getOwnPropertyNames:AB,getOwnPropertyDescriptor:jf}=Object,vB=Object.prototype.hasOwnProperty;function EB(D){return this[D]}var Nf,Lf,K6=(D,$,U)=>{var J=D!=null&&typeof D==="object";if(J){var Y=$?Nf??=new WeakMap:Lf??=new WeakMap,X=Y.get(D);if(X)return X}U=D!=null?wf(Of(D)):{};let Q=$||!D||!D.__esModule?d2(U,"default",{value:D,enumerable:!0}):U;for(let F of AB(D))if(!vB.call(Q,F))d2(Q,F,{get:EB.bind(D,F),enumerable:!0});if(J)Y.set(D,Q);return Q},u$=(D)=>{var $=(MB??=new WeakMap).get(D),U;if($)return $;if($=d2({},"__esModule",{value:!0}),D&&typeof D==="object"||typeof D==="function"){for(var J of AB(D))if(!vB.call($,J))d2($,J,{get:EB.bind(D,J),enumerable:!(U=jf(D,J))||U.enumerable})}return MB.set(D,$),$},MB,S=(D,$)=>()=>($||D(($={exports:{}}).exports,$),$.exports);var Rf=(D)=>D;function Mf(D,$){this[D]=Rf.bind(null,$)}var S0=(D,$)=>{for(var U in $)d2(D,U,{get:$[U],enumerable:!0,configurable:!0,set:Mf.bind($,U)})};var _=(D,$)=>()=>(D&&($=D(D=0)),$);var UD=Af(import.meta.url);var u6;var f4=_(()=>{u6={name:"@capgo/cli",type:"module",version:"8.58.0",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/capgo/tree/main/cli#readme",repository:{type:"git",url:"https://github.com/Cap-go/capgo.app",directory:"cli"},bugs:{url:"https://github.com/Cap-go/capgo/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli","sdk","tanstack-intent"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",bin:{capgo:"dist/index.js"},files:["!skills/_artifacts","dist","skills"],engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && bun build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"bunx --bun supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",typecheck:"tsgo --project tsconfig.tsgo.json --noEmit",lint:"bun run lint:ox","lint:ox":"oxlint --config ../.oxlintrc.json src","lint:fix":"oxlint --config ../.oxlintrc.json --fix src","check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test:notify-app-ready-background":"bun test ./test/test-notify-app-ready-background.mjs ./test/test-background-check-shutdown.mjs","test:bundle":"bun test/test-bundle.mjs","test:bundle-validation":"bun test test/bundle/","test:prescan":"bun test test/prescan/","test:functional":"bun test/test-functional.mjs","test:semver":"bun test/test-semver-validation.mjs","test:version-edge-cases":"bun test/test-version-validation.mjs","test:regex":"bun test/test-regex-validation.mjs","test:upload":"bun test/test-upload-validation.mjs","test:fail-on-incompatible":"bun test/test-fail-on-incompatible.mjs","test:native-dependencies":"bun test/test-native-dependencies.mjs && bun test/test-get-remote-dependencies.mjs","test:package-json-guard":"bun test/test-package-json-guard.mjs","test:credentials":"bun test/test-credentials.mjs","test:credentials-export":"bun test/test-credentials-export.mjs","test:asc-key-protocol":"bun test/test-asc-key-protocol.mjs","test:credentials-validation":"bun test/test-credentials-validation.mjs","test:android-service-account-validation":"bun test/test-android-service-account-validation.mjs","test:build-zip-filter":"bun test/test-build-zip-filter.mjs","test:checksum":"bun test/test-checksum-algorithm.mjs","test:build-needed":"bun test/test-build-needed.mjs","test:cli-help":"bun test/test-cli-help.mjs","test:build-cache-payload":"bun test/test-build-cache-payload.mjs","test:build-cancellation":"bun test/test-build-cancellation.mjs","test:ci-prompts":"bun test/test-ci-prompts.mjs","test:ci-secrets":"bun test/test-ci-secrets.mjs","test:android-onboarding-progress":"bun test/test-android-onboarding-progress.mjs","test:onboarding-telemetry":"bun test/test-onboarding-telemetry.mjs","test:v2-event-migration":"bun test/test-v2-event-migration.mjs","test:analytics":"bun test/test-analytics.mjs","test:cli-headers":"bun test/test-cli-headers.mjs","test:min-cli-version":"bun test/test-min-cli-version.mjs","test:authenticated-command-invocation":"bun test/test-authenticated-command-invocation.mjs","test:analytics-error-category":"bun test/test-analytics-error-category.mjs","test:analytics-org-resolver":"bun test/test-analytics-org-resolver.mjs","test:supabase-perf":"bun test/test-supabase-perf.mjs","test:preview-qr":"bun test/test-preview-qr.mjs","test:mcp-analytics":"bun test/test-mcp-analytics.mjs","test:mcp-instructions":"bun test/test-mcp-instructions.mjs","test:mcp-stdout-guard":"bun test/test-mcp-stdout-guard.mjs","test:mcp-platform-select":"bun test/test-mcp-platform-select.mjs","test:mcp-explain-scopes":"bun test/test-mcp-explain-scopes.mjs","test:mcp-oauth-reopen":"bun test/test-mcp-oauth-reopen.mjs","test:mcp-broker-oauth":"bun test/test-mcp-broker-oauth.mjs","test:mcp-broker-session":"bun test/test-mcp-broker-session.mjs","test:mcp-credentials-manage":"bun test/test-mcp-credentials-manage.mjs","test:mcp-resume-prompt":"bun test/test-mcp-resume-prompt.mjs","test:mcp-build-job":"bun test/test-mcp-build-job.mjs","test:mcp-build-tools":"bun test/test-mcp-build-tools.mjs","test:app-created-source":"bun test/test-app-created-source.mjs","test:app-add-exists":"bun test/test-app-add-exists.mjs","test:app-add-getting-started":"bun test/test-app-add-getting-started.mjs","test:app-list-output-text":"bun test/test-app-list-output-text.mjs","test:app-todo":"bun test/test-app-todo.mjs","test:doctor-analytics":"bun test/test-doctor-analytics.mjs","test:posthog-exception":"bun test/test-posthog-exception.mjs","test:cli-recovery":"bun test/test-cli-recovery.mjs","test:create-supabase-client":"bun test/test-create-supabase-client.mjs","test:onboarding-recovery":"bun test/test-onboarding-recovery.mjs","test:onboarding-progress":"bun test/test-onboarding-progress.mjs","test:onboarding-run-targets":"bun test/test-onboarding-run-targets.mjs","test:run-device-command":"bun test/test-run-device-command.mjs","test:init-app-conflict":"bun test/test-init-app-conflict.mjs","test:channel-add-exists":"bun test/test-channel-add-exists.mjs","test:wait-log":"bun test/test-wait-log.mjs","test:init-guardrails":"bun test/test-init-guardrails.mjs","test:init-upload-recovery":"bun test/test-init-upload-error-gate.mjs && bun test/test-init-upload-monorepo-recovery.mjs","test:init-replay":"bun test/test-init-replay.mjs","test:init-telemetry":"bun test/test-init-telemetry.mjs","test:capacitor-config-target":"bun test/test-capacitor-config-target.mjs","test: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:capacitor-config-typescript7 && bun run test:capacitor-config-native-import && bun run test:cli-user-error-config && bun test/test-init-monorepo-targeting.mjs","test:prompt-preferences":"bun test/test-prompt-preferences.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:auth-session":"bun test/test-auth-session.mjs","test:mcp":"node test/test-mcp.mjs","test:mcp-no-key-handshake":"node test/test-mcp-no-key-handshake.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs","test:project-type-detection":"bun test/test-project-type-detection.mjs","test:payload-split":"bun test/test-payload-split.mjs","test:macos-signing":"bun test/test-macos-signing.mjs","test:helper-dce":"bash scripts/check-helper-dce.sh","test:apple-api-import-helpers":"bun test/test-apple-api-import-helpers.mjs","test:apple-api-verify-key":"bun test/test-apple-api-verify-key.mjs","test:bundle-id-detector":"bun test/test-bundle-id-detector.mjs","test:apple-api-app-list":"bun test/test-apple-api-app-list.mjs","test:apple-api-cert-create":"bun test/test-apple-api-cert-create.mjs","test:app-verification":"bun test/test-app-verification.mjs","test:pbxproj-parser":"bun test/test-pbxproj-parser.mjs","test:manifest-path-encoding":"bun test/test-manifest-path-encoding.mjs","test:self-update":"bun test/test-self-update.mjs","test:update-prompt":"bun test/test-update-prompt.mjs","test:android-tail-engine":"bun test/test-android-tail-engine.mjs","test:android-tail-render":"bun test/test-android-tail-render.mjs","test:android-tail-routing":"bun test/test-android-tail-routing.mjs","test:dev-gate-stripped":"bun test/test-dev-gate-stripped.mjs","test:frame-fit-ios-shared":"bun test/test-frame-fit-ios-shared.mjs","test:ios-confirm-app-id":"bun test/test-ios-confirm-app-id.mjs","test:ios-create-new":"bun test/test-ios-create-new.mjs","test:ios-e2e":"bun test/test-ios-e2e.mjs","test:ios-flow-contract":"bun test/test-ios-flow-contract.mjs","test:ios-import-discovery":"bun test/test-ios-import-discovery.mjs","test:ios-import-export":"bun test/test-ios-import-export.mjs","test:ios-import-pickers":"bun test/test-ios-import-pickers.mjs","test:ios-import-recovery":"bun test/test-ios-import-recovery.mjs","test:ios-recovery":"bun test/test-ios-recovery.mjs","test:ios-resume":"bun test/test-ios-resume.mjs","test:ios-tail-handoff":"bun test/test-ios-tail-handoff.mjs","test:ios-tui-render":"bun test/test-ios-tui-render.mjs","test:p8-error":"bun test/test-p8-error.mjs","test:ios-tui-routing":"bun test/test-ios-tui-routing.mjs","test:ios-updater-sync-validation":"bun test/test-ios-updater-sync-validation.mjs","test:ios-verify-app":"bun test/test-ios-verify-app.mjs","test:ios-marketing-version":"bun test/test-ios-marketing-version.mjs","test:android-version":"bun test/test-android-version.mjs","test:platform-flow-contract":"bun test/test-platform-flow-contract.mjs","test:tail-engine-shared":"bun test/test-tail-engine-shared.mjs",test:"bun run build && bun run test:helper-dce && bun run test:version-detection:setup && bun run test:bundle && bun run test:notify-app-ready-background && bun run test:bundle-validation && bun run test:functional && bun run test:semver && bun run test:auto-bump-version && bun run test:auto-bump-ai-diff && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:cordova-upload-mode && bun run test:fail-on-incompatible && bun run test:native-dependencies && bun run test:package-json-guard && bun run test:credentials && bun run test:credentials-export && bun run test:ios-provisioning-map && bun run test:ios-provisioning-command && bun run test:credentials-validation && bun run test:android-service-account-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:build-needed && bun run test:cli-help && bun run test:build-cache-payload && bun run test:build-cancellation && bun run test:ci-prompts && bun run test:ci-secrets && bun run test:android-onboarding-progress && bun run test:onboarding-telemetry && bun run test:v2-event-migration && bun run test:analytics && bun run test:cli-headers && bun run test:min-cli-version && bun run test:authenticated-command-invocation && bun run test:analytics-error-category && bun run test:analytics-org-resolver && bun run test:supabase-perf && bun run test:preview-qr && bun run test: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-platform-select && bun run test:mcp-explain-scopes && bun run test:mcp-oauth-reopen && bun run test:mcp-broker-oauth && bun run test:mcp-broker-session && bun run test:mcp-credentials-manage && bun run test:mcp-resume-prompt && bun run test:mcp-build-job && bun run test:mcp-build-tools && bun run test:app-created-source && bun run test:app-add-exists && bun run test:app-add-getting-started && bun run test:app-list-output-text && bun run test:app-todo && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:cli-recovery && bun run test:create-supabase-client && bun run test:build-platform-selection && bun run test:builder-project-discovery && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-monorepo-targeting && bun run test:init-app-conflict && bun run test:channel-list && bun run test:channel-add-exists && bun run test:wait-log && bun run test:init-guardrails && bun run test:init-upload-recovery && bun run test:init-replay && bun run test:init-telemetry && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:mcp-no-key-handshake && bun run test:auth-session && bun run test:version-detection && bun run test:platform-paths && bun run test:project-type-detection && bun run test:payload-split && bun run test:manifest-path-encoding && bun run test:macos-signing && bun run test:asc-key-protocol && bun run test:apple-api-import-helpers && bun run test:apple-api-verify-key && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:cicd-failure-help && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-upload-prompt && bun run test:support-bundle-files && bun run test:self-update && bun run test:update-prompt && bun run test:apple-api-cert-create && bun run test:android-tail-engine && bun run test:android-tail-render && bun run test:android-tail-routing && bun run test:dev-gate-stripped && bun run test:frame-fit-ios-shared && bun run test:ios-confirm-app-id && bun run test:ios-create-new && bun run test:ios-e2e && bun run test:ios-flow-contract && bun run test:ios-import-discovery && bun run test:ios-import-export && bun run test:ios-import-pickers && bun run test:ios-import-recovery && bun run test:ios-recovery && bun run test:ios-resume && bun run test:ios-tail-handoff && bun run test:ios-tui-render && bun run test:p8-error && bun run test:ios-tui-routing && bun run test:ios-updater-sync-validation && bun run test:ios-verify-app && bun run test:ios-marketing-version && bun run test:android-version && bun run test:platform-flow-contract && bun run test:tail-engine-shared && bun run test:prescan && bun run test:android-reporting-api && bun run test:android-gcp && bun run test:android-app-verification && bun run test:android-rename && bun run test:appflow-auth && bun run test:appflow-api-map && bun run test:appflow-validate && bun run test:appflow-flow && bun run test:appflow-gapfill && bun run test:appflow-engine && bun run test:appflow-tail && bun run test:appflow-fetch && bun run test:appflow-sa-decode && bun run test:app-permission-helper && bun run test:2fa-compliance-network && bun run test:organization-set-api-host && bun run test:trial-warning && bun run test:plan-validation","test:build-platform-selection":"bun test/test-build-platform-selection.mjs","test:builder-project-discovery":"bun test/test-builder-project-discovery.mjs","test:ai-log-capture":"bun test/test-ai-log-capture.mjs","test:ai-analyze-flow":"bun test/test-ai-analyze-flow.mjs","test:cicd-failure-help":"bun test/test-cicd-failure-help.mjs","test:ai-analyze-stream":"bun test/test-ai-analyze-stream.mjs","test:ai-sse-parser":"bun test/test-ai-sse-parser.mjs","test:ai-render-markdown":"bun test/test-ai-render-markdown.mjs","test:ai-onboarding-mode":"bun test/test-ai-onboarding-mode.mjs","test:ai-fit":"bun test/test-ai-fit.mjs","test:platform-layout":"bun test/test-platform-layout.mjs","test:frame-fit":"bun test/run-frame-fit.mjs","test:onboarding-min-size":"bun test/test-onboarding-min-size.mjs","test:min-size-gate":"bun test/test-min-size-gate.mjs","test:shell-size-gate":"bun test/test-shell-size-gate.mjs","test:build-log-sanitize":"bun test/test-build-log-sanitize.mjs","test:build-output-viewport":"bun test/test-build-output-viewport.mjs","test:diff-viewer-viewport":"bun test/test-diff-viewer-viewport.mjs","test:build-complete-exit":"bun test/test-build-complete-exit.mjs","test:ai-stream-markdown":"bun test/test-ai-stream-markdown.mjs","test:support-mailto":"bun test/test-support-mailto.mjs","test:support-redact":"bun test/test-support-redact.mjs","test:support-internal-log":"bun test/test-support-internal-log.mjs","test:support-help-menu":"bun test/test-support-help-menu.mjs","test:support-contact":"bun test/test-support-contact.mjs","test:support-upload-prompt":"bun test/test-support-upload-prompt.mjs","test:support-bundle-files":"bun test/test-support-bundle-files.mjs","test:mcp-live-update-onboarding":"bun test/test-mcp-live-update-onboarding.mjs","test:app-set-options":"bun test/test-app-set-options.mjs && bun test/test-app-list-options.mjs","test:android-reporting-api":"bun test/test-android-reporting-api.mjs","test:android-gcp":"bun test/test-android-gcp.mjs","test:android-app-verification":"bun test/test-android-app-verification.mjs","test:android-rename":"bun test/test-android-rename.mjs","test:appflow-auth":"bun test/test-appflow-auth.mjs","test:appflow-api-map":"bun test/test-appflow-api-map.mjs","test:appflow-validate":"bun test/test-appflow-validate.mjs","test:appflow-flow":"bun test/test-appflow-flow.mjs","test:appflow-gapfill":"bun test/test-appflow-gapfill.mjs","test:appflow-engine":"bun test/test-appflow-engine.mjs","test:appflow-tail":"bun test/test-appflow-tail.mjs","test:appflow-fetch":"bun test/test-appflow-fetch.mjs","test:appflow-sa-decode":"bun test/test-appflow-sa-decode.mjs","test:app-permission-helper":"bun test/test-app-permission-helper.mjs","test:2fa-compliance-network":"bun test/test-2fa-compliance-network.mjs","test:organization-set-api-host":"bun test/test-organization-set-api-host.mjs","test:trial-warning":"bun test/test-trial-warning.mjs","test:plan-validation":"bun test/test-plan-validation.mjs","test:auto-bump-version":"bun test/test-auto-bump-version.mjs","test:auto-bump-ai-diff":"bun test/test-auto-bump-ai-diff.mjs","test:ios-provisioning-map":"bun test/test-ios-provisioning-map.mjs","test:ios-provisioning-command":"bun test/test-ios-provisioning-command.mjs","test:channel-list":"bun test/test-channel-list.mjs"},dependencies:{"@inkjs/ui":"^2.0.0","@manypkg/tools":"^2.1.2","@rrweb/types":"^2.1.1","@standard-schema/spec":"^1.1.0","@xmldom/xmldom":"^0.9.10","@xterm/addon-serialize":"^0.14.0","@xterm/headless":"^6.0.0","agent-cli-detector":"^0.1.6","happy-dom":"^20.11.0",ink:"^7.1.1","ink-spinner":"^5.0.0",jsonwebtoken:"^9.0.3","node-forge":"^1.4.0",qrcode:"^1.5.4",react:"^19.2.8","rrweb-snapshot":"^2.1.1","string-width":"^8.2.2",typescript:"6.0.3",zod:"^4.4.3"},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","@std/semver":"npm:@jsr/std__semver@1.0.8","@supabase/supabase-js":"^2.110.8","@tanstack/intent":"^0.3.6","@types/adm-zip":"^0.5.8","@types/jsonwebtoken":"^9.0.10","@types/node":"^26.1.1","@types/node-forge":"^1.3.14","@types/prettyjson":"^0.0.33","@types/qrcode":"^1.5.6","@types/react":"^19.2.17","@types/tmp":"^0.2.6","@types/ws":"^8.18.1","@typescript/native-preview":"7.0.0-dev.20260707.2","@vercel/ncc":"^0.44.1","@vue/compiler-dom":"3.5.40","@xterm/headless":"^6.0.0","adm-zip":"^0.6.0","ci-info":"^4.4.0",commander:"^15.0.0",eslint:"^10.7.0","git-format-staged":"4.0.2",husky:"^9.1.7","is-wsl":"^3.1.1",micromatch:"^4.0.8",open:"^11.0.0",oxlint:"^1.75.0",partysocket:"^1.3.0",prettyjson:"^1.2.5",tmp:"^0.2.7","tus-js-client":"^4.3.1",ws:"^8.21.1"}}});var uD;var M1=_(()=>{uD=class uD extends Error{context;constructor(D,$){super(D);this.name="CliUserError",this.context=$}}});import{platform as Ef}from"node:os";import{version as Tf}from"node:process";function SB(D){PB=D}function Sf(D){for(let $=0;$<D.length;$++)if(D.charCodeAt($)>255)return!1;return!0}function TB(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 bf(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 or Supabase anon key configuration.";return"Capgo API key contains invalid characters (only ASCII is allowed). Copy the key from the Capgo dashboard."}function MX(D,$){if($===void 0||$===null){if(RX.has(D.toLowerCase()))throw new uD(TB(D));throw new uD(`HTTP header "${D}" is missing or invalid.`)}if(typeof $!=="string"){if(RX.has(D.toLowerCase()))throw new uD(TB(D));throw new uD(`HTTP header "${D}" is missing or invalid.`)}if(!Sf($)){if(RX.has(D.toLowerCase()))throw new uD(bf(D));throw new uD(`HTTP header "${D}" contains invalid characters (only ASCII is allowed).`)}return $}function r6(D){let $={capgo_api:Pf,"x-cli-version":u6.version,"x-cli-command":PB,"x-cli-node":Tf,"x-cli-os":Ef()};if(D)for(let[U,J]of Object.entries(D))$[U]=MX(U,J);return $}var Pf="2025-10-01",PB="",RX;var A7=_(()=>{f4();M1();RX=new Set(["authorization","capgkey","x-capgo-log-token"])});import{existsSync as D6}from"fs";var i2=(D=".",$="unknown")=>{let U=`${D}/bun.lockb`,J=`${D}/bun.lock`,Y=`${D}/pnpm-lock.yaml`,X=`${D}/shrinkwrap.yaml`,Q=`${D}/yarn.lock`,F=`${D}/package-lock.json`,W=`${D}/npm-shrinkwrap.json`;if(D6(U)||D6(J))return"bun";if(D6(Y)||D6(X))return"pnpm";if(D6(Q))return"yarn";if(D6(F)||D6(W))return"npm";return $},v7=(D=i2(),$=!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"}},bB=(D=".",$="npx")=>{let U=`${D}/bun.lockb`,J=`${D}/bun.lock`,Y=`${D}/pnpm-lock.yaml`,X=`${D}/shrinkwrap.yaml`,Q=`${D}/yarn.lock`,F=`${D}/package-lock.json`,W=`${D}/npm-shrinkwrap.json`;if(D6(U)||D6(J))return"bunx";if(D6(Y)||D6(X))return"pnpm exec";if(D6(Q))return"yarn dlx";if(D6(F)||D6(W))return"npx";return $};var CB=()=>{};var kB,uB=(D)=>{return D===12288||D>=65281&&D<=65376||D>=65504&&D<=65510},_B=(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 xB=_(()=>{kB=(()=>{let D=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return($)=>{let U=0;D.lastIndex=0;while(D.test($))U+=1;return $.length-U}})()});var Cf,kf,gB,uf,fB,_f,xf,gf,yB=(D,$={},U={})=>{let J=$.limit??1/0,Y=$.ellipsis??"",X=$?.ellipsisWidth??(Y?yB(Y,gf,U).width:0),Q=0,F=U.controlWidth??0,W=U.tabWidth??8,K=U.emojiWidth??2,Z=2,z=U.regularWidth??1,q=U.wideWidth??2,G=[[_f,z],[Cf,0],[kf,F],[uf,W],[fB,K],[gB,q]],V=0,I=0,H=D.length,w=0,j=!1,B=H,N=Math.max(0,J-X),A=0,v=0,k=0,C=0;D:while(!0){if(v>A||I>=H&&I>V){let b=D.slice(A,v)||D.slice(V,I);w=0;for(let y of b.replaceAll(xf,"")){let T=y.codePointAt(0)||0;if(uB(T))C=2;else if(_B(T))C=q;else C=z;if(k+C>N)B=Math.min(B,Math.max(A,V)+w);if(k+C>J){j=!0;break D}w+=y.length,k+=C}A=v=0}if(I>=H)break D;for(let b=0,y=G.length;b<y;b++){let[T,h]=G[b];if(T.lastIndex=I,T.test(D)){if(w=T===gB?kB(D.slice(I,T.lastIndex)):T===fB?1:T.lastIndex-I,C=w*h,k+C>N)B=Math.min(B,I+Math.floor((N-k)/h));if(k+C>J){j=!0;break D}k+=C,A=V,v=I,I=V=T.lastIndex;continue D}}I+=1}return{width:j?N:k,index:j?B:H,truncated:j,ellipsed:j&&J>=X}},hB;var mB=_(()=>{xB();Cf=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,kf=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,gB=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,uf=/\t{1,1000}/y,fB=/[\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,_f=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,xf=/\p{M}+/gu,gf={limit:1/0,ellipsis:""},hB=yB});var ff,yf=(D,$={})=>{return hB(D,ff,$).width},o6;var AX=_(()=>{mB();ff={limit:1/0,ellipsis:"",ellipsisWidth:0},o6=yf});function _$(D,$,U){return String(D).normalize().split(df).map((J)=>cf(J,$,U)).join(`
1
+ import{createRequire as Af}from"node:module";var wf=Object.create;var{getPrototypeOf:Of,defineProperty:d2,getOwnPropertyNames:AB,getOwnPropertyDescriptor:jf}=Object,vB=Object.prototype.hasOwnProperty;function EB(D){return this[D]}var Nf,Lf,K6=(D,$,U)=>{var J=D!=null&&typeof D==="object";if(J){var Y=$?Nf??=new WeakMap:Lf??=new WeakMap,X=Y.get(D);if(X)return X}U=D!=null?wf(Of(D)):{};let Q=$||!D||!D.__esModule?d2(U,"default",{value:D,enumerable:!0}):U;for(let F of AB(D))if(!vB.call(Q,F))d2(Q,F,{get:EB.bind(D,F),enumerable:!0});if(J)Y.set(D,Q);return Q},u$=(D)=>{var $=(MB??=new WeakMap).get(D),U;if($)return $;if($=d2({},"__esModule",{value:!0}),D&&typeof D==="object"||typeof D==="function"){for(var J of AB(D))if(!vB.call($,J))d2($,J,{get:EB.bind(D,J),enumerable:!(U=jf(D,J))||U.enumerable})}return MB.set(D,$),$},MB,S=(D,$)=>()=>($||D(($={exports:{}}).exports,$),$.exports);var Rf=(D)=>D;function Mf(D,$){this[D]=Rf.bind(null,$)}var S0=(D,$)=>{for(var U in $)d2(D,U,{get:$[U],enumerable:!0,configurable:!0,set:Mf.bind($,U)})};var _=(D,$)=>()=>(D&&($=D(D=0)),$);var UD=Af(import.meta.url);var u6;var f4=_(()=>{u6={name:"@capgo/cli",type:"module",version:"8.60.0",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/capgo/tree/main/cli#readme",repository:{type:"git",url:"https://github.com/Cap-go/capgo.app",directory:"cli"},bugs:{url:"https://github.com/Cap-go/capgo/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli","sdk","tanstack-intent"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",bin:{capgo:"dist/index.js"},files:["!skills/_artifacts","dist","skills"],engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && bun build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"bunx --bun supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",typecheck:"tsgo --project tsconfig.tsgo.json --noEmit",lint:"bun run lint:ox","lint:ox":"oxlint --config ../.oxlintrc.json src","lint:fix":"oxlint --config ../.oxlintrc.json --fix src","check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test:notify-app-ready-background":"bun test ./test/test-notify-app-ready-background.mjs ./test/test-background-check-shutdown.mjs","test:bundle":"bun test/test-bundle.mjs","test:bundle-validation":"bun test test/bundle/","test:prescan":"bun test test/prescan/","test:functional":"bun test/test-functional.mjs","test:semver":"bun test/test-semver-validation.mjs","test:version-edge-cases":"bun test/test-version-validation.mjs","test:regex":"bun test/test-regex-validation.mjs","test:upload":"bun test/test-upload-validation.mjs","test:fail-on-incompatible":"bun test/test-fail-on-incompatible.mjs","test:native-dependencies":"bun test/test-native-dependencies.mjs && bun test/test-get-remote-dependencies.mjs","test:package-json-guard":"bun test/test-package-json-guard.mjs","test:credentials":"bun test/test-credentials.mjs","test:credentials-export":"bun test/test-credentials-export.mjs","test:asc-key-protocol":"bun test/test-asc-key-protocol.mjs","test:credentials-validation":"bun test/test-credentials-validation.mjs","test:android-service-account-validation":"bun test/test-android-service-account-validation.mjs","test:build-zip-filter":"bun test/test-build-zip-filter.mjs","test:checksum":"bun test/test-checksum-algorithm.mjs","test:build-needed":"bun test/test-build-needed.mjs","test:cli-help":"bun test/test-cli-help.mjs","test:build-cache-payload":"bun test/test-build-cache-payload.mjs","test:build-cancellation":"bun test/test-build-cancellation.mjs","test:ci-prompts":"bun test/test-ci-prompts.mjs","test:ci-secrets":"bun test/test-ci-secrets.mjs","test:android-onboarding-progress":"bun test/test-android-onboarding-progress.mjs","test:onboarding-telemetry":"bun test/test-onboarding-telemetry.mjs","test:v2-event-migration":"bun test/test-v2-event-migration.mjs","test:analytics":"bun test/test-analytics.mjs","test:cli-headers":"bun test/test-cli-headers.mjs","test:min-cli-version":"bun test/test-min-cli-version.mjs","test:authenticated-command-invocation":"bun test/test-authenticated-command-invocation.mjs","test:analytics-error-category":"bun test/test-analytics-error-category.mjs","test:analytics-org-resolver":"bun test/test-analytics-org-resolver.mjs","test:supabase-perf":"bun test/test-supabase-perf.mjs","test:preview-qr":"bun test/test-preview-qr.mjs","test:mcp-analytics":"bun test/test-mcp-analytics.mjs","test:mcp-instructions":"bun test/test-mcp-instructions.mjs","test:mcp-stdout-guard":"bun test/test-mcp-stdout-guard.mjs","test:mcp-platform-select":"bun test/test-mcp-platform-select.mjs","test:mcp-explain-scopes":"bun test/test-mcp-explain-scopes.mjs","test:mcp-oauth-reopen":"bun test/test-mcp-oauth-reopen.mjs","test:mcp-broker-oauth":"bun test/test-mcp-broker-oauth.mjs","test:mcp-broker-session":"bun test/test-mcp-broker-session.mjs","test:mcp-credentials-manage":"bun test/test-mcp-credentials-manage.mjs","test:mcp-resume-prompt":"bun test/test-mcp-resume-prompt.mjs","test:mcp-build-job":"bun test/test-mcp-build-job.mjs","test:mcp-build-tools":"bun test/test-mcp-build-tools.mjs","test:app-created-source":"bun test/test-app-created-source.mjs","test:app-add-exists":"bun test/test-app-add-exists.mjs","test:app-add-getting-started":"bun test/test-app-add-getting-started.mjs","test:app-list-output-text":"bun test/test-app-list-output-text.mjs","test:app-todo":"bun test/test-app-todo.mjs","test:doctor-analytics":"bun test/test-doctor-analytics.mjs","test:posthog-exception":"bun test/test-posthog-exception.mjs","test:cli-recovery":"bun test/test-cli-recovery.mjs","test:create-supabase-client":"bun test/test-create-supabase-client.mjs","test:onboarding-recovery":"bun test/test-onboarding-recovery.mjs","test:onboarding-progress":"bun test/test-onboarding-progress.mjs","test:onboarding-run-targets":"bun test/test-onboarding-run-targets.mjs","test:run-device-command":"bun test/test-run-device-command.mjs","test:init-app-conflict":"bun test/test-init-app-conflict.mjs","test:channel-add-exists":"bun test/test-channel-add-exists.mjs","test:wait-log":"bun test/test-wait-log.mjs","test:init-guardrails":"bun test/test-init-guardrails.mjs","test:init-upload-recovery":"bun test/test-init-upload-error-gate.mjs && bun test/test-init-upload-monorepo-recovery.mjs","test:init-replay":"bun test/test-init-replay.mjs","test:init-telemetry":"bun test/test-init-telemetry.mjs","test:capacitor-config-target":"bun test/test-capacitor-config-target.mjs","test:builder-app-id-config":"bun test/test-builder-app-id-config.mjs","test:capacitor-config-typescript7":"bun test/test-capacitor-config-typescript7.mjs","test:capacitor-config-native-import":"bun test/test-capacitor-config-native-import.mjs","test:cli-user-error-config":"bun test/test-cli-user-error-config.mjs","test:cordova-upload-mode":"bun test/test-cordova-upload-mode.mjs","test:init-monorepo-targeting":"bun run test:capacitor-config-target && bun run test:builder-app-id-config && bun run test:capacitor-config-typescript7 && bun run test:capacitor-config-native-import && bun run test:cli-user-error-config && bun test/test-init-monorepo-targeting.mjs","test:prompt-preferences":"bun test/test-prompt-preferences.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:auth-session":"bun test/test-auth-session.mjs","test:mcp":"node test/test-mcp.mjs","test:mcp-no-key-handshake":"node test/test-mcp-no-key-handshake.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs","test:project-type-detection":"bun test/test-project-type-detection.mjs","test:payload-split":"bun test/test-payload-split.mjs","test:macos-signing":"bun test/test-macos-signing.mjs","test:helper-dce":"bash scripts/check-helper-dce.sh","test:apple-api-import-helpers":"bun test/test-apple-api-import-helpers.mjs","test:apple-api-verify-key":"bun test/test-apple-api-verify-key.mjs","test:bundle-id-detector":"bun test/test-bundle-id-detector.mjs","test:apple-api-app-list":"bun test/test-apple-api-app-list.mjs","test:apple-api-cert-create":"bun test/test-apple-api-cert-create.mjs","test:app-verification":"bun test/test-app-verification.mjs","test:pbxproj-parser":"bun test/test-pbxproj-parser.mjs","test:manifest-path-encoding":"bun test/test-manifest-path-encoding.mjs","test:self-update":"bun test/test-self-update.mjs","test:update-prompt":"bun test/test-update-prompt.mjs","test:android-tail-engine":"bun test/test-android-tail-engine.mjs","test:android-tail-render":"bun test/test-android-tail-render.mjs","test:android-tail-routing":"bun test/test-android-tail-routing.mjs","test:dev-gate-stripped":"bun test/test-dev-gate-stripped.mjs","test:frame-fit-ios-shared":"bun test/test-frame-fit-ios-shared.mjs","test:ios-confirm-app-id":"bun test/test-ios-confirm-app-id.mjs","test:ios-create-new":"bun test/test-ios-create-new.mjs","test:ios-e2e":"bun test/test-ios-e2e.mjs","test:ios-flow-contract":"bun test/test-ios-flow-contract.mjs","test:ios-import-discovery":"bun test/test-ios-import-discovery.mjs","test:ios-import-export":"bun test/test-ios-import-export.mjs","test:ios-import-pickers":"bun test/test-ios-import-pickers.mjs","test:ios-import-recovery":"bun test/test-ios-import-recovery.mjs","test:ios-recovery":"bun test/test-ios-recovery.mjs","test:ios-resume":"bun test/test-ios-resume.mjs","test:ios-tail-handoff":"bun test/test-ios-tail-handoff.mjs","test:ios-tui-render":"bun test/test-ios-tui-render.mjs","test:p8-error":"bun test/test-p8-error.mjs","test:ios-tui-routing":"bun test/test-ios-tui-routing.mjs","test:ios-updater-sync-validation":"bun test/test-ios-updater-sync-validation.mjs","test:ios-verify-app":"bun test/test-ios-verify-app.mjs","test:ios-marketing-version":"bun test/test-ios-marketing-version.mjs","test:android-version":"bun test/test-android-version.mjs","test:platform-flow-contract":"bun test/test-platform-flow-contract.mjs","test:tail-engine-shared":"bun test/test-tail-engine-shared.mjs",test:"bun run build && bun run test:helper-dce && bun run test:version-detection:setup && bun run test:bundle && bun run test:notify-app-ready-background && bun run test:bundle-validation && bun run test:functional && bun run test:semver && bun run test:auto-bump-version && bun run test:auto-bump-ai-diff && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:cordova-upload-mode && bun run test:fail-on-incompatible && bun run test:native-dependencies && bun run test:package-json-guard && bun run test:credentials && bun run test:credentials-export && bun run test:ios-provisioning-map && bun run test:ios-provisioning-command && bun run test:credentials-validation && bun run test:android-service-account-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:build-needed && bun run test:cli-help && bun run test:build-cache-payload && bun run test:build-cancellation && bun run test:ci-prompts && bun run test:ci-secrets && bun run test:android-onboarding-progress && bun run test:onboarding-telemetry && bun run test:v2-event-migration && bun run test:analytics && bun run test:cli-headers && bun run test:min-cli-version && bun run test:authenticated-command-invocation && bun run test:analytics-error-category && bun run test:analytics-org-resolver && bun run test:supabase-perf && bun run test:preview-qr && bun run test: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-platform-select && bun run test:mcp-explain-scopes && bun run test:mcp-oauth-reopen && bun run test:mcp-broker-oauth && bun run test:mcp-broker-session && bun run test:mcp-credentials-manage && bun run test:mcp-resume-prompt && bun run test:mcp-build-job && bun run test:mcp-build-tools && bun run test:app-created-source && bun run test:app-add-exists && bun run test:app-add-getting-started && bun run test:app-list-output-text && bun run test:app-todo && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:cli-recovery && bun run test:create-supabase-client && bun run test:build-platform-selection && bun run test:builder-project-discovery && bun run test:builder-login-gate && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-monorepo-targeting && bun run test:init-app-conflict && bun run test:channel-list && bun run test:channel-add-exists && bun run test:wait-log && bun run test:init-guardrails && bun run test:init-upload-recovery && bun run test:init-replay && bun run test:init-telemetry && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:mcp-no-key-handshake && bun run test:auth-session && bun run test:version-detection && bun run test:platform-paths && bun run test:project-type-detection && bun run test:payload-split && bun run test:manifest-path-encoding && bun run test:macos-signing && bun run test:asc-key-protocol && bun run test:apple-api-import-helpers && bun run test:apple-api-verify-key && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:cicd-failure-help && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-upload-prompt && bun run test:support-bundle-files && bun run test:self-update && bun run test:update-prompt && bun run test:apple-api-cert-create && bun run test:android-tail-engine && bun run test:android-tail-render && bun run test:android-tail-routing && bun run test:dev-gate-stripped && bun run test:frame-fit-ios-shared && bun run test:ios-confirm-app-id && bun run test:ios-create-new && bun run test:ios-e2e && bun run test:ios-flow-contract && bun run test:ios-import-discovery && bun run test:ios-import-export && bun run test:ios-import-pickers && bun run test:ios-import-recovery && bun run test:ios-recovery && bun run test:ios-resume && bun run test:ios-tail-handoff && bun run test:ios-tui-render && bun run test:p8-error && bun run test:ios-tui-routing && bun run test:ios-updater-sync-validation && bun run test:ios-verify-app && bun run test:ios-marketing-version && bun run test:android-version && bun run test:platform-flow-contract && bun run test:tail-engine-shared && bun run test:prescan && bun run test:android-reporting-api && bun run test:android-gcp && bun run test:android-app-verification && bun run test:android-rename && bun run test:appflow-auth && bun run test:appflow-api-map && bun run test:appflow-validate && bun run test:appflow-flow && bun run test:appflow-gapfill && bun run test:appflow-engine && bun run test:appflow-tail && bun run test:appflow-fetch && bun run test:appflow-sa-decode && bun run test:app-permission-helper && bun run test:2fa-compliance-network && bun run test:organization-set-api-host && bun run test:trial-warning && bun run test:plan-validation","test:build-platform-selection":"bun test/test-build-platform-selection.mjs","test:builder-project-discovery":"bun test/test-builder-project-discovery.mjs","test:builder-login-gate":"bun test/test-builder-login-gate.mjs","test:ai-log-capture":"bun test/test-ai-log-capture.mjs","test:ai-analyze-flow":"bun test/test-ai-analyze-flow.mjs","test:cicd-failure-help":"bun test/test-cicd-failure-help.mjs","test:ai-analyze-stream":"bun test/test-ai-analyze-stream.mjs","test:ai-sse-parser":"bun test/test-ai-sse-parser.mjs","test:ai-render-markdown":"bun test/test-ai-render-markdown.mjs","test:ai-onboarding-mode":"bun test/test-ai-onboarding-mode.mjs","test:ai-fit":"bun test/test-ai-fit.mjs","test:platform-layout":"bun test/test-platform-layout.mjs","test:frame-fit":"bun test/run-frame-fit.mjs","test:onboarding-min-size":"bun test/test-onboarding-min-size.mjs","test:min-size-gate":"bun test/test-min-size-gate.mjs","test:shell-size-gate":"bun test/test-shell-size-gate.mjs","test:build-log-sanitize":"bun test/test-build-log-sanitize.mjs","test:build-output-viewport":"bun test/test-build-output-viewport.mjs","test:diff-viewer-viewport":"bun test/test-diff-viewer-viewport.mjs","test:build-complete-exit":"bun test/test-build-complete-exit.mjs","test:ai-stream-markdown":"bun test/test-ai-stream-markdown.mjs","test:support-mailto":"bun test/test-support-mailto.mjs","test:support-redact":"bun test/test-support-redact.mjs","test:support-internal-log":"bun test/test-support-internal-log.mjs","test:support-help-menu":"bun test/test-support-help-menu.mjs","test:support-contact":"bun test/test-support-contact.mjs","test:support-upload-prompt":"bun test/test-support-upload-prompt.mjs","test:support-bundle-files":"bun test/test-support-bundle-files.mjs","test:mcp-live-update-onboarding":"bun test/test-mcp-live-update-onboarding.mjs","test:app-set-options":"bun test/test-app-set-options.mjs && bun test/test-app-list-options.mjs","test:android-reporting-api":"bun test/test-android-reporting-api.mjs","test:android-gcp":"bun test/test-android-gcp.mjs","test:android-app-verification":"bun test/test-android-app-verification.mjs","test:android-rename":"bun test/test-android-rename.mjs","test:appflow-auth":"bun test/test-appflow-auth.mjs","test:appflow-api-map":"bun test/test-appflow-api-map.mjs","test:appflow-validate":"bun test/test-appflow-validate.mjs","test:appflow-flow":"bun test/test-appflow-flow.mjs","test:appflow-gapfill":"bun test/test-appflow-gapfill.mjs","test:appflow-engine":"bun test/test-appflow-engine.mjs","test:appflow-tail":"bun test/test-appflow-tail.mjs","test:appflow-fetch":"bun test/test-appflow-fetch.mjs","test:appflow-sa-decode":"bun test/test-appflow-sa-decode.mjs","test:app-permission-helper":"bun test/test-app-permission-helper.mjs","test:2fa-compliance-network":"bun test/test-2fa-compliance-network.mjs","test:organization-set-api-host":"bun test/test-organization-set-api-host.mjs","test:trial-warning":"bun test/test-trial-warning.mjs","test:plan-validation":"bun test/test-plan-validation.mjs","test:auto-bump-version":"bun test/test-auto-bump-version.mjs","test:auto-bump-ai-diff":"bun test/test-auto-bump-ai-diff.mjs","test:ios-provisioning-map":"bun test/test-ios-provisioning-map.mjs","test:ios-provisioning-command":"bun test/test-ios-provisioning-command.mjs","test:channel-list":"bun test/test-channel-list.mjs"},dependencies:{"@inkjs/ui":"^2.0.0","@manypkg/tools":"^2.1.2","@rrweb/types":"^2.1.1","@standard-schema/spec":"^1.1.0","@xmldom/xmldom":"^0.9.10","@xterm/addon-serialize":"^0.14.0","@xterm/headless":"^6.0.0","agent-cli-detector":"^0.1.6","happy-dom":"^20.11.0",ink:"^7.1.1","ink-spinner":"^5.0.0",jsonwebtoken:"^9.0.3","node-forge":"^1.4.0",qrcode:"^1.5.4",react:"^19.2.8","rrweb-snapshot":"^2.1.1","string-width":"^8.2.2",typescript:"6.0.3",zod:"^4.4.3"},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","@std/semver":"npm:@jsr/std__semver@1.0.8","@supabase/supabase-js":"^2.110.8","@tanstack/intent":"^0.3.6","@types/adm-zip":"^0.5.8","@types/jsonwebtoken":"^9.0.10","@types/node":"^26.1.1","@types/node-forge":"^1.3.14","@types/prettyjson":"^0.0.33","@types/qrcode":"^1.5.6","@types/react":"^19.2.17","@types/tmp":"^0.2.6","@types/ws":"^8.18.1","@typescript/native-preview":"7.0.0-dev.20260707.2","@vercel/ncc":"^0.44.1","@vue/compiler-dom":"3.5.40","@xterm/headless":"^6.0.0","adm-zip":"^0.6.0","ci-info":"^4.4.0",commander:"^15.0.0",eslint:"^10.7.0","git-format-staged":"4.0.2",husky:"^9.1.7","is-wsl":"^3.1.1",micromatch:"^4.0.8",open:"^11.0.0",oxlint:"^1.75.0",partysocket:"^1.3.0",prettyjson:"^1.2.5",tmp:"^0.2.7","tus-js-client":"^4.3.1",ws:"^8.21.1"}}});var uD;var M1=_(()=>{uD=class uD extends Error{context;constructor(D,$){super(D);this.name="CliUserError",this.context=$}}});import{platform as Ef}from"node:os";import{version as Tf}from"node:process";function SB(D){PB=D}function Sf(D){for(let $=0;$<D.length;$++)if(D.charCodeAt($)>255)return!1;return!0}function TB(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 bf(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 or Supabase anon key configuration.";return"Capgo API key contains invalid characters (only ASCII is allowed). Copy the key from the Capgo dashboard."}function MX(D,$){if($===void 0||$===null){if(RX.has(D.toLowerCase()))throw new uD(TB(D));throw new uD(`HTTP header "${D}" is missing or invalid.`)}if(typeof $!=="string"){if(RX.has(D.toLowerCase()))throw new uD(TB(D));throw new uD(`HTTP header "${D}" is missing or invalid.`)}if(!Sf($)){if(RX.has(D.toLowerCase()))throw new uD(bf(D));throw new uD(`HTTP header "${D}" contains invalid characters (only ASCII is allowed).`)}return $}function r6(D){let $={capgo_api:Pf,"x-cli-version":u6.version,"x-cli-command":PB,"x-cli-node":Tf,"x-cli-os":Ef()};if(D)for(let[U,J]of Object.entries(D))$[U]=MX(U,J);return $}var Pf="2025-10-01",PB="",RX;var A7=_(()=>{f4();M1();RX=new Set(["authorization","capgkey","x-capgo-log-token"])});import{existsSync as D6}from"fs";var i2=(D=".",$="unknown")=>{let U=`${D}/bun.lockb`,J=`${D}/bun.lock`,Y=`${D}/pnpm-lock.yaml`,X=`${D}/shrinkwrap.yaml`,Q=`${D}/yarn.lock`,F=`${D}/package-lock.json`,W=`${D}/npm-shrinkwrap.json`;if(D6(U)||D6(J))return"bun";if(D6(Y)||D6(X))return"pnpm";if(D6(Q))return"yarn";if(D6(F)||D6(W))return"npm";return $},v7=(D=i2(),$=!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"}},bB=(D=".",$="npx")=>{let U=`${D}/bun.lockb`,J=`${D}/bun.lock`,Y=`${D}/pnpm-lock.yaml`,X=`${D}/shrinkwrap.yaml`,Q=`${D}/yarn.lock`,F=`${D}/package-lock.json`,W=`${D}/npm-shrinkwrap.json`;if(D6(U)||D6(J))return"bunx";if(D6(Y)||D6(X))return"pnpm exec";if(D6(Q))return"yarn dlx";if(D6(F)||D6(W))return"npx";return $};var CB=()=>{};var kB,uB=(D)=>{return D===12288||D>=65281&&D<=65376||D>=65504&&D<=65510},_B=(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 xB=_(()=>{kB=(()=>{let D=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return($)=>{let U=0;D.lastIndex=0;while(D.test($))U+=1;return $.length-U}})()});var Cf,kf,gB,uf,fB,_f,xf,gf,yB=(D,$={},U={})=>{let J=$.limit??1/0,Y=$.ellipsis??"",X=$?.ellipsisWidth??(Y?yB(Y,gf,U).width:0),Q=0,F=U.controlWidth??0,W=U.tabWidth??8,K=U.emojiWidth??2,Z=2,z=U.regularWidth??1,q=U.wideWidth??2,G=[[_f,z],[Cf,0],[kf,F],[uf,W],[fB,K],[gB,q]],V=0,I=0,H=D.length,w=0,j=!1,B=H,N=Math.max(0,J-X),A=0,v=0,k=0,C=0;D:while(!0){if(v>A||I>=H&&I>V){let b=D.slice(A,v)||D.slice(V,I);w=0;for(let y of b.replaceAll(xf,"")){let T=y.codePointAt(0)||0;if(uB(T))C=2;else if(_B(T))C=q;else C=z;if(k+C>N)B=Math.min(B,Math.max(A,V)+w);if(k+C>J){j=!0;break D}w+=y.length,k+=C}A=v=0}if(I>=H)break D;for(let b=0,y=G.length;b<y;b++){let[T,h]=G[b];if(T.lastIndex=I,T.test(D)){if(w=T===gB?kB(D.slice(I,T.lastIndex)):T===fB?1:T.lastIndex-I,C=w*h,k+C>N)B=Math.min(B,I+Math.floor((N-k)/h));if(k+C>J){j=!0;break D}k+=C,A=V,v=I,I=V=T.lastIndex;continue D}}I+=1}return{width:j?N:k,index:j?B:H,truncated:j,ellipsed:j&&J>=X}},hB;var mB=_(()=>{xB();Cf=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,kf=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,gB=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,uf=/\t{1,1000}/y,fB=/[\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,_f=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,xf=/\p{M}+/gu,gf={limit:1/0,ellipsis:""},hB=yB});var ff,yf=(D,$={})=>{return hB(D,ff,$).width},o6;var AX=_(()=>{mB();ff={limit:1/0,ellipsis:"",ellipsisWidth:0},o6=yf});function _$(D,$,U){return String(D).normalize().split(df).map((J)=>cf(J,$,U)).join(`
2
2
  `)}var E7="\x1B",pB="›",hf=39,EX="\x07",nB="[",mf="]",rB="m",TX,lB,cB=(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},dB=(D)=>`${E7}${nB}${D}${rB}`,iB=(D)=>`${E7}${TX}${D}${EX}`,vX=(D,$,U)=>{let J=$[Symbol.iterator](),Y=!1,X=!1,Q=D.at(-1),F=Q===void 0?0:o6(Q),W=J.next(),K=J.next(),Z=0;while(!W.done){let z=W.value,q=o6(z);if(F+q<=U)D[D.length-1]+=z;else D.push(z),F=0;if(z===E7||z===pB)Y=!0,X=$.startsWith(TX,Z+1);if(Y){if(X){if(z===EX)Y=!1,X=!1}else if(z===rB)Y=!1}else if(F+=q,F===U&&!K.done)D.push(""),F=0;W=K,K=J.next(),Z+=z.length}if(Q=D.at(-1),!F&&Q!==void 0&&Q.length&&D.length>1)D[D.length-2]+=D.pop()},lf=(D)=>{let $=D.split(" "),U=$.length;while(U){if(o6($[U-1]))break;U--}if(U===$.length)return D;return $.slice(0,U).join(" ")+$.slice(U).join("")},cf=(D,$,U={})=>{if(U.trim!==!1&&D.trim()==="")return"";let J="",Y,X,Q=D.split(" "),F=[""],W=0;for(let z=0;z<Q.length;z++){let q=Q[z];if(U.trim!==!1){let V=F.at(-1)??"",I=V.trimStart();if(V.length!==I.length)F[F.length-1]=I,W=o6(I)}if(z!==0){if(W>=$&&(U.wordWrap===!1||U.trim===!1))F.push(""),W=0;if(W||U.trim===!1)F[F.length-1]+=" ",W++}let G=o6(q);if(U.hard&&G>$){let V=$-W,I=1+Math.floor((G-V-1)/$);if(Math.floor((G-1)/$)<I)F.push("");vX(F,q,$),W=o6(F.at(-1)??"");continue}if(W+G>$&&W&&G){if(U.wordWrap===!1&&W<$){vX(F,q,$),W=o6(F.at(-1)??"");continue}F.push(""),W=0}if(W+G>$&&U.wordWrap===!1){vX(F,q,$),W=o6(F.at(-1)??"");continue}F[F.length-1]+=q,W+=G}if(U.trim!==!1)F=F.map((z)=>lf(z));let K=F.join(`
3
3
  `),Z=!1;for(let z=0;z<K.length;z++){let q=K[z];if(J+=q,!Z){if(Z=q>="\uD800"&&q<="\uDBFF",Z)continue}else Z=!1;if(q===E7||q===pB){lB.lastIndex=z+1;let V=lB.exec(K)?.groups;if(V?.code!==void 0){let I=Number.parseFloat(V.code);Y=I===hf?void 0:I}else if(V?.uri!==void 0)X=V.uri.length===0?void 0:V.uri}if(K[z+1]===`
4
4
  `){if(X)J+=iB("");let G=Y?cB(Y):void 0;if(Y&&G)J+=dB(G)}else if(q===`
@@ -250,7 +250,7 @@ tell application "System Events" to get value of property list item "CFBundleNam
250
250
  `)}function mLD(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(`
251
251
  `)}function C0(D){if(!D)return"Unknown error";if(XH(D).isSecurityPolicyError)return Ck(D);let U=D;if(typeof D==="string")return D;if(D instanceof Error){let J=U.message||U.cause?.message||U.stack||D.name,Y=U.cause?.name,X=J.toLowerCase();if(X.includes("fetch failed")||X.includes("failed to fetch")||X.includes("connect timeout")||X.includes("network")||Y?.startsWith("UND_ERR"))return`Network error: ${J}${U.code?` (code ${U.code})`:""}. Check your network connection and API endpoint availability.`;let Q=U.status||U.statusCode;return[J,U.code?`Code: ${U.code}`:void 0,Q?`Status: ${Q}`:void 0].filter(Boolean).join(" | ")||D.name}if(U.message){let J=[U.message,U.code?`Code: ${U.code}`:void 0,U.status||U.statusCode?`Status: ${U.status||U.statusCode}`:void 0].filter(Boolean).join(" | "),Y=U.message.toLowerCase();if(Y.includes("fetch failed")||Y.includes("failed to fetch")||U.error==="Failed to fetch")return`Network error: ${J}. Check your network connection and API endpoint availability.`;if(U.details||U.hint||U.error)return`${J}${J?" | ":""}${U.error?typeof U.error==="string"?U.error:U.error.message??"":""}${U.details?`Details: ${U.details}`:""}${U.hint?`Hint: ${U.hint}`:""}`.trim();return J}if(typeof U.error==="string"&&U.error.length>0)return U.error;if(U.error&&typeof U.error==="object"&&typeof U.error.message==="string"&&U.error.message.length>0)return U.error.message;return`
252
252
  ${Ou.default.render(D)}`}async function cLD(D,$,U=!1){let{data:J,error:Y}=await Ek(()=>D.rpc("reject_access_due_to_2fa_for_org",{org_id:$}));if(Y){if(!U&&!O2(Y))n.error(`Cannot check 2FA compliance: ${Y.message}`);if(O2(Y)){await Tk({silent:U,telemetryFunctionName:"check2FAAccessForOrg"});return}Pk(Y)}if(J){if(!U)n.error(`\uD83D\uDD10 Access Denied: 2FA Required. Enable 2FA at ${ju("/settings/account")}`);throw Error("2FA required for this organization")}}function dLD({silent:D=!1,stdinIsTTY:$=!!Bu.isTTY,stdoutIsTTY:U=!!wu.isTTY,ci:J=SH.isCI}={}){return!D&&$&&U&&!J}function t2D(D={}){let $=D.ci??SH.isCI,U=D.stdinIsTTY??!!Bu.isTTY,J=D.stdoutIsTTY??!!wu.isTTY,Y=D.platform??Vu(),X="display"in D?D.display:j4.DISPLAY;if($||!U||!J)return!1;if(Y==="linux"&&!X)return!1;return!0}async function s2D(D){if(!t2D())return;try{await(await Promise.resolve().then(() => (Qu(),Xu))).default(D)}catch($){if($?.code==="ENOENT")return}}function iLD(D){return bW(D)||CW(D)}function M$(D){if(bW(D))return rP(D);else if(CW(D))return oP(D);return D}function Nu(D=M$(j0()),$=void 0){let U=$?.split(",")[0],J=U??OD(D,F6);if(!GD(J)){let X=U?`Package.json at ${J} does not exist`:`No package.json found at ${J}. 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 n.error(X),Error(X)}let Y=K0(J);return JSON.parse(Y)}function pLD(D=M$(j0()),$=void 0){return Nu(D,$).scripts}function nLD(D=M$(j0()),$=void 0){return Nu(D,$).version??""}function e2D(D){let $=D.replace("^","").replace("~","");if(e2($))try{let U=x6($);return rX(U)}catch{return $}return $}async function rLD(D,$=j0(),U){let J=U?U.split(",").map((Q)=>Q.trim()).filter(Boolean):[],Y=[],X=(Q)=>{let F=oD(Q);if(!Y.includes(F))Y.push(F)};for(let Q of J){let F=oD($,Q);if(GD(F))X(R$(F))}X(oD($)),X(j0());for(let Q of Y)try{let F=`${D}/package.json`,{createRequire:W}=await import("node:module"),Z=W(OD(Q,"package.json")).resolve(F),z=JSON.parse(K0(Z,"utf-8"));if(z.version)return z.version}catch{}for(let Q of Y){let F=Q,W=N4.parse(F).root;while(F!==W){let K=OD(F,"node_modules",D,F6);if(GD(K))try{let z=JSON.parse(K0(K,"utf-8"));if(z.version)return z.version}catch{}let Z=R$(F);if(Z===F)break;F=Z}}if(D==="@capgo/capacitor-updater"){let Q=null,F=OD($,"ios","App","Podfile");if(GD(F))try{let K=K0(F,"utf-8").match(/pod\s+['"]CapgoCapacitorUpdater['"],\s*:path\s*=>\s*['"]([^'"]+)['"]/);if(K?.[1])Q=oD(OD($,"ios","App",K[1]))}catch{}if(!Q){let W=OD($,"android","capacitor.settings.gradle");if(GD(W))try{let Z=K0(W,"utf-8").match(/project\(':capgo-capacitor-updater'\)\.projectDir\s*=\s*new\s+File\(['"]([^'"]+)['"]/);if(Z?.[1])Q=oD(OD($,"android",Z[1])).replace(/\/android$/,"")}catch{}}if(Q){let W=OD(Q,F6);if(GD(W))try{let K=JSON.parse(K0(W,"utf-8"));if(K.version)return K.version}catch{}}}try{let Q=U?U.split(",").map((K)=>K.trim()).filter(Boolean).join(","):U,W=(await NY($,Q)).get(D);if(W)return W}catch{}return null}async function NY(D=M$(j0()),$=void 0){let U=$?.split(",").map((X)=>X.trim()).filter(Boolean);if(U??=[OD(D,F6)],U){for(let X of U)if(!GD(X)){let Q=`Package.json at ${X} does not exist`;throw n.error(Q),Error(Q)}}let J=new Map,{createRequire:Y}=await import("node:module");for(let X of U){let Q=K0(X),F=JSON.parse(Q),W=R$(X),K=(Z,z)=>{try{let I=Y(OD(W,"package.json")).resolve(`${Z}/package.json`),H=JSON.parse(K0(I,"utf-8"));if(H.version)return H.version}catch{}let q=W,G=N4.parse(q).root;while(q!==G){let V=OD(q,"node_modules",Z,F6);if(GD(V))try{let H=JSON.parse(K0(V,"utf-8"));if(H.version)return H.version}catch{}let I=R$(q);if(I===q)break;q=I}return e2D(z)};for(let Z in F.dependencies)J.set(Z,K(Z,F.dependencies[Z]));for(let Z in F.devDependencies)J.set(Z,K(Z,F.devDependencies[Z]))}return J}async function D9D(D=M$(j0()),$=void 0){let U=$?.split(",").map((Y)=>Y.trim()).filter(Boolean);if(U??=[OD(D,F6)],U){for(let Y of U)if(!GD(Y)){let X=`Package.json at ${Y} does not exist`;throw n.error(X),Error(X)}}let J=new Map;for(let Y of U){let X=K0(Y),Q=JSON.parse(X);for(let F in Q.dependencies??{})if(typeof Q.dependencies[F]==="string")J.set(F,Q.dependencies[F]);for(let F in Q.devDependencies??{})if(typeof Q.devDependencies[F]==="string")J.set(F,Q.devDependencies[F])}return J}function $9D(D){if(!D)return!1;if(D.config&&Object.keys(D.config).length>0)return!0;return!!D.path&&GD(D.path)}async function Lu(D,$=!1){let U=U9D;try{let J=await D();if(!$9D(J)){if(!$)n.error(U);throw new uD(U)}return J}catch(J){if(J instanceof uD)throw J;let Y=C0(J);if(!$)n.error(`${U}: ${Y}`);throw new uD(U,{cause:Y})}}function PF(D=!1){return Lu(hW,D)}function J9D(D=!1){return Lu(mW,D)}async function Y9D(D,$){let U=await J9D();if(U?.config)U.config.plugins??={},U.config.plugins.extConfig??={},U.config.plugins[D]??={},U.config.plugins[D]={...U.config.plugins[D],...$},await lW(D,U);return U}async function oLD(D){return Y9D("CapacitorUpdater",D)}async function r1(D=!1){try{let $=await PF(D),U={host:$?.config?.plugins?.CapacitorUpdater?.localHost||Fu,hostWeb:$?.config?.plugins?.CapacitorUpdater?.localWebHost||wY,hostFilesApi:$?.config?.plugins?.CapacitorUpdater?.localApiFiles||Wu,hostApi:$?.config?.plugins?.CapacitorUpdater?.localApi||BY};if($?.config?.plugins?.CapacitorUpdater?.localSupa&&$?.config?.plugins?.CapacitorUpdater?.localSupaAnon){if(!D)n.info("Using custom supabase instance from capacitor.config.json");U.supaKey=$?.config?.plugins?.CapacitorUpdater?.localSupaAnon,U.supaHost=$?.config?.plugins?.CapacitorUpdater?.localSupa}return U}catch{return{host:Fu,hostWeb:wY,hostFilesApi:Wu,hostApi:BY}}}function Zu(D){return typeof D==="object"&&D!==null}function X9D(D){if(!Zu(D))return!1;let $=D.capacitor;if(Zu($)&&($.ios!==void 0||$.android!==void 0))return!0;return!1}function Q9D(D){if(GD(OD(D,"plugin.xml")))return!0;let $=OD(D,F6);if(!GD($))return!1;try{return X9D(JSON.parse(K0($,"utf-8")))}catch{return!1}}async function r5(D=!1,$){let U=(Y)=>{let X={...Y};return UA(X,void 0,D),X};if(!$&&MH)return U(MH);if(!$&&VY)return VY.then(U);let J=(async()=>{let Y=await r1(D);try{let X=Au(),Q=await fetch(`${Y.hostApi}/private/config`,{...$?{signal:$}:{},headers:r6(X?{capgkey:X}:void 0)});if(!Q.ok)throw Error(`HTTP error! status: ${Q.status}`);let W={...await Q.json(),...Y};if(!$)MH=W;return{...W}}catch{if(!D)n.info(`Local config ${C0(Y)}`);return{...Y}}finally{if(!$)VY=null}})();if(!$)VY=J;return J.then(U)}async function aLD(){let D=await r1();try{let $=Au(),U=await fetch(`${D.hostFilesApi}/files/config`,{headers:r6($?{capgkey:$}: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:n2D,maxChunkSize:r2D,alertUploadSize:p2D}}}function L2(D){let $=new URL(D);if(!["http:","https:"].includes($.protocol))throw Error("Invalid Supabase host protocol");if($.username||$.password)throw Error("Supabase host must not include credentials");if($.search||$.hash)throw Error("Supabase host must not include query parameters or fragments");let U=$1($.pathname);return`${$.origin}${U}`}function F9D(D){if(!D||typeof D!=="object")return"";let $=D;return[$.error,$.message,$.status].filter(Boolean).join(" | ")}function zu(D,$){let U=D.indexOf($);if(U<0)return D;return D.slice(U+$.length).replace(/^:\s*/,"").split(`
253
- `)[0].trim()}async function tLD(D){let $=await Mu(D);if($?.error==="channel_zip_required"||$?.error==="channel_delta_required")return $.message||$.error;let U=D instanceof Error?D.message:String(D??"");if(U.includes("CHANNEL_ZIP_REQUIRED"))return zu(U,"CHANNEL_ZIP_REQUIRED");if(U.includes("CHANNEL_DELTA_REQUIRED"))return zu(U,"CHANNEL_DELTA_REQUIRED");return null}function n5(D){if(!D)return!1;try{let $=new URL(L2(D)).hostname.toLowerCase();return $==="sb.capgo.app"||$==="xvwzpoazmxkqosrdewyv.supabase.co"||$==="ibwjdnhknbkcqfbabwei.supabase.co"||$==="aucsybvnhavogdmzwtcw.supabase.co"}catch{return!1}}function W9D(D){if(D.supaHost&&D.supaKey&&D.hostApi===BY&&!n5(D.supaHost))return`${L2(D.supaHost)}/functions/v1`;return D.hostApi}function sLD(D){let $=D?.context;return typeof $?.status==="number"?$.status:void 0}async function Mu(D){let $=D?.context;if(!$||typeof $.clone!=="function")return null;try{let U=await $.clone().text();try{return JSON.parse(U)}catch{return U?{message:U}:null}}catch{return null}}async function eLD(D){let $=await Mu(D);if($){let U=F9D($);if(U)return U}return C0(D)}async function LY(D,$){let U=($.method??"POST").toUpperCase(),J,Y=$.supaAnon;if($.supaHost&&$.supaAnon&&!n5($.supaHost))J=`${L2($.supaHost)}/functions/v1`;else{let F=await r5(!0);if(Y=$.supaAnon??F.supaKey,F.supaHost&&F.supaKey&&F.hostApi===BY&&!n5(F.supaHost)&&!($.supaHost&&n5($.supaHost)))J=`${L2(F.supaHost)}/functions/v1`;else if($.useFilesHost)J=F.hostFilesApi;else J=F.hostApi}let X=J.includes("/functions/v1"),Q=`${$1(J)}/${D.replace(/^\//,"")}`;try{let F=await fetch(Q,{method:U,headers:r6({"Content-Type":"application/json",Authorization:X&&Y?`Bearer ${Y}`:$.apikey,capgkey:$.apikey}),body:U==="GET"||U==="HEAD"?void 0:typeof $.body==="string"?$.body:JSON.stringify($.body??{}),signal:$.signal});if(!F.ok)return{data:null,error:new v6.FunctionsHttpError(F)};return{data:(F.headers.get("content-type")??"").includes("application/json")?await F.json().catch(()=>null):await F.text().catch(()=>null),error:null}}catch(F){return{data:null,error:F instanceof Error?F:Error(String(F))}}}async function DRD(D,$=!0){if(D?.supaHost&&D?.supaAnon){if(n5(D.supaHost))return(await r1($)).hostApi;return`${L2(D.supaHost)}/functions/v1`}let U=await r1($);if(U.supaHost&&U.supaKey)return W9D(U);return(await r5($)).hostApi}async function $RD(D,$,U,J=!1,Y=!0,X){let Q=await r5(J,X);if($&&U){if(!J)n.info("Using custom supabase instance from provided options");Q.supaHost=$,Q.supaKey=U}if(!Q.supaHost||!Q.supaKey)throw n.error(Ku),new uD(Ku,{missingSupaHost:!Q.supaHost,missingSupaKey:!Q.supaKey});let F=L2(Q.supaHost);return eO(F,Q.supaKey,{auth:{persistSession:!1},global:{headers:{capgkey:MX("capgkey",D)},...sM()&&Y?{fetch:DA()}:{}}})}async function K9D(D,$){let{data:U}=await D.rpc("is_paying_org",{orgid:$}).single();return U||!1}async function Z9D(D,$){let{data:U}=await D.rpc("is_trial_org",{orgid:$}).single();return U||0}async function z9D(D,$,U){let{data:J}=await D.rpc("has_usage_credits_org",U?{orgid:$,appid:U}:{orgid:$}).single();return J||!1}function q9D(D){let{trialDays:$,isPaying:U,hasCredits:J,warning:Y=!0}=D;return!!Y&&$>0&&!U&&!J}async function G9D(D,$){let{data:U,error:J}=await D.rpc("is_allowed_action_org",{orgid:$}).single();if(J)throw Error(`Cannot validate plan: ${C0(J)}`);return U===!0}async function AH(D,$,U,J){let{data:Y,error:X}=J?await D.rpc("is_allowed_action_org_action",{orgid:$,actions:U,appid:J}):await D.rpc("is_allowed_action_org_action",{orgid:$,actions:U});if(X){if(J&&X.code==="PGRST202")return G9D(D,$);throw Error(`Cannot validate plan: ${C0(X)}`)}return Y===!0}async function V9D(D,$,U,J){if(J){if(await AH(D,$,U,J))return"allowed";if(await AH(D,$,U))return"permission_denied";return"billing_denied"}return await AH(D,$,U)?"allowed":"billing_denied"}async function H9D(D,$){throw n.error(`You need to upgrade your plan to continue to use capgo.
253
+ `)[0].trim()}async function tLD(D){let $=await Mu(D);if($?.error==="channel_zip_required"||$?.error==="channel_delta_required")return $.message||$.error;let U=D instanceof Error?D.message:String(D??"");if(U.includes("CHANNEL_ZIP_REQUIRED"))return zu(U,"CHANNEL_ZIP_REQUIRED");if(U.includes("CHANNEL_DELTA_REQUIRED"))return zu(U,"CHANNEL_DELTA_REQUIRED");return null}function n5(D){if(!D)return!1;try{let $=new URL(L2(D)).hostname.toLowerCase();return $==="sb.capgo.app"||$==="xvwzpoazmxkqosrdewyv.supabase.co"||$==="ibwjdnhknbkcqfbabwei.supabase.co"||$==="aucsybvnhavogdmzwtcw.supabase.co"}catch{return!1}}function W9D(D){if(D.supaHost&&D.supaKey&&D.hostApi===BY&&!n5(D.supaHost))return`${L2(D.supaHost)}/functions/v1`;return D.hostApi}function sLD(D){let $=D?.context;return typeof $?.status==="number"?$.status:void 0}async function Mu(D){let $=D?.context;if(!$||typeof $.clone!=="function")return null;try{let U=await $.clone().text();try{return JSON.parse(U)}catch{return U?{message:U}:null}}catch{return null}}async function eLD(D){let $=await Mu(D);if($){let U=F9D($);if(U)return U}return C0(D)}async function LY(D,$){let U=($.method??"POST").toUpperCase(),J,Y=$.supaAnon;if($.supaHost&&$.supaAnon&&!n5($.supaHost))J=`${L2($.supaHost)}/functions/v1`;else{let F=await r5(!0);if(Y=$.supaAnon??F.supaKey,F.supaHost&&F.supaKey&&F.hostApi===BY&&!n5(F.supaHost)&&!($.supaHost&&n5($.supaHost)))J=`${L2(F.supaHost)}/functions/v1`;else if($.useFilesHost)J=F.hostFilesApi;else J=F.hostApi}let X=J.includes("/functions/v1"),Q=`${$1(J)}/${D.replace(/^\//,"")}`;try{let F=await fetch(Q,{method:U,headers:r6({"Content-Type":"application/json",Authorization:X&&Y?`Bearer ${Y}`:$.apikey,capgkey:$.apikey}),body:U==="GET"||U==="HEAD"?void 0:typeof $.body==="string"?$.body:JSON.stringify($.body??{}),signal:$.signal});if(!F.ok)return{data:null,error:new v6.FunctionsHttpError(F)};return{data:(F.headers.get("content-type")??"").includes("application/json")?await F.json().catch(()=>null):await F.text().catch(()=>null),error:null}}catch(F){return{data:null,error:F instanceof Error?F:Error(String(F))}}}async function DRD(D,$=!0){if(D?.supaHost&&D?.supaAnon){if(n5(D.supaHost))return(await r1($)).hostApi;return`${L2(D.supaHost)}/functions/v1`}let U=await r1($);if(U.supaHost&&U.supaKey)return W9D(U);return(await r5($)).hostApi}async function $RD(D,$,U,J=!1,Y=!0,X){let Q=await r5(J,X);if($&&U){if(!J)n.info("Using custom supabase instance from provided options");Q.supaHost=$,Q.supaKey=U}if(!Q.supaHost||!Q.supaKey){if(!J)n.error(Ku);throw new uD(Ku,{missingSupaHost:!Q.supaHost,missingSupaKey:!Q.supaKey})}let F=L2(Q.supaHost);return eO(F,Q.supaKey,{auth:{persistSession:!1},global:{headers:{capgkey:MX("capgkey",D)},...sM()&&Y?{fetch:DA()}:{}}})}async function K9D(D,$){let{data:U}=await D.rpc("is_paying_org",{orgid:$}).single();return U||!1}async function Z9D(D,$){let{data:U}=await D.rpc("is_trial_org",{orgid:$}).single();return U||0}async function z9D(D,$,U){let{data:J}=await D.rpc("has_usage_credits_org",U?{orgid:$,appid:U}:{orgid:$}).single();return J||!1}function q9D(D){let{trialDays:$,isPaying:U,hasCredits:J,warning:Y=!0}=D;return!!Y&&$>0&&!U&&!J}async function G9D(D,$){let{data:U,error:J}=await D.rpc("is_allowed_action_org",{orgid:$}).single();if(J)throw Error(`Cannot validate plan: ${C0(J)}`);return U===!0}async function AH(D,$,U,J){let{data:Y,error:X}=J?await D.rpc("is_allowed_action_org_action",{orgid:$,actions:U,appid:J}):await D.rpc("is_allowed_action_org_action",{orgid:$,actions:U});if(X){if(J&&X.code==="PGRST202")return G9D(D,$);throw Error(`Cannot validate plan: ${C0(X)}`)}return Y===!0}async function V9D(D,$,U,J){if(J){if(await AH(D,$,U,J))return"allowed";if(await AH(D,$,U))return"permission_denied";return"billing_denied"}return await AH(D,$,U)?"allowed":"billing_denied"}async function H9D(D,$){throw n.error(`You need to upgrade your plan to continue to use capgo.
254
254
  Upgrade here: ${D}
255
255
  `),await s2D(D),new uD($)}async function I9D(){throw n.error("Cannot validate plan usage for this app. The API key may lack permission to read app billing details."),new uD("Plan validation permission denied")}async function URD(D,$,U){let{data:J,error:Y}=await D.rpc("get_organization_cli_warnings",{orgid:$,cli_version:U});if(Y){n.error(`Cannot get cli warnings: ${C0(Y)}`);return}if(J.length>0){n.warn(`Found ${J.length} cli warnings for your organization.`);let X=null;for(let Q of J){if(typeof Q!=="object"||typeof Q.message!=="string"||typeof Q.fatal!=="boolean"){n.error(`Invalid cli warning: ${Q}`);continue}let F=Q;if(F.fatal)n.error(`${F.message.replaceAll("\\n",`
256
256
  `)}`),X=Error(F.message);else n.warn(`${F.message.replaceAll("\\n",`