### Install build dependencies Source: https://github.com/0xsero/litter/blob/main/docs/DEVELOPMENT.md Installs Meson, xcodegen, and Zig 0.15.x via Homebrew. ```bash brew install meson ``` ```bash brew install xcodegen ``` ```bash brew install zig@0.15 ``` -------------------------------- ### App ID Tracking Example Source: https://github.com/0xsero/litter/blob/main/shared/rust-bridge/codex-mobile-client/src/widget_guidelines/app.md Example of the thread-specific instruction line used to track existing app identifiers. ```text Apps saved in this thread so far: fitness-tracker (Fitness Tracker), todo-list (Todo List) ``` -------------------------------- ### Install Xcode command line tools Source: https://github.com/0xsero/litter/blob/main/apps/ios/fastlane/README.md Run this command to ensure the necessary Xcode command line tools are installed on your system. ```sh xcode-select --install ``` -------------------------------- ### Install Rust and iOS targets Source: https://github.com/0xsero/litter/blob/main/docs/DEVELOPMENT.md Installs Rust via rustup and adds the required iOS compilation targets. ```bash curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh rustup target add aarch64-apple-ios aarch64-apple-ios-sim x86_64-apple-ios ``` -------------------------------- ### Fitness Tracker Widget Implementation Source: https://github.com/0xsero/litter/blob/main/shared/rust-bridge/codex-mobile-client/src/widget_guidelines/app.md A complete example demonstrating state loading, migration, debounced saving, and DOM rendering for a fitness tracker widget. ```html

Workout log

``` -------------------------------- ### Debug Android Emulator Source: https://github.com/0xsero/litter/blob/main/CLAUDE.md Commands to build, install, and launch the application on an Android emulator. ```bash make android-emulator-fast ``` ```bash adb -e install -r apps/android/app/build/outputs/apk/debug/app-debug.apk ``` ```bash adb -e shell am start -n com.sigkitten.litter.android/com.litter.android.MainActivity ``` -------------------------------- ### Configure Xcode path Source: https://github.com/0xsero/litter/blob/main/docs/DEVELOPMENT.md Sets the active developer directory to the full Xcode installation. ```bash sudo xcode-select -s /Applications/Xcode.app/Contents/Developer ``` -------------------------------- ### Run app-server manually Source: https://github.com/0xsero/litter/blob/main/docs/DEVELOPMENT.md Starts the app-server bound to the loopback interface for SSH port forwarding. ```bash codex app-server --listen ws://127.0.0.1:8390 ``` -------------------------------- ### Install InjectionIII Source: https://github.com/0xsero/litter/blob/main/CLAUDE.md Command to install the InjectionIII tool via Homebrew for hot reloading support. ```bash brew install --cask injectioniii ``` -------------------------------- ### Debug iOS Simulator Source: https://github.com/0xsero/litter/blob/main/CLAUDE.md Commands to install and launch the application directly from DerivedData on the iOS simulator. ```bash xcrun simctl install booted <.../Build/Products/Debug-iphonesimulator/Litter.app> ``` ```bash xcrun simctl launch booted com.sigkitten.litter ``` -------------------------------- ### Structural SVG Container Example Source: https://github.com/0xsero/litter/blob/main/shared/rust-bridge/codex-mobile-client/src/widget_guidelines/diagram_types.md Defines a library branch layout using stacked regions with SVG markers and color classes for light/dark mode support. ```svg Library branch Main floor Circulation desk Checkouts, returns Books Reading room Seating, reference ``` -------------------------------- ### Implement Custom HTML Legend Source: https://github.com/0xsero/litter/blob/main/shared/rust-bridge/codex-mobile-client/src/widget_guidelines/charts_chart_js.md Example structure for a custom legend using flexbox for layout and inline styles for color indicators. ```html
Chrome 65% Safari 18%
``` -------------------------------- ### Mermaid ERD Schema Example Source: https://github.com/0xsero/litter/blob/main/shared/rust-bridge/codex-mobile-client/src/widget_guidelines/diagram_types.md Defines a database schema using mermaid.js erDiagram syntax to handle layout and connector routing automatically. ```mermaid erDiagram USERS ||--o{ POSTS : writes POSTS ||--o{ COMMENTS : has USERS { uuid id PK string email timestamp created_at } POSTS { uuid id PK uuid user_id FK string title } ``` -------------------------------- ### Define Arrow Marker in SVG Source: https://github.com/0xsero/litter/blob/main/shared/rust-bridge/codex-mobile-client/src/widget_guidelines/svg_setup.md Include this definition at the start of every SVG to enable consistent arrow markers that inherit the stroke color. ```xml ``` -------------------------------- ### Build and Run iOS Source: https://github.com/0xsero/litter/blob/main/docs/DEVELOPMENT.md Commands for project generation, opening in Xcode, and CLI building. ```bash make xcgen ``` ```bash open apps/ios/Litter.xcodeproj ``` ```bash xcodebuild \ -project apps/ios/Litter.xcodeproj \ -scheme Litter \ -configuration Debug \ -destination 'platform=iOS Simulator,name=iPhone 17 Pro' \ build ``` -------------------------------- ### Build and Run Commands Source: https://github.com/0xsero/litter/blob/main/README.md Use these Makefile targets to trigger fast builds for iOS and Android devices or simulators. ```bash make ios-device-fast # fast device build make ios-sim-fast # fast simulator build make android-emulator-fast # fast Android emulator build ``` -------------------------------- ### Build and Run Android Source: https://github.com/0xsero/litter/blob/main/docs/DEVELOPMENT.md Commands for opening the project in Android Studio and executing build/test pipelines. ```bash open -a "Android Studio" apps/android # open in Android Studio make test-android # generate bindings and run unit tests make android # full Rust/JNI + debug APK pipeline make android-emulator-fast # host emulator ABI only ``` -------------------------------- ### Build and Upload to TestFlight Source: https://github.com/0xsero/litter/blob/main/docs/DEVELOPMENT.md Builds the application and uploads it to TestFlight, automatically handling versioning and build number increments. ```bash APP_BUNDLE_ID= \ APP_STORE_APP_ID= \ TEAM_ID= \ ASC_KEY_ID= \ ASC_ISSUER_ID= \ ASC_PRIVATE_KEY_PATH="$HOME/AppStore.p8" \ ./apps/ios/scripts/testflight-upload.sh ``` -------------------------------- ### Authenticate with App Store Connect Source: https://github.com/0xsero/litter/blob/main/docs/DEVELOPMENT.md Initializes the authentication session using App Store Connect credentials. ```bash asc auth login \ --name "Litter ASC" \ --key-id "" \ --issuer-id "" \ --private-key "$HOME/AppStore.p8" \ --network ``` -------------------------------- ### Build iOS with Make Source: https://github.com/0xsero/litter/blob/main/docs/ios/quickstart.md Use these commands to perform full or incremental builds of the iOS project. ```bash # Full iOS build (device + simulator) make ios # Simulator development lane (faster; raw static library) make ios-sim-fast # Device development lane (faster; raw static library) make ios-device-fast # Build + open Xcode make ios-run ``` -------------------------------- ### Initialize Chart.js with Responsive Wrapper Source: https://github.com/0xsero/litter/blob/main/shared/rust-bridge/codex-mobile-client/src/widget_guidelines/charts_chart_js.md Use a relative-positioned wrapper div for sizing and a named initialization function to handle asynchronous script loading. ```html
``` -------------------------------- ### Run Local Iteration Commands Source: https://github.com/0xsero/litter/blob/main/CLAUDE.md Use these commands for fast local development cycles before packaging or releasing. ```bash make ios-sim-fast ``` ```bash make ios-device-fast ``` ```bash make android-emulator-fast ``` -------------------------------- ### Bootstrap TestFlight Defaults Source: https://github.com/0xsero/litter/blob/main/docs/DEVELOPMENT.md Configures the initial TestFlight environment settings for the specified bundle ID. ```bash APP_BUNDLE_ID= ./apps/ios/scripts/testflight-setup.sh ``` -------------------------------- ### Enable SSH via CLI Source: https://github.com/0xsero/litter/blob/main/docs/DEVELOPMENT.md Enables remote login on the Mac using the systemsetup utility. ```bash sudo systemsetup -setremotelogin on ``` -------------------------------- ### Open Project in Android Studio Source: https://github.com/0xsero/litter/blob/main/apps/android/README.md Opens the Android project directory in Android Studio on macOS. ```bash open -a "Android Studio" apps/android ``` -------------------------------- ### Repository Layout Source: https://github.com/0xsero/litter/blob/main/README.md Overview of the project directory structure and core components. ```text apps/ios/ iOS app (Litter scheme, project.yml is source of truth) apps/android/ Android app (Compose UI, Gradle build) shared/rust-bridge/ codex-mobile-client/ Shared Rust client crate + UniFFI surface (iOS & Android) codex-slingshot/ Slingshot HTTP/stream transport uniffi-bindgen/ Local binding generator wrapper shared/third_party/codex/ Upstream Codex submodule shared/third_party/ghostty Upstream Ghostty submodule for the terminal renderer patches/codex/ Local patch set applied during builds tools/scripts/ Cross-platform helper scripts ``` -------------------------------- ### Execute App Store Release Source: https://github.com/0xsero/litter/blob/main/docs/DEVELOPMENT.md Triggers the production release process using metadata from the local fastlane directory. ```bash APP_BUNDLE_ID= \ APP_STORE_APP_ID= \ TEAM_ID= \ ASC_KEY_ID= \ ASC_ISSUER_ID= \ ASC_PRIVATE_KEY_PATH="$HOME/AppStore.p8" \ ./apps/ios/scripts/app-store-release.sh ``` -------------------------------- ### Build iOS App Manually Source: https://github.com/0xsero/litter/blob/main/docs/ios/quickstart.md Execute this command to build the generated Xcode project via the command line. ```bash xcodebuild \ -project apps/ios/Litter.xcodeproj \ -scheme Litter \ -configuration Debug \ -destination 'generic/platform=iOS Simulator' \ build ``` -------------------------------- ### Run Android Unit Tests Source: https://github.com/0xsero/litter/blob/main/apps/android/docs/qa-matrix.md Executes the unit-test suite for the single hybrid runtime using the Gradle wrapper. ```bash ./gradlew :app:testDebugUnitTest ``` -------------------------------- ### window.saveAppState(obj) Source: https://github.com/0xsero/litter/blob/main/shared/rust-bridge/codex-mobile-client/src/widget_guidelines/app.md Serializes and persists the provided state object to the native host. ```APIDOC ## window.saveAppState(obj) ### Description Serializes the provided object to JSON and requests the native host to persist it. Persistence is asynchronous. ### Parameters - **obj** (Object) - The state object to persist. ### Returns - **boolean** - Returns true when the request is successfully dispatched. ``` -------------------------------- ### Implement Calorie Tracker Widget Source: https://github.com/0xsero/litter/blob/main/shared/rust-bridge/codex-mobile-client/src/widget_guidelines/app.md A complete HTML/JS implementation of a food tracker widget that uses structuredResponse to estimate calories from user input. ```html

Food log

    ``` -------------------------------- ### Execute Mac Direct Distribution Pipeline Source: https://github.com/0xsero/litter/blob/main/docs/releases/mac-distribution-checklist.md Commands to trigger the build pipeline locally, with options to include notarization or skip specific steps like Finder layout automation. ```bash # Full pipeline including notarization (needs ASC API key env vars) ASC_PRIVATE_KEY_PATH=/path/to/AuthKey.p8 \ ASC_KEY_ID=ABC123 \ ASC_ISSUER_ID=00000000-0000-0000-0000-000000000000 \ make mac-direct-dist # Build but skip notarization (for testing the script itself) SKIP_NOTARIZATION=1 make mac-direct-dist # Skip Finder layout automation if running on a host where Finder is unavailable. DMG_SKIP_FINDER_LAYOUT=1 SKIP_NOTARIZATION=1 make mac-direct-dist ``` -------------------------------- ### Rebuild and Reopen Workflow Source: https://github.com/0xsero/litter/blob/main/apps/android/README.md Automated script to rebuild the project and reopen the IDE, with optional flags for Rust recompilation or skipping the open action. ```bash ./apps/android/scripts/rebuild-and-reopen.sh ``` ```bash ./apps/android/scripts/rebuild-and-reopen.sh --with-rust ``` ```bash ./apps/android/scripts/rebuild-and-reopen.sh --no-open ``` -------------------------------- ### Streaming HTML Structure Source: https://github.com/0xsero/litter/blob/main/shared/rust-bridge/codex-mobile-client/src/widget_guidelines/core.md Follow this order to ensure content renders correctly during token-by-token streaming. ```html ``` -------------------------------- ### Run iOS screenshots action Source: https://github.com/0xsero/litter/blob/main/apps/ios/fastlane/README.md Executes the Fastlane action to generate iOS screenshots, optionally using bundle exec. ```sh [bundle exec] fastlane ios screenshots ``` -------------------------------- ### window.structuredResponse({ prompt, responseFormat }) Source: https://github.com/0xsero/litter/blob/main/shared/rust-bridge/codex-mobile-client/src/widget_guidelines/app.md Performs a one-shot AI query constrained by a provided JSON schema. ```APIDOC ## window.structuredResponse({ prompt, responseFormat }) ### Description Executes an AI-powered query that returns a structured JSON object based on the provided schema. This method supports follow-up context within the same app view session. ### Parameters - **prompt** (string) - The input prompt for the AI model. - **responseFormat** (Object) - A JSON Schema object defining the expected output structure. Must use strict mode (all fields required, additionalProperties: false). ### Returns - **Promise** - Resolves with the parsed JSON object matching the schema, or rejects on error. ``` -------------------------------- ### window.loadAppState() Source: https://github.com/0xsero/litter/blob/main/shared/rust-bridge/codex-mobile-client/src/widget_guidelines/app.md Retrieves the previously saved state object for the current app. Returns null if no state exists or if an error occurs. ```APIDOC ## window.loadAppState() ### Description Returns the parsed state object for the current app, or null if no state has been saved. This method is safe to call on every boot and will not throw errors. ### Returns - **Object|null** - The parsed state object or null. ``` -------------------------------- ### Create upload-key material Source: https://github.com/0xsero/litter/blob/main/docs/releases/android-play-internal-checklist.md Generates new upload key material on macOS, storing keystores and passwords securely. ```bash ./apps/android/scripts/setup-upload-key.sh ``` -------------------------------- ### Build Rust Bridge Source: https://github.com/0xsero/litter/blob/main/docs/DEVELOPMENT.md Compiles the Rust bridge for iOS targets. ```bash ./apps/ios/scripts/build-rust.sh # package mode: device + sim + xcframework ./apps/ios/scripts/build-rust.sh --fast-device # raw device staticlib only ``` -------------------------------- ### Register Apple Watch Source: https://github.com/0xsero/litter/blob/main/README.md Run this command after pairing a new Apple Watch to register its UDID and refresh provisioning profiles for CLI builds. ```bash make watch-register ``` -------------------------------- ### Control Codex desktop application Source: https://github.com/0xsero/litter/blob/main/tools/scripts/README.md Commands for launching, attaching to, and automating interactions with the Codex desktop application via remote debugging. ```bash # Launch a separate Codex instance with Electron remote debugging enabled. node tools/scripts/codex-desktop-controller.mjs launch \ --app "/Applications/Codex copy.app" \ --port 9333 \ --user-data-dir /tmp/codex-desktop-controller-profile # Reuse that same instance on later commands. Add --fresh-launch only if you # intentionally want a brand new app instance on the same port/profile setup. node tools/scripts/codex-desktop-controller.mjs thread-state --port 9333 --launch # Attach to an already-running automation instance and inspect the active thread. node tools/scripts/codex-desktop-controller.mjs thread-state --port 9333 # Send one turn into the current thread, wait for the assistant to finish, and print JSON. node tools/scripts/codex-desktop-controller.mjs run-turn \ --port 9333 \ --message 'Reply with exactly: OK' # Start a fresh thread in a sidebar project, run the first turn, and print the final transcript. node tools/scripts/codex-desktop-controller.mjs run-turn \ --port 9333 \ --project codex-test \ --message 'Reply with exactly: OK' ``` -------------------------------- ### Runtime Architecture Diagram Source: https://github.com/0xsero/litter/blob/main/docs/ARCHITECTURE.md Visual representation of the data flow and component hierarchy from the UI layer down to the terminal engine. ```text SwiftUI / Compose │ │ thin platform projection ▼ Swift AppModel / Kotlin AppModel │ │ generated UniFFI bindings ▼ codex-mobile-client (Rust) ├─ AppStore + reducer + snapshots ├─ MobileClient session/runtime facade ├─ AppClient direct RPC surface ├─ discovery, reconnect and SSH ├─ hydration and conversation shaping ├─ voice handoff state machine └─ terminal, local runtime and platform hooks │ ├─ patched upstream Codex app-server client/core ├─ Alleycat agent bridges ├─ codex-slingshot JSON-line/HTTP stream transport └─ Ghostty terminal engine ``` -------------------------------- ### Upload Android App Bundle Source: https://github.com/0xsero/litter/blob/main/docs/releases/android-play-internal-checklist.md Commands for uploading AABs to the Play Store, including options for release status and track promotion. ```bash ./apps/android/scripts/play-upload.sh ``` ```bash LITTER_PLAY_RELEASE_STATUS=completed ./apps/android/scripts/play-upload.sh ``` ```bash LITTER_PLAY_RELEASE_STATUS=draft \ LITTER_PLAY_PROMOTE_TRACK=production \ ./apps/android/scripts/play-upload.sh ``` -------------------------------- ### Faux Viewport for Overlays Source: https://github.com/0xsero/litter/blob/main/shared/rust-bridge/codex-mobile-client/src/widget_guidelines/core.md Use this wrapper to maintain layout height for modal or overlay mockups, as fixed positioning collapses the iframe viewport. ```html
    ``` -------------------------------- ### Interactive Control UI Source: https://github.com/0xsero/litter/blob/main/shared/rust-bridge/codex-mobile-client/src/widget_guidelines/diagram_types.md HTML markup for the heating toggle and temperature slider controls. ```html
    Thermostat 40%
    ``` -------------------------------- ### Verify SSH and binary availability Source: https://github.com/0xsero/litter/blob/main/docs/DEVELOPMENT.md Checks SSH connectivity and verifies that the codex or codex-app-server binaries are in the PATH. ```bash ssh @ 'echo ok' ssh @ \ 'command -v codex || command -v codex-app-server' ``` -------------------------------- ### Xcode Project Regeneration Source: https://github.com/0xsero/litter/blob/main/AGENTS.md Standardized scripts for regenerating the Xcode project structure. ```bash make xcgen ``` ```bash ./apps/ios/scripts/regenerate-project.sh ``` -------------------------------- ### Build without uploading Source: https://github.com/0xsero/litter/blob/main/docs/releases/android-play-internal-checklist.md Performs a local build of the Android application without triggering the Play Store upload process. ```bash UPLOAD=0 ./apps/android/scripts/play-upload.sh ``` -------------------------------- ### Implement a Bounded Data Record Card Source: https://github.com/0xsero/litter/blob/main/shared/rust-bridge/codex-mobile-client/src/widget_guidelines/ui_components.md Use this structure for displaying bounded data objects like contact cards or receipts. It requires a container with specific border-radius and border styles, utilizing CSS variables for consistent theme integration. ```html
    MR

    Maya Rodriguez

    VP of Engineering

    Emailm.rodriguez@acme.com
    Phone+1 (415) 555-0172
    ``` -------------------------------- ### SVG ViewBox Configuration Source: https://github.com/0xsero/litter/blob/main/shared/rust-bridge/codex-mobile-client/src/widget_guidelines/svg_setup.md The standard SVG tag structure for mobile widgets, requiring a fixed 360px width and flexible height. ```xml ``` -------------------------------- ### Build Android Debug APK Source: https://github.com/0xsero/litter/blob/main/apps/android/README.md Compiles the Android application in debug mode using Gradle. ```bash ./gradlew :app:assembleDebug ``` -------------------------------- ### Interactive Water Heater Diagram Styles and SVG Definitions Source: https://github.com/0xsero/litter/blob/main/shared/rust-bridge/codex-mobile-client/src/widget_guidelines/diagram_types.md CSS styles for animations and SVG definitions for gradients and markers used in an interactive water heater cross-section. ```html ``` -------------------------------- ### Upload encryption declaration document Source: https://github.com/0xsero/litter/blob/main/docs/releases/export-compliance/README.md Uploads a completed PDF declaration to the specified App Store Connect declaration ID. ```bash asc encryption documents upload \ --declaration 85d5e23f-2cdf-4e9d-a6c6-25e8ae19f40f \ --file docs/releases/export-compliance/french-encryption-declaration-annex-1-completed.pdf ``` -------------------------------- ### CMake Build Configuration for Android JNI Source: https://github.com/0xsero/litter/blob/main/apps/android/core/bridge/src/main/cpp/CMakeLists.txt Defines the project requirements, imports the ghostty shared library, and configures the build for the JNI bridge. ```cmake cmake_minimum_required(VERSION 3.22.1) project(litter_ghostty_jni LANGUAGES CXX) add_library(ghostty SHARED IMPORTED) set_target_properties( ghostty PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/../jniLibs/${ANDROID_ABI}/libghostty.so" INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/include" ) add_library(litter_ghostty_jni SHARED ghostty_jni.cpp) target_compile_features(litter_ghostty_jni PRIVATE cxx_std_17) target_include_directories(litter_ghostty_jni PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/include") target_link_libraries(litter_ghostty_jni PRIVATE ghostty EGL GLESv3 android log) ``` -------------------------------- ### Define a single-line flowchart node Source: https://github.com/0xsero/litter/blob/main/shared/rust-bridge/codex-mobile-client/src/widget_guidelines/diagram_types.md Use the c-blue class for automatic theme-aware styling on a 44px tall node. ```svg T-cells ``` -------------------------------- ### Handle TestFlight Invitation Form Submission Source: https://github.com/0xsero/litter/blob/main/services/website/public/index.html Manages form display, email validation, and POST request submission to the server. Requires elements with IDs 'testflight-trigger' and 'testflight-form' to be present in the DOM. ```javascript (function () { var trigger = document.getElementById('testflight-trigger'); var form = document.getElementById('testflight-form'); if (!trigger || !form) return; var status = form.querySelector('.tf-form-status'); var input = form.querySelector('input[name="email"]'); var submit = form.querySelector('button[type="submit"]'); function setStatus(msg, kind) { status.textContent = msg || ''; status.dataset.kind = kind || ''; } trigger.addEventListener('click', function () { form.hidden = false; form.classList.add('tf-form--visible'); setStatus('', ''); setTimeout(function () { input && input.focus(); }, 50); }); form.addEventListener('submit', function (e) { e.preventDefault(); var email = (input.value || '').trim(); if (!email || email.indexOf('@') < 1) { setStatus('Please enter a valid email address.', 'error'); return; } submit.disabled = true; setStatus('Sending…', 'pending'); fetch(form.action, { method: 'POST', headers: { 'Content-Type': 'application/json', 'Accept': 'application/json' }, body: JSON.stringify({ email: email }) }).then(function (r) { return r.json().catch(function () { return {}; }).then(function (body) { return { ok: r.ok, status: r.status, body: body }; }); }).then(function (res) { if (res.ok) { setStatus('Invite request sent. Check your inbox for a TestFlight invite from Apple.', 'success'); input.value = ''; } else if (res.status === 409) { setStatus('That email is already on the beta. Check your inbox or your TestFlight app.', 'success'); } else if (res.status === 429) { setStatus('Too many requests. Please try again in a few minutes.', 'error'); } else { var msg = (res.body && res.body.error) || 'Something went wrong. Please try again.'; setStatus(msg, 'error'); } }).catch(function () { setStatus('Network error. Please try again.', 'error'); }).then(function () { submit.disabled = false; }); }); })(); ``` -------------------------------- ### Validate app compliance Source: https://github.com/0xsero/litter/blob/main/docs/releases/export-compliance/README.md Runs a validation check on the app to ensure export compliance requirements are met. ```bash asc validate com.sigkitten.litter --wait ``` -------------------------------- ### Build Android Rust JNI Artifacts Source: https://github.com/0xsero/litter/blob/main/apps/android/README.md Compiles the Rust code and copies the resulting JNI artifacts into the bridge directory. ```bash ./tools/scripts/build-android-rust.sh ``` -------------------------------- ### Regenerate Xcode Project Source: https://github.com/0xsero/litter/blob/main/CLAUDE.md Commands to regenerate the Xcode project. Avoid running xcodegen directly inside the apps/ios directory to prevent nested project structures. ```bash make xcgen ``` ```bash ./apps/ios/scripts/regenerate-project.sh ``` ```bash xcodegen generate --spec project.yml --project Litter.xcodeproj ``` -------------------------------- ### Font Size Calibration Table Source: https://github.com/0xsero/litter/blob/main/shared/rust-bridge/codex-mobile-client/src/widget_guidelines/svg_setup.md Reference table for estimating text label widths based on character count, font weight, and font size. ```csv text, chars length, font-weight, font-size, rendered width Authentication Service, chars: 22, font-weight: 500, font-size: 14px, width: 167px Background Job Processor, chars: 24, font-weight: 500, font-size: 14px, width: 201px Detects and validates incoming tokens, chars: 37, font-weight: 400, font-size: 14px, width: 279px forwards request to, chars: 19, font-weight: 400, font-size: 12px, width: 123px データベースサーバー接続, chars: 12, font-weight: 400, font-size: 14px, width: 181px ``` -------------------------------- ### Interactive Explainer HTML Structure Source: https://github.com/0xsero/litter/blob/main/shared/rust-bridge/codex-mobile-client/src/widget_guidelines/ui_components.md HTML structure for interactive controls including range sliders, result displays, and a canvas for charts. ```html
    20
    £1,000 → £3,870
    ``` -------------------------------- ### Validate Shared Rust Changes Source: https://github.com/0xsero/litter/blob/main/CLAUDE.md Commands to ensure both iOS and Android runtimes are available for testing shared Rust logic. ```bash xcrun simctl boot ``` ```bash adb devices -l ``` -------------------------------- ### Initialize and Style Mermaid ERD Source: https://github.com/0xsero/litter/blob/main/shared/rust-bridge/codex-mobile-client/src/widget_guidelines/diagram_types.md Uses Mermaid.js to render an ERD, then applies custom CSS and DOM manipulation to round entity corners and remove attribute row borders for a design-system-compliant look. ```html
    ``` -------------------------------- ### Triage Mobile Feedback Source: https://github.com/0xsero/litter/blob/main/CLAUDE.md Scripts for managing mobile feedback and crash reports from store platforms. ```bash ./tools/scripts/triage-mobile-feedback.py --last-hours 24 ``` ```bash ./tools/scripts/triage-mobile-feedback.py mark '' --status done --note 'fixed in ...' ``` ```bash ./tools/scripts/triage-mobile-feedback.py mark '' --status pr-open --note 'Fix PR #...' ``` -------------------------------- ### App Mode JavaScript Bridge Globals Source: https://github.com/0xsero/litter/blob/main/shared/rust-bridge/codex-mobile-client/src/widget_guidelines/app.md Injected global functions for managing app state and performing structured AI queries. ```javascript // Returns the parsed state object, or null if no state has ever been saved. // Safe to call on every boot. Never throws — returns null on any error. window.loadAppState() // Serializes `obj` to JSON and asks the native host to persist it. Returns // true when the request was dispatched. Persistence is async on the native // side; there is no synchronous error for size-cap rejection (see below), // but the host will drop writes that exceed the hard cap. window.saveAppState(obj) // One-shot schema-constrained AI query. Returns a Promise that resolves // with a parsed JSON object matching `responseFormat`, or rejects with a // readable Error on schema-parse failure, model refusal, timeout, or // network error. Use it for AI-powered fields like calorie lookup, // sentiment tagging, free-text→structured data extraction — things where // you need the model, not just code. // // const { calories } = await window.structuredResponse({ // prompt: "i ate a big lasagna", // responseFormat: { // type: "object", // properties: { calories: { type: "number" } }, // required: ["calories"], // }, // }); // // `responseFormat` is a raw JSON Schema object passed through to OpenAI // structured-output mode (strict). Two constraints you MUST follow or // the call will 400 at the model boundary: // 1. `required` must list EVERY key in `properties` (strict mode). // If a field is genuinely optional, make its type nullable instead, // e.g. `{ type: ["string", "null"] }`, and still list it in `required`. // 2. Set `additionalProperties: false` on every object. // Keep schemas flat and small — one level of nesting, no more than a // handful of fields. window.structuredResponse({ prompt, responseFormat }) ``` -------------------------------- ### Sync Codex Submodule Source: https://github.com/0xsero/litter/blob/main/docs/DEVELOPMENT.md Synchronizes and applies patches to the vendored Codex submodule. ```bash ./apps/ios/scripts/sync-codex.sh ```