@capgo/cli 8.88.0 → 8.89.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/README.md +5 -3
- package/dist/index.js +717 -716
- package/dist/notify-app-ready-worker.js +1 -1
- package/dist/onboarding-worker.js +1 -1
- package/dist/package.json +2 -2
- package/dist/src/build/build-env.d.ts +8 -0
- package/dist/src/build/output-record.d.ts +5 -0
- package/dist/src/schemas/build.d.ts +1 -0
- package/dist/src/sdk.js +408 -408
- package/dist/updater-installed-worker.js +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as hm}from"node:module";var km=Object.create;var{getPrototypeOf:_m,defineProperty:b9,getOwnPropertyNames:CV,getOwnPropertyDescriptor:um}=Object,kV=Object.prototype.hasOwnProperty;function _V(D){return this[D]}var gm,xm,w$=(D,$,J)=>{var X=D!=null&&typeof D==="object";if(X){var Y=$?gm??=new WeakMap:xm??=new WeakMap,Q=Y.get(D);if(Q)return Q}J=D!=null?km(_m(D)):{};let U=$||!D||!D.__esModule?b9(J,"default",{value:D,enumerable:!0}):J;for(let F of CV(D))if(!kV.call(U,F))b9(U,F,{get:_V.bind(D,F),enumerable:!0});if(X)Y.set(D,U);return U},a6=(D)=>{var $=(SV??=new WeakMap).get(D),J;if($)return $;if($=b9({},"__esModule",{value:!0}),D&&typeof D==="object"||typeof D==="function"){for(var X of CV(D))if(!kV.call($,X))b9($,X,{get:_V.bind(D,X),enumerable:!(J=um(D,X))||J.enumerable})}return SV.set(D,$),$},SV,S=(D,$)=>()=>($||D(($={exports:{}}).exports,$),$.exports);var fm=(D)=>D;function ym(D,$){this[D]=fm.bind(null,$)}var y0=(D,$)=>{for(var J in $)b9(D,J,{get:$[J],enumerable:!0,configurable:!0,set:ym.bind($,J)})};var C=(D,$)=>()=>(D&&($=D(D=0)),$);var QID=(D)=>Promise.all(D),XD=hm(import.meta.url);var r$;var H8=C(()=>{r$={name:"@capgo/cli",type:"module",version:"8.88.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 && bun test/test-builder-only-checklist.mjs && bun test/test-builder-only-setup.mjs && bun test/test-app-todo-lists.mjs && bun test/test-app-todo-tabs.mjs && bun test/test-app-todo-command.mjs && node test/test-app-todo-interactive.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:settings-parity && 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:settings-parity":"bun test/test-settings-parity.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"}}});var xD;var c1=C(()=>{xD=class xD extends Error{context;constructor(D,$,J){super(D,J!==void 0?{cause:J}:void 0);this.name="CliUserError",this.context=$}}});import{platform as lm}from"node:os";import{version as dm}from"node:process";function xV(D){gV=D}function cm(D){for(let $=0;$<D.length;$++)if(D.charCodeAt($)>255)return!1;return!0}function uV(D){if(D.toLowerCase()==="x-capgo-log-token")return"Build log token is missing. Re-run the build command or pass a valid log token.";return"Capgo API key is missing. Run `npx -y @capgo/cli@latest login` or pass `--apikey`."}function pm(D){if(D.toLowerCase()==="x-capgo-log-token")return"Build log token contains invalid characters (only ASCII is allowed). Re-run the build command to get a fresh token.";if(D.toLowerCase()==="authorization")return"Authorization header contains invalid characters (only ASCII is allowed). Check your Capgo API key or Supabase anon key configuration.";return"Capgo API key contains invalid characters (only ASCII is allowed). Copy the key from the Capgo dashboard."}function oU(D,$){if($===void 0||$===null){if(tU.has(D.toLowerCase()))throw new xD(uV(D));throw new xD(`HTTP header "${D}" is missing or invalid.`)}if(typeof $!=="string"){if(tU.has(D.toLowerCase()))throw new xD(uV(D));throw new xD(`HTTP header "${D}" is missing or invalid.`)}if(!cm($)){if(tU.has(D.toLowerCase()))throw new xD(pm(D));throw new xD(`HTTP header "${D}" contains invalid characters (only ASCII is allowed).`)}return $}function K6(D){let $={capgo_api:im,"x-cli-version":r$.version,"x-cli-command":gV,"x-cli-node":dm,"x-cli-os":lm()};if(D)for(let[J,X]of Object.entries(D))$[J]=oU(J,X);return $}var im="2025-10-01",gV="",tU;var T3=C(()=>{H8();c1();tU=new Set(["authorization","capgkey","x-capgo-log-token"])});import{existsSync as q$}from"fs";var S9=(D=".",$="unknown")=>{let J=`${D}/bun.lockb`,X=`${D}/bun.lock`,Y=`${D}/pnpm-lock.yaml`,Q=`${D}/shrinkwrap.yaml`,U=`${D}/yarn.lock`,F=`${D}/package-lock.json`,W=`${D}/npm-shrinkwrap.json`;if(q$(J)||q$(X))return"bun";if(q$(Y)||q$(Q))return"pnpm";if(q$(U))return"yarn";if(q$(F)||q$(W))return"npm";return $},P3=(D=S9(),$=!1)=>{switch(D){case"bun":return $?"bun install":"install";case"pnpm":return $?"pnpm install":"install";case"yarn":return $?"yarn install":"install";case"npm":return $?"npm install":"install";case"unknown":return $?"unknown unknown":"unknown";default:return $?"npm install":"install"}},fV=(D=".",$="npx")=>{let J=`${D}/bun.lockb`,X=`${D}/bun.lock`,Y=`${D}/pnpm-lock.yaml`,Q=`${D}/shrinkwrap.yaml`,U=`${D}/yarn.lock`,F=`${D}/package-lock.json`,W=`${D}/npm-shrinkwrap.json`;if(q$(J)||q$(X))return"bunx";if(q$(Y)||q$(Q))return"pnpm exec";if(q$(U))return"yarn dlx";if(q$(F)||q$(W))return"npx";return $};var yV=()=>{};var hV,mV=(D)=>{return D===12288||D>=65281&&D<=65376||D>=65504&&D<=65510},lV=(D)=>{return D===8987||D===9001||D>=12272&&D<=12287||D>=12289&&D<=12350||D>=12441&&D<=12543||D>=12549&&D<=12591||D>=12593&&D<=12686||D>=12688&&D<=12771||D>=12783&&D<=12830||D>=12832&&D<=12871||D>=12880&&D<=19903||D>=65040&&D<=65049||D>=65072&&D<=65106||D>=65108&&D<=65126||D>=65128&&D<=65131||D>=127488&&D<=127490||D>=127504&&D<=127547||D>=127552&&D<=127560||D>=131072&&D<=196605||D>=196608&&D<=262141};var dV=C(()=>{hV=(()=>{let D=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return($)=>{let J=0;D.lastIndex=0;while(D.test($))J+=1;return $.length-J}})()});var nm,rm,iV,tm,cV,om,am,sm,pV=(D,$={},J={})=>{let X=$.limit??1/0,Y=$.ellipsis??"",Q=$?.ellipsisWidth??(Y?pV(Y,sm,J).width:0),U=0,F=J.controlWidth??0,W=J.tabWidth??8,K=J.emojiWidth??2,q=2,G=J.regularWidth??1,Z=J.wideWidth??2,H=[[om,G],[nm,0],[rm,F],[tm,W],[cV,K],[iV,Z]],z=0,I=0,B=D.length,N=0,V=!1,O=B,j=Math.max(0,X-Q),v=0,A=0,k=0,u=0;D:while(!0){if(A>v||I>=B&&I>z){let _=D.slice(v,A)||D.slice(z,I);N=0;for(let y of _.replaceAll(am,"")){let T=y.codePointAt(0)||0;if(mV(T))u=2;else if(lV(T))u=Z;else u=G;if(k+u>j)O=Math.min(O,Math.max(v,z)+N);if(k+u>X){V=!0;break D}N+=y.length,k+=u}v=A=0}if(I>=B)break D;for(let _=0,y=H.length;_<y;_++){let[T,d]=H[_];if(T.lastIndex=I,T.test(D)){if(N=T===iV?hV(D.slice(I,T.lastIndex)):T===cV?1:T.lastIndex-I,u=N*d,k+u>j)O=Math.min(O,I+Math.floor((j-k)/d));if(k+u>X){V=!0;break D}k+=u,v=z,A=I,I=z=T.lastIndex;continue D}}I+=1}return{width:V?j:k,index:V?O:B,truncated:V,ellipsed:V&&X>=Q}},nV;var rV=C(()=>{dV();nm=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,rm=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,iV=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,tm=/\t{1,1000}/y,cV=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,om=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,am=/\p{M}+/gu,sm={limit:1/0,ellipsis:""},nV=pV});var em,Dl=(D,$={})=>{return nV(D,em,$).width},q6;var aU=C(()=>{rV();em={limit:1/0,ellipsis:"",ellipsisWidth:0},q6=Dl});function s6(D,$,J){return String(D).normalize().split(Ql).map((X)=>Yl(X,$,J)).join(`
|
|
1
|
+
import{createRequire as hm}from"node:module";var km=Object.create;var{getPrototypeOf:_m,defineProperty:b9,getOwnPropertyNames:CV,getOwnPropertyDescriptor:um}=Object,kV=Object.prototype.hasOwnProperty;function _V(D){return this[D]}var gm,xm,w$=(D,$,J)=>{var X=D!=null&&typeof D==="object";if(X){var Y=$?gm??=new WeakMap:xm??=new WeakMap,Q=Y.get(D);if(Q)return Q}J=D!=null?km(_m(D)):{};let U=$||!D||!D.__esModule?b9(J,"default",{value:D,enumerable:!0}):J;for(let F of CV(D))if(!kV.call(U,F))b9(U,F,{get:_V.bind(D,F),enumerable:!0});if(X)Y.set(D,U);return U},a6=(D)=>{var $=(SV??=new WeakMap).get(D),J;if($)return $;if($=b9({},"__esModule",{value:!0}),D&&typeof D==="object"||typeof D==="function"){for(var X of CV(D))if(!kV.call($,X))b9($,X,{get:_V.bind(D,X),enumerable:!(J=um(D,X))||J.enumerable})}return SV.set(D,$),$},SV,S=(D,$)=>()=>($||D(($={exports:{}}).exports,$),$.exports);var fm=(D)=>D;function ym(D,$){this[D]=fm.bind(null,$)}var y0=(D,$)=>{for(var J in $)b9(D,J,{get:$[J],enumerable:!0,configurable:!0,set:ym.bind($,J)})};var C=(D,$)=>()=>(D&&($=D(D=0)),$);var QID=(D)=>Promise.all(D),XD=hm(import.meta.url);var r$;var H8=C(()=>{r$={name:"@capgo/cli",type:"module",version:"8.89.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 && bun test/test-builder-only-checklist.mjs && bun test/test-builder-only-setup.mjs && bun test/test-app-todo-lists.mjs && bun test/test-app-todo-tabs.mjs && bun test/test-app-todo-command.mjs && node test/test-app-todo-interactive.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 && bun test/test-build-env.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:settings-parity && 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:settings-parity":"bun test/test-settings-parity.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"}}});var xD;var c1=C(()=>{xD=class xD extends Error{context;constructor(D,$,J){super(D,J!==void 0?{cause:J}:void 0);this.name="CliUserError",this.context=$}}});import{platform as lm}from"node:os";import{version as dm}from"node:process";function xV(D){gV=D}function cm(D){for(let $=0;$<D.length;$++)if(D.charCodeAt($)>255)return!1;return!0}function uV(D){if(D.toLowerCase()==="x-capgo-log-token")return"Build log token is missing. Re-run the build command or pass a valid log token.";return"Capgo API key is missing. Run `npx -y @capgo/cli@latest login` or pass `--apikey`."}function pm(D){if(D.toLowerCase()==="x-capgo-log-token")return"Build log token contains invalid characters (only ASCII is allowed). Re-run the build command to get a fresh token.";if(D.toLowerCase()==="authorization")return"Authorization header contains invalid characters (only ASCII is allowed). Check your Capgo API key or Supabase anon key configuration.";return"Capgo API key contains invalid characters (only ASCII is allowed). Copy the key from the Capgo dashboard."}function oU(D,$){if($===void 0||$===null){if(tU.has(D.toLowerCase()))throw new xD(uV(D));throw new xD(`HTTP header "${D}" is missing or invalid.`)}if(typeof $!=="string"){if(tU.has(D.toLowerCase()))throw new xD(uV(D));throw new xD(`HTTP header "${D}" is missing or invalid.`)}if(!cm($)){if(tU.has(D.toLowerCase()))throw new xD(pm(D));throw new xD(`HTTP header "${D}" contains invalid characters (only ASCII is allowed).`)}return $}function K6(D){let $={capgo_api:im,"x-cli-version":r$.version,"x-cli-command":gV,"x-cli-node":dm,"x-cli-os":lm()};if(D)for(let[J,X]of Object.entries(D))$[J]=oU(J,X);return $}var im="2025-10-01",gV="",tU;var T3=C(()=>{H8();c1();tU=new Set(["authorization","capgkey","x-capgo-log-token"])});import{existsSync as q$}from"fs";var S9=(D=".",$="unknown")=>{let J=`${D}/bun.lockb`,X=`${D}/bun.lock`,Y=`${D}/pnpm-lock.yaml`,Q=`${D}/shrinkwrap.yaml`,U=`${D}/yarn.lock`,F=`${D}/package-lock.json`,W=`${D}/npm-shrinkwrap.json`;if(q$(J)||q$(X))return"bun";if(q$(Y)||q$(Q))return"pnpm";if(q$(U))return"yarn";if(q$(F)||q$(W))return"npm";return $},P3=(D=S9(),$=!1)=>{switch(D){case"bun":return $?"bun install":"install";case"pnpm":return $?"pnpm install":"install";case"yarn":return $?"yarn install":"install";case"npm":return $?"npm install":"install";case"unknown":return $?"unknown unknown":"unknown";default:return $?"npm install":"install"}},fV=(D=".",$="npx")=>{let J=`${D}/bun.lockb`,X=`${D}/bun.lock`,Y=`${D}/pnpm-lock.yaml`,Q=`${D}/shrinkwrap.yaml`,U=`${D}/yarn.lock`,F=`${D}/package-lock.json`,W=`${D}/npm-shrinkwrap.json`;if(q$(J)||q$(X))return"bunx";if(q$(Y)||q$(Q))return"pnpm exec";if(q$(U))return"yarn dlx";if(q$(F)||q$(W))return"npx";return $};var yV=()=>{};var hV,mV=(D)=>{return D===12288||D>=65281&&D<=65376||D>=65504&&D<=65510},lV=(D)=>{return D===8987||D===9001||D>=12272&&D<=12287||D>=12289&&D<=12350||D>=12441&&D<=12543||D>=12549&&D<=12591||D>=12593&&D<=12686||D>=12688&&D<=12771||D>=12783&&D<=12830||D>=12832&&D<=12871||D>=12880&&D<=19903||D>=65040&&D<=65049||D>=65072&&D<=65106||D>=65108&&D<=65126||D>=65128&&D<=65131||D>=127488&&D<=127490||D>=127504&&D<=127547||D>=127552&&D<=127560||D>=131072&&D<=196605||D>=196608&&D<=262141};var dV=C(()=>{hV=(()=>{let D=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return($)=>{let J=0;D.lastIndex=0;while(D.test($))J+=1;return $.length-J}})()});var nm,rm,iV,tm,cV,om,am,sm,pV=(D,$={},J={})=>{let X=$.limit??1/0,Y=$.ellipsis??"",Q=$?.ellipsisWidth??(Y?pV(Y,sm,J).width:0),U=0,F=J.controlWidth??0,W=J.tabWidth??8,K=J.emojiWidth??2,q=2,G=J.regularWidth??1,Z=J.wideWidth??2,H=[[om,G],[nm,0],[rm,F],[tm,W],[cV,K],[iV,Z]],z=0,I=0,B=D.length,N=0,V=!1,O=B,j=Math.max(0,X-Q),v=0,A=0,k=0,u=0;D:while(!0){if(A>v||I>=B&&I>z){let _=D.slice(v,A)||D.slice(z,I);N=0;for(let y of _.replaceAll(am,"")){let T=y.codePointAt(0)||0;if(mV(T))u=2;else if(lV(T))u=Z;else u=G;if(k+u>j)O=Math.min(O,Math.max(v,z)+N);if(k+u>X){V=!0;break D}N+=y.length,k+=u}v=A=0}if(I>=B)break D;for(let _=0,y=H.length;_<y;_++){let[T,d]=H[_];if(T.lastIndex=I,T.test(D)){if(N=T===iV?hV(D.slice(I,T.lastIndex)):T===cV?1:T.lastIndex-I,u=N*d,k+u>j)O=Math.min(O,I+Math.floor((j-k)/d));if(k+u>X){V=!0;break D}k+=u,v=z,A=I,I=z=T.lastIndex;continue D}}I+=1}return{width:V?j:k,index:V?O:B,truncated:V,ellipsed:V&&X>=Q}},nV;var rV=C(()=>{dV();nm=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,rm=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,iV=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,tm=/\t{1,1000}/y,cV=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,om=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,am=/\p{M}+/gu,sm={limit:1/0,ellipsis:""},nV=pV});var em,Dl=(D,$={})=>{return nV(D,em,$).width},q6;var aU=C(()=>{rV();em={limit:1/0,ellipsis:"",ellipsisWidth:0},q6=Dl});function s6(D,$,J){return String(D).normalize().split(Ql).map((X)=>Yl(X,$,J)).join(`
|
|
2
2
|
`)}var b3="\x1B",eV="",$l=39,eU="\x07",Dw="[",Jl="]",$w="m",DF,tV,oV=(D)=>{if(D>=30&&D<=37)return 39;if(D>=90&&D<=97)return 39;if(D>=40&&D<=47)return 49;if(D>=100&&D<=107)return 49;if(D===1||D===2)return 22;if(D===3)return 23;if(D===4)return 24;if(D===7)return 27;if(D===8)return 28;if(D===9)return 29;if(D===0)return 0;return},aV=(D)=>`${b3}${Dw}${D}${$w}`,sV=(D)=>`${b3}${DF}${D}${eU}`,sU=(D,$,J)=>{let X=$[Symbol.iterator](),Y=!1,Q=!1,U=D.at(-1),F=U===void 0?0:q6(U),W=X.next(),K=X.next(),q=0;while(!W.done){let G=W.value,Z=q6(G);if(F+Z<=J)D[D.length-1]+=G;else D.push(G),F=0;if(G===b3||G===eV)Y=!0,Q=$.startsWith(DF,q+1);if(Y){if(Q){if(G===eU)Y=!1,Q=!1}else if(G===$w)Y=!1}else if(F+=Z,F===J&&!K.done)D.push(""),F=0;W=K,K=X.next(),q+=G.length}if(U=D.at(-1),!F&&U!==void 0&&U.length&&D.length>1)D[D.length-2]+=D.pop()},Xl=(D)=>{let $=D.split(" "),J=$.length;while(J){if(q6($[J-1]))break;J--}if(J===$.length)return D;return $.slice(0,J).join(" ")+$.slice(J).join("")},Yl=(D,$,J={})=>{if(J.trim!==!1&&D.trim()==="")return"";let X="",Y,Q,U=D.split(" "),F=[""],W=0;for(let G=0;G<U.length;G++){let Z=U[G];if(J.trim!==!1){let z=F.at(-1)??"",I=z.trimStart();if(z.length!==I.length)F[F.length-1]=I,W=q6(I)}if(G!==0){if(W>=$&&(J.wordWrap===!1||J.trim===!1))F.push(""),W=0;if(W||J.trim===!1)F[F.length-1]+=" ",W++}let H=q6(Z);if(J.hard&&H>$){let z=$-W,I=1+Math.floor((H-z-1)/$);if(Math.floor((H-1)/$)<I)F.push("");sU(F,Z,$),W=q6(F.at(-1)??"");continue}if(W+H>$&&W&&H){if(J.wordWrap===!1&&W<$){sU(F,Z,$),W=q6(F.at(-1)??"");continue}F.push(""),W=0}if(W+H>$&&J.wordWrap===!1){sU(F,Z,$),W=q6(F.at(-1)??"");continue}F[F.length-1]+=Z,W+=H}if(J.trim!==!1)F=F.map((G)=>Xl(G));let K=F.join(`
|
|
3
3
|
`),q=!1;for(let G=0;G<K.length;G++){let Z=K[G];if(X+=Z,!q){if(q=Z>="\uD800"&&Z<="\uDBFF",q)continue}else q=!1;if(Z===b3||Z===eV){tV.lastIndex=G+1;let z=tV.exec(K)?.groups;if(z?.code!==void 0){let I=Number.parseFloat(z.code);Y=I===$l?void 0:I}else if(z?.uri!==void 0)Q=z.uri.length===0?void 0:z.uri}if(K[G+1]===`
|
|
4
4
|
`){if(Q)X+=sV("");let H=Y?oV(Y):void 0;if(Y&&H)X+=aV(H)}else if(Z===`
|
|
@@ -86,7 +86,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
86
86
|
`)}),$.__defineSetter__("stack",function(U){return[U].concat($.stack).join(`
|
|
87
87
|
|
|
88
88
|
`)}),$}});var VE=T((FwD,OE)=>{var V6=s("constants"),ga=process.cwd,HU=null,ua=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!HU)HU=ga.call(process);return HU};try{process.cwd()}catch(D){}if(typeof process.chdir==="function"){if(LU=process.chdir,process.chdir=function(D){HU=null,LU.call(process,D)},Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,LU)}var LU;OE.exports=fa;function fa(D){if(V6.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./))$(D);if(!D.lutimes)U(D);if(D.chown=Y(D.chown),D.fchown=Y(D.fchown),D.lchown=Y(D.lchown),D.chmod=Q(D.chmod),D.fchmod=Q(D.fchmod),D.lchmod=Q(D.lchmod),D.chownSync=F(D.chownSync),D.fchownSync=F(D.fchownSync),D.lchownSync=F(D.lchownSync),D.chmodSync=X(D.chmodSync),D.fchmodSync=X(D.fchmodSync),D.lchmodSync=X(D.lchmodSync),D.stat=J(D.stat),D.fstat=J(D.fstat),D.lstat=J(D.lstat),D.statSync=I(D.statSync),D.fstatSync=I(D.fstatSync),D.lstatSync=I(D.lstatSync),D.chmod&&!D.lchmod)D.lchmod=function(W,B,G){if(G)process.nextTick(G)},D.lchmodSync=function(){};if(D.chown&&!D.lchown)D.lchown=function(W,B,G,Z){if(Z)process.nextTick(Z)},D.lchownSync=function(){};if(ua==="win32")D.rename=typeof D.rename!=="function"?D.rename:function(W){function B(G,Z,z){var K=Date.now(),H=0;W(G,Z,function M(N){if(N&&(N.code==="EACCES"||N.code==="EPERM"||N.code==="EBUSY")&&Date.now()-K<60000){if(setTimeout(function(){D.stat(Z,function(L,O){if(L&&L.code==="ENOENT")W(G,Z,M);else z(N)})},H),H<100)H+=10;return}if(z)z(N)})}if(Object.setPrototypeOf)Object.setPrototypeOf(B,W);return B}(D.rename);D.read=typeof D.read!=="function"?D.read:function(W){function B(G,Z,z,K,H,M){var N;if(M&&typeof M==="function"){var L=0;N=function(O,j,E){if(O&&O.code==="EAGAIN"&&L<10)return L++,W.call(D,G,Z,z,K,H,N);M.apply(this,arguments)}}return W.call(D,G,Z,z,K,H,N)}if(Object.setPrototypeOf)Object.setPrototypeOf(B,W);return B}(D.read),D.readSync=typeof D.readSync!=="function"?D.readSync:function(W){return function(B,G,Z,z,K){var H=0;while(!0)try{return W.call(D,B,G,Z,z,K)}catch(M){if(M.code==="EAGAIN"&&H<10){H++;continue}throw M}}}(D.readSync);function $(W){W.lchmod=function(B,G,Z){W.open(B,V6.O_WRONLY|V6.O_SYMLINK,G,function(z,K){if(z){if(Z)Z(z);return}W.fchmod(K,G,function(H){W.close(K,function(M){if(Z)Z(H||M)})})})},W.lchmodSync=function(B,G){var Z=W.openSync(B,V6.O_WRONLY|V6.O_SYMLINK,G),z=!0,K;try{K=W.fchmodSync(Z,G),z=!1}finally{if(z)try{W.closeSync(Z)}catch(H){}else W.closeSync(Z)}return K}}function U(W){if(V6.hasOwnProperty("O_SYMLINK")&&W.futimes)W.lutimes=function(B,G,Z,z){W.open(B,V6.O_SYMLINK,function(K,H){if(K){if(z)z(K);return}W.futimes(H,G,Z,function(M){W.close(H,function(N){if(z)z(M||N)})})})},W.lutimesSync=function(B,G,Z){var z=W.openSync(B,V6.O_SYMLINK),K,H=!0;try{K=W.futimesSync(z,G,Z),H=!1}finally{if(H)try{W.closeSync(z)}catch(M){}else W.closeSync(z)}return K};else if(W.futimes)W.lutimes=function(B,G,Z,z){if(z)process.nextTick(z)},W.lutimesSync=function(){}}function Q(W){if(!W)return W;return function(B,G,Z){return W.call(D,B,G,function(z){if(q(z))z=null;if(Z)Z.apply(this,arguments)})}}function X(W){if(!W)return W;return function(B,G){try{return W.call(D,B,G)}catch(Z){if(!q(Z))throw Z}}}function Y(W){if(!W)return W;return function(B,G,Z,z){return W.call(D,B,G,Z,function(K){if(q(K))K=null;if(z)z.apply(this,arguments)})}}function F(W){if(!W)return W;return function(B,G,Z){try{return W.call(D,B,G,Z)}catch(z){if(!q(z))throw z}}}function J(W){if(!W)return W;return function(B,G,Z){if(typeof G==="function")Z=G,G=null;function z(K,H){if(H){if(H.uid<0)H.uid+=4294967296;if(H.gid<0)H.gid+=4294967296}if(Z)Z.apply(this,arguments)}return G?W.call(D,B,G,z):W.call(D,B,z)}}function I(W){if(!W)return W;return function(B,G){var Z=G?W.call(D,B,G):W.call(D,B);if(Z){if(Z.uid<0)Z.uid+=4294967296;if(Z.gid<0)Z.gid+=4294967296}return Z}}function q(W){if(!W)return!0;if(W.code==="ENOSYS")return!0;var B=!process.getuid||process.getuid()!==0;if(B){if(W.code==="EINVAL"||W.code==="EPERM")return!0}return!1}}});var EE=T((JwD,AE)=>{var RE=s("stream").Stream;AE.exports=ya;function ya(D){return{ReadStream:$,WriteStream:U};function $(Q,X){if(!(this instanceof $))return new $(Q,X);RE.call(this);var Y=this;this.path=Q,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,X=X||{};var F=Object.keys(X);for(var J=0,I=F.length;J<I;J++){var q=F[J];this[q]=X[q]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!=="number")throw TypeError("end must be a Number");if(this.start>this.end)throw Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){Y._read()});return}D.open(this.path,this.flags,this.mode,function(W,B){if(W){Y.emit("error",W),Y.readable=!1;return}Y.fd=B,Y.emit("open",B),Y._read()})}function U(Q,X){if(!(this instanceof U))return new U(Q,X);RE.call(this),this.path=Q,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,X=X||{};var Y=Object.keys(X);for(var F=0,J=Y.length;F<J;F++){var I=Y[F];this[I]=X[I]}if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.start<0)throw Error("start must be >= zero");this.pos=this.start}if(this.busy=!1,this._queue=[],this.fd===null)this._open=D.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush()}}});var TE=T((IwD,jE)=>{jE.exports=ha;var ma=Object.getPrototypeOf||function(D){return D.__proto__};function ha(D){if(D===null||typeof D!=="object")return D;if(D instanceof Object)var $={__proto__:ma(D)};else var $=Object.create(null);return Object.getOwnPropertyNames(D).forEach(function(U){Object.defineProperty($,U,Object.getOwnPropertyDescriptor(D,U))}),$}});var R6=T((qwD,WI)=>{var cD=s("fs"),da=VE(),la=EE(),na=TE(),NU=s("util"),z0,wU;if(typeof Symbol==="function"&&typeof Symbol.for==="function")z0=Symbol.for("graceful-fs.queue"),wU=Symbol.for("graceful-fs.previous");else z0="___graceful-fs.queue",wU="___graceful-fs.previous";function ia(){}function PE(D,$){Object.defineProperty(D,z0,{get:function(){return $}})}var S1=ia;if(NU.debuglog)S1=NU.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))S1=function(){var D=NU.format.apply(NU,arguments);D="GFS4: "+D.split(/\n/).join(`
|
|
89
|
-
GFS4: `),console.error(D)};if(!cD[z0]){if(JI=global[z0]||[],PE(cD,JI),cD.close=function(D){function $(U,Q){return D.call(cD,U,function(X){if(!X)SE();if(typeof Q==="function")Q.apply(this,arguments)})}return Object.defineProperty($,wU,{value:D}),$}(cD.close),cD.closeSync=function(D){function $(U){D.apply(cD,arguments),SE()}return Object.defineProperty($,wU,{value:D}),$}(cD.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){S1(cD[z0]),s("assert").equal(cD[z0].length,0)})}var JI;if(!global[z0])PE(global,cD[z0]);WI.exports=II(na(cD));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!cD.__patched)WI.exports=II(cD),cD.__patched=!0;function II(D){da(D),D.gracefulify=II,D.createReadStream=j,D.createWriteStream=E;var $=D.readFile;D.readFile=U;function U(b,R,P){if(typeof R==="function")P=R,R=null;return h(b,R,P);function h(i,v,k,A){return $(i,v,function(w){if(w&&(w.code==="EMFILE"||w.code==="ENFILE"))W8([h,[i,v,k],w,A||Date.now(),Date.now()]);else if(typeof k==="function")k.apply(this,arguments)})}}var Q=D.writeFile;D.writeFile=X;function X(b,R,P,h){if(typeof P==="function")h=P,P=null;return i(b,R,P,h);function i(v,k,A,w,V){return Q(v,k,A,function(_){if(_&&(_.code==="EMFILE"||_.code==="ENFILE"))W8([i,[v,k,A,w],_,V||Date.now(),Date.now()]);else if(typeof w==="function")w.apply(this,arguments)})}}var Y=D.appendFile;if(Y)D.appendFile=F;function F(b,R,P,h){if(typeof P==="function")h=P,P=null;return i(b,R,P,h);function i(v,k,A,w,V){return Y(v,k,A,function(_){if(_&&(_.code==="EMFILE"||_.code==="ENFILE"))W8([i,[v,k,A,w],_,V||Date.now(),Date.now()]);else if(typeof w==="function")w.apply(this,arguments)})}}var J=D.copyFile;if(J)D.copyFile=I;function I(b,R,P,h){if(typeof P==="function")h=P,P=0;return i(b,R,P,h);function i(v,k,A,w,V){return J(v,k,A,function(_){if(_&&(_.code==="EMFILE"||_.code==="ENFILE"))W8([i,[v,k,A,w],_,V||Date.now(),Date.now()]);else if(typeof w==="function")w.apply(this,arguments)})}}var q=D.readdir;D.readdir=B;var W=/^v[0-5]\./;function B(b,R,P){if(typeof R==="function")P=R,R=null;var h=W.test(process.version)?function(k,A,w,V){return q(k,i(k,A,w,V))}:function(k,A,w,V){return q(k,A,i(k,A,w,V))};return h(b,R,P);function i(v,k,A,w){return function(V,_){if(V&&(V.code==="EMFILE"||V.code==="ENFILE"))W8([h,[v,k,A],V,w||Date.now(),Date.now()]);else{if(_&&_.sort)_.sort();if(typeof A==="function")A.call(this,V,_)}}}}if(process.version.substr(0,4)==="v0.8"){var G=la(D);M=G.ReadStream,L=G.WriteStream}var Z=D.ReadStream;if(Z)M.prototype=Object.create(Z.prototype),M.prototype.open=N;var z=D.WriteStream;if(z)L.prototype=Object.create(z.prototype),L.prototype.open=O;Object.defineProperty(D,"ReadStream",{get:function(){return M},set:function(b){M=b},enumerable:!0,configurable:!0}),Object.defineProperty(D,"WriteStream",{get:function(){return L},set:function(b){L=b},enumerable:!0,configurable:!0});var K=M;Object.defineProperty(D,"FileReadStream",{get:function(){return K},set:function(b){K=b},enumerable:!0,configurable:!0});var H=L;Object.defineProperty(D,"FileWriteStream",{get:function(){return H},set:function(b){H=b},enumerable:!0,configurable:!0});function M(b,R){if(this instanceof M)return Z.apply(this,arguments),this;else return M.apply(Object.create(M.prototype),arguments)}function N(){var b=this;S(b.path,b.flags,b.mode,function(R,P){if(R){if(b.autoClose)b.destroy();b.emit("error",R)}else b.fd=P,b.emit("open",P),b.read()})}function L(b,R){if(this instanceof L)return z.apply(this,arguments),this;else return L.apply(Object.create(L.prototype),arguments)}function O(){var b=this;S(b.path,b.flags,b.mode,function(R,P){if(R)b.destroy(),b.emit("error",R);else b.fd=P,b.emit("open",P)})}function j(b,R){return new D.ReadStream(b,R)}function E(b,R){return new D.WriteStream(b,R)}var C=D.open;D.open=S;function S(b,R,P,h){if(typeof P==="function")h=P,P=null;return i(b,R,P,h);function i(v,k,A,w,V){return C(v,k,A,function(_,m){if(_&&(_.code==="EMFILE"||_.code==="ENFILE"))W8([i,[v,k,A,w],_,V||Date.now(),Date.now()]);else if(typeof w==="function")w.apply(this,arguments)})}}return D}function W8(D){S1("ENQUEUE",D[0].name,D[1]),cD[z0].push(D),qI()}var MU;function SE(){var D=Date.now();for(var $=0;$<cD[z0].length;++$)if(cD[z0][$].length>2)cD[z0][$][3]=D,cD[z0][$][4]=D;qI()}function qI(){if(clearTimeout(MU),MU=void 0,cD[z0].length===0)return;var D=cD[z0].shift(),$=D[0],U=D[1],Q=D[2],X=D[3],Y=D[4];if(X===void 0)S1("RETRY",$.name,U),$.apply(null,U);else if(Date.now()-X>=60000){S1("TIMEOUT",$.name,U);var F=U.pop();if(typeof F==="function")F.call(null,Q)}else{var J=Date.now()-Y,I=Math.max(Y-X,1),q=Math.min(I*1.2,100);if(J>=q)S1("RETRY",$.name,U),$.apply(null,U.concat([X]));else cD[z0].push(D)}if(MU===void 0)MU=setTimeout(qI,0)}});var bE=T((WwD,CE)=>{function F$(D,$){if(typeof $==="boolean")$={forever:$};if(this._originalTimeouts=JSON.parse(JSON.stringify(D)),this._timeouts=D,this._options=$||{},this._maxRetryTime=$&&$.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever)this._cachedTimeouts=this._timeouts.slice(0)}CE.exports=F$;F$.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};F$.prototype.stop=function(){if(this._timeout)clearTimeout(this._timeout);this._timeouts=[],this._cachedTimeouts=null};F$.prototype.retry=function(D){if(this._timeout)clearTimeout(this._timeout);if(!D)return!1;var $=new Date().getTime();if(D&&$-this._operationStart>=this._maxRetryTime)return this._errors.unshift(Error("RetryOperation timeout occurred")),!1;this._errors.push(D);var U=this._timeouts.shift();if(U===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),U=this._timeouts.shift();else return!1;var Q=this,X=setTimeout(function(){if(Q._attempts++,Q._operationTimeoutCb){if(Q._timeout=setTimeout(function(){Q._operationTimeoutCb(Q._attempts)},Q._operationTimeout),Q._options.unref)Q._timeout.unref()}Q._fn(Q._attempts)},U);if(this._options.unref)X.unref();return!0};F$.prototype.attempt=function(D,$){if(this._fn=D,$){if($.timeout)this._operationTimeout=$.timeout;if($.cb)this._operationTimeoutCb=$.cb}var U=this;if(this._operationTimeoutCb)this._timeout=setTimeout(function(){U._operationTimeoutCb()},U._operationTimeout);this._operationStart=new Date().getTime(),this._fn(this._attempts)};F$.prototype.try=function(D){console.log("Using RetryOperation.try() is deprecated"),this.attempt(D)};F$.prototype.start=function(D){console.log("Using RetryOperation.start() is deprecated"),this.attempt(D)};F$.prototype.start=F$.prototype.try;F$.prototype.errors=function(){return this._errors};F$.prototype.attempts=function(){return this._attempts};F$.prototype.mainError=function(){if(this._errors.length===0)return null;var D={},$=null,U=0;for(var Q=0;Q<this._errors.length;Q++){var X=this._errors[Q],Y=X.message,F=(D[Y]||0)+1;if(D[Y]=F,F>=U)$=X,U=F}return $}});var _E=T((pa)=>{var ca=bE();pa.operation=function(D){var $=pa.timeouts(D);return new ca($,{forever:D&&D.forever,unref:D&&D.unref,maxRetryTime:D&&D.maxRetryTime})};pa.timeouts=function(D){if(D instanceof Array)return[].concat(D);var $={retries:10,factor:2,minTimeout:1000,maxTimeout:1/0,randomize:!1};for(var U in D)$[U]=D[U];if($.minTimeout>$.maxTimeout)throw Error("minTimeout is greater than maxTimeout");var Q=[];for(var X=0;X<$.retries;X++)Q.push(this.createTimeout(X,$));if(D&&D.forever&&!Q.length)Q.push(this.createTimeout(X,$));return Q.sort(function(Y,F){return Y-F}),Q};pa.createTimeout=function(D,$){var U=$.randomize?Math.random()+1:1,Q=Math.round(U*$.minTimeout*Math.pow($.factor,D));return Q=Math.min(Q,$.maxTimeout),Q};pa.wrap=function(D,$,U){if($ instanceof Array)U=$,$=null;if(!U){U=[];for(var Q in D)if(typeof D[Q]==="function")U.push(Q)}for(var X=0;X<U.length;X++){var Y=U[X],F=D[Y];D[Y]=function(I){var q=pa.operation($),W=Array.prototype.slice.call(arguments,1),B=W.pop();W.push(function(G){if(q.retry(G))return;if(G)arguments[0]=q.mainError();B.apply(this,arguments)}),q.attempt(function(){I.apply(D,W)})}.bind(D,F),D[Y].options=$}}});var kE=T((GwD,OU)=>{OU.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32")OU.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")OU.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var KI=T((zwD,G8)=>{var dD=global.process,P1=function(D){return D&&typeof D==="object"&&typeof D.removeListener==="function"&&typeof D.emit==="function"&&typeof D.reallyExit==="function"&&typeof D.listeners==="function"&&typeof D.kill==="function"&&typeof D.pid==="number"&&typeof D.on==="function"};if(!P1(dD))G8.exports=function(){return function(){}};else{if(BI=s("assert"),C1=kE(),GI=/^win/i.test(dD.platform),B8=s("events"),typeof B8!=="function")B8=B8.EventEmitter;if(dD.__signal_exit_emitter__)Q0=dD.__signal_exit_emitter__;else Q0=dD.__signal_exit_emitter__=new B8,Q0.count=0,Q0.emitted={};if(!Q0.infinite)Q0.setMaxListeners(1/0),Q0.infinite=!0;G8.exports=function(D,$){if(!P1(global.process))return function(){};if(BI.equal(typeof D,"function","a callback must be provided for exit handler"),b1===!1)VU();var U="exit";if($&&$.alwaysLast)U="afterexit";var Q=function(){if(Q0.removeListener(U,D),Q0.listeners("exit").length===0&&Q0.listeners("afterexit").length===0)h9()};return Q0.on(U,D),Q},h9=function(){if(!b1||!P1(global.process))return;b1=!1,C1.forEach(function($){try{dD.removeListener($,d9[$])}catch(U){}}),dD.emit=l9,dD.reallyExit=RU,Q0.count-=1},G8.exports.unload=h9,A6=function($,U,Q){if(Q0.emitted[$])return;Q0.emitted[$]=!0,Q0.emit($,U,Q)},d9={},C1.forEach(function(D){d9[D]=function(){if(!P1(global.process))return;var U=dD.listeners(D);if(U.length===Q0.count){if(h9(),A6("exit",null,D),A6("afterexit",null,D),GI&&D==="SIGHUP")D="SIGINT";dD.kill(dD.pid,D)}}}),G8.exports.signals=function(){return C1},b1=!1,VU=function(){if(b1||!P1(global.process))return;b1=!0,Q0.count+=1,C1=C1.filter(function($){try{return dD.on($,d9[$]),!0}catch(U){return!1}}),dD.emit=ZI,dD.reallyExit=zI},G8.exports.load=VU,RU=dD.reallyExit,zI=function($){if(!P1(global.process))return;dD.exitCode=$||0,A6("exit",dD.exitCode,null),A6("afterexit",dD.exitCode,null),RU.call(dD,dD.exitCode)},l9=dD.emit,ZI=function($,U){if($==="exit"&&P1(global.process)){if(U!==void 0)dD.exitCode=U;var Q=l9.apply(this,arguments);return A6("exit",dD.exitCode,null),A6("afterexit",dD.exitCode,null),Q}else return l9.apply(this,arguments)}}var BI,C1,GI,B8,Q0,h9,A6,d9,b1,VU,RU,zI,l9,ZI});var gE=T((ea,HI)=>{var xE=Symbol();function ta(D,$,U){let Q=$[xE];if(Q)return $.stat(D,(Y,F)=>{if(Y)return U(Y);U(null,F.mtime,Q)});let X=new Date(Math.ceil(Date.now()/1000)*1000+5);$.utimes(D,X,X,(Y)=>{if(Y)return U(Y);$.stat(D,(F,J)=>{if(F)return U(F);let I=J.mtime.getTime()%1000===0?"s":"ms";Object.defineProperty($,xE,{value:I}),U(null,J.mtime,I)})})}function sa(D){let $=Date.now();if(D==="s")$=Math.ceil($/1000)*1000;return new Date($)}ea.probe=ta;ea.getMtime=sa});var hE=T((It,i9)=>{var Ut=s("path"),MI=R6(),Xt=_E(),Qt=KI(),uE=gE(),e$={};function n9(D,$){return $.lockfilePath||`${D}.lock`}function wI(D,$,U){if(!$.realpath)return U(null,Ut.resolve(D));$.fs.realpath(D,U)}function NI(D,$,U){let Q=n9(D,$);$.fs.mkdir(Q,(X)=>{if(!X)return uE.probe(Q,$.fs,(Y,F,J)=>{if(Y)return $.fs.rmdir(Q,()=>{}),U(Y);U(null,F,J)});if(X.code!=="EEXIST")return U(X);if($.stale<=0)return U(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));$.fs.stat(Q,(Y,F)=>{if(Y){if(Y.code==="ENOENT")return NI(D,{...$,stale:0},U);return U(Y)}if(!fE(F,$))return U(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));yE(D,$,(J)=>{if(J)return U(J);NI(D,{...$,stale:0},U)})})})}function fE(D,$){return D.mtime.getTime()<Date.now()-$.stale}function yE(D,$,U){$.fs.rmdir(n9(D,$),(Q)=>{if(Q&&Q.code!=="ENOENT")return U(Q);U()})}function AU(D,$){let U=e$[D];if(U.updateTimeout)return;if(U.updateDelay=U.updateDelay||$.update,U.updateTimeout=setTimeout(()=>{U.updateTimeout=null,$.fs.stat(U.lockfilePath,(Q,X)=>{let Y=U.lastUpdate+$.stale<Date.now();if(Q){if(Q.code==="ENOENT"||Y)return LI(D,U,Object.assign(Q,{code:"ECOMPROMISED"}));return U.updateDelay=1000,AU(D,$)}if(U.mtime.getTime()!==X.mtime.getTime())return LI(D,U,Object.assign(Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let J=uE.getMtime(U.mtimePrecision);$.fs.utimes(U.lockfilePath,J,J,(I)=>{let q=U.lastUpdate+$.stale<Date.now();if(U.released)return;if(I){if(I.code==="ENOENT"||q)return LI(D,U,Object.assign(I,{code:"ECOMPROMISED"}));return U.updateDelay=1000,AU(D,$)}U.mtime=J,U.lastUpdate=Date.now(),U.updateDelay=null,AU(D,$)})})},U.updateDelay),U.updateTimeout.unref)U.updateTimeout.unref()}function LI(D,$,U){if($.released=!0,$.updateTimeout)clearTimeout($.updateTimeout);if(e$[D]===$)delete e$[D];$.options.onCompromised(U)}function Yt(D,$,U){$={stale:1e4,update:null,realpath:!0,retries:0,fs:MI,onCompromised:(Q)=>{throw Q},...$},$.retries=$.retries||0,$.retries=typeof $.retries==="number"?{retries:$.retries}:$.retries,$.stale=Math.max($.stale||0,2000),$.update=$.update==null?$.stale/2:$.update||0,$.update=Math.max(Math.min($.update,$.stale/2),1000),wI(D,$,(Q,X)=>{if(Q)return U(Q);let Y=Xt.operation($.retries);Y.attempt(()=>{NI(X,$,(F,J,I)=>{if(Y.retry(F))return;if(F)return U(Y.mainError());let q=e$[X]={lockfilePath:n9(X,$),mtime:J,mtimePrecision:I,options:$,lastUpdate:Date.now()};AU(X,$),U(null,(W)=>{if(q.released)return W&&W(Object.assign(Error("Lock is already released"),{code:"ERELEASED"}));mE(X,{...$,realpath:!1},W)})})})})}function mE(D,$,U){$={fs:MI,realpath:!0,...$},wI(D,$,(Q,X)=>{if(Q)return U(Q);let Y=e$[X];if(!Y)return U(Object.assign(Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));Y.updateTimeout&&clearTimeout(Y.updateTimeout),Y.released=!0,delete e$[X],yE(X,$,U)})}function Ft(D,$,U){$={stale:1e4,realpath:!0,fs:MI,...$},$.stale=Math.max($.stale||0,2000),wI(D,$,(Q,X)=>{if(Q)return U(Q);$.fs.stat(n9(X,$),(Y,F)=>{if(Y)return Y.code==="ENOENT"?U(null,!1):U(Y);return U(null,!fE(F,$))})})}function Jt(){return e$}Qt(()=>{for(let D in e$){let $=e$[D].options;try{$.fs.rmdirSync(n9(D,$))}catch(U){}}});It.lock=Yt;It.unlock=mE;It.check=Ft;It.getLocks=Jt});var lE=T((ZwD,dE)=>{var zt=R6();function Zt(D){let $=["mkdir","realpath","stat","rmdir","utimes"],U={...D};return $.forEach((Q)=>{U[Q]=(...X)=>{let Y=X.pop(),F;try{F=D[`${Q}Sync`](...X)}catch(J){return Y(J)}Y(null,F)}}),U}function Kt(D){return(...$)=>new Promise((U,Q)=>{$.push((X,Y)=>{if(X)Q(X);else U(Y)}),D(...$)})}function Ht(D){return(...$)=>{let U,Q;if($.push((X,Y)=>{U=X,Q=Y}),D(...$),U)throw U;return Q}}function Lt(D){if(D={...D},D.fs=Zt(D.fs||zt),typeof D.retries==="number"&&D.retries>0||D.retries&&typeof D.retries.retries==="number"&&D.retries.retries>0)throw Object.assign(Error("Cannot use retries with the sync api"),{code:"ESYNC"});return D}dE.exports={toPromise:Kt,toSync:Ht,toSyncOptions:Lt}});var iE=T((KwD,E6)=>{var z8=hE(),{toPromise:EU,toSync:jU,toSyncOptions:OI}=lE();async function nE(D,$){let U=await EU(z8.lock)(D,$);return EU(U)}function Nt(D,$){let U=jU(z8.lock)(D,OI($));return jU(U)}function Mt(D,$){return EU(z8.unlock)(D,$)}function wt(D,$){return jU(z8.unlock)(D,OI($))}function Ot(D,$){return EU(z8.check)(D,$)}function Vt(D,$){return jU(z8.check)(D,OI($))}E6.exports=nE;E6.exports.lock=nE;E6.exports.unlock=Mt;E6.exports.lockSync=Nt;E6.exports.unlockSync=wt;E6.exports.check=Ot;E6.exports.checkSync=Vt});var sE=T((aE)=>{Object.defineProperty(aE,"__esModule",{value:!0});aE.canStoreURLs=aE.FileUrlStorage=void 0;var cE=s("fs"),Rt=Et(wE()),pE=At(iE());function oE(D){if(typeof WeakMap!="function")return null;var $=new WeakMap,U=new WeakMap;return(oE=function(Q){return Q?U:$})(D)}function At(D,$){if(!$&&D&&D.__esModule)return D;if(D===null||typeof D!="object"&&typeof D!="function")return{default:D};var U=oE($);if(U&&U.has(D))return U.get(D);var Q={__proto__:null},X=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Y in D)if(Y!=="default"&&{}.hasOwnProperty.call(D,Y)){var F=X?Object.getOwnPropertyDescriptor(D,Y):null;F&&(F.get||F.set)?Object.defineProperty(Q,Y,F):Q[Y]=D[Y]}return Q.default=D,U&&U.set(D,Q),Q}function Et(D){return D&&D.__esModule?D:{default:D}}function c9(D){return c9=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},c9(D)}function jt(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function rE(D,$){for(var U=0;U<$.length;U++){var Q=$[U];if(Q.enumerable=Q.enumerable||!1,Q.configurable=!0,"value"in Q)Q.writable=!0;Object.defineProperty(D,St(Q.key),Q)}}function Tt(D,$,U){if($)rE(D.prototype,$);if(U)rE(D,U);return Object.defineProperty(D,"prototype",{writable:!1}),D}function St(D){var $=Pt(D,"string");return c9($)=="symbol"?$:$+""}function Pt(D,$){if(c9(D)!="object"||!D)return D;var U=D[Symbol.toPrimitive];if(U!==void 0){var Q=U.call(D,$||"default");if(c9(Q)!="object")return Q;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var HwD=aE.canStoreURLs=!0,LwD=aE.FileUrlStorage=function(){function D($){jt(this,D),this.path=$}return Tt(D,[{key:"findAllUploads",value:function(){var U=this;return new Promise(function(Q,X){U._getItems("tus::",function(Y,F){if(Y)X(Y);else Q(F)})})}},{key:"findUploadsByFingerprint",value:function(U){var Q=this;return new Promise(function(X,Y){Q._getItems("tus::".concat(U),function(F,J){if(F)Y(F);else X(J)})})}},{key:"removeUpload",value:function(U){var Q=this;return new Promise(function(X,Y){Q._removeItem(U,function(F){if(F)Y(F);else X()})})}},{key:"addUpload",value:function(U,Q){var X=this,Y=Math.round(Math.random()*1000000000000),F="tus::".concat(U,"::").concat(Y);return new Promise(function(J,I){X._setItem(F,Q,function(q){if(q)I(q);else J(F)})})}},{key:"_setItem",value:function(U,Q,X){var Y=this;pE.lock(this.path,this._lockfileOptions()).then(function(F){X=Y._releaseAndCb(F,X),Y._getData(function(J,I){if(J){X(J);return}I[U]=Q,Y._writeData(I,function(q){return X(q)})})}).catch(X)}},{key:"_getItems",value:function(U,Q){this._getData(function(X,Y){if(X){Q(X);return}var F=Object.keys(Y).filter(function(J){return J.startsWith(U)}).map(function(J){var I=Y[J];return I.urlStorageKey=J,I});Q(null,F)})}},{key:"_removeItem",value:function(U,Q){var X=this;pE.lock(this.path,this._lockfileOptions()).then(function(Y){Q=X._releaseAndCb(Y,Q),X._getData(function(F,J){if(F){Q(F);return}delete J[U],X._writeData(J,function(I){return Q(I)})})}).catch(Q)}},{key:"_lockfileOptions",value:function(){return{realpath:!1,retries:{retries:5,minTimeout:20}}}},{key:"_releaseAndCb",value:function(U,Q){return function(X){if(X){U().then(function(){return Q(X)}).catch(function(Y){return Q((0,Rt.default)([X,Y]))});return}U().then(Q).catch(Q)}}},{key:"_writeData",value:function(U,Q){var X={encoding:"utf8",mode:432,flag:"w"};(0,cE.writeFile)(this.path,JSON.stringify(U),X,function(Y){return Q(Y)})}},{key:"_getData",value:function(U){(0,cE.readFile)(this.path,"utf8",function(Q,X){if(Q){if(Q.code==="ENOENT")U(null,{});else U(Q);return}try{X=!X.trim().length?{}:JSON.parse(X)}catch(Y){U(Y);return}U(null,X)})}}])}()});var qj=T((j6)=>{Object.defineProperty(j6,"__esModule",{value:!0});Object.defineProperty(j6,"DefaultHttpStack",{enumerable:!0,get:function(){return Uj.default}});Object.defineProperty(j6,"DetailedError",{enumerable:!0,get:function(){return bt.default}});Object.defineProperty(j6,"FileUrlStorage",{enumerable:!0,get:function(){return Xj.FileUrlStorage}});Object.defineProperty(j6,"StreamSource",{enumerable:!0,get:function(){return gt.default}});j6.Upload=void 0;Object.defineProperty(j6,"canStoreURLs",{enumerable:!0,get:function(){return Xj.canStoreURLs}});j6.defaultOptions=void 0;Object.defineProperty(j6,"enableDebugLog",{enumerable:!0,get:function(){return vt.enableDebugLog}});j6.isSupported=void 0;var bt=v1(wJ()),vt=OJ(),_t=v1(iV()),VI=v1(AR()),kt=v1(nR()),xt=v1(oR()),Uj=v1(BA()),gt=v1(vJ()),Xj=sE();function v1(D){return D&&D.__esModule?D:{default:D}}function K8(D){return K8=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},K8(D)}function ut(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function eE(D,$){for(var U=0;U<$.length;U++){var Q=$[U];if(Q.enumerable=Q.enumerable||!1,Q.configurable=!0,"value"in Q)Q.writable=!0;Object.defineProperty(D,Yj(Q.key),Q)}}function ft(D,$,U){if($)eE(D.prototype,$);if(U)eE(D,U);return Object.defineProperty(D,"prototype",{writable:!1}),D}function yt(D,$,U){return $=TU($),mt(D,Qj()?Reflect.construct($,U||[],TU(D).constructor):$.apply(D,U))}function mt(D,$){if($&&(K8($)==="object"||typeof $==="function"))return $;else if($!==void 0)throw TypeError("Derived constructors may only return object or undefined");return ht(D)}function ht(D){if(D===void 0)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function Qj(){try{var D=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch($){}return(Qj=function(){return!!D})()}function TU(D){return TU=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(U){return U.__proto__||Object.getPrototypeOf(U)},TU(D)}function dt(D,$){if(typeof $!=="function"&&$!==null)throw TypeError("Super expression must either be null or a function");if(D.prototype=Object.create($&&$.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),Object.defineProperty(D,"prototype",{writable:!1}),$)RI(D,$)}function RI(D,$){return RI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Q,X){return Q.__proto__=X,Q},RI(D,$)}function Dj(D,$){var U=Object.keys(D);if(Object.getOwnPropertySymbols){var Q=Object.getOwnPropertySymbols(D);$&&(Q=Q.filter(function(X){return Object.getOwnPropertyDescriptor(D,X).enumerable})),U.push.apply(U,Q)}return U}function Z8(D){for(var $=1;$<arguments.length;$++){var U=arguments[$]!=null?arguments[$]:{};$%2?Dj(Object(U),!0).forEach(function(Q){lt(D,Q,U[Q])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(U)):Dj(Object(U)).forEach(function(Q){Object.defineProperty(D,Q,Object.getOwnPropertyDescriptor(U,Q))})}return D}function lt(D,$,U){if($=Yj($),$ in D)Object.defineProperty(D,$,{value:U,enumerable:!0,configurable:!0,writable:!0});else D[$]=U;return D}function Yj(D){var $=nt(D,"string");return K8($)=="symbol"?$:$+""}function nt(D,$){if(K8(D)!="object"||!D)return D;var U=D[Symbol.toPrimitive];if(U!==void 0){var Q=U.call(D,$||"default");if(K8(Q)!="object")return Q;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var $j=j6.defaultOptions=Z8(Z8({},VI.default.defaultOptions),{},{httpStack:new Uj.default,fileReader:new kt.default,urlStorage:new _t.default,fingerprint:xt.default}),MwD=j6.Upload=function(D){function $(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return ut(this,$),Q=Z8(Z8({},$j),Q),yt(this,$,[U,Q])}return dt($,D),ft($,null,[{key:"terminate",value:function(Q){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return X=Z8(Z8({},$j),X),VI.default.terminate(Q,X)}}])}(VI.default),wwD=j6.isSupported=!0});var N$;var H8=u(()=>{N$={name:"@capgo/cli",type:"module",version:"8.88.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 && bun test/test-builder-only-checklist.mjs && bun test/test-builder-only-setup.mjs && bun test/test-app-todo-lists.mjs && bun test/test-app-todo-tabs.mjs && bun test/test-app-todo-command.mjs && node test/test-app-todo-interactive.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:settings-parity && 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:settings-parity":"bun test/test-settings-parity.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"}}});var AD;var _1=u(()=>{AD=class AD extends Error{context;constructor(D,$,U){super(D,U!==void 0?{cause:U}:void 0);this.name="CliUserError",this.context=$}}});import{platform as ct}from"node:os";import{version as pt}from"node:process";function SwD(D){Bj=D}function ot(D){for(let $=0;$<D.length;$++)if(D.charCodeAt($)>255)return!1;return!0}function Wj(D){if(D.toLowerCase()==="x-capgo-log-token")return"Build log token is missing. Re-run the build command or pass a valid log token.";return"Capgo API key is missing. Run `npx -y @capgo/cli@latest login` or pass `--apikey`."}function at(D){if(D.toLowerCase()==="x-capgo-log-token")return"Build log token contains invalid characters (only ASCII is allowed). Re-run the build command to get a fresh token.";if(D.toLowerCase()==="authorization")return"Authorization header contains invalid characters (only ASCII is allowed). Check your Capgo API key or Supabase anon key configuration.";return"Capgo API key contains invalid characters (only ASCII is allowed). Copy the key from the Capgo dashboard."}function EI(D,$){if($===void 0||$===null){if(AI.has(D.toLowerCase()))throw new AD(Wj(D));throw new AD(`HTTP header "${D}" is missing or invalid.`)}if(typeof $!=="string"){if(AI.has(D.toLowerCase()))throw new AD(Wj(D));throw new AD(`HTTP header "${D}" is missing or invalid.`)}if(!ot($)){if(AI.has(D.toLowerCase()))throw new AD(at(D));throw new AD(`HTTP header "${D}" contains invalid characters (only ASCII is allowed).`)}return $}function T6(D){let $={capgo_api:rt,"x-cli-version":N$.version,"x-cli-command":Bj,"x-cli-node":pt,"x-cli-os":ct()};if(D)for(let[U,Q]of Object.entries(D))$[U]=EI(U,Q);return $}var rt="2025-10-01",Bj="",AI;var jI=u(()=>{H8();_1();AI=new Set(["authorization","capgkey","x-capgo-log-token"])});import{execFileSync as $s}from"child_process";import Us from"path";function et(D,$){if($===void 0)return!0;if(typeof $==="string")return D===$;if($ instanceof RegExp)return $.test(D);return $(D)}function Ds(D,$,U){return{agent:{id:D.id,name:D.name},strategy:"environment",signal:$.name,value:U}}function Ys(D,$){let U=[],Q=zj($.command);for(let X of D)for(let Y of X.process??[]){if(!Y.pattern.test(Q))continue;U.push(Fs(X,Y,{...$,command:Q}))}return U}function Fs(D,$,U){return{agent:{id:D.id,name:D.name},strategy:"process-tree",signal:$.pattern.toString(),value:`${U.pid}:${U.command}`}}function Gj(D,$){try{return $s("ps",["-o",`${$}=`,"-p",String(D)],{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return""}}function zj(D){return Us.basename(D.trim()).replace(/^-+/,"")}function Zj(D={}){let $=D.agents??tt,U=D.strategies??Js(D.experimentalProcessTree),Q={env:D.env??process.env,pid:D.pid??process.pid,agents:$,maxProcessDepth:D.maxProcessDepth??20},X=U.flatMap((F)=>F.detect(Q)),Y=Is($,X,Q.env);if(Y===void 0)return{detected:!1};return{detected:!0,agent:Y}}function Js(D=!1){let $=[new st];if(D)$.push(new Qs);return $}function Is(D,$,U){let Q=new Set($.map((X)=>X.agent.id));for(let X of D){if(!Q.has(X.id))continue;return{id:X.id,name:X.name,...qs(X,U)}}return}function qs(D,$){for(let U of D.sessionEnv??[]){let Q=$[U];if(Q!==void 0&&Q.length>0)return{sessionId:Q}}return{}}var tt,st=class{name="environment";detect(D){let $=[];for(let U of D.agents)for(let Q of U.env??[]){let X=D.env[Q.name];if(X===void 0||!et(X,Q.value))continue;$.push(Ds(U,Q,X))}return $}},Xs=class{read(D){let $=Gj(D,"comm"),U=Number.parseInt(Gj(D,"ppid"),10);if(!$||!Number.isInteger(U))return;return{pid:D,ppid:U,command:zj($)}}},Qs=class{constructor(D=new Xs){this.reader=D}reader;name="process-tree";detect(D){let $=[],U=D.pid;for(let Q=0;Q<D.maxProcessDepth;Q+=1){let X=this.reader.read(U);if(X===void 0)break;if($.push(...Ys(D.agents,X)),X.ppid===void 0||X.ppid<=1||X.ppid===U)break;U=X.ppid}return $}};var Kj=u(()=>{tt=[{id:"codex",name:"Codex",env:[{name:"CODEX_CI",value:"1"},{name:"CODEX_SHELL",value:"1"},{name:"CODEX_THREAD_ID"}],process:[{pattern:/^codex$/i}],sessionEnv:["CODEX_THREAD_ID"]},{id:"cursor",name:"Cursor",env:[{name:"CURSOR_AGENT",value:"1"},{name:"CURSOR_CONVERSATION_ID"}],process:[{pattern:/^cursor$/i}],sessionEnv:["CURSOR_CONVERSATION_ID"]},{id:"claude-code",name:"Claude Code",env:[{name:"CLAUDECODE",value:"1"},{name:"CLAUDE_CODE_SESSION_ID"}],process:[{pattern:/^claude$/i}],sessionEnv:["CLAUDE_CODE_SESSION_ID"]},{id:"opencode",name:"OpenCode",env:[{name:"OPENCODE",value:"1"},{name:"OPENCODE_PID"}],process:[{pattern:/^opencode$/i}]},{id:"devin",name:"Devin",process:[{pattern:/devin/i}]},{id:"gemini",name:"Gemini CLI",env:[{name:"GEMINI_CLI",value:"1"}],process:[{pattern:/^gemini$/i}]},{id:"antigravity",name:"Antigravity",env:[{name:"ANTIGRAVITY_AGENT",value:"1"},{name:"ANTIGRAVITY_TRAJECTORY_ID"}],process:[{pattern:/^antigravity$/i}],sessionEnv:["ANTIGRAVITY_TRAJECTORY_ID"]},{id:"bolt",name:"Bolt",env:[{name:"BOLT_ENV"},{name:"BOLT_ORIGIN"},{name:"BOLT_SERVER_URL"}]},{id:"pi",name:"Pi",env:[{name:"PI_CODING_AGENT",value:"true"}]},{id:"replit",name:"Replit",env:[{name:"REPLIT_SESSION"}],sessionEnv:["REPLIT_SESSION"]},{id:"rork",name:"Rork",env:[{name:"RORK_API_URL"}]},{id:"kiro",name:"Kiro",env:[{name:"KIRO_SESSION_ID"}],process:[{pattern:/kiro/i}],sessionEnv:["KIRO_SESSION_ID"]},{id:"muse",name:"Muse Code",env:[{name:"MUSE_RELEASE_INFO"}]},{id:"cline",name:"Cline",env:[{name:"CLINE_WRAPPER_PATH"}],process:[{pattern:/^cline$/i}]},{id:"kilocode",name:"Kilo Code",env:[{name:"KILO",value:"1"},{name:"KILOCODE_VERSION"},{name:"KILO_RUN_ID"}],process:[{pattern:/^(kilo|kilocode)$/i}],sessionEnv:["KILO_RUN_ID"]},{id:"copilot",name:"GitHub Copilot CLI",env:[{name:"COPILOT_CLI",value:"1"},{name:"COPILOT_AGENT_SESSION_ID"},{name:"COPILOT_RUN_APP",value:"1"}],process:[{pattern:/^(github-copilot-cli|copilot)$/i}],sessionEnv:["COPILOT_AGENT_SESSION_ID"]}]});import{platform as Ws,release as Bs}from"node:os";import{arch as Gs,env as zs,version as Zs}from"node:process";function mwD(D){TI=D}function hwD(){return TI}function Hj(D=zs){let $=Zj({env:D}),U={cli_version:N$.version,node_version:Zs,os_platform:Ws(),os_arch:Gs,os_release:Bs(),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone||"undefined",is_ci:p9.isCI,is_tty:Boolean(process.stdout.isTTY),invocation_source:TI,agent_invoker:$.detected};if($.detected&&$.agent)U.agent_identity=$.agent;if(p9.name)U.ci_provider=p9.name;return U}var p9,TI="cli";var Lj=u(()=>{Kj();H8();p9=g0(zJ(),1)});import{AsyncLocalStorage as Ks}from"node:async_hooks";function nwD(D,$){return Mj.run(D,()=>Promise.resolve($()))}function Hs(){return Mj.getStore()}function iwD(){wj=!0}function Oj(){return wj}function cwD(D){Vj=D}function Nj(D){try{Vj?.(D)}catch{}}function rwD(D,$){let U;try{U=new URL(D).pathname}catch{U=D.split("?")[0]}let Q="/functions/v1/",X=U.indexOf(Q);if(X>=0){let q=U.slice(X+Q.length),W=0,B=q.length;while(W<B&&q[W]==="/")W+=1;while(B>W&&q[B-1]==="/")B-=1;let G=q.slice(W,B);return G?`${$} functions:${G}`:`${$} functions`}let Y="/rest/v1/",F=U.indexOf(Y),J=F>=0?U.slice(F+Y.length):U.replace(/^\//,"");if(J.startsWith("rpc/"))return`rpc:${J.slice(4).split("/")[0]}`;let I=J.split("/")[0]||U;return`${$} ${I}`}function Ls(D){let $=D?.headers;if(!$)return;let U=$.get;if(typeof U==="function")return U.call($,"capgkey")??void 0;if(Array.isArray($))return $.find(([Q])=>Q.toLowerCase()==="capgkey")?.[1];return $.capgkey}function Rj(){return async($,U)=>{let Q=(U?.method??"GET").toUpperCase(),X=typeof $==="string"?$:$ instanceof URL?$.href:$.url,Y=Hs(),F=Ls(U),J=Date.now();try{let I=await globalThis.fetch($,U);return Nj({url:X,method:Q,status:I.status,ok:I.ok,durationMs:Date.now()-J,source:Y,apikey:F}),I}catch(I){throw Nj({url:X,method:Q,status:0,ok:!1,durationMs:Date.now()-J,source:Y,apikey:F,error:I}),I}}}var Mj,wj=!1,Vj,pwD=5000;var Aj=u(()=>{Mj=new Ks});function Ns(D,$){if(!J9(D)||!J9($))return!1;return B1(K$(D),K$($))}function Ms(D,$,U){let Q=U?.trim()?`
|
|
89
|
+
GFS4: `),console.error(D)};if(!cD[z0]){if(JI=global[z0]||[],PE(cD,JI),cD.close=function(D){function $(U,Q){return D.call(cD,U,function(X){if(!X)SE();if(typeof Q==="function")Q.apply(this,arguments)})}return Object.defineProperty($,wU,{value:D}),$}(cD.close),cD.closeSync=function(D){function $(U){D.apply(cD,arguments),SE()}return Object.defineProperty($,wU,{value:D}),$}(cD.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){S1(cD[z0]),s("assert").equal(cD[z0].length,0)})}var JI;if(!global[z0])PE(global,cD[z0]);WI.exports=II(na(cD));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!cD.__patched)WI.exports=II(cD),cD.__patched=!0;function II(D){da(D),D.gracefulify=II,D.createReadStream=j,D.createWriteStream=E;var $=D.readFile;D.readFile=U;function U(b,R,P){if(typeof R==="function")P=R,R=null;return h(b,R,P);function h(i,v,k,A){return $(i,v,function(w){if(w&&(w.code==="EMFILE"||w.code==="ENFILE"))W8([h,[i,v,k],w,A||Date.now(),Date.now()]);else if(typeof k==="function")k.apply(this,arguments)})}}var Q=D.writeFile;D.writeFile=X;function X(b,R,P,h){if(typeof P==="function")h=P,P=null;return i(b,R,P,h);function i(v,k,A,w,V){return Q(v,k,A,function(_){if(_&&(_.code==="EMFILE"||_.code==="ENFILE"))W8([i,[v,k,A,w],_,V||Date.now(),Date.now()]);else if(typeof w==="function")w.apply(this,arguments)})}}var Y=D.appendFile;if(Y)D.appendFile=F;function F(b,R,P,h){if(typeof P==="function")h=P,P=null;return i(b,R,P,h);function i(v,k,A,w,V){return Y(v,k,A,function(_){if(_&&(_.code==="EMFILE"||_.code==="ENFILE"))W8([i,[v,k,A,w],_,V||Date.now(),Date.now()]);else if(typeof w==="function")w.apply(this,arguments)})}}var J=D.copyFile;if(J)D.copyFile=I;function I(b,R,P,h){if(typeof P==="function")h=P,P=0;return i(b,R,P,h);function i(v,k,A,w,V){return J(v,k,A,function(_){if(_&&(_.code==="EMFILE"||_.code==="ENFILE"))W8([i,[v,k,A,w],_,V||Date.now(),Date.now()]);else if(typeof w==="function")w.apply(this,arguments)})}}var q=D.readdir;D.readdir=B;var W=/^v[0-5]\./;function B(b,R,P){if(typeof R==="function")P=R,R=null;var h=W.test(process.version)?function(k,A,w,V){return q(k,i(k,A,w,V))}:function(k,A,w,V){return q(k,A,i(k,A,w,V))};return h(b,R,P);function i(v,k,A,w){return function(V,_){if(V&&(V.code==="EMFILE"||V.code==="ENFILE"))W8([h,[v,k,A],V,w||Date.now(),Date.now()]);else{if(_&&_.sort)_.sort();if(typeof A==="function")A.call(this,V,_)}}}}if(process.version.substr(0,4)==="v0.8"){var G=la(D);M=G.ReadStream,L=G.WriteStream}var Z=D.ReadStream;if(Z)M.prototype=Object.create(Z.prototype),M.prototype.open=N;var z=D.WriteStream;if(z)L.prototype=Object.create(z.prototype),L.prototype.open=O;Object.defineProperty(D,"ReadStream",{get:function(){return M},set:function(b){M=b},enumerable:!0,configurable:!0}),Object.defineProperty(D,"WriteStream",{get:function(){return L},set:function(b){L=b},enumerable:!0,configurable:!0});var K=M;Object.defineProperty(D,"FileReadStream",{get:function(){return K},set:function(b){K=b},enumerable:!0,configurable:!0});var H=L;Object.defineProperty(D,"FileWriteStream",{get:function(){return H},set:function(b){H=b},enumerable:!0,configurable:!0});function M(b,R){if(this instanceof M)return Z.apply(this,arguments),this;else return M.apply(Object.create(M.prototype),arguments)}function N(){var b=this;S(b.path,b.flags,b.mode,function(R,P){if(R){if(b.autoClose)b.destroy();b.emit("error",R)}else b.fd=P,b.emit("open",P),b.read()})}function L(b,R){if(this instanceof L)return z.apply(this,arguments),this;else return L.apply(Object.create(L.prototype),arguments)}function O(){var b=this;S(b.path,b.flags,b.mode,function(R,P){if(R)b.destroy(),b.emit("error",R);else b.fd=P,b.emit("open",P)})}function j(b,R){return new D.ReadStream(b,R)}function E(b,R){return new D.WriteStream(b,R)}var C=D.open;D.open=S;function S(b,R,P,h){if(typeof P==="function")h=P,P=null;return i(b,R,P,h);function i(v,k,A,w,V){return C(v,k,A,function(_,m){if(_&&(_.code==="EMFILE"||_.code==="ENFILE"))W8([i,[v,k,A,w],_,V||Date.now(),Date.now()]);else if(typeof w==="function")w.apply(this,arguments)})}}return D}function W8(D){S1("ENQUEUE",D[0].name,D[1]),cD[z0].push(D),qI()}var MU;function SE(){var D=Date.now();for(var $=0;$<cD[z0].length;++$)if(cD[z0][$].length>2)cD[z0][$][3]=D,cD[z0][$][4]=D;qI()}function qI(){if(clearTimeout(MU),MU=void 0,cD[z0].length===0)return;var D=cD[z0].shift(),$=D[0],U=D[1],Q=D[2],X=D[3],Y=D[4];if(X===void 0)S1("RETRY",$.name,U),$.apply(null,U);else if(Date.now()-X>=60000){S1("TIMEOUT",$.name,U);var F=U.pop();if(typeof F==="function")F.call(null,Q)}else{var J=Date.now()-Y,I=Math.max(Y-X,1),q=Math.min(I*1.2,100);if(J>=q)S1("RETRY",$.name,U),$.apply(null,U.concat([X]));else cD[z0].push(D)}if(MU===void 0)MU=setTimeout(qI,0)}});var bE=T((WwD,CE)=>{function F$(D,$){if(typeof $==="boolean")$={forever:$};if(this._originalTimeouts=JSON.parse(JSON.stringify(D)),this._timeouts=D,this._options=$||{},this._maxRetryTime=$&&$.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever)this._cachedTimeouts=this._timeouts.slice(0)}CE.exports=F$;F$.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};F$.prototype.stop=function(){if(this._timeout)clearTimeout(this._timeout);this._timeouts=[],this._cachedTimeouts=null};F$.prototype.retry=function(D){if(this._timeout)clearTimeout(this._timeout);if(!D)return!1;var $=new Date().getTime();if(D&&$-this._operationStart>=this._maxRetryTime)return this._errors.unshift(Error("RetryOperation timeout occurred")),!1;this._errors.push(D);var U=this._timeouts.shift();if(U===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),U=this._timeouts.shift();else return!1;var Q=this,X=setTimeout(function(){if(Q._attempts++,Q._operationTimeoutCb){if(Q._timeout=setTimeout(function(){Q._operationTimeoutCb(Q._attempts)},Q._operationTimeout),Q._options.unref)Q._timeout.unref()}Q._fn(Q._attempts)},U);if(this._options.unref)X.unref();return!0};F$.prototype.attempt=function(D,$){if(this._fn=D,$){if($.timeout)this._operationTimeout=$.timeout;if($.cb)this._operationTimeoutCb=$.cb}var U=this;if(this._operationTimeoutCb)this._timeout=setTimeout(function(){U._operationTimeoutCb()},U._operationTimeout);this._operationStart=new Date().getTime(),this._fn(this._attempts)};F$.prototype.try=function(D){console.log("Using RetryOperation.try() is deprecated"),this.attempt(D)};F$.prototype.start=function(D){console.log("Using RetryOperation.start() is deprecated"),this.attempt(D)};F$.prototype.start=F$.prototype.try;F$.prototype.errors=function(){return this._errors};F$.prototype.attempts=function(){return this._attempts};F$.prototype.mainError=function(){if(this._errors.length===0)return null;var D={},$=null,U=0;for(var Q=0;Q<this._errors.length;Q++){var X=this._errors[Q],Y=X.message,F=(D[Y]||0)+1;if(D[Y]=F,F>=U)$=X,U=F}return $}});var _E=T((pa)=>{var ca=bE();pa.operation=function(D){var $=pa.timeouts(D);return new ca($,{forever:D&&D.forever,unref:D&&D.unref,maxRetryTime:D&&D.maxRetryTime})};pa.timeouts=function(D){if(D instanceof Array)return[].concat(D);var $={retries:10,factor:2,minTimeout:1000,maxTimeout:1/0,randomize:!1};for(var U in D)$[U]=D[U];if($.minTimeout>$.maxTimeout)throw Error("minTimeout is greater than maxTimeout");var Q=[];for(var X=0;X<$.retries;X++)Q.push(this.createTimeout(X,$));if(D&&D.forever&&!Q.length)Q.push(this.createTimeout(X,$));return Q.sort(function(Y,F){return Y-F}),Q};pa.createTimeout=function(D,$){var U=$.randomize?Math.random()+1:1,Q=Math.round(U*$.minTimeout*Math.pow($.factor,D));return Q=Math.min(Q,$.maxTimeout),Q};pa.wrap=function(D,$,U){if($ instanceof Array)U=$,$=null;if(!U){U=[];for(var Q in D)if(typeof D[Q]==="function")U.push(Q)}for(var X=0;X<U.length;X++){var Y=U[X],F=D[Y];D[Y]=function(I){var q=pa.operation($),W=Array.prototype.slice.call(arguments,1),B=W.pop();W.push(function(G){if(q.retry(G))return;if(G)arguments[0]=q.mainError();B.apply(this,arguments)}),q.attempt(function(){I.apply(D,W)})}.bind(D,F),D[Y].options=$}}});var kE=T((GwD,OU)=>{OU.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32")OU.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")OU.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var KI=T((zwD,G8)=>{var dD=global.process,P1=function(D){return D&&typeof D==="object"&&typeof D.removeListener==="function"&&typeof D.emit==="function"&&typeof D.reallyExit==="function"&&typeof D.listeners==="function"&&typeof D.kill==="function"&&typeof D.pid==="number"&&typeof D.on==="function"};if(!P1(dD))G8.exports=function(){return function(){}};else{if(BI=s("assert"),C1=kE(),GI=/^win/i.test(dD.platform),B8=s("events"),typeof B8!=="function")B8=B8.EventEmitter;if(dD.__signal_exit_emitter__)Q0=dD.__signal_exit_emitter__;else Q0=dD.__signal_exit_emitter__=new B8,Q0.count=0,Q0.emitted={};if(!Q0.infinite)Q0.setMaxListeners(1/0),Q0.infinite=!0;G8.exports=function(D,$){if(!P1(global.process))return function(){};if(BI.equal(typeof D,"function","a callback must be provided for exit handler"),b1===!1)VU();var U="exit";if($&&$.alwaysLast)U="afterexit";var Q=function(){if(Q0.removeListener(U,D),Q0.listeners("exit").length===0&&Q0.listeners("afterexit").length===0)h9()};return Q0.on(U,D),Q},h9=function(){if(!b1||!P1(global.process))return;b1=!1,C1.forEach(function($){try{dD.removeListener($,d9[$])}catch(U){}}),dD.emit=l9,dD.reallyExit=RU,Q0.count-=1},G8.exports.unload=h9,A6=function($,U,Q){if(Q0.emitted[$])return;Q0.emitted[$]=!0,Q0.emit($,U,Q)},d9={},C1.forEach(function(D){d9[D]=function(){if(!P1(global.process))return;var U=dD.listeners(D);if(U.length===Q0.count){if(h9(),A6("exit",null,D),A6("afterexit",null,D),GI&&D==="SIGHUP")D="SIGINT";dD.kill(dD.pid,D)}}}),G8.exports.signals=function(){return C1},b1=!1,VU=function(){if(b1||!P1(global.process))return;b1=!0,Q0.count+=1,C1=C1.filter(function($){try{return dD.on($,d9[$]),!0}catch(U){return!1}}),dD.emit=ZI,dD.reallyExit=zI},G8.exports.load=VU,RU=dD.reallyExit,zI=function($){if(!P1(global.process))return;dD.exitCode=$||0,A6("exit",dD.exitCode,null),A6("afterexit",dD.exitCode,null),RU.call(dD,dD.exitCode)},l9=dD.emit,ZI=function($,U){if($==="exit"&&P1(global.process)){if(U!==void 0)dD.exitCode=U;var Q=l9.apply(this,arguments);return A6("exit",dD.exitCode,null),A6("afterexit",dD.exitCode,null),Q}else return l9.apply(this,arguments)}}var BI,C1,GI,B8,Q0,h9,A6,d9,b1,VU,RU,zI,l9,ZI});var gE=T((ea,HI)=>{var xE=Symbol();function ta(D,$,U){let Q=$[xE];if(Q)return $.stat(D,(Y,F)=>{if(Y)return U(Y);U(null,F.mtime,Q)});let X=new Date(Math.ceil(Date.now()/1000)*1000+5);$.utimes(D,X,X,(Y)=>{if(Y)return U(Y);$.stat(D,(F,J)=>{if(F)return U(F);let I=J.mtime.getTime()%1000===0?"s":"ms";Object.defineProperty($,xE,{value:I}),U(null,J.mtime,I)})})}function sa(D){let $=Date.now();if(D==="s")$=Math.ceil($/1000)*1000;return new Date($)}ea.probe=ta;ea.getMtime=sa});var hE=T((It,i9)=>{var Ut=s("path"),MI=R6(),Xt=_E(),Qt=KI(),uE=gE(),e$={};function n9(D,$){return $.lockfilePath||`${D}.lock`}function wI(D,$,U){if(!$.realpath)return U(null,Ut.resolve(D));$.fs.realpath(D,U)}function NI(D,$,U){let Q=n9(D,$);$.fs.mkdir(Q,(X)=>{if(!X)return uE.probe(Q,$.fs,(Y,F,J)=>{if(Y)return $.fs.rmdir(Q,()=>{}),U(Y);U(null,F,J)});if(X.code!=="EEXIST")return U(X);if($.stale<=0)return U(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));$.fs.stat(Q,(Y,F)=>{if(Y){if(Y.code==="ENOENT")return NI(D,{...$,stale:0},U);return U(Y)}if(!fE(F,$))return U(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));yE(D,$,(J)=>{if(J)return U(J);NI(D,{...$,stale:0},U)})})})}function fE(D,$){return D.mtime.getTime()<Date.now()-$.stale}function yE(D,$,U){$.fs.rmdir(n9(D,$),(Q)=>{if(Q&&Q.code!=="ENOENT")return U(Q);U()})}function AU(D,$){let U=e$[D];if(U.updateTimeout)return;if(U.updateDelay=U.updateDelay||$.update,U.updateTimeout=setTimeout(()=>{U.updateTimeout=null,$.fs.stat(U.lockfilePath,(Q,X)=>{let Y=U.lastUpdate+$.stale<Date.now();if(Q){if(Q.code==="ENOENT"||Y)return LI(D,U,Object.assign(Q,{code:"ECOMPROMISED"}));return U.updateDelay=1000,AU(D,$)}if(U.mtime.getTime()!==X.mtime.getTime())return LI(D,U,Object.assign(Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let J=uE.getMtime(U.mtimePrecision);$.fs.utimes(U.lockfilePath,J,J,(I)=>{let q=U.lastUpdate+$.stale<Date.now();if(U.released)return;if(I){if(I.code==="ENOENT"||q)return LI(D,U,Object.assign(I,{code:"ECOMPROMISED"}));return U.updateDelay=1000,AU(D,$)}U.mtime=J,U.lastUpdate=Date.now(),U.updateDelay=null,AU(D,$)})})},U.updateDelay),U.updateTimeout.unref)U.updateTimeout.unref()}function LI(D,$,U){if($.released=!0,$.updateTimeout)clearTimeout($.updateTimeout);if(e$[D]===$)delete e$[D];$.options.onCompromised(U)}function Yt(D,$,U){$={stale:1e4,update:null,realpath:!0,retries:0,fs:MI,onCompromised:(Q)=>{throw Q},...$},$.retries=$.retries||0,$.retries=typeof $.retries==="number"?{retries:$.retries}:$.retries,$.stale=Math.max($.stale||0,2000),$.update=$.update==null?$.stale/2:$.update||0,$.update=Math.max(Math.min($.update,$.stale/2),1000),wI(D,$,(Q,X)=>{if(Q)return U(Q);let Y=Xt.operation($.retries);Y.attempt(()=>{NI(X,$,(F,J,I)=>{if(Y.retry(F))return;if(F)return U(Y.mainError());let q=e$[X]={lockfilePath:n9(X,$),mtime:J,mtimePrecision:I,options:$,lastUpdate:Date.now()};AU(X,$),U(null,(W)=>{if(q.released)return W&&W(Object.assign(Error("Lock is already released"),{code:"ERELEASED"}));mE(X,{...$,realpath:!1},W)})})})})}function mE(D,$,U){$={fs:MI,realpath:!0,...$},wI(D,$,(Q,X)=>{if(Q)return U(Q);let Y=e$[X];if(!Y)return U(Object.assign(Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));Y.updateTimeout&&clearTimeout(Y.updateTimeout),Y.released=!0,delete e$[X],yE(X,$,U)})}function Ft(D,$,U){$={stale:1e4,realpath:!0,fs:MI,...$},$.stale=Math.max($.stale||0,2000),wI(D,$,(Q,X)=>{if(Q)return U(Q);$.fs.stat(n9(X,$),(Y,F)=>{if(Y)return Y.code==="ENOENT"?U(null,!1):U(Y);return U(null,!fE(F,$))})})}function Jt(){return e$}Qt(()=>{for(let D in e$){let $=e$[D].options;try{$.fs.rmdirSync(n9(D,$))}catch(U){}}});It.lock=Yt;It.unlock=mE;It.check=Ft;It.getLocks=Jt});var lE=T((ZwD,dE)=>{var zt=R6();function Zt(D){let $=["mkdir","realpath","stat","rmdir","utimes"],U={...D};return $.forEach((Q)=>{U[Q]=(...X)=>{let Y=X.pop(),F;try{F=D[`${Q}Sync`](...X)}catch(J){return Y(J)}Y(null,F)}}),U}function Kt(D){return(...$)=>new Promise((U,Q)=>{$.push((X,Y)=>{if(X)Q(X);else U(Y)}),D(...$)})}function Ht(D){return(...$)=>{let U,Q;if($.push((X,Y)=>{U=X,Q=Y}),D(...$),U)throw U;return Q}}function Lt(D){if(D={...D},D.fs=Zt(D.fs||zt),typeof D.retries==="number"&&D.retries>0||D.retries&&typeof D.retries.retries==="number"&&D.retries.retries>0)throw Object.assign(Error("Cannot use retries with the sync api"),{code:"ESYNC"});return D}dE.exports={toPromise:Kt,toSync:Ht,toSyncOptions:Lt}});var iE=T((KwD,E6)=>{var z8=hE(),{toPromise:EU,toSync:jU,toSyncOptions:OI}=lE();async function nE(D,$){let U=await EU(z8.lock)(D,$);return EU(U)}function Nt(D,$){let U=jU(z8.lock)(D,OI($));return jU(U)}function Mt(D,$){return EU(z8.unlock)(D,$)}function wt(D,$){return jU(z8.unlock)(D,OI($))}function Ot(D,$){return EU(z8.check)(D,$)}function Vt(D,$){return jU(z8.check)(D,OI($))}E6.exports=nE;E6.exports.lock=nE;E6.exports.unlock=Mt;E6.exports.lockSync=Nt;E6.exports.unlockSync=wt;E6.exports.check=Ot;E6.exports.checkSync=Vt});var sE=T((aE)=>{Object.defineProperty(aE,"__esModule",{value:!0});aE.canStoreURLs=aE.FileUrlStorage=void 0;var cE=s("fs"),Rt=Et(wE()),pE=At(iE());function oE(D){if(typeof WeakMap!="function")return null;var $=new WeakMap,U=new WeakMap;return(oE=function(Q){return Q?U:$})(D)}function At(D,$){if(!$&&D&&D.__esModule)return D;if(D===null||typeof D!="object"&&typeof D!="function")return{default:D};var U=oE($);if(U&&U.has(D))return U.get(D);var Q={__proto__:null},X=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Y in D)if(Y!=="default"&&{}.hasOwnProperty.call(D,Y)){var F=X?Object.getOwnPropertyDescriptor(D,Y):null;F&&(F.get||F.set)?Object.defineProperty(Q,Y,F):Q[Y]=D[Y]}return Q.default=D,U&&U.set(D,Q),Q}function Et(D){return D&&D.__esModule?D:{default:D}}function c9(D){return c9=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},c9(D)}function jt(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function rE(D,$){for(var U=0;U<$.length;U++){var Q=$[U];if(Q.enumerable=Q.enumerable||!1,Q.configurable=!0,"value"in Q)Q.writable=!0;Object.defineProperty(D,St(Q.key),Q)}}function Tt(D,$,U){if($)rE(D.prototype,$);if(U)rE(D,U);return Object.defineProperty(D,"prototype",{writable:!1}),D}function St(D){var $=Pt(D,"string");return c9($)=="symbol"?$:$+""}function Pt(D,$){if(c9(D)!="object"||!D)return D;var U=D[Symbol.toPrimitive];if(U!==void 0){var Q=U.call(D,$||"default");if(c9(Q)!="object")return Q;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var HwD=aE.canStoreURLs=!0,LwD=aE.FileUrlStorage=function(){function D($){jt(this,D),this.path=$}return Tt(D,[{key:"findAllUploads",value:function(){var U=this;return new Promise(function(Q,X){U._getItems("tus::",function(Y,F){if(Y)X(Y);else Q(F)})})}},{key:"findUploadsByFingerprint",value:function(U){var Q=this;return new Promise(function(X,Y){Q._getItems("tus::".concat(U),function(F,J){if(F)Y(F);else X(J)})})}},{key:"removeUpload",value:function(U){var Q=this;return new Promise(function(X,Y){Q._removeItem(U,function(F){if(F)Y(F);else X()})})}},{key:"addUpload",value:function(U,Q){var X=this,Y=Math.round(Math.random()*1000000000000),F="tus::".concat(U,"::").concat(Y);return new Promise(function(J,I){X._setItem(F,Q,function(q){if(q)I(q);else J(F)})})}},{key:"_setItem",value:function(U,Q,X){var Y=this;pE.lock(this.path,this._lockfileOptions()).then(function(F){X=Y._releaseAndCb(F,X),Y._getData(function(J,I){if(J){X(J);return}I[U]=Q,Y._writeData(I,function(q){return X(q)})})}).catch(X)}},{key:"_getItems",value:function(U,Q){this._getData(function(X,Y){if(X){Q(X);return}var F=Object.keys(Y).filter(function(J){return J.startsWith(U)}).map(function(J){var I=Y[J];return I.urlStorageKey=J,I});Q(null,F)})}},{key:"_removeItem",value:function(U,Q){var X=this;pE.lock(this.path,this._lockfileOptions()).then(function(Y){Q=X._releaseAndCb(Y,Q),X._getData(function(F,J){if(F){Q(F);return}delete J[U],X._writeData(J,function(I){return Q(I)})})}).catch(Q)}},{key:"_lockfileOptions",value:function(){return{realpath:!1,retries:{retries:5,minTimeout:20}}}},{key:"_releaseAndCb",value:function(U,Q){return function(X){if(X){U().then(function(){return Q(X)}).catch(function(Y){return Q((0,Rt.default)([X,Y]))});return}U().then(Q).catch(Q)}}},{key:"_writeData",value:function(U,Q){var X={encoding:"utf8",mode:432,flag:"w"};(0,cE.writeFile)(this.path,JSON.stringify(U),X,function(Y){return Q(Y)})}},{key:"_getData",value:function(U){(0,cE.readFile)(this.path,"utf8",function(Q,X){if(Q){if(Q.code==="ENOENT")U(null,{});else U(Q);return}try{X=!X.trim().length?{}:JSON.parse(X)}catch(Y){U(Y);return}U(null,X)})}}])}()});var qj=T((j6)=>{Object.defineProperty(j6,"__esModule",{value:!0});Object.defineProperty(j6,"DefaultHttpStack",{enumerable:!0,get:function(){return Uj.default}});Object.defineProperty(j6,"DetailedError",{enumerable:!0,get:function(){return bt.default}});Object.defineProperty(j6,"FileUrlStorage",{enumerable:!0,get:function(){return Xj.FileUrlStorage}});Object.defineProperty(j6,"StreamSource",{enumerable:!0,get:function(){return gt.default}});j6.Upload=void 0;Object.defineProperty(j6,"canStoreURLs",{enumerable:!0,get:function(){return Xj.canStoreURLs}});j6.defaultOptions=void 0;Object.defineProperty(j6,"enableDebugLog",{enumerable:!0,get:function(){return vt.enableDebugLog}});j6.isSupported=void 0;var bt=v1(wJ()),vt=OJ(),_t=v1(iV()),VI=v1(AR()),kt=v1(nR()),xt=v1(oR()),Uj=v1(BA()),gt=v1(vJ()),Xj=sE();function v1(D){return D&&D.__esModule?D:{default:D}}function K8(D){return K8=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},K8(D)}function ut(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function eE(D,$){for(var U=0;U<$.length;U++){var Q=$[U];if(Q.enumerable=Q.enumerable||!1,Q.configurable=!0,"value"in Q)Q.writable=!0;Object.defineProperty(D,Yj(Q.key),Q)}}function ft(D,$,U){if($)eE(D.prototype,$);if(U)eE(D,U);return Object.defineProperty(D,"prototype",{writable:!1}),D}function yt(D,$,U){return $=TU($),mt(D,Qj()?Reflect.construct($,U||[],TU(D).constructor):$.apply(D,U))}function mt(D,$){if($&&(K8($)==="object"||typeof $==="function"))return $;else if($!==void 0)throw TypeError("Derived constructors may only return object or undefined");return ht(D)}function ht(D){if(D===void 0)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function Qj(){try{var D=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch($){}return(Qj=function(){return!!D})()}function TU(D){return TU=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(U){return U.__proto__||Object.getPrototypeOf(U)},TU(D)}function dt(D,$){if(typeof $!=="function"&&$!==null)throw TypeError("Super expression must either be null or a function");if(D.prototype=Object.create($&&$.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),Object.defineProperty(D,"prototype",{writable:!1}),$)RI(D,$)}function RI(D,$){return RI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Q,X){return Q.__proto__=X,Q},RI(D,$)}function Dj(D,$){var U=Object.keys(D);if(Object.getOwnPropertySymbols){var Q=Object.getOwnPropertySymbols(D);$&&(Q=Q.filter(function(X){return Object.getOwnPropertyDescriptor(D,X).enumerable})),U.push.apply(U,Q)}return U}function Z8(D){for(var $=1;$<arguments.length;$++){var U=arguments[$]!=null?arguments[$]:{};$%2?Dj(Object(U),!0).forEach(function(Q){lt(D,Q,U[Q])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(U)):Dj(Object(U)).forEach(function(Q){Object.defineProperty(D,Q,Object.getOwnPropertyDescriptor(U,Q))})}return D}function lt(D,$,U){if($=Yj($),$ in D)Object.defineProperty(D,$,{value:U,enumerable:!0,configurable:!0,writable:!0});else D[$]=U;return D}function Yj(D){var $=nt(D,"string");return K8($)=="symbol"?$:$+""}function nt(D,$){if(K8(D)!="object"||!D)return D;var U=D[Symbol.toPrimitive];if(U!==void 0){var Q=U.call(D,$||"default");if(K8(Q)!="object")return Q;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var $j=j6.defaultOptions=Z8(Z8({},VI.default.defaultOptions),{},{httpStack:new Uj.default,fileReader:new kt.default,urlStorage:new _t.default,fingerprint:xt.default}),MwD=j6.Upload=function(D){function $(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return ut(this,$),Q=Z8(Z8({},$j),Q),yt(this,$,[U,Q])}return dt($,D),ft($,null,[{key:"terminate",value:function(Q){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return X=Z8(Z8({},$j),X),VI.default.terminate(Q,X)}}])}(VI.default),wwD=j6.isSupported=!0});var N$;var H8=u(()=>{N$={name:"@capgo/cli",type:"module",version:"8.89.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 && bun test/test-builder-only-checklist.mjs && bun test/test-builder-only-setup.mjs && bun test/test-app-todo-lists.mjs && bun test/test-app-todo-tabs.mjs && bun test/test-app-todo-command.mjs && node test/test-app-todo-interactive.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 && bun test/test-build-env.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:settings-parity && 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:settings-parity":"bun test/test-settings-parity.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"}}});var AD;var _1=u(()=>{AD=class AD extends Error{context;constructor(D,$,U){super(D,U!==void 0?{cause:U}:void 0);this.name="CliUserError",this.context=$}}});import{platform as ct}from"node:os";import{version as pt}from"node:process";function SwD(D){Bj=D}function ot(D){for(let $=0;$<D.length;$++)if(D.charCodeAt($)>255)return!1;return!0}function Wj(D){if(D.toLowerCase()==="x-capgo-log-token")return"Build log token is missing. Re-run the build command or pass a valid log token.";return"Capgo API key is missing. Run `npx -y @capgo/cli@latest login` or pass `--apikey`."}function at(D){if(D.toLowerCase()==="x-capgo-log-token")return"Build log token contains invalid characters (only ASCII is allowed). Re-run the build command to get a fresh token.";if(D.toLowerCase()==="authorization")return"Authorization header contains invalid characters (only ASCII is allowed). Check your Capgo API key or Supabase anon key configuration.";return"Capgo API key contains invalid characters (only ASCII is allowed). Copy the key from the Capgo dashboard."}function EI(D,$){if($===void 0||$===null){if(AI.has(D.toLowerCase()))throw new AD(Wj(D));throw new AD(`HTTP header "${D}" is missing or invalid.`)}if(typeof $!=="string"){if(AI.has(D.toLowerCase()))throw new AD(Wj(D));throw new AD(`HTTP header "${D}" is missing or invalid.`)}if(!ot($)){if(AI.has(D.toLowerCase()))throw new AD(at(D));throw new AD(`HTTP header "${D}" contains invalid characters (only ASCII is allowed).`)}return $}function T6(D){let $={capgo_api:rt,"x-cli-version":N$.version,"x-cli-command":Bj,"x-cli-node":pt,"x-cli-os":ct()};if(D)for(let[U,Q]of Object.entries(D))$[U]=EI(U,Q);return $}var rt="2025-10-01",Bj="",AI;var jI=u(()=>{H8();_1();AI=new Set(["authorization","capgkey","x-capgo-log-token"])});import{execFileSync as $s}from"child_process";import Us from"path";function et(D,$){if($===void 0)return!0;if(typeof $==="string")return D===$;if($ instanceof RegExp)return $.test(D);return $(D)}function Ds(D,$,U){return{agent:{id:D.id,name:D.name},strategy:"environment",signal:$.name,value:U}}function Ys(D,$){let U=[],Q=zj($.command);for(let X of D)for(let Y of X.process??[]){if(!Y.pattern.test(Q))continue;U.push(Fs(X,Y,{...$,command:Q}))}return U}function Fs(D,$,U){return{agent:{id:D.id,name:D.name},strategy:"process-tree",signal:$.pattern.toString(),value:`${U.pid}:${U.command}`}}function Gj(D,$){try{return $s("ps",["-o",`${$}=`,"-p",String(D)],{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return""}}function zj(D){return Us.basename(D.trim()).replace(/^-+/,"")}function Zj(D={}){let $=D.agents??tt,U=D.strategies??Js(D.experimentalProcessTree),Q={env:D.env??process.env,pid:D.pid??process.pid,agents:$,maxProcessDepth:D.maxProcessDepth??20},X=U.flatMap((F)=>F.detect(Q)),Y=Is($,X,Q.env);if(Y===void 0)return{detected:!1};return{detected:!0,agent:Y}}function Js(D=!1){let $=[new st];if(D)$.push(new Qs);return $}function Is(D,$,U){let Q=new Set($.map((X)=>X.agent.id));for(let X of D){if(!Q.has(X.id))continue;return{id:X.id,name:X.name,...qs(X,U)}}return}function qs(D,$){for(let U of D.sessionEnv??[]){let Q=$[U];if(Q!==void 0&&Q.length>0)return{sessionId:Q}}return{}}var tt,st=class{name="environment";detect(D){let $=[];for(let U of D.agents)for(let Q of U.env??[]){let X=D.env[Q.name];if(X===void 0||!et(X,Q.value))continue;$.push(Ds(U,Q,X))}return $}},Xs=class{read(D){let $=Gj(D,"comm"),U=Number.parseInt(Gj(D,"ppid"),10);if(!$||!Number.isInteger(U))return;return{pid:D,ppid:U,command:zj($)}}},Qs=class{constructor(D=new Xs){this.reader=D}reader;name="process-tree";detect(D){let $=[],U=D.pid;for(let Q=0;Q<D.maxProcessDepth;Q+=1){let X=this.reader.read(U);if(X===void 0)break;if($.push(...Ys(D.agents,X)),X.ppid===void 0||X.ppid<=1||X.ppid===U)break;U=X.ppid}return $}};var Kj=u(()=>{tt=[{id:"codex",name:"Codex",env:[{name:"CODEX_CI",value:"1"},{name:"CODEX_SHELL",value:"1"},{name:"CODEX_THREAD_ID"}],process:[{pattern:/^codex$/i}],sessionEnv:["CODEX_THREAD_ID"]},{id:"cursor",name:"Cursor",env:[{name:"CURSOR_AGENT",value:"1"},{name:"CURSOR_CONVERSATION_ID"}],process:[{pattern:/^cursor$/i}],sessionEnv:["CURSOR_CONVERSATION_ID"]},{id:"claude-code",name:"Claude Code",env:[{name:"CLAUDECODE",value:"1"},{name:"CLAUDE_CODE_SESSION_ID"}],process:[{pattern:/^claude$/i}],sessionEnv:["CLAUDE_CODE_SESSION_ID"]},{id:"opencode",name:"OpenCode",env:[{name:"OPENCODE",value:"1"},{name:"OPENCODE_PID"}],process:[{pattern:/^opencode$/i}]},{id:"devin",name:"Devin",process:[{pattern:/devin/i}]},{id:"gemini",name:"Gemini CLI",env:[{name:"GEMINI_CLI",value:"1"}],process:[{pattern:/^gemini$/i}]},{id:"antigravity",name:"Antigravity",env:[{name:"ANTIGRAVITY_AGENT",value:"1"},{name:"ANTIGRAVITY_TRAJECTORY_ID"}],process:[{pattern:/^antigravity$/i}],sessionEnv:["ANTIGRAVITY_TRAJECTORY_ID"]},{id:"bolt",name:"Bolt",env:[{name:"BOLT_ENV"},{name:"BOLT_ORIGIN"},{name:"BOLT_SERVER_URL"}]},{id:"pi",name:"Pi",env:[{name:"PI_CODING_AGENT",value:"true"}]},{id:"replit",name:"Replit",env:[{name:"REPLIT_SESSION"}],sessionEnv:["REPLIT_SESSION"]},{id:"rork",name:"Rork",env:[{name:"RORK_API_URL"}]},{id:"kiro",name:"Kiro",env:[{name:"KIRO_SESSION_ID"}],process:[{pattern:/kiro/i}],sessionEnv:["KIRO_SESSION_ID"]},{id:"muse",name:"Muse Code",env:[{name:"MUSE_RELEASE_INFO"}]},{id:"cline",name:"Cline",env:[{name:"CLINE_WRAPPER_PATH"}],process:[{pattern:/^cline$/i}]},{id:"kilocode",name:"Kilo Code",env:[{name:"KILO",value:"1"},{name:"KILOCODE_VERSION"},{name:"KILO_RUN_ID"}],process:[{pattern:/^(kilo|kilocode)$/i}],sessionEnv:["KILO_RUN_ID"]},{id:"copilot",name:"GitHub Copilot CLI",env:[{name:"COPILOT_CLI",value:"1"},{name:"COPILOT_AGENT_SESSION_ID"},{name:"COPILOT_RUN_APP",value:"1"}],process:[{pattern:/^(github-copilot-cli|copilot)$/i}],sessionEnv:["COPILOT_AGENT_SESSION_ID"]}]});import{platform as Ws,release as Bs}from"node:os";import{arch as Gs,env as zs,version as Zs}from"node:process";function mwD(D){TI=D}function hwD(){return TI}function Hj(D=zs){let $=Zj({env:D}),U={cli_version:N$.version,node_version:Zs,os_platform:Ws(),os_arch:Gs,os_release:Bs(),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone||"undefined",is_ci:p9.isCI,is_tty:Boolean(process.stdout.isTTY),invocation_source:TI,agent_invoker:$.detected};if($.detected&&$.agent)U.agent_identity=$.agent;if(p9.name)U.ci_provider=p9.name;return U}var p9,TI="cli";var Lj=u(()=>{Kj();H8();p9=g0(zJ(),1)});import{AsyncLocalStorage as Ks}from"node:async_hooks";function nwD(D,$){return Mj.run(D,()=>Promise.resolve($()))}function Hs(){return Mj.getStore()}function iwD(){wj=!0}function Oj(){return wj}function cwD(D){Vj=D}function Nj(D){try{Vj?.(D)}catch{}}function rwD(D,$){let U;try{U=new URL(D).pathname}catch{U=D.split("?")[0]}let Q="/functions/v1/",X=U.indexOf(Q);if(X>=0){let q=U.slice(X+Q.length),W=0,B=q.length;while(W<B&&q[W]==="/")W+=1;while(B>W&&q[B-1]==="/")B-=1;let G=q.slice(W,B);return G?`${$} functions:${G}`:`${$} functions`}let Y="/rest/v1/",F=U.indexOf(Y),J=F>=0?U.slice(F+Y.length):U.replace(/^\//,"");if(J.startsWith("rpc/"))return`rpc:${J.slice(4).split("/")[0]}`;let I=J.split("/")[0]||U;return`${$} ${I}`}function Ls(D){let $=D?.headers;if(!$)return;let U=$.get;if(typeof U==="function")return U.call($,"capgkey")??void 0;if(Array.isArray($))return $.find(([Q])=>Q.toLowerCase()==="capgkey")?.[1];return $.capgkey}function Rj(){return async($,U)=>{let Q=(U?.method??"GET").toUpperCase(),X=typeof $==="string"?$:$ instanceof URL?$.href:$.url,Y=Hs(),F=Ls(U),J=Date.now();try{let I=await globalThis.fetch($,U);return Nj({url:X,method:Q,status:I.status,ok:I.ok,durationMs:Date.now()-J,source:Y,apikey:F}),I}catch(I){throw Nj({url:X,method:Q,status:0,ok:!1,durationMs:Date.now()-J,source:Y,apikey:F,error:I}),I}}}var Mj,wj=!1,Vj,pwD=5000;var Aj=u(()=>{Mj=new Ks});function Ns(D,$){if(!J9(D)||!J9($))return!1;return B1(K$(D),K$($))}function Ms(D,$,U){let Q=U?.trim()?`
|
|
90
90
|
${U.trim()}`:"";return`This Capgo API requires @capgo/cli@${$} or newer. You are using @capgo/cli@${D}.${Q}
|
|
91
91
|
Please update: npx @capgo/cli@latest`}function Ej(D,$,U=!1){let Q=$||N$.version,X=D.minCliVersion?.trim();if(!X||!Ns(Q,X))return;let Y=Ms(Q,X,D.minCliVersionReason);if(!U)SD.error(Y);throw new AD(Y,{minCliVersion:X,currentVersion:Q})}var jj=u(()=>{L6();aF();H8();_1()});function Tj(D,$){let Q=["normal","bold","dim","italic","underline","strikethrough"].indexOf(D),X="\x1B[";return"\x1B["+Q+"m"+$+"\x1B[0m"}var r9;var Sj=u(()=>{r9=class r9{title=null;headers=[];rows=[];static narrowTheme={top:["╔","═","╤","╗"],row:["║"," ","│","║"],div:["╟","─","┼","╢"],bot:["╚","═","╧","╝"]};static wideTheme={top:["╔═","═","═╤═","═╗"],row:["║ "," "," │ "," ║"],div:["╟─","─","─┼─","─╢"],bot:["╚═","═","═╧═","═╝"]};static roundTheme={top:["╭─","─","─┬─","─╮"],row:["│ "," "," │ "," │"],div:["├─","─","─┼─","─┤"],bot:["╰─","─","─┴─","─╯"]};theme=r9.wideTheme;columnWidth(){let D=[this.headers,...this.rows].filter((U)=>U.length>0),$=D[0].map((U)=>this.cast(U).length);for(let U of D.slice(1))for(let Q=0;Q<$.length;Q++){let X=this.cast(U[Q]).length;if(X>$[Q])$[Q]=X}return $}cast(D){if(typeof D==="object")return"obj";if(D!==void 0&&typeof D.toString==="function")return D.toString();else return""}renderTitle(){return"[ "+this.title+" ]"}renderLine(D){let $=this.columnWidth();return D[0]+$.map((U)=>D[1].repeat(U)).join(D[2])+D[3]}renderCell(D,$,U=!1){let Q=this.cast(D),X=U?Tj("bold",Q):Q,Y=$-Q.length,F=this.theme.row[1];switch(typeof D){case"number":return F.repeat(Y)+X;case"string":return X+F.repeat(Y);case"boolean":case"object":return F.repeat(Math.ceil(Y/2))+Tj("italic",Q)+F.repeat(Math.floor(Y/2));default:return F.repeat(Y)}}renderRow(D,$=!1){let U=this.theme.row,Q=this.columnWidth();return U[0]+D.map((X,Y)=>this.renderCell(X,Q[Y],$)).join(U[2])+U[3]}toString(){let D=this.theme,$=this.headers.length>0,U=this.rows.length>0;return[this.title?this.renderTitle():"",$||U?this.renderLine(D.top):"",$?this.renderRow(this.headers,!0):"",$&&U?this.renderLine(D.div):"",...this.rows.map((Q)=>this.renderRow(Q)),$||U?this.renderLine(D.bot):""].filter((Q)=>Q.length>0).join(`
|
|
92
92
|
`)}}});var Pj=u(()=>{Sj()});async function Cj(D){try{let U=`https://registry.npmjs.org/${encodeURIComponent(D.toLowerCase())}`,Q=await fetch(U,{headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"}});if(!Q.ok)return null;return(await Q.json())["dist-tags"]?.latest||null}catch{return null}}async function ws(){let D=await Cj("@capgo/cli")??"",$=D?.split(".")[0]??"";return{currentVersion:N$.version,latestVersion:D,isOutdated:!!D&&D!==N$.version,majorVersion:$}}async function bj(D={warn:($)=>SD.warning($)}){let{isOutdated:$,currentVersion:U,latestVersion:Q,majorVersion:X}=await ws();if($)D.warn(`\uD83D\uDEA8 You are using @capgo/cli@${U} it's not the latest version.
|
package/dist/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capgo/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "8.
|
|
4
|
+
"version": "8.89.0",
|
|
5
5
|
"description": "A CLI to upload to capgo servers",
|
|
6
6
|
"author": "Martin martin@capgo.app",
|
|
7
7
|
"license": "Apache 2.0",
|
|
@@ -152,7 +152,7 @@
|
|
|
152
152
|
"test:version-detection:setup": "./test/fixtures/setup-test-projects.sh",
|
|
153
153
|
"test:platform-paths": "bun test/test-platform-paths.mjs",
|
|
154
154
|
"test:project-type-detection": "bun test/test-project-type-detection.mjs",
|
|
155
|
-
"test:payload-split": "bun test/test-payload-split.mjs",
|
|
155
|
+
"test:payload-split": "bun test/test-payload-split.mjs && bun test/test-build-env.mjs",
|
|
156
156
|
"test:macos-signing": "bun test/test-macos-signing.mjs",
|
|
157
157
|
"test:helper-dce": "bash scripts/check-helper-dce.sh",
|
|
158
158
|
"test:apple-api-import-helpers": "bun test/test-apple-api-import-helpers.mjs",
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom env vars for the cloud build, from repeatable `--build-env` entries and the
|
|
3
|
+
* CAPGO_BUILD_ENV env var (comma-separated). `KEY` takes the value from this process's
|
|
4
|
+
* environment (CI secrets stay out of the command line); `KEY=VALUE` sets it literally.
|
|
5
|
+
* They reach the build as credentials: Gradle and Xcode build phases see them as env vars
|
|
6
|
+
* (e.g. SENTRY_AUTH_TOKEN for the Sentry Gradle plugin).
|
|
7
|
+
*/
|
|
8
|
+
export declare function parseBuildEnv(entries: string[] | undefined, env?: NodeJS.ProcessEnv): Record<string, string>;
|
|
@@ -7,6 +7,8 @@ export interface BuildOutputRecord {
|
|
|
7
7
|
buildMode: 'debug' | 'release';
|
|
8
8
|
status: string;
|
|
9
9
|
outputUrl: string | null;
|
|
10
|
+
/** Debug symbols for crash reporters: iOS dSYMs zip or Android R8/ProGuard mapping.txt. */
|
|
11
|
+
symbolsUrl: string | null;
|
|
10
12
|
qrCodeAscii: string | null;
|
|
11
13
|
qrCodePngPath: string | null;
|
|
12
14
|
finishedAt: string;
|
|
@@ -18,7 +20,10 @@ export interface WriteBuildOutputRecordInput {
|
|
|
18
20
|
buildMode: 'debug' | 'release';
|
|
19
21
|
status: string;
|
|
20
22
|
outputUrl: string | null;
|
|
23
|
+
symbolsUrl?: string | null;
|
|
21
24
|
}
|
|
25
|
+
/** Download URL of the debug symbols from a build log line, or null. */
|
|
26
|
+
export declare function parseDebugSymbolsUrl(line: string): string | null;
|
|
22
27
|
/**
|
|
23
28
|
* Write a build-output record to `recordPath` (JSON) and, when a URL is available,
|
|
24
29
|
* a PNG QR code to `<recordPath>.qr.png`. Returns the parsed record exactly as
|
|
@@ -113,6 +113,7 @@ export declare const buildRequestOptionsSchema: z.ZodObject<{
|
|
|
113
113
|
builderJourneyId: z.ZodOptional<z.ZodString>;
|
|
114
114
|
cache: z.ZodOptional<z.ZodBoolean>;
|
|
115
115
|
cacheKey: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
|
|
116
|
+
buildEnv: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
116
117
|
}, z.core.$strip>;
|
|
117
118
|
export type BuildRequestOptions = z.infer<typeof buildRequestOptionsSchema>;
|
|
118
119
|
export declare const buildNeededOptionsSchema: z.ZodObject<{
|