@capgo/cli 8.47.0 → 8.47.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -67,7 +67,7 @@ ${X}
|
|
|
67
67
|
`}}}}).prompt();var CB=cA(()=>{FJA();FJA();QJA();s9A();tS=AQ($JA(),1);UJA=KNQ(),HNQ=P6("◆","*"),cTA=P6("■","x"),dTA=P6("▲","x"),qJA=P6("◇","o"),FNQ=P6("┌","T"),g4=P6("│","|"),S2=P6("└","—"),is0=P6("┐","T"),ns0=P6("┘","—"),zJA=P6("●",">"),al=P6("○"," "),as0=P6("◻","[•]"),rs0=P6("◼","[+]"),os0=P6("◻","[ ]"),UNQ=P6("▪","•"),ss0=P6("─","-"),ts0=P6("╮","+"),es0=P6("├","+"),At0=P6("╯","+"),Qt0=P6("╰","+"),Bt0=P6("╭","+"),zNQ=P6("●","•"),qNQ=P6("◆","*"),DNQ=P6("▲","!"),INQ=P6("■","x");$t0=[`${E0("dim","↑/↓")} to navigate`,`${E0("dim","Space:")} select`,`${E0("dim","Enter:")} confirm`],v={message:(A=[],{symbol:Q=E0("gray",g4),secondarySymbol:B=E0("gray",g4),output:$=process.stdout,spacing:J=1,withGuide:Y}={})=>{let Z=[],X=Y??nJ.withGuide,G=X?B:"",K=X?`${Q} `:"",W=X?`${B} `:"";for(let U=0;U<J;U++)Z.push(G);let H=Array.isArray(A)?A:A.split(`
|
|
68
68
|
`);if(H.length>0){let[U,...q]=H;U.length>0?Z.push(`${K}${U}`):Z.push(X?Q:"");for(let D of q)D.length>0?Z.push(`${W}${D}`):Z.push(X?B:"")}$.write(`${Z.join(`
|
|
69
69
|
`)}
|
|
70
|
-
`)},info:(A,Q)=>{v.message(A,{...Q,symbol:E0("blue",zNQ)})},success:(A,Q)=>{v.message(A,{...Q,symbol:E0("green",qNQ)})},step:(A,Q)=>{v.message(A,{...Q,symbol:E0("green",qJA)})},warn:(A,Q)=>{v.message(A,{...Q,symbol:E0("yellow",DNQ)})},warning:(A,Q)=>{v.warn(A,Q)},error:(A,Q)=>{v.message(A,{...Q,symbol:E0("red",INQ)})}},Jt0={light:P6("─","-"),heavy:P6("━","="),block:P6("█","#")},VNQ=[`${E0("dim","↑/↓")} to navigate`,`${E0("dim","Enter:")} confirm`],Yt0=`${E0("gray",g4)} `});var $6;var kZ=cA(()=>{$6={name:"@capgo/cli",type:"module",version:"8.47.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: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: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-list-output-text":"bun test/test-app-list-output-text.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-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:cli-user-error-config":"bun test/test-cli-user-error-config.mjs","test:init-monorepo-targeting":"bun run test:capacitor-config-target && bun run test:cli-user-error-config && bun test/test-init-monorepo-targeting.mjs","test:prompt-preferences":"bun test/test-prompt-preferences.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:auth-session":"bun test/test-auth-session.mjs","test:mcp":"node test/test-mcp.mjs","test:mcp-no-key-handshake":"node test/test-mcp-no-key-handshake.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs","test:project-type-detection":"bun test/test-project-type-detection.mjs","test:payload-split":"bun test/test-payload-split.mjs","test:macos-signing":"bun test/test-macos-signing.mjs","test:helper-dce":"bash scripts/check-helper-dce.sh","test:apple-api-import-helpers":"bun test/test-apple-api-import-helpers.mjs","test:apple-api-verify-key":"bun test/test-apple-api-verify-key.mjs","test:bundle-id-detector":"bun test/test-bundle-id-detector.mjs","test:apple-api-app-list":"bun test/test-apple-api-app-list.mjs","test:apple-api-cert-create":"bun test/test-apple-api-cert-create.mjs","test:app-verification":"bun test/test-app-verification.mjs","test:pbxproj-parser":"bun test/test-pbxproj-parser.mjs","test:manifest-path-encoding":"bun test/test-manifest-path-encoding.mjs","test:self-update":"bun test/test-self-update.mjs","test:update-prompt":"bun test/test-update-prompt.mjs","test:android-tail-engine":"bun test/test-android-tail-engine.mjs","test:android-tail-render":"bun test/test-android-tail-render.mjs","test:android-tail-routing":"bun test/test-android-tail-routing.mjs","test:dev-gate-stripped":"bun test/test-dev-gate-stripped.mjs","test:frame-fit-ios-shared":"bun test/test-frame-fit-ios-shared.mjs","test:ios-confirm-app-id":"bun test/test-ios-confirm-app-id.mjs","test:ios-create-new":"bun test/test-ios-create-new.mjs","test:ios-e2e":"bun test/test-ios-e2e.mjs","test:ios-flow-contract":"bun test/test-ios-flow-contract.mjs","test:ios-import-discovery":"bun test/test-ios-import-discovery.mjs","test:ios-import-export":"bun test/test-ios-import-export.mjs","test:ios-import-pickers":"bun test/test-ios-import-pickers.mjs","test:ios-import-recovery":"bun test/test-ios-import-recovery.mjs","test:ios-recovery":"bun test/test-ios-recovery.mjs","test:ios-resume":"bun test/test-ios-resume.mjs","test:ios-tail-handoff":"bun test/test-ios-tail-handoff.mjs","test:ios-tui-render":"bun test/test-ios-tui-render.mjs","test:p8-error":"bun test/test-p8-error.mjs","test:ios-tui-routing":"bun test/test-ios-tui-routing.mjs","test:ios-updater-sync-validation":"bun test/test-ios-updater-sync-validation.mjs","test:ios-verify-app":"bun test/test-ios-verify-app.mjs","test:ios-marketing-version":"bun test/test-ios-marketing-version.mjs","test:android-version":"bun test/test-android-version.mjs","test:platform-flow-contract":"bun test/test-platform-flow-contract.mjs","test:tail-engine-shared":"bun test/test-tail-engine-shared.mjs",test:"bun run build && bun run test:helper-dce && bun run test:version-detection:setup && bun run test:bundle && bun run test: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: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: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: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-list-output-text && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:cli-recovery && bun run test:create-supabase-client && bun run test:build-platform-selection && bun run test:builder-project-discovery && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-monorepo-targeting && bun run test:init-app-conflict && bun run test:channel-add-exists && bun run test:wait-log && bun run test:init-guardrails && bun run test:init-replay && bun run test:init-telemetry && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:mcp-no-key-handshake && bun run test:auth-session && bun run test:version-detection && bun run test:platform-paths && bun run test:project-type-detection && bun run test:payload-split && bun run test:manifest-path-encoding && bun run test:macos-signing && bun run test:asc-key-protocol && bun run test:apple-api-import-helpers && bun run test:apple-api-verify-key && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:cicd-failure-help && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-upload-prompt && bun run test:support-bundle-files && bun run test:self-update && bun run test:update-prompt && bun run test:apple-api-cert-create && bun run test:android-tail-engine && bun run test:android-tail-render && bun run test:android-tail-routing && bun run test:dev-gate-stripped && bun run test:frame-fit-ios-shared && bun run test:ios-confirm-app-id && bun run test:ios-create-new && bun run test:ios-e2e && bun run test:ios-flow-contract && bun run test:ios-import-discovery && bun run test:ios-import-export && bun run test:ios-import-pickers && bun run test:ios-import-recovery && bun run test:ios-recovery && bun run test:ios-resume && bun run test:ios-tail-handoff && bun run test:ios-tui-render && bun run test:p8-error && bun run test:ios-tui-routing && bun run test:ios-updater-sync-validation && bun run test:ios-verify-app && bun run test:ios-marketing-version && bun run test:android-version && bun run test:platform-flow-contract && bun run test:tail-engine-shared && bun run test:prescan && bun run test:android-reporting-api && bun run test:android-app-verification && bun run test:android-rename && bun run test:appflow-auth && bun run test:appflow-api-map && bun run test:appflow-validate && bun run test:appflow-flow && bun run test:appflow-gapfill && bun run test:appflow-engine && bun run test:appflow-tail && bun run test:appflow-fetch && bun run test:appflow-sa-decode && bun run test:app-permission-helper && bun run test:2fa-compliance-network && bun run test:organization-set-api-host && bun run test:trial-warning && bun run test:plan-validation","test:build-platform-selection":"bun test/test-build-platform-selection.mjs","test:builder-project-discovery":"bun test/test-builder-project-discovery.mjs","test:ai-log-capture":"bun test/test-ai-log-capture.mjs","test:ai-analyze-flow":"bun test/test-ai-analyze-flow.mjs","test:cicd-failure-help":"bun test/test-cicd-failure-help.mjs","test:ai-analyze-stream":"bun test/test-ai-analyze-stream.mjs","test:ai-sse-parser":"bun test/test-ai-sse-parser.mjs","test:ai-render-markdown":"bun test/test-ai-render-markdown.mjs","test:ai-onboarding-mode":"bun test/test-ai-onboarding-mode.mjs","test:ai-fit":"bun test/test-ai-fit.mjs","test:platform-layout":"bun test/test-platform-layout.mjs","test:frame-fit":"bun test/run-frame-fit.mjs","test:onboarding-min-size":"bun test/test-onboarding-min-size.mjs","test:min-size-gate":"bun test/test-min-size-gate.mjs","test:shell-size-gate":"bun test/test-shell-size-gate.mjs","test:build-log-sanitize":"bun test/test-build-log-sanitize.mjs","test:build-output-viewport":"bun test/test-build-output-viewport.mjs","test:diff-viewer-viewport":"bun test/test-diff-viewer-viewport.mjs","test:build-complete-exit":"bun test/test-build-complete-exit.mjs","test:ai-stream-markdown":"bun test/test-ai-stream-markdown.mjs","test:support-mailto":"bun test/test-support-mailto.mjs","test:support-redact":"bun test/test-support-redact.mjs","test:support-internal-log":"bun test/test-support-internal-log.mjs","test:support-help-menu":"bun test/test-support-help-menu.mjs","test:support-contact":"bun test/test-support-contact.mjs","test:support-upload-prompt":"bun test/test-support-upload-prompt.mjs","test:support-bundle-files":"bun test/test-support-bundle-files.mjs","test:mcp-live-update-onboarding":"bun test/test-mcp-live-update-onboarding.mjs","test:app-set-options":"bun test/test-app-set-options.mjs && bun test/test-app-list-options.mjs","test:android-reporting-api":"bun test/test-android-reporting-api.mjs","test:android-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"},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","@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"}}});function TNQ(A){if(A&&typeof A==="object"&&"status"in A){let Q=A.status;if(typeof Q==="number")return Q}return}function _NQ(A){let Q=[],B=new Set,$=A;if(typeof A==="string")return A;while($){if(typeof $==="string"){Q.push($);break}if(typeof $!=="object")break;if(B.has($))break;if(B.add($),$ instanceof Error){Q.push($.message),$=$.cause;continue}let J=$;if(typeof J.message==="string")Q.push(J.message);$=J.cause}return Q.join(" ")}function SNQ(A){return _NQ(A)}function xM(A){if(A&&typeof A==="object"&&"code"in A){let $=A.code;if(typeof $==="string"&&$.startsWith("commander."))return"commander"}let Q=TNQ(A);if(Q!==void 0){if(Q===401)return"unauthorized";if(Q===403)return"forbidden";if(Q===404)return"not_found";if(Q===413)return"payload_too_large";if(Q>=500)return"server_error"}let B=SNQ(A).toLowerCase();if(/econnrefused|econnreset|enotfound|eai_again|fetch failed|failed to fetch|connect timeout|und_err/.test(B))return"network_error";if(/timed out|timeout|etimedout|aborted/.test(B))return"timeout";if(/invalid|must be|required|not allowed|malformed|validation/.test(B))return"validation_error";return"unknown"}function aTA(A){if(A===401)return"unauthorized";if(A===403)return"forbidden";if(A===404)return"not_found";if(A===408||A===504)return"timeout";if(A===413)return"payload_too_large";if(A===429)return"rate_limited";if(A===400||A===422)return"validation_error";if(A>=500)return"server_error";return"unknown"}import{AsyncLocalStorage as bNQ}from"node:async_hooks";function $p(A,Q){return sTA.run(A,()=>Promise.resolve(Q()))}function xNQ(){return sTA.getStore()}function eS(){tTA=!0}function eTA(){return tTA}function Q_A(A){A_A=A}function oTA(A){try{A_A?.(A)}catch{}}function $_A(A,Q){let B;try{B=new URL(A).pathname}catch{B=A.split("?")[0]}let $="/functions/v1/",J=B.indexOf($);if(J>=0){let K=B.slice(J+$.length),W=0,H=K.length;while(W<H&&K[W]==="/")W+=1;while(H>W&&K[H-1]==="/")H-=1;let U=K.slice(W,H);return U?`${Q} functions:${U}`:`${Q} functions`}let Y="/rest/v1/",Z=B.indexOf(Y),X=Z>=0?B.slice(Z+Y.length):B.replace(/^\//,"");if(X.startsWith("rpc/"))return`rpc:${X.slice(4).split("/")[0]}`;let G=X.split("/")[0]||B;return`${Q} ${G}`}function fNQ(A){let Q=A?.headers;if(!Q)return;let B=Q.get;if(typeof B==="function")return B.call(Q,"capgkey")??void 0;if(Array.isArray(Q))return Q.find(([$])=>$.toLowerCase()==="capgkey")?.[1];return Q.capgkey}function J_A(){return async(Q,B)=>{let $=(B?.method??"GET").toUpperCase(),J=typeof Q==="string"?Q:Q instanceof URL?Q.href:Q.url,Y=xNQ(),Z=fNQ(B),X=Date.now();try{let G=await globalThis.fetch(Q,B);return oTA({url:J,method:$,status:G.status,ok:G.ok,durationMs:Date.now()-X,source:Y,apikey:Z}),G}catch(G){throw oTA({url:J,method:$,status:0,ok:!1,durationMs:Date.now()-X,source:Y,apikey:Z,error:G}),G}}}var sTA,tTA=!1,A_A,B_A=5000;var Ak=cA(()=>{sTA=new bNQ});var TQ;var _8=cA(()=>{TQ=class TQ extends Error{context;constructor(A,Q){super(A);this.name="CliUserError",this.context=Q}}});import{platform as vNQ}from"node:os";import{version as yNQ}from"node:process";function X_A(A){Z_A=A}function hNQ(A){for(let Q=0;Q<A.length;Q++)if(A.charCodeAt(Q)>255)return!1;return!0}function Y_A(A){if(A.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 uNQ(A){if(A.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(A.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 CJA(A,Q){if(Q===void 0||Q===null){if(MJA.has(A.toLowerCase()))throw new TQ(Y_A(A));throw new TQ(`HTTP header "${A}" is missing or invalid.`)}if(typeof Q!=="string"){if(MJA.has(A.toLowerCase()))throw new TQ(Y_A(A));throw new TQ(`HTTP header "${A}" is missing or invalid.`)}if(!hNQ(Q)){if(MJA.has(A.toLowerCase()))throw new TQ(uNQ(A));throw new TQ(`HTTP header "${A}" contains invalid characters (only ASCII is allowed).`)}return Q}function D8(A){let Q={capgo_api:gNQ,"x-cli-version":$6.version,"x-cli-command":Z_A,"x-cli-node":yNQ,"x-cli-os":vNQ()};if(A)for(let[B,$]of Object.entries(A))Q[B]=CJA(B,$);return Q}var gNQ="2025-10-01",Z_A="",MJA;var p7=cA(()=>{kZ();_8();MJA=new Set(["authorization","capgkey","x-capgo-log-token"])});function bZ(A){let Q=A.length;while(Q>0&&A[Q-1]==="/")Q-=1;return A.slice(0,Q)}import{randomUUID as G_A}from"node:crypto";import{existsSync as mNQ,mkdirSync as cNQ,readFileSync as dNQ,writeFileSync as lNQ}from"node:fs";import{homedir as VJA,platform as pNQ,release as iNQ}from"node:os";import{join as K_A}from"node:path";import{arch as nNQ,cwd as W_A,env as fM,version as aNQ}from"node:process";function VW(A){return A==="1"||A?.toLowerCase()==="true"||A?.toLowerCase()==="yes"}function eNQ(){if(VW(fM.CAPGO_DISABLE_TELEMETRY)||VW(fM.CAPGO_DISABLE_POSTHOG))return;return fM.CAPGO_CLI_POSTHOG_API_KEY?.trim()||fM.POSTHOG_API_KEY?.trim()||oNQ}function ARQ(A){let Q=bZ(A);if(Q.endsWith("/i/v0/e"))return`${Q}/`;let B=Q.replace(/\/capture$/,"/");return new URL("i/v0/e/",B.endsWith("/")?B:`${B}/`).toString()}function QRQ(A){if(A instanceof Error)return{cause:A.cause,message:A.message,name:A.name||"Error",stack:A.stack};if(typeof A==="string")return{message:A,name:"Error",stack:void 0};try{return{message:JSON.stringify(A)??String(A),name:"Error",stack:void 0}}catch{return{message:String(A),name:"Error",stack:void 0}}}function BRQ(A){let Q=A,B=W_A(),$=VJA();if(B)Q=Q.replaceAll(B,"<cwd>");if($)Q=Q.replaceAll($,"~");return Q}function $RQ(A){let Q=A,B=W_A(),$=VJA();if(B)Q=Q.replaceAll(B,"<cwd>");if($)Q=Q.replaceAll($,"~");return Q.replace(/<cwd>\/[^\s"',)]+/g,"<cwd>/<path>").replace(/~\/[^\s"',)]+/g,"~/<path>").replace(/[\w.%+-]+@[\w.-]+\.[A-Z]{2,}/gi,"<email>").replace(/(https?:\/\/)([^/\s:@]+):([^/\s@]+)@/gi,"$1<redacted>@").replace(/\b[a-z][\w-]*(?:\.[\w-]+){1,}\b/gi,"<app_id>").replace(/\b[a-z]:\\[^\s"',)]+/gi,"<path>").replace(/(^|[\s"'(])\/[^\s"',)]+/g,"$1<path>").replace(/(--(?:token|api[-_]?key|key|password|secret|private[-_]?key|jwt|session|auth)(?:=|\s+))("[^"]+"|'[^']+'|\S+)/gi,"$1<redacted>").replace(/\b((?:token|api[-_]?key|password|secret|authorization)\s*[:=]\s*)[^\s,;]+/gi,"$1<redacted>")}function JRQ(A,Q){let B=A?.split(`
|
|
70
|
+
`)},info:(A,Q)=>{v.message(A,{...Q,symbol:E0("blue",zNQ)})},success:(A,Q)=>{v.message(A,{...Q,symbol:E0("green",qNQ)})},step:(A,Q)=>{v.message(A,{...Q,symbol:E0("green",qJA)})},warn:(A,Q)=>{v.message(A,{...Q,symbol:E0("yellow",DNQ)})},warning:(A,Q)=>{v.warn(A,Q)},error:(A,Q)=>{v.message(A,{...Q,symbol:E0("red",INQ)})}},Jt0={light:P6("─","-"),heavy:P6("━","="),block:P6("█","#")},VNQ=[`${E0("dim","↑/↓")} to navigate`,`${E0("dim","Enter:")} confirm`],Yt0=`${E0("gray",g4)} `});var $6;var kZ=cA(()=>{$6={name:"@capgo/cli",type:"module",version:"8.47.1",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/capgo/tree/main/cli#readme",repository:{type:"git",url:"https://github.com/Cap-go/capgo.app",directory:"cli"},bugs:{url:"https://github.com/Cap-go/capgo/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli","sdk","tanstack-intent"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",bin:{capgo:"dist/index.js"},files:["!skills/_artifacts","dist","skills"],engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && bun build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js","dev-build":"SUPA_DB=development ncc build",pack:"pkg",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: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: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-list-output-text":"bun test/test-app-list-output-text.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-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:cli-user-error-config":"bun test/test-cli-user-error-config.mjs","test:init-monorepo-targeting":"bun run test:capacitor-config-target && bun run test:cli-user-error-config && bun test/test-init-monorepo-targeting.mjs","test:prompt-preferences":"bun test/test-prompt-preferences.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:auth-session":"bun test/test-auth-session.mjs","test:mcp":"node test/test-mcp.mjs","test:mcp-no-key-handshake":"node test/test-mcp-no-key-handshake.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs","test:project-type-detection":"bun test/test-project-type-detection.mjs","test:payload-split":"bun test/test-payload-split.mjs","test:macos-signing":"bun test/test-macos-signing.mjs","test:helper-dce":"bash scripts/check-helper-dce.sh","test:apple-api-import-helpers":"bun test/test-apple-api-import-helpers.mjs","test:apple-api-verify-key":"bun test/test-apple-api-verify-key.mjs","test:bundle-id-detector":"bun test/test-bundle-id-detector.mjs","test:apple-api-app-list":"bun test/test-apple-api-app-list.mjs","test:apple-api-cert-create":"bun test/test-apple-api-cert-create.mjs","test:app-verification":"bun test/test-app-verification.mjs","test:pbxproj-parser":"bun test/test-pbxproj-parser.mjs","test:manifest-path-encoding":"bun test/test-manifest-path-encoding.mjs","test:self-update":"bun test/test-self-update.mjs","test:update-prompt":"bun test/test-update-prompt.mjs","test:android-tail-engine":"bun test/test-android-tail-engine.mjs","test:android-tail-render":"bun test/test-android-tail-render.mjs","test:android-tail-routing":"bun test/test-android-tail-routing.mjs","test:dev-gate-stripped":"bun test/test-dev-gate-stripped.mjs","test:frame-fit-ios-shared":"bun test/test-frame-fit-ios-shared.mjs","test:ios-confirm-app-id":"bun test/test-ios-confirm-app-id.mjs","test:ios-create-new":"bun test/test-ios-create-new.mjs","test:ios-e2e":"bun test/test-ios-e2e.mjs","test:ios-flow-contract":"bun test/test-ios-flow-contract.mjs","test:ios-import-discovery":"bun test/test-ios-import-discovery.mjs","test:ios-import-export":"bun test/test-ios-import-export.mjs","test:ios-import-pickers":"bun test/test-ios-import-pickers.mjs","test:ios-import-recovery":"bun test/test-ios-import-recovery.mjs","test:ios-recovery":"bun test/test-ios-recovery.mjs","test:ios-resume":"bun test/test-ios-resume.mjs","test:ios-tail-handoff":"bun test/test-ios-tail-handoff.mjs","test:ios-tui-render":"bun test/test-ios-tui-render.mjs","test:p8-error":"bun test/test-p8-error.mjs","test:ios-tui-routing":"bun test/test-ios-tui-routing.mjs","test:ios-updater-sync-validation":"bun test/test-ios-updater-sync-validation.mjs","test:ios-verify-app":"bun test/test-ios-verify-app.mjs","test:ios-marketing-version":"bun test/test-ios-marketing-version.mjs","test:android-version":"bun test/test-android-version.mjs","test:platform-flow-contract":"bun test/test-platform-flow-contract.mjs","test:tail-engine-shared":"bun test/test-tail-engine-shared.mjs",test:"bun run build && bun run test:helper-dce && bun run test:version-detection:setup && bun run test:bundle && bun run test: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: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: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: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-list-output-text && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:cli-recovery && bun run test:create-supabase-client && bun run test:build-platform-selection && bun run test:builder-project-discovery && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-monorepo-targeting && bun run test:init-app-conflict && bun run test:channel-add-exists && bun run test:wait-log && bun run test:init-guardrails && bun run test:init-replay && bun run test:init-telemetry && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:mcp-no-key-handshake && bun run test:auth-session && bun run test:version-detection && bun run test:platform-paths && bun run test:project-type-detection && bun run test:payload-split && bun run test:manifest-path-encoding && bun run test:macos-signing && bun run test:asc-key-protocol && bun run test:apple-api-import-helpers && bun run test:apple-api-verify-key && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:cicd-failure-help && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-upload-prompt && bun run test:support-bundle-files && bun run test:self-update && bun run test:update-prompt && bun run test:apple-api-cert-create && bun run test:android-tail-engine && bun run test:android-tail-render && bun run test:android-tail-routing && bun run test:dev-gate-stripped && bun run test:frame-fit-ios-shared && bun run test:ios-confirm-app-id && bun run test:ios-create-new && bun run test:ios-e2e && bun run test:ios-flow-contract && bun run test:ios-import-discovery && bun run test:ios-import-export && bun run test:ios-import-pickers && bun run test:ios-import-recovery && bun run test:ios-recovery && bun run test:ios-resume && bun run test:ios-tail-handoff && bun run test:ios-tui-render && bun run test:p8-error && bun run test:ios-tui-routing && bun run test:ios-updater-sync-validation && bun run test:ios-verify-app && bun run test:ios-marketing-version && bun run test:android-version && bun run test:platform-flow-contract && bun run test:tail-engine-shared && bun run test:prescan && bun run test:android-reporting-api && bun run test:android-gcp && bun run test:android-app-verification && bun run test:android-rename && bun run test:appflow-auth && bun run test:appflow-api-map && bun run test:appflow-validate && bun run test:appflow-flow && bun run test:appflow-gapfill && bun run test:appflow-engine && bun run test:appflow-tail && bun run test:appflow-fetch && bun run test:appflow-sa-decode && bun run test:app-permission-helper && bun run test:2fa-compliance-network && bun run test:organization-set-api-host && bun run test:trial-warning && bun run test:plan-validation","test:build-platform-selection":"bun test/test-build-platform-selection.mjs","test:builder-project-discovery":"bun test/test-builder-project-discovery.mjs","test:ai-log-capture":"bun test/test-ai-log-capture.mjs","test:ai-analyze-flow":"bun test/test-ai-analyze-flow.mjs","test:cicd-failure-help":"bun test/test-cicd-failure-help.mjs","test:ai-analyze-stream":"bun test/test-ai-analyze-stream.mjs","test:ai-sse-parser":"bun test/test-ai-sse-parser.mjs","test:ai-render-markdown":"bun test/test-ai-render-markdown.mjs","test:ai-onboarding-mode":"bun test/test-ai-onboarding-mode.mjs","test:ai-fit":"bun test/test-ai-fit.mjs","test:platform-layout":"bun test/test-platform-layout.mjs","test:frame-fit":"bun test/run-frame-fit.mjs","test:onboarding-min-size":"bun test/test-onboarding-min-size.mjs","test:min-size-gate":"bun test/test-min-size-gate.mjs","test:shell-size-gate":"bun test/test-shell-size-gate.mjs","test:build-log-sanitize":"bun test/test-build-log-sanitize.mjs","test:build-output-viewport":"bun test/test-build-output-viewport.mjs","test:diff-viewer-viewport":"bun test/test-diff-viewer-viewport.mjs","test:build-complete-exit":"bun test/test-build-complete-exit.mjs","test:ai-stream-markdown":"bun test/test-ai-stream-markdown.mjs","test:support-mailto":"bun test/test-support-mailto.mjs","test:support-redact":"bun test/test-support-redact.mjs","test:support-internal-log":"bun test/test-support-internal-log.mjs","test:support-help-menu":"bun test/test-support-help-menu.mjs","test:support-contact":"bun test/test-support-contact.mjs","test:support-upload-prompt":"bun test/test-support-upload-prompt.mjs","test:support-bundle-files":"bun test/test-support-bundle-files.mjs","test:mcp-live-update-onboarding":"bun test/test-mcp-live-update-onboarding.mjs","test:app-set-options":"bun test/test-app-set-options.mjs && bun test/test-app-list-options.mjs","test:android-reporting-api":"bun test/test-android-reporting-api.mjs","test:android-gcp":"bun test/test-android-gcp.mjs","test:android-app-verification":"bun test/test-android-app-verification.mjs","test:android-rename":"bun test/test-android-rename.mjs","test:appflow-auth":"bun test/test-appflow-auth.mjs","test:appflow-api-map":"bun test/test-appflow-api-map.mjs","test:appflow-validate":"bun test/test-appflow-validate.mjs","test:appflow-flow":"bun test/test-appflow-flow.mjs","test:appflow-gapfill":"bun test/test-appflow-gapfill.mjs","test:appflow-engine":"bun test/test-appflow-engine.mjs","test:appflow-tail":"bun test/test-appflow-tail.mjs","test:appflow-fetch":"bun test/test-appflow-fetch.mjs","test:appflow-sa-decode":"bun test/test-appflow-sa-decode.mjs","test:app-permission-helper":"bun test/test-app-permission-helper.mjs","test:2fa-compliance-network":"bun test/test-2fa-compliance-network.mjs","test:organization-set-api-host":"bun test/test-organization-set-api-host.mjs","test:trial-warning":"bun test/test-trial-warning.mjs","test:plan-validation":"bun test/test-plan-validation.mjs","test:auto-bump-version":"bun test/test-auto-bump-version.mjs","test:auto-bump-ai-diff":"bun test/test-auto-bump-ai-diff.mjs"},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","@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"}}});function TNQ(A){if(A&&typeof A==="object"&&"status"in A){let Q=A.status;if(typeof Q==="number")return Q}return}function _NQ(A){let Q=[],B=new Set,$=A;if(typeof A==="string")return A;while($){if(typeof $==="string"){Q.push($);break}if(typeof $!=="object")break;if(B.has($))break;if(B.add($),$ instanceof Error){Q.push($.message),$=$.cause;continue}let J=$;if(typeof J.message==="string")Q.push(J.message);$=J.cause}return Q.join(" ")}function SNQ(A){return _NQ(A)}function xM(A){if(A&&typeof A==="object"&&"code"in A){let $=A.code;if(typeof $==="string"&&$.startsWith("commander."))return"commander"}let Q=TNQ(A);if(Q!==void 0){if(Q===401)return"unauthorized";if(Q===403)return"forbidden";if(Q===404)return"not_found";if(Q===413)return"payload_too_large";if(Q>=500)return"server_error"}let B=SNQ(A).toLowerCase();if(/econnrefused|econnreset|enotfound|eai_again|fetch failed|failed to fetch|connect timeout|und_err/.test(B))return"network_error";if(/timed out|timeout|etimedout|aborted/.test(B))return"timeout";if(/invalid|must be|required|not allowed|malformed|validation/.test(B))return"validation_error";return"unknown"}function aTA(A){if(A===401)return"unauthorized";if(A===403)return"forbidden";if(A===404)return"not_found";if(A===408||A===504)return"timeout";if(A===413)return"payload_too_large";if(A===429)return"rate_limited";if(A===400||A===422)return"validation_error";if(A>=500)return"server_error";return"unknown"}import{AsyncLocalStorage as bNQ}from"node:async_hooks";function $p(A,Q){return sTA.run(A,()=>Promise.resolve(Q()))}function xNQ(){return sTA.getStore()}function eS(){tTA=!0}function eTA(){return tTA}function Q_A(A){A_A=A}function oTA(A){try{A_A?.(A)}catch{}}function $_A(A,Q){let B;try{B=new URL(A).pathname}catch{B=A.split("?")[0]}let $="/functions/v1/",J=B.indexOf($);if(J>=0){let K=B.slice(J+$.length),W=0,H=K.length;while(W<H&&K[W]==="/")W+=1;while(H>W&&K[H-1]==="/")H-=1;let U=K.slice(W,H);return U?`${Q} functions:${U}`:`${Q} functions`}let Y="/rest/v1/",Z=B.indexOf(Y),X=Z>=0?B.slice(Z+Y.length):B.replace(/^\//,"");if(X.startsWith("rpc/"))return`rpc:${X.slice(4).split("/")[0]}`;let G=X.split("/")[0]||B;return`${Q} ${G}`}function fNQ(A){let Q=A?.headers;if(!Q)return;let B=Q.get;if(typeof B==="function")return B.call(Q,"capgkey")??void 0;if(Array.isArray(Q))return Q.find(([$])=>$.toLowerCase()==="capgkey")?.[1];return Q.capgkey}function J_A(){return async(Q,B)=>{let $=(B?.method??"GET").toUpperCase(),J=typeof Q==="string"?Q:Q instanceof URL?Q.href:Q.url,Y=xNQ(),Z=fNQ(B),X=Date.now();try{let G=await globalThis.fetch(Q,B);return oTA({url:J,method:$,status:G.status,ok:G.ok,durationMs:Date.now()-X,source:Y,apikey:Z}),G}catch(G){throw oTA({url:J,method:$,status:0,ok:!1,durationMs:Date.now()-X,source:Y,apikey:Z,error:G}),G}}}var sTA,tTA=!1,A_A,B_A=5000;var Ak=cA(()=>{sTA=new bNQ});var TQ;var _8=cA(()=>{TQ=class TQ extends Error{context;constructor(A,Q){super(A);this.name="CliUserError",this.context=Q}}});import{platform as vNQ}from"node:os";import{version as yNQ}from"node:process";function X_A(A){Z_A=A}function hNQ(A){for(let Q=0;Q<A.length;Q++)if(A.charCodeAt(Q)>255)return!1;return!0}function Y_A(A){if(A.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 uNQ(A){if(A.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(A.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 CJA(A,Q){if(Q===void 0||Q===null){if(MJA.has(A.toLowerCase()))throw new TQ(Y_A(A));throw new TQ(`HTTP header "${A}" is missing or invalid.`)}if(typeof Q!=="string"){if(MJA.has(A.toLowerCase()))throw new TQ(Y_A(A));throw new TQ(`HTTP header "${A}" is missing or invalid.`)}if(!hNQ(Q)){if(MJA.has(A.toLowerCase()))throw new TQ(uNQ(A));throw new TQ(`HTTP header "${A}" contains invalid characters (only ASCII is allowed).`)}return Q}function D8(A){let Q={capgo_api:gNQ,"x-cli-version":$6.version,"x-cli-command":Z_A,"x-cli-node":yNQ,"x-cli-os":vNQ()};if(A)for(let[B,$]of Object.entries(A))Q[B]=CJA(B,$);return Q}var gNQ="2025-10-01",Z_A="",MJA;var p7=cA(()=>{kZ();_8();MJA=new Set(["authorization","capgkey","x-capgo-log-token"])});function bZ(A){let Q=A.length;while(Q>0&&A[Q-1]==="/")Q-=1;return A.slice(0,Q)}import{randomUUID as G_A}from"node:crypto";import{existsSync as mNQ,mkdirSync as cNQ,readFileSync as dNQ,writeFileSync as lNQ}from"node:fs";import{homedir as VJA,platform as pNQ,release as iNQ}from"node:os";import{join as K_A}from"node:path";import{arch as nNQ,cwd as W_A,env as fM,version as aNQ}from"node:process";function VW(A){return A==="1"||A?.toLowerCase()==="true"||A?.toLowerCase()==="yes"}function eNQ(){if(VW(fM.CAPGO_DISABLE_TELEMETRY)||VW(fM.CAPGO_DISABLE_POSTHOG))return;return fM.CAPGO_CLI_POSTHOG_API_KEY?.trim()||fM.POSTHOG_API_KEY?.trim()||oNQ}function ARQ(A){let Q=bZ(A);if(Q.endsWith("/i/v0/e"))return`${Q}/`;let B=Q.replace(/\/capture$/,"/");return new URL("i/v0/e/",B.endsWith("/")?B:`${B}/`).toString()}function QRQ(A){if(A instanceof Error)return{cause:A.cause,message:A.message,name:A.name||"Error",stack:A.stack};if(typeof A==="string")return{message:A,name:"Error",stack:void 0};try{return{message:JSON.stringify(A)??String(A),name:"Error",stack:void 0}}catch{return{message:String(A),name:"Error",stack:void 0}}}function BRQ(A){let Q=A,B=W_A(),$=VJA();if(B)Q=Q.replaceAll(B,"<cwd>");if($)Q=Q.replaceAll($,"~");return Q}function $RQ(A){let Q=A,B=W_A(),$=VJA();if(B)Q=Q.replaceAll(B,"<cwd>");if($)Q=Q.replaceAll($,"~");return Q.replace(/<cwd>\/[^\s"',)]+/g,"<cwd>/<path>").replace(/~\/[^\s"',)]+/g,"~/<path>").replace(/[\w.%+-]+@[\w.-]+\.[A-Z]{2,}/gi,"<email>").replace(/(https?:\/\/)([^/\s:@]+):([^/\s@]+)@/gi,"$1<redacted>@").replace(/\b[a-z][\w-]*(?:\.[\w-]+){1,}\b/gi,"<app_id>").replace(/\b[a-z]:\\[^\s"',)]+/gi,"<path>").replace(/(^|[\s"'(])\/[^\s"',)]+/g,"$1<path>").replace(/(--(?:token|api[-_]?key|key|password|secret|private[-_]?key|jwt|session|auth)(?:=|\s+))("[^"]+"|'[^']+'|\S+)/gi,"$1<redacted>").replace(/\b((?:token|api[-_]?key|password|secret|authorization)\s*[:=]\s*)[^\s,;]+/gi,"$1<redacted>")}function JRQ(A,Q){let B=A?.split(`
|
|
71
71
|
`).slice(1).map(($)=>{let J=$.trim(),Y=J.startsWith("at ")?J.slice(3):J,Z=Q,X=Y,G=Y.lastIndexOf(" (");if(G!==-1&&Y.endsWith(")"))Z=Y.slice(0,G).trim()||Q,X=Y.slice(G+2,-1);else{let H=Y.lastIndexOf(" "),U=H===-1?"":Y.slice(H+1);if(/:\d+:\d+$/.test(U))Z=Y.slice(0,H).trim()||Q,X=U}let K=X.lastIndexOf(":"),W=K===-1?-1:X.lastIndexOf(":",K-1);if(K===-1||W===-1)return{function:Q,platform:"custom",lang:"javascript"};return{function:Z,filename:BRQ(X.slice(0,W)),lineno:Number.parseInt(X.slice(W+1,K),10),colno:Number.parseInt(X.slice(K+1),10),platform:"custom",lang:"javascript"}}).filter(Boolean);return B&&B.length>0?B:[{function:Q,platform:"custom",lang:"javascript"}]}function YRQ(A){if(!A||typeof A!=="object"||!("code"in A))return;let{code:Q}=A;return typeof Q==="string"?Q:void 0}function XRQ(A){if(!A||typeof A!=="object")return;let Q=A;if(typeof Q.status==="number")return Q.status;if(typeof Q.statusCode==="number")return Q.statusCode;let B=Q.context&&typeof Q.context==="object"?Q.context.status:void 0;return typeof B==="number"?B:void 0}function GRQ(A){let Q=(A instanceof Error?A.message:typeof A==="string"?A:"").toLowerCase();if(ZRQ.some((B)=>Q.includes(B)))return!0;return XRQ(A)===401}function Qk(A){if(A instanceof TQ){if(tNQ.has(A.message))return!0;return!1}if(GRQ(A))return!1;return!YRQ(A)?.startsWith("commander.")}function Jp(A){let Q=[],B=A;while(B?.parent){let $=B.name();if($)Q.push($);B=B.parent}return Q.reverse().join(" ")||"unknown"}function KRQ(A=K_A(VJA(),".capgo-credentials")){if(LJA)return LJA;let Q=K_A(A,"install-id"),B;try{let $=mNQ(Q)?dNQ(Q,"utf8").trim():"";if($)B=$;else B=G_A(),cNQ(A,{recursive:!0}),lNQ(Q,B,{encoding:"utf8",mode:384})}catch{B=G_A()}return LJA=B,B}async function Bk(A){let Q=eNQ();if(!Q)return!1;let B=fM.CAPGO_CLI_POSTHOG_API_HOST?.trim()||fM.POSTHOG_API_HOST?.trim()||rNQ,$;try{$=ARQ(B)}catch{return!1}let J=QRQ(A.error),Y=$RQ(J.message),Z=KRQ(),X=JRQ(J.stack,A.functionName),G=[A.functionName,A.kind,J.name||"Error",String(A.status??1)].join(":"),K={token:Q,event:"$exception",properties:{distinct_id:Z,$exception_list:[{type:J.name||"Error",value:Y,mechanism:{handled:!0,synthetic:!1},stacktrace:{type:"raw",frames:X}}],$exception_fingerprint:G,architecture:nNQ,cli_version:$6.version,error_kind:A.kind,function_name:A.functionName,is_ci:Boolean(fM.CI),node_version:aNQ,os_platform:pNQ(),os_release:iNQ(),runtime:"cli",status:A.status},timestamp:new Date().toISOString()};try{let W=new AbortController,H=setTimeout(()=>W.abort(),sNQ);try{return(await fetch($,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(K),signal:W.signal})).ok}finally{clearTimeout(H)}}catch{return!1}}var rNQ="https://eu.i.posthog.com/i/v0/e/",oNQ="phc_NXDyDajQaTQVwb25DEhIVZfxVUn4R0Y348Z7vWYHZUi",sNQ=1500,NJA="iOS sync validation failed. Delete your iOS folder, then rerun the add and sync commands above and retry.",tNQ,ZRQ,LJA;var HR=cA(()=>{kZ();_8();tNQ=new Set([NJA]);ZRQ=["invalid_apikey","invalid apikey","no_key_provided","no key provided","invalid api key or insufficient permissions","does not exist, run first"]});import{existsSync as xZ}from"fs";var e3=(A=".",Q="unknown")=>{let B=`${A}/bun.lockb`,$=`${A}/bun.lock`,J=`${A}/pnpm-lock.yaml`,Y=`${A}/shrinkwrap.yaml`,Z=`${A}/yarn.lock`,X=`${A}/package-lock.json`,G=`${A}/npm-shrinkwrap.json`;if(xZ(B)||xZ($))return"bun";if(xZ(J)||xZ(Y))return"pnpm";if(xZ(Z))return"yarn";if(xZ(X)||xZ(G))return"npm";return Q},xq=(A=e3(),Q=!1)=>{switch(A){case"bun":return Q?"bun install":"install";case"pnpm":return Q?"pnpm install":"install";case"yarn":return Q?"yarn install":"install";case"npm":return Q?"npm install":"install";case"unknown":return Q?"unknown unknown":"unknown";default:return Q?"npm install":"install"}},Yp=(A=".",Q="npx")=>{let B=`${A}/bun.lockb`,$=`${A}/bun.lock`,J=`${A}/pnpm-lock.yaml`,Y=`${A}/shrinkwrap.yaml`,Z=`${A}/yarn.lock`,X=`${A}/package-lock.json`,G=`${A}/npm-shrinkwrap.json`;if(xZ(B)||xZ($))return"bunx";if(xZ(J)||xZ(Y))return"pnpm exec";if(xZ(Z))return"yarn dlx";if(xZ(X)||xZ(G))return"npx";return Q};var $k=()=>{};function Zp(A,Q){if(isNaN(A)||isNaN(Q))throw Error("Cannot compare against non-numbers");return A===Q?0:A<Q?-1:1}function U_A(A=[],Q=[]){if(A.length&&!Q.length)return-1;if(!A.length&&Q.length)return 1;return 0}function Xp(A=[],Q=[]){let B=Math.max(A.length,Q.length);for(let $=0;$<B;$++){let J=A[$],Y=Q[$];if(J===void 0&&Y===void 0)return 0;if(Y===void 0)return 1;if(J===void 0)return-1;if(typeof J==="string"&&typeof Y==="number")return 1;if(typeof J==="number"&&typeof Y==="string")return-1;if(J<Y)return-1;if(J>Y)return 1}return 0}function EJA(A){return typeof A==="number"&&!Number.isNaN(A)&&(!Number.isFinite(A)||0<=A&&A<=Number.MAX_SAFE_INTEGER)}function fZ(A){return A.split(".").filter(Boolean).map((Q)=>{if(URQ.test(Q)){let B=Number(Q);if(EJA(B))return B}return Q})}function AH(A){return A.split(".").filter(Boolean)}function Kp(A,Q){let B=Number(A);if(!EJA(B))throw TypeError(Q);return B}function b2(A){return Number.isNaN(A.major)&&Number.isNaN(A.minor)&&Number.isNaN(A.patch)&&(A.prerelease===void 0||A.prerelease.length===0)&&(A.build===void 0||A.build.length===0)}var FR="0|[1-9]\\d*",WRQ="\\d*[a-zA-Z-][a-zA-Z0-9-]*",HRQ,H_A,z_A,F_A="[0-9A-Za-z-]+",q_A,D_A,I_A,O_A="(?:<|>)?=?",FRQ="x|X|\\*",RJA,Gp,M_A,C_A,jJA=256,URQ;var yX=cA(()=>{HRQ=`(?<major>${FR})\\.(?<minor>${FR})\\.(?<patch>${FR})`,H_A=`(?:${FR}|${WRQ})`,z_A=`(?:-(?<prerelease>${H_A}(?:\\.${H_A})*))`,q_A=`(?:\\+(?<buildmetadata>${F_A}(?:\\.${F_A})*))`,D_A=`v?${HRQ}${z_A}?${q_A}?`,I_A=new RegExp(`^${D_A}$`),RJA=`${FR}|${FRQ}`,Gp=`[v=\\s]*(?<major>${RJA})(?:\\.(?<minor>${RJA})(?:\\.(?<patch>${RJA})${z_A}?${q_A}?)?)?`,M_A=new RegExp(`^(?<operator>~>?|\\^|${O_A})\\s*${Gp}$`),C_A=new RegExp(`^(?<operator>${O_A})\\s*(${D_A})$|^$`);URQ=new RegExp(`^${FR}$`)});function PY(A,Q){if(A===Q)return 0;return Zp(A.major,Q.major)||Zp(A.minor,Q.minor)||Zp(A.patch,Q.patch)||U_A(A.prerelease,Q.prerelease)||Xp(A.prerelease,Q.prerelease)}var hG=cA(()=>{yX()});function L_A(A,Q){let B=A.prerelease?.length||Q.prerelease?.length;if(A.major!==Q.major)return B?"premajor":"major";if(A.minor!==Q.minor)return B?"preminor":"minor";if(A.patch!==Q.patch)return B?"prepatch":"patch";if(Xp(A.prerelease,Q.prerelease)!==0)return"prerelease"}var V_A=cA(()=>{yX()});function wJA(A){return A.toFixed(0)}function X7(A){let Q=wJA(A.major),B=wJA(A.minor),$=wJA(A.patch),J=A.prerelease?.join(".")??"",Y=A.build?.join(".")??"";return[[`${Q}.${B}.${$}`,J].filter((G)=>G).join("-"),Y].filter((G)=>G).join("+")}function zRQ(A,Q){if(b2(Q))return!0;let B=PY(A,Q);switch(Q.operator){case"=":case void 0:return B===0;case"!=":return B!==0;case">":return B>0;case"<":return B<0;case">=":return B>=0;case"<=":return B<=0}}function Wp(A,Q){for(let B of Q)if(!zRQ(A,B))return!1;if(!A.prerelease?.length)return!0;for(let B of Q){if(b2(B))continue;if(!B.prerelease?.length)continue;let{major:$,minor:J,patch:Y}=B;if(A.major===$&&A.minor===J&&A.patch===Y)return!0}return!1}var Hp=cA(()=>{yX();hG()});function Jk(A,Q){return Q.some((B)=>Wp(A,B))}var Yk=cA(()=>{Hp()});function qRQ(A=[]){let Q=[...A],B=Q.length;while(B>=0){let $=Q[B];if(typeof $==="number"){Q[B]=$+1;break}B-=1}if(B===-1)Q.push(0);return Q}function Zk(A=[],Q){let B=qRQ(A);if(!Q)return B;let $=fZ(Q);if($.every((J)=>typeof J==="string")){if($.every((J,Y)=>J===B[Y])&&typeof B[$.length]==="number")return B;$=[...$,0]}return $}function fq(A,Q,B={}){let $=B.build!==void 0?AH(B.build):A.build??[];switch(Q){case"premajor":return{major:A.major+1,minor:0,patch:0,prerelease:Zk(A.prerelease,B.prerelease),build:$};case"preminor":return{major:A.major,minor:A.minor+1,patch:0,prerelease:Zk(A.prerelease,B.prerelease),build:$};case"prepatch":return{major:A.major,minor:A.minor,patch:A.patch+1,prerelease:Zk(A.prerelease,B.prerelease),build:$};case"prerelease":{let Y=(A.prerelease??[]).length===0?A.patch+1:A.patch;return{major:A.major,minor:A.minor,patch:Y,prerelease:Zk(A.prerelease,B.prerelease),build:$}}case"major":return{major:(A.prerelease??[]).length===0||A.minor!==0||A.patch!==0?A.major+1:A.major,minor:0,patch:0,prerelease:[],build:$};case"minor":{let Y=(A.prerelease??[]).length===0||A.patch!==0?A.minor+1:A.minor;return{major:A.major,minor:Y,patch:0,prerelease:[],build:$}}case"patch":{let Y=(A.prerelease??[]).length===0?A.patch+1:A.patch;return{major:A.major,minor:A.minor,patch:Y,prerelease:[],build:$}}case"pre":return{major:A.major,minor:A.minor,patch:A.patch,prerelease:Zk(A.prerelease,B.prerelease),build:$};default:throw TypeError(`Cannot increment version: invalid argument ${Q}`)}}var N_A=cA(()=>{yX()});var Fp,UR;var Xk=cA(()=>{Fp={major:Number.NaN,minor:Number.NaN,patch:Number.NaN,prerelease:[],build:[]},UR={operator:void 0,...Fp}});var PJA=cA(()=>{Xk();yX()});function TJA(A,Q){return PY(A,Q)>0}var _JA=cA(()=>{hG()});var R_A=cA(()=>{Yk();_JA()});function i7(A,Q){return PY(A,Q)<0}var SJA=cA(()=>{hG()});var E_A=cA(()=>{Yk();SJA()});function DRQ(A){let B=A.match(C_A)?.groups;if(!B)return null;let{operator:$}=B;return{operator:$||void 0,...Fp}}function a6(A){return!A||A.toLowerCase()==="x"||A==="*"}function IRQ(A){if(a6(A.major))return;if(a6(A.minor))return{operator:">=",major:+A.major,minor:0,patch:0,prerelease:[],build:[]};if(a6(A.patch))return{operator:">=",major:+A.major,minor:+A.minor,patch:0,prerelease:[],build:[]};return{operator:">=",major:+A.major,minor:+A.minor,patch:+A.patch,prerelease:A.prerelease?fZ(A.prerelease):[],build:[]}}function ORQ(A){if(a6(A.major))return;if(a6(A.minor))return{operator:"<",major:+A.major+1,minor:0,patch:0,prerelease:[],build:[]};if(a6(A.patch))return{operator:"<",major:+A.major,minor:+A.minor+1,patch:0,prerelease:[],build:[]};if(A.prerelease)return{operator:"<=",major:+A.major,minor:+A.minor,patch:+A.patch,prerelease:fZ(A.prerelease),build:[]};return{operator:"<=",major:+A.major,minor:+A.minor,patch:+A.patch,prerelease:[],build:[]}}function MRQ(A){let Q=A.match(new RegExp(`^${Gp}`)),B=Q?.groups;if(!B)return null;let $=Q[0].length,J=A.slice($).match(/^\s+-\s+/);if(!J)return null;let Y=J[0].length,X=A.slice($+Y).match(new RegExp(`^${Gp}\\s*$`))?.groups,G=IRQ(B),K=ORQ(X);return[G,K].filter(Boolean)}function CRQ(A){let Q=a6(A.major),B=a6(A.minor),$=a6(A.patch),J=+A.major,Y=+A.minor,Z=+A.patch;if(Q)return[UR];if(B)return[{operator:">=",major:J,minor:0,patch:0},{operator:"<",major:J+1,minor:0,patch:0}];if($){if(J===0)return[{operator:">=",major:J,minor:Y,patch:0},{operator:"<",major:J,minor:Y+1,patch:0}];return[{operator:">=",major:J,minor:Y,patch:0},{operator:"<",major:J+1,minor:0,patch:0}]}let X=fZ(A.prerelease??"");if(J===0){if(Y===0)return[{operator:">=",major:J,minor:Y,patch:Z,prerelease:X},{operator:"<",major:J,minor:Y,patch:Z+1}];return[{operator:">=",major:J,minor:Y,patch:Z,prerelease:X},{operator:"<",major:J,minor:Y+1,patch:0}]}return[{operator:">=",major:J,minor:Y,patch:Z,prerelease:X},{operator:"<",major:J+1,minor:0,patch:0}]}function LRQ(A){let Q=a6(A.major),B=a6(A.minor),$=a6(A.patch),J=+A.major,Y=+A.minor,Z=+A.patch;if(Q)return[UR];if(B)return[{operator:">=",major:J,minor:0,patch:0},{operator:"<",major:J+1,minor:0,patch:0}];if($)return[{operator:">=",major:J,minor:Y,patch:0},{operator:"<",major:J,minor:Y+1,patch:0}];let X=fZ(A.prerelease??"");return[{operator:">=",major:J,minor:Y,patch:Z,prerelease:X},{operator:"<",major:J,minor:Y+1,patch:0}]}function VRQ(A){let Q=a6(A.major),B=a6(A.minor),$=a6(A.patch),J=+A.major,Y=+A.minor,Z=+A.patch;if(Q)return[{operator:"<",major:0,minor:0,patch:0}];if(B){if($)return[{operator:"<",major:J,minor:0,patch:0}];return[{operator:"<",major:J,minor:0,patch:0}]}if($)return[{operator:"<",major:J,minor:Y,patch:0}];let X=fZ(A.prerelease??""),G=AH(A.build??"");return[{operator:"<",major:J,minor:Y,patch:Z,prerelease:X,build:G}]}function NRQ(A){let Q=a6(A.minor),B=a6(A.patch),$=+A.major,J=+A.minor,Y=+A.patch;if(Q)return[{operator:"<",major:$+1,minor:0,patch:0}];if(B)return[{operator:"<",major:$,minor:J+1,patch:0}];let Z=fZ(A.prerelease??""),X=AH(A.build??"");return[{operator:"<=",major:$,minor:J,patch:Y,prerelease:Z,build:X}]}function RRQ(A){let Q=a6(A.major),B=a6(A.minor),$=a6(A.patch),J=+A.major,Y=+A.minor,Z=+A.patch;if(Q)return[{operator:"<",major:0,minor:0,patch:0}];if(B)return[{operator:">=",major:J+1,minor:0,patch:0}];if($)return[{operator:">=",major:J,minor:Y+1,patch:0}];let X=fZ(A.prerelease??""),G=AH(A.build??"");return[{operator:">",major:J,minor:Y,patch:Z,prerelease:X,build:G}]}function ERQ(A){let Q=a6(A.major),B=a6(A.minor),$=a6(A.patch),J=+A.major,Y=+A.minor,Z=+A.patch;if(Q)return[UR];if(B)return[{operator:">=",major:J,minor:0,patch:0}];if($)return[{operator:">=",major:J,minor:Y,patch:0}];let X=fZ(A.prerelease??""),G=AH(A.build??"");return[{operator:">=",major:J,minor:Y,patch:Z,prerelease:X,build:G}]}function jRQ(A){let Q=a6(A.major),B=a6(A.minor),$=a6(A.patch),J=+A.major,Y=+A.minor,Z=+A.patch;if(Q)return[UR];if(B)return[{operator:">=",major:J,minor:0,patch:0},{operator:"<",major:J+1,minor:0,patch:0}];if($)return[{operator:">=",major:J,minor:Y,patch:0},{operator:"<",major:J,minor:Y+1,patch:0}];let X=fZ(A.prerelease??""),G=AH(A.build??"");return[{operator:A.operator==="="?"=":void 0,major:J,minor:Y,patch:Z,prerelease:X,build:G}]}function wRQ(A){let Q=A.match(M_A)?.groups;if(!Q)return DRQ(A);switch(Q.operator){case"^":return CRQ(Q);case"~":case"~>":return LRQ(Q);case"<":return VRQ(Q);case"<=":return NRQ(Q);case">":return RRQ(Q);case">=":return ERQ(Q);default:return jRQ(Q)}}function PRQ(A){return A.split(/\s+/).flatMap(wRQ)}function Up(A){let Q=A.replaceAll(/(?<=[<>=~^])(\s+)/g,"").split(/\s*\|\|\s*/).map((B)=>MRQ(B)||PRQ(B));if(Q.some((B)=>B.includes(null)))throw TypeError(`Cannot parse version range: range "${A}" is invalid`);return Q}var kJA=cA(()=>{yX();Xk()});function B1(A){if(typeof A!=="string")throw TypeError(`Cannot parse version as version must be a string: received ${typeof A}`);if(A.length>jJA)throw TypeError(`Cannot parse version as version length is too long: length is ${A.length}, max length is ${jJA}`);A=A.trim();let Q=A.match(I_A)?.groups;if(!Q)throw TypeError(`Cannot parse version: ${A}`);let B=Kp(Q.major,`Cannot parse version ${A}: invalid major version`),$=Kp(Q.minor,`Cannot parse version ${A}: invalid minor version`),J=Kp(Q.patch,`Cannot parse version ${A}: invalid patch version`),Y=Q.prerelease?fZ(Q.prerelease):[],Z=Q.buildmetadata?AH(Q.buildmetadata):[];return{major:B,minor:$,patch:J,prerelease:Y,build:Z}}var zp=cA(()=>{yX();yX()});function j_A(A,Q){let B=A.operator,$=Q.operator;if(B===void 0){if(b2(A))return!0;return Jk(A,[[Q]])}if($===void 0){if(b2(Q))return!0;return Jk(Q,[[A]])}let J=PY(A,Q);return(B===">="||B===">")&&($===">="||$===">")||(B==="<="||B==="<")&&($==="<="||$==="<")||J===0&&((B===">="||B==="<=")&&($===">="||$==="<="))||J===-1&&(B===">="||B===">")&&($==="<="||$==="<")||J===1&&(B==="<="||B==="<")&&($===">="||$===">")}function TRQ(A){return A.every((Q)=>{return Q.some((B)=>_RQ(B))})}function _RQ(A){for(let Q=0;Q<A.length-1;Q++){let B=A[Q];for(let $ of A.slice(Q+1))if(!j_A(B,$))return!1}return!0}function w_A(A,Q){return TRQ([A,Q])&&A.some((B)=>{return Q.some(($)=>{return B.every((J)=>{return $.every((Y)=>j_A(J,Y))})})})}var P_A=cA(()=>{yX();hG();Yk()});var T_A=cA(()=>{kJA()});var __A=cA(()=>{Xk();Xk();PJA()});function vq(A){try{return B1(A),!0}catch{return!1}}var S_A=cA(()=>{zp()});var k_A=cA(()=>{zp()});var b_A=cA(()=>{yX()});var x_A=cA(()=>{hG()});var f_A=cA(()=>{hG()});var v_A=cA(()=>{Hp();yX();hG()});function bJA(A,Q){return PY(A,Q)>=0}var y_A=cA(()=>{hG()});var g_A=cA(()=>{Hp();yX();hG()});var h_A=cA(()=>{hG()});var uG=cA(()=>{hG();V_A();Yk();N_A();PJA();R_A();E_A();kJA();zp();P_A();T_A();__A();S_A();k_A();b_A();x_A();f_A();_JA();v_A();y_A();SJA();g_A();h_A()});var vZ=$A((pAB,Ip)=>{var u_A,m_A,c_A,d_A,l_A,p_A,i_A,n_A,a_A,r_A,o_A,s_A,t_A,qp,xJA,e_A,ASA,QSA,zR,BSA,$SA,JSA,YSA,ZSA,XSA,GSA,KSA,WSA,Dp,HSA,FSA,USA;(function(A){var Q=typeof global==="object"?global:typeof self==="object"?self:typeof this==="object"?this:{};if(typeof define==="function"&&define.amd)define("tslib",["exports"],function($){A(B(Q,B($)))});else if(typeof Ip==="object"&&typeof pAB==="object")A(B(Q,B(pAB)));else A(B(Q));function B($,J){if($!==Q)if(typeof Object.create==="function")Object.defineProperty($,"__esModule",{value:!0});else $.__esModule=!0;return function(Y,Z){return $[Y]=J?J(Y,Z):Z}}})(function(A){var Q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Y,Z){Y.__proto__=Z}||function(Y,Z){for(var X in Z)if(Object.prototype.hasOwnProperty.call(Z,X))Y[X]=Z[X]};u_A=function(Y,Z){if(typeof Z!=="function"&&Z!==null)throw TypeError("Class extends value "+String(Z)+" is not a constructor or null");Q(Y,Z);function X(){this.constructor=Y}Y.prototype=Z===null?Object.create(Z):(X.prototype=Z.prototype,new X)},m_A=Object.assign||function(Y){for(var Z,X=1,G=arguments.length;X<G;X++){Z=arguments[X];for(var K in Z)if(Object.prototype.hasOwnProperty.call(Z,K))Y[K]=Z[K]}return Y},c_A=function(Y,Z){var X={};for(var G in Y)if(Object.prototype.hasOwnProperty.call(Y,G)&&Z.indexOf(G)<0)X[G]=Y[G];if(Y!=null&&typeof Object.getOwnPropertySymbols==="function"){for(var K=0,G=Object.getOwnPropertySymbols(Y);K<G.length;K++)if(Z.indexOf(G[K])<0&&Object.prototype.propertyIsEnumerable.call(Y,G[K]))X[G[K]]=Y[G[K]]}return X},d_A=function(Y,Z,X,G){var K=arguments.length,W=K<3?Z:G===null?G=Object.getOwnPropertyDescriptor(Z,X):G,H;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")W=Reflect.decorate(Y,Z,X,G);else for(var U=Y.length-1;U>=0;U--)if(H=Y[U])W=(K<3?H(W):K>3?H(Z,X,W):H(Z,X))||W;return K>3&&W&&Object.defineProperty(Z,X,W),W},l_A=function(Y,Z){return function(X,G){Z(X,G,Y)}},p_A=function(Y,Z,X,G,K,W){function H(E){if(E!==void 0&&typeof E!=="function")throw TypeError("Function expected");return E}var U=G.kind,q=U==="getter"?"get":U==="setter"?"set":"value",D=!Z&&Y?G.static?Y:Y.prototype:null,I=Z||(D?Object.getOwnPropertyDescriptor(D,G.name):{}),O,V=!1;for(var N=X.length-1;N>=0;N--){var C={};for(var L in G)C[L]=L==="access"?{}:G[L];for(var L in G.access)C.access[L]=G.access[L];C.addInitializer=function(E){if(V)throw TypeError("Cannot add initializers after decoration has completed");W.push(H(E||null))};var R=(0,X[N])(U==="accessor"?{get:I.get,set:I.set}:I[q],C);if(U==="accessor"){if(R===void 0)continue;if(R===null||typeof R!=="object")throw TypeError("Object expected");if(O=H(R.get))I.get=O;if(O=H(R.set))I.set=O;if(O=H(R.init))K.unshift(O)}else if(O=H(R))if(U==="field")K.unshift(O);else I[q]=O}if(D)Object.defineProperty(D,G.name,I);V=!0},i_A=function(Y,Z,X){var G=arguments.length>2;for(var K=0;K<Z.length;K++)X=G?Z[K].call(Y,X):Z[K].call(Y);return G?X:void 0},n_A=function(Y){return typeof Y==="symbol"?Y:"".concat(Y)},a_A=function(Y,Z,X){if(typeof Z==="symbol")Z=Z.description?"[".concat(Z.description,"]"):"";return Object.defineProperty(Y,"name",{configurable:!0,value:X?"".concat(X," ",Z):Z})},r_A=function(Y,Z){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(Y,Z)},o_A=function(Y,Z,X,G){function K(W){return W instanceof X?W:new X(function(H){H(W)})}return new(X||(X=Promise))(function(W,H){function U(I){try{D(G.next(I))}catch(O){H(O)}}function q(I){try{D(G.throw(I))}catch(O){H(O)}}function D(I){I.done?W(I.value):K(I.value).then(U,q)}D((G=G.apply(Y,Z||[])).next())})},s_A=function(Y,Z){var X={label:0,sent:function(){if(W[0]&1)throw W[1];return W[1]},trys:[],ops:[]},G,K,W,H=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return H.next=U(0),H.throw=U(1),H.return=U(2),typeof Symbol==="function"&&(H[Symbol.iterator]=function(){return this}),H;function U(D){return function(I){return q([D,I])}}function q(D){if(G)throw TypeError("Generator is already executing.");while(H&&(H=0,D[0]&&(X=0)),X)try{if(G=1,K&&(W=D[0]&2?K.return:D[0]?K.throw||((W=K.return)&&W.call(K),0):K.next)&&!(W=W.call(K,D[1])).done)return W;if(K=0,W)D=[D[0]&2,W.value];switch(D[0]){case 0:case 1:W=D;break;case 4:return X.label++,{value:D[1],done:!1};case 5:X.label++,K=D[1],D=[0];continue;case 7:D=X.ops.pop(),X.trys.pop();continue;default:if((W=X.trys,!(W=W.length>0&&W[W.length-1]))&&(D[0]===6||D[0]===2)){X=0;continue}if(D[0]===3&&(!W||D[1]>W[0]&&D[1]<W[3])){X.label=D[1];break}if(D[0]===6&&X.label<W[1]){X.label=W[1],W=D;break}if(W&&X.label<W[2]){X.label=W[2],X.ops.push(D);break}if(W[2])X.ops.pop();X.trys.pop();continue}D=Z.call(Y,X)}catch(I){D=[6,I],K=0}finally{G=W=0}if(D[0]&5)throw D[1];return{value:D[0]?D[1]:void 0,done:!0}}},t_A=function(Y,Z){for(var X in Y)if(X!=="default"&&!Object.prototype.hasOwnProperty.call(Z,X))Dp(Z,Y,X)},Dp=Object.create?function(Y,Z,X,G){if(G===void 0)G=X;var K=Object.getOwnPropertyDescriptor(Z,X);if(!K||("get"in K?!Z.__esModule:K.writable||K.configurable))K={enumerable:!0,get:function(){return Z[X]}};Object.defineProperty(Y,G,K)}:function(Y,Z,X,G){if(G===void 0)G=X;Y[G]=Z[X]},qp=function(Y){var Z=typeof Symbol==="function"&&Symbol.iterator,X=Z&&Y[Z],G=0;if(X)return X.call(Y);if(Y&&typeof Y.length==="number")return{next:function(){if(Y&&G>=Y.length)Y=void 0;return{value:Y&&Y[G++],done:!Y}}};throw TypeError(Z?"Object is not iterable.":"Symbol.iterator is not defined.")},xJA=function(Y,Z){var X=typeof Symbol==="function"&&Y[Symbol.iterator];if(!X)return Y;var G=X.call(Y),K,W=[],H;try{while((Z===void 0||Z-- >0)&&!(K=G.next()).done)W.push(K.value)}catch(U){H={error:U}}finally{try{if(K&&!K.done&&(X=G.return))X.call(G)}finally{if(H)throw H.error}}return W},e_A=function(){for(var Y=[],Z=0;Z<arguments.length;Z++)Y=Y.concat(xJA(arguments[Z]));return Y},ASA=function(){for(var Y=0,Z=0,X=arguments.length;Z<X;Z++)Y+=arguments[Z].length;for(var G=Array(Y),K=0,Z=0;Z<X;Z++)for(var W=arguments[Z],H=0,U=W.length;H<U;H++,K++)G[K]=W[H];return G},QSA=function(Y,Z,X){if(X||arguments.length===2){for(var G=0,K=Z.length,W;G<K;G++)if(W||!(G in Z)){if(!W)W=Array.prototype.slice.call(Z,0,G);W[G]=Z[G]}}return Y.concat(W||Array.prototype.slice.call(Z))},zR=function(Y){return this instanceof zR?(this.v=Y,this):new zR(Y)},BSA=function(Y,Z,X){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var G=X.apply(Y,Z||[]),K,W=[];return K=Object.create((typeof AsyncIterator==="function"?AsyncIterator:Object).prototype),U("next"),U("throw"),U("return",H),K[Symbol.asyncIterator]=function(){return this},K;function H(N){return function(C){return Promise.resolve(C).then(N,O)}}function U(N,C){if(G[N]){if(K[N]=function(L){return new Promise(function(R,E){W.push([N,L,R,E])>1||q(N,L)})},C)K[N]=C(K[N])}}function q(N,C){try{D(G[N](C))}catch(L){V(W[0][3],L)}}function D(N){N.value instanceof zR?Promise.resolve(N.value.v).then(I,O):V(W[0][2],N)}function I(N){q("next",N)}function O(N){q("throw",N)}function V(N,C){if(N(C),W.shift(),W.length)q(W[0][0],W[0][1])}},$SA=function(Y){var Z,X;return Z={},G("next"),G("throw",function(K){throw K}),G("return"),Z[Symbol.iterator]=function(){return this},Z;function G(K,W){Z[K]=Y[K]?function(H){return(X=!X)?{value:zR(Y[K](H)),done:!1}:W?W(H):H}:W}},JSA=function(Y){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var Z=Y[Symbol.asyncIterator],X;return Z?Z.call(Y):(Y=typeof qp==="function"?qp(Y):Y[Symbol.iterator](),X={},G("next"),G("throw"),G("return"),X[Symbol.asyncIterator]=function(){return this},X);function G(W){X[W]=Y[W]&&function(H){return new Promise(function(U,q){H=Y[W](H),K(U,q,H.done,H.value)})}}function K(W,H,U,q){Promise.resolve(q).then(function(D){W({value:D,done:U})},H)}},YSA=function(Y,Z){if(Object.defineProperty)Object.defineProperty(Y,"raw",{value:Z});else Y.raw=Z;return Y};var B=Object.create?function(Y,Z){Object.defineProperty(Y,"default",{enumerable:!0,value:Z})}:function(Y,Z){Y.default=Z},$=function(Y){return $=Object.getOwnPropertyNames||function(Z){var X=[];for(var G in Z)if(Object.prototype.hasOwnProperty.call(Z,G))X[X.length]=G;return X},$(Y)};ZSA=function(Y){if(Y&&Y.__esModule)return Y;var Z={};if(Y!=null){for(var X=$(Y),G=0;G<X.length;G++)if(X[G]!=="default")Dp(Z,Y,X[G])}return B(Z,Y),Z},XSA=function(Y){return Y&&Y.__esModule?Y:{default:Y}},GSA=function(Y,Z,X,G){if(X==="a"&&!G)throw TypeError("Private accessor was defined without a getter");if(typeof Z==="function"?Y!==Z||!G:!Z.has(Y))throw TypeError("Cannot read private member from an object whose class did not declare it");return X==="m"?G:X==="a"?G.call(Y):G?G.value:Z.get(Y)},KSA=function(Y,Z,X,G,K){if(G==="m")throw TypeError("Private method is not writable");if(G==="a"&&!K)throw TypeError("Private accessor was defined without a setter");if(typeof Z==="function"?Y!==Z||!K:!Z.has(Y))throw TypeError("Cannot write private member to an object whose class did not declare it");return G==="a"?K.call(Y,X):K?K.value=X:Z.set(Y,X),X},WSA=function(Y,Z){if(Z===null||typeof Z!=="object"&&typeof Z!=="function")throw TypeError("Cannot use 'in' operator on non-object");return typeof Y==="function"?Z===Y:Y.has(Z)},HSA=function(Y,Z,X){if(Z!==null&&Z!==void 0){if(typeof Z!=="object"&&typeof Z!=="function")throw TypeError("Object expected.");var G,K;if(X){if(!Symbol.asyncDispose)throw TypeError("Symbol.asyncDispose is not defined.");G=Z[Symbol.asyncDispose]}if(G===void 0){if(!Symbol.dispose)throw TypeError("Symbol.dispose is not defined.");if(G=Z[Symbol.dispose],X)K=G}if(typeof G!=="function")throw TypeError("Object not disposable.");if(K)G=function(){try{K.call(this)}catch(W){return Promise.reject(W)}};Y.stack.push({value:Z,dispose:G,async:X})}else if(X)Y.stack.push({async:!0});return Z};var J=typeof SuppressedError==="function"?SuppressedError:function(Y,Z,X){var G=Error(X);return G.name="SuppressedError",G.error=Y,G.suppressed=Z,G};FSA=function(Y){function Z(W){Y.error=Y.hasError?new J(W,Y.error,"An error was suppressed during disposal."):W,Y.hasError=!0}var X,G=0;function K(){while(X=Y.stack.pop())try{if(!X.async&&G===1)return G=0,Y.stack.push(X),Promise.resolve().then(K);if(X.dispose){var W=X.dispose.call(X.value);if(X.async)return G|=2,Promise.resolve(W).then(K,function(H){return Z(H),K()})}else G|=1}catch(H){Z(H)}if(G===1)return Y.hasError?Promise.reject(Y.error):Promise.resolve();if(Y.hasError)throw Y.error}return K()},USA=function(Y,Z){if(typeof Y==="string"&&/^\.\.?\//.test(Y))return Y.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(X,G,K,W,H){return G?Z?".jsx":".js":K&&(!W||!H)?X:K+W+"."+H.toLowerCase()+"js"});return Y},A("__extends",u_A),A("__assign",m_A),A("__rest",c_A),A("__decorate",d_A),A("__param",l_A),A("__esDecorate",p_A),A("__runInitializers",i_A),A("__propKey",n_A),A("__setFunctionName",a_A),A("__metadata",r_A),A("__awaiter",o_A),A("__generator",s_A),A("__exportStar",t_A),A("__createBinding",Dp),A("__values",qp),A("__read",xJA),A("__spread",e_A),A("__spreadArrays",ASA),A("__spreadArray",QSA),A("__await",zR),A("__asyncGenerator",BSA),A("__asyncDelegator",$SA),A("__asyncValues",JSA),A("__makeTemplateObject",YSA),A("__importStar",ZSA),A("__importDefault",XSA),A("__classPrivateFieldGet",GSA),A("__classPrivateFieldSet",KSA),A("__classPrivateFieldIn",WSA),A("__addDisposableResource",HSA),A("__disposeResources",FSA),A("__rewriteRelativeImportExtension",USA)})});var DSA=$A((zSA)=>{Object.defineProperty(zSA,"__esModule",{value:!0});zSA.resolveFetch=void 0;var SRQ=(A)=>{if(A)return(...Q)=>A(...Q);return(...Q)=>fetch(...Q)};zSA.resolveFetch=SRQ});var fJA=$A((LSA)=>{Object.defineProperty(LSA,"__esModule",{value:!0});LSA.FunctionRegion=LSA.FunctionsHttpError=LSA.FunctionsRelayError=LSA.FunctionsFetchError=LSA.FunctionsError=void 0;class Gk extends Error{constructor(A,Q="FunctionsError",B){super(A);this.name=Q,this.context=B}toJSON(){return{name:this.name,message:this.message,context:this.context}}}LSA.FunctionsError=Gk;class OSA extends Gk{constructor(A){super("Failed to send a request to the Edge Function","FunctionsFetchError",A)}}LSA.FunctionsFetchError=OSA;class MSA extends Gk{constructor(A){super("Relay Error invoking the Edge Function","FunctionsRelayError",A)}}LSA.FunctionsRelayError=MSA;class CSA extends Gk{constructor(A){super("Edge Function returned a non-2xx status code","FunctionsHttpError",A)}}LSA.FunctionsHttpError=CSA;var ISA;(function(A){A.Any="any",A.ApNortheast1="ap-northeast-1",A.ApNortheast2="ap-northeast-2",A.ApSouth1="ap-south-1",A.ApSoutheast1="ap-southeast-1",A.ApSoutheast2="ap-southeast-2",A.CaCentral1="ca-central-1",A.EuCentral1="eu-central-1",A.EuWest1="eu-west-1",A.EuWest2="eu-west-2",A.EuWest3="eu-west-3",A.SaEast1="sa-east-1",A.UsEast1="us-east-1",A.UsWest1="us-west-1",A.UsWest2="us-west-2"})(ISA||(LSA.FunctionRegion=ISA={}))});var jSA=$A((RSA)=>{Object.defineProperty(RSA,"__esModule",{value:!0});RSA.FunctionsClient=void 0;var vRQ=vZ(),yRQ=DSA(),qR=fJA();class NSA{constructor(A,{headers:Q={},customFetch:B,region:$=qR.FunctionRegion.Any}={}){this.url=A,this.headers=Q,this.region=$,this.fetch=(0,yRQ.resolveFetch)(B)}setAuth(A){this.headers.Authorization=`Bearer ${A}`}invoke(A){return vRQ.__awaiter(this,arguments,void 0,function*(Q,B={}){var $,J;let Y,Z,X;try{let{headers:G,method:K,body:W,signal:H,timeout:U}=B,q={},{region:D}=B;if(!D)D=this.region;let I=new URL(`${this.url}/${Q}`);if(D&&D!=="any")q["x-region"]=D,I.searchParams.set("forceFunctionRegion",D);let O,V=!!G&&Object.keys(G).some((w)=>w.toLowerCase()==="content-type");if(W&&!V)if(typeof Blob<"u"&&W instanceof Blob||W instanceof ArrayBuffer)q["Content-Type"]="application/octet-stream",O=W;else if(typeof W==="string")q["Content-Type"]="text/plain",O=W;else if(typeof FormData<"u"&&W instanceof FormData)O=W;else q["Content-Type"]="application/json",O=JSON.stringify(W);else if(W&&typeof W!=="string"&&!(typeof Blob<"u"&&W instanceof Blob)&&!(W instanceof ArrayBuffer)&&!(typeof FormData<"u"&&W instanceof FormData))O=JSON.stringify(W);else O=W;let N=H;if(U)if(Z=new AbortController,Y=setTimeout(()=>Z.abort(),U),H)N=Z.signal,X=()=>Z.abort(),H.addEventListener("abort",X);else N=Z.signal;let C=yield this.fetch(I.toString(),{method:K||"POST",headers:Object.assign(Object.assign(Object.assign({},q),this.headers),G),body:O,signal:N}).catch((w)=>{throw new qR.FunctionsFetchError(w)}),L=C.headers.get("x-relay-error");if(L&&L==="true")throw new qR.FunctionsRelayError(C);if(!C.ok)throw new qR.FunctionsHttpError(C);let R=(($=C.headers.get("Content-Type"))!==null&&$!==void 0?$:"text/plain").split(";")[0].trim().toLowerCase(),E;if(R==="application/json")E=yield C.json();else if(R==="application/octet-stream"||R==="application/pdf")E=yield C.blob();else if(R==="text/event-stream")E=C;else if(R==="multipart/form-data")E=yield C.formData();else E=yield C.text();return{data:E,error:null,response:C}}catch(G){return{data:null,error:G,response:G instanceof qR.FunctionsHttpError||G instanceof qR.FunctionsRelayError?G.context:void 0}}finally{if(Y)clearTimeout(Y);if(X)(J=B.signal)===null||J===void 0||J.removeEventListener("abort",X)}})}}RSA.FunctionsClient=NSA});var wSA=$A((yq)=>{Object.defineProperty(yq,"__esModule",{value:!0});yq.FunctionRegion=yq.FunctionsRelayError=yq.FunctionsHttpError=yq.FunctionsFetchError=yq.FunctionsError=yq.FunctionsClient=void 0;var gRQ=jSA();Object.defineProperty(yq,"FunctionsClient",{enumerable:!0,get:function(){return gRQ.FunctionsClient}});var Kk=fJA();Object.defineProperty(yq,"FunctionsError",{enumerable:!0,get:function(){return Kk.FunctionsError}});Object.defineProperty(yq,"FunctionsFetchError",{enumerable:!0,get:function(){return Kk.FunctionsFetchError}});Object.defineProperty(yq,"FunctionsHttpError",{enumerable:!0,get:function(){return Kk.FunctionsHttpError}});Object.defineProperty(yq,"FunctionsRelayError",{enumerable:!0,get:function(){return Kk.FunctionsRelayError}});Object.defineProperty(yq,"FunctionRegion",{enumerable:!0,get:function(){return Kk.FunctionRegion}})});function TSA(A,Q){return new Promise((B)=>{if(Q===null||Q===void 0?void 0:Q.aborted){B();return}let $=setTimeout(()=>{Q===null||Q===void 0||Q.removeEventListener("abort",J),B()},A);function J(){clearTimeout($),B()}Q===null||Q===void 0||Q.addEventListener("abort",J)})}function mRQ(A,Q,B,$){if(!$||B>=3)return!1;if(!kSA.includes(A))return!1;if(!uRQ.includes(Q))return!1;return!0}function Wk(A){return Wk=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Q){return typeof Q}:function(Q){return Q&&typeof Symbol=="function"&&Q.constructor===Symbol&&Q!==Symbol.prototype?"symbol":typeof Q},Wk(A)}function pRQ(A,Q){if(Wk(A)!="object"||!A)return A;var B=A[Symbol.toPrimitive];if(B!==void 0){var $=B.call(A,Q||"default");if(Wk($)!="object")return $;throw TypeError("@@toPrimitive must return a primitive value.")}return(Q==="string"?String:Number)(A)}function iRQ(A){var Q=pRQ(A,"string");return Wk(Q)=="symbol"?Q:Q+""}function nRQ(A,Q,B){return(Q=iRQ(Q))in A?Object.defineProperty(A,Q,{value:B,enumerable:!0,configurable:!0,writable:!0}):A[Q]=B,A}function SSA(A,Q){var B=Object.keys(A);if(Object.getOwnPropertySymbols){var $=Object.getOwnPropertySymbols(A);Q&&($=$.filter(function(J){return Object.getOwnPropertyDescriptor(A,J).enumerable})),B.push.apply(B,$)}return B}function Op(A){for(var Q=1;Q<arguments.length;Q++){var B=arguments[Q]!=null?arguments[Q]:{};Q%2?SSA(Object(B),!0).forEach(function($){nRQ(A,$,B[$])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(B)):SSA(Object(B)).forEach(function($){Object.defineProperty(A,$,Object.getOwnPropertyDescriptor(B,$))})}return A}var PSA=(A)=>Math.min(1000*2**A,30000),uRQ,kSA,vJA,cRQ=class{constructor(A){var Q,B,$,J,Y;if(this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=A.method,this.url=A.url,this.headers=new Headers(A.headers),this.schema=A.schema,this.body=A.body,this.shouldThrowOnError=(Q=A.shouldThrowOnError)!==null&&Q!==void 0?Q:!1,this.signal=A.signal,this.isMaybeSingle=(B=A.isMaybeSingle)!==null&&B!==void 0?B:!1,this.shouldStripNulls=($=A.shouldStripNulls)!==null&&$!==void 0?$:!1,this.urlLengthLimit=(J=A.urlLengthLimit)!==null&&J!==void 0?J:8000,this.retryEnabled=(Y=A.retry)!==null&&Y!==void 0?Y:!0,A.fetch)this.fetch=A.fetch;else this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(A,Q){return this.headers=new Headers(this.headers),this.headers.set(A,Q),this}retry(A){return this.retryEnabled=A,this}then(A,Q){var B=this;if(this.schema===void 0);else if(["GET","HEAD"].includes(this.method))this.headers.set("Accept-Profile",this.schema);else this.headers.set("Content-Profile",this.schema);if(this.method!=="GET"&&this.method!=="HEAD")this.headers.set("Content-Type","application/json");if(this.shouldStripNulls){let Z=this.headers.get("Accept");if(Z==="application/vnd.pgrst.object+json")this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped");else if(!Z||Z==="application/json")this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}let $=this.fetch,Y=(async()=>{let Z=0;while(!0){let K={};if(B.headers.forEach((H,U)=>{K[U]=H}),Z>0)K["X-Retry-Count"]=String(Z);let W;try{W=await $(B.url.toString(),{method:B.method,headers:K,body:JSON.stringify(B.body,(H,U)=>typeof U==="bigint"?U.toString():U),signal:B.signal})}catch(H){if((H===null||H===void 0?void 0:H.name)==="AbortError"||(H===null||H===void 0?void 0:H.code)==="ABORT_ERR")throw H;if(!kSA.includes(B.method))throw H;if(B.retryEnabled&&Z<3){let U=PSA(Z);Z++,await TSA(U,B.signal);continue}throw H}if(mRQ(B.method,W.status,Z,B.retryEnabled)){var X,G;let H=(X=(G=W.headers)===null||G===void 0?void 0:G.get("Retry-After"))!==null&&X!==void 0?X:null,U=H!==null?Math.max(0,parseInt(H,10)||0)*1000:PSA(Z);await W.text(),Z++,await TSA(U,B.signal);continue}return await B.processResponse(W)}})();if(!this.shouldThrowOnError)Y=Y.catch((Z)=>{var X;let G="",K="",W="",H=Z===null||Z===void 0?void 0:Z.cause;if(H){var U,q,D,I;let N=(U=H===null||H===void 0?void 0:H.message)!==null&&U!==void 0?U:"",C=(q=H===null||H===void 0?void 0:H.code)!==null&&q!==void 0?q:"";if(G=`${(D=Z===null||Z===void 0?void 0:Z.name)!==null&&D!==void 0?D:"FetchError"}: ${Z===null||Z===void 0?void 0:Z.message}`,G+=`
|
|
72
72
|
|
|
73
73
|
Caused by: ${(I=H===null||H===void 0?void 0:H.name)!==null&&I!==void 0?I:"Error"}: ${N}`,C)G+=` (${C})`;if(H===null||H===void 0?void 0:H.stack)G+=`
|
|
@@ -1290,7 +1290,7 @@ Reference: ${A1.url}
|
|
|
1290
1290
|
`))A.push(` ${B}`)}function xM0(A,Q){if(Q.type==="custom")return Q.command;if(Q.type==="skip")return"# build step skipped — user opted out at wizard time";let B=Q.name;switch(A){case"bun":return`bun run ${B}`;case"npm":return`npm run ${B}`;case"pnpm":return`pnpm run ${B}`;case"yarn":return`yarn ${B}`}}function oYQ(A){switch(A){case"bun":return"bunx";case"npm":return"npx";case"pnpm":return"pnpm dlx";case"yarn":return"npx"}}function Nz(A,Q={}){let B=Q.baseDir??mM0(),$=uM0(B,_$),J=HG(A);if(fM0($)&&!Q.overwrite){let Y=yM0($,"utf8");return{kind:"exists",absolutePath:$,existingContent:Y,newContent:J.content}}return vM0(hM0($),{recursive:!0}),gM0($,J.content),{kind:"written",absolutePath:$,content:J.content}}var i0=AQ(I8(),1),sYQ=({onChoose:A,dense:Q=!1})=>i0.jsxDEV(XA,{flexDirection:"column",marginTop:1,children:[i0.jsxDEV(E9,{variant:"info",children:Q?"Android apps must be signed by a keystore. Google Play requires the same one for every update, forever.":"Android apps must be signed by a keystore. Google Play requires the same keystore for every update, forever."},void 0,!1,void 0,this),!Q&&i0.jsxDEV($Q,{},void 0,!1,void 0,this),i0.jsxDEV(a,{bold:!0,children:"Do you already have a keystore?"},void 0,!1,void 0,this),!Q&&i0.jsxDEV($Q,{},void 0,!1,void 0,this),i0.jsxDEV(G0,{options:[{label:"✅ Yes, I have one",value:"existing"},{label:"\uD83C\uDD95 No, create one for me",value:"generate"},{label:"ℹ️ What is a keystore?",value:"learn"}],onChange:(B)=>A(B)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),tYQ=({onBack:A})=>{return i0.jsxDEV(XA,{flexDirection:"column",marginTop:1,children:[i0.jsxDEV(E9,{variant:"info",children:"A keystore is a file that holds a cryptographic key used to sign your Android app."},void 0,!1,void 0,this),i0.jsxDEV($Q,{},void 0,!1,void 0,this),i0.jsxDEV(XA,{flexDirection:"column",marginLeft:2,children:[i0.jsxDEV(a,{children:"• Google Play uses the key to verify that every update really came from you."},void 0,!1,void 0,this),i0.jsxDEV(a,{children:["• You must use the"," ",i0.jsxDEV(a,{bold:!0,children:"same"},void 0,!1,void 0,this)," ","keystore for every release of this app."]},void 0,!0,void 0,this),i0.jsxDEV(a,{children:"• If you lose it, you lose the ability to publish updates."},void 0,!1,void 0,this),i0.jsxDEV(a,{children:"• If you've never published this app before, let us create one for you."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),i0.jsxDEV($Q,{},void 0,!1,void 0,this),i0.jsxDEV(G0,{options:[{label:"← Back",value:"back"}],onChange:A},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},eYQ=({showChooser:A,onChoosePicker:Q,onChooseManual:B,onSubmitPath:$,dense:J=!1})=>i0.jsxDEV(XA,{flexDirection:"column",marginTop:1,children:[i0.jsxDEV(a,{bold:!0,children:"Existing keystore (.jks, .keystore, or .p12)"},void 0,!1,void 0,this),!J&&i0.jsxDEV($Q,{},void 0,!1,void 0,this),A?i0.jsxDEV(i0.Fragment,{children:[i0.jsxDEV(a,{children:"How do you want to provide it?"},void 0,!1,void 0,this),!J&&i0.jsxDEV($Q,{},void 0,!1,void 0,this),i0.jsxDEV(G0,{options:[{label:"\uD83D\uDCC2 Open file picker",value:"picker"},{label:"\uD83D\uDCDD Type the path",value:"manual"}],onChange:(Y)=>{if(Y==="picker")Q();else B()}},void 0,!1,void 0,this)]},void 0,!0,void 0,this):i0.jsxDEV(i0.Fragment,{children:[i0.jsxDEV(a,{dimColor:!0,children:"Tip: drag a file into this window to paste its path."},void 0,!1,void 0,this),!J&&i0.jsxDEV($Q,{},void 0,!1,void 0,this),i0.jsxDEV(A$,{placeholder:"/path/to/release.jks",filter:"",onSubmit:$},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),AZQ=()=>i0.jsxDEV(XA,{marginTop:1,children:i0.jsxDEV(TB,{text:"Waiting for file selection..."},void 0,!1,void 0,this)},void 0,!1,void 0,this),QZQ=({onSubmit:A,dense:Q=!1})=>i0.jsxDEV(XA,{flexDirection:"column",marginTop:1,children:[i0.jsxDEV(a,{bold:!0,children:"Store password:"},void 0,!1,void 0,this),i0.jsxDEV(a,{dimColor:!0,children:"We'll use this to unlock the keystore and auto-detect the alias."},void 0,!1,void 0,this),!Q&&i0.jsxDEV($Q,{},void 0,!1,void 0,this),i0.jsxDEV(A$,{placeholder:"(hidden)",filter:"",mask:!0,onSubmit:A},void 0,!1,void 0,this)]},void 0,!0,void 0,this),BZQ=()=>i0.jsxDEV(XA,{marginTop:1,children:i0.jsxDEV(TB,{text:"Unlocking keystore and reading aliases..."},void 0,!1,void 0,this)},void 0,!1,void 0,this),$ZQ=({aliases:A,onSelect:Q})=>{return i0.jsxDEV(XA,{flexDirection:"column",marginTop:1,children:[i0.jsxDEV(a,{bold:!0,children:"Multiple aliases in the keystore. Which one do you use for this app?"},void 0,!1,void 0,this),i0.jsxDEV($Q,{},void 0,!1,void 0,this),i0.jsxDEV(G0,{options:A.map((B)=>({label:B,value:B})),onChange:Q},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},JZQ=({onSubmit:A,dense:Q=!1})=>i0.jsxDEV(XA,{flexDirection:"column",marginTop:1,children:[i0.jsxDEV(a,{bold:!0,children:"Key alias:"},void 0,!1,void 0,this),i0.jsxDEV(a,{dimColor:!0,children:"We couldn't auto-detect it — please enter it manually."},void 0,!1,void 0,this),!Q&&i0.jsxDEV($Q,{},void 0,!1,void 0,this),i0.jsxDEV(A$,{placeholder:"release",filter:"",onSubmit:A},void 0,!1,void 0,this)]},void 0,!0,void 0,this),YZQ=({mode:A,onSubmit:Q,dense:B=!1})=>{if(A==="probing")return i0.jsxDEV(XA,{marginTop:1,children:i0.jsxDEV(TB,{text:"Checking if the key uses the same password as the store..."},void 0,!1,void 0,this)},void 0,!1,void 0,this);return i0.jsxDEV(XA,{flexDirection:"column",marginTop:1,children:[i0.jsxDEV(a,{bold:!0,children:B?"Key password (Enter to reuse the store password):":"Key password (press Enter to use the same as store password):"},void 0,!1,void 0,this),!B&&i0.jsxDEV($Q,{},void 0,!1,void 0,this),i0.jsxDEV(A$,{placeholder:"(hidden — same as store)",filter:"",mask:!0,onSubmit:Q},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},ZZQ=({onSubmit:A,dense:Q=!1})=>i0.jsxDEV(XA,{flexDirection:"column",marginTop:1,children:[i0.jsxDEV(a,{bold:!0,children:'Key alias (press Enter for "release"):'},void 0,!1,void 0,this),!Q&&i0.jsxDEV($Q,{},void 0,!1,void 0,this),i0.jsxDEV(A$,{placeholder:"release",filter:"",onSubmit:A},void 0,!1,void 0,this)]},void 0,!0,void 0,this),XZQ=({onChoose:A,dense:Q=!1})=>i0.jsxDEV(XA,{flexDirection:"column",marginTop:1,children:[i0.jsxDEV(a,{bold:!0,children:"How would you like to set the keystore password?"},void 0,!1,void 0,this),!Q&&i0.jsxDEV($Q,{},void 0,!1,void 0,this),i0.jsxDEV(G0,{options:[{label:"\uD83D\uDD10 Generate a strong random password (recommended)",value:"random"},{label:"✍️ I'll set my own",value:"manual"}],onChange:(B)=>A(B)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),GZQ=({onSubmit:A,dense:Q=!1})=>i0.jsxDEV(XA,{flexDirection:"column",marginTop:1,children:[i0.jsxDEV(a,{bold:!0,children:"Store password:"},void 0,!1,void 0,this),!Q&&i0.jsxDEV($Q,{},void 0,!1,void 0,this),i0.jsxDEV(A$,{placeholder:"(hidden, minimum 6 characters)",filter:"",mask:!0,onSubmit:A},void 0,!1,void 0,this)]},void 0,!0,void 0,this),KZQ=({onSubmit:A,dense:Q=!1})=>i0.jsxDEV(XA,{flexDirection:"column",marginTop:1,children:[i0.jsxDEV(a,{bold:!0,children:"Key password (press Enter to match store password):"},void 0,!1,void 0,this),!Q&&i0.jsxDEV($Q,{},void 0,!1,void 0,this),i0.jsxDEV(A$,{placeholder:"(hidden — same as store)",filter:"",mask:!0,onSubmit:A},void 0,!1,void 0,this)]},void 0,!0,void 0,this),WZQ=({appId:A,onSubmit:Q,dense:B=!1})=>i0.jsxDEV(XA,{flexDirection:"column",marginTop:1,children:[i0.jsxDEV(a,{bold:!0,children:B?"Common Name for the certificate (Enter to use app ID):":"Common Name for the certificate (press Enter to use app ID):"},void 0,!1,void 0,this),i0.jsxDEV(a,{dimColor:!0,children:"Google Play doesn't display this — default is safe."},void 0,!1,void 0,this),!B&&i0.jsxDEV($Q,{},void 0,!1,void 0,this),i0.jsxDEV(A$,{placeholder:A,filter:"",onSubmit:Q},void 0,!1,void 0,this)]},void 0,!0,void 0,this),HZQ=()=>i0.jsxDEV(XA,{marginTop:1,children:i0.jsxDEV(TB,{text:"Generating 2048-bit RSA keystore..."},void 0,!1,void 0,this)},void 0,!1,void 0,this);var vQ=AQ(I8(),1),FZQ=4,UZQ=({onChoose:A,dense:Q=!1})=>vQ.jsxDEV(XA,{flexDirection:"column",marginTop:1,children:[vQ.jsxDEV(E9,{variant:"info",children:Q?"Capgo needs a Google Play service account JSON to upload AABs. Bring your own, or let Capgo set one up via Google.":"Capgo needs a Google Play service account JSON to upload AABs on your behalf. You can bring your own or let Capgo set one up via Google sign-in."},void 0,!1,void 0,this),!Q&&vQ.jsxDEV($Q,{},void 0,!1,void 0,this),vQ.jsxDEV(a,{bold:!0,children:"Do you already have a service account JSON?"},void 0,!1,void 0,this),!Q&&vQ.jsxDEV($Q,{},void 0,!1,void 0,this),vQ.jsxDEV(G0,{options:[{label:"\uD83D\uDD10 No, set one up for me via Google",value:"generate"},{label:"✅ Yes, I have my service account JSON file",value:"existing"}],onChange:(B)=>A(B)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),zZQ=({showChooser:A,onChoosePicker:Q,onChooseManual:B,onSubmitPath:$,dense:J=!1})=>vQ.jsxDEV(XA,{flexDirection:"column",marginTop:1,children:[vQ.jsxDEV(a,{bold:!0,children:"Existing service account JSON (.json)"},void 0,!1,void 0,this),!J&&vQ.jsxDEV($Q,{},void 0,!1,void 0,this),A?vQ.jsxDEV(vQ.Fragment,{children:[vQ.jsxDEV(a,{children:"How do you want to provide it?"},void 0,!1,void 0,this),!J&&vQ.jsxDEV($Q,{},void 0,!1,void 0,this),vQ.jsxDEV(G0,{options:[{label:"\uD83D\uDCC2 Open file picker",value:"picker"},{label:"\uD83D\uDCDD Type the path",value:"manual"}],onChange:(Y)=>{if(Y==="picker")Q();else B()}},void 0,!1,void 0,this)]},void 0,!0,void 0,this):vQ.jsxDEV(vQ.Fragment,{children:[vQ.jsxDEV(a,{dimColor:!0,children:"Tip: drag a file into this window to paste its path."},void 0,!1,void 0,this),!J&&vQ.jsxDEV($Q,{},void 0,!1,void 0,this),vQ.jsxDEV(A$,{placeholder:"/path/to/service-account.json",filter:"",onSubmit:$},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),qZQ=()=>vQ.jsxDEV(XA,{marginTop:1,children:vQ.jsxDEV(TB,{text:"Opening file picker..."},void 0,!1,void 0,this)},void 0,!1,void 0,this),DZQ=()=>vQ.jsxDEV(XA,{marginTop:1,children:vQ.jsxDEV(TB,{text:"Validating service account against Google Play..."},void 0,!1,void 0,this)},void 0,!1,void 0,this),IZQ=({message:A,onChoose:Q})=>{return vQ.jsxDEV(XA,{flexDirection:"column",marginTop:1,children:[vQ.jsxDEV(E9,{variant:"warning",children:"Service account validation failed."},void 0,!1,void 0,this),vQ.jsxDEV($Q,{},void 0,!1,void 0,this),vQ.jsxDEV(XA,{flexDirection:"column",marginLeft:2,children:vQ.jsxDEV(a,{color:"red",children:A},void 0,!1,void 0,this)},void 0,!1,void 0,this),vQ.jsxDEV($Q,{},void 0,!1,void 0,this),vQ.jsxDEV(a,{bold:!0,children:"What would you like to do?"},void 0,!1,void 0,this),vQ.jsxDEV($Q,{},void 0,!1,void 0,this),vQ.jsxDEV(G0,{options:[{label:"\uD83D\uDD04 Try a different service account file",value:"retry"},{label:"\uD83D\uDCBE Save credentials anyway (skip validation)",value:"save-anyway"},{label:"\uD83C\uDD95 Set up a new service account via Google",value:"oauth"}],onChange:($)=>Q($)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},cM0="Sign in with Google so Capgo can set up Play Store publishing on your account — your tokens never reach Capgo's servers.",dM0="We'll open Google's consent screen. The access requests are:";function lM0(){return vQ.jsxDEV(vQ.Fragment,{children:[vQ.jsxDEV(a,{children:["•"," ",vQ.jsxDEV(a,{bold:!0,children:"Google Cloud access"},void 0,!1,void 0,this)," ","— to create a service account in a project you pick"]},void 0,!0,void 0,this),vQ.jsxDEV(a,{children:["•"," ",vQ.jsxDEV(a,{bold:!0,children:"Google Play Developer access"},void 0,!1,void 0,this)," ","— to invite that service account to your Play Console with release-only permissions"]},void 0,!0,void 0,this),vQ.jsxDEV(a,{children:["•"," ",vQ.jsxDEV(a,{bold:!0,children:"Play app list"},void 0,!1,void 0,this)," ",`— Google words this one "see metrics and data"; we only list your apps to check the one you're building exists (optional — declining just skips that check)`]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var OZQ=({onChoose:A})=>{return vQ.jsxDEV(XA,{flexDirection:"column",marginTop:1,children:[vQ.jsxDEV(E9,{variant:"info",children:cM0},void 0,!1,void 0,this),vQ.jsxDEV($Q,{},void 0,!1,void 0,this),vQ.jsxDEV(a,{children:dM0},void 0,!1,void 0,this),vQ.jsxDEV(XA,{flexDirection:"column",marginLeft:2,marginTop:1,children:vQ.jsxDEV(lM0,{},void 0,!1,void 0,this)},void 0,!1,void 0,this),vQ.jsxDEV($Q,{},void 0,!1,void 0,this),vQ.jsxDEV(G0,{options:[{label:"\uD83D\uDD10 Continue to Google sign-in",value:"go"},{label:"ℹ️ Learn why the onboarding via Google is secure",value:"learn"},{label:"✖ Exit (I'll do it later)",value:"exit"}],onChange:(B)=>A(B)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},MZQ=({onBack:A})=>{return vQ.jsxDEV(XA,{flexDirection:"column",marginTop:1,children:[vQ.jsxDEV(E9,{variant:"info",children:"What Capgo can and can't do with the access you're about to grant."},void 0,!1,void 0,this),vQ.jsxDEV($Q,{},void 0,!1,void 0,this),vQ.jsxDEV(XA,{flexDirection:"column",marginLeft:2,children:[vQ.jsxDEV(a,{bold:!0,children:"Can Capgo touch other GCP projects on my account?"},void 0,!1,void 0,this),vQ.jsxDEV(a,{children:["The scope allows it, but the CLI only touches the project you pick: it creates one service account (",vQ.jsxDEV(a,{color:"cyan",children:"capgo-native-build"},void 0,!1,void 0,this),") there and stops."]},void 0,!0,void 0,this),vQ.jsxDEV($Q,{},void 0,!1,void 0,this),vQ.jsxDEV(a,{bold:!0,children:"Will Capgo upload anything to Play Store without me knowing?"},void 0,!1,void 0,this),vQ.jsxDEV(a,{children:"No. It invites one service account into one app with release-only permissions. Future builds use that service account, not your OAuth tokens."},void 0,!1,void 0,this),vQ.jsxDEV($Q,{},void 0,!1,void 0,this),vQ.jsxDEV(a,{bold:!0,children:"Can Capgo employees access my Google account?"},void 0,!1,void 0,this),vQ.jsxDEV(a,{children:"No. The refresh token never leaves your machine and Capgo's servers never see it. When provisioning finishes, the CLI asks Google to revoke it."},void 0,!1,void 0,this),vQ.jsxDEV($Q,{},void 0,!1,void 0,this),vQ.jsxDEV(a,{bold:!0,children:'Why does Google mention "metrics and data"?'},void 0,!1,void 0,this),vQ.jsxDEV(a,{children:"Google's wording for the Play Reporting permission. We only list your apps' package names to confirm your app exists — declining just skips that check."},void 0,!1,void 0,this),vQ.jsxDEV($Q,{},void 0,!1,void 0,this),vQ.jsxDEV(a,{bold:!0,children:"What if I change my mind later?"},void 0,!1,void 0,this),vQ.jsxDEV(a,{children:["Revoke anytime at"," ",vQ.jsxDEV(a,{color:"cyan",children:"myaccount.google.com/permissions"},void 0,!1,void 0,this),", or just delete the service account in Google Cloud. Neither needs Capgo's involvement."]},void 0,!0,void 0,this),vQ.jsxDEV($Q,{},void 0,!1,void 0,this),vQ.jsxDEV(a,{dimColor:!0,children:"Google-verified OAuth app (2026-05-02) · source: github.com/Cap-go/capgo"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),vQ.jsxDEV($Q,{},void 0,!1,void 0,this),vQ.jsxDEV(G0,{options:[{label:"← Back to sign-in",value:"back"}],onChange:A},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},CZQ=({statusMessages:A,dense:Q=!1})=>{let B=Q?A.slice(-FZQ):A;return vQ.jsxDEV(XA,{flexDirection:"column",marginTop:1,children:[vQ.jsxDEV(TB,{text:"Waiting for Google sign-in..."},void 0,!1,void 0,this),B.length>0&&vQ.jsxDEV(XA,{flexDirection:"column",marginTop:1,marginLeft:2,children:B.map(($,J)=>vQ.jsxDEV(a,{dimColor:!0,children:$},`oauth-status-${J}`,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},LZQ=({playDeveloperUrl:A,onChoose:Q})=>{return vQ.jsxDEV(XA,{flexDirection:"column",marginTop:1,children:[vQ.jsxDEV(E9,{variant:"info",children:"We need your Google Play Console Developer account ID."},void 0,!1,void 0,this),vQ.jsxDEV($Q,{},void 0,!1,void 0,this),vQ.jsxDEV(a,{children:"Every Google Play Developer account (the one you paid the $25 one-time fee for) has a unique numeric ID. We invite Capgo's service account into that specific account, which is how builds get uploaded to Play."},void 0,!1,void 0,this),vQ.jsxDEV($Q,{},void 0,!1,void 0,this),vQ.jsxDEV(a,{children:"You'll find the ID in the Play Console URL after signing in:"},void 0,!1,void 0,this),vQ.jsxDEV(XA,{marginLeft:2,marginTop:1,children:[vQ.jsxDEV(a,{dimColor:!0,children:A},void 0,!1,void 0,this),vQ.jsxDEV(a,{bold:!0,color:"cyan",children:"1234567890123456789"},void 0,!1,void 0,this),vQ.jsxDEV(a,{dimColor:!0,children:"/…"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),vQ.jsxDEV($Q,{},void 0,!1,void 0,this),vQ.jsxDEV(a,{children:["The digits after"," ",vQ.jsxDEV(a,{color:"cyan",children:"/developers/"},void 0,!1,void 0,this)," ","are what we need. Copy them, or copy the whole URL — we'll parse it."]},void 0,!0,void 0,this),vQ.jsxDEV($Q,{},void 0,!1,void 0,this),vQ.jsxDEV(G0,{options:[{label:"\uD83C\uDF10 Open Play Console in my browser",value:"open"},{label:"\uD83C\uDFAC Watch a quick video tutorial",value:"tutorial"},{label:"\uD83D\uDCDD I have my developer ID — let me paste it",value:"manual"}],onChange:($)=>Q($)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},VZQ=({onSubmit:A,dense:Q=!1})=>vQ.jsxDEV(XA,{flexDirection:"column",marginTop:1,children:[vQ.jsxDEV(a,{bold:!0,children:"Paste the Play Console URL, or just the developer ID:"},void 0,!1,void 0,this),vQ.jsxDEV(a,{dimColor:!0,children:"Either the whole address bar value or the 16–20 digit number works."},void 0,!1,void 0,this),!Q&&vQ.jsxDEV($Q,{},void 0,!1,void 0,this),vQ.jsxDEV(A$,{placeholder:"https://play.google.com/console/u/0/developers/…",filter:"",onSubmit:A},void 0,!1,void 0,this)]},void 0,!0,void 0,this),NZQ=()=>vQ.jsxDEV(XA,{marginTop:1,children:vQ.jsxDEV(TB,{text:"Loading your Google Cloud projects..."},void 0,!1,void 0,this)},void 0,!1,void 0,this),RZQ=({options:A,onChange:Q})=>{return vQ.jsxDEV(XA,{flexDirection:"column",marginTop:1,children:[vQ.jsxDEV(a,{bold:!0,children:"Which Google Cloud project should host the service account?"},void 0,!1,void 0,this),vQ.jsxDEV(a,{dimColor:!0,children:"We'll create a `capgo-native-build` service account in the chosen project."},void 0,!1,void 0,this),vQ.jsxDEV($Q,{},void 0,!1,void 0,this),vQ.jsxDEV(G0,{options:A,onChange:Q},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},EZQ=({defaultDisplayName:A,onSubmit:Q,dense:B=!1})=>vQ.jsxDEV(XA,{flexDirection:"column",marginTop:1,children:[vQ.jsxDEV(a,{bold:!0,children:"Name for the new Google Cloud project:"},void 0,!1,void 0,this),vQ.jsxDEV(a,{dimColor:!0,children:B?"≤30 chars. The project ID is auto-generated from your app ID + a random suffix.":"≤30 chars. The project ID will be auto-generated from your app ID plus a random suffix."},void 0,!1,void 0,this),!B&&vQ.jsxDEV($Q,{},void 0,!1,void 0,this),vQ.jsxDEV(A$,{placeholder:A,filter:"",onSubmit:Q},void 0,!1,void 0,this)]},void 0,!0,void 0,this),jZQ=({showChooser:A,detectedOptions:Q,androidDir:B,onChooseDetected:$,onSubmitManual:J})=>{return vQ.jsxDEV(XA,{flexDirection:"column",marginTop:1,children:[vQ.jsxDEV(E9,{variant:"info",children:"Which Android package (applicationId) should Capgo have release access to?"},void 0,!1,void 0,this),vQ.jsxDEV($Q,{},void 0,!1,void 0,this),vQ.jsxDEV(a,{children:["This is the package name the Play Console uses — it must match the"," ",vQ.jsxDEV(a,{bold:!0,children:"applicationId"},void 0,!1,void 0,this)," ","in"," ",vQ.jsxDEV(a,{color:"cyan",children:`${B}/app/build.gradle`},void 0,!1,void 0,this),", not the Capacitor JS-level appId (those can differ when plugins like CapacitorUpdater override the base ID)."]},void 0,!0,void 0,this),vQ.jsxDEV($Q,{},void 0,!1,void 0,this),A?vQ.jsxDEV(vQ.Fragment,{children:[vQ.jsxDEV(a,{bold:!0,children:"Found these in your Gradle config. Pick one, or enter a different package:"},void 0,!1,void 0,this),vQ.jsxDEV($Q,{},void 0,!1,void 0,this),vQ.jsxDEV(G0,{options:Q,onChange:$},void 0,!1,void 0,this)]},void 0,!0,void 0,this):vQ.jsxDEV(vQ.Fragment,{children:[vQ.jsxDEV(a,{bold:!0,children:"Android package name:"},void 0,!1,void 0,this),vQ.jsxDEV($Q,{},void 0,!1,void 0,this),vQ.jsxDEV(A$,{placeholder:"com.example.app",filter:"",onSubmit:J},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},wZQ=({statusMessages:A,dense:Q=!1})=>{let B=Q?A.slice(-FZQ):A;return vQ.jsxDEV(XA,{flexDirection:"column",marginTop:1,children:[vQ.jsxDEV(TB,{text:"Provisioning Google Cloud + Play Console..."},void 0,!1,void 0,this),B.length>0&&vQ.jsxDEV(XA,{flexDirection:"column",marginTop:1,marginLeft:2,children:B.map(($,J)=>vQ.jsxDEV(a,{dimColor:!0,children:$},`setup-status-${J}`,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)};var t1=AQ(I8(),1),PZQ=()=>t1.jsxDEV(XA,{marginTop:1,children:t1.jsxDEV(TB,{text:"Saving credentials..."},void 0,!1,void 0,this)},void 0,!1,void 0,this),TZQ=()=>t1.jsxDEV(XA,{marginTop:1,children:t1.jsxDEV(TB,{text:"Checking git hosting..."},void 0,!1,void 0,this)},void 0,!1,void 0,this),_ZQ=({advice:A,onChoose:Q})=>{return t1.jsxDEV(XA,{flexDirection:"column",marginTop:1,children:[t1.jsxDEV(a,{bold:!0,children:"Set up your git hosting CLI to upload env vars"},void 0,!1,void 0,this),t1.jsxDEV($Q,{},void 0,!1,void 0,this),A.map((B)=>t1.jsxDEV(XA,{flexDirection:"column",marginBottom:1,children:[t1.jsxDEV(a,{children:B.target.label},void 0,!1,void 0,this),t1.jsxDEV(a,{dimColor:!0,children:B.message},void 0,!1,void 0,this),B.commands.map(($)=>t1.jsxDEV(a,{color:"cyan",children:$},`${B.target.provider}-${$}`,!1,void 0,this))]},B.target.provider,!0,void 0,this)),t1.jsxDEV(a,{dimColor:!0,children:"Run this in another terminal, then come back here."},void 0,!1,void 0,this),t1.jsxDEV($Q,{},void 0,!1,void 0,this),t1.jsxDEV(G0,{options:[{label:"I installed and logged in, check again",value:"retry"},{label:"Skip upload",value:"skip"}],onChange:(B)=>Q(B)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},SZQ=({options:A,onChange:Q})=>{return t1.jsxDEV(XA,{flexDirection:"column",marginTop:1,children:[t1.jsxDEV(a,{bold:!0,children:"Where should Capgo upload the build env vars?"},void 0,!1,void 0,this),t1.jsxDEV($Q,{},void 0,!1,void 0,this),t1.jsxDEV(G0,{options:A,onChange:Q},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},kZQ=({entryCount:A,targetLabel:Q,cli:B,onChoose:$,dense:J=!1})=>t1.jsxDEV(XA,{flexDirection:"column",marginTop:1,children:[t1.jsxDEV(e7,{text:"Android credentials saved"},void 0,!1,void 0,this),!J&&t1.jsxDEV($Q,{},void 0,!1,void 0,this),t1.jsxDEV(a,{bold:!0,children:`Upload ${A} build env var${A===1?"":"s"} to ${Q}?`},void 0,!1,void 0,this),t1.jsxDEV(a,{dimColor:!0,children:J?"Capgo checks for existing names first and asks before replacing anything.":"Capgo will check for existing names first and ask before replacing anything."},void 0,!1,void 0,this),!J&&t1.jsxDEV($Q,{},void 0,!1,void 0,this),t1.jsxDEV(G0,{options:[{label:`Upload with ${B}`,value:"yes"},{label:"Skip",value:"no"}],onChange:(Y)=>$(Y)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),bZQ=({existingKeys:A,onChoose:Q})=>{return t1.jsxDEV(XA,{flexDirection:"column",marginTop:1,children:[t1.jsxDEV(a,{bold:!0,color:"yellow",children:"These env vars already exist and will be replaced:"},void 0,!1,void 0,this),t1.jsxDEV(XA,{flexDirection:"column",marginTop:1,marginLeft:2,children:A.map((B)=>t1.jsxDEV(a,{children:`• ${B}`},B,!1,void 0,this))},void 0,!1,void 0,this),t1.jsxDEV($Q,{},void 0,!1,void 0,this),t1.jsxDEV(G0,{options:[{label:"Replace existing env vars",value:"replace"},{label:"Skip upload",value:"skip"}],onChange:(B)=>Q(B)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},xZQ=({error:A,onChoose:Q,dense:B=!1})=>t1.jsxDEV(XA,{flexDirection:"column",marginTop:1,children:[t1.jsxDEV(sJ,{text:A||"Could not upload env vars."},void 0,!1,void 0,this),!B&&t1.jsxDEV($Q,{},void 0,!1,void 0,this),t1.jsxDEV(a,{dimColor:!0,children:"You can continue; credentials are already saved locally."},void 0,!1,void 0,this),!B&&t1.jsxDEV($Q,{},void 0,!1,void 0,this),t1.jsxDEV(G0,{options:[{label:"Try upload again",value:"retry"},{label:"Continue without upload",value:"continue"}],onChange:($)=>Q($)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),fZQ=({onChoose:A,dense:Q=!1})=>t1.jsxDEV(XA,{flexDirection:"column",marginTop:1,children:[t1.jsxDEV(e7,{text:"Android credentials saved"},void 0,!1,void 0,this),!Q&&t1.jsxDEV($Q,{},void 0,!1,void 0,this),t1.jsxDEV(a,{bold:!0,children:"Request a build now?"},void 0,!1,void 0,this),!Q&&t1.jsxDEV($Q,{},void 0,!1,void 0,this),t1.jsxDEV(G0,{options:[{label:"\uD83D\uDE80 Yes, request a build",value:"yes"},{label:"⏭ Not now",value:"no"}],onChange:(B)=>A(B)},void 0,!1,void 0,this)]},void 0,!0,void 0,this);function w0A(A){let Q=[{label:"\uD83D\uDCE8 Email Capgo support",value:"support"}];if(A.hasBuildLog)Q.push({label:"\uD83E\uDD16 Ask AI for help",value:"ai"});return Q.push({label:"\uD83D\uDD04 Try again",value:"retry"}),Q.push({label:"❌ Exit",value:"exit"}),Q}var JB=AQ(I8(),1),pM0=110;function iM0(A,Q){if(A.length<=Q)return A;return`${A.slice(0,Math.max(0,Q-1)).trimEnd()}…`}var vZQ=()=>JB.jsxDEV(XA,{marginTop:1,justifyContent:"center",children:JB.jsxDEV(TB,{text:"Detecting Android project..."},void 0,!1,void 0,this)},void 0,!1,void 0,this),yZQ=({androidDir:A,dense:Q=!1})=>JB.jsxDEV(XA,{flexDirection:"column",marginTop:1,children:[JB.jsxDEV(sJ,{text:`No ${A}/ directory found.`},void 0,!1,void 0,this),!Q&&JB.jsxDEV($Q,{},void 0,!1,void 0,this),JB.jsxDEV(a,{children:["Run"," ",JB.jsxDEV(a,{bold:!0,color:"white",children:"npx cap add android"},void 0,!1,void 0,this)," ","first, then re-run onboarding."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),gZQ=({appId:A,onChoose:Q,dense:B=!1})=>JB.jsxDEV(XA,{flexDirection:"column",marginTop:1,children:[JB.jsxDEV(a,{bold:!0,color:"yellow",children:`⚠ Android credentials already exist for ${A}`},void 0,!1,void 0,this),!B&&JB.jsxDEV($Q,{},void 0,!1,void 0,this),JB.jsxDEV(a,{children:"Onboarding will create new credentials, replacing the existing ones."},void 0,!1,void 0,this),!B&&JB.jsxDEV($Q,{},void 0,!1,void 0,this),JB.jsxDEV(G0,{options:[{label:"\uD83D\uDCE6 Start fresh (backup existing credentials first)",value:"backup"},{label:"✖ Exit onboarding",value:"exit"}],onChange:($)=>Q($)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),hZQ=()=>JB.jsxDEV(XA,{marginTop:1,children:JB.jsxDEV(TB,{text:"Backing up existing credentials..."},void 0,!1,void 0,this)},void 0,!1,void 0,this),uZQ=({uploadSummary:A,buildUrl:Q,workflowWrittenPath:B=null,envExportPath:$=null,envExportError:J=null,dense:Y=!1})=>JB.jsxDEV(XA,{flexDirection:"column",marginTop:1,children:[JB.jsxDEV(e7,{text:"Onboarding complete"},void 0,!1,void 0,this),A&&JB.jsxDEV(JB.Fragment,{children:[!Y&&JB.jsxDEV($Q,{},void 0,!1,void 0,this),JB.jsxDEV(a,{children:`${A}.`},void 0,!1,void 0,this)]},void 0,!0,void 0,this),B&&JB.jsxDEV(JB.Fragment,{children:[!Y&&JB.jsxDEV($Q,{},void 0,!1,void 0,this),JB.jsxDEV(a,{color:"green",children:["✔ Workflow file written:"," ",B]},void 0,!0,void 0,this),JB.jsxDEV(a,{dimColor:!0,children:"Dispatch it from GitHub Actions to kick off an Android build."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$&&JB.jsxDEV(JB.Fragment,{children:[!Y&&JB.jsxDEV($Q,{},void 0,!1,void 0,this),JB.jsxDEV(a,{color:"green",children:["✔ Credentials exported to:"," ",$]},void 0,!0,void 0,this),JB.jsxDEV(a,{dimColor:!0,children:["When you're ready, push them with"," ",JB.jsxDEV(a,{bold:!0,children:`gh secret set -f ${$.split("/").slice(-1)[0]}`},void 0,!1,void 0,this),". Add the file to"," ",JB.jsxDEV(a,{bold:!0,children:".gitignore"},void 0,!1,void 0,this)," ","— never commit it."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),J&&JB.jsxDEV(JB.Fragment,{children:[!Y&&JB.jsxDEV($Q,{},void 0,!1,void 0,this),JB.jsxDEV(a,{color:"yellow",children:["⚠ Could not export .env:"," ",J]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Q&&JB.jsxDEV(JB.Fragment,{children:[!Y&&JB.jsxDEV($Q,{},void 0,!1,void 0,this),JB.jsxDEV(a,{children:["Track your build:"," ",JB.jsxDEV(a,{color:"cyan",underline:!0,children:Q},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),JB.jsxDEV($Q,{},void 0,!1,void 0,this),JB.jsxDEV(a,{dimColor:!0,children:"Press Enter to finish ›"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),mZQ=({message:A,onChoose:Q,hasBuildLog:B=!1,dense:$=!1})=>JB.jsxDEV(XA,{flexDirection:"column",marginTop:1,children:[JB.jsxDEV(sJ,{text:$?iM0(A,pM0):A},void 0,!1,void 0,this),!$&&JB.jsxDEV($Q,{},void 0,!1,void 0,this),JB.jsxDEV(G0,{options:w0A({hasBuildLog:B}),onChange:(J)=>Q(J)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),cZQ=({onChoose:A,dense:Q=!1})=>JB.jsxDEV(XA,{flexDirection:"column",marginTop:1,children:[JB.jsxDEV(sJ,{text:"Build failed."},void 0,!1,void 0,this),!Q&&JB.jsxDEV($Q,{},void 0,!1,void 0,this),JB.jsxDEV(a,{children:"We can analyze the build log with Capgo AI and suggest a fix."},void 0,!1,void 0,this),!Q&&JB.jsxDEV($Q,{},void 0,!1,void 0,this),JB.jsxDEV(G0,{options:[{label:"\uD83D\uDCE8 Email Capgo support",value:"support"},{label:"\uD83E\uDD16 Debug with AI",value:"debug"},{label:"\uD83D\uDC40 Show me the build logs",value:"logs"},{label:"⏭ Skip",value:"skip"}],onChange:(B)=>A(B)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),dZQ=({streamText:A,terminalRows:Q,terminalCols:B})=>{let{rows:$,hidden:J}=so(A??"",Q,B);return JB.jsxDEV(XA,{flexDirection:"column",marginTop:1,children:[JB.jsxDEV(TB,{text:"Analyzing build log with Capgo AI..."},void 0,!1,void 0,this),$.length>0&&JB.jsxDEV(XA,{flexDirection:"column",marginTop:1,children:[JB.jsxDEV(a,{dimColor:!0,children:J>0?`… ${J} earlier line${J===1?"":"s"}`:" "},void 0,!1,void 0,this),JB.jsxDEV(a,{children:$.join(`
|
|
1291
1291
|
`)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},lZQ=({analysisText:A,collapsed:Q,result:B,retryCount:$,maxRetries:J,onRetry:Y,onSkipOrContinue:Z,onReread:X,onSupport:G,dense:K=!1})=>{let W=J-$,H=W>0,U=W===1?"\uD83D\uDD04 I fixed it, retry build (last retry)":`\uD83D\uDD04 I fixed it, retry build (${W} retries left)`;return JB.jsxDEV(XA,{flexDirection:"column",marginTop:1,children:[JB.jsxDEV(a,{bold:!0,color:"cyan",children:"AI analysis"},void 0,!1,void 0,this),!K&&JB.jsxDEV($Q,{},void 0,!1,void 0,this),A&&!Q&&JB.jsxDEV(a,{children:A},void 0,!1,void 0,this),A&&Q&&JB.jsxDEV(a,{dimColor:!0,children:"\uD83D\uDCD6 Analysis reviewed — pick an option below, or re-read it."},void 0,!1,void 0,this),B&&JB.jsxDEV(As,{kind:B.kind,message:B.message,dense:K},void 0,!1,void 0,this),!K&&JB.jsxDEV($Q,{},void 0,!1,void 0,this),JB.jsxDEV(a,{color:"yellow",children:K?"⚠ AI can make mistakes. Verify against the full log before applying the fix.":"⚠ AI can make mistakes. Always verify the diagnosis against the full log before applying the suggested fix."},void 0,!1,void 0,this),!K&&JB.jsxDEV($Q,{},void 0,!1,void 0,this),!H&&JB.jsxDEV(JB.Fragment,{children:[JB.jsxDEV(a,{dimColor:!0,children:K?`You've used all ${J} retries. Exit and re-run the wizard for another attempt.`:`You've used all ${J} retries. Exit and re-run the wizard if you need another attempt.`},void 0,!1,void 0,this),!K&&JB.jsxDEV($Q,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this),JB.jsxDEV(G0,{options:[...H?[{label:U,value:"retry"},{label:"⏭ Continue (skip retry)",value:"skip"}]:[{label:"✔ Continue",value:"continue"}],{label:"\uD83D\uDCE8 Still stuck — email Capgo support",value:"support"},...Q?[{label:"\uD83D\uDCD6 Re-read analysis",value:"reread"}]:[]],onChange:(q)=>{if(q==="retry")Y();else if(q==="support")G();else if(q==="reread")X();else Z()}},void 0,!1,void 0,this)]},void 0,!0,void 0,this)};import{readFile as nM0}from"node:fs/promises";import{join as pZQ}from"node:path";import aM0 from"node:process";function lOA(A){let Q=/\bapplicationId\s*(?:=\s*)?(['"])([^'"]+)\1/g,B=new Set;for(let $ of A.matchAll(Q)){let J=$[2].trim();if(J)B.add(J)}return[...B]}async function rM0(A){try{return await nM0(A,"utf-8")}catch{return null}}async function Qm(A,Q){let B=Q??aM0.cwd(),$=[pZQ(B,A,"app","build.gradle"),pZQ(B,A,"app","build.gradle.kts")],J=new Set;for(let Y of $){let Z=await rM0(Y);if(!Z)continue;for(let X of lOA(Z))J.add(X)}return[...J]}function oM0(A){return(Array.isArray(A?.apps)?A.apps:[]).flatMap((Q)=>{let B=typeof Q?.packageName==="string"?Q.packageName:"";if(!B)return[];return[{packageName:B,displayName:Q?.displayName||""}]})}class iZQ extends Error{status;constructor(A,Q){super(Q);this.name="ReportingApiHttpError",this.status=A}}var sM0=10,tM0=1000;async function P0A(A,Q={}){let B=Q.fetchImpl??globalThis.fetch,$=[],J=null;for(let Y=0;Y<sM0;Y++){let Z=new URL("https://playdeveloperreporting.googleapis.com/v1beta1/apps:search");if(Z.searchParams.set("pageSize",String(tM0)),J)Z.searchParams.set("pageToken",J);let X=await B(Z.toString(),{method:"GET",headers:{Authorization:`Bearer ${A}`,Accept:"application/json"}}),G=await X.json().catch(()=>null);if(!X.ok){let W=G?.error?.message||`HTTP ${X.status}`;throw new iZQ(X.status,`Play Developer Reporting API error (${X.status}): ${W}`)}$.push(...oM0(G));let K=typeof G?.nextPageToken==="string"?G.nextPageToken:void 0;if(!K)break;J=K}return $}au();function T0A(A,Q){let B=A.length===0?[]:A.split(`
|
|
1292
1292
|
`),$=Q.length===0?[]:Q.split(`
|
|
1293
|
-
`),J=B.length,Y=$.length;if(J===0)return $.map((W)=>({kind:"add",text:W}));if(Y===0)return B.map((W)=>({kind:"del",text:W}));let Z=[];for(let W=0;W<=J;W+=1)Z.push(Array.from({length:Y+1}).fill(0));for(let W=1;W<=J;W+=1)for(let H=1;H<=Y;H+=1)if(B[W-1]===$[H-1])Z[W][H]=Z[W-1][H-1]+1;else Z[W][H]=Math.max(Z[W-1][H],Z[W][H-1]);let X=[],G=J,K=Y;while(G>0&&K>0)if(B[G-1]===$[K-1])X.unshift({kind:"eq",text:B[G-1]}),G-=1,K-=1;else if(Z[G-1][K]>Z[G][K-1])X.unshift({kind:"del",text:B[G-1]}),G-=1;else X.unshift({kind:"add",text:$[K-1]}),K-=1;while(G>0)X.unshift({kind:"del",text:B[G-1]}),G-=1;while(K>0)X.unshift({kind:"add",text:$[K-1]}),K-=1;return X}zr();k0();var eM0={"workflow-preview-prepared":"Build onboarding workflow preview prepared","workflow-preview-action":"Build onboarding workflow preview action","workflow-diff-opened":"Build onboarding workflow diff opened","workflow-diff-closed":"Build onboarding workflow diff closed","workflow-file-written":"Build onboarding workflow file written"};function FO(A,Q){let B=A.filter((Y)=>Y.kind==="add").length,$=A.filter((Y)=>Y.kind==="del").length;return{workflowState:A.length>0&&B===0&&$===0?"identical":Q?"new":"replace",diffLines:A.length,diffAdded:B,diffRemoved:$}}function _0A(A){AC0(A)}async function AC0(A){let Q=A.apikey?.trim()||W4();if(!Q)return;let B=await tE(Q,A.appId),$={"app-id":A.appId,platform:A.platform,"workflow-state":A.workflowState,"diff-lines":A.diffLines,"diff-added":A.diffAdded,"diff-removed":A.diffRemoved};if(A.journeyId)$.journey_id=A.journeyId;if(A.decision)$.decision=A.decision;if(A.packageManager)$["package-manager"]=A.packageManager;if(A.buildScriptType)$["build-script-type"]=A.buildScriptType;await jB(Q,{channel:"native-builder",event:eM0[A.event],org_id:B,tracking_version:2,tags:$})}function C3(A){if(A==="bun"||A==="npm"||A==="pnpm"||A==="yarn")return A;return"npm"}function HT(A,Q){let B=[],$=new Set;if(Q&&Object.hasOwn(A,Q))B.push({label:`${Q} (recommended — matches your project type)`,value:Q}),$.add(Q);let J=Object.keys(A).filter((Y)=>!$.has(Y)).sort((Y,Z)=>Y.localeCompare(Z));for(let Y of J)B.push({label:Y,value:Y});return B.push({label:"Type a custom command…",value:"__custom__"}),B.push({label:"Skip build step (my app is raw HTML)",value:"__skip__"}),B}q7();var S0A="https://cloudresourcemanager.googleapis.com/v1",nZQ="https://serviceusage.googleapis.com/v1",pOA="https://iam.googleapis.com/v1",aZQ=120000,QC0=2000,iOA="androidpublisher.googleapis.com",nOA="capgo-native-build",rZQ="Capgo Native Build",oZQ="Allows Capgo to build and submit the app to the Google Play Store";function sZQ(A){if(A.done===!0)return!0;return typeof A.name==="string"&&/\bnoop\.DONE_OPERATION\b/.test(A.name)}var BC0=30000;async function UO(A){let Q={Authorization:`Bearer ${A.accessToken}`,Accept:"application/json"};if(A.body!==void 0)Q["Content-Type"]="application/json";let B=A.timeoutMs??BC0,$=new AbortController,J=setTimeout(()=>$.abort(),B),Y;try{Y=await fetch(A.url,{method:A.method,headers:Q,body:A.body!==void 0?JSON.stringify(A.body):void 0,signal:$.signal})}catch(X){if(X?.name==="AbortError")throw Error(`Google API request to ${A.url} timed out after ${B}ms`);throw X}finally{clearTimeout(J)}let Z=await Y.text();if(!Y.ok){let X=Z;try{let G=JSON.parse(Z);if(G.error?.message)X=`${G.error.status??""}${G.error.status&&G.error.message?": ":""}${G.error.message}`}catch{}throw kB(`gcp-api ${A.method??"GET"} ${A.url}: HTTP ${Y.status} ${X} | ${YK(Y.headers)}`),Error(`Google API ${Y.status} at ${A.url}: ${X}`)}if(kB(`gcp-api ${A.method??"GET"} ${A.url}: HTTP ${Y.status} | ${YK(Y.headers)}`),!Z.trim())return;try{return JSON.parse(Z)}catch{throw Error(`Google API returned non-JSON at ${A.url}: ${Z.slice(0,200)}`)}}async function FT(A){let Q=[],B;do{let $=new URL(`${S0A}/projects`);if($.searchParams.set("pageSize","100"),$.searchParams.set("filter","lifecycleState:ACTIVE"),B)$.searchParams.set("pageToken",B);let J=await UO({method:"GET",url:$.toString(),accessToken:A});for(let Y of J.projects??[])if(Y.projectId&&Y.projectNumber&&Y.name&&Y.lifecycleState==="ACTIVE")Q.push(Y);B=J.nextPageToken}while(B);return Q.sort(($,J)=>$.name.localeCompare(J.name)),Q}async function Bm(A,Q,B,$={}){let J=await UO({method:"POST",url:`${S0A}/projects`,accessToken:A,body:{projectId:Q,name:B}});if(J.error)throw Error(`Project create failed: ${J.error.message} (code ${J.error.code})`);if(!sZQ(J))await tZQ(A,J.name,{endpoint:S0A,timeoutMs:$.timeoutMs??aZQ});return UO({method:"GET",url:`${S0A}/projects/${encodeURIComponent(Q)}`,accessToken:A})}async function $m(A,Q,B,$={}){let J=await UO({method:"POST",url:`${nZQ}/projects/${encodeURIComponent(Q)}/services/${encodeURIComponent(B)}:enable`,accessToken:A,body:{}});if(J.error)throw Error(`Enable ${B} failed: ${J.error.message} (code ${J.error.code})`);if(sZQ(J))return;await tZQ(A,J.name,{endpoint:nZQ,timeoutMs:$.timeoutMs??aZQ})}async function $C0(A,Q){let B=[],$;do{let J=new URL(`${pOA}/projects/${encodeURIComponent(Q)}/serviceAccounts`);if(J.searchParams.set("pageSize","100"),$)J.searchParams.set("pageToken",$);let Y=await UO({method:"GET",url:J.toString(),accessToken:A});B.push(...Y.accounts??[]),$=Y.nextPageToken}while($);return B}async function JC0(A){return UO({method:"POST",url:`${pOA}/projects/${encodeURIComponent(A.projectId)}/serviceAccounts`,accessToken:A.accessToken,body:{accountId:A.accountId,serviceAccount:{displayName:A.displayName,description:A.description}}})}async function Jm(A){let Q=await $C0(A.accessToken,A.projectId),B=`${A.accountId}@${A.projectId}.iam.gserviceaccount.com`,$=Q.find((Y)=>Y.email===B);if($)return{account:$,created:!1};return{account:await JC0(A),created:!0}}async function Ym(A){let Q=await UO({method:"POST",url:`${pOA}/projects/${encodeURIComponent(A.projectId)}/serviceAccounts/${encodeURIComponent(A.serviceAccountEmail)}/keys`,accessToken:A.accessToken,body:{privateKeyType:"TYPE_GOOGLE_CREDENTIALS_FILE",keyAlgorithm:"KEY_ALG_RSA_2048"}});if(!Q.privateKeyData)throw Error("Google did not return privateKeyData on the SA key — refusing to continue without the key file");return{name:Q.name,privateKeyDataBase64:Q.privateKeyData}}async function tZQ(A,Q,B){let $=Date.now()+B.timeoutMs;for(;;){let J=await UO({method:"GET",url:`${B.endpoint}/${Q}`,accessToken:A});if(J.done){if(J.error)throw Error(`Operation ${Q} failed: ${J.error.message} (code ${J.error.code})`);return J}if(Date.now()>$)throw Error(`Operation ${Q} did not finish within ${Math.round(B.timeoutMs/1000)}s`);await new Promise((Y)=>setTimeout(Y,QC0))}}function UT(A){let J=A.replace(/[^A-Z0-9 \-'!.]/gi," ").replace(/\s+/g," ").trim().replace(/^[^A-Z0-9]+/i,"").replace(/[^A-Z0-9]+$/i,"").slice(0,30).replace(/[^A-Z0-9]+$/i,"");if(J.length<4)J="Capgo Build";return J}function k0A(A){let Y=A.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,17).replace(/-+$/,""),Z="abcdefghijkmnpqrstuvwxyz23456789",X="";for(let K=0;K<6;K++)X+="abcdefghijkmnpqrstuvwxyz23456789"[Math.floor(Math.random()*32)];return(Y?`capgo-${Y}-${X}`:`capgo-${X}`).slice(0,30).replace(/-+$/,"")}var FG=AQ(qP(),1);import{Buffer as aOA}from"node:buffer";import eZQ from"node:crypto";var YC0=27,ZC0=2048,XC0=24,GC0="keystore";function AXQ(A){let $=(String(A??"").split(/[/\\]+/).filter(Boolean).pop()??"").replace(/[^A-Za-z0-9._-]/g,"_");if($.length===0||/^\.+$/.test($))return GC0;return $}function b0A(){return eZQ.randomBytes(XC0).toString("base64url")}function Zm(A){if(!A.alias)throw Error("keystore alias is required");if(!A.storePassword)throw Error("keystore store password is required");if(!A.keyPassword)throw Error("keystore key password is required");if(!A.dname.commonName)throw Error("keystore common name is required");let Q=A.keySize??ZC0,B=A.validityYears??YC0,$=FG.default.pki.rsa.generateKeyPair(Q),J=FG.default.pki.createCertificate();J.publicKey=$.publicKey,J.serialNumber=eZQ.randomBytes(16).toString("hex");let Y=new Date,Z=new Date(Y);Z.setFullYear(Y.getFullYear()+B),J.validity.notBefore=Y,J.validity.notAfter=Z;let X=[{name:"commonName",value:A.dname.commonName}];if(A.dname.organizationName)X.push({name:"organizationName",value:A.dname.organizationName});if(A.dname.countryCode)X.push({name:"countryName",value:A.dname.countryCode});J.setSubject(X),J.setIssuer(X),J.sign($.privateKey,FG.default.md.sha256.create());let G=FG.default.pkcs12.toPkcs12Asn1($.privateKey,[J],A.storePassword,{algorithm:"3des",friendlyName:A.alias}),K=FG.default.asn1.toDer(G).getBytes(),W=aOA.from(K,"binary");return{p12Base64:FG.default.util.encode64(K),p12Bytes:W,alias:A.alias,notAfter:Z}}function Rz(A,Q){try{let B=aOA.from(A).toString("binary"),$=FG.default.asn1.fromDer(B),J;try{J=FG.default.pkcs12.pkcs12FromAsn1($,Q)}catch(X){let G=X instanceof Error?X.message:String(X);return{ok:!1,reason:/PKCS#?12 MAC|Invalid password|mac could not be verified/i.test(G)?"wrong-password":"parse-error",message:G}}if(J.getBags({bagType:FG.default.pki.oids.pkcs8ShroudedKeyBag})[FG.default.pki.oids.pkcs8ShroudedKeyBag]?.[0]?.key)return{ok:!0};return{ok:!1,reason:"no-private-key",message:"PKCS#12 unlocked but did not contain a decryptable private key bag"}}catch(B){return{ok:!1,reason:"unsupported-format",message:B instanceof Error?B.message:"not a PKCS#12 file"}}}function Xm(A,Q){try{let B=aOA.from(A).toString("binary"),$=FG.default.asn1.fromDer(B),J;try{J=FG.default.pkcs12.pkcs12FromAsn1($,Q)}catch(Z){let X=Z instanceof Error?Z.message:String(Z);return{ok:!1,reason:/PKCS#?12 MAC|Invalid password|mac could not be verified/i.test(X)?"wrong-password":"parse-error",message:X}}let Y=new Set;for(let Z of J.safeContents)for(let X of Z.safeBags){let G=X.attributes?.friendlyName;if(Array.isArray(G)){for(let K of G)if(typeof K==="string"&&K.length>0)Y.add(K)}}return{ok:!0,aliases:[...Y]}}catch(B){return{ok:!1,reason:"unsupported-format",message:B instanceof Error?B.message:"not a PKCS#12 file"}}}var zT=[...tzA,"https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/playdeveloperreporting"],Gm=[...tzA,"https://www.googleapis.com/auth/cloud-platform"];aG();q7();ZL();import KC0 from"node:process";var WC0="https://api.capgo.app/private/config/builder",HC0="CAPGO_BUILDER_CONFIG_URL",rOA="https://www.youtube.com/watch?v=Y1_Ngj8hHLU";async function x0A(){let A=KC0.env[HC0]||WC0,Q=await fetch(A,{method:"GET",headers:{Accept:"application/json"}});if(!Q.ok){let $=await Q.text().catch(()=>"");throw Error(`Capgo builder config fetch failed (${Q.status} from ${A}): ${$.slice(0,200)}`)}let B;try{B=await Q.json()}catch{throw Error(`Capgo builder config returned non-JSON from ${A}`)}if(!B.enabled)return null;if(!B.clientId||!B.clientSecret)throw Error("Capgo builder config returned enabled=true but is missing clientId/clientSecret");return{clientId:B.clientId,clientSecret:B.clientSecret,scopes:B.scopes&&B.scopes.length>0?B.scopes:["https://www.googleapis.com/auth/androidpublisher"]}}q7();var FC0="https://androidpublisher.googleapis.com/androidpublisher/v3",f0A="https://play.google.com/console/u/0/developers/";function oOA(A){return/^\d{10,25}$/.test(A.trim())}function qT(A){let Q=A.trim().replace(/^['"]|['"]$/g,"");if(!Q)return null;if(oOA(Q))return Q;let B=Q.match(/\/developers\/(\d{10,25})(?:[/?#]|$)/);if(B&&oOA(B[1]))return B[1];let $=Q.match(/\d{10,25}/);if($&&oOA($[0]))return $[0];return null}var QXQ=["CAN_MANAGE_DRAFT_APPS_GLOBAL"],BXQ=["CAN_ACCESS_APP","CAN_MANAGE_DRAFT_APPS","CAN_MANAGE_TRACK_APKS","CAN_MANAGE_PUBLIC_APKS"];async function UC0(A){let Q={Authorization:`Bearer ${A.accessToken}`,Accept:"application/json"};if(A.body!==void 0)Q["Content-Type"]="application/json";let B=await fetch(A.url,{method:A.method,headers:Q,body:A.body!==void 0?JSON.stringify(A.body):void 0}),$=await B.text();if(!B.ok){let J=$;try{let Y=JSON.parse($);if(Y.error?.message)J=`${Y.error.status??""}${Y.error.status&&Y.error.message?": ":""}${Y.error.message}`}catch{}throw kB(`play-api ${A.method} ${A.url}: HTTP ${B.status} ${J} | ${YK(B.headers)}`),Error(`Play API ${B.status} at ${A.url}: ${J}`)}if(kB(`play-api ${A.method} ${A.url}: HTTP ${B.status} | ${YK(B.headers)}`),!$.trim())return;try{return JSON.parse($)}catch{throw Error(`Play API returned non-JSON at ${A.url}: ${$.slice(0,200)}`)}}async function Km(A){let Q={email:A.serviceAccountEmail};if(A.developerAccountPermissions?.length)Q.developerAccountPermissions=A.developerAccountPermissions;if(A.grants?.length)Q.grants=A.grants.map((B)=>({packageName:B.packageName,appLevelPermissions:B.permissions}));return UC0({method:"POST",url:`${FC0}/developers/${encodeURIComponent(A.developerId)}/users`,accessToken:A.accessToken,body:Q})}var cF={welcome:0,"resume-prompt":2,"credentials-exist":0,"backing-up":0,"no-platform":0,"keystore-method-select":5,"keystore-explainer":5,"keystore-existing-path":8,"keystore-existing-picker":8,"keystore-existing-store-password":10,"keystore-existing-detecting-alias":12,"keystore-existing-alias-select":13,"keystore-existing-alias":13,"keystore-existing-key-password":14,"keystore-new-alias":8,"keystore-new-password-method":10,"keystore-new-store-password":12,"keystore-new-key-password":14,"keystore-new-cn":16,"keystore-generating":20,"service-account-method-select":22,"sa-json-existing-path":28,"sa-json-existing-picker":28,"sa-json-validating":70,"sa-json-validation-failed":70,"google-sign-in":25,"google-sign-in-running":35,"play-developer-id-input":48,"gcp-projects-loading":55,"gcp-projects-select":58,"gcp-project-create-name":60,"android-package-select":65,"android-app-verify":67,"gcp-setup-running":70,"saving-credentials":85,"detecting-ci-secrets":86,"ci-secrets-setup":86,"ci-secrets-target-select":86,"ask-ci-secrets":86,"checking-ci-secrets":87,"confirm-ci-secret-overwrite":87,"uploading-ci-secrets":88,"ci-secrets-failed":88,"ask-github-actions-setup":86,"confirm-secrets-push":87,"ask-export-env":96,"exporting-env":96,"confirm-env-export-overwrite":96,"overwrite-and-export-env":96,"pick-package-manager":95,"pick-build-script":96,"pick-build-script-custom":96,"preview-workflow-file":97,"view-workflow-diff":97,"writing-workflow-file":98,"ask-build":90,"requesting-build":95,"build-log-view":96,"ai-analysis-prompt":96,"ai-analysis-running":98,"ai-analysis-result-scroll":98,"ai-analysis-result":99,"build-complete":100,error:0,"support-confirm":0,"support-log-view":0,"support-uploading":0};function sOA(A){switch(A){case"welcome":case"credentials-exist":case"backing-up":case"no-platform":return"";case"resume-prompt":return"Resume or restart?";case"keystore-method-select":case"keystore-explainer":case"keystore-existing-path":case"keystore-existing-picker":case"keystore-existing-store-password":case"keystore-existing-detecting-alias":case"keystore-existing-alias-select":case"keystore-existing-alias":case"keystore-existing-key-password":case"keystore-new-alias":case"keystore-new-password-method":case"keystore-new-store-password":case"keystore-new-key-password":case"keystore-new-cn":case"keystore-generating":return"Step 1 of 4 · Keystore";case"service-account-method-select":return"Step 2 of 4 · Service account";case"sa-json-existing-path":case"sa-json-existing-picker":case"sa-json-validating":case"sa-json-validation-failed":return"Step 3 of 4 · Service account";case"google-sign-in":case"google-sign-in-running":return"Step 2 of 4 · Sign in with Google";case"play-developer-id-input":return"Step 3 of 4 · Play Developer Account";case"gcp-projects-loading":case"gcp-projects-select":case"gcp-project-create-name":case"android-package-select":case"android-app-verify":case"gcp-setup-running":return"Step 3 of 4 · Google Cloud Project";case"saving-credentials":case"detecting-ci-secrets":case"ci-secrets-setup":case"ci-secrets-target-select":case"ask-ci-secrets":case"ask-github-actions-setup":case"confirm-secrets-push":case"checking-ci-secrets":case"confirm-ci-secret-overwrite":case"uploading-ci-secrets":case"ci-secrets-failed":case"ask-export-env":case"exporting-env":case"confirm-env-export-overwrite":case"overwrite-and-export-env":case"pick-package-manager":case"pick-build-script":case"pick-build-script-custom":case"preview-workflow-file":case"view-workflow-diff":case"writing-workflow-file":case"ask-build":case"requesting-build":return"Step 4 of 4 · Save & Build";case"ai-analysis-prompt":case"ai-analysis-running":case"ai-analysis-result":case"ai-analysis-result-scroll":case"build-log-view":return"AI debug";case"build-complete":return"Complete";case"error":case"support-confirm":case"support-log-view":case"support-uploading":return""}}import{homedir as YXQ}from"node:os";import{join as ZXQ}from"node:path";function v0A(A){let Q=A.apps.find((B)=>B.bundleId===A.releaseBundleId)??null;if(Q)return{result:"exact-match",matchedApp:Q};if(A.apps.length>0)return{result:"wrong-build-id",matchedApp:null};if(A.registeredBundleIds.includes(A.releaseBundleId))return{result:"no-app-identifier-exists",matchedApp:null};return{result:"no-app-unregistered",matchedApp:null}}var zC0=3;function Wm(A){if(A.satisfied)return{proceed:!0,escalationLevel:0};return{proceed:!1,escalationLevel:Math.min(A.attempt,zC0)}}function $XQ(A){let{gradleIds:Q,apps:B}=A,$=B.map((Y)=>({bundleId:Y.packageName,name:Y.displayName}));if(Q.length<=1){let Y=Q[0]??"";if(!Y)return B.length>0?{kind:"wrong-build-id"}:{kind:"no-app"};let{result:Z}=v0A({releaseBundleId:Y,apps:$,registeredBundleIds:[]});if(Z==="exact-match")return{kind:"exact-match",packageName:Y};if(Z==="wrong-build-id")return{kind:"wrong-build-id"};return{kind:"no-app"}}let J=Q.filter((Y)=>$.some((Z)=>Z.bundleId===Y));if(J.length===1)return{kind:"exact-match",packageName:J[0]};if(B.length===0)return{kind:"no-app"};return{kind:"multi-gradle"}}k0();var qC0=[{value:"retry",label:"I installed and logged in, check again"},{value:"skip",label:"Skip upload"}],DC0=[{value:"replace",label:"Replace existing env vars"},{value:"skip",label:"Skip upload"}],IC0=[{value:"retry",label:"Try upload again"},{value:"continue",label:"Continue without upload"}],OC0=[{value:"with-workflow",label:"\uD83D\uDE80 Yes — set the secrets AND create a workflow file"},{value:"secrets-only",label:"\uD83D\uDD12 Yes — set ONLY the secrets"},{value:"no",label:"❌ No"}],MC0=[{value:"replace",label:"✏️ Replace it"},{value:"skip",label:"\uD83D\uDED1 Skip — keep the existing file"}],CC0=[{value:"bun",label:"\uD83D\uDCE6 bun"},{value:"npm",label:"\uD83D\uDCE6 npm"},{value:"pnpm",label:"\uD83D\uDCE6 pnpm"},{value:"yarn",label:"\uD83D\uDCE6 yarn"}],LC0=[{value:"write",label:"✏️ Write file"},{value:"view",label:"\uD83D\uDC40 Show proposed file diff"},{value:"cancel",label:"❌ Do not write file"}],VC0=[{value:"close",label:"Close diff"}],NC0=[{value:"yes",label:"\uD83D\uDE80 Yes, request a build"},{value:"no",label:"⏭ Not now"}],RC0=[{value:"__custom__",label:"Type a custom command…"},{value:"__skip__",label:"Skip build step (my app is raw HTML)"}],EC0={"saving-credentials":"auto","detecting-ci-secrets":"auto","ci-secrets-setup":"auto","ci-secrets-target-select":"choice","ask-ci-secrets":"choice","checking-ci-secrets":"auto","confirm-ci-secret-overwrite":"choice","uploading-ci-secrets":"auto","ci-secrets-failed":"error","ask-github-actions-setup":"choice","confirm-secrets-push":"choice","ask-export-env":"choice","exporting-env":"auto","confirm-env-export-overwrite":"choice","overwrite-and-export-env":"auto","pick-package-manager":"choice","pick-build-script":"choice","pick-build-script-custom":"input","preview-workflow-file":"choice","view-workflow-diff":"choice","writing-workflow-file":"auto","ask-build":"choice","requesting-build":"auto","build-complete":"done"};function zO(A,Q,B){let $={step:A,kind:EC0[A]};switch(A){case"ci-secrets-setup":return{...$,title:"Set up your git hosting CLI to upload env vars",options:qC0};case"ci-secrets-target-select":{let J=(B.ciSecretTargets??[]).map((Y)=>({value:Y.provider,label:Y.provider==="github"?"GitHub Actions repository secrets":"GitLab CI/CD variables"}));return{...$,prompt:"Where should Capgo upload the build env vars?",options:[...J,{value:"skip",label:"Skip"}]}}case"ask-ci-secrets":{let J=B.ciSecretEntries?.length??0,Y=Mz(Q?.ciSecretTarget??null),Z=Q?.ciSecretTarget?.cli||"CLI";return{...$,prompt:`Upload ${J} build env var${J===1?"":"s"} to ${Y}?`,options:[{value:"yes",label:`Upload with ${Z}`},{value:"no",label:"Skip"}]}}case"confirm-ci-secret-overwrite":return{...$,prompt:"These env vars already exist and will be replaced:",options:DC0};case"ci-secrets-failed":return{...$,message:"Could not upload env vars.",options:IC0};case"ask-github-actions-setup":return{...$,prompt:"Set up GitHub Actions for you?",options:OC0};case"confirm-secrets-push":{let J=B.ciSecretRepoLabel??"the repository";return{...$,prompt:`Confirm before pushing secrets to ${J}`,options:[{value:"confirm",label:`Yes, push to ${J}`},{value:"cancel",label:"Cancel — don't push anything"}]}}case"ask-export-env":{let J=(B.defaultEnvExportPath??"").split("/").slice(-1)[0],Y=J?`\uD83D\uDCDD Yes — write ${J}`:"\uD83D\uDCDD Yes — write the .env file";return{...$,prompt:"Export the credentials as a .env file instead?",options:[{value:"yes",label:Y},{value:"no",label:"❌ No, exit without exporting"}]}}case"confirm-env-export-overwrite":{let J=Q?.envExportTargetPath??B.defaultEnvExportPath??"the file";return{...$,prompt:`${J} already exists. Replace it with a fresh export, or skip?`,options:MC0}}case"pick-package-manager":{let J=B.detectedPackageManager,Y=CC0.map((Z)=>J&&Z.value===J?{...Z,label:`${Z.label} (recommended — matches your lockfile)`}:Z);return{...$,prompt:"Which package manager does this project use?",options:Y}}case"pick-build-script":{let J=B.availableScripts?HT(B.availableScripts,B.recommendedScript??null).map((Y)=>({value:Y.value,label:Y.label})):RC0;return{...$,prompt:"Which script builds your web assets?",options:J}}case"pick-build-script-custom":return{...$,prompt:"Custom build command",collect:["buildScriptCustomCommand"]};case"preview-workflow-file":return{...$,prompt:`What should we do with ${_$}?`,options:LC0};case"view-workflow-diff":return{...$,title:"Proposed workflow diff",options:VC0};case"ask-build":return{...$,prompt:"Request a build now?",options:NC0};case"build-complete":return{...$,message:"Build complete."};default:return $}}function UG(A,Q,B){switch(A){case"ci-secrets-target-select":return{...Q,ciSecretTarget:B.ciSecretTarget};case"ask-github-actions-setup":{let $=B,J=$.value==="no"?"declined":$.value;return{...Q,setupMode:J}}case"ask-export-env":{let $=B;if($.value==="yes")return{...Q,envExportTargetPath:$.envExportTargetPath};return Q}case"pick-package-manager":return{...Q,selectedPackageManager:B.selectedPackageManager};case"pick-build-script":{let $=B;if("buildScriptChoice"in $)return{...Q,buildScriptChoice:$.buildScriptChoice};return Q}case"pick-build-script-custom":{let J=B.command.trim();if(!J)return Q;return{...Q,buildScriptChoice:{type:"custom",command:J}}}default:return Q}}function JXQ(A,Q){let B=Q.carried?.savedCredentials;if(B&&Object.keys(B).length>0)return B;return Q.rebuildTailCredentials(A)}function y0A(A,Q){let B=Q.carried?.ciSecretEntries;if(B)return B;if(!Q.createCiSecretEntries)return[];let $=Q.rebuildTailCredentials(A);if(Object.keys($).length===0)return[];return Q.createCiSecretEntries($)}async function jC0(A){if(!A.getPackageScripts)return{};try{let Q=A.getPackageScripts()??{},B=null;if(A.findProjectType){let $=await A.findProjectType({quiet:!0}).catch((J)=>{return A.onInternalLog?.(`project-type detection failed, no recommended script: ${J instanceof Error?J.message:String(J)}`),null});if($&&A.findBuildCommandForProjectType){let J=await A.findBuildCommandForProjectType($).catch((Y)=>{return A.onInternalLog?.(`build-command lookup failed for "${$}", no recommended script: ${Y instanceof Error?Y.message:String(Y)}`),null});if(J&&Object.hasOwn(Q,J))B=J}}return{availableScripts:Q,recommendedScript:B}}catch(Q){return A.onInternalLog?.(`build-script detection failed, falling back to manual entry: ${Q instanceof Error?Q.message:String(Q)}`),{}}}async function DT(A,Q,B){switch(A){case"saving-credentials":{let $;try{$=await B.buildSavedCredentials(Q)}catch(Y){let Z=Y instanceof Error?Y.message:String(Y),X=await B.loadProgress(Q.appId);if(X){let G=B.resumeStep(X);if(G!=="saving-credentials")return B.onInternalLog?.(`saving-credentials build failed (diverting to ${G}): ${Z}`),B.onLog?.(`ℹ Some required input was missing — sending you back to fill it in. (${Z})`,"yellow"),{progress:Q,next:G}}throw Y}if(await B.updateSavedCredentials(Q.appId,B.platform,$),await B.deleteProgress(Q.appId),B.onLog?.("✔ Credentials saved"),Q.keystorePasswordGenerated)B.onLog?.(" ℹ Your auto-generated keystore password is now in ~/.capgo-credentials/credentials.json — back up that file.","yellow");let J=B.createCiSecretEntries?.($)??[];return{progress:Q,next:"ask-build",transient:{ciSecretEntries:J,savedCredentials:$}}}case"detecting-ci-secrets":{let $=B.detectCiSecretTargets(),J={ciSecretTargets:$.targets,ciSecretSetupAdvice:$.setup};if($.targets.length===0){if($.setup.length>0)return{progress:Q,next:"ci-secrets-setup",transient:J};for(let Y of $.notes)B.onLog?.(`ℹ ${Y}`,"yellow");return{progress:Q,next:"build-complete",transient:J}}if($.targets.length===1){let Y=$.targets[0],Z={...Q,ciSecretTarget:Y},X=Y.provider==="github"?"ask-github-actions-setup":"ask-ci-secrets";return{progress:Z,next:X,transient:J}}return{progress:Q,next:"ci-secrets-target-select",transient:J}}case"checking-ci-secrets":{let $=(J)=>{return B.onCiSecretError?.(J),{progress:Q,next:"ci-secrets-failed",transient:{ciSecretError:J}}};try{let J=Q.ciSecretTarget;if(!J)throw Error("No git hosting target selected.");let Y=(W)=>{B.onCiSecretCheckPhase?.(W)};Y("Resolving GitHub repository…");let Z=null;if(J.provider==="github"){if(Z=await B.getCiSecretRepoLabelAsync(J),!Z)return B.onCiSecretError?.("Could not resolve the GitHub repository. Run `gh repo view` from this directory, then try again."),{progress:Q,next:"ci-secrets-failed",transient:{ciSecretRepoLabel:null,ciSecretError:"Could not resolve the GitHub repository. Run `gh repo view` from this directory, then try again."}}}Y(Z?`Checking existing env vars in ${Z}…`:`Checking existing env vars in ${Mz(J)}…`);let X=y0A(Q,B),G=await B.listExistingCiSecretKeysAsync(J,X.map((W)=>W.key));if(J.provider==="github")return{progress:Q,next:"confirm-secrets-push",transient:{ciSecretRepoLabel:Z,ciSecretExistingKeys:G,ciSecretEntries:X}};let K=G.length>0?"confirm-ci-secret-overwrite":"uploading-ci-secrets";return{progress:Q,next:K,transient:{ciSecretExistingKeys:G,ciSecretEntries:X}}}catch(J){return $(J instanceof Error?J.message:String(J))}}case"uploading-ci-secrets":{let $=Q.ciSecretTarget;if(!$)throw Error("No git hosting target selected.");let J=y0A(Q,B);await B.uploadCiSecretsAsync($,J,B.carried?.ciSecretExistingKeys,void 0,B.onCiSecretUploadProgress);let Y=`Uploaded ${J.length} env var${J.length===1?"":"s"} to ${$.label}`;if(B.onLog?.(`✔ ${Y}`),Q.setupMode==="with-workflow"){let Z=await jC0(B);return{progress:Q,next:"pick-package-manager",transient:{ciSecretUploadSummary:Y,...Z}}}return{progress:Q,next:"build-complete",transient:{ciSecretUploadSummary:Y}}}case"exporting-env":try{let $=Q.envExportTargetPath||B.defaultExportPath(Q.appId,B.platform),J=B.exportCredentialsToEnv({appId:Q.appId,platform:B.platform,credentials:JXQ(Q,B),targetPath:$});if(J.kind==="empty")return{progress:Q,next:"build-complete",transient:{envExportError:"No credentials to export — saved state is empty."}};if(J.kind==="exists")return{progress:{...Q,envExportTargetPath:J.path},next:"confirm-env-export-overwrite"};return B.onLog?.(`✔ Exported ${J.fieldCount} field${J.fieldCount===1?"":"s"} → ${J.path}`),{progress:Q,next:"build-complete",transient:{envExportPath:J.path}}}catch($){return{progress:Q,next:"build-complete",transient:{envExportError:$ instanceof Error?$.message:String($)}}}case"overwrite-and-export-env":try{let $=B.exportCredentialsToEnv({appId:Q.appId,platform:B.platform,credentials:JXQ(Q,B),targetPath:Q.envExportTargetPath,overwrite:!0});if($.kind==="written")return B.onLog?.(`✔ Overwrote ${$.path} with ${$.fieldCount} field${$.fieldCount===1?"":"s"}`),{progress:Q,next:"build-complete",transient:{envExportPath:$.path}};return{progress:Q,next:"build-complete"}}catch($){return{progress:Q,next:"build-complete",transient:{envExportError:$ instanceof Error?$.message:String($)}}}case"writing-workflow-file":{let $=Q.buildScriptChoice;if(!$)throw Error("Internal error: no build script choice recorded.");let J=y0A(Q,B),Y=B.writeWorkflowFile({appId:Q.appId,defaultPlatform:B.platform,packageManager:Q.selectedPackageManager??"npm",buildScript:$,secretKeys:J.map((Z)=>Z.key)},{overwrite:!0});if(Y.kind==="written"){let Z=B.carried?.workflowIsNew===!1?"Overwrote":"Wrote";return B.onLog?.(`✔ ${Z} ${_$}`),B.trackWorkflowEvent?.("workflow-file-written",{decision:"write"}),{progress:Q,next:"build-complete",transient:{workflowFilePath:Y.absolutePath}}}return{progress:Q,next:"build-complete"}}case"requesting-build":{if(B.signal?.aborted)return{progress:Q};let $="";if(B.resolveApikey){let J=B.resolveApikey();if(!J)return B.onBuildOutput?.("⚠ No Capgo API key found."),B.onBuildOutput?.(`Run \`capgo login\` first, then \`capgo build request --platform ${B.platform}\`.`),{progress:Q,next:"build-complete"};$=J}B.onBuildOutput?.(`Requesting build for ${Q.appId} (${B.platform})...`);try{let J=await B.requestBuildInternal(Q.appId,{apikey:$,platform:B.platform,aiAnalysisMode:"caller-handled"},!0,B.logger);if(B.signal?.aborted)return{progress:Q};if(J.success){let Y=o7(`/app/${Q.appId}/builds`);B.onBuildOutput?.(""),B.onBuildOutput?.(`✔ Build queued — ${Y}`);let Z=y0A(Q,B);if(Z.length>0)return{progress:Q,next:"detecting-ci-secrets",transient:{buildUrl:Y,ciSecretEntries:Z}};return{progress:Q,next:"build-complete",transient:{buildUrl:Y}}}if(B.onBuildOutput?.(`⚠ ${J.error||"unknown error"}`),J.aiAnalysis?.ready&&J.aiAnalysis.jobId)return{progress:Q,next:"ai-analysis-prompt",transient:{aiJobId:J.aiAnalysis.jobId}};return{progress:Q,next:"build-complete"}}catch(J){if(B.signal?.aborted)return{progress:Q};let Y=J instanceof Error?J.message:String(J);return B.onBuildOutput?.(`⚠ ${Y}`),B.onBuildOutput?.(`Your credentials are saved. Run \`capgo build request --platform ${B.platform}\` to try again.`),{progress:Q,next:"build-complete",transient:{error:Y}}}}default:throw Error(`Unhandled tail effect step: ${A}`)}}function wC0(A,Q,B){return{...A,_oauthRefreshToken:Q.refreshToken,completedSteps:{...A.completedSteps,googleSignInComplete:{email:B.email,googleSubject:B.sub,scope:Q.scope}}}}function XXQ(A,Q,B,$){return{...A,_oauthAccessToken:Q,_oauthAccessTokenExpiresAt:B??void 0,completedSteps:{...A.completedSteps,googleSignInComplete:{email:$.email,googleSubject:$.sub,scope:""}}}}var PC0={welcome:"auto","resume-prompt":"auto","ai-analysis-prompt":"auto","ai-analysis-running":"auto","ai-analysis-result":"auto","ai-analysis-result-scroll":"auto","build-log-view":"auto","support-confirm":"choice","support-log-view":"auto","support-uploading":"auto","credentials-exist":"choice","backing-up":"auto","no-platform":"error","keystore-method-select":"choice","keystore-explainer":"choice","keystore-existing-path":"choice","keystore-existing-picker":"auto","keystore-existing-store-password":"input","keystore-existing-detecting-alias":"auto","keystore-existing-alias-select":"choice","keystore-existing-alias":"input","keystore-existing-key-password":"input","keystore-new-alias":"input","keystore-new-password-method":"choice","keystore-new-store-password":"input","keystore-new-key-password":"input","keystore-new-cn":"input","keystore-generating":"auto","service-account-method-select":"choice","sa-json-existing-path":"choice","sa-json-existing-picker":"auto","sa-json-validating":"auto","sa-json-validation-failed":"choice","google-sign-in":"choice","google-sign-in-running":"auto","play-developer-id-input":"choice","gcp-projects-loading":"auto","gcp-projects-select":"choice","gcp-project-create-name":"input","android-package-select":"auto","gcp-setup-running":"auto","saving-credentials":"auto","detecting-ci-secrets":"auto","ci-secrets-setup":"auto","ci-secrets-target-select":"choice","ask-ci-secrets":"choice","checking-ci-secrets":"auto","confirm-ci-secret-overwrite":"choice","uploading-ci-secrets":"auto","ci-secrets-failed":"error","ask-github-actions-setup":"choice","confirm-secrets-push":"choice","ask-export-env":"choice","exporting-env":"auto","confirm-env-export-overwrite":"choice","overwrite-and-export-env":"auto","pick-package-manager":"choice","pick-build-script":"choice","pick-build-script-custom":"input","preview-workflow-file":"choice","view-workflow-diff":"choice","writing-workflow-file":"auto","ask-build":"choice","requesting-build":"auto","build-complete":"done",error:"error","android-app-verify":"auto"},TC0=[{value:"existing",label:"Yes, I have one"},{value:"generate",label:"No, create one for me"},{value:"learn",label:"What is a keystore?"}],_C0=[{value:"backup",label:"Start fresh (backup existing credentials first)"},{value:"cancel",label:"Exit onboarding"}],SC0=[{value:"back",label:"Back"}],kC0=[{value:"picker",label:"Open file picker"},{value:"manual",label:"Type the path"}],bC0=[{value:"random",label:"Generate a random password (recommended)"},{value:"manual",label:"I'll type my own password"}],xC0=[{value:"generate",label:"Set it up for me (recommended) — I sign in with Google once and Capgo configures Play access automatically"},{value:"existing",label:"I already have a Google Play service-account JSON file to use"}],fC0=[{value:"picker",label:"Open file picker"},{value:"manual",label:"Type the path"}],vC0=[{value:"retry",label:"Try a different service account JSON file"},{value:"save-anyway",label:"Save anyway (skip validation)"},{value:"oauth",label:"Set one up for me via Google instead"}],yC0=[{value:"go",label:"Continue to Google sign-in"},{value:"learn",label:"Learn why the onboarding via Google is secure"},{value:"exit",label:"Exit (I'll do it later)"}],gC0=[{value:"open",label:"Open Play Console in browser"},{value:"tutorial",label:"Show me how to find the developer ID"},{value:"manual",label:"I'll type it now"}],hC0={value:"__new__",label:"Create a new project"};function IT(A,Q,B){if(dC0.has(A))return iC0(zO(A,Q,B),A);let $=A==="android-package-select"?B.detectedPackageIds===void 0?"auto":B.detectedPackageIds.length>0?"choice":"input":A==="android-app-verify"?B.playVerifyOutcome===void 0?"auto":"choice":PC0[A],J={step:A,kind:$};switch(A){case"no-platform":return{...J,message:"No Android platform found. Run `npx cap add android` first."};case"credentials-exist":return{...J,options:_C0};case"keystore-method-select":return{...J,options:TC0};case"keystore-explainer":return{...J,options:SC0};case"keystore-existing-path":return{...J,options:kC0};case"keystore-existing-store-password":return{...J,prompt:"Keystore store password",collect:["keystoreStorePassword"]};case"keystore-existing-alias-select":{let Y=B.detectedAliases??[];return{...J,options:Y.map((Z)=>({value:Z,label:Z}))}}case"keystore-existing-alias":return{...J,prompt:"Keystore alias",collect:["keystoreAlias"]};case"keystore-existing-key-password":return{...J,prompt:"Keystore key password",collect:["keystoreKeyPassword"]};case"keystore-new-alias":return{...J,prompt:"Key alias (e.g. release)",collect:["keystoreAlias"]};case"keystore-new-password-method":return{...J,options:bC0};case"keystore-new-store-password":return{...J,prompt:"Store password (min 6 chars)",collect:["keystoreStorePassword"]};case"keystore-new-key-password":return{...J,prompt:"Key password",collect:["keystoreKeyPassword"]};case"keystore-new-cn":return{...J,prompt:"Common name (e.g. your app ID)",collect:["keystoreCommonName"]};case"service-account-method-select":return{...J,options:xC0};case"sa-json-existing-path":return{...J,options:fC0};case"sa-json-validation-failed":{let Y=B.saValidation&&!B.saValidation.ok?B.saValidation.message:void 0;return{...J,options:vC0,message:Y}}case"google-sign-in":return{...J,options:yC0};case"play-developer-id-input":return{...J,options:gC0};case"gcp-projects-select":{let Y=(B.gcpProjects??[]).map((Z)=>({value:Z.projectId,label:Z.name,note:Z.projectNumber}));return{...J,options:[...Y,hC0]}}case"gcp-project-create-name":return{...J,prompt:"New GCP project display name",collect:["pendingNewProjectDisplayName"]};case"android-package-select":{if($==="choice"&&B.detectedPackageIds&&B.detectedPackageIds.length>0){let Y=new Set(B.detectedPackageIds),Z=B.playVerifyApps?new Set(B.playVerifyApps.map((K)=>K.packageName)):null,X=B.detectedPackageIds.map((K)=>({value:K,label:K,...Z?{note:Z.has(K)?"✓ exists in Play Store":"⚠ not in Play Store yet"}:{}})),G=(B.playVerifyApps??[]).filter((K)=>!Y.has(K.packageName)).map((K)=>({value:K.packageName,label:K.displayName?`${K.packageName} (${K.displayName})`:K.packageName,note:"✓ exists in Play Store"}));return{...J,options:[...X,...G]}}return J}case"android-app-verify":{if($==="choice"){let Y=Q?.completedSteps.androidPackageChosen?.packageName??"your package";if(B.playVerifyOutcome==="wrong-build-id")return{...J,message:`None of your Play Store apps match "${Y}". Pick a different package (the applicationId your app is actually published under), or create "${Y}" in Play Console (https://play.google.com/console). Capgo grants your build access to that exact package, so it must exist before Play upload. If you only need the AAB (no Play upload yet), cancel and run: npx @capgo/cli@latest build request --platform android --no-playstore-upload --output-upload`,options:[{value:"recheck",label:"Re-check (I fixed the package / created the app)"},{value:"proceed",label:"The app exists, proceed anyway"},{value:"open",label:"Open Play Console"},{value:"cancel",label:"Cancel onboarding"}]};return{...J,message:`No Play Store app exists yet for "${Y}". Create it once in Play Console (https://play.google.com/console), then re-check. Capgo grants your build access to that exact package, so it must exist before Play upload. If you only need the AAB (no Play upload yet), cancel and run: npx @capgo/cli@latest build request --platform android --no-playstore-upload --output-upload`,options:[{value:"open",label:"Open Play Console to create this app"},{value:"recheck",label:"I've created it, re-check"},{value:"proceed",label:"I've already created it, proceed anyway"},{value:"cancel",label:"Cancel onboarding"}]}}return J}case"error":return{...J,message:"An error occurred. Check the details above."};default:return J}}var g0A="release";function YJ(A,Q,B){if(lC0.has(A))return UG(A,Q,B);switch(A){case"credentials-exist":{if(B.value==="backup")return{...Q,_credentialsExistGate:"backup"};return{...Q,_credentialsExistGate:"cancel"}}case"keystore-method-select":{let $=B;if($.value==="existing")return{...Q,keystoreMethod:"existing"};if($.value==="generate")return{...Q,keystoreMethod:"generate"};return Q}case"keystore-existing-path":return{...Q,keystoreExistingPath:B.path};case"keystore-existing-store-password":return{...Q,keystoreStorePassword:B.password};case"keystore-existing-alias-select":return{...Q,keystoreAlias:B.alias};case"keystore-existing-alias":{let J=B.alias.trim()||g0A;return{...Q,keystoreAlias:J}}case"keystore-existing-key-password":{let J=B.password||Q.keystoreStorePassword||"";return{...Q,keystoreKeyPassword:J}}case"keystore-new-alias":{let J=B.alias.trim()||g0A;return{...Q,keystoreAlias:J}}case"keystore-new-password-method":{if(B.value==="random"){let J=b0A();return{...Q,keystoreStorePassword:J,keystoreKeyPassword:J,keystorePasswordGenerated:!0}}return{...Q,keystorePasswordManual:!0}}case"keystore-new-store-password":return{...Q,keystoreStorePassword:B.password};case"keystore-new-key-password":{let J=B.password||Q.keystoreStorePassword||"";return{...Q,keystoreKeyPassword:J}}case"keystore-new-cn":{let J=B.cn.trim()||Q.appId;return{...Q,keystoreCommonName:J}}case"service-account-method-select":return{...Q,serviceAccountMethod:B.value};case"sa-json-existing-path":return{...Q,serviceAccountJsonPath:B.path};case"sa-json-validation-failed":{let $=B;if($.value==="retry")return{...Q,serviceAccountJsonPath:void 0};if($.value==="save-anyway")return{...Q,_serviceAccountKeyBase64:$.serviceAccountKeyBase64,serviceAccountValidationSkipped:!0};return{...Q,serviceAccountMethod:"generate"}}case"play-developer-id-input":{let J=qT(B.rawDeveloperIdOrUrl);if(!J)return Q;let Y={developerId:J};return{...Q,completedSteps:{...Q.completedSteps,playAccountChosen:Y}}}case"gcp-projects-select":{let $=B,J={projectId:$.gcpProject.projectId,projectNumber:$.gcpProject.projectNumber,displayName:$.gcpProject.name,createdByOnboarding:!1};return{...Q,completedSteps:{...Q.completedSteps,gcpProjectChosen:J}}}case"gcp-project-create-name":{let J=UT(B.displayName.trim()||`Capgo ${Q.appId}`),Y=k0A(Q.appId),Z={projectId:Y,displayName:J,createdByOnboarding:!0};return{...Q,pendingNewProjectId:Y,pendingNewProjectDisplayName:J,completedSteps:{...Q.completedSteps,gcpProjectChosen:Z}}}case"android-package-select":{let $=B,J={packageName:$.packageName,source:$.source};return{...Q,serviceAccountMethod:$.serviceAccountMethod,completedSteps:{...Q.completedSteps,androidPackageChosen:J}}}case"android-app-verify":{if(B.verifyAction==="proceed"){let J=Q.completedSteps.androidPackageChosen?.packageName??"";return{...Q,completedSteps:{...Q.completedSteps,playAppVerified:{packageName:J,verified:!1}}}}return Q}default:return Q}}function uC0(A){let{_keystoreBase64:Q,_serviceAccountKeyBase64:B,keystoreStorePassword:$,keystoreAlias:J}=A;if(!Q||!B||!$||!J)return{};return{ANDROID_KEYSTORE_FILE:Q,KEYSTORE_KEY_ALIAS:J,KEYSTORE_STORE_PASSWORD:$,KEYSTORE_KEY_PASSWORD:A.keystoreKeyPassword||$,PLAY_CONFIG_JSON:B}}function mC0(A){let Q=A._keystoreBase64;if(!Q)throw Error("keystore not ready");let B=A._serviceAccountKeyBase64;if(!B)throw Error("service-account key not provisioned");let{keystoreStorePassword:$,keystoreAlias:J}=A;if(!$||!J)throw Error("keystore inputs missing");return{ANDROID_KEYSTORE_FILE:Q,KEYSTORE_KEY_ALIAS:J,KEYSTORE_STORE_PASSWORD:$,KEYSTORE_KEY_PASSWORD:A.keystoreKeyPassword||$,PLAY_CONFIG_JSON:B}}var cC0=new Set(["saving-credentials","detecting-ci-secrets","checking-ci-secrets","uploading-ci-secrets","exporting-env","overwrite-and-export-env","writing-workflow-file","requesting-build"]),dC0=new Set(["ci-secrets-setup","ci-secrets-target-select","ask-ci-secrets","confirm-ci-secret-overwrite","ci-secrets-failed","ask-github-actions-setup","confirm-secrets-push","ask-export-env","confirm-env-export-overwrite","pick-package-manager","pick-build-script","pick-build-script-custom","preview-workflow-file","view-workflow-diff","ask-build","build-complete"]),lC0=new Set(["ci-secrets-target-select","ask-github-actions-setup","ask-export-env","pick-package-manager","pick-build-script","pick-build-script-custom"]);function pC0(A){return{platform:"android",buildSavedCredentials:mC0,rebuildTailCredentials:uC0,resumeStep:$J,updateSavedCredentials:A.updateSavedCredentials,loadProgress:A.loadAndroidProgress,saveProgress:A.saveAndroidProgress,deleteProgress:A.deleteAndroidProgress,createCiSecretEntries:A.createCiSecretEntries,detectCiSecretTargets:A.detectCiSecretTargets,getCiSecretRepoLabelAsync:A.getCiSecretRepoLabelAsync,listExistingCiSecretKeysAsync:A.listExistingCiSecretKeysAsync,uploadCiSecretsAsync:A.uploadCiSecretsAsync,exportCredentialsToEnv:A.exportCredentialsToEnv,defaultExportPath:A.defaultExportPath,generateWorkflow:A.generateWorkflow,writeWorkflowFile:A.writeWorkflowFile,requestBuildInternal:A.requestBuildInternal,logger:A.logger,onBuildOutput:A.onBuildOutput,resolveApikey:A.resolveApikey,onCiSecretUploadProgress:A.onCiSecretUploadProgress,onCiSecretCheckPhase:A.onCiSecretCheckPhase,onCiSecretError:A.onCiSecretError,getPackageScripts:A.getPackageScripts,findProjectType:A.findProjectType,findBuildCommandForProjectType:A.findBuildCommandForProjectType,trackWorkflowEvent:A.trackWorkflowEvent,carried:A.carried,onStatus:A.onStatus,onLog:A.onLog,onInternalLog:A.onInternalLog,signal:A.signal}}function iC0(A,Q){return{step:Q,kind:A.kind,title:A.title,prompt:A.prompt,collect:A.collect,options:A.options,message:A.message}}async function Hm(A,Q,B){if(cC0.has(A)){let $=await DT(A,Q,pC0(B));return{progress:$.progress,next:$.next,transient:$.transient}}switch(A){case"backing-up":{let $=ZXQ(YXQ(),".capgo-credentials","credentials.json"),J=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),Y=ZXQ(YXQ(),".capgo-credentials",`credentials-${J}.copy.json`);try{await B.copyFile($,Y),B.onLog?.(`✔ Backup saved · ${Y}`)}catch(X){let G=X instanceof Error?X.message:String(X);if(B.onInternalLog?.(`credentials backup failed: ${G}`),X?.code==="ENOENT"||/ENOENT/.test(G))B.onLog?.("⚠ Could not backup credentials (file may not exist yet)","yellow");else B.onLog?.(`⚠ Could not back up credentials: ${G}`,"yellow")}let Z={...Q,_credentialsExistGate:"done"};return await B.saveAndroidProgress(Q.appId,Z),{progress:Z,next:"keystore-method-select"}}case"keystore-existing-detecting-alias":{let $=await B.readFile(Q.keystoreExistingPath),J=B.listKeystoreAliases($,Q.keystoreStorePassword);if(J.ok&&J.aliases.length===1){let Y=J.aliases[0],Z={...Q,keystoreAlias:Y};return await B.saveAndroidProgress(Q.appId,Z),B.onLog?.(`✔ Detected alias · ${Y}`),{progress:Z,next:"keystore-existing-key-password"}}if(J.ok&&J.aliases.length>1)return{progress:Q,next:"keystore-existing-alias-select",transient:{detectedAliases:J.aliases}};if(!J.ok&&J.reason==="wrong-password")return{progress:Q,next:"keystore-existing-store-password",transient:{wrongPassword:!0}};if(!J.ok&&J.reason==="unsupported-format")B.onLog?.("ℹ Couldn't auto-detect alias (JKS format or similar) — enter it manually.","yellow");else if(J.ok)B.onLog?.("ℹ Couldn't auto-detect alias from the keystore — enter it manually.","yellow");return{progress:Q,next:"keystore-existing-alias"}}case"keystore-existing-key-password":{let $=null,J=null;if(Q.keystoreKeyPassword)$=Q.keystoreKeyPassword,J="progress";else if(Q.keystoreStorePassword&&Q.keystoreExistingPath)try{let q=await B.readFile(Q.keystoreExistingPath);if(B.tryUnlockPrivateKey(q,Q.keystoreStorePassword).ok)$=Q.keystoreStorePassword,J="probed-same"}catch{}if(!$)return{progress:Q,next:"keystore-existing-key-password",transient:{needsKeyPasswordPrompt:!0}};if(J==="probed-same")B.onLog?.("ℹ Key password matches store password — using the same value");let Y=$;B.onLog?.("✔ Key password set");let X=(await B.readFile(Q.keystoreExistingPath)).toString("base64"),G={keystorePath:Q.keystoreExistingPath,alias:Q.keystoreAlias||g0A,isGenerated:!1},K={...Q,keystoreKeyPassword:Y,_keystoreBase64:X,serviceAccountForkSeen:!0,completedSteps:{...Q.completedSteps,keystoreReady:G}};await B.saveAndroidProgress(Q.appId,K),B.onLog?.(`✔ Keystore loaded — ${Q.keystoreExistingPath}`);let W=await B.loadAndroidProgress(Q.appId),H=W?NV(W):!1,U;if(H||W?.serviceAccountMethod!==void 0)U=W?$J(W):"service-account-method-select";else U="service-account-method-select";return{progress:K,next:U}}case"keystore-generating":{let $=Q.keystoreStorePassword,J=Q.keystoreKeyPassword||$,Y=Q.keystoreCommonName||Q.appId,Z=B.generateKeystore({alias:Q.keystoreAlias||g0A,storePassword:$,keyPassword:J,dname:{commonName:Y,organizationName:"Capgo"}}),G={keystorePath:`android/app/${Z.alias}.p12`,alias:Z.alias,isGenerated:!0},K={...Q,keystoreMethod:"generate",keystoreAlias:Z.alias,keystoreStorePassword:$,keystoreKeyPassword:J,keystoreCommonName:Y,_keystoreBase64:Z.p12Base64,serviceAccountForkSeen:!0,completedSteps:{...Q.completedSteps,keystoreReady:G}};return await B.saveAndroidProgress(Q.appId,K),B.onLog?.(`✔ Keystore generated — alias: ${Z.alias}, valid until ${Z.notAfter.getFullYear()}`),{progress:K,next:"service-account-method-select"}}case"sa-json-validating":{let $=await B.readFile(Q.serviceAccountJsonPath),J=Q.completedSteps.androidPackageChosen.packageName,Y=await B.validateServiceAccountJson({jsonBytes:$,packageName:J,signal:B.signal});if(Y.ok){let Z=$.toString("base64"),X={...Q,_serviceAccountKeyBase64:Z,serviceAccountValidationSkipped:!1};return await B.saveAndroidProgress(Q.appId,X),B.onLog?.(`✔ Service account verified — ${Y.serviceAccountEmail}`),{progress:X,next:"saving-credentials"}}if(Y.kind==="shape-error")B.onLog?.(`✖ ${Y.message}`,"red");return{progress:Q,next:"sa-json-validation-failed",transient:{saValidation:Y}}}case"google-sign-in-running":{let $;try{$=await B.runOAuthFlow({onAuthUrl:B.onAuthUrl,onStatus:B.onStatus})}catch(Z){if(Z instanceof aw){B.onLog?.("✖ Sign-in did not grant all required permissions.","red");for(let X of Z.missing)B.onLog?.(` • Missing: ${X}`,"yellow");return B.onLog?.("Please retry sign-in and leave every requested permission checked.","yellow"),{progress:Q,next:"google-sign-in"}}throw Z}if(!$.refreshToken)throw Error("Google did not return a refresh token — try again.");let J=await B.fetchUserInfo($.accessToken),Y=wC0(Q,$,J);return await B.saveAndroidProgress(Q.appId,Y),B.onLog?.(`✔ Signed in as ${J.email}`),{progress:Y,next:"play-developer-id-input",transient:{accessToken:$.accessToken}}}case"gcp-projects-loading":{let $=await B.getAccessToken(),J=await B.listProjects($);return{progress:Q,next:"gcp-projects-select",transient:{gcpProjects:J.map((Y)=>({projectId:Y.projectId,name:Y.name,projectNumber:Y.projectNumber}))}}}case"android-app-verify":{let $=Q.completedSteps.androidPackageChosen?.packageName,J=async(Y)=>{let Z={...Q,completedSteps:{...Q.completedSteps,playAppVerified:{packageName:$??"",verified:Y}}};try{await B.saveAndroidProgress(Q.appId,Z)}catch{}return{progress:Z,next:"gcp-setup-running"}};if(!$||Q.serviceAccountMethod!=="generate"||!B.listPlayApps)return await J(!1);try{let Y=await B.getAccessToken(),Z=await B.listPlayApps(Y),X=$XQ({gradleIds:[$],apps:Z});if(X.kind==="exact-match")return await J(!0);return{progress:Q,next:"android-app-verify",transient:{playVerifyApps:Z.map((G)=>({packageName:G.packageName,displayName:G.displayName})),playVerifyOutcome:X.kind==="no-app"?"no-app":"wrong-build-id"}}}catch(Y){return B.onInternalLog?.(`android-app-verify: apps:search failed, continuing unverified (${Y instanceof Error?Y.message:String(Y)})`),await J(!1)}}case"android-package-select":{let $=await B.findAndroidApplicationIds(),J;if(Q.serviceAccountMethod==="generate"&&B.listPlayApps)try{let Y=await B.getAccessToken();J=await B.listPlayApps(Y)}catch(Y){B.onInternalLog?.(`android-package-select: Play apps preload failed, showing plain picker (${Y instanceof Error?Y.message:String(Y)})`)}return{progress:Q,next:"android-package-select",transient:{detectedPackageIds:$,...J?{playVerifyApps:J}:{}}}}case"gcp-setup-running":{let $=await B.getAccessToken(),J=Q,Y=J.completedSteps.gcpProjectChosen;if(Y&&Y.createdByOnboarding&&!Y.projectNumber){B.onStatus?.(`Creating GCP project ${Y.projectId}...`);let I=await B.createProject($,Y.projectId,Y.displayName);Y={...Y,projectNumber:I.projectNumber},J={...J,completedSteps:{...J.completedSteps,gcpProjectChosen:Y}},await B.saveAndroidProgress(J.appId,J),B.onStatus?.(`✔ Project created (number ${I.projectNumber})`)}if(!Y)throw Error("No GCP project selected");let Z=Y.projectId;B.onStatus?.(`Enabling ${iOA}...`),await B.enableService($,Z,iOA),B.onStatus?.("✔ API enabled"),B.onStatus?.(`Ensuring service account "${nOA}"...`);let{account:X,created:G}=await B.ensureServiceAccount({accessToken:$,projectId:Z,accountId:nOA,displayName:rZQ,description:oZQ}),K={email:X.email,projectId:Z,uniqueId:X.uniqueId};B.onStatus?.(G?`✔ Service account created — ${X.email}`:`✔ Service account exists — ${X.email}`),B.onStatus?.("Creating service-account JSON key...");let W=await B.createServiceAccountKey({accessToken:$,projectId:Z,serviceAccountEmail:X.email});J={...J,_serviceAccountKeyBase64:W.privateKeyDataBase64,completedSteps:{...J.completedSteps,serviceAccountProvisioned:K}},await B.saveAndroidProgress(J.appId,J),B.onStatus?.("✔ Key created");let H=J.completedSteps.playAccountChosen;if(!H)throw Error("No Play Developer account chosen");let U=J.completedSteps.androidPackageChosen;B.onStatus?.(`Inviting ${X.email} to Play Console...`);try{if(!U)throw Error("No Android package selected for the Play invite");await B.inviteServiceAccount({accessToken:$,developerId:H.developerId,serviceAccountEmail:X.email,developerAccountPermissions:QXQ,grants:[{packageName:U.packageName,permissions:BXQ}]})}catch(I){let O=I instanceof Error?I.message:String(I);if(!/already|exists|duplicate/i.test(O))throw I;B.onStatus?.("ℹ Service account was already invited — continuing")}let q={developerId:H.developerId,serviceAccountEmail:X.email};J={...J,completedSteps:{...J.completedSteps,playInviteProvisioned:q}},await B.saveAndroidProgress(J.appId,J),B.onStatus?.("✔ Play Console invite confirmed");let D=J._oauthRefreshToken??J._oauthAccessToken;if(D){B.onStatus?.("Revoking OAuth token (we don't need it anymore)...");let I=!1;try{await B.revokeToken(D),I=!0,B.onStatus?.("✔ OAuth token revoked")}catch(O){let V=O instanceof Error?O.message:String(O);B.onStatus?.(`⚠ Revoke request failed (${V}) — token will expire on its own`)}if(I){let{_oauthRefreshToken:O,_oauthAccessToken:V,_oauthAccessTokenExpiresAt:N,...C}=J;J=C,await B.saveAndroidProgress(J.appId,J)}}return B.onLog?.("✔ Google Cloud + Play setup complete"),{progress:J,next:"saving-credentials"}}default:throw Error(`Unhandled effect step: ${A}`)}}var oA=AQ(I8(),1),rC0=2,m0A="release",KXQ={"backing-up":"backing-up","keystore-existing-detecting-alias":"keystore-existing-path","keystore-generating":"keystore-generating","google-sign-in-running":"google-sign-in","gcp-setup-running":"gcp-setup-running","android-package-select":void 0,"android-app-verify":void 0},oC0=new Set(["saving-credentials","detecting-ci-secrets","checking-ci-secrets","uploading-ci-secrets","exporting-env","overwrite-and-export-env","writing-workflow-file","requesting-build"]);function WXQ(A){let Q=A.trim();if(Q.length>=2){let B=Q[0],$=Q[Q.length-1];if(B==='"'&&$==='"'||B==="'"&&$==="'")Q=Q.slice(1,-1)}if(Q.startsWith("~"))Q=Q.replace(/^~/,nC0());return Q=Q.replace(/\\ /g," "),Q}function AMA(A){return{platform:"android",appId:A,startedAt:new Date().toISOString(),completedSteps:{}}}var sC0=({appId:A,initialProgress:Q,androidDir:B,apikey:$,supaHost:J,supaAnon:Y,journeyId:Z,onStep:X,onResult:G,onBeforeExit:K})=>{let{exit:W}=JU(),H=_Q.useCallback(()=>{AO(K,W)},[W,K]),U=$J(Q),[q,D]=_Q.useState(Q!==null&&U!=="welcome"?"resume-prompt":U),I=_Q.useRef(q);I.current=q;let O=_Q.useRef({step:null,startedAt:Date.now()}),V=_Q.useRef([]),N=_Q.useRef([]),[C,L]=_Q.useState(null),R=_Q.useRef($??null),E=_Q.useRef(!1),w=_Q.useRef(void 0);_Q.useEffect(()=>{if(R.current)return;let OA=W4();if(OA)R.current=OA},[]),_Q.useEffect(()=>{if(E.current||!R.current)return;E.current=!0;let OA=!1;return(async()=>{let TA=await u$(R.current,A,{supaHost:J,supaAnon:Y}).catch(()=>null);if(TA&&!OA)L(TA)})(),()=>{OA=!0}},[A,J,Y]);let[S,u]=_Q.useState([]),[k,b]=_Q.useState(null);_Q.useEffect(()=>{if(!R.current)return;let OA=O.current,TA=OA.step!==null&&OA.step===q&&q!=="error";if(C&&V.current.length>0){for(let w0 of V.current)MP({apikey:R.current,appId:A,journeyId:Z,orgId:C,platform:"android",...w0});V.current=[]}if(C&&N.current.length>0){for(let w0 of N.current)CP({apikey:R.current,appId:A,journeyId:Z,orgId:C,platform:"android",...w0});N.current=[]}if(TA)return;let OQ=Date.now(),z0=OA.step===null||OA.step===q?void 0:OA.step,HB=z0===void 0?void 0:OQ-OA.startedAt,x1={step:q,durationMs:HB,durationStep:z0,errorCategory:q==="error"||q==="sa-json-validation-failed"?w.current:void 0};if(O.current={step:q,startedAt:OQ},C)MP({apikey:R.current,appId:A,journeyId:Z,orgId:C,platform:"android",...x1});else V.current.push(x1)},[q,A,C,k]),_Q.useEffect(()=>{X?.(q)},[q,X]);let h=_Q.useCallback((OA,TA,OQ=q)=>{if(!R.current)return;let z0={step:OQ,action:OA,tags:TA};if(C)CP({apikey:R.current,appId:A,journeyId:Z,orgId:C,platform:"android",...z0});else N.current.push(z0)},[A,C,q]),[r,e]=_Q.useState(0),[n,l]=_Q.useState(null),c=_Q.useRef(!1),f=_Q.useRef(!1),d=_Q.useRef(!1),x=_Q.useRef(!1),m=_Q.useRef(!1),QA=_Q.useRef(!1),g=_Q.useRef(null),s=_Q.useRef(!1),[BA,zA]=_Q.useState("choose"),[ZA,wA]=_Q.useState("choose"),[,qA]=_Q.useState(Q?.keystoreMethod||null),[MA,fA]=_Q.useState(Q?.keystoreExistingPath||""),[YA,jA]=_Q.useState(Q?.keystoreAlias||""),[NA,CA]=_Q.useState(Q?.keystoreStorePassword||""),[cQ,EQ]=_Q.useState(Q?.keystoreKeyPassword||""),[,X0]=_Q.useState(Q?.keystoreCommonName||""),[hQ,V0]=_Q.useState(!1),[y0,KB]=_Q.useState([]),[fB,oQ]=_Q.useState(null),x0=_Q.useRef(!1),[M0,A1]=_Q.useState(Q?.serviceAccountJsonPath||""),[y1,G8]=_Q.useState(null),[,a8]=_Q.useState(Q?.completedSteps.googleSignInComplete||null),[sQ,e0]=_Q.useState(""),[_0,K1]=_Q.useState(Q?._oauthRefreshToken||""),[Q8,JA]=_Q.useState(""),[dA,IQ]=_Q.useState([]),[nQ,C0]=_Q.useState(!1),[,vB]=_Q.useState(Q?.completedSteps.playAccountChosen||null),[zB,iB]=_Q.useState("actions"),[eB,o4]=_Q.useState([]),[,N1]=_Q.useState(Q?.completedSteps.gcpProjectChosen||null),[r8,x$]=_Q.useState(Q?.pendingNewProjectDisplayName||""),[y6,g6]=_Q.useState(Q?.completedSteps.androidPackageChosen||null),[H$,K5]=_Q.useState([]),[VB,o$]=_Q.useState(null),[F$,W5]=_Q.useState(!1),[h9,d4]=_Q.useState("choose"),s$=_Q.useRef(!1),[U$,t$]=_Q.useState(null),F9=_Q.useRef(!1),U9=_Q.useRef(null),[H5,NZ]=_Q.useState(0),[OY,y7]=_Q.useState(0),[RZ,h0]=_Q.useState([]),[,uJ]=_Q.useState(Q?.completedSteps.serviceAccountProvisioned||null),[,z9]=_Q.useState(Q?.completedSteps.playInviteProvisioned||null),[r5,mJ]=_Q.useState(""),[U4,u8]=_Q.useState([]),[cJ,N6]=_Q.useState(""),R6=_Q.useRef(null),[q9,W6]=_Q.useState("email"),[p6,F5]=_Q.useState([]),U5=_Q.useRef(""),[GA,HA]=_Q.useState("Uploading your logs to Capgo support…"),[PA,uA]=_Q.useState(null),[lA,wQ]=_Q.useState(null),[dQ,PQ]=_Q.useState(""),[D0,eQ]=_Q.useState(null),[g0,WB]=_Q.useState(0),[Q1,D1]=_Q.useState(!1),[W1,X4]=_Q.useState([]),[H6,e$]=_Q.useState([]),[C8,z$]=_Q.useState(null),[G4,K4]=_Q.useState([]),[E6,l4]=_Q.useState([]),[z5,x3]=_Q.useState(null),[tF,MN]=_Q.useState("Resolving GitHub repository…"),[dJ,oO]=_Q.useState(null),[o5,eF]=_Q.useState(null),[s5,t5]=_Q.useState([]),[MY,CN]=_Q.useState(null),[FJ,ez]=_Q.useState(!0),[A2,LN]=_Q.useState(null),[EZ,sO]=_Q.useState(null),[Aq,s_]=_Q.useState(null),{stdout:EX}=iZ(),[Qq,Bq]=_Q.useState({rows:EX?.rows??24,cols:EX?.columns??80});_Q.useEffect(()=>{if(!EX)return;let OA=()=>Bq({rows:EX.rows??24,cols:EX.columns??80});return EX.on("resize",OA),()=>{EX.off("resize",OA)}},[EX]);let{rows:UJ,cols:RG}=Qq,YW=_Q.useRef(null),[tO,VN]=_Q.useState({key:"",comfortable:null}),Q2=`${q}|${RG}`,EG=tO.key===Q2?tO:{key:Q2,comfortable:null};_Q.useEffect(()=>{if(!YW.current)return;let{height:OA}=eC(YW.current);if(OA<=0)return;VN((TA)=>{if(TA.key===Q2&&TA.comfortable===OA)return TA;return{key:Q2,comfortable:OA}})});let f3=EG.comfortable,$q=Df,D9=f3!=null?N0A(UJ,$q,f3):Number.POSITIVE_INFINITY,[Jq,B2]=_Q.useState("undecided"),[Yq,$2]=_Q.useState({}),[eO,v3]=_Q.useState(null),[ZW,y3]=_Q.useState(null),[AM,q5]=_Q.useState(null),[J2,QM]=_Q.useState(null),[f$,g3]=_Q.useState(null),[XW,A9]=_Q.useState(""),[D5,Y2]=_Q.useState(null),jX=V8(),jZ=(OA,TA={})=>{let OQ=TA.diff?FO(TA.diff,TA.isNew??FJ):A2??FO(s5,TA.isNew??FJ);_0A({event:OA,appId:A,platform:"android",apikey:$,journeyId:Z,packageManager:o5??C3(jX.pm),buildScriptType:ZW?.type,decision:TA.decision,...OQ})},AB=_Q.useCallback((OA,TA="green")=>{kB(OA),u((OQ)=>{let z0=OQ[OQ.length-1];if(z0&&z0.text===OA&&z0.color===TA)return OQ;return[...OQ,{text:OA,color:TA}]})},[]),g7=_Q.useCallback((OA)=>{kB(OA),h0((TA)=>[...TA,OA])},[]);_Q.useEffect(()=>{kB(`step → ${q}`)},[q]);let wX=_Q.useCallback((OA)=>{if(c.current)return;if(c.current=!0,OA)AB(OA,"yellow");setTimeout(H,50)},[AB,H]);e8((OA,TA)=>{if(TA.ctrl&&OA==="c")u0A.kill(u0A.pid,"SIGINT");if(q==="build-complete"&&JL(OA,TA)){H();return}if(q==="preview-workflow-file"&&TA.escape)jZ("workflow-preview-action",{decision:"escape"}),t5([]),D("build-complete")});let e5=_Q.useCallback(async(OA)=>{let TA=await l5(A)||AMA(A),OQ=OA(TA);return await Zz(A,OQ),OQ},[A]),wZ=_Q.useRef(null),f4=_Q.useCallback((OA,TA)=>{(async()=>{try{let OQ=await e5(OA);D(TA??$J(OQ))}catch(OQ){wZ.current?.(OQ,TA??I.current)}})()},[e5]),GW=(OA,TA,OQ)=>{let z0={keystorePath:"android/app/release.keystore",alias:YA||"release",isGenerated:!0},HB={platform:"android",appId:A,startedAt:new Date().toISOString(),_keystoreBase64:"_",keystoreAlias:YA||"release",keystoreStorePassword:NA||"_",setupMode:Jq,ciSecretTarget:C8,selectedPackageManager:o5??C3(jX.pm),buildScriptChoice:ZW,envExportTargetPath:XW,completedSteps:{keystoreReady:z0,credentialsSaved:{savedAt:new Date().toISOString()},...OQ.buildRequested?{buildRequested:{buildUrl:r5||""}}:{},...OQ.ciSecretsUploaded?{ciSecretsUploaded:{provider:C8?.provider??"github",count:W1.length}}:{}}};return $J(YJ(OA,HB,TA))},Zq=_Q.useCallback(()=>{if(!Q)return;let{completedSteps:OA}=Q,TA=$J(Q);if(new Set(["keystore-method-select","keystore-explainer","keystore-existing-path","keystore-existing-picker","keystore-existing-store-password","keystore-existing-detecting-alias","keystore-existing-alias-select","keystore-existing-alias","keystore-existing-key-password","keystore-new-alias","keystore-new-password-method","keystore-new-store-password","keystore-new-key-password","keystore-new-cn","keystore-generating"]).has(TA)){if(Q.keystoreExistingPath)AB(`✔ Keystore selected · ${Q.keystoreExistingPath}`);if(Q.keystoreAlias)AB(`✔ Key alias · ${Q.keystoreAlias}`);if(Q.keystoreStorePassword)AB("✔ Store password set");if(Q.keystoreKeyPassword)AB("✔ Key password set");AB("↺ Re-confirming a missing keystore input","yellow")}else if(OA.keystoreReady)AB(`✔ Keystore ready — ${OA.keystoreReady.keystorePath}`);if(OA.googleSignInComplete&&TA!=="google-sign-in")AB(`✔ Signed in as ${OA.googleSignInComplete.email}`);if(OA.playAccountChosen)AB(`✔ Play Developer account — ${OA.playAccountChosen.displayName||OA.playAccountChosen.developerId}`);if(OA.gcpProjectChosen)AB(`✔ GCP project — ${OA.gcpProjectChosen.displayName}`);if(OA.androidPackageChosen)AB(`✔ Android package — ${OA.androidPackageChosen.packageName}`);if(OA.serviceAccountProvisioned)AB(`✔ Service account — ${OA.serviceAccountProvisioned.email}`);if(OA.playInviteProvisioned)AB("✔ Service account invited to Play Console")},[Q,AB]),BM=_Q.useRef(q==="resume-prompt");_Q.useEffect(()=>{if(BM.current)return;Zq()},[]);let Xq=_Q.useCallback(async()=>{await VP(A).catch(()=>{}),qA(null),zA("choose"),fA(""),jA(""),CA(""),EQ(""),X0(""),V0(!1),KB([]),oQ(null),x0.current=!1,wA("choose"),A1(""),G8(null),a8(null),e0(""),K1(""),JA(""),IQ([]),C0(!1),vB(null),iB("actions"),o4([]),N1(null),x$(""),g6(null),K5([]),o$(null),U9.current=null,W5(!1),d4("choose"),s$.current=!1,t$(null),F9.current=!1,uJ(null),z9(null)},[A]),zJ=_Q.useCallback((OA,TA)=>{w.current=GQA(OA);let OQ=OA instanceof Error?OA.message:String(OA);if(r===0)b(OQ),l(TA),e(1),D("error");else AB(`✖ ${OQ}`,"red"),AB("Run `capgo build init --platform android` to resume.","yellow"),setTimeout(()=>wX(),100)},[r,AB,wX]),Gq=_Q.useCallback((OA,TA)=>{return W6("email"),U5.current=TA,N6(OA),D("support-confirm"),new Promise((OQ)=>{R6.current=OQ})},[]),PX=_Q.useCallback((OA)=>{return W6("ai-upload"),N6(OA),D("support-confirm"),new Promise((TA)=>{R6.current=TA})},[]),h3=_Q.useCallback(()=>{let OA=JK();if(!OA)return[];try{return tOA(OA,"utf8").split(`
|
|
1293
|
+
`),J=B.length,Y=$.length;if(J===0)return $.map((W)=>({kind:"add",text:W}));if(Y===0)return B.map((W)=>({kind:"del",text:W}));let Z=[];for(let W=0;W<=J;W+=1)Z.push(Array.from({length:Y+1}).fill(0));for(let W=1;W<=J;W+=1)for(let H=1;H<=Y;H+=1)if(B[W-1]===$[H-1])Z[W][H]=Z[W-1][H-1]+1;else Z[W][H]=Math.max(Z[W-1][H],Z[W][H-1]);let X=[],G=J,K=Y;while(G>0&&K>0)if(B[G-1]===$[K-1])X.unshift({kind:"eq",text:B[G-1]}),G-=1,K-=1;else if(Z[G-1][K]>Z[G][K-1])X.unshift({kind:"del",text:B[G-1]}),G-=1;else X.unshift({kind:"add",text:$[K-1]}),K-=1;while(G>0)X.unshift({kind:"del",text:B[G-1]}),G-=1;while(K>0)X.unshift({kind:"add",text:$[K-1]}),K-=1;return X}zr();k0();var eM0={"workflow-preview-prepared":"Build onboarding workflow preview prepared","workflow-preview-action":"Build onboarding workflow preview action","workflow-diff-opened":"Build onboarding workflow diff opened","workflow-diff-closed":"Build onboarding workflow diff closed","workflow-file-written":"Build onboarding workflow file written"};function FO(A,Q){let B=A.filter((Y)=>Y.kind==="add").length,$=A.filter((Y)=>Y.kind==="del").length;return{workflowState:A.length>0&&B===0&&$===0?"identical":Q?"new":"replace",diffLines:A.length,diffAdded:B,diffRemoved:$}}function _0A(A){AC0(A)}async function AC0(A){let Q=A.apikey?.trim()||W4();if(!Q)return;let B=await tE(Q,A.appId),$={"app-id":A.appId,platform:A.platform,"workflow-state":A.workflowState,"diff-lines":A.diffLines,"diff-added":A.diffAdded,"diff-removed":A.diffRemoved};if(A.journeyId)$.journey_id=A.journeyId;if(A.decision)$.decision=A.decision;if(A.packageManager)$["package-manager"]=A.packageManager;if(A.buildScriptType)$["build-script-type"]=A.buildScriptType;await jB(Q,{channel:"native-builder",event:eM0[A.event],org_id:B,tracking_version:2,tags:$})}function C3(A){if(A==="bun"||A==="npm"||A==="pnpm"||A==="yarn")return A;return"npm"}function HT(A,Q){let B=[],$=new Set;if(Q&&Object.hasOwn(A,Q))B.push({label:`${Q} (recommended — matches your project type)`,value:Q}),$.add(Q);let J=Object.keys(A).filter((Y)=>!$.has(Y)).sort((Y,Z)=>Y.localeCompare(Z));for(let Y of J)B.push({label:Y,value:Y});return B.push({label:"Type a custom command…",value:"__custom__"}),B.push({label:"Skip build step (my app is raw HTML)",value:"__skip__"}),B}q7();var S0A="https://cloudresourcemanager.googleapis.com/v1",nZQ="https://serviceusage.googleapis.com/v1",pOA="https://iam.googleapis.com/v1",aZQ=120000,QC0=2000,iOA="androidpublisher.googleapis.com",nOA="capgo-native-build",rZQ="Capgo Native Build",oZQ="Allows Capgo to build and submit the app to the Google Play Store";function sZQ(A){if(A.done===!0)return!0;return typeof A.name==="string"&&/\bnoop\.DONE_OPERATION\b/.test(A.name)}var BC0=30000;async function UO(A){let Q={Authorization:`Bearer ${A.accessToken}`,Accept:"application/json"};if(A.body!==void 0)Q["Content-Type"]="application/json";let B=A.timeoutMs??BC0,$=new AbortController,J=setTimeout(()=>$.abort(),B),Y;try{Y=await fetch(A.url,{method:A.method,headers:Q,body:A.body!==void 0?JSON.stringify(A.body):void 0,signal:$.signal})}catch(X){if(X?.name==="AbortError")throw Error(`Google API request to ${A.url} timed out after ${B}ms`);throw X}finally{clearTimeout(J)}let Z=await Y.text();if(!Y.ok){let X=Z;try{let G=JSON.parse(Z);if(G.error?.message)X=`${G.error.status??""}${G.error.status&&G.error.message?": ":""}${G.error.message}`}catch{}throw kB(`gcp-api ${A.method??"GET"} ${A.url}: HTTP ${Y.status} ${X} | ${YK(Y.headers)}`),Error(`Google API ${Y.status} at ${A.url}: ${X}`)}if(kB(`gcp-api ${A.method??"GET"} ${A.url}: HTTP ${Y.status} | ${YK(Y.headers)}`),!Z.trim())return;try{return JSON.parse(Z)}catch{throw Error(`Google API returned non-JSON at ${A.url}: ${Z.slice(0,200)}`)}}async function FT(A){let Q=[],B;do{let $=new URL(`${S0A}/projects`);if($.searchParams.set("pageSize","100"),$.searchParams.set("filter","lifecycleState:ACTIVE"),B)$.searchParams.set("pageToken",B);let J=await UO({method:"GET",url:$.toString(),accessToken:A});for(let Y of J.projects??[])if(Y.projectId&&Y.projectNumber&&Y.name&&Y.lifecycleState==="ACTIVE")Q.push(Y);B=J.nextPageToken}while(B);return Q.sort(($,J)=>$.name.localeCompare(J.name)),Q}async function Bm(A,Q,B,$={}){let J=await UO({method:"POST",url:`${S0A}/projects`,accessToken:A,body:{projectId:Q,name:B}});if(J.error)throw Error(`Project create failed: ${J.error.message} (code ${J.error.code})`);if(!sZQ(J))await tZQ(A,J.name,{endpoint:S0A,timeoutMs:$.timeoutMs??aZQ});return UO({method:"GET",url:`${S0A}/projects/${encodeURIComponent(Q)}`,accessToken:A})}async function $m(A,Q,B,$={}){let J=await UO({method:"POST",url:`${nZQ}/projects/${encodeURIComponent(Q)}/services/${encodeURIComponent(B)}:enable`,accessToken:A,body:{}});if(J.error)throw Error(`Enable ${B} failed: ${J.error.message} (code ${J.error.code})`);if(sZQ(J))return;await tZQ(A,J.name,{endpoint:nZQ,timeoutMs:$.timeoutMs??aZQ})}async function $C0(A,Q){let B=[],$;do{let J=new URL(`${pOA}/projects/${encodeURIComponent(Q)}/serviceAccounts`);if(J.searchParams.set("pageSize","100"),$)J.searchParams.set("pageToken",$);let Y=await UO({method:"GET",url:J.toString(),accessToken:A});B.push(...Y.accounts??[]),$=Y.nextPageToken}while($);return B}async function JC0(A){return UO({method:"POST",url:`${pOA}/projects/${encodeURIComponent(A.projectId)}/serviceAccounts`,accessToken:A.accessToken,body:{accountId:A.accountId,serviceAccount:{displayName:A.displayName,description:A.description}}})}async function Jm(A){let Q=await $C0(A.accessToken,A.projectId),B=`${A.accountId}@${A.projectId}.iam.gserviceaccount.com`,$=Q.find((Y)=>Y.email===B);if($)return{account:$,created:!1};return{account:await JC0(A),created:!0}}async function Ym(A){let Q=await UO({method:"POST",url:`${pOA}/projects/${encodeURIComponent(A.projectId)}/serviceAccounts/${encodeURIComponent(A.serviceAccountEmail)}/keys`,accessToken:A.accessToken,body:{privateKeyType:"TYPE_GOOGLE_CREDENTIALS_FILE",keyAlgorithm:"KEY_ALG_RSA_2048"}});if(!Q.privateKeyData)throw Error("Google did not return privateKeyData on the SA key — refusing to continue without the key file");return{name:Q.name,privateKeyDataBase64:Q.privateKeyData}}async function tZQ(A,Q,B){let $=Date.now()+B.timeoutMs;for(;;){let J=await UO({method:"GET",url:`${B.endpoint}/${Q}`,accessToken:A});if(J.done){if(J.error)throw Error(`Operation ${Q} failed: ${J.error.message} (code ${J.error.code})`);return J}if(Date.now()>$)throw Error(`Operation ${Q} did not finish within ${Math.round(B.timeoutMs/1000)}s`);await new Promise((Y)=>setTimeout(Y,QC0))}}function UT(A){let J=A.replace(/[^A-Z0-9 \-'!]/gi," ").replace(/\s+/g," ").trim().replace(/^[^A-Z0-9]+/i,"").replace(/[^A-Z0-9]+$/i,"").slice(0,30).replace(/[^A-Z0-9]+$/i,"");if(J.length<4)J="Capgo Build";return J}function k0A(A){let Y=A.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,17).replace(/-+$/,""),Z="abcdefghijkmnpqrstuvwxyz23456789",X="";for(let K=0;K<6;K++)X+="abcdefghijkmnpqrstuvwxyz23456789"[Math.floor(Math.random()*32)];return(Y?`capgo-${Y}-${X}`:`capgo-${X}`).slice(0,30).replace(/-+$/,"")}var FG=AQ(qP(),1);import{Buffer as aOA}from"node:buffer";import eZQ from"node:crypto";var YC0=27,ZC0=2048,XC0=24,GC0="keystore";function AXQ(A){let $=(String(A??"").split(/[/\\]+/).filter(Boolean).pop()??"").replace(/[^A-Za-z0-9._-]/g,"_");if($.length===0||/^\.+$/.test($))return GC0;return $}function b0A(){return eZQ.randomBytes(XC0).toString("base64url")}function Zm(A){if(!A.alias)throw Error("keystore alias is required");if(!A.storePassword)throw Error("keystore store password is required");if(!A.keyPassword)throw Error("keystore key password is required");if(!A.dname.commonName)throw Error("keystore common name is required");let Q=A.keySize??ZC0,B=A.validityYears??YC0,$=FG.default.pki.rsa.generateKeyPair(Q),J=FG.default.pki.createCertificate();J.publicKey=$.publicKey,J.serialNumber=eZQ.randomBytes(16).toString("hex");let Y=new Date,Z=new Date(Y);Z.setFullYear(Y.getFullYear()+B),J.validity.notBefore=Y,J.validity.notAfter=Z;let X=[{name:"commonName",value:A.dname.commonName}];if(A.dname.organizationName)X.push({name:"organizationName",value:A.dname.organizationName});if(A.dname.countryCode)X.push({name:"countryName",value:A.dname.countryCode});J.setSubject(X),J.setIssuer(X),J.sign($.privateKey,FG.default.md.sha256.create());let G=FG.default.pkcs12.toPkcs12Asn1($.privateKey,[J],A.storePassword,{algorithm:"3des",friendlyName:A.alias}),K=FG.default.asn1.toDer(G).getBytes(),W=aOA.from(K,"binary");return{p12Base64:FG.default.util.encode64(K),p12Bytes:W,alias:A.alias,notAfter:Z}}function Rz(A,Q){try{let B=aOA.from(A).toString("binary"),$=FG.default.asn1.fromDer(B),J;try{J=FG.default.pkcs12.pkcs12FromAsn1($,Q)}catch(X){let G=X instanceof Error?X.message:String(X);return{ok:!1,reason:/PKCS#?12 MAC|Invalid password|mac could not be verified/i.test(G)?"wrong-password":"parse-error",message:G}}if(J.getBags({bagType:FG.default.pki.oids.pkcs8ShroudedKeyBag})[FG.default.pki.oids.pkcs8ShroudedKeyBag]?.[0]?.key)return{ok:!0};return{ok:!1,reason:"no-private-key",message:"PKCS#12 unlocked but did not contain a decryptable private key bag"}}catch(B){return{ok:!1,reason:"unsupported-format",message:B instanceof Error?B.message:"not a PKCS#12 file"}}}function Xm(A,Q){try{let B=aOA.from(A).toString("binary"),$=FG.default.asn1.fromDer(B),J;try{J=FG.default.pkcs12.pkcs12FromAsn1($,Q)}catch(Z){let X=Z instanceof Error?Z.message:String(Z);return{ok:!1,reason:/PKCS#?12 MAC|Invalid password|mac could not be verified/i.test(X)?"wrong-password":"parse-error",message:X}}let Y=new Set;for(let Z of J.safeContents)for(let X of Z.safeBags){let G=X.attributes?.friendlyName;if(Array.isArray(G)){for(let K of G)if(typeof K==="string"&&K.length>0)Y.add(K)}}return{ok:!0,aliases:[...Y]}}catch(B){return{ok:!1,reason:"unsupported-format",message:B instanceof Error?B.message:"not a PKCS#12 file"}}}var zT=[...tzA,"https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/playdeveloperreporting"],Gm=[...tzA,"https://www.googleapis.com/auth/cloud-platform"];aG();q7();ZL();import KC0 from"node:process";var WC0="https://api.capgo.app/private/config/builder",HC0="CAPGO_BUILDER_CONFIG_URL",rOA="https://www.youtube.com/watch?v=Y1_Ngj8hHLU";async function x0A(){let A=KC0.env[HC0]||WC0,Q=await fetch(A,{method:"GET",headers:{Accept:"application/json"}});if(!Q.ok){let $=await Q.text().catch(()=>"");throw Error(`Capgo builder config fetch failed (${Q.status} from ${A}): ${$.slice(0,200)}`)}let B;try{B=await Q.json()}catch{throw Error(`Capgo builder config returned non-JSON from ${A}`)}if(!B.enabled)return null;if(!B.clientId||!B.clientSecret)throw Error("Capgo builder config returned enabled=true but is missing clientId/clientSecret");return{clientId:B.clientId,clientSecret:B.clientSecret,scopes:B.scopes&&B.scopes.length>0?B.scopes:["https://www.googleapis.com/auth/androidpublisher"]}}q7();var FC0="https://androidpublisher.googleapis.com/androidpublisher/v3",f0A="https://play.google.com/console/u/0/developers/";function oOA(A){return/^\d{10,25}$/.test(A.trim())}function qT(A){let Q=A.trim().replace(/^['"]|['"]$/g,"");if(!Q)return null;if(oOA(Q))return Q;let B=Q.match(/\/developers\/(\d{10,25})(?:[/?#]|$)/);if(B&&oOA(B[1]))return B[1];let $=Q.match(/\d{10,25}/);if($&&oOA($[0]))return $[0];return null}var QXQ=["CAN_MANAGE_DRAFT_APPS_GLOBAL"],BXQ=["CAN_ACCESS_APP","CAN_MANAGE_DRAFT_APPS","CAN_MANAGE_TRACK_APKS","CAN_MANAGE_PUBLIC_APKS"];async function UC0(A){let Q={Authorization:`Bearer ${A.accessToken}`,Accept:"application/json"};if(A.body!==void 0)Q["Content-Type"]="application/json";let B=await fetch(A.url,{method:A.method,headers:Q,body:A.body!==void 0?JSON.stringify(A.body):void 0}),$=await B.text();if(!B.ok){let J=$;try{let Y=JSON.parse($);if(Y.error?.message)J=`${Y.error.status??""}${Y.error.status&&Y.error.message?": ":""}${Y.error.message}`}catch{}throw kB(`play-api ${A.method} ${A.url}: HTTP ${B.status} ${J} | ${YK(B.headers)}`),Error(`Play API ${B.status} at ${A.url}: ${J}`)}if(kB(`play-api ${A.method} ${A.url}: HTTP ${B.status} | ${YK(B.headers)}`),!$.trim())return;try{return JSON.parse($)}catch{throw Error(`Play API returned non-JSON at ${A.url}: ${$.slice(0,200)}`)}}async function Km(A){let Q={email:A.serviceAccountEmail};if(A.developerAccountPermissions?.length)Q.developerAccountPermissions=A.developerAccountPermissions;if(A.grants?.length)Q.grants=A.grants.map((B)=>({packageName:B.packageName,appLevelPermissions:B.permissions}));return UC0({method:"POST",url:`${FC0}/developers/${encodeURIComponent(A.developerId)}/users`,accessToken:A.accessToken,body:Q})}var cF={welcome:0,"resume-prompt":2,"credentials-exist":0,"backing-up":0,"no-platform":0,"keystore-method-select":5,"keystore-explainer":5,"keystore-existing-path":8,"keystore-existing-picker":8,"keystore-existing-store-password":10,"keystore-existing-detecting-alias":12,"keystore-existing-alias-select":13,"keystore-existing-alias":13,"keystore-existing-key-password":14,"keystore-new-alias":8,"keystore-new-password-method":10,"keystore-new-store-password":12,"keystore-new-key-password":14,"keystore-new-cn":16,"keystore-generating":20,"service-account-method-select":22,"sa-json-existing-path":28,"sa-json-existing-picker":28,"sa-json-validating":70,"sa-json-validation-failed":70,"google-sign-in":25,"google-sign-in-running":35,"play-developer-id-input":48,"gcp-projects-loading":55,"gcp-projects-select":58,"gcp-project-create-name":60,"android-package-select":65,"android-app-verify":67,"gcp-setup-running":70,"saving-credentials":85,"detecting-ci-secrets":86,"ci-secrets-setup":86,"ci-secrets-target-select":86,"ask-ci-secrets":86,"checking-ci-secrets":87,"confirm-ci-secret-overwrite":87,"uploading-ci-secrets":88,"ci-secrets-failed":88,"ask-github-actions-setup":86,"confirm-secrets-push":87,"ask-export-env":96,"exporting-env":96,"confirm-env-export-overwrite":96,"overwrite-and-export-env":96,"pick-package-manager":95,"pick-build-script":96,"pick-build-script-custom":96,"preview-workflow-file":97,"view-workflow-diff":97,"writing-workflow-file":98,"ask-build":90,"requesting-build":95,"build-log-view":96,"ai-analysis-prompt":96,"ai-analysis-running":98,"ai-analysis-result-scroll":98,"ai-analysis-result":99,"build-complete":100,error:0,"support-confirm":0,"support-log-view":0,"support-uploading":0};function sOA(A){switch(A){case"welcome":case"credentials-exist":case"backing-up":case"no-platform":return"";case"resume-prompt":return"Resume or restart?";case"keystore-method-select":case"keystore-explainer":case"keystore-existing-path":case"keystore-existing-picker":case"keystore-existing-store-password":case"keystore-existing-detecting-alias":case"keystore-existing-alias-select":case"keystore-existing-alias":case"keystore-existing-key-password":case"keystore-new-alias":case"keystore-new-password-method":case"keystore-new-store-password":case"keystore-new-key-password":case"keystore-new-cn":case"keystore-generating":return"Step 1 of 4 · Keystore";case"service-account-method-select":return"Step 2 of 4 · Service account";case"sa-json-existing-path":case"sa-json-existing-picker":case"sa-json-validating":case"sa-json-validation-failed":return"Step 3 of 4 · Service account";case"google-sign-in":case"google-sign-in-running":return"Step 2 of 4 · Sign in with Google";case"play-developer-id-input":return"Step 3 of 4 · Play Developer Account";case"gcp-projects-loading":case"gcp-projects-select":case"gcp-project-create-name":case"android-package-select":case"android-app-verify":case"gcp-setup-running":return"Step 3 of 4 · Google Cloud Project";case"saving-credentials":case"detecting-ci-secrets":case"ci-secrets-setup":case"ci-secrets-target-select":case"ask-ci-secrets":case"ask-github-actions-setup":case"confirm-secrets-push":case"checking-ci-secrets":case"confirm-ci-secret-overwrite":case"uploading-ci-secrets":case"ci-secrets-failed":case"ask-export-env":case"exporting-env":case"confirm-env-export-overwrite":case"overwrite-and-export-env":case"pick-package-manager":case"pick-build-script":case"pick-build-script-custom":case"preview-workflow-file":case"view-workflow-diff":case"writing-workflow-file":case"ask-build":case"requesting-build":return"Step 4 of 4 · Save & Build";case"ai-analysis-prompt":case"ai-analysis-running":case"ai-analysis-result":case"ai-analysis-result-scroll":case"build-log-view":return"AI debug";case"build-complete":return"Complete";case"error":case"support-confirm":case"support-log-view":case"support-uploading":return""}}import{homedir as YXQ}from"node:os";import{join as ZXQ}from"node:path";function v0A(A){let Q=A.apps.find((B)=>B.bundleId===A.releaseBundleId)??null;if(Q)return{result:"exact-match",matchedApp:Q};if(A.apps.length>0)return{result:"wrong-build-id",matchedApp:null};if(A.registeredBundleIds.includes(A.releaseBundleId))return{result:"no-app-identifier-exists",matchedApp:null};return{result:"no-app-unregistered",matchedApp:null}}var zC0=3;function Wm(A){if(A.satisfied)return{proceed:!0,escalationLevel:0};return{proceed:!1,escalationLevel:Math.min(A.attempt,zC0)}}function $XQ(A){let{gradleIds:Q,apps:B}=A,$=B.map((Y)=>({bundleId:Y.packageName,name:Y.displayName}));if(Q.length<=1){let Y=Q[0]??"";if(!Y)return B.length>0?{kind:"wrong-build-id"}:{kind:"no-app"};let{result:Z}=v0A({releaseBundleId:Y,apps:$,registeredBundleIds:[]});if(Z==="exact-match")return{kind:"exact-match",packageName:Y};if(Z==="wrong-build-id")return{kind:"wrong-build-id"};return{kind:"no-app"}}let J=Q.filter((Y)=>$.some((Z)=>Z.bundleId===Y));if(J.length===1)return{kind:"exact-match",packageName:J[0]};if(B.length===0)return{kind:"no-app"};return{kind:"multi-gradle"}}k0();var qC0=[{value:"retry",label:"I installed and logged in, check again"},{value:"skip",label:"Skip upload"}],DC0=[{value:"replace",label:"Replace existing env vars"},{value:"skip",label:"Skip upload"}],IC0=[{value:"retry",label:"Try upload again"},{value:"continue",label:"Continue without upload"}],OC0=[{value:"with-workflow",label:"\uD83D\uDE80 Yes — set the secrets AND create a workflow file"},{value:"secrets-only",label:"\uD83D\uDD12 Yes — set ONLY the secrets"},{value:"no",label:"❌ No"}],MC0=[{value:"replace",label:"✏️ Replace it"},{value:"skip",label:"\uD83D\uDED1 Skip — keep the existing file"}],CC0=[{value:"bun",label:"\uD83D\uDCE6 bun"},{value:"npm",label:"\uD83D\uDCE6 npm"},{value:"pnpm",label:"\uD83D\uDCE6 pnpm"},{value:"yarn",label:"\uD83D\uDCE6 yarn"}],LC0=[{value:"write",label:"✏️ Write file"},{value:"view",label:"\uD83D\uDC40 Show proposed file diff"},{value:"cancel",label:"❌ Do not write file"}],VC0=[{value:"close",label:"Close diff"}],NC0=[{value:"yes",label:"\uD83D\uDE80 Yes, request a build"},{value:"no",label:"⏭ Not now"}],RC0=[{value:"__custom__",label:"Type a custom command…"},{value:"__skip__",label:"Skip build step (my app is raw HTML)"}],EC0={"saving-credentials":"auto","detecting-ci-secrets":"auto","ci-secrets-setup":"auto","ci-secrets-target-select":"choice","ask-ci-secrets":"choice","checking-ci-secrets":"auto","confirm-ci-secret-overwrite":"choice","uploading-ci-secrets":"auto","ci-secrets-failed":"error","ask-github-actions-setup":"choice","confirm-secrets-push":"choice","ask-export-env":"choice","exporting-env":"auto","confirm-env-export-overwrite":"choice","overwrite-and-export-env":"auto","pick-package-manager":"choice","pick-build-script":"choice","pick-build-script-custom":"input","preview-workflow-file":"choice","view-workflow-diff":"choice","writing-workflow-file":"auto","ask-build":"choice","requesting-build":"auto","build-complete":"done"};function zO(A,Q,B){let $={step:A,kind:EC0[A]};switch(A){case"ci-secrets-setup":return{...$,title:"Set up your git hosting CLI to upload env vars",options:qC0};case"ci-secrets-target-select":{let J=(B.ciSecretTargets??[]).map((Y)=>({value:Y.provider,label:Y.provider==="github"?"GitHub Actions repository secrets":"GitLab CI/CD variables"}));return{...$,prompt:"Where should Capgo upload the build env vars?",options:[...J,{value:"skip",label:"Skip"}]}}case"ask-ci-secrets":{let J=B.ciSecretEntries?.length??0,Y=Mz(Q?.ciSecretTarget??null),Z=Q?.ciSecretTarget?.cli||"CLI";return{...$,prompt:`Upload ${J} build env var${J===1?"":"s"} to ${Y}?`,options:[{value:"yes",label:`Upload with ${Z}`},{value:"no",label:"Skip"}]}}case"confirm-ci-secret-overwrite":return{...$,prompt:"These env vars already exist and will be replaced:",options:DC0};case"ci-secrets-failed":return{...$,message:"Could not upload env vars.",options:IC0};case"ask-github-actions-setup":return{...$,prompt:"Set up GitHub Actions for you?",options:OC0};case"confirm-secrets-push":{let J=B.ciSecretRepoLabel??"the repository";return{...$,prompt:`Confirm before pushing secrets to ${J}`,options:[{value:"confirm",label:`Yes, push to ${J}`},{value:"cancel",label:"Cancel — don't push anything"}]}}case"ask-export-env":{let J=(B.defaultEnvExportPath??"").split("/").slice(-1)[0],Y=J?`\uD83D\uDCDD Yes — write ${J}`:"\uD83D\uDCDD Yes — write the .env file";return{...$,prompt:"Export the credentials as a .env file instead?",options:[{value:"yes",label:Y},{value:"no",label:"❌ No, exit without exporting"}]}}case"confirm-env-export-overwrite":{let J=Q?.envExportTargetPath??B.defaultEnvExportPath??"the file";return{...$,prompt:`${J} already exists. Replace it with a fresh export, or skip?`,options:MC0}}case"pick-package-manager":{let J=B.detectedPackageManager,Y=CC0.map((Z)=>J&&Z.value===J?{...Z,label:`${Z.label} (recommended — matches your lockfile)`}:Z);return{...$,prompt:"Which package manager does this project use?",options:Y}}case"pick-build-script":{let J=B.availableScripts?HT(B.availableScripts,B.recommendedScript??null).map((Y)=>({value:Y.value,label:Y.label})):RC0;return{...$,prompt:"Which script builds your web assets?",options:J}}case"pick-build-script-custom":return{...$,prompt:"Custom build command",collect:["buildScriptCustomCommand"]};case"preview-workflow-file":return{...$,prompt:`What should we do with ${_$}?`,options:LC0};case"view-workflow-diff":return{...$,title:"Proposed workflow diff",options:VC0};case"ask-build":return{...$,prompt:"Request a build now?",options:NC0};case"build-complete":return{...$,message:"Build complete."};default:return $}}function UG(A,Q,B){switch(A){case"ci-secrets-target-select":return{...Q,ciSecretTarget:B.ciSecretTarget};case"ask-github-actions-setup":{let $=B,J=$.value==="no"?"declined":$.value;return{...Q,setupMode:J}}case"ask-export-env":{let $=B;if($.value==="yes")return{...Q,envExportTargetPath:$.envExportTargetPath};return Q}case"pick-package-manager":return{...Q,selectedPackageManager:B.selectedPackageManager};case"pick-build-script":{let $=B;if("buildScriptChoice"in $)return{...Q,buildScriptChoice:$.buildScriptChoice};return Q}case"pick-build-script-custom":{let J=B.command.trim();if(!J)return Q;return{...Q,buildScriptChoice:{type:"custom",command:J}}}default:return Q}}function JXQ(A,Q){let B=Q.carried?.savedCredentials;if(B&&Object.keys(B).length>0)return B;return Q.rebuildTailCredentials(A)}function y0A(A,Q){let B=Q.carried?.ciSecretEntries;if(B)return B;if(!Q.createCiSecretEntries)return[];let $=Q.rebuildTailCredentials(A);if(Object.keys($).length===0)return[];return Q.createCiSecretEntries($)}async function jC0(A){if(!A.getPackageScripts)return{};try{let Q=A.getPackageScripts()??{},B=null;if(A.findProjectType){let $=await A.findProjectType({quiet:!0}).catch((J)=>{return A.onInternalLog?.(`project-type detection failed, no recommended script: ${J instanceof Error?J.message:String(J)}`),null});if($&&A.findBuildCommandForProjectType){let J=await A.findBuildCommandForProjectType($).catch((Y)=>{return A.onInternalLog?.(`build-command lookup failed for "${$}", no recommended script: ${Y instanceof Error?Y.message:String(Y)}`),null});if(J&&Object.hasOwn(Q,J))B=J}}return{availableScripts:Q,recommendedScript:B}}catch(Q){return A.onInternalLog?.(`build-script detection failed, falling back to manual entry: ${Q instanceof Error?Q.message:String(Q)}`),{}}}async function DT(A,Q,B){switch(A){case"saving-credentials":{let $;try{$=await B.buildSavedCredentials(Q)}catch(Y){let Z=Y instanceof Error?Y.message:String(Y),X=await B.loadProgress(Q.appId);if(X){let G=B.resumeStep(X);if(G!=="saving-credentials")return B.onInternalLog?.(`saving-credentials build failed (diverting to ${G}): ${Z}`),B.onLog?.(`ℹ Some required input was missing — sending you back to fill it in. (${Z})`,"yellow"),{progress:Q,next:G}}throw Y}if(await B.updateSavedCredentials(Q.appId,B.platform,$),await B.deleteProgress(Q.appId),B.onLog?.("✔ Credentials saved"),Q.keystorePasswordGenerated)B.onLog?.(" ℹ Your auto-generated keystore password is now in ~/.capgo-credentials/credentials.json — back up that file.","yellow");let J=B.createCiSecretEntries?.($)??[];return{progress:Q,next:"ask-build",transient:{ciSecretEntries:J,savedCredentials:$}}}case"detecting-ci-secrets":{let $=B.detectCiSecretTargets(),J={ciSecretTargets:$.targets,ciSecretSetupAdvice:$.setup};if($.targets.length===0){if($.setup.length>0)return{progress:Q,next:"ci-secrets-setup",transient:J};for(let Y of $.notes)B.onLog?.(`ℹ ${Y}`,"yellow");return{progress:Q,next:"build-complete",transient:J}}if($.targets.length===1){let Y=$.targets[0],Z={...Q,ciSecretTarget:Y},X=Y.provider==="github"?"ask-github-actions-setup":"ask-ci-secrets";return{progress:Z,next:X,transient:J}}return{progress:Q,next:"ci-secrets-target-select",transient:J}}case"checking-ci-secrets":{let $=(J)=>{return B.onCiSecretError?.(J),{progress:Q,next:"ci-secrets-failed",transient:{ciSecretError:J}}};try{let J=Q.ciSecretTarget;if(!J)throw Error("No git hosting target selected.");let Y=(W)=>{B.onCiSecretCheckPhase?.(W)};Y("Resolving GitHub repository…");let Z=null;if(J.provider==="github"){if(Z=await B.getCiSecretRepoLabelAsync(J),!Z)return B.onCiSecretError?.("Could not resolve the GitHub repository. Run `gh repo view` from this directory, then try again."),{progress:Q,next:"ci-secrets-failed",transient:{ciSecretRepoLabel:null,ciSecretError:"Could not resolve the GitHub repository. Run `gh repo view` from this directory, then try again."}}}Y(Z?`Checking existing env vars in ${Z}…`:`Checking existing env vars in ${Mz(J)}…`);let X=y0A(Q,B),G=await B.listExistingCiSecretKeysAsync(J,X.map((W)=>W.key));if(J.provider==="github")return{progress:Q,next:"confirm-secrets-push",transient:{ciSecretRepoLabel:Z,ciSecretExistingKeys:G,ciSecretEntries:X}};let K=G.length>0?"confirm-ci-secret-overwrite":"uploading-ci-secrets";return{progress:Q,next:K,transient:{ciSecretExistingKeys:G,ciSecretEntries:X}}}catch(J){return $(J instanceof Error?J.message:String(J))}}case"uploading-ci-secrets":{let $=Q.ciSecretTarget;if(!$)throw Error("No git hosting target selected.");let J=y0A(Q,B);await B.uploadCiSecretsAsync($,J,B.carried?.ciSecretExistingKeys,void 0,B.onCiSecretUploadProgress);let Y=`Uploaded ${J.length} env var${J.length===1?"":"s"} to ${$.label}`;if(B.onLog?.(`✔ ${Y}`),Q.setupMode==="with-workflow"){let Z=await jC0(B);return{progress:Q,next:"pick-package-manager",transient:{ciSecretUploadSummary:Y,...Z}}}return{progress:Q,next:"build-complete",transient:{ciSecretUploadSummary:Y}}}case"exporting-env":try{let $=Q.envExportTargetPath||B.defaultExportPath(Q.appId,B.platform),J=B.exportCredentialsToEnv({appId:Q.appId,platform:B.platform,credentials:JXQ(Q,B),targetPath:$});if(J.kind==="empty")return{progress:Q,next:"build-complete",transient:{envExportError:"No credentials to export — saved state is empty."}};if(J.kind==="exists")return{progress:{...Q,envExportTargetPath:J.path},next:"confirm-env-export-overwrite"};return B.onLog?.(`✔ Exported ${J.fieldCount} field${J.fieldCount===1?"":"s"} → ${J.path}`),{progress:Q,next:"build-complete",transient:{envExportPath:J.path}}}catch($){return{progress:Q,next:"build-complete",transient:{envExportError:$ instanceof Error?$.message:String($)}}}case"overwrite-and-export-env":try{let $=B.exportCredentialsToEnv({appId:Q.appId,platform:B.platform,credentials:JXQ(Q,B),targetPath:Q.envExportTargetPath,overwrite:!0});if($.kind==="written")return B.onLog?.(`✔ Overwrote ${$.path} with ${$.fieldCount} field${$.fieldCount===1?"":"s"}`),{progress:Q,next:"build-complete",transient:{envExportPath:$.path}};return{progress:Q,next:"build-complete"}}catch($){return{progress:Q,next:"build-complete",transient:{envExportError:$ instanceof Error?$.message:String($)}}}case"writing-workflow-file":{let $=Q.buildScriptChoice;if(!$)throw Error("Internal error: no build script choice recorded.");let J=y0A(Q,B),Y=B.writeWorkflowFile({appId:Q.appId,defaultPlatform:B.platform,packageManager:Q.selectedPackageManager??"npm",buildScript:$,secretKeys:J.map((Z)=>Z.key)},{overwrite:!0});if(Y.kind==="written"){let Z=B.carried?.workflowIsNew===!1?"Overwrote":"Wrote";return B.onLog?.(`✔ ${Z} ${_$}`),B.trackWorkflowEvent?.("workflow-file-written",{decision:"write"}),{progress:Q,next:"build-complete",transient:{workflowFilePath:Y.absolutePath}}}return{progress:Q,next:"build-complete"}}case"requesting-build":{if(B.signal?.aborted)return{progress:Q};let $="";if(B.resolveApikey){let J=B.resolveApikey();if(!J)return B.onBuildOutput?.("⚠ No Capgo API key found."),B.onBuildOutput?.(`Run \`capgo login\` first, then \`capgo build request --platform ${B.platform}\`.`),{progress:Q,next:"build-complete"};$=J}B.onBuildOutput?.(`Requesting build for ${Q.appId} (${B.platform})...`);try{let J=await B.requestBuildInternal(Q.appId,{apikey:$,platform:B.platform,aiAnalysisMode:"caller-handled"},!0,B.logger);if(B.signal?.aborted)return{progress:Q};if(J.success){let Y=o7(`/app/${Q.appId}/builds`);B.onBuildOutput?.(""),B.onBuildOutput?.(`✔ Build queued — ${Y}`);let Z=y0A(Q,B);if(Z.length>0)return{progress:Q,next:"detecting-ci-secrets",transient:{buildUrl:Y,ciSecretEntries:Z}};return{progress:Q,next:"build-complete",transient:{buildUrl:Y}}}if(B.onBuildOutput?.(`⚠ ${J.error||"unknown error"}`),J.aiAnalysis?.ready&&J.aiAnalysis.jobId)return{progress:Q,next:"ai-analysis-prompt",transient:{aiJobId:J.aiAnalysis.jobId}};return{progress:Q,next:"build-complete"}}catch(J){if(B.signal?.aborted)return{progress:Q};let Y=J instanceof Error?J.message:String(J);return B.onBuildOutput?.(`⚠ ${Y}`),B.onBuildOutput?.(`Your credentials are saved. Run \`capgo build request --platform ${B.platform}\` to try again.`),{progress:Q,next:"build-complete",transient:{error:Y}}}}default:throw Error(`Unhandled tail effect step: ${A}`)}}function wC0(A,Q,B){return{...A,_oauthRefreshToken:Q.refreshToken,completedSteps:{...A.completedSteps,googleSignInComplete:{email:B.email,googleSubject:B.sub,scope:Q.scope}}}}function XXQ(A,Q,B,$){return{...A,_oauthAccessToken:Q,_oauthAccessTokenExpiresAt:B??void 0,completedSteps:{...A.completedSteps,googleSignInComplete:{email:$.email,googleSubject:$.sub,scope:""}}}}var PC0={welcome:"auto","resume-prompt":"auto","ai-analysis-prompt":"auto","ai-analysis-running":"auto","ai-analysis-result":"auto","ai-analysis-result-scroll":"auto","build-log-view":"auto","support-confirm":"choice","support-log-view":"auto","support-uploading":"auto","credentials-exist":"choice","backing-up":"auto","no-platform":"error","keystore-method-select":"choice","keystore-explainer":"choice","keystore-existing-path":"choice","keystore-existing-picker":"auto","keystore-existing-store-password":"input","keystore-existing-detecting-alias":"auto","keystore-existing-alias-select":"choice","keystore-existing-alias":"input","keystore-existing-key-password":"input","keystore-new-alias":"input","keystore-new-password-method":"choice","keystore-new-store-password":"input","keystore-new-key-password":"input","keystore-new-cn":"input","keystore-generating":"auto","service-account-method-select":"choice","sa-json-existing-path":"choice","sa-json-existing-picker":"auto","sa-json-validating":"auto","sa-json-validation-failed":"choice","google-sign-in":"choice","google-sign-in-running":"auto","play-developer-id-input":"choice","gcp-projects-loading":"auto","gcp-projects-select":"choice","gcp-project-create-name":"input","android-package-select":"auto","gcp-setup-running":"auto","saving-credentials":"auto","detecting-ci-secrets":"auto","ci-secrets-setup":"auto","ci-secrets-target-select":"choice","ask-ci-secrets":"choice","checking-ci-secrets":"auto","confirm-ci-secret-overwrite":"choice","uploading-ci-secrets":"auto","ci-secrets-failed":"error","ask-github-actions-setup":"choice","confirm-secrets-push":"choice","ask-export-env":"choice","exporting-env":"auto","confirm-env-export-overwrite":"choice","overwrite-and-export-env":"auto","pick-package-manager":"choice","pick-build-script":"choice","pick-build-script-custom":"input","preview-workflow-file":"choice","view-workflow-diff":"choice","writing-workflow-file":"auto","ask-build":"choice","requesting-build":"auto","build-complete":"done",error:"error","android-app-verify":"auto"},TC0=[{value:"existing",label:"Yes, I have one"},{value:"generate",label:"No, create one for me"},{value:"learn",label:"What is a keystore?"}],_C0=[{value:"backup",label:"Start fresh (backup existing credentials first)"},{value:"cancel",label:"Exit onboarding"}],SC0=[{value:"back",label:"Back"}],kC0=[{value:"picker",label:"Open file picker"},{value:"manual",label:"Type the path"}],bC0=[{value:"random",label:"Generate a random password (recommended)"},{value:"manual",label:"I'll type my own password"}],xC0=[{value:"generate",label:"Set it up for me (recommended) — I sign in with Google once and Capgo configures Play access automatically"},{value:"existing",label:"I already have a Google Play service-account JSON file to use"}],fC0=[{value:"picker",label:"Open file picker"},{value:"manual",label:"Type the path"}],vC0=[{value:"retry",label:"Try a different service account JSON file"},{value:"save-anyway",label:"Save anyway (skip validation)"},{value:"oauth",label:"Set one up for me via Google instead"}],yC0=[{value:"go",label:"Continue to Google sign-in"},{value:"learn",label:"Learn why the onboarding via Google is secure"},{value:"exit",label:"Exit (I'll do it later)"}],gC0=[{value:"open",label:"Open Play Console in browser"},{value:"tutorial",label:"Show me how to find the developer ID"},{value:"manual",label:"I'll type it now"}],hC0={value:"__new__",label:"Create a new project"};function IT(A,Q,B){if(dC0.has(A))return iC0(zO(A,Q,B),A);let $=A==="android-package-select"?B.detectedPackageIds===void 0?"auto":B.detectedPackageIds.length>0?"choice":"input":A==="android-app-verify"?B.playVerifyOutcome===void 0?"auto":"choice":PC0[A],J={step:A,kind:$};switch(A){case"no-platform":return{...J,message:"No Android platform found. Run `npx cap add android` first."};case"credentials-exist":return{...J,options:_C0};case"keystore-method-select":return{...J,options:TC0};case"keystore-explainer":return{...J,options:SC0};case"keystore-existing-path":return{...J,options:kC0};case"keystore-existing-store-password":return{...J,prompt:"Keystore store password",collect:["keystoreStorePassword"]};case"keystore-existing-alias-select":{let Y=B.detectedAliases??[];return{...J,options:Y.map((Z)=>({value:Z,label:Z}))}}case"keystore-existing-alias":return{...J,prompt:"Keystore alias",collect:["keystoreAlias"]};case"keystore-existing-key-password":return{...J,prompt:"Keystore key password",collect:["keystoreKeyPassword"]};case"keystore-new-alias":return{...J,prompt:"Key alias (e.g. release)",collect:["keystoreAlias"]};case"keystore-new-password-method":return{...J,options:bC0};case"keystore-new-store-password":return{...J,prompt:"Store password (min 6 chars)",collect:["keystoreStorePassword"]};case"keystore-new-key-password":return{...J,prompt:"Key password",collect:["keystoreKeyPassword"]};case"keystore-new-cn":return{...J,prompt:"Common name (e.g. your app ID)",collect:["keystoreCommonName"]};case"service-account-method-select":return{...J,options:xC0};case"sa-json-existing-path":return{...J,options:fC0};case"sa-json-validation-failed":{let Y=B.saValidation&&!B.saValidation.ok?B.saValidation.message:void 0;return{...J,options:vC0,message:Y}}case"google-sign-in":return{...J,options:yC0};case"play-developer-id-input":return{...J,options:gC0};case"gcp-projects-select":{let Y=(B.gcpProjects??[]).map((Z)=>({value:Z.projectId,label:Z.name,note:Z.projectNumber}));return{...J,options:[...Y,hC0]}}case"gcp-project-create-name":return{...J,prompt:"New GCP project display name",collect:["pendingNewProjectDisplayName"]};case"android-package-select":{if($==="choice"&&B.detectedPackageIds&&B.detectedPackageIds.length>0){let Y=new Set(B.detectedPackageIds),Z=B.playVerifyApps?new Set(B.playVerifyApps.map((K)=>K.packageName)):null,X=B.detectedPackageIds.map((K)=>({value:K,label:K,...Z?{note:Z.has(K)?"✓ exists in Play Store":"⚠ not in Play Store yet"}:{}})),G=(B.playVerifyApps??[]).filter((K)=>!Y.has(K.packageName)).map((K)=>({value:K.packageName,label:K.displayName?`${K.packageName} (${K.displayName})`:K.packageName,note:"✓ exists in Play Store"}));return{...J,options:[...X,...G]}}return J}case"android-app-verify":{if($==="choice"){let Y=Q?.completedSteps.androidPackageChosen?.packageName??"your package";if(B.playVerifyOutcome==="wrong-build-id")return{...J,message:`None of your Play Store apps match "${Y}". Pick a different package (the applicationId your app is actually published under), or create "${Y}" in Play Console (https://play.google.com/console). Capgo grants your build access to that exact package, so it must exist before Play upload. If you only need the AAB (no Play upload yet), cancel and run: npx @capgo/cli@latest build request --platform android --no-playstore-upload --output-upload`,options:[{value:"recheck",label:"Re-check (I fixed the package / created the app)"},{value:"proceed",label:"The app exists, proceed anyway"},{value:"open",label:"Open Play Console"},{value:"cancel",label:"Cancel onboarding"}]};return{...J,message:`No Play Store app exists yet for "${Y}". Create it once in Play Console (https://play.google.com/console), then re-check. Capgo grants your build access to that exact package, so it must exist before Play upload. If you only need the AAB (no Play upload yet), cancel and run: npx @capgo/cli@latest build request --platform android --no-playstore-upload --output-upload`,options:[{value:"open",label:"Open Play Console to create this app"},{value:"recheck",label:"I've created it, re-check"},{value:"proceed",label:"I've already created it, proceed anyway"},{value:"cancel",label:"Cancel onboarding"}]}}return J}case"error":return{...J,message:"An error occurred. Check the details above."};default:return J}}var g0A="release";function YJ(A,Q,B){if(lC0.has(A))return UG(A,Q,B);switch(A){case"credentials-exist":{if(B.value==="backup")return{...Q,_credentialsExistGate:"backup"};return{...Q,_credentialsExistGate:"cancel"}}case"keystore-method-select":{let $=B;if($.value==="existing")return{...Q,keystoreMethod:"existing"};if($.value==="generate")return{...Q,keystoreMethod:"generate"};return Q}case"keystore-existing-path":return{...Q,keystoreExistingPath:B.path};case"keystore-existing-store-password":return{...Q,keystoreStorePassword:B.password};case"keystore-existing-alias-select":return{...Q,keystoreAlias:B.alias};case"keystore-existing-alias":{let J=B.alias.trim()||g0A;return{...Q,keystoreAlias:J}}case"keystore-existing-key-password":{let J=B.password||Q.keystoreStorePassword||"";return{...Q,keystoreKeyPassword:J}}case"keystore-new-alias":{let J=B.alias.trim()||g0A;return{...Q,keystoreAlias:J}}case"keystore-new-password-method":{if(B.value==="random"){let J=b0A();return{...Q,keystoreStorePassword:J,keystoreKeyPassword:J,keystorePasswordGenerated:!0}}return{...Q,keystorePasswordManual:!0}}case"keystore-new-store-password":return{...Q,keystoreStorePassword:B.password};case"keystore-new-key-password":{let J=B.password||Q.keystoreStorePassword||"";return{...Q,keystoreKeyPassword:J}}case"keystore-new-cn":{let J=B.cn.trim()||Q.appId;return{...Q,keystoreCommonName:J}}case"service-account-method-select":return{...Q,serviceAccountMethod:B.value};case"sa-json-existing-path":return{...Q,serviceAccountJsonPath:B.path};case"sa-json-validation-failed":{let $=B;if($.value==="retry")return{...Q,serviceAccountJsonPath:void 0};if($.value==="save-anyway")return{...Q,_serviceAccountKeyBase64:$.serviceAccountKeyBase64,serviceAccountValidationSkipped:!0};return{...Q,serviceAccountMethod:"generate"}}case"play-developer-id-input":{let J=qT(B.rawDeveloperIdOrUrl);if(!J)return Q;let Y={developerId:J};return{...Q,completedSteps:{...Q.completedSteps,playAccountChosen:Y}}}case"gcp-projects-select":{let $=B,J={projectId:$.gcpProject.projectId,projectNumber:$.gcpProject.projectNumber,displayName:$.gcpProject.name,createdByOnboarding:!1};return{...Q,completedSteps:{...Q.completedSteps,gcpProjectChosen:J}}}case"gcp-project-create-name":{let J=UT(B.displayName.trim()||`Capgo ${Q.appId}`),Y=k0A(Q.appId),Z={projectId:Y,displayName:J,createdByOnboarding:!0};return{...Q,pendingNewProjectId:Y,pendingNewProjectDisplayName:J,completedSteps:{...Q.completedSteps,gcpProjectChosen:Z}}}case"android-package-select":{let $=B,J={packageName:$.packageName,source:$.source};return{...Q,serviceAccountMethod:$.serviceAccountMethod,completedSteps:{...Q.completedSteps,androidPackageChosen:J}}}case"android-app-verify":{if(B.verifyAction==="proceed"){let J=Q.completedSteps.androidPackageChosen?.packageName??"";return{...Q,completedSteps:{...Q.completedSteps,playAppVerified:{packageName:J,verified:!1}}}}return Q}default:return Q}}function uC0(A){let{_keystoreBase64:Q,_serviceAccountKeyBase64:B,keystoreStorePassword:$,keystoreAlias:J}=A;if(!Q||!B||!$||!J)return{};return{ANDROID_KEYSTORE_FILE:Q,KEYSTORE_KEY_ALIAS:J,KEYSTORE_STORE_PASSWORD:$,KEYSTORE_KEY_PASSWORD:A.keystoreKeyPassword||$,PLAY_CONFIG_JSON:B}}function mC0(A){let Q=A._keystoreBase64;if(!Q)throw Error("keystore not ready");let B=A._serviceAccountKeyBase64;if(!B)throw Error("service-account key not provisioned");let{keystoreStorePassword:$,keystoreAlias:J}=A;if(!$||!J)throw Error("keystore inputs missing");return{ANDROID_KEYSTORE_FILE:Q,KEYSTORE_KEY_ALIAS:J,KEYSTORE_STORE_PASSWORD:$,KEYSTORE_KEY_PASSWORD:A.keystoreKeyPassword||$,PLAY_CONFIG_JSON:B}}var cC0=new Set(["saving-credentials","detecting-ci-secrets","checking-ci-secrets","uploading-ci-secrets","exporting-env","overwrite-and-export-env","writing-workflow-file","requesting-build"]),dC0=new Set(["ci-secrets-setup","ci-secrets-target-select","ask-ci-secrets","confirm-ci-secret-overwrite","ci-secrets-failed","ask-github-actions-setup","confirm-secrets-push","ask-export-env","confirm-env-export-overwrite","pick-package-manager","pick-build-script","pick-build-script-custom","preview-workflow-file","view-workflow-diff","ask-build","build-complete"]),lC0=new Set(["ci-secrets-target-select","ask-github-actions-setup","ask-export-env","pick-package-manager","pick-build-script","pick-build-script-custom"]);function pC0(A){return{platform:"android",buildSavedCredentials:mC0,rebuildTailCredentials:uC0,resumeStep:$J,updateSavedCredentials:A.updateSavedCredentials,loadProgress:A.loadAndroidProgress,saveProgress:A.saveAndroidProgress,deleteProgress:A.deleteAndroidProgress,createCiSecretEntries:A.createCiSecretEntries,detectCiSecretTargets:A.detectCiSecretTargets,getCiSecretRepoLabelAsync:A.getCiSecretRepoLabelAsync,listExistingCiSecretKeysAsync:A.listExistingCiSecretKeysAsync,uploadCiSecretsAsync:A.uploadCiSecretsAsync,exportCredentialsToEnv:A.exportCredentialsToEnv,defaultExportPath:A.defaultExportPath,generateWorkflow:A.generateWorkflow,writeWorkflowFile:A.writeWorkflowFile,requestBuildInternal:A.requestBuildInternal,logger:A.logger,onBuildOutput:A.onBuildOutput,resolveApikey:A.resolveApikey,onCiSecretUploadProgress:A.onCiSecretUploadProgress,onCiSecretCheckPhase:A.onCiSecretCheckPhase,onCiSecretError:A.onCiSecretError,getPackageScripts:A.getPackageScripts,findProjectType:A.findProjectType,findBuildCommandForProjectType:A.findBuildCommandForProjectType,trackWorkflowEvent:A.trackWorkflowEvent,carried:A.carried,onStatus:A.onStatus,onLog:A.onLog,onInternalLog:A.onInternalLog,signal:A.signal}}function iC0(A,Q){return{step:Q,kind:A.kind,title:A.title,prompt:A.prompt,collect:A.collect,options:A.options,message:A.message}}async function Hm(A,Q,B){if(cC0.has(A)){let $=await DT(A,Q,pC0(B));return{progress:$.progress,next:$.next,transient:$.transient}}switch(A){case"backing-up":{let $=ZXQ(YXQ(),".capgo-credentials","credentials.json"),J=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),Y=ZXQ(YXQ(),".capgo-credentials",`credentials-${J}.copy.json`);try{await B.copyFile($,Y),B.onLog?.(`✔ Backup saved · ${Y}`)}catch(X){let G=X instanceof Error?X.message:String(X);if(B.onInternalLog?.(`credentials backup failed: ${G}`),X?.code==="ENOENT"||/ENOENT/.test(G))B.onLog?.("⚠ Could not backup credentials (file may not exist yet)","yellow");else B.onLog?.(`⚠ Could not back up credentials: ${G}`,"yellow")}let Z={...Q,_credentialsExistGate:"done"};return await B.saveAndroidProgress(Q.appId,Z),{progress:Z,next:"keystore-method-select"}}case"keystore-existing-detecting-alias":{let $=await B.readFile(Q.keystoreExistingPath),J=B.listKeystoreAliases($,Q.keystoreStorePassword);if(J.ok&&J.aliases.length===1){let Y=J.aliases[0],Z={...Q,keystoreAlias:Y};return await B.saveAndroidProgress(Q.appId,Z),B.onLog?.(`✔ Detected alias · ${Y}`),{progress:Z,next:"keystore-existing-key-password"}}if(J.ok&&J.aliases.length>1)return{progress:Q,next:"keystore-existing-alias-select",transient:{detectedAliases:J.aliases}};if(!J.ok&&J.reason==="wrong-password")return{progress:Q,next:"keystore-existing-store-password",transient:{wrongPassword:!0}};if(!J.ok&&J.reason==="unsupported-format")B.onLog?.("ℹ Couldn't auto-detect alias (JKS format or similar) — enter it manually.","yellow");else if(J.ok)B.onLog?.("ℹ Couldn't auto-detect alias from the keystore — enter it manually.","yellow");return{progress:Q,next:"keystore-existing-alias"}}case"keystore-existing-key-password":{let $=null,J=null;if(Q.keystoreKeyPassword)$=Q.keystoreKeyPassword,J="progress";else if(Q.keystoreStorePassword&&Q.keystoreExistingPath)try{let q=await B.readFile(Q.keystoreExistingPath);if(B.tryUnlockPrivateKey(q,Q.keystoreStorePassword).ok)$=Q.keystoreStorePassword,J="probed-same"}catch{}if(!$)return{progress:Q,next:"keystore-existing-key-password",transient:{needsKeyPasswordPrompt:!0}};if(J==="probed-same")B.onLog?.("ℹ Key password matches store password — using the same value");let Y=$;B.onLog?.("✔ Key password set");let X=(await B.readFile(Q.keystoreExistingPath)).toString("base64"),G={keystorePath:Q.keystoreExistingPath,alias:Q.keystoreAlias||g0A,isGenerated:!1},K={...Q,keystoreKeyPassword:Y,_keystoreBase64:X,serviceAccountForkSeen:!0,completedSteps:{...Q.completedSteps,keystoreReady:G}};await B.saveAndroidProgress(Q.appId,K),B.onLog?.(`✔ Keystore loaded — ${Q.keystoreExistingPath}`);let W=await B.loadAndroidProgress(Q.appId),H=W?NV(W):!1,U;if(H||W?.serviceAccountMethod!==void 0)U=W?$J(W):"service-account-method-select";else U="service-account-method-select";return{progress:K,next:U}}case"keystore-generating":{let $=Q.keystoreStorePassword,J=Q.keystoreKeyPassword||$,Y=Q.keystoreCommonName||Q.appId,Z=B.generateKeystore({alias:Q.keystoreAlias||g0A,storePassword:$,keyPassword:J,dname:{commonName:Y,organizationName:"Capgo"}}),G={keystorePath:`android/app/${Z.alias}.p12`,alias:Z.alias,isGenerated:!0},K={...Q,keystoreMethod:"generate",keystoreAlias:Z.alias,keystoreStorePassword:$,keystoreKeyPassword:J,keystoreCommonName:Y,_keystoreBase64:Z.p12Base64,serviceAccountForkSeen:!0,completedSteps:{...Q.completedSteps,keystoreReady:G}};return await B.saveAndroidProgress(Q.appId,K),B.onLog?.(`✔ Keystore generated — alias: ${Z.alias}, valid until ${Z.notAfter.getFullYear()}`),{progress:K,next:"service-account-method-select"}}case"sa-json-validating":{let $=await B.readFile(Q.serviceAccountJsonPath),J=Q.completedSteps.androidPackageChosen.packageName,Y=await B.validateServiceAccountJson({jsonBytes:$,packageName:J,signal:B.signal});if(Y.ok){let Z=$.toString("base64"),X={...Q,_serviceAccountKeyBase64:Z,serviceAccountValidationSkipped:!1};return await B.saveAndroidProgress(Q.appId,X),B.onLog?.(`✔ Service account verified — ${Y.serviceAccountEmail}`),{progress:X,next:"saving-credentials"}}if(Y.kind==="shape-error")B.onLog?.(`✖ ${Y.message}`,"red");return{progress:Q,next:"sa-json-validation-failed",transient:{saValidation:Y}}}case"google-sign-in-running":{let $;try{$=await B.runOAuthFlow({onAuthUrl:B.onAuthUrl,onStatus:B.onStatus})}catch(Z){if(Z instanceof aw){B.onLog?.("✖ Sign-in did not grant all required permissions.","red");for(let X of Z.missing)B.onLog?.(` • Missing: ${X}`,"yellow");return B.onLog?.("Please retry sign-in and leave every requested permission checked.","yellow"),{progress:Q,next:"google-sign-in"}}throw Z}if(!$.refreshToken)throw Error("Google did not return a refresh token — try again.");let J=await B.fetchUserInfo($.accessToken),Y=wC0(Q,$,J);return await B.saveAndroidProgress(Q.appId,Y),B.onLog?.(`✔ Signed in as ${J.email}`),{progress:Y,next:"play-developer-id-input",transient:{accessToken:$.accessToken}}}case"gcp-projects-loading":{let $=await B.getAccessToken(),J=await B.listProjects($);return{progress:Q,next:"gcp-projects-select",transient:{gcpProjects:J.map((Y)=>({projectId:Y.projectId,name:Y.name,projectNumber:Y.projectNumber}))}}}case"android-app-verify":{let $=Q.completedSteps.androidPackageChosen?.packageName,J=async(Y)=>{let Z={...Q,completedSteps:{...Q.completedSteps,playAppVerified:{packageName:$??"",verified:Y}}};try{await B.saveAndroidProgress(Q.appId,Z)}catch{}return{progress:Z,next:"gcp-setup-running"}};if(!$||Q.serviceAccountMethod!=="generate"||!B.listPlayApps)return await J(!1);try{let Y=await B.getAccessToken(),Z=await B.listPlayApps(Y),X=$XQ({gradleIds:[$],apps:Z});if(X.kind==="exact-match")return await J(!0);return{progress:Q,next:"android-app-verify",transient:{playVerifyApps:Z.map((G)=>({packageName:G.packageName,displayName:G.displayName})),playVerifyOutcome:X.kind==="no-app"?"no-app":"wrong-build-id"}}}catch(Y){return B.onInternalLog?.(`android-app-verify: apps:search failed, continuing unverified (${Y instanceof Error?Y.message:String(Y)})`),await J(!1)}}case"android-package-select":{let $=await B.findAndroidApplicationIds(),J;if(Q.serviceAccountMethod==="generate"&&B.listPlayApps)try{let Y=await B.getAccessToken();J=await B.listPlayApps(Y)}catch(Y){B.onInternalLog?.(`android-package-select: Play apps preload failed, showing plain picker (${Y instanceof Error?Y.message:String(Y)})`)}return{progress:Q,next:"android-package-select",transient:{detectedPackageIds:$,...J?{playVerifyApps:J}:{}}}}case"gcp-setup-running":{let $=await B.getAccessToken(),J=Q,Y=J.completedSteps.gcpProjectChosen;if(Y&&Y.createdByOnboarding&&!Y.projectNumber){B.onStatus?.(`Creating GCP project ${Y.projectId}...`);let I=await B.createProject($,Y.projectId,Y.displayName);Y={...Y,projectNumber:I.projectNumber},J={...J,completedSteps:{...J.completedSteps,gcpProjectChosen:Y}},await B.saveAndroidProgress(J.appId,J),B.onStatus?.(`✔ Project created (number ${I.projectNumber})`)}if(!Y)throw Error("No GCP project selected");let Z=Y.projectId;B.onStatus?.(`Enabling ${iOA}...`),await B.enableService($,Z,iOA),B.onStatus?.("✔ API enabled"),B.onStatus?.(`Ensuring service account "${nOA}"...`);let{account:X,created:G}=await B.ensureServiceAccount({accessToken:$,projectId:Z,accountId:nOA,displayName:rZQ,description:oZQ}),K={email:X.email,projectId:Z,uniqueId:X.uniqueId};B.onStatus?.(G?`✔ Service account created — ${X.email}`:`✔ Service account exists — ${X.email}`),B.onStatus?.("Creating service-account JSON key...");let W=await B.createServiceAccountKey({accessToken:$,projectId:Z,serviceAccountEmail:X.email});J={...J,_serviceAccountKeyBase64:W.privateKeyDataBase64,completedSteps:{...J.completedSteps,serviceAccountProvisioned:K}},await B.saveAndroidProgress(J.appId,J),B.onStatus?.("✔ Key created");let H=J.completedSteps.playAccountChosen;if(!H)throw Error("No Play Developer account chosen");let U=J.completedSteps.androidPackageChosen;B.onStatus?.(`Inviting ${X.email} to Play Console...`);try{if(!U)throw Error("No Android package selected for the Play invite");await B.inviteServiceAccount({accessToken:$,developerId:H.developerId,serviceAccountEmail:X.email,developerAccountPermissions:QXQ,grants:[{packageName:U.packageName,permissions:BXQ}]})}catch(I){let O=I instanceof Error?I.message:String(I);if(!/already|exists|duplicate/i.test(O))throw I;B.onStatus?.("ℹ Service account was already invited — continuing")}let q={developerId:H.developerId,serviceAccountEmail:X.email};J={...J,completedSteps:{...J.completedSteps,playInviteProvisioned:q}},await B.saveAndroidProgress(J.appId,J),B.onStatus?.("✔ Play Console invite confirmed");let D=J._oauthRefreshToken??J._oauthAccessToken;if(D){B.onStatus?.("Revoking OAuth token (we don't need it anymore)...");let I=!1;try{await B.revokeToken(D),I=!0,B.onStatus?.("✔ OAuth token revoked")}catch(O){let V=O instanceof Error?O.message:String(O);B.onStatus?.(`⚠ Revoke request failed (${V}) — token will expire on its own`)}if(I){let{_oauthRefreshToken:O,_oauthAccessToken:V,_oauthAccessTokenExpiresAt:N,...C}=J;J=C,await B.saveAndroidProgress(J.appId,J)}}return B.onLog?.("✔ Google Cloud + Play setup complete"),{progress:J,next:"saving-credentials"}}default:throw Error(`Unhandled effect step: ${A}`)}}var oA=AQ(I8(),1),rC0=2,m0A="release",KXQ={"backing-up":"backing-up","keystore-existing-detecting-alias":"keystore-existing-path","keystore-generating":"keystore-generating","google-sign-in-running":"google-sign-in","gcp-setup-running":"gcp-setup-running","android-package-select":void 0,"android-app-verify":void 0},oC0=new Set(["saving-credentials","detecting-ci-secrets","checking-ci-secrets","uploading-ci-secrets","exporting-env","overwrite-and-export-env","writing-workflow-file","requesting-build"]);function WXQ(A){let Q=A.trim();if(Q.length>=2){let B=Q[0],$=Q[Q.length-1];if(B==='"'&&$==='"'||B==="'"&&$==="'")Q=Q.slice(1,-1)}if(Q.startsWith("~"))Q=Q.replace(/^~/,nC0());return Q=Q.replace(/\\ /g," "),Q}function AMA(A){return{platform:"android",appId:A,startedAt:new Date().toISOString(),completedSteps:{}}}var sC0=({appId:A,initialProgress:Q,androidDir:B,apikey:$,supaHost:J,supaAnon:Y,journeyId:Z,onStep:X,onResult:G,onBeforeExit:K})=>{let{exit:W}=JU(),H=_Q.useCallback(()=>{AO(K,W)},[W,K]),U=$J(Q),[q,D]=_Q.useState(Q!==null&&U!=="welcome"?"resume-prompt":U),I=_Q.useRef(q);I.current=q;let O=_Q.useRef({step:null,startedAt:Date.now()}),V=_Q.useRef([]),N=_Q.useRef([]),[C,L]=_Q.useState(null),R=_Q.useRef($??null),E=_Q.useRef(!1),w=_Q.useRef(void 0);_Q.useEffect(()=>{if(R.current)return;let OA=W4();if(OA)R.current=OA},[]),_Q.useEffect(()=>{if(E.current||!R.current)return;E.current=!0;let OA=!1;return(async()=>{let TA=await u$(R.current,A,{supaHost:J,supaAnon:Y}).catch(()=>null);if(TA&&!OA)L(TA)})(),()=>{OA=!0}},[A,J,Y]);let[S,u]=_Q.useState([]),[k,b]=_Q.useState(null);_Q.useEffect(()=>{if(!R.current)return;let OA=O.current,TA=OA.step!==null&&OA.step===q&&q!=="error";if(C&&V.current.length>0){for(let w0 of V.current)MP({apikey:R.current,appId:A,journeyId:Z,orgId:C,platform:"android",...w0});V.current=[]}if(C&&N.current.length>0){for(let w0 of N.current)CP({apikey:R.current,appId:A,journeyId:Z,orgId:C,platform:"android",...w0});N.current=[]}if(TA)return;let OQ=Date.now(),z0=OA.step===null||OA.step===q?void 0:OA.step,HB=z0===void 0?void 0:OQ-OA.startedAt,x1={step:q,durationMs:HB,durationStep:z0,errorCategory:q==="error"||q==="sa-json-validation-failed"?w.current:void 0};if(O.current={step:q,startedAt:OQ},C)MP({apikey:R.current,appId:A,journeyId:Z,orgId:C,platform:"android",...x1});else V.current.push(x1)},[q,A,C,k]),_Q.useEffect(()=>{X?.(q)},[q,X]);let h=_Q.useCallback((OA,TA,OQ=q)=>{if(!R.current)return;let z0={step:OQ,action:OA,tags:TA};if(C)CP({apikey:R.current,appId:A,journeyId:Z,orgId:C,platform:"android",...z0});else N.current.push(z0)},[A,C,q]),[r,e]=_Q.useState(0),[n,l]=_Q.useState(null),c=_Q.useRef(!1),f=_Q.useRef(!1),d=_Q.useRef(!1),x=_Q.useRef(!1),m=_Q.useRef(!1),QA=_Q.useRef(!1),g=_Q.useRef(null),s=_Q.useRef(!1),[BA,zA]=_Q.useState("choose"),[ZA,wA]=_Q.useState("choose"),[,qA]=_Q.useState(Q?.keystoreMethod||null),[MA,fA]=_Q.useState(Q?.keystoreExistingPath||""),[YA,jA]=_Q.useState(Q?.keystoreAlias||""),[NA,CA]=_Q.useState(Q?.keystoreStorePassword||""),[cQ,EQ]=_Q.useState(Q?.keystoreKeyPassword||""),[,X0]=_Q.useState(Q?.keystoreCommonName||""),[hQ,V0]=_Q.useState(!1),[y0,KB]=_Q.useState([]),[fB,oQ]=_Q.useState(null),x0=_Q.useRef(!1),[M0,A1]=_Q.useState(Q?.serviceAccountJsonPath||""),[y1,G8]=_Q.useState(null),[,a8]=_Q.useState(Q?.completedSteps.googleSignInComplete||null),[sQ,e0]=_Q.useState(""),[_0,K1]=_Q.useState(Q?._oauthRefreshToken||""),[Q8,JA]=_Q.useState(""),[dA,IQ]=_Q.useState([]),[nQ,C0]=_Q.useState(!1),[,vB]=_Q.useState(Q?.completedSteps.playAccountChosen||null),[zB,iB]=_Q.useState("actions"),[eB,o4]=_Q.useState([]),[,N1]=_Q.useState(Q?.completedSteps.gcpProjectChosen||null),[r8,x$]=_Q.useState(Q?.pendingNewProjectDisplayName||""),[y6,g6]=_Q.useState(Q?.completedSteps.androidPackageChosen||null),[H$,K5]=_Q.useState([]),[VB,o$]=_Q.useState(null),[F$,W5]=_Q.useState(!1),[h9,d4]=_Q.useState("choose"),s$=_Q.useRef(!1),[U$,t$]=_Q.useState(null),F9=_Q.useRef(!1),U9=_Q.useRef(null),[H5,NZ]=_Q.useState(0),[OY,y7]=_Q.useState(0),[RZ,h0]=_Q.useState([]),[,uJ]=_Q.useState(Q?.completedSteps.serviceAccountProvisioned||null),[,z9]=_Q.useState(Q?.completedSteps.playInviteProvisioned||null),[r5,mJ]=_Q.useState(""),[U4,u8]=_Q.useState([]),[cJ,N6]=_Q.useState(""),R6=_Q.useRef(null),[q9,W6]=_Q.useState("email"),[p6,F5]=_Q.useState([]),U5=_Q.useRef(""),[GA,HA]=_Q.useState("Uploading your logs to Capgo support…"),[PA,uA]=_Q.useState(null),[lA,wQ]=_Q.useState(null),[dQ,PQ]=_Q.useState(""),[D0,eQ]=_Q.useState(null),[g0,WB]=_Q.useState(0),[Q1,D1]=_Q.useState(!1),[W1,X4]=_Q.useState([]),[H6,e$]=_Q.useState([]),[C8,z$]=_Q.useState(null),[G4,K4]=_Q.useState([]),[E6,l4]=_Q.useState([]),[z5,x3]=_Q.useState(null),[tF,MN]=_Q.useState("Resolving GitHub repository…"),[dJ,oO]=_Q.useState(null),[o5,eF]=_Q.useState(null),[s5,t5]=_Q.useState([]),[MY,CN]=_Q.useState(null),[FJ,ez]=_Q.useState(!0),[A2,LN]=_Q.useState(null),[EZ,sO]=_Q.useState(null),[Aq,s_]=_Q.useState(null),{stdout:EX}=iZ(),[Qq,Bq]=_Q.useState({rows:EX?.rows??24,cols:EX?.columns??80});_Q.useEffect(()=>{if(!EX)return;let OA=()=>Bq({rows:EX.rows??24,cols:EX.columns??80});return EX.on("resize",OA),()=>{EX.off("resize",OA)}},[EX]);let{rows:UJ,cols:RG}=Qq,YW=_Q.useRef(null),[tO,VN]=_Q.useState({key:"",comfortable:null}),Q2=`${q}|${RG}`,EG=tO.key===Q2?tO:{key:Q2,comfortable:null};_Q.useEffect(()=>{if(!YW.current)return;let{height:OA}=eC(YW.current);if(OA<=0)return;VN((TA)=>{if(TA.key===Q2&&TA.comfortable===OA)return TA;return{key:Q2,comfortable:OA}})});let f3=EG.comfortable,$q=Df,D9=f3!=null?N0A(UJ,$q,f3):Number.POSITIVE_INFINITY,[Jq,B2]=_Q.useState("undecided"),[Yq,$2]=_Q.useState({}),[eO,v3]=_Q.useState(null),[ZW,y3]=_Q.useState(null),[AM,q5]=_Q.useState(null),[J2,QM]=_Q.useState(null),[f$,g3]=_Q.useState(null),[XW,A9]=_Q.useState(""),[D5,Y2]=_Q.useState(null),jX=V8(),jZ=(OA,TA={})=>{let OQ=TA.diff?FO(TA.diff,TA.isNew??FJ):A2??FO(s5,TA.isNew??FJ);_0A({event:OA,appId:A,platform:"android",apikey:$,journeyId:Z,packageManager:o5??C3(jX.pm),buildScriptType:ZW?.type,decision:TA.decision,...OQ})},AB=_Q.useCallback((OA,TA="green")=>{kB(OA),u((OQ)=>{let z0=OQ[OQ.length-1];if(z0&&z0.text===OA&&z0.color===TA)return OQ;return[...OQ,{text:OA,color:TA}]})},[]),g7=_Q.useCallback((OA)=>{kB(OA),h0((TA)=>[...TA,OA])},[]);_Q.useEffect(()=>{kB(`step → ${q}`)},[q]);let wX=_Q.useCallback((OA)=>{if(c.current)return;if(c.current=!0,OA)AB(OA,"yellow");setTimeout(H,50)},[AB,H]);e8((OA,TA)=>{if(TA.ctrl&&OA==="c")u0A.kill(u0A.pid,"SIGINT");if(q==="build-complete"&&JL(OA,TA)){H();return}if(q==="preview-workflow-file"&&TA.escape)jZ("workflow-preview-action",{decision:"escape"}),t5([]),D("build-complete")});let e5=_Q.useCallback(async(OA)=>{let TA=await l5(A)||AMA(A),OQ=OA(TA);return await Zz(A,OQ),OQ},[A]),wZ=_Q.useRef(null),f4=_Q.useCallback((OA,TA)=>{(async()=>{try{let OQ=await e5(OA);D(TA??$J(OQ))}catch(OQ){wZ.current?.(OQ,TA??I.current)}})()},[e5]),GW=(OA,TA,OQ)=>{let z0={keystorePath:"android/app/release.keystore",alias:YA||"release",isGenerated:!0},HB={platform:"android",appId:A,startedAt:new Date().toISOString(),_keystoreBase64:"_",keystoreAlias:YA||"release",keystoreStorePassword:NA||"_",setupMode:Jq,ciSecretTarget:C8,selectedPackageManager:o5??C3(jX.pm),buildScriptChoice:ZW,envExportTargetPath:XW,completedSteps:{keystoreReady:z0,credentialsSaved:{savedAt:new Date().toISOString()},...OQ.buildRequested?{buildRequested:{buildUrl:r5||""}}:{},...OQ.ciSecretsUploaded?{ciSecretsUploaded:{provider:C8?.provider??"github",count:W1.length}}:{}}};return $J(YJ(OA,HB,TA))},Zq=_Q.useCallback(()=>{if(!Q)return;let{completedSteps:OA}=Q,TA=$J(Q);if(new Set(["keystore-method-select","keystore-explainer","keystore-existing-path","keystore-existing-picker","keystore-existing-store-password","keystore-existing-detecting-alias","keystore-existing-alias-select","keystore-existing-alias","keystore-existing-key-password","keystore-new-alias","keystore-new-password-method","keystore-new-store-password","keystore-new-key-password","keystore-new-cn","keystore-generating"]).has(TA)){if(Q.keystoreExistingPath)AB(`✔ Keystore selected · ${Q.keystoreExistingPath}`);if(Q.keystoreAlias)AB(`✔ Key alias · ${Q.keystoreAlias}`);if(Q.keystoreStorePassword)AB("✔ Store password set");if(Q.keystoreKeyPassword)AB("✔ Key password set");AB("↺ Re-confirming a missing keystore input","yellow")}else if(OA.keystoreReady)AB(`✔ Keystore ready — ${OA.keystoreReady.keystorePath}`);if(OA.googleSignInComplete&&TA!=="google-sign-in")AB(`✔ Signed in as ${OA.googleSignInComplete.email}`);if(OA.playAccountChosen)AB(`✔ Play Developer account — ${OA.playAccountChosen.displayName||OA.playAccountChosen.developerId}`);if(OA.gcpProjectChosen)AB(`✔ GCP project — ${OA.gcpProjectChosen.displayName}`);if(OA.androidPackageChosen)AB(`✔ Android package — ${OA.androidPackageChosen.packageName}`);if(OA.serviceAccountProvisioned)AB(`✔ Service account — ${OA.serviceAccountProvisioned.email}`);if(OA.playInviteProvisioned)AB("✔ Service account invited to Play Console")},[Q,AB]),BM=_Q.useRef(q==="resume-prompt");_Q.useEffect(()=>{if(BM.current)return;Zq()},[]);let Xq=_Q.useCallback(async()=>{await VP(A).catch(()=>{}),qA(null),zA("choose"),fA(""),jA(""),CA(""),EQ(""),X0(""),V0(!1),KB([]),oQ(null),x0.current=!1,wA("choose"),A1(""),G8(null),a8(null),e0(""),K1(""),JA(""),IQ([]),C0(!1),vB(null),iB("actions"),o4([]),N1(null),x$(""),g6(null),K5([]),o$(null),U9.current=null,W5(!1),d4("choose"),s$.current=!1,t$(null),F9.current=!1,uJ(null),z9(null)},[A]),zJ=_Q.useCallback((OA,TA)=>{w.current=GQA(OA);let OQ=OA instanceof Error?OA.message:String(OA);if(r===0)b(OQ),l(TA),e(1),D("error");else AB(`✖ ${OQ}`,"red"),AB("Run `capgo build init --platform android` to resume.","yellow"),setTimeout(()=>wX(),100)},[r,AB,wX]),Gq=_Q.useCallback((OA,TA)=>{return W6("email"),U5.current=TA,N6(OA),D("support-confirm"),new Promise((OQ)=>{R6.current=OQ})},[]),PX=_Q.useCallback((OA)=>{return W6("ai-upload"),N6(OA),D("support-confirm"),new Promise((TA)=>{R6.current=TA})},[]),h3=_Q.useCallback(()=>{let OA=JK();if(!OA)return[];try{return tOA(OA,"utf8").split(`
|
|
1294
1294
|
`)}catch{return[]}},[]),Kq=_Q.useCallback(async(OA="error")=>{let TA=$K(k??"unknown error");await BO({subject:`Capgo Builder support — ${A} (android)`,body:`Hi Capgo team,
|
|
1295
1295
|
|
|
1296
1296
|
My build failed and I'd like help.
|
package/dist/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capgo/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "8.47.
|
|
4
|
+
"version": "8.47.1",
|
|
5
5
|
"description": "A CLI to upload to capgo servers",
|
|
6
6
|
"author": "Martin martin@capgo.app",
|
|
7
7
|
"license": "Apache 2.0",
|
|
@@ -176,7 +176,7 @@
|
|
|
176
176
|
"test:android-version": "bun test/test-android-version.mjs",
|
|
177
177
|
"test:platform-flow-contract": "bun test/test-platform-flow-contract.mjs",
|
|
178
178
|
"test:tail-engine-shared": "bun test/test-tail-engine-shared.mjs",
|
|
179
|
-
"test": "bun run build && bun run test:helper-dce && bun run test:version-detection:setup && bun run test:bundle && 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: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: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: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-list-output-text && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:cli-recovery && bun run test:create-supabase-client && bun run test:build-platform-selection && bun run test:builder-project-discovery && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-monorepo-targeting && bun run test:init-app-conflict && bun run test:channel-add-exists && bun run test:wait-log && bun run test:init-guardrails && bun run test:init-replay && bun run test:init-telemetry && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:mcp-no-key-handshake && bun run test:auth-session && bun run test:version-detection && bun run test:platform-paths && bun run test:project-type-detection && bun run test:payload-split && bun run test:manifest-path-encoding && bun run test:macos-signing && bun run test:asc-key-protocol && bun run test:apple-api-import-helpers && bun run test:apple-api-verify-key && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:cicd-failure-help && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-upload-prompt && bun run test:support-bundle-files && bun run test:self-update && bun run test:update-prompt && bun run test:apple-api-cert-create && bun run test:android-tail-engine && bun run test:android-tail-render && bun run test:android-tail-routing && bun run test:dev-gate-stripped && bun run test:frame-fit-ios-shared && bun run test:ios-confirm-app-id && bun run test:ios-create-new && bun run test:ios-e2e && bun run test:ios-flow-contract && bun run test:ios-import-discovery && bun run test:ios-import-export && bun run test:ios-import-pickers && bun run test:ios-import-recovery && bun run test:ios-recovery && bun run test:ios-resume && bun run test:ios-tail-handoff && bun run test:ios-tui-render && bun run test:p8-error && bun run test:ios-tui-routing && bun run test:ios-updater-sync-validation && bun run test:ios-verify-app && bun run test:ios-marketing-version && bun run test:android-version && bun run test:platform-flow-contract && bun run test:tail-engine-shared && bun run test:prescan && bun run test:android-reporting-api && bun run test:android-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",
|
|
179
|
+
"test": "bun run build && bun run test:helper-dce && bun run test:version-detection:setup && bun run test:bundle && 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: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: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: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-list-output-text && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:cli-recovery && bun run test:create-supabase-client && bun run test:build-platform-selection && bun run test:builder-project-discovery && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-monorepo-targeting && bun run test:init-app-conflict && bun run test:channel-add-exists && bun run test:wait-log && bun run test:init-guardrails && bun run test:init-replay && bun run test:init-telemetry && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:mcp-no-key-handshake && bun run test:auth-session && bun run test:version-detection && bun run test:platform-paths && bun run test:project-type-detection && bun run test:payload-split && bun run test:manifest-path-encoding && bun run test:macos-signing && bun run test:asc-key-protocol && bun run test:apple-api-import-helpers && bun run test:apple-api-verify-key && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:cicd-failure-help && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-upload-prompt && bun run test:support-bundle-files && bun run test:self-update && bun run test:update-prompt && bun run test:apple-api-cert-create && bun run test:android-tail-engine && bun run test:android-tail-render && bun run test:android-tail-routing && bun run test:dev-gate-stripped && bun run test:frame-fit-ios-shared && bun run test:ios-confirm-app-id && bun run test:ios-create-new && bun run test:ios-e2e && bun run test:ios-flow-contract && bun run test:ios-import-discovery && bun run test:ios-import-export && bun run test:ios-import-pickers && bun run test:ios-import-recovery && bun run test:ios-recovery && bun run test:ios-resume && bun run test:ios-tail-handoff && bun run test:ios-tui-render && bun run test:p8-error && bun run test:ios-tui-routing && bun run test:ios-updater-sync-validation && bun run test:ios-verify-app && bun run test:ios-marketing-version && bun run test:android-version && bun run test:platform-flow-contract && bun run test:tail-engine-shared && bun run test:prescan && bun run test:android-reporting-api && bun run test:android-gcp && bun run test:android-app-verification && bun run test:android-rename && bun run test:appflow-auth && bun run test:appflow-api-map && bun run test:appflow-validate && bun run test:appflow-flow && bun run test:appflow-gapfill && bun run test:appflow-engine && bun run test:appflow-tail && bun run test:appflow-fetch && bun run test:appflow-sa-decode && bun run test:app-permission-helper && bun run test:2fa-compliance-network && bun run test:organization-set-api-host && bun run test:trial-warning && bun run test:plan-validation",
|
|
180
180
|
"test:build-platform-selection": "bun test/test-build-platform-selection.mjs",
|
|
181
181
|
"test:builder-project-discovery": "bun test/test-builder-project-discovery.mjs",
|
|
182
182
|
"test:ai-log-capture": "bun test/test-ai-log-capture.mjs",
|
|
@@ -207,6 +207,7 @@
|
|
|
207
207
|
"test:mcp-live-update-onboarding": "bun test/test-mcp-live-update-onboarding.mjs",
|
|
208
208
|
"test:app-set-options": "bun test/test-app-set-options.mjs && bun test/test-app-list-options.mjs",
|
|
209
209
|
"test:android-reporting-api": "bun test/test-android-reporting-api.mjs",
|
|
210
|
+
"test:android-gcp": "bun test/test-android-gcp.mjs",
|
|
210
211
|
"test:android-app-verification": "bun test/test-android-app-verification.mjs",
|
|
211
212
|
"test:android-rename": "bun test/test-android-rename.mjs",
|
|
212
213
|
"test:appflow-auth": "bun test/test-appflow-auth.mjs",
|
|
@@ -104,7 +104,8 @@ export declare function pollOperation(accessToken: string, operationName: string
|
|
|
104
104
|
*
|
|
105
105
|
* - 4–30 characters
|
|
106
106
|
* - allowed chars: letters, digits, space, hyphen (`-`), apostrophe (`'`),
|
|
107
|
-
* exclamation (`!`)
|
|
107
|
+
* exclamation (`!`) — periods (`.`) are **not** allowed (appIds like
|
|
108
|
+
* `com.example.app` must be normalized before submit)
|
|
108
109
|
* - must start and end with a letter or digit
|
|
109
110
|
*
|
|
110
111
|
* We strip any disallowed character (including em-dashes — which break the
|
package/dist/src/sdk.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as pE0}from"node:module";var module={exports:{}};var gE0=Object.create;var{getPrototypeOf:mE0,defineProperty:lF,getOwnPropertyNames:Jb}=Object;var Q2=Object.prototype.hasOwnProperty;function X2($){return this[$]}var z0=($,D,Q)=>{var X=Jb(D);for(let J of X)if(!Q2.call($,J)&&J!=="default")lF($,J,{get:X2.bind(D,J),enumerable:!0});if(Q){for(let J of X)if(!Q2.call(Q,J)&&J!=="default")lF(Q,J,{get:X2.bind(D,J),enumerable:!0});return Q}},dE0,cE0,P1=($,D,Q)=>{var X=$!=null&&typeof $==="object";if(X){var J=D?dE0??=new WeakMap:cE0??=new WeakMap,Y=J.get($);if(Y)return Y}Q=$!=null?gE0(mE0($)):{};let Z=D||!$||!$.__esModule?lF(Q,"default",{value:$,enumerable:!0}):Q;for(let F of Jb($))if(!Q2.call(Z,F))lF(Z,F,{get:X2.bind($,F),enumerable:!0});if(X)J.set($,Z);return Z};var E=($,D)=>()=>(D||$((D={exports:{}}).exports,D),D.exports);var lE0=($)=>$;function nE0($,D){this[$]=lE0.bind(null,D)}var Q6=($,D)=>{for(var Q in D)lF($,Q,{get:D[Q],enumerable:!0,configurable:!0,set:nE0.bind(D,Q)})};var a=($,D)=>()=>($&&(D=$($=0)),D);var D0=pE0(import.meta.url);var i$;var Q8=a(()=>{i$={name:"@capgo/cli",type:"module",version:"8.47.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: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: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-list-output-text":"bun test/test-app-list-output-text.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-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:cli-user-error-config":"bun test/test-cli-user-error-config.mjs","test:init-monorepo-targeting":"bun run test:capacitor-config-target && bun run test:cli-user-error-config && bun test/test-init-monorepo-targeting.mjs","test:prompt-preferences":"bun test/test-prompt-preferences.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:auth-session":"bun test/test-auth-session.mjs","test:mcp":"node test/test-mcp.mjs","test:mcp-no-key-handshake":"node test/test-mcp-no-key-handshake.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs","test:project-type-detection":"bun test/test-project-type-detection.mjs","test:payload-split":"bun test/test-payload-split.mjs","test:macos-signing":"bun test/test-macos-signing.mjs","test:helper-dce":"bash scripts/check-helper-dce.sh","test:apple-api-import-helpers":"bun test/test-apple-api-import-helpers.mjs","test:apple-api-verify-key":"bun test/test-apple-api-verify-key.mjs","test:bundle-id-detector":"bun test/test-bundle-id-detector.mjs","test:apple-api-app-list":"bun test/test-apple-api-app-list.mjs","test:apple-api-cert-create":"bun test/test-apple-api-cert-create.mjs","test:app-verification":"bun test/test-app-verification.mjs","test:pbxproj-parser":"bun test/test-pbxproj-parser.mjs","test:manifest-path-encoding":"bun test/test-manifest-path-encoding.mjs","test:self-update":"bun test/test-self-update.mjs","test:update-prompt":"bun test/test-update-prompt.mjs","test:android-tail-engine":"bun test/test-android-tail-engine.mjs","test:android-tail-render":"bun test/test-android-tail-render.mjs","test:android-tail-routing":"bun test/test-android-tail-routing.mjs","test:dev-gate-stripped":"bun test/test-dev-gate-stripped.mjs","test:frame-fit-ios-shared":"bun test/test-frame-fit-ios-shared.mjs","test:ios-confirm-app-id":"bun test/test-ios-confirm-app-id.mjs","test:ios-create-new":"bun test/test-ios-create-new.mjs","test:ios-e2e":"bun test/test-ios-e2e.mjs","test:ios-flow-contract":"bun test/test-ios-flow-contract.mjs","test:ios-import-discovery":"bun test/test-ios-import-discovery.mjs","test:ios-import-export":"bun test/test-ios-import-export.mjs","test:ios-import-pickers":"bun test/test-ios-import-pickers.mjs","test:ios-import-recovery":"bun test/test-ios-import-recovery.mjs","test:ios-recovery":"bun test/test-ios-recovery.mjs","test:ios-resume":"bun test/test-ios-resume.mjs","test:ios-tail-handoff":"bun test/test-ios-tail-handoff.mjs","test:ios-tui-render":"bun test/test-ios-tui-render.mjs","test:p8-error":"bun test/test-p8-error.mjs","test:ios-tui-routing":"bun test/test-ios-tui-routing.mjs","test:ios-updater-sync-validation":"bun test/test-ios-updater-sync-validation.mjs","test:ios-verify-app":"bun test/test-ios-verify-app.mjs","test:ios-marketing-version":"bun test/test-ios-marketing-version.mjs","test:android-version":"bun test/test-android-version.mjs","test:platform-flow-contract":"bun test/test-platform-flow-contract.mjs","test:tail-engine-shared":"bun test/test-tail-engine-shared.mjs",test:"bun run build && bun run test:helper-dce && bun run test:version-detection:setup && bun run test:bundle && bun run test: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: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: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: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-list-output-text && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:cli-recovery && bun run test:create-supabase-client && bun run test:build-platform-selection && bun run test:builder-project-discovery && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-monorepo-targeting && bun run test:init-app-conflict && bun run test:channel-add-exists && bun run test:wait-log && bun run test:init-guardrails && bun run test:init-replay && bun run test:init-telemetry && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:mcp-no-key-handshake && bun run test:auth-session && bun run test:version-detection && bun run test:platform-paths && bun run test:project-type-detection && bun run test:payload-split && bun run test:manifest-path-encoding && bun run test:macos-signing && bun run test:asc-key-protocol && bun run test:apple-api-import-helpers && bun run test:apple-api-verify-key && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:cicd-failure-help && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-upload-prompt && bun run test:support-bundle-files && bun run test:self-update && bun run test:update-prompt && bun run test:apple-api-cert-create && bun run test:android-tail-engine && bun run test:android-tail-render && bun run test:android-tail-routing && bun run test:dev-gate-stripped && bun run test:frame-fit-ios-shared && bun run test:ios-confirm-app-id && bun run test:ios-create-new && bun run test:ios-e2e && bun run test:ios-flow-contract && bun run test:ios-import-discovery && bun run test:ios-import-export && bun run test:ios-import-pickers && bun run test:ios-import-recovery && bun run test:ios-recovery && bun run test:ios-resume && bun run test:ios-tail-handoff && bun run test:ios-tui-render && bun run test:p8-error && bun run test:ios-tui-routing && bun run test:ios-updater-sync-validation && bun run test:ios-verify-app && bun run test:ios-marketing-version && bun run test:android-version && bun run test:platform-flow-contract && bun run test:tail-engine-shared && bun run test:prescan && bun run test:android-reporting-api && bun run test:android-app-verification && bun run test:android-rename && bun run test:appflow-auth && bun run test:appflow-api-map && bun run test:appflow-validate && bun run test:appflow-flow && bun run test:appflow-gapfill && bun run test:appflow-engine && bun run test:appflow-tail && bun run test:appflow-fetch && bun run test:appflow-sa-decode && bun run test:app-permission-helper && bun run test:2fa-compliance-network && bun run test:organization-set-api-host && bun run test:trial-warning && bun run test:plan-validation","test:build-platform-selection":"bun test/test-build-platform-selection.mjs","test:builder-project-discovery":"bun test/test-builder-project-discovery.mjs","test:ai-log-capture":"bun test/test-ai-log-capture.mjs","test:ai-analyze-flow":"bun test/test-ai-analyze-flow.mjs","test:cicd-failure-help":"bun test/test-cicd-failure-help.mjs","test:ai-analyze-stream":"bun test/test-ai-analyze-stream.mjs","test:ai-sse-parser":"bun test/test-ai-sse-parser.mjs","test:ai-render-markdown":"bun test/test-ai-render-markdown.mjs","test:ai-onboarding-mode":"bun test/test-ai-onboarding-mode.mjs","test:ai-fit":"bun test/test-ai-fit.mjs","test:platform-layout":"bun test/test-platform-layout.mjs","test:frame-fit":"bun test/run-frame-fit.mjs","test:onboarding-min-size":"bun test/test-onboarding-min-size.mjs","test:min-size-gate":"bun test/test-min-size-gate.mjs","test:shell-size-gate":"bun test/test-shell-size-gate.mjs","test:build-log-sanitize":"bun test/test-build-log-sanitize.mjs","test:build-output-viewport":"bun test/test-build-output-viewport.mjs","test:diff-viewer-viewport":"bun test/test-diff-viewer-viewport.mjs","test:build-complete-exit":"bun test/test-build-complete-exit.mjs","test:ai-stream-markdown":"bun test/test-ai-stream-markdown.mjs","test:support-mailto":"bun test/test-support-mailto.mjs","test:support-redact":"bun test/test-support-redact.mjs","test:support-internal-log":"bun test/test-support-internal-log.mjs","test:support-help-menu":"bun test/test-support-help-menu.mjs","test:support-contact":"bun test/test-support-contact.mjs","test:support-upload-prompt":"bun test/test-support-upload-prompt.mjs","test:support-bundle-files":"bun test/test-support-bundle-files.mjs","test:mcp-live-update-onboarding":"bun test/test-mcp-live-update-onboarding.mjs","test:app-set-options":"bun test/test-app-set-options.mjs && bun test/test-app-list-options.mjs","test:android-reporting-api":"bun test/test-android-reporting-api.mjs","test:android-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"},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","@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 U0;var u1=a(()=>{U0=class U0 extends Error{context;constructor($,D){super($);this.name="CliUserError",this.context=D}}});import{platform as rE0}from"node:os";import{version as oE0}from"node:process";function sE0($){for(let D=0;D<$.length;D++)if($.charCodeAt(D)>255)return!1;return!0}function Yb($){if($.toLowerCase()==="x-capgo-log-token")return"Build log token is missing. Re-run the build command or pass a valid log token.";return"Capgo API key is missing. Run `npx -y @capgo/cli@latest login` or pass `--apikey`."}function eE0($){if($.toLowerCase()==="x-capgo-log-token")return"Build log token contains invalid characters (only ASCII is allowed). Re-run the build command to get a fresh token.";if($.toLowerCase()==="authorization")return"Authorization header contains invalid characters (only ASCII is allowed). Check your Capgo API key or Supabase anon key configuration.";return"Capgo API key contains invalid characters (only ASCII is allowed). Copy the key from the Capgo dashboard."}function Y2($,D){if(D===void 0||D===null){if(J2.has($.toLowerCase()))throw new U0(Yb($));throw new U0(`HTTP header "${$}" is missing or invalid.`)}if(typeof D!=="string"){if(J2.has($.toLowerCase()))throw new U0(Yb($));throw new U0(`HTTP header "${$}" is missing or invalid.`)}if(!sE0(D)){if(J2.has($.toLowerCase()))throw new U0(eE0($));throw new U0(`HTTP header "${$}" contains invalid characters (only ASCII is allowed).`)}return D}function c1($){let D={capgo_api:aE0,"x-cli-version":i$.version,"x-cli-command":tE0,"x-cli-node":oE0,"x-cli-os":rE0()};if($)for(let[Q,X]of Object.entries($))D[Q]=Y2(Q,X);return D}var aE0="2025-10-01",tE0="",J2;var t6=a(()=>{Q8();u1();J2=new Set(["authorization","capgkey","x-capgo-log-token"])});var Zb,Fb=($)=>{return $===12288||$>=65281&&$<=65376||$>=65504&&$<=65510},Gb=($)=>{return $===8987||$===9001||$>=12272&&$<=12287||$>=12289&&$<=12350||$>=12441&&$<=12543||$>=12549&&$<=12591||$>=12593&&$<=12686||$>=12688&&$<=12771||$>=12783&&$<=12830||$>=12832&&$<=12871||$>=12880&&$<=19903||$>=65040&&$<=65049||$>=65072&&$<=65106||$>=65108&&$<=65126||$>=65128&&$<=65131||$>=127488&&$<=127490||$>=127504&&$<=127547||$>=127552&&$<=127560||$>=131072&&$<=196605||$>=196608&&$<=262141};var Ub=a(()=>{Zb=(()=>{let $=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return(D)=>{let Q=0;$.lastIndex=0;while($.test(D))Q+=1;return D.length-Q}})()});var $j0,Dj0,Wb,Qj0,qb,Xj0,Jj0,Yj0,zb=($,D={},Q={})=>{let X=D.limit??1/0,J=D.ellipsis??"",Y=D?.ellipsisWidth??(J?zb(J,Yj0,Q).width:0),Z=0,F=Q.controlWidth??0,G=Q.tabWidth??8,U=Q.emojiWidth??2,W=2,q=Q.regularWidth??1,z=Q.wideWidth??2,K=[[Xj0,q],[$j0,0],[Dj0,F],[Qj0,G],[qb,U],[Wb,z]],H=0,V=0,O=$.length,N=0,B=!1,L=O,M=Math.max(0,X-Y),w=0,R=0,S=0,x=0;$:while(!0){if(R>w||V>=O&&V>H){let j=$.slice(w,R)||$.slice(H,V);N=0;for(let v of j.replaceAll(Jj0,"")){let _=v.codePointAt(0)||0;if(Fb(_))x=2;else if(Gb(_))x=z;else x=q;if(S+x>M)L=Math.min(L,Math.max(w,H)+N);if(S+x>X){B=!0;break $}N+=v.length,S+=x}w=R=0}if(V>=O)break $;for(let j=0,v=K.length;j<v;j++){let[_,h]=K[j];if(_.lastIndex=V,_.test($)){if(N=_===Wb?Zb($.slice(V,_.lastIndex)):_===qb?1:_.lastIndex-V,x=N*h,S+x>M)L=Math.min(L,V+Math.floor((M-S)/h));if(S+x>X){B=!0;break $}S+=x,w=H,R=V,V=H=_.lastIndex;continue $}}V+=1}return{width:B?M:S,index:B?L:O,truncated:B,ellipsed:B&&X>=Y}},Kb;var Hb=a(()=>{Ub();$j0=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,Dj0=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Wb=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,Qj0=/\t{1,1000}/y,qb=/[\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,Xj0=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Jj0=/\p{M}+/gu,Yj0={limit:1/0,ellipsis:""},Kb=zb});var Zj0,Fj0=($,D={})=>{return Kb($,Zj0,D).width},P8;var Z2=a(()=>{Hb();Zj0={limit:1/0,ellipsis:"",ellipsisWidth:0},P8=Fj0});function R7($,D,Q){return String($).normalize().split(zj0).map((X)=>qj0(X,D,Q)).join(`
|
|
1
|
+
import{createRequire as pE0}from"node:module";var module={exports:{}};var gE0=Object.create;var{getPrototypeOf:mE0,defineProperty:lF,getOwnPropertyNames:Jb}=Object;var Q2=Object.prototype.hasOwnProperty;function X2($){return this[$]}var z0=($,D,Q)=>{var X=Jb(D);for(let J of X)if(!Q2.call($,J)&&J!=="default")lF($,J,{get:X2.bind(D,J),enumerable:!0});if(Q){for(let J of X)if(!Q2.call(Q,J)&&J!=="default")lF(Q,J,{get:X2.bind(D,J),enumerable:!0});return Q}},dE0,cE0,P1=($,D,Q)=>{var X=$!=null&&typeof $==="object";if(X){var J=D?dE0??=new WeakMap:cE0??=new WeakMap,Y=J.get($);if(Y)return Y}Q=$!=null?gE0(mE0($)):{};let Z=D||!$||!$.__esModule?lF(Q,"default",{value:$,enumerable:!0}):Q;for(let F of Jb($))if(!Q2.call(Z,F))lF(Z,F,{get:X2.bind($,F),enumerable:!0});if(X)J.set($,Z);return Z};var E=($,D)=>()=>(D||$((D={exports:{}}).exports,D),D.exports);var lE0=($)=>$;function nE0($,D){this[$]=lE0.bind(null,D)}var Q6=($,D)=>{for(var Q in D)lF($,Q,{get:D[Q],enumerable:!0,configurable:!0,set:nE0.bind(D,Q)})};var a=($,D)=>()=>($&&(D=$($=0)),D);var D0=pE0(import.meta.url);var i$;var Q8=a(()=>{i$={name:"@capgo/cli",type:"module",version:"8.47.1",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/capgo/tree/main/cli#readme",repository:{type:"git",url:"https://github.com/Cap-go/capgo.app",directory:"cli"},bugs:{url:"https://github.com/Cap-go/capgo/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli","sdk","tanstack-intent"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",bin:{capgo:"dist/index.js"},files:["!skills/_artifacts","dist","skills"],engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && bun build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js","dev-build":"SUPA_DB=development ncc build",pack:"pkg",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: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: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-list-output-text":"bun test/test-app-list-output-text.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-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:cli-user-error-config":"bun test/test-cli-user-error-config.mjs","test:init-monorepo-targeting":"bun run test:capacitor-config-target && bun run test:cli-user-error-config && bun test/test-init-monorepo-targeting.mjs","test:prompt-preferences":"bun test/test-prompt-preferences.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:auth-session":"bun test/test-auth-session.mjs","test:mcp":"node test/test-mcp.mjs","test:mcp-no-key-handshake":"node test/test-mcp-no-key-handshake.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs","test:project-type-detection":"bun test/test-project-type-detection.mjs","test:payload-split":"bun test/test-payload-split.mjs","test:macos-signing":"bun test/test-macos-signing.mjs","test:helper-dce":"bash scripts/check-helper-dce.sh","test:apple-api-import-helpers":"bun test/test-apple-api-import-helpers.mjs","test:apple-api-verify-key":"bun test/test-apple-api-verify-key.mjs","test:bundle-id-detector":"bun test/test-bundle-id-detector.mjs","test:apple-api-app-list":"bun test/test-apple-api-app-list.mjs","test:apple-api-cert-create":"bun test/test-apple-api-cert-create.mjs","test:app-verification":"bun test/test-app-verification.mjs","test:pbxproj-parser":"bun test/test-pbxproj-parser.mjs","test:manifest-path-encoding":"bun test/test-manifest-path-encoding.mjs","test:self-update":"bun test/test-self-update.mjs","test:update-prompt":"bun test/test-update-prompt.mjs","test:android-tail-engine":"bun test/test-android-tail-engine.mjs","test:android-tail-render":"bun test/test-android-tail-render.mjs","test:android-tail-routing":"bun test/test-android-tail-routing.mjs","test:dev-gate-stripped":"bun test/test-dev-gate-stripped.mjs","test:frame-fit-ios-shared":"bun test/test-frame-fit-ios-shared.mjs","test:ios-confirm-app-id":"bun test/test-ios-confirm-app-id.mjs","test:ios-create-new":"bun test/test-ios-create-new.mjs","test:ios-e2e":"bun test/test-ios-e2e.mjs","test:ios-flow-contract":"bun test/test-ios-flow-contract.mjs","test:ios-import-discovery":"bun test/test-ios-import-discovery.mjs","test:ios-import-export":"bun test/test-ios-import-export.mjs","test:ios-import-pickers":"bun test/test-ios-import-pickers.mjs","test:ios-import-recovery":"bun test/test-ios-import-recovery.mjs","test:ios-recovery":"bun test/test-ios-recovery.mjs","test:ios-resume":"bun test/test-ios-resume.mjs","test:ios-tail-handoff":"bun test/test-ios-tail-handoff.mjs","test:ios-tui-render":"bun test/test-ios-tui-render.mjs","test:p8-error":"bun test/test-p8-error.mjs","test:ios-tui-routing":"bun test/test-ios-tui-routing.mjs","test:ios-updater-sync-validation":"bun test/test-ios-updater-sync-validation.mjs","test:ios-verify-app":"bun test/test-ios-verify-app.mjs","test:ios-marketing-version":"bun test/test-ios-marketing-version.mjs","test:android-version":"bun test/test-android-version.mjs","test:platform-flow-contract":"bun test/test-platform-flow-contract.mjs","test:tail-engine-shared":"bun test/test-tail-engine-shared.mjs",test:"bun run build && bun run test:helper-dce && bun run test:version-detection:setup && bun run test:bundle && bun run test: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: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: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: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-list-output-text && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:cli-recovery && bun run test:create-supabase-client && bun run test:build-platform-selection && bun run test:builder-project-discovery && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-monorepo-targeting && bun run test:init-app-conflict && bun run test:channel-add-exists && bun run test:wait-log && bun run test:init-guardrails && bun run test:init-replay && bun run test:init-telemetry && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:mcp-no-key-handshake && bun run test:auth-session && bun run test:version-detection && bun run test:platform-paths && bun run test:project-type-detection && bun run test:payload-split && bun run test:manifest-path-encoding && bun run test:macos-signing && bun run test:asc-key-protocol && bun run test:apple-api-import-helpers && bun run test:apple-api-verify-key && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:cicd-failure-help && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-upload-prompt && bun run test:support-bundle-files && bun run test:self-update && bun run test:update-prompt && bun run test:apple-api-cert-create && bun run test:android-tail-engine && bun run test:android-tail-render && bun run test:android-tail-routing && bun run test:dev-gate-stripped && bun run test:frame-fit-ios-shared && bun run test:ios-confirm-app-id && bun run test:ios-create-new && bun run test:ios-e2e && bun run test:ios-flow-contract && bun run test:ios-import-discovery && bun run test:ios-import-export && bun run test:ios-import-pickers && bun run test:ios-import-recovery && bun run test:ios-recovery && bun run test:ios-resume && bun run test:ios-tail-handoff && bun run test:ios-tui-render && bun run test:p8-error && bun run test:ios-tui-routing && bun run test:ios-updater-sync-validation && bun run test:ios-verify-app && bun run test:ios-marketing-version && bun run test:android-version && bun run test:platform-flow-contract && bun run test:tail-engine-shared && bun run test:prescan && bun run test:android-reporting-api && bun run test:android-gcp && bun run test:android-app-verification && bun run test:android-rename && bun run test:appflow-auth && bun run test:appflow-api-map && bun run test:appflow-validate && bun run test:appflow-flow && bun run test:appflow-gapfill && bun run test:appflow-engine && bun run test:appflow-tail && bun run test:appflow-fetch && bun run test:appflow-sa-decode && bun run test:app-permission-helper && bun run test:2fa-compliance-network && bun run test:organization-set-api-host && bun run test:trial-warning && bun run test:plan-validation","test:build-platform-selection":"bun test/test-build-platform-selection.mjs","test:builder-project-discovery":"bun test/test-builder-project-discovery.mjs","test:ai-log-capture":"bun test/test-ai-log-capture.mjs","test:ai-analyze-flow":"bun test/test-ai-analyze-flow.mjs","test:cicd-failure-help":"bun test/test-cicd-failure-help.mjs","test:ai-analyze-stream":"bun test/test-ai-analyze-stream.mjs","test:ai-sse-parser":"bun test/test-ai-sse-parser.mjs","test:ai-render-markdown":"bun test/test-ai-render-markdown.mjs","test:ai-onboarding-mode":"bun test/test-ai-onboarding-mode.mjs","test:ai-fit":"bun test/test-ai-fit.mjs","test:platform-layout":"bun test/test-platform-layout.mjs","test:frame-fit":"bun test/run-frame-fit.mjs","test:onboarding-min-size":"bun test/test-onboarding-min-size.mjs","test:min-size-gate":"bun test/test-min-size-gate.mjs","test:shell-size-gate":"bun test/test-shell-size-gate.mjs","test:build-log-sanitize":"bun test/test-build-log-sanitize.mjs","test:build-output-viewport":"bun test/test-build-output-viewport.mjs","test:diff-viewer-viewport":"bun test/test-diff-viewer-viewport.mjs","test:build-complete-exit":"bun test/test-build-complete-exit.mjs","test:ai-stream-markdown":"bun test/test-ai-stream-markdown.mjs","test:support-mailto":"bun test/test-support-mailto.mjs","test:support-redact":"bun test/test-support-redact.mjs","test:support-internal-log":"bun test/test-support-internal-log.mjs","test:support-help-menu":"bun test/test-support-help-menu.mjs","test:support-contact":"bun test/test-support-contact.mjs","test:support-upload-prompt":"bun test/test-support-upload-prompt.mjs","test:support-bundle-files":"bun test/test-support-bundle-files.mjs","test:mcp-live-update-onboarding":"bun test/test-mcp-live-update-onboarding.mjs","test:app-set-options":"bun test/test-app-set-options.mjs && bun test/test-app-list-options.mjs","test:android-reporting-api":"bun test/test-android-reporting-api.mjs","test:android-gcp":"bun test/test-android-gcp.mjs","test:android-app-verification":"bun test/test-android-app-verification.mjs","test:android-rename":"bun test/test-android-rename.mjs","test:appflow-auth":"bun test/test-appflow-auth.mjs","test:appflow-api-map":"bun test/test-appflow-api-map.mjs","test:appflow-validate":"bun test/test-appflow-validate.mjs","test:appflow-flow":"bun test/test-appflow-flow.mjs","test:appflow-gapfill":"bun test/test-appflow-gapfill.mjs","test:appflow-engine":"bun test/test-appflow-engine.mjs","test:appflow-tail":"bun test/test-appflow-tail.mjs","test:appflow-fetch":"bun test/test-appflow-fetch.mjs","test:appflow-sa-decode":"bun test/test-appflow-sa-decode.mjs","test:app-permission-helper":"bun test/test-app-permission-helper.mjs","test:2fa-compliance-network":"bun test/test-2fa-compliance-network.mjs","test:organization-set-api-host":"bun test/test-organization-set-api-host.mjs","test:trial-warning":"bun test/test-trial-warning.mjs","test:plan-validation":"bun test/test-plan-validation.mjs","test:auto-bump-version":"bun test/test-auto-bump-version.mjs","test:auto-bump-ai-diff":"bun test/test-auto-bump-ai-diff.mjs"},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","@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 U0;var u1=a(()=>{U0=class U0 extends Error{context;constructor($,D){super($);this.name="CliUserError",this.context=D}}});import{platform as rE0}from"node:os";import{version as oE0}from"node:process";function sE0($){for(let D=0;D<$.length;D++)if($.charCodeAt(D)>255)return!1;return!0}function Yb($){if($.toLowerCase()==="x-capgo-log-token")return"Build log token is missing. Re-run the build command or pass a valid log token.";return"Capgo API key is missing. Run `npx -y @capgo/cli@latest login` or pass `--apikey`."}function eE0($){if($.toLowerCase()==="x-capgo-log-token")return"Build log token contains invalid characters (only ASCII is allowed). Re-run the build command to get a fresh token.";if($.toLowerCase()==="authorization")return"Authorization header contains invalid characters (only ASCII is allowed). Check your Capgo API key or Supabase anon key configuration.";return"Capgo API key contains invalid characters (only ASCII is allowed). Copy the key from the Capgo dashboard."}function Y2($,D){if(D===void 0||D===null){if(J2.has($.toLowerCase()))throw new U0(Yb($));throw new U0(`HTTP header "${$}" is missing or invalid.`)}if(typeof D!=="string"){if(J2.has($.toLowerCase()))throw new U0(Yb($));throw new U0(`HTTP header "${$}" is missing or invalid.`)}if(!sE0(D)){if(J2.has($.toLowerCase()))throw new U0(eE0($));throw new U0(`HTTP header "${$}" contains invalid characters (only ASCII is allowed).`)}return D}function c1($){let D={capgo_api:aE0,"x-cli-version":i$.version,"x-cli-command":tE0,"x-cli-node":oE0,"x-cli-os":rE0()};if($)for(let[Q,X]of Object.entries($))D[Q]=Y2(Q,X);return D}var aE0="2025-10-01",tE0="",J2;var t6=a(()=>{Q8();u1();J2=new Set(["authorization","capgkey","x-capgo-log-token"])});var Zb,Fb=($)=>{return $===12288||$>=65281&&$<=65376||$>=65504&&$<=65510},Gb=($)=>{return $===8987||$===9001||$>=12272&&$<=12287||$>=12289&&$<=12350||$>=12441&&$<=12543||$>=12549&&$<=12591||$>=12593&&$<=12686||$>=12688&&$<=12771||$>=12783&&$<=12830||$>=12832&&$<=12871||$>=12880&&$<=19903||$>=65040&&$<=65049||$>=65072&&$<=65106||$>=65108&&$<=65126||$>=65128&&$<=65131||$>=127488&&$<=127490||$>=127504&&$<=127547||$>=127552&&$<=127560||$>=131072&&$<=196605||$>=196608&&$<=262141};var Ub=a(()=>{Zb=(()=>{let $=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return(D)=>{let Q=0;$.lastIndex=0;while($.test(D))Q+=1;return D.length-Q}})()});var $j0,Dj0,Wb,Qj0,qb,Xj0,Jj0,Yj0,zb=($,D={},Q={})=>{let X=D.limit??1/0,J=D.ellipsis??"",Y=D?.ellipsisWidth??(J?zb(J,Yj0,Q).width:0),Z=0,F=Q.controlWidth??0,G=Q.tabWidth??8,U=Q.emojiWidth??2,W=2,q=Q.regularWidth??1,z=Q.wideWidth??2,K=[[Xj0,q],[$j0,0],[Dj0,F],[Qj0,G],[qb,U],[Wb,z]],H=0,V=0,O=$.length,N=0,B=!1,L=O,M=Math.max(0,X-Y),w=0,R=0,S=0,x=0;$:while(!0){if(R>w||V>=O&&V>H){let j=$.slice(w,R)||$.slice(H,V);N=0;for(let v of j.replaceAll(Jj0,"")){let _=v.codePointAt(0)||0;if(Fb(_))x=2;else if(Gb(_))x=z;else x=q;if(S+x>M)L=Math.min(L,Math.max(w,H)+N);if(S+x>X){B=!0;break $}N+=v.length,S+=x}w=R=0}if(V>=O)break $;for(let j=0,v=K.length;j<v;j++){let[_,h]=K[j];if(_.lastIndex=V,_.test($)){if(N=_===Wb?Zb($.slice(V,_.lastIndex)):_===qb?1:_.lastIndex-V,x=N*h,S+x>M)L=Math.min(L,V+Math.floor((M-S)/h));if(S+x>X){B=!0;break $}S+=x,w=H,R=V,V=H=_.lastIndex;continue $}}V+=1}return{width:B?M:S,index:B?L:O,truncated:B,ellipsed:B&&X>=Y}},Kb;var Hb=a(()=>{Ub();$j0=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,Dj0=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Wb=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,Qj0=/\t{1,1000}/y,qb=/[\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,Xj0=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Jj0=/\p{M}+/gu,Yj0={limit:1/0,ellipsis:""},Kb=zb});var Zj0,Fj0=($,D={})=>{return Kb($,Zj0,D).width},P8;var Z2=a(()=>{Hb();Zj0={limit:1/0,ellipsis:"",ellipsisWidth:0},P8=Fj0});function R7($,D,Q){return String($).normalize().split(zj0).map((X)=>qj0(X,D,Q)).join(`
|
|
2
2
|
`)}var gq="\x1B",Nb="",Gj0=39,G2="\x07",wb="[",Uj0="]",Bb="m",U2,Vb,Ob=($)=>{if($>=30&&$<=37)return 39;if($>=90&&$<=97)return 39;if($>=40&&$<=47)return 49;if($>=100&&$<=107)return 49;if($===1||$===2)return 22;if($===3)return 23;if($===4)return 24;if($===7)return 27;if($===8)return 28;if($===9)return 29;if($===0)return 0;return},Lb=($)=>`${gq}${wb}${$}${Bb}`,Mb=($)=>`${gq}${U2}${$}${G2}`,F2=($,D,Q)=>{let X=D[Symbol.iterator](),J=!1,Y=!1,Z=$.at(-1),F=Z===void 0?0:P8(Z),G=X.next(),U=X.next(),W=0;while(!G.done){let q=G.value,z=P8(q);if(F+z<=Q)$[$.length-1]+=q;else $.push(q),F=0;if(q===gq||q===Nb)J=!0,Y=D.startsWith(U2,W+1);if(J){if(Y){if(q===G2)J=!1,Y=!1}else if(q===Bb)J=!1}else if(F+=z,F===Q&&!U.done)$.push(""),F=0;G=U,U=X.next(),W+=q.length}if(Z=$.at(-1),!F&&Z!==void 0&&Z.length&&$.length>1)$[$.length-2]+=$.pop()},Wj0=($)=>{let D=$.split(" "),Q=D.length;while(Q){if(P8(D[Q-1]))break;Q--}if(Q===D.length)return $;return D.slice(0,Q).join(" ")+D.slice(Q).join("")},qj0=($,D,Q={})=>{if(Q.trim!==!1&&$.trim()==="")return"";let X="",J,Y,Z=$.split(" "),F=[""],G=0;for(let q=0;q<Z.length;q++){let z=Z[q];if(Q.trim!==!1){let H=F.at(-1)??"",V=H.trimStart();if(H.length!==V.length)F[F.length-1]=V,G=P8(V)}if(q!==0){if(G>=D&&(Q.wordWrap===!1||Q.trim===!1))F.push(""),G=0;if(G||Q.trim===!1)F[F.length-1]+=" ",G++}let K=P8(z);if(Q.hard&&K>D){let H=D-G,V=1+Math.floor((K-H-1)/D);if(Math.floor((K-1)/D)<V)F.push("");F2(F,z,D),G=P8(F.at(-1)??"");continue}if(G+K>D&&G&&K){if(Q.wordWrap===!1&&G<D){F2(F,z,D),G=P8(F.at(-1)??"");continue}F.push(""),G=0}if(G+K>D&&Q.wordWrap===!1){F2(F,z,D),G=P8(F.at(-1)??"");continue}F[F.length-1]+=z,G+=K}if(Q.trim!==!1)F=F.map((q)=>Wj0(q));let U=F.join(`
|
|
3
3
|
`),W=!1;for(let q=0;q<U.length;q++){let z=U[q];if(X+=z,!W){if(W=z>="\uD800"&&z<="\uDBFF",W)continue}else W=!1;if(z===gq||z===Nb){Vb.lastIndex=q+1;let H=Vb.exec(U)?.groups;if(H?.code!==void 0){let V=Number.parseFloat(H.code);J=V===Gj0?void 0:V}else if(H?.uri!==void 0)Y=H.uri.length===0?void 0:H.uri}if(U[q+1]===`
|
|
4
4
|
`){if(Y)X+=Mb("");let K=J?Ob(J):void 0;if(J&&K)X+=Lb(K)}else if(z===`
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capgo/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "8.47.
|
|
4
|
+
"version": "8.47.1",
|
|
5
5
|
"description": "A CLI to upload to capgo servers",
|
|
6
6
|
"author": "Martin martin@capgo.app",
|
|
7
7
|
"license": "Apache 2.0",
|
|
@@ -176,7 +176,7 @@
|
|
|
176
176
|
"test:android-version": "bun test/test-android-version.mjs",
|
|
177
177
|
"test:platform-flow-contract": "bun test/test-platform-flow-contract.mjs",
|
|
178
178
|
"test:tail-engine-shared": "bun test/test-tail-engine-shared.mjs",
|
|
179
|
-
"test": "bun run build && bun run test:helper-dce && bun run test:version-detection:setup && bun run test:bundle && 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: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: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: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-list-output-text && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:cli-recovery && bun run test:create-supabase-client && bun run test:build-platform-selection && bun run test:builder-project-discovery && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-monorepo-targeting && bun run test:init-app-conflict && bun run test:channel-add-exists && bun run test:wait-log && bun run test:init-guardrails && bun run test:init-replay && bun run test:init-telemetry && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:mcp-no-key-handshake && bun run test:auth-session && bun run test:version-detection && bun run test:platform-paths && bun run test:project-type-detection && bun run test:payload-split && bun run test:manifest-path-encoding && bun run test:macos-signing && bun run test:asc-key-protocol && bun run test:apple-api-import-helpers && bun run test:apple-api-verify-key && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:cicd-failure-help && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-upload-prompt && bun run test:support-bundle-files && bun run test:self-update && bun run test:update-prompt && bun run test:apple-api-cert-create && bun run test:android-tail-engine && bun run test:android-tail-render && bun run test:android-tail-routing && bun run test:dev-gate-stripped && bun run test:frame-fit-ios-shared && bun run test:ios-confirm-app-id && bun run test:ios-create-new && bun run test:ios-e2e && bun run test:ios-flow-contract && bun run test:ios-import-discovery && bun run test:ios-import-export && bun run test:ios-import-pickers && bun run test:ios-import-recovery && bun run test:ios-recovery && bun run test:ios-resume && bun run test:ios-tail-handoff && bun run test:ios-tui-render && bun run test:p8-error && bun run test:ios-tui-routing && bun run test:ios-updater-sync-validation && bun run test:ios-verify-app && bun run test:ios-marketing-version && bun run test:android-version && bun run test:platform-flow-contract && bun run test:tail-engine-shared && bun run test:prescan && bun run test:android-reporting-api && bun run test:android-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",
|
|
179
|
+
"test": "bun run build && bun run test:helper-dce && bun run test:version-detection:setup && bun run test:bundle && 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: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: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: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-list-output-text && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:cli-recovery && bun run test:create-supabase-client && bun run test:build-platform-selection && bun run test:builder-project-discovery && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-monorepo-targeting && bun run test:init-app-conflict && bun run test:channel-add-exists && bun run test:wait-log && bun run test:init-guardrails && bun run test:init-replay && bun run test:init-telemetry && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:mcp-no-key-handshake && bun run test:auth-session && bun run test:version-detection && bun run test:platform-paths && bun run test:project-type-detection && bun run test:payload-split && bun run test:manifest-path-encoding && bun run test:macos-signing && bun run test:asc-key-protocol && bun run test:apple-api-import-helpers && bun run test:apple-api-verify-key && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:cicd-failure-help && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-upload-prompt && bun run test:support-bundle-files && bun run test:self-update && bun run test:update-prompt && bun run test:apple-api-cert-create && bun run test:android-tail-engine && bun run test:android-tail-render && bun run test:android-tail-routing && bun run test:dev-gate-stripped && bun run test:frame-fit-ios-shared && bun run test:ios-confirm-app-id && bun run test:ios-create-new && bun run test:ios-e2e && bun run test:ios-flow-contract && bun run test:ios-import-discovery && bun run test:ios-import-export && bun run test:ios-import-pickers && bun run test:ios-import-recovery && bun run test:ios-recovery && bun run test:ios-resume && bun run test:ios-tail-handoff && bun run test:ios-tui-render && bun run test:p8-error && bun run test:ios-tui-routing && bun run test:ios-updater-sync-validation && bun run test:ios-verify-app && bun run test:ios-marketing-version && bun run test:android-version && bun run test:platform-flow-contract && bun run test:tail-engine-shared && bun run test:prescan && bun run test:android-reporting-api && bun run test:android-gcp && bun run test:android-app-verification && bun run test:android-rename && bun run test:appflow-auth && bun run test:appflow-api-map && bun run test:appflow-validate && bun run test:appflow-flow && bun run test:appflow-gapfill && bun run test:appflow-engine && bun run test:appflow-tail && bun run test:appflow-fetch && bun run test:appflow-sa-decode && bun run test:app-permission-helper && bun run test:2fa-compliance-network && bun run test:organization-set-api-host && bun run test:trial-warning && bun run test:plan-validation",
|
|
180
180
|
"test:build-platform-selection": "bun test/test-build-platform-selection.mjs",
|
|
181
181
|
"test:builder-project-discovery": "bun test/test-builder-project-discovery.mjs",
|
|
182
182
|
"test:ai-log-capture": "bun test/test-ai-log-capture.mjs",
|
|
@@ -207,6 +207,7 @@
|
|
|
207
207
|
"test:mcp-live-update-onboarding": "bun test/test-mcp-live-update-onboarding.mjs",
|
|
208
208
|
"test:app-set-options": "bun test/test-app-set-options.mjs && bun test/test-app-list-options.mjs",
|
|
209
209
|
"test:android-reporting-api": "bun test/test-android-reporting-api.mjs",
|
|
210
|
+
"test:android-gcp": "bun test/test-android-gcp.mjs",
|
|
210
211
|
"test:android-app-verification": "bun test/test-android-app-verification.mjs",
|
|
211
212
|
"test:android-rename": "bun test/test-android-rename.mjs",
|
|
212
213
|
"test:appflow-auth": "bun test/test-appflow-auth.mjs",
|