@capgo/cli 8.81.0 → 8.82.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -67,7 +67,7 @@ ${X}
|
|
|
67
67
|
`}}}}).prompt();var JB=fA(()=>{GZA();GZA();s7A();n7A();Hx=rA(e7A(),1);KZA=OfQ(),NfQ=p$("◆","*"),qfA=p$("■","x"),zfA=p$("▲","x"),HZA=p$("◇","o"),CfQ=p$("┌","T"),r8=p$("│","|"),bU=p$("└","—"),RGB=p$("┐","T"),EGB=p$("┘","—"),WZA=p$("●",">"),tn=p$("○"," "),jGB=p$("◻","[•]"),wGB=p$("◼","[+]"),_GB=p$("◻","[ ]"),VfQ=p$("▪","•"),PGB=p$("─","-"),TGB=p$("╮","+"),SGB=p$("├","+"),kGB=p$("╯","+"),bGB=p$("╰","+"),xGB=p$("╭","+"),RfQ=p$("●","•"),EfQ=p$("◆","*"),jfQ=p$("▲","!"),wfQ=p$("■","x");vGB=[`${T0("dim","↑/↓")} to navigate`,`${T0("dim","Space:")} select`,`${T0("dim","Enter:")} confirm`],f={message:(A=[],{symbol:Q=T0("gray",r8),secondarySymbol:B=T0("gray",r8),output:$=process.stdout,spacing:J=1,withGuide:Y}={})=>{let Z=[],X=Y??L5.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,...z]=H;U.length>0?Z.push(`${K}${U}`):Z.push(X?Q:"");for(let D of z)D.length>0?Z.push(`${W}${D}`):Z.push(X?B:"")}$.write(`${Z.join(`
|
|
69
69
|
`)}
|
|
70
|
-
`)},info:(A,Q)=>{f.message(A,{...Q,symbol:T0("blue",RfQ)})},success:(A,Q)=>{f.message(A,{...Q,symbol:T0("green",EfQ)})},step:(A,Q)=>{f.message(A,{...Q,symbol:T0("green",HZA)})},warn:(A,Q)=>{f.message(A,{...Q,symbol:T0("yellow",jfQ)})},warning:(A,Q)=>{f.warn(A,Q)},error:(A,Q)=>{f.message(A,{...Q,symbol:T0("red",wfQ)})}},fGB={light:p$("─","-"),heavy:p$("━","="),block:p$("█","#")},kfQ=[`${T0("dim","↑/↓")} to navigate`,`${T0("dim","Enter:")} confirm`],gGB=`${T0("gray",r8)} `});var I$;var IX=fA(()=>{I$={name:"@capgo/cli",type:"module",version:"8.81.0",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/capgo/tree/main/cli#readme",repository:{type:"git",url:"https://github.com/Cap-go/capgo.app",directory:"cli"},bugs:{url:"https://github.com/Cap-go/capgo/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli","sdk","tanstack-intent"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",bin:{capgo:"dist/index.js"},files:["!skills/_artifacts","dist","skills"],engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && bun build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"bunx --bun supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",typecheck:"tsgo --project tsconfig.tsgo.json --noEmit",lint:"bun run lint:ox","lint:ox":"oxlint --config ../.oxlintrc.json src","lint:fix":"oxlint --config ../.oxlintrc.json --fix src","check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test:notify-app-ready-background":"bun test ./test/test-notify-app-ready-background.mjs ./test/test-background-check-shutdown.mjs","test:bundle":"bun test/test-bundle.mjs","test:bundle-validation":"bun test test/bundle/","test:prescan":"bun test test/prescan/","test:functional":"bun test/test-functional.mjs","test:semver":"bun test/test-semver-validation.mjs","test:version-edge-cases":"bun test/test-version-validation.mjs","test:regex":"bun test/test-regex-validation.mjs","test:upload":"bun test/test-upload-validation.mjs","test:fail-on-incompatible":"bun test/test-fail-on-incompatible.mjs","test:native-dependencies":"bun test/test-native-dependencies.mjs && bun test/test-get-remote-dependencies.mjs","test:package-json-guard":"bun test/test-package-json-guard.mjs","test:credentials":"bun test/test-credentials.mjs","test:credentials-export":"bun test/test-credentials-export.mjs","test:asc-key-protocol":"bun test/test-asc-key-protocol.mjs","test:credentials-validation":"bun test/test-credentials-validation.mjs","test:android-service-account-validation":"bun test/test-android-service-account-validation.mjs","test:build-zip-filter":"bun test/test-build-zip-filter.mjs","test:checksum":"bun test/test-checksum-algorithm.mjs","test:build-needed":"bun test/test-build-needed.mjs","test:cli-help":"bun test/test-cli-help.mjs","test:build-cache-payload":"bun test/test-build-cache-payload.mjs","test:build-cancellation":"bun test/test-build-cancellation.mjs","test:ci-prompts":"bun test/test-ci-prompts.mjs","test:capgo-app-id-prompt":"bun test/test-capgo-app-id-prompt.mjs","test:ci-secrets":"bun test/test-ci-secrets.mjs","test:android-onboarding-progress":"bun test/test-android-onboarding-progress.mjs && bun test/test-android-select-guard.mjs","test:android-keystore-action":"bun test/test-android-keystore-action.mjs","test:android-google-play-action":"bun test/test-android-google-play-action.mjs","test:onboarding-telemetry":"bun test/test-onboarding-telemetry.mjs","test:v2-event-migration":"bun test/test-v2-event-migration.mjs","test:analytics":"bun test/test-analytics.mjs","test:cli-headers":"bun test/test-cli-headers.mjs","test:min-cli-version":"bun test/test-min-cli-version.mjs","test:authenticated-command-invocation":"bun test/test-authenticated-command-invocation.mjs","test:analytics-error-category":"bun test/test-analytics-error-category.mjs","test:analytics-org-resolver":"bun test/test-analytics-org-resolver.mjs","test:supabase-perf":"bun test/test-supabase-perf.mjs","test:preview-qr":"bun test/test-preview-qr.mjs","test:bundle-pages":"bun test test/test-bundle-pages.test.ts","test:mcp-analytics":"bun test/test-mcp-analytics.mjs","test:mcp-instructions":"bun test/test-mcp-instructions.mjs","test:mcp-stdout-guard":"bun test/test-mcp-stdout-guard.mjs","test:mcp-platform-select":"bun test/test-mcp-platform-select.mjs","test:mcp-explain-scopes":"bun test/test-mcp-explain-scopes.mjs","test:mcp-oauth-reopen":"bun test/test-mcp-oauth-reopen.mjs","test:mcp-broker-oauth":"bun test/test-mcp-broker-oauth.mjs","test:mcp-broker-session":"bun test/test-mcp-broker-session.mjs","test:mcp-credentials-manage":"bun test/test-mcp-credentials-manage.mjs","test:mcp-resume-prompt":"bun test/test-mcp-resume-prompt.mjs","test:mcp-build-job":"bun test/test-mcp-build-job.mjs","test:mcp-build-tools":"bun test/test-mcp-build-tools.mjs","test:app-created-source":"bun test/test-app-created-source.mjs","test:app-add-exists":"bun test/test-app-add-exists.mjs","test:app-add-getting-started":"bun test/test-app-add-getting-started.mjs","test:app-list-output-text":"bun test/test-app-list-output-text.mjs","test:app-todo":"bun test/test-app-todo.mjs","test:doctor-analytics":"bun test/test-doctor-analytics.mjs","test:posthog-exception":"bun test/test-posthog-exception.mjs","test:cli-recovery":"bun test/test-cli-recovery.mjs","test:create-supabase-client":"bun test/test-create-supabase-client.mjs","test:onboarding-recovery":"bun test/test-onboarding-recovery.mjs","test:onboarding-progress":"bun test/test-onboarding-progress.mjs","test:onboarding-run-targets":"bun test/test-onboarding-run-targets.mjs","test:run-device-command":"bun test/test-run-device-command.mjs","test:init-app-conflict":"bun test/test-init-app-conflict.mjs","test:channel-add-exists":"bun test/test-channel-add-exists.mjs","test:wait-log":"bun test/test-wait-log.mjs","test:init-guardrails":"bun test/test-init-guardrails.mjs","test:init-upload-recovery":"bun test/test-init-upload-error-gate.mjs && bun test/test-init-upload-monorepo-recovery.mjs","test:init-replay":"bun test/test-init-replay.mjs","test:init-telemetry":"bun test/test-init-telemetry.mjs","test:capacitor-config-target":"bun test/test-capacitor-config-target.mjs","test:builder-app-id-config":"bun test/test-builder-app-id-config.mjs","test:capacitor-config-typescript7":"bun test/test-capacitor-config-typescript7.mjs","test:capacitor-config-native-import":"bun test/test-capacitor-config-native-import.mjs","test:cli-user-error-config":"bun test/test-cli-user-error-config.mjs","test:cordova-upload-mode":"bun test/test-cordova-upload-mode.mjs","test:init-monorepo-targeting":"bun run test:capacitor-config-target && bun run test:builder-app-id-config && bun run test:capacitor-config-typescript7 && bun run test:capacitor-config-native-import && bun run test:cli-user-error-config && bun test/test-init-monorepo-targeting.mjs","test:prompt-preferences":"bun test/test-prompt-preferences.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:auth-session":"bun test/test-auth-session.mjs","test:mcp":"node test/test-mcp.mjs","test:mcp-no-key-handshake":"node test/test-mcp-no-key-handshake.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs","test:project-type-detection":"bun test/test-project-type-detection.mjs","test:payload-split":"bun test/test-payload-split.mjs","test:macos-signing":"bun test/test-macos-signing.mjs","test:helper-dce":"bash scripts/check-helper-dce.sh","test:apple-api-import-helpers":"bun test/test-apple-api-import-helpers.mjs","test:apple-api-verify-key":"bun test/test-apple-api-verify-key.mjs","test:bundle-id-detector":"bun test/test-bundle-id-detector.mjs","test:apple-api-app-list":"bun test/test-apple-api-app-list.mjs","test:apple-api-cert-create":"bun test/test-apple-api-cert-create.mjs","test:app-verification":"bun test/test-app-verification.mjs","test:pbxproj-parser":"bun test/test-pbxproj-parser.mjs","test:self-update":"bun test/test-self-update.mjs","test:update-prompt":"bun test/test-update-prompt.mjs","test:android-tail-engine":"bun test/test-android-tail-engine.mjs","test:android-tail-render":"bun test/test-android-tail-render.mjs","test:android-tail-routing":"bun test/test-android-tail-routing.mjs","test:dev-gate-stripped":"bun test/test-dev-gate-stripped.mjs","test:frame-fit-ios-shared":"bun test/test-frame-fit-ios-shared.mjs","test:ios-confirm-app-id":"bun test/test-ios-confirm-app-id.mjs","test:ios-create-new":"bun test/test-ios-create-new.mjs","test:ios-certificate-action":"bun test/test-ios-certificate-action.mjs","test:ios-profile-action":"bun test/test-ios-profile-action.mjs","test:ios-credential-action":"bun test/test-ios-credential-action.mjs","test:ios-e2e":"bun test/test-ios-e2e.mjs","test:ios-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 scripts/run-test-suite.ts","test:run":"bun scripts/run-test-suite.ts","test:serial":"bun run build && bun scripts/run-test-suite.ts --serial","test:suite":"bun run test:helper-dce && bun run test:version-detection:setup && bun run test:bundle && bun run test:notify-app-ready-background && bun run test:bundle-validation && bun run test:functional && bun run test:semver && bun run test:auto-bump-version && bun run test:auto-bump-ai-diff && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:cordova-upload-mode && bun run test:fail-on-incompatible && bun run test:native-dependencies && bun run test:package-json-guard && bun run test:credentials && bun run test:credentials-export && bun run test:ios-provisioning-map && bun run test:ios-provisioning-command && bun run test:credentials-validation && bun run test:android-service-account-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:build-needed && bun run test:cli-help && bun run test:build-cache-payload && bun run test:build-cancellation && bun run test:ci-prompts && bun run test:capgo-app-id-prompt && bun run test:ci-secrets && bun run test:android-onboarding-progress && bun run test:android-keystore-action && bun run test:android-google-play-action && bun run test:onboarding-telemetry && bun run test:v2-event-migration && bun run test:analytics && bun run test:cli-headers && bun run test:min-cli-version && bun run test:authenticated-command-invocation && bun run test:analytics-error-category && bun run test:analytics-org-resolver && bun run test:supabase-perf && bun run test:preview-qr && bun run test:bundle-pages && bun run test:app-set-options && bun run test:mcp-analytics && bun run test:mcp-instructions && bun run test:mcp-live-update-onboarding && bun run test:mcp-stdout-guard && bun run test:mcp-platform-select && bun run test:mcp-explain-scopes && bun run test:mcp-oauth-reopen && bun run test:mcp-broker-oauth && bun run test:mcp-broker-session && bun run test:mcp-credentials-manage && bun run test:mcp-resume-prompt && bun run test:mcp-build-job && bun run test:mcp-build-tools && bun run test:app-created-source && bun run test:app-add-exists && bun run test:app-add-getting-started && bun run test:app-list-output-text && bun run test:app-todo && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:cli-recovery && bun run test:create-supabase-client && bun run test:build-platform-selection && bun run test:builder-project-discovery && bun run test:builder-app-selection && bun run test:builder-login-gate && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-monorepo-targeting && bun run test:init-app-conflict && bun run test:channel-list && bun run test:channel-add-exists && bun run test:wait-log && bun run test:init-guardrails && bun run test:init-upload-recovery && bun run test:init-replay && bun run test:init-telemetry && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:mcp-no-key-handshake && bun run test:auth-session && bun run test:version-detection && bun run test:platform-paths && bun run test:project-type-detection && bun run test:payload-split && bun run test:macos-signing && bun run test:asc-key-protocol && bun run test:apple-api-import-helpers && bun run test:apple-api-verify-key && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:cicd-failure-help && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-upload-prompt && bun run test:support-bundle-files && bun run test:self-update && bun run test:update-prompt && bun run test:apple-api-cert-create && bun run test:android-tail-engine && bun run test:android-tail-render && bun run test:android-tail-routing && bun run test:dev-gate-stripped && bun run test:frame-fit-ios-shared && bun run test:ios-confirm-app-id && bun run test:ios-create-new && bun run test:ios-certificate-action && bun run test:ios-profile-action && bun run test:ios-credential-action && bun run test:ios-e2e && bun run test:ios-flow-contract && bun run test:ios-import-discovery && bun run test:ios-import-export && bun run test:ios-import-pickers && bun run test:ios-import-recovery && bun run test:ios-recovery && bun run test:ios-resume && bun run test:ios-tail-handoff && bun run test:ios-tui-render && bun run test:p8-error && bun run test:ios-tui-routing && bun run test:ios-updater-sync-validation && bun run test:ios-verify-app && bun run test:ios-marketing-version && bun run test:android-version && bun run test:platform-flow-contract && bun run test:tail-engine-shared && bun run test:prescan && bun run test:android-reporting-api && bun run test:android-gcp && bun run test:android-app-verification && bun run test:android-rename && bun run test:appflow-auth && bun run test:appflow-api-map && bun run test:appflow-validate && bun run test:appflow-flow && bun run test:appflow-gapfill && bun run test:appflow-engine && bun run test:appflow-tail && bun run test:appflow-fetch && bun run test:appflow-sa-decode && bun run test:app-permission-helper && bun run test:2fa-compliance-network && bun run test:organization-set-api-host && bun run test:trial-warning && bun run test:plan-validation","test:build-platform-selection":"bun test/test-build-platform-selection.mjs","test:builder-project-discovery":"bun test/test-builder-project-discovery.mjs","test:builder-app-selection":"bun test/test-builder-app-selection.mjs","test:builder-login-gate":"bun test/test-builder-login-gate.mjs","test:ai-log-capture":"bun test/test-ai-log-capture.mjs","test:ai-analyze-flow":"bun test/test-ai-analyze-flow.mjs","test:cicd-failure-help":"bun test/test-cicd-failure-help.mjs","test:ai-analyze-stream":"bun test/test-ai-analyze-stream.mjs","test:ai-sse-parser":"bun test/test-ai-sse-parser.mjs","test:ai-render-markdown":"bun test/test-ai-render-markdown.mjs","test:ai-onboarding-mode":"bun test/test-ai-onboarding-mode.mjs","test:ai-fit":"bun test/test-ai-fit.mjs","test:platform-layout":"bun test/test-platform-layout.mjs","test:frame-fit":"bun test/run-frame-fit.mjs","test:onboarding-min-size":"bun test/test-onboarding-min-size.mjs","test:min-size-gate":"bun test/test-min-size-gate.mjs","test:shell-size-gate":"bun test/test-shell-size-gate.mjs","test:build-log-sanitize":"bun test/test-build-log-sanitize.mjs","test:build-output-viewport":"bun test/test-build-output-viewport.mjs","test:diff-viewer-viewport":"bun test/test-diff-viewer-viewport.mjs","test:build-complete-exit":"bun test/test-build-complete-exit.mjs","test:ai-stream-markdown":"bun test/test-ai-stream-markdown.mjs","test:support-mailto":"bun test/test-support-mailto.mjs","test:support-redact":"bun test/test-support-redact.mjs","test:support-internal-log":"bun test/test-support-internal-log.mjs","test:support-help-menu":"bun test/test-support-help-menu.mjs","test:support-contact":"bun test/test-support-contact.mjs","test:support-upload-prompt":"bun test/test-support-upload-prompt.mjs","test:support-bundle-files":"bun test/test-support-bundle-files.mjs","test:mcp-live-update-onboarding":"bun test/test-mcp-live-update-onboarding.mjs","test:app-set-options":"bun test/test-app-set-options.mjs && bun test/test-app-list-options.mjs","test:android-reporting-api":"bun test/test-android-reporting-api.mjs","test:android-gcp":"bun test/test-android-gcp.mjs","test:android-app-verification":"bun test/test-android-app-verification.mjs","test:android-rename":"bun test/test-android-rename.mjs","test:appflow-auth":"bun test/test-appflow-auth.mjs","test:appflow-api-map":"bun test/test-appflow-api-map.mjs","test:appflow-validate":"bun test/test-appflow-validate.mjs","test:appflow-flow":"bun test/test-appflow-flow.mjs","test:appflow-gapfill":"bun test/test-appflow-gapfill.mjs","test:appflow-engine":"bun test/test-appflow-engine.mjs","test:appflow-tail":"bun test/test-appflow-tail.mjs","test:appflow-fetch":"bun test/test-appflow-fetch.mjs","test:appflow-sa-decode":"bun test/test-appflow-sa-decode.mjs","test:app-permission-helper":"bun test/test-app-permission-helper.mjs","test:2fa-compliance-network":"bun test/test-2fa-compliance-network.mjs","test:organization-set-api-host":"bun test/test-organization-set-api-host.mjs","test:trial-warning":"bun test/test-trial-warning.mjs","test:plan-validation":"bun test/test-plan-validation.mjs","test:auto-bump-version":"bun test/test-auto-bump-version.mjs","test:auto-bump-ai-diff":"bun test/test-auto-bump-ai-diff.mjs","test:ios-provisioning-map":"bun test/test-ios-provisioning-map.mjs","test:ios-provisioning-command":"bun test/test-ios-provisioning-command.mjs","test:channel-list":"bun test/test-channel-list.mjs"},dependencies:{"@inkjs/ui":"^2.0.0","@manypkg/tools":"^2.1.2","@rrweb/types":"^2.1.1","@standard-schema/spec":"^1.1.0","@xmldom/xmldom":"^0.9.10","@xterm/addon-serialize":"^0.14.0","@xterm/headless":"^6.0.0","agent-cli-detector":"^0.1.6","happy-dom":"^20.11.0",ink:"^7.1.1","ink-spinner":"^5.0.0",jsonwebtoken:"^9.0.3","node-forge":"^1.4.0",qrcode:"^1.5.4",react:"^19.2.8","rrweb-snapshot":"^2.1.1","string-width":"^8.2.2",typescript:"6.0.3",zod:"^4.5.4"},optionalDependencies:{"@capgo/cli-helper-darwin-arm64":"^1.1.1","@capgo/cli-helper-darwin-x64":"^1.1.1","node-pty":"^1.1.0"},devDependencies:{"@antfu/eslint-config":"^9.2.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.6","@capacitor/cli":"^8.4.2","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.7.0","@modelcontextprotocol/client":"^2.0.0-beta.5","@modelcontextprotocol/server":"^2.0.0-beta.5","@sauber/table":"npm:@jsr/sauber__table","@sinonjs/fake-timers":"15.4.0","@std/semver":"npm:@jsr/std__semver@1.0.8","@supabase/supabase-js":"^2.110.8","@tanstack/intent":"^0.3.6","@types/adm-zip":"^0.5.8","@types/jsonwebtoken":"^9.0.10","@types/node":"^26.1.1","@types/node-forge":"^1.3.14","@types/prettyjson":"^0.0.33","@types/qrcode":"^1.5.6","@types/react":"^19.2.17","@types/tmp":"^0.2.6","@types/ws":"^8.18.1","@typescript/native-preview":"7.0.0-dev.20260707.2","@vercel/ncc":"^0.44.1","@vue/compiler-dom":"3.5.40","@xterm/headless":"^6.0.0","adm-zip":"^0.6.0","ci-info":"^4.4.0",commander:"^15.0.0",eslint:"^10.7.0","git-format-staged":"4.0.2",husky:"^9.1.7","is-wsl":"^3.1.1",micromatch:"^4.0.8",open:"^11.0.0",oxlint:"^1.75.0",partysocket:"^1.3.0",prettyjson:"^1.2.5",tmp:"^0.2.7","tus-js-client":"^4.3.1",ws:"^8.21.1"}}});function hfQ(A){if(A&&typeof A==="object"&&"status"in A){let Q=A.status;if(typeof Q==="number")return Q}return}function ufQ(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 mfQ(A){return ufQ(A)}function iL(A){if(A&&typeof A==="object"&&"code"in A){let $=A.code;if(typeof $==="string"&&$.startsWith("commander."))return"commander"}let Q=hfQ(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=mfQ(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 LfA(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 dfQ}from"node:async_hooks";function Xr(A,Q){return VfA.run(A,()=>Promise.resolve(Q()))}function lfQ(){return VfA.getStore()}function Fx(){RfA=!0}function EfA(){return RfA}function wfA(A){jfA=A}function CfA(A){try{jfA?.(A)}catch{}}function PfA(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 pfQ(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 TfA(){return async(Q,B)=>{let $=(B?.method??"GET").toUpperCase(),J=typeof Q==="string"?Q:Q instanceof URL?Q.href:Q.url,Y=lfQ(),Z=pfQ(B),X=Date.now();try{let G=await globalThis.fetch(Q,B);return CfA({url:J,method:$,status:G.status,ok:G.ok,durationMs:Date.now()-X,source:Y,apikey:Z}),G}catch(G){throw CfA({url:J,method:$,status:0,ok:!1,durationMs:Date.now()-X,source:Y,apikey:Z,error:G}),G}}}var VfA,RfA=!1,jfA,_fA=5000;var Ux=fA(()=>{VfA=new dfQ});var sA;var x1=fA(()=>{sA=class sA extends Error{context;constructor(A,Q){super(A);this.name="CliUserError",this.context=Q}}});import{platform as ifQ}from"node:os";import{version as nfQ}from"node:process";function bfA(A){kfA=A}function afQ(A){for(let Q=0;Q<A.length;Q++)if(A.charCodeAt(Q)>255)return!1;return!0}function SfA(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 ofQ(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 DZA(A,Q){if(Q===void 0||Q===null){if(zZA.has(A.toLowerCase()))throw new sA(SfA(A));throw new sA(`HTTP header "${A}" is missing or invalid.`)}if(typeof Q!=="string"){if(zZA.has(A.toLowerCase()))throw new sA(SfA(A));throw new sA(`HTTP header "${A}" is missing or invalid.`)}if(!afQ(Q)){if(zZA.has(A.toLowerCase()))throw new sA(ofQ(A));throw new sA(`HTTP header "${A}" contains invalid characters (only ASCII is allowed).`)}return Q}function j4(A){let Q={capgo_api:rfQ,"x-cli-version":I$.version,"x-cli-command":kfA,"x-cli-node":nfQ,"x-cli-os":ifQ()};if(A)for(let[B,$]of Object.entries(A))Q[B]=DZA(B,$);return Q}var rfQ="2025-10-01",kfA="",zZA;var C7=fA(()=>{IX();x1();zZA=new Set(["authorization","capgkey","x-capgo-log-token"])});function XZ(A){let Q=A.length;while(Q>0&&A[Q-1]==="/")Q-=1;return A.slice(0,Q)}import{randomUUID as xfA}from"node:crypto";import{existsSync as sfQ,mkdirSync as tfQ,readFileSync as efQ,writeFileSync as AgQ}from"node:fs";import{homedir as MZA,platform as QgQ,release as BgQ}from"node:os";import{join as vfA}from"node:path";import{arch as $gQ,cwd as ffA,env as nL,version as JgQ}from"node:process";function q3(A){return A==="1"||A?.toLowerCase()==="true"||A?.toLowerCase()==="yes"}function KgQ(){if(q3(nL.CAPGO_DISABLE_TELEMETRY)||q3(nL.CAPGO_DISABLE_POSTHOG))return;return nL.CAPGO_CLI_POSTHOG_API_KEY?.trim()||nL.POSTHOG_API_KEY?.trim()||ZgQ}function WgQ(A){let Q=XZ(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 HgQ(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 FgQ(A){let Q=A,B=ffA(),$=MZA();if(B)Q=Q.replaceAll(B,"<cwd>");if($)Q=Q.replaceAll($,"~");return Q}function UgQ(A){let Q=A,B=ffA(),$=MZA();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 qgQ(A,Q){let B=A?.split(`
|
|
70
|
+
`)},info:(A,Q)=>{f.message(A,{...Q,symbol:T0("blue",RfQ)})},success:(A,Q)=>{f.message(A,{...Q,symbol:T0("green",EfQ)})},step:(A,Q)=>{f.message(A,{...Q,symbol:T0("green",HZA)})},warn:(A,Q)=>{f.message(A,{...Q,symbol:T0("yellow",jfQ)})},warning:(A,Q)=>{f.warn(A,Q)},error:(A,Q)=>{f.message(A,{...Q,symbol:T0("red",wfQ)})}},fGB={light:p$("─","-"),heavy:p$("━","="),block:p$("█","#")},kfQ=[`${T0("dim","↑/↓")} to navigate`,`${T0("dim","Enter:")} confirm`],gGB=`${T0("gray",r8)} `});var I$;var IX=fA(()=>{I$={name:"@capgo/cli",type:"module",version:"8.82.0",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/capgo/tree/main/cli#readme",repository:{type:"git",url:"https://github.com/Cap-go/capgo.app",directory:"cli"},bugs:{url:"https://github.com/Cap-go/capgo/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli","sdk","tanstack-intent"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",bin:{capgo:"dist/index.js"},files:["!skills/_artifacts","dist","skills"],engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && bun build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"bunx --bun supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",typecheck:"tsgo --project tsconfig.tsgo.json --noEmit",lint:"bun run lint:ox","lint:ox":"oxlint --config ../.oxlintrc.json src","lint:fix":"oxlint --config ../.oxlintrc.json --fix src","check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test:notify-app-ready-background":"bun test ./test/test-notify-app-ready-background.mjs ./test/test-background-check-shutdown.mjs","test:bundle":"bun test/test-bundle.mjs","test:bundle-validation":"bun test test/bundle/","test:prescan":"bun test test/prescan/","test:functional":"bun test/test-functional.mjs","test:semver":"bun test/test-semver-validation.mjs","test:version-edge-cases":"bun test/test-version-validation.mjs","test:regex":"bun test/test-regex-validation.mjs","test:upload":"bun test/test-upload-validation.mjs","test:fail-on-incompatible":"bun test/test-fail-on-incompatible.mjs","test:native-dependencies":"bun test/test-native-dependencies.mjs && bun test/test-get-remote-dependencies.mjs","test:package-json-guard":"bun test/test-package-json-guard.mjs","test:credentials":"bun test/test-credentials.mjs","test:credentials-export":"bun test/test-credentials-export.mjs","test:asc-key-protocol":"bun test/test-asc-key-protocol.mjs","test:credentials-validation":"bun test/test-credentials-validation.mjs","test:android-service-account-validation":"bun test/test-android-service-account-validation.mjs","test:build-zip-filter":"bun test/test-build-zip-filter.mjs","test:checksum":"bun test/test-checksum-algorithm.mjs","test:build-needed":"bun test/test-build-needed.mjs","test:cli-help":"bun test/test-cli-help.mjs","test:build-cache-payload":"bun test/test-build-cache-payload.mjs","test:build-cancellation":"bun test/test-build-cancellation.mjs","test:ci-prompts":"bun test/test-ci-prompts.mjs","test:capgo-app-id-prompt":"bun test/test-capgo-app-id-prompt.mjs","test:ci-secrets":"bun test/test-ci-secrets.mjs","test:android-onboarding-progress":"bun test/test-android-onboarding-progress.mjs && bun test/test-android-select-guard.mjs","test:android-keystore-action":"bun test/test-android-keystore-action.mjs","test:android-google-play-action":"bun test/test-android-google-play-action.mjs","test:onboarding-telemetry":"bun test/test-onboarding-telemetry.mjs","test:v2-event-migration":"bun test/test-v2-event-migration.mjs","test:analytics":"bun test/test-analytics.mjs","test:cli-headers":"bun test/test-cli-headers.mjs","test:min-cli-version":"bun test/test-min-cli-version.mjs","test:authenticated-command-invocation":"bun test/test-authenticated-command-invocation.mjs","test:analytics-error-category":"bun test/test-analytics-error-category.mjs","test:analytics-org-resolver":"bun test/test-analytics-org-resolver.mjs","test:supabase-perf":"bun test/test-supabase-perf.mjs","test:preview-qr":"bun test/test-preview-qr.mjs","test:bundle-pages":"bun test test/test-bundle-pages.test.ts","test:mcp-analytics":"bun test/test-mcp-analytics.mjs","test:mcp-instructions":"bun test/test-mcp-instructions.mjs","test:mcp-stdout-guard":"bun test/test-mcp-stdout-guard.mjs","test:mcp-platform-select":"bun test/test-mcp-platform-select.mjs","test:mcp-explain-scopes":"bun test/test-mcp-explain-scopes.mjs","test:mcp-oauth-reopen":"bun test/test-mcp-oauth-reopen.mjs","test:mcp-broker-oauth":"bun test/test-mcp-broker-oauth.mjs","test:mcp-broker-session":"bun test/test-mcp-broker-session.mjs","test:mcp-credentials-manage":"bun test/test-mcp-credentials-manage.mjs","test:mcp-resume-prompt":"bun test/test-mcp-resume-prompt.mjs","test:mcp-build-job":"bun test/test-mcp-build-job.mjs","test:mcp-build-tools":"bun test/test-mcp-build-tools.mjs","test:app-created-source":"bun test/test-app-created-source.mjs","test:app-add-exists":"bun test/test-app-add-exists.mjs","test:app-add-getting-started":"bun test/test-app-add-getting-started.mjs","test:app-list-output-text":"bun test/test-app-list-output-text.mjs","test:app-todo":"bun test/test-app-todo.mjs","test:doctor-analytics":"bun test/test-doctor-analytics.mjs","test:posthog-exception":"bun test/test-posthog-exception.mjs","test:cli-recovery":"bun test/test-cli-recovery.mjs","test:create-supabase-client":"bun test/test-create-supabase-client.mjs","test:onboarding-recovery":"bun test/test-onboarding-recovery.mjs","test:onboarding-progress":"bun test/test-onboarding-progress.mjs","test:onboarding-run-targets":"bun test/test-onboarding-run-targets.mjs","test:run-device-command":"bun test/test-run-device-command.mjs","test:init-app-conflict":"bun test/test-init-app-conflict.mjs","test:channel-add-exists":"bun test/test-channel-add-exists.mjs","test:wait-log":"bun test/test-wait-log.mjs","test:init-guardrails":"bun test/test-init-guardrails.mjs","test:init-upload-recovery":"bun test/test-init-upload-error-gate.mjs && bun test/test-init-upload-monorepo-recovery.mjs","test:init-replay":"bun test/test-init-replay.mjs","test:init-telemetry":"bun test/test-init-telemetry.mjs","test:capacitor-config-target":"bun test/test-capacitor-config-target.mjs","test:builder-app-id-config":"bun test/test-builder-app-id-config.mjs","test:capacitor-config-typescript7":"bun test/test-capacitor-config-typescript7.mjs","test:capacitor-config-native-import":"bun test/test-capacitor-config-native-import.mjs","test:cli-user-error-config":"bun test/test-cli-user-error-config.mjs","test:cordova-upload-mode":"bun test/test-cordova-upload-mode.mjs","test:init-monorepo-targeting":"bun run test:capacitor-config-target && bun run test:builder-app-id-config && bun run test:capacitor-config-typescript7 && bun run test:capacitor-config-native-import && bun run test:cli-user-error-config && bun test/test-init-monorepo-targeting.mjs","test:prompt-preferences":"bun test/test-prompt-preferences.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:auth-session":"bun test/test-auth-session.mjs","test:mcp":"node test/test-mcp.mjs","test:mcp-no-key-handshake":"node test/test-mcp-no-key-handshake.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs","test:project-type-detection":"bun test/test-project-type-detection.mjs","test:payload-split":"bun test/test-payload-split.mjs","test:macos-signing":"bun test/test-macos-signing.mjs","test:helper-dce":"bash scripts/check-helper-dce.sh","test:apple-api-import-helpers":"bun test/test-apple-api-import-helpers.mjs","test:apple-api-verify-key":"bun test/test-apple-api-verify-key.mjs","test:bundle-id-detector":"bun test/test-bundle-id-detector.mjs","test:apple-api-app-list":"bun test/test-apple-api-app-list.mjs","test:apple-api-cert-create":"bun test/test-apple-api-cert-create.mjs","test:app-verification":"bun test/test-app-verification.mjs","test:pbxproj-parser":"bun test/test-pbxproj-parser.mjs","test:self-update":"bun test/test-self-update.mjs","test:update-prompt":"bun test/test-update-prompt.mjs","test:android-tail-engine":"bun test/test-android-tail-engine.mjs","test:android-tail-render":"bun test/test-android-tail-render.mjs","test:android-tail-routing":"bun test/test-android-tail-routing.mjs","test:dev-gate-stripped":"bun test/test-dev-gate-stripped.mjs","test:frame-fit-ios-shared":"bun test/test-frame-fit-ios-shared.mjs","test:ios-confirm-app-id":"bun test/test-ios-confirm-app-id.mjs","test:ios-create-new":"bun test/test-ios-create-new.mjs","test:ios-certificate-action":"bun test/test-ios-certificate-action.mjs","test:ios-profile-action":"bun test/test-ios-profile-action.mjs","test:ios-credential-action":"bun test/test-ios-credential-action.mjs","test:ios-e2e":"bun test/test-ios-e2e.mjs","test:ios-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 scripts/run-test-suite.ts","test:run":"bun scripts/run-test-suite.ts","test:serial":"bun run build && bun scripts/run-test-suite.ts --serial","test:suite":"bun run test:helper-dce && bun run test:version-detection:setup && bun run test:bundle && bun run test:notify-app-ready-background && bun run test:bundle-validation && bun run test:functional && bun run test:semver && bun run test:auto-bump-version && bun run test:auto-bump-ai-diff && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:cordova-upload-mode && bun run test:fail-on-incompatible && bun run test:native-dependencies && bun run test:package-json-guard && bun run test:credentials && bun run test:credentials-export && bun run test:ios-provisioning-map && bun run test:ios-provisioning-command && bun run test:credentials-validation && bun run test:android-service-account-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:build-needed && bun run test:cli-help && bun run test:build-cache-payload && bun run test:build-cancellation && bun run test:ci-prompts && bun run test:capgo-app-id-prompt && bun run test:ci-secrets && bun run test:android-onboarding-progress && bun run test:android-keystore-action && bun run test:android-google-play-action && bun run test:onboarding-telemetry && bun run test:v2-event-migration && bun run test:analytics && bun run test:cli-headers && bun run test:min-cli-version && bun run test:authenticated-command-invocation && bun run test:analytics-error-category && bun run test:analytics-org-resolver && bun run test:supabase-perf && bun run test:preview-qr && bun run test:bundle-pages && bun run test:app-set-options && bun run test:mcp-analytics && bun run test:mcp-instructions && bun run test:mcp-live-update-onboarding && bun run test:mcp-stdout-guard && bun run test:mcp-platform-select && bun run test:mcp-explain-scopes && bun run test:mcp-oauth-reopen && bun run test:mcp-broker-oauth && bun run test:mcp-broker-session && bun run test:mcp-credentials-manage && bun run test:mcp-resume-prompt && bun run test:mcp-build-job && bun run test:mcp-build-tools && bun run test:app-created-source && bun run test:app-add-exists && bun run test:app-add-getting-started && bun run test:app-list-output-text && bun run test:app-todo && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:cli-recovery && bun run test:create-supabase-client && bun run test:build-platform-selection && bun run test:builder-project-discovery && bun run test:builder-app-selection && bun run test:builder-login-gate && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-monorepo-targeting && bun run test:init-app-conflict && bun run test:channel-list && bun run test:channel-add-exists && bun run test:wait-log && bun run test:init-guardrails && bun run test:init-upload-recovery && bun run test:init-replay && bun run test:init-telemetry && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:mcp-no-key-handshake && bun run test:auth-session && bun run test:version-detection && bun run test:platform-paths && bun run test:project-type-detection && bun run test:payload-split && bun run test:macos-signing && bun run test:asc-key-protocol && bun run test:apple-api-import-helpers && bun run test:apple-api-verify-key && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:cicd-failure-help && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-upload-prompt && bun run test:support-bundle-files && bun run test:self-update && bun run test:update-prompt && bun run test:apple-api-cert-create && bun run test:android-tail-engine && bun run test:android-tail-render && bun run test:android-tail-routing && bun run test:dev-gate-stripped && bun run test:frame-fit-ios-shared && bun run test:ios-confirm-app-id && bun run test:ios-create-new && bun run test:ios-certificate-action && bun run test:ios-profile-action && bun run test:ios-credential-action && bun run test:ios-e2e && bun run test:ios-flow-contract && bun run test:ios-import-discovery && bun run test:ios-import-export && bun run test:ios-import-pickers && bun run test:ios-import-recovery && bun run test:ios-recovery && bun run test:ios-resume && bun run test:ios-tail-handoff && bun run test:ios-tui-render && bun run test:p8-error && bun run test:ios-tui-routing && bun run test:ios-updater-sync-validation && bun run test:ios-verify-app && bun run test:ios-marketing-version && bun run test:android-version && bun run test:platform-flow-contract && bun run test:tail-engine-shared && bun run test:prescan && bun run test:android-reporting-api && bun run test:android-gcp && bun run test:android-app-verification && bun run test:android-rename && bun run test:appflow-auth && bun run test:appflow-api-map && bun run test:appflow-validate && bun run test:appflow-flow && bun run test:appflow-gapfill && bun run test:appflow-engine && bun run test:appflow-tail && bun run test:appflow-fetch && bun run test:appflow-sa-decode && bun run test:app-permission-helper && bun run test:2fa-compliance-network && bun run test:organization-set-api-host && bun run test:trial-warning && bun run test:plan-validation","test:build-platform-selection":"bun test/test-build-platform-selection.mjs","test:builder-project-discovery":"bun test/test-builder-project-discovery.mjs","test:builder-app-selection":"bun test/test-builder-app-selection.mjs","test:builder-login-gate":"bun test/test-builder-login-gate.mjs","test:ai-log-capture":"bun test/test-ai-log-capture.mjs","test:ai-analyze-flow":"bun test/test-ai-analyze-flow.mjs","test:cicd-failure-help":"bun test/test-cicd-failure-help.mjs","test:ai-analyze-stream":"bun test/test-ai-analyze-stream.mjs","test:ai-sse-parser":"bun test/test-ai-sse-parser.mjs","test:ai-render-markdown":"bun test/test-ai-render-markdown.mjs","test:ai-onboarding-mode":"bun test/test-ai-onboarding-mode.mjs","test:ai-fit":"bun test/test-ai-fit.mjs","test:platform-layout":"bun test/test-platform-layout.mjs","test:frame-fit":"bun test/run-frame-fit.mjs","test:onboarding-min-size":"bun test/test-onboarding-min-size.mjs","test:min-size-gate":"bun test/test-min-size-gate.mjs","test:shell-size-gate":"bun test/test-shell-size-gate.mjs","test:build-log-sanitize":"bun test/test-build-log-sanitize.mjs","test:build-output-viewport":"bun test/test-build-output-viewport.mjs","test:diff-viewer-viewport":"bun test/test-diff-viewer-viewport.mjs","test:build-complete-exit":"bun test/test-build-complete-exit.mjs","test:ai-stream-markdown":"bun test/test-ai-stream-markdown.mjs","test:support-mailto":"bun test/test-support-mailto.mjs","test:support-redact":"bun test/test-support-redact.mjs","test:support-internal-log":"bun test/test-support-internal-log.mjs","test:support-help-menu":"bun test/test-support-help-menu.mjs","test:support-contact":"bun test/test-support-contact.mjs","test:support-upload-prompt":"bun test/test-support-upload-prompt.mjs","test:support-bundle-files":"bun test/test-support-bundle-files.mjs","test:mcp-live-update-onboarding":"bun test/test-mcp-live-update-onboarding.mjs","test:app-set-options":"bun test/test-app-set-options.mjs && bun test/test-app-list-options.mjs","test:android-reporting-api":"bun test/test-android-reporting-api.mjs","test:android-gcp":"bun test/test-android-gcp.mjs","test:android-app-verification":"bun test/test-android-app-verification.mjs","test:android-rename":"bun test/test-android-rename.mjs","test:appflow-auth":"bun test/test-appflow-auth.mjs","test:appflow-api-map":"bun test/test-appflow-api-map.mjs","test:appflow-validate":"bun test/test-appflow-validate.mjs","test:appflow-flow":"bun test/test-appflow-flow.mjs","test:appflow-gapfill":"bun test/test-appflow-gapfill.mjs","test:appflow-engine":"bun test/test-appflow-engine.mjs","test:appflow-tail":"bun test/test-appflow-tail.mjs","test:appflow-fetch":"bun test/test-appflow-fetch.mjs","test:appflow-sa-decode":"bun test/test-appflow-sa-decode.mjs","test:app-permission-helper":"bun test/test-app-permission-helper.mjs","test:2fa-compliance-network":"bun test/test-2fa-compliance-network.mjs","test:organization-set-api-host":"bun test/test-organization-set-api-host.mjs","test:trial-warning":"bun test/test-trial-warning.mjs","test:plan-validation":"bun test/test-plan-validation.mjs","test:auto-bump-version":"bun test/test-auto-bump-version.mjs","test:auto-bump-ai-diff":"bun test/test-auto-bump-ai-diff.mjs","test:ios-provisioning-map":"bun test/test-ios-provisioning-map.mjs","test:ios-provisioning-command":"bun test/test-ios-provisioning-command.mjs","test:channel-list":"bun test/test-channel-list.mjs"},dependencies:{"@inkjs/ui":"^2.0.0","@manypkg/tools":"^2.1.2","@rrweb/types":"^2.1.1","@standard-schema/spec":"^1.1.0","@xmldom/xmldom":"^0.9.10","@xterm/addon-serialize":"^0.14.0","@xterm/headless":"^6.0.0","agent-cli-detector":"^0.1.6","happy-dom":"^20.11.0",ink:"^7.1.1","ink-spinner":"^5.0.0",jsonwebtoken:"^9.0.3","node-forge":"^1.4.0",qrcode:"^1.5.4",react:"^19.2.8","rrweb-snapshot":"^2.1.1","string-width":"^8.2.2",typescript:"6.0.3",zod:"^4.5.4"},optionalDependencies:{"@capgo/cli-helper-darwin-arm64":"^1.1.1","@capgo/cli-helper-darwin-x64":"^1.1.1","node-pty":"^1.1.0"},devDependencies:{"@antfu/eslint-config":"^9.2.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.6","@capacitor/cli":"^8.4.2","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.7.0","@modelcontextprotocol/client":"^2.0.0-beta.5","@modelcontextprotocol/server":"^2.0.0-beta.5","@sauber/table":"npm:@jsr/sauber__table","@sinonjs/fake-timers":"15.4.0","@std/semver":"npm:@jsr/std__semver@1.0.8","@supabase/supabase-js":"^2.110.8","@tanstack/intent":"^0.3.6","@types/adm-zip":"^0.5.8","@types/jsonwebtoken":"^9.0.10","@types/node":"^26.1.1","@types/node-forge":"^1.3.14","@types/prettyjson":"^0.0.33","@types/qrcode":"^1.5.6","@types/react":"^19.2.17","@types/tmp":"^0.2.6","@types/ws":"^8.18.1","@typescript/native-preview":"7.0.0-dev.20260707.2","@vercel/ncc":"^0.44.1","@vue/compiler-dom":"3.5.40","@xterm/headless":"^6.0.0","adm-zip":"^0.6.0","ci-info":"^4.4.0",commander:"^15.0.0",eslint:"^10.7.0","git-format-staged":"4.0.2",husky:"^9.1.7","is-wsl":"^3.1.1",micromatch:"^4.0.8",open:"^11.0.0",oxlint:"^1.75.0",partysocket:"^1.3.0",prettyjson:"^1.2.5",tmp:"^0.2.7","tus-js-client":"^4.3.1",ws:"^8.21.1"}}});function hfQ(A){if(A&&typeof A==="object"&&"status"in A){let Q=A.status;if(typeof Q==="number")return Q}return}function ufQ(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 mfQ(A){return ufQ(A)}function iL(A){if(A&&typeof A==="object"&&"code"in A){let $=A.code;if(typeof $==="string"&&$.startsWith("commander."))return"commander"}let Q=hfQ(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=mfQ(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 LfA(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 dfQ}from"node:async_hooks";function Xr(A,Q){return VfA.run(A,()=>Promise.resolve(Q()))}function lfQ(){return VfA.getStore()}function Fx(){RfA=!0}function EfA(){return RfA}function wfA(A){jfA=A}function CfA(A){try{jfA?.(A)}catch{}}function PfA(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 pfQ(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 TfA(){return async(Q,B)=>{let $=(B?.method??"GET").toUpperCase(),J=typeof Q==="string"?Q:Q instanceof URL?Q.href:Q.url,Y=lfQ(),Z=pfQ(B),X=Date.now();try{let G=await globalThis.fetch(Q,B);return CfA({url:J,method:$,status:G.status,ok:G.ok,durationMs:Date.now()-X,source:Y,apikey:Z}),G}catch(G){throw CfA({url:J,method:$,status:0,ok:!1,durationMs:Date.now()-X,source:Y,apikey:Z,error:G}),G}}}var VfA,RfA=!1,jfA,_fA=5000;var Ux=fA(()=>{VfA=new dfQ});var sA;var x1=fA(()=>{sA=class sA extends Error{context;constructor(A,Q){super(A);this.name="CliUserError",this.context=Q}}});import{platform as ifQ}from"node:os";import{version as nfQ}from"node:process";function bfA(A){kfA=A}function afQ(A){for(let Q=0;Q<A.length;Q++)if(A.charCodeAt(Q)>255)return!1;return!0}function SfA(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 ofQ(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 DZA(A,Q){if(Q===void 0||Q===null){if(zZA.has(A.toLowerCase()))throw new sA(SfA(A));throw new sA(`HTTP header "${A}" is missing or invalid.`)}if(typeof Q!=="string"){if(zZA.has(A.toLowerCase()))throw new sA(SfA(A));throw new sA(`HTTP header "${A}" is missing or invalid.`)}if(!afQ(Q)){if(zZA.has(A.toLowerCase()))throw new sA(ofQ(A));throw new sA(`HTTP header "${A}" contains invalid characters (only ASCII is allowed).`)}return Q}function j4(A){let Q={capgo_api:rfQ,"x-cli-version":I$.version,"x-cli-command":kfA,"x-cli-node":nfQ,"x-cli-os":ifQ()};if(A)for(let[B,$]of Object.entries(A))Q[B]=DZA(B,$);return Q}var rfQ="2025-10-01",kfA="",zZA;var C7=fA(()=>{IX();x1();zZA=new Set(["authorization","capgkey","x-capgo-log-token"])});function XZ(A){let Q=A.length;while(Q>0&&A[Q-1]==="/")Q-=1;return A.slice(0,Q)}import{randomUUID as xfA}from"node:crypto";import{existsSync as sfQ,mkdirSync as tfQ,readFileSync as efQ,writeFileSync as AgQ}from"node:fs";import{homedir as MZA,platform as QgQ,release as BgQ}from"node:os";import{join as vfA}from"node:path";import{arch as $gQ,cwd as ffA,env as nL,version as JgQ}from"node:process";function q3(A){return A==="1"||A?.toLowerCase()==="true"||A?.toLowerCase()==="yes"}function KgQ(){if(q3(nL.CAPGO_DISABLE_TELEMETRY)||q3(nL.CAPGO_DISABLE_POSTHOG))return;return nL.CAPGO_CLI_POSTHOG_API_KEY?.trim()||nL.POSTHOG_API_KEY?.trim()||ZgQ}function WgQ(A){let Q=XZ(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 HgQ(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 FgQ(A){let Q=A,B=ffA(),$=MZA();if(B)Q=Q.replaceAll(B,"<cwd>");if($)Q=Q.replaceAll($,"~");return Q}function UgQ(A){let Q=A,B=ffA(),$=MZA();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 qgQ(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:FgQ(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 zgQ(A){if(!A||typeof A!=="object"||!("code"in A))return;let{code:Q}=A;return typeof Q==="string"?Q:void 0}function IgQ(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 MgQ(A){let Q=(A instanceof Error?A.message:typeof A==="string"?A:"").toLowerCase();if(DgQ.some((B)=>Q.includes(B)))return!0;return IgQ(A)===401}function qx(A){if(A instanceof sA){if(GgQ.has(A.message))return!0;return!1}if(MgQ(A))return!1;return!zgQ(A)?.startsWith("commander.")}function Gr(A){let Q=[],B=A;while(B?.parent){let $=B.name();if($)Q.push($);B=B.parent}return Q.reverse().join(" ")||"unknown"}function OgQ(A=vfA(MZA(),".capgo-credentials")){if(IZA)return IZA;let Q=vfA(A,"install-id"),B;try{let $=sfQ(Q)?efQ(Q,"utf8").trim():"";if($)B=$;else B=xfA(),tfQ(A,{recursive:!0}),AgQ(Q,B,{encoding:"utf8",mode:384})}catch{B=xfA()}return IZA=B,B}async function zx(A){let Q=KgQ();if(!Q)return!1;let B=nL.CAPGO_CLI_POSTHOG_API_HOST?.trim()||nL.POSTHOG_API_HOST?.trim()||YgQ,$;try{$=WgQ(B)}catch{return!1}let J=HgQ(A.error),Y=UgQ(J.message),Z=OgQ(),X=qgQ(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:$gQ,cli_version:I$.version,error_kind:A.kind,function_name:A.functionName,is_ci:Boolean(nL.CI),node_version:JgQ,os_platform:QgQ(),os_release:BgQ(),runtime:"cli",status:A.status},timestamp:new Date().toISOString()};try{let W=new AbortController,H=setTimeout(()=>W.abort(),XgQ);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 YgQ="https://eu.i.posthog.com/i/v0/e/",ZgQ="phc_NXDyDajQaTQVwb25DEhIVZfxVUn4R0Y348Z7vWYHZUi",XgQ=1500,OZA="iOS sync validation failed. Delete your iOS folder, then rerun the add and sync commands above and retry.",GgQ,DgQ,IZA;var Bj=fA(()=>{IX();x1();GgQ=new Set([OZA]);DgQ=["invalid_apikey","invalid apikey","no_key_provided","no key provided","invalid api key or insufficient permissions","does not exist, run first"]});import{existsSync as MX}from"fs";var tH=(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(MX(B)||MX($))return"bun";if(MX(J)||MX(Y))return"pnpm";if(MX(Z))return"yarn";if(MX(X)||MX(G))return"npm";return Q},mD=(A=tH(),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"}},Kr=(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(MX(B)||MX($))return"bunx";if(MX(J)||MX(Y))return"pnpm exec";if(MX(Z))return"yarn dlx";if(MX(X)||MX(G))return"npx";return Q};var Dx=()=>{};function Wr(A,Q){if(isNaN(A)||isNaN(Q))throw Error("Cannot compare against non-numbers");return A===Q?0:A<Q?-1:1}function hfA(A=[],Q=[]){if(A.length&&!Q.length)return-1;if(!A.length&&Q.length)return 1;return 0}function Hr(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 NZA(A){return typeof A==="number"&&!Number.isNaN(A)&&(!Number.isFinite(A)||0<=A&&A<=Number.MAX_SAFE_INTEGER)}function OX(A){return A.split(".").filter(Boolean).map((Q)=>{if(VgQ.test(Q)){let B=Number(Q);if(NZA(B))return B}return Q})}function eH(A){return A.split(".").filter(Boolean)}function Ur(A,Q){let B=Number(A);if(!NZA(B))throw TypeError(Q);return B}function fU(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 $j="0|[1-9]\\d*",LgQ="\\d*[a-zA-Z-][a-zA-Z0-9-]*",NgQ,gfA,ufA,yfA="[0-9A-Za-z-]+",mfA,cfA,dfA,lfA="(?:<|>)?=?",CgQ="x|X|\\*",LZA,Fr,pfA,ifA,CZA=256,VgQ;var EG=fA(()=>{NgQ=`(?<major>${$j})\\.(?<minor>${$j})\\.(?<patch>${$j})`,gfA=`(?:${$j}|${LgQ})`,ufA=`(?:-(?<prerelease>${gfA}(?:\\.${gfA})*))`,mfA=`(?:\\+(?<buildmetadata>${yfA}(?:\\.${yfA})*))`,cfA=`v?${NgQ}${ufA}?${mfA}?`,dfA=new RegExp(`^${cfA}$`),LZA=`${$j}|${CgQ}`,Fr=`[v=\\s]*(?<major>${LZA})(?:\\.(?<minor>${LZA})(?:\\.(?<patch>${LZA})${ufA}?${mfA}?)?)?`,pfA=new RegExp(`^(?<operator>~>?|\\^|${lfA})\\s*${Fr}$`),ifA=new RegExp(`^(?<operator>${lfA})\\s*(${cfA})$|^$`);VgQ=new RegExp(`^${$j}$`)});function GZ(A,Q){if(A===Q)return 0;return Wr(A.major,Q.major)||Wr(A.minor,Q.minor)||Wr(A.patch,Q.patch)||hfA(A.prerelease,Q.prerelease)||Hr(A.prerelease,Q.prerelease)}var PK=fA(()=>{EG()});function nfA(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(Hr(A.prerelease,Q.prerelease)!==0)return"prerelease"}var rfA=fA(()=>{EG()});function VZA(A){return A.toFixed(0)}function SY(A){let Q=VZA(A.major),B=VZA(A.minor),$=VZA(A.patch),J=A.prerelease?.join(".")??"",Y=A.build?.join(".")??"";return[[`${Q}.${B}.${$}`,J].filter((G)=>G).join("-"),Y].filter((G)=>G).join("+")}function RgQ(A,Q){if(fU(Q))return!0;let B=GZ(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 qr(A,Q){for(let B of Q)if(!RgQ(A,B))return!1;if(!A.prerelease?.length)return!0;for(let B of Q){if(fU(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 zr=fA(()=>{EG();PK()});function Ix(A,Q){return Q.some((B)=>qr(A,B))}var Mx=fA(()=>{zr()});function EgQ(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 Ox(A=[],Q){let B=EgQ(A);if(!Q)return B;let $=OX(Q);if($.every((J)=>typeof J==="string")){if($.every((J,Y)=>J===B[Y])&&typeof B[$.length]==="number")return B;$=[...$,0]}return $}function cD(A,Q,B={}){let $=B.build!==void 0?eH(B.build):A.build??[];switch(Q){case"premajor":return{major:A.major+1,minor:0,patch:0,prerelease:Ox(A.prerelease,B.prerelease),build:$};case"preminor":return{major:A.major,minor:A.minor+1,patch:0,prerelease:Ox(A.prerelease,B.prerelease),build:$};case"prepatch":return{major:A.major,minor:A.minor,patch:A.patch+1,prerelease:Ox(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:Ox(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:Ox(A.prerelease,B.prerelease),build:$};default:throw TypeError(`Cannot increment version: invalid argument ${Q}`)}}var afA=fA(()=>{EG()});var Dr,Jj;var Lx=fA(()=>{Dr={major:Number.NaN,minor:Number.NaN,patch:Number.NaN,prerelease:[],build:[]},Jj={operator:void 0,...Dr}});var RZA=fA(()=>{Lx();EG()});function EZA(A,Q){return GZ(A,Q)>0}var jZA=fA(()=>{PK()});var ofA=fA(()=>{Mx();jZA()});function V7(A,Q){return GZ(A,Q)<0}var wZA=fA(()=>{PK()});var sfA=fA(()=>{Mx();wZA()});function jgQ(A){let B=A.match(ifA)?.groups;if(!B)return null;let{operator:$}=B;return{operator:$||void 0,...Dr}}function D6(A){return!A||A.toLowerCase()==="x"||A==="*"}function wgQ(A){if(D6(A.major))return;if(D6(A.minor))return{operator:">=",major:+A.major,minor:0,patch:0,prerelease:[],build:[]};if(D6(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?OX(A.prerelease):[],build:[]}}function _gQ(A){if(D6(A.major))return;if(D6(A.minor))return{operator:"<",major:+A.major+1,minor:0,patch:0,prerelease:[],build:[]};if(D6(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:OX(A.prerelease),build:[]};return{operator:"<=",major:+A.major,minor:+A.minor,patch:+A.patch,prerelease:[],build:[]}}function PgQ(A){let Q=A.match(new RegExp(`^${Fr}`)),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(`^${Fr}\\s*$`))?.groups,G=wgQ(B),K=_gQ(X);return[G,K].filter(Boolean)}function TgQ(A){let Q=D6(A.major),B=D6(A.minor),$=D6(A.patch),J=+A.major,Y=+A.minor,Z=+A.patch;if(Q)return[Jj];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=OX(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 SgQ(A){let Q=D6(A.major),B=D6(A.minor),$=D6(A.patch),J=+A.major,Y=+A.minor,Z=+A.patch;if(Q)return[Jj];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=OX(A.prerelease??"");return[{operator:">=",major:J,minor:Y,patch:Z,prerelease:X},{operator:"<",major:J,minor:Y+1,patch:0}]}function kgQ(A){let Q=D6(A.major),B=D6(A.minor),$=D6(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=OX(A.prerelease??""),G=eH(A.build??"");return[{operator:"<",major:J,minor:Y,patch:Z,prerelease:X,build:G}]}function bgQ(A){let Q=D6(A.minor),B=D6(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=OX(A.prerelease??""),X=eH(A.build??"");return[{operator:"<=",major:$,minor:J,patch:Y,prerelease:Z,build:X}]}function xgQ(A){let Q=D6(A.major),B=D6(A.minor),$=D6(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=OX(A.prerelease??""),G=eH(A.build??"");return[{operator:">",major:J,minor:Y,patch:Z,prerelease:X,build:G}]}function vgQ(A){let Q=D6(A.major),B=D6(A.minor),$=D6(A.patch),J=+A.major,Y=+A.minor,Z=+A.patch;if(Q)return[Jj];if(B)return[{operator:">=",major:J,minor:0,patch:0}];if($)return[{operator:">=",major:J,minor:Y,patch:0}];let X=OX(A.prerelease??""),G=eH(A.build??"");return[{operator:">=",major:J,minor:Y,patch:Z,prerelease:X,build:G}]}function fgQ(A){let Q=D6(A.major),B=D6(A.minor),$=D6(A.patch),J=+A.major,Y=+A.minor,Z=+A.patch;if(Q)return[Jj];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=OX(A.prerelease??""),G=eH(A.build??"");return[{operator:A.operator==="="?"=":void 0,major:J,minor:Y,patch:Z,prerelease:X,build:G}]}function ggQ(A){let Q=A.match(pfA)?.groups;if(!Q)return jgQ(A);switch(Q.operator){case"^":return TgQ(Q);case"~":case"~>":return SgQ(Q);case"<":return kgQ(Q);case"<=":return bgQ(Q);case">":return xgQ(Q);case">=":return vgQ(Q);default:return fgQ(Q)}}function ygQ(A){return A.split(/\s+/).flatMap(ggQ)}function Ir(A){let Q=A.replaceAll(/(?<=[<>=~^])(\s+)/g,"").split(/\s*\|\|\s*/).map((B)=>PgQ(B)||ygQ(B));if(Q.some((B)=>B.includes(null)))throw TypeError(`Cannot parse version range: range "${A}" is invalid`);return Q}var _ZA=fA(()=>{EG();Lx()});function Z1(A){if(typeof A!=="string")throw TypeError(`Cannot parse version as version must be a string: received ${typeof A}`);if(A.length>CZA)throw TypeError(`Cannot parse version as version length is too long: length is ${A.length}, max length is ${CZA}`);A=A.trim();let Q=A.match(dfA)?.groups;if(!Q)throw TypeError(`Cannot parse version: ${A}`);let B=Ur(Q.major,`Cannot parse version ${A}: invalid major version`),$=Ur(Q.minor,`Cannot parse version ${A}: invalid minor version`),J=Ur(Q.patch,`Cannot parse version ${A}: invalid patch version`),Y=Q.prerelease?OX(Q.prerelease):[],Z=Q.buildmetadata?eH(Q.buildmetadata):[];return{major:B,minor:$,patch:J,prerelease:Y,build:Z}}var Mr=fA(()=>{EG();EG()});function tfA(A,Q){let B=A.operator,$=Q.operator;if(B===void 0){if(fU(A))return!0;return Ix(A,[[Q]])}if($===void 0){if(fU(Q))return!0;return Ix(Q,[[A]])}let J=GZ(A,Q);return(B===">="||B===">")&&($===">="||$===">")||(B==="<="||B==="<")&&($==="<="||$==="<")||J===0&&((B===">="||B==="<=")&&($===">="||$==="<="))||J===-1&&(B===">="||B===">")&&($==="<="||$==="<")||J===1&&(B==="<="||B==="<")&&($===">="||$===">")}function hgQ(A){return A.every((Q)=>{return Q.some((B)=>ugQ(B))})}function ugQ(A){for(let Q=0;Q<A.length-1;Q++){let B=A[Q];for(let $ of A.slice(Q+1))if(!tfA(B,$))return!1}return!0}function efA(A,Q){return hgQ([A,Q])&&A.some((B)=>{return Q.some(($)=>{return B.every((J)=>{return $.every((Y)=>tfA(J,Y))})})})}var AgA=fA(()=>{EG();PK();Mx()});var QgA=fA(()=>{_ZA()});var BgA=fA(()=>{Lx();Lx();RZA()});function dD(A){try{return Z1(A),!0}catch{return!1}}var $gA=fA(()=>{Mr()});var JgA=fA(()=>{Mr()});var YgA=fA(()=>{EG()});var ZgA=fA(()=>{PK()});var XgA=fA(()=>{PK()});var GgA=fA(()=>{zr();EG();PK()});function PZA(A,Q){return GZ(A,Q)>=0}var KgA=fA(()=>{PK()});var WgA=fA(()=>{zr();EG();PK()});var HgA=fA(()=>{PK()});var TK=fA(()=>{PK();rfA();Mx();afA();RZA();ofA();sfA();_ZA();Mr();AgA();QgA();BgA();$gA();JgA();YgA();ZgA();XgA();jZA();GgA();KgA();wZA();WgA();HgA()});var LX=$A((V3B,Nr)=>{var FgA,UgA,qgA,zgA,DgA,IgA,MgA,OgA,LgA,NgA,CgA,VgA,RgA,Or,TZA,EgA,jgA,wgA,Yj,_gA,PgA,TgA,SgA,kgA,bgA,xgA,vgA,fgA,Lr,ggA,ygA,hgA;(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 Nr==="object"&&typeof V3B==="object")A(B(Q,B(V3B)));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]};FgA=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)},UgA=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},qgA=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},zgA=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},DgA=function(Y,Z){return function(X,G){Z(X,G,Y)}},IgA=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,z=U==="getter"?"get":U==="setter"?"set":"value",D=!Z&&Y?G.static?Y:Y.prototype:null,I=Z||(D?Object.getOwnPropertyDescriptor(D,G.name):{}),M,N=!1;for(var V=X.length-1;V>=0;V--){var L={};for(var C in G)L[C]=C==="access"?{}:G[C];for(var C in G.access)L.access[C]=G.access[C];L.addInitializer=function(E){if(N)throw TypeError("Cannot add initializers after decoration has completed");W.push(H(E||null))};var R=(0,X[V])(U==="accessor"?{get:I.get,set:I.set}:I[z],L);if(U==="accessor"){if(R===void 0)continue;if(R===null||typeof R!=="object")throw TypeError("Object expected");if(M=H(R.get))I.get=M;if(M=H(R.set))I.set=M;if(M=H(R.init))K.unshift(M)}else if(M=H(R))if(U==="field")K.unshift(M);else I[z]=M}if(D)Object.defineProperty(D,G.name,I);N=!0},MgA=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},OgA=function(Y){return typeof Y==="symbol"?Y:"".concat(Y)},LgA=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})},NgA=function(Y,Z){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(Y,Z)},CgA=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(M){H(M)}}function z(I){try{D(G.throw(I))}catch(M){H(M)}}function D(I){I.done?W(I.value):K(I.value).then(U,z)}D((G=G.apply(Y,Z||[])).next())})},VgA=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 z([D,I])}}function z(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}}},RgA=function(Y,Z){for(var X in Y)if(X!=="default"&&!Object.prototype.hasOwnProperty.call(Z,X))Lr(Z,Y,X)},Lr=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]},Or=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.")},TZA=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},EgA=function(){for(var Y=[],Z=0;Z<arguments.length;Z++)Y=Y.concat(TZA(arguments[Z]));return Y},jgA=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},wgA=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))},Yj=function(Y){return this instanceof Yj?(this.v=Y,this):new Yj(Y)},_gA=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(V){return function(L){return Promise.resolve(L).then(V,M)}}function U(V,L){if(G[V]){if(K[V]=function(C){return new Promise(function(R,E){W.push([V,C,R,E])>1||z(V,C)})},L)K[V]=L(K[V])}}function z(V,L){try{D(G[V](L))}catch(C){N(W[0][3],C)}}function D(V){V.value instanceof Yj?Promise.resolve(V.value.v).then(I,M):N(W[0][2],V)}function I(V){z("next",V)}function M(V){z("throw",V)}function N(V,L){if(V(L),W.shift(),W.length)z(W[0][0],W[0][1])}},PgA=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:Yj(Y[K](H)),done:!1}:W?W(H):H}:W}},TgA=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 Or==="function"?Or(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,z){H=Y[W](H),K(U,z,H.done,H.value)})}}function K(W,H,U,z){Promise.resolve(z).then(function(D){W({value:D,done:U})},H)}},SgA=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)};kgA=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")Lr(Z,Y,X[G])}return B(Z,Y),Z},bgA=function(Y){return Y&&Y.__esModule?Y:{default:Y}},xgA=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)},vgA=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},fgA=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)},ggA=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};ygA=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()},hgA=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",FgA),A("__assign",UgA),A("__rest",qgA),A("__decorate",zgA),A("__param",DgA),A("__esDecorate",IgA),A("__runInitializers",MgA),A("__propKey",OgA),A("__setFunctionName",LgA),A("__metadata",NgA),A("__awaiter",CgA),A("__generator",VgA),A("__exportStar",RgA),A("__createBinding",Lr),A("__values",Or),A("__read",TZA),A("__spread",EgA),A("__spreadArrays",jgA),A("__spreadArray",wgA),A("__await",Yj),A("__asyncGenerator",_gA),A("__asyncDelegator",PgA),A("__asyncValues",TgA),A("__makeTemplateObject",SgA),A("__importStar",kgA),A("__importDefault",bgA),A("__classPrivateFieldGet",xgA),A("__classPrivateFieldSet",vgA),A("__classPrivateFieldIn",fgA),A("__addDisposableResource",ggA),A("__disposeResources",ygA),A("__rewriteRelativeImportExtension",hgA)})});var cgA=$A((ugA)=>{Object.defineProperty(ugA,"__esModule",{value:!0});ugA.resolveFetch=void 0;var mgQ=(A)=>{if(A)return(...Q)=>A(...Q);return(...Q)=>fetch(...Q)};ugA.resolveFetch=mgQ});var SZA=$A((ngA)=>{Object.defineProperty(ngA,"__esModule",{value:!0});ngA.FunctionRegion=ngA.FunctionsHttpError=ngA.FunctionsRelayError=ngA.FunctionsFetchError=ngA.FunctionsError=void 0;class Nx 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}}}ngA.FunctionsError=Nx;class lgA extends Nx{constructor(A){super("Failed to send a request to the Edge Function","FunctionsFetchError",A)}}ngA.FunctionsFetchError=lgA;class pgA extends Nx{constructor(A){super("Relay Error invoking the Edge Function","FunctionsRelayError",A)}}ngA.FunctionsRelayError=pgA;class igA extends Nx{constructor(A){super("Edge Function returned a non-2xx status code","FunctionsHttpError",A)}}ngA.FunctionsHttpError=igA;var dgA;(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"})(dgA||(ngA.FunctionRegion=dgA={}))});var tgA=$A((ogA)=>{Object.defineProperty(ogA,"__esModule",{value:!0});ogA.FunctionsClient=void 0;var igQ=LX(),ngQ=cgA(),Zj=SZA();class agA{constructor(A,{headers:Q={},customFetch:B,region:$=Zj.FunctionRegion.Any}={}){this.url=A,this.headers=Q,this.region=$,this.fetch=(0,ngQ.resolveFetch)(B)}setAuth(A){this.headers.Authorization=`Bearer ${A}`}invoke(A){return igQ.__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,z={},{region:D}=B;if(!D)D=this.region;let I=new URL(`${this.url}/${Q}`);if(D&&D!=="any")z["x-region"]=D,I.searchParams.set("forceFunctionRegion",D);let M,N=!!G&&Object.keys(G).some((w)=>w.toLowerCase()==="content-type");if(W&&!N)if(typeof Blob<"u"&&W instanceof Blob||W instanceof ArrayBuffer)z["Content-Type"]="application/octet-stream",M=W;else if(typeof W==="string")z["Content-Type"]="text/plain",M=W;else if(typeof FormData<"u"&&W instanceof FormData)M=W;else z["Content-Type"]="application/json",M=JSON.stringify(W);else if(W&&typeof W!=="string"&&!(typeof Blob<"u"&&W instanceof Blob)&&!(W instanceof ArrayBuffer)&&!(typeof FormData<"u"&&W instanceof FormData))M=JSON.stringify(W);else M=W;let V=H;if(U)if(Z=new AbortController,Y=setTimeout(()=>Z.abort(),U),H)V=Z.signal,X=()=>Z.abort(),H.addEventListener("abort",X);else V=Z.signal;let L=yield this.fetch(I.toString(),{method:K||"POST",headers:Object.assign(Object.assign(Object.assign({},z),this.headers),G),body:M,signal:V}).catch((w)=>{throw new Zj.FunctionsFetchError(w)}),C=L.headers.get("x-relay-error");if(C&&C==="true")throw new Zj.FunctionsRelayError(L);if(!L.ok)throw new Zj.FunctionsHttpError(L);let R=(($=L.headers.get("Content-Type"))!==null&&$!==void 0?$:"text/plain").split(";")[0].trim().toLowerCase(),E;if(R==="application/json")E=yield L.json();else if(R==="application/octet-stream"||R==="application/pdf")E=yield L.blob();else if(R==="text/event-stream")E=L;else if(R==="multipart/form-data")E=yield L.formData();else E=yield L.text();return{data:E,error:null,response:L}}catch(G){return{data:null,error:G,response:G instanceof Zj.FunctionsHttpError||G instanceof Zj.FunctionsRelayError?G.context:void 0}}finally{if(Y)clearTimeout(Y);if(X)(J=B.signal)===null||J===void 0||J.removeEventListener("abort",X)}})}}ogA.FunctionsClient=agA});var egA=$A((lD)=>{Object.defineProperty(lD,"__esModule",{value:!0});lD.FunctionRegion=lD.FunctionsRelayError=lD.FunctionsHttpError=lD.FunctionsFetchError=lD.FunctionsError=lD.FunctionsClient=void 0;var rgQ=tgA();Object.defineProperty(lD,"FunctionsClient",{enumerable:!0,get:function(){return rgQ.FunctionsClient}});var Cx=SZA();Object.defineProperty(lD,"FunctionsError",{enumerable:!0,get:function(){return Cx.FunctionsError}});Object.defineProperty(lD,"FunctionsFetchError",{enumerable:!0,get:function(){return Cx.FunctionsFetchError}});Object.defineProperty(lD,"FunctionsHttpError",{enumerable:!0,get:function(){return Cx.FunctionsHttpError}});Object.defineProperty(lD,"FunctionsRelayError",{enumerable:!0,get:function(){return Cx.FunctionsRelayError}});Object.defineProperty(lD,"FunctionRegion",{enumerable:!0,get:function(){return Cx.FunctionRegion}})});function QyA(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 sgQ(A,Q,B,$){if(!$||B>=3)return!1;if(!JyA.includes(A))return!1;if(!ogQ.includes(Q))return!1;return!0}function Vx(A){return Vx=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},Vx(A)}function QyQ(A,Q){if(Vx(A)!="object"||!A)return A;var B=A[Symbol.toPrimitive];if(B!==void 0){var $=B.call(A,Q||"default");if(Vx($)!="object")return $;throw TypeError("@@toPrimitive must return a primitive value.")}return(Q==="string"?String:Number)(A)}function ByQ(A){var Q=QyQ(A,"string");return Vx(Q)=="symbol"?Q:Q+""}function $yQ(A,Q,B){return(Q=ByQ(Q))in A?Object.defineProperty(A,Q,{value:B,enumerable:!0,configurable:!0,writable:!0}):A[Q]=B,A}function $yA(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 Cr(A){for(var Q=1;Q<arguments.length;Q++){var B=arguments[Q]!=null?arguments[Q]:{};Q%2?$yA(Object(B),!0).forEach(function($){$yQ(A,$,B[$])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(B)):$yA(Object(B)).forEach(function($){Object.defineProperty(A,$,Object.getOwnPropertyDescriptor(B,$))})}return A}var AyA=(A)=>Math.min(1000*2**A,30000),ogQ,JyA,kZA,tgQ=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(!JyA.includes(B.method))throw H;if(B.retryEnabled&&Z<3){let U=AyA(Z);Z++,await QyA(U,B.signal);continue}throw H}if(sgQ(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:AyA(Z);await W.text(),Z++,await QyA(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,z,D,I;let V=(U=H===null||H===void 0?void 0:H.message)!==null&&U!==void 0?U:"",L=(z=H===null||H===void 0?void 0:H.code)!==null&&z!==void 0?z:"";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"}: ${V}`,L)G+=` (${L})`;if(H===null||H===void 0?void 0:H.stack)G+=`
|
|
@@ -1243,7 +1243,7 @@ Reference: ${A}`:"Logs uploaded — Capgo support will be in touch by email."}as
|
|
|
1243
1243
|
`);return xF({kind:"build-request",appId:A.appId,error:`Cloud build ${A.jobId} failed`,logs:$,sections:B.length>0?[{title:"Internal log",lines:B}]:[]},A.outputDir)}I0();function bS0(A){if(!A||typeof A!=="object")return;let Q=A.originalResponse?.getStatus?.();return typeof Q==="number"?Q:void 0}function xS0(A){let Q=bS0(A);if(Q===401||Q===403)return"unauthorized";if(Q===413)return"payload_too_large";if(Q!==void 0&&Q>=500&&Q<600)return"storage_failure";if(Q===void 0||Q===0)return"network_error";return"unknown"}var vS0={started:"Builder Upload Started",succeeded:"Builder Upload Succeeded",failed:"Builder Upload Failed"};async function w4A(A){let Q={app_id:A.appId,platform:A.platform,build_mode:A.buildMode,job_id:A.jobId,upload_size_bytes:String(A.sizeBytes)};if(typeof A.durationSeconds==="number"&&Number.isFinite(A.durationSeconds))Q.upload_duration_seconds=String(Math.round(A.durationSeconds));if(A.phase==="failed"&&A.error!==void 0)Q.failure_category=xS0(A.error);try{await kB(A.apikey,{event:vS0[A.phase],channel:"build-lifecycle",org_id:A.orgId,tracking_version:2,tags:Q})}catch{}}async function cx0(){return T$({message:"No platform selected. Which platform do you want to build?",options:[{value:"ios",label:"iOS"},{value:"android",label:"Android"}]})}async function dx0(A,{silent:Q=!1,interactive:B=O6({silent:Q}),promptPlatform:$=cx0}={}){if(A==="ios"||A==="android")return A;if(A)throw Error(`Invalid platform "${A}". Must be "ios" or "android"`);if(!B)throw Error("Missing required argument: --platform <ios|android>. In an interactive terminal, you can omit --platform and choose one when prompted.");let J=await $();if(LB(J))throw f.warn("Build request canceled."),new sA("Build request canceled.");if(J!=="ios"&&J!=="android")throw Error("Build request canceled.");return J}function lx0(A){return{info:(Q)=>{if(!A)f.info(Q)},error:(Q)=>{if(!A)f.error(Q)},warn:(Q)=>{if(!A)f.warn(Q)},success:(Q)=>{if(!A)f.success(Q)},buildLog:(Q)=>{if(!A)console.log(Q)},uploadProgress:(()=>{let Q=A?null:a8(),B=!1;return($)=>{if(A||!Q)return;if(!B)Q.start("Uploading bundle"),B=!0;if($>=100)Q.stop("Upload complete!");else Q.message(`Uploading ${$.toFixed(0)}%`)}})(),customMsg:async(Q,B)=>{if(!A)await oV(Q,B,($)=>console.log($),($)=>f.warn($))}}}function px0(A){try{let Q=JSON.parse(A);if(!Q||typeof Q!=="object")return null;return Q}catch{return null}}async function u2Q(A,Q,B,$){if(A!==429)return;let J=px0(Q),Y=J?.error;if(Y!=="native_build_concurrency_limit_exceeded"&&Y!=="need_plan_upgrade")return;let Z=await oU(),X=J?.moreInfo?.upgrade_url||`${Z.hostWeb}/settings/organization/plans`,G=J?.message||(Y==="native_build_concurrency_limit_exceeded"?`Native build concurrency limit reached for your plan. Upgrade here: ${X}`:`Cannot ${B} native build, upgrade plan to continue: ${X}`);if($.error(G),!G.includes(X))$.error(`Upgrade here: ${X}`);try{await(await Promise.resolve().then(() => (bG(),cf))).default(X)}catch{}throw Error(G)}async function ix0(A,Q,B=3,$){let J=[1000,3000,5000];for(let Y=1;Y<=B;Y++)try{let Z=await fetch(A,Q);if(Z.ok||Z.status>=400&&Z.status<500)return Z;let X=await Z.text().catch(()=>"unknown error");if($?.warn(`Build request attempt ${Y}/${B} failed: ${Z.status} - ${X}`),Y<B){let G=J[Y-1]||5000;$?.info(`Retrying in ${G/1000}s...`),await new Promise((K)=>setTimeout(K,G))}else throw Error(`Failed to request build after ${B} attempts: ${Z.status} - ${X}`)}catch(Z){let X=Z instanceof Error?Z.message:String(Z);if(X.startsWith("Failed to request build after"))throw Z;if($?.warn(`Build request attempt ${Y}/${B} failed: ${X}`),Y<B){let G=J[Y-1]||5000;$?.info(`Retrying in ${G/1000}s...`),await new Promise((K)=>setTimeout(K,G))}else throw Error(`Failed to request build after ${B} attempts: ${X}`)}throw Error("Unexpected error in fetchWithRetry")}function m2Q(A){let Q={};if(A?.cache===!1)Q.cache_enabled=!1;let B=A?.cacheKey?.trim();if(B)Q.cache_key=B,Q.cache_fingerprint_extra=B;return Q}var nx0="Tip: if this looks cache-related (stale artifacts between RC/PROD or branches), retry with --cache-key <env> to isolate compilation cache, or --no-cache to skip cache restore.";function rx0(A){return A.cache!==!1&&!A.cacheKey?.trim()&&A.aiAnalysisMode!=="caller-handled"}var ax0=["succeeded","failed","expired","released","cancelled"],p4A=new Set(ax0);function ox0(A){if(typeof A.data==="string")return A.data;if(A.data instanceof ArrayBuffer)return new TextDecoder().decode(A.data);if(ArrayBuffer.isView(A.data)){let Q=A.data;return new TextDecoder().decode(new Uint8Array(Q.buffer,Q.byteOffset,Q.byteLength))}if(A.data&&typeof A.data.toString==="function")return A.data.toString();return""}function l2Q(A,Q,B){if(Q)Q.warn(A);else if(!B)f.warn(A)}async function sx0(A,Q,B,$){try{if(B)await B.customMsg(A,Q);else if(!$)await oV(A,Q,(J)=>console.log(J),(J)=>f.warn(J))}catch(J){l2Q(`Custom message handler encountered an error, continuing... ${String(J)}`,B,$)}}async function tx0(A,Q=!1,B,$,J,Y,Z,X){if(A&&!X)return null;let G=null,K=!1,W=(U)=>{if(!U.trim())return;if(G)return;if(!K)if(K=!0,X)X.buildLog("");else console.log("");if(X)X.buildLog(U);else console.log(U)},H=async()=>{if(!B||!$)return null;let U=XZ(B),z=`${U}/start`,I=`${U}/stream?token=${encodeURIComponent($)}`.replace(/^https:/,"wss:").replace(/^http:/,"ws:");if(X)X.info("Connecting to log streaming...");else if(!A)console.log("Connecting to log streaming...");let M=await fetch(z,{method:"POST",headers:j4({"x-capgo-log-token":$})});if(!M.ok){let N=await M.text().catch(()=>"unknown error");if(X)X.warn(`Could not start log session (${M.status}): ${N}`);else if(!A)console.warn(`Could not start log session (${M.status}): ${N}`);return null}return await new Promise((N)=>{let V=!1,L=10,C=0,R=!1,E=new ic(I,void 0,{maxRetries:L,WebSocket:gI}),w=null,k=0,g=Date.now(),S=!1,v=2000,y=4,o=p4A,t=null,r=null,p=(x)=>{if(V)return;if(V=!0,r)clearTimeout(r),r=null;if(w)clearInterval(w),w=null;if(Y&&t)Y.removeEventListener("abort",t),t=null;try{E.close()}catch(u){xB(`ws.close failed during cleanup (ignored): ${u instanceof Error?u.message:String(u)}`)}N(x)};r=setTimeout(()=>{if(!V){if(X)X.warn("Log streaming timed out after 3 hours");else if(!A)console.warn("Log streaming timed out after 3 hours");p(null)}},10800000);let c=()=>{if(w)return;w=setInterval(async()=>{try{if(E.readyState===ic.OPEN)E.send(JSON.stringify({type:"heartbeat",lastId:k}));let x=Date.now();if(J&&!S&&x-g>=v*y){S=!0;try{let u=await J();if(u&&o.has(u))G=u,p(G)}finally{S=!1}}}catch(x){if(X)X.warn(`Heartbeat encountered an error, continuing... ${String(x)}`);else if(!A)f.warn(`Heartbeat encountered an error, continuing... ${String(x)}`)}},v)},b=async(x)=>{if(x.type==="custom_msg"&&typeof x.kind==="string"&&x.data){g=Date.now(),await sx0(x.kind,x.data,X,A);return}if(x.type==="status"&&typeof x.status==="string"){let u=x.status.toLowerCase();if(g=Date.now(),o.has(u))G=u;return}if(x.type==="log"&&typeof x.message==="string"){g=Date.now(),W(x.message);return}if(typeof x.message==="string")g=Date.now(),W(x.message)},d=(x)=>{if(E.readyState!==ic.OPEN)return;try{E.send(JSON.stringify({type:"confirmed_received",lastId:x}))}catch(u){l2Q(`Failed to send log confirmation, continuing... ${String(u)}`,X,A)}};if(c(),Y){if(t=()=>{if(!V)p("cancelled")},Y.aborted){p("cancelled");return}Y.addEventListener("abort",t)}E.addEventListener("message",async(x)=>{let u=ox0(x),QA=null;try{QA=JSON.parse(u)}catch{QA=null}if(QA?.type==="heartbeat_response")return;if(QA?.type==="batch_messages"&&Array.isArray(QA.messages)){let m=k;for(let a of QA.messages)if(await b(a),typeof a.id==="number")m=Math.max(m,a.id);if(m>k)k=m,d(m)}else{if(QA)await b(QA);else if(u)g=Date.now(),W(u);if(QA&&typeof QA.id==="number"&&QA.id>k)k=QA.id,d(QA.id)}if(G)p(G)}),E.addEventListener("error",()=>{if(C+=1,X)X.warn(`Log stream encountered an error, retrying (${C}/${L})...`);else if(!A)console.warn(`Log stream encountered an error, retrying (${C}/${L})...`);if(!R&&C>=L){if(R=!0,X)X.warn("Log stream retry limit reached. Falling back to status checks.");else if(!A)f.warn("Log stream retry limit reached. Falling back to status checks.");if(Z)Z();p(null)}}),E.addEventListener("close",()=>{if(V)return;if(G){p(G);return}if(X)X.warn("Log stream closed, waiting for reconnect...");else if(!A)f.warn("Log stream closed, waiting for reconnect...")})})};try{let U=await H();if(U||G)return U||G}catch(U){if(X)X.warn(`Direct log streaming failed${U instanceof Error?`: ${U.message}`:""}`);else if(!A)f.warn(`Direct log streaming failed${U instanceof Error?`: ${U.message}`:""}`)}return G}async function ex0(A,Q,B,$,J,Y,Z=!1,X,G){let W=0;while(W<120){if(X?.aborted)return"cancelled";try{let H=await fetch(`${A}/build/status?job_id=${encodeURIComponent(Q)}&app_id=${encodeURIComponent(B)}&platform=${$}`,{headers:j4({authorization:J}),signal:X});if(!H.ok){G?.warn(`Status check failed: ${H.status}`),await new Promise((D)=>setTimeout(D,5000)),W++;continue}let U=await H.json(),z=U.status?.toLowerCase?.()??"";if(Z)G?.info(`Build status: ${z||U.status}`);if(p4A.has(z))return z;await new Promise((D)=>setTimeout(D,5000)),W++}catch(H){if(X?.aborted)return"cancelled";G?.warn(`Status check error: ${H}`),await new Promise((U)=>setTimeout(U,5000)),W++}}return G?.warn("Build status polling timed out"),"timeout"}async function Av0(A,Q,B){let $=new Set,J=new Set,Y=!1,Z=!1;if(Q==="ios"){let X=Y7(A,B,"App","CapApp-SPM","Package.swift");if(yW(X)){Y=!0;let W=(await l4A(X,"utf-8")).matchAll(/\.package\s*\([^)]*path:\s*["'](?:\.\.[\\/])*node_modules[\\/]([^"']+)["']\s*\)/g);for(let H of W){let U=H[1].replace(/\\/g,"/"),z=U.lastIndexOf("node_modules/");if(z!==-1)U=U.substring(z+13);$.add(U)}}let G=Y7(A,B);if(yW(G)){let K=[Y7(G,"App","Podfile"),Y7(G,"Podfile")];for(let H of yVA(G,{withFileTypes:!0}))if(H.isDirectory())K.push(Y7(G,H.name,"Podfile"));let W=[...new Set(K)].filter((H)=>yW(H));if(W.length>0)Z=!0;for(let H of W){let z=(await l4A(H,"utf-8")).matchAll(/pod\s+['"][^'"]+['"],\s*:path\s*=>\s*['"](?:\.\.[\\/])+node_modules[\\/]([^'"]+)['"]/g);for(let D of z){let I=D[1],M=I.lastIndexOf("node_modules/");if(M!==-1)I=I.substring(M+13);$.add(I)}}}}else if(Q==="android"){let X=Y7(A,B,"capacitor.settings.gradle");if(yW(X)){let W=(await l4A(X,"utf-8")).matchAll(/new\s+File\s*\(\s*['"]\.\.[\\/]node_modules[\\/]([^'"]+)['"]\s*\)/g);for(let H of W){let U=H[1].replace(/\\/g,"/"),z=U.lastIndexOf("node_modules/");if(z!==-1)U=U.substring(z+13);let D=U.replace(/\/(android|capacitor)$/,"");$.add(D)}}let G=Y7(A,B,"capacitor-cordova-android-plugins","build.gradle");if(yW(G)){let W=(await l4A(G,"utf-8")).matchAll(/apply\s+from\s*:\s*["'](?:\.\.\/)+node_modules\/([^"']+)["']/g);for(let H of W){let U=H[1],z=U.lastIndexOf("node_modules/");if(z!==-1)U=U.substring(z+13);let D=U.split("/"),I=D[0].startsWith("@")&&D.length>=2?`${D[0]}/${D[1]}`:D[0];J.add(I)}}}return{packages:$,cordovaPackages:J,usesSPM:Y,usesCocoaPods:Z}}function Qv0(A,Q){let B=Y7(A,Q,"App");if(yW(Y7(B,"Podfile")))return"cocoapods";if(yW(Y7(B,"CapApp-SPM","Package.swift")))return"spm";return}function c2Q(A,Q,B,$){let J=A.replace(/\\/g,"/");if(J.startsWith(`${$}/`))return!0;if(J==="package.json"||J==="package-lock.json"||J.startsWith("capacitor.config."))return!0;if(J.startsWith("resources/"))return!0;if(Q==="ios"&&J.startsWith("node_modules/@capacitor/ios/"))return!0;if(Q==="android"&&J.startsWith("node_modules/@capacitor/android/"))return!0;if(Q==="android")for(let Y of B.cordovaPackages){let Z=`node_modules/${Y}/`;if(J===`node_modules/${Y}/package.json`)return!0;if(J.startsWith(Z)){let X=J.slice(Z.length);if(X==="node_modules"||X.startsWith("node_modules/"))continue;return!0}}for(let Y of B.packages){let Z=`node_modules/${Y}/`;if(J===`${Z}package.json`)return!0;if(Q==="android"){if(J.startsWith(`${Z}android/`))return!0}else if(Q==="ios"){if(J.startsWith(`${Z}ios/`))return!0;if(B.usesSPM){if(J===`${Z}Package.swift`)return!0}if(B.usesCocoaPods||!B.usesSPM){if(J.startsWith(Z)&&J.endsWith(".podspec"))return!0}}}return!1}function xd(A,Q,B,$,J,Y){let Z=yVA(Q);for(let X of Z){let G=Y7(Q,X),K=B?`${B}/${X}`:X,W=vx0(G);if(W.isDirectory()){if(X===".git"||X==="dist"||X==="build"||X===".angular"||X===".vite"||X===".gradle"||X===".idea"||X===".swiftpm")continue;if(X==="node_modules"){xd(A,G,K,$,J,Y);continue}if(X==="resources"){xd(A,G,K,$,J,Y);continue}let H=K.replace(/\\/g,"/"),U=[...J.packages,...J.cordovaPackages];if(c2Q(K,$,J,Y)||Y===H||Y.startsWith(`${H}/`)||U.some((D)=>{return`node_modules/${D}/`.startsWith(`${H}/`)||H.startsWith(`node_modules/${D}`)}))xd(A,G,K,$,J,Y)}else if(W.isFile()){if(X===".DS_Store"||X.endsWith(".log"))continue;if(c2Q(K,$,J,Y))Bv0(A,G,K)}}}function Bv0(A,Q,B){let $=B.replace(/\\/g,"/");if(A.getEntry($))return;let J=$.lastIndexOf("/"),Y=J===-1?void 0:$.slice(0,J);A.addLocalFile(Q,Y)}function $v0(A){if(!A)return[];let Q=A.split(",").map((B)=>B.trim()).filter(Boolean).map((B)=>gVA(B));return[...new Set(Q)]}function Jv0(A,Q){let B=new Set([...Q.packages,...Q.cordovaPackages]);return B.add(A==="ios"?"@capacitor/ios":"@capacitor/android"),B}function Yv0(A,Q){let B=Y7(A,...Q.split("/"));if(yW(B))return B;let $=Y7(A,".pnpm");if(!yW($))return;let J=Q.replace("/","+"),Y=yVA($,{withFileTypes:!0}).filter((Z)=>Z.isDirectory()).map((Z)=>Z.name).filter((Z)=>Z.startsWith(`${J}@`)).sort();if(Y.length>1)throw Error(`Multiple pnpm store entries found for ${Q} in ${$}; provide the app-specific node_modules path so the native build archive can use the exact resolved package.`);for(let Z of Y){let X=Y7($,Z,"node_modules",...Q.split("/"));if(yW(X))return X}return}function Zv0(A,Q,B,$,J){if(Q.length===0)return;let Y=Q.filter((Z)=>!yW(Z));if(Y.length>0)throw Error(`Missing node_modules folder at ${Y.join(", ")}`);for(let Z of Q)for(let X of Jv0(B,$)){let G=Yv0(Z,X);if(!G)continue;xd(A,G,`node_modules/${X}`,B,$,J)}}async function Xv0(A,Q,B,$,J={}){let Y=L9($,B),Z=await Av0(A,B,Y),X=new d2Q.default;xd(X,A,"",B,Z,Y),Zv0(X,$v0(J.nodeModules),B,Z,Y);let G=/node_modules\/\.pnpm\/[^/\n\r]+(?:\/[^/\n\r]+)*\/node_modules\//g,K=/node_modules\/\.bun\/[^/\n\r]+(?:\/[^/\n\r]+)*\/node_modules\//g,W=new Set(["",".gradle",".swift",".json",".lock",".xml",".properties",".pbxproj",".xcconfig",".plist",".podspec",".rb",".yaml",".yml"]);for(let U of X.getEntries()){if(U.isDirectory)continue;let z=U.entryName.includes(".")?`.${U.entryName.split(".").pop()}`:"",D=U.entryName.split("/").pop()||"";if(!W.has(z)&&D!=="Podfile")continue;let I=U.getData().toString("utf-8"),M=UZQ(I);if(M=M.replace(G,"node_modules/").replace(K,"node_modules/"),B==="ios"){let N="../".repeat(U.entryName.split("/").length-1);M=M.replace(/(?:\.\.\/){4,}(ios\/|node_modules\/)/g,(V,L)=>`${N}${L}`)}if(M!==I)X.updateFile(U.entryName,g2Q.from(M,"utf-8"))}let H=Y7(A,"capacitor.config.json");if($&&!yW(H)){let U=`${JSON.stringify($,null,2)}
|
|
1244
1244
|
`;X.addFile("capacitor.config.json",g2Q.from(U,"utf-8"))}await hx0(Q,X.toBuffer())}function Gv0(A){let Q=A.trim().replace(/^xcode\s*/i,"");return/^\d{1,3}(?:\.\d{1,3}){0,2}$/.test(Q)?Q:void 0}var Kv0=new Set(["CAPGO_IOS_SCHEME","CAPGO_IOS_TARGET","CAPGO_IOS_DISTRIBUTION","CAPGO_IOS_XCODE_VERSION","BUILD_OUTPUT_UPLOAD_ENABLED","BUILD_OUTPUT_RETENTION_SECONDS","SKIP_BUILD_NUMBER_BUMP","SKIP_MARKETING_VERSION_BUMP","CAPGO_STORE_SUBMIT_REVIEW","CAPGO_STORE_RELEASE_NAME","CAPGO_STORE_RELEASE_NOTES","CAPGO_STORE_RELEASE_NOTES_LOCALIZED","CAPGO_IOS_AUTOMATIC_RELEASE","CAPGO_IOS_TESTFLIGHT_GROUPS","CAPGO_IOS_SOURCE_DIR","CAPGO_IOS_APP_DIR","CAPGO_IOS_PROJECT_DIR","IOS_PROJECT_DIR","CAPGO_ANDROID_SOURCE_DIR","CAPGO_ANDROID_APP_DIR","CAPGO_ANDROID_PROJECT_DIR","ANDROID_PROJECT_DIR","CAPGO_ANDROID_FLAVOR"]);function Wv0(A){if(!A||A.length===0)return;let Q={};for(let B of A){let $=B.indexOf("=");if($<=0)throw Error('--store-release-notes-locale must use locale=notes format, for example: --store-release-notes-locale en-US="Bug fixes"');let J=B.slice(0,$).trim(),Y=B.slice($+1).trim();if(!J||!Y)throw Error("--store-release-notes-locale requires both a locale and non-empty release notes");Q[J]=Y}return Object.keys(Q).length>0?Q:void 0}function n4A(A){let Q=A?.trim();if(!Q)return;let B;try{B=JSON.parse(Q)}catch(J){throw Error(`CAPGO_STORE_RELEASE_NOTES_LOCALIZED must be valid JSON: ${J instanceof Error?J.message:String(J)}`)}if(!B||typeof B!=="object"||Array.isArray(B))throw Error('CAPGO_STORE_RELEASE_NOTES_LOCALIZED must be a JSON object like {"en-US":"Bug fixes"}');let $={};for(let[J,Y]of Object.entries(B)){let Z=J.trim();if(typeof Y!=="string"||!Y.trim())throw Error(`CAPGO_STORE_RELEASE_NOTES_LOCALIZED.${Z||J} must be a non-empty string`);if(!Z)throw Error("CAPGO_STORE_RELEASE_NOTES_LOCALIZED cannot contain an empty locale key");$[Z]=Y.trim()}return Object.keys($).length>0?$:void 0}function Hv0(A,Q,B,$){let J=n4A(A.CAPGO_STORE_RELEASE_NOTES_LOCALIZED),Y=A.CAPGO_IOS_AUTOMATIC_RELEASE===void 0?void 0:A.CAPGO_IOS_AUTOMATIC_RELEASE==="true",Z={platform:Q,buildMode:B,cliVersion:$,iosScheme:A.CAPGO_IOS_SCHEME,iosTarget:A.CAPGO_IOS_TARGET,iosDistribution:A.CAPGO_IOS_DISTRIBUTION,iosXcodeVersion:Q==="ios"?A.CAPGO_IOS_XCODE_VERSION:void 0,iosSourceDir:A.CAPGO_IOS_SOURCE_DIR,iosAppDir:A.CAPGO_IOS_APP_DIR,iosProjectDir:A.CAPGO_IOS_PROJECT_DIR,androidSourceDir:A.CAPGO_ANDROID_SOURCE_DIR,androidAppDir:A.CAPGO_ANDROID_APP_DIR,androidProjectDir:A.CAPGO_ANDROID_PROJECT_DIR,androidFlavor:A.CAPGO_ANDROID_FLAVOR,outputUploadEnabled:A.BUILD_OUTPUT_UPLOAD_ENABLED==="true",outputRetentionSeconds:A.BUILD_OUTPUT_RETENTION_SECONDS?Number.parseInt(A.BUILD_OUTPUT_RETENTION_SECONDS,10)||eU:eU,skipBuildNumberBump:A.SKIP_BUILD_NUMBER_BUMP==="true",skipMarketingVersionBump:A.SKIP_MARKETING_VERSION_BUMP==="true",submitToStoreReview:A.CAPGO_STORE_SUBMIT_REVIEW==="true",storeReleaseName:A.CAPGO_STORE_RELEASE_NAME,storeReleaseNotes:A.CAPGO_STORE_RELEASE_NOTES,storeReleaseNotesLocalized:J,iosTestflightGroups:A.CAPGO_IOS_TESTFLIGHT_GROUPS,iosAutomaticRelease:Y},X={};for(let[G,K]of Object.entries(A))if(!Kv0.has(G)&&K!==void 0)X[G]=K;return{buildOptions:Z,buildCredentials:X}}async function Nz(A,Q,B=!1,$){if(!k3())iI(A);xB(`build request: started for ${A} (platform ${Q.platform??"auto"})`);let J=Date.now(),Y=Q.verbose??!1,Z=$||lx0(B),X=null,G=Q.outputRecord?{...Z,customMsg:async(K,W)=>{if(K==="qr_download_link"&&typeof W.url==="string")X=W.url;await Z.customMsg(K,W)}}:Z;try{if(Q.prescan===!0){let{validateFlags:a}=await Promise.resolve().then(() => (d4A(),fVA));a({ignoreFatal:Q.prescanIgnoreFatal,failOnWarnings:Q.failOnWarnings})}Q.apikey=Q.apikey||b0(B);let K=gVA(Q.path||h2Q()),W=await e1A(K,()=>g0());if(A=e9(A,W?.config,"native")||"",!A)throw Error("Missing argument, you need to provide a appId, or be in a capacitor project");let H=await dx0(Q.platform,{silent:B});if(H==="ios"&&Q.syncIosVersion){let a=YVA({path:K});G.info(a.changed?`Synced iOS app version to ${a.marketingVersion}`:`iOS app version is already ${a.marketingVersion}`)}if(H==="android"&&Q.syncAndroidVersion){let a=nGQ({path:K});G.info(a.changed?`Synced Android app version to ${a.packageVersion}`:`Android app version is already ${a.packageVersion}`)}let U=Q.supaHost||"https://api.capgo.app",z=await NB(Q.apikey,Q.supaHost,Q.supaAnon),D="";try{D=await W9(Q.apikey,A,{supaHost:Q.supaHost,supaAnon:Q.supaAnon})}catch{}if(G.info(`Requesting native build for ${A}`),G.info(`Platform: ${H}`),G.info(`Project: ${K}`),G.info(`
|
|
1245
1245
|
\uD83D\uDD12 Security: Credentials are never stored on Capgo servers`),G.info(" They are used only during build and deleted after"),G.info(` Build outputs can optionally be uploaded for time-limited download links
|
|
1246
|
-
`),Y)G.info(`API host: ${U}`);let I={},M={...Q.storeReleaseNotesLocalized??{},...Wv0(Q.storeReleaseNotesLocale)??{}},N=Object.keys(M).length>0;if(Q.buildCertificateBase64)I.BUILD_CERTIFICATE_BASE64=Q.buildCertificateBase64;if(Q.p12Password)I.P12_PASSWORD=Q.p12Password;if(Q.appleKeyId)I.APPLE_KEY_ID=Q.appleKeyId;if(Q.appleIssuerId)I.APPLE_ISSUER_ID=Q.appleIssuerId;if(Q.appleKeyContent)I.APPLE_KEY_CONTENT=Q.appleKeyContent;if(Q.appStoreConnectTeamId)I.APP_STORE_CONNECT_TEAM_ID=Q.appStoreConnectTeamId;if(Q.appleId)I.FASTLANE_USER=Q.appleId;if(Q.appleAppSpecificPassword)I.FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD=Q.appleAppSpecificPassword;if(Q.appleAppId)I.APPLE_APP_ID=Q.appleAppId;if(Q.iosScheme)I.CAPGO_IOS_SCHEME=Q.iosScheme;if(Q.iosTarget)I.CAPGO_IOS_TARGET=Q.iosTarget;if(Q.iosDistribution)I.CAPGO_IOS_DISTRIBUTION=Q.iosDistribution;if(Q.xcodeVersion)I.CAPGO_IOS_XCODE_VERSION=Q.xcodeVersion;if(Q.iosProvisioningProfile&&Q.iosProvisioningProfile.length>0){let a=Be(Q.iosProvisioningProfile,gVA(Q.path||h2Q()));I.CAPGO_IOS_PROVISIONING_MAP=JSON.stringify(a)}if(Q.iosProvisioningMap)I.CAPGO_IOS_PROVISIONING_MAP=Q.iosProvisioningMap;if(Q.androidKeystoreFile)I.ANDROID_KEYSTORE_FILE=Q.androidKeystoreFile;if(Q.keystoreKeyAlias)I.KEYSTORE_KEY_ALIAS=Q.keystoreKeyAlias;let V=!!Q.keystoreKeyPassword,L=!!Q.keystoreStorePassword;if(V&&!L)I.KEYSTORE_KEY_PASSWORD=Q.keystoreKeyPassword,I.KEYSTORE_STORE_PASSWORD=Q.keystoreKeyPassword;else if(!V&&L)I.KEYSTORE_KEY_PASSWORD=Q.keystoreStorePassword,I.KEYSTORE_STORE_PASSWORD=Q.keystoreStorePassword;else if(V&&L)I.KEYSTORE_KEY_PASSWORD=Q.keystoreKeyPassword,I.KEYSTORE_STORE_PASSWORD=Q.keystoreStorePassword;if(typeof Q.androidFlavor==="string"){let a=Q.androidFlavor.trim();if(a)I.CAPGO_ANDROID_FLAVOR=a}if(Q.playConfigJson)I.PLAY_CONFIG_JSON=Q.playConfigJson;if(typeof Q.androidTrack==="string"&&Q.androidTrack.trim())I.PLAY_STORE_TRACK=UzA(Q.androidTrack);if(typeof Q.androidReleaseStatus==="string"&&Q.androidReleaseStatus.trim())I.PLAY_STORE_RELEASE_STATUS=qzA(Q.androidReleaseStatus);if(Q.inAppUpdatePriority!==void 0)I.PLAY_STORE_IN_APP_UPDATE_PRIORITY=String(X_(Q.inAppUpdatePriority));if(Q.outputUpload!==void 0)I.BUILD_OUTPUT_UPLOAD_ENABLED=$Y(Q.outputUpload)?"true":"false";if(Q.outputRetention)I.BUILD_OUTPUT_RETENTION_SECONDS=String(Z_(Q.outputRetention));if(Q.skipBuildNumberBump!==void 0)I.SKIP_BUILD_NUMBER_BUMP=$Y(Q.skipBuildNumberBump)?"true":"false";if(Q.skipMarketingVersionBump!==void 0)I.SKIP_MARKETING_VERSION_BUMP=$Y(Q.skipMarketingVersionBump)?"true":"false";if(Q.submitToStoreReview!==void 0)I.CAPGO_STORE_SUBMIT_REVIEW=$Y(Q.submitToStoreReview)?"true":"false";if(typeof Q.storeReleaseName==="string"&&Q.storeReleaseName.trim())I.CAPGO_STORE_RELEASE_NAME=Q.storeReleaseName.trim();if(typeof Q.storeReleaseNotes==="string"&&Q.storeReleaseNotes.trim())I.CAPGO_STORE_RELEASE_NOTES=Q.storeReleaseNotes.trim();if(typeof Q.iosTestflightGroups==="string"&&Q.iosTestflightGroups.trim())I.CAPGO_IOS_TESTFLIGHT_GROUPS=Q.iosTestflightGroups.trim();if(Q.iosAutomaticRelease!==void 0)I.CAPGO_IOS_AUTOMATIC_RELEASE=$Y(Q.iosAutomaticRelease)?"true":"false";let C=await tt(A,H,Object.keys(I).length>0?I:void 0);if(C&&N){let a=n4A(C.CAPGO_STORE_RELEASE_NOTES_LOCALIZED)??{};C.CAPGO_STORE_RELEASE_NOTES_LOCALIZED=JSON.stringify({...a,...M})}if(Q.playstoreUpload===!1&&C)delete C.PLAY_CONFIG_JSON,G.info("ℹ️ --no-playstore-upload specified, Play Store upload disabled for this build");let R=L9(W?.config,H);if(C&&R)if(H==="ios")C.CAPGO_IOS_SOURCE_DIR=R,C.CAPGO_IOS_APP_DIR=R,C.CAPGO_IOS_PROJECT_DIR=R,C.IOS_PROJECT_DIR=R;else C.CAPGO_ANDROID_SOURCE_DIR=R,C.CAPGO_ANDROID_APP_DIR=R,C.CAPGO_ANDROID_PROJECT_DIR=R,C.ANDROID_PROJECT_DIR=R;if(!C)throw G.error("❌ No credentials found for this app and platform"),G.error(""),G.error("You must provide credentials via:"),G.error(" 1. CLI arguments (--apple-key-id, --p12-password, etc.)"),G.error(" 2. Environment variables (APPLE_KEY_ID, P12_PASSWORD, etc.)"),G.error(" 3. Saved credentials file:"),G.error(` npx @capgo/cli build credentials save --appId ${A} --platform ${H}`),G.error(""),G.error("Documentation:"),G.error(" https://capgo.app/docs/cli/cloud-build/credentials/"),Error("No credentials found. Please provide credentials before building.");let E=[];if(H==="ios"){let a=C.CAPGO_IOS_DISTRIBUTION,BA=["app_store","ad_hoc"];if(a&&!BA.includes(a))E.push(`Invalid CAPGO_IOS_DISTRIBUTION value: '${a}'. Must be one of: ${BA.join(", ")}`);let KA=a&&BA.includes(a)?a:"app_store";if(!a)G.info("ℹ️ --ios-distribution not specified, defaulting to app_store");C.CAPGO_IOS_DISTRIBUTION=KA;let YA=C.CAPGO_IOS_XCODE_VERSION;if(YA!==void 0&&!YA.trim())delete C.CAPGO_IOS_XCODE_VERSION;else if(YA!==void 0){let HA=Gv0(YA);if(HA)C.CAPGO_IOS_XCODE_VERSION=HA,G.info(`ℹ️ Building on a machine with Xcode ${HA}`);else E.push(`Invalid --xcode-version / CAPGO_IOS_XCODE_VERSION value: '${YA}'. Use a version like 26, 26.1 or 16.4.1`)}if(C.CAPGO_STORE_SUBMIT_REVIEW==="true"&&KA!=="app_store")E.push("--submit-to-store-review on iOS requires --ios-distribution app_store");if(!C.BUILD_CERTIFICATE_BASE64)E.push("BUILD_CERTIFICATE_BASE64 (or --build-certificate-base64)");if(!C.P12_PASSWORD)G.warn("⚠️ P12_PASSWORD not provided - assuming certificate has no password"),G.warn(" If your certificate requires a password, provide it with --p12-password");if(!!(C.BUILD_PROVISION_PROFILE_BASE64||C.APPLE_PROFILE_NAME)&&!C.CAPGO_IOS_PROVISIONING_MAP)throw G.error("❌ Legacy provisioning profile format detected. Run:"),G.error(" npx @capgo/cli build credentials migrate --platform ios"),G.error(""),G.error(" This will convert your existing provisioning profile to the new multi-target format."),Error("Legacy provisioning profile format detected. Run: npx @capgo/cli build credentials migrate --platform ios");if(!C.CAPGO_IOS_PROVISIONING_MAP)E.push('CAPGO_IOS_PROVISIONING_MAP (use --ios-provisioning-profile or save via "build credentials save")');if(KA==="app_store"){let HA=!!C.APPLE_KEY_ID,MA=!!C.APPLE_ISSUER_ID,wA=!!C.APPLE_KEY_CONTENT,XA=HA||MA||wA,CA=HA&&MA&&wA,VA=!!C.FASTLANE_USER,BQ=!!C.FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD,_A=!!C.APPLE_APP_ID,q0=VA||BQ||_A,lQ=VA&&BQ&&_A;if(C.CAPGO_STORE_SUBMIT_REVIEW==="true"&&!CA)E.push("App Store Connect API key (APPLE_KEY_ID/APPLE_ISSUER_ID/APPLE_KEY_CONTENT) is required for --submit-to-store-review on iOS");if(_A&&!/^\d+$/.test(String(C.APPLE_APP_ID).trim()))E.push("APPLE_APP_ID must be the app's numeric App Store Connect id (digits only, e.g. 1234567890)");if(CA);else if(lQ){if(G.info("\uD83D\uDD11 Using Apple ID + app-specific password for TestFlight upload (no App Store Connect API key)"),G.info(" Build number will use a timestamp-based fallback (App Store Connect is not queried)"),!Q.builderJourneyId)G.warn("⚠️ App-specific password authentication is not recommended; it exists as an Ionic Appflow migration fallback."),G.warn(" Prefer an App Store Connect API key (.p8): https://capgo.app/docs/builder/configuration/")}else if(q0){let _0=[];if(!VA)_0.push("FASTLANE_USER (or --apple-id)");if(!BQ)_0.push("FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD (or --apple-app-specific-password)");if(!_A)_0.push("APPLE_APP_ID (or --apple-app-id)");E.push(`Incomplete app-specific password credentials - missing: ${_0.join(", ")}`)}else if(XA){let _0=[];if(!HA)_0.push("APPLE_KEY_ID (or --apple-key-id)");if(!MA)_0.push("APPLE_ISSUER_ID (or --apple-issuer-id)");if(!wA)_0.push("APPLE_KEY_CONTENT (or --apple-key-content)");E.push(`Incomplete App Store Connect API key - missing: ${_0.join(", ")}`)}else if(C.BUILD_OUTPUT_UPLOAD_ENABLED!=="true")E.push("App Store Connect API key (APPLE_KEY_ID/APPLE_ISSUER_ID/APPLE_KEY_CONTENT) or app-specific password (FASTLANE_USER + FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD + APPLE_APP_ID) or BUILD_OUTPUT_UPLOAD_ENABLED=true (or --output-upload) (build has no output destination - enable either TestFlight upload or Capgo download link)");else if(C.SKIP_BUILD_NUMBER_BUMP!=="true"||C.SKIP_MARKETING_VERSION_BUMP!=="true")E.push("App Store Connect API key (APPLE_KEY_ID/APPLE_ISSUER_ID/APPLE_KEY_CONTENT) or app-specific password or --skip-build-number-bump and --skip-marketing-version-bump (iOS versions cannot be auto-incremented without App Store Connect credentials)");else G.warn("⚠️ No App Store Connect API key or app-specific password provided - build will succeed but cannot auto-upload to TestFlight")}else if(KA==="ad_hoc")G.info("\uD83D\uDCE6 Ad-hoc distribution mode: App Store Connect API key not required"),G.info(" Build number will use timestamp-based fallback");if(!C.APP_STORE_CONNECT_TEAM_ID)E.push("APP_STORE_CONNECT_TEAM_ID (or --app-store-connect-team-id)")}else if(H==="android"){if(!C.ANDROID_KEYSTORE_FILE)E.push("ANDROID_KEYSTORE_FILE (or --android-keystore-file)");if(!C.KEYSTORE_KEY_ALIAS)E.push("KEYSTORE_KEY_ALIAS (or --keystore-key-alias)");if(!C.KEYSTORE_KEY_PASSWORD&&!C.KEYSTORE_STORE_PASSWORD)E.push("KEYSTORE_KEY_PASSWORD or KEYSTORE_STORE_PASSWORD (at least one password required)");if(!C.PLAY_CONFIG_JSON)if(C.CAPGO_STORE_SUBMIT_REVIEW==="true")E.push("PLAY_CONFIG_JSON is required for --submit-to-store-review on Android");else if(C.BUILD_OUTPUT_UPLOAD_ENABLED!=="true")E.push("PLAY_CONFIG_JSON or BUILD_OUTPUT_UPLOAD_ENABLED=true (build has no output destination - enable either Play Store upload or Capgo download link)");else G.warn("⚠️ PLAY_CONFIG_JSON not provided - build will succeed but cannot auto-upload to Play Store")}if(E.length>0){G.error(`❌ Missing required credentials for ${H}:`),G.error("");for(let a of E)G.error(` • ${a}`);throw G.error(""),G.error("Provide credentials via:"),G.error(` 1. CLI arguments: npx @capgo/cli build request --platform ${H} ${H==="ios"?'--apple-key-id "..." --apple-issuer-id "..." --apple-key-content "..."':'--android-keystore-file "..." --keystore-key-alias "..."'}`),G.error(` 2. Environment variables: ${H==="ios"?'export APPLE_KEY_ID="..." APPLE_ISSUER_ID="..." APPLE_KEY_CONTENT="..."':'export ANDROID_KEYSTORE_FILE="..." KEYSTORE_KEY_ALIAS="..."'}`),G.error(` 3. Saved credentials: npx @capgo/cli build credentials save --platform ${H} ...`),G.error(""),G.error("Documentation:"),G.error(` https://capgo.app/docs/cli/cloud-build/${H}/`),Error(`Missing required credentials for ${H}: ${E.join(", ")}`)}if(!Q.buildMode)G.info("ℹ️ --build-mode not specified, defaulting to release");if(!C.BUILD_OUTPUT_UPLOAD_ENABLED)G.info("ℹ️ --output-upload not specified, defaulting to false (no Capgo download link)");if(!C.BUILD_OUTPUT_RETENTION_SECONDS)G.info(`ℹ️ --output-retention not specified, defaulting to ${eU}s (1 hour)`);let w=H==="ios"&&!(C.APPLE_KEY_ID&&C.APPLE_ISSUER_ID&&C.APPLE_KEY_CONTENT);if(!C.SKIP_BUILD_NUMBER_BUMP&&!w)G.info("ℹ️ --skip-build-number-bump not specified, build number will be auto-incremented (default)");if(!C.SKIP_MARKETING_VERSION_BUMP&&H==="ios"&&!w)G.info("ℹ️ --skip-marketing-version-bump not specified, marketing version will be auto-bumped when already released (default)");let{buildOptions:k,buildCredentials:g}=Hv0(C,H,Q.buildMode||"release",I$.version),S=H==="ios"?Qv0(K,R):void 0,v={app_id:A,platform:H,build_mode:Q.buildMode||"release",build_options:k,build_credentials:g,...S?{ios_dependency_manager:S}:{},...m2Q({cache:Q.cache,cacheKey:Q.cacheKey})};if(Q.cache===!1)G.info(`ℹ️ --no-cache specified, compilation cache disabled for this ${H} build`);else if(Q.cacheKey?.trim())G.info(`ℹ️ --cache-key "${Q.cacheKey.trim()}" specified for this ${H} build`);if(G.info("✓ Using credentials (merged from CLI args, env vars, and saved file)"),Y){let a=Object.keys(g);G.info(`Credentials provided: ${a.join(", ")}`),G.info(`Build options: platform=${k.platform}, mode=${k.buildMode}, cliVersion=${k.cliVersion}`)}if(Q.prescan===!0){let{executePrescan:a,runPrescanGate:BA}=await Promise.resolve().then(() => (d4A(),fVA)),{enforcedCounts:KA}=await Promise.resolve().then(() => VWQ),{decision:YA,report:NA,crashed:HA,informationOnlyFindings:MA}=await BA({enabled:!0,ignoreFatal:Q.prescanIgnoreFatal,failOnWarnings:Q.failOnWarnings,silent:B,print:(wA)=>G.info(wA),warn:(wA)=>G.warn(wA)},async()=>(await a(A,{platform:H,path:K,apikey:Q.apikey,credentials:C,androidFlavor:Q.androidFlavor,iosDist:Q.iosDistribution,skip:Q.prescanSkip,warn:Q.prescanWarn,supaHost:Q.supaHost,supaAnon:Q.supaAnon})).report);{let wA=NA?.counts,XA=NA?KA(NA):void 0,CA=HA?"crashed":!wA?"skipped":YA==="block"?"blocked":Q.prescanIgnoreFatal&&(XA?.error??wA.error)>0?"bypassed":MA>0?"information-only":(XA?.warning??wA.warning)>0?"warned":"clean";await kB(Q.apikey,{channel:"native-builder",event:"Prescan run",org_id:D,tracking_version:2,tags:{source:"build-request",result:CA,"app-id":A,platform:H,errors:String(wA?.error??0),warnings:String(wA?.warning??0),"finding-ids":NA?NA.findings.filter((VA)=>VA.severity!=="info").map((VA)=>VA.id).join(",").slice(0,200):"",bypassed:String(CA==="bypassed"),"information-only-findings":String(MA)}}).catch(()=>{})}if(YA==="block")throw Error("Prescan found blocking problems — the build was not requested and nothing was uploaded. Fix the errors above or re-run with --prescan-ignore-fatal / --no-prescan.")}await af(z,Q.apikey,"app.build_native",{appId:A},{message:`Capgo rejected this API key: missing app.build_native permission for app ${A}.`,silent:B}),G.info("Requesting build from Capgo...");let y=3,o=await ix0(`${U}/build/request`,{method:"POST",headers:j4({"Content-Type":"application/json",authorization:Q.apikey}),body:JSON.stringify(v)},y,G);if(!o.ok){let a=await o.text();if(await u2Q(o.status,a,"request",G),a.includes("build_machine_version_unavailable")){let KA=a;try{KA=JSON.parse(a).message||a}catch{}throw Error(`${KA} Change or drop --xcode-version.`)}let BA=o.status===401||o.status===403||/invalid_apikey|unauthorized|no_key_provided|invalid_jwt|no_jwt/i.test(a);throw Error(BA?`Capgo rejected the build request (HTTP ${o.status}): ${a}`:`Capgo build request failed (HTTP ${o.status}): ${a}`)}let t=await o.json();if(G.success(`Build job created: ${t.job_id}`),G.info(`Status: ${t.status}`),Y)G.info(`Upload URL: ${t.upload_url}`),G.info(`Upload expires: ${t.upload_expires_at}`);let r=Q.aiAnalysisMode??"auto-prompt",p=Q.sendLogsToSupport===!0||Q.sendLogs===!0,c=(wGQ()||Q.aiAnalytics===!0||p||r==="caller-handled")&&r!=="skip",b=null,d=!1,x;if(c&&t.job_id)b=t.job_id,await _GQ(t.job_id),TGQ(t.job_id,()=>d);let u={...G,buildLog:(a)=>{if(G.buildLog(a),c&&b)PGQ(b,a)}};await kB(Q.apikey,{channel:"native-builder",event:"Build requested",org_id:D,tracking_version:2,tags:{"app-id":A,platform:H,...Q.builderJourneyId?{journey_id:Q.builderJourneyId}:{}}}).catch();let QA=Y7(ux0(),`capgo-build-${Date.now()}`);await fx0(QA,{recursive:!0});let m=Y7(QA,`${y2Q(K)}.zip`);try{G.info(`Zipping ${H} project from ${K}...`),await Xv0(K,m,H,W?.config,{nodeModules:Q.nodeModules});let a=await yx0(m),BA=(a.size/1024/1024).toFixed(2);if(G.success(`Created zip: ${m} (${BA} MB)`),G.info("Uploading to builder..."),Y)G.info(`Upload endpoint: ${t.upload_url}`),G.info(`File size: ${BA} MB`),G.info(`Job ID: ${t.job_id}`);let KA=xx0(m);G.uploadProgress(0);let YA=Date.now(),NA=Q.buildMode||"release";w4A({apikey:Q.apikey,appId:A,orgId:D,platform:H,buildMode:NA,jobId:t.job_id,sizeBytes:a.size,phase:"started"}),await new Promise((lQ,_0)=>{let sQ=new i4A.Upload(KA,{endpoint:t.upload_url,chunkSize:5242880,retryDelays:[...aw],metadata:{filename:y2Q(m),filetype:"application/zip"},headers:j4({authorization:Q.apikey}),onBeforeRequest(k0){if(Y){G.info(`[TUS] ${k0.getMethod()} ${k0.getURL()}`);let m0=k0.getHeader("authorization");G.info(`[TUS] Authorization header present: ${!!m0}`)}},onAfterResponse(k0,m0){if(Y){G.info(`[TUS] Response status: ${m0.getStatus()}`);let wB=m0.getHeader("upload-offset"),fQ=m0.getHeader("tus-resumable");G.info(`[TUS] Upload-Offset: ${wB}, Tus-Resumable: ${fQ}`)}},async onError(k0){if(await w4A({apikey:Q.apikey,appId:A,orgId:D,platform:H,buildMode:NA,jobId:t.job_id,sizeBytes:a.size,phase:"failed",durationSeconds:(Date.now()-YA)/1000,error:k0}),G.error(`Upload error: ${k0.message}`),k0 instanceof i4A.DetailedError){let m0=k0.originalResponse?.getBody(),wB=k0.originalResponse?.getStatus(),fQ=k0.originalRequest?.getURL();if(Y)G.error(`[TUS] Request URL: ${fQ}`),G.error(`[TUS] Response status: ${wB}`),G.error(`[TUS] Response body: ${m0}`);let f0=(()=>{try{let TB=JSON.parse(m0||'{"error": "unknown error"}');return TB.status||TB.error||TB.message||"unknown error"}catch{return m0||k0.message}})();_0(Error(`TUS upload failed: ${f0}`))}else _0(Error(`TUS upload failed: ${k0.message||k0.toString()}`))},onProgress(k0,m0){let wB=Number.parseFloat((k0/m0*100).toFixed(2));G.uploadProgress(wB)},onSuccess(){if(w4A({apikey:Q.apikey,appId:A,orgId:D,platform:H,buildMode:NA,jobId:t.job_id,sizeBytes:a.size,phase:"succeeded",durationSeconds:(Date.now()-YA)/1000}),G.uploadProgress(100),Y)G.success("TUS upload completed successfully");lQ()}});if(Y)G.info("[TUS] Starting upload...");sQ.start()}),G.info("Starting build job...");let HA=await fetch(`${U}/build/start/${t.job_id}`,{method:"POST",headers:j4({"Content-Type":"application/json",authorization:Q.apikey}),body:JSON.stringify({app_id:A,...m2Q({cache:Q.cache,cacheKey:Q.cacheKey})})});if(!HA.ok){let lQ=await HA.text();throw await u2Q(HA.status,lQ,"start",G),Error(`Failed to start build: ${HA.status} - ${lQ}`)}let MA=await HA.json();G.success("Build started!"),G.info("Streaming build logs...");let wA=new AbortController,XA=aGQ({requestCancellation:()=>rGQ({url:`${U}/build/cancel/${t.job_id}`,headers:j4({"Content-Type":"application/json",authorization:Q.apikey}),appId:A}),onCancellationStarted:()=>{G.warn("Canceling build... (press Ctrl+C again to force quit)")},onCancellationResult:(lQ)=>{if(lQ.ok){G.success("Build cancellation requested.");return}xB(lQ.message),G.warn(`${lQ.message}. The remote build may still be running.`)},abortLogStream:()=>wA.abort(),forceExit:(lQ)=>g9.exit(lQ)});g9.on("SIGINT",XA);let CA,VA=!1,BQ=async()=>{try{let lQ=await fetch(`${U}/build/status?job_id=${encodeURIComponent(t.job_id)}&app_id=${encodeURIComponent(A)}&platform=${H}`,{headers:j4({authorization:Q.apikey})});if(!lQ.ok)return null;let _0=await lQ.json(),sQ=_0.status?.toLowerCase?.()??"";if(VA)G.info(`Build status: ${sQ||_0.status}`);if(p4A.has(sQ))return sQ;return null}catch{return null}},_A=null;try{_A=await tx0(B,Y,MA.logs_url,MA.logs_token,BQ,wA.signal,()=>{VA=!0},B&&!$&&!Q.outputRecord?void 0:u)}finally{g9.removeListener("SIGINT",XA)}if(_A){if(CA=_A,p4A.has(_A))await BQ().catch(()=>{})}else CA=await ex0(U,t.job_id,A,H,Q.apikey,B,VA,wA.signal,G);if(CA==="succeeded")G.success("Build completed successfully!");else if(CA==="failed"){if(G.error("Build failed"),rx0({cache:Q.cache,cacheKey:Q.cacheKey,aiAnalysisMode:r}))G.info(nx0);if(vGQ({isTTY:g9.stdout.isTTY===!0,aiAnalytics:Q.aiAnalytics===!0,sendLogs:p}))g9.stderr.write(`${PCA}
|
|
1246
|
+
`),Y)G.info(`API host: ${U}`);let I={},M={...Q.storeReleaseNotesLocalized??{},...Wv0(Q.storeReleaseNotesLocale)??{}},N=Object.keys(M).length>0;if(Q.buildCertificateBase64)I.BUILD_CERTIFICATE_BASE64=Q.buildCertificateBase64;if(Q.p12Password)I.P12_PASSWORD=Q.p12Password;if(Q.appleKeyId)I.APPLE_KEY_ID=Q.appleKeyId;if(Q.appleIssuerId)I.APPLE_ISSUER_ID=Q.appleIssuerId;if(Q.appleKeyContent)I.APPLE_KEY_CONTENT=Q.appleKeyContent;if(Q.appStoreConnectTeamId)I.APP_STORE_CONNECT_TEAM_ID=Q.appStoreConnectTeamId;if(Q.appleId)I.FASTLANE_USER=Q.appleId;if(Q.appleAppSpecificPassword)I.FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD=Q.appleAppSpecificPassword;if(Q.appleAppId)I.APPLE_APP_ID=Q.appleAppId;if(Q.iosScheme)I.CAPGO_IOS_SCHEME=Q.iosScheme;if(Q.iosTarget)I.CAPGO_IOS_TARGET=Q.iosTarget;if(Q.iosDistribution)I.CAPGO_IOS_DISTRIBUTION=Q.iosDistribution;if(Q.xcodeVersion)I.CAPGO_IOS_XCODE_VERSION=Q.xcodeVersion;if(Q.iosProvisioningProfile&&Q.iosProvisioningProfile.length>0){let a=Be(Q.iosProvisioningProfile,gVA(Q.path||h2Q()));I.CAPGO_IOS_PROVISIONING_MAP=JSON.stringify(a)}if(Q.iosProvisioningMap)I.CAPGO_IOS_PROVISIONING_MAP=Q.iosProvisioningMap;if(Q.androidKeystoreFile)I.ANDROID_KEYSTORE_FILE=Q.androidKeystoreFile;if(Q.keystoreKeyAlias)I.KEYSTORE_KEY_ALIAS=Q.keystoreKeyAlias;let V=!!Q.keystoreKeyPassword,L=!!Q.keystoreStorePassword;if(V&&!L)I.KEYSTORE_KEY_PASSWORD=Q.keystoreKeyPassword,I.KEYSTORE_STORE_PASSWORD=Q.keystoreKeyPassword;else if(!V&&L)I.KEYSTORE_KEY_PASSWORD=Q.keystoreStorePassword,I.KEYSTORE_STORE_PASSWORD=Q.keystoreStorePassword;else if(V&&L)I.KEYSTORE_KEY_PASSWORD=Q.keystoreKeyPassword,I.KEYSTORE_STORE_PASSWORD=Q.keystoreStorePassword;if(typeof Q.androidFlavor==="string"){let a=Q.androidFlavor.trim();if(a)I.CAPGO_ANDROID_FLAVOR=a}if(Q.playConfigJson)I.PLAY_CONFIG_JSON=Q.playConfigJson;if(typeof Q.androidTrack==="string"&&Q.androidTrack.trim())I.PLAY_STORE_TRACK=UzA(Q.androidTrack);if(typeof Q.androidReleaseStatus==="string"&&Q.androidReleaseStatus.trim())I.PLAY_STORE_RELEASE_STATUS=qzA(Q.androidReleaseStatus);if(Q.inAppUpdatePriority!==void 0)I.PLAY_STORE_IN_APP_UPDATE_PRIORITY=String(X_(Q.inAppUpdatePriority));if(Q.outputUpload!==void 0)I.BUILD_OUTPUT_UPLOAD_ENABLED=$Y(Q.outputUpload)?"true":"false";if(Q.outputRetention)I.BUILD_OUTPUT_RETENTION_SECONDS=String(Z_(Q.outputRetention));if(Q.skipBuildNumberBump!==void 0)I.SKIP_BUILD_NUMBER_BUMP=$Y(Q.skipBuildNumberBump)?"true":"false";if(Q.skipMarketingVersionBump!==void 0)I.SKIP_MARKETING_VERSION_BUMP=$Y(Q.skipMarketingVersionBump)?"true":"false";if(Q.submitToStoreReview!==void 0)I.CAPGO_STORE_SUBMIT_REVIEW=$Y(Q.submitToStoreReview)?"true":"false";if(typeof Q.storeReleaseName==="string"&&Q.storeReleaseName.trim())I.CAPGO_STORE_RELEASE_NAME=Q.storeReleaseName.trim();if(typeof Q.storeReleaseNotes==="string"&&Q.storeReleaseNotes.trim())I.CAPGO_STORE_RELEASE_NOTES=Q.storeReleaseNotes.trim();if(typeof Q.iosTestflightGroups==="string"&&Q.iosTestflightGroups.trim())I.CAPGO_IOS_TESTFLIGHT_GROUPS=Q.iosTestflightGroups.trim();if(Q.iosAutomaticRelease!==void 0)I.CAPGO_IOS_AUTOMATIC_RELEASE=$Y(Q.iosAutomaticRelease)?"true":"false";let C=await tt(A,H,Object.keys(I).length>0?I:void 0);if(C&&N){let a=n4A(C.CAPGO_STORE_RELEASE_NOTES_LOCALIZED)??{};C.CAPGO_STORE_RELEASE_NOTES_LOCALIZED=JSON.stringify({...a,...M})}if(Q.playstoreUpload===!1&&C)delete C.PLAY_CONFIG_JSON,G.info("ℹ️ --no-playstore-upload specified, Play Store upload disabled for this build");let R=L9(W?.config,H);if(C&&R)if(H==="ios")C.CAPGO_IOS_SOURCE_DIR=R,C.CAPGO_IOS_APP_DIR=R,C.CAPGO_IOS_PROJECT_DIR=R,C.IOS_PROJECT_DIR=R;else C.CAPGO_ANDROID_SOURCE_DIR=R,C.CAPGO_ANDROID_APP_DIR=R,C.CAPGO_ANDROID_PROJECT_DIR=R,C.ANDROID_PROJECT_DIR=R;if(!C)throw G.error("❌ No credentials found for this app and platform"),G.error(""),G.error("You must provide credentials via:"),G.error(" 1. CLI arguments (--apple-key-id, --p12-password, etc.)"),G.error(" 2. Environment variables (APPLE_KEY_ID, P12_PASSWORD, etc.)"),G.error(" 3. Saved credentials file:"),G.error(` npx @capgo/cli build credentials save --appId ${A} --platform ${H}`),G.error(""),G.error("Documentation:"),G.error(" https://capgo.app/docs/cli/cloud-build/credentials/"),Error("No credentials found. Please provide credentials before building.");let E=[];if(H==="ios"){let a=C.CAPGO_IOS_DISTRIBUTION,BA=["app_store","ad_hoc"];if(a&&!BA.includes(a))E.push(`Invalid CAPGO_IOS_DISTRIBUTION value: '${a}'. Must be one of: ${BA.join(", ")}`);let KA=a&&BA.includes(a)?a:"app_store";if(!a)G.info("ℹ️ --ios-distribution not specified, defaulting to app_store");C.CAPGO_IOS_DISTRIBUTION=KA;let YA=C.CAPGO_IOS_XCODE_VERSION;if(YA!==void 0&&!YA.trim())delete C.CAPGO_IOS_XCODE_VERSION;else if(YA!==void 0){let HA=Gv0(YA);if(HA)C.CAPGO_IOS_XCODE_VERSION=HA,G.info(`ℹ️ Building on a machine with Xcode ${HA}`);else E.push(`Invalid --xcode-version / CAPGO_IOS_XCODE_VERSION value: '${YA}'. Use a version like 26, 26.1 or 16.4.1`)}if(C.CAPGO_STORE_SUBMIT_REVIEW==="true"&&KA!=="app_store")E.push("--submit-to-store-review on iOS requires --ios-distribution app_store");if(!C.BUILD_CERTIFICATE_BASE64)E.push("BUILD_CERTIFICATE_BASE64 (or --build-certificate-base64)");if(!C.P12_PASSWORD)G.warn("⚠️ P12_PASSWORD not provided - assuming certificate has no password"),G.warn(" If your certificate requires a password, provide it with --p12-password");if(!!(C.BUILD_PROVISION_PROFILE_BASE64||C.APPLE_PROFILE_NAME)&&!C.CAPGO_IOS_PROVISIONING_MAP)throw G.error("❌ Legacy provisioning profile format detected. Run:"),G.error(" npx @capgo/cli build credentials migrate --platform ios"),G.error(""),G.error(" This will convert your existing provisioning profile to the new multi-target format."),Error("Legacy provisioning profile format detected. Run: npx @capgo/cli build credentials migrate --platform ios");if(!C.CAPGO_IOS_PROVISIONING_MAP)E.push('CAPGO_IOS_PROVISIONING_MAP (use --ios-provisioning-profile or save via "build credentials save")');if(KA==="app_store"){let HA=!!C.APPLE_KEY_ID,MA=!!C.APPLE_ISSUER_ID,wA=!!C.APPLE_KEY_CONTENT,XA=HA||MA||wA,CA=HA&&MA&&wA,VA=!!C.FASTLANE_USER,BQ=!!C.FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD,_A=!!C.APPLE_APP_ID,q0=VA||BQ||_A,lQ=VA&&BQ&&_A;if(C.CAPGO_STORE_SUBMIT_REVIEW==="true"&&!CA)E.push("App Store Connect API key (APPLE_KEY_ID/APPLE_ISSUER_ID/APPLE_KEY_CONTENT) is required for --submit-to-store-review on iOS");if(_A&&!/^\d+$/.test(String(C.APPLE_APP_ID).trim()))E.push("APPLE_APP_ID must be the app's numeric App Store Connect id (digits only, e.g. 1234567890)");if(CA);else if(lQ){if(G.info("\uD83D\uDD11 Using Apple ID + app-specific password for TestFlight upload (no App Store Connect API key)"),G.info(" Build number will use a timestamp-based fallback (App Store Connect is not queried)"),!Q.builderJourneyId)G.warn("⚠️ App-specific password authentication is not recommended; it exists as an Ionic Appflow migration fallback."),G.warn(" Prefer an App Store Connect API key (.p8): https://capgo.app/docs/builder/configuration/")}else if(q0){let _0=[];if(!VA)_0.push("FASTLANE_USER (or --apple-id)");if(!BQ)_0.push("FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD (or --apple-app-specific-password)");if(!_A)_0.push("APPLE_APP_ID (or --apple-app-id)");E.push(`Incomplete app-specific password credentials - missing: ${_0.join(", ")}`)}else if(XA){let _0=[];if(!HA)_0.push("APPLE_KEY_ID (or --apple-key-id)");if(!MA)_0.push("APPLE_ISSUER_ID (or --apple-issuer-id)");if(!wA)_0.push("APPLE_KEY_CONTENT (or --apple-key-content)");E.push(`Incomplete App Store Connect API key - missing: ${_0.join(", ")}`)}else if(C.BUILD_OUTPUT_UPLOAD_ENABLED!=="true")E.push("App Store Connect API key (APPLE_KEY_ID/APPLE_ISSUER_ID/APPLE_KEY_CONTENT) or app-specific password (FASTLANE_USER + FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD + APPLE_APP_ID) or BUILD_OUTPUT_UPLOAD_ENABLED=true (or --output-upload) (build has no output destination - enable either TestFlight upload or Capgo download link)");else if(C.SKIP_BUILD_NUMBER_BUMP!=="true"||C.SKIP_MARKETING_VERSION_BUMP!=="true")E.push("App Store Connect API key (APPLE_KEY_ID/APPLE_ISSUER_ID/APPLE_KEY_CONTENT) or app-specific password or --skip-build-number-bump and --skip-marketing-version-bump (iOS versions cannot be auto-incremented without App Store Connect credentials)");else G.warn("⚠️ No App Store Connect API key or app-specific password provided - build will succeed but cannot auto-upload to TestFlight")}else if(KA==="ad_hoc")G.info("\uD83D\uDCE6 Ad-hoc distribution mode: App Store Connect API key not required"),G.info(" Build number will use timestamp-based fallback");if(!C.APP_STORE_CONNECT_TEAM_ID)E.push("APP_STORE_CONNECT_TEAM_ID (or --app-store-connect-team-id)")}else if(H==="android"){if(!C.ANDROID_KEYSTORE_FILE)E.push("ANDROID_KEYSTORE_FILE (or --android-keystore-file)");if(!C.KEYSTORE_KEY_ALIAS)E.push("KEYSTORE_KEY_ALIAS (or --keystore-key-alias)");if(!C.KEYSTORE_KEY_PASSWORD&&!C.KEYSTORE_STORE_PASSWORD)E.push("KEYSTORE_KEY_PASSWORD or KEYSTORE_STORE_PASSWORD (at least one password required)");if(!C.PLAY_CONFIG_JSON)if(C.CAPGO_STORE_SUBMIT_REVIEW==="true")E.push("PLAY_CONFIG_JSON is required for --submit-to-store-review on Android");else if(C.BUILD_OUTPUT_UPLOAD_ENABLED!=="true")E.push("PLAY_CONFIG_JSON or BUILD_OUTPUT_UPLOAD_ENABLED=true (build has no output destination - enable either Play Store upload or Capgo download link)");else G.warn("⚠️ PLAY_CONFIG_JSON not provided - build will succeed but cannot auto-upload to Play Store")}if(E.length>0){G.error(`❌ Missing required credentials for ${H}:`),G.error("");for(let a of E)G.error(` • ${a}`);throw G.error(""),G.error("Provide credentials via:"),G.error(` 1. CLI arguments: npx @capgo/cli build request --platform ${H} ${H==="ios"?'--apple-key-id "..." --apple-issuer-id "..." --apple-key-content "..."':'--android-keystore-file "..." --keystore-key-alias "..."'}`),G.error(` 2. Environment variables: ${H==="ios"?'export APPLE_KEY_ID="..." APPLE_ISSUER_ID="..." APPLE_KEY_CONTENT="..."':'export ANDROID_KEYSTORE_FILE="..." KEYSTORE_KEY_ALIAS="..."'}`),G.error(` 3. Saved credentials: npx @capgo/cli build credentials save --platform ${H} ...`),G.error(""),G.error("Documentation:"),G.error(` https://capgo.app/docs/cli/cloud-build/${H}/`),Error(`Missing required credentials for ${H}: ${E.join(", ")}`)}if(!Q.buildMode)G.info("ℹ️ --build-mode not specified, defaulting to release");if(!C.BUILD_OUTPUT_UPLOAD_ENABLED)G.info("ℹ️ --output-upload not specified, defaulting to false (no Capgo download link)");if(!C.BUILD_OUTPUT_RETENTION_SECONDS)G.info(`ℹ️ --output-retention not specified, defaulting to ${eU}s (1 hour)`);let w=H==="ios"&&!(C.APPLE_KEY_ID&&C.APPLE_ISSUER_ID&&C.APPLE_KEY_CONTENT);if(!C.SKIP_BUILD_NUMBER_BUMP&&!w)G.info("ℹ️ --skip-build-number-bump not specified, build number will be auto-incremented (default)");if(!C.SKIP_MARKETING_VERSION_BUMP&&H==="ios"&&!w)G.info("ℹ️ --skip-marketing-version-bump not specified, marketing version will be auto-bumped when already released (default)");let{buildOptions:k,buildCredentials:g}=Hv0(C,H,Q.buildMode||"release",I$.version),S=H==="ios"?Qv0(K,R):void 0;if(S==="cocoapods")G.warn("⚠️ This iOS project uses CocoaPods. The CocoaPods trunk becomes read-only on December 2, 2026: your pods will stop getting updates and security fixes. Capgo iOS 27 SDK builds are Swift Package Manager only and become the default on January 1, 2027. Moving to Swift Package Manager takes a few minutes: https://capacitorjs.com/docs/ios/spm");let v={app_id:A,platform:H,build_mode:Q.buildMode||"release",build_options:k,build_credentials:g,...S?{ios_dependency_manager:S}:{},...m2Q({cache:Q.cache,cacheKey:Q.cacheKey})};if(Q.cache===!1)G.info(`ℹ️ --no-cache specified, compilation cache disabled for this ${H} build`);else if(Q.cacheKey?.trim())G.info(`ℹ️ --cache-key "${Q.cacheKey.trim()}" specified for this ${H} build`);if(G.info("✓ Using credentials (merged from CLI args, env vars, and saved file)"),Y){let a=Object.keys(g);G.info(`Credentials provided: ${a.join(", ")}`),G.info(`Build options: platform=${k.platform}, mode=${k.buildMode}, cliVersion=${k.cliVersion}`)}if(Q.prescan===!0){let{executePrescan:a,runPrescanGate:BA}=await Promise.resolve().then(() => (d4A(),fVA)),{enforcedCounts:KA}=await Promise.resolve().then(() => VWQ),{decision:YA,report:NA,crashed:HA,informationOnlyFindings:MA}=await BA({enabled:!0,ignoreFatal:Q.prescanIgnoreFatal,failOnWarnings:Q.failOnWarnings,silent:B,print:(wA)=>G.info(wA),warn:(wA)=>G.warn(wA)},async()=>(await a(A,{platform:H,path:K,apikey:Q.apikey,credentials:C,androidFlavor:Q.androidFlavor,iosDist:Q.iosDistribution,skip:Q.prescanSkip,warn:Q.prescanWarn,supaHost:Q.supaHost,supaAnon:Q.supaAnon})).report);{let wA=NA?.counts,XA=NA?KA(NA):void 0,CA=HA?"crashed":!wA?"skipped":YA==="block"?"blocked":Q.prescanIgnoreFatal&&(XA?.error??wA.error)>0?"bypassed":MA>0?"information-only":(XA?.warning??wA.warning)>0?"warned":"clean";await kB(Q.apikey,{channel:"native-builder",event:"Prescan run",org_id:D,tracking_version:2,tags:{source:"build-request",result:CA,"app-id":A,platform:H,errors:String(wA?.error??0),warnings:String(wA?.warning??0),"finding-ids":NA?NA.findings.filter((VA)=>VA.severity!=="info").map((VA)=>VA.id).join(",").slice(0,200):"",bypassed:String(CA==="bypassed"),"information-only-findings":String(MA)}}).catch(()=>{})}if(YA==="block")throw Error("Prescan found blocking problems — the build was not requested and nothing was uploaded. Fix the errors above or re-run with --prescan-ignore-fatal / --no-prescan.")}await af(z,Q.apikey,"app.build_native",{appId:A},{message:`Capgo rejected this API key: missing app.build_native permission for app ${A}.`,silent:B}),G.info("Requesting build from Capgo...");let y=3,o=await ix0(`${U}/build/request`,{method:"POST",headers:j4({"Content-Type":"application/json",authorization:Q.apikey}),body:JSON.stringify(v)},y,G);if(!o.ok){let a=await o.text();if(await u2Q(o.status,a,"request",G),a.includes("build_machine_version_unavailable")){let KA=a;try{KA=JSON.parse(a).message||a}catch{}throw Error(`${KA} Change or drop --xcode-version.`)}let BA=o.status===401||o.status===403||/invalid_apikey|unauthorized|no_key_provided|invalid_jwt|no_jwt/i.test(a);throw Error(BA?`Capgo rejected the build request (HTTP ${o.status}): ${a}`:`Capgo build request failed (HTTP ${o.status}): ${a}`)}let t=await o.json();if(G.success(`Build job created: ${t.job_id}`),G.info(`Status: ${t.status}`),Y)G.info(`Upload URL: ${t.upload_url}`),G.info(`Upload expires: ${t.upload_expires_at}`);let r=Q.aiAnalysisMode??"auto-prompt",p=Q.sendLogsToSupport===!0||Q.sendLogs===!0,c=(wGQ()||Q.aiAnalytics===!0||p||r==="caller-handled")&&r!=="skip",b=null,d=!1,x;if(c&&t.job_id)b=t.job_id,await _GQ(t.job_id),TGQ(t.job_id,()=>d);let u={...G,buildLog:(a)=>{if(G.buildLog(a),c&&b)PGQ(b,a)}};await kB(Q.apikey,{channel:"native-builder",event:"Build requested",org_id:D,tracking_version:2,tags:{"app-id":A,platform:H,...Q.builderJourneyId?{journey_id:Q.builderJourneyId}:{}}}).catch();let QA=Y7(ux0(),`capgo-build-${Date.now()}`);await fx0(QA,{recursive:!0});let m=Y7(QA,`${y2Q(K)}.zip`);try{G.info(`Zipping ${H} project from ${K}...`),await Xv0(K,m,H,W?.config,{nodeModules:Q.nodeModules});let a=await yx0(m),BA=(a.size/1024/1024).toFixed(2);if(G.success(`Created zip: ${m} (${BA} MB)`),G.info("Uploading to builder..."),Y)G.info(`Upload endpoint: ${t.upload_url}`),G.info(`File size: ${BA} MB`),G.info(`Job ID: ${t.job_id}`);let KA=xx0(m);G.uploadProgress(0);let YA=Date.now(),NA=Q.buildMode||"release";w4A({apikey:Q.apikey,appId:A,orgId:D,platform:H,buildMode:NA,jobId:t.job_id,sizeBytes:a.size,phase:"started"}),await new Promise((lQ,_0)=>{let sQ=new i4A.Upload(KA,{endpoint:t.upload_url,chunkSize:5242880,retryDelays:[...aw],metadata:{filename:y2Q(m),filetype:"application/zip"},headers:j4({authorization:Q.apikey}),onBeforeRequest(k0){if(Y){G.info(`[TUS] ${k0.getMethod()} ${k0.getURL()}`);let m0=k0.getHeader("authorization");G.info(`[TUS] Authorization header present: ${!!m0}`)}},onAfterResponse(k0,m0){if(Y){G.info(`[TUS] Response status: ${m0.getStatus()}`);let wB=m0.getHeader("upload-offset"),fQ=m0.getHeader("tus-resumable");G.info(`[TUS] Upload-Offset: ${wB}, Tus-Resumable: ${fQ}`)}},async onError(k0){if(await w4A({apikey:Q.apikey,appId:A,orgId:D,platform:H,buildMode:NA,jobId:t.job_id,sizeBytes:a.size,phase:"failed",durationSeconds:(Date.now()-YA)/1000,error:k0}),G.error(`Upload error: ${k0.message}`),k0 instanceof i4A.DetailedError){let m0=k0.originalResponse?.getBody(),wB=k0.originalResponse?.getStatus(),fQ=k0.originalRequest?.getURL();if(Y)G.error(`[TUS] Request URL: ${fQ}`),G.error(`[TUS] Response status: ${wB}`),G.error(`[TUS] Response body: ${m0}`);let f0=(()=>{try{let TB=JSON.parse(m0||'{"error": "unknown error"}');return TB.status||TB.error||TB.message||"unknown error"}catch{return m0||k0.message}})();_0(Error(`TUS upload failed: ${f0}`))}else _0(Error(`TUS upload failed: ${k0.message||k0.toString()}`))},onProgress(k0,m0){let wB=Number.parseFloat((k0/m0*100).toFixed(2));G.uploadProgress(wB)},onSuccess(){if(w4A({apikey:Q.apikey,appId:A,orgId:D,platform:H,buildMode:NA,jobId:t.job_id,sizeBytes:a.size,phase:"succeeded",durationSeconds:(Date.now()-YA)/1000}),G.uploadProgress(100),Y)G.success("TUS upload completed successfully");lQ()}});if(Y)G.info("[TUS] Starting upload...");sQ.start()}),G.info("Starting build job...");let HA=await fetch(`${U}/build/start/${t.job_id}`,{method:"POST",headers:j4({"Content-Type":"application/json",authorization:Q.apikey}),body:JSON.stringify({app_id:A,...m2Q({cache:Q.cache,cacheKey:Q.cacheKey})})});if(!HA.ok){let lQ=await HA.text();throw await u2Q(HA.status,lQ,"start",G),Error(`Failed to start build: ${HA.status} - ${lQ}`)}let MA=await HA.json();G.success("Build started!"),G.info("Streaming build logs...");let wA=new AbortController,XA=aGQ({requestCancellation:()=>rGQ({url:`${U}/build/cancel/${t.job_id}`,headers:j4({"Content-Type":"application/json",authorization:Q.apikey}),appId:A}),onCancellationStarted:()=>{G.warn("Canceling build... (press Ctrl+C again to force quit)")},onCancellationResult:(lQ)=>{if(lQ.ok){G.success("Build cancellation requested.");return}xB(lQ.message),G.warn(`${lQ.message}. The remote build may still be running.`)},abortLogStream:()=>wA.abort(),forceExit:(lQ)=>g9.exit(lQ)});g9.on("SIGINT",XA);let CA,VA=!1,BQ=async()=>{try{let lQ=await fetch(`${U}/build/status?job_id=${encodeURIComponent(t.job_id)}&app_id=${encodeURIComponent(A)}&platform=${H}`,{headers:j4({authorization:Q.apikey})});if(!lQ.ok)return null;let _0=await lQ.json(),sQ=_0.status?.toLowerCase?.()??"";if(VA)G.info(`Build status: ${sQ||_0.status}`);if(p4A.has(sQ))return sQ;return null}catch{return null}},_A=null;try{_A=await tx0(B,Y,MA.logs_url,MA.logs_token,BQ,wA.signal,()=>{VA=!0},B&&!$&&!Q.outputRecord?void 0:u)}finally{g9.removeListener("SIGINT",XA)}if(_A){if(CA=_A,p4A.has(_A))await BQ().catch(()=>{})}else CA=await ex0(U,t.job_id,A,H,Q.apikey,B,VA,wA.signal,G);if(CA==="succeeded")G.success("Build completed successfully!");else if(CA==="failed"){if(G.error("Build failed"),rx0({cache:Q.cache,cacheKey:Q.cacheKey,aiAnalysisMode:r}))G.info(nx0);if(vGQ({isTTY:g9.stdout.isTTY===!0,aiAnalytics:Q.aiAnalytics===!0,sendLogs:p}))g9.stderr.write(`${PCA}
|
|
1247
1247
|
`)}else G.warn(`Build finished with status: ${CA}`);if(Q.outputRecord&&CA==="succeeded")try{let lQ=await UWQ(Q.outputRecord,{jobId:t.job_id,appId:A,platform:H,buildMode:Q.buildMode??"release",status:CA,outputUrl:X},(_0)=>G.warn(_0));if(G.success(`Build output record written to ${Q.outputRecord}`),!lQ.outputUrl)G.info("ℹ️ Record contains no download URL — pass --output-upload to publish one.");if(lQ.qrCodePngPath)G.info(`ℹ️ QR code PNG written to ${lQ.qrCodePngPath}`)}catch(lQ){G.warn(`Failed to write build output record to ${Q.outputRecord}: ${lQ instanceof Error?lQ.message:String(lQ)}`)}if(CA==="failed"&&c&&b&&r==="caller-handled")try{await a1A(b),d=!0;let lQ=`${g9.env.CAPGO_AI_LOG_BASE_DIR||"/tmp/capgo-builds"}/${b}.log`;x={jobId:b,capturedLogPath:lQ,ready:!0}}catch(lQ){let _0=lQ instanceof Error?lQ.message:String(lQ);g9.stderr.write(`AI analysis unavailable because the captured Builder log could not be finalized: ${_0}
|
|
1248
1248
|
`)}else if(CA==="failed"&&c&&b&&r==="auto-prompt"){let lQ=b,_0=bGQ({isTTY:g9.stdout.isTTY===!0,aiAnalyticsFlag:Q.aiAnalytics===!0,sendLogsFlag:p}),sQ="⚠ AI can make mistakes. Always verify the diagnosis against the full log before applying the suggested fix.",k0=async()=>LWQ({appId:A,jobId:lQ,internalLogPath:k3()}),m0=async(KB,pB)=>{if(await PW({apikey:Q.apikey,orgId:D,appId:A,platform:H,jobId:b,choice:KB,triggeredBy:pB}),pB==="menu")await yT({confirm:async($0)=>{return await d1({message:$0,initialValue:!0})===!0},buildFiles:async()=>{let $0=a8();$0.start("Preparing your logs to send to Capgo support…");try{let IB=await k0();return $0.stop(IB?"Logs ready.":"Couldn't prepare logs."),IB}catch(IB){$0.stop("Couldn't prepare logs.");let WB=IB instanceof Error?IB.message:String(IB);return g9.stderr.write(`Could not prepare support logs because the captured Builder log is unavailable: ${WB}
|
|
1249
1249
|
`),null}},upload:async($0)=>{let IB=a8();IB.start("Uploading your logs to Capgo support…");let WB=await TW({apiHost:U,apikey:Q.apikey,appId:A,jobId:b??void 0,gzPath:$0});return IB.stop(WB?"Logs uploaded.":"Logs upload unavailable."),WB},print:($0)=>f.info($0)});let g1=`${g9.env.CAPGO_AI_LOG_BASE_DIR||"/tmp/capgo-builds"}/${b}.log`,Z0="";try{Z0=await sV(lQ)}catch($0){let IB=$0 instanceof Error?$0.message:String($0);g9.stderr.write(`AI analysis skipped: could not read captured log at ${g1}: ${IB}
|