@capgo/cli 8.53.0 → 8.53.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import{createRequire as fi}from"node:module";var vi=Object.create;var{getPrototypeOf:bi,defineProperty:w5,getOwnPropertyNames:Gj,getOwnPropertyDescriptor:_i}=Object,Kj=Object.prototype.hasOwnProperty;function Vj(D){return this[D]}var ki,ui,oD=(D,$,U)=>{var X=D!=null&&typeof D==="object";if(X){var Q=$?ki??=new WeakMap:ui??=new WeakMap,Y=Q.get(D);if(Y)return Y}U=D!=null?vi(bi(D)):{};let J=$||!D||!D.__esModule?w5(U,"default",{value:D,enumerable:!0}):U;for(let Z of Gj(D))if(!Kj.call(J,Z))w5(J,Z,{get:Vj.bind(D,Z),enumerable:!0});if(X)Q.set(D,J);return J},K1=(D)=>{var $=(zj??=new WeakMap).get(D),U;if($)return $;if($=w5({},"__esModule",{value:!0}),D&&typeof D==="object"||typeof D==="function"){for(var X of Gj(D))if(!Kj.call($,X))w5($,X,{get:Vj.bind(D,X),enumerable:!(U=_i(D,X))||U.enumerable})}return zj.set(D,$),$},zj,S=(D,$)=>()=>($||D(($={exports:{}}).exports,$),$.exports);var xi=(D)=>D;function gi(D,$){this[D]=xi.bind(null,$)}var lD=(D,$)=>{for(var U in $)w5(D,U,{get:$[U],enumerable:!0,configurable:!0,set:gi.bind($,U)})};var l=(D,$)=>()=>(D&&($=D(D=0)),$);var X0=fi(import.meta.url);var s$;var m8=l(()=>{s$={name:"@capgo/cli",type:"module",version:"8.53.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:bundle":"bun test/test-bundle.mjs","test:bundle-validation":"bun test test/bundle/","test:prescan":"bun test test/prescan/","test:functional":"bun test/test-functional.mjs","test:semver":"bun test/test-semver-validation.mjs","test:version-edge-cases":"bun test/test-version-validation.mjs","test:regex":"bun test/test-regex-validation.mjs","test:upload":"bun test/test-upload-validation.mjs","test:fail-on-incompatible":"bun test/test-fail-on-incompatible.mjs","test:native-dependencies":"bun test/test-native-dependencies.mjs && bun test/test-get-remote-dependencies.mjs","test:package-json-guard":"bun test/test-package-json-guard.mjs","test:credentials":"bun test/test-credentials.mjs","test:credentials-export":"bun test/test-credentials-export.mjs","test:asc-key-protocol":"bun test/test-asc-key-protocol.mjs","test:credentials-validation":"bun test/test-credentials-validation.mjs","test:android-service-account-validation":"bun test/test-android-service-account-validation.mjs","test:build-zip-filter":"bun test/test-build-zip-filter.mjs","test:checksum":"bun test/test-checksum-algorithm.mjs","test:build-needed":"bun test/test-build-needed.mjs","test:cli-help":"bun test/test-cli-help.mjs","test:build-cache-payload":"bun test/test-build-cache-payload.mjs","test:build-cancellation":"bun test/test-build-cancellation.mjs","test:ci-prompts":"bun test/test-ci-prompts.mjs","test:ci-secrets":"bun test/test-ci-secrets.mjs","test:android-onboarding-progress":"bun test/test-android-onboarding-progress.mjs","test:onboarding-telemetry":"bun test/test-onboarding-telemetry.mjs","test:v2-event-migration":"bun test/test-v2-event-migration.mjs","test:analytics":"bun test/test-analytics.mjs","test:cli-headers":"bun test/test-cli-headers.mjs","test:min-cli-version":"bun test/test-min-cli-version.mjs","test:authenticated-command-invocation":"bun test/test-authenticated-command-invocation.mjs","test:analytics-error-category":"bun test/test-analytics-error-category.mjs","test:analytics-org-resolver":"bun test/test-analytics-org-resolver.mjs","test:supabase-perf":"bun test/test-supabase-perf.mjs","test:preview-qr":"bun test/test-preview-qr.mjs","test:mcp-analytics":"bun test/test-mcp-analytics.mjs","test:mcp-instructions":"bun test/test-mcp-instructions.mjs","test:mcp-stdout-guard":"bun test/test-mcp-stdout-guard.mjs","test:mcp-platform-select":"bun test/test-mcp-platform-select.mjs","test:mcp-explain-scopes":"bun test/test-mcp-explain-scopes.mjs","test:mcp-oauth-reopen":"bun test/test-mcp-oauth-reopen.mjs","test:mcp-broker-oauth":"bun test/test-mcp-broker-oauth.mjs","test:mcp-broker-session":"bun test/test-mcp-broker-session.mjs","test:mcp-credentials-manage":"bun test/test-mcp-credentials-manage.mjs","test:mcp-resume-prompt":"bun test/test-mcp-resume-prompt.mjs","test:mcp-build-job":"bun test/test-mcp-build-job.mjs","test:mcp-build-tools":"bun test/test-mcp-build-tools.mjs","test:app-created-source":"bun test/test-app-created-source.mjs","test:app-add-exists":"bun test/test-app-add-exists.mjs","test:app-list-output-text":"bun test/test-app-list-output-text.mjs","test:doctor-analytics":"bun test/test-doctor-analytics.mjs","test:posthog-exception":"bun test/test-posthog-exception.mjs","test:cli-recovery":"bun test/test-cli-recovery.mjs","test:create-supabase-client":"bun test/test-create-supabase-client.mjs","test:onboarding-recovery":"bun test/test-onboarding-recovery.mjs","test:onboarding-progress":"bun test/test-onboarding-progress.mjs","test:onboarding-run-targets":"bun test/test-onboarding-run-targets.mjs","test:run-device-command":"bun test/test-run-device-command.mjs","test:init-app-conflict":"bun test/test-init-app-conflict.mjs","test:channel-add-exists":"bun test/test-channel-add-exists.mjs","test:wait-log":"bun test/test-wait-log.mjs","test:init-guardrails":"bun test/test-init-guardrails.mjs","test:init-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: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:init-monorepo-targeting":"bun run test:capacitor-config-target && bun run test:capacitor-config-typescript7 && bun run test:capacitor-config-native-import && bun run test:cli-user-error-config && bun test/test-init-monorepo-targeting.mjs","test:prompt-preferences":"bun test/test-prompt-preferences.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:auth-session":"bun test/test-auth-session.mjs","test:mcp":"node test/test-mcp.mjs","test:mcp-no-key-handshake":"node test/test-mcp-no-key-handshake.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs","test:project-type-detection":"bun test/test-project-type-detection.mjs","test:payload-split":"bun test/test-payload-split.mjs","test:macos-signing":"bun test/test-macos-signing.mjs","test:helper-dce":"bash scripts/check-helper-dce.sh","test:apple-api-import-helpers":"bun test/test-apple-api-import-helpers.mjs","test:apple-api-verify-key":"bun test/test-apple-api-verify-key.mjs","test:bundle-id-detector":"bun test/test-bundle-id-detector.mjs","test:apple-api-app-list":"bun test/test-apple-api-app-list.mjs","test:apple-api-cert-create":"bun test/test-apple-api-cert-create.mjs","test:app-verification":"bun test/test-app-verification.mjs","test:pbxproj-parser":"bun test/test-pbxproj-parser.mjs","test:manifest-path-encoding":"bun test/test-manifest-path-encoding.mjs","test:self-update":"bun test/test-self-update.mjs","test:update-prompt":"bun test/test-update-prompt.mjs","test:android-tail-engine":"bun test/test-android-tail-engine.mjs","test:android-tail-render":"bun test/test-android-tail-render.mjs","test:android-tail-routing":"bun test/test-android-tail-routing.mjs","test:dev-gate-stripped":"bun test/test-dev-gate-stripped.mjs","test:frame-fit-ios-shared":"bun test/test-frame-fit-ios-shared.mjs","test:ios-confirm-app-id":"bun test/test-ios-confirm-app-id.mjs","test:ios-create-new":"bun test/test-ios-create-new.mjs","test:ios-e2e":"bun test/test-ios-e2e.mjs","test:ios-flow-contract":"bun test/test-ios-flow-contract.mjs","test:ios-import-discovery":"bun test/test-ios-import-discovery.mjs","test:ios-import-export":"bun test/test-ios-import-export.mjs","test:ios-import-pickers":"bun test/test-ios-import-pickers.mjs","test:ios-import-recovery":"bun test/test-ios-import-recovery.mjs","test:ios-recovery":"bun test/test-ios-recovery.mjs","test:ios-resume":"bun test/test-ios-resume.mjs","test:ios-tail-handoff":"bun test/test-ios-tail-handoff.mjs","test:ios-tui-render":"bun test/test-ios-tui-render.mjs","test:p8-error":"bun test/test-p8-error.mjs","test:ios-tui-routing":"bun test/test-ios-tui-routing.mjs","test:ios-updater-sync-validation":"bun test/test-ios-updater-sync-validation.mjs","test:ios-verify-app":"bun test/test-ios-verify-app.mjs","test:ios-marketing-version":"bun test/test-ios-marketing-version.mjs","test:android-version":"bun test/test-android-version.mjs","test:platform-flow-contract":"bun test/test-platform-flow-contract.mjs","test:tail-engine-shared":"bun test/test-tail-engine-shared.mjs",test:"bun run build && bun run test:helper-dce && bun run test:version-detection:setup && bun run test:bundle && bun run test:notify-app-ready-background && bun run test:bundle-validation && bun run test:functional && bun run test:semver && bun run test:auto-bump-version && bun run test:auto-bump-ai-diff && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:fail-on-incompatible && bun run test:native-dependencies && bun run test:package-json-guard && bun run test:credentials && bun run test:credentials-export && bun run test:ios-provisioning-map && bun run test:ios-provisioning-command && bun run test:credentials-validation && bun run test:android-service-account-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:build-needed && bun run test:cli-help && bun run test:build-cache-payload && bun run test:build-cancellation && bun run test:ci-prompts && bun run test:ci-secrets && bun run test:android-onboarding-progress && bun run test:onboarding-telemetry && bun run test:v2-event-migration && bun run test:analytics && bun run test:cli-headers && bun run test:min-cli-version && bun run test:authenticated-command-invocation && bun run test:analytics-error-category && bun run test:analytics-org-resolver && bun run test:supabase-perf && bun run test:preview-qr && bun run test:app-set-options && bun run test:mcp-analytics && bun run test:mcp-instructions && bun run test:mcp-live-update-onboarding && bun run test:mcp-stdout-guard && bun run test:mcp-platform-select && bun run test:mcp-explain-scopes && bun run test:mcp-oauth-reopen && bun run test:mcp-broker-oauth && bun run test:mcp-broker-session && bun run test:mcp-credentials-manage && bun run test:mcp-resume-prompt && bun run test:mcp-build-job && bun run test:mcp-build-tools && bun run test:app-created-source && bun run test:app-add-exists && bun run test:app-list-output-text && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:cli-recovery && bun run test:create-supabase-client && bun run test:build-platform-selection && bun run test:builder-project-discovery && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-monorepo-targeting && bun run test:init-app-conflict && bun run test:channel-list && bun run test:channel-add-exists && bun run test:wait-log && bun run test:init-guardrails && bun run test:init-upload-recovery && bun run test:init-replay && bun run test:init-telemetry && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:mcp-no-key-handshake && bun run test:auth-session && bun run test:version-detection && bun run test:platform-paths && bun run test:project-type-detection && bun run test:payload-split && bun run test:manifest-path-encoding && bun run test:macos-signing && bun run test:asc-key-protocol && bun run test:apple-api-import-helpers && bun run test:apple-api-verify-key && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:cicd-failure-help && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-upload-prompt && bun run test:support-bundle-files && bun run test:self-update && bun run test:update-prompt && bun run test:apple-api-cert-create && bun run test:android-tail-engine && bun run test:android-tail-render && bun run test:android-tail-routing && bun run test:dev-gate-stripped && bun run test:frame-fit-ios-shared && bun run test:ios-confirm-app-id && bun run test:ios-create-new && bun run test:ios-e2e && bun run test:ios-flow-contract && bun run test:ios-import-discovery && bun run test:ios-import-export && bun run test:ios-import-pickers && bun run test:ios-import-recovery && bun run test:ios-recovery && bun run test:ios-resume && bun run test:ios-tail-handoff && bun run test:ios-tui-render && bun run test:p8-error && bun run test:ios-tui-routing && bun run test:ios-updater-sync-validation && bun run test:ios-verify-app && bun run test:ios-marketing-version && bun run test:android-version && bun run test:platform-flow-contract && bun run test:tail-engine-shared && bun run test:prescan && bun run test:android-reporting-api && bun run test:android-gcp && bun run test:android-app-verification && bun run test:android-rename && bun run test:appflow-auth && bun run test:appflow-api-map && bun run test:appflow-validate && bun run test:appflow-flow && bun run test:appflow-gapfill && bun run test:appflow-engine && bun run test:appflow-tail && bun run test:appflow-fetch && bun run test:appflow-sa-decode && bun run test:app-permission-helper && bun run test:2fa-compliance-network && bun run test:organization-set-api-host && bun run test:trial-warning && bun run test:plan-validation","test:build-platform-selection":"bun test/test-build-platform-selection.mjs","test:builder-project-discovery":"bun test/test-builder-project-discovery.mjs","test:ai-log-capture":"bun test/test-ai-log-capture.mjs","test:ai-analyze-flow":"bun test/test-ai-analyze-flow.mjs","test:cicd-failure-help":"bun test/test-cicd-failure-help.mjs","test:ai-analyze-stream":"bun test/test-ai-analyze-stream.mjs","test:ai-sse-parser":"bun test/test-ai-sse-parser.mjs","test:ai-render-markdown":"bun test/test-ai-render-markdown.mjs","test:ai-onboarding-mode":"bun test/test-ai-onboarding-mode.mjs","test:ai-fit":"bun test/test-ai-fit.mjs","test:platform-layout":"bun test/test-platform-layout.mjs","test:frame-fit":"bun test/run-frame-fit.mjs","test:onboarding-min-size":"bun test/test-onboarding-min-size.mjs","test:min-size-gate":"bun test/test-min-size-gate.mjs","test:shell-size-gate":"bun test/test-shell-size-gate.mjs","test:build-log-sanitize":"bun test/test-build-log-sanitize.mjs","test:build-output-viewport":"bun test/test-build-output-viewport.mjs","test:diff-viewer-viewport":"bun test/test-diff-viewer-viewport.mjs","test:build-complete-exit":"bun test/test-build-complete-exit.mjs","test:ai-stream-markdown":"bun test/test-ai-stream-markdown.mjs","test:support-mailto":"bun test/test-support-mailto.mjs","test:support-redact":"bun test/test-support-redact.mjs","test:support-internal-log":"bun test/test-support-internal-log.mjs","test:support-help-menu":"bun test/test-support-help-menu.mjs","test:support-contact":"bun test/test-support-contact.mjs","test:support-upload-prompt":"bun test/test-support-upload-prompt.mjs","test:support-bundle-files":"bun test/test-support-bundle-files.mjs","test:mcp-live-update-onboarding":"bun test/test-mcp-live-update-onboarding.mjs","test:app-set-options":"bun test/test-app-set-options.mjs && bun test/test-app-list-options.mjs","test:android-reporting-api":"bun test/test-android-reporting-api.mjs","test:android-gcp":"bun test/test-android-gcp.mjs","test:android-app-verification":"bun test/test-android-app-verification.mjs","test:android-rename":"bun test/test-android-rename.mjs","test:appflow-auth":"bun test/test-appflow-auth.mjs","test:appflow-api-map":"bun test/test-appflow-api-map.mjs","test:appflow-validate":"bun test/test-appflow-validate.mjs","test:appflow-flow":"bun test/test-appflow-flow.mjs","test:appflow-gapfill":"bun test/test-appflow-gapfill.mjs","test:appflow-engine":"bun test/test-appflow-engine.mjs","test:appflow-tail":"bun test/test-appflow-tail.mjs","test:appflow-fetch":"bun test/test-appflow-fetch.mjs","test:appflow-sa-decode":"bun test/test-appflow-sa-decode.mjs","test:app-permission-helper":"bun test/test-app-permission-helper.mjs","test:2fa-compliance-network":"bun test/test-2fa-compliance-network.mjs","test:organization-set-api-host":"bun test/test-organization-set-api-host.mjs","test:trial-warning":"bun test/test-trial-warning.mjs","test:plan-validation":"bun test/test-plan-validation.mjs","test:auto-bump-version":"bun test/test-auto-bump-version.mjs","test:auto-bump-ai-diff":"bun test/test-auto-bump-ai-diff.mjs","test:ios-provisioning-map":"bun test/test-ios-provisioning-map.mjs","test:ios-provisioning-command":"bun test/test-ios-provisioning-command.mjs","test:channel-list":"bun test/test-channel-list.mjs"},dependencies:{"@inkjs/ui":"^2.0.0","@manypkg/tools":"^2.1.2","@rrweb/types":"^2.1.1","@standard-schema/spec":"^1.1.0","@xmldom/xmldom":"^0.9.10","@xterm/addon-serialize":"^0.14.0","@xterm/headless":"^6.0.0","agent-cli-detector":"^0.1.6","happy-dom":"^20.11.0",ink:"^7.1.1","ink-spinner":"^5.0.0",jsonwebtoken:"^9.0.3","node-forge":"^1.4.0",qrcode:"^1.5.4",react:"^19.2.8","rrweb-snapshot":"^2.1.1","string-width":"^8.2.2",typescript:"6.0.3",zod:"^4.4.3"},optionalDependencies:{"@capgo/cli-helper-darwin-arm64":"^1.1.1","@capgo/cli-helper-darwin-x64":"^1.1.1","node-pty":"^1.1.0"},devDependencies:{"@antfu/eslint-config":"^9.2.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.6","@capacitor/cli":"^8.4.2","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.7.0","@modelcontextprotocol/client":"^2.0.0-beta.5","@modelcontextprotocol/server":"^2.0.0-beta.5","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver@1.0.8","@supabase/supabase-js":"^2.110.8","@tanstack/intent":"^0.3.6","@types/adm-zip":"^0.5.8","@types/jsonwebtoken":"^9.0.10","@types/node":"^26.1.1","@types/node-forge":"^1.3.14","@types/prettyjson":"^0.0.33","@types/qrcode":"^1.5.6","@types/react":"^19.2.17","@types/tmp":"^0.2.6","@types/ws":"^8.18.1","@typescript/native-preview":"7.0.0-dev.20260707.2","@vercel/ncc":"^0.44.1","@vue/compiler-dom":"3.5.40","@xterm/headless":"^6.0.0","adm-zip":"^0.6.0","ci-info":"^4.4.0",commander:"^15.0.0",eslint:"^10.7.0","git-format-staged":"4.0.2",husky:"^9.1.7","is-wsl":"^3.1.1",micromatch:"^4.0.8",open:"^11.0.0",oxlint:"^1.75.0",partysocket:"^1.3.0",prettyjson:"^1.2.5",tmp:"^0.2.7","tus-js-client":"^4.3.1",ws:"^8.21.1"}}});var m0;var H4=l(()=>{m0=class m0 extends Error{context;constructor(D,$){super(D);this.name="CliUserError",this.context=$}}});import{platform as mi}from"node:os";import{version as hi}from"node:process";function Ij(D){Bj=D}function di(D){for(let $=0;$<D.length;$++)if(D.charCodeAt($)>255)return!1;return!0}function Hj(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 ci(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 kq(D,$){if($===void 0||$===null){if(_q.has(D.toLowerCase()))throw new m0(Hj(D));throw new m0(`HTTP header "${D}" is missing or invalid.`)}if(typeof $!=="string"){if(_q.has(D.toLowerCase()))throw new m0(Hj(D));throw new m0(`HTTP header "${D}" is missing or invalid.`)}if(!di($)){if(_q.has(D.toLowerCase()))throw new m0(ci(D));throw new m0(`HTTP header "${D}" contains invalid characters (only ASCII is allowed).`)}return $}function I6(D){let $={capgo_api:li,"x-cli-version":s$.version,"x-cli-command":Bj,"x-cli-node":hi,"x-cli-os":mi()};if(D)for(let[U,X]of Object.entries(D))$[U]=kq(U,X);return $}var li="2025-10-01",Bj="",_q;var fU=l(()=>{m8();H4();_q=new Set(["authorization","capgkey","x-capgo-log-token"])});var L5=S((zC0,Cj)=>{var Sj={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:"(?=.)",QMARK:"[^/]",END_ANCHOR:"(?:\\/|$)",DOTS_SLASH:"\\.{1,2}(?:\\/|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|\\/)\\.{1,2}(?:\\/|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:\\/|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:\\/|$))",QMARK_NO_DOT:"[^.\\/]",STAR:"[^/]*?",START_ANCHOR:"(?:^|\\/)",SEP:"/"},cn={...Sj,SLASH_LITERAL:"[\\\\/]",QMARK:"[^\\\\/]",STAR:"[^\\\\/]*?",DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},pn={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};Cj.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:65536,POSIX_REGEX_SOURCE:pn,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(D){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${D.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(D){return D===!0?cn:Sj}}});var N5=S((sn)=>{var{REGEX_BACKSLASH:nn,REGEX_REMOVE_BACKSLASH:rn,REGEX_SPECIAL_CHARS:an,REGEX_SPECIAL_CHARS_GLOBAL:on}=L5();sn.isObject=(D)=>D!==null&&typeof D==="object"&&!Array.isArray(D);sn.hasRegexChars=(D)=>an.test(D);sn.isRegexChar=(D)=>D.length===1&&sn.hasRegexChars(D);sn.escapeRegex=(D)=>D.replace(on,"\\$1");sn.toPosixSlashes=(D)=>D.replace(nn,"/");sn.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let D=navigator.platform.toLowerCase();return D==="win32"||D==="windows"}if(typeof process<"u"&&process.platform)return process.platform==="win32";return!1};sn.removeBackslashes=(D)=>{return D.replace(rn,($)=>{return $==="\\"?"":$})};sn.escapeLast=(D,$,U)=>{let X=D.lastIndexOf($,U);if(X===-1)return D;if(D[X-1]==="\\")return sn.escapeLast(D,$,X-1);return`${D.slice(0,X)}\\${D.slice(X)}`};sn.removePrefix=(D,$={})=>{let U=D;if(U.startsWith("./"))U=U.slice(2),$.prefix="./";return U};sn.wrapOutput=(D,$={},U={})=>{let X=U.contains?"":"^",Q=U.contains?"":"$",Y=`${X}(?:${D})${Q}`;if($.negated===!0)Y=`(?:^(?!${Y}).*$)`;return Y};sn.basename=(D,{windows:$}={})=>{let U=D.split($?/[\\/]/:"/"),X=U[U.length-1];if(X==="")return U[U.length-2];return X}});var mj=S((KC0,yj)=>{var _j=N5(),{CHAR_ASTERISK:gq,CHAR_AT:Zr,CHAR_BACKWARD_SLASH:j5,CHAR_COMMA:qr,CHAR_DOT:fq,CHAR_EXCLAMATION_MARK:yq,CHAR_FORWARD_SLASH:fj,CHAR_LEFT_CURLY_BRACE:mq,CHAR_LEFT_PARENTHESES:hq,CHAR_LEFT_SQUARE_BRACKET:Fr,CHAR_PLUS:Wr,CHAR_QUESTION_MARK:kj,CHAR_RIGHT_CURLY_BRACE:zr,CHAR_RIGHT_PARENTHESES:uj,CHAR_RIGHT_SQUARE_BRACKET:Gr}=L5(),xj=(D)=>{return D===fj||D===j5},gj=(D)=>{if(D.isPrefix!==!0)D.depth=D.isGlobstar?1/0:1},Kr=(D,$)=>{let U=$||{},X=D.length-1,Q=U.parts===!0||U.scanToEnd===!0,Y=[],J=[],Z=[],q=D,F=-1,W=0,z=0,G=!1,K=!1,V=!1,B=!1,H=!1,O=!1,w=!1,I=!1,N=!1,E=!1,P=0,k,T,v={value:"",depth:0,isGlob:!1},j=()=>F>=X,R=()=>q.charCodeAt(F+1),x=()=>{return k=T,q.charCodeAt(++F)};while(F<X){T=x();let L;if(T===j5){if(w=v.backslashes=!0,T=x(),T===mq)O=!0;continue}if(O===!0||T===mq){P++;while(j()!==!0&&(T=x())){if(T===j5){w=v.backslashes=!0,x();continue}if(T===mq){P++;continue}if(O!==!0&&T===fq&&(T=x())===fq){if(G=v.isBrace=!0,V=v.isGlob=!0,E=!0,Q===!0)continue;break}if(O!==!0&&T===qr){if(G=v.isBrace=!0,V=v.isGlob=!0,E=!0,Q===!0)continue;break}if(T===zr){if(P--,P===0){O=!1,G=v.isBrace=!0,E=!0;break}}}if(Q===!0)continue;break}if(T===fj){if(Y.push(F),J.push(v),v={value:"",depth:0,isGlob:!1},E===!0)continue;if(k===fq&&F===W+1){W+=2;continue}z=F+1;continue}if(U.noext!==!0){if((T===Wr||T===Zr||T===gq||T===kj||T===yq)===!0&&R()===hq){if(V=v.isGlob=!0,B=v.isExtglob=!0,E=!0,T===yq&&F===W)N=!0;if(Q===!0){while(j()!==!0&&(T=x())){if(T===j5){w=v.backslashes=!0,T=x();continue}if(T===uj){V=v.isGlob=!0,E=!0;break}}continue}break}}if(T===gq){if(k===gq)H=v.isGlobstar=!0;if(V=v.isGlob=!0,E=!0,Q===!0)continue;break}if(T===kj){if(V=v.isGlob=!0,E=!0,Q===!0)continue;break}if(T===Fr){while(j()!==!0&&(L=x())){if(L===j5){w=v.backslashes=!0,x();continue}if(L===Gr){K=v.isBracket=!0,V=v.isGlob=!0,E=!0;break}}if(Q===!0)continue;break}if(U.nonegate!==!0&&T===yq&&F===W){I=v.negated=!0,W++;continue}if(U.noparen!==!0&&T===hq){if(V=v.isGlob=!0,Q===!0){while(j()!==!0&&(T=x())){if(T===hq){w=v.backslashes=!0,T=x();continue}if(T===uj){E=!0;break}}continue}break}if(V===!0){if(E=!0,Q===!0)continue;break}}if(U.noext===!0)B=!1,V=!1;let m=q,b="",_="";if(W>0)b=q.slice(0,W),q=q.slice(W),z-=W;if(m&&V===!0&&z>0)m=q.slice(0,z),_=q.slice(z);else if(V===!0)m="",_=q;else m=q;if(m&&m!==""&&m!=="/"&&m!==q){if(xj(m.charCodeAt(m.length-1)))m=m.slice(0,-1)}if(U.unescape===!0){if(_)_=_j.removeBackslashes(_);if(m&&w===!0)m=_j.removeBackslashes(m)}let A={prefix:b,input:D,start:W,base:m,glob:_,isBrace:G,isBracket:K,isGlob:V,isExtglob:B,isGlobstar:H,negated:I,negatedExtglob:N};if(U.tokens===!0){if(A.maxDepth=0,!xj(T))J.push(v);A.tokens=J}if(U.parts===!0||U.tokens===!0){let L;for(let M=0;M<Y.length;M++){let u=L?L+1:W,h=Y[M],y=D.slice(u,h);if(U.tokens){if(M===0&&W!==0)J[M].isPrefix=!0,J[M].value=b;else J[M].value=y;gj(J[M]),A.maxDepth+=J[M].depth}if(M!==0||y!=="")Z.push(y);L=h}if(L&&L+1<D.length){let M=D.slice(L+1);if(Z.push(M),U.tokens)J[J.length-1].value=M,gj(J[J.length-1]),A.maxDepth+=J[J.length-1].depth}A.slashes=Y,A.parts=Z}return A};yj.exports=Kr});var pj=S((VC0,cj)=>{var M5=L5(),M$=N5(),{MAX_LENGTH:mU,POSIX_REGEX_SOURCE:Vr,REGEX_NON_SPECIAL_CHARS:Hr,REGEX_SPECIAL_CHARS_BACKREF:Br,REPLACEMENTS:hj}=M5,Ir=(D,$)=>{if(typeof $.expandRange==="function")return $.expandRange(...D,$);D.sort();let U=`[${D.join("-")}]`;try{new RegExp(U)}catch(X){return D.map((Q)=>M$.escapeRegex(Q)).join("..")}return U},h8=(D,$)=>{return`Missing ${D}: "${$}" - use "\\\\${$}" to match literal characters`},lj=(D)=>{let $=[],U=0,X=0,Q=0,Y="",J=!1;for(let Z of D){if(J===!0){Y+=Z,J=!1;continue}if(Z==="\\"){Y+=Z,J=!0;continue}if(Z==='"'){Q=Q===1?0:1,Y+=Z;continue}if(Q===0){if(Z==="[")U++;else if(Z==="]"&&U>0)U--;else if(U===0){if(Z==="(")X++;else if(Z===")"&&X>0)X--;else if(Z==="|"&&X===0){$.push(Y),Y="";continue}}}Y+=Z}return $.push(Y),$},Or=(D)=>{let $=!1;for(let U of D){if($===!0){$=!1;continue}if(U==="\\"){$=!0;continue}if(/[?*+@!()[\]{}]/.test(U))return!1}return!0},dj=(D)=>{let $=D.trim(),U=!0;while(U===!0)if(U=!1,/^@\([^\\()[\]{}|]+\)$/.test($))$=$.slice(2,-1),U=!0;if(!Or($))return;return $.replace(/\\(.)/g,"$1")},wr=(D)=>{let $=D.map(dj).filter(Boolean);for(let U=0;U<$.length;U++)for(let X=U+1;X<$.length;X++){let Q=$[U],Y=$[X],J=Q[0];if(!J||Q!==J.repeat(Q.length)||Y!==J.repeat(Y.length))continue;if(Q===Y||Q.startsWith(Y)||Y.startsWith(Q))return!0}return!1},lq=(D,$=!0)=>{if(D[0]!=="+"&&D[0]!=="*"||D[1]!=="(")return;let U=0,X=0,Q=0,Y=!1;for(let J=1;J<D.length;J++){let Z=D[J];if(Y===!0){Y=!1;continue}if(Z==="\\"){Y=!0;continue}if(Z==='"'){Q=Q===1?0:1;continue}if(Q===1)continue;if(Z==="["){U++;continue}if(Z==="]"&&U>0){U--;continue}if(U>0)continue;if(Z==="("){X++;continue}if(Z===")"){if(X--,X===0){if($===!0&&J!==D.length-1)return;return{type:D[0],body:D.slice(2,J),end:J}}}}},Lr=(D)=>{let $=0,U=[];while($<D.length){let Q=lq(D.slice($),!1);if(!Q||Q.type!=="*")return;let Y=lj(Q.body).map((Z)=>Z.trim());if(Y.length!==1)return;let J=dj(Y[0]);if(!J||J.length!==1)return;U.push(J),$+=Q.end+1}if(U.length<1)return;return`${U.length===1?M$.escapeRegex(U[0]):`[${U.map((Q)=>M$.escapeRegex(Q)).join("")}]`}*`},Nr=(D)=>{let $=0,U=D.trim(),X=lq(U);while(X)$++,U=X.body.trim(),X=lq(U);return $},jr=(D,$)=>{if($.maxExtglobRecursion===!1)return{risky:!1};let U=typeof $.maxExtglobRecursion==="number"?$.maxExtglobRecursion:M5.DEFAULT_MAX_EXTGLOB_RECURSION,X=lj(D).map((Q)=>Q.trim());if(X.length>1){if(X.some((Q)=>Q==="")||X.some((Q)=>/^[*?]+$/.test(Q))||wr(X))return{risky:!0}}for(let Q of X){let Y=Lr(Q);if(Y)return{risky:!0,safeOutput:Y};if(Nr(Q)>U)return{risky:!0}}return{risky:!1}},dq=(D,$)=>{if(typeof D!=="string")throw TypeError("Expected a string");D=hj[D]||D;let U={...$},X=typeof U.maxLength==="number"?Math.min(mU,U.maxLength):mU,Q=D.length;if(Q>X)throw SyntaxError(`Input length: ${Q}, exceeds maximum allowed length: ${X}`);let Y={type:"bos",value:"",output:U.prepend||""},J=[Y],Z=U.capture?"":"?:",q=M5.globChars(U.windows),F=M5.extglobChars(q),{DOT_LITERAL:W,PLUS_LITERAL:z,SLASH_LITERAL:G,ONE_CHAR:K,DOTS_SLASH:V,NO_DOT:B,NO_DOT_SLASH:H,NO_DOTS_SLASH:O,QMARK:w,QMARK_NO_DOT:I,STAR:N,START_ANCHOR:E}=q,P=(s)=>{return`(${Z}(?:(?!${E}${s.dot?V:W}).)*?)`},k=U.dot?"":B,T=U.dot?w:I,v=U.bash===!0?P(U):N;if(U.capture)v=`(${v})`;if(typeof U.noext==="boolean")U.noextglob=U.noext;let j={input:D,index:-1,start:0,dot:U.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:J};D=M$.removePrefix(D,j),Q=D.length;let R=[],x=[],m=[],b=Y,_,A=()=>j.index===Q-1,L=j.peek=(s=1)=>D[j.index+s],M=j.advance=()=>D[++j.index]||"",u=()=>D.slice(j.index+1),h=(s="",f0=0)=>{j.consumed+=s,j.index+=f0},y=(s)=>{j.output+=s.output!=null?s.output:s.value,h(s.value)},D0=()=>{let s=1;while(L()==="!"&&(L(2)!=="("||L(3)==="?"))M(),j.start++,s++;if(s%2===0)return!1;return j.negated=!0,j.start++,!0},f=(s)=>{j[s]++,m.push(s)},c=(s)=>{j[s]--,m.pop()},$0=(s)=>{if(b.type==="globstar"){let f0=j.braces>0&&(s.type==="comma"||s.type==="brace"),e=s.extglob===!0||R.length&&(s.type==="pipe"||s.type==="paren");if(s.type!=="slash"&&s.type!=="paren"&&!f0&&!e)j.output=j.output.slice(0,-b.output.length),b.type="star",b.value="*",b.output=v,j.output+=b.output}if(R.length&&s.type!=="paren")R[R.length-1].inner+=s.value;if(s.value||s.output)y(s);if(b&&b.type==="text"&&s.type==="text"){b.output=(b.output||b.value)+s.value,b.value+=s.value;return}s.prev=b,J.push(s),b=s},V0=(s,f0)=>{let e={...F[f0],conditions:1,inner:""};e.prev=b,e.parens=j.parens,e.output=j.output,e.startIndex=j.index,e.tokensIndex=J.length;let N0=(U.capture?"(":"")+e.open;f("parens"),$0({type:s,value:f0,output:j.output?"":K}),$0({type:"paren",extglob:!0,value:M(),output:N0}),R.push(e)},T0=(s)=>{let f0=D.slice(s.startIndex,j.index+1),e=D.slice(s.startIndex+2,j.index),N0=jr(e,U);if((s.type==="plus"||s.type==="star")&&N0.risky){let d0=N0.safeOutput?(s.output?"":K)+(U.capture?`(${N0.safeOutput})`:N0.safeOutput):void 0,H6=J[s.tokensIndex];H6.type="text",H6.value=f0,H6.output=d0||M$.escapeRegex(f0);for(let B6=s.tokensIndex+1;B6<J.length;B6++)J[B6].value="",J[B6].output="",delete J[B6].suffix;j.output=s.output+H6.output,j.backtrack=!0,$0({type:"paren",extglob:!0,value:_,output:""}),c("parens");return}let n0=s.close+(U.capture?")":""),GD;if(s.type==="negate"){let d0=v;if(s.inner&&s.inner.length>1&&s.inner.includes("/"))d0=P(U);if(d0!==v||A()||/^\)+$/.test(u()))n0=s.close=`)$))${d0}`;if(s.inner.includes("*")&&(GD=u())&&/^\.[^\\/.]+$/.test(GD)){let H6=dq(GD,{...$,fastpaths:!1}).output;n0=s.close=`)${H6})${d0})`}if(s.prev.type==="bos")j.negatedExtglob=!0}$0({type:"paren",extglob:!0,value:_,output:n0}),c("parens")};if(U.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(D)){let s=!1,f0=D.replace(Br,(e,N0,n0,GD,d0,H6)=>{if(GD==="\\")return s=!0,e;if(GD==="?"){if(N0)return N0+GD+(d0?w.repeat(d0.length):"");if(H6===0)return T+(d0?w.repeat(d0.length):"");return w.repeat(n0.length)}if(GD===".")return W.repeat(n0.length);if(GD==="*"){if(N0)return N0+GD+(d0?v:"");return v}return N0?e:`\\${e}`});if(s===!0)if(U.unescape===!0)f0=f0.replace(/\\/g,"");else f0=f0.replace(/\\+/g,(e)=>{return e.length%2===0?"\\\\":e?"\\":""});if(f0===D&&U.contains===!0)return j.output=D,j;return j.output=M$.wrapOutput(f0,j,$),j}while(!A()){if(_=M(),_==="\x00")continue;if(_==="\\"){let e=L();if(e==="/"&&U.bash!==!0)continue;if(e==="."||e===";")continue;if(!e){_+="\\",$0({type:"text",value:_});continue}let N0=/^\\+/.exec(u()),n0=0;if(N0&&N0[0].length>2){if(n0=N0[0].length,j.index+=n0,n0%2!==0)_+="\\"}if(U.unescape===!0)_=M();else _+=M();if(j.brackets===0){$0({type:"text",value:_});continue}}if(j.brackets>0&&(_!=="]"||b.value==="["||b.value==="[^")){if(U.posix!==!1&&_===":"){let e=b.value.slice(1);if(e.includes("[")){if(b.posix=!0,e.includes(":")){let N0=b.value.lastIndexOf("["),n0=b.value.slice(0,N0),GD=b.value.slice(N0+2),d0=Vr[GD];if(d0){if(b.value=n0+d0,j.backtrack=!0,M(),!Y.output&&J.indexOf(b)===1)Y.output=K;continue}}}}if(_==="["&&L()!==":"||_==="-"&&L()==="]")_=`\\${_}`;if(_==="]"&&(b.value==="["||b.value==="[^"))_=`\\${_}`;if(U.posix===!0&&_==="!"&&b.value==="[")_="^";b.value+=_,y({value:_});continue}if(j.quotes===1&&_!=='"'){_=M$.escapeRegex(_),b.value+=_,y({value:_});continue}if(_==='"'){if(j.quotes=j.quotes===1?0:1,U.keepQuotes===!0)$0({type:"text",value:_});continue}if(_==="("){f("parens"),$0({type:"paren",value:_});continue}if(_===")"){if(j.parens===0&&U.strictBrackets===!0)throw SyntaxError(h8("opening","("));let e=R[R.length-1];if(e&&j.parens===e.parens+1){T0(R.pop());continue}$0({type:"paren",value:_,output:j.parens?")":"\\)"}),c("parens");continue}if(_==="["){if(U.nobracket===!0||!u().includes("]")){if(U.nobracket!==!0&&U.strictBrackets===!0)throw SyntaxError(h8("closing","]"));_=`\\${_}`}else f("brackets");$0({type:"bracket",value:_});continue}if(_==="]"){if(U.nobracket===!0||b&&b.type==="bracket"&&b.value.length===1){$0({type:"text",value:_,output:`\\${_}`});continue}if(j.brackets===0){if(U.strictBrackets===!0)throw SyntaxError(h8("opening","["));$0({type:"text",value:_,output:`\\${_}`});continue}c("brackets");let e=b.value.slice(1);if(b.posix!==!0&&e[0]==="^"&&!e.includes("/"))_=`/${_}`;if(b.value+=_,y({value:_}),U.literalBrackets===!1||M$.hasRegexChars(e))continue;let N0=M$.escapeRegex(b.value);if(j.output=j.output.slice(0,-b.value.length),U.literalBrackets===!0){j.output+=N0,b.value=N0;continue}b.value=`(${Z}${N0}|${b.value})`,j.output+=b.value;continue}if(_==="{"&&U.nobrace!==!0){f("braces");let e={type:"brace",value:_,output:"(",outputIndex:j.output.length,tokensIndex:j.tokens.length};x.push(e),$0(e);continue}if(_==="}"){let e=x[x.length-1];if(U.nobrace===!0||!e){$0({type:"text",value:_,output:_});continue}let N0=")";if(e.dots===!0){let n0=J.slice(),GD=[];for(let d0=n0.length-1;d0>=0;d0--){if(J.pop(),n0[d0].type==="brace")break;if(n0[d0].type!=="dots")GD.unshift(n0[d0].value)}N0=Ir(GD,U),j.backtrack=!0}if(e.comma!==!0&&e.dots!==!0){let n0=j.output.slice(0,e.outputIndex),GD=j.tokens.slice(e.tokensIndex);e.value=e.output="\\{",_=N0="\\}",j.output=n0;for(let d0 of GD)j.output+=d0.output||d0.value}$0({type:"brace",value:_,output:N0}),c("braces"),x.pop();continue}if(_==="|"){if(R.length>0)R[R.length-1].conditions++;$0({type:"text",value:_});continue}if(_===","){let e=_,N0=x[x.length-1];if(N0&&m[m.length-1]==="braces")N0.comma=!0,e="|";$0({type:"comma",value:_,output:e});continue}if(_==="/"){if(b.type==="dot"&&j.index===j.start+1){j.start=j.index+1,j.consumed="",j.output="",J.pop(),b=Y;continue}$0({type:"slash",value:_,output:G});continue}if(_==="."){if(j.braces>0&&b.type==="dot"){if(b.value===".")b.output=W;let e=x[x.length-1];b.type="dots",b.output+=_,b.value+=_,e.dots=!0;continue}if(j.braces+j.parens===0&&b.type!=="bos"&&b.type!=="slash"){$0({type:"text",value:_,output:W});continue}$0({type:"dot",value:_,output:W});continue}if(_==="?"){if(!(b&&b.value==="(")&&U.noextglob!==!0&&L()==="("&&L(2)!=="?"){V0("qmark",_);continue}if(b&&b.type==="paren"){let N0=L(),n0=_;if(b.value==="("&&!/[!=<:]/.test(N0)||N0==="<"&&!/<([!=]|\w+>)/.test(u()))n0=`\\${_}`;$0({type:"text",value:_,output:n0});continue}if(U.dot!==!0&&(b.type==="slash"||b.type==="bos")){$0({type:"qmark",value:_,output:I});continue}$0({type:"qmark",value:_,output:w});continue}if(_==="!"){if(U.noextglob!==!0&&L()==="("){if(L(2)!=="?"||!/[!=<:]/.test(L(3))){V0("negate",_);continue}}if(U.nonegate!==!0&&j.index===0){D0();continue}}if(_==="+"){if(U.noextglob!==!0&&L()==="("&&L(2)!=="?"){V0("plus",_);continue}if(b&&b.value==="("||U.regex===!1){$0({type:"plus",value:_,output:z});continue}if(b&&(b.type==="bracket"||b.type==="paren"||b.type==="brace")||j.parens>0){$0({type:"plus",value:_});continue}$0({type:"plus",value:z});continue}if(_==="@"){if(U.noextglob!==!0&&L()==="("&&L(2)!=="?"){$0({type:"at",extglob:!0,value:_,output:""});continue}$0({type:"text",value:_});continue}if(_!=="*"){if(_==="$"||_==="^")_=`\\${_}`;let e=Hr.exec(u());if(e)_+=e[0],j.index+=e[0].length;$0({type:"text",value:_});continue}if(b&&(b.type==="globstar"||b.star===!0)){b.type="star",b.star=!0,b.value+=_,b.output=v,j.backtrack=!0,j.globstar=!0,h(_);continue}let s=u();if(U.noextglob!==!0&&/^\([^?]/.test(s)){V0("star",_);continue}if(b.type==="star"){if(U.noglobstar===!0){h(_);continue}let e=b.prev,N0=e.prev,n0=e.type==="slash"||e.type==="bos",GD=N0&&(N0.type==="star"||N0.type==="globstar");if(U.bash===!0&&(!n0||s[0]&&s[0]!=="/")){$0({type:"star",value:_,output:""});continue}let d0=j.braces>0&&(e.type==="comma"||e.type==="brace"),H6=R.length&&(e.type==="pipe"||e.type==="paren");if(!n0&&e.type!=="paren"&&!d0&&!H6){$0({type:"star",value:_,output:""});continue}while(s.slice(0,3)==="/**"){let B6=D[j.index+4];if(B6&&B6!=="/")break;s=s.slice(3),h("/**",3)}if(e.type==="bos"&&A()){b.type="globstar",b.value+=_,b.output=P(U),j.output=b.output,j.globstar=!0,h(_);continue}if(e.type==="slash"&&e.prev.type!=="bos"&&!GD&&A()){j.output=j.output.slice(0,-(e.output+b.output).length),e.output=`(?:${e.output}`,b.type="globstar",b.output=P(U)+(U.strictSlashes?")":"|$)"),b.value+=_,j.globstar=!0,j.output+=e.output+b.output,h(_);continue}if(e.type==="slash"&&e.prev.type!=="bos"&&s[0]==="/"){let B6=s[1]!==void 0?"|$":"";j.output=j.output.slice(0,-(e.output+b.output).length),e.output=`(?:${e.output}`,b.type="globstar",b.output=`${P(U)}${G}|${G}${B6})`,b.value+=_,j.output+=e.output+b.output,j.globstar=!0,h(_+M()),$0({type:"slash",value:"/",output:""});continue}if(e.type==="bos"&&s[0]==="/"){b.type="globstar",b.value+=_,b.output=`(?:^|${G}|${P(U)}${G})`,j.output=b.output,j.globstar=!0,h(_+M()),$0({type:"slash",value:"/",output:""});continue}j.output=j.output.slice(0,-b.output.length),b.type="globstar",b.output=P(U),b.value+=_,j.output+=b.output,j.globstar=!0,h(_);continue}let f0={type:"star",value:_,output:v};if(U.bash===!0){if(f0.output=".*?",b.type==="bos"||b.type==="slash")f0.output=k+f0.output;$0(f0);continue}if(b&&(b.type==="bracket"||b.type==="paren")&&U.regex===!0){f0.output=_,$0(f0);continue}if(j.index===j.start||b.type==="slash"||b.type==="dot"){if(b.type==="dot")j.output+=H,b.output+=H;else if(U.dot===!0)j.output+=O,b.output+=O;else j.output+=k,b.output+=k;if(L()!=="*")j.output+=K,b.output+=K}$0(f0)}while(j.brackets>0){if(U.strictBrackets===!0)throw SyntaxError(h8("closing","]"));j.output=M$.escapeLast(j.output,"["),c("brackets")}while(j.parens>0){if(U.strictBrackets===!0)throw SyntaxError(h8("closing",")"));j.output=M$.escapeLast(j.output,"("),c("parens")}while(j.braces>0){if(U.strictBrackets===!0)throw SyntaxError(h8("closing","}"));j.output=M$.escapeLast(j.output,"{"),c("braces")}if(U.strictSlashes!==!0&&(b.type==="star"||b.type==="bracket"))$0({type:"maybe_slash",value:"",output:`${G}?`});if(j.backtrack===!0){j.output="";for(let s of j.tokens)if(j.output+=s.output!=null?s.output:s.value,s.suffix)j.output+=s.suffix}return j};dq.fastpaths=(D,$)=>{let U={...$},X=typeof U.maxLength==="number"?Math.min(mU,U.maxLength):mU,Q=D.length;if(Q>X)throw SyntaxError(`Input length: ${Q}, exceeds maximum allowed length: ${X}`);D=hj[D]||D;let{DOT_LITERAL:Y,SLASH_LITERAL:J,ONE_CHAR:Z,DOTS_SLASH:q,NO_DOT:F,NO_DOTS:W,NO_DOTS_SLASH:z,STAR:G,START_ANCHOR:K}=M5.globChars(U.windows),V=U.dot?W:F,B=U.dot?z:F,H=U.capture?"":"?:",O={negated:!1,prefix:""},w=U.bash===!0?".*?":G;if(U.capture)w=`(${w})`;let I=(k)=>{if(k.noglobstar===!0)return w;return`(${H}(?:(?!${K}${k.dot?q:Y}).)*?)`},N=(k)=>{switch(k){case"*":return`${V}${Z}${w}`;case".*":return`${Y}${Z}${w}`;case"*.*":return`${V}${w}${Y}${Z}${w}`;case"*/*":return`${V}${w}${J}${Z}${B}${w}`;case"**":return V+I(U);case"**/*":return`(?:${V}${I(U)}${J})?${B}${Z}${w}`;case"**/*.*":return`(?:${V}${I(U)}${J})?${B}${w}${Y}${Z}${w}`;case"**/.*":return`(?:${V}${I(U)}${J})?${Y}${Z}${w}`;default:{let T=/^(.*?)\.(\w+)$/.exec(k);if(!T)return;let v=N(T[1]);if(!v)return;return v+Y+T[2]}}},E=M$.removePrefix(D,O),P=N(E);if(P&&U.strictSlashes!==!0)P+=`${J}?`;return P};cj.exports=dq});var rj=S((HC0,nj)=>{var Mr=mj(),cq=pj(),ij=N5(),Rr=L5(),Ar=(D)=>D&&typeof D==="object"&&!Array.isArray(D),ID=(D,$,U=!1)=>{if(Array.isArray(D)){let W=D.map((G)=>ID(G,$,U));return(G)=>{for(let K of W){let V=K(G);if(V)return V}return!1}}let X=Ar(D)&&D.tokens&&D.input;if(D===""||typeof D!=="string"&&!X)throw TypeError("Expected pattern to be a non-empty string");let Q=$||{},Y=Q.windows,J=X?ID.compileRe(D,$):ID.makeRe(D,$,!1,!0),Z=J.state;delete J.state;let q=()=>!1;if(Q.ignore){let W={...$,ignore:null,onMatch:null,onResult:null};q=ID(Q.ignore,W,U)}let F=(W,z=!1)=>{let{isMatch:G,match:K,output:V}=ID.test(W,J,$,{glob:D,posix:Y}),B={glob:D,state:Z,regex:J,posix:Y,input:W,output:V,match:K,isMatch:G};if(typeof Q.onResult==="function")Q.onResult(B);if(G===!1)return B.isMatch=!1,z?B:!1;if(q(W)){if(typeof Q.onIgnore==="function")Q.onIgnore(B);return B.isMatch=!1,z?B:!1}if(typeof Q.onMatch==="function")Q.onMatch(B);return z?B:!0};if(U)F.state=Z;return F};ID.test=(D,$,U,{glob:X,posix:Q}={})=>{if(typeof D!=="string")throw TypeError("Expected input to be a string");if(D==="")return{isMatch:!1,output:""};let Y=U||{},J=Y.format||(Q?ij.toPosixSlashes:null),Z=D===X,q=Z&&J?J(D):D;if(Z===!1)q=J?J(D):D,Z=q===X;if(Z===!1||Y.capture===!0)if(Y.matchBase===!0||Y.basename===!0)Z=ID.matchBase(D,$,U,Q);else Z=$.exec(q);return{isMatch:Boolean(Z),match:Z,output:q}};ID.matchBase=(D,$,U)=>{return($ instanceof RegExp?$:ID.makeRe($,U)).test(ij.basename(D))};ID.isMatch=(D,$,U)=>ID($,U)(D);ID.parse=(D,$)=>{if(Array.isArray(D))return D.map((U)=>ID.parse(U,$));return cq(D,{...$,fastpaths:!1})};ID.scan=(D,$)=>Mr(D,$);ID.compileRe=(D,$,U=!1,X=!1)=>{if(U===!0)return D.output;let Q=$||{},Y=Q.contains?"":"^",J=Q.contains?"":"$",Z=`${Y}(?:${D.output})${J}`;if(D&&D.negated===!0)Z=`^(?!${Z}).*$`;let q=ID.toRegex(Z,$);if(X===!0)q.state=D;return q};ID.makeRe=(D,$={},U=!1,X=!1)=>{if(!D||typeof D!=="string")throw TypeError("Expected a non-empty string");let Q={negated:!1,fastpaths:!0};if($.fastpaths!==!1&&(D[0]==="."||D[0]==="*"))Q.output=cq.fastpaths(D,$);if(!Q.output)Q=cq(D,$);return ID.compileRe(Q,$,U,X)};ID.toRegex=(D,$)=>{try{let U=$||{};return new RegExp(D,U.flags||(U.nocase?"i":""))}catch(U){if($&&$.debug===!0)throw U;return/$^/}};ID.constants=Rr;nj.exports=ID});var tj=S((BC0,sj)=>{var aj=rj(),Er=N5();function oj(D,$,U=!1){if($&&($.windows===null||$.windows===void 0))$={...$,windows:Er.isWindows()};return aj(D,$,U)}Object.assign(oj,aj);sj.exports=oj});var _0=S((qa)=>{var iq=Symbol.for("yaml.alias"),WM=Symbol.for("yaml.document"),hU=Symbol.for("yaml.map"),zM=Symbol.for("yaml.pair"),nq=Symbol.for("yaml.scalar"),lU=Symbol.for("yaml.seq"),f6=Symbol.for("yaml.node.type"),$a=(D)=>!!D&&typeof D==="object"&&D[f6]===iq,Ua=(D)=>!!D&&typeof D==="object"&&D[f6]===WM,Xa=(D)=>!!D&&typeof D==="object"&&D[f6]===hU,Qa=(D)=>!!D&&typeof D==="object"&&D[f6]===zM,GM=(D)=>!!D&&typeof D==="object"&&D[f6]===nq,Ya=(D)=>!!D&&typeof D==="object"&&D[f6]===lU;function KM(D){if(D&&typeof D==="object")switch(D[f6]){case hU:case lU:return!0}return!1}function Ja(D){if(D&&typeof D==="object")switch(D[f6]){case iq:case hU:case nq:case lU:return!0}return!1}var Za=(D)=>(GM(D)||KM(D))&&!!D.anchor;qa.ALIAS=iq;qa.DOC=WM;qa.MAP=hU;qa.NODE_TYPE=f6;qa.PAIR=zM;qa.SCALAR=nq;qa.SEQ=lU;qa.hasAnchor=Za;qa.isAlias=$a;qa.isCollection=KM;qa.isDocument=Ua;qa.isMap=Xa;qa.isNode=Ja;qa.isPair=Qa;qa.isScalar=GM;qa.isSeq=Ya});var A5=S((Aa)=>{var ED=_0(),K$=Symbol("break visit"),VM=Symbol("skip children"),O6=Symbol("remove node");function dU(D,$){let U=HM($);if(ED.isDocument(D)){if(d8(null,D.contents,U,Object.freeze([D]))===O6)D.contents=null}else d8(null,D,U,Object.freeze([]))}dU.BREAK=K$;dU.SKIP=VM;dU.REMOVE=O6;function d8(D,$,U,X){let Q=BM(D,$,U,X);if(ED.isNode(Q)||ED.isPair(Q))return IM(D,X,Q),d8(D,Q,U,X);if(typeof Q!=="symbol"){if(ED.isCollection($)){X=Object.freeze(X.concat($));for(let Y=0;Y<$.items.length;++Y){let J=d8(Y,$.items[Y],U,X);if(typeof J==="number")Y=J-1;else if(J===K$)return K$;else if(J===O6)$.items.splice(Y,1),Y-=1}}else if(ED.isPair($)){X=Object.freeze(X.concat($));let Y=d8("key",$.key,U,X);if(Y===K$)return K$;else if(Y===O6)$.key=null;let J=d8("value",$.value,U,X);if(J===K$)return K$;else if(J===O6)$.value=null}}return Q}async function cU(D,$){let U=HM($);if(ED.isDocument(D)){if(await c8(null,D.contents,U,Object.freeze([D]))===O6)D.contents=null}else await c8(null,D,U,Object.freeze([]))}cU.BREAK=K$;cU.SKIP=VM;cU.REMOVE=O6;async function c8(D,$,U,X){let Q=await BM(D,$,U,X);if(ED.isNode(Q)||ED.isPair(Q))return IM(D,X,Q),c8(D,Q,U,X);if(typeof Q!=="symbol"){if(ED.isCollection($)){X=Object.freeze(X.concat($));for(let Y=0;Y<$.items.length;++Y){let J=await c8(Y,$.items[Y],U,X);if(typeof J==="number")Y=J-1;else if(J===K$)return K$;else if(J===O6)$.items.splice(Y,1),Y-=1}}else if(ED.isPair($)){X=Object.freeze(X.concat($));let Y=await c8("key",$.key,U,X);if(Y===K$)return K$;else if(Y===O6)$.key=null;let J=await c8("value",$.value,U,X);if(J===K$)return K$;else if(J===O6)$.value=null}}return Q}function HM(D){if(typeof D==="object"&&(D.Collection||D.Node||D.Value))return Object.assign({Alias:D.Node,Map:D.Node,Scalar:D.Node,Seq:D.Node},D.Value&&{Map:D.Value,Scalar:D.Value,Seq:D.Value},D.Collection&&{Map:D.Collection,Seq:D.Collection},D);return D}function BM(D,$,U,X){if(typeof U==="function")return U(D,$,X);if(ED.isMap($))return U.Map?.(D,$,X);if(ED.isSeq($))return U.Seq?.(D,$,X);if(ED.isPair($))return U.Pair?.(D,$,X);if(ED.isScalar($))return U.Scalar?.(D,$,X);if(ED.isAlias($))return U.Alias?.(D,$,X);return}function IM(D,$,U){let X=$[$.length-1];if(ED.isCollection(X))X.items[D]=U;else if(ED.isPair(X))if(D==="key")X.key=U;else X.value=U;else if(ED.isDocument(X))X.contents=U;else{let Q=ED.isAlias(X)?"alias":"scalar";throw Error(`Cannot replace node with ${Q} parent`)}}Aa.visit=dU;Aa.visitAsync=cU});var rq=S((va)=>{var OM=_0(),Pa=A5(),Sa={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Ca=(D)=>D.replace(/[!,[\]{}]/g,($)=>Sa[$]);class y${constructor(D,$){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},y$.defaultYaml,D),this.tags=Object.assign({},y$.defaultTags,$)}clone(){let D=new y$(this.yaml,this.tags);return D.docStart=this.docStart,D}atDocument(){let D=new y$(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:y$.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},y$.defaultTags);break}return D}add(D,$){if(this.atNextDocument)this.yaml={explicit:y$.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},y$.defaultTags),this.atNextDocument=!1;let U=D.trim().split(/[ \t]+/),X=U.shift();switch(X){case"%TAG":{if(U.length!==2){if($(0,"%TAG directive should contain exactly two parts"),U.length<2)return!1}let[Q,Y]=U;return this.tags[Q]=Y,!0}case"%YAML":{if(this.yaml.explicit=!0,U.length!==1)return $(0,"%YAML directive should contain exactly one part"),!1;let[Q]=U;if(Q==="1.1"||Q==="1.2")return this.yaml.version=Q,!0;else{let Y=/^\d+\.\d+$/.test(Q);return $(6,`Unsupported YAML version ${Q}`,Y),!1}}default:return $(0,`Unknown directive ${X}`,!0),!1}}tagName(D,$){if(D==="!")return"!";if(D[0]!=="!")return $(`Not a valid tag: ${D}`),null;if(D[1]==="<"){let Y=D.slice(2,-1);if(Y==="!"||Y==="!!")return $(`Verbatim tags aren't resolved, so ${D} is invalid.`),null;if(D[D.length-1]!==">")$("Verbatim tags must end with a >");return Y}let[,U,X]=D.match(/^(.*!)([^!]*)$/s);if(!X)$(`The ${D} tag has no suffix`);let Q=this.tags[U];if(Q)try{return Q+decodeURIComponent(X)}catch(Y){return $(String(Y)),null}if(U==="!")return D;return $(`Could not resolve tag: ${D}`),null}tagString(D){for(let[$,U]of Object.entries(this.tags))if(D.startsWith(U))return $+Ca(D.substring(U.length));return D[0]==="!"?D:`!<${D}>`}toString(D){let $=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],U=Object.entries(this.tags),X;if(D&&U.length>0&&OM.isNode(D.contents)){let Q={};Pa.visit(D.contents,(Y,J)=>{if(OM.isNode(J)&&J.tag)Q[J.tag]=!0}),X=Object.keys(Q)}else X=[];for(let[Q,Y]of U){if(Q==="!!"&&Y==="tag:yaml.org,2002:")continue;if(!D||X.some((J)=>J.startsWith(Y)))$.push(`%TAG ${Q} ${Y}`)}return $.join(`
1
+ import{createRequire as fi}from"node:module";var vi=Object.create;var{getPrototypeOf:bi,defineProperty:w5,getOwnPropertyNames:Gj,getOwnPropertyDescriptor:_i}=Object,Kj=Object.prototype.hasOwnProperty;function Vj(D){return this[D]}var ki,ui,oD=(D,$,U)=>{var X=D!=null&&typeof D==="object";if(X){var Q=$?ki??=new WeakMap:ui??=new WeakMap,Y=Q.get(D);if(Y)return Y}U=D!=null?vi(bi(D)):{};let J=$||!D||!D.__esModule?w5(U,"default",{value:D,enumerable:!0}):U;for(let Z of Gj(D))if(!Kj.call(J,Z))w5(J,Z,{get:Vj.bind(D,Z),enumerable:!0});if(X)Q.set(D,J);return J},K1=(D)=>{var $=(zj??=new WeakMap).get(D),U;if($)return $;if($=w5({},"__esModule",{value:!0}),D&&typeof D==="object"||typeof D==="function"){for(var X of Gj(D))if(!Kj.call($,X))w5($,X,{get:Vj.bind(D,X),enumerable:!(U=_i(D,X))||U.enumerable})}return zj.set(D,$),$},zj,S=(D,$)=>()=>($||D(($={exports:{}}).exports,$),$.exports);var xi=(D)=>D;function gi(D,$){this[D]=xi.bind(null,$)}var lD=(D,$)=>{for(var U in $)w5(D,U,{get:$[U],enumerable:!0,configurable:!0,set:gi.bind($,U)})};var l=(D,$)=>()=>(D&&($=D(D=0)),$);var X0=fi(import.meta.url);var s$;var m8=l(()=>{s$={name:"@capgo/cli",type:"module",version:"8.53.1",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/capgo/tree/main/cli#readme",repository:{type:"git",url:"https://github.com/Cap-go/capgo.app",directory:"cli"},bugs:{url:"https://github.com/Cap-go/capgo/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli","sdk","tanstack-intent"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",bin:{capgo:"dist/index.js"},files:["!skills/_artifacts","dist","skills"],engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && bun build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"bunx --bun supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",typecheck:"tsgo --project tsconfig.tsgo.json --noEmit",lint:"bun run lint:ox","lint:ox":"oxlint --config ../.oxlintrc.json src","lint:fix":"oxlint --config ../.oxlintrc.json --fix src","check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test:notify-app-ready-background":"bun test ./test/test-notify-app-ready-background.mjs","test:bundle":"bun test/test-bundle.mjs","test:bundle-validation":"bun test test/bundle/","test:prescan":"bun test test/prescan/","test:functional":"bun test/test-functional.mjs","test:semver":"bun test/test-semver-validation.mjs","test:version-edge-cases":"bun test/test-version-validation.mjs","test:regex":"bun test/test-regex-validation.mjs","test:upload":"bun test/test-upload-validation.mjs","test:fail-on-incompatible":"bun test/test-fail-on-incompatible.mjs","test:native-dependencies":"bun test/test-native-dependencies.mjs && bun test/test-get-remote-dependencies.mjs","test:package-json-guard":"bun test/test-package-json-guard.mjs","test:credentials":"bun test/test-credentials.mjs","test:credentials-export":"bun test/test-credentials-export.mjs","test:asc-key-protocol":"bun test/test-asc-key-protocol.mjs","test:credentials-validation":"bun test/test-credentials-validation.mjs","test:android-service-account-validation":"bun test/test-android-service-account-validation.mjs","test:build-zip-filter":"bun test/test-build-zip-filter.mjs","test:checksum":"bun test/test-checksum-algorithm.mjs","test:build-needed":"bun test/test-build-needed.mjs","test:cli-help":"bun test/test-cli-help.mjs","test:build-cache-payload":"bun test/test-build-cache-payload.mjs","test:build-cancellation":"bun test/test-build-cancellation.mjs","test:ci-prompts":"bun test/test-ci-prompts.mjs","test:ci-secrets":"bun test/test-ci-secrets.mjs","test:android-onboarding-progress":"bun test/test-android-onboarding-progress.mjs","test:onboarding-telemetry":"bun test/test-onboarding-telemetry.mjs","test:v2-event-migration":"bun test/test-v2-event-migration.mjs","test:analytics":"bun test/test-analytics.mjs","test:cli-headers":"bun test/test-cli-headers.mjs","test:min-cli-version":"bun test/test-min-cli-version.mjs","test:authenticated-command-invocation":"bun test/test-authenticated-command-invocation.mjs","test:analytics-error-category":"bun test/test-analytics-error-category.mjs","test:analytics-org-resolver":"bun test/test-analytics-org-resolver.mjs","test:supabase-perf":"bun test/test-supabase-perf.mjs","test:preview-qr":"bun test/test-preview-qr.mjs","test:mcp-analytics":"bun test/test-mcp-analytics.mjs","test:mcp-instructions":"bun test/test-mcp-instructions.mjs","test:mcp-stdout-guard":"bun test/test-mcp-stdout-guard.mjs","test:mcp-platform-select":"bun test/test-mcp-platform-select.mjs","test:mcp-explain-scopes":"bun test/test-mcp-explain-scopes.mjs","test:mcp-oauth-reopen":"bun test/test-mcp-oauth-reopen.mjs","test:mcp-broker-oauth":"bun test/test-mcp-broker-oauth.mjs","test:mcp-broker-session":"bun test/test-mcp-broker-session.mjs","test:mcp-credentials-manage":"bun test/test-mcp-credentials-manage.mjs","test:mcp-resume-prompt":"bun test/test-mcp-resume-prompt.mjs","test:mcp-build-job":"bun test/test-mcp-build-job.mjs","test:mcp-build-tools":"bun test/test-mcp-build-tools.mjs","test:app-created-source":"bun test/test-app-created-source.mjs","test:app-add-exists":"bun test/test-app-add-exists.mjs","test:app-list-output-text":"bun test/test-app-list-output-text.mjs","test:doctor-analytics":"bun test/test-doctor-analytics.mjs","test:posthog-exception":"bun test/test-posthog-exception.mjs","test:cli-recovery":"bun test/test-cli-recovery.mjs","test:create-supabase-client":"bun test/test-create-supabase-client.mjs","test:onboarding-recovery":"bun test/test-onboarding-recovery.mjs","test:onboarding-progress":"bun test/test-onboarding-progress.mjs","test:onboarding-run-targets":"bun test/test-onboarding-run-targets.mjs","test:run-device-command":"bun test/test-run-device-command.mjs","test:init-app-conflict":"bun test/test-init-app-conflict.mjs","test:channel-add-exists":"bun test/test-channel-add-exists.mjs","test:wait-log":"bun test/test-wait-log.mjs","test:init-guardrails":"bun test/test-init-guardrails.mjs","test:init-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: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:init-monorepo-targeting":"bun run test:capacitor-config-target && bun run test:capacitor-config-typescript7 && bun run test:capacitor-config-native-import && bun run test:cli-user-error-config && bun test/test-init-monorepo-targeting.mjs","test:prompt-preferences":"bun test/test-prompt-preferences.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:auth-session":"bun test/test-auth-session.mjs","test:mcp":"node test/test-mcp.mjs","test:mcp-no-key-handshake":"node test/test-mcp-no-key-handshake.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs","test:project-type-detection":"bun test/test-project-type-detection.mjs","test:payload-split":"bun test/test-payload-split.mjs","test:macos-signing":"bun test/test-macos-signing.mjs","test:helper-dce":"bash scripts/check-helper-dce.sh","test:apple-api-import-helpers":"bun test/test-apple-api-import-helpers.mjs","test:apple-api-verify-key":"bun test/test-apple-api-verify-key.mjs","test:bundle-id-detector":"bun test/test-bundle-id-detector.mjs","test:apple-api-app-list":"bun test/test-apple-api-app-list.mjs","test:apple-api-cert-create":"bun test/test-apple-api-cert-create.mjs","test:app-verification":"bun test/test-app-verification.mjs","test:pbxproj-parser":"bun test/test-pbxproj-parser.mjs","test:manifest-path-encoding":"bun test/test-manifest-path-encoding.mjs","test:self-update":"bun test/test-self-update.mjs","test:update-prompt":"bun test/test-update-prompt.mjs","test:android-tail-engine":"bun test/test-android-tail-engine.mjs","test:android-tail-render":"bun test/test-android-tail-render.mjs","test:android-tail-routing":"bun test/test-android-tail-routing.mjs","test:dev-gate-stripped":"bun test/test-dev-gate-stripped.mjs","test:frame-fit-ios-shared":"bun test/test-frame-fit-ios-shared.mjs","test:ios-confirm-app-id":"bun test/test-ios-confirm-app-id.mjs","test:ios-create-new":"bun test/test-ios-create-new.mjs","test:ios-e2e":"bun test/test-ios-e2e.mjs","test:ios-flow-contract":"bun test/test-ios-flow-contract.mjs","test:ios-import-discovery":"bun test/test-ios-import-discovery.mjs","test:ios-import-export":"bun test/test-ios-import-export.mjs","test:ios-import-pickers":"bun test/test-ios-import-pickers.mjs","test:ios-import-recovery":"bun test/test-ios-import-recovery.mjs","test:ios-recovery":"bun test/test-ios-recovery.mjs","test:ios-resume":"bun test/test-ios-resume.mjs","test:ios-tail-handoff":"bun test/test-ios-tail-handoff.mjs","test:ios-tui-render":"bun test/test-ios-tui-render.mjs","test:p8-error":"bun test/test-p8-error.mjs","test:ios-tui-routing":"bun test/test-ios-tui-routing.mjs","test:ios-updater-sync-validation":"bun test/test-ios-updater-sync-validation.mjs","test:ios-verify-app":"bun test/test-ios-verify-app.mjs","test:ios-marketing-version":"bun test/test-ios-marketing-version.mjs","test:android-version":"bun test/test-android-version.mjs","test:platform-flow-contract":"bun test/test-platform-flow-contract.mjs","test:tail-engine-shared":"bun test/test-tail-engine-shared.mjs",test:"bun run build && bun run test:helper-dce && bun run test:version-detection:setup && bun run test:bundle && bun run test:notify-app-ready-background && bun run test:bundle-validation && bun run test:functional && bun run test:semver && bun run test:auto-bump-version && bun run test:auto-bump-ai-diff && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:fail-on-incompatible && bun run test:native-dependencies && bun run test:package-json-guard && bun run test:credentials && bun run test:credentials-export && bun run test:ios-provisioning-map && bun run test:ios-provisioning-command && bun run test:credentials-validation && bun run test:android-service-account-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:build-needed && bun run test:cli-help && bun run test:build-cache-payload && bun run test:build-cancellation && bun run test:ci-prompts && bun run test:ci-secrets && bun run test:android-onboarding-progress && bun run test:onboarding-telemetry && bun run test:v2-event-migration && bun run test:analytics && bun run test:cli-headers && bun run test:min-cli-version && bun run test:authenticated-command-invocation && bun run test:analytics-error-category && bun run test:analytics-org-resolver && bun run test:supabase-perf && bun run test:preview-qr && bun run test:app-set-options && bun run test:mcp-analytics && bun run test:mcp-instructions && bun run test:mcp-live-update-onboarding && bun run test:mcp-stdout-guard && bun run test:mcp-platform-select && bun run test:mcp-explain-scopes && bun run test:mcp-oauth-reopen && bun run test:mcp-broker-oauth && bun run test:mcp-broker-session && bun run test:mcp-credentials-manage && bun run test:mcp-resume-prompt && bun run test:mcp-build-job && bun run test:mcp-build-tools && bun run test:app-created-source && bun run test:app-add-exists && bun run test:app-list-output-text && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:cli-recovery && bun run test:create-supabase-client && bun run test:build-platform-selection && bun run test:builder-project-discovery && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-monorepo-targeting && bun run test:init-app-conflict && bun run test:channel-list && bun run test:channel-add-exists && bun run test:wait-log && bun run test:init-guardrails && bun run test:init-upload-recovery && bun run test:init-replay && bun run test:init-telemetry && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:mcp-no-key-handshake && bun run test:auth-session && bun run test:version-detection && bun run test:platform-paths && bun run test:project-type-detection && bun run test:payload-split && bun run test:manifest-path-encoding && bun run test:macos-signing && bun run test:asc-key-protocol && bun run test:apple-api-import-helpers && bun run test:apple-api-verify-key && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:cicd-failure-help && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-upload-prompt && bun run test:support-bundle-files && bun run test:self-update && bun run test:update-prompt && bun run test:apple-api-cert-create && bun run test:android-tail-engine && bun run test:android-tail-render && bun run test:android-tail-routing && bun run test:dev-gate-stripped && bun run test:frame-fit-ios-shared && bun run test:ios-confirm-app-id && bun run test:ios-create-new && bun run test:ios-e2e && bun run test:ios-flow-contract && bun run test:ios-import-discovery && bun run test:ios-import-export && bun run test:ios-import-pickers && bun run test:ios-import-recovery && bun run test:ios-recovery && bun run test:ios-resume && bun run test:ios-tail-handoff && bun run test:ios-tui-render && bun run test:p8-error && bun run test:ios-tui-routing && bun run test:ios-updater-sync-validation && bun run test:ios-verify-app && bun run test:ios-marketing-version && bun run test:android-version && bun run test:platform-flow-contract && bun run test:tail-engine-shared && bun run test:prescan && bun run test:android-reporting-api && bun run test:android-gcp && bun run test:android-app-verification && bun run test:android-rename && bun run test:appflow-auth && bun run test:appflow-api-map && bun run test:appflow-validate && bun run test:appflow-flow && bun run test:appflow-gapfill && bun run test:appflow-engine && bun run test:appflow-tail && bun run test:appflow-fetch && bun run test:appflow-sa-decode && bun run test:app-permission-helper && bun run test:2fa-compliance-network && bun run test:organization-set-api-host && bun run test:trial-warning && bun run test:plan-validation","test:build-platform-selection":"bun test/test-build-platform-selection.mjs","test:builder-project-discovery":"bun test/test-builder-project-discovery.mjs","test:ai-log-capture":"bun test/test-ai-log-capture.mjs","test:ai-analyze-flow":"bun test/test-ai-analyze-flow.mjs","test:cicd-failure-help":"bun test/test-cicd-failure-help.mjs","test:ai-analyze-stream":"bun test/test-ai-analyze-stream.mjs","test:ai-sse-parser":"bun test/test-ai-sse-parser.mjs","test:ai-render-markdown":"bun test/test-ai-render-markdown.mjs","test:ai-onboarding-mode":"bun test/test-ai-onboarding-mode.mjs","test:ai-fit":"bun test/test-ai-fit.mjs","test:platform-layout":"bun test/test-platform-layout.mjs","test:frame-fit":"bun test/run-frame-fit.mjs","test:onboarding-min-size":"bun test/test-onboarding-min-size.mjs","test:min-size-gate":"bun test/test-min-size-gate.mjs","test:shell-size-gate":"bun test/test-shell-size-gate.mjs","test:build-log-sanitize":"bun test/test-build-log-sanitize.mjs","test:build-output-viewport":"bun test/test-build-output-viewport.mjs","test:diff-viewer-viewport":"bun test/test-diff-viewer-viewport.mjs","test:build-complete-exit":"bun test/test-build-complete-exit.mjs","test:ai-stream-markdown":"bun test/test-ai-stream-markdown.mjs","test:support-mailto":"bun test/test-support-mailto.mjs","test:support-redact":"bun test/test-support-redact.mjs","test:support-internal-log":"bun test/test-support-internal-log.mjs","test:support-help-menu":"bun test/test-support-help-menu.mjs","test:support-contact":"bun test/test-support-contact.mjs","test:support-upload-prompt":"bun test/test-support-upload-prompt.mjs","test:support-bundle-files":"bun test/test-support-bundle-files.mjs","test:mcp-live-update-onboarding":"bun test/test-mcp-live-update-onboarding.mjs","test:app-set-options":"bun test/test-app-set-options.mjs && bun test/test-app-list-options.mjs","test:android-reporting-api":"bun test/test-android-reporting-api.mjs","test:android-gcp":"bun test/test-android-gcp.mjs","test:android-app-verification":"bun test/test-android-app-verification.mjs","test:android-rename":"bun test/test-android-rename.mjs","test:appflow-auth":"bun test/test-appflow-auth.mjs","test:appflow-api-map":"bun test/test-appflow-api-map.mjs","test:appflow-validate":"bun test/test-appflow-validate.mjs","test:appflow-flow":"bun test/test-appflow-flow.mjs","test:appflow-gapfill":"bun test/test-appflow-gapfill.mjs","test:appflow-engine":"bun test/test-appflow-engine.mjs","test:appflow-tail":"bun test/test-appflow-tail.mjs","test:appflow-fetch":"bun test/test-appflow-fetch.mjs","test:appflow-sa-decode":"bun test/test-appflow-sa-decode.mjs","test:app-permission-helper":"bun test/test-app-permission-helper.mjs","test:2fa-compliance-network":"bun test/test-2fa-compliance-network.mjs","test:organization-set-api-host":"bun test/test-organization-set-api-host.mjs","test:trial-warning":"bun test/test-trial-warning.mjs","test:plan-validation":"bun test/test-plan-validation.mjs","test:auto-bump-version":"bun test/test-auto-bump-version.mjs","test:auto-bump-ai-diff":"bun test/test-auto-bump-ai-diff.mjs","test:ios-provisioning-map":"bun test/test-ios-provisioning-map.mjs","test:ios-provisioning-command":"bun test/test-ios-provisioning-command.mjs","test:channel-list":"bun test/test-channel-list.mjs"},dependencies:{"@inkjs/ui":"^2.0.0","@manypkg/tools":"^2.1.2","@rrweb/types":"^2.1.1","@standard-schema/spec":"^1.1.0","@xmldom/xmldom":"^0.9.10","@xterm/addon-serialize":"^0.14.0","@xterm/headless":"^6.0.0","agent-cli-detector":"^0.1.6","happy-dom":"^20.11.0",ink:"^7.1.1","ink-spinner":"^5.0.0",jsonwebtoken:"^9.0.3","node-forge":"^1.4.0",qrcode:"^1.5.4",react:"^19.2.8","rrweb-snapshot":"^2.1.1","string-width":"^8.2.2",typescript:"6.0.3",zod:"^4.4.3"},optionalDependencies:{"@capgo/cli-helper-darwin-arm64":"^1.1.1","@capgo/cli-helper-darwin-x64":"^1.1.1","node-pty":"^1.1.0"},devDependencies:{"@antfu/eslint-config":"^9.2.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.6","@capacitor/cli":"^8.4.2","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.7.0","@modelcontextprotocol/client":"^2.0.0-beta.5","@modelcontextprotocol/server":"^2.0.0-beta.5","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver@1.0.8","@supabase/supabase-js":"^2.110.8","@tanstack/intent":"^0.3.6","@types/adm-zip":"^0.5.8","@types/jsonwebtoken":"^9.0.10","@types/node":"^26.1.1","@types/node-forge":"^1.3.14","@types/prettyjson":"^0.0.33","@types/qrcode":"^1.5.6","@types/react":"^19.2.17","@types/tmp":"^0.2.6","@types/ws":"^8.18.1","@typescript/native-preview":"7.0.0-dev.20260707.2","@vercel/ncc":"^0.44.1","@vue/compiler-dom":"3.5.40","@xterm/headless":"^6.0.0","adm-zip":"^0.6.0","ci-info":"^4.4.0",commander:"^15.0.0",eslint:"^10.7.0","git-format-staged":"4.0.2",husky:"^9.1.7","is-wsl":"^3.1.1",micromatch:"^4.0.8",open:"^11.0.0",oxlint:"^1.75.0",partysocket:"^1.3.0",prettyjson:"^1.2.5",tmp:"^0.2.7","tus-js-client":"^4.3.1",ws:"^8.21.1"}}});var m0;var H4=l(()=>{m0=class m0 extends Error{context;constructor(D,$){super(D);this.name="CliUserError",this.context=$}}});import{platform as mi}from"node:os";import{version as hi}from"node:process";function Ij(D){Bj=D}function di(D){for(let $=0;$<D.length;$++)if(D.charCodeAt($)>255)return!1;return!0}function Hj(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 ci(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 kq(D,$){if($===void 0||$===null){if(_q.has(D.toLowerCase()))throw new m0(Hj(D));throw new m0(`HTTP header "${D}" is missing or invalid.`)}if(typeof $!=="string"){if(_q.has(D.toLowerCase()))throw new m0(Hj(D));throw new m0(`HTTP header "${D}" is missing or invalid.`)}if(!di($)){if(_q.has(D.toLowerCase()))throw new m0(ci(D));throw new m0(`HTTP header "${D}" contains invalid characters (only ASCII is allowed).`)}return $}function I6(D){let $={capgo_api:li,"x-cli-version":s$.version,"x-cli-command":Bj,"x-cli-node":hi,"x-cli-os":mi()};if(D)for(let[U,X]of Object.entries(D))$[U]=kq(U,X);return $}var li="2025-10-01",Bj="",_q;var fU=l(()=>{m8();H4();_q=new Set(["authorization","capgkey","x-capgo-log-token"])});var L5=S((zC0,Cj)=>{var Sj={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:"(?=.)",QMARK:"[^/]",END_ANCHOR:"(?:\\/|$)",DOTS_SLASH:"\\.{1,2}(?:\\/|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|\\/)\\.{1,2}(?:\\/|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:\\/|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:\\/|$))",QMARK_NO_DOT:"[^.\\/]",STAR:"[^/]*?",START_ANCHOR:"(?:^|\\/)",SEP:"/"},cn={...Sj,SLASH_LITERAL:"[\\\\/]",QMARK:"[^\\\\/]",STAR:"[^\\\\/]*?",DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},pn={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};Cj.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:65536,POSIX_REGEX_SOURCE:pn,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(D){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${D.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(D){return D===!0?cn:Sj}}});var N5=S((sn)=>{var{REGEX_BACKSLASH:nn,REGEX_REMOVE_BACKSLASH:rn,REGEX_SPECIAL_CHARS:an,REGEX_SPECIAL_CHARS_GLOBAL:on}=L5();sn.isObject=(D)=>D!==null&&typeof D==="object"&&!Array.isArray(D);sn.hasRegexChars=(D)=>an.test(D);sn.isRegexChar=(D)=>D.length===1&&sn.hasRegexChars(D);sn.escapeRegex=(D)=>D.replace(on,"\\$1");sn.toPosixSlashes=(D)=>D.replace(nn,"/");sn.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let D=navigator.platform.toLowerCase();return D==="win32"||D==="windows"}if(typeof process<"u"&&process.platform)return process.platform==="win32";return!1};sn.removeBackslashes=(D)=>{return D.replace(rn,($)=>{return $==="\\"?"":$})};sn.escapeLast=(D,$,U)=>{let X=D.lastIndexOf($,U);if(X===-1)return D;if(D[X-1]==="\\")return sn.escapeLast(D,$,X-1);return`${D.slice(0,X)}\\${D.slice(X)}`};sn.removePrefix=(D,$={})=>{let U=D;if(U.startsWith("./"))U=U.slice(2),$.prefix="./";return U};sn.wrapOutput=(D,$={},U={})=>{let X=U.contains?"":"^",Q=U.contains?"":"$",Y=`${X}(?:${D})${Q}`;if($.negated===!0)Y=`(?:^(?!${Y}).*$)`;return Y};sn.basename=(D,{windows:$}={})=>{let U=D.split($?/[\\/]/:"/"),X=U[U.length-1];if(X==="")return U[U.length-2];return X}});var mj=S((KC0,yj)=>{var _j=N5(),{CHAR_ASTERISK:gq,CHAR_AT:Zr,CHAR_BACKWARD_SLASH:j5,CHAR_COMMA:qr,CHAR_DOT:fq,CHAR_EXCLAMATION_MARK:yq,CHAR_FORWARD_SLASH:fj,CHAR_LEFT_CURLY_BRACE:mq,CHAR_LEFT_PARENTHESES:hq,CHAR_LEFT_SQUARE_BRACKET:Fr,CHAR_PLUS:Wr,CHAR_QUESTION_MARK:kj,CHAR_RIGHT_CURLY_BRACE:zr,CHAR_RIGHT_PARENTHESES:uj,CHAR_RIGHT_SQUARE_BRACKET:Gr}=L5(),xj=(D)=>{return D===fj||D===j5},gj=(D)=>{if(D.isPrefix!==!0)D.depth=D.isGlobstar?1/0:1},Kr=(D,$)=>{let U=$||{},X=D.length-1,Q=U.parts===!0||U.scanToEnd===!0,Y=[],J=[],Z=[],q=D,F=-1,W=0,z=0,G=!1,K=!1,V=!1,B=!1,H=!1,O=!1,w=!1,I=!1,N=!1,E=!1,P=0,k,T,v={value:"",depth:0,isGlob:!1},j=()=>F>=X,R=()=>q.charCodeAt(F+1),x=()=>{return k=T,q.charCodeAt(++F)};while(F<X){T=x();let L;if(T===j5){if(w=v.backslashes=!0,T=x(),T===mq)O=!0;continue}if(O===!0||T===mq){P++;while(j()!==!0&&(T=x())){if(T===j5){w=v.backslashes=!0,x();continue}if(T===mq){P++;continue}if(O!==!0&&T===fq&&(T=x())===fq){if(G=v.isBrace=!0,V=v.isGlob=!0,E=!0,Q===!0)continue;break}if(O!==!0&&T===qr){if(G=v.isBrace=!0,V=v.isGlob=!0,E=!0,Q===!0)continue;break}if(T===zr){if(P--,P===0){O=!1,G=v.isBrace=!0,E=!0;break}}}if(Q===!0)continue;break}if(T===fj){if(Y.push(F),J.push(v),v={value:"",depth:0,isGlob:!1},E===!0)continue;if(k===fq&&F===W+1){W+=2;continue}z=F+1;continue}if(U.noext!==!0){if((T===Wr||T===Zr||T===gq||T===kj||T===yq)===!0&&R()===hq){if(V=v.isGlob=!0,B=v.isExtglob=!0,E=!0,T===yq&&F===W)N=!0;if(Q===!0){while(j()!==!0&&(T=x())){if(T===j5){w=v.backslashes=!0,T=x();continue}if(T===uj){V=v.isGlob=!0,E=!0;break}}continue}break}}if(T===gq){if(k===gq)H=v.isGlobstar=!0;if(V=v.isGlob=!0,E=!0,Q===!0)continue;break}if(T===kj){if(V=v.isGlob=!0,E=!0,Q===!0)continue;break}if(T===Fr){while(j()!==!0&&(L=x())){if(L===j5){w=v.backslashes=!0,x();continue}if(L===Gr){K=v.isBracket=!0,V=v.isGlob=!0,E=!0;break}}if(Q===!0)continue;break}if(U.nonegate!==!0&&T===yq&&F===W){I=v.negated=!0,W++;continue}if(U.noparen!==!0&&T===hq){if(V=v.isGlob=!0,Q===!0){while(j()!==!0&&(T=x())){if(T===hq){w=v.backslashes=!0,T=x();continue}if(T===uj){E=!0;break}}continue}break}if(V===!0){if(E=!0,Q===!0)continue;break}}if(U.noext===!0)B=!1,V=!1;let m=q,b="",_="";if(W>0)b=q.slice(0,W),q=q.slice(W),z-=W;if(m&&V===!0&&z>0)m=q.slice(0,z),_=q.slice(z);else if(V===!0)m="",_=q;else m=q;if(m&&m!==""&&m!=="/"&&m!==q){if(xj(m.charCodeAt(m.length-1)))m=m.slice(0,-1)}if(U.unescape===!0){if(_)_=_j.removeBackslashes(_);if(m&&w===!0)m=_j.removeBackslashes(m)}let A={prefix:b,input:D,start:W,base:m,glob:_,isBrace:G,isBracket:K,isGlob:V,isExtglob:B,isGlobstar:H,negated:I,negatedExtglob:N};if(U.tokens===!0){if(A.maxDepth=0,!xj(T))J.push(v);A.tokens=J}if(U.parts===!0||U.tokens===!0){let L;for(let M=0;M<Y.length;M++){let u=L?L+1:W,h=Y[M],y=D.slice(u,h);if(U.tokens){if(M===0&&W!==0)J[M].isPrefix=!0,J[M].value=b;else J[M].value=y;gj(J[M]),A.maxDepth+=J[M].depth}if(M!==0||y!=="")Z.push(y);L=h}if(L&&L+1<D.length){let M=D.slice(L+1);if(Z.push(M),U.tokens)J[J.length-1].value=M,gj(J[J.length-1]),A.maxDepth+=J[J.length-1].depth}A.slashes=Y,A.parts=Z}return A};yj.exports=Kr});var pj=S((VC0,cj)=>{var M5=L5(),M$=N5(),{MAX_LENGTH:mU,POSIX_REGEX_SOURCE:Vr,REGEX_NON_SPECIAL_CHARS:Hr,REGEX_SPECIAL_CHARS_BACKREF:Br,REPLACEMENTS:hj}=M5,Ir=(D,$)=>{if(typeof $.expandRange==="function")return $.expandRange(...D,$);D.sort();let U=`[${D.join("-")}]`;try{new RegExp(U)}catch(X){return D.map((Q)=>M$.escapeRegex(Q)).join("..")}return U},h8=(D,$)=>{return`Missing ${D}: "${$}" - use "\\\\${$}" to match literal characters`},lj=(D)=>{let $=[],U=0,X=0,Q=0,Y="",J=!1;for(let Z of D){if(J===!0){Y+=Z,J=!1;continue}if(Z==="\\"){Y+=Z,J=!0;continue}if(Z==='"'){Q=Q===1?0:1,Y+=Z;continue}if(Q===0){if(Z==="[")U++;else if(Z==="]"&&U>0)U--;else if(U===0){if(Z==="(")X++;else if(Z===")"&&X>0)X--;else if(Z==="|"&&X===0){$.push(Y),Y="";continue}}}Y+=Z}return $.push(Y),$},Or=(D)=>{let $=!1;for(let U of D){if($===!0){$=!1;continue}if(U==="\\"){$=!0;continue}if(/[?*+@!()[\]{}]/.test(U))return!1}return!0},dj=(D)=>{let $=D.trim(),U=!0;while(U===!0)if(U=!1,/^@\([^\\()[\]{}|]+\)$/.test($))$=$.slice(2,-1),U=!0;if(!Or($))return;return $.replace(/\\(.)/g,"$1")},wr=(D)=>{let $=D.map(dj).filter(Boolean);for(let U=0;U<$.length;U++)for(let X=U+1;X<$.length;X++){let Q=$[U],Y=$[X],J=Q[0];if(!J||Q!==J.repeat(Q.length)||Y!==J.repeat(Y.length))continue;if(Q===Y||Q.startsWith(Y)||Y.startsWith(Q))return!0}return!1},lq=(D,$=!0)=>{if(D[0]!=="+"&&D[0]!=="*"||D[1]!=="(")return;let U=0,X=0,Q=0,Y=!1;for(let J=1;J<D.length;J++){let Z=D[J];if(Y===!0){Y=!1;continue}if(Z==="\\"){Y=!0;continue}if(Z==='"'){Q=Q===1?0:1;continue}if(Q===1)continue;if(Z==="["){U++;continue}if(Z==="]"&&U>0){U--;continue}if(U>0)continue;if(Z==="("){X++;continue}if(Z===")"){if(X--,X===0){if($===!0&&J!==D.length-1)return;return{type:D[0],body:D.slice(2,J),end:J}}}}},Lr=(D)=>{let $=0,U=[];while($<D.length){let Q=lq(D.slice($),!1);if(!Q||Q.type!=="*")return;let Y=lj(Q.body).map((Z)=>Z.trim());if(Y.length!==1)return;let J=dj(Y[0]);if(!J||J.length!==1)return;U.push(J),$+=Q.end+1}if(U.length<1)return;return`${U.length===1?M$.escapeRegex(U[0]):`[${U.map((Q)=>M$.escapeRegex(Q)).join("")}]`}*`},Nr=(D)=>{let $=0,U=D.trim(),X=lq(U);while(X)$++,U=X.body.trim(),X=lq(U);return $},jr=(D,$)=>{if($.maxExtglobRecursion===!1)return{risky:!1};let U=typeof $.maxExtglobRecursion==="number"?$.maxExtglobRecursion:M5.DEFAULT_MAX_EXTGLOB_RECURSION,X=lj(D).map((Q)=>Q.trim());if(X.length>1){if(X.some((Q)=>Q==="")||X.some((Q)=>/^[*?]+$/.test(Q))||wr(X))return{risky:!0}}for(let Q of X){let Y=Lr(Q);if(Y)return{risky:!0,safeOutput:Y};if(Nr(Q)>U)return{risky:!0}}return{risky:!1}},dq=(D,$)=>{if(typeof D!=="string")throw TypeError("Expected a string");D=hj[D]||D;let U={...$},X=typeof U.maxLength==="number"?Math.min(mU,U.maxLength):mU,Q=D.length;if(Q>X)throw SyntaxError(`Input length: ${Q}, exceeds maximum allowed length: ${X}`);let Y={type:"bos",value:"",output:U.prepend||""},J=[Y],Z=U.capture?"":"?:",q=M5.globChars(U.windows),F=M5.extglobChars(q),{DOT_LITERAL:W,PLUS_LITERAL:z,SLASH_LITERAL:G,ONE_CHAR:K,DOTS_SLASH:V,NO_DOT:B,NO_DOT_SLASH:H,NO_DOTS_SLASH:O,QMARK:w,QMARK_NO_DOT:I,STAR:N,START_ANCHOR:E}=q,P=(s)=>{return`(${Z}(?:(?!${E}${s.dot?V:W}).)*?)`},k=U.dot?"":B,T=U.dot?w:I,v=U.bash===!0?P(U):N;if(U.capture)v=`(${v})`;if(typeof U.noext==="boolean")U.noextglob=U.noext;let j={input:D,index:-1,start:0,dot:U.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:J};D=M$.removePrefix(D,j),Q=D.length;let R=[],x=[],m=[],b=Y,_,A=()=>j.index===Q-1,L=j.peek=(s=1)=>D[j.index+s],M=j.advance=()=>D[++j.index]||"",u=()=>D.slice(j.index+1),h=(s="",f0=0)=>{j.consumed+=s,j.index+=f0},y=(s)=>{j.output+=s.output!=null?s.output:s.value,h(s.value)},D0=()=>{let s=1;while(L()==="!"&&(L(2)!=="("||L(3)==="?"))M(),j.start++,s++;if(s%2===0)return!1;return j.negated=!0,j.start++,!0},f=(s)=>{j[s]++,m.push(s)},c=(s)=>{j[s]--,m.pop()},$0=(s)=>{if(b.type==="globstar"){let f0=j.braces>0&&(s.type==="comma"||s.type==="brace"),e=s.extglob===!0||R.length&&(s.type==="pipe"||s.type==="paren");if(s.type!=="slash"&&s.type!=="paren"&&!f0&&!e)j.output=j.output.slice(0,-b.output.length),b.type="star",b.value="*",b.output=v,j.output+=b.output}if(R.length&&s.type!=="paren")R[R.length-1].inner+=s.value;if(s.value||s.output)y(s);if(b&&b.type==="text"&&s.type==="text"){b.output=(b.output||b.value)+s.value,b.value+=s.value;return}s.prev=b,J.push(s),b=s},V0=(s,f0)=>{let e={...F[f0],conditions:1,inner:""};e.prev=b,e.parens=j.parens,e.output=j.output,e.startIndex=j.index,e.tokensIndex=J.length;let N0=(U.capture?"(":"")+e.open;f("parens"),$0({type:s,value:f0,output:j.output?"":K}),$0({type:"paren",extglob:!0,value:M(),output:N0}),R.push(e)},T0=(s)=>{let f0=D.slice(s.startIndex,j.index+1),e=D.slice(s.startIndex+2,j.index),N0=jr(e,U);if((s.type==="plus"||s.type==="star")&&N0.risky){let d0=N0.safeOutput?(s.output?"":K)+(U.capture?`(${N0.safeOutput})`:N0.safeOutput):void 0,H6=J[s.tokensIndex];H6.type="text",H6.value=f0,H6.output=d0||M$.escapeRegex(f0);for(let B6=s.tokensIndex+1;B6<J.length;B6++)J[B6].value="",J[B6].output="",delete J[B6].suffix;j.output=s.output+H6.output,j.backtrack=!0,$0({type:"paren",extglob:!0,value:_,output:""}),c("parens");return}let n0=s.close+(U.capture?")":""),GD;if(s.type==="negate"){let d0=v;if(s.inner&&s.inner.length>1&&s.inner.includes("/"))d0=P(U);if(d0!==v||A()||/^\)+$/.test(u()))n0=s.close=`)$))${d0}`;if(s.inner.includes("*")&&(GD=u())&&/^\.[^\\/.]+$/.test(GD)){let H6=dq(GD,{...$,fastpaths:!1}).output;n0=s.close=`)${H6})${d0})`}if(s.prev.type==="bos")j.negatedExtglob=!0}$0({type:"paren",extglob:!0,value:_,output:n0}),c("parens")};if(U.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(D)){let s=!1,f0=D.replace(Br,(e,N0,n0,GD,d0,H6)=>{if(GD==="\\")return s=!0,e;if(GD==="?"){if(N0)return N0+GD+(d0?w.repeat(d0.length):"");if(H6===0)return T+(d0?w.repeat(d0.length):"");return w.repeat(n0.length)}if(GD===".")return W.repeat(n0.length);if(GD==="*"){if(N0)return N0+GD+(d0?v:"");return v}return N0?e:`\\${e}`});if(s===!0)if(U.unescape===!0)f0=f0.replace(/\\/g,"");else f0=f0.replace(/\\+/g,(e)=>{return e.length%2===0?"\\\\":e?"\\":""});if(f0===D&&U.contains===!0)return j.output=D,j;return j.output=M$.wrapOutput(f0,j,$),j}while(!A()){if(_=M(),_==="\x00")continue;if(_==="\\"){let e=L();if(e==="/"&&U.bash!==!0)continue;if(e==="."||e===";")continue;if(!e){_+="\\",$0({type:"text",value:_});continue}let N0=/^\\+/.exec(u()),n0=0;if(N0&&N0[0].length>2){if(n0=N0[0].length,j.index+=n0,n0%2!==0)_+="\\"}if(U.unescape===!0)_=M();else _+=M();if(j.brackets===0){$0({type:"text",value:_});continue}}if(j.brackets>0&&(_!=="]"||b.value==="["||b.value==="[^")){if(U.posix!==!1&&_===":"){let e=b.value.slice(1);if(e.includes("[")){if(b.posix=!0,e.includes(":")){let N0=b.value.lastIndexOf("["),n0=b.value.slice(0,N0),GD=b.value.slice(N0+2),d0=Vr[GD];if(d0){if(b.value=n0+d0,j.backtrack=!0,M(),!Y.output&&J.indexOf(b)===1)Y.output=K;continue}}}}if(_==="["&&L()!==":"||_==="-"&&L()==="]")_=`\\${_}`;if(_==="]"&&(b.value==="["||b.value==="[^"))_=`\\${_}`;if(U.posix===!0&&_==="!"&&b.value==="[")_="^";b.value+=_,y({value:_});continue}if(j.quotes===1&&_!=='"'){_=M$.escapeRegex(_),b.value+=_,y({value:_});continue}if(_==='"'){if(j.quotes=j.quotes===1?0:1,U.keepQuotes===!0)$0({type:"text",value:_});continue}if(_==="("){f("parens"),$0({type:"paren",value:_});continue}if(_===")"){if(j.parens===0&&U.strictBrackets===!0)throw SyntaxError(h8("opening","("));let e=R[R.length-1];if(e&&j.parens===e.parens+1){T0(R.pop());continue}$0({type:"paren",value:_,output:j.parens?")":"\\)"}),c("parens");continue}if(_==="["){if(U.nobracket===!0||!u().includes("]")){if(U.nobracket!==!0&&U.strictBrackets===!0)throw SyntaxError(h8("closing","]"));_=`\\${_}`}else f("brackets");$0({type:"bracket",value:_});continue}if(_==="]"){if(U.nobracket===!0||b&&b.type==="bracket"&&b.value.length===1){$0({type:"text",value:_,output:`\\${_}`});continue}if(j.brackets===0){if(U.strictBrackets===!0)throw SyntaxError(h8("opening","["));$0({type:"text",value:_,output:`\\${_}`});continue}c("brackets");let e=b.value.slice(1);if(b.posix!==!0&&e[0]==="^"&&!e.includes("/"))_=`/${_}`;if(b.value+=_,y({value:_}),U.literalBrackets===!1||M$.hasRegexChars(e))continue;let N0=M$.escapeRegex(b.value);if(j.output=j.output.slice(0,-b.value.length),U.literalBrackets===!0){j.output+=N0,b.value=N0;continue}b.value=`(${Z}${N0}|${b.value})`,j.output+=b.value;continue}if(_==="{"&&U.nobrace!==!0){f("braces");let e={type:"brace",value:_,output:"(",outputIndex:j.output.length,tokensIndex:j.tokens.length};x.push(e),$0(e);continue}if(_==="}"){let e=x[x.length-1];if(U.nobrace===!0||!e){$0({type:"text",value:_,output:_});continue}let N0=")";if(e.dots===!0){let n0=J.slice(),GD=[];for(let d0=n0.length-1;d0>=0;d0--){if(J.pop(),n0[d0].type==="brace")break;if(n0[d0].type!=="dots")GD.unshift(n0[d0].value)}N0=Ir(GD,U),j.backtrack=!0}if(e.comma!==!0&&e.dots!==!0){let n0=j.output.slice(0,e.outputIndex),GD=j.tokens.slice(e.tokensIndex);e.value=e.output="\\{",_=N0="\\}",j.output=n0;for(let d0 of GD)j.output+=d0.output||d0.value}$0({type:"brace",value:_,output:N0}),c("braces"),x.pop();continue}if(_==="|"){if(R.length>0)R[R.length-1].conditions++;$0({type:"text",value:_});continue}if(_===","){let e=_,N0=x[x.length-1];if(N0&&m[m.length-1]==="braces")N0.comma=!0,e="|";$0({type:"comma",value:_,output:e});continue}if(_==="/"){if(b.type==="dot"&&j.index===j.start+1){j.start=j.index+1,j.consumed="",j.output="",J.pop(),b=Y;continue}$0({type:"slash",value:_,output:G});continue}if(_==="."){if(j.braces>0&&b.type==="dot"){if(b.value===".")b.output=W;let e=x[x.length-1];b.type="dots",b.output+=_,b.value+=_,e.dots=!0;continue}if(j.braces+j.parens===0&&b.type!=="bos"&&b.type!=="slash"){$0({type:"text",value:_,output:W});continue}$0({type:"dot",value:_,output:W});continue}if(_==="?"){if(!(b&&b.value==="(")&&U.noextglob!==!0&&L()==="("&&L(2)!=="?"){V0("qmark",_);continue}if(b&&b.type==="paren"){let N0=L(),n0=_;if(b.value==="("&&!/[!=<:]/.test(N0)||N0==="<"&&!/<([!=]|\w+>)/.test(u()))n0=`\\${_}`;$0({type:"text",value:_,output:n0});continue}if(U.dot!==!0&&(b.type==="slash"||b.type==="bos")){$0({type:"qmark",value:_,output:I});continue}$0({type:"qmark",value:_,output:w});continue}if(_==="!"){if(U.noextglob!==!0&&L()==="("){if(L(2)!=="?"||!/[!=<:]/.test(L(3))){V0("negate",_);continue}}if(U.nonegate!==!0&&j.index===0){D0();continue}}if(_==="+"){if(U.noextglob!==!0&&L()==="("&&L(2)!=="?"){V0("plus",_);continue}if(b&&b.value==="("||U.regex===!1){$0({type:"plus",value:_,output:z});continue}if(b&&(b.type==="bracket"||b.type==="paren"||b.type==="brace")||j.parens>0){$0({type:"plus",value:_});continue}$0({type:"plus",value:z});continue}if(_==="@"){if(U.noextglob!==!0&&L()==="("&&L(2)!=="?"){$0({type:"at",extglob:!0,value:_,output:""});continue}$0({type:"text",value:_});continue}if(_!=="*"){if(_==="$"||_==="^")_=`\\${_}`;let e=Hr.exec(u());if(e)_+=e[0],j.index+=e[0].length;$0({type:"text",value:_});continue}if(b&&(b.type==="globstar"||b.star===!0)){b.type="star",b.star=!0,b.value+=_,b.output=v,j.backtrack=!0,j.globstar=!0,h(_);continue}let s=u();if(U.noextglob!==!0&&/^\([^?]/.test(s)){V0("star",_);continue}if(b.type==="star"){if(U.noglobstar===!0){h(_);continue}let e=b.prev,N0=e.prev,n0=e.type==="slash"||e.type==="bos",GD=N0&&(N0.type==="star"||N0.type==="globstar");if(U.bash===!0&&(!n0||s[0]&&s[0]!=="/")){$0({type:"star",value:_,output:""});continue}let d0=j.braces>0&&(e.type==="comma"||e.type==="brace"),H6=R.length&&(e.type==="pipe"||e.type==="paren");if(!n0&&e.type!=="paren"&&!d0&&!H6){$0({type:"star",value:_,output:""});continue}while(s.slice(0,3)==="/**"){let B6=D[j.index+4];if(B6&&B6!=="/")break;s=s.slice(3),h("/**",3)}if(e.type==="bos"&&A()){b.type="globstar",b.value+=_,b.output=P(U),j.output=b.output,j.globstar=!0,h(_);continue}if(e.type==="slash"&&e.prev.type!=="bos"&&!GD&&A()){j.output=j.output.slice(0,-(e.output+b.output).length),e.output=`(?:${e.output}`,b.type="globstar",b.output=P(U)+(U.strictSlashes?")":"|$)"),b.value+=_,j.globstar=!0,j.output+=e.output+b.output,h(_);continue}if(e.type==="slash"&&e.prev.type!=="bos"&&s[0]==="/"){let B6=s[1]!==void 0?"|$":"";j.output=j.output.slice(0,-(e.output+b.output).length),e.output=`(?:${e.output}`,b.type="globstar",b.output=`${P(U)}${G}|${G}${B6})`,b.value+=_,j.output+=e.output+b.output,j.globstar=!0,h(_+M()),$0({type:"slash",value:"/",output:""});continue}if(e.type==="bos"&&s[0]==="/"){b.type="globstar",b.value+=_,b.output=`(?:^|${G}|${P(U)}${G})`,j.output=b.output,j.globstar=!0,h(_+M()),$0({type:"slash",value:"/",output:""});continue}j.output=j.output.slice(0,-b.output.length),b.type="globstar",b.output=P(U),b.value+=_,j.output+=b.output,j.globstar=!0,h(_);continue}let f0={type:"star",value:_,output:v};if(U.bash===!0){if(f0.output=".*?",b.type==="bos"||b.type==="slash")f0.output=k+f0.output;$0(f0);continue}if(b&&(b.type==="bracket"||b.type==="paren")&&U.regex===!0){f0.output=_,$0(f0);continue}if(j.index===j.start||b.type==="slash"||b.type==="dot"){if(b.type==="dot")j.output+=H,b.output+=H;else if(U.dot===!0)j.output+=O,b.output+=O;else j.output+=k,b.output+=k;if(L()!=="*")j.output+=K,b.output+=K}$0(f0)}while(j.brackets>0){if(U.strictBrackets===!0)throw SyntaxError(h8("closing","]"));j.output=M$.escapeLast(j.output,"["),c("brackets")}while(j.parens>0){if(U.strictBrackets===!0)throw SyntaxError(h8("closing",")"));j.output=M$.escapeLast(j.output,"("),c("parens")}while(j.braces>0){if(U.strictBrackets===!0)throw SyntaxError(h8("closing","}"));j.output=M$.escapeLast(j.output,"{"),c("braces")}if(U.strictSlashes!==!0&&(b.type==="star"||b.type==="bracket"))$0({type:"maybe_slash",value:"",output:`${G}?`});if(j.backtrack===!0){j.output="";for(let s of j.tokens)if(j.output+=s.output!=null?s.output:s.value,s.suffix)j.output+=s.suffix}return j};dq.fastpaths=(D,$)=>{let U={...$},X=typeof U.maxLength==="number"?Math.min(mU,U.maxLength):mU,Q=D.length;if(Q>X)throw SyntaxError(`Input length: ${Q}, exceeds maximum allowed length: ${X}`);D=hj[D]||D;let{DOT_LITERAL:Y,SLASH_LITERAL:J,ONE_CHAR:Z,DOTS_SLASH:q,NO_DOT:F,NO_DOTS:W,NO_DOTS_SLASH:z,STAR:G,START_ANCHOR:K}=M5.globChars(U.windows),V=U.dot?W:F,B=U.dot?z:F,H=U.capture?"":"?:",O={negated:!1,prefix:""},w=U.bash===!0?".*?":G;if(U.capture)w=`(${w})`;let I=(k)=>{if(k.noglobstar===!0)return w;return`(${H}(?:(?!${K}${k.dot?q:Y}).)*?)`},N=(k)=>{switch(k){case"*":return`${V}${Z}${w}`;case".*":return`${Y}${Z}${w}`;case"*.*":return`${V}${w}${Y}${Z}${w}`;case"*/*":return`${V}${w}${J}${Z}${B}${w}`;case"**":return V+I(U);case"**/*":return`(?:${V}${I(U)}${J})?${B}${Z}${w}`;case"**/*.*":return`(?:${V}${I(U)}${J})?${B}${w}${Y}${Z}${w}`;case"**/.*":return`(?:${V}${I(U)}${J})?${Y}${Z}${w}`;default:{let T=/^(.*?)\.(\w+)$/.exec(k);if(!T)return;let v=N(T[1]);if(!v)return;return v+Y+T[2]}}},E=M$.removePrefix(D,O),P=N(E);if(P&&U.strictSlashes!==!0)P+=`${J}?`;return P};cj.exports=dq});var rj=S((HC0,nj)=>{var Mr=mj(),cq=pj(),ij=N5(),Rr=L5(),Ar=(D)=>D&&typeof D==="object"&&!Array.isArray(D),ID=(D,$,U=!1)=>{if(Array.isArray(D)){let W=D.map((G)=>ID(G,$,U));return(G)=>{for(let K of W){let V=K(G);if(V)return V}return!1}}let X=Ar(D)&&D.tokens&&D.input;if(D===""||typeof D!=="string"&&!X)throw TypeError("Expected pattern to be a non-empty string");let Q=$||{},Y=Q.windows,J=X?ID.compileRe(D,$):ID.makeRe(D,$,!1,!0),Z=J.state;delete J.state;let q=()=>!1;if(Q.ignore){let W={...$,ignore:null,onMatch:null,onResult:null};q=ID(Q.ignore,W,U)}let F=(W,z=!1)=>{let{isMatch:G,match:K,output:V}=ID.test(W,J,$,{glob:D,posix:Y}),B={glob:D,state:Z,regex:J,posix:Y,input:W,output:V,match:K,isMatch:G};if(typeof Q.onResult==="function")Q.onResult(B);if(G===!1)return B.isMatch=!1,z?B:!1;if(q(W)){if(typeof Q.onIgnore==="function")Q.onIgnore(B);return B.isMatch=!1,z?B:!1}if(typeof Q.onMatch==="function")Q.onMatch(B);return z?B:!0};if(U)F.state=Z;return F};ID.test=(D,$,U,{glob:X,posix:Q}={})=>{if(typeof D!=="string")throw TypeError("Expected input to be a string");if(D==="")return{isMatch:!1,output:""};let Y=U||{},J=Y.format||(Q?ij.toPosixSlashes:null),Z=D===X,q=Z&&J?J(D):D;if(Z===!1)q=J?J(D):D,Z=q===X;if(Z===!1||Y.capture===!0)if(Y.matchBase===!0||Y.basename===!0)Z=ID.matchBase(D,$,U,Q);else Z=$.exec(q);return{isMatch:Boolean(Z),match:Z,output:q}};ID.matchBase=(D,$,U)=>{return($ instanceof RegExp?$:ID.makeRe($,U)).test(ij.basename(D))};ID.isMatch=(D,$,U)=>ID($,U)(D);ID.parse=(D,$)=>{if(Array.isArray(D))return D.map((U)=>ID.parse(U,$));return cq(D,{...$,fastpaths:!1})};ID.scan=(D,$)=>Mr(D,$);ID.compileRe=(D,$,U=!1,X=!1)=>{if(U===!0)return D.output;let Q=$||{},Y=Q.contains?"":"^",J=Q.contains?"":"$",Z=`${Y}(?:${D.output})${J}`;if(D&&D.negated===!0)Z=`^(?!${Z}).*$`;let q=ID.toRegex(Z,$);if(X===!0)q.state=D;return q};ID.makeRe=(D,$={},U=!1,X=!1)=>{if(!D||typeof D!=="string")throw TypeError("Expected a non-empty string");let Q={negated:!1,fastpaths:!0};if($.fastpaths!==!1&&(D[0]==="."||D[0]==="*"))Q.output=cq.fastpaths(D,$);if(!Q.output)Q=cq(D,$);return ID.compileRe(Q,$,U,X)};ID.toRegex=(D,$)=>{try{let U=$||{};return new RegExp(D,U.flags||(U.nocase?"i":""))}catch(U){if($&&$.debug===!0)throw U;return/$^/}};ID.constants=Rr;nj.exports=ID});var tj=S((BC0,sj)=>{var aj=rj(),Er=N5();function oj(D,$,U=!1){if($&&($.windows===null||$.windows===void 0))$={...$,windows:Er.isWindows()};return aj(D,$,U)}Object.assign(oj,aj);sj.exports=oj});var _0=S((qa)=>{var iq=Symbol.for("yaml.alias"),WM=Symbol.for("yaml.document"),hU=Symbol.for("yaml.map"),zM=Symbol.for("yaml.pair"),nq=Symbol.for("yaml.scalar"),lU=Symbol.for("yaml.seq"),f6=Symbol.for("yaml.node.type"),$a=(D)=>!!D&&typeof D==="object"&&D[f6]===iq,Ua=(D)=>!!D&&typeof D==="object"&&D[f6]===WM,Xa=(D)=>!!D&&typeof D==="object"&&D[f6]===hU,Qa=(D)=>!!D&&typeof D==="object"&&D[f6]===zM,GM=(D)=>!!D&&typeof D==="object"&&D[f6]===nq,Ya=(D)=>!!D&&typeof D==="object"&&D[f6]===lU;function KM(D){if(D&&typeof D==="object")switch(D[f6]){case hU:case lU:return!0}return!1}function Ja(D){if(D&&typeof D==="object")switch(D[f6]){case iq:case hU:case nq:case lU:return!0}return!1}var Za=(D)=>(GM(D)||KM(D))&&!!D.anchor;qa.ALIAS=iq;qa.DOC=WM;qa.MAP=hU;qa.NODE_TYPE=f6;qa.PAIR=zM;qa.SCALAR=nq;qa.SEQ=lU;qa.hasAnchor=Za;qa.isAlias=$a;qa.isCollection=KM;qa.isDocument=Ua;qa.isMap=Xa;qa.isNode=Ja;qa.isPair=Qa;qa.isScalar=GM;qa.isSeq=Ya});var A5=S((Aa)=>{var ED=_0(),K$=Symbol("break visit"),VM=Symbol("skip children"),O6=Symbol("remove node");function dU(D,$){let U=HM($);if(ED.isDocument(D)){if(d8(null,D.contents,U,Object.freeze([D]))===O6)D.contents=null}else d8(null,D,U,Object.freeze([]))}dU.BREAK=K$;dU.SKIP=VM;dU.REMOVE=O6;function d8(D,$,U,X){let Q=BM(D,$,U,X);if(ED.isNode(Q)||ED.isPair(Q))return IM(D,X,Q),d8(D,Q,U,X);if(typeof Q!=="symbol"){if(ED.isCollection($)){X=Object.freeze(X.concat($));for(let Y=0;Y<$.items.length;++Y){let J=d8(Y,$.items[Y],U,X);if(typeof J==="number")Y=J-1;else if(J===K$)return K$;else if(J===O6)$.items.splice(Y,1),Y-=1}}else if(ED.isPair($)){X=Object.freeze(X.concat($));let Y=d8("key",$.key,U,X);if(Y===K$)return K$;else if(Y===O6)$.key=null;let J=d8("value",$.value,U,X);if(J===K$)return K$;else if(J===O6)$.value=null}}return Q}async function cU(D,$){let U=HM($);if(ED.isDocument(D)){if(await c8(null,D.contents,U,Object.freeze([D]))===O6)D.contents=null}else await c8(null,D,U,Object.freeze([]))}cU.BREAK=K$;cU.SKIP=VM;cU.REMOVE=O6;async function c8(D,$,U,X){let Q=await BM(D,$,U,X);if(ED.isNode(Q)||ED.isPair(Q))return IM(D,X,Q),c8(D,Q,U,X);if(typeof Q!=="symbol"){if(ED.isCollection($)){X=Object.freeze(X.concat($));for(let Y=0;Y<$.items.length;++Y){let J=await c8(Y,$.items[Y],U,X);if(typeof J==="number")Y=J-1;else if(J===K$)return K$;else if(J===O6)$.items.splice(Y,1),Y-=1}}else if(ED.isPair($)){X=Object.freeze(X.concat($));let Y=await c8("key",$.key,U,X);if(Y===K$)return K$;else if(Y===O6)$.key=null;let J=await c8("value",$.value,U,X);if(J===K$)return K$;else if(J===O6)$.value=null}}return Q}function HM(D){if(typeof D==="object"&&(D.Collection||D.Node||D.Value))return Object.assign({Alias:D.Node,Map:D.Node,Scalar:D.Node,Seq:D.Node},D.Value&&{Map:D.Value,Scalar:D.Value,Seq:D.Value},D.Collection&&{Map:D.Collection,Seq:D.Collection},D);return D}function BM(D,$,U,X){if(typeof U==="function")return U(D,$,X);if(ED.isMap($))return U.Map?.(D,$,X);if(ED.isSeq($))return U.Seq?.(D,$,X);if(ED.isPair($))return U.Pair?.(D,$,X);if(ED.isScalar($))return U.Scalar?.(D,$,X);if(ED.isAlias($))return U.Alias?.(D,$,X);return}function IM(D,$,U){let X=$[$.length-1];if(ED.isCollection(X))X.items[D]=U;else if(ED.isPair(X))if(D==="key")X.key=U;else X.value=U;else if(ED.isDocument(X))X.contents=U;else{let Q=ED.isAlias(X)?"alias":"scalar";throw Error(`Cannot replace node with ${Q} parent`)}}Aa.visit=dU;Aa.visitAsync=cU});var rq=S((va)=>{var OM=_0(),Pa=A5(),Sa={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Ca=(D)=>D.replace(/[!,[\]{}]/g,($)=>Sa[$]);class y${constructor(D,$){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},y$.defaultYaml,D),this.tags=Object.assign({},y$.defaultTags,$)}clone(){let D=new y$(this.yaml,this.tags);return D.docStart=this.docStart,D}atDocument(){let D=new y$(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:y$.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},y$.defaultTags);break}return D}add(D,$){if(this.atNextDocument)this.yaml={explicit:y$.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},y$.defaultTags),this.atNextDocument=!1;let U=D.trim().split(/[ \t]+/),X=U.shift();switch(X){case"%TAG":{if(U.length!==2){if($(0,"%TAG directive should contain exactly two parts"),U.length<2)return!1}let[Q,Y]=U;return this.tags[Q]=Y,!0}case"%YAML":{if(this.yaml.explicit=!0,U.length!==1)return $(0,"%YAML directive should contain exactly one part"),!1;let[Q]=U;if(Q==="1.1"||Q==="1.2")return this.yaml.version=Q,!0;else{let Y=/^\d+\.\d+$/.test(Q);return $(6,`Unsupported YAML version ${Q}`,Y),!1}}default:return $(0,`Unknown directive ${X}`,!0),!1}}tagName(D,$){if(D==="!")return"!";if(D[0]!=="!")return $(`Not a valid tag: ${D}`),null;if(D[1]==="<"){let Y=D.slice(2,-1);if(Y==="!"||Y==="!!")return $(`Verbatim tags aren't resolved, so ${D} is invalid.`),null;if(D[D.length-1]!==">")$("Verbatim tags must end with a >");return Y}let[,U,X]=D.match(/^(.*!)([^!]*)$/s);if(!X)$(`The ${D} tag has no suffix`);let Q=this.tags[U];if(Q)try{return Q+decodeURIComponent(X)}catch(Y){return $(String(Y)),null}if(U==="!")return D;return $(`Could not resolve tag: ${D}`),null}tagString(D){for(let[$,U]of Object.entries(this.tags))if(D.startsWith(U))return $+Ca(D.substring(U.length));return D[0]==="!"?D:`!<${D}>`}toString(D){let $=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],U=Object.entries(this.tags),X;if(D&&U.length>0&&OM.isNode(D.contents)){let Q={};Pa.visit(D.contents,(Y,J)=>{if(OM.isNode(J)&&J.tag)Q[J.tag]=!0}),X=Object.keys(Q)}else X=[];for(let[Q,Y]of U){if(Q==="!!"&&Y==="tag:yaml.org,2002:")continue;if(!D||X.some((J)=>J.startsWith(Y)))$.push(`%TAG ${Q} ${Y}`)}return $.join(`
2
2
  `)}}y$.defaultYaml={explicit:!1,version:"1.2"};y$.defaultTags={"!!":"tag:yaml.org,2002:"};va.Directives=y$});var pU=S((xa)=>{var wM=_0(),_a=A5();function ka(D){if(/[\x00-\x19\s,[\]{}]/.test(D)){let U=`Anchor must not contain whitespace or control characters: ${JSON.stringify(D)}`;throw Error(U)}return!0}function LM(D){let $=new Set;return _a.visit(D,{Value(U,X){if(X.anchor)$.add(X.anchor)}}),$}function NM(D,$){for(let U=1;;++U){let X=`${D}${U}`;if(!$.has(X))return X}}function ua(D,$){let U=[],X=new Map,Q=null;return{onAnchor:(Y)=>{U.push(Y),Q??(Q=LM(D));let J=NM($,Q);return Q.add(J),J},setAnchors:()=>{for(let Y of U){let J=X.get(Y);if(typeof J==="object"&&J.anchor&&(wM.isScalar(J.node)||wM.isCollection(J.node)))J.node.anchor=J.anchor;else{let Z=Error("Failed to resolve repeated object (this should not happen)");throw Z.source=Y,Z}}},sourceObjects:X}}xa.anchorIsValid=ka;xa.anchorNames=LM;xa.createNodeAnchors=ua;xa.findNewAnchor=NM});var aq=S((ha)=>{function E5(D,$,U,X){if(X&&typeof X==="object")if(Array.isArray(X))for(let Q=0,Y=X.length;Q<Y;++Q){let J=X[Q],Z=E5(D,X,String(Q),J);if(Z===void 0)delete X[Q];else if(Z!==J)X[Q]=Z}else if(X instanceof Map)for(let Q of Array.from(X.keys())){let Y=X.get(Q),J=E5(D,X,Q,Y);if(J===void 0)X.delete(Q);else if(J!==Y)X.set(Q,J)}else if(X instanceof Set)for(let Q of Array.from(X)){let Y=E5(D,X,Q,Q);if(Y===void 0)X.delete(Q);else if(Y!==Q)X.delete(Q),X.add(Y)}else for(let[Q,Y]of Object.entries(X)){let J=E5(D,X,Q,Y);if(J===void 0)delete X[Q];else if(J!==Y)X[Q]=J}return D.call($,U,X)}ha.applyReviver=E5});var V1=S((ca)=>{var da=_0();function jM(D,$,U){if(Array.isArray(D))return D.map((X,Q)=>jM(X,String(Q),U));if(D&&typeof D.toJSON==="function"){if(!U||!da.hasAnchor(D))return D.toJSON($,U);let X={aliasCount:0,count:1,res:void 0};U.anchors.set(D,X),U.onCreate=(Y)=>{X.res=Y,delete U.onCreate};let Q=D.toJSON($,U);if(U.onCreate)U.onCreate(Q);return Q}if(typeof D==="bigint"&&!U?.keep)return Number(D);return D}ca.toJS=jM});var iU=S((ra)=>{var ia=aq(),MM=_0(),na=V1();class RM{constructor(D){Object.defineProperty(this,MM.NODE_TYPE,{value:D})}clone(){let D=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)D.range=this.range.slice();return D}toJS(D,{mapAsMap:$,maxAliasCount:U,onAnchor:X,reviver:Q}={}){if(!MM.isDocument(D))throw TypeError("A document argument is required");let Y={anchors:new Map,doc:D,keep:!0,mapAsMap:$===!0,mapKeyWarned:!1,maxAliasCount:typeof U==="number"?U:100},J=na.toJS(this,"",Y);if(typeof X==="function")for(let{count:Z,res:q}of Y.anchors.values())X(q,Z);return typeof Q==="function"?ia.applyReviver(Q,{"":J},"",J):J}}ra.NodeBase=RM});var T5=S((Do)=>{var oa=pU(),sa=A5(),p8=_0(),ta=iU(),ea=V1();class AM extends ta.NodeBase{constructor(D){super(p8.ALIAS);this.source=D,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(D,$){if($?.maxAliasCount===0)throw ReferenceError("Alias resolution is disabled");let U;if($?.aliasResolveCache)U=$.aliasResolveCache;else if(U=[],sa.visit(D,{Node:(Q,Y)=>{if(p8.isAlias(Y)||p8.hasAnchor(Y))U.push(Y)}}),$)$.aliasResolveCache=U;let X=void 0;for(let Q of U){if(Q===this)break;if(Q.anchor===this.source)X=Q}return X}toJSON(D,$){if(!$)return{source:this.source};let{anchors:U,doc:X,maxAliasCount:Q}=$,Y=this.resolve(X,$);if(!Y){let Z=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(Z)}let J=U.get(Y);if(!J)ea.toJS(Y,null,$),J=U.get(Y);if(J?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(Q>=0){if(J.count+=1,J.aliasCount===0)J.aliasCount=nU(X,Y,U);if(J.count*J.aliasCount>Q)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return J.res}toString(D,$,U){let X=`*${this.source}`;if(D){if(oa.anchorIsValid(this.source),D.options.verifyAliasOrder&&!D.anchors.has(this.source)){let Q=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(Q)}if(D.implicitKey)return`${X} `}return X}}function nU(D,$,U){if(p8.isAlias($)){let X=$.resolve(D),Q=U&&X&&U.get(X);return Q?Q.count*Q.aliasCount:0}else if(p8.isCollection($)){let X=0;for(let Q of $.items){let Y=nU(D,Q,U);if(Y>X)X=Y}return X}else if(p8.isPair($)){let X=nU(D,$.key,U),Q=nU(D,$.value,U);return Math.max(X,Q)}return 1}Do.Alias=AM});var jD=S((Jo)=>{var Uo=_0(),Xo=iU(),Qo=V1(),Yo=(D)=>!D||typeof D!=="function"&&typeof D!=="object";class I4 extends Xo.NodeBase{constructor(D){super(Uo.SCALAR);this.value=D}toJSON(D,$){return $?.keep?this.value:Qo.toJS(this.value,D,$)}toString(){return String(this.value)}}I4.BLOCK_FOLDED="BLOCK_FOLDED";I4.BLOCK_LITERAL="BLOCK_LITERAL";I4.PLAIN="PLAIN";I4.QUOTE_DOUBLE="QUOTE_DOUBLE";I4.QUOTE_SINGLE="QUOTE_SINGLE";Jo.Scalar=I4;Jo.isScalarValue=Yo});var P5=S((Ko)=>{var Fo=T5(),O4=_0(),EM=jD(),Wo="tag:yaml.org,2002:";function zo(D,$,U){if($){let X=U.filter((Y)=>Y.tag===$),Q=X.find((Y)=>!Y.format)??X[0];if(!Q)throw Error(`Tag ${$} not found`);return Q}return U.find((X)=>X.identify?.(D)&&!X.format)}function Go(D,$,U){if(O4.isDocument(D))D=D.contents;if(O4.isNode(D))return D;if(O4.isPair(D)){let z=U.schema[O4.MAP].createNode?.(U.schema,null,U);return z.items.push(D),z}if(D instanceof String||D instanceof Number||D instanceof Boolean||typeof BigInt<"u"&&D instanceof BigInt)D=D.valueOf();let{aliasDuplicateObjects:X,onAnchor:Q,onTagObj:Y,schema:J,sourceObjects:Z}=U,q=void 0;if(X&&D&&typeof D==="object")if(q=Z.get(D),q)return q.anchor??(q.anchor=Q(D)),new Fo.Alias(q.anchor);else q={anchor:null,node:null},Z.set(D,q);if($?.startsWith("!!"))$=Wo+$.slice(2);let F=zo(D,$,J.tags);if(!F){if(D&&typeof D.toJSON==="function")D=D.toJSON();if(!D||typeof D!=="object"){let z=new EM.Scalar(D);if(q)q.node=z;return z}F=D instanceof Map?J[O4.MAP]:(Symbol.iterator in Object(D))?J[O4.SEQ]:J[O4.MAP]}if(Y)Y(F),delete U.onTagObj;let W=F?.createNode?F.createNode(U.schema,D,U):typeof F?.nodeClass?.from==="function"?F.nodeClass.from(U.schema,D,U):new EM.Scalar(D);if($)W.tag=$;else if(!F.default)W.tag=F.tag;if(q)q.node=W;return W}Ko.createNode=Go});var rU=S((Io)=>{var Ho=P5(),w6=_0(),Bo=iU();function oq(D,$,U){let X=U;for(let Q=$.length-1;Q>=0;--Q){let Y=$[Q];if(typeof Y==="number"&&Number.isInteger(Y)&&Y>=0){let J=[];J[Y]=X,X=J}else X=new Map([[Y,X]])}return Ho.createNode(X,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:D,sourceObjects:new Map})}var TM=(D)=>D==null||typeof D==="object"&&!!D[Symbol.iterator]().next().done;class PM extends Bo.NodeBase{constructor(D,$){super(D);Object.defineProperty(this,"schema",{value:$,configurable:!0,enumerable:!1,writable:!0})}clone(D){let $=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(D)$.schema=D;if($.items=$.items.map((U)=>w6.isNode(U)||w6.isPair(U)?U.clone(D):U),this.range)$.range=this.range.slice();return $}addIn(D,$){if(TM(D))this.add($);else{let[U,...X]=D,Q=this.get(U,!0);if(w6.isCollection(Q))Q.addIn(X,$);else if(Q===void 0&&this.schema)this.set(U,oq(this.schema,X,$));else throw Error(`Expected YAML collection at ${U}. Remaining path: ${X}`)}}deleteIn(D){let[$,...U]=D;if(U.length===0)return this.delete($);let X=this.get($,!0);if(w6.isCollection(X))return X.deleteIn(U);else throw Error(`Expected YAML collection at ${$}. Remaining path: ${U}`)}getIn(D,$){let[U,...X]=D,Q=this.get(U,!0);if(X.length===0)return!$&&w6.isScalar(Q)?Q.value:Q;else return w6.isCollection(Q)?Q.getIn(X,$):void 0}hasAllNullValues(D){return this.items.every(($)=>{if(!w6.isPair($))return!1;let U=$.value;return U==null||D&&w6.isScalar(U)&&U.value==null&&!U.commentBefore&&!U.comment&&!U.tag})}hasIn(D){let[$,...U]=D;if(U.length===0)return this.has($);let X=this.get($,!0);return w6.isCollection(X)?X.hasIn(U):!1}setIn(D,$){let[U,...X]=D;if(X.length===0)this.set(U,$);else{let Q=this.get(U,!0);if(w6.isCollection(Q))Q.setIn(X,$);else if(Q===void 0&&this.schema)this.set(U,oq(this.schema,X,$));else throw Error(`Expected YAML collection at ${U}. Remaining path: ${X}`)}}}Io.Collection=PM;Io.collectionFromPath=oq;Io.isEmptyPath=TM});var S5=S((Mo)=>{var No=(D)=>D.replace(/^(?!$)(?: $)?/gm,"#");function sq(D,$){if(/^\n+$/.test(D))return D.substring(1);return $?D.replace(/^(?! *$)/gm,$):D}var jo=(D,$,U)=>D.endsWith(`
3
3
  `)?sq(U,$):U.includes(`
4
4
  `)?`
package/dist/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capgo/cli",
3
3
  "type": "module",
4
- "version": "8.53.0",
4
+ "version": "8.53.1",
5
5
  "description": "A CLI to upload to capgo servers",
6
6
  "author": "Martin martin@capgo.app",
7
7
  "license": "Apache 2.0",
package/dist/src/sdk.js CHANGED
@@ -1,4 +1,4 @@
1
- import{createRequire as Bj0}from"node:module";var module={exports:{}};var Oj0=Object.create;var{getPrototypeOf:zj0,defineProperty:rF,getOwnPropertyNames:Ib}=Object;var H2=Object.prototype.hasOwnProperty;function V2($){return this[$]}var H0=($,D,Q)=>{var X=Ib(D);for(let J of X)if(!H2.call($,J)&&J!=="default")rF($,J,{get:V2.bind(D,J),enumerable:!0});if(Q){for(let J of X)if(!H2.call(Q,J)&&J!=="default")rF(Q,J,{get:V2.bind(D,J),enumerable:!0});return Q}},Lj0,Mj0,S1=($,D,Q)=>{var X=$!=null&&typeof $==="object";if(X){var J=D?Lj0??=new WeakMap:Mj0??=new WeakMap,Y=J.get($);if(Y)return Y}Q=$!=null?Oj0(zj0($)):{};let Z=D||!$||!$.__esModule?rF(Q,"default",{value:$,enumerable:!0}):Q;for(let F of Ib($))if(!H2.call(Z,F))rF(Z,F,{get:V2.bind($,F),enumerable:!0});if(X)J.set($,Z);return Z};var E=($,D)=>()=>(D||$((D={exports:{}}).exports,D),D.exports);var Nj0=($)=>$;function wj0($,D){this[$]=Nj0.bind(null,D)}var Q6=($,D)=>{for(var Q in D)rF($,Q,{get:D[Q],enumerable:!0,configurable:!0,set:wj0.bind(D,Q)})};var t=($,D)=>()=>($&&(D=$($=0)),D);var Q0=Bj0(import.meta.url);var i$;var Q8=t(()=>{i$={name:"@capgo/cli",type:"module",version:"8.53.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:bundle":"bun test/test-bundle.mjs","test:bundle-validation":"bun test test/bundle/","test:prescan":"bun test test/prescan/","test:functional":"bun test/test-functional.mjs","test:semver":"bun test/test-semver-validation.mjs","test:version-edge-cases":"bun test/test-version-validation.mjs","test:regex":"bun test/test-regex-validation.mjs","test:upload":"bun test/test-upload-validation.mjs","test:fail-on-incompatible":"bun test/test-fail-on-incompatible.mjs","test:native-dependencies":"bun test/test-native-dependencies.mjs && bun test/test-get-remote-dependencies.mjs","test:package-json-guard":"bun test/test-package-json-guard.mjs","test:credentials":"bun test/test-credentials.mjs","test:credentials-export":"bun test/test-credentials-export.mjs","test:asc-key-protocol":"bun test/test-asc-key-protocol.mjs","test:credentials-validation":"bun test/test-credentials-validation.mjs","test:android-service-account-validation":"bun test/test-android-service-account-validation.mjs","test:build-zip-filter":"bun test/test-build-zip-filter.mjs","test:checksum":"bun test/test-checksum-algorithm.mjs","test:build-needed":"bun test/test-build-needed.mjs","test:cli-help":"bun test/test-cli-help.mjs","test:build-cache-payload":"bun test/test-build-cache-payload.mjs","test:build-cancellation":"bun test/test-build-cancellation.mjs","test:ci-prompts":"bun test/test-ci-prompts.mjs","test:ci-secrets":"bun test/test-ci-secrets.mjs","test:android-onboarding-progress":"bun test/test-android-onboarding-progress.mjs","test:onboarding-telemetry":"bun test/test-onboarding-telemetry.mjs","test:v2-event-migration":"bun test/test-v2-event-migration.mjs","test:analytics":"bun test/test-analytics.mjs","test:cli-headers":"bun test/test-cli-headers.mjs","test:min-cli-version":"bun test/test-min-cli-version.mjs","test:authenticated-command-invocation":"bun test/test-authenticated-command-invocation.mjs","test:analytics-error-category":"bun test/test-analytics-error-category.mjs","test:analytics-org-resolver":"bun test/test-analytics-org-resolver.mjs","test:supabase-perf":"bun test/test-supabase-perf.mjs","test:preview-qr":"bun test/test-preview-qr.mjs","test:mcp-analytics":"bun test/test-mcp-analytics.mjs","test:mcp-instructions":"bun test/test-mcp-instructions.mjs","test:mcp-stdout-guard":"bun test/test-mcp-stdout-guard.mjs","test:mcp-platform-select":"bun test/test-mcp-platform-select.mjs","test:mcp-explain-scopes":"bun test/test-mcp-explain-scopes.mjs","test:mcp-oauth-reopen":"bun test/test-mcp-oauth-reopen.mjs","test:mcp-broker-oauth":"bun test/test-mcp-broker-oauth.mjs","test:mcp-broker-session":"bun test/test-mcp-broker-session.mjs","test:mcp-credentials-manage":"bun test/test-mcp-credentials-manage.mjs","test:mcp-resume-prompt":"bun test/test-mcp-resume-prompt.mjs","test:mcp-build-job":"bun test/test-mcp-build-job.mjs","test:mcp-build-tools":"bun test/test-mcp-build-tools.mjs","test:app-created-source":"bun test/test-app-created-source.mjs","test:app-add-exists":"bun test/test-app-add-exists.mjs","test:app-list-output-text":"bun test/test-app-list-output-text.mjs","test:doctor-analytics":"bun test/test-doctor-analytics.mjs","test:posthog-exception":"bun test/test-posthog-exception.mjs","test:cli-recovery":"bun test/test-cli-recovery.mjs","test:create-supabase-client":"bun test/test-create-supabase-client.mjs","test:onboarding-recovery":"bun test/test-onboarding-recovery.mjs","test:onboarding-progress":"bun test/test-onboarding-progress.mjs","test:onboarding-run-targets":"bun test/test-onboarding-run-targets.mjs","test:run-device-command":"bun test/test-run-device-command.mjs","test:init-app-conflict":"bun test/test-init-app-conflict.mjs","test:channel-add-exists":"bun test/test-channel-add-exists.mjs","test:wait-log":"bun test/test-wait-log.mjs","test:init-guardrails":"bun test/test-init-guardrails.mjs","test:init-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: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:init-monorepo-targeting":"bun run test:capacitor-config-target && bun run test:capacitor-config-typescript7 && bun run test:capacitor-config-native-import && bun run test:cli-user-error-config && bun test/test-init-monorepo-targeting.mjs","test:prompt-preferences":"bun test/test-prompt-preferences.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:auth-session":"bun test/test-auth-session.mjs","test:mcp":"node test/test-mcp.mjs","test:mcp-no-key-handshake":"node test/test-mcp-no-key-handshake.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs","test:project-type-detection":"bun test/test-project-type-detection.mjs","test:payload-split":"bun test/test-payload-split.mjs","test:macos-signing":"bun test/test-macos-signing.mjs","test:helper-dce":"bash scripts/check-helper-dce.sh","test:apple-api-import-helpers":"bun test/test-apple-api-import-helpers.mjs","test:apple-api-verify-key":"bun test/test-apple-api-verify-key.mjs","test:bundle-id-detector":"bun test/test-bundle-id-detector.mjs","test:apple-api-app-list":"bun test/test-apple-api-app-list.mjs","test:apple-api-cert-create":"bun test/test-apple-api-cert-create.mjs","test:app-verification":"bun test/test-app-verification.mjs","test:pbxproj-parser":"bun test/test-pbxproj-parser.mjs","test:manifest-path-encoding":"bun test/test-manifest-path-encoding.mjs","test:self-update":"bun test/test-self-update.mjs","test:update-prompt":"bun test/test-update-prompt.mjs","test:android-tail-engine":"bun test/test-android-tail-engine.mjs","test:android-tail-render":"bun test/test-android-tail-render.mjs","test:android-tail-routing":"bun test/test-android-tail-routing.mjs","test:dev-gate-stripped":"bun test/test-dev-gate-stripped.mjs","test:frame-fit-ios-shared":"bun test/test-frame-fit-ios-shared.mjs","test:ios-confirm-app-id":"bun test/test-ios-confirm-app-id.mjs","test:ios-create-new":"bun test/test-ios-create-new.mjs","test:ios-e2e":"bun test/test-ios-e2e.mjs","test:ios-flow-contract":"bun test/test-ios-flow-contract.mjs","test:ios-import-discovery":"bun test/test-ios-import-discovery.mjs","test:ios-import-export":"bun test/test-ios-import-export.mjs","test:ios-import-pickers":"bun test/test-ios-import-pickers.mjs","test:ios-import-recovery":"bun test/test-ios-import-recovery.mjs","test:ios-recovery":"bun test/test-ios-recovery.mjs","test:ios-resume":"bun test/test-ios-resume.mjs","test:ios-tail-handoff":"bun test/test-ios-tail-handoff.mjs","test:ios-tui-render":"bun test/test-ios-tui-render.mjs","test:p8-error":"bun test/test-p8-error.mjs","test:ios-tui-routing":"bun test/test-ios-tui-routing.mjs","test:ios-updater-sync-validation":"bun test/test-ios-updater-sync-validation.mjs","test:ios-verify-app":"bun test/test-ios-verify-app.mjs","test:ios-marketing-version":"bun test/test-ios-marketing-version.mjs","test:android-version":"bun test/test-android-version.mjs","test:platform-flow-contract":"bun test/test-platform-flow-contract.mjs","test:tail-engine-shared":"bun test/test-tail-engine-shared.mjs",test:"bun run build && bun run test:helper-dce && bun run test:version-detection:setup && bun run test:bundle && bun run test:notify-app-ready-background && bun run test:bundle-validation && bun run test:functional && bun run test:semver && bun run test:auto-bump-version && bun run test:auto-bump-ai-diff && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:fail-on-incompatible && bun run test:native-dependencies && bun run test:package-json-guard && bun run test:credentials && bun run test:credentials-export && bun run test:ios-provisioning-map && bun run test:ios-provisioning-command && bun run test:credentials-validation && bun run test:android-service-account-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:build-needed && bun run test:cli-help && bun run test:build-cache-payload && bun run test:build-cancellation && bun run test:ci-prompts && bun run test:ci-secrets && bun run test:android-onboarding-progress && bun run test:onboarding-telemetry && bun run test:v2-event-migration && bun run test:analytics && bun run test:cli-headers && bun run test:min-cli-version && bun run test:authenticated-command-invocation && bun run test:analytics-error-category && bun run test:analytics-org-resolver && bun run test:supabase-perf && bun run test:preview-qr && bun run test:app-set-options && bun run test:mcp-analytics && bun run test:mcp-instructions && bun run test:mcp-live-update-onboarding && bun run test:mcp-stdout-guard && bun run test:mcp-platform-select && bun run test:mcp-explain-scopes && bun run test:mcp-oauth-reopen && bun run test:mcp-broker-oauth && bun run test:mcp-broker-session && bun run test:mcp-credentials-manage && bun run test:mcp-resume-prompt && bun run test:mcp-build-job && bun run test:mcp-build-tools && bun run test:app-created-source && bun run test:app-add-exists && bun run test:app-list-output-text && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:cli-recovery && bun run test:create-supabase-client && bun run test:build-platform-selection && bun run test:builder-project-discovery && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-monorepo-targeting && bun run test:init-app-conflict && bun run test:channel-list && bun run test:channel-add-exists && bun run test:wait-log && bun run test:init-guardrails && bun run test:init-upload-recovery && bun run test:init-replay && bun run test:init-telemetry && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:mcp-no-key-handshake && bun run test:auth-session && bun run test:version-detection && bun run test:platform-paths && bun run test:project-type-detection && bun run test:payload-split && bun run test:manifest-path-encoding && bun run test:macos-signing && bun run test:asc-key-protocol && bun run test:apple-api-import-helpers && bun run test:apple-api-verify-key && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:cicd-failure-help && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-upload-prompt && bun run test:support-bundle-files && bun run test:self-update && bun run test:update-prompt && bun run test:apple-api-cert-create && bun run test:android-tail-engine && bun run test:android-tail-render && bun run test:android-tail-routing && bun run test:dev-gate-stripped && bun run test:frame-fit-ios-shared && bun run test:ios-confirm-app-id && bun run test:ios-create-new && bun run test:ios-e2e && bun run test:ios-flow-contract && bun run test:ios-import-discovery && bun run test:ios-import-export && bun run test:ios-import-pickers && bun run test:ios-import-recovery && bun run test:ios-recovery && bun run test:ios-resume && bun run test:ios-tail-handoff && bun run test:ios-tui-render && bun run test:p8-error && bun run test:ios-tui-routing && bun run test:ios-updater-sync-validation && bun run test:ios-verify-app && bun run test:ios-marketing-version && bun run test:android-version && bun run test:platform-flow-contract && bun run test:tail-engine-shared && bun run test:prescan && bun run test:android-reporting-api && bun run test:android-gcp && bun run test:android-app-verification && bun run test:android-rename && bun run test:appflow-auth && bun run test:appflow-api-map && bun run test:appflow-validate && bun run test:appflow-flow && bun run test:appflow-gapfill && bun run test:appflow-engine && bun run test:appflow-tail && bun run test:appflow-fetch && bun run test:appflow-sa-decode && bun run test:app-permission-helper && bun run test:2fa-compliance-network && bun run test:organization-set-api-host && bun run test:trial-warning && bun run test:plan-validation","test:build-platform-selection":"bun test/test-build-platform-selection.mjs","test:builder-project-discovery":"bun test/test-builder-project-discovery.mjs","test:ai-log-capture":"bun test/test-ai-log-capture.mjs","test:ai-analyze-flow":"bun test/test-ai-analyze-flow.mjs","test:cicd-failure-help":"bun test/test-cicd-failure-help.mjs","test:ai-analyze-stream":"bun test/test-ai-analyze-stream.mjs","test:ai-sse-parser":"bun test/test-ai-sse-parser.mjs","test:ai-render-markdown":"bun test/test-ai-render-markdown.mjs","test:ai-onboarding-mode":"bun test/test-ai-onboarding-mode.mjs","test:ai-fit":"bun test/test-ai-fit.mjs","test:platform-layout":"bun test/test-platform-layout.mjs","test:frame-fit":"bun test/run-frame-fit.mjs","test:onboarding-min-size":"bun test/test-onboarding-min-size.mjs","test:min-size-gate":"bun test/test-min-size-gate.mjs","test:shell-size-gate":"bun test/test-shell-size-gate.mjs","test:build-log-sanitize":"bun test/test-build-log-sanitize.mjs","test:build-output-viewport":"bun test/test-build-output-viewport.mjs","test:diff-viewer-viewport":"bun test/test-diff-viewer-viewport.mjs","test:build-complete-exit":"bun test/test-build-complete-exit.mjs","test:ai-stream-markdown":"bun test/test-ai-stream-markdown.mjs","test:support-mailto":"bun test/test-support-mailto.mjs","test:support-redact":"bun test/test-support-redact.mjs","test:support-internal-log":"bun test/test-support-internal-log.mjs","test:support-help-menu":"bun test/test-support-help-menu.mjs","test:support-contact":"bun test/test-support-contact.mjs","test:support-upload-prompt":"bun test/test-support-upload-prompt.mjs","test:support-bundle-files":"bun test/test-support-bundle-files.mjs","test:mcp-live-update-onboarding":"bun test/test-mcp-live-update-onboarding.mjs","test:app-set-options":"bun test/test-app-set-options.mjs && bun test/test-app-list-options.mjs","test:android-reporting-api":"bun test/test-android-reporting-api.mjs","test:android-gcp":"bun test/test-android-gcp.mjs","test:android-app-verification":"bun test/test-android-app-verification.mjs","test:android-rename":"bun test/test-android-rename.mjs","test:appflow-auth":"bun test/test-appflow-auth.mjs","test:appflow-api-map":"bun test/test-appflow-api-map.mjs","test:appflow-validate":"bun test/test-appflow-validate.mjs","test:appflow-flow":"bun test/test-appflow-flow.mjs","test:appflow-gapfill":"bun test/test-appflow-gapfill.mjs","test:appflow-engine":"bun test/test-appflow-engine.mjs","test:appflow-tail":"bun test/test-appflow-tail.mjs","test:appflow-fetch":"bun test/test-appflow-fetch.mjs","test:appflow-sa-decode":"bun test/test-appflow-sa-decode.mjs","test:app-permission-helper":"bun test/test-app-permission-helper.mjs","test:2fa-compliance-network":"bun test/test-2fa-compliance-network.mjs","test:organization-set-api-host":"bun test/test-organization-set-api-host.mjs","test:trial-warning":"bun test/test-trial-warning.mjs","test:plan-validation":"bun test/test-plan-validation.mjs","test:auto-bump-version":"bun test/test-auto-bump-version.mjs","test:auto-bump-ai-diff":"bun test/test-auto-bump-ai-diff.mjs","test:ios-provisioning-map":"bun test/test-ios-provisioning-map.mjs","test:ios-provisioning-command":"bun test/test-ios-provisioning-command.mjs","test:channel-list":"bun test/test-channel-list.mjs"},dependencies:{"@inkjs/ui":"^2.0.0","@manypkg/tools":"^2.1.2","@rrweb/types":"^2.1.1","@standard-schema/spec":"^1.1.0","@xmldom/xmldom":"^0.9.10","@xterm/addon-serialize":"^0.14.0","@xterm/headless":"^6.0.0","agent-cli-detector":"^0.1.6","happy-dom":"^20.11.0",ink:"^7.1.1","ink-spinner":"^5.0.0",jsonwebtoken:"^9.0.3","node-forge":"^1.4.0",qrcode:"^1.5.4",react:"^19.2.8","rrweb-snapshot":"^2.1.1","string-width":"^8.2.2",typescript:"6.0.3",zod:"^4.4.3"},optionalDependencies:{"@capgo/cli-helper-darwin-arm64":"^1.1.1","@capgo/cli-helper-darwin-x64":"^1.1.1","node-pty":"^1.1.0"},devDependencies:{"@antfu/eslint-config":"^9.2.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.6","@capacitor/cli":"^8.4.2","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.7.0","@modelcontextprotocol/client":"^2.0.0-beta.5","@modelcontextprotocol/server":"^2.0.0-beta.5","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver@1.0.8","@supabase/supabase-js":"^2.110.8","@tanstack/intent":"^0.3.6","@types/adm-zip":"^0.5.8","@types/jsonwebtoken":"^9.0.10","@types/node":"^26.1.1","@types/node-forge":"^1.3.14","@types/prettyjson":"^0.0.33","@types/qrcode":"^1.5.6","@types/react":"^19.2.17","@types/tmp":"^0.2.6","@types/ws":"^8.18.1","@typescript/native-preview":"7.0.0-dev.20260707.2","@vercel/ncc":"^0.44.1","@vue/compiler-dom":"3.5.40","@xterm/headless":"^6.0.0","adm-zip":"^0.6.0","ci-info":"^4.4.0",commander:"^15.0.0",eslint:"^10.7.0","git-format-staged":"4.0.2",husky:"^9.1.7","is-wsl":"^3.1.1",micromatch:"^4.0.8",open:"^11.0.0",oxlint:"^1.75.0",partysocket:"^1.3.0",prettyjson:"^1.2.5",tmp:"^0.2.7","tus-js-client":"^4.3.1",ws:"^8.21.1"}}});var U0;var y1=t(()=>{U0=class U0 extends Error{context;constructor($,D){super($);this.name="CliUserError",this.context=D}}});import{platform as Ej0}from"node:os";import{version as jj0}from"node:process";function Tj0($){for(let D=0;D<$.length;D++)if($.charCodeAt(D)>255)return!1;return!0}function Tb($){if($.toLowerCase()==="x-capgo-log-token")return"Build log token is missing. Re-run the build command or pass a valid log token.";return"Capgo API key is missing. Run `npx -y @capgo/cli@latest login` or pass `--apikey`."}function Cj0($){if($.toLowerCase()==="x-capgo-log-token")return"Build log token contains invalid characters (only ASCII is allowed). Re-run the build command to get a fresh token.";if($.toLowerCase()==="authorization")return"Authorization header contains invalid characters (only ASCII is allowed). Check your Capgo API key or Supabase anon key configuration.";return"Capgo API key contains invalid characters (only ASCII is allowed). Copy the key from the Capgo dashboard."}function z2($,D){if(D===void 0||D===null){if(O2.has($.toLowerCase()))throw new U0(Tb($));throw new U0(`HTTP header "${$}" is missing or invalid.`)}if(typeof D!=="string"){if(O2.has($.toLowerCase()))throw new U0(Tb($));throw new U0(`HTTP header "${$}" is missing or invalid.`)}if(!Tj0(D)){if(O2.has($.toLowerCase()))throw new U0(Cj0($));throw new U0(`HTTP header "${$}" contains invalid characters (only ASCII is allowed).`)}return D}function c1($){let D={capgo_api:Aj0,"x-cli-version":i$.version,"x-cli-command":Ij0,"x-cli-node":jj0,"x-cli-os":Ej0()};if($)for(let[Q,X]of Object.entries($))D[Q]=z2(Q,X);return D}var Aj0="2025-10-01",Ij0="",O2;var a6=t(()=>{Q8();y1();O2=new Set(["authorization","capgkey","x-capgo-log-token"])});var Cb,Pb=($)=>{return $===12288||$>=65281&&$<=65376||$>=65504&&$<=65510},Sb=($)=>{return $===8987||$===9001||$>=12272&&$<=12287||$>=12289&&$<=12350||$>=12441&&$<=12543||$>=12549&&$<=12591||$>=12593&&$<=12686||$>=12688&&$<=12771||$>=12783&&$<=12830||$>=12832&&$<=12871||$>=12880&&$<=19903||$>=65040&&$<=65049||$>=65072&&$<=65106||$>=65108&&$<=65126||$>=65128&&$<=65131||$>=127488&&$<=127490||$>=127504&&$<=127547||$>=127552&&$<=127560||$>=131072&&$<=196605||$>=196608&&$<=262141};var xb=t(()=>{Cb=(()=>{let $=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return(D)=>{let Q=0;$.lastIndex=0;while($.test(D))Q+=1;return D.length-Q}})()});var Pj0,Sj0,_b,xj0,vb,_j0,vj0,kj0,kb=($,D={},Q={})=>{let X=D.limit??1/0,J=D.ellipsis??"",Y=D?.ellipsisWidth??(J?kb(J,kj0,Q).width:0),Z=0,F=Q.controlWidth??0,G=Q.tabWidth??8,U=Q.emojiWidth??2,W=2,q=Q.regularWidth??1,K=Q.wideWidth??2,H=[[_j0,q],[Pj0,0],[Sj0,F],[xj0,G],[vb,U],[_b,K]],V=0,O=0,z=$.length,N=0,B=!1,L=z,M=Math.max(0,X-Y),w=0,R=0,x=0,_=0;$:while(!0){if(R>w||O>=z&&O>V){let j=$.slice(w,R)||$.slice(V,O);N=0;for(let k of j.replaceAll(vj0,"")){let v=k.codePointAt(0)||0;if(Pb(v))_=2;else if(Sb(v))_=K;else _=q;if(x+_>M)L=Math.min(L,Math.max(w,V)+N);if(x+_>X){B=!0;break $}N+=k.length,x+=_}w=R=0}if(O>=z)break $;for(let j=0,k=H.length;j<k;j++){let[v,g]=H[j];if(v.lastIndex=O,v.test($)){if(N=v===_b?Cb($.slice(O,v.lastIndex)):v===vb?1:v.lastIndex-O,_=N*g,x+_>M)L=Math.min(L,O+Math.floor((M-x)/g));if(x+_>X){B=!0;break $}x+=_,w=V,R=O,O=V=v.lastIndex;continue $}}O+=1}return{width:B?M:x,index:B?L:z,truncated:B,ellipsed:B&&X>=Y}},yb;var fb=t(()=>{xb();Pj0=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,Sj0=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,_b=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,xj0=/\t{1,1000}/y,vb=/[\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,_j0=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,vj0=/\p{M}+/gu,kj0={limit:1/0,ellipsis:""},yb=kb});var yj0,fj0=($,D={})=>{return yb($,yj0,D).width},P8;var L2=t(()=>{fb();yj0={limit:1/0,ellipsis:"",ellipsisWidth:0},P8=fj0});function E7($,D,Q){return String($).normalize().split(mj0).map((X)=>gj0(X,D,Q)).join(`
1
+ import{createRequire as Bj0}from"node:module";var module={exports:{}};var Oj0=Object.create;var{getPrototypeOf:zj0,defineProperty:rF,getOwnPropertyNames:Ib}=Object;var H2=Object.prototype.hasOwnProperty;function V2($){return this[$]}var H0=($,D,Q)=>{var X=Ib(D);for(let J of X)if(!H2.call($,J)&&J!=="default")rF($,J,{get:V2.bind(D,J),enumerable:!0});if(Q){for(let J of X)if(!H2.call(Q,J)&&J!=="default")rF(Q,J,{get:V2.bind(D,J),enumerable:!0});return Q}},Lj0,Mj0,S1=($,D,Q)=>{var X=$!=null&&typeof $==="object";if(X){var J=D?Lj0??=new WeakMap:Mj0??=new WeakMap,Y=J.get($);if(Y)return Y}Q=$!=null?Oj0(zj0($)):{};let Z=D||!$||!$.__esModule?rF(Q,"default",{value:$,enumerable:!0}):Q;for(let F of Ib($))if(!H2.call(Z,F))rF(Z,F,{get:V2.bind($,F),enumerable:!0});if(X)J.set($,Z);return Z};var E=($,D)=>()=>(D||$((D={exports:{}}).exports,D),D.exports);var Nj0=($)=>$;function wj0($,D){this[$]=Nj0.bind(null,D)}var Q6=($,D)=>{for(var Q in D)rF($,Q,{get:D[Q],enumerable:!0,configurable:!0,set:wj0.bind(D,Q)})};var t=($,D)=>()=>($&&(D=$($=0)),D);var Q0=Bj0(import.meta.url);var i$;var Q8=t(()=>{i$={name:"@capgo/cli",type:"module",version:"8.53.1",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/capgo/tree/main/cli#readme",repository:{type:"git",url:"https://github.com/Cap-go/capgo.app",directory:"cli"},bugs:{url:"https://github.com/Cap-go/capgo/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli","sdk","tanstack-intent"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",bin:{capgo:"dist/index.js"},files:["!skills/_artifacts","dist","skills"],engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && bun build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"bunx --bun supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",typecheck:"tsgo --project tsconfig.tsgo.json --noEmit",lint:"bun run lint:ox","lint:ox":"oxlint --config ../.oxlintrc.json src","lint:fix":"oxlint --config ../.oxlintrc.json --fix src","check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test:notify-app-ready-background":"bun test ./test/test-notify-app-ready-background.mjs","test:bundle":"bun test/test-bundle.mjs","test:bundle-validation":"bun test test/bundle/","test:prescan":"bun test test/prescan/","test:functional":"bun test/test-functional.mjs","test:semver":"bun test/test-semver-validation.mjs","test:version-edge-cases":"bun test/test-version-validation.mjs","test:regex":"bun test/test-regex-validation.mjs","test:upload":"bun test/test-upload-validation.mjs","test:fail-on-incompatible":"bun test/test-fail-on-incompatible.mjs","test:native-dependencies":"bun test/test-native-dependencies.mjs && bun test/test-get-remote-dependencies.mjs","test:package-json-guard":"bun test/test-package-json-guard.mjs","test:credentials":"bun test/test-credentials.mjs","test:credentials-export":"bun test/test-credentials-export.mjs","test:asc-key-protocol":"bun test/test-asc-key-protocol.mjs","test:credentials-validation":"bun test/test-credentials-validation.mjs","test:android-service-account-validation":"bun test/test-android-service-account-validation.mjs","test:build-zip-filter":"bun test/test-build-zip-filter.mjs","test:checksum":"bun test/test-checksum-algorithm.mjs","test:build-needed":"bun test/test-build-needed.mjs","test:cli-help":"bun test/test-cli-help.mjs","test:build-cache-payload":"bun test/test-build-cache-payload.mjs","test:build-cancellation":"bun test/test-build-cancellation.mjs","test:ci-prompts":"bun test/test-ci-prompts.mjs","test:ci-secrets":"bun test/test-ci-secrets.mjs","test:android-onboarding-progress":"bun test/test-android-onboarding-progress.mjs","test:onboarding-telemetry":"bun test/test-onboarding-telemetry.mjs","test:v2-event-migration":"bun test/test-v2-event-migration.mjs","test:analytics":"bun test/test-analytics.mjs","test:cli-headers":"bun test/test-cli-headers.mjs","test:min-cli-version":"bun test/test-min-cli-version.mjs","test:authenticated-command-invocation":"bun test/test-authenticated-command-invocation.mjs","test:analytics-error-category":"bun test/test-analytics-error-category.mjs","test:analytics-org-resolver":"bun test/test-analytics-org-resolver.mjs","test:supabase-perf":"bun test/test-supabase-perf.mjs","test:preview-qr":"bun test/test-preview-qr.mjs","test:mcp-analytics":"bun test/test-mcp-analytics.mjs","test:mcp-instructions":"bun test/test-mcp-instructions.mjs","test:mcp-stdout-guard":"bun test/test-mcp-stdout-guard.mjs","test:mcp-platform-select":"bun test/test-mcp-platform-select.mjs","test:mcp-explain-scopes":"bun test/test-mcp-explain-scopes.mjs","test:mcp-oauth-reopen":"bun test/test-mcp-oauth-reopen.mjs","test:mcp-broker-oauth":"bun test/test-mcp-broker-oauth.mjs","test:mcp-broker-session":"bun test/test-mcp-broker-session.mjs","test:mcp-credentials-manage":"bun test/test-mcp-credentials-manage.mjs","test:mcp-resume-prompt":"bun test/test-mcp-resume-prompt.mjs","test:mcp-build-job":"bun test/test-mcp-build-job.mjs","test:mcp-build-tools":"bun test/test-mcp-build-tools.mjs","test:app-created-source":"bun test/test-app-created-source.mjs","test:app-add-exists":"bun test/test-app-add-exists.mjs","test:app-list-output-text":"bun test/test-app-list-output-text.mjs","test:doctor-analytics":"bun test/test-doctor-analytics.mjs","test:posthog-exception":"bun test/test-posthog-exception.mjs","test:cli-recovery":"bun test/test-cli-recovery.mjs","test:create-supabase-client":"bun test/test-create-supabase-client.mjs","test:onboarding-recovery":"bun test/test-onboarding-recovery.mjs","test:onboarding-progress":"bun test/test-onboarding-progress.mjs","test:onboarding-run-targets":"bun test/test-onboarding-run-targets.mjs","test:run-device-command":"bun test/test-run-device-command.mjs","test:init-app-conflict":"bun test/test-init-app-conflict.mjs","test:channel-add-exists":"bun test/test-channel-add-exists.mjs","test:wait-log":"bun test/test-wait-log.mjs","test:init-guardrails":"bun test/test-init-guardrails.mjs","test:init-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: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:init-monorepo-targeting":"bun run test:capacitor-config-target && bun run test:capacitor-config-typescript7 && bun run test:capacitor-config-native-import && bun run test:cli-user-error-config && bun test/test-init-monorepo-targeting.mjs","test:prompt-preferences":"bun test/test-prompt-preferences.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:auth-session":"bun test/test-auth-session.mjs","test:mcp":"node test/test-mcp.mjs","test:mcp-no-key-handshake":"node test/test-mcp-no-key-handshake.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs","test:project-type-detection":"bun test/test-project-type-detection.mjs","test:payload-split":"bun test/test-payload-split.mjs","test:macos-signing":"bun test/test-macos-signing.mjs","test:helper-dce":"bash scripts/check-helper-dce.sh","test:apple-api-import-helpers":"bun test/test-apple-api-import-helpers.mjs","test:apple-api-verify-key":"bun test/test-apple-api-verify-key.mjs","test:bundle-id-detector":"bun test/test-bundle-id-detector.mjs","test:apple-api-app-list":"bun test/test-apple-api-app-list.mjs","test:apple-api-cert-create":"bun test/test-apple-api-cert-create.mjs","test:app-verification":"bun test/test-app-verification.mjs","test:pbxproj-parser":"bun test/test-pbxproj-parser.mjs","test:manifest-path-encoding":"bun test/test-manifest-path-encoding.mjs","test:self-update":"bun test/test-self-update.mjs","test:update-prompt":"bun test/test-update-prompt.mjs","test:android-tail-engine":"bun test/test-android-tail-engine.mjs","test:android-tail-render":"bun test/test-android-tail-render.mjs","test:android-tail-routing":"bun test/test-android-tail-routing.mjs","test:dev-gate-stripped":"bun test/test-dev-gate-stripped.mjs","test:frame-fit-ios-shared":"bun test/test-frame-fit-ios-shared.mjs","test:ios-confirm-app-id":"bun test/test-ios-confirm-app-id.mjs","test:ios-create-new":"bun test/test-ios-create-new.mjs","test:ios-e2e":"bun test/test-ios-e2e.mjs","test:ios-flow-contract":"bun test/test-ios-flow-contract.mjs","test:ios-import-discovery":"bun test/test-ios-import-discovery.mjs","test:ios-import-export":"bun test/test-ios-import-export.mjs","test:ios-import-pickers":"bun test/test-ios-import-pickers.mjs","test:ios-import-recovery":"bun test/test-ios-import-recovery.mjs","test:ios-recovery":"bun test/test-ios-recovery.mjs","test:ios-resume":"bun test/test-ios-resume.mjs","test:ios-tail-handoff":"bun test/test-ios-tail-handoff.mjs","test:ios-tui-render":"bun test/test-ios-tui-render.mjs","test:p8-error":"bun test/test-p8-error.mjs","test:ios-tui-routing":"bun test/test-ios-tui-routing.mjs","test:ios-updater-sync-validation":"bun test/test-ios-updater-sync-validation.mjs","test:ios-verify-app":"bun test/test-ios-verify-app.mjs","test:ios-marketing-version":"bun test/test-ios-marketing-version.mjs","test:android-version":"bun test/test-android-version.mjs","test:platform-flow-contract":"bun test/test-platform-flow-contract.mjs","test:tail-engine-shared":"bun test/test-tail-engine-shared.mjs",test:"bun run build && bun run test:helper-dce && bun run test:version-detection:setup && bun run test:bundle && bun run test:notify-app-ready-background && bun run test:bundle-validation && bun run test:functional && bun run test:semver && bun run test:auto-bump-version && bun run test:auto-bump-ai-diff && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:fail-on-incompatible && bun run test:native-dependencies && bun run test:package-json-guard && bun run test:credentials && bun run test:credentials-export && bun run test:ios-provisioning-map && bun run test:ios-provisioning-command && bun run test:credentials-validation && bun run test:android-service-account-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:build-needed && bun run test:cli-help && bun run test:build-cache-payload && bun run test:build-cancellation && bun run test:ci-prompts && bun run test:ci-secrets && bun run test:android-onboarding-progress && bun run test:onboarding-telemetry && bun run test:v2-event-migration && bun run test:analytics && bun run test:cli-headers && bun run test:min-cli-version && bun run test:authenticated-command-invocation && bun run test:analytics-error-category && bun run test:analytics-org-resolver && bun run test:supabase-perf && bun run test:preview-qr && bun run test:app-set-options && bun run test:mcp-analytics && bun run test:mcp-instructions && bun run test:mcp-live-update-onboarding && bun run test:mcp-stdout-guard && bun run test:mcp-platform-select && bun run test:mcp-explain-scopes && bun run test:mcp-oauth-reopen && bun run test:mcp-broker-oauth && bun run test:mcp-broker-session && bun run test:mcp-credentials-manage && bun run test:mcp-resume-prompt && bun run test:mcp-build-job && bun run test:mcp-build-tools && bun run test:app-created-source && bun run test:app-add-exists && bun run test:app-list-output-text && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:cli-recovery && bun run test:create-supabase-client && bun run test:build-platform-selection && bun run test:builder-project-discovery && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-monorepo-targeting && bun run test:init-app-conflict && bun run test:channel-list && bun run test:channel-add-exists && bun run test:wait-log && bun run test:init-guardrails && bun run test:init-upload-recovery && bun run test:init-replay && bun run test:init-telemetry && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:mcp-no-key-handshake && bun run test:auth-session && bun run test:version-detection && bun run test:platform-paths && bun run test:project-type-detection && bun run test:payload-split && bun run test:manifest-path-encoding && bun run test:macos-signing && bun run test:asc-key-protocol && bun run test:apple-api-import-helpers && bun run test:apple-api-verify-key && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:cicd-failure-help && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-upload-prompt && bun run test:support-bundle-files && bun run test:self-update && bun run test:update-prompt && bun run test:apple-api-cert-create && bun run test:android-tail-engine && bun run test:android-tail-render && bun run test:android-tail-routing && bun run test:dev-gate-stripped && bun run test:frame-fit-ios-shared && bun run test:ios-confirm-app-id && bun run test:ios-create-new && bun run test:ios-e2e && bun run test:ios-flow-contract && bun run test:ios-import-discovery && bun run test:ios-import-export && bun run test:ios-import-pickers && bun run test:ios-import-recovery && bun run test:ios-recovery && bun run test:ios-resume && bun run test:ios-tail-handoff && bun run test:ios-tui-render && bun run test:p8-error && bun run test:ios-tui-routing && bun run test:ios-updater-sync-validation && bun run test:ios-verify-app && bun run test:ios-marketing-version && bun run test:android-version && bun run test:platform-flow-contract && bun run test:tail-engine-shared && bun run test:prescan && bun run test:android-reporting-api && bun run test:android-gcp && bun run test:android-app-verification && bun run test:android-rename && bun run test:appflow-auth && bun run test:appflow-api-map && bun run test:appflow-validate && bun run test:appflow-flow && bun run test:appflow-gapfill && bun run test:appflow-engine && bun run test:appflow-tail && bun run test:appflow-fetch && bun run test:appflow-sa-decode && bun run test:app-permission-helper && bun run test:2fa-compliance-network && bun run test:organization-set-api-host && bun run test:trial-warning && bun run test:plan-validation","test:build-platform-selection":"bun test/test-build-platform-selection.mjs","test:builder-project-discovery":"bun test/test-builder-project-discovery.mjs","test:ai-log-capture":"bun test/test-ai-log-capture.mjs","test:ai-analyze-flow":"bun test/test-ai-analyze-flow.mjs","test:cicd-failure-help":"bun test/test-cicd-failure-help.mjs","test:ai-analyze-stream":"bun test/test-ai-analyze-stream.mjs","test:ai-sse-parser":"bun test/test-ai-sse-parser.mjs","test:ai-render-markdown":"bun test/test-ai-render-markdown.mjs","test:ai-onboarding-mode":"bun test/test-ai-onboarding-mode.mjs","test:ai-fit":"bun test/test-ai-fit.mjs","test:platform-layout":"bun test/test-platform-layout.mjs","test:frame-fit":"bun test/run-frame-fit.mjs","test:onboarding-min-size":"bun test/test-onboarding-min-size.mjs","test:min-size-gate":"bun test/test-min-size-gate.mjs","test:shell-size-gate":"bun test/test-shell-size-gate.mjs","test:build-log-sanitize":"bun test/test-build-log-sanitize.mjs","test:build-output-viewport":"bun test/test-build-output-viewport.mjs","test:diff-viewer-viewport":"bun test/test-diff-viewer-viewport.mjs","test:build-complete-exit":"bun test/test-build-complete-exit.mjs","test:ai-stream-markdown":"bun test/test-ai-stream-markdown.mjs","test:support-mailto":"bun test/test-support-mailto.mjs","test:support-redact":"bun test/test-support-redact.mjs","test:support-internal-log":"bun test/test-support-internal-log.mjs","test:support-help-menu":"bun test/test-support-help-menu.mjs","test:support-contact":"bun test/test-support-contact.mjs","test:support-upload-prompt":"bun test/test-support-upload-prompt.mjs","test:support-bundle-files":"bun test/test-support-bundle-files.mjs","test:mcp-live-update-onboarding":"bun test/test-mcp-live-update-onboarding.mjs","test:app-set-options":"bun test/test-app-set-options.mjs && bun test/test-app-list-options.mjs","test:android-reporting-api":"bun test/test-android-reporting-api.mjs","test:android-gcp":"bun test/test-android-gcp.mjs","test:android-app-verification":"bun test/test-android-app-verification.mjs","test:android-rename":"bun test/test-android-rename.mjs","test:appflow-auth":"bun test/test-appflow-auth.mjs","test:appflow-api-map":"bun test/test-appflow-api-map.mjs","test:appflow-validate":"bun test/test-appflow-validate.mjs","test:appflow-flow":"bun test/test-appflow-flow.mjs","test:appflow-gapfill":"bun test/test-appflow-gapfill.mjs","test:appflow-engine":"bun test/test-appflow-engine.mjs","test:appflow-tail":"bun test/test-appflow-tail.mjs","test:appflow-fetch":"bun test/test-appflow-fetch.mjs","test:appflow-sa-decode":"bun test/test-appflow-sa-decode.mjs","test:app-permission-helper":"bun test/test-app-permission-helper.mjs","test:2fa-compliance-network":"bun test/test-2fa-compliance-network.mjs","test:organization-set-api-host":"bun test/test-organization-set-api-host.mjs","test:trial-warning":"bun test/test-trial-warning.mjs","test:plan-validation":"bun test/test-plan-validation.mjs","test:auto-bump-version":"bun test/test-auto-bump-version.mjs","test:auto-bump-ai-diff":"bun test/test-auto-bump-ai-diff.mjs","test:ios-provisioning-map":"bun test/test-ios-provisioning-map.mjs","test:ios-provisioning-command":"bun test/test-ios-provisioning-command.mjs","test:channel-list":"bun test/test-channel-list.mjs"},dependencies:{"@inkjs/ui":"^2.0.0","@manypkg/tools":"^2.1.2","@rrweb/types":"^2.1.1","@standard-schema/spec":"^1.1.0","@xmldom/xmldom":"^0.9.10","@xterm/addon-serialize":"^0.14.0","@xterm/headless":"^6.0.0","agent-cli-detector":"^0.1.6","happy-dom":"^20.11.0",ink:"^7.1.1","ink-spinner":"^5.0.0",jsonwebtoken:"^9.0.3","node-forge":"^1.4.0",qrcode:"^1.5.4",react:"^19.2.8","rrweb-snapshot":"^2.1.1","string-width":"^8.2.2",typescript:"6.0.3",zod:"^4.4.3"},optionalDependencies:{"@capgo/cli-helper-darwin-arm64":"^1.1.1","@capgo/cli-helper-darwin-x64":"^1.1.1","node-pty":"^1.1.0"},devDependencies:{"@antfu/eslint-config":"^9.2.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.6","@capacitor/cli":"^8.4.2","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.7.0","@modelcontextprotocol/client":"^2.0.0-beta.5","@modelcontextprotocol/server":"^2.0.0-beta.5","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver@1.0.8","@supabase/supabase-js":"^2.110.8","@tanstack/intent":"^0.3.6","@types/adm-zip":"^0.5.8","@types/jsonwebtoken":"^9.0.10","@types/node":"^26.1.1","@types/node-forge":"^1.3.14","@types/prettyjson":"^0.0.33","@types/qrcode":"^1.5.6","@types/react":"^19.2.17","@types/tmp":"^0.2.6","@types/ws":"^8.18.1","@typescript/native-preview":"7.0.0-dev.20260707.2","@vercel/ncc":"^0.44.1","@vue/compiler-dom":"3.5.40","@xterm/headless":"^6.0.0","adm-zip":"^0.6.0","ci-info":"^4.4.0",commander:"^15.0.0",eslint:"^10.7.0","git-format-staged":"4.0.2",husky:"^9.1.7","is-wsl":"^3.1.1",micromatch:"^4.0.8",open:"^11.0.0",oxlint:"^1.75.0",partysocket:"^1.3.0",prettyjson:"^1.2.5",tmp:"^0.2.7","tus-js-client":"^4.3.1",ws:"^8.21.1"}}});var U0;var y1=t(()=>{U0=class U0 extends Error{context;constructor($,D){super($);this.name="CliUserError",this.context=D}}});import{platform as Ej0}from"node:os";import{version as jj0}from"node:process";function Tj0($){for(let D=0;D<$.length;D++)if($.charCodeAt(D)>255)return!1;return!0}function Tb($){if($.toLowerCase()==="x-capgo-log-token")return"Build log token is missing. Re-run the build command or pass a valid log token.";return"Capgo API key is missing. Run `npx -y @capgo/cli@latest login` or pass `--apikey`."}function Cj0($){if($.toLowerCase()==="x-capgo-log-token")return"Build log token contains invalid characters (only ASCII is allowed). Re-run the build command to get a fresh token.";if($.toLowerCase()==="authorization")return"Authorization header contains invalid characters (only ASCII is allowed). Check your Capgo API key or Supabase anon key configuration.";return"Capgo API key contains invalid characters (only ASCII is allowed). Copy the key from the Capgo dashboard."}function z2($,D){if(D===void 0||D===null){if(O2.has($.toLowerCase()))throw new U0(Tb($));throw new U0(`HTTP header "${$}" is missing or invalid.`)}if(typeof D!=="string"){if(O2.has($.toLowerCase()))throw new U0(Tb($));throw new U0(`HTTP header "${$}" is missing or invalid.`)}if(!Tj0(D)){if(O2.has($.toLowerCase()))throw new U0(Cj0($));throw new U0(`HTTP header "${$}" contains invalid characters (only ASCII is allowed).`)}return D}function c1($){let D={capgo_api:Aj0,"x-cli-version":i$.version,"x-cli-command":Ij0,"x-cli-node":jj0,"x-cli-os":Ej0()};if($)for(let[Q,X]of Object.entries($))D[Q]=z2(Q,X);return D}var Aj0="2025-10-01",Ij0="",O2;var a6=t(()=>{Q8();y1();O2=new Set(["authorization","capgkey","x-capgo-log-token"])});var Cb,Pb=($)=>{return $===12288||$>=65281&&$<=65376||$>=65504&&$<=65510},Sb=($)=>{return $===8987||$===9001||$>=12272&&$<=12287||$>=12289&&$<=12350||$>=12441&&$<=12543||$>=12549&&$<=12591||$>=12593&&$<=12686||$>=12688&&$<=12771||$>=12783&&$<=12830||$>=12832&&$<=12871||$>=12880&&$<=19903||$>=65040&&$<=65049||$>=65072&&$<=65106||$>=65108&&$<=65126||$>=65128&&$<=65131||$>=127488&&$<=127490||$>=127504&&$<=127547||$>=127552&&$<=127560||$>=131072&&$<=196605||$>=196608&&$<=262141};var xb=t(()=>{Cb=(()=>{let $=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return(D)=>{let Q=0;$.lastIndex=0;while($.test(D))Q+=1;return D.length-Q}})()});var Pj0,Sj0,_b,xj0,vb,_j0,vj0,kj0,kb=($,D={},Q={})=>{let X=D.limit??1/0,J=D.ellipsis??"",Y=D?.ellipsisWidth??(J?kb(J,kj0,Q).width:0),Z=0,F=Q.controlWidth??0,G=Q.tabWidth??8,U=Q.emojiWidth??2,W=2,q=Q.regularWidth??1,K=Q.wideWidth??2,H=[[_j0,q],[Pj0,0],[Sj0,F],[xj0,G],[vb,U],[_b,K]],V=0,O=0,z=$.length,N=0,B=!1,L=z,M=Math.max(0,X-Y),w=0,R=0,x=0,_=0;$:while(!0){if(R>w||O>=z&&O>V){let j=$.slice(w,R)||$.slice(V,O);N=0;for(let k of j.replaceAll(vj0,"")){let v=k.codePointAt(0)||0;if(Pb(v))_=2;else if(Sb(v))_=K;else _=q;if(x+_>M)L=Math.min(L,Math.max(w,V)+N);if(x+_>X){B=!0;break $}N+=k.length,x+=_}w=R=0}if(O>=z)break $;for(let j=0,k=H.length;j<k;j++){let[v,g]=H[j];if(v.lastIndex=O,v.test($)){if(N=v===_b?Cb($.slice(O,v.lastIndex)):v===vb?1:v.lastIndex-O,_=N*g,x+_>M)L=Math.min(L,O+Math.floor((M-x)/g));if(x+_>X){B=!0;break $}x+=_,w=V,R=O,O=V=v.lastIndex;continue $}}O+=1}return{width:B?M:x,index:B?L:z,truncated:B,ellipsed:B&&X>=Y}},yb;var fb=t(()=>{xb();Pj0=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,Sj0=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,_b=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,xj0=/\t{1,1000}/y,vb=/[\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,_j0=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,vj0=/\p{M}+/gu,kj0={limit:1/0,ellipsis:""},yb=kb});var yj0,fj0=($,D={})=>{return yb($,yj0,D).width},P8;var L2=t(()=>{fb();yj0={limit:1/0,ellipsis:"",ellipsisWidth:0},P8=fj0});function E7($,D,Q){return String($).normalize().split(mj0).map((X)=>gj0(X,D,Q)).join(`
2
2
  `)}var sq="\x1B",mb="›",uj0=39,N2="\x07",db="[",bj0="]",cb="m",w2,ub,bb=($)=>{if($>=30&&$<=37)return 39;if($>=90&&$<=97)return 39;if($>=40&&$<=47)return 49;if($>=100&&$<=107)return 49;if($===1||$===2)return 22;if($===3)return 23;if($===4)return 24;if($===7)return 27;if($===8)return 28;if($===9)return 29;if($===0)return 0;return},hb=($)=>`${sq}${db}${$}${cb}`,gb=($)=>`${sq}${w2}${$}${N2}`,M2=($,D,Q)=>{let X=D[Symbol.iterator](),J=!1,Y=!1,Z=$.at(-1),F=Z===void 0?0:P8(Z),G=X.next(),U=X.next(),W=0;while(!G.done){let q=G.value,K=P8(q);if(F+K<=Q)$[$.length-1]+=q;else $.push(q),F=0;if(q===sq||q===mb)J=!0,Y=D.startsWith(w2,W+1);if(J){if(Y){if(q===N2)J=!1,Y=!1}else if(q===cb)J=!1}else if(F+=K,F===Q&&!U.done)$.push(""),F=0;G=U,U=X.next(),W+=q.length}if(Z=$.at(-1),!F&&Z!==void 0&&Z.length&&$.length>1)$[$.length-2]+=$.pop()},hj0=($)=>{let D=$.split(" "),Q=D.length;while(Q){if(P8(D[Q-1]))break;Q--}if(Q===D.length)return $;return D.slice(0,Q).join(" ")+D.slice(Q).join("")},gj0=($,D,Q={})=>{if(Q.trim!==!1&&$.trim()==="")return"";let X="",J,Y,Z=$.split(" "),F=[""],G=0;for(let q=0;q<Z.length;q++){let K=Z[q];if(Q.trim!==!1){let V=F.at(-1)??"",O=V.trimStart();if(V.length!==O.length)F[F.length-1]=O,G=P8(O)}if(q!==0){if(G>=D&&(Q.wordWrap===!1||Q.trim===!1))F.push(""),G=0;if(G||Q.trim===!1)F[F.length-1]+=" ",G++}let H=P8(K);if(Q.hard&&H>D){let V=D-G,O=1+Math.floor((H-V-1)/D);if(Math.floor((H-1)/D)<O)F.push("");M2(F,K,D),G=P8(F.at(-1)??"");continue}if(G+H>D&&G&&H){if(Q.wordWrap===!1&&G<D){M2(F,K,D),G=P8(F.at(-1)??"");continue}F.push(""),G=0}if(G+H>D&&Q.wordWrap===!1){M2(F,K,D),G=P8(F.at(-1)??"");continue}F[F.length-1]+=K,G+=H}if(Q.trim!==!1)F=F.map((q)=>hj0(q));let U=F.join(`
3
3
  `),W=!1;for(let q=0;q<U.length;q++){let K=U[q];if(X+=K,!W){if(W=K>="\uD800"&&K<="\uDBFF",W)continue}else W=!1;if(K===sq||K===mb){ub.lastIndex=q+1;let V=ub.exec(U)?.groups;if(V?.code!==void 0){let O=Number.parseFloat(V.code);J=O===uj0?void 0:O}else if(V?.uri!==void 0)Y=V.uri.length===0?void 0:V.uri}if(U[q+1]===`
4
4
  `){if(Y)X+=gb("");let H=J?bb(J):void 0;if(J&&H)X+=hb(H)}else if(K===`
@@ -505,7 +505,7 @@ ${b51($)}
505
505
  Done ✅`}function g51($){let D=["Name","id"];if($.showOrg)D.push("Organization");if(D.push("Created"),$.showOrgId)D.push("Organization ID");return D}function m51($,D,Q){let X=[$.name??"",$.app_id];if(D.showOrg)X.push(Q.get($.owner_org)??"Unknown");if(X.push(KX($.created_at)),D.showOrgId)X.push($.owner_org);return X}function d51($,D,Q){let X=new m8;X.headers=g51(D),X.rows=[];for(let J of $.toReversed())X.rows.push(m51(J,D,Q));C.success("Apps"),C.success(X.toString())}async function c51($,D,Q){let X=[],J=0;while(!0){let{data:Y,error:Z}=await q1(XW(J,Q.filterByOrgId),{apikey:$,method:"GET",body:void 0,supaHost:Q.supaHost,supaAnon:Q.supaAnon});if(Z){if(!D)C.error("Apps not found");throw Error(`Apps not found: ${F0(Z)}`)}let F=Array.isArray(Y)?Y:[];if(!F.length)break;if(X.push(...F),F.length<50)break;J+=1}return X.sort((Y,Z)=>String(Z.created_at).localeCompare(String(Y.created_at)))}async function OF0($,D=!1){let Q=!D&&$.outputText;if(!D&&!Q)o0("List apps in Capgo");if(await R$(Q?{warn:(Y)=>HF0.write(`${Y}
506
506
  `)}:void 0),Q&&$.apikey)k_("Use provided API key");$.apikey=$.apikey||f0(!1,Q?k_:void 0);let X=await U1($.apikey,$.supaHost,$.supaAnon,Boolean(Q));if(await K$(X,$.apikey),!D){if($.filterByOrgId)if(Q)HF0.write(`${VF0}
507
507
  `);else C.warn(VF0);if(!Q)C.info("Getting active bundle in Capgo")}let J=await c51($.apikey,D||Boolean(Q),{supaHost:$.supaHost,supaAnon:$.supaAnon,filterByOrgId:$.filterByOrgId});if(F1({channel:"app",event:"Apps Listed",tags:{app_count:J.length}}),!J.length){if(!D&&!Q)C.error("No apps found");throw Error("No apps found")}if(!D)if(Q)k_(`
508
- ${h51(J)}`);else{let Y=new Map;if($.showOrg){let{data:Z,error:F}=await X.rpc("get_orgs_v7");if(F)throw Error(`Cannot get organizations: ${F0(F)}`);for(let G of Z??[])Y.set(G.gid,G.name??"Unknown")}C.info(`Active app in Capgo: ${J.length}`),d51(J,$,Y),Q1("Done ✅")}return J}F6();nH();import{env as l51}from"node:process";var n51=["CURSOR_AGENT","CURSOR_TRACE_ID","CLAUDECODE","CLAUDE_CODE","AIDER","GEMINI_CLI","CODEX_CLI","CAPGO_ONBOARDING_SOURCE"];function zF0($=l51){if($.CAPGO_ONBOARDING_SOURCE==="ai")return!0;return n51.some((D)=>D!=="CAPGO_ONBOARDING_SOURCE"&&Boolean($[D]))}y1();e0();var p51=/^[a-z0-9]+(\.[\w-]+)+$/i;function i51($,D,Q){if(!D.apikey){if(!Q)C.error("Missing API key, you need to provide an API key to upload your bundle");throw new U0("Missing API key")}if(!$){if(!Q)C.error("Missing argument, you need to provide a appId, or be in a capacitor project");throw new U0("Missing appId")}if($==="io.ionic.starter"){if(!Q)C.error(`This appId ${$} cannot be used it's reserved, please change it in your capacitor config.`);throw new U0("Reserved appId, please change it in capacitor config")}if($.includes("--")){if(!Q)C.error('The app id includes illegal symbols. You cannot use "--" in the app id');throw new U0("App id includes illegal symbols")}if(!p51.test($)){if(!Q)C.error(`Invalid app ID format: "${$}"`),C.info("App ID must be in reverse domain notation (e.g., com.example.app)"),C.info("Valid format: lowercase letters, numbers, dots, hyphens, and underscores"),C.info("Examples: com.mycompany.myapp, io.capgo.app, com.example.my-app");throw new U0("Invalid app ID format")}}function r51($){if($)return $;return lH()==="mcp"?"mcp":"cli-direct"}function o51($){if(!$||typeof $!=="object")return!1;let{status:D,statusCode:Q}=$;return D===409||Q==="409"}function t51($,D){if(D===409)return!0;let Q=F0($).toLowerCase();return Q.includes("app_id_already_exists")||Q.includes("app id already exists")}async function a51($,D,Q,X){let J=0;while(!0){let{data:Y,error:Z}=await q1(XW(J,Q),{apikey:$,method:"GET",body:void 0,supaHost:X?.supaHost,supaAnon:X?.supaAnon});if(Z){let G=z8(Z);if(G===400||G===401||G===403)return null;throw Z}let F=Array.isArray(Y)?Y:[];if(F.some((G)=>G.app_id===D))return!0;if(F.length<50)return!1;J+=1}}async function s51($,D,Q,X){let{data:J,error:Y}=await q1(`app/${encodeURIComponent(D)}`,{apikey:$,method:"GET",body:void 0,supaHost:X?.supaHost,supaAnon:X?.supaAnon});if(Y){let Z=z8(Y);if(Z===404)return!1;if(Z===401||Z===403)return null;throw Y}return J?.owner_org===Q}async function e51($,D={}){let X=await(D.isAppInTargetOrganization??s51)($.apikey,$.appId,$.ownerOrg,{supaHost:$.supaHost,supaAnon:$.supaAnon});if(X===!0)return!0;if(X===!1)return!1;let Y=await(D.isAppListedInOrganization??a51)($.apikey,$.appId,$.ownerOrg,{supaHost:$.supaHost,supaAnon:$.supaAnon});if(Y===!0)return!0;if(Y===!1)return!1;throw Error("Cannot verify app ownership for this API key. Grant app.read or org.read, then retry.")}async function $Q1($,D={}){if(!t51($.createError,$.httpStatus))return"not_duplicate";try{return await e51($,D)?"duplicate_owned":"duplicate_taken"}catch(Q){throw Error(F0(Q))}}async function DQ1($,D){let Q=await sU({supaHost:D.supaHost,supaAnon:D.supaAnon}),J=Q.includes("/functions/v1")&&D.supaAnon?`Bearer ${D.supaAnon}`:$,Y=await fetch(`${Q}/app`,{method:"POST",headers:c1({"Content-Type":"application/json",Authorization:J,capgkey:$}),body:JSON.stringify({owner_org:D.ownerOrg,app_id:D.appId,name:D.name,...D.iconUrl?{icon:D.iconUrl}:{},need_onboarding:!1,created_from_onboarding:D.createdFromOnboarding,onboarding:D.onboardingSource?{source:D.onboardingSource,outcome:"in_progress"}:void 0})}),Z=await Y.json().catch(()=>null);if(!Y.ok){let G=gL(Z)||`HTTP ${Y.status}`,U=Error(G);throw U.httpStatus=Y.status,U}if(!Z?.app_id)throw Error("App create API returned no app_id");return Z}async function sL($,D,Q,X=!1,J){if(!X)o0("Adding");if(!X)await R$();D.apikey=D.apikey||f0();let Y=await O1(),Z=o1($,Y?.config);i51(Z,D,X);let F=await U1(D.apikey,D.supaHost,D.supaAnon),G=await K$(F,D.apikey);if(!Q)Q=await pL(F,D.apikey,"org.create_app");let U=Q.gid;await DW(F,D.apikey,"org.create_app",{orgId:U},{message:`Insufficient permissions to create an app in organization ${U}`,silent:X});let{name:W,icon:q}=D;if(W=W||Y.config?.appName||"Unknown",q=q||"resources/icon.png",!q||!W){if(!X)C.error("Missing argument, you need to provide a appId and a name, or be in a capacitor project");throw Error("Missing app name or icon path")}if(!X)C.info(`Adding ${Z} to Capgo`);let K=null,H=null;if(LF0(q)){if(K=MF0(q),H=qX(q)||"image/png",!X)C.warn(`Found app icon ${q}`)}else if(LF0(FZ)){if(K=MF0(FZ),H=qX(FZ)||"image/png",!X)C.warn(`Found app icon ${FZ}`)}else if(!X)C.warn(`Cannot find app icon in any of the following locations: ${q}, ${FZ}`);let V=GZ(U,Z),O;if(K&&H){let{error:L}=await F.storage.from("images").upload(V,K,{contentType:H,upsert:!1});if(L&&!o51(L)){if(!X)C.warn(`Could not upload app icon (${F0(L)}). Continuing without an icon.`)}else O=V}let z=r51(J),N=z==="mcp"?"mcp":zF0()?"ai":"cli",B=!1;try{await DQ1(D.apikey,{ownerOrg:U,appId:Z,name:W,iconUrl:O,createdFromOnboarding:z==="onboarding",onboardingSource:N,supaHost:D.supaHost,supaAnon:D.supaAnon})}catch(L){let M;try{M=await $Q1({apikey:D.apikey,appId:Z,ownerOrg:U,createError:L,httpStatus:L.httpStatus,supaHost:D.supaHost,supaAnon:D.supaAnon})}catch(w){let R=F0(w);if(!X)C.error(`Could not add app ${R}`);throw Error(`Could not add app ${R}`)}if(M==="duplicate_owned")B=!0;else if(M==="duplicate_taken"){let w=`App ID ${Z} already exists`;if(!X)C.error(`Could not add app: ${w}`);throw Error(`Could not add app: ${w}`)}else{let w=F0(L);if(!X)C.error(`Could not add app ${w}`);throw Error(`Could not add app ${w}`)}}if(B)F1({channel:"app",event:"CLI Recovered App Already Exists",appId:Z,apikey:D.apikey,orgId:U,tags:{source:z}});else await s0(D.apikey,{channel:"app",event:"App Created",icon:"\uD83C\uDD95",org_id:U,tracking_version:2,tags:{"app-id":Z,source:z},notifyConsole:!0}).catch(()=>{});if(!X){if(B)C.success(`App ${Z} already exists in Capgo`);else C.success(`App ${Z} added to Capgo`);C.info("This app is accessible to all members of your organization based on their permissions"),C.info(`Next step: upload a bundle with "npx @capgo/cli bundle upload ${Z}"`),Q1("Done ✅")}return{appId:Z,organizationUid:U,userId:G,name:W,iconUrl:O,signedURL:O}}X1();y1();e0();async function NF0($,D,Q=!1,X=!1){if(!Q)o0("Deleting");D.apikey=D.apikey||f0();let J=await O1(),Y=o1($,J?.config);if(!D.apikey){if(!Q)C.error("Missing API key, you need to provide an API key to upload your bundle");throw Error("Missing API key")}if(!Y){if(!Q)C.error("Missing argument, you need to provide a appId, or be in a capacitor project");throw new U0("Missing appId")}let Z=await U1(D.apikey,D.supaHost,D.supaAnon),F=await K$(Z,D.apikey);await h$(Z,D.apikey,Y,"app.delete",Q);let{data:G,error:U}=await q1(`app/${encodeURIComponent(Y)}`,{apikey:D.apikey,method:"GET",body:void 0,supaHost:D.supaHost,supaAnon:D.supaAnon});if(U&&z8(U)!==404){if(!Q)C.warn(`Cannot get the app owner ${F0(U)}`)}let W=typeof G?.owner_org==="string"?G.owner_org:void 0;if(!W){let N=`Cannot verify organization ownership for app ${Y}`;if(!Q)C.error(N);throw Error(N)}let{data:q,error:K}=await q1(`organization?orgId=${encodeURIComponent(W)}`,{apikey:D.apikey,method:"GET",body:void 0,supaHost:D.supaHost,supaAnon:D.supaAnon}),H=typeof q?.created_by==="string"?q.created_by:void 0;if(K||!H){let N=`Cannot verify organization ownership for app ${Y}`;if(!Q)C.error(N);throw Error(N)}if(!X&&H!==F)if(!Q){C.warn("Deleting the app is not recommended for users that are not the organization owner"),C.warn("You are invited as a super_admin but your are not the owner"),C.warn("It's strongly recommended that you do not continue!");let N=await P$({message:"Do you want to continue?",options:[{label:"Yes",value:"yes"},{label:"No",value:"no"}]});if(r0(N)||N==="no")throw C.warn("Canceled deleting the app, exiting"),new U0("App deletion cancelled")}else throw Error("Cannot delete app: you are not the organization owner");let{error:V}=W?await Z.storage.from("images").remove([GZ(W,Y)]):{error:null};if(V&&!Q)C.error("Could not delete app logo");let{error:O}=await Z.storage.from(`apps/${Y}/${F}`).remove(["versions"]);if(O&&!Q)C.error("Could not delete app version");let{error:z}=await q1(`app/${encodeURIComponent(Y)}`,{apikey:D.apikey,method:"DELETE",body:void 0,supaHost:D.supaHost,supaAnon:D.supaAnon});if(z){if(!Q)C.error("Could not delete app");throw Error(`Could not delete app: ${F0(z)}`)}if(W)await s0(D.apikey,{channel:"app",event:"App Deleted",org_id:W,tracking_version:2,tags:{"app-id":Y}}).catch(()=>{});if(!Q)C.success("App deleted in Capgo"),Q1("Done ✅");return!0}m2();X1();Q8();$D();e0();import{spawnSync as QQ1}from"node:child_process";import{readFileSync as XQ1}from"node:fs";import{dirname as f_}from"node:path";import{cwd as JQ1,version as YQ1}from"node:process";import{platform as DM,version as ZQ1}from"node:os";var FQ1="Some dependencies are not up to date";async function eL($){let D={},Q=Object.keys($);return(await Promise.all(Q.map((J)=>rH(J)))).forEach((J,Y)=>{if(J)D[Q[Y]]=J}),D}async function y_($){let D=b_($),Q=await hL(D,$),X={"@capgo/cli":i$.version};for(let[J,Y]of Q)if(J.startsWith("@capgo/")||J.startsWith("@capawesome/")||J.startsWith("capacitor"))X[J]=Y;return X}function u_($){if(!$)return;let D=$.split(",").map((Q)=>Q.trim()).filter(Boolean);return D.length>0?D:void 0}function b_($){let D=u_($);if(!D)return $$(JQ1());return f_(D[0])}function GQ1($){let D=JSON.parse(XQ1($,"utf-8"));return new Set([...Object.keys(D.dependencies??{}),...Object.keys(D.devDependencies??{})])}function jF0($,D,Q=GQ1){let X=[],J=new Set;for(let Z of $){let F=Q(Z),G=D.filter((U)=>F.has(U.name));if(G.length===0)continue;X.push({packageJsonPath:Z,packages:G});for(let U of G)J.add(U.name)}let Y=D.filter((Z)=>!J.has(Z.name));if(Y.length>0&&$[0])X.push({packageJsonPath:$[0],packages:Y});return X}function wF0($,D=DM()){if(D==="win32")return`"${$.replace(/"/g,'""')}"`;return`'${$.replaceAll("'","'\\''")}'`}function UQ1($,D,Q=DM()){if(Q==="win32")return`cd /d ${wF0($,Q)} && ${D}`;return`(cd ${wF0($,Q)} && ${D})`}function AF0($,D,Q,X=DM()){let J=u_($);if(!J||J.length<=1){let Y=b_($);return BF0($M(Y),D)}return jF0(J,D,Q).map(({packageJsonPath:Y,packages:Z})=>{let F=f_(Y),G=$M(F);return UQ1(F,BF0(G,Z),X)}).join(`
508
+ ${h51(J)}`);else{let Y=new Map;if($.showOrg){let{data:Z,error:F}=await X.rpc("get_orgs_v7");if(F)throw Error(`Cannot get organizations: ${F0(F)}`);for(let G of Z??[])Y.set(G.gid,G.name??"Unknown")}C.info(`Active app in Capgo: ${J.length}`),d51(J,$,Y),Q1("Done ✅")}return J}F6();nH();import{env as l51}from"node:process";var n51=["CURSOR_AGENT","CURSOR_TRACE_ID","CLAUDECODE","CLAUDE_CODE","AIDER","GEMINI_CLI","CODEX_CLI","CAPGO_ONBOARDING_SOURCE"];function zF0($=l51){if($.CAPGO_ONBOARDING_SOURCE==="ai")return!0;return n51.some((D)=>D!=="CAPGO_ONBOARDING_SOURCE"&&Boolean($[D]))}y1();e0();var p51=/^[a-z0-9]+(\.[\w-]+)+$/i;function i51($,D,Q){if(!D.apikey){if(!Q)C.error("Missing API key, you need to provide an API key to upload your bundle");throw new U0("Missing API key")}if(!$){if(!Q)C.error("Missing argument, you need to provide a appId, or be in a capacitor project");throw new U0("Missing appId")}if($==="io.ionic.starter"){if(!Q)C.error(`This appId ${$} cannot be used it's reserved, please change it in your capacitor config.`);throw new U0("Reserved appId, please change it in capacitor config")}if($.includes("--")){if(!Q)C.error('The app id includes illegal symbols. You cannot use "--" in the app id');throw new U0("App id includes illegal symbols")}if(!p51.test($)){if(!Q)C.error(`Invalid app ID format: "${$}"`),C.info("App ID must be in reverse domain notation (e.g., com.example.app)"),C.info("Valid format: lowercase letters, numbers, dots, hyphens, and underscores"),C.info("Examples: com.mycompany.myapp, io.capgo.app, com.example.my-app");throw new U0("Invalid app ID format")}}function r51($){if($)return $;return lH()==="mcp"?"mcp":"cli-direct"}function o51($){if(!$||typeof $!=="object")return!1;let{status:D,statusCode:Q}=$;return D===409||Q==="409"}function t51($,D){if(D===409)return!0;let Q=F0($).toLowerCase();return Q.includes("app_id_already_exists")||Q.includes("app id already exists")}async function a51($,D,Q,X){let J=0;while(!0){let{data:Y,error:Z}=await q1(XW(J,Q),{apikey:$,method:"GET",body:void 0,supaHost:X?.supaHost,supaAnon:X?.supaAnon});if(Z){let G=z8(Z);if(G===400||G===401||G===403)return null;throw Z}let F=Array.isArray(Y)?Y:[];if(F.some((G)=>G.app_id===D))return!0;if(F.length<50)return!1;J+=1}}async function s51($,D,Q,X){let{data:J,error:Y}=await q1(`app/${encodeURIComponent(D)}`,{apikey:$,method:"GET",body:void 0,supaHost:X?.supaHost,supaAnon:X?.supaAnon});if(Y){let Z=z8(Y);if(Z===404)return!1;if(Z===401||Z===403)return null;throw Y}return J?.owner_org===Q}async function e51($,D={}){let X=await(D.isAppInTargetOrganization??s51)($.apikey,$.appId,$.ownerOrg,{supaHost:$.supaHost,supaAnon:$.supaAnon});if(X===!0)return!0;if(X===!1)return!1;let Y=await(D.isAppListedInOrganization??a51)($.apikey,$.appId,$.ownerOrg,{supaHost:$.supaHost,supaAnon:$.supaAnon});if(Y===!0)return!0;if(Y===!1)return!1;throw Error("Cannot verify app ownership for this API key. Grant app.read or org.read, then retry.")}async function $Q1($,D={}){if(!t51($.createError,$.httpStatus))return"not_duplicate";try{return await e51($,D)?"duplicate_owned":"duplicate_taken"}catch(Q){throw Error(F0(Q))}}async function DQ1($,D){let Q=await sU({supaHost:D.supaHost,supaAnon:D.supaAnon}),J=Q.includes("/functions/v1")&&D.supaAnon?`Bearer ${D.supaAnon}`:$,Y=await fetch(`${Q}/app`,{method:"POST",headers:c1({"Content-Type":"application/json",Authorization:J,capgkey:$}),body:JSON.stringify({owner_org:D.ownerOrg,app_id:D.appId,name:D.name,...D.iconUrl?{icon:D.iconUrl}:{},need_onboarding:!1,created_from_onboarding:D.createdFromOnboarding,onboarding:D.onboardingSource?{source:D.onboardingSource,outcome:"in_progress"}:void 0})}),Z=await Y.json().catch(()=>null);if(!Y.ok){let G=gL(Z)||`HTTP ${Y.status}`,U=Error(G);throw U.httpStatus=Y.status,U}if(!Z?.app_id)throw Error("App create API returned no app_id");return Z}async function sL($,D,Q,X=!1,J){if(!X)o0("Adding");if(!X)await R$();D.apikey=D.apikey||f0();let Y=await O1(),Z=o1($,Y?.config);i51(Z,D,X);let F=await U1(D.apikey,D.supaHost,D.supaAnon),G=await K$(F,D.apikey);if(!Q)Q=await pL(F,D.apikey,"org.create_app");let U=Q.gid;await DW(F,D.apikey,"org.create_app",{orgId:U},{message:`Insufficient permissions to create an app in organization ${U}`,silent:X});let{name:W,icon:q}=D;if(W=W||Y.config?.appName||"Unknown",q=q||"resources/icon.png",!q||!W){if(!X)C.error("Missing argument, you need to provide a appId and a name, or be in a capacitor project");throw Error("Missing app name or icon path")}if(!X)C.info(`Adding ${Z} to Capgo`);let K=null,H=null;if(LF0(q)){if(K=MF0(q),H=qX(q)||"image/png",!X)C.warn(`Found app icon ${q}`)}else if(LF0(FZ)){if(K=MF0(FZ),H=qX(FZ)||"image/png",!X)C.warn(`Found app icon ${FZ}`)}else if(!X)C.warn(`Cannot find app icon in any of the following locations: ${q}, ${FZ}`);let V=GZ(U,Z),O;if(K&&H){let{error:L}=await F.storage.from("images").upload(V,K,{contentType:H,upsert:!1});if(L&&!o51(L)){if(!X)C.warn(`Could not upload app icon (${F0(L)}). Continuing without an icon.`)}else O=V}let z=r51(J),N=z==="mcp"?"mcp":zF0()?"ai":"cli",B=!1;try{await DQ1(D.apikey,{ownerOrg:U,appId:Z,name:W,iconUrl:O,createdFromOnboarding:z==="onboarding",onboardingSource:N,supaHost:D.supaHost,supaAnon:D.supaAnon})}catch(L){let M;try{M=await $Q1({apikey:D.apikey,appId:Z,ownerOrg:U,createError:L,httpStatus:L.httpStatus,supaHost:D.supaHost,supaAnon:D.supaAnon})}catch(w){let R=F0(w);if(!X)C.error(`Could not add app ${R}`);throw new U0(`Could not add app ${R}`)}if(M==="duplicate_owned")B=!0;else if(M==="duplicate_taken"){let w=`App ID ${Z} already exists`;if(!X)C.error(`Could not add app: ${w}`);throw new U0(`Could not add app: ${w}`)}else{let w=F0(L);if(!X)C.error(`Could not add app ${w}`);throw new U0(`Could not add app ${w}`)}}if(B)F1({channel:"app",event:"CLI Recovered App Already Exists",appId:Z,apikey:D.apikey,orgId:U,tags:{source:z}});else await s0(D.apikey,{channel:"app",event:"App Created",icon:"\uD83C\uDD95",org_id:U,tracking_version:2,tags:{"app-id":Z,source:z},notifyConsole:!0}).catch(()=>{});if(!X){if(B)C.success(`App ${Z} already exists in Capgo`);else C.success(`App ${Z} added to Capgo`);C.info("This app is accessible to all members of your organization based on their permissions"),C.info(`Next step: upload a bundle with "npx @capgo/cli bundle upload ${Z}"`),Q1("Done ✅")}return{appId:Z,organizationUid:U,userId:G,name:W,iconUrl:O,signedURL:O}}X1();y1();e0();async function NF0($,D,Q=!1,X=!1){if(!Q)o0("Deleting");D.apikey=D.apikey||f0();let J=await O1(),Y=o1($,J?.config);if(!D.apikey){if(!Q)C.error("Missing API key, you need to provide an API key to upload your bundle");throw Error("Missing API key")}if(!Y){if(!Q)C.error("Missing argument, you need to provide a appId, or be in a capacitor project");throw new U0("Missing appId")}let Z=await U1(D.apikey,D.supaHost,D.supaAnon),F=await K$(Z,D.apikey);await h$(Z,D.apikey,Y,"app.delete",Q);let{data:G,error:U}=await q1(`app/${encodeURIComponent(Y)}`,{apikey:D.apikey,method:"GET",body:void 0,supaHost:D.supaHost,supaAnon:D.supaAnon});if(U&&z8(U)!==404){if(!Q)C.warn(`Cannot get the app owner ${F0(U)}`)}let W=typeof G?.owner_org==="string"?G.owner_org:void 0;if(!W){let N=`Cannot verify organization ownership for app ${Y}`;if(!Q)C.error(N);throw Error(N)}let{data:q,error:K}=await q1(`organization?orgId=${encodeURIComponent(W)}`,{apikey:D.apikey,method:"GET",body:void 0,supaHost:D.supaHost,supaAnon:D.supaAnon}),H=typeof q?.created_by==="string"?q.created_by:void 0;if(K||!H){let N=`Cannot verify organization ownership for app ${Y}`;if(!Q)C.error(N);throw Error(N)}if(!X&&H!==F)if(!Q){C.warn("Deleting the app is not recommended for users that are not the organization owner"),C.warn("You are invited as a super_admin but your are not the owner"),C.warn("It's strongly recommended that you do not continue!");let N=await P$({message:"Do you want to continue?",options:[{label:"Yes",value:"yes"},{label:"No",value:"no"}]});if(r0(N)||N==="no")throw C.warn("Canceled deleting the app, exiting"),new U0("App deletion cancelled")}else throw Error("Cannot delete app: you are not the organization owner");let{error:V}=W?await Z.storage.from("images").remove([GZ(W,Y)]):{error:null};if(V&&!Q)C.error("Could not delete app logo");let{error:O}=await Z.storage.from(`apps/${Y}/${F}`).remove(["versions"]);if(O&&!Q)C.error("Could not delete app version");let{error:z}=await q1(`app/${encodeURIComponent(Y)}`,{apikey:D.apikey,method:"DELETE",body:void 0,supaHost:D.supaHost,supaAnon:D.supaAnon});if(z){if(!Q)C.error("Could not delete app");throw Error(`Could not delete app: ${F0(z)}`)}if(W)await s0(D.apikey,{channel:"app",event:"App Deleted",org_id:W,tracking_version:2,tags:{"app-id":Y}}).catch(()=>{});if(!Q)C.success("App deleted in Capgo"),Q1("Done ✅");return!0}m2();X1();Q8();$D();e0();import{spawnSync as QQ1}from"node:child_process";import{readFileSync as XQ1}from"node:fs";import{dirname as f_}from"node:path";import{cwd as JQ1,version as YQ1}from"node:process";import{platform as DM,version as ZQ1}from"node:os";var FQ1="Some dependencies are not up to date";async function eL($){let D={},Q=Object.keys($);return(await Promise.all(Q.map((J)=>rH(J)))).forEach((J,Y)=>{if(J)D[Q[Y]]=J}),D}async function y_($){let D=b_($),Q=await hL(D,$),X={"@capgo/cli":i$.version};for(let[J,Y]of Q)if(J.startsWith("@capgo/")||J.startsWith("@capawesome/")||J.startsWith("capacitor"))X[J]=Y;return X}function u_($){if(!$)return;let D=$.split(",").map((Q)=>Q.trim()).filter(Boolean);return D.length>0?D:void 0}function b_($){let D=u_($);if(!D)return $$(JQ1());return f_(D[0])}function GQ1($){let D=JSON.parse(XQ1($,"utf-8"));return new Set([...Object.keys(D.dependencies??{}),...Object.keys(D.devDependencies??{})])}function jF0($,D,Q=GQ1){let X=[],J=new Set;for(let Z of $){let F=Q(Z),G=D.filter((U)=>F.has(U.name));if(G.length===0)continue;X.push({packageJsonPath:Z,packages:G});for(let U of G)J.add(U.name)}let Y=D.filter((Z)=>!J.has(Z.name));if(Y.length>0&&$[0])X.push({packageJsonPath:$[0],packages:Y});return X}function wF0($,D=DM()){if(D==="win32")return`"${$.replace(/"/g,'""')}"`;return`'${$.replaceAll("'","'\\''")}'`}function UQ1($,D,Q=DM()){if(Q==="win32")return`cd /d ${wF0($,Q)} && ${D}`;return`(cd ${wF0($,Q)} && ${D})`}function AF0($,D,Q,X=DM()){let J=u_($);if(!J||J.length<=1){let Y=b_($);return BF0($M(Y),D)}return jF0(J,D,Q).map(({packageJsonPath:Y,packages:Z})=>{let F=f_(Y),G=$M(F);return UQ1(F,BF0(G,Z),X)}).join(`
509
509
  `)}function WQ1($,D,Q){let X=u_($);if(!X||X.length<=1){let J=b_($);EF0($M(J),D,J);return}for(let{packageJsonPath:J,packages:Y}of jF0(X,D,Q)){let Z=f_(J);EF0($M(Z),Y,Z)}}function $M($){let D=QQ($,"npm"),Q=sX(D),X=KK($);return{pm:D,command:Q,installCommand:`${D} ${Q}`,runner:X}}function h_($,D){let Q=[];for(let X of Object.keys($)){let J=$[X],Y=D[X];if(J&&Y&&J!==Y)Q.push({name:X,installed:J,latest:Y})}return Q}function qQ1($){let D=[],Q=[];for(let X of $)if(X.name.startsWith("@capgo/"))D.push(X);else Q.push(X);return{capgo:D,other:Q}}function KQ1($,D,Q){if($==="skip")return[];if($==="all")return[...D,...Q];return D}function BF0($,D){let Q=D.map((X)=>`${X.name}@latest`).join(" ");return`${$.installCommand} ${Q}`.trim()}function RF0($){if(!$)return"";return typeof $==="string"?$:$.toString("utf8")}function EF0($,D,Q){if(D.length===0)return;let[X,...J]=$.installCommand.split(/\s+/).filter(Boolean);if(!X)throw Error("Cannot determine package manager install command");let Y=D.map((F)=>`${F.name}@latest`),Z=QQ1(X,[...J,...Y],{stdio:"pipe",cwd:Q});if(Z.error||Z.status!==0){let F=[RF0(Z.stdout),RF0(Z.stderr)].map((W)=>W.trim()).filter(Boolean).join(`
510
510
  `),G=F?`
511
511
  ${F}`:"",U=`Dependency update failed with code ${Z.status??"unknown"}${G}`;throw Z.error??Error(U)}}function HQ1($,D){let Q=h_($,D);return{is_outdated:Q.length>0,dependency_count:Object.keys($).length,outdated_count:Q.length}}function IF0($){C.warn("\x1B[31m\uD83D\uDEA8 Some dependencies are not up to date\x1B[0m");for(let D of $)C.warn(` ${D.name}: ${D.installed} → ${D.latest}`)}function VQ1($,D,Q){if(!Q&&D.length>0)C.info(`Run: