@capgo/cli 8.62.0 → 8.63.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.62.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-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: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-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-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(`
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.63.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-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: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-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.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===`
@@ -86,7 +86,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
86
86
  `)}),$.__defineSetter__("stack",function(U){return[U].concat($.stack).join(`
87
87
 
88
88
  `)}),$}});var BE=S((_VD,VE)=>{var Q6=e("constants"),Kp=process.cwd,Z7=null,wp=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!Z7)Z7=Kp.call(process);return Z7};try{process.cwd()}catch(D){}if(typeof process.chdir==="function"){if(V7=process.chdir,process.chdir=function(D){Z7=null,V7.call(process,D)},Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,V7)}var V7;VE.exports=Hp;function Hp(D){if(Q6.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./))$(D);if(!D.lutimes)U(D);if(D.chown=Q(D.chown),D.fchown=Q(D.fchown),D.lchown=Q(D.lchown),D.chmod=X(D.chmod),D.fchmod=X(D.fchmod),D.lchmod=X(D.lchmod),D.chownSync=Y(D.chownSync),D.fchownSync=Y(D.fchownSync),D.lchownSync=Y(D.lchownSync),D.chmodSync=F(D.chmodSync),D.fchmodSync=F(D.fchmodSync),D.lchmodSync=F(D.lchmodSync),D.stat=J(D.stat),D.fstat=J(D.fstat),D.lstat=J(D.lstat),D.statSync=q(D.statSync),D.fstatSync=q(D.fstatSync),D.lstatSync=q(D.lstatSync),D.chmod&&!D.lchmod)D.lchmod=function(W,I,G){if(G)process.nextTick(G)},D.lchmodSync=function(){};if(D.chown&&!D.lchown)D.lchown=function(W,I,G,V){if(V)process.nextTick(V)},D.lchownSync=function(){};if(wp==="win32")D.rename=typeof D.rename!=="function"?D.rename:function(W){function I(G,V,Z){var K=Date.now(),B=0;W(G,V,function L(O){if(O&&(O.code==="EACCES"||O.code==="EPERM"||O.code==="EBUSY")&&Date.now()-K<60000){if(setTimeout(function(){D.stat(V,function(w,N){if(w&&w.code==="ENOENT")W(G,V,L);else Z(O)})},B),B<100)B+=10;return}if(Z)Z(O)})}if(Object.setPrototypeOf)Object.setPrototypeOf(I,W);return I}(D.rename);D.read=typeof D.read!=="function"?D.read:function(W){function I(G,V,Z,K,B,L){var O;if(L&&typeof L==="function"){var w=0;O=function(N,R,j){if(N&&N.code==="EAGAIN"&&w<10)return w++,W.call(D,G,V,Z,K,B,O);L.apply(this,arguments)}}return W.call(D,G,V,Z,K,B,O)}if(Object.setPrototypeOf)Object.setPrototypeOf(I,W);return I}(D.read),D.readSync=typeof D.readSync!=="function"?D.readSync:function(W){return function(I,G,V,Z,K){var B=0;while(!0)try{return W.call(D,I,G,V,Z,K)}catch(L){if(L.code==="EAGAIN"&&B<10){B++;continue}throw L}}}(D.readSync);function $(W){W.lchmod=function(I,G,V){W.open(I,Q6.O_WRONLY|Q6.O_SYMLINK,G,function(Z,K){if(Z){if(V)V(Z);return}W.fchmod(K,G,function(B){W.close(K,function(L){if(V)V(B||L)})})})},W.lchmodSync=function(I,G){var V=W.openSync(I,Q6.O_WRONLY|Q6.O_SYMLINK,G),Z=!0,K;try{K=W.fchmodSync(V,G),Z=!1}finally{if(Z)try{W.closeSync(V)}catch(B){}else W.closeSync(V)}return K}}function U(W){if(Q6.hasOwnProperty("O_SYMLINK")&&W.futimes)W.lutimes=function(I,G,V,Z){W.open(I,Q6.O_SYMLINK,function(K,B){if(K){if(Z)Z(K);return}W.futimes(B,G,V,function(L){W.close(B,function(O){if(Z)Z(L||O)})})})},W.lutimesSync=function(I,G,V){var Z=W.openSync(I,Q6.O_SYMLINK),K,B=!0;try{K=W.futimesSync(Z,G,V),B=!1}finally{if(B)try{W.closeSync(Z)}catch(L){}else W.closeSync(Z)}return K};else if(W.futimes)W.lutimes=function(I,G,V,Z){if(Z)process.nextTick(Z)},W.lutimesSync=function(){}}function X(W){if(!W)return W;return function(I,G,V){return W.call(D,I,G,function(Z){if(z(Z))Z=null;if(V)V.apply(this,arguments)})}}function F(W){if(!W)return W;return function(I,G){try{return W.call(D,I,G)}catch(V){if(!z(V))throw V}}}function Q(W){if(!W)return W;return function(I,G,V,Z){return W.call(D,I,G,V,function(K){if(z(K))K=null;if(Z)Z.apply(this,arguments)})}}function Y(W){if(!W)return W;return function(I,G,V){try{return W.call(D,I,G,V)}catch(Z){if(!z(Z))throw Z}}}function J(W){if(!W)return W;return function(I,G,V){if(typeof G==="function")V=G,G=null;function Z(K,B){if(B){if(B.uid<0)B.uid+=4294967296;if(B.gid<0)B.gid+=4294967296}if(V)V.apply(this,arguments)}return G?W.call(D,I,G,Z):W.call(D,I,Z)}}function q(W){if(!W)return W;return function(I,G){var V=G?W.call(D,I,G):W.call(D,I);if(V){if(V.uid<0)V.uid+=4294967296;if(V.gid<0)V.gid+=4294967296}return V}}function z(W){if(!W)return!0;if(W.code==="ENOSYS")return!0;var I=!process.getuid||process.getuid()!==0;if(I){if(W.code==="EINVAL"||W.code==="EPERM")return!0}return!1}}});var HE=S((kVD,wE)=>{var KE=e("stream").Stream;wE.exports=Lp;function Lp(D){return{ReadStream:$,WriteStream:U};function $(X,F){if(!(this instanceof $))return new $(X,F);KE.call(this);var Q=this;this.path=X,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,F=F||{};var Y=Object.keys(F);for(var J=0,q=Y.length;J<q;J++){var z=Y[J];this[z]=F[z]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!=="number")throw TypeError("end must be a Number");if(this.start>this.end)throw Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){Q._read()});return}D.open(this.path,this.flags,this.mode,function(W,I){if(W){Q.emit("error",W),Q.readable=!1;return}Q.fd=I,Q.emit("open",I),Q._read()})}function U(X,F){if(!(this instanceof U))return new U(X,F);KE.call(this),this.path=X,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,F=F||{};var Q=Object.keys(F);for(var Y=0,J=Q.length;Y<J;Y++){var q=Q[Y];this[q]=F[q]}if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.start<0)throw Error("start must be >= zero");this.pos=this.start}if(this.busy=!1,this._queue=[],this.fd===null)this._open=D.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush()}}});var OE=S((gVD,LE)=>{LE.exports=Np;var Op=Object.getPrototypeOf||function(D){return D.__proto__};function Np(D){if(D===null||typeof D!=="object")return D;if(D instanceof Object)var $={__proto__:Op(D)};else var $=Object.create(null);return Object.getOwnPropertyNames(D).forEach(function(U){Object.defineProperty($,U,Object.getOwnPropertyDescriptor(D,U))}),$}});var Y6=S((fVD,fY)=>{var hD=e("fs"),Mp=BE(),Ep=HE(),Ap=OE(),B7=e("util"),Q0,w7;if(typeof Symbol==="function"&&typeof Symbol.for==="function")Q0=Symbol.for("graceful-fs.queue"),w7=Symbol.for("graceful-fs.previous");else Q0="___graceful-fs.queue",w7="___graceful-fs.previous";function Rp(){}function ME(D,$){Object.defineProperty(D,Q0,{get:function(){return $}})}var J1=Rp;if(B7.debuglog)J1=B7.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))J1=function(){var D=B7.format.apply(B7,arguments);D="GFS4: "+D.split(/\n/).join(`
89
- GFS4: `),console.error(D)};if(!hD[Q0]){if(_Y=global[Q0]||[],ME(hD,_Y),hD.close=function(D){function $(U,X){return D.call(hD,U,function(F){if(!F)NE();if(typeof X==="function")X.apply(this,arguments)})}return Object.defineProperty($,w7,{value:D}),$}(hD.close),hD.closeSync=function(D){function $(U){D.apply(hD,arguments),NE()}return Object.defineProperty($,w7,{value:D}),$}(hD.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){J1(hD[Q0]),e("assert").equal(hD[Q0].length,0)})}var _Y;if(!global[Q0])ME(global,hD[Q0]);fY.exports=kY(Ap(hD));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!hD.__patched)fY.exports=kY(hD),hD.__patched=!0;function kY(D){Mp(D),D.gracefulify=kY,D.createReadStream=R,D.createWriteStream=j;var $=D.readFile;D.readFile=U;function U(u,E,P){if(typeof E==="function")P=E,E=null;return h(u,E,P);function h(d,v,x,A){return $(d,v,function(H){if(H&&(H.code==="EMFILE"||H.code==="ENFILE"))x4([h,[d,v,x],H,A||Date.now(),Date.now()]);else if(typeof x==="function")x.apply(this,arguments)})}}var X=D.writeFile;D.writeFile=F;function F(u,E,P,h){if(typeof P==="function")h=P,P=null;return d(u,E,P,h);function d(v,x,A,H,M){return X(v,x,A,function(b){if(b&&(b.code==="EMFILE"||b.code==="ENFILE"))x4([d,[v,x,A,H],b,M||Date.now(),Date.now()]);else if(typeof H==="function")H.apply(this,arguments)})}}var Q=D.appendFile;if(Q)D.appendFile=Y;function Y(u,E,P,h){if(typeof P==="function")h=P,P=null;return d(u,E,P,h);function d(v,x,A,H,M){return Q(v,x,A,function(b){if(b&&(b.code==="EMFILE"||b.code==="ENFILE"))x4([d,[v,x,A,H],b,M||Date.now(),Date.now()]);else if(typeof H==="function")H.apply(this,arguments)})}}var J=D.copyFile;if(J)D.copyFile=q;function q(u,E,P,h){if(typeof P==="function")h=P,P=0;return d(u,E,P,h);function d(v,x,A,H,M){return J(v,x,A,function(b){if(b&&(b.code==="EMFILE"||b.code==="ENFILE"))x4([d,[v,x,A,H],b,M||Date.now(),Date.now()]);else if(typeof H==="function")H.apply(this,arguments)})}}var z=D.readdir;D.readdir=I;var W=/^v[0-5]\./;function I(u,E,P){if(typeof E==="function")P=E,E=null;var h=W.test(process.version)?function(x,A,H,M){return z(x,d(x,A,H,M))}:function(x,A,H,M){return z(x,A,d(x,A,H,M))};return h(u,E,P);function d(v,x,A,H){return function(M,b){if(M&&(M.code==="EMFILE"||M.code==="ENFILE"))x4([h,[v,x,A],M,H||Date.now(),Date.now()]);else{if(b&&b.sort)b.sort();if(typeof A==="function")A.call(this,M,b)}}}}if(process.version.substr(0,4)==="v0.8"){var G=Ep(D);L=G.ReadStream,w=G.WriteStream}var V=D.ReadStream;if(V)L.prototype=Object.create(V.prototype),L.prototype.open=O;var Z=D.WriteStream;if(Z)w.prototype=Object.create(Z.prototype),w.prototype.open=N;Object.defineProperty(D,"ReadStream",{get:function(){return L},set:function(u){L=u},enumerable:!0,configurable:!0}),Object.defineProperty(D,"WriteStream",{get:function(){return w},set:function(u){w=u},enumerable:!0,configurable:!0});var K=L;Object.defineProperty(D,"FileReadStream",{get:function(){return K},set:function(u){K=u},enumerable:!0,configurable:!0});var B=w;Object.defineProperty(D,"FileWriteStream",{get:function(){return B},set:function(u){B=u},enumerable:!0,configurable:!0});function L(u,E){if(this instanceof L)return V.apply(this,arguments),this;else return L.apply(Object.create(L.prototype),arguments)}function O(){var u=this;T(u.path,u.flags,u.mode,function(E,P){if(E){if(u.autoClose)u.destroy();u.emit("error",E)}else u.fd=P,u.emit("open",P),u.read()})}function w(u,E){if(this instanceof w)return Z.apply(this,arguments),this;else return w.apply(Object.create(w.prototype),arguments)}function N(){var u=this;T(u.path,u.flags,u.mode,function(E,P){if(E)u.destroy(),u.emit("error",E);else u.fd=P,u.emit("open",P)})}function R(u,E){return new D.ReadStream(u,E)}function j(u,E){return new D.WriteStream(u,E)}var C=D.open;D.open=T;function T(u,E,P,h){if(typeof P==="function")h=P,P=null;return d(u,E,P,h);function d(v,x,A,H,M){return C(v,x,A,function(b,m){if(b&&(b.code==="EMFILE"||b.code==="ENFILE"))x4([d,[v,x,A,H],b,M||Date.now(),Date.now()]);else if(typeof H==="function")H.apply(this,arguments)})}}return D}function x4(D){J1("ENQUEUE",D[0].name,D[1]),hD[Q0].push(D),gY()}var K7;function NE(){var D=Date.now();for(var $=0;$<hD[Q0].length;++$)if(hD[Q0][$].length>2)hD[Q0][$][3]=D,hD[Q0][$][4]=D;gY()}function gY(){if(clearTimeout(K7),K7=void 0,hD[Q0].length===0)return;var D=hD[Q0].shift(),$=D[0],U=D[1],X=D[2],F=D[3],Q=D[4];if(F===void 0)J1("RETRY",$.name,U),$.apply(null,U);else if(Date.now()-F>=60000){J1("TIMEOUT",$.name,U);var Y=U.pop();if(typeof Y==="function")Y.call(null,X)}else{var J=Date.now()-Q,q=Math.max(Q-F,1),z=Math.min(q*1.2,100);if(J>=z)J1("RETRY",$.name,U),$.apply(null,U.concat([F]));else hD[Q0].push(D)}if(K7===void 0)K7=setTimeout(gY,0)}});var AE=S((yVD,EE)=>{function r0(D,$){if(typeof $==="boolean")$={forever:$};if(this._originalTimeouts=JSON.parse(JSON.stringify(D)),this._timeouts=D,this._options=$||{},this._maxRetryTime=$&&$.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever)this._cachedTimeouts=this._timeouts.slice(0)}EE.exports=r0;r0.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};r0.prototype.stop=function(){if(this._timeout)clearTimeout(this._timeout);this._timeouts=[],this._cachedTimeouts=null};r0.prototype.retry=function(D){if(this._timeout)clearTimeout(this._timeout);if(!D)return!1;var $=new Date().getTime();if(D&&$-this._operationStart>=this._maxRetryTime)return this._errors.unshift(Error("RetryOperation timeout occurred")),!1;this._errors.push(D);var U=this._timeouts.shift();if(U===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),U=this._timeouts.shift();else return!1;var X=this,F=setTimeout(function(){if(X._attempts++,X._operationTimeoutCb){if(X._timeout=setTimeout(function(){X._operationTimeoutCb(X._attempts)},X._operationTimeout),X._options.unref)X._timeout.unref()}X._fn(X._attempts)},U);if(this._options.unref)F.unref();return!0};r0.prototype.attempt=function(D,$){if(this._fn=D,$){if($.timeout)this._operationTimeout=$.timeout;if($.cb)this._operationTimeoutCb=$.cb}var U=this;if(this._operationTimeoutCb)this._timeout=setTimeout(function(){U._operationTimeoutCb()},U._operationTimeout);this._operationStart=new Date().getTime(),this._fn(this._attempts)};r0.prototype.try=function(D){console.log("Using RetryOperation.try() is deprecated"),this.attempt(D)};r0.prototype.start=function(D){console.log("Using RetryOperation.start() is deprecated"),this.attempt(D)};r0.prototype.start=r0.prototype.try;r0.prototype.errors=function(){return this._errors};r0.prototype.attempts=function(){return this._attempts};r0.prototype.mainError=function(){if(this._errors.length===0)return null;var D={},$=null,U=0;for(var X=0;X<this._errors.length;X++){var F=this._errors[X],Q=F.message,Y=(D[Q]||0)+1;if(D[Q]=Y,Y>=U)$=F,U=Y}return $}});var jE=S((Sp)=>{var jp=AE();Sp.operation=function(D){var $=Sp.timeouts(D);return new jp($,{forever:D&&D.forever,unref:D&&D.unref,maxRetryTime:D&&D.maxRetryTime})};Sp.timeouts=function(D){if(D instanceof Array)return[].concat(D);var $={retries:10,factor:2,minTimeout:1000,maxTimeout:1/0,randomize:!1};for(var U in D)$[U]=D[U];if($.minTimeout>$.maxTimeout)throw Error("minTimeout is greater than maxTimeout");var X=[];for(var F=0;F<$.retries;F++)X.push(this.createTimeout(F,$));if(D&&D.forever&&!X.length)X.push(this.createTimeout(F,$));return X.sort(function(Q,Y){return Q-Y}),X};Sp.createTimeout=function(D,$){var U=$.randomize?Math.random()+1:1,X=Math.round(U*$.minTimeout*Math.pow($.factor,D));return X=Math.min(X,$.maxTimeout),X};Sp.wrap=function(D,$,U){if($ instanceof Array)U=$,$=null;if(!U){U=[];for(var X in D)if(typeof D[X]==="function")U.push(X)}for(var F=0;F<U.length;F++){var Q=U[F],Y=D[Q];D[Q]=function(q){var z=Sp.operation($),W=Array.prototype.slice.call(arguments,1),I=W.pop();W.push(function(G){if(z.retry(G))return;if(G)arguments[0]=z.mainError();I.apply(this,arguments)}),z.attempt(function(){q.apply(D,W)})}.bind(D,Y),D[Q].options=$}}});var SE=S((hVD,H7)=>{H7.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32")H7.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")H7.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var lY=S((dVD,k4)=>{var fD=global.process,q1=function(D){return D&&typeof D==="object"&&typeof D.removeListener==="function"&&typeof D.emit==="function"&&typeof D.reallyExit==="function"&&typeof D.listeners==="function"&&typeof D.kill==="function"&&typeof D.pid==="number"&&typeof D.on==="function"};if(!q1(fD))k4.exports=function(){return function(){}};else{if(yY=e("assert"),z1=SE(),mY=/^win/i.test(fD.platform),_4=e("events"),typeof _4!=="function")_4=_4.EventEmitter;if(fD.__signal_exit_emitter__)eD=fD.__signal_exit_emitter__;else eD=fD.__signal_exit_emitter__=new _4,eD.count=0,eD.emitted={};if(!eD.infinite)eD.setMaxListeners(1/0),eD.infinite=!0;k4.exports=function(D,$){if(!q1(global.process))return function(){};if(yY.equal(typeof D,"function","a callback must be provided for exit handler"),W1===!1)L7();var U="exit";if($&&$.alwaysLast)U="afterexit";var X=function(){if(eD.removeListener(U,D),eD.listeners("exit").length===0&&eD.listeners("afterexit").length===0)$3()};return eD.on(U,D),X},$3=function(){if(!W1||!q1(global.process))return;W1=!1,z1.forEach(function($){try{fD.removeListener($,U3[$])}catch(U){}}),fD.emit=F3,fD.reallyExit=O7,eD.count-=1},k4.exports.unload=$3,J6=function($,U,X){if(eD.emitted[$])return;eD.emitted[$]=!0,eD.emit($,U,X)},U3={},z1.forEach(function(D){U3[D]=function(){if(!q1(global.process))return;var U=fD.listeners(D);if(U.length===eD.count){if($3(),J6("exit",null,D),J6("afterexit",null,D),mY&&D==="SIGHUP")D="SIGINT";fD.kill(fD.pid,D)}}}),k4.exports.signals=function(){return z1},W1=!1,L7=function(){if(W1||!q1(global.process))return;W1=!0,eD.count+=1,z1=z1.filter(function($){try{return fD.on($,U3[$]),!0}catch(U){return!1}}),fD.emit=dY,fD.reallyExit=hY},k4.exports.load=L7,O7=fD.reallyExit,hY=function($){if(!q1(global.process))return;fD.exitCode=$||0,J6("exit",fD.exitCode,null),J6("afterexit",fD.exitCode,null),O7.call(fD,fD.exitCode)},F3=fD.emit,dY=function($,U){if($==="exit"&&q1(global.process)){if(U!==void 0)fD.exitCode=U;var X=F3.apply(this,arguments);return J6("exit",fD.exitCode,null),J6("afterexit",fD.exitCode,null),X}else return F3.apply(this,arguments)}}var yY,z1,mY,_4,eD,$3,J6,U3,W1,L7,O7,hY,F3,dY});var PE=S((up,cY)=>{var TE=Symbol();function vp(D,$,U){let X=$[TE];if(X)return $.stat(D,(Q,Y)=>{if(Q)return U(Q);U(null,Y.mtime,X)});let F=new Date(Math.ceil(Date.now()/1000)*1000+5);$.utimes(D,F,F,(Q)=>{if(Q)return U(Q);$.stat(D,(Y,J)=>{if(Y)return U(Y);let q=J.mtime.getTime()%1000===0?"s":"ms";Object.defineProperty($,TE,{value:q}),U(null,J.mtime,q)})})}function bp(D){let $=Date.now();if(D==="s")$=Math.ceil($/1000)*1000;return new Date($)}up.probe=vp;up.getMtime=bp});var xE=S((dp,Q3)=>{var kp=e("path"),pY=Y6(),gp=jE(),fp=lY(),CE=PE(),g$={};function X3(D,$){return $.lockfilePath||`${D}.lock`}function rY(D,$,U){if(!$.realpath)return U(null,kp.resolve(D));$.fs.realpath(D,U)}function iY(D,$,U){let X=X3(D,$);$.fs.mkdir(X,(F)=>{if(!F)return CE.probe(X,$.fs,(Q,Y,J)=>{if(Q)return $.fs.rmdir(X,()=>{}),U(Q);U(null,Y,J)});if(F.code!=="EEXIST")return U(F);if($.stale<=0)return U(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));$.fs.stat(X,(Q,Y)=>{if(Q){if(Q.code==="ENOENT")return iY(D,{...$,stale:0},U);return U(Q)}if(!vE(Y,$))return U(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));bE(D,$,(J)=>{if(J)return U(J);iY(D,{...$,stale:0},U)})})})}function vE(D,$){return D.mtime.getTime()<Date.now()-$.stale}function bE(D,$,U){$.fs.rmdir(X3(D,$),(X)=>{if(X&&X.code!=="ENOENT")return U(X);U()})}function N7(D,$){let U=g$[D];if(U.updateTimeout)return;if(U.updateDelay=U.updateDelay||$.update,U.updateTimeout=setTimeout(()=>{U.updateTimeout=null,$.fs.stat(U.lockfilePath,(X,F)=>{let Q=U.lastUpdate+$.stale<Date.now();if(X){if(X.code==="ENOENT"||Q)return nY(D,U,Object.assign(X,{code:"ECOMPROMISED"}));return U.updateDelay=1000,N7(D,$)}if(U.mtime.getTime()!==F.mtime.getTime())return nY(D,U,Object.assign(Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let J=CE.getMtime(U.mtimePrecision);$.fs.utimes(U.lockfilePath,J,J,(q)=>{let z=U.lastUpdate+$.stale<Date.now();if(U.released)return;if(q){if(q.code==="ENOENT"||z)return nY(D,U,Object.assign(q,{code:"ECOMPROMISED"}));return U.updateDelay=1000,N7(D,$)}U.mtime=J,U.lastUpdate=Date.now(),U.updateDelay=null,N7(D,$)})})},U.updateDelay),U.updateTimeout.unref)U.updateTimeout.unref()}function nY(D,$,U){if($.released=!0,$.updateTimeout)clearTimeout($.updateTimeout);if(g$[D]===$)delete g$[D];$.options.onCompromised(U)}function yp(D,$,U){$={stale:1e4,update:null,realpath:!0,retries:0,fs:pY,onCompromised:(X)=>{throw X},...$},$.retries=$.retries||0,$.retries=typeof $.retries==="number"?{retries:$.retries}:$.retries,$.stale=Math.max($.stale||0,2000),$.update=$.update==null?$.stale/2:$.update||0,$.update=Math.max(Math.min($.update,$.stale/2),1000),rY(D,$,(X,F)=>{if(X)return U(X);let Q=gp.operation($.retries);Q.attempt(()=>{iY(F,$,(Y,J,q)=>{if(Q.retry(Y))return;if(Y)return U(Q.mainError());let z=g$[F]={lockfilePath:X3(F,$),mtime:J,mtimePrecision:q,options:$,lastUpdate:Date.now()};N7(F,$),U(null,(W)=>{if(z.released)return W&&W(Object.assign(Error("Lock is already released"),{code:"ERELEASED"}));uE(F,{...$,realpath:!1},W)})})})})}function uE(D,$,U){$={fs:pY,realpath:!0,...$},rY(D,$,(X,F)=>{if(X)return U(X);let Q=g$[F];if(!Q)return U(Object.assign(Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));Q.updateTimeout&&clearTimeout(Q.updateTimeout),Q.released=!0,delete g$[F],bE(F,$,U)})}function mp(D,$,U){$={stale:1e4,realpath:!0,fs:pY,...$},$.stale=Math.max($.stale||0,2000),rY(D,$,(X,F)=>{if(X)return U(X);$.fs.stat(X3(F,$),(Q,Y)=>{if(Q)return Q.code==="ENOENT"?U(null,!1):U(Q);return U(null,!vE(Y,$))})})}function hp(){return g$}fp(()=>{for(let D in g$){let $=g$[D].options;try{$.fs.rmdirSync(X3(D,$))}catch(U){}}});dp.lock=yp;dp.unlock=uE;dp.check=mp;dp.getLocks=hp});var kE=S((lVD,_E)=>{var pp=Y6();function rp(D){let $=["mkdir","realpath","stat","rmdir","utimes"],U={...D};return $.forEach((X)=>{U[X]=(...F)=>{let Q=F.pop(),Y;try{Y=D[`${X}Sync`](...F)}catch(J){return Q(J)}Q(null,Y)}}),U}function ap(D){return(...$)=>new Promise((U,X)=>{$.push((F,Q)=>{if(F)X(F);else U(Q)}),D(...$)})}function op(D){return(...$)=>{let U,X;if($.push((F,Q)=>{U=F,X=Q}),D(...$),U)throw U;return X}}function tp(D){if(D={...D},D.fs=rp(D.fs||pp),typeof D.retries==="number"&&D.retries>0||D.retries&&typeof D.retries.retries==="number"&&D.retries.retries>0)throw Object.assign(Error("Cannot use retries with the sync api"),{code:"ESYNC"});return D}_E.exports={toPromise:ap,toSync:op,toSyncOptions:tp}});var fE=S((cVD,q6)=>{var g4=xE(),{toPromise:M7,toSync:E7,toSyncOptions:aY}=kE();async function gE(D,$){let U=await M7(g4.lock)(D,$);return M7(U)}function sp(D,$){let U=E7(g4.lock)(D,aY($));return E7(U)}function ep(D,$){return M7(g4.unlock)(D,$)}function Dr(D,$){return E7(g4.unlock)(D,aY($))}function $r(D,$){return M7(g4.check)(D,$)}function Ur(D,$){return E7(g4.check)(D,aY($))}q6.exports=gE;q6.exports.lock=gE;q6.exports.unlock=ep;q6.exports.lockSync=sp;q6.exports.unlockSync=Dr;q6.exports.check=$r;q6.exports.checkSync=Ur});var nE=S((lE)=>{Object.defineProperty(lE,"__esModule",{value:!0});lE.canStoreURLs=lE.FileUrlStorage=void 0;var yE=e("fs"),Fr=Qr(ZE()),mE=Xr(fE());function dE(D){if(typeof WeakMap!="function")return null;var $=new WeakMap,U=new WeakMap;return(dE=function(X){return X?U:$})(D)}function Xr(D,$){if(!$&&D&&D.__esModule)return D;if(D===null||typeof D!="object"&&typeof D!="function")return{default:D};var U=dE($);if(U&&U.has(D))return U.get(D);var X={__proto__:null},F=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Q in D)if(Q!=="default"&&{}.hasOwnProperty.call(D,Q)){var Y=F?Object.getOwnPropertyDescriptor(D,Q):null;Y&&(Y.get||Y.set)?Object.defineProperty(X,Q,Y):X[Q]=D[Q]}return X.default=D,U&&U.set(D,X),X}function Qr(D){return D&&D.__esModule?D:{default:D}}function Y3(D){return Y3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},Y3(D)}function Yr(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function hE(D,$){for(var U=0;U<$.length;U++){var X=$[U];if(X.enumerable=X.enumerable||!1,X.configurable=!0,"value"in X)X.writable=!0;Object.defineProperty(D,qr(X.key),X)}}function Jr(D,$,U){if($)hE(D.prototype,$);if(U)hE(D,U);return Object.defineProperty(D,"prototype",{writable:!1}),D}function qr(D){var $=zr(D,"string");return Y3($)=="symbol"?$:$+""}function zr(D,$){if(Y3(D)!="object"||!D)return D;var U=D[Symbol.toPrimitive];if(U!==void 0){var X=U.call(D,$||"default");if(Y3(X)!="object")return X;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var nVD=lE.canStoreURLs=!0,iVD=lE.FileUrlStorage=function(){function D($){Yr(this,D),this.path=$}return Jr(D,[{key:"findAllUploads",value:function(){var U=this;return new Promise(function(X,F){U._getItems("tus::",function(Q,Y){if(Q)F(Q);else X(Y)})})}},{key:"findUploadsByFingerprint",value:function(U){var X=this;return new Promise(function(F,Q){X._getItems("tus::".concat(U),function(Y,J){if(Y)Q(Y);else F(J)})})}},{key:"removeUpload",value:function(U){var X=this;return new Promise(function(F,Q){X._removeItem(U,function(Y){if(Y)Q(Y);else F()})})}},{key:"addUpload",value:function(U,X){var F=this,Q=Math.round(Math.random()*1000000000000),Y="tus::".concat(U,"::").concat(Q);return new Promise(function(J,q){F._setItem(Y,X,function(z){if(z)q(z);else J(Y)})})}},{key:"_setItem",value:function(U,X,F){var Q=this;mE.lock(this.path,this._lockfileOptions()).then(function(Y){F=Q._releaseAndCb(Y,F),Q._getData(function(J,q){if(J){F(J);return}q[U]=X,Q._writeData(q,function(z){return F(z)})})}).catch(F)}},{key:"_getItems",value:function(U,X){this._getData(function(F,Q){if(F){X(F);return}var Y=Object.keys(Q).filter(function(J){return J.startsWith(U)}).map(function(J){var q=Q[J];return q.urlStorageKey=J,q});X(null,Y)})}},{key:"_removeItem",value:function(U,X){var F=this;mE.lock(this.path,this._lockfileOptions()).then(function(Q){X=F._releaseAndCb(Q,X),F._getData(function(Y,J){if(Y){X(Y);return}delete J[U],F._writeData(J,function(q){return X(q)})})}).catch(X)}},{key:"_lockfileOptions",value:function(){return{realpath:!1,retries:{retries:5,minTimeout:20}}}},{key:"_releaseAndCb",value:function(U,X){return function(F){if(F){U().then(function(){return X(F)}).catch(function(Q){return X((0,Fr.default)([F,Q]))});return}U().then(X).catch(X)}}},{key:"_writeData",value:function(U,X){var F={encoding:"utf8",mode:432,flag:"w"};(0,yE.writeFile)(this.path,JSON.stringify(U),F,function(Q){return X(Q)})}},{key:"_getData",value:function(U){(0,yE.readFile)(this.path,"utf8",function(X,F){if(X){if(X.code==="ENOENT")U(null,{});else U(X);return}try{F=!F.trim().length?{}:JSON.parse(F)}catch(Q){U(Q);return}U(null,F)})}}])}()});var UA=S((z6)=>{Object.defineProperty(z6,"__esModule",{value:!0});Object.defineProperty(z6,"DefaultHttpStack",{enumerable:!0,get:function(){return aE.default}});Object.defineProperty(z6,"DetailedError",{enumerable:!0,get:function(){return Ir.default}});Object.defineProperty(z6,"FileUrlStorage",{enumerable:!0,get:function(){return oE.FileUrlStorage}});Object.defineProperty(z6,"StreamSource",{enumerable:!0,get:function(){return Kr.default}});z6.Upload=void 0;Object.defineProperty(z6,"canStoreURLs",{enumerable:!0,get:function(){return oE.canStoreURLs}});z6.defaultOptions=void 0;Object.defineProperty(z6,"enableDebugLog",{enumerable:!0,get:function(){return Gr.enableDebugLog}});z6.isSupported=void 0;var Ir=I1(rQ()),Gr=aQ(),Zr=I1(fO()),oY=I1(wN()),Vr=I1(gN()),Br=I1(dN()),aE=I1(XM()),Kr=I1(YY()),oE=nE();function I1(D){return D&&D.__esModule?D:{default:D}}function y4(D){return y4=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},y4(D)}function wr(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function iE(D,$){for(var U=0;U<$.length;U++){var X=$[U];if(X.enumerable=X.enumerable||!1,X.configurable=!0,"value"in X)X.writable=!0;Object.defineProperty(D,sE(X.key),X)}}function Hr(D,$,U){if($)iE(D.prototype,$);if(U)iE(D,U);return Object.defineProperty(D,"prototype",{writable:!1}),D}function Lr(D,$,U){return $=A7($),Or(D,tE()?Reflect.construct($,U||[],A7(D).constructor):$.apply(D,U))}function Or(D,$){if($&&(y4($)==="object"||typeof $==="function"))return $;else if($!==void 0)throw TypeError("Derived constructors may only return object or undefined");return Nr(D)}function Nr(D){if(D===void 0)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function tE(){try{var D=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch($){}return(tE=function(){return!!D})()}function A7(D){return A7=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(U){return U.__proto__||Object.getPrototypeOf(U)},A7(D)}function Mr(D,$){if(typeof $!=="function"&&$!==null)throw TypeError("Super expression must either be null or a function");if(D.prototype=Object.create($&&$.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),Object.defineProperty(D,"prototype",{writable:!1}),$)tY(D,$)}function tY(D,$){return tY=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(X,F){return X.__proto__=F,X},tY(D,$)}function pE(D,$){var U=Object.keys(D);if(Object.getOwnPropertySymbols){var X=Object.getOwnPropertySymbols(D);$&&(X=X.filter(function(F){return Object.getOwnPropertyDescriptor(D,F).enumerable})),U.push.apply(U,X)}return U}function f4(D){for(var $=1;$<arguments.length;$++){var U=arguments[$]!=null?arguments[$]:{};$%2?pE(Object(U),!0).forEach(function(X){Er(D,X,U[X])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(U)):pE(Object(U)).forEach(function(X){Object.defineProperty(D,X,Object.getOwnPropertyDescriptor(U,X))})}return D}function Er(D,$,U){if($=sE($),$ in D)Object.defineProperty(D,$,{value:U,enumerable:!0,configurable:!0,writable:!0});else D[$]=U;return D}function sE(D){var $=Ar(D,"string");return y4($)=="symbol"?$:$+""}function Ar(D,$){if(y4(D)!="object"||!D)return D;var U=D[Symbol.toPrimitive];if(U!==void 0){var X=U.call(D,$||"default");if(y4(X)!="object")return X;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var rE=z6.defaultOptions=f4(f4({},oY.default.defaultOptions),{},{httpStack:new aE.default,fileReader:new Vr.default,urlStorage:new Zr.default,fingerprint:Br.default}),rVD=z6.Upload=function(D){function $(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return wr(this,$),X=f4(f4({},rE),X),Lr(this,$,[U,X])}return Mr($,D),Hr($,null,[{key:"terminate",value:function(X){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return F=f4(f4({},rE),F),oY.default.terminate(X,F)}}])}(oY.default),aVD=z6.isSupported=!0});var X$;var m4=g(()=>{X$={name:"@capgo/cli",type:"module",version:"8.62.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-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: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-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-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 ND;var G1=g(()=>{ND=class ND extends Error{context;constructor(D,$){super(D);this.name="CliUserError",this.context=$}}});import{platform as jr}from"node:os";import{version as Sr}from"node:process";function FBD(D){XA=D}function Pr(D){for(let $=0;$<D.length;$++)if(D.charCodeAt($)>255)return!1;return!0}function FA(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 Cr(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 eY(D,$){if($===void 0||$===null){if(sY.has(D.toLowerCase()))throw new ND(FA(D));throw new ND(`HTTP header "${D}" is missing or invalid.`)}if(typeof $!=="string"){if(sY.has(D.toLowerCase()))throw new ND(FA(D));throw new ND(`HTTP header "${D}" is missing or invalid.`)}if(!Pr($)){if(sY.has(D.toLowerCase()))throw new ND(Cr(D));throw new ND(`HTTP header "${D}" contains invalid characters (only ASCII is allowed).`)}return $}function W6(D){let $={capgo_api:Tr,"x-cli-version":X$.version,"x-cli-command":XA,"x-cli-node":Sr,"x-cli-os":jr()};if(D)for(let[U,X]of Object.entries(D))$[U]=eY(U,X);return $}var Tr="2025-10-01",XA="",sY;var DJ=g(()=>{m4();G1();sY=new Set(["authorization","capgkey","x-capgo-log-token"])});import{execFileSync as _r}from"child_process";import kr from"path";function ur(D,$){if($===void 0)return!0;if(typeof $==="string")return D===$;if($ instanceof RegExp)return $.test(D);return $(D)}function xr(D,$,U){return{agent:{id:D.id,name:D.name},strategy:"environment",signal:$.name,value:U}}function yr(D,$){let U=[],X=YA($.command);for(let F of D)for(let Q of F.process??[]){if(!Q.pattern.test(X))continue;U.push(mr(F,Q,{...$,command:X}))}return U}function mr(D,$,U){return{agent:{id:D.id,name:D.name},strategy:"process-tree",signal:$.pattern.toString(),value:`${U.pid}:${U.command}`}}function QA(D,$){try{return _r("ps",["-o",`${$}=`,"-p",String(D)],{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return""}}function YA(D){return kr.basename(D.trim()).replace(/^-+/,"")}function JA(D={}){let $=D.agents??vr,U=D.strategies??hr(D.experimentalProcessTree),X={env:D.env??process.env,pid:D.pid??process.pid,agents:$,maxProcessDepth:D.maxProcessDepth??20},F=U.flatMap((Y)=>Y.detect(X)),Q=dr($,F,X.env);if(Q===void 0)return{detected:!1};return{detected:!0,agent:Q}}function hr(D=!1){let $=[new br];if(D)$.push(new fr);return $}function dr(D,$,U){let X=new Set($.map((F)=>F.agent.id));for(let F of D){if(!X.has(F.id))continue;return{id:F.id,name:F.name,...lr(F,U)}}return}function lr(D,$){for(let U of D.sessionEnv??[]){let X=$[U];if(X!==void 0&&X.length>0)return{sessionId:X}}return{}}var vr,br=class{name="environment";detect(D){let $=[];for(let U of D.agents)for(let X of U.env??[]){let F=D.env[X.name];if(F===void 0||!ur(F,X.value))continue;$.push(xr(U,X,F))}return $}},gr=class{read(D){let $=QA(D,"comm"),U=Number.parseInt(QA(D,"ppid"),10);if(!$||!Number.isInteger(U))return;return{pid:D,ppid:U,command:YA($)}}},fr=class{constructor(D=new gr){this.reader=D}reader;name="process-tree";detect(D){let $=[],U=D.pid;for(let X=0;X<D.maxProcessDepth;X+=1){let F=this.reader.read(U);if(F===void 0)break;if($.push(...yr(D.agents,F)),F.ppid===void 0||F.ppid<=1||F.ppid===U)break;U=F.ppid}return $}};var qA=g(()=>{vr=[{id:"codex",name:"Codex",env:[{name:"CODEX_CI",value:"1"},{name:"CODEX_SHELL",value:"1"},{name:"CODEX_THREAD_ID"}],process:[{pattern:/^codex$/i}],sessionEnv:["CODEX_THREAD_ID"]},{id:"cursor",name:"Cursor",env:[{name:"CURSOR_AGENT",value:"1"},{name:"CURSOR_CONVERSATION_ID"}],process:[{pattern:/^cursor$/i}],sessionEnv:["CURSOR_CONVERSATION_ID"]},{id:"claude-code",name:"Claude Code",env:[{name:"CLAUDECODE",value:"1"},{name:"CLAUDE_CODE_SESSION_ID"}],process:[{pattern:/^claude$/i}],sessionEnv:["CLAUDE_CODE_SESSION_ID"]},{id:"opencode",name:"OpenCode",env:[{name:"OPENCODE",value:"1"},{name:"OPENCODE_PID"}],process:[{pattern:/^opencode$/i}]},{id:"devin",name:"Devin",process:[{pattern:/devin/i}]},{id:"gemini",name:"Gemini CLI",env:[{name:"GEMINI_CLI",value:"1"}],process:[{pattern:/^gemini$/i}]},{id:"antigravity",name:"Antigravity",env:[{name:"ANTIGRAVITY_AGENT",value:"1"},{name:"ANTIGRAVITY_TRAJECTORY_ID"}],process:[{pattern:/^antigravity$/i}],sessionEnv:["ANTIGRAVITY_TRAJECTORY_ID"]},{id:"bolt",name:"Bolt",env:[{name:"BOLT_ENV"},{name:"BOLT_ORIGIN"},{name:"BOLT_SERVER_URL"}]},{id:"pi",name:"Pi",env:[{name:"PI_CODING_AGENT",value:"true"}]},{id:"replit",name:"Replit",env:[{name:"REPLIT_SESSION"}],sessionEnv:["REPLIT_SESSION"]},{id:"rork",name:"Rork",env:[{name:"RORK_API_URL"}]},{id:"kiro",name:"Kiro",env:[{name:"KIRO_SESSION_ID"}],process:[{pattern:/kiro/i}],sessionEnv:["KIRO_SESSION_ID"]},{id:"muse",name:"Muse Code",env:[{name:"MUSE_RELEASE_INFO"}]},{id:"cline",name:"Cline",env:[{name:"CLINE_WRAPPER_PATH"}],process:[{pattern:/^cline$/i}]},{id:"kilocode",name:"Kilo Code",env:[{name:"KILO",value:"1"},{name:"KILOCODE_VERSION"},{name:"KILO_RUN_ID"}],process:[{pattern:/^(kilo|kilocode)$/i}],sessionEnv:["KILO_RUN_ID"]},{id:"copilot",name:"GitHub Copilot CLI",env:[{name:"COPILOT_CLI",value:"1"},{name:"COPILOT_AGENT_SESSION_ID"},{name:"COPILOT_RUN_APP",value:"1"}],process:[{pattern:/^(github-copilot-cli|copilot)$/i}],sessionEnv:["COPILOT_AGENT_SESSION_ID"]}]});import{platform as cr,release as nr}from"node:os";import{arch as ir,env as pr,version as rr}from"node:process";function BBD(D){$J=D}function KBD(){return $J}function zA(D=pr){let $=JA({env:D}),U={cli_version:X$.version,node_version:rr,os_platform:cr(),os_arch:ir,os_release:nr(),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone||"undefined",is_ci:J3.isCI,is_tty:Boolean(process.stdout.isTTY),invocation_source:$J,agent_invoker:$.detected};if($.detected&&$.agent)U.agent_identity=$.agent;if(J3.name)U.ci_provider=J3.name;return U}var J3,$J="cli";var WA=g(()=>{qA();m4();J3=j0(hQ(),1)});import{AsyncLocalStorage as ar}from"node:async_hooks";function LBD(D,$){return GA.run(D,()=>Promise.resolve($()))}function or(){return GA.getStore()}function OBD(){ZA=!0}function VA(){return ZA}function NBD(D){BA=D}function IA(D){try{BA?.(D)}catch{}}function EBD(D,$){let U;try{U=new URL(D).pathname}catch{U=D.split("?")[0]}let X="/functions/v1/",F=U.indexOf(X);if(F>=0){let z=U.slice(F+X.length),W=0,I=z.length;while(W<I&&z[W]==="/")W+=1;while(I>W&&z[I-1]==="/")I-=1;let G=z.slice(W,I);return G?`${$} functions:${G}`:`${$} functions`}let Q="/rest/v1/",Y=U.indexOf(Q),J=Y>=0?U.slice(Y+Q.length):U.replace(/^\//,"");if(J.startsWith("rpc/"))return`rpc:${J.slice(4).split("/")[0]}`;let q=J.split("/")[0]||U;return`${$} ${q}`}function tr(D){let $=D?.headers;if(!$)return;let U=$.get;if(typeof U==="function")return U.call($,"capgkey")??void 0;if(Array.isArray($))return $.find(([X])=>X.toLowerCase()==="capgkey")?.[1];return $.capgkey}function KA(){return async($,U)=>{let X=(U?.method??"GET").toUpperCase(),F=typeof $==="string"?$:$ instanceof URL?$.href:$.url,Q=or(),Y=tr(U),J=Date.now();try{let q=await globalThis.fetch($,U);return IA({url:F,method:X,status:q.status,ok:q.ok,durationMs:Date.now()-J,source:Q,apikey:Y}),q}catch(q){throw IA({url:F,method:X,status:0,ok:!1,durationMs:Date.now()-J,source:Q,apikey:Y,error:q}),q}}}var GA,ZA=!1,BA,MBD=5000;var wA=g(()=>{GA=new ar});function sr(D,$){if(!N2(D)||!N2($))return!1;return c6($$(D),$$($))}function er(D,$,U){let X=U?.trim()?`
89
+ GFS4: `),console.error(D)};if(!hD[Q0]){if(_Y=global[Q0]||[],ME(hD,_Y),hD.close=function(D){function $(U,X){return D.call(hD,U,function(F){if(!F)NE();if(typeof X==="function")X.apply(this,arguments)})}return Object.defineProperty($,w7,{value:D}),$}(hD.close),hD.closeSync=function(D){function $(U){D.apply(hD,arguments),NE()}return Object.defineProperty($,w7,{value:D}),$}(hD.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){J1(hD[Q0]),e("assert").equal(hD[Q0].length,0)})}var _Y;if(!global[Q0])ME(global,hD[Q0]);fY.exports=kY(Ap(hD));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!hD.__patched)fY.exports=kY(hD),hD.__patched=!0;function kY(D){Mp(D),D.gracefulify=kY,D.createReadStream=R,D.createWriteStream=j;var $=D.readFile;D.readFile=U;function U(u,E,P){if(typeof E==="function")P=E,E=null;return h(u,E,P);function h(d,v,x,A){return $(d,v,function(H){if(H&&(H.code==="EMFILE"||H.code==="ENFILE"))x4([h,[d,v,x],H,A||Date.now(),Date.now()]);else if(typeof x==="function")x.apply(this,arguments)})}}var X=D.writeFile;D.writeFile=F;function F(u,E,P,h){if(typeof P==="function")h=P,P=null;return d(u,E,P,h);function d(v,x,A,H,M){return X(v,x,A,function(b){if(b&&(b.code==="EMFILE"||b.code==="ENFILE"))x4([d,[v,x,A,H],b,M||Date.now(),Date.now()]);else if(typeof H==="function")H.apply(this,arguments)})}}var Q=D.appendFile;if(Q)D.appendFile=Y;function Y(u,E,P,h){if(typeof P==="function")h=P,P=null;return d(u,E,P,h);function d(v,x,A,H,M){return Q(v,x,A,function(b){if(b&&(b.code==="EMFILE"||b.code==="ENFILE"))x4([d,[v,x,A,H],b,M||Date.now(),Date.now()]);else if(typeof H==="function")H.apply(this,arguments)})}}var J=D.copyFile;if(J)D.copyFile=q;function q(u,E,P,h){if(typeof P==="function")h=P,P=0;return d(u,E,P,h);function d(v,x,A,H,M){return J(v,x,A,function(b){if(b&&(b.code==="EMFILE"||b.code==="ENFILE"))x4([d,[v,x,A,H],b,M||Date.now(),Date.now()]);else if(typeof H==="function")H.apply(this,arguments)})}}var z=D.readdir;D.readdir=I;var W=/^v[0-5]\./;function I(u,E,P){if(typeof E==="function")P=E,E=null;var h=W.test(process.version)?function(x,A,H,M){return z(x,d(x,A,H,M))}:function(x,A,H,M){return z(x,A,d(x,A,H,M))};return h(u,E,P);function d(v,x,A,H){return function(M,b){if(M&&(M.code==="EMFILE"||M.code==="ENFILE"))x4([h,[v,x,A],M,H||Date.now(),Date.now()]);else{if(b&&b.sort)b.sort();if(typeof A==="function")A.call(this,M,b)}}}}if(process.version.substr(0,4)==="v0.8"){var G=Ep(D);L=G.ReadStream,w=G.WriteStream}var V=D.ReadStream;if(V)L.prototype=Object.create(V.prototype),L.prototype.open=O;var Z=D.WriteStream;if(Z)w.prototype=Object.create(Z.prototype),w.prototype.open=N;Object.defineProperty(D,"ReadStream",{get:function(){return L},set:function(u){L=u},enumerable:!0,configurable:!0}),Object.defineProperty(D,"WriteStream",{get:function(){return w},set:function(u){w=u},enumerable:!0,configurable:!0});var K=L;Object.defineProperty(D,"FileReadStream",{get:function(){return K},set:function(u){K=u},enumerable:!0,configurable:!0});var B=w;Object.defineProperty(D,"FileWriteStream",{get:function(){return B},set:function(u){B=u},enumerable:!0,configurable:!0});function L(u,E){if(this instanceof L)return V.apply(this,arguments),this;else return L.apply(Object.create(L.prototype),arguments)}function O(){var u=this;T(u.path,u.flags,u.mode,function(E,P){if(E){if(u.autoClose)u.destroy();u.emit("error",E)}else u.fd=P,u.emit("open",P),u.read()})}function w(u,E){if(this instanceof w)return Z.apply(this,arguments),this;else return w.apply(Object.create(w.prototype),arguments)}function N(){var u=this;T(u.path,u.flags,u.mode,function(E,P){if(E)u.destroy(),u.emit("error",E);else u.fd=P,u.emit("open",P)})}function R(u,E){return new D.ReadStream(u,E)}function j(u,E){return new D.WriteStream(u,E)}var C=D.open;D.open=T;function T(u,E,P,h){if(typeof P==="function")h=P,P=null;return d(u,E,P,h);function d(v,x,A,H,M){return C(v,x,A,function(b,m){if(b&&(b.code==="EMFILE"||b.code==="ENFILE"))x4([d,[v,x,A,H],b,M||Date.now(),Date.now()]);else if(typeof H==="function")H.apply(this,arguments)})}}return D}function x4(D){J1("ENQUEUE",D[0].name,D[1]),hD[Q0].push(D),gY()}var K7;function NE(){var D=Date.now();for(var $=0;$<hD[Q0].length;++$)if(hD[Q0][$].length>2)hD[Q0][$][3]=D,hD[Q0][$][4]=D;gY()}function gY(){if(clearTimeout(K7),K7=void 0,hD[Q0].length===0)return;var D=hD[Q0].shift(),$=D[0],U=D[1],X=D[2],F=D[3],Q=D[4];if(F===void 0)J1("RETRY",$.name,U),$.apply(null,U);else if(Date.now()-F>=60000){J1("TIMEOUT",$.name,U);var Y=U.pop();if(typeof Y==="function")Y.call(null,X)}else{var J=Date.now()-Q,q=Math.max(Q-F,1),z=Math.min(q*1.2,100);if(J>=z)J1("RETRY",$.name,U),$.apply(null,U.concat([F]));else hD[Q0].push(D)}if(K7===void 0)K7=setTimeout(gY,0)}});var AE=S((yVD,EE)=>{function r0(D,$){if(typeof $==="boolean")$={forever:$};if(this._originalTimeouts=JSON.parse(JSON.stringify(D)),this._timeouts=D,this._options=$||{},this._maxRetryTime=$&&$.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever)this._cachedTimeouts=this._timeouts.slice(0)}EE.exports=r0;r0.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};r0.prototype.stop=function(){if(this._timeout)clearTimeout(this._timeout);this._timeouts=[],this._cachedTimeouts=null};r0.prototype.retry=function(D){if(this._timeout)clearTimeout(this._timeout);if(!D)return!1;var $=new Date().getTime();if(D&&$-this._operationStart>=this._maxRetryTime)return this._errors.unshift(Error("RetryOperation timeout occurred")),!1;this._errors.push(D);var U=this._timeouts.shift();if(U===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),U=this._timeouts.shift();else return!1;var X=this,F=setTimeout(function(){if(X._attempts++,X._operationTimeoutCb){if(X._timeout=setTimeout(function(){X._operationTimeoutCb(X._attempts)},X._operationTimeout),X._options.unref)X._timeout.unref()}X._fn(X._attempts)},U);if(this._options.unref)F.unref();return!0};r0.prototype.attempt=function(D,$){if(this._fn=D,$){if($.timeout)this._operationTimeout=$.timeout;if($.cb)this._operationTimeoutCb=$.cb}var U=this;if(this._operationTimeoutCb)this._timeout=setTimeout(function(){U._operationTimeoutCb()},U._operationTimeout);this._operationStart=new Date().getTime(),this._fn(this._attempts)};r0.prototype.try=function(D){console.log("Using RetryOperation.try() is deprecated"),this.attempt(D)};r0.prototype.start=function(D){console.log("Using RetryOperation.start() is deprecated"),this.attempt(D)};r0.prototype.start=r0.prototype.try;r0.prototype.errors=function(){return this._errors};r0.prototype.attempts=function(){return this._attempts};r0.prototype.mainError=function(){if(this._errors.length===0)return null;var D={},$=null,U=0;for(var X=0;X<this._errors.length;X++){var F=this._errors[X],Q=F.message,Y=(D[Q]||0)+1;if(D[Q]=Y,Y>=U)$=F,U=Y}return $}});var jE=S((Sp)=>{var jp=AE();Sp.operation=function(D){var $=Sp.timeouts(D);return new jp($,{forever:D&&D.forever,unref:D&&D.unref,maxRetryTime:D&&D.maxRetryTime})};Sp.timeouts=function(D){if(D instanceof Array)return[].concat(D);var $={retries:10,factor:2,minTimeout:1000,maxTimeout:1/0,randomize:!1};for(var U in D)$[U]=D[U];if($.minTimeout>$.maxTimeout)throw Error("minTimeout is greater than maxTimeout");var X=[];for(var F=0;F<$.retries;F++)X.push(this.createTimeout(F,$));if(D&&D.forever&&!X.length)X.push(this.createTimeout(F,$));return X.sort(function(Q,Y){return Q-Y}),X};Sp.createTimeout=function(D,$){var U=$.randomize?Math.random()+1:1,X=Math.round(U*$.minTimeout*Math.pow($.factor,D));return X=Math.min(X,$.maxTimeout),X};Sp.wrap=function(D,$,U){if($ instanceof Array)U=$,$=null;if(!U){U=[];for(var X in D)if(typeof D[X]==="function")U.push(X)}for(var F=0;F<U.length;F++){var Q=U[F],Y=D[Q];D[Q]=function(q){var z=Sp.operation($),W=Array.prototype.slice.call(arguments,1),I=W.pop();W.push(function(G){if(z.retry(G))return;if(G)arguments[0]=z.mainError();I.apply(this,arguments)}),z.attempt(function(){q.apply(D,W)})}.bind(D,Y),D[Q].options=$}}});var SE=S((hVD,H7)=>{H7.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32")H7.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")H7.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var lY=S((dVD,k4)=>{var fD=global.process,q1=function(D){return D&&typeof D==="object"&&typeof D.removeListener==="function"&&typeof D.emit==="function"&&typeof D.reallyExit==="function"&&typeof D.listeners==="function"&&typeof D.kill==="function"&&typeof D.pid==="number"&&typeof D.on==="function"};if(!q1(fD))k4.exports=function(){return function(){}};else{if(yY=e("assert"),z1=SE(),mY=/^win/i.test(fD.platform),_4=e("events"),typeof _4!=="function")_4=_4.EventEmitter;if(fD.__signal_exit_emitter__)eD=fD.__signal_exit_emitter__;else eD=fD.__signal_exit_emitter__=new _4,eD.count=0,eD.emitted={};if(!eD.infinite)eD.setMaxListeners(1/0),eD.infinite=!0;k4.exports=function(D,$){if(!q1(global.process))return function(){};if(yY.equal(typeof D,"function","a callback must be provided for exit handler"),W1===!1)L7();var U="exit";if($&&$.alwaysLast)U="afterexit";var X=function(){if(eD.removeListener(U,D),eD.listeners("exit").length===0&&eD.listeners("afterexit").length===0)$3()};return eD.on(U,D),X},$3=function(){if(!W1||!q1(global.process))return;W1=!1,z1.forEach(function($){try{fD.removeListener($,U3[$])}catch(U){}}),fD.emit=F3,fD.reallyExit=O7,eD.count-=1},k4.exports.unload=$3,J6=function($,U,X){if(eD.emitted[$])return;eD.emitted[$]=!0,eD.emit($,U,X)},U3={},z1.forEach(function(D){U3[D]=function(){if(!q1(global.process))return;var U=fD.listeners(D);if(U.length===eD.count){if($3(),J6("exit",null,D),J6("afterexit",null,D),mY&&D==="SIGHUP")D="SIGINT";fD.kill(fD.pid,D)}}}),k4.exports.signals=function(){return z1},W1=!1,L7=function(){if(W1||!q1(global.process))return;W1=!0,eD.count+=1,z1=z1.filter(function($){try{return fD.on($,U3[$]),!0}catch(U){return!1}}),fD.emit=dY,fD.reallyExit=hY},k4.exports.load=L7,O7=fD.reallyExit,hY=function($){if(!q1(global.process))return;fD.exitCode=$||0,J6("exit",fD.exitCode,null),J6("afterexit",fD.exitCode,null),O7.call(fD,fD.exitCode)},F3=fD.emit,dY=function($,U){if($==="exit"&&q1(global.process)){if(U!==void 0)fD.exitCode=U;var X=F3.apply(this,arguments);return J6("exit",fD.exitCode,null),J6("afterexit",fD.exitCode,null),X}else return F3.apply(this,arguments)}}var yY,z1,mY,_4,eD,$3,J6,U3,W1,L7,O7,hY,F3,dY});var PE=S((up,cY)=>{var TE=Symbol();function vp(D,$,U){let X=$[TE];if(X)return $.stat(D,(Q,Y)=>{if(Q)return U(Q);U(null,Y.mtime,X)});let F=new Date(Math.ceil(Date.now()/1000)*1000+5);$.utimes(D,F,F,(Q)=>{if(Q)return U(Q);$.stat(D,(Y,J)=>{if(Y)return U(Y);let q=J.mtime.getTime()%1000===0?"s":"ms";Object.defineProperty($,TE,{value:q}),U(null,J.mtime,q)})})}function bp(D){let $=Date.now();if(D==="s")$=Math.ceil($/1000)*1000;return new Date($)}up.probe=vp;up.getMtime=bp});var xE=S((dp,Q3)=>{var kp=e("path"),pY=Y6(),gp=jE(),fp=lY(),CE=PE(),g$={};function X3(D,$){return $.lockfilePath||`${D}.lock`}function rY(D,$,U){if(!$.realpath)return U(null,kp.resolve(D));$.fs.realpath(D,U)}function iY(D,$,U){let X=X3(D,$);$.fs.mkdir(X,(F)=>{if(!F)return CE.probe(X,$.fs,(Q,Y,J)=>{if(Q)return $.fs.rmdir(X,()=>{}),U(Q);U(null,Y,J)});if(F.code!=="EEXIST")return U(F);if($.stale<=0)return U(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));$.fs.stat(X,(Q,Y)=>{if(Q){if(Q.code==="ENOENT")return iY(D,{...$,stale:0},U);return U(Q)}if(!vE(Y,$))return U(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));bE(D,$,(J)=>{if(J)return U(J);iY(D,{...$,stale:0},U)})})})}function vE(D,$){return D.mtime.getTime()<Date.now()-$.stale}function bE(D,$,U){$.fs.rmdir(X3(D,$),(X)=>{if(X&&X.code!=="ENOENT")return U(X);U()})}function N7(D,$){let U=g$[D];if(U.updateTimeout)return;if(U.updateDelay=U.updateDelay||$.update,U.updateTimeout=setTimeout(()=>{U.updateTimeout=null,$.fs.stat(U.lockfilePath,(X,F)=>{let Q=U.lastUpdate+$.stale<Date.now();if(X){if(X.code==="ENOENT"||Q)return nY(D,U,Object.assign(X,{code:"ECOMPROMISED"}));return U.updateDelay=1000,N7(D,$)}if(U.mtime.getTime()!==F.mtime.getTime())return nY(D,U,Object.assign(Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let J=CE.getMtime(U.mtimePrecision);$.fs.utimes(U.lockfilePath,J,J,(q)=>{let z=U.lastUpdate+$.stale<Date.now();if(U.released)return;if(q){if(q.code==="ENOENT"||z)return nY(D,U,Object.assign(q,{code:"ECOMPROMISED"}));return U.updateDelay=1000,N7(D,$)}U.mtime=J,U.lastUpdate=Date.now(),U.updateDelay=null,N7(D,$)})})},U.updateDelay),U.updateTimeout.unref)U.updateTimeout.unref()}function nY(D,$,U){if($.released=!0,$.updateTimeout)clearTimeout($.updateTimeout);if(g$[D]===$)delete g$[D];$.options.onCompromised(U)}function yp(D,$,U){$={stale:1e4,update:null,realpath:!0,retries:0,fs:pY,onCompromised:(X)=>{throw X},...$},$.retries=$.retries||0,$.retries=typeof $.retries==="number"?{retries:$.retries}:$.retries,$.stale=Math.max($.stale||0,2000),$.update=$.update==null?$.stale/2:$.update||0,$.update=Math.max(Math.min($.update,$.stale/2),1000),rY(D,$,(X,F)=>{if(X)return U(X);let Q=gp.operation($.retries);Q.attempt(()=>{iY(F,$,(Y,J,q)=>{if(Q.retry(Y))return;if(Y)return U(Q.mainError());let z=g$[F]={lockfilePath:X3(F,$),mtime:J,mtimePrecision:q,options:$,lastUpdate:Date.now()};N7(F,$),U(null,(W)=>{if(z.released)return W&&W(Object.assign(Error("Lock is already released"),{code:"ERELEASED"}));uE(F,{...$,realpath:!1},W)})})})})}function uE(D,$,U){$={fs:pY,realpath:!0,...$},rY(D,$,(X,F)=>{if(X)return U(X);let Q=g$[F];if(!Q)return U(Object.assign(Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));Q.updateTimeout&&clearTimeout(Q.updateTimeout),Q.released=!0,delete g$[F],bE(F,$,U)})}function mp(D,$,U){$={stale:1e4,realpath:!0,fs:pY,...$},$.stale=Math.max($.stale||0,2000),rY(D,$,(X,F)=>{if(X)return U(X);$.fs.stat(X3(F,$),(Q,Y)=>{if(Q)return Q.code==="ENOENT"?U(null,!1):U(Q);return U(null,!vE(Y,$))})})}function hp(){return g$}fp(()=>{for(let D in g$){let $=g$[D].options;try{$.fs.rmdirSync(X3(D,$))}catch(U){}}});dp.lock=yp;dp.unlock=uE;dp.check=mp;dp.getLocks=hp});var kE=S((lVD,_E)=>{var pp=Y6();function rp(D){let $=["mkdir","realpath","stat","rmdir","utimes"],U={...D};return $.forEach((X)=>{U[X]=(...F)=>{let Q=F.pop(),Y;try{Y=D[`${X}Sync`](...F)}catch(J){return Q(J)}Q(null,Y)}}),U}function ap(D){return(...$)=>new Promise((U,X)=>{$.push((F,Q)=>{if(F)X(F);else U(Q)}),D(...$)})}function op(D){return(...$)=>{let U,X;if($.push((F,Q)=>{U=F,X=Q}),D(...$),U)throw U;return X}}function tp(D){if(D={...D},D.fs=rp(D.fs||pp),typeof D.retries==="number"&&D.retries>0||D.retries&&typeof D.retries.retries==="number"&&D.retries.retries>0)throw Object.assign(Error("Cannot use retries with the sync api"),{code:"ESYNC"});return D}_E.exports={toPromise:ap,toSync:op,toSyncOptions:tp}});var fE=S((cVD,q6)=>{var g4=xE(),{toPromise:M7,toSync:E7,toSyncOptions:aY}=kE();async function gE(D,$){let U=await M7(g4.lock)(D,$);return M7(U)}function sp(D,$){let U=E7(g4.lock)(D,aY($));return E7(U)}function ep(D,$){return M7(g4.unlock)(D,$)}function Dr(D,$){return E7(g4.unlock)(D,aY($))}function $r(D,$){return M7(g4.check)(D,$)}function Ur(D,$){return E7(g4.check)(D,aY($))}q6.exports=gE;q6.exports.lock=gE;q6.exports.unlock=ep;q6.exports.lockSync=sp;q6.exports.unlockSync=Dr;q6.exports.check=$r;q6.exports.checkSync=Ur});var nE=S((lE)=>{Object.defineProperty(lE,"__esModule",{value:!0});lE.canStoreURLs=lE.FileUrlStorage=void 0;var yE=e("fs"),Fr=Qr(ZE()),mE=Xr(fE());function dE(D){if(typeof WeakMap!="function")return null;var $=new WeakMap,U=new WeakMap;return(dE=function(X){return X?U:$})(D)}function Xr(D,$){if(!$&&D&&D.__esModule)return D;if(D===null||typeof D!="object"&&typeof D!="function")return{default:D};var U=dE($);if(U&&U.has(D))return U.get(D);var X={__proto__:null},F=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Q in D)if(Q!=="default"&&{}.hasOwnProperty.call(D,Q)){var Y=F?Object.getOwnPropertyDescriptor(D,Q):null;Y&&(Y.get||Y.set)?Object.defineProperty(X,Q,Y):X[Q]=D[Q]}return X.default=D,U&&U.set(D,X),X}function Qr(D){return D&&D.__esModule?D:{default:D}}function Y3(D){return Y3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},Y3(D)}function Yr(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function hE(D,$){for(var U=0;U<$.length;U++){var X=$[U];if(X.enumerable=X.enumerable||!1,X.configurable=!0,"value"in X)X.writable=!0;Object.defineProperty(D,qr(X.key),X)}}function Jr(D,$,U){if($)hE(D.prototype,$);if(U)hE(D,U);return Object.defineProperty(D,"prototype",{writable:!1}),D}function qr(D){var $=zr(D,"string");return Y3($)=="symbol"?$:$+""}function zr(D,$){if(Y3(D)!="object"||!D)return D;var U=D[Symbol.toPrimitive];if(U!==void 0){var X=U.call(D,$||"default");if(Y3(X)!="object")return X;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var nVD=lE.canStoreURLs=!0,iVD=lE.FileUrlStorage=function(){function D($){Yr(this,D),this.path=$}return Jr(D,[{key:"findAllUploads",value:function(){var U=this;return new Promise(function(X,F){U._getItems("tus::",function(Q,Y){if(Q)F(Q);else X(Y)})})}},{key:"findUploadsByFingerprint",value:function(U){var X=this;return new Promise(function(F,Q){X._getItems("tus::".concat(U),function(Y,J){if(Y)Q(Y);else F(J)})})}},{key:"removeUpload",value:function(U){var X=this;return new Promise(function(F,Q){X._removeItem(U,function(Y){if(Y)Q(Y);else F()})})}},{key:"addUpload",value:function(U,X){var F=this,Q=Math.round(Math.random()*1000000000000),Y="tus::".concat(U,"::").concat(Q);return new Promise(function(J,q){F._setItem(Y,X,function(z){if(z)q(z);else J(Y)})})}},{key:"_setItem",value:function(U,X,F){var Q=this;mE.lock(this.path,this._lockfileOptions()).then(function(Y){F=Q._releaseAndCb(Y,F),Q._getData(function(J,q){if(J){F(J);return}q[U]=X,Q._writeData(q,function(z){return F(z)})})}).catch(F)}},{key:"_getItems",value:function(U,X){this._getData(function(F,Q){if(F){X(F);return}var Y=Object.keys(Q).filter(function(J){return J.startsWith(U)}).map(function(J){var q=Q[J];return q.urlStorageKey=J,q});X(null,Y)})}},{key:"_removeItem",value:function(U,X){var F=this;mE.lock(this.path,this._lockfileOptions()).then(function(Q){X=F._releaseAndCb(Q,X),F._getData(function(Y,J){if(Y){X(Y);return}delete J[U],F._writeData(J,function(q){return X(q)})})}).catch(X)}},{key:"_lockfileOptions",value:function(){return{realpath:!1,retries:{retries:5,minTimeout:20}}}},{key:"_releaseAndCb",value:function(U,X){return function(F){if(F){U().then(function(){return X(F)}).catch(function(Q){return X((0,Fr.default)([F,Q]))});return}U().then(X).catch(X)}}},{key:"_writeData",value:function(U,X){var F={encoding:"utf8",mode:432,flag:"w"};(0,yE.writeFile)(this.path,JSON.stringify(U),F,function(Q){return X(Q)})}},{key:"_getData",value:function(U){(0,yE.readFile)(this.path,"utf8",function(X,F){if(X){if(X.code==="ENOENT")U(null,{});else U(X);return}try{F=!F.trim().length?{}:JSON.parse(F)}catch(Q){U(Q);return}U(null,F)})}}])}()});var UA=S((z6)=>{Object.defineProperty(z6,"__esModule",{value:!0});Object.defineProperty(z6,"DefaultHttpStack",{enumerable:!0,get:function(){return aE.default}});Object.defineProperty(z6,"DetailedError",{enumerable:!0,get:function(){return Ir.default}});Object.defineProperty(z6,"FileUrlStorage",{enumerable:!0,get:function(){return oE.FileUrlStorage}});Object.defineProperty(z6,"StreamSource",{enumerable:!0,get:function(){return Kr.default}});z6.Upload=void 0;Object.defineProperty(z6,"canStoreURLs",{enumerable:!0,get:function(){return oE.canStoreURLs}});z6.defaultOptions=void 0;Object.defineProperty(z6,"enableDebugLog",{enumerable:!0,get:function(){return Gr.enableDebugLog}});z6.isSupported=void 0;var Ir=I1(rQ()),Gr=aQ(),Zr=I1(fO()),oY=I1(wN()),Vr=I1(gN()),Br=I1(dN()),aE=I1(XM()),Kr=I1(YY()),oE=nE();function I1(D){return D&&D.__esModule?D:{default:D}}function y4(D){return y4=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},y4(D)}function wr(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function iE(D,$){for(var U=0;U<$.length;U++){var X=$[U];if(X.enumerable=X.enumerable||!1,X.configurable=!0,"value"in X)X.writable=!0;Object.defineProperty(D,sE(X.key),X)}}function Hr(D,$,U){if($)iE(D.prototype,$);if(U)iE(D,U);return Object.defineProperty(D,"prototype",{writable:!1}),D}function Lr(D,$,U){return $=A7($),Or(D,tE()?Reflect.construct($,U||[],A7(D).constructor):$.apply(D,U))}function Or(D,$){if($&&(y4($)==="object"||typeof $==="function"))return $;else if($!==void 0)throw TypeError("Derived constructors may only return object or undefined");return Nr(D)}function Nr(D){if(D===void 0)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function tE(){try{var D=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch($){}return(tE=function(){return!!D})()}function A7(D){return A7=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(U){return U.__proto__||Object.getPrototypeOf(U)},A7(D)}function Mr(D,$){if(typeof $!=="function"&&$!==null)throw TypeError("Super expression must either be null or a function");if(D.prototype=Object.create($&&$.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),Object.defineProperty(D,"prototype",{writable:!1}),$)tY(D,$)}function tY(D,$){return tY=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(X,F){return X.__proto__=F,X},tY(D,$)}function pE(D,$){var U=Object.keys(D);if(Object.getOwnPropertySymbols){var X=Object.getOwnPropertySymbols(D);$&&(X=X.filter(function(F){return Object.getOwnPropertyDescriptor(D,F).enumerable})),U.push.apply(U,X)}return U}function f4(D){for(var $=1;$<arguments.length;$++){var U=arguments[$]!=null?arguments[$]:{};$%2?pE(Object(U),!0).forEach(function(X){Er(D,X,U[X])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(U)):pE(Object(U)).forEach(function(X){Object.defineProperty(D,X,Object.getOwnPropertyDescriptor(U,X))})}return D}function Er(D,$,U){if($=sE($),$ in D)Object.defineProperty(D,$,{value:U,enumerable:!0,configurable:!0,writable:!0});else D[$]=U;return D}function sE(D){var $=Ar(D,"string");return y4($)=="symbol"?$:$+""}function Ar(D,$){if(y4(D)!="object"||!D)return D;var U=D[Symbol.toPrimitive];if(U!==void 0){var X=U.call(D,$||"default");if(y4(X)!="object")return X;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var rE=z6.defaultOptions=f4(f4({},oY.default.defaultOptions),{},{httpStack:new aE.default,fileReader:new Vr.default,urlStorage:new Zr.default,fingerprint:Br.default}),rVD=z6.Upload=function(D){function $(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return wr(this,$),X=f4(f4({},rE),X),Lr(this,$,[U,X])}return Mr($,D),Hr($,null,[{key:"terminate",value:function(X){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return F=f4(f4({},rE),F),oY.default.terminate(X,F)}}])}(oY.default),aVD=z6.isSupported=!0});var X$;var m4=g(()=>{X$={name:"@capgo/cli",type:"module",version:"8.63.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-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: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-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.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 ND;var G1=g(()=>{ND=class ND extends Error{context;constructor(D,$){super(D);this.name="CliUserError",this.context=$}}});import{platform as jr}from"node:os";import{version as Sr}from"node:process";function FBD(D){XA=D}function Pr(D){for(let $=0;$<D.length;$++)if(D.charCodeAt($)>255)return!1;return!0}function FA(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 Cr(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 eY(D,$){if($===void 0||$===null){if(sY.has(D.toLowerCase()))throw new ND(FA(D));throw new ND(`HTTP header "${D}" is missing or invalid.`)}if(typeof $!=="string"){if(sY.has(D.toLowerCase()))throw new ND(FA(D));throw new ND(`HTTP header "${D}" is missing or invalid.`)}if(!Pr($)){if(sY.has(D.toLowerCase()))throw new ND(Cr(D));throw new ND(`HTTP header "${D}" contains invalid characters (only ASCII is allowed).`)}return $}function W6(D){let $={capgo_api:Tr,"x-cli-version":X$.version,"x-cli-command":XA,"x-cli-node":Sr,"x-cli-os":jr()};if(D)for(let[U,X]of Object.entries(D))$[U]=eY(U,X);return $}var Tr="2025-10-01",XA="",sY;var DJ=g(()=>{m4();G1();sY=new Set(["authorization","capgkey","x-capgo-log-token"])});import{execFileSync as _r}from"child_process";import kr from"path";function ur(D,$){if($===void 0)return!0;if(typeof $==="string")return D===$;if($ instanceof RegExp)return $.test(D);return $(D)}function xr(D,$,U){return{agent:{id:D.id,name:D.name},strategy:"environment",signal:$.name,value:U}}function yr(D,$){let U=[],X=YA($.command);for(let F of D)for(let Q of F.process??[]){if(!Q.pattern.test(X))continue;U.push(mr(F,Q,{...$,command:X}))}return U}function mr(D,$,U){return{agent:{id:D.id,name:D.name},strategy:"process-tree",signal:$.pattern.toString(),value:`${U.pid}:${U.command}`}}function QA(D,$){try{return _r("ps",["-o",`${$}=`,"-p",String(D)],{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return""}}function YA(D){return kr.basename(D.trim()).replace(/^-+/,"")}function JA(D={}){let $=D.agents??vr,U=D.strategies??hr(D.experimentalProcessTree),X={env:D.env??process.env,pid:D.pid??process.pid,agents:$,maxProcessDepth:D.maxProcessDepth??20},F=U.flatMap((Y)=>Y.detect(X)),Q=dr($,F,X.env);if(Q===void 0)return{detected:!1};return{detected:!0,agent:Q}}function hr(D=!1){let $=[new br];if(D)$.push(new fr);return $}function dr(D,$,U){let X=new Set($.map((F)=>F.agent.id));for(let F of D){if(!X.has(F.id))continue;return{id:F.id,name:F.name,...lr(F,U)}}return}function lr(D,$){for(let U of D.sessionEnv??[]){let X=$[U];if(X!==void 0&&X.length>0)return{sessionId:X}}return{}}var vr,br=class{name="environment";detect(D){let $=[];for(let U of D.agents)for(let X of U.env??[]){let F=D.env[X.name];if(F===void 0||!ur(F,X.value))continue;$.push(xr(U,X,F))}return $}},gr=class{read(D){let $=QA(D,"comm"),U=Number.parseInt(QA(D,"ppid"),10);if(!$||!Number.isInteger(U))return;return{pid:D,ppid:U,command:YA($)}}},fr=class{constructor(D=new gr){this.reader=D}reader;name="process-tree";detect(D){let $=[],U=D.pid;for(let X=0;X<D.maxProcessDepth;X+=1){let F=this.reader.read(U);if(F===void 0)break;if($.push(...yr(D.agents,F)),F.ppid===void 0||F.ppid<=1||F.ppid===U)break;U=F.ppid}return $}};var qA=g(()=>{vr=[{id:"codex",name:"Codex",env:[{name:"CODEX_CI",value:"1"},{name:"CODEX_SHELL",value:"1"},{name:"CODEX_THREAD_ID"}],process:[{pattern:/^codex$/i}],sessionEnv:["CODEX_THREAD_ID"]},{id:"cursor",name:"Cursor",env:[{name:"CURSOR_AGENT",value:"1"},{name:"CURSOR_CONVERSATION_ID"}],process:[{pattern:/^cursor$/i}],sessionEnv:["CURSOR_CONVERSATION_ID"]},{id:"claude-code",name:"Claude Code",env:[{name:"CLAUDECODE",value:"1"},{name:"CLAUDE_CODE_SESSION_ID"}],process:[{pattern:/^claude$/i}],sessionEnv:["CLAUDE_CODE_SESSION_ID"]},{id:"opencode",name:"OpenCode",env:[{name:"OPENCODE",value:"1"},{name:"OPENCODE_PID"}],process:[{pattern:/^opencode$/i}]},{id:"devin",name:"Devin",process:[{pattern:/devin/i}]},{id:"gemini",name:"Gemini CLI",env:[{name:"GEMINI_CLI",value:"1"}],process:[{pattern:/^gemini$/i}]},{id:"antigravity",name:"Antigravity",env:[{name:"ANTIGRAVITY_AGENT",value:"1"},{name:"ANTIGRAVITY_TRAJECTORY_ID"}],process:[{pattern:/^antigravity$/i}],sessionEnv:["ANTIGRAVITY_TRAJECTORY_ID"]},{id:"bolt",name:"Bolt",env:[{name:"BOLT_ENV"},{name:"BOLT_ORIGIN"},{name:"BOLT_SERVER_URL"}]},{id:"pi",name:"Pi",env:[{name:"PI_CODING_AGENT",value:"true"}]},{id:"replit",name:"Replit",env:[{name:"REPLIT_SESSION"}],sessionEnv:["REPLIT_SESSION"]},{id:"rork",name:"Rork",env:[{name:"RORK_API_URL"}]},{id:"kiro",name:"Kiro",env:[{name:"KIRO_SESSION_ID"}],process:[{pattern:/kiro/i}],sessionEnv:["KIRO_SESSION_ID"]},{id:"muse",name:"Muse Code",env:[{name:"MUSE_RELEASE_INFO"}]},{id:"cline",name:"Cline",env:[{name:"CLINE_WRAPPER_PATH"}],process:[{pattern:/^cline$/i}]},{id:"kilocode",name:"Kilo Code",env:[{name:"KILO",value:"1"},{name:"KILOCODE_VERSION"},{name:"KILO_RUN_ID"}],process:[{pattern:/^(kilo|kilocode)$/i}],sessionEnv:["KILO_RUN_ID"]},{id:"copilot",name:"GitHub Copilot CLI",env:[{name:"COPILOT_CLI",value:"1"},{name:"COPILOT_AGENT_SESSION_ID"},{name:"COPILOT_RUN_APP",value:"1"}],process:[{pattern:/^(github-copilot-cli|copilot)$/i}],sessionEnv:["COPILOT_AGENT_SESSION_ID"]}]});import{platform as cr,release as nr}from"node:os";import{arch as ir,env as pr,version as rr}from"node:process";function BBD(D){$J=D}function KBD(){return $J}function zA(D=pr){let $=JA({env:D}),U={cli_version:X$.version,node_version:rr,os_platform:cr(),os_arch:ir,os_release:nr(),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone||"undefined",is_ci:J3.isCI,is_tty:Boolean(process.stdout.isTTY),invocation_source:$J,agent_invoker:$.detected};if($.detected&&$.agent)U.agent_identity=$.agent;if(J3.name)U.ci_provider=J3.name;return U}var J3,$J="cli";var WA=g(()=>{qA();m4();J3=j0(hQ(),1)});import{AsyncLocalStorage as ar}from"node:async_hooks";function LBD(D,$){return GA.run(D,()=>Promise.resolve($()))}function or(){return GA.getStore()}function OBD(){ZA=!0}function VA(){return ZA}function NBD(D){BA=D}function IA(D){try{BA?.(D)}catch{}}function EBD(D,$){let U;try{U=new URL(D).pathname}catch{U=D.split("?")[0]}let X="/functions/v1/",F=U.indexOf(X);if(F>=0){let z=U.slice(F+X.length),W=0,I=z.length;while(W<I&&z[W]==="/")W+=1;while(I>W&&z[I-1]==="/")I-=1;let G=z.slice(W,I);return G?`${$} functions:${G}`:`${$} functions`}let Q="/rest/v1/",Y=U.indexOf(Q),J=Y>=0?U.slice(Y+Q.length):U.replace(/^\//,"");if(J.startsWith("rpc/"))return`rpc:${J.slice(4).split("/")[0]}`;let q=J.split("/")[0]||U;return`${$} ${q}`}function tr(D){let $=D?.headers;if(!$)return;let U=$.get;if(typeof U==="function")return U.call($,"capgkey")??void 0;if(Array.isArray($))return $.find(([X])=>X.toLowerCase()==="capgkey")?.[1];return $.capgkey}function KA(){return async($,U)=>{let X=(U?.method??"GET").toUpperCase(),F=typeof $==="string"?$:$ instanceof URL?$.href:$.url,Q=or(),Y=tr(U),J=Date.now();try{let q=await globalThis.fetch($,U);return IA({url:F,method:X,status:q.status,ok:q.ok,durationMs:Date.now()-J,source:Q,apikey:Y}),q}catch(q){throw IA({url:F,method:X,status:0,ok:!1,durationMs:Date.now()-J,source:Q,apikey:Y,error:q}),q}}}var GA,ZA=!1,BA,MBD=5000;var wA=g(()=>{GA=new ar});function sr(D,$){if(!N2(D)||!N2($))return!1;return c6($$(D),$$($))}function er(D,$,U){let X=U?.trim()?`
90
90
  ${U.trim()}`:"";return`This Capgo API requires @capgo/cli@${$} or newer. You are using @capgo/cli@${D}.${X}
91
91
  Please update: npx @capgo/cli@latest`}function HA(D,$,U=!1){let X=$||X$.version,F=D.minCliVersion?.trim();if(!F||!sr(X,F))return;let Q=er(X,F,D.minCliVersionReason);if(!U)ED.error(Q);throw new ND(Q,{minCliVersion:F,currentVersion:X})}var LA=g(()=>{D6();AQ();m4();G1()});function OA(D,$){let X=["normal","bold","dim","italic","underline","strikethrough"].indexOf(D),F="\x1B[";return"\x1B["+X+"m"+$+"\x1B[0m"}var q3;var NA=g(()=>{q3=class q3{title=null;headers=[];rows=[];static narrowTheme={top:["╔","═","╤","╗"],row:["║"," ","│","║"],div:["╟","─","┼","╢"],bot:["╚","═","╧","╝"]};static wideTheme={top:["╔═","═","═╤═","═╗"],row:["║ "," "," │ "," ║"],div:["╟─","─","─┼─","─╢"],bot:["╚═","═","═╧═","═╝"]};static roundTheme={top:["╭─","─","─┬─","─╮"],row:["│ "," "," │ "," │"],div:["├─","─","─┼─","─┤"],bot:["╰─","─","─┴─","─╯"]};theme=q3.wideTheme;columnWidth(){let D=[this.headers,...this.rows].filter((U)=>U.length>0),$=D[0].map((U)=>this.cast(U).length);for(let U of D.slice(1))for(let X=0;X<$.length;X++){let F=this.cast(U[X]).length;if(F>$[X])$[X]=F}return $}cast(D){if(typeof D==="object")return"obj";if(D!==void 0&&typeof D.toString==="function")return D.toString();else return""}renderTitle(){return"[ "+this.title+" ]"}renderLine(D){let $=this.columnWidth();return D[0]+$.map((U)=>D[1].repeat(U)).join(D[2])+D[3]}renderCell(D,$,U=!1){let X=this.cast(D),F=U?OA("bold",X):X,Q=$-X.length,Y=this.theme.row[1];switch(typeof D){case"number":return Y.repeat(Q)+F;case"string":return F+Y.repeat(Q);case"boolean":case"object":return Y.repeat(Math.ceil(Q/2))+OA("italic",X)+Y.repeat(Math.floor(Q/2));default:return Y.repeat(Q)}}renderRow(D,$=!1){let U=this.theme.row,X=this.columnWidth();return U[0]+D.map((F,Q)=>this.renderCell(F,X[Q],$)).join(U[2])+U[3]}toString(){let D=this.theme,$=this.headers.length>0,U=this.rows.length>0;return[this.title?this.renderTitle():"",$||U?this.renderLine(D.top):"",$?this.renderRow(this.headers,!0):"",$&&U?this.renderLine(D.div):"",...this.rows.map((X)=>this.renderRow(X)),$||U?this.renderLine(D.bot):""].filter((X)=>X.length>0).join(`
92
92
  `)}}});var MA=g(()=>{NA()});async function EA(D){try{let U=`https://registry.npmjs.org/${encodeURIComponent(D.toLowerCase())}`,X=await fetch(U,{headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"}});if(!X.ok)return null;return(await X.json())["dist-tags"]?.latest||null}catch{return null}}async function Da(){let D=await EA("@capgo/cli")??"",$=D?.split(".")[0]??"";return{currentVersion:X$.version,latestVersion:D,isOutdated:!!D&&D!==X$.version,majorVersion:$}}async function AA(D={warn:($)=>ED.warning($)}){let{isOutdated:$,currentVersion:U,latestVersion:X,majorVersion:F}=await Da();if($)D.warn(`\uD83D\uDEA8 You are using @capgo/cli@${U} it's not the latest version.
package/dist/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capgo/cli",
3
3
  "type": "module",
4
- "version": "8.62.0",
4
+ "version": "8.63.0",
5
5
  "description": "A CLI to upload to capgo servers",
6
6
  "author": "Martin martin@capgo.app",
7
7
  "license": "Apache 2.0",
@@ -188,9 +188,10 @@
188
188
  "test:android-version": "bun test/test-android-version.mjs",
189
189
  "test:platform-flow-contract": "bun test/test-platform-flow-contract.mjs",
190
190
  "test:tail-engine-shared": "bun test/test-tail-engine-shared.mjs",
191
- "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-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",
191
+ "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-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",
192
192
  "test:build-platform-selection": "bun test/test-build-platform-selection.mjs",
193
193
  "test:builder-project-discovery": "bun test/test-builder-project-discovery.mjs",
194
+ "test:builder-app-selection": "bun test/test-builder-app-selection.mjs",
194
195
  "test:builder-login-gate": "bun test/test-builder-login-gate.mjs",
195
196
  "test:ai-log-capture": "bun test/test-ai-log-capture.mjs",
196
197
  "test:ai-analyze-flow": "bun test/test-ai-analyze-flow.mjs",
@@ -0,0 +1,37 @@
1
+ import type { CapacitorConfig } from '../../config';
2
+ import { createSupabaseClient, invokeCapgoCliApi } from '../../utils.js';
3
+ export interface BuilderVisibleApp {
4
+ app_id: string;
5
+ name: string | null;
6
+ need_onboarding?: boolean | null;
7
+ }
8
+ export interface BuilderAppApiOptions {
9
+ supaHost?: string;
10
+ supaAnon?: string;
11
+ }
12
+ export type AppSelectionErrorCode = 'list' | 'read' | 'missing' | 'build' | 'permission' | 'config' | 'api';
13
+ export declare class AppSelectionError extends Error {
14
+ readonly code: AppSelectionErrorCode;
15
+ constructor(code: AppSelectionErrorCode, message: string, options?: ErrorOptions);
16
+ }
17
+ export declare function getAppSelectionSuggestion(config: CapacitorConfig): {
18
+ appId: string;
19
+ source: 'builder' | 'capacitor';
20
+ };
21
+ export declare function rankVisibleApps<T extends BuilderVisibleApp>(apps: T[], suggestedId: string): T[];
22
+ export declare function listVisibleBuilderApps(apikey: string, options?: BuilderAppApiOptions, request?: typeof invokeCapgoCliApi): Promise<BuilderVisibleApp[]>;
23
+ export declare function verifyBuilderApp(apikey: string, appId: string, options?: BuilderAppApiOptions, dependencies?: {
24
+ request?: typeof invokeCapgoCliApi;
25
+ createClient?: typeof createSupabaseClient;
26
+ }): Promise<void>;
27
+ export declare function persistBuilderAppSelection(appId: string): Promise<boolean>;
28
+ export declare const builderAppCreationUrl: string;
29
+ export declare function openBuilderAppCreation(): Promise<boolean>;
30
+ export interface BuilderAppSelectionServices {
31
+ list: (apikey: string) => Promise<BuilderVisibleApp[]>;
32
+ verify: (apikey: string, appId: string) => Promise<void>;
33
+ persist: (appId: string) => Promise<boolean>;
34
+ openDashboard: () => Promise<boolean>;
35
+ dashboardUrl: string;
36
+ }
37
+ export declare function createBuilderAppSelectionServices(options?: BuilderAppApiOptions): BuilderAppSelectionServices;