@capgo/cli 8.65.0 → 8.66.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +359 -359
- package/dist/notify-app-ready-worker.js +3 -3
- package/dist/onboarding-worker.js +3 -3
- package/dist/package.json +1 -1
- package/dist/src/analytics/org-resolver.d.ts +3 -1
- package/dist/src/build/onboarding/telemetry.d.ts +1 -1
- package/dist/src/sdk.js +4 -4
- package/dist/updater-installed-worker.js +3 -3
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as um}from"node:module";var Tm=Object.create;var{getPrototypeOf:Pm,defineProperty:b9,getOwnPropertyNames:bV,getOwnPropertyDescriptor:bm}=Object,SV=Object.prototype.hasOwnProperty;function CV(D){return this[D]}var Sm,Cm,w$=(D,$,J)=>{var X=D!=null&&typeof D==="object";if(X){var Y=$?Sm??=new WeakMap:Cm??=new WeakMap,Q=Y.get(D);if(Q)return Q}J=D!=null?Tm(Pm(D)):{};let U=$||!D||!D.__esModule?b9(J,"default",{value:D,enumerable:!0}):J;for(let F of bV(D))if(!SV.call(U,F))b9(U,F,{get:CV.bind(D,F),enumerable:!0});if(X)Y.set(D,U);return U},a6=(D)=>{var $=(PV??=new WeakMap).get(D),J;if($)return $;if($=b9({},"__esModule",{value:!0}),D&&typeof D==="object"||typeof D==="function"){for(var X of bV(D))if(!SV.call($,X))b9($,X,{get:CV.bind(D,X),enumerable:!(J=bm(D,X))||J.enumerable})}return PV.set(D,$),$},PV,S=(D,$)=>()=>($||D(($={exports:{}}).exports,$),$.exports);var km=(D)=>D;function _m(D,$){this[D]=km.bind(null,$)}var y0=(D,$)=>{for(var J in $)b9(D,J,{get:$[J],enumerable:!0,configurable:!0,set:_m.bind($,J)})};var k=(D,$)=>()=>(D&&($=D(D=0)),$);var XD=um(import.meta.url);var r$;var H8=k(()=>{r$={name:"@capgo/cli",type:"module",version:"8.65.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 && bun test/test-android-select-guard.mjs","test:android-keystore-action":"bun test/test-android-keystore-action.mjs","test:android-google-play-action":"bun test/test-android-google-play-action.mjs","test:onboarding-telemetry":"bun test/test-onboarding-telemetry.mjs","test:v2-event-migration":"bun test/test-v2-event-migration.mjs","test:analytics":"bun test/test-analytics.mjs","test:cli-headers":"bun test/test-cli-headers.mjs","test:min-cli-version":"bun test/test-min-cli-version.mjs","test:authenticated-command-invocation":"bun test/test-authenticated-command-invocation.mjs","test:analytics-error-category":"bun test/test-analytics-error-category.mjs","test:analytics-org-resolver":"bun test/test-analytics-org-resolver.mjs","test:supabase-perf":"bun test/test-supabase-perf.mjs","test:preview-qr":"bun test/test-preview-qr.mjs","test:bundle-pages":"bun test test/test-bundle-pages.test.ts","test:mcp-analytics":"bun test/test-mcp-analytics.mjs","test:mcp-instructions":"bun test/test-mcp-instructions.mjs","test:mcp-stdout-guard":"bun test/test-mcp-stdout-guard.mjs","test:mcp-platform-select":"bun test/test-mcp-platform-select.mjs","test:mcp-explain-scopes":"bun test/test-mcp-explain-scopes.mjs","test:mcp-oauth-reopen":"bun test/test-mcp-oauth-reopen.mjs","test:mcp-broker-oauth":"bun test/test-mcp-broker-oauth.mjs","test:mcp-broker-session":"bun test/test-mcp-broker-session.mjs","test:mcp-credentials-manage":"bun test/test-mcp-credentials-manage.mjs","test:mcp-resume-prompt":"bun test/test-mcp-resume-prompt.mjs","test:mcp-build-job":"bun test/test-mcp-build-job.mjs","test:mcp-build-tools":"bun test/test-mcp-build-tools.mjs","test:app-created-source":"bun test/test-app-created-source.mjs","test:app-add-exists":"bun test/test-app-add-exists.mjs","test:app-add-getting-started":"bun test/test-app-add-getting-started.mjs","test:app-list-output-text":"bun test/test-app-list-output-text.mjs","test:app-todo":"bun test/test-app-todo.mjs","test:doctor-analytics":"bun test/test-doctor-analytics.mjs","test:posthog-exception":"bun test/test-posthog-exception.mjs","test:cli-recovery":"bun test/test-cli-recovery.mjs","test:create-supabase-client":"bun test/test-create-supabase-client.mjs","test:onboarding-recovery":"bun test/test-onboarding-recovery.mjs","test:onboarding-progress":"bun test/test-onboarding-progress.mjs","test:onboarding-run-targets":"bun test/test-onboarding-run-targets.mjs","test:run-device-command":"bun test/test-run-device-command.mjs","test:init-app-conflict":"bun test/test-init-app-conflict.mjs","test:channel-add-exists":"bun test/test-channel-add-exists.mjs","test:wait-log":"bun test/test-wait-log.mjs","test:init-guardrails":"bun test/test-init-guardrails.mjs","test:init-upload-recovery":"bun test/test-init-upload-error-gate.mjs && bun test/test-init-upload-monorepo-recovery.mjs","test:init-replay":"bun test/test-init-replay.mjs","test:init-telemetry":"bun test/test-init-telemetry.mjs","test:capacitor-config-target":"bun test/test-capacitor-config-target.mjs","test:builder-app-id-config":"bun test/test-builder-app-id-config.mjs","test:capacitor-config-typescript7":"bun test/test-capacitor-config-typescript7.mjs","test:capacitor-config-native-import":"bun test/test-capacitor-config-native-import.mjs","test:cli-user-error-config":"bun test/test-cli-user-error-config.mjs","test:cordova-upload-mode":"bun test/test-cordova-upload-mode.mjs","test:init-monorepo-targeting":"bun run test:capacitor-config-target && bun run test:builder-app-id-config && bun run test:capacitor-config-typescript7 && bun run test:capacitor-config-native-import && bun run test:cli-user-error-config && bun test/test-init-monorepo-targeting.mjs","test:prompt-preferences":"bun test/test-prompt-preferences.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:auth-session":"bun test/test-auth-session.mjs","test:mcp":"node test/test-mcp.mjs","test:mcp-no-key-handshake":"node test/test-mcp-no-key-handshake.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs","test:project-type-detection":"bun test/test-project-type-detection.mjs","test:payload-split":"bun test/test-payload-split.mjs","test:macos-signing":"bun test/test-macos-signing.mjs","test:helper-dce":"bash scripts/check-helper-dce.sh","test:apple-api-import-helpers":"bun test/test-apple-api-import-helpers.mjs","test:apple-api-verify-key":"bun test/test-apple-api-verify-key.mjs","test:bundle-id-detector":"bun test/test-bundle-id-detector.mjs","test:apple-api-app-list":"bun test/test-apple-api-app-list.mjs","test:apple-api-cert-create":"bun test/test-apple-api-cert-create.mjs","test:app-verification":"bun test/test-app-verification.mjs","test:pbxproj-parser":"bun test/test-pbxproj-parser.mjs","test: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-certificate-action":"bun test/test-ios-certificate-action.mjs","test:ios-credential-action":"bun test/test-ios-credential-action.mjs","test:ios-e2e":"bun test/test-ios-e2e.mjs","test:ios-flow-contract":"bun test/test-ios-flow-contract.mjs","test:ios-import-discovery":"bun test/test-ios-import-discovery.mjs","test:ios-import-export":"bun test/test-ios-import-export.mjs","test:ios-import-pickers":"bun test/test-ios-import-pickers.mjs","test:ios-import-recovery":"bun test/test-ios-import-recovery.mjs","test:ios-recovery":"bun test/test-ios-recovery.mjs","test:ios-resume":"bun test/test-ios-resume.mjs","test:ios-tail-handoff":"bun test/test-ios-tail-handoff.mjs","test:ios-tui-render":"bun test/test-ios-tui-render.mjs","test:p8-error":"bun test/test-p8-error.mjs","test:ios-tui-routing":"bun test/test-ios-tui-routing.mjs","test:ios-updater-sync-validation":"bun test/test-ios-updater-sync-validation.mjs","test:ios-verify-app":"bun test/test-ios-verify-app.mjs","test:ios-marketing-version":"bun test/test-ios-marketing-version.mjs","test:android-version":"bun test/test-android-version.mjs","test:platform-flow-contract":"bun test/test-platform-flow-contract.mjs","test:tail-engine-shared":"bun test/test-tail-engine-shared.mjs",test:"bun run build && bun 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:android-keystore-action && bun run test:android-google-play-action && bun run test:onboarding-telemetry && bun run test:v2-event-migration && bun run test:analytics && bun run test:cli-headers && bun run test:min-cli-version && bun run test:authenticated-command-invocation && bun run test:analytics-error-category && bun run test:analytics-org-resolver && bun run test:supabase-perf && bun run test:preview-qr && bun run test:bundle-pages && bun run test:app-set-options && bun run test:mcp-analytics && bun run test:mcp-instructions && bun run test:mcp-live-update-onboarding && bun run test:mcp-stdout-guard && bun run test:mcp-platform-select && bun run test:mcp-explain-scopes && bun run test:mcp-oauth-reopen && bun run test:mcp-broker-oauth && bun run test:mcp-broker-session && bun run test:mcp-credentials-manage && bun run test:mcp-resume-prompt && bun run test:mcp-build-job && bun run test:mcp-build-tools && bun run test:app-created-source && bun run test:app-add-exists && bun run test:app-add-getting-started && bun run test:app-list-output-text && bun run test:app-todo && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:cli-recovery && bun run test:create-supabase-client && bun run test:build-platform-selection && bun run test:builder-project-discovery && bun run test:builder-app-selection && bun run test:builder-login-gate && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-monorepo-targeting && bun run test:init-app-conflict && bun run test:channel-list && bun run test:channel-add-exists && bun run test:wait-log && bun run test:init-guardrails && bun run test:init-upload-recovery && bun run test:init-replay && bun run test:init-telemetry && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:mcp-no-key-handshake && bun run test:auth-session && bun run test:version-detection && bun run test:platform-paths && bun run test:project-type-detection && bun run test:payload-split && bun run test: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-certificate-action && bun run test:ios-credential-action && bun run test:ios-e2e && bun run test:ios-flow-contract && bun run test:ios-import-discovery && bun run test:ios-import-export && bun run test:ios-import-pickers && bun run test:ios-import-recovery && bun run test:ios-recovery && bun run test:ios-resume && bun run test:ios-tail-handoff && bun run test:ios-tui-render && bun run test:p8-error && bun run test:ios-tui-routing && bun run test:ios-updater-sync-validation && bun run test:ios-verify-app && bun run test:ios-marketing-version && bun run test:android-version && bun run test:platform-flow-contract && bun run test:tail-engine-shared && bun run test:prescan && bun run test:android-reporting-api && bun run test:android-gcp && bun run test:android-app-verification && bun run test:android-rename && bun run test:appflow-auth && bun run test:appflow-api-map && bun run test:appflow-validate && bun run test:appflow-flow && bun run test:appflow-gapfill && bun run test:appflow-engine && bun run test:appflow-tail && bun run test:appflow-fetch && bun run test:appflow-sa-decode && bun run test:app-permission-helper && bun run test:2fa-compliance-network && bun run test:organization-set-api-host && bun run test:trial-warning && bun run test:plan-validation","test:build-platform-selection":"bun test/test-build-platform-selection.mjs","test:builder-project-discovery":"bun test/test-builder-project-discovery.mjs","test:builder-app-selection":"bun test/test-builder-app-selection.mjs","test:builder-login-gate":"bun test/test-builder-login-gate.mjs","test:ai-log-capture":"bun test/test-ai-log-capture.mjs","test:ai-analyze-flow":"bun test/test-ai-analyze-flow.mjs","test:cicd-failure-help":"bun test/test-cicd-failure-help.mjs","test:ai-analyze-stream":"bun test/test-ai-analyze-stream.mjs","test:ai-sse-parser":"bun test/test-ai-sse-parser.mjs","test:ai-render-markdown":"bun test/test-ai-render-markdown.mjs","test:ai-onboarding-mode":"bun test/test-ai-onboarding-mode.mjs","test:ai-fit":"bun test/test-ai-fit.mjs","test:platform-layout":"bun test/test-platform-layout.mjs","test:frame-fit":"bun test/run-frame-fit.mjs","test:onboarding-min-size":"bun test/test-onboarding-min-size.mjs","test:min-size-gate":"bun test/test-min-size-gate.mjs","test:shell-size-gate":"bun test/test-shell-size-gate.mjs","test:build-log-sanitize":"bun test/test-build-log-sanitize.mjs","test:build-output-viewport":"bun test/test-build-output-viewport.mjs","test:diff-viewer-viewport":"bun test/test-diff-viewer-viewport.mjs","test:build-complete-exit":"bun test/test-build-complete-exit.mjs","test:ai-stream-markdown":"bun test/test-ai-stream-markdown.mjs","test:support-mailto":"bun test/test-support-mailto.mjs","test:support-redact":"bun test/test-support-redact.mjs","test:support-internal-log":"bun test/test-support-internal-log.mjs","test:support-help-menu":"bun test/test-support-help-menu.mjs","test:support-contact":"bun test/test-support-contact.mjs","test:support-upload-prompt":"bun test/test-support-upload-prompt.mjs","test:support-bundle-files":"bun test/test-support-bundle-files.mjs","test:mcp-live-update-onboarding":"bun test/test-mcp-live-update-onboarding.mjs","test:app-set-options":"bun test/test-app-set-options.mjs && bun test/test-app-list-options.mjs","test:android-reporting-api":"bun test/test-android-reporting-api.mjs","test:android-gcp":"bun test/test-android-gcp.mjs","test:android-app-verification":"bun test/test-android-app-verification.mjs","test:android-rename":"bun test/test-android-rename.mjs","test:appflow-auth":"bun test/test-appflow-auth.mjs","test:appflow-api-map":"bun test/test-appflow-api-map.mjs","test:appflow-validate":"bun test/test-appflow-validate.mjs","test:appflow-flow":"bun test/test-appflow-flow.mjs","test:appflow-gapfill":"bun test/test-appflow-gapfill.mjs","test:appflow-engine":"bun test/test-appflow-engine.mjs","test:appflow-tail":"bun test/test-appflow-tail.mjs","test:appflow-fetch":"bun test/test-appflow-fetch.mjs","test:appflow-sa-decode":"bun test/test-appflow-sa-decode.mjs","test:app-permission-helper":"bun test/test-app-permission-helper.mjs","test:2fa-compliance-network":"bun test/test-2fa-compliance-network.mjs","test:organization-set-api-host":"bun test/test-organization-set-api-host.mjs","test:trial-warning":"bun test/test-trial-warning.mjs","test:plan-validation":"bun test/test-plan-validation.mjs","test:auto-bump-version":"bun test/test-auto-bump-version.mjs","test:auto-bump-ai-diff":"bun test/test-auto-bump-ai-diff.mjs","test:ios-provisioning-map":"bun test/test-ios-provisioning-map.mjs","test:ios-provisioning-command":"bun test/test-ios-provisioning-command.mjs","test:channel-list":"bun test/test-channel-list.mjs"},dependencies:{"@inkjs/ui":"^2.0.0","@manypkg/tools":"^2.1.2","@rrweb/types":"^2.1.1","@standard-schema/spec":"^1.1.0","@xmldom/xmldom":"^0.9.10","@xterm/addon-serialize":"^0.14.0","@xterm/headless":"^6.0.0","agent-cli-detector":"^0.1.6","happy-dom":"^20.11.0",ink:"^7.1.1","ink-spinner":"^5.0.0",jsonwebtoken:"^9.0.3","node-forge":"^1.4.0",qrcode:"^1.5.4",react:"^19.2.8","rrweb-snapshot":"^2.1.1","string-width":"^8.2.2",typescript:"6.0.3",zod:"^4.5.4"},optionalDependencies:{"@capgo/cli-helper-darwin-arm64":"^1.1.1","@capgo/cli-helper-darwin-x64":"^1.1.1","node-pty":"^1.1.0"},devDependencies:{"@antfu/eslint-config":"^9.2.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.6","@capacitor/cli":"^8.4.2","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.7.0","@modelcontextprotocol/client":"^2.0.0-beta.5","@modelcontextprotocol/server":"^2.0.0-beta.5","@sauber/table":"npm:@jsr/sauber__table","@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 xD;var c1=k(()=>{xD=class xD extends Error{context;constructor(D,$){super(D);this.name="CliUserError",this.context=$}}});import{platform as xm}from"node:os";import{version as fm}from"node:process";function uV(D){_V=D}function hm(D){for(let $=0;$<D.length;$++)if(D.charCodeAt($)>255)return!1;return!0}function kV(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 mm(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 tU(D,$){if($===void 0||$===null){if(rU.has(D.toLowerCase()))throw new xD(kV(D));throw new xD(`HTTP header "${D}" is missing or invalid.`)}if(typeof $!=="string"){if(rU.has(D.toLowerCase()))throw new xD(kV(D));throw new xD(`HTTP header "${D}" is missing or invalid.`)}if(!hm($)){if(rU.has(D.toLowerCase()))throw new xD(mm(D));throw new xD(`HTTP header "${D}" contains invalid characters (only ASCII is allowed).`)}return $}function K6(D){let $={capgo_api:ym,"x-cli-version":r$.version,"x-cli-command":_V,"x-cli-node":fm,"x-cli-os":xm()};if(D)for(let[J,X]of Object.entries(D))$[J]=tU(J,X);return $}var ym="2025-10-01",_V="",rU;var T3=k(()=>{H8();c1();rU=new Set(["authorization","capgkey","x-capgo-log-token"])});import{existsSync as q$}from"fs";var S9=(D=".",$="unknown")=>{let J=`${D}/bun.lockb`,X=`${D}/bun.lock`,Y=`${D}/pnpm-lock.yaml`,Q=`${D}/shrinkwrap.yaml`,U=`${D}/yarn.lock`,F=`${D}/package-lock.json`,W=`${D}/npm-shrinkwrap.json`;if(q$(J)||q$(X))return"bun";if(q$(Y)||q$(Q))return"pnpm";if(q$(U))return"yarn";if(q$(F)||q$(W))return"npm";return $},P3=(D=S9(),$=!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"}},gV=(D=".",$="npx")=>{let J=`${D}/bun.lockb`,X=`${D}/bun.lock`,Y=`${D}/pnpm-lock.yaml`,Q=`${D}/shrinkwrap.yaml`,U=`${D}/yarn.lock`,F=`${D}/package-lock.json`,W=`${D}/npm-shrinkwrap.json`;if(q$(J)||q$(X))return"bunx";if(q$(Y)||q$(Q))return"pnpm exec";if(q$(U))return"yarn dlx";if(q$(F)||q$(W))return"npx";return $};var xV=()=>{};var fV,yV=(D)=>{return D===12288||D>=65281&&D<=65376||D>=65504&&D<=65510},hV=(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 mV=k(()=>{fV=(()=>{let D=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return($)=>{let J=0;D.lastIndex=0;while(D.test($))J+=1;return $.length-J}})()});var lm,dm,lV,im,dV,cm,pm,nm,iV=(D,$={},J={})=>{let X=$.limit??1/0,Y=$.ellipsis??"",Q=$?.ellipsisWidth??(Y?iV(Y,nm,J).width:0),U=0,F=J.controlWidth??0,W=J.tabWidth??8,K=J.emojiWidth??2,q=2,G=J.regularWidth??1,Z=J.wideWidth??2,H=[[cm,G],[lm,0],[dm,F],[im,W],[dV,K],[lV,Z]],z=0,I=0,B=D.length,N=0,V=!1,O=B,L=Math.max(0,X-Q),v=0,A=0,C=0,u=0;D:while(!0){if(A>v||I>=B&&I>z){let _=D.slice(v,A)||D.slice(z,I);N=0;for(let y of _.replaceAll(pm,"")){let T=y.codePointAt(0)||0;if(yV(T))u=2;else if(hV(T))u=Z;else u=G;if(C+u>L)O=Math.min(O,Math.max(v,z)+N);if(C+u>X){V=!0;break D}N+=y.length,C+=u}v=A=0}if(I>=B)break D;for(let _=0,y=H.length;_<y;_++){let[T,d]=H[_];if(T.lastIndex=I,T.test(D)){if(N=T===lV?fV(D.slice(I,T.lastIndex)):T===dV?1:T.lastIndex-I,u=N*d,C+u>L)O=Math.min(O,I+Math.floor((L-C)/d));if(C+u>X){V=!0;break D}C+=u,v=z,A=I,I=z=T.lastIndex;continue D}}I+=1}return{width:V?L:C,index:V?O:B,truncated:V,ellipsed:V&&X>=Q}},cV;var pV=k(()=>{mV();lm=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,dm=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,lV=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,im=/\t{1,1000}/y,dV=/[\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,cm=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,pm=/\p{M}+/gu,nm={limit:1/0,ellipsis:""},cV=iV});var rm,tm=(D,$={})=>{return cV(D,rm,$).width},q6;var oU=k(()=>{pV();rm={limit:1/0,ellipsis:"",ellipsisWidth:0},q6=tm});function s6(D,$,J){return String(D).normalize().split(Dl).map((X)=>em(X,$,J)).join(`
|
|
1
|
+
import{createRequire as um}from"node:module";var Tm=Object.create;var{getPrototypeOf:Pm,defineProperty:b9,getOwnPropertyNames:bV,getOwnPropertyDescriptor:bm}=Object,SV=Object.prototype.hasOwnProperty;function CV(D){return this[D]}var Sm,Cm,w$=(D,$,J)=>{var X=D!=null&&typeof D==="object";if(X){var Y=$?Sm??=new WeakMap:Cm??=new WeakMap,Q=Y.get(D);if(Q)return Q}J=D!=null?Tm(Pm(D)):{};let U=$||!D||!D.__esModule?b9(J,"default",{value:D,enumerable:!0}):J;for(let F of bV(D))if(!SV.call(U,F))b9(U,F,{get:CV.bind(D,F),enumerable:!0});if(X)Y.set(D,U);return U},a6=(D)=>{var $=(PV??=new WeakMap).get(D),J;if($)return $;if($=b9({},"__esModule",{value:!0}),D&&typeof D==="object"||typeof D==="function"){for(var X of bV(D))if(!SV.call($,X))b9($,X,{get:CV.bind(D,X),enumerable:!(J=bm(D,X))||J.enumerable})}return PV.set(D,$),$},PV,S=(D,$)=>()=>($||D(($={exports:{}}).exports,$),$.exports);var km=(D)=>D;function _m(D,$){this[D]=km.bind(null,$)}var y0=(D,$)=>{for(var J in $)b9(D,J,{get:$[J],enumerable:!0,configurable:!0,set:_m.bind($,J)})};var k=(D,$)=>()=>(D&&($=D(D=0)),$);var XD=um(import.meta.url);var r$;var H8=k(()=>{r$={name:"@capgo/cli",type:"module",version:"8.66.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 && bun test/test-android-select-guard.mjs","test:android-keystore-action":"bun test/test-android-keystore-action.mjs","test:android-google-play-action":"bun test/test-android-google-play-action.mjs","test:onboarding-telemetry":"bun test/test-onboarding-telemetry.mjs","test:v2-event-migration":"bun test/test-v2-event-migration.mjs","test:analytics":"bun test/test-analytics.mjs","test:cli-headers":"bun test/test-cli-headers.mjs","test:min-cli-version":"bun test/test-min-cli-version.mjs","test:authenticated-command-invocation":"bun test/test-authenticated-command-invocation.mjs","test:analytics-error-category":"bun test/test-analytics-error-category.mjs","test:analytics-org-resolver":"bun test/test-analytics-org-resolver.mjs","test:supabase-perf":"bun test/test-supabase-perf.mjs","test:preview-qr":"bun test/test-preview-qr.mjs","test:bundle-pages":"bun test test/test-bundle-pages.test.ts","test:mcp-analytics":"bun test/test-mcp-analytics.mjs","test:mcp-instructions":"bun test/test-mcp-instructions.mjs","test:mcp-stdout-guard":"bun test/test-mcp-stdout-guard.mjs","test:mcp-platform-select":"bun test/test-mcp-platform-select.mjs","test:mcp-explain-scopes":"bun test/test-mcp-explain-scopes.mjs","test:mcp-oauth-reopen":"bun test/test-mcp-oauth-reopen.mjs","test:mcp-broker-oauth":"bun test/test-mcp-broker-oauth.mjs","test:mcp-broker-session":"bun test/test-mcp-broker-session.mjs","test:mcp-credentials-manage":"bun test/test-mcp-credentials-manage.mjs","test:mcp-resume-prompt":"bun test/test-mcp-resume-prompt.mjs","test:mcp-build-job":"bun test/test-mcp-build-job.mjs","test:mcp-build-tools":"bun test/test-mcp-build-tools.mjs","test:app-created-source":"bun test/test-app-created-source.mjs","test:app-add-exists":"bun test/test-app-add-exists.mjs","test:app-add-getting-started":"bun test/test-app-add-getting-started.mjs","test:app-list-output-text":"bun test/test-app-list-output-text.mjs","test:app-todo":"bun test/test-app-todo.mjs","test:doctor-analytics":"bun test/test-doctor-analytics.mjs","test:posthog-exception":"bun test/test-posthog-exception.mjs","test:cli-recovery":"bun test/test-cli-recovery.mjs","test:create-supabase-client":"bun test/test-create-supabase-client.mjs","test:onboarding-recovery":"bun test/test-onboarding-recovery.mjs","test:onboarding-progress":"bun test/test-onboarding-progress.mjs","test:onboarding-run-targets":"bun test/test-onboarding-run-targets.mjs","test:run-device-command":"bun test/test-run-device-command.mjs","test:init-app-conflict":"bun test/test-init-app-conflict.mjs","test:channel-add-exists":"bun test/test-channel-add-exists.mjs","test:wait-log":"bun test/test-wait-log.mjs","test:init-guardrails":"bun test/test-init-guardrails.mjs","test:init-upload-recovery":"bun test/test-init-upload-error-gate.mjs && bun test/test-init-upload-monorepo-recovery.mjs","test:init-replay":"bun test/test-init-replay.mjs","test:init-telemetry":"bun test/test-init-telemetry.mjs","test:capacitor-config-target":"bun test/test-capacitor-config-target.mjs","test:builder-app-id-config":"bun test/test-builder-app-id-config.mjs","test:capacitor-config-typescript7":"bun test/test-capacitor-config-typescript7.mjs","test:capacitor-config-native-import":"bun test/test-capacitor-config-native-import.mjs","test:cli-user-error-config":"bun test/test-cli-user-error-config.mjs","test:cordova-upload-mode":"bun test/test-cordova-upload-mode.mjs","test:init-monorepo-targeting":"bun run test:capacitor-config-target && bun run test:builder-app-id-config && bun run test:capacitor-config-typescript7 && bun run test:capacitor-config-native-import && bun run test:cli-user-error-config && bun test/test-init-monorepo-targeting.mjs","test:prompt-preferences":"bun test/test-prompt-preferences.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:auth-session":"bun test/test-auth-session.mjs","test:mcp":"node test/test-mcp.mjs","test:mcp-no-key-handshake":"node test/test-mcp-no-key-handshake.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs","test:project-type-detection":"bun test/test-project-type-detection.mjs","test:payload-split":"bun test/test-payload-split.mjs","test:macos-signing":"bun test/test-macos-signing.mjs","test:helper-dce":"bash scripts/check-helper-dce.sh","test:apple-api-import-helpers":"bun test/test-apple-api-import-helpers.mjs","test:apple-api-verify-key":"bun test/test-apple-api-verify-key.mjs","test:bundle-id-detector":"bun test/test-bundle-id-detector.mjs","test:apple-api-app-list":"bun test/test-apple-api-app-list.mjs","test:apple-api-cert-create":"bun test/test-apple-api-cert-create.mjs","test:app-verification":"bun test/test-app-verification.mjs","test:pbxproj-parser":"bun test/test-pbxproj-parser.mjs","test: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-certificate-action":"bun test/test-ios-certificate-action.mjs","test:ios-credential-action":"bun test/test-ios-credential-action.mjs","test:ios-e2e":"bun test/test-ios-e2e.mjs","test:ios-flow-contract":"bun test/test-ios-flow-contract.mjs","test:ios-import-discovery":"bun test/test-ios-import-discovery.mjs","test:ios-import-export":"bun test/test-ios-import-export.mjs","test:ios-import-pickers":"bun test/test-ios-import-pickers.mjs","test:ios-import-recovery":"bun test/test-ios-import-recovery.mjs","test:ios-recovery":"bun test/test-ios-recovery.mjs","test:ios-resume":"bun test/test-ios-resume.mjs","test:ios-tail-handoff":"bun test/test-ios-tail-handoff.mjs","test:ios-tui-render":"bun test/test-ios-tui-render.mjs","test:p8-error":"bun test/test-p8-error.mjs","test:ios-tui-routing":"bun test/test-ios-tui-routing.mjs","test:ios-updater-sync-validation":"bun test/test-ios-updater-sync-validation.mjs","test:ios-verify-app":"bun test/test-ios-verify-app.mjs","test:ios-marketing-version":"bun test/test-ios-marketing-version.mjs","test:android-version":"bun test/test-android-version.mjs","test:platform-flow-contract":"bun test/test-platform-flow-contract.mjs","test:tail-engine-shared":"bun test/test-tail-engine-shared.mjs",test:"bun run build && bun 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:android-keystore-action && bun run test:android-google-play-action && bun run test:onboarding-telemetry && bun run test:v2-event-migration && bun run test:analytics && bun run test:cli-headers && bun run test:min-cli-version && bun run test:authenticated-command-invocation && bun run test:analytics-error-category && bun run test:analytics-org-resolver && bun run test:supabase-perf && bun run test:preview-qr && bun run test:bundle-pages && bun run test:app-set-options && bun run test:mcp-analytics && bun run test:mcp-instructions && bun run test:mcp-live-update-onboarding && bun run test:mcp-stdout-guard && bun run test:mcp-platform-select && bun run test:mcp-explain-scopes && bun run test:mcp-oauth-reopen && bun run test:mcp-broker-oauth && bun run test:mcp-broker-session && bun run test:mcp-credentials-manage && bun run test:mcp-resume-prompt && bun run test:mcp-build-job && bun run test:mcp-build-tools && bun run test:app-created-source && bun run test:app-add-exists && bun run test:app-add-getting-started && bun run test:app-list-output-text && bun run test:app-todo && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:cli-recovery && bun run test:create-supabase-client && bun run test:build-platform-selection && bun run test:builder-project-discovery && bun run test:builder-app-selection && bun run test:builder-login-gate && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-monorepo-targeting && bun run test:init-app-conflict && bun run test:channel-list && bun run test:channel-add-exists && bun run test:wait-log && bun run test:init-guardrails && bun run test:init-upload-recovery && bun run test:init-replay && bun run test:init-telemetry && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:mcp-no-key-handshake && bun run test:auth-session && bun run test:version-detection && bun run test:platform-paths && bun run test:project-type-detection && bun run test:payload-split && bun run test: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-certificate-action && bun run test:ios-credential-action && bun run test:ios-e2e && bun run test:ios-flow-contract && bun run test:ios-import-discovery && bun run test:ios-import-export && bun run test:ios-import-pickers && bun run test:ios-import-recovery && bun run test:ios-recovery && bun run test:ios-resume && bun run test:ios-tail-handoff && bun run test:ios-tui-render && bun run test:p8-error && bun run test:ios-tui-routing && bun run test:ios-updater-sync-validation && bun run test:ios-verify-app && bun run test:ios-marketing-version && bun run test:android-version && bun run test:platform-flow-contract && bun run test:tail-engine-shared && bun run test:prescan && bun run test:android-reporting-api && bun run test:android-gcp && bun run test:android-app-verification && bun run test:android-rename && bun run test:appflow-auth && bun run test:appflow-api-map && bun run test:appflow-validate && bun run test:appflow-flow && bun run test:appflow-gapfill && bun run test:appflow-engine && bun run test:appflow-tail && bun run test:appflow-fetch && bun run test:appflow-sa-decode && bun run test:app-permission-helper && bun run test:2fa-compliance-network && bun run test:organization-set-api-host && bun run test:trial-warning && bun run test:plan-validation","test:build-platform-selection":"bun test/test-build-platform-selection.mjs","test:builder-project-discovery":"bun test/test-builder-project-discovery.mjs","test:builder-app-selection":"bun test/test-builder-app-selection.mjs","test:builder-login-gate":"bun test/test-builder-login-gate.mjs","test:ai-log-capture":"bun test/test-ai-log-capture.mjs","test:ai-analyze-flow":"bun test/test-ai-analyze-flow.mjs","test:cicd-failure-help":"bun test/test-cicd-failure-help.mjs","test:ai-analyze-stream":"bun test/test-ai-analyze-stream.mjs","test:ai-sse-parser":"bun test/test-ai-sse-parser.mjs","test:ai-render-markdown":"bun test/test-ai-render-markdown.mjs","test:ai-onboarding-mode":"bun test/test-ai-onboarding-mode.mjs","test:ai-fit":"bun test/test-ai-fit.mjs","test:platform-layout":"bun test/test-platform-layout.mjs","test:frame-fit":"bun test/run-frame-fit.mjs","test:onboarding-min-size":"bun test/test-onboarding-min-size.mjs","test:min-size-gate":"bun test/test-min-size-gate.mjs","test:shell-size-gate":"bun test/test-shell-size-gate.mjs","test:build-log-sanitize":"bun test/test-build-log-sanitize.mjs","test:build-output-viewport":"bun test/test-build-output-viewport.mjs","test:diff-viewer-viewport":"bun test/test-diff-viewer-viewport.mjs","test:build-complete-exit":"bun test/test-build-complete-exit.mjs","test:ai-stream-markdown":"bun test/test-ai-stream-markdown.mjs","test:support-mailto":"bun test/test-support-mailto.mjs","test:support-redact":"bun test/test-support-redact.mjs","test:support-internal-log":"bun test/test-support-internal-log.mjs","test:support-help-menu":"bun test/test-support-help-menu.mjs","test:support-contact":"bun test/test-support-contact.mjs","test:support-upload-prompt":"bun test/test-support-upload-prompt.mjs","test:support-bundle-files":"bun test/test-support-bundle-files.mjs","test:mcp-live-update-onboarding":"bun test/test-mcp-live-update-onboarding.mjs","test:app-set-options":"bun test/test-app-set-options.mjs && bun test/test-app-list-options.mjs","test:android-reporting-api":"bun test/test-android-reporting-api.mjs","test:android-gcp":"bun test/test-android-gcp.mjs","test:android-app-verification":"bun test/test-android-app-verification.mjs","test:android-rename":"bun test/test-android-rename.mjs","test:appflow-auth":"bun test/test-appflow-auth.mjs","test:appflow-api-map":"bun test/test-appflow-api-map.mjs","test:appflow-validate":"bun test/test-appflow-validate.mjs","test:appflow-flow":"bun test/test-appflow-flow.mjs","test:appflow-gapfill":"bun test/test-appflow-gapfill.mjs","test:appflow-engine":"bun test/test-appflow-engine.mjs","test:appflow-tail":"bun test/test-appflow-tail.mjs","test:appflow-fetch":"bun test/test-appflow-fetch.mjs","test:appflow-sa-decode":"bun test/test-appflow-sa-decode.mjs","test:app-permission-helper":"bun test/test-app-permission-helper.mjs","test:2fa-compliance-network":"bun test/test-2fa-compliance-network.mjs","test:organization-set-api-host":"bun test/test-organization-set-api-host.mjs","test:trial-warning":"bun test/test-trial-warning.mjs","test:plan-validation":"bun test/test-plan-validation.mjs","test:auto-bump-version":"bun test/test-auto-bump-version.mjs","test:auto-bump-ai-diff":"bun test/test-auto-bump-ai-diff.mjs","test:ios-provisioning-map":"bun test/test-ios-provisioning-map.mjs","test:ios-provisioning-command":"bun test/test-ios-provisioning-command.mjs","test:channel-list":"bun test/test-channel-list.mjs"},dependencies:{"@inkjs/ui":"^2.0.0","@manypkg/tools":"^2.1.2","@rrweb/types":"^2.1.1","@standard-schema/spec":"^1.1.0","@xmldom/xmldom":"^0.9.10","@xterm/addon-serialize":"^0.14.0","@xterm/headless":"^6.0.0","agent-cli-detector":"^0.1.6","happy-dom":"^20.11.0",ink:"^7.1.1","ink-spinner":"^5.0.0",jsonwebtoken:"^9.0.3","node-forge":"^1.4.0",qrcode:"^1.5.4",react:"^19.2.8","rrweb-snapshot":"^2.1.1","string-width":"^8.2.2",typescript:"6.0.3",zod:"^4.5.4"},optionalDependencies:{"@capgo/cli-helper-darwin-arm64":"^1.1.1","@capgo/cli-helper-darwin-x64":"^1.1.1","node-pty":"^1.1.0"},devDependencies:{"@antfu/eslint-config":"^9.2.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.6","@capacitor/cli":"^8.4.2","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.7.0","@modelcontextprotocol/client":"^2.0.0-beta.5","@modelcontextprotocol/server":"^2.0.0-beta.5","@sauber/table":"npm:@jsr/sauber__table","@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 xD;var c1=k(()=>{xD=class xD extends Error{context;constructor(D,$){super(D);this.name="CliUserError",this.context=$}}});import{platform as xm}from"node:os";import{version as fm}from"node:process";function uV(D){_V=D}function hm(D){for(let $=0;$<D.length;$++)if(D.charCodeAt($)>255)return!1;return!0}function kV(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 mm(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 tU(D,$){if($===void 0||$===null){if(rU.has(D.toLowerCase()))throw new xD(kV(D));throw new xD(`HTTP header "${D}" is missing or invalid.`)}if(typeof $!=="string"){if(rU.has(D.toLowerCase()))throw new xD(kV(D));throw new xD(`HTTP header "${D}" is missing or invalid.`)}if(!hm($)){if(rU.has(D.toLowerCase()))throw new xD(mm(D));throw new xD(`HTTP header "${D}" contains invalid characters (only ASCII is allowed).`)}return $}function K6(D){let $={capgo_api:ym,"x-cli-version":r$.version,"x-cli-command":_V,"x-cli-node":fm,"x-cli-os":xm()};if(D)for(let[J,X]of Object.entries(D))$[J]=tU(J,X);return $}var ym="2025-10-01",_V="",rU;var T3=k(()=>{H8();c1();rU=new Set(["authorization","capgkey","x-capgo-log-token"])});import{existsSync as q$}from"fs";var S9=(D=".",$="unknown")=>{let J=`${D}/bun.lockb`,X=`${D}/bun.lock`,Y=`${D}/pnpm-lock.yaml`,Q=`${D}/shrinkwrap.yaml`,U=`${D}/yarn.lock`,F=`${D}/package-lock.json`,W=`${D}/npm-shrinkwrap.json`;if(q$(J)||q$(X))return"bun";if(q$(Y)||q$(Q))return"pnpm";if(q$(U))return"yarn";if(q$(F)||q$(W))return"npm";return $},P3=(D=S9(),$=!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"}},gV=(D=".",$="npx")=>{let J=`${D}/bun.lockb`,X=`${D}/bun.lock`,Y=`${D}/pnpm-lock.yaml`,Q=`${D}/shrinkwrap.yaml`,U=`${D}/yarn.lock`,F=`${D}/package-lock.json`,W=`${D}/npm-shrinkwrap.json`;if(q$(J)||q$(X))return"bunx";if(q$(Y)||q$(Q))return"pnpm exec";if(q$(U))return"yarn dlx";if(q$(F)||q$(W))return"npx";return $};var xV=()=>{};var fV,yV=(D)=>{return D===12288||D>=65281&&D<=65376||D>=65504&&D<=65510},hV=(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 mV=k(()=>{fV=(()=>{let D=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return($)=>{let J=0;D.lastIndex=0;while(D.test($))J+=1;return $.length-J}})()});var lm,dm,lV,im,dV,cm,pm,nm,iV=(D,$={},J={})=>{let X=$.limit??1/0,Y=$.ellipsis??"",Q=$?.ellipsisWidth??(Y?iV(Y,nm,J).width:0),U=0,F=J.controlWidth??0,W=J.tabWidth??8,K=J.emojiWidth??2,q=2,G=J.regularWidth??1,Z=J.wideWidth??2,H=[[cm,G],[lm,0],[dm,F],[im,W],[dV,K],[lV,Z]],z=0,I=0,B=D.length,N=0,V=!1,O=B,L=Math.max(0,X-Q),v=0,A=0,C=0,u=0;D:while(!0){if(A>v||I>=B&&I>z){let _=D.slice(v,A)||D.slice(z,I);N=0;for(let y of _.replaceAll(pm,"")){let T=y.codePointAt(0)||0;if(yV(T))u=2;else if(hV(T))u=Z;else u=G;if(C+u>L)O=Math.min(O,Math.max(v,z)+N);if(C+u>X){V=!0;break D}N+=y.length,C+=u}v=A=0}if(I>=B)break D;for(let _=0,y=H.length;_<y;_++){let[T,d]=H[_];if(T.lastIndex=I,T.test(D)){if(N=T===lV?fV(D.slice(I,T.lastIndex)):T===dV?1:T.lastIndex-I,u=N*d,C+u>L)O=Math.min(O,I+Math.floor((L-C)/d));if(C+u>X){V=!0;break D}C+=u,v=z,A=I,I=z=T.lastIndex;continue D}}I+=1}return{width:V?L:C,index:V?O:B,truncated:V,ellipsed:V&&X>=Q}},cV;var pV=k(()=>{mV();lm=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,dm=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,lV=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,im=/\t{1,1000}/y,dV=/[\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,cm=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,pm=/\p{M}+/gu,nm={limit:1/0,ellipsis:""},cV=iV});var rm,tm=(D,$={})=>{return cV(D,rm,$).width},q6;var oU=k(()=>{pV();rm={limit:1/0,ellipsis:"",ellipsisWidth:0},q6=tm});function s6(D,$,J){return String(D).normalize().split(Dl).map((X)=>em(X,$,J)).join(`
|
|
2
2
|
`)}var b3="\x1B",aV="",om=39,sU="\x07",sV="[",am="]",eV="m",eU,nV,rV=(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},tV=(D)=>`${b3}${sV}${D}${eV}`,oV=(D)=>`${b3}${eU}${D}${sU}`,aU=(D,$,J)=>{let X=$[Symbol.iterator](),Y=!1,Q=!1,U=D.at(-1),F=U===void 0?0:q6(U),W=X.next(),K=X.next(),q=0;while(!W.done){let G=W.value,Z=q6(G);if(F+Z<=J)D[D.length-1]+=G;else D.push(G),F=0;if(G===b3||G===aV)Y=!0,Q=$.startsWith(eU,q+1);if(Y){if(Q){if(G===sU)Y=!1,Q=!1}else if(G===eV)Y=!1}else if(F+=Z,F===J&&!K.done)D.push(""),F=0;W=K,K=X.next(),q+=G.length}if(U=D.at(-1),!F&&U!==void 0&&U.length&&D.length>1)D[D.length-2]+=D.pop()},sm=(D)=>{let $=D.split(" "),J=$.length;while(J){if(q6($[J-1]))break;J--}if(J===$.length)return D;return $.slice(0,J).join(" ")+$.slice(J).join("")},em=(D,$,J={})=>{if(J.trim!==!1&&D.trim()==="")return"";let X="",Y,Q,U=D.split(" "),F=[""],W=0;for(let G=0;G<U.length;G++){let Z=U[G];if(J.trim!==!1){let z=F.at(-1)??"",I=z.trimStart();if(z.length!==I.length)F[F.length-1]=I,W=q6(I)}if(G!==0){if(W>=$&&(J.wordWrap===!1||J.trim===!1))F.push(""),W=0;if(W||J.trim===!1)F[F.length-1]+=" ",W++}let H=q6(Z);if(J.hard&&H>$){let z=$-W,I=1+Math.floor((H-z-1)/$);if(Math.floor((H-1)/$)<I)F.push("");aU(F,Z,$),W=q6(F.at(-1)??"");continue}if(W+H>$&&W&&H){if(J.wordWrap===!1&&W<$){aU(F,Z,$),W=q6(F.at(-1)??"");continue}F.push(""),W=0}if(W+H>$&&J.wordWrap===!1){aU(F,Z,$),W=q6(F.at(-1)??"");continue}F[F.length-1]+=Z,W+=H}if(J.trim!==!1)F=F.map((G)=>sm(G));let K=F.join(`
|
|
3
3
|
`),q=!1;for(let G=0;G<K.length;G++){let Z=K[G];if(X+=Z,!q){if(q=Z>="\uD800"&&Z<="\uDBFF",q)continue}else q=!1;if(Z===b3||Z===aV){nV.lastIndex=G+1;let z=nV.exec(K)?.groups;if(z?.code!==void 0){let I=Number.parseFloat(z.code);Y=I===om?void 0:I}else if(z?.uri!==void 0)Q=z.uri.length===0?void 0:z.uri}if(K[G+1]===`
|
|
4
4
|
`){if(Q)X+=oV("");let H=Y?rV(Y):void 0;if(Y&&H)X+=tV(H)}else if(Z===`
|
|
@@ -246,8 +246,8 @@ Please generate a new API key with a shorter expiration:
|
|
|
246
246
|
tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}var Yx=k(()=>{Xx()});import{promisify as _JD}from"node:util";import{execFile as uJD}from"node:child_process";async function jO(D=gJD){let{stdout:$}=await D("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),J=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec($);if(!J)throw new Qx(`Cannot find Windows browser in stdout: ${JSON.stringify($)}`);let{id:X}=J.groups,Y=X.lastIndexOf("."),Q=X.lastIndexOf("-"),U=Y===-1?void 0:X.slice(0,Y),F=Q===-1?void 0:X.slice(0,Q);return uQ[X]??uQ[U]??uQ[F]??{name:X,id:X}}var gJD,uQ,gQ,Qx;var RO=k(()=>{gJD=_JD(uJD),uQ={MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},MSEdgeBHTML:{name:"Edge Beta",id:"com.microsoft.edge.beta"},MSEdgeDHTML:{name:"Edge Dev",id:"com.microsoft.edge.dev"},AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},ChromeBHTML:{name:"Chrome Beta",id:"com.google.chrome.beta"},ChromeDHTML:{name:"Chrome Dev",id:"com.google.chrome.dev"},ChromiumHTM:{name:"Chromium",id:"org.chromium.Chromium"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveDHTML:{name:"Brave Dev",id:"com.brave.Browser.dev"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},OperaStable:{name:"Opera",id:"com.operasoftware.Opera"},VivaldiHTM:{name:"Vivaldi",id:"com.vivaldi.Vivaldi"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"}},gQ=new Map(Object.entries(uQ));Qx=class Qx extends Error{}});import{promisify as xJD}from"node:util";import MO from"node:process";import{execFile as fJD}from"node:child_process";async function AO(){if(MO.platform==="darwin"){let D=await wO();return{name:await LO(D),id:D}}if(MO.platform==="linux"){let{stdout:D}=await yJD("xdg-mime",["query","default","x-scheme-handler/http"]),$=D.trim();return{name:hJD($.replace(/.desktop$/,"").replace("-"," ")),id:$}}if(MO.platform==="win32")return jO();throw Error("Only macOS, Linux, and Windows are supported")}var yJD,hJD=(D)=>D.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,($)=>$.toUpperCase());var Ux=k(()=>{$x();Yx();RO();RO();yJD=xJD(fJD)});import vO from"node:process";var mJD,Fx;var Wx=k(()=>{mJD=Boolean(vO.env.SSH_CONNECTION||vO.env.SSH_CLIENT||vO.env.SSH_TTY),Fx=mJD});var Hx={};y0(Hx,{openApp:()=>nJD,default:()=>rJD,apps:()=>r4});import EO from"node:process";import zx from"node:path";import{fileURLToPath as lJD}from"node:url";import dJD from"node:child_process";import iJD,{constants as cJD}from"node:fs/promises";function Zx(D){if(typeof D==="string"||Array.isArray(D))return D;let{[qx]:$}=D;if(!$)throw Error(`${qx} is not supported`);return $}function t7({[U9]:D},{wsl:$}={}){if($&&y6)return Zx($);if(!D)throw Error(`${U9} is not supported`);return Zx(D)}var xQ,TO,Kx,U9,qx,Gx=async(D,$)=>{if(D.length===0)return;let J=[];for(let X of D)try{return await $(X)}catch(Y){J.push(Y)}throw AggregateError(J,"Failed to open in all supported apps")},r7=async(D)=>{D={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...D};let $=D[xQ]===!0;if(delete D[xQ],Array.isArray(D.app))return Gx(D.app,(K)=>r7({...D,app:K,[xQ]:!0}));let{name:J,arguments:X=[]}=D.app??{};if(X=[...X],Array.isArray(J))return Gx(J,(K)=>r7({...D,app:{name:K,arguments:X},[xQ]:!0}));if(J==="browser"||J==="browserPrivate"){let K={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","com.brave.browser":"brave","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","com.microsoft.edgemac":"edge","microsoft-edge.desktop":"edge","com.apple.safari":"safari"},q={chrome:"--incognito",brave:"--incognito",firefox:"--private-window",edge:"--inPrivate"},G;if(y6){let Z=await sg();G=gQ.get(Z)??{}}else G=await AO();if(G.id in K){let Z=K[G.id.toLowerCase()];if(J==="browserPrivate"){if(Z==="safari")throw Error("Safari doesn't support opening in private mode via command line");X.push(q[Z])}return r7({...D,app:{name:r4[Z],arguments:X}})}throw Error(`${G.name} is not supported as a default browser`)}let Y,Q=[],U={},F=!1;if(y6&&!p4()&&!Fx&&!J)F=await ag();if(U9==="darwin"){if(Y="open",D.wait)Q.push("--wait-apps");if(D.background)Q.push("--background");if(D.newInstance)Q.push("--new");if(J)Q.push("-a",J)}else if(U9==="win32"||F){if(Y=await _Q(),Q.push(...T$.argumentsPrefix),!y6)U.windowsVerbatimArguments=!0;if(y6&&D.target)D.target=await eg(D.target);let K=["$ProgressPreference = 'SilentlyContinue';","Start"];if(D.wait)K.push("-Wait");if(J){if(K.push(T$.escapeArgument(J)),D.target)X.push(D.target)}else if(D.target)K.push(T$.escapeArgument(D.target));if(X.length>0)X=X.map((q)=>T$.escapeArgument(q)),K.push("-ArgumentList",X.join(","));if(D.target=T$.encodeCommand(K.join(" ")),!D.wait)U.stdio="ignore"}else{if(J)Y=J;else{let K=!TO||TO==="/",q=!1;try{await iJD.access(Kx,cJD.X_OK),q=!0}catch{}Y=EO.versions.electron??(U9==="android"||K||!q)?"xdg-open":Kx}if(X.length>0)Q.push(...X);if(!D.wait)U.stdio="ignore",U.detached=!0}if(U9==="darwin"&&X.length>0)Q.push("--args",...X);if(D.target)Q.push(D.target);let W=dJD.spawn(Y,Q,U);if(D.wait)return new Promise((K,q)=>{W.once("error",q),W.once("close",(G)=>{if(!D.allowNonzeroExitCode&&G!==0){q(Error(`Exited with code ${G}`));return}K(W)})});if($)return new Promise((K,q)=>{W.once("error",q),W.once("spawn",()=>{W.once("close",(G)=>{if(W.off("error",q),G!==0){q(Error(`Exited with code ${G}`));return}W.unref(),K(W)})})});return W.unref(),new Promise((K,q)=>{W.once("error",q),W.once("spawn",()=>{W.off("error",q),K(W)})})},pJD=(D,$)=>{if(typeof D!=="string")throw TypeError("Expected a `target`");return r7({...$,target:D})},nJD=(D,$)=>{if(typeof D!=="string"&&!Array.isArray(D))throw TypeError("Expected a valid `name`");let{arguments:J=[]}=$??{};if(J!==void 0&&J!==null&&!Array.isArray(J))throw TypeError("Expected `appArguments` as Array type");return r7({...$,app:{name:D,arguments:J}})},r4,rJD;var Ix=k(()=>{Dx();NO();Ux();HO();Wx();xQ=Symbol("fallbackAttempt"),TO=import.meta.url?zx.dirname(lJD(import.meta.url)):"",Kx=zx.join(TO,"xdg-open"),{platform:U9,arch:qx}=EO;r4={browser:"browser",browserPrivate:"browserPrivate"};n4(r4,"chrome",()=>t7({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium","chromium-browser"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));n4(r4,"brave",()=>t7({darwin:"brave browser",win32:"brave",linux:["brave-browser","brave"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",x64:["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe","/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]}}));n4(r4,"firefox",()=>t7({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));n4(r4,"edge",()=>t7({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));n4(r4,"safari",()=>t7({darwin:"Safari"}));rJD=pJD});import{spawn as tJD}from"node:child_process";import{existsSync as ID,readdirSync as K9,readFileSync as H0,statSync as oJD}from"node:fs";import{homedir as jx,platform as Rx}from"node:os";import a4,{dirname as h6,join as jD,relative as Mx,resolve as eD,sep as Ax}from"node:path";import{cwd as T0,env as o4,stdin as vx,stdout as Ex}from"node:process";function fQ(D,$){let J=vE();if(J)J[D]($);else lD[D]($)}function Px(D=""){if(!D)return dQ;return`${dQ}${D.startsWith("/")?D:`/${D}`}`}function fTD(D){let $=XXD.toLocaleString("en-US");return[`Delta updates cannot upload this bundle: it has ${D.toLocaleString("en-US")} files, and Capgo allows at most ${$} files per delta (manifest) upload.`,"Delta mode tracks and uploads each file individually so devices can download only what changed. Very large file counts are not supported on that path.","What you can do:","1. Upload a full zip instead: npx @capgo/cli@latest bundle upload --no-delta","2. Or reduce files in your web build output (remove unused assets, avoid copying large trees into dist).","See https://capgo.app/docs/faq/#are-there-delta-update-file-path-limitations"].join(`
|
|
247
247
|
`)}function hTD(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(`
|
|
248
248
|
`)}function m0(D){if(!D)return"Unknown error";if(qO(D).isSecurityPolicyError)return mg(D);let J=D;if(typeof D==="string")return D;if(D instanceof Error){let X=J.message||J.cause?.message||J.stack||D.name,Y=J.cause?.name,Q=X.toLowerCase();if(Q.includes("fetch failed")||Q.includes("failed to fetch")||Q.includes("connect timeout")||Q.includes("network")||Y?.startsWith("UND_ERR"))return`Network error: ${X}${J.code?` (code ${J.code})`:""}. Check your network connection and API endpoint availability.`;let U=J.status||J.statusCode;return[X,J.code?`Code: ${J.code}`:void 0,U?`Status: ${U}`:void 0].filter(Boolean).join(" | ")||D.name}if(J.message){let X=[J.message,J.code?`Code: ${J.code}`:void 0,J.status||J.statusCode?`Status: ${J.status||J.statusCode}`:void 0].filter(Boolean).join(" | "),Y=J.message.toLowerCase();if(Y.includes("fetch failed")||Y.includes("failed to fetch")||J.error==="Failed to fetch")return`Network error: ${X}. Check your network connection and API endpoint availability.`;if(J.details||J.hint||J.error)return`${X}${X?" | ":""}${J.error?typeof J.error==="string"?J.error:J.error.message??"":""}${J.details?`Details: ${J.details}`:""}${J.hint?`Hint: ${J.hint}`:""}`.trim();return X}if(typeof J.error==="string"&&J.error.length>0)return J.error;if(J.error&&typeof J.error==="object"&&typeof J.error.message==="string"&&J.error.message.length>0)return J.error.message;return`
|
|
249
|
-
${Tx.default.render(D)}`}async function lTD(D,$,J=!1){let{data:X,error:Y}=await gg(()=>D.rpc("reject_access_due_to_2fa_for_org",{org_id:$}));if(Y){if(!J&&!Q9(Y))r.error(`Cannot check 2FA compliance: ${Y.message}`);if(Q9(Y)){await xg({silent:J,telemetryFunctionName:"check2FAAccessForOrg"});return}fg(Y)}if(X){if(!J)r.error(`\uD83D\uDD10 Access Denied: 2FA Required. Enable 2FA at ${Px("/settings/account")}`);throw Error("2FA required for this organization")}}function dTD({silent:D=!1,stdinIsTTY:$=!!vx.isTTY,stdoutIsTTY:J=!!Ex.isTTY,ci:X=uO.isCI}={}){return!D&&$&&J&&!X}function YXD(D={}){let $=D.ci??uO.isCI,J=D.stdinIsTTY??!!vx.isTTY,X=D.stdoutIsTTY??!!Ex.isTTY,Y=D.platform??Rx(),Q="display"in D?D.display:o4.DISPLAY;if($||!J||!X)return!1;if(Y==="linux"&&!Q)return!1;return!0}async function QXD(D){if(!YXD())return;try{await(await Promise.resolve().then(() => (Ix(),Hx))).default(D)}catch($){if($?.code==="ENOENT")return}}function iTD(D){return Jq(D)||Xq(D)}function m6(D){if(Jq(D))return eS(D);else if(Xq(D))return DC(D);return D}function bx(D=m6(T0()),$=void 0){let J=$?.split(",")[0],X=J??jD(D,N$);if(!ID(X)){let Q=J?`Package.json at ${X} does not exist`:`No package.json found at ${X}. 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 r.error(Q),Error(Q)}let Y=H0(X);return JSON.parse(Y)}function cTD(D=m6(T0()),$=void 0){return bx(D,$).scripts}function pTD(D=m6(T0()),$=void 0){return bx(D,$).version??""}function UXD(D){let $=D.replace("^","").replace("~","");if(y9($))try{let J=o$($);return VF(J)}catch{return $}return $}async function nTD(D,$=T0(),J){let X=J?J.split(",").map((U)=>U.trim()).filter(Boolean):[],Y=[],Q=(U)=>{let F=eD(U);if(!Y.includes(F))Y.push(F)};for(let U of X){let F=eD($,U);if(ID(F))Q(h6(F))}Q(eD($)),Q(T0());for(let U of Y)try{let F=`${D}/package.json`,{createRequire:W}=await import("node:module"),q=W(jD(U,"package.json")).resolve(F),G=JSON.parse(H0(q,"utf-8"));if(G.version)return G.version}catch{}for(let U of Y){let F=U,W=a4.parse(F).root;while(F!==W){let K=jD(F,"node_modules",D,N$);if(ID(K))try{let G=JSON.parse(H0(K,"utf-8"));if(G.version)return G.version}catch{}let q=h6(F);if(q===F)break;F=q}}if(D==="@capgo/capacitor-updater"){let U=null,F=jD($,"ios","App","Podfile");if(ID(F))try{let K=H0(F,"utf-8").match(/pod\s+['"]CapgoCapacitorUpdater['"],\s*:path\s*=>\s*['"]([^'"]+)['"]/);if(K?.[1])U=eD(jD($,"ios","App",K[1]))}catch{}if(!U){let W=jD($,"android","capacitor.settings.gradle");if(ID(W))try{let q=H0(W,"utf-8").match(/project\(':capgo-capacitor-updater'\)\.projectDir\s*=\s*new\s+File\(['"]([^'"]+)['"]/);if(q?.[1])U=eD(jD($,"android",q[1])).replace(/\/android$/,"")}catch{}}if(U){let W=jD(U,N$);if(ID(W))try{let K=JSON.parse(H0(W,"utf-8"));if(K.version)return K.version}catch{}}}try{let U=J?J.split(",").map((K)=>K.trim()).filter(Boolean).join(","):J,W=(await pQ($,U)).get(D);if(W)return W}catch{}return null}async function pQ(D=m6(T0()),$=void 0){let J=$?.split(",").map((Q)=>Q.trim()).filter(Boolean);if(J??=[jD(D,N$)],J){for(let Q of J)if(!ID(Q)){let U=`Package.json at ${Q} does not exist`;throw r.error(U),Error(U)}}let X=new Map,{createRequire:Y}=await import("node:module");for(let Q of J){let U=H0(Q),F=JSON.parse(U),W=h6(Q),K=(q,G)=>{try{let I=Y(jD(W,"package.json")).resolve(`${q}/package.json`),B=JSON.parse(H0(I,"utf-8"));if(B.version)return B.version}catch{}let Z=W,H=a4.parse(Z).root;while(Z!==H){let z=jD(Z,"node_modules",q,N$);if(ID(z))try{let B=JSON.parse(H0(z,"utf-8"));if(B.version)return B.version}catch{}let I=h6(Z);if(I===Z)break;Z=I}return UXD(G)};for(let q in F.dependencies)X.set(q,K(q,F.dependencies[q]));for(let q in F.devDependencies)X.set(q,K(q,F.devDependencies[q]))}return X}async function FXD(D=m6(T0()),$=void 0){let J=$?.split(",").map((Y)=>Y.trim()).filter(Boolean);if(J??=[jD(D,N$)],J){for(let Y of J)if(!ID(Y)){let Q=`Package.json at ${Y} does not exist`;throw r.error(Q),Error(Q)}}let X=new Map;for(let Y of J){let Q=H0(Y),U=JSON.parse(Q);for(let F in U.dependencies??{})if(typeof U.dependencies[F]==="string")X.set(F,U.dependencies[F]);for(let F in U.devDependencies??{})if(typeof U.devDependencies[F]==="string")X.set(F,U.devDependencies[F])}return X}function WXD(D){if(!D)return!1;if(D.config&&Object.keys(D.config).length>0)return!0;return!!D.path&&ID(D.path)}async function Sx(D,$=!1){let J=KXD;try{let X=await D();if(!WXD(X)){if(!$)r.error(J);throw new xD(J)}return X}catch(X){if(X instanceof xD)throw X;let Y=m0(X);if(!$)r.error(`${J}: ${Y}`);throw new xD(J,{cause:Y})}}function DK(D=!1){return Sx(Gq,D)}function qXD(D=!1){return Sx(Zq,D)}async function GXD(D,$){let J=await qXD();if(J?.config)J.config.plugins??={},J.config.plugins.extConfig??={},J.config.plugins[D]??={},J.config.plugins[D]={...J.config.plugins[D],...$},await zq(D,J);return J}async function rTD(D){return GXD("CapacitorUpdater",D)}async function I4(D=!1){try{let $=await DK(D),J={host:$?.config?.plugins?.CapacitorUpdater?.localHost||Bx,hostWeb:$?.config?.plugins?.CapacitorUpdater?.localWebHost||dQ,hostFilesApi:$?.config?.plugins?.CapacitorUpdater?.localApiFiles||Ox,hostApi:$?.config?.plugins?.CapacitorUpdater?.localApi||lQ};if($?.config?.plugins?.CapacitorUpdater?.localSupa&&$?.config?.plugins?.CapacitorUpdater?.localSupaAnon){if(!D)r.info("Using custom supabase instance from capacitor.config.json");J.supaKey=$?.config?.plugins?.CapacitorUpdater?.localSupaAnon,J.supaHost=$?.config?.plugins?.CapacitorUpdater?.localSupa}return J}catch{return{host:Bx,hostWeb:dQ,hostFilesApi:Ox,hostApi:lQ}}}function Vx(D){return typeof D==="object"&&D!==null}function ZXD(D){if(!Vx(D))return!1;let $=D.capacitor;if(Vx($)&&($.ios!==void 0||$.android!==void 0))return!0;return!1}function zXD(D){if(ID(jD(D,"plugin.xml")))return!0;let $=jD(D,N$);if(!ID($))return!1;try{return ZXD(JSON.parse(H0($,"utf-8")))}catch{return!1}}async function a7(D=!1,$){let J=(Y)=>{let Q={...Y};return FE(Q,void 0,D),Q};if(!$&&PO)return J(PO);if(!$&&yQ)return yQ.then(J);let X=(async()=>{let Y=await I4(D);try{let Q=_x(),U=await fetch(`${Y.hostApi}/private/config`,{...$?{signal:$}:{},headers:K6(Q?{capgkey:Q}:void 0)});if(!U.ok)throw Error(`HTTP error! status: ${U.status}`);let W={...await U.json(),...Y};if(!$)PO=W;return{...W}}catch{if(!D)r.info(`Local config ${m0(Y)}`);return{...Y}}finally{if(!$)yQ=null}})();if(!$)yQ=X;return X.then(J)}async function tTD(){let D=await I4();try{let $=_x(),J=await fetch(`${D.hostFilesApi}/files/config`,{headers:K6($?{capgkey:$}:void 0)});if(!J.ok)throw Error(`HTTP error! status: ${J.status}`);return await J.json()}catch{return{partialUpload:!1,TUSUpload:!1,partialUploadForced:!1,TUSUploadForced:!1,maxUploadLength:DXD,maxChunkSize:$XD,alertUploadSize:eJD}}}function W9(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
|
|
250
|
-
`)[0].trim()}async function oTD(D){let $=await kx(D);if($?.error==="channel_zip_required"||$?.error==="channel_delta_required")return $.message||$.error;let J=D instanceof Error?D.message:String(D??"");if(J.includes("CHANNEL_ZIP_REQUIRED"))return wx(J,"CHANNEL_ZIP_REQUIRED");if(J.includes("CHANNEL_DELTA_REQUIRED"))return wx(J,"CHANNEL_DELTA_REQUIRED");return null}function o7(D){if(!D)return!1;try{let $=new URL(W9(D)).hostname.toLowerCase();return $==="sb.capgo.app"||$==="xvwzpoazmxkqosrdewyv.supabase.co"||$==="ibwjdnhknbkcqfbabwei.supabase.co"||$==="aucsybvnhavogdmzwtcw.supabase.co"}catch{return!1}}function IXD(D){if(D.supaHost&&D.supaKey&&D.hostApi===lQ&&!o7(D.supaHost))return`${W9(D.supaHost)}/functions/v1`;return D.hostApi}function aTD(D){let $=D?.context;return typeof $?.status==="number"?$.status:void 0}async function kx(D){let $=D?.context;if(!$||typeof $.clone!=="function")return null;try{let J=await $.clone().text();try{return JSON.parse(J)}catch{return J?{message:J}:null}}catch{return null}}async function sTD(D){let $=await kx(D);if($){let J=HXD($);if(J)return J}return m0(D)}async function nQ(D,$){let J=($.method??"POST").toUpperCase(),X,Y=$.supaAnon;if($.supaHost&&$.supaAnon&&!o7($.supaHost))X=`${W9($.supaHost)}/functions/v1`;else{let F=await a7(!0);if(Y=$.supaAnon??F.supaKey,F.supaHost&&F.supaKey&&F.hostApi===lQ&&!o7(F.supaHost)&&!($.supaHost&&o7($.supaHost)))X=`${W9(F.supaHost)}/functions/v1`;else if($.useFilesHost)X=F.hostFilesApi;else X=F.hostApi}let Q=X.includes("/functions/v1"),U=`${N1(X)}/${D.replace(/^\//,"")}`;try{let F=await fetch(U,{method:J,headers:K6({"Content-Type":"application/json",Authorization:Q&&Y?`Bearer ${Y}`:$.apikey,capgkey:$.apikey}),body:J==="GET"||J==="HEAD"?void 0:typeof $.body==="string"?$.body:JSON.stringify($.body??{}),signal:$.signal});if(!F.ok)return{data:null,error:new f$.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 eTD(D,$=!0){if(D?.supaHost&&D?.supaAnon){if(o7(D.supaHost))return(await I4($)).hostApi;return`${W9(D.supaHost)}/functions/v1`}let J=await I4($);if(J.supaHost&&J.supaKey)return IXD(J);return(await a7($)).hostApi}async function DPD(D,$,J,X=!1,Y=!0,Q){let U=await a7(X,Q);if($&&J){if(!X)r.info("Using custom supabase instance from provided options");U.supaHost=$,U.supaKey=J}if(!U.supaHost||!U.supaKey){if(!X)r.error(Nx);throw new xD(Nx,{missingSupaHost:!U.supaHost,missingSupaKey:!U.supaKey})}let F=W9(U.supaHost);return Yj(F,U.supaKey,{auth:{persistSession:!1},global:{headers:{capgkey:tU("capgkey",D)},...XE()&&Y?{fetch:QE()}:{}}})}async function BXD(D,$){let{data:J}=await D.rpc("is_paying_org",{orgid:$}).single();return J||!1}async function OXD(D,$){let{data:J}=await D.rpc("is_trial_org",{orgid:$}).single();return J||0}async function NXD(D,$,J){let{data:X}=await D.rpc("has_usage_credits_org",J?{orgid:$,appid:J}:{orgid:$}).single();return X||!1}function VXD(D){let{trialDays:$,isPaying:J,hasCredits:X,warning:Y=!0}=D;return!!Y&&$>0&&!J&&!X}async function wXD(D,$){let{data:J,error:X}=await D.rpc("is_allowed_action_org",{orgid:$}).single();if(X)throw Error(`Cannot validate plan: ${m0(X)}`);return J===!0}async function bO(D,$,J,X){let{data:Y,error:Q}=X?await D.rpc("is_allowed_action_org_action",{orgid:$,actions:J,appid:X}):await D.rpc("is_allowed_action_org_action",{orgid:$,actions:J});if(Q){if(X&&Q.code==="PGRST202")return wXD(D,$);throw Error(`Cannot validate plan: ${m0(Q)}`)}return Y===!0}async function LXD(D,$,J,X){if(X){if(await bO(D,$,J,X))return"allowed";if(await bO(D,$,J))return"permission_denied";return"billing_denied"}return await bO(D,$,J)?"allowed":"billing_denied"}async function jXD(D,$){throw r.error(`You need to upgrade your plan to continue to use capgo.
|
|
249
|
+
${Tx.default.render(D)}`}async function lTD(D,$,J=!1){let{data:X,error:Y}=await gg(()=>D.rpc("reject_access_due_to_2fa_for_org",{org_id:$}));if(Y){if(!J&&!Q9(Y))r.error(`Cannot check 2FA compliance: ${Y.message}`);if(Q9(Y)){await xg({silent:J,telemetryFunctionName:"check2FAAccessForOrg"});return}fg(Y)}if(X){if(!J)r.error(`\uD83D\uDD10 Access Denied: 2FA Required. Enable 2FA at ${Px("/settings/account")}`);throw Error("2FA required for this organization")}}function dTD({silent:D=!1,stdinIsTTY:$=!!vx.isTTY,stdoutIsTTY:J=!!Ex.isTTY,ci:X=uO.isCI}={}){return!D&&$&&J&&!X}function YXD(D={}){let $=D.ci??uO.isCI,J=D.stdinIsTTY??!!vx.isTTY,X=D.stdoutIsTTY??!!Ex.isTTY,Y=D.platform??Rx(),Q="display"in D?D.display:o4.DISPLAY;if($||!J||!X)return!1;if(Y==="linux"&&!Q)return!1;return!0}async function QXD(D){if(!YXD())return;try{await(await Promise.resolve().then(() => (Ix(),Hx))).default(D)}catch($){if($?.code==="ENOENT")return}}function iTD(D){return Jq(D)||Xq(D)}function m6(D){if(Jq(D))return eS(D);else if(Xq(D))return DC(D);return D}function bx(D=m6(T0()),$=void 0){let J=$?.split(",")[0],X=J??jD(D,N$);if(!ID(X)){let Q=J?`Package.json at ${X} does not exist`:`No package.json found at ${X}. 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 r.error(Q),Error(Q)}let Y=H0(X);return JSON.parse(Y)}function cTD(D=m6(T0()),$=void 0){return bx(D,$).scripts}function pTD(D=m6(T0()),$=void 0){return bx(D,$).version??""}function UXD(D){let $=D.replace("^","").replace("~","");if(y9($))try{let J=o$($);return VF(J)}catch{return $}return $}async function nTD(D,$=T0(),J){let X=J?J.split(",").map((U)=>U.trim()).filter(Boolean):[],Y=[],Q=(U)=>{let F=eD(U);if(!Y.includes(F))Y.push(F)};for(let U of X){let F=eD($,U);if(ID(F))Q(h6(F))}Q(eD($)),Q(T0());for(let U of Y)try{let F=`${D}/package.json`,{createRequire:W}=await import("node:module"),q=W(jD(U,"package.json")).resolve(F),G=JSON.parse(H0(q,"utf-8"));if(G.version)return G.version}catch{}for(let U of Y){let F=U,W=a4.parse(F).root;while(F!==W){let K=jD(F,"node_modules",D,N$);if(ID(K))try{let G=JSON.parse(H0(K,"utf-8"));if(G.version)return G.version}catch{}let q=h6(F);if(q===F)break;F=q}}if(D==="@capgo/capacitor-updater"){let U=null,F=jD($,"ios","App","Podfile");if(ID(F))try{let K=H0(F,"utf-8").match(/pod\s+['"]CapgoCapacitorUpdater['"],\s*:path\s*=>\s*['"]([^'"]+)['"]/);if(K?.[1])U=eD(jD($,"ios","App",K[1]))}catch{}if(!U){let W=jD($,"android","capacitor.settings.gradle");if(ID(W))try{let q=H0(W,"utf-8").match(/project\(':capgo-capacitor-updater'\)\.projectDir\s*=\s*new\s+File\(['"]([^'"]+)['"]/);if(q?.[1])U=eD(jD($,"android",q[1])).replace(/\/android$/,"")}catch{}}if(U){let W=jD(U,N$);if(ID(W))try{let K=JSON.parse(H0(W,"utf-8"));if(K.version)return K.version}catch{}}}try{let U=J?J.split(",").map((K)=>K.trim()).filter(Boolean).join(","):J,W=(await pQ($,U)).get(D);if(W)return W}catch{}return null}async function pQ(D=m6(T0()),$=void 0){let J=$?.split(",").map((Q)=>Q.trim()).filter(Boolean);if(J??=[jD(D,N$)],J){for(let Q of J)if(!ID(Q)){let U=`Package.json at ${Q} does not exist`;throw r.error(U),Error(U)}}let X=new Map,{createRequire:Y}=await import("node:module");for(let Q of J){let U=H0(Q),F=JSON.parse(U),W=h6(Q),K=(q,G)=>{try{let I=Y(jD(W,"package.json")).resolve(`${q}/package.json`),B=JSON.parse(H0(I,"utf-8"));if(B.version)return B.version}catch{}let Z=W,H=a4.parse(Z).root;while(Z!==H){let z=jD(Z,"node_modules",q,N$);if(ID(z))try{let B=JSON.parse(H0(z,"utf-8"));if(B.version)return B.version}catch{}let I=h6(Z);if(I===Z)break;Z=I}return UXD(G)};for(let q in F.dependencies)X.set(q,K(q,F.dependencies[q]));for(let q in F.devDependencies)X.set(q,K(q,F.devDependencies[q]))}return X}async function FXD(D=m6(T0()),$=void 0){let J=$?.split(",").map((Y)=>Y.trim()).filter(Boolean);if(J??=[jD(D,N$)],J){for(let Y of J)if(!ID(Y)){let Q=`Package.json at ${Y} does not exist`;throw r.error(Q),Error(Q)}}let X=new Map;for(let Y of J){let Q=H0(Y),U=JSON.parse(Q);for(let F in U.dependencies??{})if(typeof U.dependencies[F]==="string")X.set(F,U.dependencies[F]);for(let F in U.devDependencies??{})if(typeof U.devDependencies[F]==="string")X.set(F,U.devDependencies[F])}return X}function WXD(D){if(!D)return!1;if(D.config&&Object.keys(D.config).length>0)return!0;return!!D.path&&ID(D.path)}async function Sx(D,$=!1){let J=KXD;try{let X=await D();if(!WXD(X)){if(!$)r.error(J);throw new xD(J)}return X}catch(X){if(X instanceof xD)throw X;let Y=m0(X);if(!$)r.error(`${J}: ${Y}`);throw new xD(J,{cause:Y})}}function DK(D=!1){return Sx(Gq,D)}function qXD(D=!1){return Sx(Zq,D)}async function GXD(D,$){let J=await qXD();if(J?.config)J.config.plugins??={},J.config.plugins.extConfig??={},J.config.plugins[D]??={},J.config.plugins[D]={...J.config.plugins[D],...$},await zq(D,J);return J}async function rTD(D){return GXD("CapacitorUpdater",D)}async function I4(D=!1){try{let $=await DK(D),J={host:$?.config?.plugins?.CapacitorUpdater?.localHost||Bx,hostWeb:$?.config?.plugins?.CapacitorUpdater?.localWebHost||dQ,hostFilesApi:$?.config?.plugins?.CapacitorUpdater?.localApiFiles||Ox,hostApi:$?.config?.plugins?.CapacitorUpdater?.localApi||lQ};if($?.config?.plugins?.CapacitorUpdater?.localSupa&&$?.config?.plugins?.CapacitorUpdater?.localSupaAnon){if(!D)r.info("Using custom supabase instance from capacitor.config.json");J.supaKey=$?.config?.plugins?.CapacitorUpdater?.localSupaAnon,J.supaHost=$?.config?.plugins?.CapacitorUpdater?.localSupa}return J}catch{return{host:Bx,hostWeb:dQ,hostFilesApi:Ox,hostApi:lQ}}}function Vx(D){return typeof D==="object"&&D!==null}function ZXD(D){if(!Vx(D))return!1;let $=D.capacitor;if(Vx($)&&($.ios!==void 0||$.android!==void 0))return!0;return!1}function zXD(D){if(ID(jD(D,"plugin.xml")))return!0;let $=jD(D,N$);if(!ID($))return!1;try{return ZXD(JSON.parse(H0($,"utf-8")))}catch{return!1}}async function a7(D=!1,$){let J=(Y)=>{let Q={...Y};return FE(Q,void 0,D),Q};if(!$&&PO)return J(PO);if(!$&&yQ)return yQ.then(J);let X=(async()=>{let Y=await I4(D);try{let Q=_x(),U=await fetch(`${Y.hostApi}/private/config`,{...$?{signal:$}:{},headers:K6(Q?{capgkey:Q}:void 0)});if(!U.ok)throw Error(`HTTP error! status: ${U.status}`);let W={...await U.json(),...Y};if(!$)PO=W;return{...W}}catch{if(!D)r.info(`Local config ${m0(Y)}`);return{...Y}}finally{if(!$)yQ=null}})();if(!$)yQ=X;return X.then(J)}async function tTD(){let D=await I4();try{let $=_x(),J=await fetch(`${D.hostFilesApi}/files/config`,{headers:K6($?{capgkey:$}:void 0)});if(!J.ok)throw Error(`HTTP error! status: ${J.status}`);return await J.json()}catch{return{partialUpload:!1,TUSUpload:!1,partialUploadForced:!1,TUSUploadForced:!1,maxUploadLength:DXD,maxChunkSize:$XD,alertUploadSize:eJD}}}function W9(D){let $=new URL(D);if(!["http:","https:"].includes($.protocol))throw Error("Invalid Supabase host protocol");let J=$.hostname==="localhost"||$.hostname==="127.0.0.1"||$.hostname==="[::1]";if($.protocol==="http:"&&!J)throw Error("Supabase host must use HTTPS (HTTP is only allowed for localhost)");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 X=N1($.pathname);return`${$.origin}${X}`}function HXD(D){if(!D||typeof D!=="object")return"";let $=D;return[$.error,$.message,$.status].filter(Boolean).join(" | ")}function wx(D,$){let J=D.indexOf($);if(J<0)return D;return D.slice(J+$.length).replace(/^:\s*/,"").split(`
|
|
250
|
+
`)[0].trim()}async function oTD(D){let $=await kx(D);if($?.error==="channel_zip_required"||$?.error==="channel_delta_required")return $.message||$.error;let J=D instanceof Error?D.message:String(D??"");if(J.includes("CHANNEL_ZIP_REQUIRED"))return wx(J,"CHANNEL_ZIP_REQUIRED");if(J.includes("CHANNEL_DELTA_REQUIRED"))return wx(J,"CHANNEL_DELTA_REQUIRED");return null}function o7(D){if(!D)return!1;try{let $=new URL(W9(D)).hostname.toLowerCase();return $==="sb.capgo.app"||$==="xvwzpoazmxkqosrdewyv.supabase.co"||$==="ibwjdnhknbkcqfbabwei.supabase.co"||$==="aucsybvnhavogdmzwtcw.supabase.co"}catch{return!1}}function IXD(D){if(D.supaHost&&D.supaKey&&D.hostApi===lQ&&!o7(D.supaHost))return`${W9(D.supaHost)}/functions/v1`;return D.hostApi}function aTD(D){let $=D?.context;return typeof $?.status==="number"?$.status:void 0}async function kx(D){let $=D?.context;if(!$||typeof $.clone!=="function")return null;try{let J=await $.clone().text();try{return JSON.parse(J)}catch{return J?{message:J}:null}}catch{return null}}async function sTD(D){let $=await kx(D);if($){let J=HXD($);if(J)return J}return m0(D)}async function nQ(D,$){let J=($.method??"POST").toUpperCase(),X,Y=$.supaAnon;if($.supaHost&&$.supaAnon&&!o7($.supaHost))X=`${W9($.supaHost)}/functions/v1`;else{let F=await a7(!0);if(Y=$.supaAnon??F.supaKey,F.supaHost&&F.supaKey&&F.hostApi===lQ&&!o7(F.supaHost)&&!($.supaHost&&o7($.supaHost)))X=`${W9(F.supaHost)}/functions/v1`;else if($.useFilesHost)X=F.hostFilesApi;else X=F.hostApi}let Q=X.includes("/functions/v1"),U=`${N1(X)}/${D.replace(/^\//,"")}`;try{let F=await fetch(U,{method:J,redirect:"error",headers:K6({"Content-Type":"application/json",Authorization:Q&&Y?`Bearer ${Y}`:$.apikey,capgkey:$.apikey}),body:J==="GET"||J==="HEAD"?void 0:typeof $.body==="string"?$.body:JSON.stringify($.body??{}),signal:$.signal});if(!F.ok)return{data:null,error:new f$.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 eTD(D,$=!0){if(D?.supaHost&&D?.supaAnon){if(o7(D.supaHost))return(await I4($)).hostApi;return`${W9(D.supaHost)}/functions/v1`}let J=await I4($);if(J.supaHost&&J.supaKey)return IXD(J);return(await a7($)).hostApi}async function DPD(D,$,J,X=!1,Y=!0,Q){let U=await a7(X,Q);if($&&J){if(!X)r.info("Using custom supabase instance from provided options");U.supaHost=$,U.supaKey=J}if(!U.supaHost||!U.supaKey){if(!X)r.error(Nx);throw new xD(Nx,{missingSupaHost:!U.supaHost,missingSupaKey:!U.supaKey})}let F=W9(U.supaHost);return Yj(F,U.supaKey,{auth:{persistSession:!1},global:{headers:{capgkey:tU("capgkey",D)},...XE()&&Y?{fetch:QE()}:{}}})}async function BXD(D,$){let{data:J}=await D.rpc("is_paying_org",{orgid:$}).single();return J||!1}async function OXD(D,$){let{data:J}=await D.rpc("is_trial_org",{orgid:$}).single();return J||0}async function NXD(D,$,J){let{data:X}=await D.rpc("has_usage_credits_org",J?{orgid:$,appid:J}:{orgid:$}).single();return X||!1}function VXD(D){let{trialDays:$,isPaying:J,hasCredits:X,warning:Y=!0}=D;return!!Y&&$>0&&!J&&!X}async function wXD(D,$){let{data:J,error:X}=await D.rpc("is_allowed_action_org",{orgid:$}).single();if(X)throw Error(`Cannot validate plan: ${m0(X)}`);return J===!0}async function bO(D,$,J,X){let{data:Y,error:Q}=X?await D.rpc("is_allowed_action_org_action",{orgid:$,actions:J,appid:X}):await D.rpc("is_allowed_action_org_action",{orgid:$,actions:J});if(Q){if(X&&Q.code==="PGRST202")return wXD(D,$);throw Error(`Cannot validate plan: ${m0(Q)}`)}return Y===!0}async function LXD(D,$,J,X){if(X){if(await bO(D,$,J,X))return"allowed";if(await bO(D,$,J))return"permission_denied";return"billing_denied"}return await bO(D,$,J)?"allowed":"billing_denied"}async function jXD(D,$){throw r.error(`You need to upgrade your plan to continue to use capgo.
|
|
251
251
|
Upgrade here: ${D}
|
|
252
252
|
`),await QXD(D),new xD($)}async function RXD(){throw r.error("Cannot validate plan usage for this app. The API key may lack permission to read app billing details."),new xD("Plan validation permission denied")}async function $PD(D,$,J){let{data:X,error:Y}=await D.rpc("get_organization_cli_warnings",{orgid:$,cli_version:J});if(Y){r.error(`Cannot get cli warnings: ${m0(Y)}`);return}if(X.length>0){r.warn(`Found ${X.length} cli warnings for your organization.`);let Q=null;for(let U of X){if(typeof U!=="object"||typeof U.message!=="string"||typeof U.fatal!=="boolean"){r.error(`Invalid cli warning: ${U}`);continue}let F=U;if(F.fatal)r.error(`${F.message.replaceAll("\\n",`
|
|
253
253
|
`)}`),Q=Error(F.message);else r.warn(`${F.message.replaceAll("\\n",`
|