diff --git a/.github/actions/windows-ci-setup/action.yml b/.github/actions/windows-ci-setup/action.yml index 5374c07d9..397728732 100644 --- a/.github/actions/windows-ci-setup/action.yml +++ b/.github/actions/windows-ci-setup/action.yml @@ -1,7 +1,15 @@ name: Windows CI setup description: >- Prepare a Windows runner for the Windows test jobs: toolchain, shader - compiler, a cheaper release profile for the CI builds, and the Rust cache. + compiler, a cheaper release profile for the CI builds, cargo-nextest and the + Rust cache. + +inputs: + save-rust-cache: + description: >- + Whether this job saves the shared Windows Rust cache when it runs on main. + Give it to exactly one job. Pull requests never save. + default: 'false' runs: using: composite @@ -43,12 +51,26 @@ runs: $cargoHome = if ($env:CARGO_HOME) { $env:CARGO_HOME } else { Join-Path $env:USERPROFILE '.cargo' } Add-Content -LiteralPath (Join-Path $cargoHome 'config.toml') -Value $config Write-Host "opt-level 0 for $($members.Count) workspace crates: $($members -join ', ')" + - name: Install cargo-nextest + shell: pwsh + # Pinned release, verified against a checksum (as scripts/ci/install-nextest.sh on Linux). + run: | + $version = '0.9.146' + $sha256 = '0fa689815c8157e4633225b6b173184b3d546eb6ffb754c3d0e6ea5973284a20' + $zip = Join-Path $env:RUNNER_TEMP 'nextest.zip' + Invoke-WebRequest -Uri "https://github.com/nextest-rs/nextest/releases/download/cargo-nextest-$version/cargo-nextest-$version-x86_64-pc-windows-msvc.zip" -OutFile $zip -MaximumRetryCount 5 -RetryIntervalSec 5 + if ((Get-FileHash -Algorithm SHA256 $zip).Hash -ne $sha256) { throw 'cargo-nextest checksum mismatch' } + $bin = Join-Path $env:RUNNER_TEMP 'nextest-bin' + Expand-Archive -LiteralPath $zip -DestinationPath $bin -Force + $bin >> $env:GITHUB_PATH + # One cache for every Windows job (they build the same dependency graph with + # the same profile); the job given save-rust-cache writes it, on main only. - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 with: - # Only main writes the cache; PRs restore it. - save-if: ${{ github.ref == 'refs/heads/main' }} + shared-key: windows + add-job-id-key: false + save-if: ${{ inputs.save-rust-cache == 'true' && github.ref == 'refs/heads/main' }} cache-on-failure: true # Workspace crates are rebuilt on every change anyway and are cheap at - # opt-level 0, so keep them out of the cache. Each job gets its own - # cache (rust-cache keys on the job id by default). + # opt-level 0, so keep them out of the cache. cache-workspace-crates: false diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index be300810e..83993b402 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -11,41 +11,34 @@ name: Android # ANDROID_KEYSTORE_BASE64 base64 of the release keystore (.jks) # ANDROID_KEYSTORE_PASSWORD ANDROID_KEY_ALIAS ANDROID_KEY_PASSWORD # Without them the APK is signed with a throwaway debug key and not published. +# ci.yml passes them only on pushes to main (which publish): pull requests and +# the merge queue build with the debug key. +# Called by ci.yml, which decides when Android runs (the app, its Rust core or +# the shared fonts and icons changed) and holds the runners for it. on: - pull_request: - paths: - - 'apps/android/**' - - 'crates/**' - - 'scripts/android/**' - # The app measures and draws the iOS app's fonts and icons. - - 'apps/ios/Zeron/Fonts/**' - - 'apps/ios/Zeron/Assets.xcassets/**' - - 'Cargo.toml' - - 'Cargo.lock' - - 'rust-toolchain.toml' - - '.github/workflows/android.yml' - push: - branches: [main] - paths: - - 'apps/android/**' - - 'crates/**' - - 'scripts/android/**' - - 'apps/ios/Zeron/Fonts/**' - - 'apps/ios/Zeron/Assets.xcassets/**' - - 'Cargo.toml' - - 'Cargo.lock' - - 'rust-toolchain.toml' - - '.github/workflows/android.yml' + workflow_call: + inputs: + pass-key: + description: Cache key prefix under which each job records its pass (ci.yml); empty records nothing. + type: string + default: '' + secrets: + ANDROID_KEYSTORE_BASE64: + required: false + ANDROID_KEYSTORE_PASSWORD: + required: false + ANDROID_KEY_ALIAS: + required: false + ANDROID_KEY_PASSWORD: + required: false + CLOUDFLARE_API_TOKEN: + required: false workflow_dispatch: permissions: contents: read -concurrency: - group: android-${{ github.ref }} - cancel-in-progress: ${{ github.event_name == 'pull_request' }} - env: NDK_VERSION: 29.0.14206865 # Phones: arm64 only (an x86_64 core would double the download for emulators). @@ -80,6 +73,8 @@ jobs: - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 with: key: android + # Only main writes the cache: pull request caches would evict main's. + save-if: ${{ github.ref == 'refs/heads/main' }} - name: build tools (cargo-ndk, rsvg-convert) run: | cargo install cargo-ndk --locked @@ -92,8 +87,11 @@ jobs: echo "version=$version" >> "$GITHUB_OUTPUT" echo "VERSION=$version" >> "$GITHUB_ENV" # Only grows: Android installs a build over another only when it's higher. - echo "BUILD_NUMBER=$((1000 + GITHUB_RUN_NUMBER))" >> "$GITHUB_ENV" - echo "build=$((1000 + GITHUB_RUN_NUMBER))" >> "$GITHUB_OUTPUT" + # The run number is the calling workflow's (ci.yml), which started over at 1 + # when Android moved into it; the standalone workflow had reached ~200, so + # 2000 keeps published build numbers above every build already installed. + echo "BUILD_NUMBER=$((2000 + GITHUB_RUN_NUMBER))" >> "$GITHUB_ENV" + echo "build=$((2000 + GITHUB_RUN_NUMBER))" >> "$GITHUB_OUTPUT" - id: signing name: release key @@ -139,6 +137,12 @@ jobs: path: out/android/* if-no-files-found: error retention-days: 14 + - name: Record the pass (CI skips this job while its inputs stay the same) + if: inputs.pass-key != '' + uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + with: + path: rust-toolchain.toml + key: ${{ inputs.pass-key }}-apk publish: if: github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.apk.outputs.signed == 'true' diff --git a/.github/workflows/ci-emergency.yml b/.github/workflows/ci-emergency.yml new file mode 100644 index 000000000..33f43cd34 --- /dev/null +++ b/.github/workflows/ci-emergency.yml @@ -0,0 +1,41 @@ +name: CI emergency + +# Gives one pull request every CI runner now (scripts/ci/emergency.py): adds +# `ci:lock` to it, cancels the other pull requests' CI runs, and re-runs its own +# if needed. Dispatching needs write access. Release the runners by removing the +# label, or by merging or closing the pull request. +on: + workflow_dispatch: + inputs: + pr: + description: Pull request number + required: true + type: number + cancel-main: + description: Also cancel main and merge queue CI runs + type: boolean + default: false + +permissions: + contents: read + actions: write # cancel and re-run CI runs + issues: write # the ci:lock label + pull-requests: write + +concurrency: + group: ci-emergency + cancel-in-progress: false + +jobs: + emergency: + runs-on: ubuntu-24.04 + timeout-minutes: 5 + steps: + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + with: + sparse-checkout: scripts/ci + - env: + GITHUB_TOKEN: ${{ github.token }} + PR: ${{ inputs.pr }} + CANCEL_MAIN: ${{ inputs.cancel-main }} + run: python3 -I scripts/ci/emergency.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..0183c74ec --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,239 @@ +name: CI + +# The one entry point for pull request, main and merge queue checks. +# +# plan which suites this change needs, and the runners they will use +# (scripts/ci/plan.py). A suite, or a single Windows or voice job, +# that already passed on the same inputs is skipped +# (scripts/ci/reuse.py; every job records its pass as its last +# step). Pull requests get the fast tier: Windows, +# macOS, voice and Android only when the change looks platform +# specific, and the Windows packaging, iOS simulator and macOS +# fixtures only for their own files; the `ci:full` label (then +# re-run) or the CI_PR_TIER=full repository variable runs everything. +# Main, the merge queue and manual runs get the full tier; the +# nightly schedule runs everything, slow tests included. Voice and +# the Linux browser fixture run only nightly, manually or with +# `ci:full`. Fork pull requests reuse only main's passes. +# admit waits until every runner the run needs is free, so that once a +# run starts, none of its jobs queues behind another run's +# (scripts/ci/admit.py). Its name carries the reservation; other runs +# read it from there. +# suites the reusable workflows, all started together once admitted. +# result "CI result": one check to require in the ruleset and merge queue. +# +# Repository variables (all optional): +# CI_PR_TIER fast (default) or full, for pull requests +# CI_BUDGET_TOTAL hosted runners all CI runs may hold at once (20, the org limit) +# CI_BUDGET_MACOS ... macOS runners (5, the org limit) +# CI_BUDGET_WINDOWS ... Windows runners (10) +# CI_ADMISSION off: start at once, as before +# CI_DEBOUNCE_SECONDS wait for further pushes to a pull request first (60) +# CI_LOCK_HOURS how long a ci:lock label holds runners (6) +# CI_FORK_REUSE own: fork pull requests also reuse their own earlier passes +# (safe once the merge queue, which reuses nothing, is required) +# +# Labels (adding one needs the triage role): ci:full (every suite, nothing +# reused), ci:priority (front of the admission queue), ci:lock (a full run's +# runners kept for the pull request until merged, closed, unlabelled or +# CI_LOCK_HOURS). ci-emergency.yml locks a pull request and cancels the rest. + +on: + pull_request: + push: + branches: [main] + merge_group: + workflow_dispatch: + # Nightly: every suite and job in full (slow tests and fixtures included), nothing reused. + schedule: + - cron: '23 6 * * *' + +permissions: + contents: read + +concurrency: + # A new push to a pull request cancels its previous run, admitted or still + # waiting, which releases everything that run held. + group: ci-${{ github.event.pull_request.number && format('pr-{0}', github.event.pull_request.number) || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + plan: + runs-on: ubuntu-24.04 + timeout-minutes: 5 + permissions: + contents: read + pull-requests: read + actions: read # earlier passes (Actions cache entries) + outputs: + suites: ${{ steps.plan.outputs.suites }} + reservation: ${{ steps.plan.outputs.reservation }} + tier: ${{ steps.plan.outputs.tier }} + keys: ${{ steps.plan.outputs.keys }} + skip: ${{ steps.plan.outputs.skip }} + flags: ${{ steps.plan.outputs.flags }} + pr: ${{ steps.plan.outputs.pr }} + steps: + # The Rust sources too: the fingerprints scan them for files they read from + # outside their packages. (~30 MB; root files such as Cargo.lock come with cone mode.) + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + with: + sparse-checkout: | + scripts/ci + scripts/tests + .github + crates + apps/zeron + - name: Planner and admission tests + run: python3 -m unittest discover -s scripts/tests -p 'test_ci_*.py' + - id: plan + env: + GITHUB_TOKEN: ${{ github.token }} + CI_PR_TIER: ${{ vars.CI_PR_TIER }} + CI_FORK_REUSE: ${{ vars.CI_FORK_REUSE }} + run: python3 -I scripts/ci/plan.py + + admit: + name: "admit [${{ needs.plan.outputs.reservation }}]${{ needs.plan.outputs.pr != '' && format(' #{0}', needs.plan.outputs.pr) || '' }}" + needs: plan + runs-on: ubuntu-24.04 + # GitHub stops a hosted job at 6 hours; admit.py lets the run start after MAX_WAIT_MINUTES. + timeout-minutes: 330 + permissions: + contents: read + actions: read + pull-requests: read # ci:priority / ci:lock labels and pull request heads + issues: read # when ci:lock was added + steps: + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + with: + sparse-checkout: scripts/ci + - env: + GITHUB_TOKEN: ${{ github.token }} + CI_RESERVATION: ${{ needs.plan.outputs.reservation }} + CI_BUDGET_TOTAL: ${{ vars.CI_BUDGET_TOTAL }} + CI_BUDGET_MACOS: ${{ vars.CI_BUDGET_MACOS }} + CI_BUDGET_WINDOWS: ${{ vars.CI_BUDGET_WINDOWS }} + CI_ADMISSION: ${{ vars.CI_ADMISSION }} + CI_DEBOUNCE_SECONDS: ${{ vars.CI_DEBOUNCE_SECONDS }} + CI_LOCK_HOURS: ${{ vars.CI_LOCK_HOURS }} + MAX_WAIT_MINUTES: 120 + run: python3 -I scripts/ci/admit.py + + linux-core: + needs: [plan, admit] + if: fromJSON(needs.plan.outputs.suites).core + uses: ./.github/workflows/ui-tests.yml + with: + core: true + ui: false + pass-key: ${{ fromJSON(needs.plan.outputs.keys).core || '' }} + + linux-ui: + needs: [plan, admit] + if: fromJSON(needs.plan.outputs.suites).ui + uses: ./.github/workflows/ui-tests.yml + with: + core: false + ui: true + browser: ${{ contains(fromJSON(needs.plan.outputs.flags).ui || fromJSON('[]'), 'browser') }} + pass-key: ${{ fromJSON(needs.plan.outputs.keys).ui || '' }} + + cursor: + needs: [plan, admit] + if: fromJSON(needs.plan.outputs.suites).cursor + uses: ./.github/workflows/cursor-compatibility.yml + with: + rust-tests: false + pass-key: ${{ fromJSON(needs.plan.outputs.keys).cursor || '' }} + + edge: + needs: [plan, admit] + if: fromJSON(needs.plan.outputs.suites).edge + uses: ./.github/workflows/preview-tests.yml + with: + pass-key: ${{ fromJSON(needs.plan.outputs.keys).edge || '' }} + + installer: + needs: [plan, admit] + if: fromJSON(needs.plan.outputs.suites).installer + uses: ./.github/workflows/linux-installer.yml + with: + pass-key: ${{ fromJSON(needs.plan.outputs.keys).installer || '' }} + + voice: + needs: [plan, admit] + if: fromJSON(needs.plan.outputs.suites).voice + uses: ./.github/workflows/voice-tests.yml + with: + pass-key: ${{ fromJSON(needs.plan.outputs.keys).voice || '' }} + skip: ${{ toJSON(fromJSON(needs.plan.outputs.skip).voice || fromJSON('[]')) }} + + windows: + needs: [plan, admit] + if: fromJSON(needs.plan.outputs.suites).windows + uses: ./.github/workflows/windows.yml + with: + pass-key: ${{ fromJSON(needs.plan.outputs.keys).windows || '' }} + skip: ${{ toJSON(fromJSON(needs.plan.outputs.skip).windows || fromJSON('[]')) }} + + macos: + needs: [plan, admit] + if: fromJSON(needs.plan.outputs.suites).macos + uses: ./.github/workflows/macos.yml + with: + native: true + frame-source: false + ios: false + fixtures: ${{ contains(fromJSON(needs.plan.outputs.flags).macos || fromJSON('[]'), 'fixtures') }} + pass-key: ${{ fromJSON(needs.plan.outputs.keys).macos || '' }} + + frame-source: + needs: [plan, admit] + if: fromJSON(needs.plan.outputs.suites).frame_source + uses: ./.github/workflows/macos.yml + with: + native: false + frame-source: true + ios: false + pass-key: ${{ fromJSON(needs.plan.outputs.keys).frame_source || '' }} + + ios: + needs: [plan, admit] + if: fromJSON(needs.plan.outputs.suites).ios + uses: ./.github/workflows/macos.yml + with: + native: false + frame-source: false + ios: true + skip: ${{ toJSON(fromJSON(needs.plan.outputs.skip).ios || fromJSON('[]')) }} + pass-key: ${{ fromJSON(needs.plan.outputs.keys).ios || '' }} + + android: + needs: [plan, admit] + if: fromJSON(needs.plan.outputs.suites).android + uses: ./.github/workflows/android.yml + # Only what android.yml uses, and only on pushes to main, which publish: pull + # requests and the merge queue (code not on main yet) sign with a debug key. + secrets: + ANDROID_KEYSTORE_BASE64: ${{ github.event_name == 'push' && secrets.ANDROID_KEYSTORE_BASE64 || '' }} + ANDROID_KEYSTORE_PASSWORD: ${{ github.event_name == 'push' && secrets.ANDROID_KEYSTORE_PASSWORD || '' }} + ANDROID_KEY_ALIAS: ${{ github.event_name == 'push' && secrets.ANDROID_KEY_ALIAS || '' }} + ANDROID_KEY_PASSWORD: ${{ github.event_name == 'push' && secrets.ANDROID_KEY_PASSWORD || '' }} + CLOUDFLARE_API_TOKEN: ${{ github.event_name == 'push' && secrets.CLOUDFLARE_API_TOKEN || '' }} + with: + pass-key: ${{ fromJSON(needs.plan.outputs.keys).android || '' }} + + result: + name: CI result + needs: [plan, admit, linux-core, linux-ui, cursor, edge, installer, voice, windows, macos, frame-source, ios, android] + if: always() + runs-on: ubuntu-24.04 + timeout-minutes: 5 + steps: + - env: + FAILED: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} + RESULTS: ${{ toJSON(needs) }} + run: | + echo "$RESULTS" | python3 -c 'import json,sys; [print(k.ljust(13), v["result"]) for k, v in json.load(sys.stdin).items()]' + test "$FAILED" = false diff --git a/.github/workflows/cursor-compatibility.yml b/.github/workflows/cursor-compatibility.yml index 7120e031c..073e6bcfd 100644 --- a/.github/workflows/cursor-compatibility.yml +++ b/.github/workflows/cursor-compatibility.yml @@ -1,26 +1,22 @@ name: Cursor compatibility +# Pull requests and main: called by ci.yml (with rust-tests off: core-tests +# already runs them there). Also called by release.yml and dispatched by +# cursor-sdk-update.yml on its update branch. on: - pull_request: - paths: - - 'crates/harness/**' - - 'crates/doc/**' - - 'crates/engine/**' - - 'Cargo.toml' - - 'Cargo.lock' - - 'scripts/*cursor-sdk*' - - '.github/workflows/cursor-*.yml' - push: - branches: [main] - paths: - - 'crates/harness/**' - - 'crates/doc/**' - - 'crates/engine/**' - - 'Cargo.toml' - - 'Cargo.lock' - - 'scripts/*cursor-sdk*' - - '.github/workflows/cursor-*.yml' workflow_dispatch: + inputs: + rust-tests: + type: boolean + default: true workflow_call: + inputs: + pass-key: + description: Cache key prefix under which each job records its pass (ci.yml); empty records nothing. + type: string + default: '' + rust-tests: + type: boolean + default: true permissions: contents: read jobs: @@ -40,15 +36,20 @@ jobs: npm install --prefix "$RUNNER_TEMP/cursor-sdk-contract" --ignore-scripts --no-audit --no-fund "$pin" - name: Actual SDK token expiry, stream invalidation, and transient auth recovery run: node scripts/test-cursor-sdk-auth.mjs "$RUNNER_TEMP/cursor-sdk-contract/node_modules/@cursor/sdk" + - name: Record the pass (CI skips this job while its inputs stay the same) + if: inputs.pass-key != '' + uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + with: + path: rust-toolchain.toml + key: ${{ inputs.pass-key }}-cursor-compatibility # The Rust half (harness compatibility, steering, session recovery, durable # commands, message delivery, native Pi RPC) is part of the `core-tests` job - # of ui-tests.yml, which already runs on pull requests and on main with a - # superset of this workflow's paths. Run it here only for the callers that - # do not get that: release.yml (tag push), cursor-sdk-update.yml (manual - # dispatch on the update branch) and manual runs. + # of ui-tests.yml, which ci.yml runs on pull requests and main. Run it here + # for the other callers: release.yml (tag push), cursor-sdk-update.yml + # (dispatch on the update branch) and manual runs. rust-tests: - if: ${{ github.event_name != 'pull_request' && !(github.event_name == 'push' && github.ref == 'refs/heads/main') }} + if: inputs.rust-tests runs-on: ubuntu-24.04 timeout-minutes: 30 steps: diff --git a/.github/workflows/linux-installer.yml b/.github/workflows/linux-installer.yml index 54a987c63..925b78045 100644 --- a/.github/workflows/linux-installer.yml +++ b/.github/workflows/linux-installer.yml @@ -1,34 +1,17 @@ name: Linux installer +# Called by ci.yml when the installers or the desktop entry change. on: - pull_request: - paths: - - 'edge/src/install.sh' - - 'scripts/package-linux.sh' - - 'scripts/test-linux-desktop-entry.sh' - - 'scripts/ci/apt-install.sh' - - 'dist/zeron.desktop' - - 'dist/zeron.png' - - '.github/workflows/linux-installer.yml' - push: - branches: [main] - paths: - - 'edge/src/install.sh' - - 'scripts/package-linux.sh' - - 'scripts/test-linux-desktop-entry.sh' - - 'scripts/ci/apt-install.sh' - - 'dist/zeron.desktop' - - 'dist/zeron.png' - - '.github/workflows/linux-installer.yml' - workflow_dispatch: + workflow_call: + inputs: + pass-key: + description: Cache key prefix under which each job records its pass (ci.yml); empty records nothing. + type: string + default: '' permissions: contents: read -concurrency: - group: linux-installer-${{ github.ref }} - cancel-in-progress: ${{ github.event_name == 'pull_request' }} - jobs: desktop-entry: runs-on: ubuntu-24.04 @@ -42,3 +25,9 @@ jobs: # Both installers, offline, under a throwaway HOME (no network, no systemd). - name: Installers write a valid launcher entry run: scripts/test-linux-desktop-entry.sh + - name: Record the pass (CI skips this job while its inputs stay the same) + if: inputs.pass-key != '' + uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + with: + path: rust-toolchain.toml + key: ${{ inputs.pass-key }}-desktop-entry diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 64ed306a1..bf1bcab1c 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1,43 +1,38 @@ name: macOS tests +# Called by ci.yml, which decides which of these run (scripts/ci/plan.py) and +# holds the runners for them (scripts/ci/admit.py). on: - pull_request: - paths: - - 'Cargo.toml' - - 'Cargo.lock' - - 'rust-toolchain.toml' - - 'crates/**' - - 'edge/**' - - 'scripts/run-macos-browser-fixture.sh' - - 'scripts/test-browser-storage.py' - - 'scripts/ci/run-macos-fixture.sh' - - 'dist/macos/Info.plist' - - 'apps/ios/**' - - '.github/workflows/macos.yml' - push: - branches: [main] - paths: - - 'Cargo.toml' - - 'Cargo.lock' - - 'rust-toolchain.toml' - - 'crates/**' - - 'edge/**' - - 'scripts/run-macos-browser-fixture.sh' - - 'scripts/test-browser-storage.py' - - 'scripts/ci/run-macos-fixture.sh' - - 'dist/macos/Info.plist' - - 'apps/ios/**' - - '.github/workflows/macos.yml' - workflow_dispatch: + workflow_call: + inputs: + pass-key: + description: Cache key prefix under which each job records its pass (ci.yml); empty records nothing. + type: string + default: '' + native: + type: boolean + default: true + frame-source: + type: boolean + default: true + ios: + type: boolean + default: true + fixtures: + description: Also run the WebKit browser and preview fixtures (pull requests that touch them; always otherwise). + type: boolean + default: true + skip: + description: JSON list of jobs not to run (ci.yml; `ios-tests` when a pull request leaves the app alone). + type: string + default: '[]' permissions: contents: read -concurrency: - group: macos-${{ github.ref }} - cancel-in-progress: ${{ github.event_name == 'pull_request' }} - env: + # Pull requests and main leave out slow and soak tests (scripts/ci/nextest.toml `ci` profile). + NEXTEST_PROFILE: ${{ github.event_name == 'schedule' && 'default' || 'ci' }} # Tests run on the dev profile (workspace crates at opt-level 0, dependencies at 2 as configured in # Cargo.toml) instead of --release: a cold build is several times cheaper. No debug info is needed. CARGO_PROFILE_DEV_DEBUG: 0 @@ -46,42 +41,10 @@ env: # rustc 1.98.0 and another 1.98.1) and rust-cache keys include the rustc version, so a job that lands # on an older image would otherwise miss the cache that `main` seeded. jobs: - changes: - runs-on: ubuntu-24.04 - permissions: - pull-requests: read - outputs: - ios: ${{ steps.filter.outputs.result }} - steps: - - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - id: filter - with: - script: | - // Preserve iOS coverage for main pushes and manual runs. - if (context.eventName !== 'pull_request') return true; - const files = await github.paginate(github.rest.pulls.listFiles, { - ...context.repo, - pull_number: context.payload.pull_request.number, - per_page: 100, - }); - // Run conservatively if the API did not return the full diff. - if (files.length < context.payload.pull_request.changed_files) return true; - // The app links the Rust mobile core and everything it depends on. - const mobileCore = ['crates/mobile/', 'crates/client/', 'crates/text/', 'crates/markdown/', - 'crates/doc/', 'crates/sync/', 'crates/proto/', 'crates/rpc/', 'crates/syntax/', - 'scripts/ios/']; - const affectsIOS = path => path?.startsWith('apps/ios/') - || mobileCore.some(prefix => path?.startsWith(prefix)) - || path === 'Cargo.lock' - || path === 'Cargo.toml' - || path === 'rust-toolchain.toml' - || path === '.github/workflows/macos.yml'; - return files.some(file => affectsIOS(file.filename) - || affectsIOS(file.previous_filename)); - # Updater and preview tests, native UI regressions and the two native WebKit fixtures. Everything is # compiled once (one cargo invocation, so dependencies are built once) and then run. macos-native: + if: inputs.native runs-on: macos-latest # A cold cache (first run, eviction, toolchain bump) takes about 32 minutes; warm is about 10. timeout-minutes: 45 @@ -110,28 +73,30 @@ jobs: mkdir -p "$bin" tar -xzf "$RUNNER_TEMP/nextest.tar.gz" -C "$bin" cargo-nextest echo "$bin" >> "$GITHUB_PATH" - - name: Build tests and fixtures + # The app (`-p zeron --bins`) is compiled with the tests, sharing their zeron-ui + # build: a separate `cargo build -p zeron` rebuilt zeron-ui without the fixture + # feature (and a `cargo check` before that recompiled every dependency). + - name: Build tests and the application + run: | + cargo nextest run --config-file scripts/ci/nextest.toml --no-run --locked \ + -p zeron-update -p zeron-preview -p zeron-ui -p zeron-text -p zeron \ + --features zeron-ui/browser-fixture --lib --bins --tests + - name: Build fixtures + if: inputs.fixtures run: | - cargo nextest run --no-run --locked \ - -p zeron-update -p zeron-preview -p zeron-ui -p zeron-text \ - --features zeron-ui/browser-fixture --lib --tests cargo build --locked -p zeron-update -p zeron-preview -p zeron-ui \ --features zeron-ui/browser-fixture --example browser-fixture --example preview-fixture - - name: Check macOS application - env: - # Match the old `cargo check --release`: no debug assertions. - CARGO_PROFILE_DEV_DEBUG_ASSERTIONS: false - run: cargo check --locked -p zeron - name: Updater, preview, CoreText and native UI regressions run: | # zeron-text's coretext tests are macOS-only (#![cfg(target_os = "macos")]); its other # tests run on Linux in ios-core. The attachment filters cover file staging, chips and # external Finder drops, whose paths and file metadata are platform-specific. - cargo nextest run --no-fail-fast --locked \ - -p zeron-update -p zeron-preview -p zeron-ui -p zeron-text \ - --features zeron-ui/browser-fixture --lib --tests \ + cargo nextest run --config-file scripts/ci/nextest.toml --no-fail-fast --locked \ + -p zeron-update -p zeron-preview -p zeron-ui -p zeron-text -p zeron \ + --features zeron-ui/browser-fixture --lib --bins --tests \ -E 'package(zeron-update) | package(zeron-preview) | binary_id(zeron-text::coretext) | (binary_id(zeron-ui) & (test(native_diff_font_geometry) | test(/notify::tests::/) | test(/^attachments::tests::/) | test(/composer::attachment_chip_tests::/) | test(/shell::chat_dropzone_tests::/) | test(=queue::tests::queue_rows_label_attachment_chips_and_file_only_sends) | test(=transcript::tests::user_bubbles_project_attachment_chips_in_place_of_the_strip) | test(=transcript::tests::sent_chips_show_upload_progress_until_their_bytes_land)))' - name: Native browser regression and screenshots + if: inputs.fixtures timeout-minutes: 7 env: RUST_BACKTRACE: 1 @@ -140,21 +105,25 @@ jobs: scripts/ci/run-macos-fixture.sh target/debug/examples/browser-fixture "$RUNNER_TEMP/browser-captures" test -f "$RUNNER_TEMP/browser-captures/result.txt" - name: Persistent browser profiles across app launches + if: inputs.fixtures timeout-minutes: 5 run: python3 scripts/test-browser-storage.py --fixture target/debug/examples/browser-fixture - name: Upload browser screenshots - if: always() + if: ${{ inputs.fixtures && always() }} uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: browser-macos-captures path: ${{ runner.temp }}/browser-captures* if-no-files-found: ignore - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + if: inputs.fixtures with: node-version: 24 - name: Install preview fixture server + if: inputs.fixtures run: npm ci --prefix edge - name: Project discovery, stable URLs and HMR in native WebKit + if: inputs.fixtures timeout-minutes: 5 env: ZERON_PREVIEW_AUTO_OPEN: 1 @@ -162,15 +131,22 @@ jobs: VITE_BINARY="$GITHUB_WORKSPACE/edge/node_modules/vite/bin/vite.js" scripts/ci/run-macos-fixture.sh target/debug/examples/preview-fixture "$RUNNER_TEMP/preview-captures" test -f "$RUNNER_TEMP/preview-captures/result.txt" - name: Upload preview screenshots - if: always() + if: ${{ inputs.fixtures && always() }} uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: preview-macos-captures path: ${{ runner.temp }}/preview-captures* if-no-files-found: ignore + - name: Record the pass (CI skips this job while its inputs stay the same) + if: inputs.pass-key != '' + uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + with: + path: rust-toolchain.toml + key: ${{ inputs.pass-key }}-macos-native # gpui_macos lives in the pinned GPUI checkout, a separate workspace with its own cache. macos-frame-source: + if: inputs.frame-source runs-on: macos-latest timeout-minutes: 30 steps: @@ -195,13 +171,18 @@ jobs: - name: Native frame-source recovery regression working-directory: frame-source-tests run: cargo test --locked -p gpui_macos --test frame_source_recovery + - name: Record the pass (CI skips this job while its inputs stay the same) + if: inputs.pass-key != '' + uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + with: + path: rust-toolchain.toml + key: ${{ inputs.pass-key }}-macos-frame-source # The iOS checks that do not need Apple tooling run on Linux: Rust mobile core tests, and "the # committed Swift bindings are current" (the UniFFI metadata is identical for any target, so the # bindings are generated from the host build of the library). ios-core: - needs: changes - if: needs.changes.outputs.ios == 'true' + if: inputs.ios runs-on: ubuntu-24.04 timeout-minutes: 30 steps: @@ -214,30 +195,36 @@ jobs: cache-on-failure: true - name: Rust mobile core tests run: cargo test --locked -p zeron-text -p zeron-markdown -p zeron-client -p zeron-mobile - - name: Generated Swift bindings are current + # Only for the simulator tests, which link these bindings (they run when the app, + # the FFI crate or the client changes, see scripts/ci/plan.py). + # The committed bindings: the Swift file the app compiles, and the C header and + # module map the simulator job links (apps/ios/CoreFFI). scripts/ios/build-core.sh + # refreshes all three. Only crates/mobile defines the FFI, so this runs with the + # simulator tests (see scripts/ci/plan.py). + - name: Generated bindings are current + if: ${{ !contains(fromJSON(inputs.skip), 'ios-tests') }} run: | cargo build --locked -p zeron-mobile --lib cargo build --locked -p zeron-mobile --bin uniffi-bindgen --features bindgen target/debug/uniffi-bindgen generate --library target/debug/libzeron_mobile.so \ --language swift --out-dir "$RUNNER_TEMP/gen" >/dev/null diff -u apps/ios/Zeron/Core/Generated/zeron_core.swift "$RUNNER_TEMP/gen/zeron_core.swift" - # The simulator job links these headers instead of regenerating them. - mkdir -p "$RUNNER_TEMP/ios-include" - cp "$RUNNER_TEMP/gen/zeron_coreFFI.h" "$RUNNER_TEMP/ios-include/zeron_coreFFI.h" - cp "$RUNNER_TEMP/gen/zeron_coreFFI.modulemap" "$RUNNER_TEMP/ios-include/module.modulemap" - - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + diff -u apps/ios/CoreFFI/zeron_coreFFI.h "$RUNNER_TEMP/gen/zeron_coreFFI.h" + diff -u apps/ios/CoreFFI/module.modulemap "$RUNNER_TEMP/gen/zeron_coreFFI.modulemap" + - name: Record the pass (CI skips this job while its inputs stay the same) + if: inputs.pass-key != '' + uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 with: - name: ios-ffi-include - path: ${{ runner.temp }}/ios-include - retention-days: 1 + path: rust-toolchain.toml + key: ${{ inputs.pass-key }}-ios-core - # iOS unit tests in the simulator (only when iOS or the mobile core changed, see `changes`). - # Waiting for macos-frame-source keeps a run to two macOS runners at a time. + # iOS unit tests in the simulator (pull requests: when the app, the FFI crate or the + # client changes). Independent of ios-core: the bindings it links are committed + # (apps/ios/CoreFFI), and ios-core checks they are current. # Do not boot the simulator in the background: hundreds of launchd_sim daemons starve the 3-vCPU # VM and slow every other step down by minutes. xcodebuild boots it when needed. ios-tests: - needs: [changes, ios-core, macos-frame-source] - if: needs.changes.outputs.ios == 'true' + if: ${{ inputs.ios && !contains(fromJSON(inputs.skip), 'ios-tests') }} runs-on: macos-latest timeout-minutes: 30 steps: @@ -268,16 +255,15 @@ jobs: with: save-if: ${{ github.ref == 'refs/heads/main' }} cache-on-failure: true + # The dev profile (workspace crates unoptimized, dependencies at opt-level 2): the + # unit tests don't need the optimized core the app ships, and it builds in about half the time. - name: Build the Rust core for the simulator run: | - # Same build as scripts/ios/build-core.sh iphonesimulator; the bindings came from ios-core. - IPHONEOS_DEPLOYMENT_TARGET=26.0 cargo build --locked -p zeron-mobile --lib --profile mobile --target aarch64-apple-ios-sim - mkdir -p target/ios-core/iphonesimulator - cp target/aarch64-apple-ios-sim/mobile/libzeron_mobile.a target/ios-core/iphonesimulator/ - - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 - with: - name: ios-ffi-include - path: target/ios-core/iphonesimulator/include + IPHONEOS_DEPLOYMENT_TARGET=26.0 cargo build --locked -p zeron-mobile --lib --target aarch64-apple-ios-sim + mkdir -p target/ios-core/iphonesimulator/include + cp target/aarch64-apple-ios-sim/debug/libzeron_mobile.a target/ios-core/iphonesimulator/ + cp apps/ios/CoreFFI/zeron_coreFFI.h target/ios-core/iphonesimulator/include/zeron_coreFFI.h + cp apps/ios/CoreFFI/module.modulemap target/ios-core/iphonesimulator/include/module.modulemap - name: Run iOS unit tests working-directory: apps/ios env: @@ -295,3 +281,9 @@ jobs: name: ios-test-results path: ${{ runner.temp }}/ios-tests.xcresult if-no-files-found: ignore + - name: Record the pass (CI skips this job while its inputs stay the same) + if: inputs.pass-key != '' + uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + with: + path: rust-toolchain.toml + key: ${{ inputs.pass-key }}-ios-tests diff --git a/.github/workflows/preview-tests.yml b/.github/workflows/preview-tests.yml index 2e39a7f6b..1458949a3 100644 --- a/.github/workflows/preview-tests.yml +++ b/.github/workflows/preview-tests.yml @@ -1,71 +1,49 @@ name: Preview networking + +# Called by ci.yml when edge/ changes. The Rust networking tests run in +# core-tests (ui-tests.yml, Linux) and macos-native (macos.yml); this keeps the +# edge coordinator and the credential vault (edge/vault, its own package), in +# one job: each takes seconds, a runner of its own cost more than the tests. on: - pull_request: - paths: ['crates/preview/**', 'crates/proto/**', 'Cargo.toml', 'Cargo.lock', 'edge/**', '.github/workflows/preview-tests.yml'] - push: - branches: [main] - paths: ['crates/preview/**', 'crates/proto/**', 'Cargo.toml', 'Cargo.lock', 'edge/**', '.github/workflows/preview-tests.yml'] + workflow_call: + inputs: + pass-key: + description: Cache key prefix under which each job records its pass (ci.yml); empty records nothing. + type: string + default: '' + permissions: contents: read -concurrency: - group: preview-tests-${{ github.ref }} - cancel-in-progress: ${{ github.event_name == 'pull_request' }} + jobs: - # The Rust networking tests run in `core-tests` (ui-tests.yml, Linux) and - # `macos-native` (macos.yml); this workflow keeps the edge coordinator. - coordinator: - runs-on: ubuntu-latest + edge: + runs-on: ubuntu-24.04 timeout-minutes: 10 - defaults: - run: - working-directory: edge steps: - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: 24 cache: npm - cache-dependency-path: edge/package-lock.json - - run: npm ci - - run: npm run typecheck - - run: npm test - # The credential vault (edge/vault) has its own package and tests; run them - # whenever it (or this workflow) changes. - vault: - runs-on: ubuntu-latest - timeout-minutes: 10 - defaults: - run: - working-directory: edge/vault - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: detect vault changes - id: changed - working-directory: . - shell: bash + cache-dependency-path: | + edge/package-lock.json + edge/vault/package-lock.json + - name: Coordinator + working-directory: edge run: | - if [ "${{ github.event_name }}" = "pull_request" ]; then - base="${{ github.event.pull_request.base.sha }}" - else - base="${{ github.event.before }}" - fi - if [ -z "$base" ] || ! git cat-file -e "$base" 2>/dev/null \ - || git diff --name-only "$base" "$GITHUB_SHA" | grep -qE '^(edge/vault/|\.github/workflows/preview-tests\.yml)'; then - echo "changed=true" >> "$GITHUB_OUTPUT" - else - echo "changed=false" >> "$GITHUB_OUTPUT" - fi - - uses: actions/setup-node@v4 - if: steps.changed.outputs.changed == 'true' + npm ci + npm run typecheck + npm test + - name: Credential vault + if: ${{ !cancelled() }} + working-directory: edge/vault + run: | + npm ci + npm run typecheck + npm test + - name: Record the pass (CI skips this job while its inputs stay the same) + if: inputs.pass-key != '' + uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 with: - node-version: 24 - cache: npm - cache-dependency-path: edge/vault/package-lock.json - - if: steps.changed.outputs.changed == 'true' - run: npm ci - - if: steps.changed.outputs.changed == 'true' - run: npm run typecheck - - if: steps.changed.outputs.changed == 'true' - run: npm test + path: rust-toolchain.toml + key: ${{ inputs.pass-key }}-edge diff --git a/.github/workflows/ui-tests.yml b/.github/workflows/ui-tests.yml index d3fd28300..5b26b70cc 100644 --- a/.github/workflows/ui-tests.yml +++ b/.github/workflows/ui-tests.yml @@ -1,47 +1,41 @@ -name: UI tests +name: Linux tests +# Called by ci.yml, which decides which of these run and holds the runners for +# them (scripts/ci/plan.py, scripts/ci/admit.py). on: - pull_request: - paths: - - 'Cargo.toml' - - 'Cargo.lock' - - 'rust-toolchain.toml' - - 'crates/**' - - '.github/actions/linux-ci/**' - - 'scripts/ci/**' - - 'scripts/*cursor-sdk*' - - '.github/workflows/cursor-*.yml' - - 'scripts/test-linux-browser.sh' - - 'scripts/test-browser-storage.py' - - '.github/workflows/ui-tests.yml' - push: - branches: [main] - paths: - - 'Cargo.toml' - - 'Cargo.lock' - - 'rust-toolchain.toml' - - 'crates/**' - - '.github/actions/linux-ci/**' - - 'scripts/ci/**' - - 'scripts/*cursor-sdk*' - - '.github/workflows/cursor-*.yml' - - 'scripts/test-linux-browser.sh' - - 'scripts/test-browser-storage.py' - - '.github/workflows/ui-tests.yml' - workflow_dispatch: + workflow_call: + inputs: + pass-key: + description: Cache key prefix under which each job records its pass (ci.yml); empty records nothing. + type: string + default: '' + core: + type: boolean + default: true + ui: + type: boolean + default: true + browser: + description: Also run the native browser fixture (ci.yml - nightly, manual runs and `ci:full`). + type: boolean + default: true permissions: contents: read -concurrency: - group: ui-tests-${{ github.ref }} - cancel-in-progress: ${{ github.event_name == 'pull_request' }} +# Pull requests and main leave out the slow and soak tests (scripts/ci/nextest.toml +# `ci` profile) and run the cursor_shim stress test for 14 rounds; the nightly +# run (schedule) runs everything in full. +env: + NEXTEST_PROFILE: ${{ github.event_name == 'schedule' && 'default' || 'ci' }} + ZERON_STRESS_ROUNDS: ${{ github.event_name == 'schedule' && '100' || '14' }} jobs: # Every Linux Rust test that is not UI: one build, one nextest run (see - # scripts/ci/test-core.sh). Replaces session-sync-regressions and the Rust - # steps of cursor-compatibility and preview-tests. + # scripts/ci/test-core.sh), including the voice protocol and transport tests + # that need no audio stack. core-tests: + if: inputs.core runs-on: ubuntu-24.04 timeout-minutes: 30 steps: @@ -50,50 +44,51 @@ jobs: with: rust-cache: core save-rust-cache: 'true' - - name: Harness, engine, sync, update, doc and preview tests + - name: Harness, engine, sync, update, doc, preview, MCP and voice protocol tests run: scripts/ci/test-core.sh + - name: Record the pass (CI skips this job while its inputs stay the same) + if: inputs.pass-key != '' + uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + with: + path: rust-toolchain.toml + key: ${{ inputs.pass-key }}-core-tests + # UI and headless layout regressions, then (when `browser`) the native browser + # on X11 and Wayland. One job: the browser fixture shares the UI build's + # dependency graph and cache, so it costs a link rather than a second runner. ui-tests: + if: inputs.ui runs-on: ubuntu-24.04 - timeout-minutes: 30 + timeout-minutes: 40 steps: - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 - - uses: ./.github/actions/linux-ci + - id: setup + uses: ./.github/actions/linux-ci with: rust-cache: ui save-rust-cache: 'true' - apt-cache: gpui - apt-packages: >- - libxkbcommon-dev libxkbcommon-x11-dev libwayland-dev - libx11-dev libxcb1-dev libx11-xcb-dev - libfontconfig1-dev libfreetype-dev libasound2-dev - libvulkan-dev pkg-config cmake libwebkit2gtk-4.1-dev libjson-glib-dev - - name: UI and headless layout regressions - run: cargo nextest run --config-file scripts/ci/nextest.toml --locked --no-fail-fast -p zeron-ui --lib --test voice_orb_geometry - - linux-browser: - runs-on: ubuntu-24.04 - timeout-minutes: 30 - steps: - - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 - - uses: ./.github/actions/linux-ci - with: - # Same dependency graph as ui-tests, which saves this cache on main. - rust-cache: ui - apt-cache: browser - apt-recommends: 'true' + # One .deb cache for both package sets (apt-install.sh uses it as its archive). + apt-cache: ui-browser + apt-recommends: ${{ inputs.browser && 'true' || 'false' }} apt-packages: >- libxkbcommon-dev libxkbcommon-x11-dev libwayland-dev libx11-dev libxcb1-dev libx11-xcb-dev libfontconfig1-dev libfreetype-dev libasound2-dev libvulkan-dev pkg-config cmake - libwebkit2gtk-4.1-dev libjson-glib-dev xvfb xauth xdotool openbox - weston ffmpeg imagemagick fonts-noto-cjk + libwebkit2gtk-4.1-dev libjson-glib-dev + ${{ inputs.browser && 'xvfb xauth xdotool openbox weston ffmpeg imagemagick fonts-noto-cjk' || '' }} + - name: UI and headless layout regressions + run: cargo nextest run --config-file scripts/ci/nextest.toml --locked --no-fail-fast -p zeron-ui --lib + # The browser steps run even when a UI test failed (a separate signal), but not + # when the setup did: without the packages they can only fail. - name: Build browser fixture + if: ${{ inputs.browser && !cancelled() && steps.setup.outcome == 'success' }} run: cargo build --locked -p zeron-ui --example browser-fixture --features browser-fixture - name: Persistent browser profiles across app launches + if: ${{ inputs.browser && !cancelled() && steps.setup.outcome == 'success' }} timeout-minutes: 5 run: xvfb-run -a python3 scripts/test-browser-storage.py --fixture target/debug/examples/browser-fixture - name: X11 and Wayland browser regressions + if: ${{ inputs.browser && !cancelled() && steps.setup.outcome == 'success' }} timeout-minutes: 5 env: RUST_LOG: gpui_wgpu=info @@ -102,9 +97,15 @@ jobs: scripts/test-linux-browser.sh "$RUNNER_TEMP/linux-browser/default" VK_DRIVER_FILES=/dev/null scripts/test-linux-browser.sh "$RUNNER_TEMP/linux-browser/opengl" - name: Upload native browser evidence - if: always() + if: ${{ inputs.browser && always() }} uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: linux-browser path: ${{ runner.temp }}/linux-browser if-no-files-found: warn + - name: Record the pass (CI skips this job while its inputs stay the same) + if: inputs.pass-key != '' + uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + with: + path: rust-toolchain.toml + key: ${{ inputs.pass-key }}-ui-tests diff --git a/.github/workflows/voice-tests.yml b/.github/workflows/voice-tests.yml index 8aeec8e2a..7adbae2ec 100644 --- a/.github/workflows/voice-tests.yml +++ b/.github/workflows/voice-tests.yml @@ -1,41 +1,60 @@ name: Native Codex voice + +# Called by ci.yml nightly, on manual runs and with the `ci:full` label +# (scripts/ci/plan.py NIGHTLY_SUITES). The rest of voice is tested where it is +# built: protocol, transport, MCP and voice-media in core-tests +# (scripts/ci/test-core.sh), the mobile voice and orb core in ios-core +# (macos.yml), voice-media on Windows in windows.yml. on: - pull_request: - paths: - - 'crates/audio/**' - - 'crates/voice-media/**' - - 'crates/voice-session/**' - - 'crates/orb/**' - - 'crates/proto/src/voice/**' - - 'crates/rpc/**' - - 'crates/client/**' - - 'crates/mobile/**' - - 'apps/ios/Zeron/Voice/**' - - 'apps/ios/ZeronTests/RemoteVoiceLifecycleTests.swift' - - 'dist/voice/**' - - 'scripts/package-voice-runtime.py' - - 'crates/proto/src/voice.rs' - - 'crates/harness/**' - - 'crates/engine/**' - - 'crates/ui/**' - - 'crates/mcp/**' - - 'Cargo.toml' - - 'Cargo.lock' - - 'scripts/codex-voice-remote-smoke.py' - - 'scripts/tests/*voice_remote*' - - 'scripts/tests/test_voice_packaging.py' - - '.github/workflows/voice-tests.yml' - workflow_dispatch: + workflow_call: + inputs: + pass-key: + description: Cache key prefix under which each job records its pass (ci.yml); empty records nothing. + type: string + default: '' + skip: + description: JSON list of jobs that already passed on the same inputs (ci.yml skips them). + type: string + default: '[]' + permissions: contents: read + jobs: - runtime-packaging: - strategy: - fail-fast: false - matrix: - os: [ubuntu-24.04, windows-latest] - runs-on: ${{ matrix.os }} - timeout-minutes: 5 + # The WebRTC AEC3 audio stack (zeron-audio; its meson build is most of the + # job) and the Python fixtures. + offline-linux: + if: ${{ !contains(fromJSON(inputs.skip), 'offline-linux') }} + runs-on: ubuntu-24.04 + timeout-minutes: 45 + steps: + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + - name: Development runtime projection and split-host diagnostic fixtures (no downloads, Codex, microphone or provider) + run: | + python3 -m unittest discover -s scripts/tests -p 'test_voice_packaging.py' -v + python3 -m unittest discover -s scripts/tests -p 'test_voice_remote*.py' -v + - uses: ./.github/actions/linux-ci + with: + rust-cache: voice + save-rust-cache: 'true' + apt-cache: voice + apt-packages: >- + libasound2-dev clang libclang-dev pkg-config meson ninja-build + - name: Native audio and WebRTC AEC3 + run: cargo nextest run --config-file scripts/ci/nextest.toml --locked --no-fail-fast -p zeron-audio --features aec --lib + - name: Record the pass (CI skips this job while its inputs stay the same) + if: inputs.pass-key != '' + uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + with: + path: rust-toolchain.toml + key: ${{ inputs.pass-key }}-offline-linux + + # The packaged Windows media runtime: download, project and initialize it + # without audio devices or a provider. + windows-runtime: + if: ${{ !contains(fromJSON(inputs.skip), 'windows-runtime') }} + runs-on: windows-latest + timeout-minutes: 45 steps: - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 @@ -43,81 +62,23 @@ jobs: python-version: '3.12' - name: Development runtime projection fixtures (no downloads or audio devices) run: python -m unittest discover -s scripts/tests -p 'test_voice_packaging.py' -v - - split-host-probe: - strategy: - fail-fast: false - matrix: - os: [ubuntu-24.04, macos-14] - runs-on: ${{ matrix.os }} - timeout-minutes: 5 - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - name: Rust toolchain + shell: bash + run: rustup show active-toolchain || rustup toolchain install + - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 with: - python-version: '3.12' - - name: Split-host diagnostic fixtures (no Codex, microphone or provider) - run: python3 -m unittest discover -s scripts/tests -p 'test_voice_remote*.py' -v - - offline-linux: - runs-on: ubuntu-24.04 - timeout-minutes: 45 - env: - CARGO_BUILD_JOBS: 2 - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - with: - components: llvm-tools-preview - - name: Native audio and GPUI build tools - run: | - sudo apt-get update - sudo apt-get install -y libasound2-dev clang libclang-dev pkg-config meson ninja-build libwayland-dev libxkbcommon-dev libxcb1-dev libxcb-shape0-dev libxcb-xfixes0-dev libx11-xcb-dev libxrandr-dev libxi-dev libxcursor-dev libx11-dev libxinerama-dev libegl1-mesa-dev libvulkan-dev libfontconfig1-dev libfreetype6-dev libssl-dev libdbus-1-dev - - uses: Swatinem/rust-cache@v2 - - name: Protocol, transport and idle runtime (no provider access) - run: | - cargo test --locked -p zeron-voice-media --lib - cargo test --locked -p zeron-orb - cargo test --locked -p zeron-voice-session --lib - cargo test --locked -p zeron-mobile --lib voice - cargo test --locked -p zeron-mobile --lib orb - cargo test --locked -p zeron-proto voice --lib - cargo test --locked -p zeron-harness --lib - cargo test --locked -p zeron-harness --test codex --test acp - cargo test --locked -p zeron-doc voice --lib - cargo test --locked -p zeron-engine --lib voice - cargo test --locked -p zeron-engine --test voice_runtime - cargo test --locked -p zeron-engine --test device_routing - cargo test --locked -p zeron-rpc --test device_room - cargo test --locked -p zeron-mcp --lib - - name: Native audio and WebRTC AEC3 - run: cargo test --locked -p zeron-audio --features aec --lib - - native-platform-check: - strategy: - fail-fast: false - matrix: - os: [macos-14, windows-latest] - runs-on: ${{ matrix.os }} - timeout-minutes: 45 - env: - CARGO_BUILD_JOBS: 2 - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@v2 - - name: Compile subscription bridge without audio hardware or provider access - run: cargo check --locked -p zeron-harness -p zeron-engine - - name: Installed and development runtime resolution - run: cargo test --locked -p zeron-voice-media --lib - - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 - if: runner.os == 'Windows' - with: - python-version: '3.12' + # Only main writes the cache: pull request caches evicted main's. + save-if: ${{ github.ref == 'refs/heads/main' }} + cache-on-failure: true - name: Initialize a projected Windows runtime (no provider or audio devices) - if: runner.os == 'Windows' run: | $env:ZERON_VOICE_MEDIA_DIR = Join-Path $env:RUNNER_TEMP 'zeron-media/codex-resources/voice' python scripts/package-voice-runtime.py --download --destination $env:ZERON_VOICE_MEDIA_DIR if ($LASTEXITCODE -ne 0) { throw 'Voice runtime packaging failed' } cargo test --locked -p zeron-voice-media --lib packaged_native_runtime_initializes_without_audio_devices -- --ignored + - name: Record the pass (CI skips this job while its inputs stay the same) + if: inputs.pass-key != '' + uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + with: + path: rust-toolchain.toml + key: ${{ inputs.pass-key }}-windows-runtime diff --git a/.github/workflows/weekly-tests.yml b/.github/workflows/weekly-tests.yml new file mode 100644 index 000000000..cca42e40f --- /dev/null +++ b/.github/workflows/weekly-tests.yml @@ -0,0 +1,47 @@ +name: Weekly coverage + +# Tests no other workflow runs, so they don't rot unnoticed: +# - zeron-engine's integration test binaries outside scripts/ci/test-core.sh +# (e2e, cloud_runner, run_recovery, m5_repos_diffs_terminals, ...); live ones +# stay #[ignore]d; +# - the crates whose own tests have no runner: term, syntax, theme, veil, +# visual, visual-gpu, zatex, notify. +# Nothing here gates pull requests; a failure is a weekly signal to fix or delete. +on: + schedule: + - cron: '41 5 * * 1' + workflow_dispatch: + +permissions: + contents: read + +jobs: + engine-integration: + runs-on: ubuntu-24.04 + timeout-minutes: 90 + steps: + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + - uses: ./.github/actions/linux-ci + with: + rust-cache: core # saved by core-tests (ci.yml); same dependency graph + - name: Every zeron-engine test binary + run: cargo nextest run --config-file scripts/ci/nextest.toml --locked --no-fail-fast -p zeron-engine --tests + + crates: + runs-on: ubuntu-24.04 + timeout-minutes: 60 + steps: + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + - uses: ./.github/actions/linux-ci + with: + rust-cache: weekly-crates + apt-cache: ui-browser + apt-packages: >- + libxkbcommon-dev libxkbcommon-x11-dev libwayland-dev libx11-dev libxcb1-dev + libx11-xcb-dev libfontconfig1-dev libfreetype-dev libasound2-dev libvulkan-dev + pkg-config cmake + - name: Crates without a runner + run: >- + cargo nextest run --config-file scripts/ci/nextest.toml --locked --no-fail-fast + -p zeron-term -p zeron-syntax -p zeron-theme -p zeron-veil -p zeron-visual + -p zeron-visual-gpu -p zatex -p zeron-notify --lib --tests diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 23addd036..f94857382 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -1,29 +1,21 @@ name: Windows tests +# Called by ci.yml (which decides when Windows runs and holds the runners for +# it, see scripts/ci/admit.py). Dispatch it by hand for the native GUI probes. on: - pull_request: - paths: - - 'Cargo.toml' - - 'Cargo.lock' - - 'rust-toolchain.toml' - - 'apps/zeron/**' - - 'dist/windows/**' - - 'crates/**' - - 'scripts/test-windows-*.ps1' - - 'scripts/package-windows.ps1' - - '.github/workflows/windows.yml' - push: - branches: [main] - paths: - - 'Cargo.toml' - - 'Cargo.lock' - - 'rust-toolchain.toml' - - 'apps/zeron/**' - - 'dist/windows/**' - - 'crates/**' - - 'scripts/test-windows-*.ps1' - - 'scripts/package-windows.ps1' - - '.github/workflows/windows.yml' + workflow_call: + inputs: + pass-key: + description: Cache key prefix under which each job records its pass (ci.yml); empty records nothing. + type: string + default: '' + skip: + description: JSON list of jobs that already passed on the same inputs (ci.yml skips them). + type: string + default: '[]' + native_gui: + type: boolean + default: false workflow_dispatch: inputs: native_gui: @@ -34,74 +26,69 @@ on: permissions: contents: read -concurrency: - group: windows-tests-${{ github.ref }} - cancel-in-progress: ${{ github.event_name == 'pull_request' }} - defaults: run: shell: pwsh +# Pull requests and main leave out slow and soak tests (scripts/ci/nextest.toml `ci` profile). +env: + NEXTEST_PROFILE: ${{ github.event_name == 'schedule' && 'default' || 'ci' }} + ZERON_STRESS_ROUNDS: ${{ github.event_name == 'schedule' && '100' || '14' }} + jobs: - # The original single serial job is split into three independent jobs so they - # run in parallel. Together they run exactly the commands the single job ran. - ui-tests: + # Every Windows crate suite in ONE build: separate `cargo test` invocations + # with different package sets each recompiled the shared dependency graph + # (they used to be three jobs, ~20 min each, almost all of it compiling). + # nextest runs each test in its own process, so zeron-ui's tests run side by + # side (the old in-process `--test-threads=1` run needed them one at a time). + tests: + if: ${{ !contains(fromJSON(inputs.skip || '[]'), 'tests') }} runs-on: windows-2022 - timeout-minutes: 45 + timeout-minutes: 60 steps: - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 - uses: ./.github/actions/windows-ci-setup - - name: UI tests + with: + save-rust-cache: 'true' + - name: Build tests + run: >- + cargo nextest run --config-file scripts/ci/nextest.toml --no-run --release --locked + -p zeron-ui -p zeron-harness -p gpui_windows -p zeron -p zeron-update -p zeron-proto -p zeron-engine -p zeron-voice-media + --features zeron-harness/native-fixture + --lib --bins + --test codex_availability --test windows_native --test opencode --test cursor_shim --test pi_rpc + --test background_engine --test noop_browser + --test worktree_on_run --test codex_catalog --test codex_login_resolution --test auth + # Same selection as the old commands: + # UI: the zeron-ui library (native_diff_font_geometry included) + # native harness security/integration + portable driver suites (OpenCode HTTP/SSE, + # the Cursor shim, Pi RPC; the shell- and python-fixture suites are unix-only) + # shader layout, application and updater, worktree paths, engine unit/catalog/login/auth + # voice-media (runtime resolution; used to be its own build in voice-tests.yml) + # gpui_windows (shader layout) is a git dependency, which a filterset cannot name: the last + # clause picks it as "not one of the workspace packages above". + - name: UI, harness, shader layout, application, updater and engine tests env: RUST_BACKTRACE: '1' - run: | - # Native platform initialization runs in its own process. Keep the - # real-font assertion and the complete headless suite mandatory. - cargo test --release --locked -p zeron-ui --lib native_diff_font_geometry -- --test-threads=1 --nocapture - $nativeResult = $LASTEXITCODE - cargo test --release --locked -p zeron-ui --lib -- --test-threads=1 --skip native_diff_font_geometry --nocapture - $headlessResult = $LASTEXITCODE - if ($nativeResult -ne 0 -or $headlessResult -ne 0) { exit 1 } - - # The crate suites compile different package sets, so the two jobs below each - # build what they need in parallel instead of one job building them in turn. - harness-app-tests: - runs-on: windows-2022 - timeout-minutes: 45 - steps: - - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 - - uses: ./.github/actions/windows-ci-setup - - name: Native harness security and integration tests - run: cargo test --release --locked -p zeron-harness --features native-fixture --lib --test codex_availability --test windows_native - # The driver suites whose fixtures run without a POSIX shell: an in-test - # HTTP/SSE server (OpenCode), node (the Cursor shim) and a Rust peer - # (Pi). The shell- and python-fixture suites are unix-only. - - name: Portable harness integration tests - run: cargo test --release --locked -p zeron-harness --features native-fixture --test opencode --test cursor_shim --test pi_rpc - - name: Shader layout tests - run: cargo test --release --locked -p gpui_windows --lib layout - - name: Application and updater tests - run: cargo test --release --locked -p zeron -p zeron-update - - engine-tests: - runs-on: windows-2022 - timeout-minutes: 45 - steps: - - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 - - uses: ./.github/actions/windows-ci-setup - - name: Worktree path compatibility - run: | - cargo test --release --locked -p zeron-proto --lib device_paths - if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } - cargo test --release --locked -p zeron-engine --test worktree_on_run worktree_location_ - - name: Engine unit tests - run: cargo test --release --locked -p zeron-engine --lib - - name: Harness catalog and login tests - run: cargo test --release --locked -p zeron-engine --test codex_catalog --test codex_login_resolution - - name: Auth integration tests - run: cargo test --release --locked -p zeron-engine --test auth + run: >- + cargo nextest run --config-file scripts/ci/nextest.toml --release --locked --no-fail-fast + -p zeron-ui -p zeron-harness -p gpui_windows -p zeron -p zeron-update -p zeron-proto -p zeron-engine -p zeron-voice-media + --features zeron-harness/native-fixture + --lib --bins + --test codex_availability --test windows_native --test opencode --test cursor_shim --test pi_rpc + --test background_engine --test noop_browser + --test worktree_on_run --test codex_catalog --test codex_login_resolution --test auth + -E "(package(zeron-ui) & kind(lib)) | package(zeron-harness) | package(zeron) | package(zeron-update) | (package(zeron-voice-media) & kind(lib)) | (package(zeron-proto) & test(device_paths)) | (package(zeron-engine) & (kind(lib) | binary_id(zeron-engine::codex_catalog) | binary_id(zeron-engine::codex_login_resolution) | binary_id(zeron-engine::auth) | (binary_id(zeron-engine::worktree_on_run) & test(worktree_location_)))) | (not package(zeron-ui) & not package(zeron-harness) & not package(zeron) & not package(zeron-update) & not package(zeron-proto) & not package(zeron-engine) & not package(zeron-voice-media) & test(layout))" + - name: Record the pass (CI skips this job while its inputs stay the same) + if: inputs.pass-key != '' + uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + with: + path: rust-toolchain.toml + key: ${{ inputs.pass-key }}-tests + # Restores the cache `tests` saves: the same dependencies, built with the same profile. app: + if: ${{ !contains(fromJSON(inputs.skip || '[]'), 'app') }} runs-on: windows-2022 timeout-minutes: 45 steps: @@ -151,10 +138,10 @@ jobs: throw 'An isolated Windows startup must select local-only mode' } - name: Build rendering fixture - if: ${{ github.event_name == 'workflow_dispatch' && inputs.native_gui }} + if: ${{ inputs.native_gui }} run: cargo build --release --locked -p zeron-ui --example windows-render-fixture --features windows-render-fixture - name: Upload GUI test binaries - if: ${{ github.event_name == 'workflow_dispatch' && inputs.native_gui }} + if: ${{ inputs.native_gui }} uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: windows-gui-binaries @@ -163,9 +150,15 @@ jobs: target/release/examples/windows-render-fixture.exe if-no-files-found: error retention-days: 1 + - name: Record the pass (CI skips this job while its inputs stay the same) + if: inputs.pass-key != '' + uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + with: + path: rust-toolchain.toml + key: ${{ inputs.pass-key }}-app native-gui: - if: ${{ github.event_name == 'workflow_dispatch' && inputs.native_gui }} + if: ${{ inputs.native_gui }} needs: app runs-on: windows-2022 timeout-minutes: 10 diff --git a/apps/android/README.md b/apps/android/README.md index 2a9db4344..06005e576 100644 --- a/apps/android/README.md +++ b/apps/android/README.md @@ -31,9 +31,10 @@ iterating on Kotlin; `ZERON_ANDROID_ABIS=arm64-v8a` builds one ABI. ## Releases -`.github/workflows/android.yml` builds a release APK (arm64, the core at the -`mobile-dist` profile) whenever the app or the Rust core changes: pull requests -get it as a workflow artifact, and pushes to `main` publish it to +`.github/workflows/android.yml` (run by `ci.yml`) builds a release APK (arm64, +the core at the `mobile-dist` profile) whenever the app or the Rust core +changes: pull requests that touch the app or the mobile core (or carry the +`ci:full` label) get it as a workflow artifact, and pushes to `main` publish it to `zeron.sh/releases/zeron-android-arm64.apk` — the website's Android download — with a copy per build (`zeron---android-arm64.apk`) and `.sha256`s. diff --git a/apps/ios/CoreFFI/module.modulemap b/apps/ios/CoreFFI/module.modulemap new file mode 100644 index 000000000..0d0a9e388 --- /dev/null +++ b/apps/ios/CoreFFI/module.modulemap @@ -0,0 +1,7 @@ +module zeron_coreFFI { + header "zeron_coreFFI.h" + export * + use "Darwin" + use "_Builtin_stdbool" + use "_Builtin_stdint" +} \ No newline at end of file diff --git a/apps/ios/CoreFFI/zeron_coreFFI.h b/apps/ios/CoreFFI/zeron_coreFFI.h new file mode 100644 index 000000000..28c7111d9 --- /dev/null +++ b/apps/ios/CoreFFI/zeron_coreFFI.h @@ -0,0 +1,3387 @@ +// This file was autogenerated by some hot garbage in the `uniffi` crate. +// Trust me, you don't want to mess with it! + +#pragma once + +#include +#include +#include + +// The following structs are used to implement the lowest level +// of the FFI, and thus useful to multiple uniffied crates. +// We ensure they are declared exactly once, with a header guard, UNIFFI_SHARED_H. +#ifdef UNIFFI_SHARED_H + // We also try to prevent mixing versions of shared uniffi header structs. + // If you add anything to the #else block, you must increment the version suffix in UNIFFI_SHARED_HEADER_V4 + #ifndef UNIFFI_SHARED_HEADER_V4 + #error Combining helper code from multiple versions of uniffi is not supported + #endif // ndef UNIFFI_SHARED_HEADER_V4 +#else +#define UNIFFI_SHARED_H +#define UNIFFI_SHARED_HEADER_V4 +// ⚠️ Attention: If you change this #else block (ending in `#endif // def UNIFFI_SHARED_H`) you *must* ⚠️ +// ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V4 in this file. ⚠️ + +typedef struct RustBuffer +{ + uint64_t capacity; + uint64_t len; + uint8_t *_Nullable data; +} RustBuffer; + +typedef struct ForeignBytes +{ + int32_t len; + const uint8_t *_Nullable data; +} ForeignBytes; + +// Error definitions +typedef struct RustCallStatus { + int8_t code; + RustBuffer errorBuf; +} RustCallStatus; + +// ⚠️ Attention: If you change this #else block (ending in `#endif // def UNIFFI_SHARED_H`) you *must* ⚠️ +// ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V4 in this file. ⚠️ +#endif // def UNIFFI_SHARED_H +#ifndef UNIFFI_FFIDEF_RUST_FUTURE_CONTINUATION_CALLBACK +#define UNIFFI_FFIDEF_RUST_FUTURE_CONTINUATION_CALLBACK +typedef void (*UniffiRustFutureContinuationCallback)(uint64_t, int8_t + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_DROPPED_CALLBACK +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_DROPPED_CALLBACK +typedef void (*UniffiForeignFutureDroppedCallback)(uint64_t + ); + +#endif +#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_FREE +#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_FREE +typedef void (*UniffiCallbackInterfaceFree)(uint64_t + ); + +#endif +#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_CLONE +#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_CLONE +typedef uint64_t (*UniffiCallbackInterfaceClone)(uint64_t + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_DROPPED_CALLBACK_STRUCT +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_DROPPED_CALLBACK_STRUCT +typedef struct UniffiForeignFutureDroppedCallbackStruct { + uint64_t handle; + UniffiForeignFutureDroppedCallback _Nonnull free; +} UniffiForeignFutureDroppedCallbackStruct; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_U8 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_U8 +typedef struct UniffiForeignFutureResultU8 { + uint8_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureResultU8; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U8 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U8 +typedef void (*UniffiForeignFutureCompleteU8)(uint64_t, UniffiForeignFutureResultU8 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_I8 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_I8 +typedef struct UniffiForeignFutureResultI8 { + int8_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureResultI8; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I8 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I8 +typedef void (*UniffiForeignFutureCompleteI8)(uint64_t, UniffiForeignFutureResultI8 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_U16 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_U16 +typedef struct UniffiForeignFutureResultU16 { + uint16_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureResultU16; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U16 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U16 +typedef void (*UniffiForeignFutureCompleteU16)(uint64_t, UniffiForeignFutureResultU16 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_I16 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_I16 +typedef struct UniffiForeignFutureResultI16 { + int16_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureResultI16; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I16 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I16 +typedef void (*UniffiForeignFutureCompleteI16)(uint64_t, UniffiForeignFutureResultI16 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_U32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_U32 +typedef struct UniffiForeignFutureResultU32 { + uint32_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureResultU32; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U32 +typedef void (*UniffiForeignFutureCompleteU32)(uint64_t, UniffiForeignFutureResultU32 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_I32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_I32 +typedef struct UniffiForeignFutureResultI32 { + int32_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureResultI32; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I32 +typedef void (*UniffiForeignFutureCompleteI32)(uint64_t, UniffiForeignFutureResultI32 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_U64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_U64 +typedef struct UniffiForeignFutureResultU64 { + uint64_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureResultU64; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U64 +typedef void (*UniffiForeignFutureCompleteU64)(uint64_t, UniffiForeignFutureResultU64 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_I64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_I64 +typedef struct UniffiForeignFutureResultI64 { + int64_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureResultI64; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I64 +typedef void (*UniffiForeignFutureCompleteI64)(uint64_t, UniffiForeignFutureResultI64 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_F32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_F32 +typedef struct UniffiForeignFutureResultF32 { + float returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureResultF32; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F32 +typedef void (*UniffiForeignFutureCompleteF32)(uint64_t, UniffiForeignFutureResultF32 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_F64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_F64 +typedef struct UniffiForeignFutureResultF64 { + double returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureResultF64; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F64 +typedef void (*UniffiForeignFutureCompleteF64)(uint64_t, UniffiForeignFutureResultF64 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_RUST_BUFFER +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_RUST_BUFFER +typedef struct UniffiForeignFutureResultRustBuffer { + RustBuffer returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureResultRustBuffer; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER +typedef void (*UniffiForeignFutureCompleteRustBuffer)(uint64_t, UniffiForeignFutureResultRustBuffer + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_VOID +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_VOID +typedef struct UniffiForeignFutureResultVoid { + RustCallStatus callStatus; +} UniffiForeignFutureResultVoid; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_VOID +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_VOID +typedef void (*UniffiForeignFutureCompleteVoid)(uint64_t, UniffiForeignFutureResultVoid + ); + +#endif +#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_CLIENT_LISTENER_METHOD0 +#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_CLIENT_LISTENER_METHOD0 +typedef void (*UniffiCallbackInterfaceClientListenerMethod0)(uint64_t, RustBuffer, void* _Nonnull, + RustCallStatus *_Nonnull uniffiCallStatus + ); + +#endif +#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_UPLOAD_PROGRESS_METHOD0 +#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_UPLOAD_PROGRESS_METHOD0 +typedef void (*UniffiCallbackInterfaceUploadProgressMethod0)(uint64_t, double, void* _Nonnull, + RustCallStatus *_Nonnull uniffiCallStatus + ); + +#endif +#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_VOICE_MEDIA_LISTENER_METHOD0 +#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_VOICE_MEDIA_LISTENER_METHOD0 +typedef void (*UniffiCallbackInterfaceVoiceMediaListenerMethod0)(uint64_t, RustBuffer, void* _Nonnull, + RustCallStatus *_Nonnull uniffiCallStatus + ); + +#endif +#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_VOICE_SESSION_LISTENER_METHOD0 +#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_VOICE_SESSION_LISTENER_METHOD0 +typedef void (*UniffiCallbackInterfaceVoiceSessionListenerMethod0)(uint64_t, RustBuffer, void* _Nonnull, + RustCallStatus *_Nonnull uniffiCallStatus + ); + +#endif +#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_VOICE_SESSION_LISTENER_METHOD1 +#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_VOICE_SESSION_LISTENER_METHOD1 +typedef void (*UniffiCallbackInterfaceVoiceSessionListenerMethod1)(uint64_t, RustBuffer, void* _Nonnull, + RustCallStatus *_Nonnull uniffiCallStatus + ); + +#endif +#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_LAYOUT_LISTENER_METHOD0 +#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_LAYOUT_LISTENER_METHOD0 +typedef void (*UniffiCallbackInterfaceLayoutListenerMethod0)(uint64_t, uint64_t, void* _Nonnull, + RustCallStatus *_Nonnull uniffiCallStatus + ); + +#endif +#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_PLATFORM_MEASURER_METHOD0 +#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_PLATFORM_MEASURER_METHOD0 +typedef void (*UniffiCallbackInterfacePlatformMeasurerMethod0)(uint64_t, RustBuffer, float, int8_t, RustBuffer, float* _Nonnull, + RustCallStatus *_Nonnull uniffiCallStatus + ); + +#endif +#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_PLATFORM_MEASURER_METHOD1 +#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_PLATFORM_MEASURER_METHOD1 +typedef void (*UniffiCallbackInterfacePlatformMeasurerMethod1)(uint64_t, RustBuffer, float, int8_t, RustBuffer, RustBuffer* _Nonnull, + RustCallStatus *_Nonnull uniffiCallStatus + ); + +#endif +#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TERMINAL_LISTENER_METHOD0 +#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TERMINAL_LISTENER_METHOD0 +typedef void (*UniffiCallbackInterfaceTerminalListenerMethod0)(uint64_t, void* _Nonnull, + RustCallStatus *_Nonnull uniffiCallStatus + ); + +#endif +#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TERMINAL_LISTENER_METHOD1 +#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TERMINAL_LISTENER_METHOD1 +typedef void (*UniffiCallbackInterfaceTerminalListenerMethod1)(uint64_t, void* _Nonnull, + RustCallStatus *_Nonnull uniffiCallStatus + ); + +#endif +#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_VISUAL_LISTENER_METHOD0 +#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_VISUAL_LISTENER_METHOD0 +typedef void (*UniffiCallbackInterfaceVisualListenerMethod0)(uint64_t, RustBuffer, void* _Nonnull, + RustCallStatus *_Nonnull uniffiCallStatus + ); + +#endif +#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_VISUAL_LISTENER_METHOD1 +#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_VISUAL_LISTENER_METHOD1 +typedef void (*UniffiCallbackInterfaceVisualListenerMethod1)(uint64_t, RustBuffer, void* _Nonnull, + RustCallStatus *_Nonnull uniffiCallStatus + ); + +#endif +#ifndef UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_CLIENT_LISTENER +#define UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_CLIENT_LISTENER +typedef struct UniffiVTableCallbackInterfaceClientListener { + UniffiCallbackInterfaceFree _Nonnull uniffiFree; + UniffiCallbackInterfaceClone _Nonnull uniffiClone; + UniffiCallbackInterfaceClientListenerMethod0 _Nonnull onEvent; +} UniffiVTableCallbackInterfaceClientListener; + +#endif +#ifndef UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_UPLOAD_PROGRESS +#define UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_UPLOAD_PROGRESS +typedef struct UniffiVTableCallbackInterfaceUploadProgress { + UniffiCallbackInterfaceFree _Nonnull uniffiFree; + UniffiCallbackInterfaceClone _Nonnull uniffiClone; + UniffiCallbackInterfaceUploadProgressMethod0 _Nonnull onProgress; +} UniffiVTableCallbackInterfaceUploadProgress; + +#endif +#ifndef UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_VOICE_MEDIA_LISTENER +#define UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_VOICE_MEDIA_LISTENER +typedef struct UniffiVTableCallbackInterfaceVoiceMediaListener { + UniffiCallbackInterfaceFree _Nonnull uniffiFree; + UniffiCallbackInterfaceClone _Nonnull uniffiClone; + UniffiCallbackInterfaceVoiceMediaListenerMethod0 _Nonnull onRequest; +} UniffiVTableCallbackInterfaceVoiceMediaListener; + +#endif +#ifndef UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_VOICE_SESSION_LISTENER +#define UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_VOICE_SESSION_LISTENER +typedef struct UniffiVTableCallbackInterfaceVoiceSessionListener { + UniffiCallbackInterfaceFree _Nonnull uniffiFree; + UniffiCallbackInterfaceClone _Nonnull uniffiClone; + UniffiCallbackInterfaceVoiceSessionListenerMethod0 _Nonnull onVoiceState; + UniffiCallbackInterfaceVoiceSessionListenerMethod1 _Nonnull onVoiceClosed; +} UniffiVTableCallbackInterfaceVoiceSessionListener; + +#endif +#ifndef UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_LAYOUT_LISTENER +#define UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_LAYOUT_LISTENER +typedef struct UniffiVTableCallbackInterfaceLayoutListener { + UniffiCallbackInterfaceFree _Nonnull uniffiFree; + UniffiCallbackInterfaceClone _Nonnull uniffiClone; + UniffiCallbackInterfaceLayoutListenerMethod0 _Nonnull frameReady; +} UniffiVTableCallbackInterfaceLayoutListener; + +#endif +#ifndef UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_PLATFORM_MEASURER +#define UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_PLATFORM_MEASURER +typedef struct UniffiVTableCallbackInterfacePlatformMeasurer { + UniffiCallbackInterfaceFree _Nonnull uniffiFree; + UniffiCallbackInterfaceClone _Nonnull uniffiClone; + UniffiCallbackInterfacePlatformMeasurerMethod0 _Nonnull measure; + UniffiCallbackInterfacePlatformMeasurerMethod1 _Nonnull measureRun; +} UniffiVTableCallbackInterfacePlatformMeasurer; + +#endif +#ifndef UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_TERMINAL_LISTENER +#define UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_TERMINAL_LISTENER +typedef struct UniffiVTableCallbackInterfaceTerminalListener { + UniffiCallbackInterfaceFree _Nonnull uniffiFree; + UniffiCallbackInterfaceClone _Nonnull uniffiClone; + UniffiCallbackInterfaceTerminalListenerMethod0 _Nonnull changed; + UniffiCallbackInterfaceTerminalListenerMethod1 _Nonnull bell; +} UniffiVTableCallbackInterfaceTerminalListener; + +#endif +#ifndef UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_VISUAL_LISTENER +#define UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_VISUAL_LISTENER +typedef struct UniffiVTableCallbackInterfaceVisualListener { + UniffiCallbackInterfaceFree _Nonnull uniffiFree; + UniffiCallbackInterfaceClone _Nonnull uniffiClone; + UniffiCallbackInterfaceVisualListenerMethod0 _Nonnull display; + UniffiCallbackInterfaceVisualListenerMethod1 _Nonnull frame; +} UniffiVTableCallbackInterfaceVisualListener; + +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CLONE_CAPTIONFADER +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CLONE_CAPTIONFADER +uint64_t uniffi_zeron_mobile_fn_clone_captionfader(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FREE_CAPTIONFADER +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FREE_CAPTIONFADER +void uniffi_zeron_mobile_fn_free_captionfader(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CONSTRUCTOR_CAPTIONFADER_NEW +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CONSTRUCTOR_CAPTIONFADER_NEW +uint64_t uniffi_zeron_mobile_fn_constructor_captionfader_new(uint32_t max_chars, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CAPTIONFADER_FRAME +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CAPTIONFADER_FRAME +RustBuffer uniffi_zeron_mobile_fn_method_captionfader_frame(uint64_t ptr, RustBuffer item, RustBuffer text, int8_t reduced_motion, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CLONE_CLIENTLISTENER +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CLONE_CLIENTLISTENER +uint64_t uniffi_zeron_mobile_fn_clone_clientlistener(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FREE_CLIENTLISTENER +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FREE_CLIENTLISTENER +void uniffi_zeron_mobile_fn_free_clientlistener(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_INIT_CALLBACK_VTABLE_CLIENTLISTENER +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_INIT_CALLBACK_VTABLE_CLIENTLISTENER +void uniffi_zeron_mobile_fn_init_callback_vtable_clientlistener(const UniffiVTableCallbackInterfaceClientListener* _Nonnull vtable +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CLIENTLISTENER_ON_EVENT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CLIENTLISTENER_ON_EVENT +void uniffi_zeron_mobile_fn_method_clientlistener_on_event(uint64_t ptr, RustBuffer event, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CLONE_CORECLIENT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CLONE_CORECLIENT +uint64_t uniffi_zeron_mobile_fn_clone_coreclient(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FREE_CORECLIENT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FREE_CORECLIENT +void uniffi_zeron_mobile_fn_free_coreclient(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CONSTRUCTOR_CORECLIENT_NEW +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CONSTRUCTOR_CORECLIENT_NEW +uint64_t uniffi_zeron_mobile_fn_constructor_coreclient_new(RustBuffer config, RustBuffer credentials, uint64_t listener, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_ARCHIVE_SESSION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_ARCHIVE_SESSION +void uniffi_zeron_mobile_fn_method_coreclient_archive_session(uint64_t ptr, RustBuffer chat_id, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_ARCHIVED_SESSIONS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_ARCHIVED_SESSIONS +RustBuffer uniffi_zeron_mobile_fn_method_coreclient_archived_sessions(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_ASSIGN_SECTION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_ASSIGN_SECTION +void uniffi_zeron_mobile_fn_method_coreclient_assign_section(uint64_t ptr, RustBuffer chat_id, RustBuffer section_id, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_CHILD_SESSIONS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_CHILD_SESSIONS +RustBuffer uniffi_zeron_mobile_fn_method_coreclient_child_sessions(uint64_t ptr, RustBuffer parent_id, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_CLOSE_SESSION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_CLOSE_SESSION +void uniffi_zeron_mobile_fn_method_coreclient_close_session(uint64_t ptr, RustBuffer chat_id, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_CLOUD_MODELS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_CLOUD_MODELS +uint64_t uniffi_zeron_mobile_fn_method_coreclient_cloud_models(uint64_t ptr, RustBuffer harness +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_CONNECTIVITY +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_CONNECTIVITY +RustBuffer uniffi_zeron_mobile_fn_method_coreclient_connectivity(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_CREATE_PROJECT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_CREATE_PROJECT +uint64_t uniffi_zeron_mobile_fn_method_coreclient_create_project(uint64_t ptr, RustBuffer device_id, RustBuffer path, int8_t git_detected +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_CREATE_SECTION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_CREATE_SECTION +RustBuffer uniffi_zeron_mobile_fn_method_coreclient_create_section(uint64_t ptr, RustBuffer name, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_CREATE_SESSION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_CREATE_SESSION +RustBuffer uniffi_zeron_mobile_fn_method_coreclient_create_session(uint64_t ptr, RustBuffer new_session, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_CREATE_WORKTREE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_CREATE_WORKTREE +uint64_t uniffi_zeron_mobile_fn_method_coreclient_create_worktree(uint64_t ptr, RustBuffer device_id, RustBuffer space_id, RustBuffer repo_path, RustBuffer base +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_DELETE_PROJECT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_DELETE_PROJECT +void uniffi_zeron_mobile_fn_method_coreclient_delete_project(uint64_t ptr, RustBuffer space_id, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_DELETE_SECTION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_DELETE_SECTION +void uniffi_zeron_mobile_fn_method_coreclient_delete_section(uint64_t ptr, RustBuffer section_id, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_DELETE_SESSION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_DELETE_SESSION +void uniffi_zeron_mobile_fn_method_coreclient_delete_session(uint64_t ptr, RustBuffer chat_id, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_DEVICE_ID +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_DEVICE_ID +RustBuffer uniffi_zeron_mobile_fn_method_coreclient_device_id(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_DEVICES +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_DEVICES +RustBuffer uniffi_zeron_mobile_fn_method_coreclient_devices(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_EXECUTION_DEVICES +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_EXECUTION_DEVICES +RustBuffer uniffi_zeron_mobile_fn_method_coreclient_execution_devices(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_FRONT_PAGE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_FRONT_PAGE +RustBuffer uniffi_zeron_mobile_fn_method_coreclient_front_page(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_IS_DEMO +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_IS_DEMO +int8_t uniffi_zeron_mobile_fn_method_coreclient_is_demo(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_LIST_FOLDERS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_LIST_FOLDERS +uint64_t uniffi_zeron_mobile_fn_method_coreclient_list_folders(uint64_t ptr, RustBuffer device_id, RustBuffer path +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_LIST_HARNESSES +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_LIST_HARNESSES +uint64_t uniffi_zeron_mobile_fn_method_coreclient_list_harnesses(uint64_t ptr, RustBuffer device_id +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_LIST_MODELS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_LIST_MODELS +uint64_t uniffi_zeron_mobile_fn_method_coreclient_list_models(uint64_t ptr, RustBuffer device_id, RustBuffer harness +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_LIST_REFS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_LIST_REFS +uint64_t uniffi_zeron_mobile_fn_method_coreclient_list_refs(uint64_t ptr, RustBuffer device_id, RustBuffer repo_path +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_MARK_SEEN +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_MARK_SEEN +void uniffi_zeron_mobile_fn_method_coreclient_mark_seen(uint64_t ptr, RustBuffer chat_id, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_MOVE_PIN +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_MOVE_PIN +void uniffi_zeron_mobile_fn_method_coreclient_move_pin(uint64_t ptr, RustBuffer chat_id, RustBuffer after, RustBuffer before, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_NETWORK_PATH_CHANGED +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_NETWORK_PATH_CHANGED +void uniffi_zeron_mobile_fn_method_coreclient_network_path_changed(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_ON_BACKGROUND +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_ON_BACKGROUND +void uniffi_zeron_mobile_fn_method_coreclient_on_background(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_ON_FOREGROUND +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_ON_FOREGROUND +void uniffi_zeron_mobile_fn_method_coreclient_on_foreground(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_OPEN_SESSION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_OPEN_SESSION +uint64_t uniffi_zeron_mobile_fn_method_coreclient_open_session(uint64_t ptr, RustBuffer chat_id, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_ORG_ID +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_ORG_ID +RustBuffer uniffi_zeron_mobile_fn_method_coreclient_org_id(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_PIN_SESSION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_PIN_SESSION +void uniffi_zeron_mobile_fn_method_coreclient_pin_session(uint64_t ptr, RustBuffer chat_id, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_PIN_SESSION_AT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_PIN_SESSION_AT +void uniffi_zeron_mobile_fn_method_coreclient_pin_session_at(uint64_t ptr, RustBuffer chat_id, RustBuffer after, RustBuffer before, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_PLACE_SESSION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_PLACE_SESSION +void uniffi_zeron_mobile_fn_method_coreclient_place_session(uint64_t ptr, RustBuffer chat_id, RustBuffer section_id, RustBuffer after, RustBuffer before, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_PRELOAD_SESSIONS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_PRELOAD_SESSIONS +void uniffi_zeron_mobile_fn_method_coreclient_preload_sessions(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_PROJECT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_PROJECT +RustBuffer uniffi_zeron_mobile_fn_method_coreclient_project(uint64_t ptr, RustBuffer space_id, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_PROJECTLESS_SESSIONS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_PROJECTLESS_SESSIONS +RustBuffer uniffi_zeron_mobile_fn_method_coreclient_projectless_sessions(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_PROJECTS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_PROJECTS +RustBuffer uniffi_zeron_mobile_fn_method_coreclient_projects(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_PULL_REQUESTS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_PULL_REQUESTS +RustBuffer uniffi_zeron_mobile_fn_method_coreclient_pull_requests(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_READ_ATTACHMENT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_READ_ATTACHMENT +uint64_t uniffi_zeron_mobile_fn_method_coreclient_read_attachment(uint64_t ptr, RustBuffer device_id, RustBuffer path +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_REGISTER_PUSH_TARGET +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_REGISTER_PUSH_TARGET +uint64_t uniffi_zeron_mobile_fn_method_coreclient_register_push_target(uint64_t ptr, RustBuffer token, RustBuffer environment, RustBuffer prefs +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_RENAME_PROJECT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_RENAME_PROJECT +void uniffi_zeron_mobile_fn_method_coreclient_rename_project(uint64_t ptr, RustBuffer space_id, RustBuffer name, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_RENAME_SECTION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_RENAME_SECTION +void uniffi_zeron_mobile_fn_method_coreclient_rename_section(uint64_t ptr, RustBuffer section_id, RustBuffer name, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_RENAME_SESSION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_RENAME_SESSION +void uniffi_zeron_mobile_fn_method_coreclient_rename_session(uint64_t ptr, RustBuffer chat_id, RustBuffer title, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_SEARCH +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_SEARCH +RustBuffer uniffi_zeron_mobile_fn_method_coreclient_search(uint64_t ptr, RustBuffer query, uint32_t limit, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_SEARCH_FILES +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_SEARCH_FILES +uint64_t uniffi_zeron_mobile_fn_method_coreclient_search_files(uint64_t ptr, RustBuffer device_id, RustBuffer chat_id, RustBuffer space_id, RustBuffer query +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_SESSION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_SESSION +RustBuffer uniffi_zeron_mobile_fn_method_coreclient_session(uint64_t ptr, RustBuffer chat_id, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_SESSION_CONFIG +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_SESSION_CONFIG +RustBuffer uniffi_zeron_mobile_fn_method_coreclient_session_config(uint64_t ptr, RustBuffer chat_id, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_SESSION_ROW +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_SESSION_ROW +RustBuffer uniffi_zeron_mobile_fn_method_coreclient_session_row(uint64_t ptr, RustBuffer chat_id, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_SET_NETWORK_ONLINE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_SET_NETWORK_ONLINE +void uniffi_zeron_mobile_fn_method_coreclient_set_network_online(uint64_t ptr, int8_t online, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_SET_SECTION_COLLAPSED +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_SET_SECTION_COLLAPSED +void uniffi_zeron_mobile_fn_method_coreclient_set_section_collapsed(uint64_t ptr, RustBuffer section_id, int8_t collapsed, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_SET_SESSION_CONFIG +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_SET_SESSION_CONFIG +void uniffi_zeron_mobile_fn_method_coreclient_set_session_config(uint64_t ptr, RustBuffer chat_id, RustBuffer config, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_SHUTDOWN +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_SHUTDOWN +void uniffi_zeron_mobile_fn_method_coreclient_shutdown(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_SWITCH_REF +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_SWITCH_REF +uint64_t uniffi_zeron_mobile_fn_method_coreclient_switch_ref(uint64_t ptr, RustBuffer device_id, RustBuffer repo_path, RustBuffer ref_name +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_SWITCH_SESSION_REF +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_SWITCH_SESSION_REF +uint64_t uniffi_zeron_mobile_fn_method_coreclient_switch_session_ref(uint64_t ptr, RustBuffer chat_id, RustBuffer reference +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_UNARCHIVE_SESSION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_UNARCHIVE_SESSION +void uniffi_zeron_mobile_fn_method_coreclient_unarchive_session(uint64_t ptr, RustBuffer chat_id, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_UNPIN_SESSION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_UNPIN_SESSION +void uniffi_zeron_mobile_fn_method_coreclient_unpin_session(uint64_t ptr, RustBuffer chat_id, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_UNREGISTER_PUSH_TARGET +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_UNREGISTER_PUSH_TARGET +uint64_t uniffi_zeron_mobile_fn_method_coreclient_unregister_push_target(uint64_t ptr +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_UPDATE_TOKENS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_UPDATE_TOKENS +void uniffi_zeron_mobile_fn_method_coreclient_update_tokens(uint64_t ptr, RustBuffer tokens, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_UPLOAD_ATTACHMENT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_UPLOAD_ATTACHMENT +uint64_t uniffi_zeron_mobile_fn_method_coreclient_upload_attachment(uint64_t ptr, RustBuffer device_id, RustBuffer name, RustBuffer data, RustBuffer progress +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_USER_ID +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_USER_ID +RustBuffer uniffi_zeron_mobile_fn_method_coreclient_user_id(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_WARM_DIRECT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_WARM_DIRECT +void uniffi_zeron_mobile_fn_method_coreclient_warm_direct(uint64_t ptr, RustBuffer chat_id, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_WORKSPACE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_WORKSPACE +RustBuffer uniffi_zeron_mobile_fn_method_coreclient_workspace(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_WORKSPACE_REVISION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_WORKSPACE_REVISION +uint64_t uniffi_zeron_mobile_fn_method_coreclient_workspace_revision(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_BILLING_CHECKOUT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_BILLING_CHECKOUT +uint64_t uniffi_zeron_mobile_fn_method_coreclient_billing_checkout(uint64_t ptr, RustBuffer kind, RustBuffer plan, RustBuffer packs +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_BILLING_PORTAL +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_BILLING_PORTAL +uint64_t uniffi_zeron_mobile_fn_method_coreclient_billing_portal(uint64_t ptr +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_BILLING_STATUS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_BILLING_STATUS +uint64_t uniffi_zeron_mobile_fn_method_coreclient_billing_status(uint64_t ptr +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_CLOUD_ENABLE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_CLOUD_ENABLE +uint64_t uniffi_zeron_mobile_fn_method_coreclient_cloud_enable(uint64_t ptr +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_CLOUD_SESSION_ACTION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_CLOUD_SESSION_ACTION +uint64_t uniffi_zeron_mobile_fn_method_coreclient_cloud_session_action(uint64_t ptr, RustBuffer chat_id, int8_t wake +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_CLOUD_SESSIONS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_CLOUD_SESSIONS +uint64_t uniffi_zeron_mobile_fn_method_coreclient_cloud_sessions(uint64_t ptr +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_CLOUD_STATUS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_CLOUD_STATUS +uint64_t uniffi_zeron_mobile_fn_method_coreclient_cloud_status(uint64_t ptr +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_CREATE_CLOUD_PROJECT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_CREATE_CLOUD_PROJECT +uint64_t uniffi_zeron_mobile_fn_method_coreclient_create_cloud_project(uint64_t ptr, RustBuffer repo +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_CREATE_CLOUD_SESSION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_CREATE_CLOUD_SESSION +uint64_t uniffi_zeron_mobile_fn_method_coreclient_create_cloud_session(uint64_t ptr, RustBuffer space_id, RustBuffer config, RustBuffer branch, RustBuffer title +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_GITHUB_BRANCHES +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_GITHUB_BRANCHES +uint64_t uniffi_zeron_mobile_fn_method_coreclient_github_branches(uint64_t ptr, RustBuffer repo +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_GITHUB_CONNECT_POLL +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_GITHUB_CONNECT_POLL +uint64_t uniffi_zeron_mobile_fn_method_coreclient_github_connect_poll(uint64_t ptr, RustBuffer flow_id +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_GITHUB_CONNECT_START +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_GITHUB_CONNECT_START +uint64_t uniffi_zeron_mobile_fn_method_coreclient_github_connect_start(uint64_t ptr +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_GITHUB_REPOS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_GITHUB_REPOS +uint64_t uniffi_zeron_mobile_fn_method_coreclient_github_repos(uint64_t ptr, RustBuffer query +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_PROVIDER_LOGIN_CANCEL +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_PROVIDER_LOGIN_CANCEL +void uniffi_zeron_mobile_fn_method_coreclient_provider_login_cancel(uint64_t ptr, RustBuffer login_id, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_PROVIDER_LOGIN_FINISH +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_PROVIDER_LOGIN_FINISH +uint64_t uniffi_zeron_mobile_fn_method_coreclient_provider_login_finish(uint64_t ptr, RustBuffer login_id +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_PROVIDER_LOGIN_START +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_PROVIDER_LOGIN_START +uint64_t uniffi_zeron_mobile_fn_method_coreclient_provider_login_start(uint64_t ptr, RustBuffer provider, RustBuffer done_url +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_VAULT_ACCOUNTS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_VAULT_ACCOUNTS +uint64_t uniffi_zeron_mobile_fn_method_coreclient_vault_accounts(uint64_t ptr, RustBuffer provider +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_VAULT_ACTIVATE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_VAULT_ACTIVATE +uint64_t uniffi_zeron_mobile_fn_method_coreclient_vault_activate(uint64_t ptr, RustBuffer provider, RustBuffer slot +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_VAULT_FORGET +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_VAULT_FORGET +uint64_t uniffi_zeron_mobile_fn_method_coreclient_vault_forget(uint64_t ptr, RustBuffer provider, RustBuffer slot +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_VAULT_PUT_API_KEY +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_VAULT_PUT_API_KEY +uint64_t uniffi_zeron_mobile_fn_method_coreclient_vault_put_api_key(uint64_t ptr, RustBuffer provider, RustBuffer key +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_VAULT_STATUS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_VAULT_STATUS +uint64_t uniffi_zeron_mobile_fn_method_coreclient_vault_status(uint64_t ptr +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_VAULT_USAGE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_VAULT_USAGE +uint64_t uniffi_zeron_mobile_fn_method_coreclient_vault_usage(uint64_t ptr, RustBuffer provider, RustBuffer slot +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_CREATE_SIDE_CHAT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_CREATE_SIDE_CHAT +RustBuffer uniffi_zeron_mobile_fn_method_coreclient_create_side_chat(uint64_t ptr, RustBuffer parent_id, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_FORK_SIDE_CHAT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_FORK_SIDE_CHAT +uint64_t uniffi_zeron_mobile_fn_method_coreclient_fork_side_chat(uint64_t ptr, RustBuffer source_id +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_DEVICE_ACTIVATE_ACCOUNT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_DEVICE_ACTIVATE_ACCOUNT +uint64_t uniffi_zeron_mobile_fn_method_coreclient_device_activate_account(uint64_t ptr, RustBuffer device_id, RustBuffer harness, RustBuffer account_id +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_DEVICE_AGENT_ACCOUNTS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_DEVICE_AGENT_ACCOUNTS +uint64_t uniffi_zeron_mobile_fn_method_coreclient_device_agent_accounts(uint64_t ptr, RustBuffer device_id +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_DEVICE_FORGET_ACCOUNT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_DEVICE_FORGET_ACCOUNT +uint64_t uniffi_zeron_mobile_fn_method_coreclient_device_forget_account(uint64_t ptr, RustBuffer device_id, RustBuffer harness, RustBuffer account_id +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_DEVICE_LOGIN_CANCEL +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_DEVICE_LOGIN_CANCEL +void uniffi_zeron_mobile_fn_method_coreclient_device_login_cancel(uint64_t ptr, RustBuffer device_id, RustBuffer login_id, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_DEVICE_LOGIN_COMPLETE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_DEVICE_LOGIN_COMPLETE +uint64_t uniffi_zeron_mobile_fn_method_coreclient_device_login_complete(uint64_t ptr, RustBuffer device_id, RustBuffer login_id, RustBuffer code +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_DEVICE_LOGIN_POLL +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_DEVICE_LOGIN_POLL +uint64_t uniffi_zeron_mobile_fn_method_coreclient_device_login_poll(uint64_t ptr, RustBuffer device_id, RustBuffer login_id, RustBuffer done_url +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_DEVICE_LOGIN_START +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_DEVICE_LOGIN_START +uint64_t uniffi_zeron_mobile_fn_method_coreclient_device_login_start(uint64_t ptr, RustBuffer device_id, RustBuffer harness, RustBuffer provider, RustBuffer done_url +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_SET_HARNESS_ENABLED +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_SET_HARNESS_ENABLED +uint64_t uniffi_zeron_mobile_fn_method_coreclient_set_harness_enabled(uint64_t ptr, RustBuffer device_id, RustBuffer harness, int8_t enabled +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_START_VOICE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_START_VOICE +uint64_t uniffi_zeron_mobile_fn_method_coreclient_start_voice(uint64_t ptr, RustBuffer host_device_id, RustBuffer voice, uint64_t media, uint64_t listener, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_ATTACH_TERMINAL +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_ATTACH_TERMINAL +uint64_t uniffi_zeron_mobile_fn_method_coreclient_attach_terminal(uint64_t ptr, RustBuffer terminal, uint16_t cols, uint16_t rows, uint64_t listener, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_OPEN_TERMINAL +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_CORECLIENT_OPEN_TERMINAL +uint64_t uniffi_zeron_mobile_fn_method_coreclient_open_terminal(uint64_t ptr, RustBuffer chat_id, uint16_t cols, uint16_t rows, uint64_t listener +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CLONE_UPLOADPROGRESS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CLONE_UPLOADPROGRESS +uint64_t uniffi_zeron_mobile_fn_clone_uploadprogress(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FREE_UPLOADPROGRESS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FREE_UPLOADPROGRESS +void uniffi_zeron_mobile_fn_free_uploadprogress(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_INIT_CALLBACK_VTABLE_UPLOADPROGRESS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_INIT_CALLBACK_VTABLE_UPLOADPROGRESS +void uniffi_zeron_mobile_fn_init_callback_vtable_uploadprogress(const UniffiVTableCallbackInterfaceUploadProgress* _Nonnull vtable +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_UPLOADPROGRESS_ON_PROGRESS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_UPLOADPROGRESS_ON_PROGRESS +void uniffi_zeron_mobile_fn_method_uploadprogress_on_progress(uint64_t ptr, double fraction, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CLONE_SESSIONHANDLE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CLONE_SESSIONHANDLE +uint64_t uniffi_zeron_mobile_fn_clone_sessionhandle(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FREE_SESSIONHANDLE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FREE_SESSIONHANDLE +void uniffi_zeron_mobile_fn_free_sessionhandle(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_SUBAGENTS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_SUBAGENTS +RustBuffer uniffi_zeron_mobile_fn_method_sessionhandle_subagents(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_BEGIN_QUEUED_EDIT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_BEGIN_QUEUED_EDIT +uint64_t uniffi_zeron_mobile_fn_method_sessionhandle_begin_queued_edit(uint64_t ptr, RustBuffer id, RustBuffer instance_id +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_CHAT_ID +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_CHAT_ID +RustBuffer uniffi_zeron_mobile_fn_method_sessionhandle_chat_id(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_CLEAR_QUEUE_ERROR +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_CLEAR_QUEUE_ERROR +void uniffi_zeron_mobile_fn_method_sessionhandle_clear_queue_error(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_COMPOSER +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_COMPOSER +RustBuffer uniffi_zeron_mobile_fn_method_sessionhandle_composer(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_DELIVER_QUEUED_NOW +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_DELIVER_QUEUED_NOW +uint64_t uniffi_zeron_mobile_fn_method_sessionhandle_deliver_queued_now(uint64_t ptr, RustBuffer id +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_ENQUEUE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_ENQUEUE +RustBuffer uniffi_zeron_mobile_fn_method_sessionhandle_enqueue(uint64_t ptr, RustBuffer text, RustBuffer attachments, int8_t hold_for_turn_end, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_FINISH_QUEUED_EDIT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_FINISH_QUEUED_EDIT +uint64_t uniffi_zeron_mobile_fn_method_sessionhandle_finish_queued_edit(uint64_t ptr, RustBuffer lease, RustBuffer action, RustBuffer text +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_INTERRUPT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_INTERRUPT +void uniffi_zeron_mobile_fn_method_sessionhandle_interrupt(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_MARK_SEEN +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_MARK_SEEN +void uniffi_zeron_mobile_fn_method_sessionhandle_mark_seen(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_MESSAGE_TEXT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_MESSAGE_TEXT +RustBuffer uniffi_zeron_mobile_fn_method_sessionhandle_message_text(uint64_t ptr, RustBuffer entry_id, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_MOVE_QUEUED +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_MOVE_QUEUED +int8_t uniffi_zeron_mobile_fn_method_sessionhandle_move_queued(uint64_t ptr, RustBuffer id, uint32_t to, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_MOVE_QUEUED_BY +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_MOVE_QUEUED_BY +int8_t uniffi_zeron_mobile_fn_method_sessionhandle_move_queued_by(uint64_t ptr, RustBuffer id, int32_t delta, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_REMOVE_QUEUED +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_REMOVE_QUEUED +uint64_t uniffi_zeron_mobile_fn_method_sessionhandle_remove_queued(uint64_t ptr, RustBuffer id +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_RENEW_QUEUED_EDIT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_RENEW_QUEUED_EDIT +uint64_t uniffi_zeron_mobile_fn_method_sessionhandle_renew_queued_edit(uint64_t ptr, RustBuffer lease +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_RESPOND_INPUT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_RESPOND_INPUT +void uniffi_zeron_mobile_fn_method_sessionhandle_respond_input(uint64_t ptr, RustBuffer request_id, RustBuffer answers, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_RETRY_DELIVERY +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_RETRY_DELIVERY +void uniffi_zeron_mobile_fn_method_sessionhandle_retry_delivery(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_SEND +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_SEND +RustBuffer uniffi_zeron_mobile_fn_method_sessionhandle_send(uint64_t ptr, RustBuffer request, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_SEND_QUEUED_NOW +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_SEND_QUEUED_NOW +uint64_t uniffi_zeron_mobile_fn_method_sessionhandle_send_queued_now(uint64_t ptr, RustBuffer id +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_SET_VIEW_ATTACHED +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_SET_VIEW_ATTACHED +void uniffi_zeron_mobile_fn_method_sessionhandle_set_view_attached(uint64_t ptr, int8_t attached, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_TRANSCRIPT_STATUS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_SESSIONHANDLE_TRANSCRIPT_STATUS +RustBuffer uniffi_zeron_mobile_fn_method_sessionhandle_transcript_status(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CLONE_VOICECALL +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CLONE_VOICECALL +uint64_t uniffi_zeron_mobile_fn_clone_voicecall(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FREE_VOICECALL +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FREE_VOICECALL +void uniffi_zeron_mobile_fn_free_voicecall(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_VOICECALL_COMPLETE_MEDIA +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_VOICECALL_COMPLETE_MEDIA +void uniffi_zeron_mobile_fn_method_voicecall_complete_media(uint64_t ptr, uint64_t request_id, RustBuffer failure, RustBuffer sdp, uint16_t microphone, uint16_t speaker, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_VOICECALL_SET_MUTED +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_VOICECALL_SET_MUTED +void uniffi_zeron_mobile_fn_method_voicecall_set_muted(uint64_t ptr, int8_t muted, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_VOICECALL_STOP +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_VOICECALL_STOP +void uniffi_zeron_mobile_fn_method_voicecall_stop(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CLONE_VOICEMEDIALISTENER +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CLONE_VOICEMEDIALISTENER +uint64_t uniffi_zeron_mobile_fn_clone_voicemedialistener(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FREE_VOICEMEDIALISTENER +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FREE_VOICEMEDIALISTENER +void uniffi_zeron_mobile_fn_free_voicemedialistener(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_INIT_CALLBACK_VTABLE_VOICEMEDIALISTENER +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_INIT_CALLBACK_VTABLE_VOICEMEDIALISTENER +void uniffi_zeron_mobile_fn_init_callback_vtable_voicemedialistener(const UniffiVTableCallbackInterfaceVoiceMediaListener* _Nonnull vtable +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_VOICEMEDIALISTENER_ON_REQUEST +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_VOICEMEDIALISTENER_ON_REQUEST +void uniffi_zeron_mobile_fn_method_voicemedialistener_on_request(uint64_t ptr, RustBuffer request, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CLONE_VOICESESSIONLISTENER +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CLONE_VOICESESSIONLISTENER +uint64_t uniffi_zeron_mobile_fn_clone_voicesessionlistener(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FREE_VOICESESSIONLISTENER +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FREE_VOICESESSIONLISTENER +void uniffi_zeron_mobile_fn_free_voicesessionlistener(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_INIT_CALLBACK_VTABLE_VOICESESSIONLISTENER +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_INIT_CALLBACK_VTABLE_VOICESESSIONLISTENER +void uniffi_zeron_mobile_fn_init_callback_vtable_voicesessionlistener(const UniffiVTableCallbackInterfaceVoiceSessionListener* _Nonnull vtable +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_VOICESESSIONLISTENER_ON_VOICE_STATE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_VOICESESSIONLISTENER_ON_VOICE_STATE +void uniffi_zeron_mobile_fn_method_voicesessionlistener_on_voice_state(uint64_t ptr, RustBuffer state, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_VOICESESSIONLISTENER_ON_VOICE_CLOSED +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_VOICESESSIONLISTENER_ON_VOICE_CLOSED +void uniffi_zeron_mobile_fn_method_voicesessionlistener_on_voice_closed(uint64_t ptr, RustBuffer reason, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CLONE_LAYOUTFRAME +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CLONE_LAYOUTFRAME +uint64_t uniffi_zeron_mobile_fn_clone_layoutframe(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FREE_LAYOUTFRAME +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FREE_LAYOUTFRAME +void uniffi_zeron_mobile_fn_free_layoutframe(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_LAYOUTFRAME_BUILD_MICROS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_LAYOUTFRAME_BUILD_MICROS +uint64_t uniffi_zeron_mobile_fn_method_layoutframe_build_micros(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_LAYOUTFRAME_DISPLAY +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_LAYOUTFRAME_DISPLAY +RustBuffer uniffi_zeron_mobile_fn_method_layoutframe_display(uint64_t ptr, uint32_t index, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_LAYOUTFRAME_INDEX_AT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_LAYOUTFRAME_INDEX_AT +RustBuffer uniffi_zeron_mobile_fn_method_layoutframe_index_at(uint64_t ptr, float y, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_LAYOUTFRAME_INDEX_OF +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_LAYOUTFRAME_INDEX_OF +RustBuffer uniffi_zeron_mobile_fn_method_layoutframe_index_of(uint64_t ptr, uint64_t key, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_LAYOUTFRAME_MESSAGE_TEXT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_LAYOUTFRAME_MESSAGE_TEXT +RustBuffer uniffi_zeron_mobile_fn_method_layoutframe_message_text(uint64_t ptr, uint32_t index, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_LAYOUTFRAME_PLACEMENT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_LAYOUTFRAME_PLACEMENT +RustBuffer uniffi_zeron_mobile_fn_method_layoutframe_placement(uint64_t ptr, uint32_t index, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_LAYOUTFRAME_PLAIN_TEXT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_LAYOUTFRAME_PLAIN_TEXT +RustBuffer uniffi_zeron_mobile_fn_method_layoutframe_plain_text(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_LAYOUTFRAME_PREPARED_HEAP_BYTES +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_LAYOUTFRAME_PREPARED_HEAP_BYTES +uint64_t uniffi_zeron_mobile_fn_method_layoutframe_prepared_heap_bytes(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_LAYOUTFRAME_REVISION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_LAYOUTFRAME_REVISION +uint64_t uniffi_zeron_mobile_fn_method_layoutframe_revision(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_LAYOUTFRAME_ROW_COUNT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_LAYOUTFRAME_ROW_COUNT +uint32_t uniffi_zeron_mobile_fn_method_layoutframe_row_count(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_LAYOUTFRAME_ROWS_IN +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_LAYOUTFRAME_ROWS_IN +RustBuffer uniffi_zeron_mobile_fn_method_layoutframe_rows_in(uint64_t ptr, float y0, float y1, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_LAYOUTFRAME_STYLE_COUNT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_LAYOUTFRAME_STYLE_COUNT +uint32_t uniffi_zeron_mobile_fn_method_layoutframe_style_count(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_LAYOUTFRAME_STYLES +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_LAYOUTFRAME_STYLES +RustBuffer uniffi_zeron_mobile_fn_method_layoutframe_styles(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_LAYOUTFRAME_TOTAL_HEIGHT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_LAYOUTFRAME_TOTAL_HEIGHT +float uniffi_zeron_mobile_fn_method_layoutframe_total_height(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_LAYOUTFRAME_WIDTH +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_LAYOUTFRAME_WIDTH +float uniffi_zeron_mobile_fn_method_layoutframe_width(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CLONE_LAYOUTLISTENER +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CLONE_LAYOUTLISTENER +uint64_t uniffi_zeron_mobile_fn_clone_layoutlistener(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FREE_LAYOUTLISTENER +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FREE_LAYOUTLISTENER +void uniffi_zeron_mobile_fn_free_layoutlistener(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_INIT_CALLBACK_VTABLE_LAYOUTLISTENER +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_INIT_CALLBACK_VTABLE_LAYOUTLISTENER +void uniffi_zeron_mobile_fn_init_callback_vtable_layoutlistener(const UniffiVTableCallbackInterfaceLayoutListener* _Nonnull vtable +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_LAYOUTLISTENER_FRAME_READY +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_LAYOUTLISTENER_FRAME_READY +void uniffi_zeron_mobile_fn_method_layoutlistener_frame_ready(uint64_t ptr, uint64_t revision, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CLONE_PLATFORMMEASURER +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CLONE_PLATFORMMEASURER +uint64_t uniffi_zeron_mobile_fn_clone_platformmeasurer(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FREE_PLATFORMMEASURER +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FREE_PLATFORMMEASURER +void uniffi_zeron_mobile_fn_free_platformmeasurer(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_INIT_CALLBACK_VTABLE_PLATFORMMEASURER +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_INIT_CALLBACK_VTABLE_PLATFORMMEASURER +void uniffi_zeron_mobile_fn_init_callback_vtable_platformmeasurer(const UniffiVTableCallbackInterfacePlatformMeasurer* _Nonnull vtable +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_PLATFORMMEASURER_MEASURE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_PLATFORMMEASURER_MEASURE +float uniffi_zeron_mobile_fn_method_platformmeasurer_measure(uint64_t ptr, RustBuffer face, float size, int8_t ligatures, RustBuffer text, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_PLATFORMMEASURER_MEASURE_RUN +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_PLATFORMMEASURER_MEASURE_RUN +RustBuffer uniffi_zeron_mobile_fn_method_platformmeasurer_measure_run(uint64_t ptr, RustBuffer face, float size, int8_t ligatures, RustBuffer text, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CLONE_TEXTSYSTEM +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CLONE_TEXTSYSTEM +uint64_t uniffi_zeron_mobile_fn_clone_textsystem(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FREE_TEXTSYSTEM +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FREE_TEXTSYSTEM +void uniffi_zeron_mobile_fn_free_textsystem(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CONSTRUCTOR_TEXTSYSTEM_NEW +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CONSTRUCTOR_TEXTSYSTEM_NEW +uint64_t uniffi_zeron_mobile_fn_constructor_textsystem_new(RustBuffer faces, RustBuffer measurer, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CLONE_TRANSCRIPTVIEW +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CLONE_TRANSCRIPTVIEW +uint64_t uniffi_zeron_mobile_fn_clone_transcriptview(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FREE_TRANSCRIPTVIEW +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FREE_TRANSCRIPTVIEW +void uniffi_zeron_mobile_fn_free_transcriptview(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CONSTRUCTOR_TRANSCRIPTVIEW_NEW +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CONSTRUCTOR_TRANSCRIPTVIEW_NEW +uint64_t uniffi_zeron_mobile_fn_constructor_transcriptview_new(uint64_t text, uint64_t listener, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TRANSCRIPTVIEW_ATTACH +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TRANSCRIPTVIEW_ATTACH +int8_t uniffi_zeron_mobile_fn_method_transcriptview_attach(uint64_t ptr, uint64_t client, RustBuffer chat_id, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TRANSCRIPTVIEW_ATTACH_SUBAGENT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TRANSCRIPTVIEW_ATTACH_SUBAGENT +int8_t uniffi_zeron_mobile_fn_method_transcriptview_attach_subagent(uint64_t ptr, uint64_t client, RustBuffer chat_id, RustBuffer doc_id, int8_t frozen, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TRANSCRIPTVIEW_CLOSE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TRANSCRIPTVIEW_CLOSE +void uniffi_zeron_mobile_fn_method_transcriptview_close(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TRANSCRIPTVIEW_FRAME +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TRANSCRIPTVIEW_FRAME +uint64_t uniffi_zeron_mobile_fn_method_transcriptview_frame(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TRANSCRIPTVIEW_SET_DEBUG_ENTRIES +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TRANSCRIPTVIEW_SET_DEBUG_ENTRIES +void uniffi_zeron_mobile_fn_method_transcriptview_set_debug_entries(uint64_t ptr, RustBuffer entries, int8_t working, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TRANSCRIPTVIEW_SET_MATH +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TRANSCRIPTVIEW_SET_MATH +void uniffi_zeron_mobile_fn_method_transcriptview_set_math(uint64_t ptr, int8_t enabled, RustBuffer face, uint16_t size_percent, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TRANSCRIPTVIEW_SET_VIEWPORT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TRANSCRIPTVIEW_SET_VIEWPORT +void uniffi_zeron_mobile_fn_method_transcriptview_set_viewport(uint64_t ptr, float width, float text_scale, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TRANSCRIPTVIEW_SET_VISUAL_SOURCE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TRANSCRIPTVIEW_SET_VISUAL_SOURCE +void uniffi_zeron_mobile_fn_method_transcriptview_set_visual_source(uint64_t ptr, uint64_t client, RustBuffer device_id, float pixel_scale, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TRANSCRIPTVIEW_TOGGLE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TRANSCRIPTVIEW_TOGGLE +void uniffi_zeron_mobile_fn_method_transcriptview_toggle(uint64_t ptr, uint64_t key, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TRANSCRIPTVIEW_TOGGLE_DETAIL +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TRANSCRIPTVIEW_TOGGLE_DETAIL +void uniffi_zeron_mobile_fn_method_transcriptview_toggle_detail(uint64_t ptr, uint64_t row, uint64_t detail, int8_t open, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TRANSCRIPTVIEW_VISUAL +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TRANSCRIPTVIEW_VISUAL +RustBuffer uniffi_zeron_mobile_fn_method_transcriptview_visual(uint64_t ptr, RustBuffer id, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CLONE_ORBRENDERER +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CLONE_ORBRENDERER +uint64_t uniffi_zeron_mobile_fn_clone_orbrenderer(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FREE_ORBRENDERER +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FREE_ORBRENDERER +void uniffi_zeron_mobile_fn_free_orbrenderer(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CONSTRUCTOR_ORBRENDERER_NEW +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CONSTRUCTOR_ORBRENDERER_NEW +uint64_t uniffi_zeron_mobile_fn_constructor_orbrenderer_new(RustBuffer preset, RustBuffer orb, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_ORBRENDERER_NEXT_FRAME +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_ORBRENDERER_NEXT_FRAME +RustBuffer uniffi_zeron_mobile_fn_method_orbrenderer_next_frame(uint64_t ptr, int8_t animating, int8_t reduced_motion, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_ORBRENDERER_SET_AUDIO_LEVELS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_ORBRENDERER_SET_AUDIO_LEVELS +void uniffi_zeron_mobile_fn_method_orbrenderer_set_audio_levels(uint64_t ptr, float microphone, float speaker, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_ORBRENDERER_SET_ORB +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_ORBRENDERER_SET_ORB +void uniffi_zeron_mobile_fn_method_orbrenderer_set_orb(uint64_t ptr, RustBuffer orb, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CLONE_TERMINALLISTENER +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CLONE_TERMINALLISTENER +uint64_t uniffi_zeron_mobile_fn_clone_terminallistener(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FREE_TERMINALLISTENER +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FREE_TERMINALLISTENER +void uniffi_zeron_mobile_fn_free_terminallistener(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_INIT_CALLBACK_VTABLE_TERMINALLISTENER +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_INIT_CALLBACK_VTABLE_TERMINALLISTENER +void uniffi_zeron_mobile_fn_init_callback_vtable_terminallistener(const UniffiVTableCallbackInterfaceTerminalListener* _Nonnull vtable +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALLISTENER_CHANGED +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALLISTENER_CHANGED +void uniffi_zeron_mobile_fn_method_terminallistener_changed(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALLISTENER_BELL +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALLISTENER_BELL +void uniffi_zeron_mobile_fn_method_terminallistener_bell(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CLONE_TERMINALSESSION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CLONE_TERMINALSESSION +uint64_t uniffi_zeron_mobile_fn_clone_terminalsession(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FREE_TERMINALSESSION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FREE_TERMINALSESSION +void uniffi_zeron_mobile_fn_free_terminalsession(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_CLEAR_SELECTION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_CLEAR_SELECTION +void uniffi_zeron_mobile_fn_method_terminalsession_clear_selection(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_CLICK +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_CLICK +int8_t uniffi_zeron_mobile_fn_method_terminalsession_click(uint64_t ptr, uint16_t row, uint16_t col, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_CLOSE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_CLOSE +void uniffi_zeron_mobile_fn_method_terminalsession_close(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_DETACH +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_DETACH +void uniffi_zeron_mobile_fn_method_terminalsession_detach(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_EXTEND_SELECTION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_EXTEND_SELECTION +void uniffi_zeron_mobile_fn_method_terminalsession_extend_selection(uint64_t ptr, uint16_t row, uint16_t col, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_FRAME +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_FRAME +RustBuffer uniffi_zeron_mobile_fn_method_terminalsession_frame(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_INFO +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_INFO +RustBuffer uniffi_zeron_mobile_fn_method_terminalsession_info(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_IS_DIRECT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_IS_DIRECT +int8_t uniffi_zeron_mobile_fn_method_terminalsession_is_direct(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_PASTE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_PASTE +void uniffi_zeron_mobile_fn_method_terminalsession_paste(uint64_t ptr, RustBuffer text, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_PHASE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_PHASE +RustBuffer uniffi_zeron_mobile_fn_method_terminalsession_phase(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_PRESS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_PRESS +void uniffi_zeron_mobile_fn_method_terminalsession_press(uint64_t ptr, RustBuffer key, RustBuffer modifiers, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_RESIZE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_RESIZE +void uniffi_zeron_mobile_fn_method_terminalsession_resize(uint64_t ptr, uint16_t cols, uint16_t rows, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_REVISION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_REVISION +uint64_t uniffi_zeron_mobile_fn_method_terminalsession_revision(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_SCROLL_TO_POSITION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_SCROLL_TO_POSITION +void uniffi_zeron_mobile_fn_method_terminalsession_scroll_to_position(uint64_t ptr, float back, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_SELECT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_SELECT +void uniffi_zeron_mobile_fn_method_terminalsession_select(uint64_t ptr, uint16_t row, uint16_t col, int8_t word, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_SELECTION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_SELECTION +RustBuffer uniffi_zeron_mobile_fn_method_terminalsession_selection(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_SET_DARK +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_SET_DARK +void uniffi_zeron_mobile_fn_method_terminalsession_set_dark(uint64_t ptr, int8_t dark, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_SET_FOCUSED +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_SET_FOCUSED +void uniffi_zeron_mobile_fn_method_terminalsession_set_focused(uint64_t ptr, int8_t focused, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_TEXT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_TEXT +RustBuffer uniffi_zeron_mobile_fn_method_terminalsession_text(uint64_t ptr, int8_t all, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_TITLE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_TITLE +RustBuffer uniffi_zeron_mobile_fn_method_terminalsession_title(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_TYPE_TEXT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_TYPE_TEXT +void uniffi_zeron_mobile_fn_method_terminalsession_type_text(uint64_t ptr, RustBuffer text, RustBuffer modifiers, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_WHEEL +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_TERMINALSESSION_WHEEL +int8_t uniffi_zeron_mobile_fn_method_terminalsession_wheel(uint64_t ptr, float rows, uint16_t row, uint16_t col, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CLONE_VISUALLISTENER +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CLONE_VISUALLISTENER +uint64_t uniffi_zeron_mobile_fn_clone_visuallistener(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FREE_VISUALLISTENER +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FREE_VISUALLISTENER +void uniffi_zeron_mobile_fn_free_visuallistener(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_INIT_CALLBACK_VTABLE_VISUALLISTENER +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_INIT_CALLBACK_VTABLE_VISUALLISTENER +void uniffi_zeron_mobile_fn_init_callback_vtable_visuallistener(const UniffiVTableCallbackInterfaceVisualListener* _Nonnull vtable +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_VISUALLISTENER_DISPLAY +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_VISUALLISTENER_DISPLAY +void uniffi_zeron_mobile_fn_method_visuallistener_display(uint64_t ptr, RustBuffer display, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_VISUALLISTENER_FRAME +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_VISUALLISTENER_FRAME +void uniffi_zeron_mobile_fn_method_visuallistener_frame(uint64_t ptr, RustBuffer frame, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CLONE_VISUALSESSION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_CLONE_VISUALSESSION +uint64_t uniffi_zeron_mobile_fn_clone_visualsession(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FREE_VISUALSESSION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FREE_VISUALSESSION +void uniffi_zeron_mobile_fn_free_visualsession(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_VISUALSESSION_ACTIVATE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_VISUALSESSION_ACTIVATE +void uniffi_zeron_mobile_fn_method_visualsession_activate(uint64_t ptr, uint64_t control, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_VISUALSESSION_ATTACH +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_VISUALSESSION_ATTACH +void uniffi_zeron_mobile_fn_method_visualsession_attach(uint64_t ptr, uint64_t listener, int8_t dark, int8_t reduce_motion, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_VISUALSESSION_DETACH +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_VISUALSESSION_DETACH +void uniffi_zeron_mobile_fn_method_visualsession_detach(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_VISUALSESSION_POINTER +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_VISUALSESSION_POINTER +void uniffi_zeron_mobile_fn_method_visualsession_pointer(uint64_t ptr, uint64_t surface, RustBuffer phase, float x, float y, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_VISUALSESSION_SET_APPEARANCE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_VISUALSESSION_SET_APPEARANCE +void uniffi_zeron_mobile_fn_method_visualsession_set_appearance(uint64_t ptr, int8_t dark, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_VISUALSESSION_SLIDE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_VISUALSESSION_SLIDE +void uniffi_zeron_mobile_fn_method_visualsession_slide(uint64_t ptr, uint64_t control, float fraction, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_VISUALSESSION_TITLE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_METHOD_VISUALSESSION_TITLE +RustBuffer uniffi_zeron_mobile_fn_method_visualsession_title(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_CORE_VERSION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_CORE_VERSION +RustBuffer uniffi_zeron_mobile_fn_func_core_version(RustCallStatus *_Nonnull out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_AUTH_CALLBACK_SCHEME +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_AUTH_CALLBACK_SCHEME +RustBuffer uniffi_zeron_mobile_fn_func_auth_callback_scheme(RustCallStatus *_Nonnull out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_AUTH_EXCHANGE_CODE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_AUTH_EXCHANGE_CODE +uint64_t uniffi_zeron_mobile_fn_func_auth_exchange_code(RustBuffer edge_url, RustBuffer code +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_AUTH_LIST_ORGS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_AUTH_LIST_ORGS +uint64_t uniffi_zeron_mobile_fn_func_auth_list_orgs(RustBuffer edge_url, RustBuffer access_token +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_AUTH_PRODUCTION_EDGE_URL +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_AUTH_PRODUCTION_EDGE_URL +RustBuffer uniffi_zeron_mobile_fn_func_auth_production_edge_url(RustCallStatus *_Nonnull out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_AUTH_REFRESH +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_AUTH_REFRESH +uint64_t uniffi_zeron_mobile_fn_func_auth_refresh(RustBuffer edge_url, RustBuffer refresh_token, RustBuffer organization_id +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_FALLBACK_HARNESSES +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_FALLBACK_HARNESSES +RustBuffer uniffi_zeron_mobile_fn_func_fallback_harnesses(RustCallStatus *_Nonnull out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_FALLBACK_MODELS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_FALLBACK_MODELS +RustBuffer uniffi_zeron_mobile_fn_func_fallback_models(RustBuffer harness, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_HARNESS_LABEL +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_HARNESS_LABEL +RustBuffer uniffi_zeron_mobile_fn_func_harness_label(RustBuffer harness, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_JWT_EXPIRY +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_JWT_EXPIRY +RustBuffer uniffi_zeron_mobile_fn_func_jwt_expiry(RustBuffer jwt, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_MAX_ATTACHMENT_BYTES +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_MAX_ATTACHMENT_BYTES +uint64_t uniffi_zeron_mobile_fn_func_max_attachment_bytes(RustCallStatus *_Nonnull out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_MODEL_LABEL +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_MODEL_LABEL +RustBuffer uniffi_zeron_mobile_fn_func_model_label(RustBuffer harness, RustBuffer model, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_PARSE_AUTH_CALLBACK +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_PARSE_AUTH_CALLBACK +RustBuffer uniffi_zeron_mobile_fn_func_parse_auth_callback(RustBuffer url, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_PARSE_USER_MESSAGE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_PARSE_USER_MESSAGE +RustBuffer uniffi_zeron_mobile_fn_func_parse_user_message(RustBuffer content, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_PROJECT_COLOR_COUNT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_PROJECT_COLOR_COUNT +uint32_t uniffi_zeron_mobile_fn_func_project_color_count(RustCallStatus *_Nonnull out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_PROJECT_COLOR_INDEX +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_PROJECT_COLOR_INDEX +uint32_t uniffi_zeron_mobile_fn_func_project_color_index(RustBuffer space_path, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_REASONING_LABEL +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_REASONING_LABEL +RustBuffer uniffi_zeron_mobile_fn_func_reasoning_label(RustBuffer level, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_RELATIVE_TIME_LABEL +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_RELATIVE_TIME_LABEL +RustBuffer uniffi_zeron_mobile_fn_func_relative_time_label(int64_t at_ms, int64_t now_ms, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_WORKOS_AUTHORIZE_URL +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_WORKOS_AUTHORIZE_URL +RustBuffer uniffi_zeron_mobile_fn_func_workos_authorize_url(RustBuffer state, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_AGENT_LOGIN_RULES +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_AGENT_LOGIN_RULES +RustBuffer uniffi_zeron_mobile_fn_func_agent_login_rules(RustBuffer harness, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_FILE_MENTION_LINK +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_FILE_MENTION_LINK +RustBuffer uniffi_zeron_mobile_fn_func_file_mention_link(RustBuffer path, int8_t is_dir, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_DEFAULT_VOICE_STYLES +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_DEFAULT_VOICE_STYLES +RustBuffer uniffi_zeron_mobile_fn_func_default_voice_styles(RustCallStatus *_Nonnull out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_VOICE_HOST_CAPABILITY +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_VOICE_HOST_CAPABILITY +RustBuffer uniffi_zeron_mobile_fn_func_voice_host_capability(RustCallStatus *_Nonnull out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_DEBUG_LINE_STARTS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_DEBUG_LINE_STARTS +RustBuffer uniffi_zeron_mobile_fn_func_debug_line_starts(uint64_t text_system, RustBuffer face, float size, float width, RustBuffer text, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_LAYOUT_FIXTURE_MARKDOWN +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_LAYOUT_FIXTURE_MARKDOWN +RustBuffer uniffi_zeron_mobile_fn_func_layout_fixture_markdown(RustCallStatus *_Nonnull out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_MATH_FONT_DATA +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_MATH_FONT_DATA +RustBuffer uniffi_zeron_mobile_fn_func_math_font_data(uint8_t index, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_WALLPAPER_RENDER +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_WALLPAPER_RENDER +RustBuffer uniffi_zeron_mobile_fn_func_wallpaper_render(RustBuffer rgba, uint32_t width, uint32_t height, RustBuffer effect, int8_t light, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_WALLPAPER_SAFE_OPACITY +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_FN_FUNC_WALLPAPER_SAFE_OPACITY +float uniffi_zeron_mobile_fn_func_wallpaper_safe_opacity(RustBuffer rgba, uint32_t width, uint32_t height, uint32_t text_rgb, uint32_t background_rgb, float region, float min_contrast, float max_opacity, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUSTBUFFER_ALLOC +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUSTBUFFER_ALLOC +RustBuffer ffi_zeron_mobile_rustbuffer_alloc(uint64_t size, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUSTBUFFER_FROM_BYTES +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUSTBUFFER_FROM_BYTES +RustBuffer ffi_zeron_mobile_rustbuffer_from_bytes(ForeignBytes bytes, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUSTBUFFER_FREE +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUSTBUFFER_FREE +void ffi_zeron_mobile_rustbuffer_free(RustBuffer buf, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUSTBUFFER_RESERVE +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUSTBUFFER_RESERVE +RustBuffer ffi_zeron_mobile_rustbuffer_reserve(RustBuffer buf, uint64_t additional, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_POLL_U8 +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_POLL_U8 +void ffi_zeron_mobile_rust_future_poll_u8(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_CANCEL_U8 +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_CANCEL_U8 +void ffi_zeron_mobile_rust_future_cancel_u8(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_FREE_U8 +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_FREE_U8 +void ffi_zeron_mobile_rust_future_free_u8(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_COMPLETE_U8 +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_COMPLETE_U8 +uint8_t ffi_zeron_mobile_rust_future_complete_u8(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_POLL_I8 +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_POLL_I8 +void ffi_zeron_mobile_rust_future_poll_i8(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_CANCEL_I8 +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_CANCEL_I8 +void ffi_zeron_mobile_rust_future_cancel_i8(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_FREE_I8 +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_FREE_I8 +void ffi_zeron_mobile_rust_future_free_i8(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_COMPLETE_I8 +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_COMPLETE_I8 +int8_t ffi_zeron_mobile_rust_future_complete_i8(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_POLL_U16 +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_POLL_U16 +void ffi_zeron_mobile_rust_future_poll_u16(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_CANCEL_U16 +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_CANCEL_U16 +void ffi_zeron_mobile_rust_future_cancel_u16(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_FREE_U16 +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_FREE_U16 +void ffi_zeron_mobile_rust_future_free_u16(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_COMPLETE_U16 +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_COMPLETE_U16 +uint16_t ffi_zeron_mobile_rust_future_complete_u16(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_POLL_I16 +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_POLL_I16 +void ffi_zeron_mobile_rust_future_poll_i16(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_CANCEL_I16 +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_CANCEL_I16 +void ffi_zeron_mobile_rust_future_cancel_i16(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_FREE_I16 +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_FREE_I16 +void ffi_zeron_mobile_rust_future_free_i16(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_COMPLETE_I16 +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_COMPLETE_I16 +int16_t ffi_zeron_mobile_rust_future_complete_i16(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_POLL_U32 +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_POLL_U32 +void ffi_zeron_mobile_rust_future_poll_u32(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_CANCEL_U32 +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_CANCEL_U32 +void ffi_zeron_mobile_rust_future_cancel_u32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_FREE_U32 +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_FREE_U32 +void ffi_zeron_mobile_rust_future_free_u32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_COMPLETE_U32 +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_COMPLETE_U32 +uint32_t ffi_zeron_mobile_rust_future_complete_u32(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_POLL_I32 +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_POLL_I32 +void ffi_zeron_mobile_rust_future_poll_i32(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_CANCEL_I32 +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_CANCEL_I32 +void ffi_zeron_mobile_rust_future_cancel_i32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_FREE_I32 +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_FREE_I32 +void ffi_zeron_mobile_rust_future_free_i32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_COMPLETE_I32 +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_COMPLETE_I32 +int32_t ffi_zeron_mobile_rust_future_complete_i32(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_POLL_U64 +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_POLL_U64 +void ffi_zeron_mobile_rust_future_poll_u64(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_CANCEL_U64 +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_CANCEL_U64 +void ffi_zeron_mobile_rust_future_cancel_u64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_FREE_U64 +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_FREE_U64 +void ffi_zeron_mobile_rust_future_free_u64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_COMPLETE_U64 +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_COMPLETE_U64 +uint64_t ffi_zeron_mobile_rust_future_complete_u64(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_POLL_I64 +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_POLL_I64 +void ffi_zeron_mobile_rust_future_poll_i64(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_CANCEL_I64 +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_CANCEL_I64 +void ffi_zeron_mobile_rust_future_cancel_i64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_FREE_I64 +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_FREE_I64 +void ffi_zeron_mobile_rust_future_free_i64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_COMPLETE_I64 +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_COMPLETE_I64 +int64_t ffi_zeron_mobile_rust_future_complete_i64(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_POLL_F32 +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_POLL_F32 +void ffi_zeron_mobile_rust_future_poll_f32(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_CANCEL_F32 +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_CANCEL_F32 +void ffi_zeron_mobile_rust_future_cancel_f32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_FREE_F32 +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_FREE_F32 +void ffi_zeron_mobile_rust_future_free_f32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_COMPLETE_F32 +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_COMPLETE_F32 +float ffi_zeron_mobile_rust_future_complete_f32(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_POLL_F64 +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_POLL_F64 +void ffi_zeron_mobile_rust_future_poll_f64(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_CANCEL_F64 +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_CANCEL_F64 +void ffi_zeron_mobile_rust_future_cancel_f64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_FREE_F64 +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_FREE_F64 +void ffi_zeron_mobile_rust_future_free_f64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_COMPLETE_F64 +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_COMPLETE_F64 +double ffi_zeron_mobile_rust_future_complete_f64(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_POLL_RUST_BUFFER +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_POLL_RUST_BUFFER +void ffi_zeron_mobile_rust_future_poll_rust_buffer(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_CANCEL_RUST_BUFFER +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_CANCEL_RUST_BUFFER +void ffi_zeron_mobile_rust_future_cancel_rust_buffer(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_FREE_RUST_BUFFER +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_FREE_RUST_BUFFER +void ffi_zeron_mobile_rust_future_free_rust_buffer(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_COMPLETE_RUST_BUFFER +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_COMPLETE_RUST_BUFFER +RustBuffer ffi_zeron_mobile_rust_future_complete_rust_buffer(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_POLL_VOID +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_POLL_VOID +void ffi_zeron_mobile_rust_future_poll_void(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_CANCEL_VOID +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_CANCEL_VOID +void ffi_zeron_mobile_rust_future_cancel_void(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_FREE_VOID +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_FREE_VOID +void ffi_zeron_mobile_rust_future_free_void(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_COMPLETE_VOID +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_RUST_FUTURE_COMPLETE_VOID +void ffi_zeron_mobile_rust_future_complete_void(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_CORE_VERSION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_CORE_VERSION +uint16_t uniffi_zeron_mobile_checksum_func_core_version(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_AUTH_CALLBACK_SCHEME +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_AUTH_CALLBACK_SCHEME +uint16_t uniffi_zeron_mobile_checksum_func_auth_callback_scheme(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_AUTH_EXCHANGE_CODE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_AUTH_EXCHANGE_CODE +uint16_t uniffi_zeron_mobile_checksum_func_auth_exchange_code(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_AUTH_LIST_ORGS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_AUTH_LIST_ORGS +uint16_t uniffi_zeron_mobile_checksum_func_auth_list_orgs(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_AUTH_PRODUCTION_EDGE_URL +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_AUTH_PRODUCTION_EDGE_URL +uint16_t uniffi_zeron_mobile_checksum_func_auth_production_edge_url(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_AUTH_REFRESH +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_AUTH_REFRESH +uint16_t uniffi_zeron_mobile_checksum_func_auth_refresh(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_FALLBACK_HARNESSES +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_FALLBACK_HARNESSES +uint16_t uniffi_zeron_mobile_checksum_func_fallback_harnesses(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_FALLBACK_MODELS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_FALLBACK_MODELS +uint16_t uniffi_zeron_mobile_checksum_func_fallback_models(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_HARNESS_LABEL +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_HARNESS_LABEL +uint16_t uniffi_zeron_mobile_checksum_func_harness_label(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_JWT_EXPIRY +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_JWT_EXPIRY +uint16_t uniffi_zeron_mobile_checksum_func_jwt_expiry(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_MAX_ATTACHMENT_BYTES +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_MAX_ATTACHMENT_BYTES +uint16_t uniffi_zeron_mobile_checksum_func_max_attachment_bytes(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_MODEL_LABEL +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_MODEL_LABEL +uint16_t uniffi_zeron_mobile_checksum_func_model_label(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_PARSE_AUTH_CALLBACK +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_PARSE_AUTH_CALLBACK +uint16_t uniffi_zeron_mobile_checksum_func_parse_auth_callback(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_PARSE_USER_MESSAGE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_PARSE_USER_MESSAGE +uint16_t uniffi_zeron_mobile_checksum_func_parse_user_message(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_PROJECT_COLOR_COUNT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_PROJECT_COLOR_COUNT +uint16_t uniffi_zeron_mobile_checksum_func_project_color_count(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_PROJECT_COLOR_INDEX +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_PROJECT_COLOR_INDEX +uint16_t uniffi_zeron_mobile_checksum_func_project_color_index(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_REASONING_LABEL +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_REASONING_LABEL +uint16_t uniffi_zeron_mobile_checksum_func_reasoning_label(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_RELATIVE_TIME_LABEL +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_RELATIVE_TIME_LABEL +uint16_t uniffi_zeron_mobile_checksum_func_relative_time_label(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_WORKOS_AUTHORIZE_URL +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_WORKOS_AUTHORIZE_URL +uint16_t uniffi_zeron_mobile_checksum_func_workos_authorize_url(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_AGENT_LOGIN_RULES +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_AGENT_LOGIN_RULES +uint16_t uniffi_zeron_mobile_checksum_func_agent_login_rules(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_FILE_MENTION_LINK +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_FILE_MENTION_LINK +uint16_t uniffi_zeron_mobile_checksum_func_file_mention_link(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_DEFAULT_VOICE_STYLES +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_DEFAULT_VOICE_STYLES +uint16_t uniffi_zeron_mobile_checksum_func_default_voice_styles(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_VOICE_HOST_CAPABILITY +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_VOICE_HOST_CAPABILITY +uint16_t uniffi_zeron_mobile_checksum_func_voice_host_capability(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_DEBUG_LINE_STARTS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_DEBUG_LINE_STARTS +uint16_t uniffi_zeron_mobile_checksum_func_debug_line_starts(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_LAYOUT_FIXTURE_MARKDOWN +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_LAYOUT_FIXTURE_MARKDOWN +uint16_t uniffi_zeron_mobile_checksum_func_layout_fixture_markdown(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_MATH_FONT_DATA +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_MATH_FONT_DATA +uint16_t uniffi_zeron_mobile_checksum_func_math_font_data(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_WALLPAPER_RENDER +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_WALLPAPER_RENDER +uint16_t uniffi_zeron_mobile_checksum_func_wallpaper_render(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_WALLPAPER_SAFE_OPACITY +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_FUNC_WALLPAPER_SAFE_OPACITY +uint16_t uniffi_zeron_mobile_checksum_func_wallpaper_safe_opacity(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CAPTIONFADER_FRAME +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CAPTIONFADER_FRAME +uint16_t uniffi_zeron_mobile_checksum_method_captionfader_frame(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CLIENTLISTENER_ON_EVENT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CLIENTLISTENER_ON_EVENT +uint16_t uniffi_zeron_mobile_checksum_method_clientlistener_on_event(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_ARCHIVE_SESSION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_ARCHIVE_SESSION +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_archive_session(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_ARCHIVED_SESSIONS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_ARCHIVED_SESSIONS +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_archived_sessions(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_ASSIGN_SECTION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_ASSIGN_SECTION +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_assign_section(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_CHILD_SESSIONS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_CHILD_SESSIONS +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_child_sessions(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_CLOSE_SESSION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_CLOSE_SESSION +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_close_session(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_CLOUD_MODELS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_CLOUD_MODELS +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_cloud_models(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_CONNECTIVITY +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_CONNECTIVITY +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_connectivity(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_CREATE_PROJECT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_CREATE_PROJECT +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_create_project(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_CREATE_SECTION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_CREATE_SECTION +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_create_section(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_CREATE_SESSION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_CREATE_SESSION +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_create_session(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_CREATE_WORKTREE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_CREATE_WORKTREE +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_create_worktree(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_DELETE_PROJECT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_DELETE_PROJECT +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_delete_project(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_DELETE_SECTION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_DELETE_SECTION +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_delete_section(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_DELETE_SESSION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_DELETE_SESSION +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_delete_session(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_DEVICE_ID +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_DEVICE_ID +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_device_id(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_DEVICES +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_DEVICES +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_devices(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_EXECUTION_DEVICES +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_EXECUTION_DEVICES +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_execution_devices(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_FRONT_PAGE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_FRONT_PAGE +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_front_page(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_IS_DEMO +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_IS_DEMO +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_is_demo(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_LIST_FOLDERS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_LIST_FOLDERS +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_list_folders(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_LIST_HARNESSES +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_LIST_HARNESSES +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_list_harnesses(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_LIST_MODELS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_LIST_MODELS +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_list_models(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_LIST_REFS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_LIST_REFS +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_list_refs(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_MARK_SEEN +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_MARK_SEEN +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_mark_seen(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_MOVE_PIN +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_MOVE_PIN +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_move_pin(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_NETWORK_PATH_CHANGED +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_NETWORK_PATH_CHANGED +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_network_path_changed(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_ON_BACKGROUND +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_ON_BACKGROUND +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_on_background(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_ON_FOREGROUND +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_ON_FOREGROUND +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_on_foreground(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_OPEN_SESSION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_OPEN_SESSION +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_open_session(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_ORG_ID +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_ORG_ID +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_org_id(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_PIN_SESSION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_PIN_SESSION +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_pin_session(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_PIN_SESSION_AT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_PIN_SESSION_AT +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_pin_session_at(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_PLACE_SESSION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_PLACE_SESSION +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_place_session(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_PRELOAD_SESSIONS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_PRELOAD_SESSIONS +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_preload_sessions(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_PROJECT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_PROJECT +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_project(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_PROJECTLESS_SESSIONS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_PROJECTLESS_SESSIONS +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_projectless_sessions(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_PROJECTS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_PROJECTS +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_projects(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_PULL_REQUESTS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_PULL_REQUESTS +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_pull_requests(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_READ_ATTACHMENT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_READ_ATTACHMENT +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_read_attachment(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_REGISTER_PUSH_TARGET +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_REGISTER_PUSH_TARGET +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_register_push_target(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_RENAME_PROJECT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_RENAME_PROJECT +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_rename_project(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_RENAME_SECTION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_RENAME_SECTION +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_rename_section(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_RENAME_SESSION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_RENAME_SESSION +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_rename_session(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_SEARCH +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_SEARCH +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_search(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_SEARCH_FILES +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_SEARCH_FILES +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_search_files(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_SESSION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_SESSION +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_session(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_SESSION_CONFIG +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_SESSION_CONFIG +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_session_config(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_SESSION_ROW +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_SESSION_ROW +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_session_row(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_SET_NETWORK_ONLINE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_SET_NETWORK_ONLINE +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_set_network_online(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_SET_SECTION_COLLAPSED +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_SET_SECTION_COLLAPSED +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_set_section_collapsed(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_SET_SESSION_CONFIG +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_SET_SESSION_CONFIG +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_set_session_config(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_SHUTDOWN +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_SHUTDOWN +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_shutdown(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_SWITCH_REF +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_SWITCH_REF +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_switch_ref(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_SWITCH_SESSION_REF +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_SWITCH_SESSION_REF +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_switch_session_ref(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_UNARCHIVE_SESSION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_UNARCHIVE_SESSION +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_unarchive_session(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_UNPIN_SESSION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_UNPIN_SESSION +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_unpin_session(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_UNREGISTER_PUSH_TARGET +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_UNREGISTER_PUSH_TARGET +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_unregister_push_target(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_UPDATE_TOKENS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_UPDATE_TOKENS +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_update_tokens(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_UPLOAD_ATTACHMENT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_UPLOAD_ATTACHMENT +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_upload_attachment(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_USER_ID +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_USER_ID +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_user_id(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_WARM_DIRECT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_WARM_DIRECT +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_warm_direct(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_WORKSPACE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_WORKSPACE +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_workspace(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_WORKSPACE_REVISION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_WORKSPACE_REVISION +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_workspace_revision(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_BILLING_CHECKOUT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_BILLING_CHECKOUT +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_billing_checkout(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_BILLING_PORTAL +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_BILLING_PORTAL +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_billing_portal(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_BILLING_STATUS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_BILLING_STATUS +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_billing_status(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_CLOUD_ENABLE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_CLOUD_ENABLE +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_cloud_enable(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_CLOUD_SESSION_ACTION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_CLOUD_SESSION_ACTION +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_cloud_session_action(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_CLOUD_SESSIONS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_CLOUD_SESSIONS +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_cloud_sessions(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_CLOUD_STATUS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_CLOUD_STATUS +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_cloud_status(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_CREATE_CLOUD_PROJECT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_CREATE_CLOUD_PROJECT +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_create_cloud_project(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_CREATE_CLOUD_SESSION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_CREATE_CLOUD_SESSION +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_create_cloud_session(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_GITHUB_BRANCHES +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_GITHUB_BRANCHES +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_github_branches(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_GITHUB_CONNECT_POLL +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_GITHUB_CONNECT_POLL +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_github_connect_poll(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_GITHUB_CONNECT_START +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_GITHUB_CONNECT_START +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_github_connect_start(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_GITHUB_REPOS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_GITHUB_REPOS +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_github_repos(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_PROVIDER_LOGIN_CANCEL +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_PROVIDER_LOGIN_CANCEL +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_provider_login_cancel(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_PROVIDER_LOGIN_FINISH +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_PROVIDER_LOGIN_FINISH +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_provider_login_finish(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_PROVIDER_LOGIN_START +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_PROVIDER_LOGIN_START +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_provider_login_start(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_VAULT_ACCOUNTS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_VAULT_ACCOUNTS +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_vault_accounts(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_VAULT_ACTIVATE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_VAULT_ACTIVATE +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_vault_activate(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_VAULT_FORGET +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_VAULT_FORGET +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_vault_forget(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_VAULT_PUT_API_KEY +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_VAULT_PUT_API_KEY +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_vault_put_api_key(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_VAULT_STATUS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_VAULT_STATUS +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_vault_status(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_VAULT_USAGE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_VAULT_USAGE +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_vault_usage(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_CREATE_SIDE_CHAT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_CREATE_SIDE_CHAT +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_create_side_chat(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_FORK_SIDE_CHAT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_FORK_SIDE_CHAT +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_fork_side_chat(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_DEVICE_ACTIVATE_ACCOUNT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_DEVICE_ACTIVATE_ACCOUNT +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_device_activate_account(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_DEVICE_AGENT_ACCOUNTS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_DEVICE_AGENT_ACCOUNTS +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_device_agent_accounts(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_DEVICE_FORGET_ACCOUNT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_DEVICE_FORGET_ACCOUNT +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_device_forget_account(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_DEVICE_LOGIN_CANCEL +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_DEVICE_LOGIN_CANCEL +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_device_login_cancel(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_DEVICE_LOGIN_COMPLETE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_DEVICE_LOGIN_COMPLETE +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_device_login_complete(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_DEVICE_LOGIN_POLL +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_DEVICE_LOGIN_POLL +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_device_login_poll(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_DEVICE_LOGIN_START +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_DEVICE_LOGIN_START +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_device_login_start(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_SET_HARNESS_ENABLED +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_SET_HARNESS_ENABLED +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_set_harness_enabled(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_START_VOICE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_START_VOICE +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_start_voice(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_ATTACH_TERMINAL +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_ATTACH_TERMINAL +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_attach_terminal(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_OPEN_TERMINAL +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_CORECLIENT_OPEN_TERMINAL +uint16_t uniffi_zeron_mobile_checksum_method_coreclient_open_terminal(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_UPLOADPROGRESS_ON_PROGRESS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_UPLOADPROGRESS_ON_PROGRESS +uint16_t uniffi_zeron_mobile_checksum_method_uploadprogress_on_progress(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_SUBAGENTS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_SUBAGENTS +uint16_t uniffi_zeron_mobile_checksum_method_sessionhandle_subagents(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_BEGIN_QUEUED_EDIT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_BEGIN_QUEUED_EDIT +uint16_t uniffi_zeron_mobile_checksum_method_sessionhandle_begin_queued_edit(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_CHAT_ID +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_CHAT_ID +uint16_t uniffi_zeron_mobile_checksum_method_sessionhandle_chat_id(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_CLEAR_QUEUE_ERROR +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_CLEAR_QUEUE_ERROR +uint16_t uniffi_zeron_mobile_checksum_method_sessionhandle_clear_queue_error(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_COMPOSER +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_COMPOSER +uint16_t uniffi_zeron_mobile_checksum_method_sessionhandle_composer(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_DELIVER_QUEUED_NOW +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_DELIVER_QUEUED_NOW +uint16_t uniffi_zeron_mobile_checksum_method_sessionhandle_deliver_queued_now(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_ENQUEUE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_ENQUEUE +uint16_t uniffi_zeron_mobile_checksum_method_sessionhandle_enqueue(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_FINISH_QUEUED_EDIT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_FINISH_QUEUED_EDIT +uint16_t uniffi_zeron_mobile_checksum_method_sessionhandle_finish_queued_edit(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_INTERRUPT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_INTERRUPT +uint16_t uniffi_zeron_mobile_checksum_method_sessionhandle_interrupt(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_MARK_SEEN +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_MARK_SEEN +uint16_t uniffi_zeron_mobile_checksum_method_sessionhandle_mark_seen(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_MESSAGE_TEXT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_MESSAGE_TEXT +uint16_t uniffi_zeron_mobile_checksum_method_sessionhandle_message_text(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_MOVE_QUEUED +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_MOVE_QUEUED +uint16_t uniffi_zeron_mobile_checksum_method_sessionhandle_move_queued(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_MOVE_QUEUED_BY +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_MOVE_QUEUED_BY +uint16_t uniffi_zeron_mobile_checksum_method_sessionhandle_move_queued_by(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_REMOVE_QUEUED +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_REMOVE_QUEUED +uint16_t uniffi_zeron_mobile_checksum_method_sessionhandle_remove_queued(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_RENEW_QUEUED_EDIT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_RENEW_QUEUED_EDIT +uint16_t uniffi_zeron_mobile_checksum_method_sessionhandle_renew_queued_edit(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_RESPOND_INPUT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_RESPOND_INPUT +uint16_t uniffi_zeron_mobile_checksum_method_sessionhandle_respond_input(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_RETRY_DELIVERY +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_RETRY_DELIVERY +uint16_t uniffi_zeron_mobile_checksum_method_sessionhandle_retry_delivery(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_SEND +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_SEND +uint16_t uniffi_zeron_mobile_checksum_method_sessionhandle_send(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_SEND_QUEUED_NOW +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_SEND_QUEUED_NOW +uint16_t uniffi_zeron_mobile_checksum_method_sessionhandle_send_queued_now(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_SET_VIEW_ATTACHED +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_SET_VIEW_ATTACHED +uint16_t uniffi_zeron_mobile_checksum_method_sessionhandle_set_view_attached(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_TRANSCRIPT_STATUS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_SESSIONHANDLE_TRANSCRIPT_STATUS +uint16_t uniffi_zeron_mobile_checksum_method_sessionhandle_transcript_status(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_VOICECALL_COMPLETE_MEDIA +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_VOICECALL_COMPLETE_MEDIA +uint16_t uniffi_zeron_mobile_checksum_method_voicecall_complete_media(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_VOICECALL_SET_MUTED +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_VOICECALL_SET_MUTED +uint16_t uniffi_zeron_mobile_checksum_method_voicecall_set_muted(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_VOICECALL_STOP +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_VOICECALL_STOP +uint16_t uniffi_zeron_mobile_checksum_method_voicecall_stop(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_VOICEMEDIALISTENER_ON_REQUEST +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_VOICEMEDIALISTENER_ON_REQUEST +uint16_t uniffi_zeron_mobile_checksum_method_voicemedialistener_on_request(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_VOICESESSIONLISTENER_ON_VOICE_STATE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_VOICESESSIONLISTENER_ON_VOICE_STATE +uint16_t uniffi_zeron_mobile_checksum_method_voicesessionlistener_on_voice_state(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_VOICESESSIONLISTENER_ON_VOICE_CLOSED +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_VOICESESSIONLISTENER_ON_VOICE_CLOSED +uint16_t uniffi_zeron_mobile_checksum_method_voicesessionlistener_on_voice_closed(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_LAYOUTFRAME_BUILD_MICROS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_LAYOUTFRAME_BUILD_MICROS +uint16_t uniffi_zeron_mobile_checksum_method_layoutframe_build_micros(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_LAYOUTFRAME_DISPLAY +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_LAYOUTFRAME_DISPLAY +uint16_t uniffi_zeron_mobile_checksum_method_layoutframe_display(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_LAYOUTFRAME_INDEX_AT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_LAYOUTFRAME_INDEX_AT +uint16_t uniffi_zeron_mobile_checksum_method_layoutframe_index_at(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_LAYOUTFRAME_INDEX_OF +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_LAYOUTFRAME_INDEX_OF +uint16_t uniffi_zeron_mobile_checksum_method_layoutframe_index_of(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_LAYOUTFRAME_MESSAGE_TEXT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_LAYOUTFRAME_MESSAGE_TEXT +uint16_t uniffi_zeron_mobile_checksum_method_layoutframe_message_text(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_LAYOUTFRAME_PLACEMENT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_LAYOUTFRAME_PLACEMENT +uint16_t uniffi_zeron_mobile_checksum_method_layoutframe_placement(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_LAYOUTFRAME_PLAIN_TEXT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_LAYOUTFRAME_PLAIN_TEXT +uint16_t uniffi_zeron_mobile_checksum_method_layoutframe_plain_text(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_LAYOUTFRAME_PREPARED_HEAP_BYTES +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_LAYOUTFRAME_PREPARED_HEAP_BYTES +uint16_t uniffi_zeron_mobile_checksum_method_layoutframe_prepared_heap_bytes(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_LAYOUTFRAME_REVISION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_LAYOUTFRAME_REVISION +uint16_t uniffi_zeron_mobile_checksum_method_layoutframe_revision(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_LAYOUTFRAME_ROW_COUNT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_LAYOUTFRAME_ROW_COUNT +uint16_t uniffi_zeron_mobile_checksum_method_layoutframe_row_count(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_LAYOUTFRAME_ROWS_IN +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_LAYOUTFRAME_ROWS_IN +uint16_t uniffi_zeron_mobile_checksum_method_layoutframe_rows_in(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_LAYOUTFRAME_STYLE_COUNT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_LAYOUTFRAME_STYLE_COUNT +uint16_t uniffi_zeron_mobile_checksum_method_layoutframe_style_count(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_LAYOUTFRAME_STYLES +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_LAYOUTFRAME_STYLES +uint16_t uniffi_zeron_mobile_checksum_method_layoutframe_styles(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_LAYOUTFRAME_TOTAL_HEIGHT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_LAYOUTFRAME_TOTAL_HEIGHT +uint16_t uniffi_zeron_mobile_checksum_method_layoutframe_total_height(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_LAYOUTFRAME_WIDTH +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_LAYOUTFRAME_WIDTH +uint16_t uniffi_zeron_mobile_checksum_method_layoutframe_width(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_LAYOUTLISTENER_FRAME_READY +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_LAYOUTLISTENER_FRAME_READY +uint16_t uniffi_zeron_mobile_checksum_method_layoutlistener_frame_ready(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_PLATFORMMEASURER_MEASURE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_PLATFORMMEASURER_MEASURE +uint16_t uniffi_zeron_mobile_checksum_method_platformmeasurer_measure(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_PLATFORMMEASURER_MEASURE_RUN +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_PLATFORMMEASURER_MEASURE_RUN +uint16_t uniffi_zeron_mobile_checksum_method_platformmeasurer_measure_run(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TRANSCRIPTVIEW_ATTACH +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TRANSCRIPTVIEW_ATTACH +uint16_t uniffi_zeron_mobile_checksum_method_transcriptview_attach(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TRANSCRIPTVIEW_ATTACH_SUBAGENT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TRANSCRIPTVIEW_ATTACH_SUBAGENT +uint16_t uniffi_zeron_mobile_checksum_method_transcriptview_attach_subagent(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TRANSCRIPTVIEW_CLOSE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TRANSCRIPTVIEW_CLOSE +uint16_t uniffi_zeron_mobile_checksum_method_transcriptview_close(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TRANSCRIPTVIEW_FRAME +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TRANSCRIPTVIEW_FRAME +uint16_t uniffi_zeron_mobile_checksum_method_transcriptview_frame(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TRANSCRIPTVIEW_SET_DEBUG_ENTRIES +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TRANSCRIPTVIEW_SET_DEBUG_ENTRIES +uint16_t uniffi_zeron_mobile_checksum_method_transcriptview_set_debug_entries(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TRANSCRIPTVIEW_SET_MATH +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TRANSCRIPTVIEW_SET_MATH +uint16_t uniffi_zeron_mobile_checksum_method_transcriptview_set_math(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TRANSCRIPTVIEW_SET_VIEWPORT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TRANSCRIPTVIEW_SET_VIEWPORT +uint16_t uniffi_zeron_mobile_checksum_method_transcriptview_set_viewport(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TRANSCRIPTVIEW_SET_VISUAL_SOURCE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TRANSCRIPTVIEW_SET_VISUAL_SOURCE +uint16_t uniffi_zeron_mobile_checksum_method_transcriptview_set_visual_source(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TRANSCRIPTVIEW_TOGGLE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TRANSCRIPTVIEW_TOGGLE +uint16_t uniffi_zeron_mobile_checksum_method_transcriptview_toggle(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TRANSCRIPTVIEW_TOGGLE_DETAIL +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TRANSCRIPTVIEW_TOGGLE_DETAIL +uint16_t uniffi_zeron_mobile_checksum_method_transcriptview_toggle_detail(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TRANSCRIPTVIEW_VISUAL +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TRANSCRIPTVIEW_VISUAL +uint16_t uniffi_zeron_mobile_checksum_method_transcriptview_visual(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_ORBRENDERER_NEXT_FRAME +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_ORBRENDERER_NEXT_FRAME +uint16_t uniffi_zeron_mobile_checksum_method_orbrenderer_next_frame(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_ORBRENDERER_SET_AUDIO_LEVELS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_ORBRENDERER_SET_AUDIO_LEVELS +uint16_t uniffi_zeron_mobile_checksum_method_orbrenderer_set_audio_levels(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_ORBRENDERER_SET_ORB +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_ORBRENDERER_SET_ORB +uint16_t uniffi_zeron_mobile_checksum_method_orbrenderer_set_orb(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALLISTENER_CHANGED +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALLISTENER_CHANGED +uint16_t uniffi_zeron_mobile_checksum_method_terminallistener_changed(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALLISTENER_BELL +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALLISTENER_BELL +uint16_t uniffi_zeron_mobile_checksum_method_terminallistener_bell(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_CLEAR_SELECTION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_CLEAR_SELECTION +uint16_t uniffi_zeron_mobile_checksum_method_terminalsession_clear_selection(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_CLICK +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_CLICK +uint16_t uniffi_zeron_mobile_checksum_method_terminalsession_click(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_CLOSE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_CLOSE +uint16_t uniffi_zeron_mobile_checksum_method_terminalsession_close(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_DETACH +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_DETACH +uint16_t uniffi_zeron_mobile_checksum_method_terminalsession_detach(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_EXTEND_SELECTION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_EXTEND_SELECTION +uint16_t uniffi_zeron_mobile_checksum_method_terminalsession_extend_selection(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_FRAME +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_FRAME +uint16_t uniffi_zeron_mobile_checksum_method_terminalsession_frame(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_INFO +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_INFO +uint16_t uniffi_zeron_mobile_checksum_method_terminalsession_info(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_IS_DIRECT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_IS_DIRECT +uint16_t uniffi_zeron_mobile_checksum_method_terminalsession_is_direct(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_PASTE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_PASTE +uint16_t uniffi_zeron_mobile_checksum_method_terminalsession_paste(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_PHASE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_PHASE +uint16_t uniffi_zeron_mobile_checksum_method_terminalsession_phase(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_PRESS +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_PRESS +uint16_t uniffi_zeron_mobile_checksum_method_terminalsession_press(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_RESIZE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_RESIZE +uint16_t uniffi_zeron_mobile_checksum_method_terminalsession_resize(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_REVISION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_REVISION +uint16_t uniffi_zeron_mobile_checksum_method_terminalsession_revision(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_SCROLL_TO_POSITION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_SCROLL_TO_POSITION +uint16_t uniffi_zeron_mobile_checksum_method_terminalsession_scroll_to_position(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_SELECT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_SELECT +uint16_t uniffi_zeron_mobile_checksum_method_terminalsession_select(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_SELECTION +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_SELECTION +uint16_t uniffi_zeron_mobile_checksum_method_terminalsession_selection(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_SET_DARK +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_SET_DARK +uint16_t uniffi_zeron_mobile_checksum_method_terminalsession_set_dark(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_SET_FOCUSED +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_SET_FOCUSED +uint16_t uniffi_zeron_mobile_checksum_method_terminalsession_set_focused(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_TEXT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_TEXT +uint16_t uniffi_zeron_mobile_checksum_method_terminalsession_text(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_TITLE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_TITLE +uint16_t uniffi_zeron_mobile_checksum_method_terminalsession_title(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_TYPE_TEXT +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_TYPE_TEXT +uint16_t uniffi_zeron_mobile_checksum_method_terminalsession_type_text(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_WHEEL +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_TERMINALSESSION_WHEEL +uint16_t uniffi_zeron_mobile_checksum_method_terminalsession_wheel(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_VISUALLISTENER_DISPLAY +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_VISUALLISTENER_DISPLAY +uint16_t uniffi_zeron_mobile_checksum_method_visuallistener_display(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_VISUALLISTENER_FRAME +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_VISUALLISTENER_FRAME +uint16_t uniffi_zeron_mobile_checksum_method_visuallistener_frame(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_VISUALSESSION_ACTIVATE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_VISUALSESSION_ACTIVATE +uint16_t uniffi_zeron_mobile_checksum_method_visualsession_activate(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_VISUALSESSION_ATTACH +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_VISUALSESSION_ATTACH +uint16_t uniffi_zeron_mobile_checksum_method_visualsession_attach(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_VISUALSESSION_DETACH +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_VISUALSESSION_DETACH +uint16_t uniffi_zeron_mobile_checksum_method_visualsession_detach(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_VISUALSESSION_POINTER +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_VISUALSESSION_POINTER +uint16_t uniffi_zeron_mobile_checksum_method_visualsession_pointer(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_VISUALSESSION_SET_APPEARANCE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_VISUALSESSION_SET_APPEARANCE +uint16_t uniffi_zeron_mobile_checksum_method_visualsession_set_appearance(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_VISUALSESSION_SLIDE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_VISUALSESSION_SLIDE +uint16_t uniffi_zeron_mobile_checksum_method_visualsession_slide(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_VISUALSESSION_TITLE +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_METHOD_VISUALSESSION_TITLE +uint16_t uniffi_zeron_mobile_checksum_method_visualsession_title(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_CONSTRUCTOR_CAPTIONFADER_NEW +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_CONSTRUCTOR_CAPTIONFADER_NEW +uint16_t uniffi_zeron_mobile_checksum_constructor_captionfader_new(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_CONSTRUCTOR_CORECLIENT_NEW +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_CONSTRUCTOR_CORECLIENT_NEW +uint16_t uniffi_zeron_mobile_checksum_constructor_coreclient_new(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_CONSTRUCTOR_TEXTSYSTEM_NEW +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_CONSTRUCTOR_TEXTSYSTEM_NEW +uint16_t uniffi_zeron_mobile_checksum_constructor_textsystem_new(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_CONSTRUCTOR_TRANSCRIPTVIEW_NEW +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_CONSTRUCTOR_TRANSCRIPTVIEW_NEW +uint16_t uniffi_zeron_mobile_checksum_constructor_transcriptview_new(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_CONSTRUCTOR_ORBRENDERER_NEW +#define UNIFFI_FFIDEF_UNIFFI_ZERON_MOBILE_CHECKSUM_CONSTRUCTOR_ORBRENDERER_NEW +uint16_t uniffi_zeron_mobile_checksum_constructor_orbrenderer_new(void + +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_ZERON_MOBILE_UNIFFI_CONTRACT_VERSION +#define UNIFFI_FFIDEF_FFI_ZERON_MOBILE_UNIFFI_CONTRACT_VERSION +uint32_t ffi_zeron_mobile_uniffi_contract_version(void + +); +#endif + diff --git a/crates/engine/src/credentials.rs b/crates/engine/src/credentials.rs index 75f150a09..81522b104 100644 --- a/crates/engine/src/credentials.rs +++ b/crates/engine/src/credentials.rs @@ -1433,10 +1433,23 @@ fn is_github_login(login: &str) -> bool { /// when there is none, or when it's a bot's (an agent that configured the /// App it pushes as). An identity the user chose stays. async fn configure_git_identity(home: &Path, identity: &GitIdentity) { + // `git config --global` writes $XDG_CONFIG_HOME/git/config when that file + // exists. An XDG_CONFIG_HOME outside `home` belongs to another home (this + // process's own, when `home` is a sandbox or a test directory), so `home`'s is + // used instead; otherwise the identity lands in that other user's config. + // When `home` is this process's own, its XDG_CONFIG_HOME is the user's + // wherever it lives: replacing it would hide an identity kept there, and + // ~/.gitconfig (which wins over it) would get the machine's. + let own_home = std::env::var_os("HOME").is_some_and(|own| Path::new(&own) == home); + let xdg_config = std::env::var_os("XDG_CONFIG_HOME") + .map(std::path::PathBuf::from) + .filter(|dir| own_home || dir.starts_with(home)) + .unwrap_or_else(|| home.join(".config")); let git = |args: &[&str]| { let mut cmd = tokio::process::Command::new("git"); cmd.args(args) .env("HOME", home) + .env("XDG_CONFIG_HOME", &xdg_config) .env("GIT_CONFIG_NOSYSTEM", "1") .stdin(std::process::Stdio::null()) .stdout(std::process::Stdio::piped()) @@ -1611,9 +1624,11 @@ mod tests { async fn the_machine_identity_never_overrides_the_users_own() { let home = tempfile::tempdir().unwrap(); let git = |args: &[&str]| { + // XDG_CONFIG_HOME too: with the developer's set, `--global` is their real config. let out = std::process::Command::new("git") .args(args) .env("HOME", home.path()) + .env("XDG_CONFIG_HOME", home.path().join(".config")) .env("GIT_CONFIG_NOSYSTEM", "1") .output() .unwrap(); diff --git a/crates/engine/tests/claude_subagents.rs b/crates/engine/tests/misc/claude_subagents.rs similarity index 100% rename from crates/engine/tests/claude_subagents.rs rename to crates/engine/tests/misc/claude_subagents.rs diff --git a/crates/engine/tests/codex_subagents.rs b/crates/engine/tests/misc/codex_subagents.rs similarity index 100% rename from crates/engine/tests/codex_subagents.rs rename to crates/engine/tests/misc/codex_subagents.rs diff --git a/crates/engine/tests/local_profiles.rs b/crates/engine/tests/misc/local_profiles.rs similarity index 100% rename from crates/engine/tests/local_profiles.rs rename to crates/engine/tests/misc/local_profiles.rs diff --git a/crates/engine/tests/misc/main.rs b/crates/engine/tests/misc/main.rs new file mode 100644 index 000000000..38eb3ca26 --- /dev/null +++ b/crates/engine/tests/misc/main.rs @@ -0,0 +1,9 @@ +//! Small suites in one test binary: each tests/*.rs file is its own binary, +//! linked against the whole crate, so a handful of tests each cost more to +//! link than to run. + +mod pi_resume; +mod osc7501; +mod codex_subagents; +mod claude_subagents; +mod local_profiles; diff --git a/crates/engine/tests/osc7501.rs b/crates/engine/tests/misc/osc7501.rs similarity index 100% rename from crates/engine/tests/osc7501.rs rename to crates/engine/tests/misc/osc7501.rs diff --git a/crates/engine/tests/pi_resume.rs b/crates/engine/tests/misc/pi_resume.rs similarity index 100% rename from crates/engine/tests/pi_resume.rs rename to crates/engine/tests/misc/pi_resume.rs diff --git a/crates/harness/src/muse/mod.rs b/crates/harness/src/muse/mod.rs index d7b0eb6c7..00d233091 100644 --- a/crates/harness/src/muse/mod.rs +++ b/crates/harness/src/muse/mod.rs @@ -172,7 +172,15 @@ impl MuseHarness { _ = consumer.closed() => Ok(()), }; if let Err(error) = result { - let status = runner.host.child.try_wait().ok().flatten(); + // The first symptom of a crash is usually the pipe's ("Muse + // stdout closed"), racing the exit itself: give the exit and + // the stderr tail a moment so the message names the crash (as + // the Pi driver does). + let status = + tokio::time::timeout(Duration::from_millis(250), runner.host.child.wait()) + .await + .ok() + .and_then(Result::ok); runner.error = Some(if status.is_some() { runner.host.tail.wait_closed().await; crate::crash_message("Muse", status, &runner.host.tail) diff --git a/crates/harness/tests/cursor_shim.rs b/crates/harness/tests/cursor_shim.rs index 45b1969fd..a53ba55ec 100644 --- a/crates/harness/tests/cursor_shim.rs +++ b/crates/harness/tests/cursor_shim.rs @@ -217,7 +217,13 @@ async fn stress_100_interrupted_sessions_recover_without_losing_history_or_repla ); assert_eq!(frame(&mut lines).await["status"], "finished"); finish(&mut child, stdin).await; - for round in 0..100 { + // Pull request CI runs two cycles of the seven failure modes + // (ZERON_STRESS_ROUNDS=14); the nightly run and local runs do 100. + let rounds: usize = std::env::var("ZERON_STRESS_ROUNDS") + .ok() + .and_then(|v| v.parse().ok()) + .unwrap_or(100); + for round in 0..rounds { let mode = round % 7; let prompt = match mode { 3 => "send-error", @@ -266,11 +272,11 @@ async fn stress_100_interrupted_sessions_recover_without_losing_history_or_repla .unwrap() .lines() .count(), - 201, + 2 * rounds + 1, "recovery must not send any unrequested prompts" ); println!( - "stress: 100 crashed/disconnected/cancelled/errored sessions, 100 successful same-session recoveries, zero history loss" + "stress: {rounds} crashed/disconnected/cancelled/errored sessions, {rounds} successful same-session recoveries, zero history loss" ); } diff --git a/crates/harness/tests/acp_hardening.rs b/crates/harness/tests/misc/acp_hardening.rs similarity index 100% rename from crates/harness/tests/acp_hardening.rs rename to crates/harness/tests/misc/acp_hardening.rs diff --git a/crates/harness/tests/claude_availability.rs b/crates/harness/tests/misc/claude_availability.rs similarity index 100% rename from crates/harness/tests/claude_availability.rs rename to crates/harness/tests/misc/claude_availability.rs diff --git a/crates/harness/tests/claude_models.rs b/crates/harness/tests/misc/claude_models.rs similarity index 97% rename from crates/harness/tests/claude_models.rs rename to crates/harness/tests/misc/claude_models.rs index f89cc39e5..79b69b071 100644 --- a/crates/harness/tests/claude_models.rs +++ b/crates/harness/tests/misc/claude_models.rs @@ -7,7 +7,7 @@ use zeron_proto::ReasoningLevel; fn fixture(response: serde_json::Value) -> (tempfile::TempDir, ClaudeHarness) { let dir = tempfile::tempdir().unwrap(); let script = dir.path().join("claude"); - std::fs::write(&script, include_str!("fixtures/fake-claude-models.py")).unwrap(); + std::fs::write(&script, include_str!("../fixtures/fake-claude-models.py")).unwrap(); std::fs::set_permissions(&script, std::fs::Permissions::from_mode(0o755)).unwrap(); std::fs::write(dir.path().join("response.json"), response.to_string()).unwrap(); (dir, ClaudeHarness::new().with_executable(script)) diff --git a/crates/harness/tests/misc/main.rs b/crates/harness/tests/misc/main.rs new file mode 100644 index 000000000..db6e37d97 --- /dev/null +++ b/crates/harness/tests/misc/main.rs @@ -0,0 +1,11 @@ +//! Small suites in one test binary: each tests/*.rs file is its own binary, +//! linked against the whole crate, so a handful of tests each cost more to +//! link than to run. + +mod claude_models; +mod model_catalog; +mod model_refresh; +mod run_env; +mod pi_mcp; +mod claude_availability; +mod acp_hardening; diff --git a/crates/harness/tests/model_catalog.rs b/crates/harness/tests/misc/model_catalog.rs similarity index 100% rename from crates/harness/tests/model_catalog.rs rename to crates/harness/tests/misc/model_catalog.rs diff --git a/crates/harness/tests/model_refresh.rs b/crates/harness/tests/misc/model_refresh.rs similarity index 100% rename from crates/harness/tests/model_refresh.rs rename to crates/harness/tests/misc/model_refresh.rs diff --git a/crates/harness/tests/pi_mcp.rs b/crates/harness/tests/misc/pi_mcp.rs similarity index 100% rename from crates/harness/tests/pi_mcp.rs rename to crates/harness/tests/misc/pi_mcp.rs diff --git a/crates/harness/tests/run_env.rs b/crates/harness/tests/misc/run_env.rs similarity index 100% rename from crates/harness/tests/run_env.rs rename to crates/harness/tests/misc/run_env.rs diff --git a/crates/ui/tests/voice_orb_geometry.rs b/crates/orb/tests/geometry.rs similarity index 87% rename from crates/ui/tests/voice_orb_geometry.rs rename to crates/orb/tests/geometry.rs index 843eb0c7e..9760affa3 100644 --- a/crates/ui/tests/voice_orb_geometry.rs +++ b/crates/orb/tests/geometry.rs @@ -1,7 +1,7 @@ // MIT: extracted with the orb; see THIRD_PARTY_NOTICES.md. -//! Smoke tests + microbench for mode painters. +//! Smoke tests for the mode painters (moved from zeron-ui, which re-exports this crate). -use zeron_ui::orb::{ +use zeron_orb::{ ModeKey, OrbSize, OrbState, engine::{MAX_ICON_D, MAX_MORPH_DOTS, MAX_NODE_N, ModeOpts, draw_mode, sanitize_mode_opts}, resolve_preset, @@ -162,52 +162,6 @@ fn legacy_all_constant_keeps_its_original_array_shape() { assert_eq!(original_nine.len(), 9); assert_eq!(OrbState::ALL_STATES.len(), 12); } - -#[test] -fn bench_geometry_cost() { - use std::time::Instant; - for &state in OrbState::ALL_STATES { - for &size in OrbSize::ALL_SIZES { - let resolved = resolve_preset(state, size); - for i in 0..20 { - let _ = draw_mode( - resolved.mode, - size.pixels(), - i as f32 * 0.016, - &resolved.opts, - ); - } - let n = 1000usize; - let t0 = Instant::now(); - let mut total_dots = 0usize; - let mut total_lines = 0usize; - for i in 0..n { - let f = draw_mode( - resolved.mode, - size.pixels(), - i as f32 * 0.016, - &resolved.opts, - ); - total_dots += f.dots.len(); - total_lines += f.lines.len(); - } - let elapsed = t0.elapsed(); - let per = elapsed / n as u32; - let avg_dots = total_dots / n; - let avg_lines = total_lines / n; - eprintln!( - "{:>12}/{:<6} {:>5} dots {:>4} lines {:>8.2?} /frame (~{:.0}k geom-fps)", - state.as_str(), - size.pixels() as u32, - avg_dots, - avg_lines, - per, - 1.0 / per.as_secs_f64() / 1000.0 - ); - } - } -} - /// Strokes are painted at their exact colour, one `Path` per segment. Batching /// them into shared paths was tried and reverted for visibly brightening the /// web (see `paint.rs`), so what matters now is that every alpha the engine diff --git a/crates/preview/tests/login_tunnel_e2e.rs b/crates/preview/tests/misc/login_tunnel_e2e.rs similarity index 100% rename from crates/preview/tests/login_tunnel_e2e.rs rename to crates/preview/tests/misc/login_tunnel_e2e.rs diff --git a/crates/preview/tests/misc/main.rs b/crates/preview/tests/misc/main.rs new file mode 100644 index 000000000..97dcaf496 --- /dev/null +++ b/crates/preview/tests/misc/main.rs @@ -0,0 +1,7 @@ +//! Small suites in one test binary: each tests/*.rs file is its own binary, +//! linked against the whole crate, so a handful of tests each cost more to +//! link than to run. + +mod transport; +mod proxy; +mod login_tunnel_e2e; diff --git a/crates/preview/tests/proxy.rs b/crates/preview/tests/misc/proxy.rs similarity index 100% rename from crates/preview/tests/proxy.rs rename to crates/preview/tests/misc/proxy.rs diff --git a/crates/preview/tests/transport.rs b/crates/preview/tests/misc/transport.rs similarity index 100% rename from crates/preview/tests/transport.rs rename to crates/preview/tests/misc/transport.rs diff --git a/crates/term-link/src/remote.rs b/crates/term-link/src/remote.rs index f9ced747b..563a427be 100644 --- a/crates/term-link/src/remote.rs +++ b/crates/term-link/src/remote.rs @@ -590,10 +590,8 @@ impl Pump { async fn run(mut self, mut source: Source) { loop { let ended = match source { - Source::Direct(link) => { - self.path.send_replace(TerminalPath::Direct); - self.pump_direct(link).await - } + // pump_direct reports Direct itself, once writes ride the link. + Source::Direct(link) => self.pump_direct(link).await, Source::Relay(stream) => { self.path.send_replace(TerminalPath::Relay); self.pump_relay(stream).await @@ -654,6 +652,10 @@ impl Pump { mut acks, } = link; self.hub.attach_writer(&self.key, self.id, outgoing); + // Only now: anyone who sees Direct and types goes over the link, not + // the relay (reported before the attach, a keystroke could slip + // through the relay in between). + self.path.send_replace(TerminalPath::Direct); let ended = loop { tokio::select! { event = events.recv() => { diff --git a/docs/pi.md b/docs/pi.md index d2c19798f..96bee58ec 100644 --- a/docs/pi.md +++ b/docs/pi.md @@ -60,7 +60,7 @@ Validation: ```sh cargo test -p zeron-harness --features native-fixture -cargo test -p zeron-engine --lib --test pi_resume --test acp_lifecycle --test message_queue --test e2e +cargo test -p zeron-engine --lib --test misc --test acp_lifecycle --test message_queue --test e2e cargo test -p zeron-harness --test pi_live -- --ignored --nocapture cargo check -p zeron-ui --tests cargo build -p zeron-mobile --features bindgen diff --git a/docs/program-status.md b/docs/program-status.md index aa375acdb..5f22bc77e 100644 --- a/docs/program-status.md +++ b/docs/program-status.md @@ -76,7 +76,7 @@ terminal control strings. Only one bounded summary per chat is replicated. ## Verification -`cargo test -p zeron-engine --test osc7501` exercises a real Unix PTY through the +`cargo test -p zeron-engine --test misc` exercises a real Unix PTY through the engine, registry, shared sidebar derivation, and MCP. It also runs a capability probe without a terminal emulator. Parser unit tests cover fragmentation, malformed/oversized reports, hierarchical records, replacement, and lifecycle diff --git a/docs/reference/ci.md b/docs/reference/ci.md new file mode 100644 index 000000000..49c4a15e8 --- /dev/null +++ b/docs/reference/ci.md @@ -0,0 +1,301 @@ +# CI + +Pull requests, `main` and the merge queue all go through one workflow, +[`ci.yml`](../../.github/workflows/ci.yml). It runs these jobs in order: + +1. **plan** ([`scripts/ci/plan.py`](../../scripts/ci/plan.py)) lists the + changed files and picks the suites the change needs. It drops the jobs that + already passed on the same inputs (see [Reuse](#reuse)), and counts the + runners the rest will use. +2. **admit** ([`scripts/ci/admit.py`](../../scripts/ci/admit.py)) waits until + all of those runners are free. +3. **The suites** all start together. Each is a reusable workflow: + `ui-tests.yml` (Linux), `windows.yml`, `macos.yml` (macOS and iOS), + `voice-tests.yml`, `android.yml`, `preview-tests.yml`, + `linux-installer.yml` and `cursor-compatibility.yml`. +4. **CI result** passes when no suite failed or was cancelled. This is the + check to require in the ruleset and the merge queue. + +## Which suites run + +| | Pull request (fast tier) | `main`, merge queue, manual run (full tier) | +|---|---|---| +| Linux core and UI, Cursor, edge, installer | when their files change | when their files change | +| iOS core (Linux) | app or mobile core changed | app or mobile core changed | +| iOS simulator | the app, `crates/mobile` or `crates/client` changed | with iOS core | +| Windows tests, macOS | only when the change looks platform specific | when their files change | +| Windows packaging (`app`) | `apps/zeron`, `dist/windows`, packaging scripts, `crates/update` | with Windows tests | +| macOS browser / preview fixtures | browser, preview or edge code changed | always | +| Linux browser fixture | nightly or `ci:full` only | nightly or manual run only | +| Android APK | the Android app or `crates/mobile` changed | when its files change | +| Voice (audio stack, Windows media runtime) | nightly or `ci:full` only | nightly or manual run only | +| GPUI frame-source | the pinned GPUI revision moved | the same | + +The `iOS core` paths come from the Cargo graph: every crate `zeron-mobile` +depends on. + +On the fast tier, a change counts as platform specific when it touches: + +- the platform's own files: packaging, scripts, `apps/zeron`, `crates/update`, + and the voice crates or the mobile core for voice and Android; +- a file under `crates/` whose name says so, such as `browser/macos.rs`; +- changed code (not comments) with a platform conditional or platform API: + `target_os`, `cfg(unix)`, `cfg(windows)`, `objc`, WebKit, `HWND`, ... + +`Cargo.toml`, `Cargo.lock` and `rust-toolchain.toml` changes run everything +except a version bump: one that only changes `version = "..."` lines (the +workspace version and the workspace packages' versions in the lockfile) selects +nothing, and is left out of the reuse fingerprints. Changes to CI itself run +everything. + +### Scheduled runs + +- **Nightly** (`ci.yml`, schedule): every suite, job and fixture, nothing + reused, slow tests included. Voice and the Linux browser fixture run only + here, on manual runs and with `ci:full`: in the two weeks measured, the + voice jobs left after the move to `core-tests` never failed, and the Linux + browser fixture's failures were window-timing flakes and package downloads. + The rest of voice (protocol, transport, MCP, voice-media) runs in + `core-tests`, `ios-core` and the Windows tests. +- **Nightly** (`release-profile-tests.yml`): core and UI in the release profile. +- **Weekly** (`weekly-tests.yml`): the tests no other workflow runs. That is + every `zeron-engine` integration binary, plus the crates whose own tests have + no other runner (term, syntax, theme, veil, visual, visual-gpu, zatex, + notify). + +### Slow tests + +Pull requests and `main` use nextest's `ci` profile (`scripts/ci/nextest.toml`). +It leaves out these slow and soak tests, which the nightly runs keep: + +- the doc_host sync tests at 48-chat scale or against the real 30 s quantum; +- the Codex dying-server backoff test; +- the preview leak test; +- two preview discovery tests that assert nothing happens during a sleep. + +The Cursor shim stress test runs 14 rounds instead of 100 +(`ZERON_STRESS_ROUNDS`). + +Test binaries that run nothing on Linux are not built there: + +- Windows-only files; +- files whose every test is `#[ignore]`d. + +Small integration suites share one binary per crate (`tests/misc/`), since +every `tests/*.rs` file is linked against the whole crate. + +To run every suite on a pull request, add the `ci:full` label, then push or +re-run the CI workflow. To make every pull request run the full tier, set the +repository variable `CI_PR_TIER=full`. + +## Reuse + +After a new push, a suite runs again only if something it reads changed. That +is checked by content, not by what the push touched: a suite reruns when `main` +changed something it reads, and is skipped when the push only touched code it +doesn't read. + +For each selected suite, `plan` hashes the inputs in the tree being tested +([`scripts/ci/reuse.py`](../../scripts/ci/reuse.py)). For a pull request that +tree is the merge with the current `main`. The inputs are: + +- `Cargo.toml`, `Cargo.lock`, the toolchain and `ci.yml`; +- the suite's workflow, the CI scripts and setup actions it runs + (`nextest.toml`, `test-core.sh`, the apt and nextest installers…), and the + non-Rust files it uses. The planner and the scheduler (`plan.py`, + `admit.py`, `reuse.py`, `emergency.py`) decide what runs, not whether a test + passes, so changing them reuses everything; +- for Rust suites: + - the packages they test and every workspace package those depend on, of any + dependency kind; + - every file outside those packages that their Rust sources name with a + `../` path, for example `include_str!("../../../ui/src/file-icons.json")` + or `CARGO_MANIFEST_DIR` joined with `../harness/tests/fixtures`. The + sources are scanned on every run, so new references are picked up without + a list to maintain. The plan summary lists the files found. + +When a job passes, its last step saves a tiny Actions cache entry named after +the suite's hash and the job. `plan` skips a suite when all its jobs have such +an entry. A single Windows or voice job can be skipped while the suite's other +jobs run. Skipped suites reserve no runners and count as passed in `CI result`. +The plan summary shows what was reused. + +Which recorded passes count: + +| Run | Reuses passes from | +|---|---| +| Pull request from a branch of this repository | its own earlier runs, and `main` | +| Pull request from a fork | `main` only (its own too with `CI_FORK_REUSE=own`) | +| `main` | `main` only | +| Merge queue (the last gate before `main`), `ci:full` label, manual run | nothing | + +Reuse fails closed: + +- If a pull request changes a Rust build file (`crates/`, `apps/zeron`, + `Cargo.*`, `.cargo/`) that no selected suite's fingerprint covers, nothing is + reused. +- If a suite's sources build a path from the package directory's parent in + code (`.parent()`, `.ancestors()`, `join("..")`), the scan can't follow it. + That suite then counts the whole workspace as its input. + +A pull request could fake a pass in its own runs: an earlier push whose edited +workflow saves the pass entry for the fingerprint of a later, clean-looking +commit would let that commit's suites be skipped. No other ref ever sees those +entries, but until the merge queue (which reuses nothing) is the required gate, +a green `CI result` on the pull request is what a reviewer goes by. So forks +reuse only `main`'s passes; set `CI_FORK_REUSE=own` once the merge queue is +required. + +Changing what goes into a fingerprint (`SUITE_INPUTS`, `COMMON`, +`SUITE_PACKAGES` in `reuse.py`) changes every fingerprint once, so the next run +reruns everything; recorded passes count again after that. + +Limits: + +- A path assembled from variables is not found by the scan. Write such + references as one `../` literal, or add the path to the suite's + `SUITE_INPUTS`. +- A test that depends on the network or on timing and passed by luck stays + passed until its inputs change. Re-run with `ci:full` to check everything + again. + +## Admission + +GitHub starts a job as soon as a runner frees up. When several runs compete, +each one gets some of its jobs going and holds those runners while its other +jobs queue behind other runs, so every run takes hours. + +Admission prevents this. A run's `admit` job waits until the runners for the +whole run are free; only then do the run's jobs start. Each runner is released +when the job using it finishes. Admission is first come, first served. A run +that only needs Linux runners may still start ahead of a run waiting for macOS +runners, but never by taking runners that run is waiting for. + +All the state lives in the GitHub API, so admission works with the read-only +token that pull requests from forks get: + +- The admit job's name carries the run's reservation, for example + `admit [linux=4 windows=2 macos=1]`. +- Other runs read that reservation from their admit jobs. +- How much of it a run still holds comes from how many of its jobs have + finished. + +### Priority and locks + +Adding a label needs the triage role or above, so GitHub decides who can use +these. A fork's author can't label their own pull request. + +- **`ci:priority`**: the pull request's runs go to the front of the queue, + behind any locked pull request. Nobody behind them may take runners they + wait for, so the next runners to free up go to them. Running jobs are never + stopped. +- **`ci:lock`**: while the pull request is open, admission treats a full run's + worth of runners (10 Linux, 3 Windows, 3 macOS) as taken, whether or not + the pull request is running anything. Its own runs skip the queue and are + admitted as soon as their runners are free. The lock ends when: + - the label is removed; + - the pull request is merged or closed; + - `CI_LOCK_HOURS` (6) have passed since the label was added. Add the label + again to extend. +- **CI emergency** ([`ci-emergency.yml`](../../.github/workflows/ci-emergency.yml)): + a workflow you start by hand from the Actions tab with a pull request number. + It needs write access. It: + - adds `ci:lock` to the pull request; + - cancels every other pull request's CI run (with `cancel-main`, also + `main` and merge queue runs); + - re-runs the pull request's own CI if none is running and the last run + didn't pass. + + The cancelled pull requests need a push or a re-run afterwards. + +A run states its pull request in its admit job's name, for example +`admit [linux=4 windows=0 macos=1] #1077`. The claim only counts when that +pull request's head is the run's commit, so a run can't borrow another pull +request's priority or lock. + +Repository variables: + +| Variable | Default | | +|---|---|---| +| `CI_BUDGET_TOTAL` | 20 | Hosted runners all CI runs may hold at once: the organization's concurrency limit | +| `CI_BUDGET_MACOS` | 5 | macOS runners: the organization's macOS limit | +| `CI_BUDGET_WINDOWS` | 10 | Windows runners: half the pool, so Linux keeps the other half | +| `CI_DEBOUNCE_SECONDS` | 60 | How long a pull request run waits before queueing. A push within that time cancels it. | +| `CI_ADMISSION` | on | `off` starts every run at once | +| `CI_PR_TIER` | fast | `full` runs everything on pull requests | +| `CI_LOCK_HOURS` | 6 | How long a `ci:lock` label holds runners | +| `CI_FORK_REUSE` | (unset) | `own`: fork pull requests also reuse their own earlier passes. Set it once the merge queue is required | + +A pull request can edit its own copy of `ci.yml`, so the reservation other runs +read from its admit job is not trusted: + +- it is capped at a full run (`MAX_RESERVATION`); +- jobs an admitted run reserved but never created stop counting 10 minutes + after admission, except the `CI result` job and Android publishing, which + start late (90 minutes); +- a waiting run that could have been admitted for 3 minutes but still waits + (an edited admit step that never finishes) is ignored: the runs behind it + stop waiting for it. + +Admission ensures that all of a run's runners were free when it started. It +can't stop jobs it doesn't see from taking runners in the meantime: other +repositories of the organization, release and deploy workflows. Those can +still take a free runner first. + +### No deadlocks + +Every wait points the same way: locked runs (oldest lock first), then +`ci:priority`, then first come first served. So no two runs can wait for each +other. + +- A waiting run's `admit` job holds a runner until the run is admitted. A run + counts those runners only for the runs ahead of it, not behind it. +- A lock's reservation counts against everyone except older locks. A second + lock waits until the first is released; the first never waits for the + second. + +`scripts/tests/test_ci_admit.py` simulates 3,000 random queues (any sizes, +priority, overlapping locks, any polling order) and checks that every run gets +admitted. The scheduler before this rule deadlocked in about 1 in 10 of them. + +Waiting costs a runner: an `admit` job runs on the same hosted pool as the +suites. With about 20 runs waiting at once, their admit jobs took the whole +pool, admitted runs' jobs got no runner, and nothing moved until the 2-hour +timeout. So when an admitted run's Linux or Windows job has been queued for 10 +minutes, every waiting admit job but the first 5 (a quarter of +`CI_BUDGET_TOTAL`) in the queue gives its runner back and starts its run +without a reservation. Others count that run as holding its runners, so +admission catches up. The test models GitHub's runner pool as well as +admission: without this rule most of its 30-run queues never drain, with it +all of them do. + +Admission never blocks CI. It lets the run start anyway if: + +- it waited 2 hours; +- the API keeps failing; +- the API rate limit runs out for more than 10 minutes. + +The `GITHUB_TOKEN` gets 1000 to 5000 API requests an hour per repository, +depending on the plan; zeron has seen 5000. To stay well under that, +admission: + +- uses conditional requests, which cost nothing when nothing changed; +- refetches a run's jobs only when the run changed; +- polls every 30 s at the head of the queue, 1 and 2 min at the next two + places, 5 min further back, and 10 min when fewer than 400 requests are + left. The quota is shared with every workflow (releases, the Cursor SDK + update, CI emergency). + +## Caches + +The repository has 10 GB of Actions cache. When it is full, GitHub evicts the +least recently used entries. Only `main` saves caches, so pull requests can't +push out the caches that `main` seeds. There is one cache per build: Linux +core, Linux UI, Linux voice, one shared by the Windows jobs, macOS native, iOS +core and simulator, and Android. + +## Locally + +```sh +python3 -m unittest discover -s scripts/tests -p 'test_ci_*.py' +``` diff --git a/docs/research/codex-subagents.md b/docs/research/codex-subagents.md index abec9b832..7e9acfff1 100644 --- a/docs/research/codex-subagents.md +++ b/docs/research/codex-subagents.md @@ -40,7 +40,7 @@ resumed child's output to the original document. ```sh cargo test --locked -p zeron-harness -p zeron-doc -p zeron-proto -cargo test --locked -p zeron-engine --lib --test e2e --test codex_subagents +cargo test --locked -p zeron-engine --lib --test e2e --test misc ``` ## Live validation diff --git a/docs/session-publication.md b/docs/session-publication.md index 557b4c4fb..132b882f6 100644 --- a/docs/session-publication.md +++ b/docs/session-publication.md @@ -48,7 +48,7 @@ history deletion or prove that every possible checkpoint-pruning defect is fixed including cursor preservation, restart/deduplication, and injected outbox-write failure followed by ordinary or cursor-bearing snapshot persistence. -`cargo test --locked -p zeron-engine --lib --test session_publication --test restart_resume --test local_profiles --test born_chat2_race --test codex_subagents --test message_queue --test transcript_salvage` +`cargo test --locked -p zeron-engine --lib --test session_publication --test restart_resume --test misc --test born_chat2_race --test message_queue --test transcript_salvage` covers actual LRU eviction, disconnected cleanup before snapshot debounce, engine restart/resume, command queues, and profile lifecycle. The Codex adapter fixture reproduces a successful-but-invisible resumed turn, then validates full diff --git a/docs/sync-resource-resilience.md b/docs/sync-resource-resilience.md index 171098b9e..1ec4136ca 100644 --- a/docs/sync-resource-resilience.md +++ b/docs/sync-resource-resilience.md @@ -168,7 +168,7 @@ Relevant checks: ``` cargo test --locked -p zeron-engine --test sync_resources -- --nocapture -cargo test --locked -p zeron-engine --lib --test session_publication --test restart_resume --test local_profiles --test born_chat2_race --test codex_subagents --test message_queue --test transcript_salvage +cargo test --locked -p zeron-engine --lib --test session_publication --test restart_resume --test misc --test born_chat2_race --test message_queue --test transcript_salvage cargo test --locked -p zeron-sync --lib cargo test --locked -p zeron-rpc --test device_room cargo check --locked -p zeron-ui diff --git a/docs/whale-startup-reliability.md b/docs/whale-startup-reliability.md index c15228d52..75e655a89 100644 --- a/docs/whale-startup-reliability.md +++ b/docs/whale-startup-reliability.md @@ -80,7 +80,7 @@ emits its Vitest shutdown-state diagnostic; the focused checkpoint run is clean. ```sh cargo test -p zeron-sync -p zeron-rpc --features zeron-sync/mock-server -cargo test -p zeron-engine --lib --test session_publication --test restart_resume --test local_profiles --test codex_subagents +cargo test -p zeron-engine --lib --test session_publication --test restart_resume --test misc cargo test -p zeron-update cargo test -p zeron-ui --lib -- --test-threads=1 npm --prefix edge run typecheck diff --git a/scripts/ci/admit.py b/scripts/ci/admit.py new file mode 100644 index 000000000..6f67e0f63 --- /dev/null +++ b/scripts/ci/admit.py @@ -0,0 +1,602 @@ +#!/usr/bin/env python3 +"""Admission control for CI runs: a run starts only when all its runners are free. + +GitHub queues every job of every run as soon as it can, so under load each run +gets a few of its jobs going and holds those runners while its other jobs wait +behind other runs' jobs: every run is slow, none finishes. Instead, the +`admit` job of .github/workflows/ci.yml runs this script, which waits until +the runners the whole run needs (its reservation, computed by plan.py) fit in +the runner budget, and only then lets the run's jobs start. + +Bookkeeping lives in GitHub itself, so nothing needs write access (pull +requests from forks only get a read-only token): + + - A run's reservation is in its admit job's name: "admit [linux=3 windows=2 macos=1]". + - A run whose admit job is still queued or running is waiting. Waiting runs + are served first come, first served, ordered by when their admit job was + created (a re-run queues again at the back). + - A run whose admit job succeeded holds, per runner type, its reservation + minus the jobs of that type that have finished: a runner is released as + soon as the job using it is done, not when the whole run ends. + - A waiting run's own admit job holds one Linux runner. + +Any pull request can edit its own copy of ci.yml, so a reservation read from +another run is not trusted: + + - it is capped at the most plan.py ever reserves (MAX_RESERVATION); + - an admitted run's jobs that have not shown up CREATE_GRACE after admission + stop counting, except the LATE_JOBS that start after the others (the + result job, Android publishing), which stop at UNSEEN_GRACE; + - a waiting run that could have been admitted for UNRESPONSIVE_GRACE but + still waits is not following this protocol (an edited admit step that + never finishes): the runs behind it stop waiting for it. + +So a run cannot hold more than a full run's worth of runners, hold runners it +never uses for long, or block the queue by never taking its turn. + +Waiting costs a runner: the admit job runs on the same hosted pool as the +suites. When so many runs wait at once that their admit jobs leave admitted +runs' jobs queued (STALL_SECONDS without a runner), the runs furthest back +yield: all running admit jobs but the first quarter of the budget +(KEEP_WAITING_SHARE) stop waiting and start their suites without a +reservation, which frees their runners. Without this, +about 20 runs waiting at once took the whole pool and nothing ran until the +MAX_WAIT_MINUTES timeout. + +Priority and locks (labels; adding a label needs the triage role or above): + + - `ci:priority` on a pull request puts its runs at the front of the queue + (after locked ones): the runners that free up go to it first, since nobody + behind it may take what it waits for. + - `ci:lock` on a pull request keeps a full run's worth of runners + (MAX_RESERVATION) out of everyone else's budget while the pull request is + open, whether or not it is running anything; its own runs are admitted as + soon as their runners are free, ahead of every queue. It ends when the + label is removed, the pull request is merged or closed, or LOCK_HOURS + after the label was added (add it again to extend). + - A run claims its pull request in its admit job's name ("... #123"); the + claim only counts when that pull request's head is the run's commit. + +The emergency workflow (.github/workflows/ci-emergency.yml, write access) +adds `ci:lock` and cancels the other pull requests' CI runs. + +A waiting run is admitted when, for every resource it needs, what admitted +runs hold + what the runs ahead of it in the queue need + its own need fits in +the budget. So a run that needs only Linux can go ahead of a run waiting for +a macOS runner, but never takes anything that run is waiting for (conservative +backfilling: nobody is overtaken on a resource they wait for). + +Resources: `total` (every hosted job, the org-wide concurrency limit), and +`macos` and `windows`. Budgets default to the organization's runner limits +(20 jobs, 5 on macOS; Windows capped at 10 so Linux keeps half), overridable +with the repository variables CI_BUDGET_TOTAL / CI_BUDGET_MACOS / +CI_BUDGET_WINDOWS. Runners this script cannot see (other repositories of the +organization, release and deploy workflows) can still take a free runner +first, which is why admission is "all runners were free when the run +started", not a hard guarantee. + +The GITHUB_TOKEN may make 1000 API requests an hour per repository, shared by +every job. The script uses conditional requests (a 304 is free), refetches a +run's jobs only when the run changed, polls less often the further back in the +queue it is, and slows down when the remaining quota is low. If it cannot +reach the API, the quota resets more than 10 minutes away, or it waited +MAX_WAIT_MINUTES (120), it lets the run start (fail open) rather than block CI. +""" + +from __future__ import annotations + +import calendar +import json +import os +import re +import sys +import time +import urllib.error +import urllib.request +from urllib.parse import quote +from dataclasses import dataclass, field + +RUNNERS = ("linux", "windows", "macos") +RESOURCES = ("total", "macos", "windows") +ADMIT_PREFIX = "admit" +UNRESERVED_JOBS = ("plan",) # jobs that run before admission and are not in reservations +RESERVATION = re.compile(r"\b(linux|windows|macos)=(\d+)\b") +# The largest reservation plan.py makes: every suite, on main (checked by test_ci_admit.py). +MAX_RESERVATION = {"linux": 10, "windows": 3, "macos": 3} +# How long an admitted run's not-yet-created jobs stay reserved. Its suites' jobs +# are created as soon as admit finishes; LATE_JOBS (the `CI result` job, and +# Android publishing on main) only once the jobs they need are done. +CREATE_GRACE = 10 * 60 +UNSEEN_GRACE = 90 * 60 +LATE_JOBS = {"linux": 2, "windows": 0, "macos": 0} +# A waiting run that could have been admitted this long, but still waits, is ignored. +UNRESPONSIVE_GRACE = 3 * 60 +# An admitted run's job queued this long (Linux or Windows: the runners waiting +# admit jobs take from) means waiting admit jobs are starving the pool. +STALL_SECONDS = 10 * 60 +# ...then all but this share of the total budget of running admit jobs (the first +# in the queue) stop waiting (should_yield). +KEEP_WAITING_SHARE = 4 +PRIORITY_LABEL = "ci:priority" +LOCK_LABEL = "ci:lock" +LOCK_HOURS = 6 +PR_CLAIM = re.compile(r"#(\d+)\s*$") + + +def parse_reservation(name: str) -> dict[str, int] | None: + found = dict((k, int(v)) for k, v in RESERVATION.findall(name)) + if not found: + return None + return {r: min(found.get(r, 0), MAX_RESERVATION[r]) for r in RUNNERS} + + +def need_of(counts: dict[str, int]) -> dict[str, int]: + return {"total": sum(counts.values()), "macos": counts["macos"], "windows": counts["windows"]} + + +def runner_of(job: dict) -> str: + labels = " ".join(job.get("labels") or []).lower() + if "windows" in labels: + return "windows" + if "macos" in labels: + return "macos" + return "linux" + + +def is_admit(job: dict) -> bool: + return job["name"].startswith(ADMIT_PREFIX) + + +def held(declared: dict[str, int], jobs: list[dict], since_admitted: float = 0) -> dict[str, int]: + """Runners an admitted run still holds: its reservation minus its finished jobs. + + After CREATE_GRACE, jobs not created yet count only up to LATE_JOBS; after + UNSEEN_GRACE only jobs that exist and have not finished count. + """ + done = {r: 0 for r in RUNNERS} + active = {r: 0 for r in RUNNERS} + for job in jobs: + if is_admit(job) or job["name"] in UNRESERVED_JOBS: + continue + # Skipped jobs never had a runner, and the plan did not count the ones it turned + # off. (One skipped because a job it needs failed stays reserved until the run ends.) + if job.get("conclusion") == "skipped": + continue + bucket = done if job["status"] == "completed" else active + bucket[runner_of(job)] += 1 + if since_admitted > UNSEEN_GRACE: + return active + if since_admitted > CREATE_GRACE: + return {r: active[r] + min(max(declared[r] - done[r] - active[r], 0), LATE_JOBS[r]) for r in RUNNERS} + return {r: max(declared[r] - done[r], active[r], 0) for r in RUNNERS} + + +def stalled_for(jobs: list[dict]) -> float: + """How long the run's longest-queued Linux or Windows job has waited for a runner.""" + ages = [seconds_since(job.get("created_at")) for job in jobs + if job.get("status") == "queued" and not is_admit(job) and job["name"] not in UNRESERVED_JOBS + and runner_of(job) != "macos"] # macOS queues behind its own limit, not admit jobs + return max(ages, default=0) + + +def seconds_since(timestamp: str | None) -> float: + if not timestamp: + return 0 + return time.time() - calendar.timegm(time.strptime(timestamp, "%Y-%m-%dT%H:%M:%SZ")) + + +@dataclass +class Waiter: + run_id: int + key: tuple # (admit job created_at, admit job id): queue order + need: dict[str, int] + running: bool # its admit job holds a runner + pr: int | None = None # its pull request, when verified + ignored: bool = False # does not take its turn (mark_unresponsive): nobody waits for it + + +@dataclass +class Holding: + need: dict[str, int] # need_of(held()) of an admitted run + pr: int | None = None + stalled: float = 0 # seconds its longest-queued job has waited for a runner (stalled_for) + + +@dataclass +class Snapshot: + waiters: list[Waiter] = field(default_factory=list) + holding: list[Holding] = field(default_factory=list) + priority: set[int] = field(default_factory=set) # pull requests labelled ci:priority + locked: set[int] = field(default_factory=set) # pull requests holding a ci:lock + lock_times: dict[int, str] = field(default_factory=dict) # when each lock's label was added + + +@dataclass +class Decision: + admit: bool + position: int + used: dict[str, int] + ahead: dict[str, int] + + +def add(a: dict[str, int], b: dict[str, int], sign: int = 1) -> dict[str, int]: + return {r: a[r] + sign * b[r] for r in RESOURCES} + + +def bigger(a: dict[str, int], b: dict[str, int]) -> dict[str, int]: + return {r: max(a[r], b[r]) for r in RESOURCES} + + +def rank(w: Waiter, snapshot: Snapshot) -> tuple: + """Queue order: locked runs (oldest lock first), then ci:priority, then everyone, each first come first served.""" + if w.pr in snapshot.locked: + return (0, snapshot.lock_times.get(w.pr, ""), w.key) + return (1 if w.pr in snapshot.priority else 2, "", w.key) + + +def decide(me: int, mine: dict[str, int], snapshot: Snapshot, budget: dict[str, int]) -> Decision: + """Whether run `me` may start. + + Every wait points forward in one order (locked runs by lock age, then + ci:priority, then first come first served), so no cycle, and so no deadlock, + can form: + - a waiting run's admit job holds a runner until it is admitted, so a run + counts the admit runners of the runs *ahead* of it, never of those + behind it (they wait for it; counting them was a circular wait); + - a lock's standing reservation counts against everyone except the + older locks: two locks never wait for each other. + """ + zero = {r: 0 for r in RESOURCES} + full = need_of(MAX_RESERVATION) + order = sorted(snapshot.waiters, key=lambda w: rank(w, snapshot)) + self_ = next((w for w in order if w.run_id == me), None) + position = order.index(self_) if self_ is not None else len(order) + ahead_of_me = order[:position] + my_lock = self_.pr if self_ is not None and self_.pr in snapshot.locked else None + + def lock_is_older(pr: int) -> bool: + return (snapshot.lock_times.get(pr, ""), pr) < (snapshot.lock_times.get(my_lock, ""), my_lock) + + lock_use = {pr: dict(zero) for pr in snapshot.locked} + used = dict(zero) + for h in snapshot.holding: + if h.pr in snapshot.locked: + lock_use[h.pr] = add(lock_use[h.pr], h.need) + else: + used = add(used, h.need) + for pr in snapshot.locked: + if my_lock is None or (pr != my_lock and lock_is_older(pr)): + # A full run held for the lock, or what its runs hold if that is more. + used = add(used, bigger(full, lock_use[pr])) + else: + # Our own lock, or a newer one: only what its runs really hold. + used = add(used, lock_use[pr]) + for w in ahead_of_me: + if w.running: + used["total"] += 1 + + ahead = dict(zero) + for w in ahead_of_me: + if w.ignored: + continue # it does not take its turn; only its admit runner counts (above) + if w.pr in snapshot.locked and (my_lock is None or lock_is_older(w.pr)): + continue # its need is already in `used` as the lock's standing reservation + ahead = add(ahead, w.need) + + # A run larger than the budget goes when nothing else holds or waits for that resource. + fits = all(used[r] + ahead[r] + min(mine[r], budget[r]) <= budget[r] + for r in RESOURCES if mine[r] > 0) + return Decision(fits, position, used, ahead) + + +def mark_unresponsive(me: int, snapshot: Snapshot, budget: dict[str, int], since: dict[int, float], + now: float, grace: float = UNRESPONSIVE_GRACE) -> None: + """Ignore waiting runs that could have been admitted for `grace` but still wait. + + An honest admit job takes its turn within a poll (30 s at the head of the + queue). One that does not, such as an edited ci.yml whose admit step never + finishes, would otherwise hold everyone behind it until MAX_WAIT_MINUTES. + `since` (run -> when it was first seen admissible) persists between polls. + Ignoring a run only lowers what others wait for, so it cannot add a wait cycle. + """ + for w in sorted(snapshot.waiters, key=lambda w: rank(w, snapshot)): + if w.run_id == me or not w.running: + continue # a queued admit job cannot take its turn yet + if decide(w.run_id, w.need, snapshot, budget).admit: + first = since.setdefault(w.run_id, now) + w.ignored = now - first > grace + else: + since.pop(w.run_id, None) + live = {w.run_id for w in snapshot.waiters} + for run in [r for r in since if r not in live]: + del since[run] + + +def should_yield(me: int, snapshot: Snapshot, budget: dict[str, int], + stall: float = STALL_SECONDS) -> bool: + """Whether this waiting run should give its admit runner back and start now. + + Waiting admit jobs hold hosted runners from the same pool as the suites. + When an admitted run's jobs have queued for `stall` seconds, those runners + are what they wait for: every running admit job but the first + budget/KEEP_WAITING_SHARE in the queue stops waiting. Its suites start + without a reservation (others count them as held, so admission catches up), + and its runner goes to the queued jobs, which GitHub created before the + yielding run's. + """ + if not any(h.stalled > stall for h in snapshot.holding): + return False + keep = max(2, budget["total"] // KEEP_WAITING_SHARE) + running = [w.run_id for w in sorted(snapshot.waiters, key=lambda w: rank(w, snapshot)) if w.running] + return me in running and running.index(me) >= keep + + +# GitHub API ------------------------------------------------------------------------------------ + +class RateLimited(Exception): + def __init__(self, wait: float): + super().__init__(f"rate limited for {wait:.0f}s") + self.wait = wait + + +class Api: + def __init__(self, token: str, base: str): + self.token = token + self.base = base + self.cache: dict[str, tuple[str, object]] = {} + self.remaining = 1000 + self.requests = 0 + + def get(self, path: str): + url = self.base + path + headers = { + "Authorization": f"Bearer {self.token}", + "Accept": "application/vnd.github+json", + "X-GitHub-Api-Version": "2022-11-28", + } + cached = self.cache.get(url) + if cached: + headers["If-None-Match"] = cached[0] + request = urllib.request.Request(url, headers=headers) + try: + with urllib.request.urlopen(request, timeout=30) as response: + self._note(response.headers) + body = json.load(response) + etag = response.headers.get("ETag") + if etag: + self.cache[url] = (etag, body) + return body + except urllib.error.HTTPError as error: + self._note(error.headers) + if error.code == 304 and cached: + return cached[1] + if error.code in (403, 429): + retry = error.headers.get("Retry-After") + reset = error.headers.get("X-RateLimit-Reset") + if retry: + raise RateLimited(float(retry)) from error + if error.headers.get("X-RateLimit-Remaining") == "0" and reset: + raise RateLimited(max(30.0, float(reset) - time.time())) from error + raise + + def _note(self, headers) -> None: + if headers is None: + return + remaining = headers.get("X-RateLimit-Remaining") + if remaining is not None: + self.remaining = int(remaining) + self.requests += 1 + + +class Scheduler: + """Builds Snapshots, refetching a run's jobs only when the run changed.""" + + REFRESH = 300 # refetch unchanged runs' jobs at least this often (seconds) + + def __init__(self, api: Api, repo: str, workflow_id: int): + self.api = api + self.repo = repo + self.workflow_id = workflow_id + self.jobs: dict[int, tuple[str, float, list[dict]]] = {} # run -> (updated_at, fetched, jobs) + + def run_jobs(self, run: dict) -> list[dict]: + cached = self.jobs.get(run["id"]) + now = time.time() + if cached and cached[0] == run["updated_at"] and now - cached[1] < self.REFRESH: + return cached[2] + jobs: list[dict] = [] + page = 1 + while True: + data = self.api.get(f"/repos/{self.repo}/actions/runs/{run['id']}/jobs" + f"?filter=latest&per_page=100&page={page}") + jobs.extend(data["jobs"]) + if len(data["jobs"]) < 100: + break + page += 1 + self.jobs[run["id"]] = (run["updated_at"], now, jobs) + return jobs + + def snapshot(self) -> Snapshot: + runs: list[dict] = [] + page = 1 + while True: + data = self.api.get(f"/repos/{self.repo}/actions/workflows/{self.workflow_id}/runs" + f"?status=in_progress&per_page=100&page={page}") + runs.extend(data["workflow_runs"]) + if len(data["workflow_runs"]) < 100: + break + page += 1 + live = {run["id"] for run in runs} + self.jobs = {k: v for k, v in self.jobs.items() if k in live} + + lock_times = self.locks() + snap = Snapshot(priority=self.labelled(PRIORITY_LABEL), locked=set(lock_times), lock_times=lock_times) + special = snap.priority | snap.locked + for run in runs: + jobs = self.run_jobs(run) + admit = next((j for j in jobs if is_admit(j)), None) + if admit is None: + continue # still planning: not asking for anything yet + declared = parse_reservation(admit["name"]) + if declared is None: + continue + pr = self.verified_pr(admit["name"], run, special) + if admit["status"] != "completed": + snap.waiters.append(Waiter(run["id"], (admit["created_at"], admit["id"]), + need_of(declared), admit["status"] == "in_progress", pr)) + elif admit["conclusion"] == "success": + since = seconds_since(admit.get("completed_at")) + snap.holding.append(Holding(need_of(held(declared, jobs, since)), pr, stalled_for(jobs))) + return snap + + def labelled(self, label: str) -> set[int]: + """Open pull requests carrying `label`.""" + found: set[int] = set() + page = 1 + while True: + issues = self.api.get(f"/repos/{self.repo}/issues?state=open&labels={quote(label)}" + f"&per_page=100&page={page}") + found |= {i["number"] for i in issues if "pull_request" in i} + if len(issues) < 100: + return found + page += 1 + + def locks(self) -> dict[int, str]: + """Pull requests labelled ci:lock less than LOCK_HOURS ago, and when.""" + hours = float(os.environ.get("CI_LOCK_HOURS") or LOCK_HOURS) + locked: dict[int, str] = {} + for number in self.labelled(LOCK_LABEL): + added = None + page = 1 + while True: + events = self.api.get(f"/repos/{self.repo}/issues/{number}/events?per_page=100&page={page}") + for event in events: + if event.get("event") == "labeled" and event.get("label", {}).get("name") == LOCK_LABEL: + added = event["created_at"] + if len(events) < 100: + break + page += 1 + if added and seconds_since(added) < hours * 3600: + locked[number] = added + return locked + + def verified_pr(self, admit_name: str, run: dict, special: set[int]) -> int | None: + """The pull request a run claims, if it matters and the run is really its head.""" + match = PR_CLAIM.search(admit_name) + if not match or int(match.group(1)) not in special or run.get("event") != "pull_request": + return None + number = int(match.group(1)) + pull = self.api.get(f"/repos/{self.repo}/pulls/{number}") + return number if pull.get("head", {}).get("sha") == run.get("head_sha") else None + + +def env_int(name: str, default: int) -> int: + value = os.environ.get(name, "").strip() + return int(value) if value.isdigit() else default + + +def summary(text: str) -> None: + print(text) + path = os.environ.get("GITHUB_STEP_SUMMARY") + if path: + with open(path, "a") as f: + f.write(text + "\n") + + +def main() -> int: + mine_counts = parse_reservation(os.environ["CI_RESERVATION"]) + if mine_counts is None: + print(f"::warning::unreadable reservation {os.environ['CI_RESERVATION']!r}; not waiting") + return 0 + mine = need_of(mine_counts) + if os.environ.get("CI_ADMISSION", "on").lower() in ("off", "false", "0"): + summary("Admission control is off (CI_ADMISSION); starting at once.") + return 0 + if mine["total"] <= 1: + summary("Nothing to test but the result job; starting at once.") + return 0 + + budget = { + # The organization's hosted-runner concurrency limit (20 jobs, 5 on macOS). + "total": env_int("CI_BUDGET_TOTAL", 20), + "macos": env_int("CI_BUDGET_MACOS", 5), + "windows": env_int("CI_BUDGET_WINDOWS", 10), + } + max_wait = env_int("MAX_WAIT_MINUTES", 120) * 60 + debounce = env_int("CI_DEBOUNCE_SECONDS", 60) if os.environ.get("GITHUB_EVENT_NAME") == "pull_request" else 0 + + repo = os.environ["GITHUB_REPOSITORY"] + me = int(os.environ["GITHUB_RUN_ID"]) + api = Api(os.environ["GITHUB_TOKEN"], os.environ.get("GITHUB_API_URL", "https://api.github.com")) + started = time.time() + + if debounce: + # A newer push to the same pull request cancels this run (ci.yml's concurrency group): + # pushes in quick succession only start the last one. + print(f"Waiting {debounce}s for further pushes") + time.sleep(debounce) + + try: + workflow_id = api.get(f"/repos/{repo}/actions/runs/{me}")["workflow_id"] + except (OSError, RateLimited, KeyError, ValueError) as error: + print(f"::warning::admission unavailable ({error}); starting at once") + return 0 + scheduler = Scheduler(api, repo, workflow_id) + + print(f"Reservation {mine}; budget {budget}") + failures = 0 + last = None + admissible_since: dict[int, float] = {} # mark_unresponsive's memory + while True: + waited = time.time() - started + try: + snap = scheduler.snapshot() + failures = 0 + except RateLimited as error: + print(f"::warning::{error}") + if error.wait > 600 or waited + error.wait > max_wait: + summary("::warning::Admission gave up (API rate limit); starting without a reservation.") + return 0 + time.sleep(error.wait) + continue + except (OSError, KeyError, ValueError) as error: # URLError, HTTPError, timeouts, bad JSON + failures += 1 + print(f"::warning::admission poll failed ({error})") + if failures >= 5: + summary("::warning::Admission unavailable (API errors); starting without a reservation.") + return 0 + time.sleep(30) + continue + + mark_unresponsive(me, snap, budget, admissible_since, time.time()) + decision = decide(me, mine, snap, budget) + ignored = sorted(w.run_id for w in snap.waiters if w.ignored) + state = (decision.position, tuple(decision.used.values()), tuple(decision.ahead.values()), tuple(ignored)) + if state != last: + print(f"[{waited / 60:5.1f} min] position {decision.position}, in use {decision.used}, " + f"needed ahead {decision.ahead}, {len(snap.waiters)} waiting, " + f"priority {sorted(snap.priority) or '-'}, locked {sorted(snap.locked) or '-'}, " + f"ignored (not taking their turn) {ignored or '-'}, API quota left {api.remaining}") + last = state + if decision.admit: + summary(f"Admitted after {waited / 60:.1f} min (reservation `{os.environ['CI_RESERVATION']}`, " + f"in use {decision.used}, budget {budget}, {api.requests} API requests).") + return 0 + if should_yield(me, snap, budget): + summary(f"::notice::Admitted runs' jobs are queued behind waiting admit jobs; after " + f"{waited / 60:.1f} min this run gives its runner back and starts without a reservation.") + return 0 + if waited > max_wait: + summary(f"::warning::Admission waited {waited / 60:.0f} min; starting without a reservation.") + return 0 + + # Every poll lists the runs and refetches the jobs of those that changed, from + # the repository's shared GITHUB_TOKEN quota: only the head of the queue polls often. + interval = {0: 30, 1: 60, 2: 120}.get(decision.position, 300) + if api.remaining < 400: + interval = max(interval, 600) + time.sleep(interval) + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/scripts/ci/emergency.py b/scripts/ci/emergency.py new file mode 100644 index 000000000..5ac1cb6d2 --- /dev/null +++ b/scripts/ci/emergency.py @@ -0,0 +1,122 @@ +#!/usr/bin/env python3 +"""CI emergency: give one pull request every runner, now. + +Run by .github/workflows/ci-emergency.yml (manual; needs write access). It: + + 1. adds the `ci:lock` label to the pull request (removing it first if it was + there, which restarts its CI_LOCK_HOURS), so admission keeps a full run's + runners for it until it is merged, closed or unlabelled + (scripts/ci/admit.py); + 2. cancels every other pull request's CI run that is queued, waiting for + admission or running (main and merge queue runs too, with CANCEL_MAIN); + 3. re-runs the pull request's latest CI run if none is in progress and the + last one did not pass. + +Cancelled pull requests need a push or a re-run afterwards. +""" + +from __future__ import annotations + +import json +import os +import sys +import urllib.request +from urllib.parse import quote + +LOCK_LABEL = "ci:lock" +ACTIVE = ("queued", "in_progress", "waiting", "pending", "requested") + + +def to_cancel(runs: list[dict], head_sha: str, cancel_main: bool) -> list[dict]: + """The active CI runs to cancel: every one not testing the pull request's head.""" + chosen = [] + for run in runs: + if run.get("status") not in ACTIVE or run.get("head_sha") == head_sha: + continue + if run.get("event") == "pull_request" or cancel_main: + chosen.append(run) + return chosen + + +def to_rerun(runs: list[dict], head_sha: str) -> dict | None: + """The pull request's latest CI run, if none is active and it did not pass.""" + own = sorted((r for r in runs if r.get("head_sha") == head_sha and r.get("event") == "pull_request"), + key=lambda r: r["id"], reverse=True) + if not own or any(r.get("status") in ACTIVE for r in own): + return None + return own[0] if own[0].get("conclusion") != "success" else None + + +def request(method: str, path: str, body: dict | None = None): + url = os.environ.get("GITHUB_API_URL", "https://api.github.com") + path + data = json.dumps(body).encode() if body is not None else None + req = urllib.request.Request(url, data=data, method=method, headers={ + "Authorization": f"Bearer {os.environ['GITHUB_TOKEN']}", + "Accept": "application/vnd.github+json", + "X-GitHub-Api-Version": "2022-11-28", + }) + with urllib.request.urlopen(req, timeout=30) as response: + text = response.read() + return json.loads(text) if text else None + + +def workflow_runs(repo: str, workflow: str) -> list[dict]: + runs: list[dict] = [] + for status in ACTIVE: + page = 1 + while True: + batch = request("GET", f"/repos/{repo}/actions/workflows/{workflow}/runs" + f"?status={status}&per_page=100&page={page}")["workflow_runs"] + runs.extend(batch) + if len(batch) < 100: + break + page += 1 + return runs + + +def main() -> int: + repo = os.environ["GITHUB_REPOSITORY"] + number = int(os.environ["PR"]) + cancel_main = os.environ.get("CANCEL_MAIN", "false") == "true" + pr = request("GET", f"/repos/{repo}/pulls/{number}") + if pr["state"] != "open": + print(f"::error::#{number} is {pr['state']}") + return 1 + head = pr["head"]["sha"] + + if any(label["name"] == LOCK_LABEL for label in pr.get("labels", [])): + request("DELETE", f"/repos/{repo}/issues/{number}/labels/{quote(LOCK_LABEL)}") + request("POST", f"/repos/{repo}/issues/{number}/labels", {"labels": [LOCK_LABEL]}) + lines = [f"### CI emergency for #{number}", "", f"Locked: `{LOCK_LABEL}` added to #{number}."] + + active = workflow_runs(repo, "ci.yml") + cancelled = [] + for run in to_cancel(active, head, cancel_main): + try: + request("POST", f"/repos/{repo}/actions/runs/{run['id']}/cancel") + cancelled.append(run) + except OSError as error: # already finished, or not cancellable + print(f"::warning::could not cancel run {run['id']}: {error}") + lines.append(f"Cancelled {len(cancelled)} other CI run(s):") + lines += [f"- [{r.get('display_title', r['id'])}]({r.get('html_url', '')}) ({r.get('event')})" for r in cancelled] + + recent = request("GET", f"/repos/{repo}/actions/workflows/ci.yml/runs?head_sha={head}&per_page=20")["workflow_runs"] + rerun = to_rerun(active + recent, head) + if rerun: + request("POST", f"/repos/{repo}/actions/runs/{rerun['id']}/rerun") + lines.append(f"Re-ran #{number}'s CI run {rerun['id']}.") + else: + lines.append(f"#{number}'s CI is running or passed; nothing to re-run.") + lines += ["", f"Remove `{LOCK_LABEL}` (or merge/close #{number}) to release the runners."] + + text = "\n".join(lines) + print(text) + summary = os.environ.get("GITHUB_STEP_SUMMARY") + if summary: + with open(summary, "a") as f: + f.write(text + "\n") + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/scripts/ci/nextest.toml b/scripts/ci/nextest.toml index 7666a4ada..0aace013d 100644 --- a/scripts/ci/nextest.toml +++ b/scripts/ci/nextest.toml @@ -22,3 +22,40 @@ retries = 2 [[profile.default.overrides]] filter = 'package(zeron-harness) & test(mcp_injection_reaches_isolated_server_processes)' retries = 2 + +# Windows used to run the zeron-ui library with `cargo test --test-threads=1`: +# every test in one process, where native platform state (fonts, DirectWrite, +# the message loop) is shared. nextest gives each test its own process, so they +# run side by side there too. If one turns out to share state across processes, +# put just it in a max-threads = 1 test group. + +# preview `discovery` tests bind the fixed port 7331 and serialize with a mutex, +# which does nothing when every test is its own process (nextest): one at a time. +[test-groups.preview-discovery] +max-threads = 1 + +[[profile.default.overrides]] +filter = 'binary_id(zeron-preview::discovery)' +test-group = 'preview-discovery' + +# `ci`: pull requests and main (NEXTEST_PROFILE=ci). Leaves out slow and soak +# tests, which the scheduled runs (default profile) still run: +# engine doc_host sync at 48-chat scale and against the real 30 s quantum / +# 10 s idle grace (the ~16 small sync_lifecycle tests cover the policy); +# harness codex: an app server that keeps dying (sleeps the real 1+3+8 s backoff); +# preview `leak` (RSS growth under churn) and the two discovery tests that +# assert nothing happens during a 5-7 s sleep. +# The cursor_shim stress test runs 14 rounds instead of 100 (ZERON_STRESS_ROUNDS). +[profile.ci] +default-filter = ''' +not ( + (package(zeron-engine) & ( + test(=doc_host::sync_lifecycle_tests::cold_jobs_get_a_real_timed_turn_without_any_writer_ending) + | test(=doc_host::sync_lifecycle_tests::slow_checkpoints_survive_idle_grace_with_all_slots_occupied) + | test(/^doc_host::sync_lifecycle_tests::forty_eight_/))) + | (binary_id(zeron-harness::codex) & test(=an_app_server_that_keeps_dying_reports_what_it_printed)) + | binary_id(zeron-preview::leak) + | (binary_id(zeron-preview::discovery) & (test(=a_discovered_server_is_probed_once_not_every_cycle) + | test(=authentication_callbacks_receive_no_discovery_connections))) +) +''' diff --git a/scripts/ci/plan.py b/scripts/ci/plan.py new file mode 100644 index 000000000..07570bec1 --- /dev/null +++ b/scripts/ci/plan.py @@ -0,0 +1,514 @@ +#!/usr/bin/env python3 +"""Decide which CI suites a run needs and how many runners it reserves. + +Run by the `plan` job of .github/workflows/ci.yml. Inputs come from the +environment (see main()); outputs are written to $GITHUB_OUTPUT: + + suites JSON object, suite name -> true/false + reservation "linux=N windows=N macos=N", the runners the run will use. The + admit job carries it in its name so that other runs' admission + (scripts/ci/admit.py) can read it. + tier "fast" (pull requests) or "full" (main, merge queue, manual, + `ci:full` label, CI_PR_TIER=full) + keys JSON object, suite -> cache key prefix under which its jobs record + a pass (scripts/ci/reuse.py) + skip JSON object, suite -> jobs that already passed on the same + inputs and are skipped (Windows and voice skip single jobs; the + other suites only run or skip as a whole) + flags JSON object, suite -> optional steps to run (fast tier: only + for their own files): ui "browser", macos "fixtures" + pr the pull request number (pull requests only), for the admit job name + +Reuse. A selected suite whose inputs (scripts/ci/reuse.py) are unchanged since +its jobs passed, on this pull request or on main, is skipped, as are single +Windows and voice jobs that passed while the others did not. + +Tiers. Every suite has a broad path list (what used to trigger its workflow). +On the full tier a suite runs when any changed file matches it. On the fast +tier the expensive platform suites (Windows, macOS native, voice platforms, +Android) only run when the change can plausibly be platform specific: their +own files, or Rust/script hunks that mention the platform (cfg(windows), +target_os, objc, WebKit...). Linux, iOS (already selective) and the cheap +suites run as on the full tier. Changes to CI itself run everything. + +Nightly only. Some checks cost more runner time than the regressions they +catch on pull requests and main (NIGHTLY_SUITES, NIGHTLY_FLAGS): they run on +the nightly schedule, on manual runs and with the `ci:full` label. +""" + +from __future__ import annotations + +import json +import os +import re +import subprocess +import sys +import urllib.request + +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +import reuse # noqa: E402 +from reuse import matches # noqa: E402 + +# Suite -> (job, runner) for each job it starts; the job name is also the name its +# pass is recorded under. Keep in step with the reusable workflows +# (scripts/tests/test_ci_plan.py checks). +SUITE_JOBS: dict[str, list[tuple[str, str]]] = { + "core": [("core-tests", "linux")], # ui-tests.yml + "ui": [("ui-tests", "linux")], # ui-tests.yml (UI + Linux browser) + "cursor": [("cursor-compatibility", "linux")], # cursor-compatibility.yml + "edge": [("edge", "linux")], # preview-tests.yml + "installer": [("desktop-entry", "linux")], # linux-installer.yml + "voice": [("offline-linux", "linux"), ("windows-runtime", "windows")], # voice-tests.yml + "windows": [("tests", "windows"), ("app", "windows")], # windows.yml + "macos": [("macos-native", "macos")], # macos.yml + "frame_source": [("macos-frame-source", "macos")], # macos.yml + "ios": [("ios-core", "linux"), ("ios-tests", "macos")], # macos.yml (+ android publish below) + "android": [("apk", "linux")], # android.yml (+ publish on main, added below) +} +# Run only nightly, manually or with `ci:full` (see the module docstring): voice +# (the AEC3 audio stack and the packaged Windows media runtime; no failures of +# their own in the two weeks measured, and the rest of voice is tested in +# core-tests, ios-core and the Windows tests) and the Linux native browser +# fixture (its failures were window-timing flakes and package downloads). +NIGHTLY_SUITES = ("voice",) +NIGHTLY_FLAGS = (("ui", "browser"),) +# Suites whose jobs are independent, so one can be skipped while another runs. +SPLITTABLE = ("voice", "windows") + +CARGO = ["Cargo.toml", "Cargo.lock", "rust-toolchain.toml"] +CI_SELF = [ + ".github/workflows/ci.yml", + "scripts/ci/plan.py", + "scripts/ci/admit.py", + "scripts/ci/reuse.py", +] + +# The apps link the Rust mobile core and everything it depends on (iOS and Android). +# main() replaces this with zeron-mobile's dependency closure from the Cargo.toml +# files; this list is the fallback when they cannot be read. +MOBILE_CORE = [ + "crates/mobile/**", "crates/client/**", "crates/text/**", "crates/markdown/**", + "crates/doc/**", "crates/sync/**", "crates/proto/**", "crates/rpc/**", "crates/syntax/**", + "crates/orb/**", "crates/voice-session/**", "crates/visual/**", "crates/visual-gpu/**", + "crates/term/**", "crates/term-link/**", "crates/veil/**", "crates/zatex/**", "crates/preview/**", +] + +# Voice: the WebRTC audio stack (zeron-audio, which nothing else builds yet) and +# the packaged Windows media runtime. The rest of voice is tested where it is +# built: protocol and transport in core-tests, mobile voice in ios-core, +# voice-media in core-tests and the Windows tests. +VOICE_PATHS = ["crates/audio/**", "crates/voice-media/**", "dist/voice/**", "scripts/package-voice-runtime.py", + "scripts/codex-voice-remote-smoke.py", "scripts/tests/*voice*", ".github/workflows/voice-tests.yml"] + +BROAD: dict[str, list[str]] = { + "core": CARGO + ["crates/**", "apps/zeron/**", "scripts/ci/**", ".github/actions/linux-ci/**", + ".github/workflows/ui-tests.yml"], + "ui": CARGO + ["crates/**", "scripts/ci/**", ".github/actions/linux-ci/**", + "scripts/test-linux-browser.sh", "scripts/test-browser-storage.py", + ".github/workflows/ui-tests.yml"], + "cursor": CARGO + ["crates/harness/**", "crates/doc/**", "crates/engine/**", + "scripts/*cursor-sdk*", ".github/workflows/cursor-*.yml"], + "edge": ["edge/**", ".github/workflows/preview-tests.yml"], + "installer": ["edge/src/install.sh", "scripts/package-linux.sh", "scripts/test-linux-desktop-entry.sh", + "scripts/ci/apt-install.sh", "dist/zeron.desktop", "dist/zeron.png", + ".github/workflows/linux-installer.yml"], + "voice": CARGO + VOICE_PATHS, + "windows": CARGO + ["crates/**", "apps/zeron/**", "dist/windows/**", "scripts/test-windows-*.ps1", + "scripts/package-windows.ps1", ".github/actions/windows-ci-setup/**", + ".github/workflows/windows.yml"], + "macos": CARGO + ["crates/**", "apps/zeron/**", "edge/**", "scripts/run-macos-browser-fixture.sh", + "scripts/test-browser-storage.py", "scripts/ci/run-macos-fixture.sh", + "dist/macos/Info.plist", ".github/workflows/macos.yml"], + # Tests the pinned GPUI checkout: only when the pin moves (see gpui_moved()). + "frame_source": [".github/workflows/macos.yml"], + "ios": CARGO + MOBILE_CORE + ["apps/ios/**", "scripts/ios/**", ".github/workflows/macos.yml"], + "android": CARGO + ["apps/android/**", "crates/**", "scripts/android/**", "apps/ios/Zeron/Fonts/**", + "apps/ios/Zeron/Assets.xcassets/**", ".github/workflows/android.yml"], +} + +# Fast tier: the files that always select the platform suite... +FAST_PATHS: dict[str, list[str]] = { + "voice": VOICE_PATHS, + "windows": CARGO + ["apps/zeron/**", "dist/windows/**", "scripts/test-windows-*.ps1", + "scripts/package-windows.ps1", ".github/actions/windows-ci-setup/**", + ".github/workflows/windows.yml", "crates/update/**"], + "macos": CARGO + ["apps/zeron/**", "crates/update/**", "crates/preview/**", "crates/text/**", + "edge/package.json", "edge/package-lock.json", "scripts/run-macos-browser-fixture.sh", + "scripts/test-browser-storage.py", "scripts/ci/run-macos-fixture.sh", + "dist/macos/Info.plist", ".github/workflows/macos.yml"], + # The Rust is the same code the Linux suites test (no Android cfg), so a pull + # request builds the APK for the app, the FFI crate and dependency changes. + "android": CARGO + ["apps/android/**", "scripts/android/**", "crates/mobile/**", "crates/mobile-bindgen/**", + "apps/ios/Zeron/Fonts/**", "apps/ios/Zeron/Assets.xcassets/**", + ".github/workflows/android.yml"], +} + +# Fast tier: jobs and steps of a selected suite that only run for their own files. +# On the full tier everything runs. +JOB_PATHS: dict[tuple[str, str], list[str]] = { + # Release build, packaging, installer and startup probes (`tests` already + # compiles the app). + ("windows", "app"): CARGO + ["apps/zeron/**", "dist/windows/**", "scripts/test-windows-*.ps1", + "scripts/package-windows.ps1", ".github/actions/windows-ci-setup/**", + ".github/workflows/windows.yml", "crates/update/**"], + # The simulator unit tests (and the bindings they link): the app, the FFI + # crate and the client it wraps; ios-core tests the rest of the mobile core. + ("ios", "ios-tests"): CARGO + ["apps/ios/**", "scripts/ios/**", "crates/mobile/**", "crates/mobile-bindgen/**", + "crates/client/**", ".github/workflows/macos.yml"], +} +# Fast tier: optional steps (flags passed to the suite workflow, and part of its fingerprint). +FLAG_PATHS: dict[tuple[str, str], list[str]] = { + # Native browser fixture on X11/Wayland/OpenGL. + ("ui", "browser"): CARGO + ["crates/ui/src/browser/**", "crates/ui/examples/browser-fixture*", + "scripts/test-linux-browser.sh", "scripts/test-browser-storage.py", + ".github/workflows/ui-tests.yml"], + # WebKit browser fixture and the preview (HMR) fixture. + ("macos", "fixtures"): CARGO + ["crates/ui/src/browser/**", "crates/ui/examples/browser-fixture*", + "crates/ui/examples/preview-fixture*", "crates/preview/**", "edge/**", + "scripts/run-macos-browser-fixture.sh", "scripts/test-browser-storage.py", + "scripts/ci/run-macos-fixture.sh", ".github/workflows/macos.yml"], +} + +# A version bump (workspace version in Cargo.toml and the workspace packages' +# versions in Cargo.lock) changes no code: it selects nothing and is left out of +# the fingerprints (reuse.py). +VERSION_LINE = re.compile(r'^\s*version\s*=\s*"[^"]*"\s*$') + + +# ...and, for files under crates/, platform markers in the file name or in the +# changed code (comments are ignored: "as on Windows" changes nothing). A +# platform conditional (target_os, cfg(unix), cfg(not(windows))...) counts for +# both, since it decides what each of them compiles; cfg(windows) only for Windows. A Rust file without a +# diff (too large, binary) counts too. +PLATFORM_CFG = r"target_os|target_family|target_vendor|cfg!?\(\s*(?:not\(\s*(?:unix|windows)|unix)\b" +PLATFORM_PATHS = { + "windows": re.compile(r"(?:^|[/_.-])(?:windows|win32)(?:[/_.-]|$)", re.IGNORECASE), + "macos": re.compile(r"(?:^|[/_.-])(?:macos|darwin|apple|coretext|webkit)(?:[/_.-]|$)", re.IGNORECASE), +} +PLATFORM_CODE = { + "windows": re.compile(PLATFORM_CFG + r"|cfg!?\(\s*windows\b|\bwindows(?:_sys)?::|\bwin32|\bwinapi\b|\bmsvc\b|\bhwnd\b" + r"|direct3d|directwrite|\bdwrite|\bd3d1[12]|gpui_windows", re.IGNORECASE), + "macos": re.compile(PLATFORM_CFG + r"|\bobjc2?\b|\bcocoa\b|\bappkit\b|core_?text|\bwebkit|wkwebview" + r"|\bns(?:view|window|string|app|event)\b|gpui_macos|\bcore_foundation", re.IGNORECASE), +} +COMMENT = re.compile(r"^\s*(?://|/\*|\*)") + + +PLATFORM_FAST_SUITES = ("voice", "windows", "macos", "android") + + +def changed_code(patch: str) -> str: + """The added and removed lines of a diff, without comments.""" + lines = [] + for line in patch.splitlines(): + if line[:1] not in "+-" or line.startswith(("+++", "---")): + continue + code = line[1:] + if COMMENT.match(code): + continue + lines.append(code.split("//", 1)[0]) + return "\n".join(lines) + + +def platform_specific(platform: str, files: list[dict]) -> bool: + for f in files: + path = f["filename"] + if not path.startswith("crates/"): + continue + if PLATFORM_PATHS[platform].search(path): + return True + patch = f.get("patch") + if patch is None: + if path.endswith(".rs"): + return True + continue + if PLATFORM_CODE[platform].search(changed_code(patch)): + return True + return False + + +def version_only(f: dict) -> bool: + """A Cargo.toml / Cargo.lock change that only changes `version = "..."` lines.""" + if f["filename"] not in ("Cargo.toml", "Cargo.lock") or f.get("patch") is None: + return False + changed = [line[1:] for line in f["patch"].splitlines() + if line[:1] in "+-" and not line.startswith(("+++", "---"))] + return bool(changed) and all(VERSION_LINE.match(line) for line in changed) + + +def gpui_moved(files: list[dict]) -> bool: + """Whether the pinned GPUI (zeronsh/zui) checkout changed.""" + for f in files: + if f["filename"] not in ("Cargo.toml", "Cargo.lock"): + continue + patch = f.get("patch") + if patch is None or re.search(r"^[+-].*(gpui|zui)", patch, re.MULTILINE): + return True + return False + + +def plan(files: list[dict] | None, tier: str, mobile: list[str] | None = None, + nightly: bool = False) -> dict[str, bool]: + """files: [{"filename", "previous_filename"?, "patch"?}], or None for "everything". + + `nightly`: the nightly schedule, a manual run or `ci:full`, which also run NIGHTLY_SUITES. + """ + suites = select(files, tier, mobile) + if not nightly: + for suite in NIGHTLY_SUITES: + suites[suite] = False + return suites + + +def select(files: list[dict] | None, tier: str, mobile: list[str] | None) -> dict[str, bool]: + if files is None: + return {suite: True for suite in SUITE_JOBS} + files = [f for f in files if not version_only(f)] + paths = {f["filename"] for f in files} | {f["previous_filename"] for f in files if f.get("previous_filename")} + if any(p in CI_SELF for p in paths): + return {suite: True for suite in SUITE_JOBS} + + broad = dict(BROAD) + if mobile is not None: + broad["ios"] = CARGO + mobile + ["apps/ios/**", "scripts/ios/**", ".github/workflows/macos.yml"] + suites = {suite: any(matches(p, broad[suite]) for p in paths) for suite in SUITE_JOBS} + suites["frame_source"] = suites["frame_source"] or gpui_moved(files) + if tier == "fast": + for suite in PLATFORM_FAST_SUITES: + if not suites[suite]: + continue + fast = any(matches(p, FAST_PATHS[suite]) for p in paths) + if not fast and suite in PLATFORM_CODE: + fast = platform_specific(suite, files) + suites[suite] = fast + return suites + + +def gated(files: list[dict] | None, tier: str, suites: dict[str, bool], + nightly: bool = False) -> tuple[dict[str, list[str]], dict[str, list[str]]]: + """Fast tier: (jobs not needed, flags on) per selected suite. The full tier runs + everything but NIGHTLY_FLAGS, which only `nightly` runs.""" + paths = None if files is None else ({f["filename"] for f in files} + | {f["previous_filename"] for f in files if f.get("previous_filename")}) + everything = tier != "fast" or paths is None or any(p in CI_SELF for p in paths) + off: dict[str, list[str]] = {} + flags: dict[str, list[str]] = {} + for (suite, job), patterns in JOB_PATHS.items(): + if suites.get(suite) and not everything and not any(matches(p, patterns) for p in paths): + off.setdefault(suite, []).append(job) + for (suite, flag), patterns in FLAG_PATHS.items(): + if (suite, flag) in NIGHTLY_FLAGS and not nightly: + continue + if suites.get(suite) and (everything or any(matches(p, patterns) for p in paths)): + flags.setdefault(suite, []).append(flag) + return off, flags + + +def jobs_to_run(suites: dict[str, bool], skip: dict[str, list[str]] | None = None) -> dict[str, list[tuple[str, str]]]: + skip = skip or {} + return {suite: [job for job in SUITE_JOBS[suite] if job[0] not in skip.get(suite, ())] + for suite, enabled in suites.items() if enabled} + + +def reservation(running: dict[str, list[tuple[str, str]]], event: str, ref: str) -> dict[str, int]: + counts = {"linux": 1, "windows": 0, "macos": 0} # 1: the final `CI result` job + for jobs in running.values(): + for _, runner in jobs: + counts[runner] += 1 + if running.get("android") and event == "push" and ref == "refs/heads/main": + counts["linux"] += 1 # android.yml publish + return counts + + +def reused_jobs(suites: dict[str, bool], passed: dict[str, set[str]], + off: dict[str, list[str]] | None = None) -> dict[str, list[str]]: + """Jobs to skip: all of a suite's (needed ones) when they all passed, or single ones of SPLITTABLE suites.""" + off = off or {} + skip: dict[str, list[str]] = {} + for suite, enabled in suites.items(): + if not enabled: + continue + jobs = [job for job, _ in SUITE_JOBS[suite] if job not in off.get(suite, ())] + done = [job for job in jobs if job in passed.get(suite, set())] + if len(done) == len(jobs) or (done and suite in SPLITTABLE): + skip[suite] = done + return skip + + +def format_reservation(counts: dict[str, int]) -> str: + return " ".join(f"{k}={counts[k]}" for k in ("linux", "windows", "macos")) + + +# GitHub API -------------------------------------------------------------------------------------- + +def api(path: str): + url = os.environ.get("GITHUB_API_URL", "https://api.github.com") + path + request = urllib.request.Request(url, headers={ + "Authorization": f"Bearer {os.environ['GITHUB_TOKEN']}", + "Accept": "application/vnd.github+json", + "X-GitHub-Api-Version": "2022-11-28", + }) + with urllib.request.urlopen(request, timeout=30) as response: + return json.load(response) + + +def pull_request_files(repo: str, number: int, expected: int) -> list[dict] | None: + files: list[dict] = [] + page = 1 + while True: + batch = api(f"/repos/{repo}/pulls/{number}/files?per_page=100&page={page}") + files.extend(batch) + if len(batch) < 100: + break + page += 1 + # The API stops at 3000 files: run everything rather than guess. + return files if len(files) >= expected else None + + +def compare_files(repo: str, base: str, head: str) -> list[dict] | None: + if not base or set(base) == {"0"}: + return None + data = api(f"/repos/{repo}/compare/{base}...{head}") + files = data.get("files") + # compare lists at most 300 files. + if files is None or len(files) >= 300: + return None + return files + + +def main() -> int: + event = os.environ["GITHUB_EVENT_NAME"] + repo = os.environ["GITHUB_REPOSITORY"] + ref = os.environ.get("GITHUB_REF", "") + with open(os.environ["GITHUB_EVENT_PATH"]) as f: + payload = json.load(f) + + tier = "full" + # The nightly schedule and manual runs (and `ci:full`, below) also run the nightly-only checks. + nightly = event in ("schedule", "workflow_dispatch") + files: list[dict] | None = None + why = "" + # Refs whose recorded passes this run may reuse (none: run everything selected). + trusted: set[str] = set() + try: + if event == "pull_request": + # The pull request as it is now (not as in the event), so adding `ci:full` + # and re-running works. + pr = api(f"/repos/{repo}/pulls/{payload['pull_request']['number']}") + labels = {label["name"] for label in pr.get("labels", [])} + if "ci:full" in labels: + why = "label ci:full: every suite, nothing reused" + nightly = True + else: + # A fork's earlier runs could have recorded a pass for any fingerprint + # (its own edited workflows write the cache), including the one of the + # commit it asks to merge: forks reuse main's passes only, until the + # merge queue (which reuses nothing) is the required gate and + # CI_FORK_REUSE=own turns this back on. + head_repo = (pr.get("head", {}).get("repo") or {}).get("full_name") + fork = head_repo != repo + own = not fork or os.environ.get("CI_FORK_REUSE", "") == "own" + trusted = {ref, "refs/heads/main"} if own else {"refs/heads/main"} + if os.environ.get("CI_PR_TIER", "fast") == "full": + why = "CI_PR_TIER=full" + else: + tier = "fast" + files = pull_request_files(repo, pr["number"], pr.get("changed_files", 0)) + elif event == "push": + trusted = {"refs/heads/main"} + files = compare_files(repo, payload.get("before", ""), payload.get("after", "")) + elif event == "merge_group": + # The last gate before main: run everything selected, reuse nothing. + group = payload["merge_group"] + files = compare_files(repo, group["base_sha"], group["head_sha"]) + # workflow_dispatch and anything else: everything, nothing reused. + except (OSError, KeyError, ValueError) as error: # URLError, HTTPError, timeouts, bad JSON + print(f"::warning::could not list changed files ({error}); running every suite") + files = None + + mobile = None + try: + mobile = [d + "/**" for d in sorted(reuse.Workspace(".").closure(["zeron-mobile"]))] + ["crates/mobile-bindgen/**"] + except (OSError, ValueError, KeyError) as error: + print(f"::warning::could not read the workspace ({error}); using the static mobile core list") + selected = plan(files, tier, mobile, nightly) + off, flags = gated(files, tier, selected, nightly) + # What a job does depends on its gated jobs and flags too: they are part of the fingerprint. + variants = {suite: " ".join(f"-{j}" for j in off.get(suite, [])) + " " + " ".join(flags.get(suite, [])) + for suite, on in selected.items() if on} + keys: dict[str, str] = {} + extra: dict[str, list[str]] = {} + passed: dict[str, set[str]] = {} + try: + keys, extra, inputs = reuse.suite_keys([suite for suite, on in selected.items() if on], variants=variants) + uncovered = sorted(f["filename"] for f in files or [] + if matches(f["filename"], reuse.BUILD_PATHS) and not reuse.covered(f["filename"], inputs)) + if trusted and uncovered: + print(f"::notice::nothing reused: no suite fingerprint covers {', '.join(uncovered[:5])}") + why = (why + "; " if why else "") + "nothing reused (changed build files outside every fingerprint)" + trusted = set() + except (OSError, ValueError, KeyError, subprocess.CalledProcessError) as error: + print(f"::warning::could not fingerprint the suites ({error}); nothing is reused or recorded") + if trusted: + for suite, key in keys.items(): + try: + passed[suite] = reuse.passed_jobs(api, repo, key, trusted) + except (OSError, KeyError, ValueError) as error: + print(f"::warning::could not look up earlier passes of {suite} ({error})") + reused = reused_jobs(selected, passed, off) + skip = {suite: sorted(set(off.get(suite, [])) | set(reused.get(suite, []))) + for suite in set(off) | set(reused)} + running = jobs_to_run(selected, skip) + suites = {suite: bool(running.get(suite)) for suite in selected} + counts = reservation(running, event, ref) + out = { + "suites": json.dumps(suites, separators=(",", ":")), + "reservation": format_reservation(counts), + "tier": tier, + "keys": json.dumps(keys, separators=(",", ":")), + "skip": json.dumps(skip, separators=(",", ":")), + "flags": json.dumps(flags, separators=(",", ":")), + # The admit job names its pull request, for ci:priority and ci:lock (scripts/ci/admit.py). + "pr": str(payload["pull_request"]["number"]) if event == "pull_request" else "", + } + with open(os.environ["GITHUB_OUTPUT"], "a") as f: + for key, value in out.items(): + f.write(f"{key}={value}\n") + + summary = os.environ.get("GITHUB_STEP_SUMMARY") + lines = [f"### CI plan: {tier} tier{f' ({why})' if why else ''}", "", + f"Changed files: {'all (not listed)' if files is None else len(files)}", "", + "| suite | runs | |", "|---|---|---|"] + for suite, on in selected.items(): + if not on: + lines.append(f"| {suite} | – | not affected |") + continue + notes = [] + if reused.get(suite): + notes.append(f"reused (passed on the same inputs): {', '.join(reused[suite])}") + if off.get(suite): + notes.append(f"not needed for this change: {', '.join(off[suite])}") + if flags.get(suite): + notes.append(f"with {', '.join(flags[suite])}") + state = "yes" if running.get(suite) else "reused" if reused.get(suite) else "–" + lines.append(f"| {suite} | {state} | {'; '.join(notes)} |") + lines += ["", f"Reserved runners: `{out['reservation']}`"] + if tier == "fast": + lines += ["", "Windows, macOS and Android run on pull requests only when the change looks " + "platform specific. Add the `ci:full` label and re-run for everything."] + if not nightly: + lines += ["", "Nightly only (or with `ci:full`): voice and the Linux native browser fixture."] + files_read = {path for paths in extra.values() for path in paths} + if files_read: + lines += ["", "Files outside their packages that Rust suites read (part of their fingerprints): " + + ", ".join(f"`{p}`" for p in sorted(files_read))] + text = "\n".join(lines) + print(text) + if summary: + with open(summary, "a") as f: + f.write(text + "\n") + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/scripts/ci/reuse.py b/scripts/ci/reuse.py new file mode 100644 index 000000000..2c8494ed0 --- /dev/null +++ b/scripts/ci/reuse.py @@ -0,0 +1,304 @@ +"""Skip CI jobs that already passed on exactly the same inputs. + +A job's result depends on the files it builds and reads, not on which commit +they came from. plan.py fingerprints every suite's inputs in the tree being +tested (for a pull request, the merge with the current main) and asks the +Actions cache whether each of the suite's jobs already passed with that +fingerprint. Jobs record a pass as their last step (a tiny cache entry keyed +`-`); see the "Record the pass" steps in the suite workflows. + +A suite's inputs: + + - COMMON: the workspace manifest and lockfile, the toolchain and ci.yml; + - SUITE_INPUTS: its workflow, the CI scripts and actions it runs (not the + planner and scheduler), and the non-Rust files it uses; + - for Rust suites, the directories of the workspace packages it tests and of + every workspace package those depend on (Cargo.toml path dependencies, of + every kind), plus any file outside those directories that their Rust + sources name with a relative path ("../ui/src/file-icons.json", + CARGO_MANIFEST_DIR.join("../harness/tests/fixtures")), found by scanning + the sources on every run. + +Git object ids identify the contents, so the fingerprint is the hash of the +sorted (path, object id) list. The ids come from `git ls-tree` on the checked +out commit: no file needs to be read except the Rust sources that are scanned. + +Which passes count: a pull request trusts its own earlier runs and main's (a +fork only main's, unless CI_FORK_REUSE=own: its earlier runs could have +forged a pass for the fingerprint of the commit it asks to merge); main +trusts only main's; the merge queue, the last gate before main, reuses +nothing. If a pull request changes a Rust build file no selected suite's +fingerprint covers, nothing is reused either (fail closed). +The `ci:full` label and manual runs reuse nothing. + +Two refinements: a suite's gated jobs and optional steps (plan.py's JOB_PATHS +and FLAG_PATHS) are part of its fingerprint, since they change what its jobs +check; and the workspace version (Cargo.toml) and the workspace packages' +versions (Cargo.lock) are left out, since a version bump changes no code. +""" + +from __future__ import annotations + +import fnmatch +import hashlib +import os +import posixpath +import re +import subprocess +import tomllib + +VERSION = "v1" + +COMMON = [ + "Cargo.toml", "Cargo.lock", "rust-toolchain.toml", ".cargo/**", ".github/workflows/ci.yml", +] +# The CI files a suite runs. plan.py, admit.py, reuse.py and emergency.py decide +# which suites run and when, not whether their tests pass, so they are no input +# (a change to what a fingerprint means bumps VERSION instead). +LINUX_SETUP = [".github/actions/linux-ci/**", "scripts/ci/apt-install.sh", "scripts/ci/install-nextest.sh"] +NEXTEST = ["scripts/ci/nextest.toml"] + +SUITE_INPUTS: dict[str, list[str]] = { + "core": [".github/workflows/ui-tests.yml", "scripts/ci/test-core.sh"] + LINUX_SETUP + NEXTEST, + "ui": [".github/workflows/ui-tests.yml", "scripts/test-linux-browser.sh", "scripts/test-browser-storage.py"] + + LINUX_SETUP + NEXTEST, + "cursor": [".github/workflows/cursor-compatibility.yml", "scripts/*cursor-sdk*", "crates/harness/src/cursor/**"], + "edge": [".github/workflows/preview-tests.yml", "edge/**"], + "installer": [".github/workflows/linux-installer.yml", "edge/src/install.sh", "scripts/package-linux.sh", + "scripts/test-linux-desktop-entry.sh", "dist/zeron.desktop", "dist/zeron.png", + "scripts/ci/apt-install.sh"], + "voice": [".github/workflows/voice-tests.yml", "dist/voice/**", "scripts/package-voice-runtime.py", + "scripts/codex-voice-remote-smoke.py", "scripts/tests/*voice*"] + LINUX_SETUP + NEXTEST, + "windows": [".github/workflows/windows.yml", "dist/windows/**", "scripts/test-windows-*.ps1", + "scripts/package-windows.ps1", ".github/actions/windows-ci-setup/**"] + NEXTEST, + "macos": [".github/workflows/macos.yml", "edge/**", "scripts/run-macos-browser-fixture.sh", + "scripts/test-browser-storage.py", "dist/macos/**", "scripts/ci/run-macos-fixture.sh"] + NEXTEST, + "frame_source": [".github/workflows/macos.yml"], + "ios": [".github/workflows/macos.yml", "apps/ios/**", "scripts/ios/**"], + "android": [".github/workflows/android.yml", "apps/android/**", "scripts/android/**", + "apps/ios/Zeron/Fonts/**", "apps/ios/Zeron/Assets.xcassets/**"], +} + +# The workspace packages each suite builds and tests (their dependencies are added). +SUITE_PACKAGES: dict[str, list[str]] = { + "core": ["zeron-harness", "zeron-engine", "zeron-sync", "zeron-update", "zeron-doc", "zeron-preview", + "zeron-mcp", "zeron-proto", "zeron-rpc", "zeron-orb", "zeron-voice-session", "zeron-voice-media"], + "ui": ["zeron-ui"], + "voice": ["zeron-audio", "zeron-voice-media"], + "windows": ["zeron-ui", "zeron-harness", "zeron", "zeron-update", "zeron-proto", "zeron-engine", + "zeron-voice-media"], + "macos": ["zeron-update", "zeron-preview", "zeron-ui", "zeron-text", "zeron"], + "ios": ["zeron-mobile", "zeron-text", "zeron-markdown", "zeron-client"], + "android": ["zeron-mobile"], +} + +# A ../ path that names something (a bare "../.." names no file); "/../x" as in +# concat!(env!("CARGO_MANIFEST_DIR"), "/../x") too. +RELATIVE_PATH = re.compile(r'"/?((?:\.\./)+[^"\\\n{}./][^"\\\n{}]*)"') +# Paths the scan cannot follow: the package directory's parent reached in code. +# A suite whose sources do this reads the whole workspace (fail closed). +UNFOLLOWABLE = re.compile(r'CARGO_MANIFEST_DIR[^;]{0,200}?(?:\.parent\(\)|\.ancestors\(\)|join\(\s*"\.\.")') +EVERYTHING = ["crates/**", "apps/**", "scripts/**", "dist/**", "edge/**"] +DEPENDENCY_TABLES = ("dependencies", "dev-dependencies", "build-dependencies") + + +def matches(path: str, patterns: list[str]) -> bool: + for pattern in patterns: + if pattern.endswith("/**"): + if path.startswith(pattern[:-2]): + return True + elif fnmatch.fnmatchcase(path, pattern): + return True + return False + + +def tree_index(root: str = ".") -> dict[str, str]: + """path -> git object id for every file of HEAD (submodules: their commit).""" + out = subprocess.run(["git", "-C", root, "ls-tree", "-r", "-z", "--full-tree", "HEAD"], + check=True, capture_output=True).stdout.decode() + index = {} + for entry in out.split("\0"): + if entry: + meta, path = entry.split("\t", 1) + index[path] = meta.split()[2] + return index + + +class Workspace: + """Workspace packages and their path dependencies, from the Cargo.toml files.""" + + def __init__(self, root: str = "."): + self.root = root + with open(os.path.join(root, "Cargo.toml"), "rb") as f: + manifest = tomllib.load(f) + workspace = manifest["workspace"] + shared = workspace.get("dependencies", {}) + self.dirs: dict[str, str] = {} # package -> directory + manifests: dict[str, dict] = {} + for member in workspace["members"]: + with open(os.path.join(root, member, "Cargo.toml"), "rb") as f: + data = tomllib.load(f) + self.dirs[data["package"]["name"]] = member + manifests[member] = data + by_dir = {d: name for name, d in self.dirs.items()} + self.deps: dict[str, set[str]] = {} + for member, data in manifests.items(): + tables = [data.get(t, {}) for t in DEPENDENCY_TABLES] + for target in data.get("target", {}).values(): + tables += [target.get(t, {}) for t in DEPENDENCY_TABLES] + found = set() + for table in tables: + for key, spec in table.items(): + spec = spec if isinstance(spec, dict) else {} + name = spec.get("package", key) + path = spec.get("path") + if spec.get("workspace"): + shared_spec = shared.get(key, {}) + if isinstance(shared_spec, dict): + name = shared_spec.get("package", key) + path = shared_spec.get("path") + if path is not None: + target_dir = posixpath.normpath(posixpath.join(member, path)) if not spec.get( + "workspace") else posixpath.normpath(path) + if target_dir in by_dir: + found.add(by_dir[target_dir]) + elif name in self.dirs: + found.add(name) + self.deps[by_dir[member]] = found + + def closure(self, packages: list[str]) -> set[str]: + """The directories of `packages` and of everything they depend on.""" + seen: set[str] = set() + stack = [p for p in packages if p in self.dirs] + while stack: + package = stack.pop() + if package in seen: + continue + seen.add(package) + stack.extend(self.deps.get(package, ())) + return {self.dirs[p] for p in seen} + + def references(self, dirs: set[str], index: dict[str, str]) -> set[str]: + """Paths outside `dirs` that Rust sources in `dirs` name relatively.""" + found: set[str] = set() + for top in dirs: + for target in self._named_paths(top, index): + if target == "*" or not any(target == d or target.startswith(d + "/") for d in dirs): + found.add(target) + return found + + def _named_paths(self, top: str, index: dict[str, str]) -> set[str]: + """Every existing path a Rust file under `top` names with a ../ path.""" + cache = self.__dict__.setdefault("_named", {}) + if top in cache: + return cache[top] + named: set[str] = set() + for walk_dir, _, names in os.walk(os.path.join(self.root, top)): + rel_dir = posixpath.relpath(walk_dir.replace(os.sep, "/"), self.root.replace(os.sep, "/")) + for name in names: + if not name.endswith(".rs"): + continue + with open(os.path.join(walk_dir, name), encoding="utf-8", errors="replace") as f: + text = f.read() + if UNFOLLOWABLE.search(text): + named.add("*") + for literal in RELATIVE_PATH.findall(text): + # include_str!/include_bytes! resolve from the file, CARGO_MANIFEST_DIR from the package. + for base in (rel_dir, top): + target = posixpath.normpath(posixpath.join(base, literal)) + if not target.startswith("..") and exists(target, index): + named.add(target) + break + cache[top] = named + return named + + +def exists(path: str, index: dict[str, str]) -> bool: + if path in index: + return True + prefix = path.rstrip("/") + "/" + return any(p.startswith(prefix) for p in index) + + +VERSION_KEY = re.compile(r'^version\s*=\s*"[^"]*"\s*$', re.MULTILINE) + + +def without_versions(path: str, root: str) -> str | None: + """Cargo.toml without the workspace version, Cargo.lock without the workspace + packages' versions (a version bump changes no code); None for other files.""" + if path not in ("Cargo.toml", "Cargo.lock"): + return None + with open(os.path.join(root, path), encoding="utf-8") as f: + text = f.read() + if path == "Cargo.toml": + # Only [workspace.package] has a bare `version = "..."` line; dependencies use inline tables. + return hashlib.sha256(VERSION_KEY.sub("", text).encode()).hexdigest() + blocks = text.split("\n\n") + # Workspace packages are the [[package]] entries without a `source`. + kept = [VERSION_KEY.sub("", b) if "[[package]]" in b and "\nsource = " not in b else b for b in blocks] + return hashlib.sha256("\n\n".join(kept).encode()).hexdigest() + + +def fingerprint(suite: str, index: dict[str, str], patterns: list[str], dirs: set[str], + variant: str = "", root: str | None = None) -> str: + """Hash of every (path, object id) a suite depends on. `dirs` are file or directory paths.""" + prefixes = tuple(d.rstrip("/") + "/" for d in dirs) + lines = [] + for path, oid in index.items(): + if path in dirs or path.startswith(prefixes) or matches(path, patterns): + if root is not None: + oid = without_versions(path, root) or oid + lines.append(f"{path} {oid}") + lines.sort() + digest = hashlib.sha256(f"{VERSION}\n{suite}\n{variant.strip()}\n".encode()) + digest.update("\n".join(lines).encode()) + return digest.hexdigest()[:40] + + +def suite_keys(suites: list[str], root: str = ".", variants: dict[str, str] | None = None) -> tuple[dict[str, str], dict[str, list[str]], + dict[str, tuple[list[str], set[str]]]]: + """Per suite: cache key prefix, the paths outside its packages it reads, and its inputs.""" + index = tree_index(root) + workspace = Workspace(root) + keys: dict[str, str] = {} + extra: dict[str, list[str]] = {} + inputs: dict[str, tuple[list[str], set[str]]] = {} + for suite in suites: + patterns = COMMON + SUITE_INPUTS[suite] + dirs: set[str] = set() + if suite in SUITE_PACKAGES: + dirs = workspace.closure(SUITE_PACKAGES[suite]) + refs = workspace.references(dirs, index) + extra[suite] = sorted(r if r != "*" else "the whole workspace (a path built from " + "CARGO_MANIFEST_DIR's parent)" for r in refs) + if "*" in refs: + patterns = patterns + EVERYTHING + refs.discard("*") + dirs |= refs + variant = (variants or {}).get(suite, "") + keys[suite] = f"ci-pass-{VERSION}-{suite}-{fingerprint(suite, index, patterns, dirs, variant, root)}" + inputs[suite] = (patterns, dirs) + return keys, extra, inputs + + +def covered(path: str, inputs: dict[str, tuple[list[str], set[str]]]) -> bool: + """Whether some suite's fingerprint includes `path`.""" + for patterns, dirs in inputs.values(): + if path in dirs or any(path.startswith(d.rstrip("/") + "/") for d in dirs) or matches(path, patterns): + return True + return False + + +# Changed files here that no fingerprint covers mean the inputs are not understood: +# nothing is reused (fail closed). +BUILD_PATHS = ["crates/**", "apps/zeron/**", "Cargo.toml", "Cargo.lock", ".cargo/**", "rust-toolchain.toml"] + + +def passed_jobs(api, repo: str, key: str, trusted_refs: set[str]) -> set[str]: + """Jobs recorded as passed under `key` on a trusted ref.""" + data = api(f"/repos/{repo}/actions/caches?key={key}-&per_page=100") + jobs = set() + for cache in data.get("actions_caches", []): + if cache.get("ref") in trusted_refs and cache["key"].startswith(key + "-"): + jobs.add(cache["key"][len(key) + 1:]) + return jobs diff --git a/scripts/ci/test-core.sh b/scripts/ci/test-core.sh index a5c6aea8a..cb177936d 100755 --- a/scripts/ci/test-core.sh +++ b/scripts/ci/test-core.sh @@ -14,21 +14,37 @@ # zeron-engine lib + the integration tests named below. Engine has many other # integration binaries (live agents etc.) that no workflow ran, so # they are listed instead of globbed to avoid compiling them. +# voice (moved from voice-tests.yml offline-linux, which ran them as 14 separate +# `cargo test` builds): zeron-voice-media, zeron-voice-session and zeron-orb +# lib, zeron-proto lib `voice` tests, zeron-mcp lib, zeron-rpc +# device_room, engine voice_runtime and device_routing. They need no +# audio stack, and harness already depends on all of them. # nextest does not run doctests; these crates have none (their doc comments # contain no Rust code blocks). # Extra arguments are passed to nextest (the nightly job adds `--release`). +# NEXTEST_PROFILE=ci (pull requests and main) leaves out the slow and soak tests +# that scripts/ci/nextest.toml lists; the nightly runs use the default profile. set -euo pipefail cd "$(dirname "$0")/../.." +# Test binaries that run nothing on Linux are left out: they would still be +# compiled and linked. Windows-only files (#![cfg(windows)]), and files whose +# every test is #[ignore]d because it needs a live service or a real CLI. +skip=" codex_availability windows_native managed_install muse_account_live pi_live real_acp_lifecycle real_quiet_survey coordinator " tests=() for f in crates/harness/tests/*.rs crates/preview/tests/*.rs crates/doc/tests/*.rs; do - tests+=(--test "$(basename "$f" .rs)") + name="$(basename "$f" .rs)" + [[ "$skip" == *" $name "* ]] || tests+=(--test "$name") done -for t in session_publication restart_resume side_chats codex_subagents claude_subagents local_profiles message_queue pi_resume osc7501; do +# `misc` (harness, engine and preview): the small suites, one binary each. +# The orb geometry tests live in zeron-orb's `geometry`. +for t in misc geometry session_publication restart_resume side_chats message_queue voice_runtime device_routing device_room; do tests+=(--test "$t") done exec cargo nextest run --config-file scripts/ci/nextest.toml --locked --no-fail-fast \ -p zeron-harness -p zeron-engine -p zeron-sync -p zeron-update -p zeron-doc -p zeron-preview \ + -p zeron-mcp -p zeron-proto -p zeron-rpc -p zeron-orb -p zeron-voice-session -p zeron-voice-media \ --features zeron-harness/native-fixture \ - --lib --bins "${tests[@]}" "$@" + --lib --bins "${tests[@]}" \ + -E 'not ((package(zeron-proto) & not test(voice)) | (package(zeron-rpc) & kind(lib)))' "$@" diff --git a/scripts/ios/build-core.sh b/scripts/ios/build-core.sh index 6f4fb99bc..57f3fa2d1 100755 --- a/scripts/ios/build-core.sh +++ b/scripts/ios/build-core.sh @@ -9,7 +9,10 @@ # libzeron_mobile.a linked via LIBRARY_SEARCH_PATHS # include/module.modulemap `import zeron_coreFFI` (SWIFT_INCLUDE_PATHS) # and refreshes apps/ios/Zeron/Core/Generated/zeron_core.swift — committed so -# Xcode's synchronized folder always sees it; CI fails if it drifts. +# Xcode's synchronized folder always sees it — and apps/ios/CoreFFI/ (the C +# header and module map, committed so CI's simulator tests need no bindings +# build; outside the synchronized folders, so Xcode compiles nothing from it). +# CI fails if any of them drifts. set -euo pipefail ROOT="$(cd "$(dirname "$0")/../.." && pwd)" @@ -61,7 +64,8 @@ GEN="$OUT/gen" "$ROOT/target/mobile/uniffi-bindgen" generate --library "$LIB" --language swift --out-dir "$GEN" >/dev/null cp "$GEN/zeron_coreFFI.h" "$OUT/include/zeron_coreFFI.h" cp "$GEN/zeron_coreFFI.modulemap" "$OUT/include/module.modulemap" -# Only touch the Swift file when it changed so Xcode doesn't recompile it. -SWIFT_OUT="$ROOT/apps/ios/Zeron/Core/Generated/zeron_core.swift" -mkdir -p "$(dirname "$SWIFT_OUT")" -cmp -s "$GEN/zeron_core.swift" "$SWIFT_OUT" || cp "$GEN/zeron_core.swift" "$SWIFT_OUT" +# Only touch the committed files when they changed so Xcode doesn't recompile them. +refresh() { mkdir -p "$(dirname "$2")"; cmp -s "$1" "$2" || cp "$1" "$2"; } +refresh "$GEN/zeron_core.swift" "$ROOT/apps/ios/Zeron/Core/Generated/zeron_core.swift" +refresh "$GEN/zeron_coreFFI.h" "$ROOT/apps/ios/CoreFFI/zeron_coreFFI.h" +refresh "$GEN/zeron_coreFFI.modulemap" "$ROOT/apps/ios/CoreFFI/module.modulemap" diff --git a/scripts/tests/test_ci_admit.py b/scripts/tests/test_ci_admit.py new file mode 100644 index 000000000..ff23c4868 --- /dev/null +++ b/scripts/tests/test_ci_admit.py @@ -0,0 +1,464 @@ +"""scripts/ci/admit.py: when a waiting CI run may start.""" + +import pathlib +import sys +import unittest + +sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[2] / "scripts" / "ci")) + +import admit # noqa: E402 +from admit import Holding, Snapshot, Waiter, decide, held, need_of, parse_reservation # noqa: E402 + +BUDGET = {"total": 10, "macos": 3, "windows": 4} + + +def need(linux=0, windows=0, macos=0): + return need_of({"linux": linux, "windows": windows, "macos": macos}) + + +def held_(pr=None, **counts): + return Holding(need(**counts), pr) + + +def waiter(run, order, running=True, pr=None, **counts): + return Waiter(run, (f"2026-10-27T00:00:{order:02d}Z", order), need(**counts), running, pr) + + +def job(name, label, status="completed", conclusion="success"): + return {"name": name, "labels": [label], "status": status, "conclusion": conclusion} + + +class ReservationTests(unittest.TestCase): + def test_parse(self): + self.assertEqual(parse_reservation("admit [linux=3 windows=2 macos=1]"), + {"linux": 3, "windows": 2, "macos": 1}) + self.assertEqual(parse_reservation("admit [linux=1]"), {"linux": 1, "windows": 0, "macos": 0}) + self.assertIsNone(parse_reservation("admit []")) + + def test_reservations_are_capped_at_a_full_run(self): + # Another run's admit name comes from its own (editable) ci.yml. + self.assertEqual(parse_reservation("admit [linux=999 windows=50 macos=40]"), admit.MAX_RESERVATION) + + def test_cap_is_the_largest_plan(self): + sys.path.insert(0, str(pathlib.Path(admit.__file__).parent)) + import plan + everything = plan.reservation(plan.jobs_to_run({s: True for s in plan.SUITE_JOBS}), "push", + "refs/heads/main") + self.assertEqual(everything, admit.MAX_RESERVATION) + + def test_held_releases_finished_jobs(self): + declared = {"linux": 3, "windows": 2, "macos": 1} + jobs = [ + job("plan", "ubuntu-24.04"), + job("admit [linux=3 windows=2 macos=1]", "ubuntu-24.04"), + job("linux / core-tests", "ubuntu-24.04"), + job("windows / tests", "windows-2022", "in_progress", None), + job("macos / macos-native", "macos-latest", conclusion="failure"), + job("macos / macos-frame-source", "macos-latest", conclusion="skipped"), + ] + self.assertEqual(held(declared, jobs), {"linux": 2, "windows": 2, "macos": 0}) + + def test_jobs_that_never_appear_stop_counting(self): + declared = {"linux": 2, "windows": 0, "macos": 3} + jobs = [job("macos / macos-native", "macos-latest", "in_progress", None)] + self.assertEqual(held(declared, jobs, since_admitted=60)["macos"], 3) + # After CREATE_GRACE only the late jobs (result, Android publish) may still be missing. + self.assertEqual(held(declared, jobs, since_admitted=admit.CREATE_GRACE + 1), + {"linux": 2, "windows": 0, "macos": 1}) + self.assertEqual(held({"linux": 10, "windows": 3, "macos": 3}, [], since_admitted=admit.CREATE_GRACE + 1), + admit.LATE_JOBS) + self.assertEqual(held(declared, jobs, since_admitted=admit.UNSEEN_GRACE + 1), + {"linux": 0, "windows": 0, "macos": 1}) + + def test_stalled_for(self): + import time + stamp = lambda ago: time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime(time.time() - ago)) # noqa: E731 + jobs = [dict(job("linux / core-tests", "ubuntu-24.04", "queued", None), created_at=stamp(700)), + dict(job("macos / macos-native", "macos-latest", "queued", None), created_at=stamp(3000)), + dict(job("windows / tests", "windows-2022", "in_progress", None), created_at=stamp(5000))] + self.assertAlmostEqual(admit.stalled_for(jobs), 700, delta=5) # macOS queues behind its own limit + self.assertEqual(admit.stalled_for(jobs[1:]), 0) + + def test_seconds_since(self): + import time + stamp = time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime(time.time() - 120)) + self.assertAlmostEqual(admit.seconds_since(stamp), 120, delta=2) + self.assertEqual(admit.seconds_since(None), 0) + + def test_held_never_below_what_is_running(self): + jobs = [job(f"w{i}", "windows-2022", "in_progress", None) for i in range(3)] + self.assertEqual(held({"linux": 0, "windows": 2, "macos": 0}, jobs)["windows"], 3) + + +class DecideTests(unittest.TestCase): + def test_alone_starts(self): + snap = Snapshot([waiter(1, 1, linux=3, windows=2, macos=2)], []) + self.assertTrue(decide(1, need(linux=3, windows=2, macos=2), snap, BUDGET).admit) + + def test_waits_until_everything_fits(self): + snap = Snapshot([waiter(2, 2, macos=2)], [held_(linux=2, macos=2)]) + d = decide(2, need(macos=2), snap, BUDGET) + self.assertFalse(d.admit) # 2 + 2 macOS > 3 + snap.holding = [held_(linux=2, macos=1)] + self.assertTrue(decide(2, need(macos=2), snap, BUDGET).admit) + + def test_first_come_first_served(self): + snap = Snapshot([waiter(5, 1, windows=3), waiter(6, 2, windows=3)], [held_(windows=1)]) + self.assertTrue(decide(5, need(windows=3), snap, BUDGET).admit) + later = decide(6, need(windows=3), snap, BUDGET) + self.assertFalse(later.admit) + self.assertEqual(later.position, 1) + + def test_backfill_only_with_what_nobody_ahead_waits_for(self): + # Run 7 waits for macOS; run 8 needs only Linux and may go ahead... + holding = [held_(linux=1, macos=3)] + snap = Snapshot([waiter(7, 1, linux=1, macos=2), waiter(8, 2, linux=2)], holding) + self.assertFalse(decide(7, need(linux=1, macos=2), snap, BUDGET).admit) + self.assertTrue(decide(8, need(linux=2), snap, BUDGET).admit) + # ...but not into the total that run 7 will need. + snap.holding = [held_(linux=4, macos=3)] # 7 held + run 7's admit job + run 7's 3 ahead + 2 > 10 + self.assertFalse(decide(8, need(linux=2), snap, BUDGET).admit) + + def test_admit_jobs_ahead_hold_a_runner_those_behind_do_not_count(self): + ahead = [waiter(i, i, running=True, linux=1) for i in range(1, 4)] + behind = [waiter(i, i, running=True, linux=1) for i in range(20, 30)] + snap = Snapshot(ahead + [waiter(10, 10, linux=4)] + behind, [held_(linux=2)]) + d = decide(10, need(linux=4), snap, BUDGET) + # 2 held + 3 admit jobs ahead + 3 needed ahead + 4 > 10; the ten behind are not counted + self.assertEqual(d.used["total"], 5) + self.assertFalse(d.admit) + snap.holding = [] + self.assertTrue(decide(10, need(linux=4), snap, BUDGET).admit) # 3 + 3 + 4 <= 10 + + def test_no_circular_wait_behind_a_full_run(self): + # A full run at the head and many waiting behind it, each holding its admit + # runner: counting those as busy made the head wait for them and them for it. + big = {"total": 20, "macos": 5, "windows": 10} + full = need_of(admit.MAX_RESERVATION) + behind = [waiter(10 + i, 10 + i, linux=8, windows=1) for i in range(12)] + snap = Snapshot([waiter(1, 1, **{k: v for k, v in admit.MAX_RESERVATION.items()})] + behind, []) + self.assertTrue(decide(1, full, snap, big).admit) + # Once it holds its runners, the next one goes as soon as they free up. + snap.waiters = behind + snap.holding = [held_(**admit.MAX_RESERVATION)] + self.assertFalse(decide(10, need(linux=8, windows=1), snap, big).admit) + snap.holding = [held_(linux=2)] + self.assertTrue(decide(10, need(linux=8, windows=1), snap, big).admit) + + def test_oversized_run_goes_when_the_resource_is_idle(self): + snap = Snapshot([waiter(1, 1, macos=5)], []) + self.assertTrue(decide(1, need(macos=5), snap, BUDGET).admit) + snap.holding = [held_(macos=1)] + self.assertFalse(decide(1, need(macos=5), snap, BUDGET).admit) + + def test_unseen_self_queues_behind_everyone(self): + snap = Snapshot([waiter(2, 1, linux=8)], []) + d = decide(99, need(linux=3), snap, BUDGET) + self.assertEqual(d.position, 1) + self.assertFalse(d.admit) + + +class MisbehaviourTests(unittest.TestCase): + BIG = {"total": 20, "macos": 5, "windows": 10} + + def test_a_run_that_never_takes_its_turn_is_ignored(self): + # Run 1 claims a full run and its admit step never finishes (an edited ci.yml). + fake = waiter(1, 1, **admit.MAX_RESERVATION) + snap = lambda: Snapshot([waiter(1, 1, **admit.MAX_RESERVATION), waiter(2, 2, linux=6)], []) # noqa: E731 + since = {} + s = snap() + admit.mark_unresponsive(2, s, self.BIG, since, now=1000) + self.assertFalse(decide(2, need(linux=6), s, self.BIG).admit) # 16 ahead + 6 > 20 + s = snap() + admit.mark_unresponsive(2, s, self.BIG, since, now=1000 + admit.UNRESPONSIVE_GRACE + 1) + self.assertTrue(s.waiters[0].ignored) + self.assertTrue(decide(2, need(linux=6), s, self.BIG).admit) + self.assertEqual(fake.need, s.waiters[0].need) + + def test_a_run_that_cannot_start_yet_is_not_ignored(self): + since = {} + for now in (0, 10_000): + s = Snapshot([waiter(1, 1, macos=3), waiter(2, 2, linux=2)], [held_(macos=4)]) + admit.mark_unresponsive(2, s, self.BIG, since, now) + self.assertFalse(s.waiters[0].ignored) # it waits for macOS, as it should + # Nor one whose admit job has no runner yet. + s = Snapshot([waiter(1, 1, running=False, linux=2), waiter(2, 2, linux=2)], []) + admit.mark_unresponsive(2, s, self.BIG, {1: 0}, now=10_000) + self.assertFalse(s.waiters[0].ignored) + + def test_yield_only_when_admitted_jobs_starve_and_only_from_the_back(self): + waiters = [waiter(i, i, linux=3) for i in range(1, 11)] + snap = Snapshot(waiters, [Holding(need(linux=5), stalled=admit.STALL_SECONDS - 1)]) + self.assertFalse(any(admit.should_yield(i, snap, self.BIG) for i in range(1, 11))) + snap.holding[0].stalled = admit.STALL_SECONDS + 1 + keep = self.BIG["total"] // admit.KEEP_WAITING_SHARE + self.assertEqual([i for i in range(1, 11) if admit.should_yield(i, snap, self.BIG)], + list(range(keep + 1, 11))) + + +class PhysicalPoolTests(unittest.TestCase): + """Waiting admit jobs hold runners from the same pool as the suites. + + The decide()-only simulation (LivenessTests) assumes admitted runs always + get their runners. Here GitHub's pool is modelled too: a fixed number of + runners, handed to queued jobs (admit jobs and suite jobs alike) in the + order they were created. With enough runs waiting, their admit jobs took + the whole pool and nothing finished until MAX_WAIT_MINUTES; should_yield + must keep every queue draining. + """ + + def simulate(self, seed, yielding=True, runs_count=30, ticks=400): + import random + rng = random.Random(seed) + budget = {"total": 20, "macos": 5, "windows": 10} + tick_s = 60 + runs = {r: {"need": rng.randint(2, 6), "arrive": rng.randint(0, 5), "duration": rng.randint(3, 15), + "admitted": False, "done": 0} for r in range(1, runs_count + 1)} + queue = [] # [created tick, run, kind]; kind "admit" or "suite" + running = [] # [run, kind, ticks left] + for r, run in sorted(runs.items(), key=lambda kv: kv[1]["arrive"]): + queue.append([run["arrive"], r, "admit"]) + for tick in range(ticks): + # Suite jobs finish; GitHub hands free runners to the oldest queued jobs. + for job in [j for j in running if j[1] == "suite"]: + job[2] -= 1 + if job[2] <= 0: + running.remove(job) + runs[job[0]]["done"] += 1 + queue.sort() + while len(running) < budget["total"] and queue and queue[0][0] <= tick: + created, r, kind = queue.pop(0) + running.append([r, kind, runs[r]["duration"]]) + if all(run["done"] == run["need"] for run in runs.values()): + return tick + + def snapshot(): + waiters, holding = [], [] + for r, run in runs.items(): + if run["arrive"] > tick: + continue + if not run["admitted"]: + on_runner = any(j[0] == r and j[1] == "admit" for j in running) + waiters.append(Waiter(r, (run["arrive"], r), need(linux=run["need"]), on_runner)) + else: + left = run["need"] - run["done"] + queued = [c for c, q, k in queue if q == r and k == "suite"] + stalled = (tick - min(queued)) * tick_s if queued else 0 + holding.append(Holding(need(linux=left), None, stalled)) + return Snapshot(waiters, holding) + + for job in [j for j in running if j[1] == "admit"]: + r = job[0] + snap = snapshot() + go = decide(r, need(linux=runs[r]["need"]), snap, budget).admit + if go or (yielding and admit.should_yield(r, snap, budget)): + running.remove(job) + runs[r]["admitted"] = True + queue.extend([tick, r, "suite"] for _ in range(runs[r]["need"])) + return None + + def test_waiting_admit_jobs_never_starve_the_pool(self): + for seed in range(200): + self.assertIsNotNone(self.simulate(seed), f"seed {seed}: stuck") + + def test_without_yielding_the_pool_starves(self): + # The model reproduces the stall should_yield fixes. + self.assertTrue(any(self.simulate(seed, yielding=False) is None for seed in range(20))) + + +class PriorityAndLockTests(unittest.TestCase): + BIG = {"total": 50, "macos": 10, "windows": 16} + + def test_priority_goes_first(self): + snap = Snapshot([waiter(1, 1, linux=2, macos=3), waiter(2, 2, pr=77, linux=2, macos=3)], + [held_(macos=6)], priority={77}) + self.assertTrue(decide(2, need(linux=2, macos=3), snap, self.BIG).admit) + first = decide(1, need(linux=2, macos=3), snap, self.BIG) + self.assertFalse(first.admit) # 6 held + 3 for #77 ahead + 3 > 10 + self.assertEqual(first.position, 1) + + def test_others_backfill_only_around_priority(self): + snap = Snapshot([waiter(2, 1, pr=77, macos=4), waiter(3, 2, linux=3)], [held_(macos=8)], priority={77}) + self.assertFalse(decide(2, need(macos=4), snap, self.BIG).admit) # waits for macOS + self.assertTrue(decide(3, need(linux=3), snap, self.BIG).admit) # Linux only: fine + + def test_a_lock_holds_a_full_run_while_idle(self): + full = need_of(admit.MAX_RESERVATION) + snap = Snapshot([waiter(5, 1, linux=3, macos=2)], [held_(macos=6)], locked={90}) + d = decide(5, need(linux=3, macos=2), snap, self.BIG) + self.assertEqual(d.used["macos"], 6 + full["macos"]) + self.assertFalse(d.admit) # 6 + 3 locked + 2 > 10 + snap.holding = [held_(macos=5)] + self.assertTrue(decide(5, need(linux=3, macos=2), snap, self.BIG).admit) + + def test_the_locked_pull_request_goes_ahead_of_everyone_into_its_reservation(self): + others = [waiter(i, i, linux=5, macos=3) for i in range(1, 4)] + snap = Snapshot(others + [waiter(9, 9, pr=90, linux=10, windows=3, macos=4)], + [held_(linux=20, macos=6)], locked={90}, priority={1}) + d = decide(9, need(linux=10, windows=3, macos=4), snap, self.BIG) + self.assertTrue(d.admit) + self.assertEqual(d.position, 0) + + def test_the_lock_is_not_counted_twice_once_its_run_holds_runners(self): + snap = Snapshot([waiter(5, 1, macos=2)], [held_(pr=90, macos=4), held_(macos=4)], locked={90}) + self.assertEqual(decide(5, need(macos=2), snap, self.BIG).used["macos"], 8) + + def test_two_locks_do_not_wait_for_each_other(self): + big = {"total": 20, "macos": 5, "windows": 10} + full_counts = admit.MAX_RESERVATION + full = need_of(full_counts) + snap = Snapshot([waiter(1, 1, pr=90, **full_counts), waiter(2, 2, pr=91, **full_counts)], [], + locked={90, 91}, lock_times={90: "2026-10-27T10:00:00Z", 91: "2026-10-27T10:05:00Z"}) + self.assertTrue(decide(1, full, snap, big).admit) # the older lock goes + self.assertFalse(decide(2, full, snap, big).admit) # the newer one waits for the older + # The older lock keeps its runners until it is released; then the newer one goes. + snap.waiters = [w for w in snap.waiters if w.run_id == 2] + snap.locked, snap.lock_times = {91}, {91: "2026-10-27T10:05:00Z"} + snap.holding = [held_(pr=90, linux=2)] + self.assertTrue(decide(2, full, snap, big).admit) + + def test_an_unverified_claim_is_an_ordinary_run(self): + snap = Snapshot([waiter(1, 1, linux=2), waiter(2, 2, pr=None, linux=2)], [], priority={77}) + self.assertEqual(decide(2, need(linux=2), snap, self.BIG).position, 1) + + +class SchedulerLabelTests(unittest.TestCase): + class FakeApi: + def __init__(self, pulls, labels, events): + self.pulls, self.labels, self.events = pulls, labels, events + + def get(self, path): + if "/issues?" in path: + label = "ci:lock" if "ci%3Alock" in path else "ci:priority" + return [{"number": n, "pull_request": {}} for n in self.labels.get(label, [])] + if "/events" in path: + number = int(path.split("/issues/")[1].split("/")[0]) + return self.events.get(number, []) + if "/pulls/" in path: + return self.pulls[int(path.rsplit("/", 1)[1])] + raise AssertionError(path) + + def test_claims_are_verified_and_locks_expire(self): + import time + now = time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime()) + old = time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime(time.time() - 7 * 3600)) + lock_event = lambda when: [{"event": "labeled", "label": {"name": "ci:lock"}, "created_at": when}] # noqa: E731 + api = self.FakeApi({77: {"head": {"sha": "abc"}}}, + {"ci:priority": [77], "ci:lock": [90, 91]}, + {90: lock_event(now), 91: lock_event(old)}) + scheduler = admit.Scheduler(api, "o/r", 1) + self.assertEqual(set(scheduler.locks()), {90}) + run = {"event": "pull_request", "head_sha": "abc"} + self.assertEqual(scheduler.verified_pr("admit [linux=2] #77", run, {77}), 77) + self.assertIsNone(scheduler.verified_pr("admit [linux=2] #77", dict(run, head_sha="zzz"), {77})) + self.assertIsNone(scheduler.verified_pr("admit [linux=2] #12", run, {77})) + self.assertIsNone(scheduler.verified_pr("admit [linux=2] #77", dict(run, event="push"), {77})) + + +class EmergencyTests(unittest.TestCase): + def test_cancels_everything_but_the_locked_pull_request(self): + import emergency + runs = [ + {"id": 1, "status": "in_progress", "head_sha": "mine", "event": "pull_request"}, + {"id": 2, "status": "queued", "head_sha": "other", "event": "pull_request"}, + {"id": 3, "status": "in_progress", "head_sha": "main", "event": "push"}, + {"id": 4, "status": "completed", "head_sha": "old", "event": "pull_request"}, + ] + self.assertEqual([r["id"] for r in emergency.to_cancel(runs, "mine", False)], [2]) + self.assertEqual([r["id"] for r in emergency.to_cancel(runs, "mine", True)], [2, 3]) + + def test_reruns_only_when_nothing_is_running_and_it_did_not_pass(self): + import emergency + failed = {"id": 5, "status": "completed", "conclusion": "cancelled", "head_sha": "h", "event": "pull_request"} + passed = dict(failed, id=6, conclusion="success") + running = dict(failed, id=7, status="in_progress") + self.assertEqual(emergency.to_rerun([failed], "h")["id"], 5) + self.assertIsNone(emergency.to_rerun([failed, passed], "h")) # the latest passed + self.assertIsNone(emergency.to_rerun([failed, running], "h")) + self.assertIsNone(emergency.to_rerun([], "h")) + + +class SchedulerTests(unittest.TestCase): + """Snapshot building from API data, without the network.""" + + class FakeApi: + def __init__(self, runs, jobs): + self.runs, self.jobs, self.calls = runs, jobs, [] + + def get(self, path): + if "/issues?" in path: + return [] # no ci:priority or ci:lock labels + self.calls.append(path) + if "/workflows/" in path: + return {"workflow_runs": self.runs} + run = int(path.split("/runs/")[1].split("/")[0]) + return {"jobs": self.jobs[run]} + + def test_snapshot_and_caching(self): + runs = [{"id": 1, "updated_at": "a"}, {"id": 2, "updated_at": "a"}, {"id": 3, "updated_at": "a"}] + jobs = { + 1: [job("plan", "ubuntu-24.04"), job("admit [linux=2 macos=1]", "ubuntu-24.04"), + job("macos / macos-native", "macos-latest", "in_progress", None)], + 2: [dict(job("admit [linux=1 windows=2]", "ubuntu-24.04", "in_progress", None), + created_at="2026-10-27T00:00:01Z", id=20)], + 3: [job("plan", "ubuntu-24.04", "in_progress", None)], + } + api = self.FakeApi(runs, jobs) + scheduler = admit.Scheduler(api, "o/r", 9) + snap = scheduler.snapshot() + self.assertEqual([h.need for h in snap.holding], [need(linux=2, macos=1)]) + self.assertEqual([w.run_id for w in snap.waiters], [2]) + self.assertEqual(snap.waiters[0].need, need(linux=1, windows=2)) + self.assertEqual(len(api.calls), 4) + scheduler.snapshot() # nothing changed: only the run list is fetched again + self.assertEqual(len(api.calls), 5) + runs[0]["updated_at"] = "b" + scheduler.snapshot() + self.assertEqual(len(api.calls), 7) + + +if __name__ == "__main__": + unittest.main() + + +class LivenessTests(unittest.TestCase): + """Random queues always drain: whatever arrives, every run is eventually admitted.""" + + def test_random_queues_drain(self): + import random + budget = {"total": 20, "macos": 5, "windows": 10} + cap = admit.MAX_RESERVATION + for seed in range(3000): + rng = random.Random(seed) + runs = {} + for run in range(1, rng.randint(2, 14)): + counts = {r: rng.randint(0, cap[r]) for r in admit.RUNNERS} + counts["linux"] = max(counts["linux"], 1) + runs[run] = {"need": need(**counts), "pr": run, "arrive": rng.randint(0, 5), + "duration": rng.randint(1, 6)} + locked = set(rng.sample(sorted(runs), k=min(len(runs), rng.choice([0, 0, 1, 2])))) + priority = set(rng.sample(sorted(runs), k=min(len(runs), rng.choice([0, 1, 2])))) - locked + lock_times = {pr: f"2026-10-27T10:0{i}:00Z" for i, pr in enumerate(sorted(locked, key=lambda p: rng.random()))} + admitted, done = {}, set() + for tick in range(400): + for run, left in list(admitted.items()): + if left == 0: + del admitted[run] + done.add(run) + locked.discard(runs[run]["pr"]) # merged: the lock ends + else: + admitted[run] = left - 1 + waiting = [run for run in runs if run not in admitted and run not in done + and runs[run]["arrive"] <= tick] + for run in sorted(waiting, key=lambda r: rng.random()): # polls in any order + snap = Snapshot( + [Waiter(r, (f"t{runs[r]['arrive']:03d}", r), runs[r]["need"], True, runs[r]["pr"]) + for r in runs if r not in admitted and r not in done and runs[r]["arrive"] <= tick], + [Holding(runs[r]["need"], runs[r]["pr"]) for r in admitted], + priority=priority, locked=set(locked), + lock_times={p: t for p, t in lock_times.items() if p in locked}) + if decide(run, runs[run]["need"], snap, budget).admit: + admitted[run] = runs[run]["duration"] + if len(done) == len(runs): + break + self.assertEqual(len(done), len(runs), f"seed {seed}: stuck with {sorted(set(runs) - done)}") diff --git a/scripts/tests/test_ci_plan.py b/scripts/tests/test_ci_plan.py new file mode 100644 index 000000000..e9717efd0 --- /dev/null +++ b/scripts/tests/test_ci_plan.py @@ -0,0 +1,215 @@ +"""scripts/ci/plan.py: which suites a change selects, and the runners they reserve.""" + +import json +import pathlib +import sys +import unittest + +ROOT = pathlib.Path(__file__).resolve().parents[2] +sys.path.insert(0, str(ROOT / "scripts" / "ci")) + +import plan # noqa: E402 + + +def files(*paths, patch=""): + return [{"filename": p, "patch": patch} for p in paths] + + +def selected(suites): + return {name for name, on in suites.items() if on} + + +class PlanTests(unittest.TestCase): + def test_docs_only_runs_nothing(self): + self.assertEqual(selected(plan.plan(files("README.md", "docs/ci.md"), "fast")), set()) + + def test_ui_change_on_a_pull_request_stays_on_linux(self): + suites = plan.plan(files("crates/ui/src/shell.rs", patch="+let width = 3;"), "fast") + self.assertEqual(selected(suites), {"core", "ui"}) + + def test_ui_change_on_main_runs_every_platform_it_touches(self): + suites = plan.plan(files("crates/ui/src/shell.rs", patch="+let width = 3;"), "full") + self.assertEqual(selected(suites), {"core", "ui", "windows", "macos", "android"}) + + def test_platform_code_selects_its_platform(self): + windows = plan.plan(files("crates/ui/src/shell.rs", patch='+#[cfg(windows)]\n+fn f() {}'), "fast") + self.assertTrue(windows["windows"]) + self.assertFalse(windows["macos"]) + macos = plan.plan(files("crates/ui/src/browser.rs", patch="+ let view: WKWebView = make();"), "fast") + self.assertTrue(macos["macos"]) + self.assertFalse(macos["windows"]) + both = plan.plan(files("crates/term/src/pty.rs", patch='+#[cfg(target_os = "linux")]'), "fast") + self.assertTrue(both["windows"] and both["macos"]) + unix = plan.plan(files("crates/term/src/pty.rs", patch='+ if cfg!(unix) {'), "fast") + self.assertTrue(unix["windows"] and unix["macos"]) + objc = plan.plan(files("crates/notify/src/mac.rs", patch='+ let app: id = msg_send![class!(NSApp), sharedApplication];'), "fast") + self.assertTrue(objc["macos"]) + + def test_comments_and_window_identifiers_do_not_count(self): + for patch in ("+ /// it has no page (Windows), the search finds none of it.", + "+ cx.refresh_windows();", + "+ .usage_windows", + "+ // content leaves the keyboard with the page. AppKit gives it back", + "+let x = 1; // as zui does on Windows"): + suites = plan.plan(files("crates/ui/src/a.rs", patch=patch), "fast") + self.assertFalse(suites["windows"] or suites["macos"], patch) + + def test_context_lines_do_not_count(self): + patch = " #[cfg(windows)]\n fn f() {}\n+let x = 1;" + self.assertFalse(plan.plan(files("crates/ui/src/a.rs", patch=patch), "fast")["windows"]) + + def test_platform_file_names_count(self): + suites = plan.plan(files("crates/ui/src/platform/windows.rs", patch="+let x = 1;"), "fast") + self.assertTrue(suites["windows"]) + self.assertTrue(plan.plan(files("crates/ui/src/browser/macos.rs", patch="+let x = 1;"), "fast")["macos"]) + self.assertFalse(plan.plan(files("crates/ui/src/window_list.rs", patch="+let x = 1;"), "fast")["windows"]) + + def test_rust_file_without_a_diff_is_treated_as_platform_specific(self): + suites = plan.plan([{"filename": "crates/engine/src/huge.rs"}], "fast") + self.assertTrue(suites["windows"] and suites["macos"]) + + def test_lockfile_runs_every_rust_suite(self): + suites = plan.plan(files("Cargo.lock"), "fast") + self.assertEqual(selected(suites), {"core", "ui", "cursor", "windows", "macos", "ios", "android"}) + + def test_mobile_core_selects_ios_and_android(self): + suites = plan.plan(files("crates/sync/src/lib.rs", patch="+let x = 1;"), "fast") + self.assertTrue(suites["ios"]) + self.assertFalse(suites["android"]) # the same Rust as the Linux suites test + self.assertFalse(suites["windows"]) + self.assertTrue(plan.plan(files("crates/mobile/src/lib.rs", patch="+let x = 1;"), "fast")["android"]) + self.assertTrue(plan.plan(files("crates/sync/src/lib.rs", patch="+x"), "full")["android"]) + + def test_renamed_from_counts(self): + f = [{"filename": "docs/x.md", "previous_filename": "apps/ios/Zeron/X.swift", "patch": ""}] + self.assertTrue(plan.plan(f, "fast")["ios"]) + + def test_ci_changes_run_everything(self): + daytime = set(plan.SUITE_JOBS) - set(plan.NIGHTLY_SUITES) + self.assertEqual(selected(plan.plan(files("scripts/ci/admit.py"), "fast")), daytime) + self.assertEqual(selected(plan.plan(None, "fast")), daytime) + self.assertTrue(all(plan.plan(None, "full", nightly=True).values())) + + def test_voice_runs_only_nightly(self): + change = files("crates/audio/src/aec.rs", patch="+let x = 1;") + self.assertFalse(plan.plan(change, "fast")["voice"]) + self.assertFalse(plan.plan(change, "full")["voice"]) + self.assertTrue(plan.plan(change, "full", nightly=True)["voice"]) + + def test_edge_and_installer(self): + self.assertEqual(selected(plan.plan(files("edge/src/coordinator.ts"), "fast")), {"edge"}) + self.assertEqual(selected(plan.plan(files("edge/src/install.sh"), "fast")), {"edge", "installer"}) + self.assertTrue(plan.plan(files("edge/package-lock.json"), "fast")["macos"]) + + def test_version_bumps_select_nothing(self): + bump = [{"filename": "Cargo.toml", "patch": '@@ -37 +37 @@\n-version = "0.2.126"\n+version = "0.2.127"'}, + {"filename": "Cargo.lock", "patch": ' name = "zeron-ui"\n-version = "0.2.126"\n+version = "0.2.127"'}] + self.assertEqual(selected(plan.plan(bump, "full")), set()) + dep = [{"filename": "Cargo.lock", + "patch": '-version = "1.0.1"\n+version = "1.0.2"\n-checksum = "aa"\n+checksum = "bb"'}] + self.assertTrue(plan.plan(dep, "fast")["core"]) + + def test_frame_source_runs_when_the_gpui_pin_moves(self): + moved = [{"filename": "Cargo.toml", + "patch": '-gpui = { git = "https://github.com/zeronsh/zui", rev = "a" }\n' + '+gpui = { git = "https://github.com/zeronsh/zui", rev = "b" }'}] + self.assertTrue(plan.plan(moved, "fast")["frame_source"]) + other = [{"filename": "Cargo.toml", "patch": '+serde = "1"'}] + self.assertFalse(plan.plan(other, "full")["frame_source"]) + self.assertTrue(plan.plan(files(".github/workflows/macos.yml"), "fast")["frame_source"]) + + def test_jobs_and_steps_for_their_own_files(self): + change = files("crates/ui/src/shell.rs", patch='+#[cfg(windows)]\n+fn f() {}') + suites = plan.plan(change, "fast") + off, flags = plan.gated(change, "fast", suites) + self.assertEqual(off, {"windows": ["app"]}) + self.assertEqual(flags, {}) + browser = files("crates/ui/src/browser/view.rs", patch='+let a = 1;') + off, flags = plan.gated(browser, "fast", plan.plan(browser, "fast")) + self.assertEqual(flags, {}) # the Linux browser fixture runs nightly + off, flags = plan.gated(browser, "fast", plan.plan(browser, "fast"), nightly=True) + self.assertEqual(flags, {"ui": ["browser"]}) + app = files("crates/mobile/src/lib.rs", "apps/zeron/src/main.rs", patch="+x") + off, flags = plan.gated(app, "fast", plan.plan(app, "fast")) + self.assertNotIn("windows", off) + self.assertNotIn("ios", off) + sync = files("crates/sync/src/lib.rs", patch="+x") + self.assertEqual(plan.gated(sync, "fast", plan.plan(sync, "fast"))[0], {"ios": ["ios-tests"]}) + full_off, full_flags = plan.gated(change, "full", plan.plan(change, "full")) + self.assertEqual(full_off, {}) + self.assertEqual(full_flags, {"macos": ["fixtures"]}) + nightly = plan.gated(change, "full", plan.plan(change, "full", nightly=True), nightly=True) + self.assertEqual(nightly[1], {"ui": ["browser"], "macos": ["fixtures"]}) + + def test_reservation(self): + suites = plan.plan(files("Cargo.lock"), "full", nightly=True) + counts = plan.reservation(plan.jobs_to_run(suites), "pull_request", "refs/pull/1/merge") + # result + core + ui + cursor + voice + ios-core + apk; voice runtime + windows x2; native + ios-tests + self.assertEqual(counts, {"linux": 7, "windows": 3, "macos": 2}) + main = plan.reservation(plan.jobs_to_run(suites), "push", "refs/heads/main") + self.assertEqual(main["linux"], 8) # + android publish + self.assertEqual(plan.format_reservation(counts), "linux=7 windows=3 macos=2") + daytime = plan.reservation(plan.jobs_to_run(plan.plan(files("Cargo.lock"), "full")), "push", + "refs/heads/main") + self.assertEqual(daytime, {"linux": 7, "windows": 2, "macos": 2}) # no voice + self.assertEqual(plan.reservation(plan.jobs_to_run({s: False for s in plan.SUITE_JOBS}), "push", + "refs/heads/main"), + {"linux": 1, "windows": 0, "macos": 0}) + + +class WorkflowConsistencyTests(unittest.TestCase): + """SUITE_JOBS must match the jobs the reusable workflows start.""" + + # suite -> (workflow, jobs of that workflow the suite turns on) + SUITES = { + "core": ("ui-tests.yml", ["core-tests"]), + "ui": ("ui-tests.yml", ["ui-tests"]), + "cursor": ("cursor-compatibility.yml", ["cursor-compatibility"]), + "edge": ("preview-tests.yml", ["edge"]), + "installer": ("linux-installer.yml", ["desktop-entry"]), + "voice": ("voice-tests.yml", ["offline-linux", "windows-runtime"]), + "windows": ("windows.yml", ["tests", "app"]), + "macos": ("macos.yml", ["macos-native"]), + "frame_source": ("macos.yml", ["macos-frame-source"]), + "ios": ("macos.yml", ["ios-core", "ios-tests"]), + "android": ("android.yml", ["apk"]), + } + + def test_job_runners_match(self): + """Each suite's jobs and runners, and the name each records its pass under.""" + try: + import yaml + except ImportError: + self.skipTest("PyYAML not installed") + workflows = ROOT / ".github" / "workflows" + for suite, (workflow, jobs) in self.SUITES.items(): + text = (workflows / workflow).read_text() + spec = yaml.safe_load(text) + runners = [] + for job in jobs: + runs_on = spec["jobs"][job]["runs-on"] + if "matrix.os" in runs_on: + default = spec.get("on", spec.get(True))["workflow_call"]["inputs"]["native-oses"]["default"] + labels = [(f"{job}-{os}", os) for os in json.loads(default)] + else: + labels = [(job, runs_on)] + for marker, label in labels: + runner = "windows" if "windows" in label else "macos" if "macos" in label else "linux" + runners.append((marker, runner)) + recorded = marker if "matrix.os" not in runs_on else f"{job}-${{{{ matrix.os }}}}" + self.assertIn(f"key: ${{{{ inputs.pass-key }}}}-{recorded}", text, (suite, marker)) + self.assertEqual(sorted(runners), sorted(plan.SUITE_JOBS[suite]), suite) + + def test_every_suite_is_called(self): + try: + import yaml + except ImportError: + self.skipTest("PyYAML not installed") + ci = (ROOT / ".github" / "workflows" / "ci.yml").read_text() + for suite in plan.SUITE_JOBS: + self.assertIn(f"suites).{suite}", ci, suite) + self.assertIn(f"keys).{suite} ||", ci, suite) + + +if __name__ == "__main__": + unittest.main() diff --git a/scripts/tests/test_ci_reuse.py b/scripts/tests/test_ci_reuse.py new file mode 100644 index 000000000..4d3afb49e --- /dev/null +++ b/scripts/tests/test_ci_reuse.py @@ -0,0 +1,342 @@ +"""scripts/ci/reuse.py and plan.py's reuse: a suite is skipped only when nothing it reads changed.""" + +import json +import os +import pathlib +import subprocess +import sys +import tempfile +import unittest + +ROOT = pathlib.Path(__file__).resolve().parents[2] +sys.path.insert(0, str(ROOT / "scripts" / "ci")) + +import plan # noqa: E402 +import reuse # noqa: E402 + + +def write(root, path, text): + full = pathlib.Path(root, path) + full.parent.mkdir(parents=True, exist_ok=True) + full.write_text(text) + + +class FakeRepo: + """A small workspace in a temporary git repository.""" + + def __init__(self): + self.dir = tempfile.TemporaryDirectory() + self.root = self.dir.name + write(self.root, "Cargo.toml", '[workspace]\nmembers = ["crates/a", "crates/b", "crates/c", "apps/app"]\n' + '[workspace.package]\nversion = "1.0.0"\n' + '[workspace.dependencies]\nzb = { path = "crates/b" }\n' + 'serde = { version = "1" }\n') + write(self.root, "Cargo.lock", '[[package]]\nname = "za"\nversion = "1.0.0"\n\n' + '[[package]]\nname = "serde"\nversion = "1.0.1"\n' + 'source = "registry+https://github.com/rust-lang/crates.io-index"\n') + write(self.root, "rust-toolchain.toml", "[toolchain]\n") + write(self.root, "crates/a/Cargo.toml", '[package]\nname = "za"\n[dependencies]\nzb.workspace = true\n') + write(self.root, "crates/a/src/lib.rs", 'const ICONS: &str = include_str!("../../c/assets/icons.json");\n') + write(self.root, "crates/b/Cargo.toml", '[package]\nname = "zb"\n[dev-dependencies]\n' + 'serde = "1"\n') + write(self.root, "crates/b/src/lib.rs", "pub fn b() {}\n") + write(self.root, "crates/c/Cargo.toml", '[package]\nname = "zc"\n') + write(self.root, "crates/c/src/lib.rs", "pub fn c() {}\n") + write(self.root, "crates/c/assets/icons.json", "{}\n") + write(self.root, "apps/app/Cargo.toml", '[package]\nname = "app"\n[target.\'cfg(windows)\'.dependencies]\n' + 'renamed = { package = "zc", path = "../../crates/c" }\n') + write(self.root, "apps/app/src/main.rs", + 'fn main() { let _ = env!("CARGO_MANIFEST_DIR").to_owned() + "../../scripts/fixture.txt"; ' + 'let _guard = "../.."; }\n') + write(self.root, "scripts/fixture.txt", "x\n") + self.git("init", "-q") + self.commit() + + def git(self, *args): + subprocess.run(["git", "-C", self.root, *args], check=True, capture_output=True, + env={**os.environ, "GIT_AUTHOR_NAME": "t", "GIT_AUTHOR_EMAIL": "t@t", + "GIT_COMMITTER_NAME": "t", "GIT_COMMITTER_EMAIL": "t@t"}) + + def commit(self): + self.git("add", "-A") + self.git("commit", "-q", "-m", "c", "--allow-empty") + + def keys(self, packages): + old = dict(reuse.SUITE_PACKAGES), dict(reuse.SUITE_INPUTS) + reuse.SUITE_PACKAGES.clear() + reuse.SUITE_PACKAGES.update(packages) + reuse.SUITE_INPUTS.clear() + reuse.SUITE_INPUTS.update({suite: [] for suite in packages}) + try: + return reuse.suite_keys(list(packages), self.root)[:2] + finally: + reuse.SUITE_PACKAGES.clear() + reuse.SUITE_PACKAGES.update(old[0]) + reuse.SUITE_INPUTS.clear() + reuse.SUITE_INPUTS.update(old[1]) + + +class FingerprintTests(unittest.TestCase): + def setUp(self): + self.repo = FakeRepo() + self.suites = {"a": ["za"], "b": ["zb"], "app": ["app"]} + + def tearDown(self): + self.repo.dir.cleanup() + + def changed_after(self, path, text): + before, _ = self.repo.keys(self.suites) + write(self.repo.root, path, text) + self.repo.commit() + after, _ = self.repo.keys(self.suites) + return {suite for suite in before if before[suite] != after[suite]} + + def test_dependency_closure(self): + ws = reuse.Workspace(self.repo.root) + self.assertEqual(ws.closure(["za"]), {"crates/a", "crates/b"}) + self.assertEqual(ws.closure(["app"]), {"apps/app", "crates/c"}) # renamed, target-specific + self.assertEqual(ws.closure(["zb"]), {"crates/b"}) # a registry dev-dependency is not a package + + def test_files_named_from_outside_the_package_are_found(self): + _, extra = self.repo.keys(self.suites) + self.assertEqual(extra["a"], ["crates/c/assets/icons.json"]) + self.assertEqual(extra["app"], ["scripts/fixture.txt"]) # not "../.." (names no file) + + def test_a_dependency_change_reruns_its_dependents_only(self): + self.assertEqual(self.changed_after("crates/b/src/lib.rs", "pub fn b() { }\n"), {"a", "b"}) + + def test_a_leaf_change_reruns_only_its_suite(self): + self.assertEqual(self.changed_after("crates/a/src/extra.rs", "\n"), {"a"}) + + def test_a_named_file_counts_but_its_package_does_not(self): + self.assertEqual(self.changed_after("crates/c/assets/icons.json", "[]\n"), {"a", "app"}) + self.assertEqual(self.changed_after("crates/c/src/other.rs", "\n"), {"app"}) + + def test_the_lockfile_and_toolchain_rerun_everything(self): + self.assertEqual(self.changed_after("Cargo.lock", "# lock 2\n"), {"a", "b", "app"}) + self.assertEqual(self.changed_after("rust-toolchain.toml", "[toolchain]\nchannel = \"1.99\"\n"), + {"a", "b", "app"}) + + def test_a_version_bump_changes_no_fingerprint(self): + cargo = pathlib.Path(self.repo.root, "Cargo.toml").read_text().replace('version = "1.0.0"', 'version = "1.0.1"') + before, _ = self.repo.keys(self.suites) + write(self.repo.root, "Cargo.toml", cargo) + lock = pathlib.Path(self.repo.root, "Cargo.lock").read_text() + write(self.repo.root, "Cargo.lock", lock.replace('name = "za"\nversion = "1.0.0"', 'name = "za"\nversion = "1.0.1"')) + self.repo.commit() + self.assertEqual(self.repo.keys(self.suites)[0], before) + # A dependency's version is a real change. + write(self.repo.root, "Cargo.lock", lock.replace('version = "1.0.1"\nsource', 'version = "1.0.2"\nsource')) + self.repo.commit() + self.assertNotEqual(self.repo.keys(self.suites)[0], before) + + def test_variants_are_part_of_the_key(self): + with_browser = reuse.suite_keys(["core"], str(ROOT), variants={"core": "browser"})[0] \ + if (ROOT / "crates" / "ui" / "src").is_dir() else None + if with_browser: + plain = reuse.suite_keys(["core"], str(ROOT))[0] + self.assertNotEqual(with_browser["core"], plain["core"]) + + def test_the_planner_and_scheduler_are_no_input(self): + self.assertEqual(self.changed_after("scripts/ci/plan.py", "# plan\n"), set()) + self.assertEqual(self.changed_after("scripts/ci/admit.py", "# admit\n"), set()) + self.assertEqual(self.changed_after(".github/workflows/ci.yml", "on: push\n"), {"a", "b", "app"}) + + def test_ci_files_count_for_the_suites_that_run_them(self): + keys = lambda: reuse.suite_keys(["core", "edge", "windows"], str(ROOT))[0] # noqa: E731 + if not (ROOT / "crates" / "ui" / "src").is_dir(): + self.skipTest("Rust sources not checked out") + self.assertIn("scripts/ci/nextest.toml", reuse.SUITE_INPUTS["core"]) + self.assertIn("scripts/ci/test-core.sh", reuse.SUITE_INPUTS["core"]) + self.assertNotIn("scripts/ci/nextest.toml", reuse.SUITE_INPUTS["edge"]) + self.assertIn(".github/actions/windows-ci-setup/**", reuse.SUITE_INPUTS["windows"]) + self.assertTrue(all(not reuse.matches(f"scripts/ci/{f}", reuse.COMMON) + for f in ("plan.py", "admit.py", "reuse.py", "emergency.py"))) + self.assertEqual(keys(), keys()) + + def test_unrelated_files_change_nothing(self): + self.assertEqual(self.changed_after("docs/notes.md", "hi\n"), set()) + + def test_concat_paths_count(self): + write(self.repo.root, "crates/b/src/fonts.rs", + 'const F: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/../c/assets/icons.json");\n') + self.repo.commit() + _, extra = self.repo.keys(self.suites) + self.assertIn("crates/c/assets/icons.json", extra["b"]) + + def test_paths_the_scan_cannot_follow_make_the_suite_read_everything(self): + write(self.repo.root, "crates/b/tests/walk.rs", + 'fn f() { let root = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).parent().unwrap(); }\n') + self.repo.commit() + self.assertIn("b", self.changed_after("docs/../scripts/other.txt", "y\n")) + + def test_keys_are_stable(self): + self.assertEqual(self.repo.keys(self.suites), self.repo.keys(self.suites)) + + +class RealWorkspaceTests(unittest.TestCase): + """The zeron workspace itself (skipped where the sources are not checked out).""" + + def setUp(self): + if not (ROOT / "crates" / "ui" / "src").is_dir(): + self.skipTest("Rust sources not checked out") + + def test_core_does_not_read_the_ui(self): + ws = reuse.Workspace(str(ROOT)) + core = ws.closure(reuse.SUITE_PACKAGES["core"]) + self.assertNotIn("crates/ui", core) + self.assertIn("crates/ui", ws.closure(reuse.SUITE_PACKAGES["windows"])) + + def test_mobile_reads_the_ui_icons_and_fonts(self): + _, extra, _ = reuse.suite_keys(["ios"], str(ROOT)) + self.assertIn("crates/ui/src/file-icons.json", extra["ios"]) + + def test_every_rust_suite_has_packages_that_exist(self): + ws = reuse.Workspace(str(ROOT)) + for suite, packages in reuse.SUITE_PACKAGES.items(): + for package in packages: + self.assertIn(package, ws.dirs, (suite, package)) + self.assertEqual(set(reuse.SUITE_INPUTS), set(plan.SUITE_JOBS)) + + +class LookupTests(unittest.TestCase): + def test_only_trusted_refs_count(self): + key = "ci-pass-v1-windows-abc" + caches = {"actions_caches": [ + {"key": f"{key}-tests", "ref": "refs/heads/main"}, + {"key": f"{key}-app", "ref": "refs/pull/9/merge"}, # another pull request + {"key": f"{key}-tests", "ref": "refs/pull/7/merge"}, + {"key": f"{key}0-app", "ref": "refs/heads/main"}, # a longer key with the same prefix + ]} + api = lambda path: caches # noqa: E731 + self.assertEqual(reuse.passed_jobs(api, "o/r", key, {"refs/pull/7/merge", "refs/heads/main"}), {"tests"}) + self.assertEqual(reuse.passed_jobs(api, "o/r", key, set()), set()) + + +class ReusePlanTests(unittest.TestCase): + def test_whole_suites(self): + suites = {s: s in ("core", "ios") for s in plan.SUITE_JOBS} + skip = plan.reused_jobs(suites, {"core": {"core-tests"}, "ios": {"ios-core"}}) + self.assertEqual(skip, {"core": ["core-tests"]}) # iOS: the simulator tests never passed + running = plan.jobs_to_run(suites, skip) + self.assertEqual(running["core"], []) + self.assertEqual([j for j, _ in running["ios"]], ["ios-core", "ios-tests"]) + + def test_single_jobs_of_splittable_suites(self): + suites = {s: s in ("windows", "voice") for s in plan.SUITE_JOBS} + passed = {"windows": {"tests"}, "voice": {"offline-linux"}} + skip = plan.reused_jobs(suites, passed) + running = plan.jobs_to_run(suites, skip) + self.assertEqual(running["windows"], [("app", "windows")]) + self.assertEqual(running["voice"], [("windows-runtime", "windows")]) + counts = plan.reservation(running, "pull_request", "refs/pull/1/merge") + self.assertEqual(counts, {"linux": 1, "windows": 2, "macos": 0}) + + def test_unselected_suites_are_not_reused(self): + suites = {s: False for s in plan.SUITE_JOBS} + self.assertEqual(plan.reused_jobs(suites, {"core": {"core-tests"}}), {}) + + +class PlanMainTests(unittest.TestCase): + """plan.py end to end on a fake repository and API.""" + + def run_plan(self, event, payload, caches, labels=(), files=None, head_repo="o/r", extra_env=None): + repo = FakeRepo() + self.addCleanup(repo.dir.cleanup) + out = pathlib.Path(repo.root, "out") + event_path = pathlib.Path(repo.root, "event.json") + event_path.write_text(json.dumps(payload)) + files = files or [{"filename": "crates/b/src/lib.rs", "patch": "+x"}] + + def fake_api(path): + if "/actions/caches" in path: + return {"actions_caches": caches} + if path.endswith("/files?per_page=100&page=1"): + return files + if "/pulls/" in path: + return {"number": 3, "changed_files": 1, "labels": [{"name": n} for n in labels], + "head": {"repo": {"full_name": head_repo} if head_repo else None}} + return {"files": files} + + env = {"GITHUB_EVENT_NAME": event, "GITHUB_REPOSITORY": "o/r", "GITHUB_REF": "refs/pull/3/merge", + "GITHUB_EVENT_PATH": str(event_path), "GITHUB_OUTPUT": str(out), "GITHUB_TOKEN": "t"} + old_env, old_api, cwd = dict(os.environ), plan.api, os.getcwd() + packages, inputs = dict(reuse.SUITE_PACKAGES), dict(reuse.SUITE_INPUTS) + try: + os.environ.pop("CI_FORK_REUSE", None) + os.environ.update(env) + os.environ.update(extra_env or {}) + os.environ.pop("GITHUB_STEP_SUMMARY", None) + plan.api = fake_api + reuse.SUITE_PACKAGES.clear() + reuse.SUITE_PACKAGES.update({"core": ["zb"], "ui": ["za"]}) + os.chdir(repo.root) + from contextlib import redirect_stdout + from io import StringIO + with redirect_stdout(StringIO()): + plan.main() + finally: + os.chdir(cwd) + plan.api = old_api + os.environ.clear() + os.environ.update(old_env) + reuse.SUITE_PACKAGES.clear() + reuse.SUITE_PACKAGES.update(packages) + reuse.SUITE_INPUTS.clear() + reuse.SUITE_INPUTS.update(inputs) + return dict(line.split("=", 1) for line in out.read_text().splitlines()) + + def test_a_passed_suite_is_skipped_and_its_runner_not_reserved(self): + first = self.run_plan("pull_request", {"pull_request": {"number": 3}}, []) + keys = json.loads(first["keys"]) + self.assertTrue(json.loads(first["suites"])["core"]) + caches = [{"key": keys["core"] + "-core-tests", "ref": "refs/pull/3/merge"}] + second = self.run_plan("pull_request", {"pull_request": {"number": 3}}, caches) + self.assertFalse(json.loads(second["suites"])["core"]) + self.assertTrue(json.loads(second["suites"])["ui"]) + self.assertEqual(json.loads(second["skip"]), {"core": ["core-tests"]}) + self.assertLess(int(second["reservation"].split()[0].split("=")[1]), + int(first["reservation"].split()[0].split("=")[1])) + + def test_forks_reuse_only_mains_passes(self): + first = self.run_plan("pull_request", {"pull_request": {"number": 3}}, [], head_repo="someone/r") + key = json.loads(first["keys"])["core"] + "-core-tests" + own = [{"key": key, "ref": "refs/pull/3/merge"}] + self.assertTrue(json.loads(self.run_plan("pull_request", {"pull_request": {"number": 3}}, own, + head_repo="someone/r")["suites"])["core"]) + self.assertTrue(json.loads(self.run_plan("pull_request", {"pull_request": {"number": 3}}, own, + head_repo=None)["suites"])["core"]) # deleted fork + mains = [{"key": key, "ref": "refs/heads/main"}] + self.assertFalse(json.loads(self.run_plan("pull_request", {"pull_request": {"number": 3}}, mains, + head_repo="someone/r")["suites"])["core"]) + # CI_FORK_REUSE=own, once the merge queue is required. + self.assertFalse(json.loads(self.run_plan("pull_request", {"pull_request": {"number": 3}}, own, + head_repo="someone/r", + extra_env={"CI_FORK_REUSE": "own"})["suites"])["core"]) + + def test_the_merge_queue_reuses_nothing(self): + first = self.run_plan("pull_request", {"pull_request": {"number": 3}}, []) + caches = [{"key": json.loads(first["keys"])["core"] + "-core-tests", "ref": "refs/heads/main"}] + group = self.run_plan("merge_group", {"merge_group": {"base_sha": "a" * 40, "head_sha": "b" * 40}}, caches) + self.assertTrue(json.loads(group["suites"])["core"]) + + def test_a_build_file_no_fingerprint_covers_disables_reuse(self): + first = self.run_plan("pull_request", {"pull_request": {"number": 3}}, []) + caches = [{"key": json.loads(first["keys"])["core"] + "-core-tests", "ref": "refs/pull/3/merge"}] + # crates/c is in no selected suite (core reads crates/b, ui crates/a and b). + again = self.run_plan("pull_request", {"pull_request": {"number": 3}}, caches, + files=[{"filename": "crates/b/src/lib.rs", "patch": "+x"}, + {"filename": "crates/c/src/lib.rs", "patch": "+x"}]) + self.assertTrue(json.loads(again["suites"])["core"]) + + def test_ci_full_and_main_do_not_trust_pull_request_passes(self): + first = self.run_plan("pull_request", {"pull_request": {"number": 3}}, []) + caches = [{"key": json.loads(first["keys"])["core"] + "-core-tests", "ref": "refs/pull/3/merge"}] + full = self.run_plan("pull_request", {"pull_request": {"number": 3}}, caches, labels=["ci:full"]) + self.assertTrue(json.loads(full["suites"])["core"]) + main = self.run_plan("push", {"before": "a" * 40, "after": "b" * 40}, caches) + self.assertTrue(json.loads(main["suites"])["core"]) + + +if __name__ == "__main__": + unittest.main()