Full Code of nikivdev/flow for AI

main 6a108e90229f cached
400 files
5.1 MB
1.4M tokens
5847 symbols
1 requests
Download .txt
Showing preview only (5,402K chars total). Download the full file or copy to clipboard to get everything.
Repository: nikivdev/flow
Branch: main
Commit: 6a108e90229f
Files: 400
Total size: 5.1 MB

Directory structure:
gitextract_aj30rg7u/

├── .ai/
│   ├── agents.md
│   ├── docs/
│   │   ├── .last_sync
│   │   ├── architecture.md
│   │   ├── changelog.md
│   │   └── commands.md
│   ├── flox/
│   │   └── manifest.toml
│   ├── health-checks.json
│   ├── recipes/
│   │   └── project/
│   │       ├── bootstrap-core-tools.md
│   │       ├── install-rise-auto.md
│   │       ├── installer-smoke-sh.md
│   │       ├── release-core-toolchain.md
│   │       ├── release-flow-registry.md
│   │       ├── release-rise-registry.md
│   │       └── release-seq-registry.md
│   ├── repos.toml
│   ├── tasks/
│   │   └── flow/
│   │       ├── bench-cli/
│   │       │   ├── main.mbt
│   │       │   ├── moon.mod.json
│   │       │   └── moon.pkg.json
│   │       ├── dev-check/
│   │       │   ├── main.mbt
│   │       │   ├── moon.mod.json
│   │       │   └── moon.pkg.json
│   │       ├── noop/
│   │       │   ├── main.mbt
│   │       │   ├── moon.mod.json
│   │       │   └── moon.pkg.json
│   │       ├── pr-ready/
│   │       │   ├── main.mbt
│   │       │   ├── moon.mod.json
│   │       │   └── moon.pkg.json
│   │       ├── regression-smoke/
│   │       │   ├── main.mbt
│   │       │   ├── moon.mod.json
│   │       │   └── moon.pkg.json
│   │       └── release-preflight/
│   │           ├── main.mbt
│   │           ├── moon.mod.json
│   │           └── moon.pkg.json
│   └── todos/
│       └── todos.json
├── .flox.disabled
├── .github/
│   └── workflows/
│       ├── canary.yml
│       ├── nightly-validation.yml
│       ├── pr-fast.yml
│       └── release.yml
├── .gitignore
├── .goreleaser.yaml
├── .pi/
│   └── extensions/
│       └── test-extensibility.ts
├── AGENTS.md.bak
├── Cargo.toml
├── Support/
│   └── flow/
│       └── auth.toml
├── agents.md
├── bench/
│   ├── ffi_host_boundary/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       ├── bin/
│   │       │   └── rust_boundary_bench.rs
│   │       └── lib.rs
│   └── moon_ffi_boundary/
│       ├── main.mbt
│       ├── moon.mod.json
│       └── moon.pkg.template.json
├── build.rs
├── crates/
│   ├── ai_taskd_client/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       └── main.rs
│   ├── flow_commit_scan/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       └── lib.rs
│   ├── opentui-lite/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       └── lib.rs
│   ├── seq_client/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       └── lib.rs
│   └── seq_everruns_bridge/
│       ├── Cargo.toml
│       └── src/
│           ├── lib.rs
│           └── maple.rs
├── docs/
│   ├── ai-dev-layout.md
│   ├── ai-run-task-fast-path.md
│   ├── ai-task-fast-path-guide.md
│   ├── ai-traces.md
│   ├── anonymous-telemetry-contract.md
│   ├── ascii-commit-visualization-pipeline.md
│   ├── bench/
│   │   ├── cli-startup.md
│   │   ├── moonbit-rust-ffi-boundary.md
│   │   └── readme.md
│   ├── ci-cd-runbook.md
│   ├── codex-first-control-plane-roadmap.md
│   ├── codex-fork-tasks.md
│   ├── codex-maple-telemetry-runbook.md
│   ├── codex-openai-session-resolver.md
│   ├── commands/
│   │   ├── ai.md
│   │   ├── clone.md
│   │   ├── commit.md
│   │   ├── commits.md
│   │   ├── db.md
│   │   ├── deploy.md
│   │   ├── docs.md
│   │   ├── domains.md
│   │   ├── down.md
│   │   ├── env.md
│   │   ├── fast.md
│   │   ├── global.md
│   │   ├── install.md
│   │   ├── invariants.md
│   │   ├── jj.md
│   │   ├── migrate.md
│   │   ├── new.md
│   │   ├── pr.md
│   │   ├── publish.md
│   │   ├── readme.md
│   │   ├── recipe.md
│   │   ├── release.md
│   │   ├── repos.md
│   │   ├── reviews-todo.md
│   │   ├── seq-rpc.md
│   │   ├── services.md
│   │   ├── setup.md
│   │   ├── skills.md
│   │   ├── sync.md
│   │   ├── tasks.md
│   │   ├── up.md
│   │   ├── upstream.md
│   │   ├── url.md
│   │   └── web.md
│   ├── commits/
│   │   ├── .gitkeep
│   │   └── readme.md
│   ├── dependency-vendoring.md
│   ├── dev-server-management.md
│   ├── env-security-roadmap.md
│   ├── everruns-maple-runbook.md
│   ├── everruns-seq-bridge-integration.md
│   ├── fast-commit-deep-review-loop.md
│   ├── features.md
│   ├── flow-toml-spec.md
│   ├── how-api-expects-logs-errors-for-automatic-fixes.md
│   ├── how-flow-daemon-manages-macos-services.md
│   ├── how-to-make-a-project-flow-project.md
│   ├── how-to-use-flow-ai-to-manage-claude-code-sessions.md
│   ├── how-to-use-flow-to-deploy.md
│   ├── how-to-use-flow-to-store-and-work-with-env.md
│   ├── ideas.toml
│   ├── index.mdx
│   ├── install-script-latest-release-verification.md
│   ├── jj-home-branch-workflow.md
│   ├── jj-review-workspaces.md
│   ├── jj-workspaces-for-parallel-work.md
│   ├── local-domains-domainsd-cpp-spec.md
│   ├── local-domains-no-random-ports.md
│   ├── log-ingesting.md
│   ├── moonbit-ai-tasks-implementation.md
│   ├── moonbit-rust-boundary-refactor-plan.md
│   ├── moving-repos.md
│   ├── myflow-localhost-runbook.md
│   ├── new-branch.md
│   ├── new-pr.md
│   ├── outdated-readme.md
│   ├── pr-edit-watcher.md
│   ├── private-fork-flow.md
│   ├── private-mirror-sync-workflow.md
│   ├── private-repo-fast.md
│   ├── proxyx-design.md
│   ├── read-stream-of-logs.md
│   ├── rise-sandbox-feature-test-runbook.md
│   ├── rise.md
│   ├── rl-for-myflow-harbor.md
│   ├── rl-myflow-harbor-task-specs.md
│   ├── rl-signal-capture-runbook.md
│   ├── run-repos.md
│   ├── seq-agent-rpc-contract.md
│   ├── session-history-mining.md
│   ├── session-semantic-recovery-with-seq.md
│   ├── set-env-with-hive.md
│   ├── task-failure-hooks.md
│   ├── usage-analytics-rollout.md
│   ├── use-flow-to-write-software-better.md
│   ├── vendor-code-intelligence.md
│   ├── vendor-nix-inspiration.md
│   └── vendor-optimization-loop.md
├── flow.py
├── flow.toml
├── install.sh
├── lib/
│   └── vendor-manifest/
│       ├── axum.toml
│       ├── clap.toml
│       ├── crossterm.toml
│       ├── crypto_secretbox.toml
│       ├── ctrlc.toml
│       ├── futures.toml
│       ├── hmac.toml
│       ├── ignore.toml
│       ├── notify-debouncer-mini.toml
│       ├── notify.toml
│       ├── portable-pty.toml
│       ├── ratatui.toml
│       ├── regex.toml
│       ├── reqwest.toml
│       ├── rmp-serde.toml
│       ├── rusqlite.toml
│       ├── serde.toml
│       ├── sha1.toml
│       ├── sha2.toml
│       ├── tokio-stream.toml
│       ├── tokio.toml
│       ├── toml.toml
│       ├── tower-http.toml
│       ├── tracing-subscriber.toml
│       ├── url.toml
│       └── x25519-dalek.toml
├── license
├── pyproject.toml
├── readme.md
├── scripts/
│   ├── agents-switch.sh
│   ├── ai-taskd-launchd.py
│   ├── bench-ai-runtime.py
│   ├── bench-cli-startup.py
│   ├── bench-moonbit-rust-ffi.py
│   ├── build_rl_runtime_dataset.py
│   ├── cdn-nginx.conf
│   ├── check_cli_startup_thresholds.py
│   ├── check_release_tag_version.py
│   ├── ci/
│   │   └── check-readme-case.sh
│   ├── ci_blacksmith.py
│   ├── ci_host_runner.py
│   ├── ci_host_setup.sh
│   ├── cli_startup_thresholds.json
│   ├── codex-flow-wrapper
│   ├── codex-jazz-wrapper
│   ├── codex-skill-eval-launchd.py
│   ├── codex_fork.py
│   ├── deploy.sh
│   ├── deps_check.py
│   ├── generate_help_full_json.py
│   ├── install-linux-hub.sh
│   ├── install-macos-dev.sh
│   ├── install.sh
│   ├── myflow-commit-session-smoke.sh
│   ├── package-release.sh
│   ├── pre-push-guard.sh
│   ├── publish-release.sh
│   ├── release.sh
│   ├── remote-hub-setup.sh
│   ├── rl_signal_summary.py
│   ├── run-health-checks.mjs
│   ├── run-repos.sh
│   ├── setup-github-ssh.sh
│   ├── setup-release-host.sh
│   ├── sync-cdn.sh
│   ├── vendor/
│   │   ├── apply-trims.sh
│   │   ├── bench_iteration.py
│   │   ├── check-upstream.sh
│   │   ├── important-crates.txt
│   │   ├── inhouse-crate.sh
│   │   ├── materialize-all.sh
│   │   ├── offenders.sh
│   │   ├── optimize_loop.sh
│   │   ├── rough_edges_audit.py
│   │   ├── sync-all.sh
│   │   ├── sync-crate.sh
│   │   ├── trim-hooks.sh
│   │   ├── typesense_code_index.py
│   │   ├── update-deps.sh
│   │   └── vendor-repo.sh
│   └── verify-install-latest-release.sh
├── spec/
│   └── tracing-flow.md
├── src/
│   ├── activity_log.rs
│   ├── agent_setup.rs
│   ├── agents.rs
│   ├── ai.rs
│   ├── ai_context.rs
│   ├── ai_everruns.rs
│   ├── ai_server.rs
│   ├── ai_taskd.rs
│   ├── ai_tasks.rs
│   ├── ai_test.rs
│   ├── analytics.rs
│   ├── archive.rs
│   ├── ask.rs
│   ├── auth.rs
│   ├── base_tool.rs
│   ├── bin/
│   │   ├── ai_taskd_client.rs
│   │   └── lin.rs
│   ├── branches.rs
│   ├── changes.rs
│   ├── cli.rs
│   ├── code.rs
│   ├── codex_memory.rs
│   ├── codex_runtime.rs
│   ├── codex_skill_eval.rs
│   ├── codex_telemetry.rs
│   ├── codex_text.rs
│   ├── codexd.rs
│   ├── commit.rs
│   ├── commits.rs
│   ├── config.rs
│   ├── daemon.rs
│   ├── daemon_snapshot.rs
│   ├── db.rs
│   ├── deploy.rs
│   ├── deploy_setup.rs
│   ├── deps.rs
│   ├── discover.rs
│   ├── docs.rs
│   ├── doctor.rs
│   ├── domains.rs
│   ├── env.rs
│   ├── env_setup.rs
│   ├── explain_commits.rs
│   ├── ext.rs
│   ├── features.rs
│   ├── fish_install.rs
│   ├── fish_trace.rs
│   ├── fix.rs
│   ├── fixup.rs
│   ├── flox.rs
│   ├── gh_release.rs
│   ├── git_guard.rs
│   ├── gitignore_policy.rs
│   ├── hash.rs
│   ├── health.rs
│   ├── help_full.json
│   ├── help_search.rs
│   ├── history.rs
│   ├── hive.rs
│   ├── home.rs
│   ├── http_client.rs
│   ├── hub.rs
│   ├── indexer.rs
│   ├── info.rs
│   ├── init.rs
│   ├── install.rs
│   ├── invariants.rs
│   ├── jazz_state.rs
│   ├── jazz_state_stub.rs
│   ├── jj.rs
│   ├── json_parse.rs
│   ├── latest.rs
│   ├── lib.rs
│   ├── lifecycle.rs
│   ├── lmstudio.rs
│   ├── log_server.rs
│   ├── log_store.rs
│   ├── logs.rs
│   ├── macos.rs
│   ├── main.rs
│   ├── notify.rs
│   ├── opentui_prompt.rs
│   ├── otp.rs
│   ├── palette.rs
│   ├── parallel.rs
│   ├── path_hygiene.rs
│   ├── pr_edit.rs
│   ├── processes.rs
│   ├── project_snapshot.rs
│   ├── projects.rs
│   ├── proxy/
│   │   ├── mod.rs
│   │   ├── server.rs
│   │   ├── summary.rs
│   │   └── trace.rs
│   ├── publish.rs
│   ├── push.rs
│   ├── recipe.rs
│   ├── registry.rs
│   ├── release.rs
│   ├── release_signing.rs
│   ├── repo_capsule.rs
│   ├── repos.rs
│   ├── reviews_todo.rs
│   ├── rl_signals.rs
│   ├── running.rs
│   ├── screen.rs
│   ├── sealer_crypto.rs
│   ├── secret_redact.rs
│   ├── secrets.rs
│   ├── seq_client.rs
│   ├── seq_rpc.rs
│   ├── server.rs
│   ├── servers.rs
│   ├── servers_tui.rs
│   ├── services.rs
│   ├── setup.rs
│   ├── skills.rs
│   ├── ssh.rs
│   ├── ssh_keys.rs
│   ├── start.rs
│   ├── storage.rs
│   ├── supervisor.rs
│   ├── sync.rs
│   ├── task_failure_agents.rs
│   ├── task_match.rs
│   ├── tasks.rs
│   ├── terminal.rs
│   ├── todo.rs
│   ├── tools.rs
│   ├── trace.rs
│   ├── traces.rs
│   ├── traces_stub.rs
│   ├── undo.rs
│   ├── upgrade.rs
│   ├── upstream.rs
│   ├── url_inspect.rs
│   ├── usage.rs
│   ├── vcs.rs
│   ├── watchers.rs
│   ├── web.rs
│   └── workflow.rs
├── test-extension.md
├── tests/
│   ├── deps.ts
│   └── test_log_server.ts
├── tools/
│   └── domainsd-cpp/
│       ├── domainsd.cpp
│       ├── install-macos-launchd.sh
│       ├── readme.md
│       └── uninstall-macos-launchd.sh
└── vendor.lock.toml

================================================
FILE CONTENTS
================================================

================================================
FILE: .ai/agents.md
================================================
# Autonomous Agent Instructions

Project: flow

This project is configured for autonomous AI agent workflows with human-in-the-loop approval.

## Response Format

**Every response MUST end with exactly one of these signals on the final line:**

### Success signals

```
done.
```
Use when task completed successfully with high certainty. No further action needed.

```
done: <message>
```
Use when task completed with context to share. Example: `done: Added login command with --token flag`

### Needs human input

```
needsUpdate: <message>
```
Use when you need human decision or action. Example: `needsUpdate: Should I use OAuth or API key auth?`

### Error signals

```
error: <message>
```
Use when task failed or cannot proceed. Example: `error: Build failed - missing dependency xyz`

## Rules

1. **Always end with a signal** - The last line must be one of the above
2. **One signal only** - Never combine signals
3. **Be specific** - Include actionable context in messages
4. **No quotes** - Write signals exactly as shown, no wrapping quotes

## Examples

### Successful implementation
```
Added the new CLI command with all requested flags.

done.
```

### Completed with context
```
Refactored the auth module to use the new token format.

done: Auth now supports both JWT and API key methods
```

### Need human decision
```
Found two approaches for caching:
1. Redis - better for distributed systems
2. In-memory - simpler, faster for single instance

needsUpdate: Which caching approach should I use?
```

### Error occurred
```
Attempted to run tests but encountered issues.

error: Test suite requires DATABASE_URL environment variable
```


================================================
FILE: .ai/docs/.last_sync
================================================
2026-01-01 03:08:07 (4e4a4e7)


================================================
FILE: .ai/docs/architecture.md
================================================
# Flow Architecture

## Overview

Flow is a CLI tool and task runner written in Rust. It provides project automation, AI-assisted development workflows, and deployment capabilities.

## Project Structure

```
src/
├── main.rs          # CLI entry point, command routing
├── lib.rs           # Module exports
├── cli.rs           # Clap command definitions
├── config.rs        # Configuration loading (flow.toml, global config)
├── tasks.rs         # Task execution and discovery
├── parallel.rs      # Parallel task runner with TUI
├── commit.rs        # AI-powered git commits and code review
├── ai.rs            # AI session management (Claude, Codex)
├── deploy.rs        # Deployment to hosts/platforms
├── deploy_setup.rs  # Interactive deployment setup
├── docs.rs          # Auto-generated documentation management
├── daemon.rs        # Background daemon management
├── start.rs         # Project bootstrap (.ai/ folder)
├── env.rs           # Environment variable management
├── skills.rs        # Codex skill management
├── tools.rs         # AI tool management
├── agent.rs         # Kode subagent invocation
├── upstream.rs      # Upstream fork workflow
├── hub.rs           # Hub daemon management
├── processes.rs     # Process tracking and management
├── projects.rs      # Project registry
├── history.rs       # Task history
├── palette.rs       # Fuzzy finder UI
├── notify.rs        # Lin notification integration
├── commits.rs       # Git commit browser
├── fixup.rs         # TOML auto-fix
├── doctor.rs        # System diagnostics
├── init.rs          # Project scaffolding
├── discover.rs      # Config discovery
├── flox.rs          # Flox integration
├── task_match.rs    # NL task matching via LM Studio
├── lmstudio.rs      # LM Studio API client
├── log_server.rs    # HTTP log server
├── log_store.rs     # Log storage
├── watchers.rs      # File watchers
├── running.rs       # Running state tracking
├── sync.rs          # Sync utilities
└── db.rs            # Database utilities
```

## Configuration

### Project Config (`flow.toml`)

```toml
name = "project-name"

[tasks.dev]
run = "cargo run"
description = "Run development server"

[tasks.build]
run = "cargo build --release"

[daemons.api]
run = "cargo run --bin api"
port = 8080

[host]
connection = "user@host"
domain = "example.com"

[cloudflare]
name = "worker-name"

[commit]
review_instructions = "Focus on security"
```

### Global Config (`~/.config/flow/flow.toml`)

Global tasks and settings that apply across all projects.

## Key Concepts

### Tasks
Commands defined in `flow.toml` that can be run via `f <task>`. Support descriptions, dependencies, and arguments.

### Daemons
Long-running background processes managed by flow. Can be started, stopped, and monitored.

### AI Sessions
Integration with Claude Code and Codex. Sessions are tracked in `.ai/internal/sessions/` with checkpoints for context management.

### Deployment
Support for:
- **Host**: SSH-based deployment to Linux servers
- **Cloudflare**: Workers deployment
- **Railway**: Platform deployment

### Hub
Central daemon for managing servers and aggregating logs across projects.

## Data Flow

### Commit Flow
1. Stage changes (`git add`)
2. Generate diff
3. (Optional) Code review via Codex/Claude
4. Generate commit message via OpenAI
5. Commit and push
6. (Optional) Sync to gitedit.dev

### Task Execution
1. Load `flow.toml` (project or global)
2. Resolve task by name
3. Execute command with environment
4. Capture output and status
5. Store in history

### Parallel Execution
1. Parse task specifications
2. Create async task handles
3. Run with semaphore-based concurrency limit
4. Render real-time TUI with spinners
5. Collect results and display failures

## File Locations

### Per-Project
- `.ai/` - AI configuration and data
  - `actions/` - Fixer scripts
  - `skills/` - Codex skills
  - `tools/` - TypeScript tools
  - `flox/` - Flox manifest
  - `docs/` - Auto-generated docs
  - `agents.md` - Agent instructions
  - `internal/` - Private data (gitignored)
    - `sessions/` - AI sessions
    - `checkpoints/` - Checkpoints
    - `db/` - SQLite database
- `.claude/` - Symlinks to `.ai/` (gitignored)
- `.codex/` - Symlinks to `.ai/` (gitignored)
- `.flox/` - Symlinks to `.ai/flox/` (gitignored)
- `flow.toml` - Project configuration

### Global
- `~/.config/flow/flow.toml` - Global config
- `~/.config/flow/config.toml` - Flow settings
- `~/.local/share/flow/` - Data storage
  - `history.sqlite` - Task history
  - `projects.json` - Project registry

## Dependencies

Key crates:
- `clap` - CLI parsing
- `tokio` - Async runtime
- `axum` - HTTP server
- `ratatui` - TUI components
- `crossterm` - Terminal manipulation
- `reqwest` - HTTP client
- `rusqlite` - SQLite
- `serde` - Serialization
- `toml` - Config parsing


================================================
FILE: .ai/docs/changelog.md
================================================
# Changelog

Auto-maintained changelog tracking flow features and changes.

## 2024-12-31

### Added
- **Documentation system** (`f docs`): Auto-generated documentation in `.ai/docs/`. Commands: `list`, `status`, `sync`, `edit`. Docs are updated by AI as part of commit flow.
- **Parallel task runner** (`f parallel`): Run multiple tasks concurrently with animated spinners, real-time status display, and pretty output. Supports custom labels (`label:command`) and fail-fast mode.
- **Docs update reminder**: Commit flow now detects when docs may need updating and shows a reminder.

### Changed
- **`f commit` is now the default**: Full commit with Claude review + GitEdit sync. Just run `f commit` or `f commit -m "note"`.
- **Claude is default reviewer**: Use `--codex` to switch to Codex.
- **No context by default**: Use `--context` to include AI session context.
- **Tokens default 1000**: Use `-t` to change.
- **Hidden legacy commands**: `f commit-simple` (no review) and `f commit-with-check` (no gitedit) are hidden but still available.
- **`.flox/` materialization**: Flox environment now gitignored and materialized from `.ai/flox/manifest.toml` via `f start`. Source of truth moved to `.ai/flox/`.
- **Gitignore section**: `f start` now adds `.flox/` to the `# flow` gitignore section.

## 2024-12-30

### Added
- **Deploy health check** (`f deploy health`): HTTP health check for deployments with configurable URL and expected status code.
- **GitEdit review sync**: `f commitWithCheckWithGitedit` now syncs diff, review results, and AI session data to gitedit.dev.

### Changed
- **`.ai/` folder restructure**: Separated public (tracked) and private (gitignored) content:
  - `.ai/actions/`, `.ai/skills/`, `.ai/tools/`, `.ai/flox/` - tracked
  - `.ai/internal/` - gitignored (sessions, checkpoints, db)
- **Tool folder materialization**: `.claude/` and `.codex/` now gitignored and materialized from `.ai/` via symlinks in `f start`.
- **Review instructions**: Now auto-discovered from `.ai/review.md`, `.ai/commit-review.md`, or `.ai/instructions.md`.
- **Fixers**: Pre-commit fixers now check first before processing, support scripts in `.ai/actions/`.

---

## Document Sync

This changelog is updated when commits add new features or make significant changes. To update:

1. Run `f docs sync` (when implemented)
2. Or manually add entries following the format above

### Tracking Commits

Recent commits that may need documentation:
- Check `git log --oneline -20` for recent changes
- Focus on user-facing features and behavior changes


================================================
FILE: .ai/docs/commands.md
================================================
# Flow CLI Commands

Auto-generated documentation for flow CLI commands.

## Task Execution

### `f` (no args)
Opens fuzzy finder to browse and run project tasks from `flow.toml`.

### `f <task>`
Run a task directly by name. Additional arguments are passed to the task command.

### `f run <task>`
Explicit task execution (same as `f <task>`).

### `f tasks`
List all tasks from the current project's `flow.toml` with descriptions.

### `f rerun`
Re-run the last executed task in this project.

### `f last-cmd`
Show the last task's input and output/error.

### `f last-cmd-full`
Show full details of the last task run (command, status, output).

### `f search` (alias: `f s`)
Fuzzy search global commands/tasks from `~/.config/flow/flow.toml`. Useful outside project directories.

### `f match <query>` (alias: `f m`)
Match natural language query to a task using LM Studio. Requires LM Studio running on localhost:1234.

Options:
- `--model <name>` - LM Studio model (default: qwen3-8b)
- `--port <port>` - LM Studio port (default: 1234)
- `-n, --dry-run` - Show match without running

## Parallel Execution

### `f parallel <tasks...>` (alias: `f p`)
Run multiple tasks in parallel with pretty status display.

```bash
# Auto-labeled (uses first word as label)
f parallel 'echo hello' 'cargo build' 'cargo test'

# Custom labels with label:command syntax
f parallel 'build:cargo build' 'test:cargo test' 'lint:cargo clippy'
```

Options:
- `-j, --jobs <n>` - Max concurrent jobs (default: CPU count)
- `-f, --fail-fast` - Stop all tasks on first failure

Features:
- Animated spinners with color cycling
- Real-time status (pending/running/success/failure)
- Shows last output line during execution
- Timing for completed tasks
- Full output for failed tasks

## Git & Commits

### `f commit` (alias: `f c`)
The default flow commit: stages changes, runs Claude code review, generates commit message, commits, pushes, and syncs AI sessions to gitedit.dev.

```bash
f commit              # Just commit with Claude review
f commit -m "note"    # Add author note to commit message
```

Options:
- `-n, --no-push` - Skip pushing after commit
- `--sync` - Run synchronously (don't delegate to hub)
- `--context` - Include AI session context in review (default: off)
- `--dry` - Show context without committing
- `--codex` - Use Codex instead of Claude for review
- `--review-model <model>` - Choose model (claude-opus, codex-high, codex-mini)
- `-m, --message <msg>` - Custom message to include
- `-t, --tokens <n>` - Max tokens for context (default: 1000)

### `f commit-simple` (hidden)
Simple AI commit without code review. Just generates commit message and commits.

### `f commit-with-check` (alias: `f cc`, hidden)
Like `commit` but without syncing to gitedit.dev.

### `f commits`
Browse git commits with AI session metadata using fuzzy search.

Options:
- `-n, --limit <n>` - Number of commits (default: 100)
- `--all` - Show all branches

### `f fixup`
Fix common TOML syntax errors in `flow.toml`.

Options:
- `-n, --dry-run` - Show fixes without applying

## Process Management

### `f ps`
List running flow processes for current project.

Options:
- `--all` - Show processes across all projects

### `f kill [task]`
Stop running flow processes.

Options:
- `--pid <pid>` - Kill by PID
- `--all` - Kill all project processes
- `-f, --force` - Force kill (SIGKILL)
- `--timeout <secs>` - SIGKILL timeout (default: 5)

### `f logs [task]`
View logs from running or recent tasks.

Options:
- `-f, --follow` - Follow in real-time
- `-n, --lines <n>` - Lines to show (default: 50)
- `--all` - All projects
- `-l, --list` - List available logs
- `-p, --project <name>` - By project name
- `-q, --quiet` - Suppress headers

## Daemons

### `f daemon` (alias: `f d`)
Manage background daemons defined in `flow.toml`.

Subcommands:
- `start <name>` - Start a daemon
- `stop <name>` - Stop a daemon
- `restart <name>` - Restart a daemon
- `status` - Show all daemon status
- `list` (alias: `ls`) - List available daemons

## AI Sessions

### `f ai`
Manage AI coding sessions (Claude Code, Codex).

Subcommands:
- `list` (alias: `ls`) - List all sessions
- `claude [action]` - Claude sessions only
- `codex [action]` - Codex sessions only
- `resume [session]` - Resume a session
- `save <name>` - Bookmark current session
- `notes <session>` - Open/create session notes
- `remove <session>` - Remove from tracking
- `init` - Initialize .ai folder
- `import` - Import existing sessions
- `copy [session]` - Copy history to clipboard
- `context [session]` - Copy last exchange for context passing

### `f sessions` (alias: `f ss`)
Fuzzy search AI sessions across all projects, copy context to clipboard.

Options:
- `-p, --provider <name>` - Filter by provider (claude, codex, all)
- `-c, --count <n>` - Number of exchanges to copy
- `-l, --list` - Show without copying
- `-f, --full` - Full context, ignore checkpoints
- `--summarize` - Generate summaries for stale sessions

### `f agent` (alias: `f a`)
Invoke kode AI subagents.

Subcommands:
- `list` (alias: `ls`) - List available agents
- `run <agent> <prompt>` - Run agent (codify, explore, general)

## Project Setup

### `f init`
Scaffold a new `flow.toml` in current directory.

Options:
- `--path <path>` - Output path

### `f start`
Bootstrap project with `.ai/` folder structure:
- `.ai/actions/` - Fixer scripts (tracked)
- `.ai/skills/` - Shared skills (tracked)
- `.ai/tools/` - Shared tools (tracked)
- `.ai/flox/` - Flox manifest (tracked)
- `.ai/docs/` - AI-generated docs (tracked)
- `.ai/agents.md` - Agent instructions (tracked)
- `.ai/internal/` - Private data (gitignored)

Also materializes `.claude/`, `.codex/`, `.flox/` with symlinks.

### `f doctor`
Verify required tools and shell integrations (flox, lin, direnv).

### `f projects`
List all registered projects (those with `name` in `flow.toml`).

### `f active [project]`
Show or set the active project (fallback for commands outside project dirs).

Options:
- `-c, --clear` - Clear active project

## Environment

### `f env`
Sync project environment and manage env vars via 1focus.

Subcommands:
- `login` - Authenticate with 1focus
- `pull` - Fetch env vars to .env
- `push` - Push .env to 1focus
- `list` (alias: `ls`) - List env vars
- `set <KEY=VALUE>` - Set a var
- `delete <keys...>` - Delete vars
- `status` - Show auth status

Options (for pull/push/list/set/delete):
- `-e, --environment <env>` - Environment (dev, staging, production)

## Deployment

### `f deploy`
Deploy to various platforms.

Subcommands:
- `host` (alias: `h`) - Deploy to Linux host via SSH
  - `--remote-build` - Build on remote instead of syncing artifacts
  - `--setup` - Run setup script even if deployed
- `cloudflare` (alias: `cf`) - Deploy to Cloudflare Workers
  - `--secrets` - Also set secrets from env_file
  - `--dev` - Run in dev mode
- `setup` - Interactive deploy setup
- `railway` - Deploy to Railway
- `status` - Show deployment status
- `logs` - View deployment logs
  - `-f, --follow` - Follow logs
  - `-n, --lines <n>` - Lines to show
- `restart` - Restart deployed service
- `stop` - Stop deployed service
- `shell` - SSH into host
- `set-host <connection>` - Configure host (user@host:port)
- `show-host` - Show host configuration
- `health` - Check deployment health
  - `--url <url>` - Custom URL
  - `--status <code>` - Expected status (default: 200)

## Upstream Forks

### `f upstream` (alias: `f up`)
Manage upstream fork workflow.

Subcommands:
- `status` - Show upstream configuration
- `setup` - Set up upstream remote and tracking
  - `-u, --upstream-url <url>` - Upstream repo URL
  - `-b, --upstream-branch <branch>` - Branch name (default: main)
- `pull` - Pull from upstream into local 'upstream' branch
  - `-b, --branch <branch>` - Also merge into this branch
- `sync` - Full sync: pull upstream, merge, push to origin
  - `--no-push` - Skip pushing

## Skills & Tools

### `f skills`
Manage Codex skills in `.ai/skills/`.

Subcommands:
- `list` (alias: `ls`) - List skills
- `new <name>` - Create skill
  - `-d, --description <desc>` - Description
- `show <name>` - Show skill details
- `edit <name>` - Edit in editor
- `remove <name>` - Remove skill
- `install <name>` - Install from registry
- `search [query]` - Search registry
- `sync` - Sync flow.toml tasks as skills

### `f tools` (alias: `f t`)
Manage AI tools in `.ai/tools/*.ts`.

Subcommands:
- `list` (alias: `ls`) - List tools
- `run <name> [args...]` - Run a tool
- `new <name>` - Create tool
  - `-d, --description <desc>` - Description
  - `--ai` - Use AI to generate implementation
- `edit <name>` - Edit in editor
- `remove <name>` - Remove tool

## Hub & Server

### `f hub`
Ensure hub daemon is running, launch TUI for inspection.

Subcommands:
- `start` - Start hub daemon
- `stop` - Stop hub daemon

Options:
- `--host <ip>` - Hub host (default: 127.0.0.1)
- `--port <port>` - Hub port (default: 9050)
- `--config <path>` - Config path
- `--no-ui` - Skip TUI

### `f server`
Start HTTP server for log ingestion and queries.

Options:
- `--host <host>` - Bind host (default: 127.0.0.1)
- `--port <port>` - Port (default: 9060)

Subcommands:
- `foreground` - Run in foreground
- `stop` - Stop background server

## Documentation

### `f docs`
Manage auto-generated documentation in `.ai/docs/`.

Subcommands:
- `list` (alias: `ls`) - List documentation files
- `status` - Show recent commits and what may need documenting
- `sync` - Update sync marker after docs are updated
  - `-n, --commits <n>` - Commits to analyze (default: 10)
  - `--dry` - Dry run
- `edit <name>` - Open doc file in editor

The docs are updated by AI assistants as part of the commit flow. When running `f commitWithCheckWithGitedit`, the AI reviews changes and updates:
- `commands.md` - CLI command reference
- `changelog.md` - Feature changelog
- `architecture.md` - Project structure

## Notifications

### `f notify <action>`
Send proposal notification to Lin for approval (human-in-the-loop).

Options:
- `-t, --title <title>` - Proposal title
- `-c, --context <ctx>` - Context/description
- `-e, --expires <secs>` - Expiration (default: 300)


================================================
FILE: .ai/flox/manifest.toml
================================================
version = 1

[install.cargo]
pkg-path = "cargo"

[install.eza]
pkg-path = "eza"


================================================
FILE: .ai/health-checks.json
================================================
{
  "checks": [
    {
      "name": "share-page",
      "type": "gitedit-share",
      "baseUrl": "https://gitedit.dev",
      "owner": "giteditdev",
      "repo": "gitedit",
      "commit": "HEAD"
    }
  ]
}


================================================
FILE: .ai/recipes/project/bootstrap-core-tools.md
================================================
---
title: Bootstrap Core CLI Stack
description: Install rise, seq, and seqd via flow install auto backend.
tags: [bootstrap, install, rise, seq]
---

Bootstrap the core toolchain onto the same bin directory as `f`.

```sh
set -euo pipefail
cd ~/code/flow
bin_dir="${FLOW_BIN_DIR:-$HOME/.flow/bin}"
mkdir -p "$bin_dir"
f install rise --backend auto --bin-dir "$bin_dir" --force
f install seq --backend auto --bin-dir "$bin_dir" --force
f install seqd --backend auto --bin-dir "$bin_dir" --force
ls -la "$bin_dir" | rg ' f$| rise$| seq$| seqd$| lin$' || true
```



================================================
FILE: .ai/recipes/project/install-rise-auto.md
================================================
---
title: Install Rise Via Flow Auto
description: Validate that flow install rise resolves through auto backend.
tags: [install, rise, registry, parm]
---

Install rise using Flow auto backend and print binary path.

```sh
set -euo pipefail
cd ~/code/flow
tmpdir="$(mktemp -d /tmp/flow-install-rise.XXXXXX)"
trap 'rm -rf "$tmpdir"' EXIT
f install rise --backend auto --bin-dir "$tmpdir" --force
ls -l "$tmpdir"
"$tmpdir/rise" --version || true
```


================================================
FILE: .ai/recipes/project/installer-smoke-sh.md
================================================
---
title: Installer Smoke Via sh
description: Smoke test myflow installer snippet with pipe-to-sh entrypoint.
tags: [install, smoke, sh]
---

Run the hosted installer in sh mode (supports curl | sh bootstrap).

```sh
set -euo pipefail
curl -fsSL https://myflow.sh/install.sh | sh
```


================================================
FILE: .ai/recipes/project/release-core-toolchain.md
================================================
---
title: Release Core Toolchain
description: Publish flow, rise, and seq/seqd to myflow registry.
tags: [release, registry, flow, rise, seq]
---

```sh
set -euo pipefail
cd ~/code/flow
f recipe run project:release-flow-registry
f recipe run project:release-rise-registry
f recipe run project:release-seq-registry
```


================================================
FILE: .ai/recipes/project/release-flow-registry.md
================================================
---
title: Release Flow To Registry
description: Publish flow to myflow registry with explicit version.
tags: [release, registry, myflow]
---

Cut a new registry release for flow.

```sh
set -euo pipefail
export FLOW_REGISTRY_URL="${FLOW_REGISTRY_URL:-https://myflow.sh}"
cd ~/code/flow
if [ -n "${FLOW_VERSION:-}" ]; then
  f release registry --version "$FLOW_VERSION" --registry "$FLOW_REGISTRY_URL"
else
  f release registry --registry "$FLOW_REGISTRY_URL"
fi
```


================================================
FILE: .ai/recipes/project/release-rise-registry.md
================================================
---
title: Release Rise To Registry
description: Publish latest rise binary to myflow registry.
tags: [release, registry, rise]
---

```sh
set -euo pipefail
cd ~/code/rise
f release registry
```


================================================
FILE: .ai/recipes/project/release-seq-registry.md
================================================
---
title: Release Seq+Seqd To Registry
description: Stage seq/seqd binaries and publish package seq to myflow registry.
tags: [release, registry, seq]
---

```sh
set -euo pipefail
cd ~/code/seq
f release-registry-stage
f release registry --no-build
```


================================================
FILE: .ai/repos.toml
================================================
root = "~/repos"

[[repos]]
owner = "rust-lang"
repo = "crates.io-index"
url = "https://github.com/rust-lang/crates.io-index"

[[repos]]
owner = "dtolnay"
repo = "anyhow"
url = "https://github.com/dtolnay/anyhow"

[[repos]]
owner = "tokio-rs"
repo = "tokio"
url = "https://github.com/tokio-rs/tokio"


================================================
FILE: .ai/tasks/flow/bench-cli/main.mbt
================================================
// title: Flow CLI Bench
// description: Quick CLI benchmark for high-frequency Flow entry points.
// tags: [flow,bench,latency]

fn project_root() -> String {
  match @sys.get_env_var("FLOW_AI_TASK_PROJECT_ROOT") {
    Some(root) => root
    None => "../../../.."
  }
}

async fn run_step(label : String, command : String, root : String) -> Unit raise {
  println("==> " + label)
  println("    " + command)
  let code = @process.run(
    "sh",
    ["-lc", command],
    stdin=@stdio.stdin,
    stdout=@stdio.stdout,
    stderr=@stdio.stderr,
    cwd=root,
  )
  if code != 0 {
    abort("step failed: " + label + " (exit " + code.to_string() + ")")
  }
}

async fn main raise {
  let root = project_root()
  let bench_script =
    "set -euo pipefail; " +
    "bin=${FLOW_BIN:-./target/release/f}; " +
    "if [ ! -x \"$bin\" ]; then bin=./target/debug/f; fi; " +
    "runs=${FLOW_BENCH_ITERATIONS:-20}; " +
    "warmup=${FLOW_BENCH_WARMUP:-5}; " +
    "echo \"bench bin: $bin\"; " +
    "echo \"runs: $runs warmup: $warmup\"; " +
    "if command -v hyperfine >/dev/null 2>&1; then " +
    "hyperfine --warmup \"$warmup\" --runs \"$runs\" " +
    "\"$bin --help >/dev/null\" " +
    "\"$bin tasks list >/dev/null\" " +
    "\"$bin tasks dupes >/dev/null\"; " +
    "else " +
    "echo 'hyperfine not found; fallback single-run timing'; " +
    "for cmd in '--help' 'tasks list' 'tasks dupes'; do " +
    "echo \"timing: $bin $cmd\"; /usr/bin/time -l sh -lc \"$bin $cmd >/dev/null\"; " +
    "done; " +
    "fi"

  run_step("cli benchmark", bench_script, root)
  println("flow/bench-cli: ok")
}


================================================
FILE: .ai/tasks/flow/bench-cli/moon.mod.json
================================================
{
  "name": "nikiv/flow-ai-tasks",
  "version": "0.1.0",
  "deps": {
    "moonbitlang/async": "0.16.6",
    "moonbitlang/x": "0.4.40"
  }
}


================================================
FILE: .ai/tasks/flow/bench-cli/moon.pkg.json
================================================
{
  "is-main": true,
  "import": [
    "moonbitlang/async",
    "moonbitlang/async/process",
    "moonbitlang/async/stdio",
    "moonbitlang/x/sys"
  ],
  "support-targets": ["native"]
}


================================================
FILE: .ai/tasks/flow/dev-check/main.mbt
================================================
// title: Flow Dev Check
// description: Fast local quality gate for Flow code changes.
// tags: [flow,dev,check]

fn project_root() -> String {
  match @sys.get_env_var("FLOW_AI_TASK_PROJECT_ROOT") {
    Some(root) => root
    None => "../../../.."
  }
}

async fn run_step(label : String, command : String, root : String) -> Unit raise {
  println("==> " + label)
  println("    " + command)
  let code = @process.run(
    "sh",
    ["-lc", command],
    stdin=@stdio.stdin,
    stdout=@stdio.stdout,
    stderr=@stdio.stderr,
    cwd=root,
  )
  if code != 0 {
    abort("step failed: " + label + " (exit " + code.to_string() + ")")
  }
}

async fn main raise {
  let root = project_root()
  run_step("cargo check", "cargo check --all-targets", root)
  run_step(
    "targeted ai task test",
    "cargo test ai_tasks::tests::parses_metadata_comments -- --nocapture",
    root,
  )
  run_step("tasks help smoke", "./target/debug/f tasks --help >/dev/null", root)
  println("flow/dev-check: ok")
}


================================================
FILE: .ai/tasks/flow/dev-check/moon.mod.json
================================================
{
  "name": "nikiv/flow-ai-tasks",
  "version": "0.1.0",
  "deps": {
    "moonbitlang/async": "0.16.6",
    "moonbitlang/x": "0.4.40"
  }
}


================================================
FILE: .ai/tasks/flow/dev-check/moon.pkg.json
================================================
{
  "is-main": true,
  "import": [
    "moonbitlang/async",
    "moonbitlang/async/process",
    "moonbitlang/async/stdio",
    "moonbitlang/x/sys"
  ],
  "support-targets": ["native"]
}


================================================
FILE: .ai/tasks/flow/noop/main.mbt
================================================
// title: Flow Noop
// description: Minimal AI task for runtime overhead benchmarking.
// tags: [flow,bench,noop]

fn main {
  ()
}


================================================
FILE: .ai/tasks/flow/noop/moon.mod.json
================================================
{
  "name": "nikiv/flow-ai-tasks",
  "version": "0.1.0",
  "deps": {
    "moonbitlang/async": "0.16.6",
    "moonbitlang/x": "0.4.40"
  }
}


================================================
FILE: .ai/tasks/flow/noop/moon.pkg.json
================================================
{
  "is-main": true,
  "support-targets": ["native"]
}


================================================
FILE: .ai/tasks/flow/pr-ready/main.mbt
================================================
// title: Flow PR Ready
// description: Pre-PR gate: compile, task checks, docs parity, gitignore hygiene.
// tags: [flow,pr,gate]

fn project_root() -> String {
  match @sys.get_env_var("FLOW_AI_TASK_PROJECT_ROOT") {
    Some(root) => root
    None => "../../../.."
  }
}

async fn run_step(label : String, command : String, root : String) -> Unit raise {
  println("==> " + label)
  println("    " + command)
  let code = @process.run(
    "sh",
    ["-lc", command],
    stdin=@stdio.stdin,
    stdout=@stdio.stdout,
    stderr=@stdio.stderr,
    cwd=root,
  )
  if code != 0 {
    abort("step failed: " + label + " (exit " + code.to_string() + ")")
  }
}

async fn main raise {
  let root = project_root()

  run_step("dev check", "./target/debug/f ai:flow/dev-check", root)

  run_step(
    "docs parity gate",
    "set -euo pipefail; " +
    "src_changed=$(git diff --name-only HEAD -- src/cli.rs src/tasks.rs src/palette.rs src/ai_tasks.rs || true); " +
    "if [ -n \"$src_changed\" ]; then " +
    "docs_changed=$(git diff --name-only HEAD -- docs/commands/readme.md docs/commands/tasks.md docs/commands/recipe.md || true); " +
    "if [ -z \"$docs_changed\" ]; then echo 'expected docs/commands updates for CLI/task changes' >&2; exit 1; fi; " +
    "fi; " +
    "echo 'docs parity: ok'",
    root,
  )

  run_step(
    "gitignore hygiene gate",
    "set -euo pipefail; " +
    "if git diff -- .gitignore | grep -E '\\.beads/|\\.rise/|\\.ai/todos/\\*\\.bike' >/dev/null; then " +
    "echo 'blocked personal tooling pattern detected in .gitignore diff' >&2; exit 1; " +
    "fi; " +
    "echo 'gitignore hygiene: ok'",
    root,
  )

  println("flow/pr-ready: ok")
}


================================================
FILE: .ai/tasks/flow/pr-ready/moon.mod.json
================================================
{
  "name": "nikiv/flow-ai-tasks",
  "version": "0.1.0",
  "deps": {
    "moonbitlang/async": "0.16.6",
    "moonbitlang/x": "0.4.40"
  }
}


================================================
FILE: .ai/tasks/flow/pr-ready/moon.pkg.json
================================================
{
  "is-main": true,
  "import": [
    "moonbitlang/async",
    "moonbitlang/async/process",
    "moonbitlang/async/stdio",
    "moonbitlang/x/sys"
  ],
  "support-targets": ["native"]
}


================================================
FILE: .ai/tasks/flow/regression-smoke/main.mbt
================================================
// title: Flow Regression Smoke
// description: Validate task discovery and AI task execution in a fresh temp project.
// tags: [flow,smoke,regression]

fn project_root() -> String {
  match @sys.get_env_var("FLOW_AI_TASK_PROJECT_ROOT") {
    Some(root) => root
    None => "../../../.."
  }
}

async fn run_step(label : String, command : String, root : String) -> Unit raise {
  println("==> " + label)
  println("    " + command)
  let code = @process.run(
    "sh",
    ["-lc", command],
    stdin=@stdio.stdin,
    stdout=@stdio.stdout,
    stderr=@stdio.stderr,
    cwd=root,
  )
  if code != 0 {
    abort("step failed: " + label + " (exit " + code.to_string() + ")")
  }
}

async fn main raise {
  let root = project_root()
  let smoke_script =
    "set -euo pipefail; " +
    "bin=${FLOW_BIN:-$PWD/target/debug/f}; " +
    "case \"$bin\" in /*) ;; *) bin=\"$PWD/$bin\" ;; esac; " +
    "if [ ! -x \"$bin\" ]; then bin=$PWD/target/release/f; fi; " +
    "tmp=$(mktemp -d /tmp/flow-task-smoke.XXXXXX); " +
    "trap 'rm -rf \"$tmp\"' EXIT; " +
    "printf '%s\\n' '[[tasks]]' 'name = \"hello\"' 'command = \"echo hello-flow\"' > \"$tmp/flow.toml\"; " +
    "(cd \"$tmp\" && \"$bin\" tasks init-ai --root . >/dev/null); " +
    "(cd \"$tmp\" && \"$bin\" tasks list | grep -q 'ai:starter'); " +
    "(cd \"$tmp\" && out=$(\"$bin\" starter) && case \"$out\" in *'starter ai task: ok'*) : ;; *) echo 'starter output mismatch' >&2; exit 1 ;; esac); " +
    "(cd \"$tmp\" && out=$(\"$bin\" hello) && case \"$out\" in *'hello-flow'*) : ;; *) echo 'hello output mismatch' >&2; exit 1 ;; esac); " +
    "echo 'regression smoke passed'"

  run_step("temp project smoke", smoke_script, root)
  println("flow/regression-smoke: ok")
}


================================================
FILE: .ai/tasks/flow/regression-smoke/moon.mod.json
================================================
{
  "name": "nikiv/flow-ai-tasks",
  "version": "0.1.0",
  "deps": {
    "moonbitlang/async": "0.16.6",
    "moonbitlang/x": "0.4.40"
  }
}


================================================
FILE: .ai/tasks/flow/regression-smoke/moon.pkg.json
================================================
{
  "is-main": true,
  "import": [
    "moonbitlang/async",
    "moonbitlang/async/process",
    "moonbitlang/async/stdio",
    "moonbitlang/x/sys"
  ],
  "support-targets": ["native"]
}


================================================
FILE: .ai/tasks/flow/release-preflight/main.mbt
================================================
// title: Flow Release Preflight
// description: Build release binary and validate core release smoke checks.
// tags: [flow,release,preflight]

fn project_root() -> String {
  match @sys.get_env_var("FLOW_AI_TASK_PROJECT_ROOT") {
    Some(root) => root
    None => "../../../.."
  }
}

async fn run_step(label : String, command : String, root : String) -> Unit raise {
  println("==> " + label)
  println("    " + command)
  let code = @process.run(
    "sh",
    ["-lc", command],
    stdin=@stdio.stdin,
    stdout=@stdio.stdout,
    stderr=@stdio.stderr,
    cwd=root,
  )
  if code != 0 {
    abort("step failed: " + label + " (exit " + code.to_string() + ")")
  }
}

async fn main raise {
  let root = project_root()

  run_step("build release f", "cargo build --release --bin f", root)
  run_step("release version", "./target/release/f --version", root)
  run_step("release tasks help", "./target/release/f tasks --help >/dev/null", root)
  run_step(
    "release regression smoke",
    "FLOW_BIN=./target/release/f ./target/release/f ai:flow/regression-smoke",
    root,
  )

  println("flow/release-preflight: ok")
}


================================================
FILE: .ai/tasks/flow/release-preflight/moon.mod.json
================================================
{
  "name": "nikiv/flow-ai-tasks",
  "version": "0.1.0",
  "deps": {
    "moonbitlang/async": "0.16.6",
    "moonbitlang/x": "0.4.40"
  }
}


================================================
FILE: .ai/tasks/flow/release-preflight/moon.pkg.json
================================================
{
  "is-main": true,
  "import": [
    "moonbitlang/async",
    "moonbitlang/async/process",
    "moonbitlang/async/stdio",
    "moonbitlang/x/sys"
  ],
  "support-targets": ["native"]
}


================================================
FILE: .ai/todos/todos.json
================================================
[
  {
    "id": "c1b0f1e0e6d84f33b169b9b0f87f3c4e",
    "title": "Evaluate Rolldown for builds and deployment speedups",
    "status": "pending",
    "created_at": "2026-01-02T19:30:00Z",
    "updated_at": null,
    "note": "Compare Vite/Rollup vs Rolldown (Rust) and list build cache, asset diffing, and deploy pipeline optimizations.",
    "session": null
  },
  {
    "id": "72529e916fd74131ba746d6a962f53f6",
    "title": "Re-run review: review timed out for commit d076aea",
    "status": "completed",
    "created_at": "2026-02-13T10:13:24.836444+00:00",
    "updated_at": "2026-02-13T10:46:08.595809+00:00",
    "note": "Source: flow review\nCommit: d076aead403da676b24cc8f2631cb217e7f5a004\nModel: gpt-5.1-codex-max\nReview summary: Codex review timed out after 120s\n\nRe-run review: review timed out for commit d076aea",
    "session": null,
    "external_ref": "flow-review-issue-3b7fc9b7a8dc"
  },
  {
    "id": "26717fd7a4774eceb418c88579de547c",
    "title": "Re-run review: review timed out for commit 6ace98e",
    "status": "completed",
    "created_at": "2026-02-13T14:20:44.173471+00:00",
    "updated_at": "2026-02-16T21:59:53.299632+00:00",
    "note": "Source: flow review\nCommit: 6ace98ebb6984d2b237007c964066d50f6faa153\nModel: gpt-5.1-codex-max\nReview summary: Codex review timed out after 300s\n\nRe-run review: review timed out for commit 6ace98e",
    "session": null,
    "external_ref": "flow-review-issue-ce0f9bb6b555"
  },
  {
    "id": "cf5fc5b65e62468b8f72d1cf88fac6e0",
    "title": "Re-run review: review timed out for commit 311eea9",
    "status": "completed",
    "created_at": "2026-02-14T09:28:44.871217+00:00",
    "updated_at": "2026-02-14T09:31:15.179148+00:00",
    "note": "Source: flow review\nCommit: 311eea95538dfc9c87d6b2e5f98a7890a0803465\nModel: gpt-5.1-codex-max\nReview summary: Codex review timed out after 300s\n\nRe-run review: review timed out for commit 311eea9",
    "session": null,
    "external_ref": "flow-review-issue-888c93874436"
  },
  {
    "id": "1d57246970fd4297b5bba7e2bb1c4ce3",
    "title": "Re-run review: review timed out for commit 2177d65",
    "status": "completed",
    "created_at": "2026-02-14T16:21:46.629833+00:00",
    "updated_at": "2026-02-16T21:59:53.395640+00:00",
    "note": "Source: flow review\nCommit: 2177d65d15ebc28e13152b31413aa8263e8f8f71\nModel: gpt-5.1-codex-max\nReview summary: Codex review timed out after 300s\n\nRe-run review: review timed out for commit 2177d65",
    "session": null,
    "external_ref": "flow-review-issue-e11c99ffe84e"
  },
  {
    "id": "f21c30c0925f48ac858e716fa4ca5473",
    "title": "[P2] AI branch selection errors on valid `none` response — /Users/nikiv/code/flow/src/branches.rs:93-105",
    "status": "pending",
    "created_at": "2026-02-15T14:53:56.021590+00:00",
    "updated_at": null,
    "note": "Source: flow review\nCommit: 0f2d9648acd4e91cdfa807d379adcc834937d3a9\nModel: gpt-5.1-codex-max\n\n[P2] AI branch selection errors on valid `none` response — /Users/nikiv/code/flow/src/branches.rs:93-105",
    "session": null,
    "external_ref": "flow-review-issue-cb4f1393f4e9"
  },
  {
    "id": "e52b2941b9b94e0289ba8d01f7e2fa83",
    "title": "[P2] Missing project param returns 500 instead of client error — /Users/nikiv/code/flow/src/server.rs:900-907",
    "status": "pending",
    "created_at": "2026-02-16T10:41:04.444182+00:00",
    "updated_at": null,
    "note": "Source: flow review\nCommit: 4133ea3a77aa72f21abd21c4e26799bac3278f34\nModel: gpt-5.1-codex-max\n\n[P2] Missing project param returns 500 instead of client error — /Users/nikiv/code/flow/src/server.rs:900-907",
    "session": null,
    "external_ref": "flow-review-issue-cc5166e8114b"
  },
  {
    "id": "d4a12dd1ab3449c5953b4e3e3b572e89",
    "title": "[P2] JJ default remote ignores new git.remote setting — /Users/nikiv/code/flow/src/cli.rs:1718-1726",
    "status": "pending",
    "created_at": "2026-02-16T18:58:58.634200+00:00",
    "updated_at": null,
    "note": "Source: flow review\nCommit: 0b6424d81eeee048a5e1507cc67094ea4e883819\nModel: gpt-5.1-codex-max\n\n[P2] JJ default remote ignores new git.remote setting — /Users/nikiv/code/flow/src/cli.rs:1718-1726",
    "session": null,
    "external_ref": "flow-review-issue-aa7d77e8a06c"
  },
  {
    "id": "ccc4555e52c745e4aa017237f10a8c97",
    "title": "[P1] Collect gitedit sessions after creating commit — /Users/nikiv/code/flow/src/commit.rs:4299-4311",
    "status": "pending",
    "created_at": "2026-02-16T19:43:51.443004+00:00",
    "updated_at": null,
    "note": "Source: flow review\nCommit: 18a4bde4ca0433b7b3689560cfd6a949ebfd0565\nModel: gpt-5.1-codex-max\n\n[P1] Collect gitedit sessions after creating commit — /Users/nikiv/code/flow/src/commit.rs:4299-4311",
    "session": null,
    "external_ref": "flow-review-issue-4f55a14a7a31"
  },
  {
    "id": "f264371559114db59152e00a394a999b",
    "title": "[P1] Honor recipe shell selection when running commands — /Users/nikiv/code/flow/src/recipe.rs:122-126",
    "status": "completed",
    "created_at": "2026-02-17T11:40:29.148363+00:00",
    "updated_at": "2026-02-17T14:43:38.741376+00:00",
    "note": "Source: flow review\nCommit: c52538d993835214221eb89252777e1e64027454\nModel: gpt-5.1-codex-max\n\n[P1] Honor recipe shell selection when running commands — /Users/nikiv/code/flow/src/recipe.rs:122-126",
    "session": null,
    "external_ref": "flow-review-issue-551b4c7441b9",
    "priority": "P4"
  },
  {
    "id": "e2b50f22152841f299d47ab83dc2e264",
    "title": "[P2] Global recipes default to project directory — /Users/nikiv/code/flow/src/recipe.rs:560-569",
    "status": "completed",
    "created_at": "2026-02-17T11:40:29.148363+00:00",
    "updated_at": "2026-02-17T14:43:38.749300+00:00",
    "note": "Source: flow review\nCommit: c52538d993835214221eb89252777e1e64027454\nModel: gpt-5.1-codex-max\n\n[P2] Global recipes default to project directory — /Users/nikiv/code/flow/src/recipe.rs:560-569",
    "session": null,
    "external_ref": "flow-review-issue-658624948e1a",
    "priority": "P4"
  },
  {
    "id": "1531571a23a44211837aa0a3f7692a6f",
    "title": "[P2] reviews-todo fix ignores configured Codex binary — /Users/nikiv/code/flow/src/reviews_todo.rs:262-265",
    "status": "completed",
    "created_at": "2026-02-17T11:40:29.148363+00:00",
    "updated_at": "2026-02-17T14:43:38.756548+00:00",
    "note": "Source: flow review\nCommit: c52538d993835214221eb89252777e1e64027454\nModel: gpt-5.1-codex-max\n\n[P2] reviews-todo fix ignores configured Codex binary — /Users/nikiv/code/flow/src/reviews_todo.rs:262-265",
    "session": null,
    "external_ref": "flow-review-issue-9f11354ed9dd",
    "priority": "P4"
  },
  {
    "id": "3aa07bb3ec6344cfbb2e11072ef39604",
    "title": "[P2] Run bootstrap after registry installs — /Users/nikiv/code/flow/scripts/install.sh:637-646",
    "status": "completed",
    "created_at": "2026-02-17T13:40:09.528742+00:00",
    "updated_at": "2026-02-17T14:43:38.764137+00:00",
    "note": "Source: flow review\nCommit: 96f37f21bc5bcf51fafe38fe0fc8343a3cbb916b\nModel: gpt-5.1-codex-max\n\n[P2] Run bootstrap after registry installs — /Users/nikiv/code/flow/scripts/install.sh:637-646",
    "session": null,
    "external_ref": "flow-review-issue-245de484c8ee",
    "priority": "P4"
  },
  {
    "id": "0a7bc4060d23470d96cac5ea043a6b0a",
    "title": "[P1] Scoped parsing blocks ':' or '/' task names — /var/folders/69/jnm2pqrx12103z_f8hh3_d1w0000gn/T/.tmpDgAgRL/repo/src/...",
    "status": "completed",
    "created_at": "2026-02-17T14:32:04.676369+00:00",
    "updated_at": "2026-02-17T14:42:36.827744+00:00",
    "note": "Source: flow review\nCommit: 527049ff7b73886705ded5e4105e35ca7a76d01b\nModel: gpt-5.1-codex-max\n\n[P1] Scoped parsing blocks ':' or '/' task names — /var/folders/69/jnm2pqrx12103z_f8hh3_d1w0000gn/T/.tmpDgAgRL/repo/src/tasks.rs:728-741",
    "session": null,
    "external_ref": "flow-review-issue-7cf264b052d8",
    "priority": "P4"
  },
  {
    "id": "8f2bdf3f63f440f1abbb034634fe2eae",
    "title": "Re-run review: review timed out for commit 527049f",
    "status": "completed",
    "created_at": "2026-02-17T14:35:26.536392+00:00",
    "updated_at": "2026-02-17T14:43:57.289970+00:00",
    "note": "Source: flow review\nCommit: 527049ff7b73886705ded5e4105e35ca7a76d01b\nModel: gpt-5.1-codex-max\nReview summary: Codex review timed out after 360s\n\nRe-run review: review timed out for commit 527049f",
    "session": null,
    "external_ref": "flow-review-issue-c02170490800",
    "priority": "P4"
  }
]

================================================
FILE: .flox.disabled
================================================
flox activate repeatedly failed

================================================
FILE: .github/workflows/canary.yml
================================================
name: Canary

on:
  push:
    branches:
      - main
    paths-ignore:
      - "docs/**"
      - "**/*.md"
  workflow_dispatch:

permissions:
  contents: write

concurrency:
  group: canary
  cancel-in-progress: true

env:
  CARGO_TERM_COLOR: always

jobs:
  build:
    timeout-minutes: 40
    env:
      # Don't reference `secrets.*` in `if:` expressions; GitHub rejects that at workflow-parse time.
      MACOS_SIGN_P12_B64: ${{ secrets.MACOS_SIGN_P12_B64 }}
      MACOS_SIGN_P12_PASSWORD: ${{ secrets.MACOS_SIGN_P12_PASSWORD }}
      MACOS_SIGN_IDENTITY: ${{ secrets.MACOS_SIGN_IDENTITY }}
    strategy:
      matrix:
        include:
          - target: x86_64-apple-darwin
            os: macos-latest
          - target: aarch64-apple-darwin
            os: macos-latest
          - target: x86_64-unknown-linux-gnu
            os: ubuntu-latest
          - target: aarch64-unknown-linux-gnu
            os: ubuntu-latest

    runs-on: ${{ matrix.os }}
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Validate readme casing
        run: scripts/ci/check-readme-case.sh

      - name: Cache vendored deps
        uses: actions/cache@v4
        with:
          path: |
            .vendor/flow-vendor
            lib/vendor
            lib/vendor-manifest
          key: ${{ runner.os }}-${{ runner.arch }}-vendor-${{ hashFiles('vendor.lock.toml') }}

      - name: Verify pinned vendor commit is published
        run: scripts/vendor/vendor-repo.sh verify-pinned-origin

      - name: Hydrate vendored deps
        run: scripts/vendor/vendor-repo.sh hydrate

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable
        with:
          targets: ${{ matrix.target }}

      - name: Cache Rust build
        uses: Swatinem/rust-cache@v2
        with:
          workspaces: ". -> target"
          cache-on-failure: true

      - name: Install cross-compilation tools (Linux ARM)
        if: matrix.target == 'aarch64-unknown-linux-gnu'
        run: |
          sudo apt-get update
          sudo apt-get install -y gcc-aarch64-linux-gnu

      - name: Build
        run: |
          if [ "${{ matrix.target }}" = "aarch64-unknown-linux-gnu" ]; then
            export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc
          fi
          cargo build --release --target ${{ matrix.target }} --bin f

      - name: Import code-signing certificates (macOS)
        if: runner.os == 'macOS' && env.MACOS_SIGN_P12_B64 != ''
        uses: apple-actions/import-codesign-certs@v3
        with:
          p12-file-base64: ${{ env.MACOS_SIGN_P12_B64 }}
          p12-password: ${{ env.MACOS_SIGN_P12_PASSWORD }}

      - name: Codesign (macOS)
        if: runner.os == 'macOS' && env.MACOS_SIGN_P12_B64 != '' && env.MACOS_SIGN_IDENTITY != ''
        run: |
          BIN="target/${{ matrix.target }}/release/f"
          codesign --force --options runtime --timestamp --sign "$MACOS_SIGN_IDENTITY" "$BIN"
          codesign -vvv --strict "$BIN"

      - name: Package
        run: |
          mkdir -p dist
          cp target/${{ matrix.target }}/release/f dist/
          cd dist
          tar -czvf flow-${{ matrix.target }}.tar.gz f
          cd ..

      - name: Upload artifact
        uses: actions/upload-artifact@v4
        with:
          name: flow-${{ matrix.target }}
          path: dist/flow-${{ matrix.target }}.tar.gz

  build-linux-host-simd:
    timeout-minutes: 40
    runs-on: [self-hosted, linux, x64, ci-1focus]
    env:
      RUSTFLAGS: -C target-cpu=native
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Validate readme casing
        run: scripts/ci/check-readme-case.sh

      - name: Cache vendored deps
        uses: actions/cache@v4
        with:
          path: |
            .vendor/flow-vendor
            lib/vendor
            lib/vendor-manifest
          key: ${{ runner.os }}-${{ runner.arch }}-vendor-${{ hashFiles('vendor.lock.toml') }}

      - name: Verify pinned vendor commit is published
        run: scripts/vendor/vendor-repo.sh verify-pinned-origin

      - name: Hydrate vendored deps
        run: scripts/vendor/vendor-repo.sh hydrate

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable
        with:
          targets: x86_64-unknown-linux-gnu

      - name: Cache Rust build
        uses: Swatinem/rust-cache@v2
        with:
          workspaces: ". -> target"
          cache-on-failure: true

      - name: Build (Linux host SIMD)
        run: cargo build --release --target x86_64-unknown-linux-gnu --features linux-host-simd-json --bin f

      - name: Package
        run: |
          mkdir -p dist
          cp target/x86_64-unknown-linux-gnu/release/f dist/
          cd dist
          tar -czvf flow-x86_64-unknown-linux-gnu-linux-host-simd.tar.gz f
          cd ..

      - name: Upload artifact
        uses: actions/upload-artifact@v4
        with:
          name: flow-x86_64-unknown-linux-gnu-linux-host-simd
          path: dist/flow-x86_64-unknown-linux-gnu-linux-host-simd.tar.gz

  release:
    needs: [build, build-linux-host-simd]
    timeout-minutes: 20
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Download all artifacts
        uses: actions/download-artifact@v4
        with:
          path: artifacts

      - name: Prepare release files
        run: |
          mkdir -p release
          find artifacts -name "*.tar.gz" -exec cp {} release/ \;
          cd release
          sha256sum *.tar.gz > checksums.txt
          cat checksums.txt

      - name: Move canary tag to this commit
        run: |
          git tag -f canary "${GITHUB_SHA}"
          git push origin -f refs/tags/canary

      - name: Create/Update Canary Release
        uses: softprops/action-gh-release@v2
        with:
          tag_name: canary
          name: Canary
          prerelease: true
          generate_release_notes: false
          files: release/*
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


================================================
FILE: .github/workflows/nightly-validation.yml
================================================
name: Nightly Validation

on:
  schedule:
    - cron: "27 3 * * *"
  workflow_dispatch:

permissions:
  contents: read

env:
  CARGO_TERM_COLOR: always

jobs:
  deps-freshness:
    timeout-minutes: 30
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Validate readme casing
        run: scripts/ci/check-readme-case.sh

      - name: Cache vendored deps
        uses: actions/cache@v4
        with:
          path: |
            .vendor/flow-vendor
            lib/vendor
            lib/vendor-manifest
          key: ${{ runner.os }}-${{ runner.arch }}-vendor-${{ hashFiles('vendor.lock.toml') }}

      - name: Verify pinned vendor commit is published
        run: scripts/vendor/vendor-repo.sh verify-pinned-origin

      - name: Hydrate vendored deps
        run: scripts/vendor/vendor-repo.sh hydrate

      - name: Smoke vendor trims
        run: scripts/vendor/apply-trims.sh

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable

      - name: Check dependency freshness
        run: python3 scripts/deps_check.py

  build:
    timeout-minutes: 50
    strategy:
      fail-fast: false
      matrix:
        include:
          - target: x86_64-apple-darwin
            os: macos-latest
          - target: aarch64-apple-darwin
            os: macos-latest
          - target: x86_64-unknown-linux-gnu
            os: ubuntu-latest
          - target: aarch64-unknown-linux-gnu
            os: ubuntu-latest

    runs-on: ${{ matrix.os }}
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Validate readme casing
        run: scripts/ci/check-readme-case.sh

      - name: Cache vendored deps
        uses: actions/cache@v4
        with:
          path: |
            .vendor/flow-vendor
            lib/vendor
            lib/vendor-manifest
          key: ${{ runner.os }}-${{ runner.arch }}-vendor-${{ hashFiles('vendor.lock.toml') }}

      - name: Verify pinned vendor commit is published
        run: scripts/vendor/vendor-repo.sh verify-pinned-origin

      - name: Hydrate vendored deps
        run: scripts/vendor/vendor-repo.sh hydrate

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable
        with:
          targets: ${{ matrix.target }}

      - name: Cache Rust build
        uses: Swatinem/rust-cache@v2
        with:
          workspaces: ". -> target"
          cache-on-failure: true

      - name: Install cross-compilation tools (Linux ARM)
        if: matrix.target == 'aarch64-unknown-linux-gnu'
        run: |
          sudo apt-get update
          sudo apt-get install -y gcc-aarch64-linux-gnu

      - name: Build
        run: |
          if [ "${{ matrix.target }}" = "aarch64-unknown-linux-gnu" ]; then
            export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc
          fi
          cargo build --release --target ${{ matrix.target }} --bin f

  build-linux-host-simd:
    timeout-minutes: 50
    runs-on: [self-hosted, linux, x64, ci-1focus]
    env:
      RUSTFLAGS: -C target-cpu=native
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Validate readme casing
        run: scripts/ci/check-readme-case.sh

      - name: Cache vendored deps
        uses: actions/cache@v4
        with:
          path: |
            .vendor/flow-vendor
            lib/vendor
            lib/vendor-manifest
          key: ${{ runner.os }}-${{ runner.arch }}-vendor-${{ hashFiles('vendor.lock.toml') }}

      - name: Verify pinned vendor commit is published
        run: scripts/vendor/vendor-repo.sh verify-pinned-origin

      - name: Hydrate vendored deps
        run: scripts/vendor/vendor-repo.sh hydrate

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable
        with:
          targets: x86_64-unknown-linux-gnu

      - name: Cache Rust build
        uses: Swatinem/rust-cache@v2
        with:
          workspaces: ". -> target"
          cache-on-failure: true

      - name: Build (Linux host SIMD)
        run: cargo build --release --target x86_64-unknown-linux-gnu --features linux-host-simd-json --bin f


================================================
FILE: .github/workflows/pr-fast.yml
================================================
name: PR Fast Check

on:
  pull_request:
    branches:
      - main
    paths-ignore:
      - "docs/**"
      - "**/*.md"

permissions:
  contents: read

concurrency:
  group: pr-fast-${{ github.event.pull_request.number }}
  cancel-in-progress: true

env:
  CARGO_TERM_COLOR: always

jobs:
  check-linux:
    runs-on: ubuntu-latest
    timeout-minutes: 45
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Validate readme casing
        run: scripts/ci/check-readme-case.sh

      - name: Cache vendored deps
        uses: actions/cache@v4
        with:
          path: |
            .vendor/flow-vendor
            lib/vendor
            lib/vendor-manifest
          key: ${{ runner.os }}-${{ runner.arch }}-vendor-${{ hashFiles('vendor.lock.toml') }}

      - name: Verify pinned vendor commit is published
        run: scripts/vendor/vendor-repo.sh verify-pinned-origin

      - name: Hydrate vendored deps
        run: scripts/vendor/vendor-repo.sh hydrate

      - name: Smoke vendor trims
        run: scripts/vendor/apply-trims.sh

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable

      - name: Cache Rust build
        uses: Swatinem/rust-cache@v2
        with:
          workspaces: ". -> target"
          cache-on-failure: true

      - name: Check flowd
        run: cargo check -p flowd

      - name: Check flowd SIMD feature lane
        run: cargo check -p flowd --features linux-host-simd-json

      - name: Check seq bridge
        run: cargo check -p seq_everruns_bridge

      - name: Compile seq bridge tests
        run: cargo test -p seq_everruns_bridge --no-run

      - name: Build release CLI
        env:
          CARGO_INCREMENTAL: 0
        run: cargo build --release --bin f

      - name: Benchmark release CLI startup
        run: python3 scripts/bench-cli-startup.py --iterations 5 --warmup 1 --flow-bin ./target/release/f --json-out out/bench/cli-startup.json

      - name: Enforce startup latency thresholds
        run: python3 scripts/check_cli_startup_thresholds.py out/bench/cli-startup.json


================================================
FILE: .github/workflows/release.yml
================================================
name: Release

on:
  push:
    tags:
      - "v*"

permissions:
  contents: write

env:
  CARGO_TERM_COLOR: always

jobs:
  build:
    timeout-minutes: 40
    env:
      # Don't reference `secrets.*` in `if:` expressions; GitHub rejects that at workflow-parse time.
      MACOS_SIGN_P12_B64: ${{ secrets.MACOS_SIGN_P12_B64 }}
      MACOS_SIGN_P12_PASSWORD: ${{ secrets.MACOS_SIGN_P12_PASSWORD }}
      MACOS_SIGN_IDENTITY: ${{ secrets.MACOS_SIGN_IDENTITY }}
    strategy:
      matrix:
        include:
          - target: x86_64-apple-darwin
            os: macos-latest
          - target: aarch64-apple-darwin
            os: macos-latest
          - target: x86_64-unknown-linux-gnu
            os: ubuntu-latest
          - target: aarch64-unknown-linux-gnu
            os: ubuntu-latest

    runs-on: ${{ matrix.os }}
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Verify release tag matches Cargo version
        run: python3 scripts/check_release_tag_version.py "${GITHUB_REF_NAME}"

      - name: Validate readme casing
        run: scripts/ci/check-readme-case.sh

      - name: Cache vendored deps
        uses: actions/cache@v4
        with:
          path: |
            .vendor/flow-vendor
            lib/vendor
            lib/vendor-manifest
          key: ${{ runner.os }}-${{ runner.arch }}-vendor-${{ hashFiles('vendor.lock.toml') }}

      - name: Verify pinned vendor commit is published
        run: scripts/vendor/vendor-repo.sh verify-pinned-origin

      - name: Hydrate vendored deps
        run: scripts/vendor/vendor-repo.sh hydrate

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable
        with:
          targets: ${{ matrix.target }}

      - name: Cache Rust build
        uses: Swatinem/rust-cache@v2
        with:
          workspaces: ". -> target"
          cache-on-failure: true

      - name: Install cross-compilation tools (Linux ARM)
        if: matrix.target == 'aarch64-unknown-linux-gnu'
        run: |
          sudo apt-get update
          sudo apt-get install -y gcc-aarch64-linux-gnu

      - name: Build
        run: |
          if [ "${{ matrix.target }}" = "aarch64-unknown-linux-gnu" ]; then
            export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc
          fi
          cargo build --release --target ${{ matrix.target }} --bin f

      - name: Import code-signing certificates (macOS)
        if: runner.os == 'macOS' && env.MACOS_SIGN_P12_B64 != ''
        uses: apple-actions/import-codesign-certs@v3
        with:
          p12-file-base64: ${{ env.MACOS_SIGN_P12_B64 }}
          p12-password: ${{ env.MACOS_SIGN_P12_PASSWORD }}

      - name: Codesign (macOS)
        if: runner.os == 'macOS' && env.MACOS_SIGN_P12_B64 != '' && env.MACOS_SIGN_IDENTITY != ''
        run: |
          BIN="target/${{ matrix.target }}/release/f"
          codesign --force --options runtime --timestamp --sign "$MACOS_SIGN_IDENTITY" "$BIN"
          codesign -vvv --strict "$BIN"

      - name: Package
        run: |
          mkdir -p dist
          cp target/${{ matrix.target }}/release/f dist/
          cd dist
          tar -czvf flow-${{ matrix.target }}.tar.gz f
          cd ..

      - name: Upload artifact
        uses: actions/upload-artifact@v4
        with:
          name: flow-${{ matrix.target }}
          path: dist/flow-${{ matrix.target }}.tar.gz

  build-linux-host-simd:
    timeout-minutes: 40
    runs-on: [self-hosted, linux, x64, ci-1focus]
    env:
      RUSTFLAGS: -C target-cpu=native
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Verify release tag matches Cargo version
        run: python3 scripts/check_release_tag_version.py "${GITHUB_REF_NAME}"

      - name: Validate readme casing
        run: scripts/ci/check-readme-case.sh

      - name: Cache vendored deps
        uses: actions/cache@v4
        with:
          path: |
            .vendor/flow-vendor
            lib/vendor
            lib/vendor-manifest
          key: ${{ runner.os }}-${{ runner.arch }}-vendor-${{ hashFiles('vendor.lock.toml') }}

      - name: Verify pinned vendor commit is published
        run: scripts/vendor/vendor-repo.sh verify-pinned-origin

      - name: Hydrate vendored deps
        run: scripts/vendor/vendor-repo.sh hydrate

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable
        with:
          targets: x86_64-unknown-linux-gnu

      - name: Cache Rust build
        uses: Swatinem/rust-cache@v2
        with:
          workspaces: ". -> target"
          cache-on-failure: true

      - name: Build (Linux host SIMD)
        run: cargo build --release --target x86_64-unknown-linux-gnu --features linux-host-simd-json --bin f

      - name: Package
        run: |
          mkdir -p dist
          cp target/x86_64-unknown-linux-gnu/release/f dist/
          cd dist
          tar -czvf flow-x86_64-unknown-linux-gnu-linux-host-simd.tar.gz f
          cd ..

      - name: Upload artifact
        uses: actions/upload-artifact@v4
        with:
          name: flow-x86_64-unknown-linux-gnu-linux-host-simd
          path: dist/flow-x86_64-unknown-linux-gnu-linux-host-simd.tar.gz

  release:
    needs: [build, build-linux-host-simd]
    timeout-minutes: 20
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Download all artifacts
        uses: actions/download-artifact@v4
        with:
          path: artifacts

      - name: Prepare release files
        run: |
          mkdir -p release
          find artifacts -name "*.tar.gz" -exec cp {} release/ \;
          cd release
          sha256sum *.tar.gz > checksums.txt
          cat checksums.txt

      - name: Create Release
        uses: softprops/action-gh-release@v2
        with:
          files: release/*
          generate_release_notes: true
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


================================================
FILE: .gitignore
================================================
# flow
.cargo/
.ai/internal/
.ai/web/
.ai/reviews/
.ai/test/
.ai/tmp/
.ai/cache/
.ai/artifacts/
.ai/traces/
.ai/generated/
.ai/scratch/
.ai/skills/
# keep generated skills ignored by default, but track curated flow-default skills
!.ai/skills/
.ai/skills/*
!.ai/skills/env/
.ai/skills/env/*
!.ai/skills/env/skill.md
!.ai/skills/quality-bun-feature-delivery/
.ai/skills/quality-bun-feature-delivery/*
!.ai/skills/quality-bun-feature-delivery/skill.md
!.ai/skills/pr-markdown-body-file/
.ai/skills/pr-markdown-body-file/*
!.ai/skills/pr-markdown-body-file/skill.md
.ai/todos/*.bike
.claude/
.codex/
.flox/
.flow/
.flow_diff_review.tmp
.vendor/
lib/vendor/
lib/vendor-history/
!lib/vendor-manifest/
!lib/vendor-manifest/**

# core
.DS_Store
.env
.env*.local
.env.production
output
out/
dist
target
.idea
.cache
.output
node_modules
package-lock.json
yarn.lock
.vercel
env-local/
*.db
.repo_ignore
i.*
i-*
i/
internal/
past.*
past-*
past/
*.log
private
.blade
.npm-cache
/npm/**/vendor/
/npm/flow-*/
/test-data
testing/
desktop/.tauri-dev.json

.ai/review-log.jsonl
.rise/
.ai/state.json
.ai/tasks/**/.mooncakes/
.ai/tasks/**/_build/
bench/moon_ffi_boundary/_build/
bench/moon_ffi_boundary/moon.pkg.json

.beads/

*.pyc

__pycache__/

# explain-commits output is local/generated by default
docs/commits/*
!docs/commits/
!docs/commits/readme.md
!docs/commits/.gitkeep


================================================
FILE: .goreleaser.yaml
================================================
project_name: flow

before:
  hooks:
    - rustup default stable
    - cargo install --locked cargo-zigbuild

builds:
  - id: f
    builder: rust
    binary: f
    tool: cargo
    command: zigbuild
    flags:
      - --release
    targets:
      - aarch64-apple-darwin
      - x86_64-apple-darwin
      - aarch64-unknown-linux-gnu
      - x86_64-unknown-linux-gnu
  - id: lin
    builder: rust
    binary: lin
    tool: cargo
    command: zigbuild
    flags:
      - --release
    targets:
      - aarch64-apple-darwin
      - x86_64-apple-darwin
      - aarch64-unknown-linux-gnu
      - x86_64-unknown-linux-gnu

archives:
  - id: default
    format: tar.gz
    name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
    builds:
      - f
      - lin
    files:
      - LICENSE*
      - README*

checksum:
  name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt"

changelog:
  sort: asc


================================================
FILE: .pi/extensions/test-extensibility.ts
================================================
/**
 * Test Extension - Demonstrates pi-mono extensibility
 *
 * Run with: pi (in ~/code/flow directory)
 * Then ask: "use the counter tool" or "run a bash command"
 */

import type { ExtensionAPI, ExtensionContext } from "@mariozechner/pi-coding-agent"
import { Type } from "@sinclair/typebox"

export default function (pi: ExtensionAPI) {
  console.log("[test-ext] Extension loaded!")

  // ============================================
  // 1. CUSTOM TOOL
  // ============================================
  let count = 0

  pi.registerTool({
    name: "counter",
    label: "Counter",
    description: "A simple counter tool. Actions: get, increment, decrement, reset",
    parameters: Type.Object({
      action: Type.Union([
        Type.Literal("get"),
        Type.Literal("increment"),
        Type.Literal("decrement"),
        Type.Literal("reset"),
      ]),
      amount: Type.Optional(Type.Number({ description: "Amount to add/subtract (default 1)" })),
    }),

    async execute(_toolCallId, params, onUpdate, _ctx, _signal) {
      const amount = params.amount ?? 1

      // Stream progress
      onUpdate?.({ content: [{ type: "text", text: `Processing ${params.action}...` }] })

      switch (params.action) {
        case "increment":
          count += amount
          break
        case "decrement":
          count -= amount
          break
        case "reset":
          count = 0
          break
      }

      return {
        content: [{ type: "text", text: `Counter is now: ${count}` }],
        details: { count, action: params.action },
      }
    },
  })

  // ============================================
  // 2. EVENT HOOKS
  // ============================================

  // Log all tool calls
  pi.on("tool_call", async (event, ctx) => {
    console.log(`[test-ext] Tool called: ${event.toolName}`)

    // Example: warn on dangerous bash commands (but don't block)
    if (event.toolName === "bash") {
      const cmd = event.input.command as string
      if (cmd.includes("rm ")) {
        ctx.ui.notify("Careful with rm commands!", "warn")
      }
    }

    return undefined // Don't block
  })

  // Log turn completions
  pi.on("turn_end", async (event, _ctx) => {
    console.log(`[test-ext] Turn ended. Tokens: ${event.usage?.inputTokens ?? 0} in, ${event.usage?.outputTokens ?? 0} out`)
  })

  // ============================================
  // 3. CUSTOM COMMAND
  // ============================================

  pi.registerCommand("count", {
    description: "Show the current counter value",
    handler: async (_args, ctx) => {
      ctx.ui.notify(`Counter: ${count}`, "info")
    },
  })

  // ============================================
  // 4. SESSION EVENTS
  // ============================================

  pi.on("session_start", async (_event, _ctx) => {
    console.log("[test-ext] Session started")
    count = 0 // Reset on new session
  })
}


================================================
FILE: AGENTS.md.bak
================================================


================================================
FILE: Cargo.toml
================================================
[package]
name = "flowd"
version = "0.1.3"
edition = "2024"
repository = "https://github.com/nikivdev/flow"
autobins = false

[workspace]
members = [
  ".",
  "crates/ai_taskd_client",
  "crates/flow_commit_scan",
  "crates/opentui-lite",
  "crates/seq_client",
  "crates/seq_everruns_bridge",
]
default-members = ["."]
resolver = "2"

[[bin]]
name = "f"
path = "src/main.rs"

[[bin]]
name = "flow"
path = "src/main.rs"

[[bin]]
name = "lin"
path = "src/bin/lin.rs"

[dependencies]
axum = { version = "0.8", default-features = false, features = ["http1", "json", "query", "tokio"] }
tower-http = { version = "0.6", features = ["cors"] }
anyhow = "1"
clap = { version = "4", features = ["derive"] }
futures = "0.3"
ignore = "0.4"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
rmp-serde = "1"
tokio = { version = "1", features = ["full"] }
tokio-stream = { version = "0.1", features = ["sync"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
toml = "1"
ratatui = { version = "0.30", default-features = false, features = ["crossterm"] }
crossterm = "0.29"
reqwest = { version = "0.13", default-features = false, features = ["json", "blocking", "query", "rustls"] }
which = "8"
rusqlite = { version = "0.39", features = ["bundled"] }
notify = "8"
notify-debouncer-mini = "0.7"
shellexpand = "3"
shell-words = "1"
base64 = "0.22"
bs58 = "0.5.1"
sha2 = "0.10"
hex = "0.4"
url = "2"
strip-ansi-escapes = "0.2"
portable-pty = "0.9"
regex = "1.12.2"
chrono = "0.4.42"
dirs = "6.0.0"
uuid = { version = "1", features = ["v4"] }
tempfile = "3"
ctrlc = "3.4"
rpassword = "7"
atty = "0.2"
hmac = "0.12"
sha1 = "0.10"
data-encoding = "2.6"
opentui-lite = { path = "crates/opentui-lite" }
blake3 = "1"
crypto_secretbox = "0.1"
rand = "0.10"
x25519-dalek = { version = "2", features = ["static_secrets"] }
simd-json = { version = "0.17", optional = true }
seq_everruns_bridge = { path = "crates/seq_everruns_bridge" }
flow_commit_scan = { path = "crates/flow_commit_scan" }

[target.'cfg(unix)'.dependencies]
libc = "0.2"

[dev-dependencies]
mockito = "1.7"
tempfile = "3"

[features]
default = []
linux-host-simd-json = ["dep:simd-json"]

[profile.release]
opt-level = 3
lto = "fat"
codegen-units = 1
panic = "abort"
strip = "symbols"
incremental = false
debug = 0

[patch.crates-io]
axum = { path = "lib/vendor/axum" }
reqwest = { path = "lib/vendor/reqwest" }
tower-http = { path = "lib/vendor/tower-http" }
ratatui = { path = "lib/vendor/ratatui" }
url = { path = "lib/vendor/url" }
crypto_secretbox = { path = "lib/vendor/crypto_secretbox" }
portable-pty = { path = "lib/vendor/portable-pty" }
tokio-stream = { path = "lib/vendor/tokio-stream" }
tracing-subscriber = { path = "lib/vendor/tracing-subscriber" }
futures = { path = "lib/vendor/futures" }
sha1 = { path = "lib/vendor/sha1" }
sha2 = { path = "lib/vendor/sha2" }
tokio = { path = "lib/vendor/tokio" }
crossterm = { path = "lib/vendor/crossterm" }
hmac = { path = "lib/vendor/hmac" }
toml = { path = "lib/vendor/toml" }
clap = { path = "lib/vendor/clap" }
notify-debouncer-mini = { path = "lib/vendor/notify-debouncer-mini" }
ignore = { path = "lib/vendor/ignore" }
x25519-dalek = { path = "lib/vendor/x25519-dalek" }
rusqlite = { path = "lib/vendor/rusqlite" }
rmp-serde = { path = "lib/vendor/rmp-serde" }
ctrlc = { path = "lib/vendor/ctrlc" }
notify = { path = "lib/vendor/notify" }
regex = { path = "lib/vendor/regex" }
serde = { path = "lib/vendor/serde" }


================================================
FILE: Support/flow/auth.toml
================================================


================================================
FILE: agents.md
================================================
# Assistant Rules (flow)

Only load skills when the request clearly needs them.

## Skills (on-demand)
- flow-native: Use for Flow CLI native workflows (env setup, secrets, deploys, logs, deps), for repos with `flow.toml`, or Cloudflare Workers. Avoid direct pnpm/wrangler unless asked.
- flow-interactive: Use when commands are interactive or could block on stdin (e.g., `f setup`).
- flow-dev-traces: Use when debugging Flow proxy behavior, tracing requests, or when the user asks about proxyx, trace-summary.json, or flow trace commands.
- flow-usage: Use when running or troubleshooting Flow command behavior.
- internal-ai-inference: Use only when asked to run inference or integrate with internal AI tooling.

Default: Avoid loading skills for routine edits, reviews, or simple questions.


================================================
FILE: bench/ffi_host_boundary/Cargo.toml
================================================
[package]
name = "flow_ffi_host_boundary"
version = "0.1.0"
edition = "2024"

[lib]
crate-type = ["staticlib", "rlib"]

[[bin]]
name = "rust_boundary_bench"
path = "src/bin/rust_boundary_bench.rs"

[dependencies]
libc = "0.2"

[profile.release]
lto = "fat"
codegen-units = 1
panic = "abort"
strip = true


================================================
FILE: bench/ffi_host_boundary/src/bin/rust_boundary_bench.rs
================================================
use std::hint::black_box;

use flow_ffi_host_boundary::{flow_host_add_u64, flow_host_noop, monotonic_now_ns, rust_fn_add, rust_inline_add};

#[derive(Debug)]
struct BenchResult {
    label: &'static str,
    ns_total: u64,
    ns_per_op: f64,
    checksum: u64,
}

fn finish(label: &'static str, iterations: u64, start: u64, acc: u64) -> BenchResult {
    let end = monotonic_now_ns();
    let total = end.saturating_sub(start);
    BenchResult {
        label,
        ns_total: total,
        ns_per_op: total as f64 / iterations as f64,
        checksum: acc,
    }
}

fn bench_inline_add(iterations: u64) -> BenchResult {
    let mut acc = black_box(0_u64);
    let start = monotonic_now_ns();
    for i in 0..iterations {
        acc = black_box(rust_inline_add(black_box(acc), black_box(i)));
    }
    finish("rust_inline_add", iterations, start, acc)
}

fn bench_fn_add(iterations: u64) -> BenchResult {
    let mut acc = black_box(0_u64);
    let start = monotonic_now_ns();
    for i in 0..iterations {
        acc = black_box(rust_fn_add(black_box(acc), black_box(i)));
    }
    finish("rust_fn_add", iterations, start, acc)
}

fn bench_extern_add(iterations: u64) -> BenchResult {
    let mut acc = black_box(0_u64);
    let start = monotonic_now_ns();
    for i in 0..iterations {
        acc = black_box(flow_host_add_u64(black_box(acc), black_box(i)));
    }
    finish("rust_extern_add", iterations, start, acc)
}

fn bench_noop(iterations: u64) -> BenchResult {
    let mut acc = black_box(0_u64);
    let start = monotonic_now_ns();
    for _ in 0..iterations {
        acc = black_box(flow_host_noop(black_box(acc)));
    }
    finish("rust_extern_noop", iterations, start, acc)
}

fn parse_iters() -> u64 {
    let mut args = std::env::args().skip(1);
    while let Some(arg) = args.next() {
        if arg == "--iters" {
            if let Some(value) = args.next() {
                if let Ok(parsed) = value.parse::<u64>() {
                    if parsed > 0 {
                        return parsed;
                    }
                }
            }
        }
    }
    10_000_000
}

fn print_result(result: &BenchResult) {
    println!(
        "{} ns_total={} ns_per_op={:.4} checksum={}",
        result.label, result.ns_total, result.ns_per_op, result.checksum
    );
}

fn main() {
    let iterations = parse_iters();
    println!("rust_boundary_bench iterations={}", iterations);

    let inline = bench_inline_add(iterations);
    let fn_call = bench_fn_add(iterations);
    let extern_call = bench_extern_add(iterations);
    let noop = bench_noop(iterations);

    print_result(&inline);
    print_result(&fn_call);
    print_result(&extern_call);
    print_result(&noop);
}


================================================
FILE: bench/ffi_host_boundary/src/lib.rs
================================================
use std::hint::black_box;

#[unsafe(no_mangle)]
#[inline(never)]
pub extern "C" fn flow_host_now_ns() -> u64 {
    monotonic_now_ns()
}

#[unsafe(no_mangle)]
#[inline(never)]
pub extern "C" fn flow_host_noop(x: u64) -> u64 {
    x.wrapping_add(1)
}

#[unsafe(no_mangle)]
#[inline(never)]
pub extern "C" fn flow_host_add_u64(a: u64, b: u64) -> u64 {
    a.wrapping_add(b)
}

#[unsafe(no_mangle)]
pub extern "C" fn flow_host_bench_iterations() -> u64 {
    std::env::var("FLOW_FFI_ITERS")
        .ok()
        .and_then(|v| v.parse::<u64>().ok())
        .filter(|v| *v > 0)
        .unwrap_or(10_000_000)
}

#[inline(always)]
pub fn rust_inline_add(a: u64, b: u64) -> u64 {
    a.wrapping_add(b)
}

#[inline(never)]
pub fn rust_fn_add(a: u64, b: u64) -> u64 {
    a.wrapping_add(b)
}

pub fn monotonic_now_ns() -> u64 {
    unsafe {
        let mut ts: libc::timespec = std::mem::zeroed();
        if libc::clock_gettime(libc::CLOCK_MONOTONIC, &mut ts) != 0 {
            return 0;
        }
        (ts.tv_sec as u64)
            .saturating_mul(1_000_000_000)
            .saturating_add(ts.tv_nsec as u64)
    }
}


================================================
FILE: bench/moon_ffi_boundary/main.mbt
================================================
extern "C" fn flow_host_now_ns() -> UInt64 = "flow_host_now_ns"
extern "C" fn flow_host_noop(x : UInt64) -> UInt64 = "flow_host_noop"
extern "C" fn flow_host_add_u64(a : UInt64, b : UInt64) -> UInt64 = "flow_host_add_u64"
extern "C" fn flow_host_bench_iterations() -> UInt64 = "flow_host_bench_iterations"

fn bench_ffi_add(iterations : Int) -> (UInt64, UInt64) {
  let mut acc : UInt64 = 0UL
  let start = flow_host_now_ns()
  for i = 0; i < iterations; i = i + 1 {
    acc = flow_host_add_u64(acc, i.to_uint64())
  }
  let elapsed = flow_host_now_ns() - start
  (elapsed, acc)
}

fn bench_ffi_noop(iterations : Int) -> (UInt64, UInt64) {
  let mut acc : UInt64 = 0UL
  let start = flow_host_now_ns()
  for _i = 0; _i < iterations; _i = _i + 1 {
    acc = flow_host_noop(acc)
  }
  let elapsed = flow_host_now_ns() - start
  (elapsed, acc)
}

fn bench_moon_add(iterations : Int) -> (UInt64, UInt64) {
  let mut acc : UInt64 = 0UL
  let start = flow_host_now_ns()
  for i = 0; i < iterations; i = i + 1 {
    acc = acc + i.to_uint64()
  }
  let elapsed = flow_host_now_ns() - start
  (elapsed, acc)
}

fn parse_iterations() -> Int {
  flow_host_bench_iterations().to_int()
}

fn print_result(
  label : String,
  total_ns : UInt64,
  checksum : UInt64,
  iterations : Int,
) -> Unit {
  let per_op = total_ns / iterations.to_uint64()
  println(
    label +
    " ns_total=" + total_ns.to_string() +
    " ns_per_op=" + per_op.to_string() +
    " checksum=" + checksum.to_string(),
  )
}

fn main {
  let iterations = parse_iterations()
  println("moon_ffi_boundary iterations=" + iterations.to_string())

  let (moon_add_ns, moon_add_sum) = bench_moon_add(iterations)
  let (ffi_add_ns, ffi_add_sum) = bench_ffi_add(iterations)
  let (ffi_noop_ns, ffi_noop_sum) = bench_ffi_noop(iterations)

  print_result("moon_add", moon_add_ns, moon_add_sum, iterations)
  print_result("moon_ffi_add", ffi_add_ns, ffi_add_sum, iterations)
  print_result("moon_ffi_noop", ffi_noop_ns, ffi_noop_sum, iterations)
}


================================================
FILE: bench/moon_ffi_boundary/moon.mod.json
================================================
{
  "name": "nikiv/moon_ffi_boundary",
  "version": "0.1.0"
}


================================================
FILE: bench/moon_ffi_boundary/moon.pkg.template.json
================================================
{
  "is-main": true,
  "support-targets": ["native"],
  "link": {
    "native": {
      "cc-flags": "__CC_FLAGS__",
      "cc-link-flags": "__CC_LINK_FLAGS__"
    }
  }
}


================================================
FILE: build.rs
================================================
use std::env;
use std::fs;
use std::path::Path;
use std::time::{SystemTime, UNIX_EPOCH};

fn main() {
    // Embed build timestamp as seconds since Unix epoch
    let timestamp = SystemTime::now()
        .duration_since(UNIX_EPOCH)
        .unwrap()
        .as_secs();

    // Write timestamp to a file in OUT_DIR so cargo detects the change
    let out_dir = env::var("OUT_DIR").unwrap();
    let dest_path = Path::new(&out_dir).join("build_timestamp.txt");
    fs::write(&dest_path, timestamp.to_string()).unwrap();

    println!("cargo:rustc-env=BUILD_TIMESTAMP={}", timestamp);

    // Always rerun build script (no rerun-if-changed means always run)
}


================================================
FILE: crates/ai_taskd_client/Cargo.toml
================================================
[package]
name = "ai-taskd-client"
version = "0.1.0"
edition = "2024"

[dependencies]
serde = { version = "1", features = ["derive"] }
serde_json = "1"
rmp-serde = "1"
shell-words = "1"
dirs = "6.0.0"


================================================
FILE: crates/ai_taskd_client/src/main.rs
================================================
include!("../../../src/bin/ai_taskd_client.rs");


================================================
FILE: crates/flow_commit_scan/Cargo.toml
================================================
[package]
name = "flow_commit_scan"
version = "0.1.0"
edition = "2024"

[dependencies]
regex = "1.12.2"


================================================
FILE: crates/flow_commit_scan/src/lib.rs
================================================
use std::path::Path;
use std::process::Command;
use std::sync::OnceLock;

use regex::Regex;

pub type SecretFinding = (String, usize, String, String);

/// Common secret patterns to detect in diff content.
/// Each tuple is (pattern_name, regex_pattern).
const SECRET_PATTERNS: &[(&str, &str)] = &[
    // API Keys with known prefixes
    ("AWS Access Key", r"AKIA[0-9A-Z]{16}"),
    (
        "AWS Secret Key",
        r#"(?i)aws.{0,20}secret.{0,20}['"][0-9a-zA-Z/+]{40}['"]"#,
    ),
    ("GitHub Token", r"ghp_[0-9a-zA-Z]{36}"),
    ("GitHub OAuth", r"gho_[0-9a-zA-Z]{36}"),
    ("GitHub App Token", r"ghu_[0-9a-zA-Z]{36}"),
    ("GitHub Refresh Token", r"ghr_[0-9a-zA-Z]{36}"),
    ("GitLab Token", r"glpat-[0-9a-zA-Z\\-_]{20,}"),
    ("Slack Token", r"xox[baprs]-[0-9a-zA-Z]{10,48}"),
    (
        "Slack Webhook",
        r"https://hooks\.slack\.com/services/T[0-9A-Z]{8,}/B[0-9A-Z]{8,}/[0-9a-zA-Z]{24}",
    ),
    (
        "Discord Webhook",
        r"https://discord(?:app)?\.com/api/webhooks/[0-9]{17,}/[0-9a-zA-Z_-]{60,}",
    ),
    ("Stripe Key", r"sk_live_[0-9a-zA-Z]{24,}"),
    ("Stripe Restricted", r"rk_live_[0-9a-zA-Z]{24,}"),
    // OpenAI keys - multiple formats (legacy, project, service account)
    ("OpenAI Key (Legacy)", r"sk-[a-zA-Z0-9]{32,}"),
    ("OpenAI Key (Project)", r"sk-proj-[a-zA-Z0-9\\-_]{20,}"),
    ("OpenAI Key (Service)", r"sk-svcacct-[a-zA-Z0-9\\-_]{20,}"),
    ("Anthropic Key", r"sk-ant-[0-9a-zA-Z\\-_]{90,}"),
    ("Google API Key", r"AIza[0-9A-Za-z\\-_]{35}"),
    ("Groq API Key", r"gsk_[0-9a-zA-Z]{50,}"),
    (
        "Mistral API Key",
        r#"(?i)mistral.{0,10}(api[_-]?key|key).{0,5}[=:].{0,5}["'][0-9a-zA-Z]{32,}["']"#,
    ),
    (
        "Cohere API Key",
        r#"(?i)cohere.{0,10}(api[_-]?key|key).{0,5}[=:].{0,5}["'][0-9a-zA-Z]{40,}["']"#,
    ),
    (
        "Heroku API Key",
        r"(?i)heroku.{0,20}[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",
    ),
    ("NPM Token", r"npm_[0-9a-zA-Z]{36}"),
    ("PyPI Token", r"pypi-[0-9a-zA-Z_-]{50,}"),
    ("Telegram Bot Token", r"[0-9]{8,10}:[0-9A-Za-z_-]{35}"),
    ("Twilio Key", r"SK[0-9a-fA-F]{32}"),
    ("SendGrid Key", r"SG\.[0-9a-zA-Z_-]{22}\.[0-9a-zA-Z_-]{43}"),
    ("Mailgun Key", r"key-[0-9a-zA-Z]{32}"),
    (
        "Private Key",
        r"-----BEGIN (RSA |EC |DSA |OPENSSH )?PRIVATE KEY-----",
    ),
    (
        "Supabase Key",
        r"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9\.[0-9a-zA-Z_-]{50,}",
    ),
    (
        "Firebase Key",
        r#"(?i)firebase.{0,20}["'][A-Za-z0-9_-]{30,}["']"#,
    ),
    // Generic patterns (higher false positive risk, but catch common mistakes)
    (
        "Generic API Key Assignment",
        r#"(?i)(api[_-]?key|apikey)\s*[:=]\s*['"][0-9a-zA-Z\-_]{20,}['"]"#,
    ),
    (
        "Generic Secret Assignment",
        r#"(?i)(secret|password|passwd|pwd)\s*[:=]\s*['"][^'"]{8,}['"]"#,
    ),
    ("Bearer Token", r"(?i)bearer\s+[0-9a-zA-Z\-_.]{20,}"),
    ("Basic Auth", r"(?i)basic\s+[A-Za-z0-9+/=]{20,}"),
    // High-entropy strings that look like secrets (env var assignments)
    (
        "Env Var Secret",
        r#"(?i)(KEY|TOKEN|SECRET|PASSWORD|CREDENTIAL|AUTH)[_A-Z]*\s*=\s*['"]?[0-9a-zA-Z\-_/+=]{32,}['"]?"#,
    ),
];

fn compiled_secret_patterns() -> &'static Vec<(&'static str, Regex)> {
    static COMPILED: OnceLock<Vec<(&'static str, Regex)>> = OnceLock::new();
    COMPILED.get_or_init(|| {
        SECRET_PATTERNS
            .iter()
            .filter_map(|(name, pattern)| Regex::new(pattern).ok().map(|re| (*name, re)))
            .collect()
    })
}

const SECRET_SCAN_IGNORE_MARKERS: &[&str] = &[
    "flow:secret:ignore",
    "flow-secret-ignore",
    "flow:secret-scan:ignore",
    "gitleaks:allow",
];

fn should_ignore_secret_scan_line(content: &str) -> bool {
    let lower = content.to_lowercase();
    SECRET_SCAN_IGNORE_MARKERS
        .iter()
        .any(|m| lower.contains(&m.to_lowercase()))
}

fn extract_first_quoted_value(s: &str) -> Option<&str> {
    let (qpos, qch) = s.char_indices().find(|(_, c)| *c == '"' || *c == '\'')?;
    let end = s.rfind(qch)?;
    if end <= qpos {
        return None;
    }
    Some(&s[qpos + 1..end])
}

fn looks_like_identifier_reference(value: &str) -> bool {
    let v = value.trim();
    !v.is_empty()
        && v.len() >= 8
        && v.contains('_')
        && v.chars()
            .all(|c| c.is_ascii_uppercase() || c.is_ascii_digit() || c == '_' || c == '.')
}

fn looks_like_secret_lookup(value: &str) -> bool {
    let v = value.trim();

    if v.starts_with("${") && v.ends_with('}') {
        let inner = &v[2..v.len() - 1];
        return !inner.contains(":-")
            && !inner.contains("-")
            && inner
                .chars()
                .all(|c| c.is_ascii_uppercase() || c.is_ascii_digit() || c == '_');
    }

    if !(v.starts_with("$(") && v.ends_with(')')) {
        return false;
    }
    let inner = v[2..v.len() - 1].trim();
    if inner.contains('"') || inner.contains('\'') || inner.contains('`') {
        return false;
    }
    let inner_lc = inner.to_lowercase();
    inner_lc.starts_with("get_env ")
        || inner_lc.starts_with("getenv ")
        || inner_lc.starts_with("printenv ")
        || inner_lc.starts_with("op read ")
        || inner_lc.starts_with("pass show ")
        || inner_lc.starts_with("security find-generic-password")
        || inner_lc.starts_with("aws ssm get-parameter")
        || inner_lc.starts_with("vault kv get")
        || inner_lc.starts_with("bw get")
        || inner_lc.starts_with("gcloud secrets versions access")
}

fn generic_secret_assignment_is_false_positive(content: &str, matched: &str) -> bool {
    if let Some((_, rhs)) = matched.split_once('=') {
        let rhs = rhs.trim_start();
        if rhs.starts_with("\"$(") || rhs.starts_with("'$(") || rhs.starts_with("`") {
            return true;
        }
        if rhs.starts_with("\"$") || rhs.starts_with("'$") {
            return true;
        }
    } else if let Some((_, rhs)) = matched.split_once(':') {
        let rhs = rhs.trim_start();
        if rhs.starts_with("\"$(") || rhs.starts_with("'$(") || rhs.starts_with("`") {
            return true;
        }
        if rhs.starts_with("\"$") || rhs.starts_with("'$") {
            return true;
        }
    }

    if let Some(val) = extract_first_quoted_value(matched) {
        let v = val.trim();
        if looks_like_identifier_reference(v) {
            return true;
        }
        if looks_like_secret_lookup(v) {
            return true;
        }
    }

    let lc = content.to_lowercase();
    lc.contains("$(get_env ")
}

/// Scan staged diff content for hardcoded secrets.
/// Returns list of (file, line_num, pattern_name, matched_text) for detected secrets.
pub fn scan_diff_for_secrets(repo_root: &Path) -> Vec<SecretFinding> {
    let output = Command::new("git")
        .args(["diff", "--cached", "-U0"])
        .current_dir(repo_root)
        .output();

    let Ok(output) = output else {
        return Vec::new();
    };

    if !output.status.success() {
        return Vec::new();
    }

    let diff = String::from_utf8_lossy(&output.stdout);
    let mut findings: Vec<SecretFinding> = Vec::new();
    let mut current_file = String::new();
    let mut current_line: usize = 0;
    let mut ignore_next_added_line = false;

    let patterns = compiled_secret_patterns();

    for line in diff.lines() {
        if line.starts_with("+++ b/") {
            current_file = line.strip_prefix("+++ b/").unwrap_or("").to_string();
            ignore_next_added_line = false;
            continue;
        }

        if line.starts_with("@@") {
            if let Some(plus_pos) = line.find('+') {
                let after_plus = &line[plus_pos + 1..];
                let num_str: String = after_plus
                    .chars()
                    .take_while(|c| c.is_ascii_digit())
                    .collect();
                current_line = num_str.parse().unwrap_or(0);
            }
            ignore_next_added_line = false;
            continue;
        }

        if line.starts_with('+') && !line.starts_with("+++") {
            let content = &line[1..];

            if ignore_next_added_line {
                ignore_next_added_line = false;
                current_line += 1;
                continue;
            }
            let trimmed = content.trim_start();
            if trimmed.starts_with('#') && should_ignore_secret_scan_line(trimmed) {
                ignore_next_added_line = true;
                current_line += 1;
                continue;
            }
            if should_ignore_secret_scan_line(content) {
                current_line += 1;
                continue;
            }
            if content.to_lowercase().contains("flow:secret:ignore-next") {
                ignore_next_added_line = true;
                current_line += 1;
                continue;
            }

            for (name, re) in patterns {
                if let Some(m) = re.find(content) {
                    let matched = m.as_str();
                    let matched_lower = matched.to_lowercase();

                    if matched_lower.contains("xxx")
                        || matched_lower.contains("your")
                        || matched_lower.contains("example")
                        || matched_lower.contains("placeholder")
                        || matched_lower.contains("replace")
                        || matched_lower.contains("insert")
                        || matched_lower.contains("todo")
                        || matched_lower.contains("fixme")
                        || matched == "sk-..."
                        || matched == "sk-xxxx"
                        || matched
                            .chars()
                            .all(|c| c == 'x' || c == 'X' || c == '.' || c == '-' || c == '_')
                    {
                        continue;
                    }

                    if *name == "Generic Secret Assignment"
                        && generic_secret_assignment_is_false_positive(content, matched)
                    {
                        continue;
                    }

                    let redacted = if matched.len() > 12 {
                        format!("{}...{}", &matched[..6], &matched[matched.len() - 4..])
                    } else {
                        matched.to_string()
                    };
                    findings.push((
                        current_file.clone(),
                        current_line,
                        name.to_string(),
                        redacted,
                    ));
                    break;
                }
            }
            current_line += 1;
        } else if !line.starts_with('-') && !line.starts_with('\\') {
            current_line += 1;
            ignore_next_added_line = false;
        }
    }

    findings
}


================================================
FILE: crates/opentui-lite/Cargo.toml
================================================
[package]
name = "opentui-lite"
version = "0.1.0"
edition = "2024"

[lib]
path = "src/lib.rs"

[dependencies]
libc = { version = "0.2", default-features = false }


================================================
FILE: crates/opentui-lite/src/lib.rs
================================================
use std::ffi::{CStr, CString};
use std::fmt;
use std::path::{Path, PathBuf};
use std::sync::Arc;

#[derive(Debug)]
pub struct Error {
    message: String,
}

impl Error {
    fn new(message: impl Into<String>) -> Self {
        Self {
            message: message.into(),
        }
    }
}

impl fmt::Display for Error {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, "{}", self.message)
    }
}

impl std::error::Error for Error {}

pub type Result<T> = std::result::Result<T, Error>;

#[repr(C)]
#[derive(Clone, Copy, Debug, Default)]
pub struct Color {
    pub r: f32,
    pub g: f32,
    pub b: f32,
    pub a: f32,
}

impl Color {
    pub const fn rgba(r: f32, g: f32, b: f32, a: f32) -> Self {
        Self { r, g, b, a }
    }

    pub const fn rgb(r: f32, g: f32, b: f32) -> Self {
        Self { r, g, b, a: 1.0 }
    }
}

pub const ATTR_NONE: u32 = 0;
pub const ATTR_BOLD: u32 = 1 << 0;
pub const ATTR_DIM: u32 = 1 << 1;
pub const ATTR_ITALIC: u32 = 1 << 2;
pub const ATTR_UNDERLINE: u32 = 1 << 3;
pub const ATTR_BLINK: u32 = 1 << 4;
pub const ATTR_INVERSE: u32 = 1 << 5;
pub const ATTR_HIDDEN: u32 = 1 << 6;
pub const ATTR_STRIKETHROUGH: u32 = 1 << 7;

pub const BORDER_SIMPLE: [u32; 11] = [
    '+' as u32, '+' as u32, '+' as u32, '+' as u32, '-' as u32, '|' as u32, '+' as u32, '+' as u32,
    '+' as u32, '+' as u32, '+' as u32,
];

type RendererPtr = *mut std::ffi::c_void;
type BufferPtr = *mut std::ffi::c_void;

type FnCreateRenderer = unsafe extern "C" fn(u32, u32, bool) -> RendererPtr;
type FnDestroyRenderer = unsafe extern "C" fn(RendererPtr);
type FnSetupTerminal = unsafe extern "C" fn(RendererPtr, bool);
type FnSuspendRenderer = unsafe extern "C" fn(RendererPtr);
type FnRender = unsafe extern "C" fn(RendererPtr, bool);
type FnClearTerminal = unsafe extern "C" fn(RendererPtr);
type FnResizeRenderer = unsafe extern "C" fn(RendererPtr, u32, u32);
type FnGetNextBuffer = unsafe extern "C" fn(RendererPtr) -> BufferPtr;
type FnGetCurrentBuffer = unsafe extern "C" fn(RendererPtr) -> BufferPtr;
type FnBufferClear = unsafe extern "C" fn(BufferPtr, *const f32);
type FnBufferDrawText =
    unsafe extern "C" fn(BufferPtr, *const u8, usize, u32, u32, *const f32, *const f32, u32);
type FnBufferFillRect = unsafe extern "C" fn(BufferPtr, u32, u32, u32, u32, *const f32);
type FnBufferDrawBox = unsafe extern "C" fn(
    BufferPtr,
    i32,
    i32,
    u32,
    u32,
    *const u32,
    u32,
    *const f32,
    *const f32,
    *const u8,
    u32,
);

#[derive(Clone)]
pub struct OpenTui {
    inner: Arc<Inner>,
}

struct Inner {
    lib: *mut std::ffi::c_void,
    fns: Fns,
    path: String,
}

struct Fns {
    create_renderer: FnCreateRenderer,
    destroy_renderer: FnDestroyRenderer,
    setup_terminal: FnSetupTerminal,
    suspend_renderer: FnSuspendRenderer,
    render: FnRender,
    clear_terminal: FnClearTerminal,
    resize_renderer: FnResizeRenderer,
    get_next_buffer: FnGetNextBuffer,
    get_current_buffer: FnGetCurrentBuffer,
    buffer_clear: FnBufferClear,
    buffer_draw_text: FnBufferDrawText,
    buffer_fill_rect: FnBufferFillRect,
    buffer_draw_box: FnBufferDrawBox,
}

impl Drop for Inner {
    fn drop(&mut self) {
        unsafe {
            if !self.lib.is_null() {
                let _ = dlclose(self.lib);
            }
        }
    }
}

impl OpenTui {
    pub fn load() -> Result<Self> {
        let (lib, path) = load_library()?;
        let fns = unsafe {
            Fns {
                create_renderer: load_symbol(lib, "createRenderer")?,
                destroy_renderer: load_symbol(lib, "destroyRenderer")?,
                setup_terminal: load_symbol(lib, "setupTerminal")?,
                suspend_renderer: load_symbol(lib, "suspendRenderer")?,
                render: load_symbol(lib, "render")?,
                clear_terminal: load_symbol(lib, "clearTerminal")?,
                resize_renderer: load_symbol(lib, "resizeRenderer")?,
                get_next_buffer: load_symbol(lib, "getNextBuffer")?,
                get_current_buffer: load_symbol(lib, "getCurrentBuffer")?,
                buffer_clear: load_symbol(lib, "bufferClear")?,
                buffer_draw_text: load_symbol(lib, "bufferDrawText")?,
                buffer_fill_rect: load_symbol(lib, "bufferFillRect")?,
                buffer_draw_box: load_symbol(lib, "bufferDrawBox")?,
            }
        };
        Ok(Self {
            inner: Arc::new(Inner { lib, fns, path }),
        })
    }

    pub fn path(&self) -> &str {
        &self.inner.path
    }

    pub fn create_renderer(&self, width: u32, height: u32, testing: bool) -> Result<Renderer> {
        let ptr = unsafe { (self.inner.fns.create_renderer)(width, height, testing) };
        if ptr.is_null() {
            return Err(Error::new("opentui: createRenderer returned null"));
        }
        Ok(Renderer {
            inner: self.inner.clone(),
            ptr,
        })
    }
}

pub struct Renderer {
    inner: Arc<Inner>,
    ptr: RendererPtr,
}

impl Renderer {
    pub fn setup_terminal(&self, use_alternate_screen: bool) {
        unsafe { (self.inner.fns.setup_terminal)(self.ptr, use_alternate_screen) };
    }

    pub fn suspend(&self) {
        unsafe { (self.inner.fns.suspend_renderer)(self.ptr) };
    }

    pub fn clear_terminal(&self) {
        unsafe { (self.inner.fns.clear_terminal)(self.ptr) };
    }

    pub fn resize(&self, width: u32, height: u32) {
        unsafe { (self.inner.fns.resize_renderer)(self.ptr, width, height) };
    }

    pub fn render(&self, force: bool) {
        unsafe { (self.inner.fns.render)(self.ptr, force) };
    }

    pub fn next_buffer(&self) -> Buffer {
        let ptr = unsafe { (self.inner.fns.get_next_buffer)(self.ptr) };
        Buffer {
            inner: self.inner.clone(),
            ptr,
        }
    }

    pub fn current_buffer(&self) -> Buffer {
        let ptr = unsafe { (self.inner.fns.get_current_buffer)(self.ptr) };
        Buffer {
            inner: self.inner.clone(),
            ptr,
        }
    }
}

impl Drop for Renderer {
    fn drop(&mut self) {
        unsafe {
            (self.inner.fns.destroy_renderer)(self.ptr);
        }
    }
}

pub struct Buffer {
    inner: Arc<Inner>,
    ptr: BufferPtr,
}

impl Buffer {
    pub fn clear(&self, bg: Color) {
        unsafe { (self.inner.fns.buffer_clear)(self.ptr, &bg as *const Color as *const f32) };
    }

    pub fn fill_rect(&self, x: u32, y: u32, width: u32, height: u32, bg: Color) {
        unsafe {
            (self.inner.fns.buffer_fill_rect)(
                self.ptr,
                x,
                y,
                width,
                height,
                &bg as *const Color as *const f32,
            )
        };
    }

    pub fn draw_text(&self, text: &str, x: u32, y: u32, fg: Color, bg: Option<Color>, attr: u32) {
        let bg_ptr = match bg {
            Some(color) => &color as *const Color as *const f32,
            None => std::ptr::null(),
        };
        unsafe {
            (self.inner.fns.buffer_draw_text)(
                self.ptr,
                text.as_ptr(),
                text.len(),
                x,
                y,
                &fg as *const Color as *const f32,
                bg_ptr,
                attr,
            )
        };
    }

    pub fn draw_box(
        &self,
        x: i32,
        y: i32,
        width: u32,
        height: u32,
        border_chars: &[u32; 11],
        packed_options: u32,
        border: Color,
        background: Color,
        title: Option<&str>,
    ) {
        let (title_ptr, title_len) = match title {
            Some(value) => (value.as_ptr(), value.len() as u32),
            None => (std::ptr::null(), 0),
        };
        unsafe {
            (self.inner.fns.buffer_draw_box)(
                self.ptr,
                x,
                y,
                width,
                height,
                border_chars.as_ptr(),
                packed_options,
                &border as *const Color as *const f32,
                &background as *const Color as *const f32,
                title_ptr,
                title_len,
            )
        };
    }
}

fn load_library() -> Result<(*mut std::ffi::c_void, String)> {
    let mut errors = Vec::new();
    for path in candidate_paths() {
        match try_dlopen(&path) {
            Ok(lib) => return Ok((lib, path.display().to_string())),
            Err(err) => errors.push(format!("{}: {}", path.display(), err)),
        }
    }
    let mut message = String::from("opentui: failed to load native library");
    if !errors.is_empty() {
        message.push_str(" (tried: ");
        message.push_str(&errors.join(", "));
        message.push(')');
    }
    Err(Error::new(message))
}

fn candidate_paths() -> Vec<PathBuf> {
    let mut paths = Vec::new();
    let lib_name = lib_filename();

    if let Ok(path) = std::env::var("OPENTUI_LIB_PATH") {
        paths.push(PathBuf::from(path));
    }

    if let Ok(dir) = std::env::var("OPENTUI_LIB_DIR") {
        paths.push(PathBuf::from(dir).join(lib_name));
    }

    if let Ok(prefix) = std::env::var("OPENTUI_PREFIX") {
        paths.push(PathBuf::from(prefix).join("lib").join(lib_name));
    }

    if let Ok(home) = std::env::var("HOME") {
        let home_path = PathBuf::from(&home);
        if let Some(target_dir) = zig_target_dir() {
            paths.push(
                home_path
                    .join("repos/anomalyco/opentui/packages/core/src/zig/lib")
                    .join(target_dir)
                    .join(lib_name),
            );
        }
        paths.push(home_path.join(".local/lib").join(lib_name));
    }

    paths.push(PathBuf::from(lib_name));
    paths
}

fn zig_target_dir() -> Option<&'static str> {
    match (std::env::consts::ARCH, std::env::consts::OS) {
        ("aarch64", "macos") => Some("aarch64-macos"),
        ("x86_64", "macos") => Some("x86_64-macos"),
        ("aarch64", "linux") => Some("aarch64-linux"),
        ("x86_64", "linux") => Some("x86_64-linux"),
        _ => None,
    }
}

fn lib_filename() -> &'static str {
    if cfg!(target_os = "macos") {
        "libopentui.dylib"
    } else if cfg!(target_os = "linux") {
        "libopentui.so"
    } else {
        "libopentui"
    }
}

fn try_dlopen(path: &Path) -> Result<*mut std::ffi::c_void> {
    let cpath = path_to_cstring(path)?;
    unsafe {
        let handle = dlopen(cpath.as_ptr(), libc::RTLD_NOW);
        if handle.is_null() {
            return Err(Error::new(dl_error_string()));
        }
        Ok(handle)
    }
}

fn path_to_cstring(path: &Path) -> Result<CString> {
    #[cfg(unix)]
    {
        use std::os::unix::ffi::OsStrExt;
        CString::new(path.as_os_str().as_bytes())
            .map_err(|_| Error::new("opentui: invalid library path"))
    }
    #[cfg(not(unix))]
    {
        Err(Error::new("opentui: unsupported platform"))
    }
}

unsafe fn load_symbol<T>(lib: *mut std::ffi::c_void, symbol: &str) -> Result<T> {
    let name = CString::new(symbol).map_err(|_| Error::new("opentui: invalid symbol"))?;
    let ptr = unsafe { dlsym(lib, name.as_ptr()) };
    if ptr.is_null() {
        return Err(Error::new(format!("opentui: missing symbol {symbol}")));
    }
    Ok(unsafe { std::mem::transmute_copy(&ptr) })
}

fn dl_error_string() -> String {
    unsafe {
        let err = dlerror();
        if err.is_null() {
            return "unknown dlopen error".to_string();
        }
        CStr::from_ptr(err).to_string_lossy().to_string()
    }
}

unsafe extern "C" {
    fn dlopen(path: *const libc::c_char, mode: libc::c_int) -> *mut std::ffi::c_void;
    fn dlsym(handle: *mut std::ffi::c_void, symbol: *const libc::c_char) -> *mut std::ffi::c_void;
    fn dlclose(handle: *mut std::ffi::c_void) -> libc::c_int;
    fn dlerror() -> *const libc::c_char;
}


================================================
FILE: crates/seq_client/Cargo.toml
================================================
[package]
name = "seq_client"
version = "0.1.0"
edition = "2021"
description = "Rust client for seqd Agent RPC v1 over Unix sockets"
license = "MIT"

[dependencies]
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
thiserror = "2.0"



================================================
FILE: crates/seq_client/src/lib.rs
================================================
use serde::{Deserialize, Serialize};
use serde_json::{json, Value};
use std::io::{Read, Write};
use std::os::unix::net::UnixStream;
use std::path::{Path, PathBuf};
use std::sync::Mutex;
use std::time::Duration;
use thiserror::Error;

const DEFAULT_SOCKET_PATH: &str = "/tmp/seqd.sock";
const MAX_RESPONSE_BYTES: usize = 1024 * 1024;

#[derive(Debug, Error)]
pub enum SeqClientError {
    #[error("io error: {0}")]
    Io(#[from] std::io::Error),
    #[error("json error: {0}")]
    Json(#[from] serde_json::Error),
    #[error("invalid protocol: {0}")]
    Protocol(String),
    #[error("remote error: {0}")]
    Remote(String),
}

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct RpcRequest {
    pub op: String,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub request_id: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub run_id: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub tool_call_id: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub args: Option<Value>,
}

impl RpcRequest {
    pub fn new(op: impl Into<String>) -> Self {
        Self {
            op: op.into(),
            ..Self::default()
        }
    }

    pub fn with_request_id(mut self, request_id: impl Into<String>) -> Self {
        self.request_id = Some(request_id.into());
        self
    }

    pub fn with_run_id(mut self, run_id: impl Into<String>) -> Self {
        self.run_id = Some(run_id.into());
        self
    }

    pub fn with_tool_call_id(mut self, tool_call_id: impl Into<String>) -> Self {
        self.tool_call_id = Some(tool_call_id.into());
        self
    }

    pub fn with_args_json(mut self, args: Value) -> Self {
        self.args = Some(args);
        self
    }

    pub fn with_args<T: Serialize>(mut self, args: &T) -> Result<Self, SeqClientError> {
        self.args = Some(serde_json::to_value(args)?);
        Ok(self)
    }
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RpcResponse {
    pub ok: bool,
    pub op: String,
    #[serde(default)]
    pub request_id: String,
    #[serde(default)]
    pub run_id: String,
    #[serde(default)]
    pub tool_call_id: String,
    pub ts_ms: u64,
    pub dur_us: u64,
    #[serde(default)]
    pub result: Option<Value>,
    #[serde(default)]
    pub error: Option<String>,
}

#[derive(Debug)]
pub struct SeqClient {
    socket_path: PathBuf,
    stream: Mutex<UnixStream>,
}

impl SeqClient {
    pub fn connect_default() -> Result<Self, SeqClientError> {
        Self::connect(DEFAULT_SOCKET_PATH)
    }

    pub fn connect(path: impl AsRef<Path>) -> Result<Self, SeqClientError> {
        let stream = UnixStream::connect(path.as_ref())?;
        Ok(Self {
            socket_path: path.as_ref().to_path_buf(),
            stream: Mutex::new(stream),
        })
    }

    pub fn connect_with_timeout(
        path: impl AsRef<Path>,
        timeout: Duration,
    ) -> Result<Self, SeqClientError> {
        let stream = UnixStream::connect(path.as_ref())?;
        stream.set_read_timeout(Some(timeout))?;
        stream.set_write_timeout(Some(timeout))?;
        Ok(Self {
            socket_path: path.as_ref().to_path_buf(),
            stream: Mutex::new(stream),
        })
    }

    pub fn socket_path(&self) -> &Path {
        &self.socket_path
    }

    pub fn call(&self, request: RpcRequest) -> Result<RpcResponse, SeqClientError> {
        let mut stream = self
            .stream
            .lock()
            .map_err(|_| SeqClientError::Protocol("socket mutex poisoned".into()))?;
        write_request(&mut stream, &request)?;
        let line = read_response_line(&mut stream)?;
        let response: RpcResponse = serde_json::from_slice(&line)?;
        Ok(response)
    }

    pub fn call_ok(&self, request: RpcRequest) -> Result<Value, SeqClientError> {
        let response = self.call(request)?;
        if response.ok {
            Ok(response.result.unwrap_or_else(|| json!({})))
        } else {
            Err(SeqClientError::Remote(
                response
                    .error
                    .unwrap_or_else(|| "unknown_error".to_string()),
            ))
        }
    }

    pub fn ping(&self) -> Result<RpcResponse, SeqClientError> {
        self.call(RpcRequest::new("ping"))
    }

    pub fn app_state(&self) -> Result<RpcResponse, SeqClientError> {
        self.call(RpcRequest::new("app_state"))
    }

    pub fn perf(&self) -> Result<RpcResponse, SeqClientError> {
        self.call(RpcRequest::new("perf"))
    }

    pub fn open_app(&self, name: &str) -> Result<RpcResponse, SeqClientError> {
        self.call(RpcRequest::new("open_app").with_args_json(json!({ "name": name })))
    }

    pub fn open_app_toggle(&self, name: &str) -> Result<RpcResponse, SeqClientError> {
        self.call(RpcRequest::new("open_app_toggle").with_args_json(json!({ "name": name })))
    }

    pub fn run_macro(&self, name: &str) -> Result<RpcResponse, SeqClientError> {
        self.call(RpcRequest::new("run_macro").with_args_json(json!({ "name": name })))
    }

    pub fn click(&self, x: f64, y: f64) -> Result<RpcResponse, SeqClientError> {
        self.call(RpcRequest::new("click").with_args_json(json!({ "x": x, "y": y })))
    }

    pub fn right_click(&self, x: f64, y: f64) -> Result<RpcResponse, SeqClientError> {
        self.call(RpcRequest::new("right_click").with_args_json(json!({ "x": x, "y": y })))
    }

    pub fn double_click(&self, x: f64, y: f64) -> Result<RpcResponse, SeqClientError> {
        self.call(RpcRequest::new("double_click").with_args_json(json!({ "x": x, "y": y })))
    }

    pub fn move_mouse(&self, x: f64, y: f64) -> Result<RpcResponse, SeqClientError> {
        self.call(RpcRequest::new("move").with_args_json(json!({ "x": x, "y": y })))
    }

    pub fn scroll(&self, x: f64, y: f64, dy: i32) -> Result<RpcResponse, SeqClientError> {
        self.call(RpcRequest::new("scroll").with_args_json(json!({ "x": x, "y": y, "dy": dy })))
    }

    pub fn drag(&self, x1: f64, y1: f64, x2: f64, y2: f64) -> Result<RpcResponse, SeqClientError> {
        self.call(
            RpcRequest::new("drag")
                .with_args_json(json!({ "x1": x1, "y1": y1, "x2": x2, "y2": y2 })),
        )
    }

    pub fn screenshot(&self, path: Option<&str>) -> Result<RpcResponse, SeqClientError> {
        let req = if let Some(path) = path {
            RpcRequest::new("screenshot").with_args_json(json!({ "path": path }))
        } else {
            RpcRequest::new("screenshot")
        };
        self.call(req)
    }
}

fn write_request(stream: &mut UnixStream, request: &RpcRequest) -> Result<(), SeqClientError> {
    let mut payload = serde_json::to_vec(request)?;
    payload.push(b'\n');
    stream.write_all(&payload)?;
    Ok(())
}

fn read_response_line(stream: &mut UnixStream) -> Result<Vec<u8>, SeqClientError> {
    let mut out = Vec::with_capacity(512);
    let mut buf = [0u8; 512];
    loop {
        let n = stream.read(&mut buf)?;
        if n == 0 {
            if out.is_empty() {
                return Err(SeqClientError::Protocol(
                    "unexpected EOF while waiting for response".to_string(),
                ));
            }
            break;
        }
        for b in &buf[..n] {
            out.push(*b);
            if *b == b'\n' {
                out.pop();
                return Ok(out);
            }
        }
        if out.len() > MAX_RESPONSE_BYTES {
            return Err(SeqClientError::Protocol(
                "response exceeded max size".to_string(),
            ));
        }
    }
    Ok(out)
}

#[cfg(test)]
mod tests {
    use super::*;
    use std::fs;
    use std::io::{BufRead, BufReader};
    use std::os::unix::net::UnixListener;
    use std::thread;

    fn test_socket_path(tag: &str) -> PathBuf {
        let mut p = std::env::temp_dir();
        let pid = std::process::id();
        let now = std::time::SystemTime::now()
            .duration_since(std::time::UNIX_EPOCH)
            .expect("clock")
            .as_nanos();
        p.push(format!("seq_client_{tag}_{pid}_{now}.sock"));
        p
    }

    #[test]
    fn call_roundtrip_ping() {
        let path = test_socket_path("ping");
        let listener = UnixListener::bind(&path).expect("bind");
        let server = thread::spawn(move || {
            let (stream, _) = listener.accept().expect("accept");
            let mut reader = BufReader::new(stream);
            let mut line = String::new();
            reader.read_line(&mut line).expect("read line");
            let req: Value = serde_json::from_str(line.trim()).expect("parse req");
            assert_eq!(req["op"], "ping");
            let response = json!({
                "ok": true,
                "op": "ping",
                "request_id": "",
                "run_id": "",
                "tool_call_id": "",
                "ts_ms": 1,
                "dur_us": 2,
                "result": { "pong": true }
            });
            let mut inner = reader.into_inner();
            inner
                .write_all(format!("{}\n", response).as_bytes())
                .expect("write");
        });

        let client = SeqClient::connect(&path).expect("connect");
        let response = client.ping().expect("call");
        assert!(response.ok);
        assert_eq!(response.op, "ping");
        assert_eq!(response.result.unwrap()["pong"], true);

        server.join().expect("join");
        let _ = fs::remove_file(path);
    }

    #[test]
    fn call_ok_surfaces_remote_error() {
        let path = test_socket_path("err");
        let listener = UnixListener::bind(&path).expect("bind");
        let server = thread::spawn(move || {
            let (stream, _) = listener.accept().expect("accept");
            let mut reader = BufReader::new(stream);
            let mut line = String::new();
            reader.read_line(&mut line).expect("read line");
            let response = json!({
                "ok": false,
                "op": "open_app",
                "request_id": "r1",
                "run_id": "",
                "tool_call_id": "",
                "ts_ms": 10,
                "dur_us": 11,
                "error": "missing_name"
            });
            let mut inner = reader.into_inner();
            inner
                .write_all(format!("{}\n", response).as_bytes())
                .expect("write");
        });

        let client = SeqClient::connect(&path).expect("connect");
        let err = client
            .call_ok(RpcRequest::new("open_app"))
            .expect_err("should fail");
        match err {
            SeqClientError::Remote(s) => assert_eq!(s, "missing_name"),
            other => panic!("unexpected error: {other:?}"),
        }

        server.join().expect("join");
        let _ = fs::remove_file(path);
    }
}


================================================
FILE: crates/seq_everruns_bridge/Cargo.toml
================================================
[package]
name = "seq_everruns_bridge"
version = "0.1.0"
edition = "2021"
description = "Everruns client-side tool bridge for seqd RPC"
license = "MIT"

[dependencies]
seq_client = { path = "../seq_client" }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
thiserror = "2.0"
reqwest = { version = "0.13", default-features = false, features = ["blocking", "rustls"] }


================================================
FILE: crates/seq_everruns_bridge/src/lib.rs
================================================
use seq_client::{RpcRequest, SeqClient};
use serde::{Deserialize, Serialize};
use serde_json::{json, Value};
use std::time::{Instant, SystemTime, UNIX_EPOCH};
use thiserror::Error;

pub mod maple;

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ToolCall {
    pub id: String,
    pub name: String,
    #[serde(default)]
    pub arguments: Value,
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct ToolResult {
    pub tool_call_id: String,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub result: Option<Value>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub error: Option<String>,
}

#[derive(Debug, Deserialize)]
pub struct ToolCallRequestedData {
    pub tool_calls: Vec<ToolCall>,
}

#[derive(Debug, Error)]
pub enum BridgeError {
    #[error("unsupported seq tool name: {0}")]
    UnsupportedTool(String),
}

pub fn parse_tool_call_requested(data: &Value) -> Result<Vec<ToolCall>, serde_json::Error> {
    let parsed: ToolCallRequestedData = serde_json::from_value(data.clone())?;
    Ok(parsed.tool_calls)
}

pub fn execute_tool_call(
    client: &SeqClient,
    session_id: &str,
    event_id: &str,
    call: &ToolCall,
) -> ToolResult {
    execute_tool_call_with_maple(client, session_id, event_id, call, None)
}

pub fn execute_tool_call_with_maple(
    client: &SeqClient,
    session_id: &str,
    event_id: &str,
    call: &ToolCall,
    maple_exporter: Option<&maple::MapleTraceExporter>,
) -> ToolResult {
    let started = Instant::now();
    let start_unix_nano = unix_time_nanos_now();
    let seq_op = map_tool_name_to_seq_op(&call.name).unwrap_or("unknown");

    let result = match build_request(session_id, event_id, call) {
        Ok(req) => match client.call(req) {
            Ok(resp) => {
                if resp.ok {
                    ToolResult {
                        tool_call_id: call.id.clone(),
                        result: Some(resp.result.unwrap_or_else(|| json!({}))),
                        error: None,
                    }
                } else {
                    let op = map_tool_name_to_seq_op(&call.name).unwrap_or("unknown");
                    ToolResult {
                        tool_call_id: call.id.clone(),
                        result: None,
                        error: Some(
                            resp.error
                                .unwrap_or_else(|| format!("seq {op} failed with unknown error")),
                        ),
                    }
                }
            }
            Err(err) => {
                let op = map_tool_name_to_seq_op(&call.name).unwrap_or("unknown");
                ToolResult {
                    tool_call_id: call.id.clone(),
                    result: None,
                    error: Some(format!("seq {op} call failed: {err}")),
                }
            }
        },
        Err(err) => ToolResult {
            tool_call_id: call.id.clone(),
            result: None,
            error: Some(err.to_string()),
        },
    };

    if let Some(exporter) = maple_exporter {
        let elapsed = started.elapsed();
        let duration_ms = elapsed.as_millis() as u64;
        let end_unix_nano = start_unix_nano.saturating_add(elapsed.as_nanos() as u64);
        let ok = result.error.is_none();
        let span = maple::MapleSpan::for_tool_call(
            session_id,
            event_id,
            &call.id,
            &call.name,
            seq_op,
            ok,
            result.error.as_deref(),
            start_unix_nano,
            end_unix_nano,
            duration_ms,
        );
        exporter.emit_span(span);
    }

    result
}

pub fn build_request(
    session_id: &str,
    event_id: &str,
    call: &ToolCall,
) -> Result<RpcRequest, BridgeError> {
    let op = map_tool_name_to_seq_op(&call.name)
        .ok_or_else(|| BridgeError::UnsupportedTool(call.name.clone()))?;

    let mut req = RpcRequest::new(op)
        .with_request_id(format!("everruns:{event_id}:{}", call.id))
        .with_run_id(session_id)
        .with_tool_call_id(&call.id);

    if !call.arguments.is_null() {
        req = req.with_args_json(call.arguments.clone());
    }

    Ok(req)
}

pub fn map_tool_name_to_seq_op(tool_name: &str) -> Option<&'static str> {
    let mut name = tool_name.trim().to_ascii_lowercase().replace('-', "_");

    for prefix in ["seq.", "seq:", "seq_"] {
        if let Some(rest) = name.strip_prefix(prefix) {
            name = rest.to_string();
            break;
        }
    }

    match name.as_str() {
        "ping" => Some("ping"),
        "app_state" => Some("app_state"),
        "perf" => Some("perf"),
        "open_app" => Some("open_app"),
        "open_app_toggle" => Some("open_app_toggle"),
        "run_macro" => Some("run_macro"),
        "click" => Some("click"),
        "right_click" => Some("right_click"),
        "double_click" => Some("double_click"),
        "move" => Some("move"),
        "scroll" => Some("scroll"),
        "drag" => Some("drag"),
        "screenshot" => Some("screenshot"),
        _ => None,
    }
}

pub fn client_side_tool_definitions() -> Vec<Value> {
    vec![
        client_tool(
            "seq_ping",
            "Health check seqd runtime",
            json!({"type":"object","properties":{},"additionalProperties":false}),
        ),
        client_tool(
            "seq_app_state",
            "Get frontmost/previous app snapshot",
            json!({"type":"object","properties":{},"additionalProperties":false}),
        ),
        client_tool(
            "seq_perf",
            "Get seqd performance snapshot",
            json!({"type":"object","properties":{},"additionalProperties":false}),
        ),
        client_tool(
            "seq_open_app",
            "Open application by name",
            json!({
                "type":"object",
                "properties":{"name":{"type":"string","description":"App name (e.g. Safari)"}},
                "required":["name"],
                "additionalProperties":false
            }),
        ),
        client_tool(
            "seq_open_app_toggle",
            "Toggle to app by name",
            json!({
                "type":"object",
                "properties":{"name":{"type":"string","description":"App name (e.g. Safari)"}},
                "required":["name"],
                "additionalProperties":false
            }),
        ),
        client_tool(
            "seq_run_macro",
            "Run seq macro by name",
            json!({
                "type":"object",
                "properties":{"name":{"type":"string","description":"Macro name"}},
                "required":["name"],
                "additionalProperties":false
            }),
        ),
        client_tool(
            "seq_click",
            "Click at screen coordinates",
            json!({
                "type":"object",
                "properties":{"x":{"type":"number"},"y":{"type":"number"}},
                "required":["x","y"],
                "additionalProperties":false
            }),
        ),
        client_tool(
            "seq_right_click",
            "Right click at screen coordinates",
            json!({
                "type":"object",
                "properties":{"x":{"type":"number"},"y":{"type":"number"}},
                "required":["x","y"],
                "additionalProperties":false
            }),
        ),
        client_tool(
            "seq_double_click",
            "Double click at screen coordinates",
            json!({
                "type":"object",
                "properties":{"x":{"type":"number"},"y":{"type":"number"}},
                "required":["x","y"],
                "additionalProperties":false
            }),
        ),
        client_tool(
            "seq_move",
            "Move pointer to coordinates",
            json!({
                "type":"object",
                "properties":{"x":{"type":"number"},"y":{"type":"number"}},
                "required":["x","y"],
                "additionalProperties":false
            }),
        ),
        client_tool(
            "seq_scroll",
            "Scroll at coordinates by delta",
            json!({
                "type":"object",
                "properties":{"x":{"type":"number"},"y":{"type":"number"},"dy":{"type":"integer"}},
                "required":["x","y","dy"],
                "additionalProperties":false
            }),
        ),
        client_tool(
            "seq_drag",
            "Drag from one coordinate to another",
            json!({
                "type":"object",
                "properties":{"x1":{"type":"number"},"y1":{"type":"number"},"x2":{"type":"number"},"y2":{"type":"number"}},
                "required":["x1","y1","x2","y2"],
                "additionalProperties":false
            }),
        ),
        client_tool(
            "seq_screenshot",
            "Capture screenshot to optional path",
            json!({
                "type":"object",
                "properties":{"path":{"type":"string","description":"Output path (optional)"}},
                "additionalProperties":false
            }),
        ),
    ]
}

fn client_tool(name: &str, description: &str, parameters: Value) -> Value {
    json!({
        "type": "client_side",
        "name": name,
        "description": description,
        "parameters": parameters
    })
}

fn unix_time_nanos_now() -> u64 {
    match SystemTime::now().duration_since(UNIX_EPOCH) {
        Ok(dur) => dur.as_nanos() as u64,
        Err(_) => 0,
    }
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn maps_supported_tool_names() {
        assert_eq!(map_tool_name_to_seq_op("seq_open_app"), Some("open_app"));
        assert_eq!(map_tool_name_to_seq_op("seq.open_app"), Some("open_app"));
        assert_eq!(map_tool_name_to_seq_op("seq:open-app"), Some("open_app"));
        assert_eq!(map_tool_name_to_seq_op("PING"), Some("ping"));
        assert_eq!(map_tool_name_to_seq_op("unknown_tool"), None);
    }

    #[test]
    fn builds_request_with_correlation_ids() {
        let call = ToolCall {
            id: "tool-9".to_string(),
            name: "seq_click".to_string(),
            arguments: json!({"x": 1, "y": 2}),
        };

        let req = build_request("session-1", "event-7", &call).expect("request should build");
        assert_eq!(req.op, "click");
        assert_eq!(req.request_id.as_deref(), Some("everruns:event-7:tool-9"));
        assert_eq!(req.run_id.as_deref(), Some("session-1"));
        assert_eq!(req.tool_call_id.as_deref(), Some("tool-9"));
        assert_eq!(req.args, Some(json!({"x": 1, "y": 2})));
    }

    #[test]
    fn emits_expected_tool_catalog() {
        let defs = client_side_tool_definitions();
        assert_eq!(defs.len(), 13);
        let names: Vec<&str> = defs
            .iter()
            .filter_map(|v| v.get("name").and_then(Value::as_str))
            .collect();
        assert!(names.contains(&"seq_open_app"));
        assert!(names.contains(&"seq_screenshot"));
    }

    #[test]
    fn parse_tool_call_requested_payload() {
        let payload = json!({
            "tool_calls": [
                {"id":"tc1","name":"seq_ping","arguments":{}},
                {"id":"tc2","name":"seq_open_app","arguments":{"name":"Safari"}}
            ]
        });

        let calls = parse_tool_call_requested(&payload).expect("payload should parse");
        assert_eq!(calls.len(), 2);
        assert_eq!(calls[0].id, "tc1");
        assert_eq!(calls[1].name, "seq_open_app");
    }

    #[test]
    fn unsupported_tool_returns_error_result() {
        let call = ToolCall {
            id: "tcX".to_string(),
            name: "seq_not_real".to_string(),
            arguments: json!({}),
        };

        let result = ToolResult {
            tool_call_id: call.id.clone(),
            result: None,
            error: Some(
                build_request("session", "event", &call)
                    .expect_err("should error")
                    .to_string(),
            ),
        };

        assert_eq!(result.tool_call_id, "tcX");
        assert!(result
            .error
            .unwrap_or_default()
            .contains("unsupported seq tool name"));
    }

    #[test]
    fn bridge_error_is_displayable() {
        let e = BridgeError::UnsupportedTool("foo".to_string());
        assert_eq!(e.to_string(), "unsupported seq tool name: foo");
    }
}


================================================
FILE: crates/seq_everruns_bridge/src/maple.rs
================================================
use reqwest::blocking::Client;
use serde_json::{json, Value};
use std::sync::atomic::{AtomicU64, Ordering};
use std::sync::mpsc::{sync_channel, Receiver, RecvTimeoutError, SyncSender, TryRecvError};
use std::sync::Arc;
use std::thread;
use std::time::Duration;
use thiserror::Error;

const DEFAULT_SCOPE_NAME: &str = "seq_everruns_bridge";
const DEFAULT_SERVICE_NAME: &str = "seq-everruns-bridge";
const DEFAULT_ENV: &str = "local";
const DEFAULT_QUEUE_CAPACITY: usize = 4096;
const DEFAULT_MAX_BATCH_SIZE: usize = 128;
const DEFAULT_FLUSH_INTERVAL_MS: u64 = 50;
const DEFAULT_CONNECT_TIMEOUT_MS: u64 = 400;
const DEFAULT_REQUEST_TIMEOUT_MS: u64 = 800;

#[derive(Debug, Clone)]
pub struct MapleIngestTarget {
    pub traces_endpoint: String,
    pub ingest_key: String,
}

#[derive(Debug, Clone)]
pub struct MapleExporterConfig {
    pub service_name: String,
    pub service_version: Option<String>,
    pub deployment_environment: String,
    pub scope_name: String,
    pub queue_capacity: usize,
    pub max_batch_size: usize,
    pub flush_interval: Duration,
    pub connect_timeout: Duration,
    pub request_timeout: Duration,
    pub targets: Vec<MapleIngestTarget>,
}

impl MapleExporterConfig {
    pub fn from_env() -> Result<Option<Self>, MapleConfigError> {
        let targets = parse_targets_from_env()?;
        if targets.is_empty() {
            return Ok(None);
        }

        let service_name = std::env::var("SEQ_EVERRUNS_MAPLE_SERVICE_NAME")
            .ok()
            .and_then(non_empty)
            .unwrap_or_else(|| DEFAULT_SERVICE_NAME.to_string());

        let deployment_environment = std::env::var("SEQ_EVERRUNS_MAPLE_ENV")
            .ok()
            .and_then(non_empty)
            .unwrap_or_else(|| DEFAULT_ENV.to_string());

        let service_version = std::env::var("SEQ_EVERRUNS_MAPLE_SERVICE_VERSION")
            .ok()
            .and_then(non_empty);

        let scope_name = std::env::var("SEQ_EVERRUNS_MAPLE_SCOPE_NAME")
            .ok()
            .and_then(non_empty)
            .unwrap_or_else(|| DEFAULT_SCOPE_NAME.to_string());

        let queue_capacity = env_usize("SEQ_EVERRUNS_MAPLE_QUEUE_CAPACITY")
            .unwrap_or(DEFAULT_QUEUE_CAPACITY)
            .max(1);
        let max_batch_size = env_usize("SEQ_EVERRUNS_MAPLE_MAX_BATCH_SIZE")
            .unwrap_or(DEFAULT_MAX_BATCH_SIZE)
            .max(1);
        let flush_interval = Duration::from_millis(
            env_u64("SEQ_EVERRUNS_MAPLE_FLUSH_INTERVAL_MS").unwrap_or(DEFAULT_FLUSH_INTERVAL_MS),
        );
        let connect_timeout = Duration::from_millis(
            env_u64("SEQ_EVERRUNS_MAPLE_CONNECT_TIMEOUT_MS").unwrap_or(DEFAULT_CONNECT_TIMEOUT_MS),
        );
        let request_timeout = Duration::from_millis(
            env_u64("SEQ_EVERRUNS_MAPLE_REQUEST_TIMEOUT_MS").unwrap_or(DEFAULT_REQUEST_TIMEOUT_MS),
        );

        Ok(Some(Self {
            service_name,
            service_version,
            deployment_environment,
            scope_name,
            queue_capacity,
            max_batch_size,
            flush_interval,
            connect_timeout,
            request_timeout,
            targets,
        }))
    }
}

impl Default for MapleExporterConfig {
    fn default() -> Self {
        Self {
            service_name: DEFAULT_SERVICE_NAME.to_string(),
            service_version: None,
            deployment_environment: DEFAULT_ENV.to_string(),
            scope_name: DEFAULT_SCOPE_NAME.to_string(),
            queue_capacity: DEFAULT_QUEUE_CAPACITY,
            max_batch_size: DEFAULT_MAX_BATCH_SIZE,
            flush_interval: Duration::from_millis(DEFAULT_FLUSH_INTERVAL_MS),
            connect_timeout: Duration::from_millis(DEFAULT_CONNECT_TIMEOUT_MS),
            request_timeout: Duration::from_millis(DEFAULT_REQUEST_TIMEOUT_MS),
            targets: Vec::new(),
        }
    }
}

#[derive(Debug, Error)]
pub enum MapleConfigError {
    #[error("SEQ_EVERRUNS_MAPLE_TRACES_ENDPOINTS count ({endpoints}) does not match SEQ_EVERRUNS_MAPLE_INGEST_KEYS count ({keys})")]
    EndpointKeyCountMismatch { endpoints: usize, keys: usize },
    #[error("{prefix} endpoint/key must both be set")]
    IncompletePair { prefix: &'static str },
}

#[derive(Debug, Clone)]
pub struct MapleSpan {
    pub trace_id: String,
    pub span_id: String,
    pub parent_span_id: String,
    pub name: String,
    pub kind: i32,
    pub start_time_unix_nano: u64,
    pub end_time_unix_nano: u64,
    pub status_code: i32,
    pub status_message: Option<String>,
    pub attributes: Vec<(String, String)>,
}

impl MapleSpan {
    pub fn for_runtime_event(
        session_id: &str,
        event_id: &str,
        stage: &str,
        ok: bool,
        error: Option<&str>,
        start_time_unix_nano: u64,
        end_time_unix_nano: u64,
        mut extra_attributes: Vec<(String, String)>,
    ) -> Self {
        let trace_id = stable_trace_id(session_id, event_id);
        let span_id = stable_span_id(&format!(
            "{session_id}:{event_id}:{stage}:{start_time_unix_nano}"
        ));
        extra_attributes.push(("session_id".to_string(), session_id.to_string()));
        extra_attributes.push(("event_id".to_string(), event_id.to_string()));
        extra_attributes.push(("stage".to_string(), stage.to_string()));
        extra_attributes.push(("bridge.ok".to_string(), ok.to_string()));
        if let Some(msg) = error {
            extra_attributes.push(("error.message".to_string(), msg.to_string()));
        }

        Self {
            trace_id,
            span_id,
            parent_span_id: String::new(),
            name: format!("everruns.{stage}"),
            kind: 1,
            start_time_unix_nano,
            end_time_unix_nano,
            status_code: if ok { 1 } else { 2 },
            status_message: error.map(|s| s.to_string()),
            attributes: extra_attributes,
        }
    }

    pub fn for_tool_call(
        session_id: &str,
        event_id: &str,
        tool_call_id: &str,
        tool_name: &str,
        seq_op: &str,
        ok: bool,
        error: Option<&str>,
        start_time_unix_nano: u64,
        end_time_unix_nano: u64,
        duration_ms: u64,
    ) -> Self {
        let trace_id = stable_trace_id(session_id, event_id);
        let span_id = stable_span_id(&format!(
            "{session_id}:{event_id}:{tool_call_id}:{start_time_unix_nano}"
        ));

        let mut attributes = vec![
            ("session_id".to_string(), session_id.to_string()),
            ("event_id".to_string(), event_id.to_string()),
            ("tool_call_id".to_string(), tool_call_id.to_string()),
            ("tool_name".to_string(), tool_name.to_string()),
            ("seq_op".to_string(), seq_op.to_string()),
            ("bridge.ok".to_string(), ok.to_string()),
            ("bridge.duration_ms".to_string(), duration_ms.to_string()),
        ];
        if let Some(msg) = error {
            attributes.push(("error.message".to_string(), msg.to_string()));
        }

        Self {
            trace_id,
            span_id,
            parent_span_id: String::new(),
            name: "everruns.tool_call".to_string(),
            kind: 3,
            start_time_unix_nano,
            end_time_unix_nano,
            status_code: if ok { 1 } else { 2 },
            status_message: error.map(|s| s.to_string()),
            attributes,
        }
    }
}

#[derive(Debug, Clone, Default)]
pub struct MapleExporterStats {
    pub enqueued: u64,
    pub sent: u64,
    pub failed: u64,
    pub dropped: u64,
}

#[derive(Default)]
struct MapleExporterStatsAtomic {
    enqueued: AtomicU64,
    sent: AtomicU64,
    failed: AtomicU64,
    dropped: AtomicU64,
}

struct WorkerTarget {
    traces_endpoint: String,
    ingest_key: String,
    client: Client,
}

pub struct MapleTraceExporter {
    tx: SyncSender<MapleSpan>,
    stats: Arc<MapleExporterStatsAtomic>,
}

impl MapleTraceExporter {
    pub fn from_env() -> Result<Option<Self>, MapleConfigError> {
        let Some(config) = MapleExporterConfig::from_env()? else {
            return Ok(None);
        };
        Ok(Some(Self::new(config)))
    }

    pub fn new(config: MapleExporterConfig) -> Self {
        let (tx, rx) = sync_channel(config.queue_capacity.max(1));
        let stats = Arc::new(MapleExporterStatsAtomic::default());
        let worker_stats = Arc::clone(&stats);
        thread::spawn(move || worker_main(rx, config, worker_stats));
        Self { tx, stats }
    }

    pub fn emit_span(&self, span: MapleSpan) {
        if self.tx.try_send(span).is_ok() {
            self.stats.enqueued.fetch_add(1, Ordering::Relaxed);
        } else {
            self.stats.dropped.fetch_add(1, Ordering::Relaxed);
        }
    }

    pub fn stats(&self) -> MapleExporterStats {
        MapleExporterStats {
            enqueued: self.stats.enqueued.load(Ordering::Relaxed),
            sent: self.stats.sent.load(Ordering::Relaxed),
            failed: self.stats.failed.load(Ordering::Relaxed),
            dropped: self.stats.dropped.load(Ordering::Relaxed),
        }
    }
}

fn worker_main(
    rx: Receiver<MapleSpan>,
    config: MapleExporterConfig,
    stats: Arc<MapleExporterStatsAtomic>,
) {
    let worker_targets: Vec<WorkerTarget> = config
        .targets
        .iter()
        .map(|target| WorkerTarget {
            traces_endpoint: target.traces_endpoint.clone(),
            ingest_key: target.ingest_key.clone(),
            client: Client::builder()
                .connect_timeout(config.connect_timeout)
                .timeout(config.request_timeout)
                .build()
                .expect("failed to build maple exporter HTTP client"),
        })
        .collect();

    let mut batch = Vec::with_capacity(config.max_batch_size.max(1));
    let mut disconnected = false;

    while !disconnected {
        match rx.recv_timeout(config.flush_interval) {
            Ok(span) => batch.push(span),
            Err(RecvTimeoutError::Timeout) => {}
            Err(RecvTimeoutError::Disconnected) => {
                disconnected = true;
            }
        }

        while batch.len() < config.max_batch_size {
            match rx.try_recv() {
                Ok(span) => batch.push(span),
                Err(TryRecvError::Empty) => break,
                Err(TryRecvError::Disconnected) => {
                    disconnected = true;
                    break;
                }
            }
        }

        if !batch.is_empty() {
            flush_batch(&config, &worker_targets, &batch, &stats);
            batch.clear();
        }
    }
}

fn flush_batch(
    config: &MapleExporterConfig,
    worker_targets: &[WorkerTarget],
    spans: &[MapleSpan],
    stats: &Arc<MapleExporterStatsAtomic>,
) {
    let spans_payload: Vec<Value> = spans.iter().map(encode_span).collect();
    let resource_attrs = build_resource_attrs(config);
    let payload = json!({
        "resourceSpans": [
            {
                "resource": {
                    "attributes": resource_attrs
                },
                "scopeSpans": [
                    {
                        "scope": { "name": config.scope_name },
                        "spans": spans_payload
                    }
                ]
            }
        ]
    });

    let body = payload.to_string();
    for target in worker_targets {
        let sent = target
            .client
            .post(&target.traces_endpoint)
            .header("content-type", "application/json")
            .header("x-maple-ingest-key", &target.ingest_key)
            .body(body.clone())
            .send();

        match sent {
            Ok(resp) if resp.status().is_success() => {
                stats.sent.fetch_add(spans.len() as u64, Ordering::Relaxed);
            }
            Ok(_) | Err(_) => {
                stats
                    .failed
                    .fetch_add(spans.len() as u64, Ordering::Relaxed);
            }
        }
    }
}

fn build_resource_attrs(config: &MapleExporterConfig) -> Vec<Value> {
    let mut attrs = vec![
        otlp_string_attr("service.name", &config.service_name),
        otlp_string_attr("deployment.environment", &config.deployment_environment),
    ];

    if let Some(version) = &config.service_version {
        attrs.push(otlp_string_attr("service.version", version));
    }

    attrs
}

fn encode_span(span: &MapleSpan) -> Value {
    json!({
        "traceId": span.trace_id,
        "spanId": span.span_id,
        "parentSpanId": span.parent_span_id,
        "name": span.name,
        "kind": span.kind,
        "startTimeUnixNano": span.start_time_unix_nano.to_string(),
        "endTimeUnixNano": span.end_time_unix_nano.to_string(),
        "attributes": span
            .attributes
            .iter()
            .map(|(key, value)| otlp_string_attr(key, value))
            .collect::<Vec<Value>>(),
        "status": {
            "code": span.status_code,
            "message": span.status_message.clone().unwrap_or_default()
        }
    })
}

fn otlp_string_attr(key: &str, value: &str) -> Value {
    json!({
        "key": key,
        "value": { "stringValue": value }
    })
}

fn parse_targets_from_env() -> Result<Vec<MapleIngestTarget>, MapleConfigError> {
    let mut targets = Vec::new();

    let local_endpoint = std::env::var("SEQ_EVERRUNS_MAPLE_LOCAL_ENDPOINT")
        .ok()
        .and_then(non_empty);
    let local_key = std::env::var("SEQ_EVERRUNS_MAPLE_LOCAL_INGEST_KEY")
        .ok()
        .and_then(non_empty);
    match (local_endpoint, local_key) {
        (Some(endpoint), Some(key)) => targets.push(MapleIngestTarget {
            traces_endpoint: endpoint,
            ingest_key: key,
        }),
        (None, None) => {}
        _ => {
            return Err(MapleConfigError::IncompletePair {
                prefix: "SEQ_EVERRUNS_MAPLE_LOCAL",
            });
        }
    }

    let hosted_endpoint = std::env::var("SEQ_EVERRUNS_MAPLE_HOSTED_ENDPOINT")
        .ok()
        .and_then(non_empty);
    let hosted_key = std::env::var("SEQ_EVERRUNS_MAPLE_HOSTED_INGEST_KEY")
        .ok()
        .and_then(non_empty);
    match (hosted_endpoint, hosted_key) {
        (Some(endpoint), Some(key)) => targets.push(MapleIngestTarget {
            traces_endpoint: endpoint,
            ingest_key: key,
        }),
        (None, None) => {}
        _ => {
            return Err(MapleConfigError::IncompletePair {
                prefix: "SEQ_EVERRUNS_MAPLE_HOSTED",
            });
        }
    }

    let csv_endpoints = split_csv_env("SEQ_EVERRUNS_MAPLE_TRACES_ENDPOINTS");
    let csv_keys = split_csv_env("SEQ_EVERRUNS_MAPLE_INGEST_KEYS");
    if !csv_endpoints.is_empty() || !csv_keys.is_empty() {
        if csv_endpoints.len() != csv_keys.len() {
            return Err(MapleConfigError::EndpointKeyCountMismatch {
                endpoints: csv_endpoints.len(),
                keys: csv_keys.len(),
            });
        }
        for (endpoint, key) in csv_endpoints.into_iter().zip(csv_keys.into_iter()) {
            targets.push(MapleIngestTarget {
                traces_endpoint: endpoint,
                ingest_key: key,
            });
        }
    }

    Ok(dedup_targets(targets))
}

fn split_csv_env(key: &str) -> Vec<String> {
    std::env::var(key)
        .ok()
        .map(|raw| raw.split(',').filter_map(non_empty).collect())
        .unwrap_or_default()
}

fn dedup_targets(targets: Vec<MapleIngestTarget>) -> Vec<MapleIngestTarget> {
    let mut out: Vec<MapleIngestTarget> = Vec::new();
    for target in targets {
        let exists = out.iter().any(|existing| {
            existing.traces_endpoint == target.traces_endpoint
                && existing.ingest_key == target.ingest_key
        });
        if !exists {
            out.push(target);
        }
    }
    out
}

fn env_usize(key: &str) -> Option<usize> {
    std::env::var(key)
        .ok()
        .and_then(|v| v.trim().parse::<usize>().ok())
}

fn env_u64(key: &str) -> Option<u64> {
    std::env::var(key)
        .ok()
        .and_then(|v| v.trim().parse::<u64>().ok())
}

fn non_empty(s: impl AsRef<str>) -> Option<String> {
    let value = s.as_ref().trim();
    if value.is_empty() {
        None
    } else {
        Some(value.to_string())
    }
}

pub fn stable_trace_id(session_id: &str, event_id: &str) -> String {
    let a = fnv1a64(session_id.as_bytes());
    let b = fnv1a64(event_id.as_bytes());
    format!("{a:016x}{b:016x}")
}

pub fn stable_span_id(seed: &str) -> String {
    format!("{:016x}", fnv1a64(seed.as_bytes()))
}

fn fnv1a64(data: &[u8]) -> u64 {
    let mut hash: u64 = 0xcbf29ce484222325;
    for byte in data {
        hash ^= *byte as u64;
        hash = hash.wrapping_mul(0x100000001b3);
    }
    hash
}

#[cfg(test)]
mod tests {
    use super::*;
    use std::io::{Read, Write};
    use std::net::TcpListener;
    use std::sync::Mutex;
    use std::time::Duration;

    static ENV_LOCK: Mutex<()> = Mutex::new(());

    fn unset_maple_envs() {
        let keys = [
            "SEQ_EVERRUNS_MAPLE_LOCAL_ENDPOINT",
            "SEQ_EVERRUNS_MAPLE_LOCAL_INGEST_KEY",
            "SEQ_EVERRUNS_MAPLE_HOSTED_ENDPOINT",
            "SEQ_EVERRUNS_MAPLE_HOSTED_INGEST_KEY",
            "SEQ_EVERRUNS_MAPLE_TRACES_ENDPOINTS",
            "SEQ_EVERRUNS_MAPLE_INGEST_KEYS",
            "SEQ_EVERRUNS_MAPLE_SERVICE_NAME",
            "SEQ_EVERRUNS_MAPLE_SERVICE_VERSION",
            "SEQ_EVERRUNS_MAPLE_ENV",
            "SEQ_EVERRUNS_MAPLE_SCOPE_NAME",
            "SEQ_EVERRUNS_MAPLE_QUEUE_CAPACITY",
            "SEQ_EVERRUNS_MAPLE_MAX_BATCH_SIZE",
            "SEQ_EVERRUNS_MAPLE_FLUSH_INTERVAL_MS",
            "SEQ_EVERRUNS_MAPLE_CONNECT_TIMEOUT_MS",
            "SEQ_EVERRUNS_MAPLE_REQUEST_TIMEOUT_MS",
        ];
        for key in keys {
            std::env::remove_var(key);
        }
    }

    #[test]
    fn stable_ids_have_expected_length() {
        let trace_id = stable_trace_id("session-1", "event-1");
        let span_id = stable_span_id("session-1:event-1:tc1");
        assert_eq!(trace_id.len(), 32);
        assert_eq!(span_id.len(), 16);
    }

    #[test]
    fn reads_dual_target_env_config() {
        let _guard = ENV_LOCK.lock().expect("lock env");
        unset_maple_envs();
        std::env::set_var(
            "SEQ_EVERRUNS_MAPLE_LOCAL_ENDPOINT",
            "http://ingest.maple.localhost/v1/traces",
        );
        std::env::set_var("SEQ_EVERRUNS_MAPLE_LOCAL_INGEST_KEY", "maple_pk_local");
        std::env::set_var(
            "SEQ_EVERRUNS_MAPLE_HOSTED_ENDPOINT",
            "https://ingest.1focus.ai/v1/traces",
        );
        std::env::set_var("SEQ_EVERRUNS_MAPLE_HOSTED_INGEST_KEY", "maple_pk_hosted");

        let cfg = MapleExporterConfig::from_env()
            .expect("env parse")
            .expect("config should exist");
        assert_eq!(cfg.targets.len(), 2);
        assert!(cfg
            .targets
            .iter()
            .any(|t| t.traces_endpoint == "http://ingest.maple.localhost/v1/traces"));
        assert!(cfg
            .targets
            .iter()
            .any(|t| t.traces_endpoint == "https://ingest.1focus.ai/v1/traces"));
        unset_maple_envs();
    }

    #[test]
    fn csv_target_env_mismatch_returns_error() {
        let _guard = ENV_LOCK.lock().expect("lock env");
        unset_maple_envs();
        std::env::set_var(
            "SEQ_EVERRUNS_MAPLE_TRACES_ENDPOINTS",
            "http://ingest.maple.localhost/v1/traces,https://ingest.1focus.ai/v1/traces",
        );
        std::env::set_var("SEQ_EVERRUNS_MAPLE_INGEST_KEYS", "maple_pk_only_one");

        let err = MapleExporterConfig::from_env().expect_err("mismatch should error");
        assert!(matches!(
            err,
            MapleConfigError::EndpointKeyCountMismatch { .. }
        ));
        unset_maple_envs();
    }

    #[test]
    fn incomplete_local_pair_returns_error() {
        let _guard = ENV_LOCK.lock().expect("lock env");
        unset_maple_envs();
        std::env::set_var(
            "SEQ_EVERRUNS_MAPLE_LOCAL_ENDPOINT",
            "http://ingest.maple.localhost/v1/traces",
        );

        let err = MapleExporterConfig::from_env().expect_err("incomplete pair should error");
        assert!(matches!(
            err,
            MapleConfigError::IncompletePair {
                prefix: "SEQ_EVERRUNS_MAPLE_LOCAL"
            }
        ));
        unset_maple_envs();
    }

    #[test]
    fn exporter_sends_span_to_ingest_endpoint() {
        let listener = TcpListener::bind("127.0.0.1:0").expect("bind test server");
        let addr = listener.local_addr().expect("local addr");

        let server = std::thread::spawn(move || {
            if let Ok((mut stream, _)) = listener.accept() {
                let mut req = [0_u8; 8192];
                let _ = stream.read(&mut req);
                let response =
                    b"HTTP/1.1 200 OK\r\nContent-Type: application/json\r\nContent-Length: 2\r\n\r\n{}";
                let _ = stream.write_all(response);
                let _ = stream.flush();
            }
        });

        let config = MapleExporterConfig {
            service_name: "seq-everruns-bridge-test".to_string(),
            service_version: None,
            deployment_environment: "test".to_string(),
            scope_name: "seq_everruns_bridge".to_string(),
            queue_capacity: 32,
            max_batch_size: 8,
            flush_interval: Duration::from_millis(10),
            connect_timeout: Duration::from_millis(200),
            request_timeout: Duration::from_millis(200),
            targets: vec![MapleIngestTarget {
                traces_endpoint: format!("http://{addr}/v1/traces"),
                ingest_key: "maple_pk_test".to_string(),
            }],
        };

        let exporter = MapleTraceExporter::new(config);
        let span = MapleSpan::for_tool_call(
            "session-1",
            "event-1",
            "tool-1",
            "seq_ping",
            "ping",
            true,
            None,
            1_739_890_000_000_000_000,
            1_739_890_000_100_000_000,
            100,
        );
        exporter.emit_span(span);

        std::thread::sleep(Duration::from_millis(80));
        let stats = exporter.stats();
        assert!(stats.sent >= 1, "expected at least one sent span");
        let _ = server.join();
    }
}


================================================
FILE: docs/ai-dev-layout.md
================================================
# `.ai/` Dev Layout

Use `.ai/` aggressively for local AI-assisted development, but keep the split
between tracked project intelligence and disposable local artifacts explicit.

Tracked in this repo:

- `.ai/docs/`
- `.ai/recipes/`
- `.ai/repos.toml`
- curated `.ai/skills/` entries that are intentionally committed

Ignored local-dev buckets:

- `.ai/reviews/`
  - generated PR feedback packets and review snapshots
- `.ai/test/`
  - AI scratch tests and local validation files
- `.ai/tmp/`
  - throwaway intermediate files
- `.ai/cache/`
  - cached derivations or precomputed local state
- `.ai/artifacts/`
  - generated outputs worth inspecting locally but not committing
- `.ai/traces/`
  - local trace dumps or trace export scratch
- `.ai/generated/`
  - one-off generated code/docs that should be promoted elsewhere if kept
- `.ai/scratch/`
  - free-form local notes, prompts, and experiments

Rules of thumb:

1. If it is canonical project knowledge, promote it out of the local bucket and
   track it intentionally.
2. If it is generated, per-machine, or iteration-only, keep it under one of the
   ignored buckets above.
3. Prefer `.ai/` over random top-level temp files so local AI/dev state stays
   contained and easy to clean up.


================================================
FILE: docs/ai-run-task-fast-path.md
================================================
# AI Run Task Fast Path

Goal: let AI add a run task in one edit, return a runnable `f ...` command, and optionally push.

## Prompt Contract

```text
make public task <doc-path.md> <thing>
make internal task <doc-path.md> <thing>
```

`<doc-path.md>` is implementation context. Do not edit docs unless asked.

## File Targeting

- Public: `~/run/flow.toml`
- Internal shared: `~/run/i/flow.toml`
- Internal project (only if project is explicitly requested): `~/run/i/<project>/flow.toml`

## Fast Rules

- Read only:
  - `<doc-path.md>`
  - target `flow.toml`
- Edit one `flow.toml` file.
- Add one `[[tasks]]` block unless user asks for multiple.
- Required fields: `name`, `description`, `command`.
- Add `interactive = true` only for prompts/TUI.
- Use `"$@"` passthrough when args should flow through.
- Keep shell idempotent and non-destructive.

## Required AI Reply Format

```text
Changed:
- /abs/path/to/flow.toml

Run:
f <r|ri|rip ...> <task-name> [args]

Share:
cd <repo> && git add <flow.toml> && git commit -m "add <task-name>" && git push
```

Shortcut map:
- Public -> `f r <task>`
- Internal shared -> `f ri <task>`
- Internal project -> `f rip <project> <task>`

## Push Confidence Gate

Include `Share` command only when all are true:

- single-file `flow.toml` change
- no secrets
- no destructive commands
- no uncertain behavior

Otherwise:

```text
Share:
skip (manual review)
```


================================================
FILE: docs/ai-task-fast-path-guide.md
================================================
# MoonBit AI Task Fast Path Guide

This guide is the practical playbook for running Flow MoonBit AI tasks at the lowest possible invocation latency.

It covers:

- when to use `f` vs `fai`
- how daemon mode actually works
- exact env knobs for tuning
- benchmark workflow to validate improvements
- troubleshooting for common regressions

---

## 1. Runtime Modes

Flow supports multiple runtime paths for `.ai/tasks/*.mbt`:

1. `moon run` path  
   `FLOW_AI_TASK_RUNTIME=moon-run f ai:flow/dev-check`  
   Highest flexibility, highest overhead.

2. Cached binary path through `f`  
   `FLOW_AI_TASK_RUNTIME=cached f ai:flow/dev-check`  
   Uses build cache, still pays full `f` process startup.

3. Daemon path through `f`  
   `f tasks run-ai --daemon ai:flow/dev-check`  
   Uses `ai-taskd` over Unix socket, still pays `f` process startup.

4. Fast daemon client (`fai`)  
   `fai ai:flow/dev-check`  
   Lowest invocation overhead for hot loops.

---

## 2. Recommended Setup (Low Latency)

From `~/code/flow`:

```bash
f install-ai-fast-client
f tasks daemon start
```

What this gives you:

- `~/.local/bin/fai` installed (low-overhead client).
- `ai-taskd` running and warm (`~/.flow/run/ai-taskd.sock`).

Verify:

```bash
which fai
fai --help
f tasks daemon status
fai ai:flow/noop
```

For always-on daemon across login sessions (recommended for stable latency):

```bash
f ai-taskd-launchd-install
f ai-taskd-launchd-status
```

---

## 3. Fast-Path Architecture

### `fai` path

1. `fai` sends a compact request to `~/.flow/run/ai-taskd.sock`
2. `ai-taskd` resolves task selector (fast exact path first)
3. `ai-taskd` reuses cached binary artifact when available
4. task process runs with `FLOW_AI_TASK_PROJECT_ROOT` set

### Key optimizations in current implementation

- daemon discovery cache with TTL:
  - `FLOW_AI_TASKD_DISCOVERY_TTL_MS` (default `750`)
- daemon artifact cache with TTL:
  - `FLOW_AI_TASKD_ARTIFACT_TTL_MS` (default `1500`)
- fast selector resolution:
  - exact selectors skip full recursive task discovery
- faster cache key computation:
  - file metadata fingerprints instead of full content hashing
  - Moon version cached on disk with TTL

Moon version knobs:

- `FLOW_AI_TASK_MOON_VERSION` (explicit override)
- `FLOW_AI_TASK_MOON_VERSION_TTL_SECS` (default `43200`)

Wire protocol knobs:

- `fai --protocol msgpack` (default)
- `fai --protocol json` (compat / debugging)

---

## 4. Using `f` with Fast Client Preference

`f` can optionally route AI task dispatch through the fast client when daemon mode is enabled.

Required:

```bash
export FLOW_AI_TASK_DAEMON=1
export FLOW_AI_TASK_FAST_CLIENT=1
```

Optional selector control:

```bash
export FLOW_AI_TASK_FAST_SELECTORS='ai:flow/noop,ai:flow/bench-cli,ai:project/*'
```

Optional client binary override:

```bash
export FLOW_AI_TASK_FAST_CLIENT_BIN="$HOME/.local/bin/fai"
```

Without `FLOW_AI_TASK_FAST_CLIENT=1`, `f` keeps normal daemon behavior.

---

## 5. `fai` CLI Usage

```bash
fai [--root PATH] [--socket PATH] [--protocol json|msgpack] [--no-cache] [--capture-output] [--timings] <selector> [-- <args...>]
fai [--root PATH] [--socket PATH] [--protocol json|msgpack] [--no-cache] [--capture-output] [--timings] --batch-stdin
```

Examples:

```bash
fai ai:flow/noop
fai --root ~/code/flow ai:flow/bench-cli -- --iterations 50
fai --no-cache ai:flow/dev-check
fai --timings ai:flow/noop
printf 'ai:flow/noop\nai:flow/noop\n' | fai --batch-stdin
```

Notes:

- default is no-capture mode for lower overhead
- use `--capture-output` if you need command output returned through client response
- use `--timings` to print server-side phase timings (`resolve_us`, `run_us`, `total_us`)
- use `--batch-stdin` for pooled client bursts (single client process, multiple requests)

---

## 6. Benchmark Procedure

Run baseline runtime benchmark:

```bash
f bench-ai-runtime --iterations 80 --warmup 10 --json-out /tmp/flow_ai_runtime.json
```

This includes:

- `moon_run_noop`
- `cached_noop`
- `daemon_cached_noop`
- `cached_binary_direct`
- `daemon_client_noop` (if `ai-taskd-client` binary is present)

For focused hot-loop comparisons:

```bash
python3 - <<'PY'
import subprocess,time,statistics
from pathlib import Path
root=Path('~/code/flow').expanduser()
cases=[
 ('f_daemon',['./target/debug/f','tasks','run-ai','--daemon','ai:flow/noop']),
 ('fai',['fai','ai:flow/noop']),
 ('f_cached',['./target/debug/f','ai:flow/noop']),
]
for name,cmd in cases:
  xs=[]
  for i in range(60):
    t0=time.perf_counter()
    p=subprocess.run(cmd,cwd=root,stdout=subprocess.DEVNULL,stderr=subprocess.DEVNULL)
    dt=(time.perf_counter()-t0)*1000
    if p.returncode!=0: raise SystemExit((name,p.returncode))
    if i>=10: xs.append(dt)
  xs=sorted(xs)
  pct=lambda p: xs[int((len(xs)-1)*p)]
  print(name,'p50',round(pct(0.5),2),'p95',round(pct(0.95),2),'mean',round(statistics.mean(xs),2))
PY
```

---

## 7. Operational Recommendations

Use this default profile for lowest latency:

```bash
export FLOW_AI_TASK_DAEMON=1
export FLOW_AI_TASK_FAST_CLIENT=1
export FLOW_AI_TASK_FAST_SELECTORS='ai:flow/*'
f tasks daemon start
```

Then:

- latency-critical loops: `fai ai:...`
- normal dev ergonomics: `f ai:...` (auto fast-client when selectors match)

---

## 8. Troubleshooting

### `fai` says cannot connect to socket

Start daemon:

```bash
f tasks daemon start
```

Check:

```bash
f tasks daemon status
ls -l ~/.flow/run/ai-taskd.sock
```

Or install persistent daemon:

```bash
f ai-taskd-launchd-install
```

### Task not found with `fai`

Use full selector:

```bash
f tasks list | rg '^ai:'
fai ai:flow/dev-check
```

### Latency suddenly regressed

Check:

```bash
ps -Ao pcpu,pmem,comm | sort -k1 -nr | head -n 20
f tasks daemon status
```

Then rerun benchmark with warmup.

### Need strict correctness instead of lowest overhead

Use `--capture-output` on `fai` for output-capture parity.

### Need in-daemon stage attribution for profiling

```bash
fai --timings ai:flow/noop
FLOW_AI_TASKD_TIMINGS_LOG=1 f tasks daemon serve
```

---

## 9. Implemented Optimization Set

Implemented in this iteration:

1. always-on daemon support via launchd tasks (`ai-taskd-launchd-*`)
2. binary request framing support (`msgpack`) in `fai` + `ai-taskd`
3. pooled client burst mode via `fai --batch-stdin`
4. per-request stage timings exposed via `fai --timings` and daemon timing logs

Potential next frontier:

1. keep a persistent client-side socket session with framed multi-request protocol
2. add lock-free shared-memory ring for local burst dispatch if socket overhead becomes dominant
3. push per-stage timing aggregation into benchmark JSON outputs for automatic regression gating


================================================
FILE: docs/ai-traces.md
================================================
# AI Traces (Flow)

Use this doc when collecting context for debugging or development work in `~/code/flow`.
The goal is to keep trace collection low overhead while still capturing enough signal for fast fixes.

## Quick start

- Proxy traces summary:
  - `~/.config/flow/proxy/trace-summary.json`
- Last trace event (CLI):
  - `f proxy last`
- Stream traces (CLI):
  - `f proxy trace`

## Trace sources

- **Proxy ring buffer summary**
  - Path: `~/.config/flow/proxy/trace-summary.json`
- **Fish shell IO traces**
  - Path: `${XDG_DATA_HOME:-~/.local/share}/fish/io-trace/last.meta`
  - Command: `fish-trace last`

## When to use which

- Start with the summary file to find errors/slow requests.
- Use `f proxy last` when you need the newest request details.
- Use `f proxy trace` to tail a stream during repro.

## Safety notes

- Summary parsing is cheap and safe to run anytime.
- If proxy is not running, `f proxy` commands will fail; fall back to the summary file and fish traces.

## Skills + harness loading

Codex skills are discovered from `~/.codex/skills` and injected by the AI harness.
If a new skill was added or edited, restart the agent or re-list skills to refresh.
This repo ships trace guidance via the `flow-dev-traces` skill.


================================================
FILE: docs/anonymous-telemetry-contract.md
================================================
# Anonymous Telemetry Contract (Flow CLI)

Flow emits anonymous command telemetry for product/training quality when analytics is enabled.

## Event

- `type`: `flow.command.v1`
- `schema_version`: `1`
- `event_id`: UUID
- `name`: normalized command path (for unknown commands: `task-shortcut`)
- `ok`: command success
- `at`: event timestamp (ms)
- `source`: `flow-cli`
- `payload`:
  - `anon_user_id` (rotates every 30 days)
  - `project_fingerprint` (rotates every 30 days)
  - `command_path`
  - `success`
  - `exit_code` (currently null)
  - `duration_ms`
  - `flags_used`
  - `flow_version`
  - `os`
  - `arch`
  - `interactive`
  - `ci`

## Privacy Guarantees

- No usernames/emails.
- No prompts/assistant messages.
- No file contents.
- No absolute paths (project fingerprint is HMAC-based and rotated).
- No stable raw install identifier in payload.

## Endpoint

Default endpoint:

`https://api.myflow.sh/api/telemetry/flow`

Can be overridden in `flow.toml`:

```toml
[analytics]
endpoint = "https://api.myflow.sh/api/telemetry/flow"
enabled = true
sample_rate = 1.0
```


================================================
FILE: docs/ascii-commit-visualization-pipeline.md
================================================
# ASCII Commit Visualization Pipeline

This explains how commit analysis data becomes ASCII-style diagrams in myflow.

Scope:

- generation and storage in Flow
- API serving via Flow server
- runtime diagram rendering in myflow via `box-of-rain`

---

## 1. Commit Analysis Generation

Flow generates commit explanations with:

```bash
f explain-commits 3 --force
```

Implementation:

- `src/explain_commits.rs`
- Uses `ai-task.sh` with provider/model fixed to Kimi defaults (`nvidia` + `moonshotai/kimi-k2.5`).
- For each commit, Flow gathers:
  - `sha`, `short_sha`, `subject`, `author`, `date`
  - file list from `git diff --name-only`
  - truncated diff payload (max chars guard)

Output per project (default):

- `docs/commits/<date>-<short_sha>-<slug>.md`
- `docs/commits/<date>-<short_sha>-<slug>.json`
- `docs/commits/.index.json` (digest/index cache)

Notes:

- `--force` bypasses digest skip logic.
- `--out-dir` can override default output location.

---

## 2. Storage Format

The sidecar `.json` mirrors Flow’s `ExplainedCommit` shape:

- `sha`
- `short_sha`
- `subject`
- `author`
- `date`
- `summary`
- `changes`
- `files` (array of changed file paths)
- `markdown_file`
- `generated_at`

This is the source of truth consumed by the UI.

---

## 3. API Serving Layer

Flow server exposes commit explanations over HTTP:

- `GET /projects/:name/commit-explanations?limit=50`
- `GET /projects/:name/commit-explanations/:sha`

Implementation:

- `src/log_server.rs`:
  - `project_commit_explanations`
  - `project_commit_explanation_detail`
- data loader functions are in `src/explain_commits.rs`:
  - `list_explained_commits`
  - `get_explained_commit`

---

## 4. myflow Data Consumption

myflow fetches these endpoints through `flowFetch` model atoms:

- `/projects/$project/commit-explanations`
- `/projects/$project/commit-explanations/$sha`

Model file:

- `~/code/myflow/web/lib/models/flow-projects.ts`

Relevant type:

- `FlowExplainedCommit`

---

## 5. Diagram Generation (ASCII -> SVG)

Diagram rendering is client-side in myflow and uses `box-of-rain`.

Theme/options:

- `~/code/myflow/web/lib/diagram-theme.ts`
- shared `DIAGRAM_SVG_OPTIONS`:
  - transparent background
  - mono font
  - light/dark foreground colors

### 5.1 What `box-of-rain` actually does

`box-of-rain` has two explicit stages:

1. layout stage: `render(nodeDef)`  
   Input is a graph description (`NodeDef` + `connections`).  
   Output is a multiline ASCII canvas (boxes, borders, arrows, connectors).
2. paint stage: `renderSvg(ascii, svgOptions)`  
   Input is the ASCII text grid.  
   Output is an SVG string where each character is positioned with fixed-width metrics.

Important: layout and paint are separate.  
If shape/connectors are wrong, the bug is in `NodeDef`/connections.  
If colors/spacing/fonts are wrong, the bug is in `SvgOptions`.

Core graph primitives used in myflow:

- `id`: stable node identifier for edge wiring.
- `children`: lines rendered inside a box.
- `border`: visual style (`rounded`, `bold`).
- `childDirection`: relative arrangement (`horizontal`).
- `connections`: explicit edges, each with:
  - `from`, `to`
  - `fromSide`, `toSide` (`left|right|top|bottom`).

Timeline shape (conceptual):

```text
c0 ──> c1 ──> c2
```

Files impact shape (conceptual):

```text
commit ──> dirA
commit ──> dirB
commit ──> dirC
```

### Timeline diagram

File:

- `~/code/myflow/web/lib/commit-timeline-diagram.tsx`

Algorithm:

1. take up to 8 newest commits
2. reverse to oldest -> newest
3. build one rounded node per commit:
   - line 1: `short_sha`
   - lines 2+: truncated subject (2 lines max)
4. connect node `i -> i+1` (right to left sides)
5. render:
   - `render(nodeDef)` -> ASCII layout
   - `renderSvg(ascii, DIAGRAM_SVG_OPTIONS)` -> SVG
6. inject SVG into DOM with `dangerouslySetInnerHTML`

Conceptual `NodeDef` sketch:

```ts
{
  children: [
    { id: "c0", border: "rounded", children: ["2daa3fd", "feat: sub-agent"] },
    { id: "c1", border: "rounded", children: ["f298c48", "memories rollout"] },
  ],
  childDirection: "horizontal",
  connections: [{ from: "c0", to: "c1", fromSide: "right", toSide: "left" }],
}
```

Mounted at:

- `~/code/myflow/web/pages/flow/$project/index.tsx`

### Files impact diagram

File:

- `~/code/myflow/web/lib/files-impact-diagram.tsx`

Algorithm:

1. group `commit.files` by top path bucket:
   - first 2 segments when possible
2. create bold commit node
3. create one rounded directory node per group:
   - dir label
   - up to 3 file names
   - `+N more` overflow line
4. connect `commit -> each_dir`
5. render ASCII then SVG with same theme options

Conceptual `NodeDef` sketch:

```ts
{
  children: [
    { id: "commit", border: "bold", children: ["2daa3fd", "feat: sub-agent"] },
    { id: "d0", border: "rounded", children: ["codex-rs/core/", "  agent.rs", "  mod.rs"] },
  ],
  childDirection: "horizontal",
  connections: [{ from: "commit", to: "d0", fromSide: "right", toSide: "left" }],
}
```

Mounted at:

- `~/code/myflow/web/pages/flow/$project/commit/$sha.tsx`

---

## 6. Performance and Limits

- both diagram components are wrapped in `useMemo`
- timeline hard limit: 8 commits
- subject lines are truncated for stable node widths
- files list per group is capped in-node (full list still shown below diagram)

---

## 7. Common Failure Modes

1. No commit data:
   - run `f explain-commits N` in the target repo
2. API empty:
   - ensure Flow server is running (`f server`)
   - ensure project is registered in Flow
3. Diagram package missing:
   - ensure `box-of-rain` dependency resolves in myflow runtime build
4. BetterAuth `/api` base URL error in browser:
   - use absolute URL normalization in `web/lib/auth-client.ts` (relative `/api` alone is invalid for BetterAuth client config)

---

## 8. Quick End-to-End Check

From target repo (example: codex):

```bash
cd ~/repos/openai/codex
f explain-commits 3 --force
```

From Flow:

```bash
f server --host 127.0.0.1 --port 9050
curl 'http://127.0.0.1:9050/projects/codex/commit-explanations?limit=3'
```

Then open myflow:

- project view: `/flow/codex`
- commit view: `/flow/codex/commit/<sha>`


================================================
FILE: docs/bench/cli-startup.md
================================================
# Flow CLI Startup Benchmark

Use this to measure cold-ish user-facing Flow latency on cheap commands that should stay fast.

## Run

```bash
f bench-cli-startup
```

Useful knobs:

```bash
f bench-cli-startup -- --iterations 30 --warmup 5
f bench-cli-startup -- --flow-bin ./target/release/f
f bench-cli-startup -- --json-out out/bench/cli-startup.json
```

## What it measures

- `f --help`
- `f --help-full`
- `f info`
- `f projects`
- `f analytics status`
- `f tasks list`
- `f tasks dupes`

The script forces:

- `CI=1`
- `FLOW_ANALYTICS_DISABLE=1`

That keeps the benchmark focused on Flow startup and command dispatch instead of analytics prompts.

## Readouts to track

- `p50_ms`
- `p95_ms`
- `p99_ms`
- `mean_ms`

For startup work, keep the policy simple:

- optimize only if median improves
- reject changes that materially regress `p95`
- benchmark from the same binary and same repo fixture

## Why these commands

These commands are the best early signal for startup overhead because they are local, cheap, non-interactive, and sensitive to unnecessary pre-dispatch work such as eager secrets loading and auto skill sync.


================================================
FILE: docs/bench/moonbit-rust-ffi-boundary.md
================================================
# MoonBit <-> Rust FFI Boundary Benchmark

This benchmark measures raw call overhead between MoonBit (native C backend) and Rust host functions.

## Scope

Measured:
- Rust local math baseline (`rust_inline_add`, `rust_fn_add`)
- Rust calling exported C ABI functions (`rust_extern_add`, `rust_extern_noop`)
- MoonBit calling Rust-exported C ABI (`moon_ffi_add`, `moon_ffi_noop`)

Not measured:
- app-level task execution
- process startup/teardown
- end-to-end Flow command latency

## Where the code lives

- `bench/ffi_host_boundary/src/lib.rs`
- `bench/ffi_host_boundary/src/bin/rust_boundary_bench.rs`
- `bench/moon_ffi_boundary/main.mbt`
- `bench/moon_ffi_boundary/moon.pkg.template.json`
- `scripts/bench-moonbit-rust-ffi.py`
- Flow task: `bench-ffi-boundary` in `flow.toml`

## Run commands

Direct script:

```bash
cd ~/code/flow
python3 scripts/bench-moonbit-rust-ffi.py --iters 10000000 --json-out /tmp/ffi.json
```

With machine-local tuning flags:

```bash
cd ~/code/flow
python3 scripts/bench-moonbit-rust-ffi.py --iters 10000000 --native-opt --json-out /tmp/ffi_native.json
```

Via Flow:

```bash
cd ~/code/flow
f bench-ffi-boundary --iters 10000000 --json-out /tmp/ffi_flow.json
```

## Latest measured numbers (this machine)

Method: 3 rounds each, 10M iterations/round, median ns/op.

| metric | baseline | native-opt | tuned/base |
|---|---:|---:|---:|
| rust_extern_add | 2.7683 | 2.8291 | 1.022x |
| rust_extern_noop | 2.7880 | 2.9140 | 1.045x |
| moon_ffi_add | 0.9005 | 1.1075 | 1.230x |
| moon_ffi_noop | 0.8576 | 0.8462 | 0.987x |

Interpretation:
- Boundary overhead is single-digit nanoseconds.
- On this machine, `--native-opt` did not consistently improve results; it was mixed/slightly worse for most metrics.
- You must benchmark on your target machine before locking optimization flags.

## Important measurement caveat

`moon_add` (pure MoonBit loop) can be optimized away by the compiler and report `0 ns`. Treat it as non-authoritative for boundary decisions.

Use FFI metrics (`moon_ffi_*`, `rust_extern_*`) as the primary signal.

## Optimizations implemented

1. Exported host functions stripped to minimal arithmetic (removed internal `black_box`).
2. Rust FFI functions marked `#[inline(never)]` to avoid accidental inlining in host-side tests.
3. Rust bench crate release profile tightened:
   - `lto = "fat"`
   - `codegen-units = 1`
   - `panic = "abort"`
   - `strip = true`
4. Moon native flags are configurable via template placeholder:
   - `cc-flags` in `moon.pkg.template.json`
5. Benchmark script supports `--native-opt`:
   - Rust: `RUSTFLAGS=-C target-cpu=native`
   - Moon native: `-O3 -march=native -mtune=native`

## Ideas borrowed from Moon toolchain

From `~/repos/moonbitlang/moon`:
- `Cargo.toml` uses explicit release profile controls (`lto`, `codegen-units`, `strip`) for predictable build/runtime tradeoffs.
- Native pipeline exposes per-package `cc-flags` / `cc-link-flags` (schema in `crates/moonbuild/template/pkg.schema.json`).
- TCC-run mode exists to speed dev-time run loops, not runtime performance; custom native flags disable that fast dev path.

Practical implication:
- For runtime benchmarks, tune native flags carefully and measure.
- For developer iteration speed, avoid unnecessary custom flags when tcc-run is beneficial.

## Decision guidance: should Rust core move to MoonBit for speed?

Based on these numbers: no, not for boundary speed alone.

Reason:
- Boundary is already near-zero cost (sub-3ns on this host).
- Any wins from migration will mostly come from architecture choices (fewer crossings, coarser APIs), not language-switch micro-optimizations.

Move code to MoonBit for:
- faster iteration/modeling
- portability or generation benefits
- maintainability

Keep in Rust when:
- syscall-heavy paths
- mature unsafe/perf-critical internals already stable

## Next benchmark to add (recommended)

Add a coarse-grained benchmark for real task payload crossing:
- one boundary call carrying a packed command
- compare against N tiny calls
- report payload sizes and p50/p95

That will better predict real Flow task runtime behavior than arithmetic no-op microbenchmarks.


================================================
FILE: docs/bench/readme.md
================================================
# Bench Docs

- `moonbit-rust-ffi-boundary.md`: raw MoonBit <-> Rust boundary benchmark, commands, results, and optimization guidance.
- `cli-startup.md`: repeatable benchmark for Flow CLI startup and cheap read-only command latency.


================================================
FILE: docs/ci-cd-runbook.md
================================================
# Flow CI/CD Runbook

This runbook documents how Flow CI/CD is wired today and how to debug it quickly when jobs fail.

## Architecture

- Workflows:
  - `.github/workflows/pr-fast.yml`: fast PR gate (Linux) using vendored hydrate + `cargo check`.
  - `.github/workflows/canary.yml`: runs on every push to `main`, publishes/updates the `canary` release/tag.
  - `.github/workflows/nightly-validation.yml`: scheduled full cross-target validation (plus host SIMD) without publishing.
  - `.github/workflows/release.yml`: runs on tag pushes matching `v*`, publishes stable releases.
- Trigger optimization:
  - Canary `push` skips docs-only changes (`docs/**`, `**/*.md`).
  - Use `workflow_dispatch` to force a Canary run when needed after docs-only changes.
- Vendored deps bootstrap:
  - Both workflows run `scripts/vendor/vendor-repo.sh hydrate` immediately after checkout in each build job.
  - This materializes `lib/vendor/*` from the pinned commit in `vendor.lock.toml` before Cargo builds.
  - Build jobs cache vendor checkout/materialization (`.vendor/flow-vendor`, `lib/vendor`, `lib/vendor-manifest`) keyed by `vendor.lock.toml`.
- Repository policy checks:
  - CI enforces lowercase `readme.md` naming via `scripts/ci/check-readme-case.sh`.
- Build jobs in both workflows:
  - Matrix build: macOS + Linux targets.
  - SIMD build: `build-linux-host-simd` (Linux x64 with `--features linux-host-simd-json`).
  - CI builds `--bin f` only (release artifacts package `f`; avoids duplicate `flow` alias build cost).
- Release jobs:
  - Gather all build artifacts.
  - Publish release assets (and in Canary, force-move `canary` tag to current `main` commit).
  - `release` waits for both `build` and `build-linux-host-simd`.

## Runner Modes

Flow uses task-driven mode switching (not manual workflow edits):

- `github` mode:
  - Standard Linux lanes on `ubuntu-latest`.
  - SIMD lane disabled.
- `blacksmith` mode:
  - Linux lanes on Blacksmith runners.
  - SIMD lane enabled on Blacksmith.
- `host` mode:
  - Standard Linux lanes stay on GitHub-hosted runners.
  - SIMD lane runs on self-hosted label: `[self-hosted, linux, x64, ci-1focus]`.

Check/switch mode:

```bash
f ci-blacksmith-status
f ci-blacksmith-enable
f ci-blacksmith-enable-apply
f ci-host-enable
f ci-host-enable-apply
f ci-blacksmith-disable
f ci-blacksmith-disable-apply
```

## One-Command Host Setup

Preferred path (painless, idempotent):

```bash
f ci-host-setup
```

If infra host is not configured yet:

```bash
f ci-host-setup <user@ip>
```

What `f ci-host-setup` does:

1. Validates `gh` auth and `infra` host config.
2. Installs/registers the `ci-1focus` self-hosted runner on the Linux host.
3. Waits for runner to report online.
4. Switches workflows to `host` mode with commit + push.
5. Prints final runner health/status.

## Daily Operations

- Check current mode: `f ci-blacksmith-status`
- Check runner service + GitHub registration: `f ci-host-runner-status`
- Reinstall runner if needed: `f ci-host-runner-install`
- Remove runner: `f ci-host-runner-remove`

Stable release flow:

1. Merge version bump to `main`.
2. Push tag `vX.Y.Z`.
3. Watch `Release` workflow.

Canary flow:

1. Push to `main`.
2. Watch `Canary` workflow.
3. Confirm `canary` tag moved and release assets updated.

PR flow:

1. Open/refresh PR to `main`.
2. Watch `PR Fast Check` (`cargo check` + `cargo test --no-run` shard).
3. Merge only after fast check passes.

## Debug Playbook

### 1) Workflow failed or stuck

```bash
gh run list --workflow Canary --limit 10
gh run list --workflow Release --limit 10
gh run view <run-id> --log-failed
gh run watch <run-id>
```

If failure shows:

- `failed to load source for dependency 'axum'`
- `Unable to update .../lib/vendor/axum`
- `No such file or directory (os error 2)`

then vendored deps were not hydrated before build.

### 2) SIMD lane queued forever

Usually means self-hosted runner routing issue.

```bash
f ci-blacksmith-status
f ci-host-runner-status
python3 ./scripts/ci_host_runner.py health --repo nikivdev/flow
```

Expected healthy state is:

- Host service: `active`
- GitHub runner status: `online`
- Runner has label `ci-1focus`

If not healthy, run:

```bash
f ci-host-runner-install
python3 ./scripts/ci_host_runner.py wait-online --repo nikivdev/flow --timeout-secs 120 --interval-secs 5
```

### 3) Workflows not using expected runner profile

```bash
f ci-blacksmith-status
```

If wrong:

```bash
f ci-host-enable-apply
# or:
f ci-blacksmith-enable-apply
# or:
f ci-blacksmith-disable-apply
```

### 3b) Vendored repo hydrate issues

Hydration depends on `vendor.lock.toml` pin and vendor repo availability.

Quick checks:

```bash
scripts/vendor/vendor-repo.sh status
scripts/vendor/vendor-repo.sh hydrate
```

Expected:

- pinned commit in `vendor.lock.toml` is non-empty,
- hydrate logs `hydrated <crate> -> lib/vendor/<crate>`,
- `lib/vendor/axum/Cargo.toml` and `lib/vendor/reqwest/Cargo.toml` exist after hydrate.

If CI cannot clone SSH URL from lock, `vendor-repo.sh` now falls back to HTTPS clone for GitHub URLs.

### 4) `curl ... install.sh` does not fetch expected fresh build

Flow installer defaults to `canary` unless `FLOW_VERSION` is set differently. Check if `canary` moved:

```bash
git ls-remote --tags origin canary
```

Then verify in sandbox (recommended) using:

- `docs/rise-sandbox-feature-test-runbook.md`

That runbook gives an isolated `rise sandbox` smoke test for:

```bash
curl -fsSL https://myflow.sh/install.sh | sh
~/.flow/bin/f --version
```

### 5) Setup task fails mid-install

Re-run:

```bash
f ci-host-setup
```

The installer path is idempotent (it removes old service/config before re-registering). If failure persists, inspect:

```bash
f ci-host-runner-status
gh api repos/nikivdev/flow/actions/runners
```

## Notes

- CI/CD execution is defined in repo workflows; GitHub UI is control plane/visibility (runs, logs, runner state), not the source of truth for pipeline logic.
- Current performance balance: keep general Linux matrix jobs on GitHub-hosted runners, offload expensive SIMD build to the Linux host.


================================================
FILE: docs/codex-first-control-plane-roadmap.md
================================================
# Codex-First Control Plane Roadmap

This document proposes how Flow should evolve from "helpful CLI + local skills"
into a Codex-first control plane where the user stays inside Codex and Flow
handles routing, memory, execution, and learning behind the scenes.

## Goal

Target state:

- the user speaks natural intent in Codex
- Flow resolves references, routes workflows, fetches secure context, and runs
  the right tool/task
- Codex sees only the smallest useful context for the current turn
- repeated phrasing becomes reusable system knowledge without turning every repo
  preamble into a wall of rules

Example desired behavior:

- `document it` resolves to the docs write flow
- a pasted Linear URL is unrolled before planning
- `continue the last deploy investigation` finds the right session/worktree
- the user does not need to remember `forge doc`, `forge linear inspect`, or
  repo-specific wrappers

## Problem

Current Flow has strong building blocks but they are still separate:

- task skills are generated and reloaded for Codex
- sessions are stored and recoverable
- env storage is becoming secure enough for org use
- router telemetry already exists
- repo-specific systems like Forge can mine aliases and inject lean workflow
  rules

But the user still pays too much cognitive cost:

- wrappers like `L` and repo-specific launchers carry logic outside Flow
- repo preambles grow whenever a new shortcut is taught
- skill learning is mostly manual
- URL/reference unrolling is repo-specific instead of generic
- Codex app-server connections are process-per-query in some paths

The result is "good pieces, weak control plane".

## Design Principles

1. Flow is the control plane; repo tools remain domain executors.
2. Skills stay thin; runtime resolution carries the real behavior.
3. Reference unrolling is deterministic first, model-assisted only if needed.
4. Learning produces suggestions, not prompt bloat.
5. No default context should be paid for behavior that is not active.

## Existing Flow Building Blocks

- task-synced Codex skill metadata in [src/skills.rs](/Users/nikitavoloboev/code/flow/src/skills.rs#L378) and [src/skills.rs](/Users/nikitavoloboev/code/flow/src/skills.rs#L443)
- Codex skill cache reload in [src/skills.rs](/Users/nikitavoloboev/code/flow/src/skills.rs#L1224)
- configurable Codex wrapper transport in [src/commit.rs](/Users/nikitavoloboev/code/flow/src/commit.rs#L5414)
- multi-provider session recovery and copy flows in [src/ai.rs](/Users/nikitavoloboev/code/flow/src/ai.rs#L1)
- router telemetry hooks in [src/rl_signals.rs](/Users/nikitavoloboev/code/flow/src/rl_signals.rs#L307)
- current Codex session resolver direction in [codex-openai-session-resolver.md](/Users/nikitavoloboev/code/flow/docs/codex-openai-session-resolver.md#L1)

These are enough to start. The missing work is unification.

## Constraint: no Codex fork

Flow should target current upstream Codex directly.

That means:

- prefer wrapper transport + config over patching Codex
- use stable upstream surfaces like normal user skill roots, `skills/list`, and `thread/*`
- treat newer upstream features such as `skills/list perCwdExtraUserRoots` and in-process app-server clients as accelerators, not prerequisites
- keep repo-specific behavior in Flow or repo executors, not in a private Codex fork

## Proposed Architecture

### 1. warm Codex control layer

Add a Flow-managed warm control layer, either as an extension of `ai-taskd`, a
focused `codexd`, or a lighter in-process broker where that is enough for the
current upstream Codex client surface.

Responsibilities:

- maintain repo-scoped Codex app-server sessions
- cache recent threads, active skills, and repo metadata
- expose fast local RPC for lookup, runtime-skill injection, and doctor output
- resolve references before they reach Codex as plain text
- own the "what extra context is actually needed for this turn?" decision

This should absorb behavior that currently lives in wrappers like `L`.

### 2. Intent registry

Promote Forge-style phrase aliasing into Flow as a generic feature.

Each intent has:

- canonical name
- phrase aliases
- optional repo/path scope
- resolver/action target
- confidence policy
- evidence counters for suggested future aliases

Examples:

- `doc-it`
- `linear-reference`
- `session-recover`
- `review-intent-comment`

Intent matching must stay deterministic and cheap.

### 3. Reference resolvers

Flow should ship a generic resolver layer for pasted references:

- Linear issue URLs
- Linear project URLs
- GitHub PR / issue URLs
- repo file paths
- commit SHAs
- saved Flow session names or IDs

Resolvers return structured payloads, not prose. Repo-local executors like
Forge can register resolver commands for domain-specific expansion.

### 4. Runtime skills

Split Codex knowledge into two layers:

- baseline skills: always available, minimal repo guidance
- runtime skills: ephemeral, injected only when a matched intent or resolver
  requires them

Examples:

- user says `document it`
  - inject tiny docs-routing runtime skill
- user pastes a Linear URL
  - inject tiny linear-unrolled runtime context
- user asks to recover recent work
  - inject session-recovery runtime context only for that request

Runtime skills should expire automatically and be bounded by a strict budget.

### 5. Suggestion loop, not self-bloating memory

Use router telemetry plus transcript mining to propose:

- new aliases
- new reference patterns
- candidate runtime skills
- stale skills that should be removed

Important:

- do not auto-install every observed phrase
- require evidence thresholds
- prefer suggested changes that collapse multiple variants into one canonical
  intent

## Flow Commands

Add a small command family around the new control plane:

```bash
f codex open [query]
f codex resolve "<text-or-url>" [--json]
f codex runtime
f codex runtime show
f codex runtime clear
f codex teach suggest
f codex teach accept <intent-or-suggestion-id>
f codex teach reject <intent-or-suggestion-id>
f codex doctor
f codexd start|stop|status
```

Intended behavior:

- `f codex open` replaces personal wrappers like `L`
- `f codex resolve` shows what Flow would unroll or route before Codex sees it
- `f codex runtime show` explains which runtime skills/context are active
- `f codex teach suggest` presents evidence-backed alias/intent suggestions
- `f codex doctor` exposes repo path, active app-server connection, runtime
  budget, skill count, and recent resolver hits

## Config Shape

Proposed `flow.toml` additions:

```toml
[codex]
control_plane = "daemon"
warm_app_server = true
runtime_skill_budget_chars = 1200
auto_resolve_references = true
auto_learn = "suggest-only"

[codex.session]
open_command = "codex"
prefer_last_active = true
repo_scoped_lookup = true

[[codex.intent]]
name = "doc-it"
phrases = ["doc it", "document it", "write this down", "save this in docs"]
resolver = "docs.route_write"
scope = ["repo", "personal"]

[[codex.intent]]
name = "session-recover"
phrases = ["what was i doing", "recover recent context", "continue the work"]
resolver = "session.recover"

[[codex.reference_resolver]]
name = "linear"
match = ["https://linear.app/*/issue/*", "https://linear.app/*/project/*"]
command = "forge linear inspect {{ref}} --json"
inject_as = "linear"

[[codex.reference_resolver]]
name = "docs"
match = ["doc it", "document it"]
command = "forge doc route --title {{title}} --json"
inject_as = "docs"
```

Also add a personal/global config file for user-specific phrase preferences:

- `~/.config/flow/codex-intents.toml`

Use this for personal language variants that should not live in repo config.

## Daemon Responsibilities

`codexd` should own:

- app-server lifecycle
- repo session caches
- runtime skill activation/deactivation
- resolver execution
- secure env lookups for active workflows
- bounded prompt-context assembly
- suggestion generation from telemetry/history
- compatibility with existing `f skills reload` and `f ai codex ...` flows

It should not:

- replace repo-specific executors like Forge
- run opaque model-based routing in the hot path
- inject large transcript summaries into every turn

## Prompt Budget Policy

The runtime layer needs hard limits:

- baseline repo guidance stays small
- runtime additions must fit a bounded char/token budget
- each resolved intent/reference should justify its own inclusion
- unused runtime skills expire quickly

Budget policy should prefer:

1. structured resolver output
2. one tiny runtime skill
3. one short recovery summary
4. nothing else

## Learning Loop

Inputs:

- router telemetry
- accepted/overridden task choices
- resolver hits
- successful tool invocations
- session transcript mining

Outputs:

- proposed alias additions
- proposed resolver registrations
- dead-skill cleanup suggestions
- better default repo baselines

Approval model:

- repo suggestions require explicit accept
- personal suggestions can default to personal scope
- org/shared suggestions should stay gated

## Relationship To Forge

Forge should remain the Prom executor for Prom-specific workflows.

Flow should absorb the generic pieces Forge proved useful:

- intent aliasing
- reference unrolling
- thin runtime teaching
- lean docs workflow activation

That means:

- Prom keeps `forge linear inspect`, `forge doc`, and similar domain commands
- Flow becomes the generic router that decides when to call them

## Rollout Phases

### Phase 0: unify wrappers

- move `L`-style session open/recover behavior into `f codex open`
- make repo-scoped Codex session resolution first-class
- expose a `doctor` view for current skill/runtime state

### Phase 1: warm daemon

- add `codexd` with persistent app-server connection per repo
- keep recent thread cache and skills cache warm
- remove process-per-query overhead for session lookup/reload paths

### Phase 2: intent registry + resolvers

- add config-backed intent aliases
- add generic reference resolver interface
- ship built-ins for session recovery, docs routing, and Linear URLs

### Phase 3: runtime skills

- inject temporary runtime skills/context instead of growing repo preambles
- enforce runtime budget caps
- surface active runtime state in `f codex runtime show`

### Phase 4: learning loop

- mine telemetry + sessions for candidate aliases and resolver patterns
- generate suggestions only after evidence thresholds
- add accept/reject workflow

### Phase 5: provider expansion

- reuse the same intent/resolver plane for Claude and Cursor transcript-backed
  workflows where useful
- keep Codex as the first-class interactive target

## First Implementation Slice

The highest-value first slice is:

1. `f codex open`
2. `codexd` with warm repo-scoped app-server
3. `f codex resolve`
4. config-backed intents
5. built-in resolvers for:
   - docs intents
   - Linear URLs
   - session recovery prompts
6. `f codex runtime show`

Why this first:

- it removes the most command-memory burden immediately
- it uses Flow’s existing app-server + skills + session foundations
- it keeps the prompt surface thin
- it gives a concrete place to move personal wrapper logic

## Success Metrics

- p50 `f codex open` latency
- number of user prompts that required remembering a repo command
- average runtime-context bytes injected per turn
- resolver hit rate
- accepted suggestion rate
- count of active baseline skills versus runtime skills

## Non-Goals

- full semantic agent routing in the hot path
- unbounded transcript mining into prompt context
- replacing repo executors with Flow clones
- auto-learning every phrase without evidence or approval

## Summary

The target system is not "more AGENTS text" and not "more commands for the
user to remember".

It is:

- thin baseline repo guidance
- a warm Flow Codex control daemon
- deterministic intent/reference resolution
- ephemeral runtime skills
- evidence-backed learning with approval

That is how Flow becomes truly Codex-first while keeping context cost low.


================================================
FILE: docs/codex-fork-tasks.md
================================================
# Codex Fork Tasks

These Flow tasks automate the personal Codex fork workflow described in:

- `~/docs/codex/codex-fork-home-branch-workflow.md`

They are intentionally narrow:

- keep `~/repos/openai/codex` as the upstream reference checkout
- keep `~/repos/nikivdev/codex` as the fork home checkout
- create one stable worktree per real fork task under `~/.worktrees/codex`
- attach Codex sessions to that worktree instead of to one drifting checkout

## Commands

Run these from `~/code/flow`:

```bash
cd ~/code/flow
f codex-fork-status
f codex-fork-sync
f codex-fork-task "add workspace ref to the footer"
f codex-fork-last
f codex-fork-promote --push
```

If you are outside `~/code/flow`, use the explicit config form:

```bash
flow run --config ~/code/flow/flow.toml codex-fork-task "add workspace ref to the footer"
```

## What Each Task Does

### `f codex-fork-status`

Shows:

- the upstream reference checkout
- the personal fork home checkout
- the current `nikiv`, `upstream/main`, and `private/nikiv` refs
- existing fork worktrees
- the last worktree used by the helper

Use this first when the fork state is unclear.

### `f codex-fork-sync`

Fast-forwards `nikiv` in `~/repos/nikivdev/codex` to `upstream/main`.

Optional push:

```bash
f codex-fork-sync --push
```

Safety rule:

- it refuses to run if the fork home checkout is dirty

### `f codex-fork-task "<query>"`

This is the main entry point.

It:

1. derives a branch like `codex/<slug>`
2. creates or reuses `~/.worktrees/codex/<branch-name-with-slashes-rewritten>`
3. records that worktree as the "last fork worktree"
4. resumes the last Codex session in that worktree if one exists
5. otherwise starts a fresh Codex session there with an initial prompt that points at the fork workflow doc

Examples:

```bash
f codex-fork-task "add workspace ref to the footer"
f codex-fork-task "thread name startup" --branch codex/thread-name-startup
f codex-fork-task "statusline workspace ref" --no-launch
```

### `f codex-fork-last`

Resumes `codex resume --last` in the last worktree created or used by the helper.

This is the closest current Flow equivalent to binding a key that reattaches to the last active fork session.

You can also target a branch or path explicitly:

```bash
f codex-fork-last codex/workspace-awareness
f codex-fork-last ~/.worktrees/codex/codex-workspace-awareness
```

### `f codex-fork-promote`

Creates or updates a review branch from the current task worktree tip.

Default mapping:

- `codex/workspace-awareness` -> `review/nikiv-workspace-awareness`

Examples:

```bash
f codex-fork-promote
f codex-fork-promote codex/workspace-awareness --push
f codex-fork-promote ~/.worktrees/codex/codex-workspace-awareness --review-branch review/nikiv-codex-workspace-awareness
```

## State File

The helper records the last used worktree in:

```text
~/.flow/codex-fork/last-worktree.txt
```

That is what powers `f codex-fork-last`.

## Environment Overrides

If you want the helper to point somewhere else, override these env vars:

- `FLOW_CODEX_UPSTREAM_CHECKOUT`
- `FLOW_CODEX_FORK_HOME`
- `FLOW_CODEX_WORKTREE_ROOT`
- `FLOW_CODEX_WORKFLOW_DOC`
- `FLOW_CODEX_FORK_STATE_DIR`
- `FLOW_CODEX_FORK_BASE_BRANCH`
- `FLOW_CODEX_FORK_PRIVATE_REMOTE`
- `FLOW_CODEX_FORK_UPSTREAM_REMOTE`
- `FLOW_CODEX_FORK_UPSTREAM_BRANCH`


================================================
FILE: docs/codex-maple-telemetry-runbook.md
================================================
# Codex Maple Telemetry Runbook

Use this when you want shared analytics for Flow-guided Codex usage without
changing the local source of truth.

## What T
Download .txt
gitextract_aj30rg7u/

├── .ai/
│   ├── agents.md
│   ├── docs/
│   │   ├── .last_sync
│   │   ├── architecture.md
│   │   ├── changelog.md
│   │   └── commands.md
│   ├── flox/
│   │   └── manifest.toml
│   ├── health-checks.json
│   ├── recipes/
│   │   └── project/
│   │       ├── bootstrap-core-tools.md
│   │       ├── install-rise-auto.md
│   │       ├── installer-smoke-sh.md
│   │       ├── release-core-toolchain.md
│   │       ├── release-flow-registry.md
│   │       ├── release-rise-registry.md
│   │       └── release-seq-registry.md
│   ├── repos.toml
│   ├── tasks/
│   │   └── flow/
│   │       ├── bench-cli/
│   │       │   ├── main.mbt
│   │       │   ├── moon.mod.json
│   │       │   └── moon.pkg.json
│   │       ├── dev-check/
│   │       │   ├── main.mbt
│   │       │   ├── moon.mod.json
│   │       │   └── moon.pkg.json
│   │       ├── noop/
│   │       │   ├── main.mbt
│   │       │   ├── moon.mod.json
│   │       │   └── moon.pkg.json
│   │       ├── pr-ready/
│   │       │   ├── main.mbt
│   │       │   ├── moon.mod.json
│   │       │   └── moon.pkg.json
│   │       ├── regression-smoke/
│   │       │   ├── main.mbt
│   │       │   ├── moon.mod.json
│   │       │   └── moon.pkg.json
│   │       └── release-preflight/
│   │           ├── main.mbt
│   │           ├── moon.mod.json
│   │           └── moon.pkg.json
│   └── todos/
│       └── todos.json
├── .flox.disabled
├── .github/
│   └── workflows/
│       ├── canary.yml
│       ├── nightly-validation.yml
│       ├── pr-fast.yml
│       └── release.yml
├── .gitignore
├── .goreleaser.yaml
├── .pi/
│   └── extensions/
│       └── test-extensibility.ts
├── AGENTS.md.bak
├── Cargo.toml
├── Support/
│   └── flow/
│       └── auth.toml
├── agents.md
├── bench/
│   ├── ffi_host_boundary/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       ├── bin/
│   │       │   └── rust_boundary_bench.rs
│   │       └── lib.rs
│   └── moon_ffi_boundary/
│       ├── main.mbt
│       ├── moon.mod.json
│       └── moon.pkg.template.json
├── build.rs
├── crates/
│   ├── ai_taskd_client/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       └── main.rs
│   ├── flow_commit_scan/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       └── lib.rs
│   ├── opentui-lite/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       └── lib.rs
│   ├── seq_client/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       └── lib.rs
│   └── seq_everruns_bridge/
│       ├── Cargo.toml
│       └── src/
│           ├── lib.rs
│           └── maple.rs
├── docs/
│   ├── ai-dev-layout.md
│   ├── ai-run-task-fast-path.md
│   ├── ai-task-fast-path-guide.md
│   ├── ai-traces.md
│   ├── anonymous-telemetry-contract.md
│   ├── ascii-commit-visualization-pipeline.md
│   ├── bench/
│   │   ├── cli-startup.md
│   │   ├── moonbit-rust-ffi-boundary.md
│   │   └── readme.md
│   ├── ci-cd-runbook.md
│   ├── codex-first-control-plane-roadmap.md
│   ├── codex-fork-tasks.md
│   ├── codex-maple-telemetry-runbook.md
│   ├── codex-openai-session-resolver.md
│   ├── commands/
│   │   ├── ai.md
│   │   ├── clone.md
│   │   ├── commit.md
│   │   ├── commits.md
│   │   ├── db.md
│   │   ├── deploy.md
│   │   ├── docs.md
│   │   ├── domains.md
│   │   ├── down.md
│   │   ├── env.md
│   │   ├── fast.md
│   │   ├── global.md
│   │   ├── install.md
│   │   ├── invariants.md
│   │   ├── jj.md
│   │   ├── migrate.md
│   │   ├── new.md
│   │   ├── pr.md
│   │   ├── publish.md
│   │   ├── readme.md
│   │   ├── recipe.md
│   │   ├── release.md
│   │   ├── repos.md
│   │   ├── reviews-todo.md
│   │   ├── seq-rpc.md
│   │   ├── services.md
│   │   ├── setup.md
│   │   ├── skills.md
│   │   ├── sync.md
│   │   ├── tasks.md
│   │   ├── up.md
│   │   ├── upstream.md
│   │   ├── url.md
│   │   └── web.md
│   ├── commits/
│   │   ├── .gitkeep
│   │   └── readme.md
│   ├── dependency-vendoring.md
│   ├── dev-server-management.md
│   ├── env-security-roadmap.md
│   ├── everruns-maple-runbook.md
│   ├── everruns-seq-bridge-integration.md
│   ├── fast-commit-deep-review-loop.md
│   ├── features.md
│   ├── flow-toml-spec.md
│   ├── how-api-expects-logs-errors-for-automatic-fixes.md
│   ├── how-flow-daemon-manages-macos-services.md
│   ├── how-to-make-a-project-flow-project.md
│   ├── how-to-use-flow-ai-to-manage-claude-code-sessions.md
│   ├── how-to-use-flow-to-deploy.md
│   ├── how-to-use-flow-to-store-and-work-with-env.md
│   ├── ideas.toml
│   ├── index.mdx
│   ├── install-script-latest-release-verification.md
│   ├── jj-home-branch-workflow.md
│   ├── jj-review-workspaces.md
│   ├── jj-workspaces-for-parallel-work.md
│   ├── local-domains-domainsd-cpp-spec.md
│   ├── local-domains-no-random-ports.md
│   ├── log-ingesting.md
│   ├── moonbit-ai-tasks-implementation.md
│   ├── moonbit-rust-boundary-refactor-plan.md
│   ├── moving-repos.md
│   ├── myflow-localhost-runbook.md
│   ├── new-branch.md
│   ├── new-pr.md
│   ├── outdated-readme.md
│   ├── pr-edit-watcher.md
│   ├── private-fork-flow.md
│   ├── private-mirror-sync-workflow.md
│   ├── private-repo-fast.md
│   ├── proxyx-design.md
│   ├── read-stream-of-logs.md
│   ├── rise-sandbox-feature-test-runbook.md
│   ├── rise.md
│   ├── rl-for-myflow-harbor.md
│   ├── rl-myflow-harbor-task-specs.md
│   ├── rl-signal-capture-runbook.md
│   ├── run-repos.md
│   ├── seq-agent-rpc-contract.md
│   ├── session-history-mining.md
│   ├── session-semantic-recovery-with-seq.md
│   ├── set-env-with-hive.md
│   ├── task-failure-hooks.md
│   ├── usage-analytics-rollout.md
│   ├── use-flow-to-write-software-better.md
│   ├── vendor-code-intelligence.md
│   ├── vendor-nix-inspiration.md
│   └── vendor-optimization-loop.md
├── flow.py
├── flow.toml
├── install.sh
├── lib/
│   └── vendor-manifest/
│       ├── axum.toml
│       ├── clap.toml
│       ├── crossterm.toml
│       ├── crypto_secretbox.toml
│       ├── ctrlc.toml
│       ├── futures.toml
│       ├── hmac.toml
│       ├── ignore.toml
│       ├── notify-debouncer-mini.toml
│       ├── notify.toml
│       ├── portable-pty.toml
│       ├── ratatui.toml
│       ├── regex.toml
│       ├── reqwest.toml
│       ├── rmp-serde.toml
│       ├── rusqlite.toml
│       ├── serde.toml
│       ├── sha1.toml
│       ├── sha2.toml
│       ├── tokio-stream.toml
│       ├── tokio.toml
│       ├── toml.toml
│       ├── tower-http.toml
│       ├── tracing-subscriber.toml
│       ├── url.toml
│       └── x25519-dalek.toml
├── license
├── pyproject.toml
├── readme.md
├── scripts/
│   ├── agents-switch.sh
│   ├── ai-taskd-launchd.py
│   ├── bench-ai-runtime.py
│   ├── bench-cli-startup.py
│   ├── bench-moonbit-rust-ffi.py
│   ├── build_rl_runtime_dataset.py
│   ├── cdn-nginx.conf
│   ├── check_cli_startup_thresholds.py
│   ├── check_release_tag_version.py
│   ├── ci/
│   │   └── check-readme-case.sh
│   ├── ci_blacksmith.py
│   ├── ci_host_runner.py
│   ├── ci_host_setup.sh
│   ├── cli_startup_thresholds.json
│   ├── codex-flow-wrapper
│   ├── codex-jazz-wrapper
│   ├── codex-skill-eval-launchd.py
│   ├── codex_fork.py
│   ├── deploy.sh
│   ├── deps_check.py
│   ├── generate_help_full_json.py
│   ├── install-linux-hub.sh
│   ├── install-macos-dev.sh
│   ├── install.sh
│   ├── myflow-commit-session-smoke.sh
│   ├── package-release.sh
│   ├── pre-push-guard.sh
│   ├── publish-release.sh
│   ├── release.sh
│   ├── remote-hub-setup.sh
│   ├── rl_signal_summary.py
│   ├── run-health-checks.mjs
│   ├── run-repos.sh
│   ├── setup-github-ssh.sh
│   ├── setup-release-host.sh
│   ├── sync-cdn.sh
│   ├── vendor/
│   │   ├── apply-trims.sh
│   │   ├── bench_iteration.py
│   │   ├── check-upstream.sh
│   │   ├── important-crates.txt
│   │   ├── inhouse-crate.sh
│   │   ├── materialize-all.sh
│   │   ├── offenders.sh
│   │   ├── optimize_loop.sh
│   │   ├── rough_edges_audit.py
│   │   ├── sync-all.sh
│   │   ├── sync-crate.sh
│   │   ├── trim-hooks.sh
│   │   ├── typesense_code_index.py
│   │   ├── update-deps.sh
│   │   └── vendor-repo.sh
│   └── verify-install-latest-release.sh
├── spec/
│   └── tracing-flow.md
├── src/
│   ├── activity_log.rs
│   ├── agent_setup.rs
│   ├── agents.rs
│   ├── ai.rs
│   ├── ai_context.rs
│   ├── ai_everruns.rs
│   ├── ai_server.rs
│   ├── ai_taskd.rs
│   ├── ai_tasks.rs
│   ├── ai_test.rs
│   ├── analytics.rs
│   ├── archive.rs
│   ├── ask.rs
│   ├── auth.rs
│   ├── base_tool.rs
│   ├── bin/
│   │   ├── ai_taskd_client.rs
│   │   └── lin.rs
│   ├── branches.rs
│   ├── changes.rs
│   ├── cli.rs
│   ├── code.rs
│   ├── codex_memory.rs
│   ├── codex_runtime.rs
│   ├── codex_skill_eval.rs
│   ├── codex_telemetry.rs
│   ├── codex_text.rs
│   ├── codexd.rs
│   ├── commit.rs
│   ├── commits.rs
│   ├── config.rs
│   ├── daemon.rs
│   ├── daemon_snapshot.rs
│   ├── db.rs
│   ├── deploy.rs
│   ├── deploy_setup.rs
│   ├── deps.rs
│   ├── discover.rs
│   ├── docs.rs
│   ├── doctor.rs
│   ├── domains.rs
│   ├── env.rs
│   ├── env_setup.rs
│   ├── explain_commits.rs
│   ├── ext.rs
│   ├── features.rs
│   ├── fish_install.rs
│   ├── fish_trace.rs
│   ├── fix.rs
│   ├── fixup.rs
│   ├── flox.rs
│   ├── gh_release.rs
│   ├── git_guard.rs
│   ├── gitignore_policy.rs
│   ├── hash.rs
│   ├── health.rs
│   ├── help_full.json
│   ├── help_search.rs
│   ├── history.rs
│   ├── hive.rs
│   ├── home.rs
│   ├── http_client.rs
│   ├── hub.rs
│   ├── indexer.rs
│   ├── info.rs
│   ├── init.rs
│   ├── install.rs
│   ├── invariants.rs
│   ├── jazz_state.rs
│   ├── jazz_state_stub.rs
│   ├── jj.rs
│   ├── json_parse.rs
│   ├── latest.rs
│   ├── lib.rs
│   ├── lifecycle.rs
│   ├── lmstudio.rs
│   ├── log_server.rs
│   ├── log_store.rs
│   ├── logs.rs
│   ├── macos.rs
│   ├── main.rs
│   ├── notify.rs
│   ├── opentui_prompt.rs
│   ├── otp.rs
│   ├── palette.rs
│   ├── parallel.rs
│   ├── path_hygiene.rs
│   ├── pr_edit.rs
│   ├── processes.rs
│   ├── project_snapshot.rs
│   ├── projects.rs
│   ├── proxy/
│   │   ├── mod.rs
│   │   ├── server.rs
│   │   ├── summary.rs
│   │   └── trace.rs
│   ├── publish.rs
│   ├── push.rs
│   ├── recipe.rs
│   ├── registry.rs
│   ├── release.rs
│   ├── release_signing.rs
│   ├── repo_capsule.rs
│   ├── repos.rs
│   ├── reviews_todo.rs
│   ├── rl_signals.rs
│   ├── running.rs
│   ├── screen.rs
│   ├── sealer_crypto.rs
│   ├── secret_redact.rs
│   ├── secrets.rs
│   ├── seq_client.rs
│   ├── seq_rpc.rs
│   ├── server.rs
│   ├── servers.rs
│   ├── servers_tui.rs
│   ├── services.rs
│   ├── setup.rs
│   ├── skills.rs
│   ├── ssh.rs
│   ├── ssh_keys.rs
│   ├── start.rs
│   ├── storage.rs
│   ├── supervisor.rs
│   ├── sync.rs
│   ├── task_failure_agents.rs
│   ├── task_match.rs
│   ├── tasks.rs
│   ├── terminal.rs
│   ├── todo.rs
│   ├── tools.rs
│   ├── trace.rs
│   ├── traces.rs
│   ├── traces_stub.rs
│   ├── undo.rs
│   ├── upgrade.rs
│   ├── upstream.rs
│   ├── url_inspect.rs
│   ├── usage.rs
│   ├── vcs.rs
│   ├── watchers.rs
│   ├── web.rs
│   └── workflow.rs
├── test-extension.md
├── tests/
│   ├── deps.ts
│   └── test_log_server.ts
├── tools/
│   └── domainsd-cpp/
│       ├── domainsd.cpp
│       ├── install-macos-launchd.sh
│       ├── readme.md
│       └── uninstall-macos-launchd.sh
└── vendor.lock.toml
Download .txt
Showing preview only (541K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (5847 symbols across 170 files)

FILE: .pi/extensions/test-extensibility.ts
  method execute (line 33) | async execute(_toolCallId, params, onUpdate, _ctx, _signal) {

FILE: bench/ffi_host_boundary/src/bin/rust_boundary_bench.rs
  type BenchResult (line 6) | struct BenchResult {
  function finish (line 13) | fn finish(label: &'static str, iterations: u64, start: u64, acc: u64) ->...
  function bench_inline_add (line 24) | fn bench_inline_add(iterations: u64) -> BenchResult {
  function bench_fn_add (line 33) | fn bench_fn_add(iterations: u64) -> BenchResult {
  function bench_extern_add (line 42) | fn bench_extern_add(iterations: u64) -> BenchResult {
  function bench_noop (line 51) | fn bench_noop(iterations: u64) -> BenchResult {
  function parse_iters (line 60) | fn parse_iters() -> u64 {
  function print_result (line 76) | fn print_result(result: &BenchResult) {
  function main (line 83) | fn main() {

FILE: bench/ffi_host_boundary/src/lib.rs
  function flow_host_now_ns (line 5) | pub extern "C" fn flow_host_now_ns() -> u64 {
  function flow_host_noop (line 11) | pub extern "C" fn flow_host_noop(x: u64) -> u64 {
  function flow_host_add_u64 (line 17) | pub extern "C" fn flow_host_add_u64(a: u64, b: u64) -> u64 {
  function flow_host_bench_iterations (line 22) | pub extern "C" fn flow_host_bench_iterations() -> u64 {
  function rust_inline_add (line 31) | pub fn rust_inline_add(a: u64, b: u64) -> u64 {
  function rust_fn_add (line 36) | pub fn rust_fn_add(a: u64, b: u64) -> u64 {
  function monotonic_now_ns (line 40) | pub fn monotonic_now_ns() -> u64 {

FILE: build.rs
  function main (line 6) | fn main() {

FILE: crates/flow_commit_scan/src/lib.rs
  type SecretFinding (line 7) | pub type SecretFinding = (String, usize, String, String);
  constant SECRET_PATTERNS (line 11) | const SECRET_PATTERNS: &[(&str, &str)] = &[
  function compiled_secret_patterns (line 89) | fn compiled_secret_patterns() -> &'static Vec<(&'static str, Regex)> {
  constant SECRET_SCAN_IGNORE_MARKERS (line 99) | const SECRET_SCAN_IGNORE_MARKERS: &[&str] = &[
  function should_ignore_secret_scan_line (line 106) | fn should_ignore_secret_scan_line(content: &str) -> bool {
  function extract_first_quoted_value (line 113) | fn extract_first_quoted_value(s: &str) -> Option<&str> {
  function looks_like_identifier_reference (line 122) | fn looks_like_identifier_reference(value: &str) -> bool {
  function looks_like_secret_lookup (line 131) | fn looks_like_secret_lookup(value: &str) -> bool {
  function generic_secret_assignment_is_false_positive (line 163) | fn generic_secret_assignment_is_false_positive(content: &str, matched: &...
  function scan_diff_for_secrets (line 198) | pub fn scan_diff_for_secrets(repo_root: &Path) -> Vec<SecretFinding> {

FILE: crates/opentui-lite/src/lib.rs
  type Error (line 7) | pub struct Error {
    method new (line 12) | fn new(message: impl Into<String>) -> Self {
    method fmt (line 20) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  type Result (line 27) | pub type Result<T> = std::result::Result<T, Error>;
  type Color (line 31) | pub struct Color {
    method rgba (line 39) | pub const fn rgba(r: f32, g: f32, b: f32, a: f32) -> Self {
    method rgb (line 43) | pub const fn rgb(r: f32, g: f32, b: f32) -> Self {
  constant ATTR_NONE (line 48) | pub const ATTR_NONE: u32 = 0;
  constant ATTR_BOLD (line 49) | pub const ATTR_BOLD: u32 = 1 << 0;
  constant ATTR_DIM (line 50) | pub const ATTR_DIM: u32 = 1 << 1;
  constant ATTR_ITALIC (line 51) | pub const ATTR_ITALIC: u32 = 1 << 2;
  constant ATTR_UNDERLINE (line 52) | pub const ATTR_UNDERLINE: u32 = 1 << 3;
  constant ATTR_BLINK (line 53) | pub const ATTR_BLINK: u32 = 1 << 4;
  constant ATTR_INVERSE (line 54) | pub const ATTR_INVERSE: u32 = 1 << 5;
  constant ATTR_HIDDEN (line 55) | pub const ATTR_HIDDEN: u32 = 1 << 6;
  constant ATTR_STRIKETHROUGH (line 56) | pub const ATTR_STRIKETHROUGH: u32 = 1 << 7;
  constant BORDER_SIMPLE (line 58) | pub const BORDER_SIMPLE: [u32; 11] = [
  type RendererPtr (line 63) | type RendererPtr = *mut std::ffi::c_void;
  type BufferPtr (line 64) | type BufferPtr = *mut std::ffi::c_void;
  type FnCreateRenderer (line 66) | type FnCreateRenderer = unsafe extern "C" fn(u32, u32, bool) -> Renderer...
  type FnDestroyRenderer (line 67) | type FnDestroyRenderer = unsafe extern "C" fn(RendererPtr);
  type FnSetupTerminal (line 68) | type FnSetupTerminal = unsafe extern "C" fn(RendererPtr, bool);
  type FnSuspendRenderer (line 69) | type FnSuspendRenderer = unsafe extern "C" fn(RendererPtr);
  type FnRender (line 70) | type FnRender = unsafe extern "C" fn(RendererPtr, bool);
  type FnClearTerminal (line 71) | type FnClearTerminal = unsafe extern "C" fn(RendererPtr);
  type FnResizeRenderer (line 72) | type FnResizeRenderer = unsafe extern "C" fn(RendererPtr, u32, u32);
  type FnGetNextBuffer (line 73) | type FnGetNextBuffer = unsafe extern "C" fn(RendererPtr) -> BufferPtr;
  type FnGetCurrentBuffer (line 74) | type FnGetCurrentBuffer = unsafe extern "C" fn(RendererPtr) -> BufferPtr;
  type FnBufferClear (line 75) | type FnBufferClear = unsafe extern "C" fn(BufferPtr, *const f32);
  type FnBufferDrawText (line 76) | type FnBufferDrawText =
  type FnBufferFillRect (line 78) | type FnBufferFillRect = unsafe extern "C" fn(BufferPtr, u32, u32, u32, u...
  type FnBufferDrawBox (line 79) | type FnBufferDrawBox = unsafe extern "C" fn(
  type OpenTui (line 94) | pub struct OpenTui {
    method load (line 131) | pub fn load() -> Result<Self> {
    method path (line 155) | pub fn path(&self) -> &str {
    method create_renderer (line 159) | pub fn create_renderer(&self, width: u32, height: u32, testing: bool) ...
  type Inner (line 98) | struct Inner {
  type Fns (line 104) | struct Fns {
  method drop (line 121) | fn drop(&mut self) {
  type Renderer (line 171) | pub struct Renderer {
    method setup_terminal (line 177) | pub fn setup_terminal(&self, use_alternate_screen: bool) {
    method suspend (line 181) | pub fn suspend(&self) {
    method clear_terminal (line 185) | pub fn clear_terminal(&self) {
    method resize (line 189) | pub fn resize(&self, width: u32, height: u32) {
    method render (line 193) | pub fn render(&self, force: bool) {
    method next_buffer (line 197) | pub fn next_buffer(&self) -> Buffer {
    method current_buffer (line 205) | pub fn current_buffer(&self) -> Buffer {
  method drop (line 215) | fn drop(&mut self) {
  type Buffer (line 222) | pub struct Buffer {
    method clear (line 228) | pub fn clear(&self, bg: Color) {
    method fill_rect (line 232) | pub fn fill_rect(&self, x: u32, y: u32, width: u32, height: u32, bg: C...
    method draw_text (line 245) | pub fn draw_text(&self, text: &str, x: u32, y: u32, fg: Color, bg: Opt...
    method draw_box (line 264) | pub fn draw_box(
  function load_library (line 298) | fn load_library() -> Result<(*mut std::ffi::c_void, String)> {
  function candidate_paths (line 315) | fn candidate_paths() -> Vec<PathBuf> {
  function zig_target_dir (line 348) | fn zig_target_dir() -> Option<&'static str> {
  function lib_filename (line 358) | fn lib_filename() -> &'static str {
  function try_dlopen (line 368) | fn try_dlopen(path: &Path) -> Result<*mut std::ffi::c_void> {
  function path_to_cstring (line 379) | fn path_to_cstring(path: &Path) -> Result<CString> {
  function load_symbol (line 392) | unsafe fn load_symbol<T>(lib: *mut std::ffi::c_void, symbol: &str) -> Re...
  function dl_error_string (line 401) | fn dl_error_string() -> String {
  function dlopen (line 412) | fn dlopen(path: *const libc::c_char, mode: libc::c_int) -> *mut std::ffi...
  function dlsym (line 413) | fn dlsym(handle: *mut std::ffi::c_void, symbol: *const libc::c_char) -> ...
  function dlclose (line 414) | fn dlclose(handle: *mut std::ffi::c_void) -> libc::c_int;
  function dlerror (line 415) | fn dlerror() -> *const libc::c_char;

FILE: crates/seq_client/src/lib.rs
  constant DEFAULT_SOCKET_PATH (line 10) | const DEFAULT_SOCKET_PATH: &str = "/tmp/seqd.sock";
  constant MAX_RESPONSE_BYTES (line 11) | const MAX_RESPONSE_BYTES: usize = 1024 * 1024;
  type SeqClientError (line 14) | pub enum SeqClientError {
  type RpcRequest (line 26) | pub struct RpcRequest {
    method new (line 39) | pub fn new(op: impl Into<String>) -> Self {
    method with_request_id (line 46) | pub fn with_request_id(mut self, request_id: impl Into<String>) -> Self {
    method with_run_id (line 51) | pub fn with_run_id(mut self, run_id: impl Into<String>) -> Self {
    method with_tool_call_id (line 56) | pub fn with_tool_call_id(mut self, tool_call_id: impl Into<String>) ->...
    method with_args_json (line 61) | pub fn with_args_json(mut self, args: Value) -> Self {
    method with_args (line 66) | pub fn with_args<T: Serialize>(mut self, args: &T) -> Result<Self, Seq...
  type RpcResponse (line 73) | pub struct RpcResponse {
  type SeqClient (line 91) | pub struct SeqClient {
    method connect_default (line 97) | pub fn connect_default() -> Result<Self, SeqClientError> {
    method connect (line 101) | pub fn connect(path: impl AsRef<Path>) -> Result<Self, SeqClientError> {
    method connect_with_timeout (line 109) | pub fn connect_with_timeout(
    method socket_path (line 122) | pub fn socket_path(&self) -> &Path {
    method call (line 126) | pub fn call(&self, request: RpcRequest) -> Result<RpcResponse, SeqClie...
    method call_ok (line 137) | pub fn call_ok(&self, request: RpcRequest) -> Result<Value, SeqClientE...
    method ping (line 150) | pub fn ping(&self) -> Result<RpcResponse, SeqClientError> {
    method app_state (line 154) | pub fn app_state(&self) -> Result<RpcResponse, SeqClientError> {
    method perf (line 158) | pub fn perf(&self) -> Result<RpcResponse, SeqClientError> {
    method open_app (line 162) | pub fn open_app(&self, name: &str) -> Result<RpcResponse, SeqClientErr...
    method open_app_toggle (line 166) | pub fn open_app_toggle(&self, name: &str) -> Result<RpcResponse, SeqCl...
    method run_macro (line 170) | pub fn run_macro(&self, name: &str) -> Result<RpcResponse, SeqClientEr...
    method click (line 174) | pub fn click(&self, x: f64, y: f64) -> Result<RpcResponse, SeqClientEr...
    method right_click (line 178) | pub fn right_click(&self, x: f64, y: f64) -> Result<RpcResponse, SeqCl...
    method double_click (line 182) | pub fn double_click(&self, x: f64, y: f64) -> Result<RpcResponse, SeqC...
    method move_mouse (line 186) | pub fn move_mouse(&self, x: f64, y: f64) -> Result<RpcResponse, SeqCli...
    method scroll (line 190) | pub fn scroll(&self, x: f64, y: f64, dy: i32) -> Result<RpcResponse, S...
    method drag (line 194) | pub fn drag(&self, x1: f64, y1: f64, x2: f64, y2: f64) -> Result<RpcRe...
    method screenshot (line 201) | pub fn screenshot(&self, path: Option<&str>) -> Result<RpcResponse, Se...
  function write_request (line 211) | fn write_request(stream: &mut UnixStream, request: &RpcRequest) -> Resul...
  function read_response_line (line 218) | fn read_response_line(stream: &mut UnixStream) -> Result<Vec<u8>, SeqCli...
  function test_socket_path (line 255) | fn test_socket_path(tag: &str) -> PathBuf {
  function call_roundtrip_ping (line 267) | fn call_roundtrip_ping() {
  function call_ok_surfaces_remote_error (line 304) | fn call_ok_surfaces_remote_error() {

FILE: crates/seq_everruns_bridge/src/lib.rs
  type ToolCall (line 10) | pub struct ToolCall {
  type ToolResult (line 18) | pub struct ToolResult {
  type ToolCallRequestedData (line 27) | pub struct ToolCallRequestedData {
  type BridgeError (line 32) | pub enum BridgeError {
  function parse_tool_call_requested (line 37) | pub fn parse_tool_call_requested(data: &Value) -> Result<Vec<ToolCall>, ...
  function execute_tool_call (line 42) | pub fn execute_tool_call(
  function execute_tool_call_with_maple (line 51) | pub fn execute_tool_call_with_maple(
  function build_request (line 122) | pub fn build_request(
  function map_tool_name_to_seq_op (line 142) | pub fn map_tool_name_to_seq_op(tool_name: &str) -> Option<&'static str> {
  function client_side_tool_definitions (line 170) | pub fn client_side_tool_definitions() -> Vec<Value> {
  function client_tool (line 289) | fn client_tool(name: &str, description: &str, parameters: Value) -> Value {
  function unix_time_nanos_now (line 298) | fn unix_time_nanos_now() -> u64 {
  function maps_supported_tool_names (line 310) | fn maps_supported_tool_names() {
  function builds_request_with_correlation_ids (line 319) | fn builds_request_with_correlation_ids() {
  function emits_expected_tool_catalog (line 335) | fn emits_expected_tool_catalog() {
  function parse_tool_call_requested_payload (line 347) | fn parse_tool_call_requested_payload() {
  function unsupported_tool_returns_error_result (line 362) | fn unsupported_tool_returns_error_result() {
  function bridge_error_is_displayable (line 387) | fn bridge_error_is_displayable() {

FILE: crates/seq_everruns_bridge/src/maple.rs
  constant DEFAULT_SCOPE_NAME (line 10) | const DEFAULT_SCOPE_NAME: &str = "seq_everruns_bridge";
  constant DEFAULT_SERVICE_NAME (line 11) | const DEFAULT_SERVICE_NAME: &str = "seq-everruns-bridge";
  constant DEFAULT_ENV (line 12) | const DEFAULT_ENV: &str = "local";
  constant DEFAULT_QUEUE_CAPACITY (line 13) | const DEFAULT_QUEUE_CAPACITY: usize = 4096;
  constant DEFAULT_MAX_BATCH_SIZE (line 14) | const DEFAULT_MAX_BATCH_SIZE: usize = 128;
  constant DEFAULT_FLUSH_INTERVAL_MS (line 15) | const DEFAULT_FLUSH_INTERVAL_MS: u64 = 50;
  constant DEFAULT_CONNECT_TIMEOUT_MS (line 16) | const DEFAULT_CONNECT_TIMEOUT_MS: u64 = 400;
  constant DEFAULT_REQUEST_TIMEOUT_MS (line 17) | const DEFAULT_REQUEST_TIMEOUT_MS: u64 = 800;
  type MapleIngestTarget (line 20) | pub struct MapleIngestTarget {
  type MapleExporterConfig (line 26) | pub struct MapleExporterConfig {
    method from_env (line 40) | pub fn from_env() -> Result<Option<Self>, MapleConfigError> {
  method default (line 97) | fn default() -> Self {
  type MapleConfigError (line 114) | pub enum MapleConfigError {
  type MapleSpan (line 122) | pub struct MapleSpan {
    method for_runtime_event (line 136) | pub fn for_runtime_event(
    method for_tool_call (line 172) | pub fn for_tool_call(
  type MapleExporterStats (line 218) | pub struct MapleExporterStats {
  type MapleExporterStatsAtomic (line 226) | struct MapleExporterStatsAtomic {
  type WorkerTarget (line 233) | struct WorkerTarget {
  type MapleTraceExporter (line 239) | pub struct MapleTraceExporter {
    method from_env (line 245) | pub fn from_env() -> Result<Option<Self>, MapleConfigError> {
    method new (line 252) | pub fn new(config: MapleExporterConfig) -> Self {
    method emit_span (line 260) | pub fn emit_span(&self, span: MapleSpan) {
    method stats (line 268) | pub fn stats(&self) -> MapleExporterStats {
  function worker_main (line 278) | fn worker_main(
  function flush_batch (line 327) | fn flush_batch(
  function build_resource_attrs (line 374) | fn build_resource_attrs(config: &MapleExporterConfig) -> Vec<Value> {
  function encode_span (line 387) | fn encode_span(span: &MapleSpan) -> Value {
  function otlp_string_attr (line 408) | fn otlp_string_attr(key: &str, value: &str) -> Value {
  function parse_targets_from_env (line 415) | fn parse_targets_from_env() -> Result<Vec<MapleIngestTarget>, MapleConfi...
  function split_csv_env (line 476) | fn split_csv_env(key: &str) -> Vec<String> {
  function dedup_targets (line 483) | fn dedup_targets(targets: Vec<MapleIngestTarget>) -> Vec<MapleIngestTarg...
  function env_usize (line 497) | fn env_usize(key: &str) -> Option<usize> {
  function env_u64 (line 503) | fn env_u64(key: &str) -> Option<u64> {
  function non_empty (line 509) | fn non_empty(s: impl AsRef<str>) -> Option<String> {
  function stable_trace_id (line 518) | pub fn stable_trace_id(session_id: &str, event_id: &str) -> String {
  function stable_span_id (line 524) | pub fn stable_span_id(seed: &str) -> String {
  function fnv1a64 (line 528) | fn fnv1a64(data: &[u8]) -> u64 {
  function unset_maple_envs (line 547) | fn unset_maple_envs() {
  function stable_ids_have_expected_length (line 571) | fn stable_ids_have_expected_length() {
  function reads_dual_target_env_config (line 579) | fn reads_dual_target_env_config() {
  function csv_target_env_mismatch_returns_error (line 609) | fn csv_target_env_mismatch_returns_error() {
  function incomplete_local_pair_returns_error (line 627) | fn incomplete_local_pair_returns_error() {
  function exporter_sends_span_to_ingest_endpoint (line 646) | fn exporter_sends_span_to_ingest_endpoint() {

FILE: flow.py
  function demo_single (line 24) | def demo_single(task: str, model: str = "gpt-4o-mini"):
  function demo_sequential (line 42) | def demo_sequential(task: str, model: str = "gpt-4o-mini"):
  function demo_concurrent (line 78) | def demo_concurrent(task: str, model: str = "gpt-4o-mini"):
  function demo_hierarchical (line 116) | def demo_hierarchical(task: str, model: str = "gpt-4o-mini"):
  function demo_rearrange (line 157) | def demo_rearrange(task: str, model: str = "gpt-4o-mini"):
  function demo_chat (line 206) | def demo_chat(topic: str, model: str = "gpt-4o-mini", rounds: int = 3):
  function demo_auto (line 247) | def demo_auto(task: str, model: str = "gpt-4o-mini"):
  function main (line 273) | def main():

FILE: scripts/ai-taskd-launchd.py
  function run (line 14) | def run(cmd: list[str]) -> subprocess.CompletedProcess:
  function resolve_f_bin (line 18) | def resolve_f_bin(repo_root: Path) -> str:
  function plist_path (line 34) | def plist_path() -> Path:
  function domain_target (line 38) | def domain_target() -> str:
  function install (line 42) | def install(repo_root: Path) -> int:
  function uninstall (line 76) | def uninstall() -> int:
  function status (line 86) | def status() -> int:
  function logs (line 97) | def logs(lines: int) -> int:
  function main (line 112) | def main() -> int:

FILE: scripts/bench-ai-runtime.py
  function run_cmd (line 15) | def run_cmd(cmd: List[str], cwd: Path, env: Dict[str, str] | None = None...
  function pct (line 29) | def pct(values_us: List[float], p: float) -> float:
  function summarize (line 38) | def summarize(values_us: List[float]) -> Dict[str, float]:
  function benchmark_command (line 50) | def benchmark_command(
  function find_flow_bin (line 76) | def find_flow_bin(repo: Path, flow_bin: str | None) -> str:
  function find_ai_taskd_client_bin (line 86) | def find_ai_taskd_client_bin(repo: Path) -> str | None:
  function ensure_cached_binary (line 96) | def ensure_cached_binary(repo: Path, flow_bin: str) -> str:
  function main (line 111) | def main() -> int:

FILE: scripts/bench-cli-startup.py
  function pct (line 13) | def pct(values_ms: List[float], p: float) -> float:
  function summarize (line 22) | def summarize(values_ms: List[float]) -> Dict[str, float]:
  function run_cmd (line 34) | def run_cmd(
  function benchmark_command (line 52) | def benchmark_command(
  function find_flow_bin (line 86) | def find_flow_bin(repo: Path, flow_bin: str | None) -> str:
  function main (line 95) | def main() -> int:

FILE: scripts/bench-moonbit-rust-ffi.py
  function run (line 11) | def run(cmd, cwd: Path, env: Dict[str, str] | None = None) -> subprocess...
  function parse_metrics (line 18) | def parse_metrics(text: str) -> Dict[str, Dict[str, float]]:
  function write_moon_pkg (line 37) | def write_moon_pkg(moon_dir: Path, rust_lib_dir: Path, cc_flags: str) ->...
  function main (line 44) | def main() -> int:

FILE: scripts/build_rl_runtime_dataset.py
  class DatasetRow (line 35) | class DatasetRow:
  function _read_jsonl (line 46) | def _read_jsonl(path: Path, *, last: int = 0) -> list[dict[str, Any]]:
  function _now_stamp (line 66) | def _now_stamp() -> str:
  function _hash_id (line 70) | def _hash_id(parts: list[str]) -> str:
  function _bucket (line 75) | def _bucket(row_id: str, seed: int) -> int:
  function _as_int (line 80) | def _as_int(value: Any, default: int = 0) -> int:
  function _sanitize_text (line 90) | def _sanitize_text(value: Any) -> str:
  function _extract_captured_text (line 98) | def _extract_captured_text(value: Any) -> str:
  function _reward_components (line 107) | def _reward_components(success: bool, duration_ms: int) -> tuple[float, ...
  function _normalize_flow (line 115) | def _normalize_flow(rows: list[dict[str, Any]]) -> list[DatasetRow]:
  function _normalize_seq (line 226) | def _normalize_seq(rows: list[dict[str, Any]]) -> list[DatasetRow]:
  function _cap_by_event (line 358) | def _cap_by_event(rows: list[DatasetRow], *, max_per_event: int, seed: i...
  function _write_jsonl (line 380) | def _write_jsonl(path: Path, rows: list[dict[str, Any]]) -> None:
  function _build_report (line 388) | def _build_report(
  function main (line 455) | def main() -> int:

FILE: scripts/check_cli_startup_thresholds.py
  function main (line 9) | def main() -> int:

FILE: scripts/check_release_tag_version.py
  function read_package_version (line 9) | def read_package_version(cargo_toml: pathlib.Path) -> str:
  function main (line 25) | def main(argv: list[str]) -> int:

FILE: scripts/ci_blacksmith.py
  function rewrite_workflow (line 45) | def rewrite_workflow(path: Path, mode: str) -> bool:
  function detect_profile (line 114) | def detect_profile(path: Path) -> str:
  function status (line 127) | def status() -> int:
  function run_cmd (line 140) | def run_cmd(args: list[str]) -> None:
  function has_staged_workflow_changes (line 144) | def has_staged_workflow_changes() -> bool:
  function maybe_commit_and_push (line 153) | def maybe_commit_and_push(mode: str, commit: bool, push: bool) -> int:
  function set_mode (line 176) | def set_mode(mode: str, commit: bool, push: bool) -> int:
  function main (line 195) | def main() -> int:

FILE: scripts/ci_host_runner.py
  class HostTriplet (line 32) | class HostTriplet:
  function run_capture (line 38) | def run_capture(args: list[str], cwd: str | None = None) -> str:
  function run_stream (line 50) | def run_stream(args: list[str], *, input_text: str | None = None) -> None:
  function load_host_triplet (line 54) | def load_host_triplet() -> HostTriplet:
  function gh_api (line 64) | def gh_api(path: str, *, method: str = "GET", jq: str | None = None) -> ...
  function gh_api_json (line 74) | def gh_api_json(path: str, *, method: str = "GET") -> dict:
  function ssh_script (line 79) | def ssh_script(host: HostTriplet, script: str) -> None:
  function ssh_capture (line 96) | def ssh_capture(host: HostTriplet, script: str) -> str:
  function shell_assign (line 121) | def shell_assign(name: str, value: str) -> str:
  function default_runner_name (line 125) | def default_runner_name(host: HostTriplet) -> str:
  function github_runner_state (line 130) | def github_runner_state(repo: str, runner_name: str) -> tuple[str, bool ...
  function host_service_state (line 138) | def host_service_state(host: HostTriplet) -> str:
  function cmd_status (line 155) | def cmd_status(args: argparse.Namespace) -> int:
  function cmd_health (line 183) | def cmd_health(args: argparse.Namespace) -> int:
  function cmd_wait_online (line 195) | def cmd_wait_online(args: argparse.Namespace) -> int:
  function cmd_install (line 219) | def cmd_install(args: argparse.Namespace) -> int:
  function cmd_remove (line 322) | def cmd_remove(args: argparse.Namespace) -> int:
  function build_parser (line 384) | def build_parser() -> argparse.ArgumentParser:
  function main (line 419) | def main() -> int:

FILE: scripts/codex-skill-eval-launchd.py
  function run (line 14) | def run(cmd: list[str]) -> subprocess.CompletedProcess:
  function resolve_f_bin (line 18) | def resolve_f_bin(repo_root: Path) -> str:
  function plist_path (line 34) | def plist_path() -> Path:
  function domain_target (line 38) | def domain_target() -> str:
  function log_dir (line 42) | def log_dir() -> Path:
  function install (line 48) | def install(
  function uninstall (line 117) | def uninstall() -> int:
  function status (line 127) | def status() -> int:
  function logs (line 138) | def logs(lines: int) -> int:
  function main (line 152) | def main() -> int:

FILE: scripts/codex_fork.py
  function env_path (line 14) | def env_path(name: str, default: Path) -> Path:
  function fail (line 51) | def fail(message: str, code: int = 1) -> int:
  function run (line 56) | def run(
  function capture (line 77) | def capture(cmd: list[str], *, cwd: Path | None = None, check: bool = Tr...
  function ensure_repo (line 82) | def ensure_repo(path: Path, label: str) -> None:
  function ensure_state_dir (line 95) | def ensure_state_dir() -> None:
  function read_last_worktree (line 99) | def read_last_worktree() -> Path | None:
  function write_last_worktree (line 108) | def write_last_worktree(path: Path) -> None:
  function slugify (line 113) | def slugify(text: str) -> str:
  function branch_to_worktree_name (line 121) | def branch_to_worktree_name(branch: str) -> str:
  function git_ref_exists (line 125) | def git_ref_exists(repo: Path, ref: str) -> bool:
  function git_branch_exists (line 134) | def git_branch_exists(repo: Path, branch: str) -> bool:
  function git_current_branch (line 138) | def git_current_branch(repo: Path) -> str:
  function git_rev (line 145) | def git_rev(repo: Path, ref: str) -> str | None:
  function worktree_entries (line 152) | def worktree_entries(repo: Path) -> list[dict[str, str]]:
  function worktree_for_branch (line 176) | def worktree_for_branch(repo: Path, branch: str) -> Path | None:
  function branch_from_target (line 183) | def branch_from_target(target: str) -> str:
  function default_worktree_path (line 189) | def default_worktree_path(branch: str) -> Path:
  function ensure_task_worktree (line 193) | def ensure_task_worktree(branch: str, path: Path, base: str) -> tuple[Pa...
  function build_prompt (line 212) | def build_prompt(query: str, branch: str, worktree: Path, base: str) -> ...
  function launch_codex_new (line 228) | def launch_codex_new(worktree: Path, prompt: str) -> int:
  function launch_codex_resume_last (line 241) | def launch_codex_resume_last(worktree: Path, prompt: str | None = None) ...
  function print_next_commands (line 255) | def print_next_commands(worktree: Path, branch: str, prompt: str) -> None:
  function cmd_status (line 277) | def cmd_status(_args: argparse.Namespace) -> int:
  function cmd_sync (line 322) | def cmd_sync(args: argparse.Namespace) -> int:
  function cmd_task (line 351) | def cmd_task(args: argparse.Namespace) -> int:
  function resolve_target_worktree (line 377) | def resolve_target_worktree(target: str | None) -> Path:
  function cmd_last (line 396) | def cmd_last(args: argparse.Namespace) -> int:
  function review_branch_for (line 405) | def review_branch_for(source_branch: str) -> str:
  function cmd_promote (line 414) | def cmd_promote(args: argparse.Namespace) -> int:
  function build_parser (line 432) | def build_parser() -> argparse.ArgumentParser:
  function main (line 516) | def main() -> int:

FILE: scripts/deps_check.py
  function run_json (line 15) | def run_json(cmd: list[str], *, cwd: Path) -> Any:
  function fetch_latest (line 30) | def fetch_latest(crate: str, cache: dict[str, str]) -> str:
  function load_vendor_rows (line 59) | def load_vendor_rows(repo_root: Path) -> list[dict[str, Any]]:
  function load_direct_rows (line 65) | def load_direct_rows(repo_root: Path) -> list[dict[str, Any]]:
  function print_rows (line 115) | def print_rows(title: str, rows: list[dict[str, Any]], *, include_kinds:...
  function main (line 129) | def main() -> int:

FILE: scripts/generate_help_full_json.py
  function main (line 10) | def main() -> int:

FILE: scripts/rl_signal_summary.py
  function percentile (line 12) | def percentile(sorted_values: list[int], pct: float) -> int:
  function main (line 19) | def main() -> int:

FILE: scripts/run-health-checks.mjs
  function resolveDefaultBaseUrl (line 92) | function resolveDefaultBaseUrl(configValue) {
  function resolveBaseUrl (line 99) | function resolveBaseUrl(check, fallback, required = true) {
  function resolveTimeoutMs (line 108) | function resolveTimeoutMs(check, fallback) {
  function expandEnv (line 112) | function expandEnv(value) {
  function runHttpCheck (line 123) | async function runHttpCheck(check, { baseUrl, timeoutMs }) {
  function runGiteditShareCheck (line 158) | async function runGiteditShareCheck(check, { baseUrl, timeoutMs }) {
  function resolveCommitSha (line 218) | function resolveCommitSha(ref) {
  function buildSharePayload (line 229) | function buildSharePayload({ owner, repo, commitSha }) {
  function encodeSharePayload (line 250) | function encodeSharePayload(payload) {
  function normalizeStatuses (line 257) | function normalizeStatuses(value) {
  function normalizeContains (line 265) | function normalizeContains(value) {
  function resolveUrl (line 271) | function resolveUrl(url, baseUrl) {
  function fetchWithTimeout (line 279) | async function fetchWithTimeout(url, options, timeoutMs) {

FILE: scripts/vendor/bench_iteration.py
  class BenchRow (line 20) | class BenchRow:
  function utc_now (line 30) | def utc_now() -> str:
  function git_head (line 34) | def git_head(project: Path) -> str:
  function read_jsonl (line 45) | def read_jsonl(path: Path) -> list[dict]:
  function append_jsonl (line 60) | def append_jsonl(path: Path, rows: list[BenchRow]) -> None:
  function run_cmd (line 67) | def run_cmd(project: Path, cmd: str) -> float:
  function run_sample (line 76) | def run_sample(project: Path, mode: Mode, cmd: str) -> float:
  function summarize (line 82) | def summarize(values: list[float]) -> dict[str, float]:
  function main (line 92) | def main() -> None:

FILE: scripts/vendor/rough_edges_audit.py
  class Finding (line 23) | class Finding:
  function load_toml (line 30) | def load_toml(path: Path) -> dict[str, Any]:
  function read_manifest_crate (line 35) | def read_manifest_crate(path: Path) -> str:
  function list_lock_crates (line 44) | def list_lock_crates(vendor_lock: dict[str, Any]) -> list[dict[str, str]]:
  function read_patch_paths (line 63) | def read_patch_paths(cargo_toml: dict[str, Any]) -> dict[str, str]:
  function latest_mtime (line 80) | def latest_mtime(paths: list[Path]) -> float:
  function check_warning_hygiene (line 89) | def check_warning_hygiene(project: Path) -> list[Finding]:
  function build_report (line 172) | def build_report(project: Path) -> tuple[dict[str, Any], list[Finding]]:
  function print_text (line 495) | def print_text(metrics: dict[str, Any], findings: list[Finding]) -> None:
  function main (line 519) | def main() -> None:

FILE: scripts/vendor/typesense_code_index.py
  function env_first (line 28) | def env_first(*names: str, default: str) -> str:
  class SourceEntry (line 93) | class SourceEntry:
  function die (line 106) | def die(msg: str) -> NoReturn:
  function load_toml (line 110) | def load_toml(path: Path) -> dict:
  function load_vendor_sources (line 115) | def load_vendor_sources(project: Path) -> list[SourceEntry]:
  function load_vendor_lock (line 181) | def load_vendor_lock(project: Path) -> dict:
  function _as_dict (line 188) | def _as_dict(value: object) -> dict:
  function _as_list (line 192) | def _as_list(value: object) -> list:
  function _s (line 196) | def _s(v: object) -> str | None:
  function typesense_request (line 203) | def typesense_request(
  function collection_url (line 226) | def collection_url(base: str, name: str) -> str:
  function ensure_collection (line 230) | def ensure_collection(base_url: str, api_key: str, name: str, fields: li...
  function import_jsonl (line 252) | def import_jsonl(base_url: str, api_key: str, collection: str, docs: lis...
  function iter_text_files (line 281) | def iter_text_files(root: Path, *, exclude_vendor: bool) -> Iterable[Path]:
  function extract_symbols (line 293) | def extract_symbols(path: Path, lines: list[str]) -> list[str]:
  function chunk_lines (line 312) | def chunk_lines(lines: list[str], chunk_size: int, overlap: int) -> Iter...
  function lang_for (line 327) | def lang_for(path: Path) -> str:
  function file_to_chunks (line 332) | def file_to_chunks(
  function build_sources_docs (line 369) | def build_sources_docs(project: Path, sources: list[SourceEntry]) -> lis...
  function collect_chunk_docs (line 390) | def collect_chunk_docs(
  function write_sources_index (line 448) | def write_sources_index(project: Path, sources: list[SourceEntry], out_p...
  function _utc_now (line 474) | def _utc_now() -> str:
  function cmd_index (line 480) | def cmd_index(args: argparse.Namespace) -> None:
  function _build_filter (line 552) | def _build_filter(args: argparse.Namespace) -> str | None:
  function cmd_search (line 567) | def cmd_search(args: argparse.Namespace) -> None:
  function cmd_sources (line 646) | def cmd_sources(args: argparse.Namespace) -> None:
  function build_parser (line 675) | def build_parser() -> argparse.ArgumentParser:
  function main (line 715) | def main() -> None:

FILE: src/activity_log.rs
  constant ACTIVITY_EVENT_VERSION (line 12) | const ACTIVITY_EVENT_VERSION: u32 = 1;
  constant HUMAN_LINE_MAX_CHARS (line 13) | const HUMAN_LINE_MAX_CHARS: usize = 220;
  constant EVENT_ID_LEN (line 14) | const EVENT_ID_LEN: usize = 7;
  type ActivityStatus (line 18) | pub enum ActivityStatus {
    method as_str (line 24) | fn as_str(self) -> &'static str {
  type ActivityEvent (line 34) | pub struct ActivityEvent {
    method done (line 64) | pub fn done(kind: impl Into<String>, summary: impl Into<String>) -> Se...
    method changed (line 68) | pub fn changed(kind: impl Into<String>, summary: impl Into<String>) ->...
    method new (line 72) | fn new(status: ActivityStatus, kind: String, summary: String) -> Self {
  type FileLockGuard (line 95) | struct FileLockGuard {
  method drop (line 101) | fn drop(&mut self) {
  function acquire_file_lock (line 107) | fn acquire_file_lock(file: &std::fs::File) -> Result<FileLockGuard> {
  function acquire_file_lock (line 118) | fn acquire_file_lock(_file: &std::fs::File) -> Result<()> {
  function month_slug (line 122) | fn month_slug(month: u32) -> &'static str {
  function daily_log_root (line 140) | fn daily_log_root() -> PathBuf {
  function daily_log_path_at (line 150) | fn daily_log_path_at(root: &Path, now: chrono::DateTime<Local>) -> PathB...
  function daily_events_path_at (line 157) | fn daily_events_path_at(root: &Path, now: chrono::DateTime<Local>) -> Pa...
  function daily_dedupe_index_dir_at (line 166) | fn daily_dedupe_index_dir_at(root: &Path, now: chrono::DateTime<Local>) ...
  function append_daily_event_at (line 175) | fn append_daily_event_at(
  function normalize_event (line 234) | fn normalize_event(mut event: ActivityEvent) -> Option<ActivityEvent> {
  function render_human_line (line 311) | fn render_human_line(event: &ActivityEvent, now: chrono::DateTime<Local>...
  function render_kind (line 328) | fn render_kind(event: &ActivityEvent) -> String {
  function render_tags (line 335) | fn render_tags(event: &ActivityEvent) -> String {
  function dedupe_key_exists (line 347) | fn dedupe_key_exists(events_path: &Path, index_dir: &Path, dedupe_key: &...
  function dedupe_index_contains (line 358) | fn dedupe_index_contains(index_dir: &Path, dedupe_key: &str) -> Result<b...
  function persist_dedupe_key (line 368) | fn persist_dedupe_key(index_dir: &Path, dedupe_key: &str) -> Result<()> {
  function dedupe_marker_path (line 391) | fn dedupe_marker_path(index_dir: &Path, dedupe_key: &str) -> PathBuf {
  function sidecar_contains_dedupe_key (line 396) | fn sidecar_contains_dedupe_key(path: &Path, dedupe_key: &str) -> Result<...
  function derive_scope_from_event (line 423) | fn derive_scope_from_event(event: &ActivityEvent) -> Option<String> {
  function path_scope_label (line 432) | fn path_scope_label(path: &str) -> Option<String> {
  function canonical_event_identity (line 466) | fn canonical_event_identity(event: &ActivityEvent) -> String {
  function normalize_text (line 485) | fn normalize_text(value: &str) -> String {
  function compact_token (line 489) | fn compact_token(value: &str, max_chars: usize) -> String {
  function truncate_chars (line 493) | fn truncate_chars(value: &str, max_chars: usize) -> String {
  function truncate_session_id (line 505) | fn truncate_session_id(value: &str) -> String {
  function short_hash (line 509) | fn short_hash(value: &str, len: usize) -> String {
  function unix_now_secs (line 515) | fn unix_now_secs() -> u64 {
  function current_daily_log_path (line 522) | pub fn current_daily_log_path() -> PathBuf {
  function current_daily_events_path (line 526) | pub fn current_daily_events_path() -> PathBuf {
  function append_daily_event (line 530) | pub fn append_daily_event(event: ActivityEvent) -> Result<()> {
  function append_daily_bullet (line 542) | pub fn append_daily_bullet(message: &str) -> Result<()> {
  function path_uses_expected_year_month_day_layout (line 553) | fn path_uses_expected_year_month_day_layout() {
  function append_daily_event_writes_human_line_and_sidecar (line 569) | fn append_daily_event_writes_human_line_and_sidecar() {
  function append_daily_event_dedupes_when_explicit_key_matches (line 600) | fn append_daily_event_dedupes_when_explicit_key_matches() {
  function append_daily_event_recovers_dedupe_index_from_sidecar (line 629) | fn append_daily_event_recovers_dedupe_index_from_sidecar() {

FILE: src/agent_setup.rs
  function generate_agents_md (line 11) | fn generate_agents_md(project_name: &str, _primary_task: &str) -> String {
  function run (line 106) | pub fn run() -> Result<()> {
  function is_lin_running (line 203) | fn is_lin_running() -> bool {

FILE: src/agents.rs
  constant DEFAULT_GEN_REPO_REL (line 22) | const DEFAULT_GEN_REPO_REL: &str = "org/gen/gen";
  constant FLOW_AGENT_NAME (line 24) | const FLOW_AGENT_NAME: &str = "flow";
  function run (line 27) | pub fn run(cmd: AgentsCommand) -> Result<()> {
  function find_gen (line 53) | fn find_gen() -> Option<GenLocation> {
  type GenLocation (line 85) | enum GenLocation {
  function list_agents (line 91) | fn list_agents() -> Result<()> {
  function run_agents_rules (line 125) | fn run_agents_rules(profile: Option<&str>, repo: Option<&str>) -> Result...
  function list_agents_profiles (line 195) | fn list_agents_profiles(agents_dir: &Path) -> Result<Vec<String>> {
  function select_agents_profile (line 219) | fn select_agents_profile(profiles: &[String]) -> Result<Option<String>> {
  function prompt_agents_profile (line 258) | fn prompt_agents_profile(profiles: &[String]) -> Result<String> {
  type AgentEntry (line 282) | struct AgentEntry {
  type FzfAgentResult (line 288) | struct FzfAgentResult<'a> {
  function run_fuzzy_agents (line 293) | fn run_fuzzy_agents() -> Result<()> {
  function copy_agent_instructions (line 328) | fn copy_agent_instructions(agent_name: Option<&str>) -> Result<()> {
  function run_agent_fzf_simple (line 390) | fn run_agent_fzf_simple<'a>(entries: &'a [AgentEntry]) -> Result<Option<...
  function get_agent_content (line 423) | fn get_agent_content(name: &str, path: Option<&Path>) -> Result<String> {
  function get_flow_agent_instructions (line 461) | fn get_flow_agent_instructions() -> String {
  function default_gen_repo (line 480) | fn default_gen_repo() -> Option<PathBuf> {
  function gen_repo_from_env (line 484) | fn gen_repo_from_env() -> Option<PathBuf> {
  function gen_repo_hint (line 488) | fn gen_repo_hint() -> String {
  function run_agent_fzf (line 494) | fn run_agent_fzf<'a>(entries: &'a [AgentEntry]) -> Result<Option<FzfAgen...
  function prompt_for_agent_prompt (line 534) | fn prompt_for_agent_prompt(agent_name: &str) -> Result<Vec<String>> {
  function build_agent_entries (line 552) | fn build_agent_entries() -> Result<Vec<AgentEntry>> {
  function find_project_root (line 602) | fn find_project_root() -> Option<PathBuf> {
  function apply_project_config_env (line 615) | fn apply_project_config_env(cmd: &mut Command) {
  function collect_agent_entries (line 624) | fn collect_agent_entries(
  function agent_name_from_path (line 673) | fn agent_name_from_path(root: &Path, path: &Path) -> Option<String> {
  function parse_agent_frontmatter (line 683) | fn parse_agent_frontmatter(path: &Path) -> Result<(Option<String>, Optio...
  function trim_yaml_scalar (line 707) | fn trim_yaml_scalar(value: &str) -> String {
  constant DIR_AGENTS (line 713) | const DIR_AGENTS: &[&str] = &["docker-to-flox"];
  function run_agent_optional (line 715) | fn run_agent_optional(agent: &str, prompt: Option<Vec<String>>) -> Resul...
  function list_gen_agents (line 738) | fn list_gen_agents(gen_loc: &GenLocation) -> Result<()> {
  function fetch_gen_agent_entries (line 774) | fn fetch_gen_agent_entries() -> Result<Vec<AgentEntry>> {
  function parse_gen_agent_list (line 815) | fn parse_gen_agent_list(stdout: &str) -> Vec<AgentEntry> {
  function parse_agent_list_line (line 837) | fn parse_agent_list_line(line: &str) -> Option<(String, String)> {
  function get_agent_config (line 858) | fn get_agent_config() -> (String, Option<String>) {
  function run_agent (line 871) | fn run_agent(agent: &str, prompt: Vec<String>) -> Result<()> {
  function invoke_claude (line 916) | fn invoke_claude(prompt: &str) -> Result<std::process::ExitStatus> {
  function invoke_opencode (line 927) | fn invoke_opencode(prompt: &str, model: Option<&str>) -> Result<std::pro...
  function run_flow_agent_capture (line 943) | pub fn run_flow_agent_capture(prompt: &str) -> Result<String> {
  function run_flow_agent_capture_streaming (line 960) | pub fn run_flow_agent_capture_streaming(prompt: &str) -> Result<String> {
  constant FALLBACK_AGENT_MODEL (line 977) | const FALLBACK_AGENT_MODEL: &str = "openrouter/moonshotai/kimi-k2:free";
  function get_agent_model (line 980) | fn get_agent_model() -> String {
  function invoke_gen (line 994) | fn invoke_gen(location: &GenLocation, prompt: &str) -> Result<std::proce...
  function invoke_gen_with_model (line 1000) | fn invoke_gen_with_model(
  function invoke_gen_capture (line 1037) | fn invoke_gen_capture(location: &GenLocation, prompt: &str) -> Result<St...
  function invoke_gen_capture_streaming (line 1082) | fn invoke_gen_capture_streaming(location: &GenLocation, prompt: &str) ->...
  function extract_text_from_gen_output (line 1170) | fn extract_text_from_gen_output(stdout: &str) -> Option<String> {
  function extract_text_from_gen_line (line 1182) | fn extract_text_from_gen_line(line: &str) -> Option<String> {
  function build_flow_prompt (line 1196) | fn build_flow_prompt(user_prompt: &str) -> Result<String> {
  constant FLOW_SCHEMA_CONTEXT (line 1234) | const FLOW_SCHEMA_CONTEXT: &str = r#"# Flow Task Runner Context
  constant FLOW_CLI_CONTEXT (line 1282) | const FLOW_CLI_CONTEXT: &str = r#"

FILE: src/ai.rs
  type Provider (line 46) | pub enum Provider {
  type SessionIndex (line 55) | struct SessionIndex {
  type WebSession (line 61) | pub struct WebSession {
  type WebSessionMessage (line 72) | pub struct WebSessionMessage {
  type SessionHistory (line 78) | pub struct SessionHistory {
  type SessionMessages (line 86) | struct SessionMessages {
  method default (line 93) | fn default() -> Self {
  type CommitCheckpoints (line 104) | pub struct CommitCheckpoints {
  type CommitCheckpoint (line 110) | pub struct CommitCheckpoint {
  type SavedSession (line 120) | struct SavedSession {
  function default_provider (line 134) | fn default_provider() -> String {
  type AiSession (line 140) | struct AiSession {
  type JsonlEntry (line 159) | struct JsonlEntry {
  type CodexEntry (line 170) | struct CodexEntry {
  type CursorEntry (line 180) | struct CursorEntry {
  type SessionMessage (line 186) | struct SessionMessage {
  type CodexRecoverRow (line 192) | pub(crate) struct CodexRecoverRow {
  type CodexRecoverCandidate (line 206) | struct CodexRecoverCandidate {
  type CodexRecoverOutput (line 219) | struct CodexRecoverOutput {
  type CodexResolvedReference (line 230) | struct CodexResolvedReference {
  type CodexOpenPlan (line 240) | struct CodexOpenPlan {
  type CodexResolveReferenceSnapshot (line 261) | pub struct CodexResolveReferenceSnapshot {
  type CodexResolveRuntimeSkillSnapshot (line 271) | pub struct CodexResolveRuntimeSkillSnapshot {
  type CodexResolveInspectorResponse (line 284) | pub struct CodexResolveInspectorResponse {
  type CodexResolveWorkflowExplanation (line 306) | pub struct CodexResolveWorkflowExplanation {
  type CodexResolveWorkflowPacket (line 321) | pub struct CodexResolveWorkflowPacket {
  type CodexResolveWorkflowTrace (line 333) | pub struct CodexResolveWorkflowTrace {
  type CodexResolveWorkflowValidation (line 344) | pub struct CodexResolveWorkflowValidation {
  type CodexResolveWorkflowCommand (line 353) | pub struct CodexResolveWorkflowCommand {
  type CodexResolveWorkflowArtifact (line 360) | pub struct CodexResolveWorkflowArtifact {
  type CodexResolveWorkflowStep (line 368) | pub struct CodexResolveWorkflowStep {
  type CodexSessionReferenceRequest (line 374) | struct CodexSessionReferenceRequest {
  type LinearUrlReference (line 381) | struct LinearUrlReference {
  type LinearUrlKind (line 391) | enum LinearUrlKind {
  constant CODEX_QUERY_CACHE_VERSION (line 396) | const CODEX_QUERY_CACHE_VERSION: u32 = 1;
  constant CODEX_QUERY_CACHE_ENV_DISABLE (line 397) | const CODEX_QUERY_CACHE_ENV_DISABLE: &str = "FLOW_DISABLE_CODEX_QUERY_CA...
  constant CODEX_SESSION_COMPLETION_DEFAULT_SCAN_LIMIT (line 398) | const CODEX_SESSION_COMPLETION_DEFAULT_SCAN_LIMIT: usize = 24;
  constant CODEX_SESSION_COMPLETION_DEFAULT_IDLE_SECS (line 399) | const CODEX_SESSION_COMPLETION_DEFAULT_IDLE_SECS: u64 = 90;
  constant FLOW_CODEX_TRACE_SERVICE_NAME (line 400) | const FLOW_CODEX_TRACE_SERVICE_NAME: &str = "flow_codex";
  type CodexStateDbStamp (line 403) | struct CodexStateDbStamp {
  type CodexQueryCacheEntry (line 410) | struct CodexQueryCacheEntry {
  type CodexThreadSchema (line 417) | struct CodexThreadSchema {
  type CodexThreadSchemaCacheEntry (line 423) | struct CodexThreadSchemaCacheEntry {
  type CodexSessionCompletionSnapshot (line 429) | struct CodexSessionCompletionSnapshot {
  type CodexTurnPatchChange (line 439) | struct CodexTurnPatchChange {
  type PrFeedbackCursorHandoff (line 446) | struct PrFeedbackCursorHandoff {
  function run_provider (line 454) | pub fn run_provider(provider: Provider, action: Option<ProviderAiAction>...
  function run (line 659) | pub fn run(action: Option<AiAction>) -> Result<()> {
  function for_each_nonempty_jsonl_line (line 940) | fn for_each_nonempty_jsonl_line(path: &Path, mut on_line: impl FnMut(&st...
  function get_checkpoint_path (line 962) | fn get_checkpoint_path(project_path: &PathBuf) -> PathBuf {
  function load_checkpoints (line 970) | pub fn load_checkpoints(project_path: &PathBuf) -> Result<CommitCheckpoi...
  function save_checkpoint (line 981) | pub fn save_checkpoint(project_path: &PathBuf, checkpoint: CommitCheckpo...
  function log_review_result (line 995) | pub fn log_review_result(
  function log_commit_review (line 1028) | pub fn log_commit_review(
  type CommitReviewSummary (line 1074) | pub struct CommitReviewSummary {
  function log_commit_event (line 1084) | pub fn log_commit_event(
  function get_context_since_checkpoint (line 1126) | pub fn get_context_since_checkpoint() -> Result<Option<String>> {
  function get_context_since_checkpoint_for_path (line 1132) | pub fn get_context_since_checkpoint_for_path(project_path: &PathBuf) -> ...
  type GitEditSessionData (line 1194) | pub struct GitEditSessionData {
  type GitEditExchange (line 1204) | pub struct GitEditExchange {
  function get_session_ids_for_hash (line 1212) | pub fn get_session_ids_for_hash(project_path: &PathBuf) -> Result<(Vec<S...
  function get_sessions_for_gitedit (line 1228) | pub fn get_sessions_for_gitedit(project_path: &PathBuf) -> Result<Vec<Gi...
  function get_sessions_for_gitedit_between (line 1239) | pub fn get_sessions_for_gitedit_between(
  function get_session_exchanges_since (line 1302) | fn get_session_exchanges_since(
  function get_last_entry_timestamp (line 1407) | pub fn get_last_entry_timestamp() -> Result<Option<(String, String)>> {
  function get_last_entry_timestamp_for_path (line 1413) | pub fn get_last_entry_timestamp_for_path(
  function get_session_last_timestamp (line 1438) | fn get_session_last_timestamp(
  function read_context_since (line 1488) | fn read_context_since(
  function floor_char_boundary (line 1653) | fn floor_char_boundary(s: &str, pos: usize) -> usize {
  function truncate_message (line 1662) | fn truncate_message(msg: &str, max_chars: usize) -> String {
  function extract_intent (line 1671) | fn extract_intent(msg: &str, max_chars: usize) -> String {
  function read_codex_context_since (line 1695) | fn read_codex_context_since(
  function read_codex_last_context (line 1746) | fn read_codex_last_context(session_file: &PathBuf, count: usize) -> Resu...
  function read_codex_memory_exchanges (line 1774) | pub(crate) fn read_codex_memory_exchanges(
  function read_cursor_last_context (line 1796) | fn read_cursor_last_context(session_file: &PathBuf, count: usize) -> Res...
  function read_codex_exchanges (line 1824) | fn read_codex_exchanges(
  function read_cursor_exchanges (line 1876) | fn read_cursor_exchanges(
  function parse_timestamp_for_compare (line 1923) | fn parse_timestamp_for_compare(ts: &str) -> Option<chrono::DateTime<chro...
  type TimestampWindow (line 1933) | struct TimestampWindow<'a> {
  function parse_timestamp_window (line 1940) | fn parse_timestamp_window<'a>(
  function timestamp_in_window_cached (line 1952) | fn timestamp_in_window_cached(ts: &str, window: &TimestampWindow<'_>) ->...
  function get_codex_last_timestamp (line 1991) | fn get_codex_last_timestamp(session_file: &PathBuf) -> Result<Option<Str...
  function get_cursor_last_timestamp (line 2018) | fn get_cursor_last_timestamp(session_file: &PathBuf) -> Result<Option<St...
  function extract_codex_message (line 2022) | fn extract_codex_message(entry: &CodexEntry) -> Option<(String, String)> {
  function normalize_cursor_role (line 2063) | fn normalize_cursor_role(role: &str) -> &str {
  function extract_cursor_message (line 2071) | fn extract_cursor_message(entry: &CursorEntry) -> Option<(String, String...
  function get_recent_session_context (line 2087) | pub fn get_recent_session_context(max_exchanges: usize) -> Result<Option...
  function get_ai_sessions_dir (line 2128) | fn get_ai_sessions_dir() -> Result<PathBuf> {
  function get_index_path (line 2138) | fn get_index_path() -> Result<PathBuf> {
  function get_notes_dir (line 2143) | fn get_notes_dir() -> Result<PathBuf> {
  function load_index (line 2148) | fn load_index() -> Result<SessionIndex> {
  function load_index_for_path (line 2158) | fn load_index_for_path(project_path: &Path) -> Result<SessionIndex> {
  function get_sessions_for_web (line 2173) | pub fn get_sessions_for_web(project_path: &PathBuf) -> Result<Vec<WebSes...
  function read_session_messages_for_path (line 2235) | fn read_session_messages_for_path(
  function read_claude_messages_for_path (line 2247) | fn read_claude_messages_for_path(project_path: &Path, session_id: &str) ...
  function read_codex_messages (line 2296) | fn read_codex_messages(session_id: &str) -> Result<SessionMessages> {
  function read_cursor_messages (line 2328) | fn read_cursor_messages(session_id: &str) -> Result<SessionMessages> {
  function extract_codex_timestamp (line 2359) | fn extract_codex_timestamp(entry: &CodexEntry) -> Option<String> {
  function extract_message_text (line 2371) | fn extract_message_text(content_value: &serde_json::Value) -> Option<Str...
  function strip_tagged_block (line 2404) | fn strip_tagged_block(text: &str, open_tag: &str, close_tag: &str) -> St...
  function truncate_before_heading (line 2418) | fn truncate_before_heading(text: &str, heading: &str) -> String {
  function collapse_blank_lines (line 2432) | fn collapse_blank_lines(text: &str) -> String {
  function strip_known_transcript_scaffolding (line 2458) | fn strip_known_transcript_scaffolding(role: &str, text: &str) -> String {
  function normalize_session_message (line 2494) | fn normalize_session_message(role: &str, text: &str) -> Option<String> {
  function get_cursor_file_timestamp (line 2514) | fn get_cursor_file_timestamp(path: &Path) -> Option<String> {
  function push_message (line 2519) | fn push_message(messages: &mut Vec<WebSessionMessage>, role: &str, conte...
  function save_index (line 2537) | fn save_index(index: &SessionIndex) -> Result<()> {
  function get_claude_projects_dir (line 2548) | fn get_claude_projects_dir() -> PathBuf {
  function get_codex_projects_dir (line 2554) | fn get_codex_projects_dir() -> PathBuf {
  function get_codex_sessions_dir (line 2559) | fn get_codex_sessions_dir() -> PathBuf {
  function get_cursor_projects_dir (line 2564) | fn get_cursor_projects_dir() -> PathBuf {
  function path_to_project_name (line 2570) | fn path_to_project_name(path: &str) -> String {
  function path_to_cursor_project_key (line 2574) | fn path_to_cursor_project_key(path: &Path) -> String {
  function cursor_project_key_matches_path (line 2580) | fn cursor_project_key_matches_path(project_key: &str, path: &Path) -> bo...
  function decode_cursor_project_path (line 2589) | fn decode_cursor_project_path(project_key: &str) -> Option<PathBuf> {
  function collect_cursor_project_session_files (line 2647) | fn collect_cursor_project_session_files(project_dir: &Path) -> Vec<PathB...
  function read_sessions_for_project (line 2683) | fn read_sessions_for_project(provider: Provider) -> Result<Vec<AiSession...
  function resolve_session_target_path (line 2716) | fn resolve_session_target_path(path: Option<&str>) -> Result<PathBuf> {
  function read_sessions_for_target (line 2734) | fn read_sessions_for_target(provider: Provider, path: Option<&str>) -> R...
  function read_sessions_for_path (line 2740) | fn read_sessions_for_path(provider: Provider, path: &PathBuf) -> Result<...
  function read_provider_sessions_for_path (line 2774) | fn read_provider_sessions_for_path(provider: Provider, path: &PathBuf) -...
  function read_provider_sessions (line 2824) | fn read_provider_sessions(provider: Provider) -> Result<Vec<AiSession>> {
  function parse_session_file (line 2886) | fn parse_session_file(path: &PathBuf, session_id: &str, provider: Provid...
  function parse_codex_session_file (line 2957) | fn parse_codex_session_file(
  function parse_cursor_session_file (line 3038) | fn parse_cursor_session_file(path: &PathBuf, fallback_id: &str) -> Optio...
  function ai_session_from_codex_recover_row (line 3070) | fn ai_session_from_codex_recover_row(row: CodexRecoverRow) -> AiSession {
  function read_codex_sessions_for_path_from_files (line 3091) | fn read_codex_sessions_for_path_from_files(path: &PathBuf) -> Result<Vec...
  function read_codex_sessions_for_path (line 3116) | fn read_codex_sessions_for_path(path: &PathBuf) -> Result<Vec<AiSession>> {
  function read_cursor_sessions_for_path (line 3156) | fn read_cursor_sessions_for_path(path: &PathBuf) -> Result<Vec<AiSession...
  function collect_codex_session_files (line 3204) | fn collect_codex_session_files(root: &PathBuf) -> Vec<PathBuf> {
  function codex_session_id_from_path (line 3227) | fn codex_session_id_from_path(path: &Path) -> Option<String> {
  function cursor_session_id_from_path (line 3232) | fn cursor_session_id_from_path(path: &Path) -> Option<String> {
  function resolve_explicit_native_session (line 3238) | fn resolve_explicit_native_session(query: &str, provider: Provider) -> O...
  function resolve_session_selection (line 3258) | fn resolve_session_selection(
  function get_most_recent_session_id (line 3295) | fn get_most_recent_session_id() -> Result<Option<String>> {
  function format_session_ref (line 3300) | fn format_session_ref(session: &AiSession, include_provider: bool) -> St...
  function print_latest_session_id (line 3314) | fn print_latest_session_id(provider: Provider, path: Option<String>) -> ...
  type FzfSessionEntry (line 3341) | struct FzfSessionEntry {
  type ProviderSessionListRow (line 3348) | struct ProviderSessionListRow {
  function list_sessions (line 3357) | fn list_sessions(provider: Provider) -> Result<()> {
  function run_session_fzf (line 3507) | fn run_session_fzf(entries: &[FzfSessionEntry]) -> Result<Option<&FzfSes...
  function launch_session (line 3540) | fn launch_session(session_id: &str, provider: Provider) -> Result<bool> {
  function new_codex_session_trace (line 3544) | fn new_codex_session_trace(workflow_kind: &str) -> CodexResolveWorkflowT...
  function direct_codex_trace_query (line 3554) | fn direct_codex_trace_query(action: &str, route: &str, session_id: Optio...
  function record_direct_codex_launch_event (line 3570) | fn record_direct_codex_launch_event(
  function launch_session_for_target (line 3607) | fn launch_session_for_target(
  function launch_claude_continue (line 3677) | fn launch_claude_continue() -> Result<bool> {
  function launch_claude_resume_picker (line 3686) | fn launch_claude_resume_picker() -> Result<bool> {
  function detect_git_root (line 3695) | fn detect_git_root(path: &Path) -> Option<PathBuf> {
  function codex_trusted_paths (line 3715) | fn codex_trusted_paths() -> Vec<PathBuf> {
  function codex_trusted_paths_for (line 3722) | fn codex_trusted_paths_for(seed: &Path) -> Vec<PathBuf> {
  function codex_projects_override (line 3739) | fn codex_projects_override(paths: &[PathBuf]) -> Option<String> {
  function apply_codex_trust_overrides (line 3760) | fn apply_codex_trust_overrides(command: &mut Command) {
  function apply_codex_trust_overrides_for (line 3766) | fn apply_codex_trust_overrides_for(command: &mut Command, target_path: O...
  function apply_codex_runtime_state_to_command (line 3775) | fn apply_codex_runtime_state_to_command(command: &mut Command, runtime_s...
  function apply_codex_trace_env_to_command (line 3784) | fn apply_codex_trace_env_to_command(
  function codex_personal_env_keys (line 3800) | fn codex_personal_env_keys() -> Vec<String> {
  function codex_has_explicit_maple_env (line 3826) | fn codex_has_explicit_maple_env() -> bool {
  function apply_codex_personal_env_to_command (line 3835) | fn apply_codex_personal_env_to_command(command: &mut Command) {
  function codex_runtime_transport_enabled (line 3856) | fn codex_runtime_transport_enabled(target_path: &Path) -> bool {
  function launch_codex_resume_picker (line 3872) | fn launch_codex_resume_picker() -> Result<bool> {
  function launch_codex_continue_last_for_target (line 3886) | fn launch_codex_continue_last_for_target(target_path: Option<&Path>) -> ...
  function provider_name (line 3918) | fn provider_name(provider: Provider) -> &'static str {
  function ensure_provider_tty (line 3927) | fn ensure_provider_tty(provider: Provider, action: &str) -> Result<()> {
  function print_provider_session_listing (line 3939) | fn print_provider_session_listing(
  function provider_sessions (line 4050) | fn provider_sessions(provider: Provider, path: Option<String>, json: boo...
  function continue_session (line 4076) | fn continue_session(
  function quick_start_session (line 4142) | pub fn quick_start_session(provider: Provider) -> Result<()> {
  function new_session (line 4175) | fn new_session(provider: Provider) -> Result<()> {
  function new_session_for_target (line 4179) | fn new_session_for_target(
  function find_codex_session (line 4253) | fn find_codex_session(
  function find_and_copy_codex_session (line 4263) | fn find_and_copy_codex_session(
  function find_best_codex_session_match (line 4279) | fn find_best_codex_session_match(
  function recover_codex_sessions (line 4332) | fn recover_codex_sessions(
  function canonicalize_recover_path (line 4393) | fn canonicalize_recover_path(path: Option<String>) -> Result<PathBuf> {
  function normalize_recover_query (line 4407) | fn normalize_recover_query(parts: &[String]) -> Option<String> {
  function recover_query_tokens (line 4412) | fn recover_query_tokens(query: &str) -> Vec<String> {
  function looks_like_git_sha (line 4423) | fn looks_like_git_sha(token: &str) -> bool {
  function looks_like_codex_session_token (line 4427) | fn looks_like_codex_session_token(token: &str) -> bool {
  function extract_codex_session_hints (line 4462) | fn extract_codex_session_hints(query: &str) -> Vec<String> {
  function extract_codex_session_hint (line 4478) | fn extract_codex_session_hint(query: &str) -> Option<String> {
  function extract_codex_session_reference_request (line 4482) | fn extract_codex_session_reference_request(
  function starts_with_codex_session_lookup_only_phrase (line 4502) | fn starts_with_codex_session_lookup_only_phrase(query: &str) -> bool {
  function extract_codex_session_reference_user_request (line 4516) | fn extract_codex_session_reference_user_request(
  function strip_codex_session_followup_prefix (line 4536) | fn strip_codex_session_followup_prefix(value: &str) -> &str {
  function extract_codex_session_reference_count (line 4573) | fn extract_codex_session_reference_count(query_text: &str, session_hints...
  function strip_codex_session_window_prefix (line 4591) | fn strip_codex_session_window_prefix(value: &str) -> &str {
  function codex_session_window_regex (line 4599) | fn codex_session_window_regex() -> &'static Regex {
  function resolve_builtin_codex_session_reference (line 4607) | fn resolve_builtin_codex_session_reference(
  function render_codex_session_reference (line 4630) | fn render_codex_session_reference(row: &CodexRecoverRow, count: usize, e...
  function codex_sqlite_home (line 4651) | fn codex_sqlite_home() -> Result<PathBuf> {
  function parse_codex_versioned_db_filename (line 4662) | fn parse_codex_versioned_db_filename(file_name: &str, prefix: &str) -> O...
  function select_codex_state_db_path (line 4670) | fn select_codex_state_db_path(sqlite_home: &Path) -> Result<PathBuf> {
  function codex_state_db_path (line 4697) | fn codex_state_db_path() -> Result<PathBuf> {
  function codex_query_cache_disabled (line 4701) | fn codex_query_cache_disabled() -> bool {
  function codex_query_cache_root (line 4713) | fn codex_query_cache_root() -> Result<PathBuf> {
  function codex_session_completion_markers_dir (line 4719) | fn codex_session_completion_markers_dir() -> Result<PathBuf> {
  function codex_session_completion_scan_limit (line 4725) | fn codex_session_completion_scan_limit() -> usize {
  function codex_session_completion_idle_secs (line 4733) | fn codex_session_completion_idle_secs() -> u64 {
  function prune_codex_session_completion_markers (line 4741) | fn prune_codex_session_completion_markers(now_unix: u64) -> Result<()> {
  function claim_codex_session_completion_marker (line 4768) | fn claim_codex_session_completion_marker(session_id: &str, assistant_at_...
  function codex_query_cache_entry_count (line 4785) | fn codex_query_cache_entry_count() -> usize {
  function codex_query_cache_store (line 4799) | fn codex_query_cache_store() -> &'static Mutex<HashMap<PathBuf, CodexQue...
  function codex_thread_schema_cache (line 4804) | fn codex_thread_schema_cache() -> &'static Mutex<HashMap<PathBuf, CodexT...
  function unix_now_secs (line 4809) | fn unix_now_secs() -> u64 {
  function codex_state_db_stamp (line 4816) | fn codex_state_db_stamp(path: &Path) -> Result<CodexStateDbStamp> {
  function read_codex_thread_schema (line 4832) | fn read_codex_thread_schema(conn: &Connection) -> Result<CodexThreadSche...
  function load_codex_thread_schema (line 4849) | fn load_codex_thread_schema(db_path: &Path) -> Result<CodexThreadSchema> {
  function codex_recover_select_sql (line 4874) | fn codex_recover_select_sql(schema: &CodexThreadSchema) -> String {
  function map_codex_recover_row (line 4901) | fn map_codex_recover_row(row: &rusqlite::Row<'_>) -> rusqlite::Result<Co...
  function codex_query_cache_path (line 4914) | fn codex_query_cache_path(
  function read_codex_query_cache (line 4924) | fn read_codex_query_cache(path: &Path, stamp: &CodexStateDbStamp) -> Opt...
  function write_codex_query_cache (line 4949) | fn write_codex_query_cache(path: &Path, entry: &CodexQueryCacheEntry) ->...
  function with_codex_query_cache (line 4991) | fn with_codex_query_cache<F>(
  function escape_like (line 5020) | fn escape_like(value: &str) -> String {
  function read_recent_codex_threads (line 5027) | fn read_recent_codex_threads(
  function read_recent_codex_threads_local (line 5042) | pub(crate) fn read_recent_codex_threads_local(
  function read_recent_codex_threads_global_local (line 5103) | fn read_recent_codex_threads_global_local(limit: usize) -> Result<Vec<Co...
  function read_codex_threads_by_session_hint (line 5127) | fn read_codex_threads_by_session_hint(
  function read_codex_threads_by_session_hint_local (line 5143) | pub(crate) fn read_codex_threads_by_session_hint_local(
  function search_codex_threads_for_find (line 5181) | fn search_codex_threads_for_find(
  function search_codex_threads_for_find_local (line 5196) | pub(crate) fn search_codex_threads_for_find_local(
  function codex_find_search_terms (line 5278) | fn codex_find_search_terms(query: &str) -> Vec<String> {
  function tokenize_recover_query (line 5297) | fn tokenize_recover_query(query: &str) -> Vec<String> {
  function rank_recover_rows (line 5308) | fn rank_recover_rows(rows: &mut Vec<CodexRecoverRow>, query: Option<&str...
  function recover_row_score (line 5330) | fn recover_row_score(row: &CodexRecoverRow, normalized_query: &str, toke...
  function build_recover_output (line 5410) | fn build_recover_output(
  function infer_recover_route (line 5452) | fn infer_recover_route(
  function shell_escape_path (line 5472) | fn shell_escape_path(path: &Path) -> String {
  function build_recover_summary (line 5484) | fn build_recover_summary(
  function truncate_recover_id (line 5529) | fn truncate_recover_id(value: &str) -> String {
  function truncate_recover_text (line 5533) | fn truncate_recover_text(value: &str) -> String {
  function format_unix_ts (line 5542) | fn format_unix_ts(ts: i64) -> String {
  function codex_model_label (line 5548) | fn codex_model_label(model: Option<&str>, reasoning_effort: Option<&str>...
  function print_recover_output (line 5562) | fn print_recover_output(output: &CodexRecoverOutput) {
  function open_codex_session (line 5609) | fn open_codex_session(
  function connect_codex_session (line 5625) | fn connect_codex_session(
  function resolve_codex_input (line 5726) | fn resolve_codex_input(
  function codex_resolve_inspector (line 5752) | pub fn codex_resolve_inspector(
  function build_codex_resolve_workflow_explanation (line 5791) | fn build_codex_resolve_workflow_explanation(
  function build_pr_feedback_workflow_explanation (line 5960) | fn build_pr_feedback_workflow_explanation(
  function parse_reference_fields (line 6120) | fn parse_reference_fields(output: &str) -> BTreeMap<String, String> {
  function push_workflow_artifact (line 6142) | fn push_workflow_artifact(
  function load_runtime_skills_from_plan (line 6157) | fn load_runtime_skills_from_plan(
  constant DEFAULT_GLOBAL_CODEX_WRAPPER_BIN (line 6183) | const DEFAULT_GLOBAL_CODEX_WRAPPER_BIN: &str = "~/code/flow/scripts/code...
  constant DEFAULT_GLOBAL_CODEX_HOME_SESSION_PATH (line 6184) | const DEFAULT_GLOBAL_CODEX_HOME_SESSION_PATH: &str = "~/repos/openai/cod...
  constant DEFAULT_GLOBAL_CODEX_SKILL_SOURCE_NAME (line 6185) | const DEFAULT_GLOBAL_CODEX_SKILL_SOURCE_NAME: &str = "vercel-labs-skills";
  constant DEFAULT_GLOBAL_CODEX_SKILL_SOURCE_PATH (line 6186) | const DEFAULT_GLOBAL_CODEX_SKILL_SOURCE_PATH: &str = "~/repos/vercel-lab...
  constant DEFAULT_GLOBAL_CODEX_PROMPT_BUDGET (line 6187) | const DEFAULT_GLOBAL_CODEX_PROMPT_BUDGET: usize = 1200;
  constant DEFAULT_GLOBAL_CODEX_MAX_REFERENCES (line 6188) | const DEFAULT_GLOBAL_CODEX_MAX_REFERENCES: usize = 2;
  constant CODEX_SKILL_EVAL_LAUNCHD_LABEL (line 6189) | const CODEX_SKILL_EVAL_LAUNCHD_LABEL: &str = "dev.nikiv.flow-codex-skill...
  type CodexSkillEvalScheduleStatus (line 6193) | enum CodexSkillEvalScheduleStatus {
    method as_str (line 6201) | fn as_str(self) -> &'static str {
    method ready (line 6210) | fn ready(self) -> bool {
  type CodexDoctorSnapshot (line 6217) | pub struct CodexDoctorSnapshot {
  type CodexSkillsDashboardResponse (line 6254) | pub struct CodexSkillsDashboardResponse {
  type CodexEvalRouteSnapshot (line 6261) | pub struct CodexEvalRouteSnapshot {
  type CodexEvalSkillSnapshot (line 6273) | pub struct CodexEvalSkillSnapshot {
  type CodexEvalOpportunity (line 6285) | pub struct CodexEvalOpportunity {
  type CodexEvalCommand (line 6294) | pub struct CodexEvalCommand {
  type CodexEvalSnapshot (line 6301) | pub struct CodexEvalSnapshot {
  type CodexEvalQualitySnapshot (line 6318) | pub struct CodexEvalQualitySnapshot {
  function codex_skill_eval_launchd_plist_path (line 6325) | fn codex_skill_eval_launchd_plist_path() -> PathBuf {
  function codex_skill_eval_launchd_status (line 6332) | fn codex_skill_eval_launchd_status() -> CodexSkillEvalScheduleStatus {
  function collect_codex_doctor_snapshot (line 6354) | fn collect_codex_doctor_snapshot(target_path: &Path) -> Result<CodexDoct...
  function codex_skills_dashboard_snapshot (line 6513) | pub fn codex_skills_dashboard_snapshot(
  function codex_skill_source_sync (line 6524) | pub fn codex_skill_source_sync(
  function print_codex_doctor (line 6533) | fn print_codex_doctor(snapshot: &CodexDoctorSnapshot) {
  function assert_codex_doctor (line 6606) | fn assert_codex_doctor(
  function codexd_learning_refresh_interval_secs (line 6668) | fn codexd_learning_refresh_interval_secs() -> u64 {
  function codexd_learning_refresh_state (line 6676) | fn codexd_learning_refresh_state() -> &'static Mutex<u64> {
  function maybe_run_codex_learning_refresh (line 6681) | pub(crate) fn maybe_run_codex_learning_refresh() -> Result<usize> {
  function codex_eval_commands (line 6707) | fn codex_eval_commands(target_path: &Path) -> Vec<CodexEvalCommand> {
  function codex_eval_failure_modes (line 6733) | fn codex_eval_failure_modes(doctor: &CodexDoctorSnapshot) -> Vec<String> {
  function build_codex_eval_quality (line 6747) | fn build_codex_eval_quality(
  function build_codex_eval_summary (line 6780) | fn build_codex_eval_summary(
  function build_codex_eval_opportunities (line 6815) | fn build_codex_eval_opportunities(
  function codex_eval_snapshot (line 6933) | pub fn codex_eval_snapshot(target_path: &Path, limit: usize) -> Result<C...
  function print_codex_eval (line 7032) | fn print_codex_eval(snapshot: &CodexEvalSnapshot) {
  function codex_eval (line 7094) | fn codex_eval(
  function parse_global_flow_toml (line 7118) | fn parse_global_flow_toml(path: &Path) -> Result<toml::value::Table> {
  function ensure_toml_table (line 7137) | fn ensure_toml_table<'a>(
  function write_string_atomically (line 7153) | fn write_string_atomically(path: &Path, content: &str) -> Result<()> {
  function upsert_global_codex_config (line 7171) | fn upsert_global_codex_config(path: &Path) -> Result<(String, bool, bool...
  function install_codex_skill_eval_launchd (line 7255) | fn install_codex_skill_eval_launchd(
  function codex_enable_global (line 7294) | fn codex_enable_global(
  function codex_doctor (line 7400) | fn codex_doctor(
  type CodexQuickLaunchEvent (line 7435) | struct CodexQuickLaunchEvent {
  type CodexQuickLaunchHydration (line 7445) | struct CodexQuickLaunchHydration {
  function codex_quick_launch_log_path (line 7455) | fn codex_quick_launch_log_path() -> Result<PathBuf> {
  function codex_quick_launch_hydrations_path (line 7461) | fn codex_quick_launch_hydrations_path() -> Result<PathBuf> {
  function log_codex_quick_launch_event (line 7467) | fn log_codex_quick_launch_event(event: &CodexQuickLaunchEvent) -> Result...
  function log_codex_quick_launch_hydration (line 7484) | fn log_codex_quick_launch_hydration(hydration: &CodexQuickLaunchHydratio...
  function load_recent_codex_quick_launches (line 7502) | fn load_recent_codex_quick_launches(limit: usize) -> Result<Vec<CodexQui...
  function load_hydrated_codex_quick_launch_ids (line 7525) | fn load_hydrated_codex_quick_launch_ids() -> Result<BTreeSet<String>> {
  function parse_rfc3339_to_unix (line 7539) | fn parse_rfc3339_to_unix(value: &str) -> Option<u64> {
  function read_codex_first_user_message_since (line 7545) | fn read_codex_first_user_message_since(
  function file_modified_unix (line 7583) | fn file_modified_unix(path: &Path) -> Option<u64> {
  function read_codex_session_completion_snapshot (line 7593) | fn read_codex_session_completion_snapshot(
  function assistant_completion_summary (line 7640) | fn assistant_completion_summary(text: &str) -> Option<String> {
  function select_codex_session_completion_summary (line 7674) | fn select_codex_session_completion_summary(
  function build_codex_session_completion_event (line 7697) | fn build_codex_session_completion_event(
  function read_codex_turn_patch_changes (line 7715) | fn read_codex_turn_patch_changes(
  function parse_apply_patch_changes (line 7772) | fn parse_apply_patch_changes(input: &str, session_cwd: &str) -> Vec<Code...
  function resolve_patch_path (line 7836) | fn resolve_patch_path(path: &str, session_cwd: &str) -> String {
  function fish_fn_path (line 7844) | fn fish_fn_path() -> String {
  function is_fish_fn_path (line 7854) | fn is_fish_fn_path(path: &str) -> bool {
  function summarize_fish_fn_change (line 7858) | fn summarize_fish_fn_change(text: &str) -> Option<String> {
  function build_fish_fn_changed_event (line 7903) | fn build_fish_fn_changed_event(
  function changed_file_label (line 7918) | fn changed_file_label(path: &str) -> String {
  function summarize_generic_changed_files (line 7930) | fn summarize_generic_changed_files(changes: &[CodexTurnPatchChange]) -> ...
  function build_codex_session_changed_events (line 7948) | fn build_codex_session_changed_events(
  function hydrate_codex_quick_launch (line 8019) | fn hydrate_codex_quick_launch(
  function reconcile_pending_codex_quick_launches (line 8073) | fn reconcile_pending_codex_quick_launches(limit: usize) -> Result<usize> {
  function reconcile_codex_session_completions (line 8140) | pub(crate) fn reconcile_codex_session_completions(limit: usize) -> Resul...
  function run_codex_background_maintenance (line 8187) | pub(crate) fn run_codex_background_maintenance() -> Result<(usize, usize...
  function maybe_run_codex_telemetry_export (line 8193) | pub(crate) fn maybe_run_codex_telemetry_export(limit: usize) -> Result<u...
  function codex_touch_launch (line 8197) | fn codex_touch_launch(mode: String, cwd: Option<String>, provider: Provi...
  function codex_daemon_command (line 8233) | fn codex_daemon_command(action: Option<CodexDaemonAction>, provider: Pro...
  function codex_memory_command (line 8252) | fn codex_memory_command(action: Option<CodexMemoryAction>, provider: Pro...
  function codex_telemetry_command (line 8358) | fn codex_telemetry_command(
  function codex_trace_command (line 8420) | fn codex_trace_command(action: Option<CodexTraceAction>, provider: Provi...
  function codex_skill_eval_command (line 8524) | fn codex_skill_eval_command(
  function codex_skill_source_command (line 8655) | fn codex_skill_source_command(
  function codex_runtime_command (line 8700) | fn codex_runtime_command(action: Option<CodexRuntimeAction>, provider: P...
  function normalize_codex_resolve_args (line 8736) | fn normalize_codex_resolve_args(query: Vec<String>, json_output: bool) -...
  function build_codex_open_plan (line 8751) | fn build_codex_open_plan(
  function build_codex_commit_workflow_plan (line 8979) | fn build_codex_commit_workflow_plan(
  function build_codex_sync_workflow_plan (line 9048) | fn build_codex_sync_workflow_plan(
  function execute_codex_open_plan (line 9090) | fn execute_codex_open_plan(plan: &CodexOpenPlan) -> Result<()> {
  function maybe_open_cursor_for_pr_feedback_check (line 9130) | fn maybe_open_cursor_for_pr_feedback_check(plan: &CodexOpenPlan) {
  function env_flag_is_false (line 9156) | fn env_flag_is_false(name: &str) -> bool {
  function parse_pr_feedback_cursor_handoff (line 9166) | fn parse_pr_feedback_cursor_handoff(value: &str) -> Option<PrFeedbackCur...
  function command_on_path (line 9190) | fn command_on_path(command: &str) -> bool {
  function open_cursor_review_handoff (line 9197) | fn open_cursor_review_handoff(handoff: &PrFeedbackCursorHandoff) -> Resu...
  function print_codex_open_plan (line 9216) | fn print_codex_open_plan(plan: &CodexOpenPlan) {
  function record_codex_open_plan (line 9256) | fn record_codex_open_plan(plan: &CodexOpenPlan, mode: &str) {
  function load_codex_config_for_path (line 9317) | fn load_codex_config_for_path(target_path: &Path) -> config::CodexConfig {
  function default_codex_connect_path (line 9339) | fn default_codex_connect_path() -> PathBuf {
  function resolve_codex_connect_target_path (line 9358) | fn resolve_codex_connect_target_path(path: Option<String>) -> Result<Pat...
  function looks_like_recovery_prompt (line 9369) | fn looks_like_recovery_prompt(normalized_query: &str) -> bool {
  function looks_like_commit_workflow_query (line 9381) | fn looks_like_commit_workflow_query(normalized_query: &str) -> bool {
  function looks_like_prom_sync_workflow_query (line 9403) | fn looks_like_prom_sync_workflow_query(normalized_query: &str) -> bool {
  function looks_like_session_lookup_query (line 9417) | fn looks_like_session_lookup_query(normalized_query: &str) -> bool {
  function looks_like_directional_session_query (line 9426) | fn looks_like_directional_session_query(query: &str) -> bool {
  function contains_lookup_subject (line 9432) | fn contains_lookup_subject(query: &str) -> bool {
  function starts_with_session_control_phrase (line 9445) | fn starts_with_session_control_phrase(query: &str) -> bool {
  function resolve_codex_session_lookup (line 9463) | fn resolve_codex_session_lookup(
  function resolve_directional_session_lookup (line 9509) | fn resolve_directional_session_lookup(
  function split_directional_query (line 9561) | fn split_directional_query(query: &str) -> Option<(String, String)> {
  function find_word_boundary (line 9571) | fn find_word_boundary(text: &str, needle: &str) -> Option<usize> {
  function parse_ordinal_index (line 9590) | fn parse_ordinal_index(query: &str) -> Option<usize> {
  function looks_like_latest_query (line 9618) | fn looks_like_latest_query(query: &str) -> bool {
  function strip_codex_control_words (line 9627) | fn strip_codex_control_words(query: &str) -> Vec<String> {
  function build_codex_recovery_plan (line 9665) | fn build_codex_recovery_plan(
  function build_recovery_prompt (line 9719) | fn build_recovery_prompt(
  function build_codex_open_no_match_message (line 9762) | fn build_codex_open_no_match_message(
  function resolve_codex_references (line 9779) | fn resolve_codex_references(
  function resolve_builtin_repo_references (line 9835) | fn resolve_builtin_repo_references(
  function resolve_external_reference (line 9867) | fn resolve_external_reference(
  function render_reference_resolver_command (line 9935) | fn render_reference_resolver_command(
  function resolve_builtin_linear_reference (line 9950) | fn resolve_builtin_linear_reference(
  function resolve_builtin_url_reference (line 9969) | fn resolve_builtin_url_reference(
  function resolve_builtin_commit_workflow_reference (line 10009) | fn resolve_builtin_commit_workflow_reference(repo_root: &Path) -> Result...
  function resolve_builtin_sync_workflow_reference (line 10040) | fn resolve_builtin_sync_workflow_reference(repo_root: &Path) -> Result<C...
  function capture_git_stdout (line 10058) | fn capture_git_stdout(repo_root: &Path, args: &[&str]) -> Option<String> {
  function render_commit_workflow_reference (line 10075) | fn render_commit_workflow_reference(
  function render_sync_workflow_reference (line 10143) | fn render_sync_workflow_reference(repo_root: &Path, agents_instructions:...
  function render_compact_bullet_block (line 10169) | fn render_compact_bullet_block(value: &str, max_lines: usize) -> String {
  function read_repo_agents_instructions (line 10184) | fn read_repo_agents_instructions(repo_root: &Path) -> Option<String> {
  function detect_commit_workflow_kit_gate (line 10194) | fn detect_commit_workflow_kit_gate(repo_root: &Path) -> Option<String> {
  function is_prom_workspace_path (line 10204) | fn is_prom_workspace_path(path: &Path) -> bool {
  function detect_sync_workflow_command (line 10209) | fn detect_sync_workflow_command(repo_root: &Path) -> Option<String> {
  function extract_reference_candidates (line 10216) | fn extract_reference_candidates(query_text: &str) -> Vec<String> {
  function trim_reference_token (line 10238) | fn trim_reference_token(value: &str) -> &str {
  function looks_like_http_url (line 10247) | fn looks_like_http_url(value: &str) -> bool {
  function looks_like_github_pr_url (line 10252) | fn looks_like_github_pr_url(value: &str) -> bool {
  function looks_like_pr_feedback_query (line 10265) | fn looks_like_pr_feedback_query(query_text: &str) -> bool {
  function wildcard_match (line 10275) | fn wildcard_match(pattern: &str, candidate: &str) -> bool {
  function parse_linear_url_reference (line 10305) | fn parse_linear_url_reference(value: &str) -> Option<LinearUrlReference> {
  function humanize_linear_slug (line 10347) | fn humanize_linear_slug(value: &str) -> String {
  function render_linear_url_reference (line 10362) | fn render_linear_url_reference(reference: &LinearUrlReference) -> String {
  function build_codex_prompt (line 10383) | fn build_codex_prompt(
  function build_codex_prompt_with_runtime (line 10439) | fn build_codex_prompt_with_runtime(
  function has_session_reference (line 10454) | fn has_session_reference(references: &[CodexResolvedReference]) -> bool {
  function effective_max_resolved_references (line 10460) | fn effective_max_resolved_references(codex_cfg: &config::CodexConfig) ->...
  function effective_prompt_context_budget_chars (line 10464) | fn effective_prompt_context_budget_chars(
  function new_workflow_trace_id (line 10474) | fn new_workflow_trace_id() -> String {
  function new_workflow_span_id (line 10478) | fn new_workflow_span_id() -> String {
  function workflow_kind_from_route (line 10482) | fn workflow_kind_from_route(route: &str) -> String {
  function trace_context_from_reference (line 10489) | fn trace_context_from_reference(
  function derive_codex_open_plan_trace (line 10507) | fn derive_codex_open_plan_trace(plan: &CodexOpenPlan) -> Option<CodexRes...
  function finalize_codex_open_plan (line 10526) | fn finalize_codex_open_plan(mut plan: CodexOpenPlan) -> CodexOpenPlan {
  function runtime_skill_names (line 10545) | fn runtime_skill_names(runtime: Option<&codex_runtime::CodexRuntimeActiv...
  function compact_codex_context_block (line 10562) | fn compact_codex_context_block(value: &str, max_lines: usize, max_chars:...
  function copy_session (line 10589) | fn copy_session(session: Option<String>, provider: Provider) -> Result<(...
  function copy_session_history_to_clipboard (line 10734) | fn copy_session_history_to_clipboard(session_id: &str, provider: Provide...
  function copy_last_session (line 10742) | fn copy_last_session(provider: Provider, search: Option<String>) -> Resu...
  function copy_session_by_search (line 10784) | fn copy_session_by_search(provider: Provider, query: &str) -> Result<()> {
  function append_history_message (line 10931) | fn append_history_message(
  function read_session_history (line 10963) | fn read_session_history(session_id: &str, provider: Provider) -> Result<...
  function extract_content_text (line 11047) | fn extract_content_text(content: Option<&serde_json::Value>) -> String {
  function strip_system_reminders (line 11070) | fn strip_system_reminders(text: &str) -> String {
  function is_session_boilerplate (line 11086) | fn is_session_boilerplate(text: &str) -> bool {
  function copy_context (line 11142) | fn copy_context(
  function show_session (line 11296) | fn show_session(
  function read_last_context (line 11356) | fn read_last_context(
  function copy_to_clipboard (line 11453) | fn copy_to_clipboard(text: &str) -> Result<()> {
  function strip_thinking_blocks (line 11512) | fn strip_thinking_blocks(s: &str) -> String {
  function truncate_str (line 11535) | fn truncate_str(s: &str, max: usize) -> String {
  function format_relative_time (line 11548) | fn format_relative_time(ts: &str) -> String {
  function is_auto_generated_name (line 11592) | fn is_auto_generated_name(name: &str) -> bool {
  function extract_error_summary (line 11598) | fn extract_error_summary(entry: &JsonlEntry) -> Option<String> {
  function extract_codex_user_message (line 11633) | fn extract_codex_user_message(entry: &CodexEntry) -> Option<String> {
  function extract_codex_error_summary (line 11669) | fn extract_codex_error_summary(entry: &CodexEntry) -> Option<String> {
  function extract_codex_content_text (line 11698) | fn extract_codex_content_text(value: &serde_json::Value) -> Option<Strin...
  function clean_summary (line 11728) | fn clean_summary(s: &str) -> String {
  constant GEMINI_API_URL (line 11752) | const GEMINI_API_URL: &str = "https://generativelanguage.googleapis.com/...
  constant DEFAULT_GEMINI_MODEL (line 11753) | const DEFAULT_GEMINI_MODEL: &str = "gemini-1.5-flash";
  constant DEFAULT_SUMMARY_AGE_MINUTES (line 11754) | const DEFAULT_SUMMARY_AGE_MINUTES: i64 = 45;
  constant DEFAULT_SUMMARY_MAX_CHARS (line 11755) | const DEFAULT_SUMMARY_MAX_CHARS: usize = 12_000;
  constant DEFAULT_HANDOFF_MAX_CHARS (line 11756) | const DEFAULT_HANDOFF_MAX_CHARS: usize = 6_000;
  function get_session_summaries_path (line 11758) | fn get_session_summaries_path(project_path: &PathBuf) -> PathBuf {
  function load_session_summaries (line 11765) | fn load_session_summaries(project_path: &PathBuf) -> Result<SessionSumma...
  function save_session_summaries (line 11775) | fn save_session_summaries(project_path: &PathBuf, summaries: &SessionSum...
  function summary_key (line 11785) | fn summary_key(session: &CrossProjectSession) -> String {
  function get_summary_cache_entry (line 11795) | fn get_summary_cache_entry<'a>(
  function summary_age_minutes (line 11812) | fn summary_age_minutes() -> i64 {
  function summary_max_chars (line 11819) | fn summary_max_chars() -> usize {
  function handoff_max_chars (line 11826) | fn handoff_max_chars() -> usize {
  function gemini_model (line 11833) | fn gemini_model() -> String {
  function get_gemini_api_key (line 11837) | fn get_gemini_api_key() -> Result<String> {
  function truncate_for_summary (line 11863) | fn truncate_for_summary(context: &str) -> String {
  function truncate_for_handoff (line 11872) | fn truncate_for_handoff(context: &str) -> String {
  function should_summarize (line 11881) | fn should_summarize(last_ts: &str) -> bool {
  function summarize_session_with_gemini (line 11889) | fn summarize_session_with_gemini(context: &str) -> Result<SessionSummary> {
  function summarize_handoff_with_gemini (line 11960) | fn summarize_handoff_with_gemini(context: &str) -> Result<String> {
  function parse_summary_response (line 12028) | fn parse_summary_response(content: &str) -> Result<SessionSummaryRespons...
  function extract_json_object (line 12038) | fn extract_json_object(s: &str) -> Option<String> {
  type GeminiResponse (line 12048) | struct GeminiResponse {
  type GeminiCandidate (line 12053) | struct GeminiCandidate {
  type GeminiContent (line 12058) | struct GeminiContent {
  type GeminiPart (line 12063) | struct GeminiPart {
  type SessionSummaryResponse (line 12068) | struct SessionSummaryResponse {
  function get_display_summary (line 12073) | fn get_display_summary(
  function get_latest_session_ref_for_path (line 12088) | pub fn get_latest_session_ref_for_path(project_path: &PathBuf) -> Result...
  function get_latest_session_history_for_path (line 12096) | pub fn get_latest_session_history_for_path(
  function maybe_update_summary (line 12131) | fn maybe_update_summary(
  function save_summary_cache (line 12165) | fn save_summary_cache(cache: &mut HashMap<PathBuf, SummaryCacheEntry>) -...
  function get_session_last_timestamp_for_session (line 12175) | fn get_session_last_timestamp_for_session(session: &CrossProjectSession)...
  function resume_session (line 12195) | fn resume_session(session: Option<String>, path: Option<String>, provide...
  function save_session (line 12323) | fn save_session(name: &str, id: Option<String>) -> Result<()> {
  function open_notes (line 12365) | fn open_notes(session: &str) -> Result<()> {
  function remove_session (line 12406) | fn remove_session(session: &str) -> Result<()> {
  function init_ai_folder (line 12428) | fn init_ai_folder() -> Result<()> {
  function ensure_gitignore (line 12452) | fn ensure_gitignore() -> Result<()> {
  function auto_import_sessions (line 12485) | fn auto_import_sessions() -> Result<()> {
  function import_sessions (line 12549) | fn import_sessions() -> Result<()> {
  function generate_session_name (line 12619) | fn generate_session_name(session: &AiSession, index: &SessionIndex) -> S...
  type CrossProjectSession (line 12680) | struct CrossProjectSession {
  type SessionSummaries (line 12692) | struct SessionSummaries {
  type SessionSummary (line 12697) | struct SessionSummary {
  type SessionChapter (line 12706) | struct SessionChapter {
  type SummaryCacheEntry (line 12711) | struct SummaryCacheEntry {
  type ConsumedCheckpoints (line 12718) | struct ConsumedCheckpoints {
  type ConsumedEntry (line 12724) | struct ConsumedEntry {
  function run_sessions (line 12734) | pub fn run_sessions(opts: &SessionsOpts) -> Result<()> {
  function scan_all_project_sessions (line 12919) | fn scan_all_project_sessions(provider: Provider) -> Result<Vec<CrossProj...
  function scan_project_sessions (line 13075) | fn scan_project_sessions(project_folder: &PathBuf, provider: Provider) -...
  function extract_project_name (line 13107) | fn extract_project_name(folder: &PathBuf) -> String {
  function folder_to_path (line 13120) | fn folder_to_path(folder: &PathBuf) -> PathBuf {
  function get_cross_project_context (line 13128) | fn get_cross_project_context(
  function read_cross_project_context (line 13154) | fn read_cross_project_context(
  function find_codex_session_file (line 13288) | fn find_codex_session_file(session_id: &str) -> Option<PathBuf> {
  function find_cursor_session_file (line 13317) | fn find_cursor_session_file(session_id: &str) -> Option<PathBuf> {
  function read_codex_cross_project_context (line 13341) | fn read_codex_cross_project_context(
  function read_cursor_cross_project_context (line 13385) | fn read_cursor_cross_project_context(
  function get_consumed_checkpoints_path (line 13430) | fn get_consumed_checkpoints_path(project_path: &PathBuf) -> PathBuf {
  function load_consumed_checkpoints (line 13438) | fn load_consumed_checkpoints(project_path: &PathBuf) -> Result<ConsumedC...
  function save_consumed_checkpoint (line 13449) | fn save_consumed_checkpoint(session: &CrossProjectSession) -> Result<()> {
  function get_session_last_timestamp_for_path (line 13484) | fn get_session_last_timestamp_for_path(
  function init_temp_git_repo (line 13538) | fn init_temp_git_repo() -> tempfile::TempDir {
  function decode_cursor_project_path_handles_hyphenated_components (line 13550) | fn decode_cursor_project_path_handles_hyphenated_components() {
  function parse_cursor_session_file_extracts_messages (line 13576) | fn parse_cursor_session_file_extracts_messages() {
  function normalize_session_message_strips_setup_scaffolding (line 13599) | fn normalize_session_message_strips_setup_scaffolding() {
  function normalize_codex_resolve_args_accepts_trailing_json_flag (line 13628) | fn normalize_codex_resolve_args_accepts_trailing_json_flag() {
  function select_codex_state_db_path_prefers_highest_version (line 13649) | fn select_codex_state_db_path_prefers_highest_version() {
  function read_codex_thread_schema_detects_optional_columns (line 13660) | fn read_codex_thread_schema_detects_optional_columns() {
  function read_codex_first_user_message_since_prefers_first_post_launch_turn (line 13704) | fn read_codex_first_user_message_since_prefers_first_post_launch_turn() {
  function read_codex_first_user_message_since_skips_contextual_scaffolding (line 13727) | fn read_codex_first_user_message_since_skips_contextual_scaffolding() {
  function append_history_message_skips_consecutive_duplicates (line 13749) | fn append_history_message_skips_consecutive_duplicates() {
  function codex_find_search_terms_keep_phrase_and_meaningful_tokens (line 13762) | fn codex_find_search_terms_keep_phrase_and_meaningful_tokens() {
  function rank_recover_rows_prefers_matching_session_id_prefix (line 13776) | fn rank_recover_rows_prefers_matching_session_id_prefix() {
  function extract_codex_session_hint_prefers_uuid_like_token (line 13806) | fn extract_codex_session_hint_prefers_uuid_like_token() {
  function extract_codex_session_hint_ignores_git_sha_like_token (line 13816) | fn extract_codex_session_hint_ignores_git_sha_like_token() {
  function extract_codex_session_reference_request_parses_count_and_followup (line 13824) | fn extract_codex_session_reference_request_parses_count_and_followup() {
  function extract_codex_session_reference_request_supports_two_session_hints (line 13840) | fn extract_codex_session_reference_request_supports_two_session_hints() {
  function extract_codex_session_reference_request_requires_followup_work (line 13861) | fn extract_codex_session_reference_request_requires_followup_work() {
  function extract_codex_session_reference_request_does_not_steal_resume_queries (line 13872) | fn extract_codex_session_reference_request_does_not_steal_resume_queries...
  function infer_recover_route_changes_directory_for_cross_repo_candidate (line 13883) | fn infer_recover_route_changes_directory_for_cross_repo_candidate() {
  function session_lookup_detection_stays_conservative_for_general_session_work (line 13907) | fn session_lookup_detection_stays_conservative_for_general_session_work() {
  function session_lookup_detection_accepts_explicit_control_prompts (line 13920) | fn session_lookup_detection_accepts_explicit_control_prompts() {
  function wildcard_match_handles_linear_style_patterns (line 13928) | fn wildcard_match_handles_linear_style_patterns() {
  function sample_codex_doctor_snapshot (line 13943) | fn sample_codex_doctor_snapshot() -> CodexDoctorSnapshot {
  function codex_doctor_assert_autonomous_accepts_grounded_snapshot (line 13981) | fn codex_doctor_assert_autonomous_accepts_grounded_snapshot() {
  function codex_doctor_assert_learning_requires_grounded_outcomes (line 13987) | fn codex_doctor_assert_learning_requires_grounded_outcomes() {
  function codex_eval_opportunities_flag_missing_runtime_and_daemon (line 14000) | fn codex_eval_opportunities_flag_missing_runtime_and_daemon() {
  function codex_eval_summary_prefers_grounded_signal_when_ready (line 14022) | fn codex_eval_summary_prefers_grounded_signal_when_ready() {
  function codex_eval_quality_marks_blocking_runtime_failures_erroneous (line 14051) | fn codex_eval_quality_marks_blocking_runtime_failures_erroneous() {
  function codex_eval_quality_stays_valid_while_warming_up (line 14076) | fn codex_eval_quality_stays_valid_while_warming_up() {
  function parse_linear_url_reference_extracts_project_shape (line 14086) | fn parse_linear_url_reference_extracts_project_shape() {
  function github_pr_url_detection_is_specific (line 14100) | fn github_pr_url_detection_is_specific() {
  function pr_feedback_query_detection_matches_check_and_comments (line 14110) | fn pr_feedback_query_detection_matches_check_and_comments() {
  function commit_workflow_query_detection_matches_high_confidence_phrases (line 14123) | fn commit_workflow_query_detection_matches_high_confidence_phrases() {
  function commit_workflow_query_detection_stays_conservative (line 14130) | fn commit_workflow_query_detection_stays_conservative() {
  function prom_sync_workflow_query_detection_matches_high_confidence_phrases (line 14140) | fn prom_sync_workflow_query_detection_matches_high_confidence_phrases() {
  function prom_sync_workflow_query_detection_stays_conservative (line 14147) | fn prom_sync_workflow_query_detection_stays_conservative() {
  function build_codex_open_plan_routes_plain_commit_into_commit_workflow (line 14157) | fn build_codex_open_plan_routes_plain_commit_into_commit_workflow() {
  function build_codex_open_plan_routes_prom_sync_branch_into_sync_workflow (line 14181) | fn build_codex_open_plan_routes_prom_sync_branch_into_sync_workflow() {
  function parse_pr_feedback_cursor_handoff_extracts_paths (line 14209) | fn parse_pr_feedback_cursor_handoff_extracts_paths() {
  function build_codex_prompt_keeps_plain_query_plain (line 14230) | fn build_codex_prompt_keeps_plain_query_plain() {
  function build_codex_prompt_avoids_duplicate_reference_header (line 14238) | fn build_codex_prompt_avoids_duplicate_reference_header() {
  function parse_reference_fields_extracts_pr_feedback_artifacts (line 14252) | fn parse_reference_fields_extracts_pr_feedback_artifacts() {
  function derive_codex_open_plan_trace_assigns_plain_routes (line 14286) | fn derive_codex_open_plan_trace_assigns_plain_routes() {
  function build_pr_feedback_workflow_explanation_surfaces_packet_and_command (line 14314) | fn build_pr_feedback_workflow_explanation_surfaces_packet_and_command() {
  function build_codex_prompt_respects_shared_context_budget (line 14405) | fn build_codex_prompt_respects_shared_context_budget() {
  function read_codex_session_completion_snapshot_tracks_latest_completed_turn (line 14431) | fn read_codex_session_completion_snapshot_tracks_latest_completed_turn() {
  function select_codex_session_completion_summary_prefers_last_user_message (line 14461) | fn select_codex_session_completion_summary_prefers_last_user_message() {
  function parse_apply_patch_changes_extracts_absolute_paths (line 14486) | fn parse_apply_patch_changes_extracts_absolute_paths() {
  function summarize_fish_fn_change_detects_shortcut_remap (line 14508) | fn summarize_fish_fn_change_detects_shortcut_remap() {
  function build_codex_session_changed_events_uses_fish_summary_fallback (line 14524) | fn build_codex_session_changed_events_uses_fish_summary_fallback() {
  function format_session_ref_respects_provider_prefix_flag (line 14562) | fn format_session_ref_respects_provider_prefix_flag() {
  function ai_session_from_codex_recover_row_prefers_title_for_preview (line 14584) | fn ai_session_from_codex_recover_row_prefers_title_for_preview() {
  function ai_session_from_codex_recover_row_falls_back_to_first_user_message (line 14606) | fn ai_session_from_codex_recover_row_falls_back_to_first_user_message() {

FILE: src/ai_context.rs
  function find_project_root (line 32) | pub fn find_project_root() -> Option<PathBuf> {
  function load_command_context (line 54) | pub fn load_command_context(command: &str) -> Option<String> {
  function load_task_context (line 63) | pub fn load_task_context(task_name: &str) -> Option<String> {
  function load_project_context (line 72) | pub fn load_project_context() -> Option<String> {
  function load_full_command_context (line 79) | pub fn load_full_command_context(command: &str) -> String {
  function load_context_file (line 98) | fn load_context_file(path: &Path) -> Option<String> {
  function has_ai_context (line 107) | pub fn has_ai_context() -> bool {
  function test_find_project_root_returns_some_in_git_repo (line 118) | fn test_find_project_root_returns_some_in_git_repo() {

FILE: src/ai_everruns.rs
  constant DEFAULT_EVERRUNS_BASE_URL (line 23) | const DEFAULT_EVERRUNS_BASE_URL: &str = "http://127.0.0.1:9300/api";
  constant DEFAULT_EVERRUNS_API_KEY_ENV (line 24) | const DEFAULT_EVERRUNS_API_KEY_ENV: &str = "EVERRUNS_API_KEY";
  constant DEFAULT_SEQ_SOCKET (line 25) | const DEFAULT_SEQ_SOCKET: &str = "/tmp/seqd.sock";
  function run (line 27) | pub fn run(opts: AiEverrunsOpts) -> Result<()> {
  function resolve_prompt (line 88) | fn resolve_prompt(opts: &AiEverrunsOpts) -> Result<String> {
  function wait_for_completion (line 112) | fn wait_for_completion(
  function wait_for_completion_sse (line 160) | fn wait_for_completion_sse(
  function wait_for_completion_poll (line 330) | fn wait_for_completion_poll(
  function is_sse_unavailable_error (line 482) | fn is_sse_unavailable_error(err: &anyhow::Error) -> bool {
  function classify_error_text (line 487) | fn classify_error_text(err: &str) -> &'static str {
  function emit_qa_pair_signal (line 510) | fn emit_qa_pair_signal(
  type SignalTextMode (line 530) | enum SignalTextMode {
  function signal_text_mode (line 536) | fn signal_text_mode() -> SignalTextMode {
  function signal_text_max_chars (line 547) | fn signal_text_max_chars() -> usize {
  function text_signal_payload (line 555) | fn text_signal_payload(text: &str) -> Value {
  function extract_output_text (line 582) | fn extract_output_text(data: &Value) -> Option<String> {
  function resolve_session_id (line 602) | fn resolve_session_id(api: &EverrunsApi, resolved: &ResolvedSettings) ->...
  type ResolvedSettings (line 642) | struct ResolvedSettings {
    method from_opts (line 657) | fn from_opts(opts: &AiEverrunsOpts) -> Result<Self> {
  function normalize_base_url (line 724) | fn normalize_base_url(raw: &str) -> Result<String> {
  function resolve_seq_socket_path (line 741) | fn resolve_seq_socket_path(cli_socket: Option<PathBuf>) -> PathBuf {
  function load_project_everruns_config (line 754) | fn load_project_everruns_config() -> Option<EverrunsConfig> {
  function find_flow_toml_upwards (line 761) | fn find_flow_toml_upwards(start: &Path) -> Option<PathBuf> {
  function first_non_empty (line 773) | fn first_non_empty(a: Option<String>, b: Option<String>) -> Option<Strin...
  function env_non_empty (line 783) | fn env_non_empty(name: &str) -> Option<String> {
  type EverrunsApi (line 794) | struct EverrunsApi {
    method new (line 802) | fn new(base_url: String, api_key: Option<String>) -> Result<Self> {
    method pick_first_harness_id (line 819) | fn pick_first_harness_id(&self) -> Result<String> {
    method pick_first_agent_id (line 830) | fn pick_first_agent_id(&self) -> Result<String> {
    method create_session (line 841) | fn create_session(&self, body: Value) -> Result<String> {
    method post_message (line 850) | fn post_message(&self, session_id: &str, prompt: &str) -> Result<Strin...
    method list_events (line 867) | fn list_events(&self, session_id: &str, since_id: Option<&str>) -> Res...
    method submit_tool_results (line 883) | fn submit_tool_results(
    method read_sse_batch (line 894) | fn read_sse_batch(
    method get_json (line 991) | fn get_json(&self, path: &str, query: &[(&str, String)]) -> Result<Val...
    method post_json (line 997) | fn post_json(&self, path: &str, body: Value) -> Result<Value> {
    method with_auth (line 1003) | fn with_auth(&self, request: RequestBuilder) -> RequestBuilder {
    method send_json (line 1011) | fn send_json(&self, request: RequestBuilder, method: &str, path: &str)...
  type SeqBridge (line 1040) | struct SeqBridge {
    method connect (line 1046) | fn connect(settings: &ResolvedSettings) -> Result<Self> {
    method execute_tool_call (line 1066) | fn execute_tool_call(
    method emit_runtime_event (line 1168) | fn emit_runtime_event(
  function unix_time_nanos_now (line 1210) | fn unix_time_nanos_now() -> u64 {
  function end_unix_nanos (line 1217) | fn end_unix_nanos(start_unix_nano: u64, started: Instant) -> u64 {
  type ListResponse (line 1222) | struct ListResponse<T> {
  type ResourceStub (line 1227) | struct ResourceStub {
  type EverrunsEvent (line 1234) | struct EverrunsEvent {
  type EventContext (line 1245) | struct EventContext {
  type SubmitToolResultsRequest (line 1251) | struct SubmitToolResultsRequest {
  type SubmitToolResult (line 1256) | struct SubmitToolResult {
  type SseBatch (line 1264) | struct SseBatch {
  type SseFrame (line 1269) | enum SseFrame {
  function decode_sse_frame (line 1275) | fn decode_sse_frame(event_type: &str, data: &str) -> Result<SseFrame> {

FILE: src/ai_server.rs
  constant DEFAULT_URL (line 14) | const DEFAULT_URL: &str = "http://127.0.0.1:7331";
  constant MAX_RETRIES (line 15) | const MAX_RETRIES: usize = 3;
  type ChatRequest (line 18) | struct ChatRequest {
  type ChatMessage (line 25) | struct ChatMessage {
  type ChatResponse (line 31) | struct ChatResponse {
  type Choice (line 36) | struct Choice {
  type ResponseMessage (line 42) | struct ResponseMessage {
  type ModelsResponse (line 47) | struct ModelsResponse {
  type ModelInfo (line 52) | struct ModelInfo {
  type AiServerConfig (line 56) | struct AiServerConfig {
  function quick_prompt (line 63) | pub fn quick_prompt(
  function resolve_ai_config (line 156) | fn resolve_ai_config(
  function fetch_default_model (line 217) | fn fetch_default_model(base_url: &str, token: Option<&str>) -> Result<St...
  function base_ai_url (line 259) | fn base_ai_url(url: &str) -> String {

FILE: src/ai_taskd.rs
  constant MSGPACK_WIRE_PREFIX (line 17) | const MSGPACK_WIRE_PREFIX: u8 = 0xFF;
  type WireEncoding (line 20) | enum WireEncoding {
  type CachedDiscovery (line 26) | struct CachedDiscovery {
  type CachedArtifact (line 32) | struct CachedArtifact {
  type TaskdState (line 38) | struct TaskdState {
  type TaskdRequest (line 45) | enum TaskdRequest {
  function default_capture_output (line 64) | fn default_capture_output() -> bool {
  type TaskdResponse (line 69) | struct TaskdResponse {
  type RequestTimings (line 80) | struct RequestTimings {
    method to_kv_line (line 89) | fn to_kv_line(&self, selector: &str) -> String {
  function start (line 102) | pub fn start() -> Result<()> {
  function stop (line 140) | pub fn stop() -> Result<()> {
  function status (line 164) | pub fn status() -> Result<()> {
  function run_via_daemon (line 173) | pub fn run_via_daemon(
  function serve (line 205) | pub fn serve() -> Result<()> {
  function handle_request (line 286) | fn handle_request(request: &TaskdRequest, state: &mut TaskdState) -> Tas...
  type RunRequestOutcome (line 362) | struct RunRequestOutcome {
  function discovery_ttl (line 369) | fn discovery_ttl() -> Duration {
  function artifact_ttl (line 377) | fn artifact_ttl() -> Duration {
  function discovery_key (line 385) | fn discovery_key(project_root: &Path) -> PathBuf {
  function ensure_discovery_fresh (line 391) | fn ensure_discovery_fresh(state: &mut TaskdState, key: &Path) -> Result<...
  function refresh_discovery (line 401) | fn refresh_discovery(state: &mut TaskdState, key: &Path) -> Result<()> {
  function run_request (line 413) | fn run_request(
  function router_session_id (line 595) | fn router_session_id(project_root: &Path) -> String {
  function emit_router_decision (line 610) | fn emit_router_decision(
  function emit_router_override (line 655) | fn emit_router_override(
  function emit_router_outcome (line 683) | fn emit_router_outcome(
  function classify_error (line 727) | fn classify_error(message: &str) -> String {
  function read_optional_env (line 744) | fn read_optional_env(key: &str) -> Option<String> {
  function normalize_selector_for_compare (line 753) | fn normalize_selector_for_compare(value: &str) -> String {
  function same_task_selector (line 761) | fn same_task_selector(a: &str, b: &str) -> bool {
  function run_cached_task_output_hot (line 765) | fn run_cached_task_output_hot(
  function run_cached_task_status_hot (line 795) | fn run_cached_task_status_hot(
  function run_artifact_output (line 825) | fn run_artifact_output(
  function run_artifact_status (line 849) | fn run_artifact_status(
  function ping (line 873) | fn ping() -> Result<()> {
  function send_request (line 882) | fn send_request(request: &TaskdRequest, encoding: WireEncoding) -> Resul...
  function encode_request (line 902) | fn encode_request(request: &TaskdRequest, encoding: WireEncoding) -> Res...
  function decode_request (line 917) | fn decode_request(payload: &[u8]) -> Result<(TaskdRequest, WireEncoding)> {
  function encode_response (line 932) | fn encode_response(response: &TaskdResponse, encoding: WireEncoding) -> ...
  function decode_response (line 947) | fn decode_response(payload: &[u8]) -> Result<TaskdResponse> {
  function infer_encoding_from_payload (line 956) | fn infer_encoding_from_payload(payload: &[u8]) -> WireEncoding {
  function socket_path (line 964) | fn socket_path() -> PathBuf {
  function pid_path (line 972) | fn pid_path() -> PathBuf {
  function shell_quote (line 980) | fn shell_quote(raw: &str) -> String {
  function write_error_response (line 985) | fn write_error_response(stream: &mut UnixStream, message: String, encodi...
  function timings_log_enabled (line 1000) | fn timings_log_enabled() -> bool {
  function selector_compare_handles_ai_prefix (line 1017) | fn selector_compare_handles_ai_prefix() {

FILE: src/ai_tasks.rs
  type DiscoveredAiTask (line 15) | pub struct DiscoveredAiTask {
  type AiTaskDiscoveryArtifacts (line 27) | pub(crate) struct AiTaskDiscoveryArtifacts {
  type Metadata (line 33) | struct Metadata {
  type CachedTaskArtifact (line 40) | pub struct CachedTaskArtifact {
  function discover_tasks (line 46) | pub fn discover_tasks(root: &Path) -> Result<Vec<DiscoveredAiTask>> {
  function discover_tasks_from_root (line 56) | pub(crate) fn discover_tasks_from_root(root: PathBuf) -> Result<Vec<Disc...
  function discover_tasks_from_root_artifacts (line 60) | pub(crate) fn discover_tasks_from_root_artifacts(
  function resolve_task_fast (line 130) | pub fn resolve_task_fast(root: &Path, selector: &str) -> Result<Option<D...
  function select_task (line 180) | pub fn select_task<'a>(
  function run_task (line 231) | pub fn run_task(task: &DiscoveredAiTask, project_root: &Path, args: &[St...
  function run_task_via_moon (line 257) | pub fn run_task_via_moon(
  function run_task_via_moon_output (line 277) | pub fn run_task_via_moon_output(
  function build_task_cached (line 293) | pub fn build_task_cached(
  function run_task_cached (line 368) | pub fn run_task_cached(
  function run_task_cached_output (line 395) | pub fn run_task_cached_output(
  function default_cache_root (line 419) | pub fn default_cache_root() -> Result<PathBuf> {
  function moon_run_command (line 423) | fn moon_run_command(task: &DiscoveredAiTask, project_root: &Path, args: ...
  function task_reference (line 462) | pub fn task_reference(task: &DiscoveredAiTask) -> String {
  function resolve_moon_workspace_and_entry (line 466) | fn resolve_moon_workspace_and_entry(
  function task_has_workspace (line 486) | fn task_has_workspace(task: &DiscoveredAiTask, project_root: &Path) -> b...
  function ai_task_cache_root (line 495) | fn ai_task_cache_root() -> Result<PathBuf> {
  function compute_cache_key (line 504) | fn compute_cache_key(
  function hash_file_signature_if_exists (line 526) | fn hash_file_signature_if_exists(hasher: &mut Sha256, path: &Path) -> Re...
  function moon_version_for_cache_key (line 543) | fn moon_version_for_cache_key() -> Option<Vec<u8>> {
  function find_built_binary (line 584) | fn find_built_binary(workspace_dir: &Path) -> Result<PathBuf> {
  function moon_mod_package_name (line 633) | fn moon_mod_package_name(workspace_dir: &Path) -> Result<Option<String>> {
  function is_executable (line 655) | fn is_executable(path: &Path) -> bool {
  function find_moon_workspace_root (line 669) | fn find_moon_workspace_root(start: &Path) -> Option<PathBuf> {
  function parse_task (line 680) | fn parse_task(task_root: &Path, path: &Path) -> Result<DiscoveredAiTask> {
  function parse_metadata (line 727) | fn parse_metadata(content: &str) -> Metadata {
  function parse_tags (line 754) | fn parse_tags(value: &str) -> Vec<String> {
  function strip_quotes (line 770) | fn strip_quotes(value: &str) -> String {
  function parse_scoped_selector (line 783) | fn parse_scoped_selector(selector: &str) -> Option<(String, String)> {
  function normalize_selector (line 802) | fn normalize_selector(raw: &str) -> String {
  function parses_metadata_comments (line 821) | fn parses_metadata_comments() {

FILE: src/ai_test.rs
  function run (line 8) | pub fn run(opts: AiTestNewOpts) -> Result<()> {
  function find_project_root (line 59) | fn find_project_root(start: &Path) -> Result<PathBuf> {
  function normalize_relative_dir (line 71) | fn normalize_relative_dir(raw: &str) -> Result<PathBuf> {
  function normalize_test_name (line 92) | fn normalize_test_name(raw: &str, use_spec: bool) -> Result<PathBuf> {
  function sanitize_segment (line 114) | fn sanitize_segment(raw: &str) -> String {
  function normalize_file_component (line 133) | fn normalize_file_component(file: &str, use_spec: bool) -> String {
  function appends_test_suffix_for_plain_name (line 159) | fn appends_test_suffix_for_plain_name() {
  function preserves_existing_test_suffix (line 165) | fn preserves_existing_test_suffix() {
  function adds_spec_before_extension (line 171) | fn adds_spec_before_extension() {

FILE: src/analytics.rs
  function run (line 6) | pub fn run(cmd: AnalyticsCommand) -> Result<()> {

FILE: src/archive.rs
  function run (line 10) | pub fn run(opts: ArchiveOpts) -> Result<()> {
  type ArchiveFilter (line 82) | struct ArchiveFilter {
    method default (line 87) | fn default() -> Self {
    method should_skip (line 102) | fn should_skip(&self, path: &Path) -> bool {
  function copy_dir_all (line 110) | fn copy_dir_all(from: &Path, to: &Path, filter: &ArchiveFilter) -> Resul...
  function copy_symlink (line 139) | fn copy_symlink(target: &Path, dest: &Path) -> Result<()> {
  function sanitize_segment (line 160) | fn sanitize_segment(value: &str) -> String {

FILE: src/ask.rs
  type AskOpts (line 15) | pub struct AskOpts {
  type AskSelection (line 24) | enum AskSelection {
  type FlowCommand (line 29) | struct FlowCommand {
  function run (line 36) | pub fn run(opts: AskOpts) -> Result<()> {
  function run_with_tasks (line 42) | fn run_with_tasks(opts: AskOpts, tasks: Vec<DiscoveredTask>) -> Result<(...
  function print_task_suggestion (line 79) | fn print_task_suggestion(task: &DiscoveredTask, args: &[String]) {
  function print_command_suggestion (line 97) | fn print_command_suggestion(command: &str) {
  function find_task (line 102) | fn find_task<'a>(name: &str, tasks: &'a [DiscoveredTask]) -> Result<&'a ...
  function flow_command_candidates (line 109) | fn flow_command_candidates() -> Vec<FlowCommand> {
  function valid_subcommand_set (line 136) | fn valid_subcommand_set(commands: &[FlowCommand]) -> HashSet<String> {
  function build_prompt (line 153) | fn build_prompt(query: &str, tasks: &[DiscoveredTask], commands: &[FlowC...
  function parse_ask_response (line 197) | fn parse_ask_response(
  function parse_structured_line (line 240) | fn parse_structured_line(
  function normalize_command (line 260) | fn normalize_command(raw: &str, valid_subcommands: &HashSet<String>) -> ...
  function is_command_like (line 287) | fn is_command_like(raw: &str, valid_subcommands: &HashSet<String>) -> bo...
  function cli_subcommands (line 300) | fn cli_subcommands() -> Vec<String> {
  function is_cli_subcommand (line 312) | fn is_cli_subcommand(args: &[String]) -> bool {
  function normalize_name (line 323) | fn normalize_name(s: &str) -> String {
  type DirectMatchResult (line 331) | struct DirectMatchResult {
  function try_direct_match (line 337) | fn try_direct_match(args: &[String], tasks: &[DiscoveredTask]) -> Option...
  function generate_abbreviation (line 413) | fn generate_abbreviation(name: &str) -> Option<String> {
  function extract_task_name (line 429) | fn extract_task_name(response: &str, tasks: &[DiscoveredTask]) -> Result...
  function make_discovered (line 466) | fn make_discovered(name: &str) -> DiscoveredTask {
  function parse_task_response (line 490) | fn parse_task_response() {
  function parse_command_response (line 502) | fn parse_command_response() {

FILE: src/auth.rs
  type DeviceStartResponse (line 12) | struct DeviceStartResponse {
  function default_poll_interval (line 21) | fn default_poll_interval() -> u64 {
  type DevicePollResponse (line 26) | struct DevicePollResponse {
  function run (line 31) | pub fn run(opts: AuthOpts) -> Result<()> {
  function login (line 35) | fn login(api_url_override: Option<String>) -> Result<()> {
  function open_in_browser (line 109) | fn open_in_browser(url: &str) {

FILE: src/base_tool.rs
  function resolve_bin (line 6) | pub fn resolve_bin() -> Option<PathBuf> {
  function run_inherit_stdio (line 24) | pub fn run_inherit_stdio(bin: &Path, args: &[String]) -> Result<()> {
  function run_with_stdin (line 38) | pub fn run_with_stdin(bin: &Path, args: &[String], stdin: &str) -> Resul...

FILE: src/bin/ai_taskd_client.rs
  constant MSGPACK_WIRE_PREFIX (line 9) | const MSGPACK_WIRE_PREFIX: u8 = 0xFF;
  type WireProtocol (line 12) | enum WireProtocol {
  type TaskdRequest (line 19) | enum TaskdRequest {
  type TaskdResponse (line 33) | struct TaskdResponse {
  type RequestTimings (line 43) | struct RequestTimings {
  function main (line 51) | fn main() {
  function run (line 61) | fn run() -> Result<i32, String> {
  function run_batch (line 168) | fn run_batch(
  function run_once (line 219) | fn run_once(
  function send_request (line 242) | fn send_request(
  function encode_request (line 264) | fn encode_request(request: &TaskdRequest, protocol: WireProtocol) -> Res...
  function decode_response (line 279) | fn decode_response(payload: &[u8]) -> Result<TaskdResponse, String> {
  function print_response (line 288) | fn print_response(response: &TaskdResponse, include_timings: bool, selec...
  function default_socket_path (line 308) | fn default_socket_path() -> PathBuf {
  function read_optional_env (line 316) | fn read_optional_env(key: &str) -> Option<String> {
  function print_help (line 325) | fn print_help() {

FILE: src/branches.rs
  type BranchEntry (line 16) | struct BranchEntry {
  function run (line 23) | pub fn run(cmd: BranchesCommand) -> Result<()> {
  function run_list (line 35) | fn run_list(opts: BranchListOpts) -> Result<()> {
  function run_find (line 49) | fn run_find(opts: BranchFindOpts) -> Result<()> {
  function run_ai (line 82) | fn run_ai(opts: BranchAiOpts) -> Result<()> {
  function print_branch (line 122) | fn print_branch(entry: &BranchEntry) {
  function collect_branches (line 142) | fn collect_branches(include_remote: bool) -> Result<Vec<BranchEntry>> {
  function collect_local_branches (line 152) | fn collect_local_branches() -> Result<Vec<BranchEntry>> {
  function collect_remote_branches (line 185) | fn collect_remote_branches() -> Result<Vec<BranchEntry>> {
  function rank_branches (line 217) | fn rank_branches<'a>(query: &str, branches: &'a [BranchEntry]) -> Vec<(i...
  function top_candidates_for_ai (line 271) | fn top_candidates_for_ai(query: &str, branches: &[BranchEntry], limit: u...
  function build_ai_prompt (line 285) | fn build_ai_prompt(query: &str, candidates: &[BranchEntry]) -> String {
  function parse_ai_branch_response (line 313) | fn parse_ai_branch_response(response: &str, candidates: &[BranchEntry]) ...
  function switch_to_entry (line 334) | fn switch_to_entry(entry: &BranchEntry) -> Result<()> {
  function git_capture (line 364) | fn git_capture(args: &[&str]) -> Result<String> {

FILE: src/changes.rs
  function trace_enabled (line 15) | fn trace_enabled() -> bool {
  function trace (line 26) | fn trace(msg: &str) {
  function run (line 32) | pub fn run(cmd: ChangesCommand) -> Result<()> {
  function run_diff (line 49) | pub fn run_diff(cmd: DiffCommand) -> Result<()> {
  function repo_root (line 66) | fn repo_root() -> Result<PathBuf> {
  function git_output_in (line 82) | fn git_output_in(repo_root: &Path, args: &[&str]) -> Result<(String, boo...
  function git_ref_exists (line 97) | fn git_ref_exists(repo_root: &Path, reference: &str) -> Result<bool> {
  function resolve_base_ref (line 107) | fn resolve_base_ref(repo_root: &Path) -> Result<String> {
  function list_untracked (line 119) | fn list_untracked(repo_root: &Path) -> Result<Vec<String>> {
  function print_current_diff (line 132) | fn print_current_diff() -> Result<()> {
  function diff_from_base (line 141) | fn diff_from_base(repo_root: &Path, base_ref: &str) -> Result<String> {
  function read_diff_input (line 157) | fn read_diff_input(diff: Option<String>, file: Option<PathBuf>) -> Resul...
  function read_stdin (line 182) | fn read_stdin() -> Result<String> {
  function apply_diff (line 190) | fn apply_diff(diff: Option<String>, file: Option<PathBuf>) -> Result<()> {
  function apply_diff_content (line 203) | fn apply_diff_content(repo_root: &Path, content: &str) -> Result<()> {
  type DiffBundle (line 228) | struct DiffBundle {
  type DiffBundlePayload (line 245) | struct DiffBundlePayload {
  type DiffBundlePayloadV1 (line 258) | struct DiffBundlePayloadV1 {
  type DiffBundlePayloadV2 (line 268) | struct DiffBundlePayloadV2 {
  type DiffStashRecord (line 280) | struct DiffStashRecord {
  function create_bundle (line 288) | fn create_bundle(env_keys: &[String]) -> Result<()> {
  function normalize_env_keys (line 350) | fn normalize_env_keys(raw: &[String]) -> Result<Vec<String>> {
  function load_project_name (line 388) | fn load_project_name(repo_root: &Path) -> Result<String> {
  function ensure_project_match (line 405) | fn ensure_project_match(repo_root: &Path, bundle: &DiffBundle) -> Result...
  function gather_env_vars (line 421) | fn gather_env_vars(keys: &[String]) -> Result<(Option<String>, BTreeMap<...
  function read_personal_local_env (line 445) | fn read_personal_local_env(keys: &[String]) -> Result<BTreeMap<String, S...
  function unroll_bundle (line 470) | fn unroll_bundle(id: &str) -> Result<()> {
  function bundle_hash (line 530) | fn bundle_hash(payload: &DiffBundlePayload) -> Result<String> {
  function bundle_hash_v1 (line 538) | fn bundle_hash_v1(payload: &DiffBundlePayloadV1) -> Result<String> {
  function bundle_hash_v2 (line 546) | fn bundle_hash_v2(payload: &DiffBundlePayloadV2) -> Result<String> {
  function bundle_dir (line 554) | fn bundle_dir() -> Result<PathBuf> {
  function write_bundle (line 562) | fn write_bundle(bundle: &DiffBundle) -> Result<PathBuf> {
  function read_bundle (line 570) | fn read_bundle(id: &str) -> Result<(DiffBundle, Option<PathBuf>)> {
  function apply_env_vars (line 638) | fn apply_env_vars(bundle: &DiffBundle) -> Result<()> {
  function local_env_path (line 663) | fn local_env_path(target: &str) -> Result<PathBuf> {
  function stash_log_path (line 672) | fn stash_log_path() -> Result<PathBuf> {
  function record_stash (line 679) | fn record_stash(repo_root: &Path, stash_ref: &str, bundle_hash: &str, me...
  function sanitize_env_segment (line 704) | fn sanitize_env_segment(value: &str) -> String {
  function write_local_env (line 724) | fn write_local_env(
  function stash_if_dirty (line 747) | fn stash_if_dirty(repo_root: &Path, bundle_hash: &str) -> Result<Option<...

FILE: src/cli.rs
  type Cli (line 15) | pub struct Cli {
  function version_with_build_time (line 25) | fn version_with_build_time() -> &'static str {
  function format_relative_time (line 53) | fn format_relative_time(seconds: u64) -> String {
  type Commands (line 68) | pub enum Commands {
  type TracesOpts (line 606) | pub struct TracesOpts {
  type TraceCommand (line 625) | pub struct TraceCommand {
  type AnalyticsCommand (line 633) | pub struct AnalyticsCommand {
  type AnalyticsAction (line 639) | pub enum AnalyticsAction {
  type TraceAction (line 653) | pub enum TraceAction {
  type TraceSessionOpts (line 659) | pub struct TraceSessionOpts {
  type TraceSource (line 666) | pub enum TraceSource {
  type ProxyCommand (line 675) | pub struct ProxyCommand {
  type ProxyAction (line 681) | pub enum ProxyAction {
  type ProxyStartOpts (line 698) | pub struct ProxyStartOpts {
  type ProxyTraceOpts (line 709) | pub struct ProxyTraceOpts {
  type ProxyLastOpts (line 732) | pub struct ProxyLastOpts {
  type ProxyAddOpts (line 747) | pub struct ProxyAddOpts {
  type DomainsCommand (line 765) | pub struct DomainsCommand {
  type DomainsEngineArg (line 775) | pub enum DomainsEngineArg {
  type DomainsAction (line 781) | pub enum DomainsAction {
  type DomainsAddOpts (line 801) | pub struct DomainsAddOpts {
  type DomainsGetOpts (line 812) | pub struct DomainsGetOpts {
  type DomainsRmOpts (line 821) | pub struct DomainsRmOpts {
  type DaemonOpts (line 827) | pub struct DaemonOpts {
  type ScreenOpts (line 850) | pub struct ScreenOpts {
  type LogsOpts (line 865) | pub struct LogsOpts {
  type TraceOpts (line 892) | pub struct TraceOpts {
  type ServersOpts (line 899) | pub struct ServersOpts {
  type TasksCommand (line 910) | pub struct TasksCommand {
  type TasksAction (line 916) | pub enum TasksAction {
  type TasksListOpts (line 932) | pub struct TasksListOpts {
  type TasksDupesOpts (line 942) | pub struct TasksDupesOpts {
  type TasksInitAiOpts (line 949) | pub struct TasksInitAiOpts {
  type TasksBuildAiOpts (line 959) | pub struct TasksBuildAiOpts {
  type TasksRunAiOpts (line 972) | pub struct TasksRunAiOpts {
  type TasksDaemonCommand (line 991) | pub struct TasksDaemonCommand {
  type TasksDaemonAction (line 997) | pub enum TasksDaemonAction {
  type TasksOpts (line 1010) | pub struct TasksOpts {
  method default (line 1017) | fn default() -> Self {
  type AiTestNewOpts (line 1025) | pub struct AiTestNewOpts {
  type GlobalCommand (line 1043) | pub struct GlobalCommand {
  type GlobalAction (line 1058) | pub enum GlobalAction {
  type TaskRunOpts (line 1075) | pub struct TaskRunOpts {
  type LifecycleRunOpts (line 1097) | pub struct LifecycleRunOpts {
  type FastRunOpts (line 1107) | pub struct FastRunOpts {
  type TaskActivateOpts (line 1123) | pub struct TaskActivateOpts {
  type ProcessOpts (line 1130) | pub struct ProcessOpts {
  type KillOpts (line 1140) | pub struct KillOpts {
  type TaskLogsOpts (line 1162) | pub struct TaskLogsOpts {
  type DoctorOpts (line 1193) | pub struct DoctorOpts {}
  type HealthOpts (line 1196) | pub struct HealthOpts {}
  type InvariantsOpts (line 1199) | pub struct InvariantsOpts {
  type RerunOpts (line 1206) | pub struct RerunOpts {
  type ActiveOpts (line 1213) | pub struct ActiveOpts {
  type SessionsOpts (line 1223) | pub struct SessionsOpts {
  type ServerOpts (line 1245) | pub struct ServerOpts {
  type ServerAction (line 1257) | pub enum ServerAction {
  type WebOpts (line 1265) | pub struct WebOpts {
  type InitOpts (line 1275) | pub struct InitOpts {
  type ShellInitOpts (line 1282) | pub struct ShellInitOpts {
  type ShellCommand (line 1288) | pub struct ShellCommand {
  type ShellAction (line 1294) | pub enum ShellAction {
  type NewOpts (line 1302) | pub struct NewOpts {
  type HomeCommand (line 1313) | pub struct HomeCommand {
  type HomeAction (line 1324) | pub enum HomeAction {
  type ArchiveOpts (line 1330) | pub struct ArchiveOpts {
  type HubCommand (line 1336) | pub struct HubCommand {
  type HubOpts (line 1345) | pub struct HubOpts {
  type HubAction (line 1368) | pub enum HubAction {
  type SecretsCommand (line 1376) | pub struct SecretsCommand {
  type OtpCommand (line 1382) | pub struct OtpCommand {
  type OtpAction (line 1388) | pub enum OtpAction {
  type SecretsAction (line 1402) | pub enum SecretsAction {
  type SecretsListOpts (line 1410) | pub struct SecretsListOpts {
  type SecretsPullOpts (line 1417) | pub struct SecretsPullOpts {
  type DbCommand (line 1440) | pub struct DbCommand {
  type DbAction (line 1446) | pub enum DbAction {
  type JazzStorageCommand (line 1454) | pub struct JazzStorageCommand {
  type JazzStorageAction (line 1460) | pub enum JazzStorageAction {
  type JazzStorageKind (line 1482) | pub enum JazzStorageKind {
  type PostgresCommand (line 1492) | pub struct PostgresCommand {
  type PostgresAction (line 1498) | pub enum PostgresAction {
  type SecretsFormat (line 1520) | pub enum SecretsFormat {
  type SetupTarget (line 1526) | pub enum SetupTarget {
  type SetupOpts (line 1533) | pub struct SetupOpts {
  type IndexOpts (line 1543) | pub struct IndexOpts {
  type MatchOpts (line 1558) | pub struct MatchOpts {
  type AskOpts (line 1577) | pub struct AskOpts {
  type BranchesCommand (line 1592) | pub struct BranchesCommand {
  type BranchesAction (line 1598) | pub enum BranchesAction {
  type BranchListOpts (line 1608) | pub struct BranchListOpts {
  type BranchFindOpts (line 1618) | pub struct BranchFindOpts {
  type BranchAiOpts (line 1634) | pub struct BranchAiOpts {
  type CommitOpts (line 1656) | pub struct CommitOpts {
  type PrOpts (line 1726) | pub struct PrOpts {
  type GitignoreCommand (line 1754) | pub struct GitignoreCommand {
  type GitignoreAction (line 1760) | pub enum GitignoreAction {
  type GitignoreScanOpts (line 1777) | pub struct GitignoreScanOpts {
  type GitignorePolicyInitOpts (line 1787) | pub struct GitignorePolicyInitOpts {
  type RecipeCommand (line 1794) | pub struct RecipeCommand {
  type RecipeAction (line 1800) | pub enum RecipeAction {
  type RecipeListOpts (line 1812) | pub struct RecipeListOpts {
  type RecipeSearchOpts (line 1825) | pub struct RecipeSearchOpts {
  type RecipeRunOpts (line 1837) | pub struct RecipeRunOpts {
  type RecipeInitOpts (line 1855) | pub struct RecipeInitOpts {
  type RecipeScopeArg (line 1865) | pub enum RecipeScopeArg {
  type CommitQueueCommand (line 1871) | pub struct CommitQueueCommand {
  type ReviewCommand (line 1877) | pub struct ReviewCommand {
  type ReviewsTodoCommand (line 1883) | pub struct ReviewsTodoCommand {
  type GitRepairOpts (line 1889) | pub struct GitRepairOpts {
  type CommitQueueAction (line 1903) | pub enum CommitQueueAction {
  type ReviewAction (line 1994) | pub enum ReviewAction {
  type ReviewsTodoAction (line 2005) | pub enum ReviewsTodoAction {
  type JjCommand (line 2050) | pub struct JjCommand {
  type StatusOpts (line 2056) | pub struct StatusOpts {
  type JjStatusOpts (line 2063) | pub struct JjStatusOpts {
  type JjAction (line 2070) | pub enum JjAction {
  type JjRebaseOpts (line 2096) | pub struct JjRebaseOpts {
  type JjPushOpts (line 2103) | pub struct JjPushOpts {
  type JjSyncOpts (line 2113) | pub struct JjSyncOpts {
  type JjWorkspaceAction (line 2129) | pub enum JjWorkspaceAction {
  type JjBookmarkAction (line 2180) | pub enum JjBookmarkAction {
  type FixupOpts (line 2208) | pub struct FixupOpts {
  type FixOpts (line 2218) | pub struct FixOpts {
  type UndoCommand (line 2237) | pub struct UndoCommand {
  type UndoAction (line 2249) | pub enum UndoAction {
  type ChangesCommand (line 2261) | pub struct ChangesCommand {
  type DiffCommand (line 2267) | pub struct DiffCommand {
  type HashOpts (line 2279) | pub struct HashOpts {
  type ChangesAction (line 2286) | pub enum ChangesAction {
  type DaemonCommand (line 2306) | pub struct DaemonCommand {
  type DaemonAction (line 2312) | pub enum DaemonAction {
  type SupervisorCommand (line 2339) | pub struct SupervisorCommand {
  type SupervisorAction (line 2348) | pub enum SupervisorAction {
  type AiCommand (line 2376) | pub struct AiCommand {
  type AiAction (line 2382) | pub enum AiAction {
  type AiEverrunsOpts (line 2468) | pub struct AiEverrunsOpts {
  type ProviderAiAction (line 2509) | pub enum ProviderAiAction {
  type CodexDaemonAction (line 2784) | pub enum CodexDaemonAction {
  type CodexMemoryAction (line 2806) | pub enum CodexMemoryAction {
  type CodexTelemetryAction (line 2852) | pub enum CodexTelemetryAction {
  type CodexTraceAction (line 2871) | pub enum CodexTraceAction {
  type CodexSkillEvalAction (line 2902) | pub enum CodexSkillEvalAction {
  type CodexSkillSourceAction (line 2954) | pub enum CodexSkillSourceAction {
  type CodexRuntimeAction (line 2979) | pub enum CodexRuntimeAction {
  type EnvCommand (line 3002) | pub struct EnvCommand {
  type AuthOpts (line 3008) | pub struct AuthOpts {
  type ServicesCommand (line 3015) | pub struct ServicesCommand {
  type PushCommand (line 3021) | pub struct PushCommand {
  type SshCommand (line 3049) | pub struct SshCommand {
  type EnvAction (line 3055) | pub enum EnvAction {
  type ServicesAction (line 3161) | pub enum ServicesAction {
  type MacosCommand (line 3170) | pub struct MacosCommand {
  type MacosAction (line 3176) | pub enum MacosAction {
  type MacosListOpts (line 3195) | pub struct MacosListOpts {
  type MacosAuditOpts (line 3208) | pub struct MacosAuditOpts {
  type MacosInfoOpts (line 3215) | pub struct MacosInfoOpts {
  type MacosDisableOpts (line 3221) | pub struct MacosDisableOpts {
  type MacosEnableOpts (line 3230) | pub struct MacosEnableOpts {
  type MacosCleanOpts (line 3236) | pub struct MacosCleanOpts {
  type StripeServiceOpts (line 3246) | pub struct StripeServiceOpts {
  type StripeModeArg (line 3268) | pub enum StripeModeArg {
  type SshAction (line 3274) | pub enum SshAction {
  type TokenAction (line 3302) | pub enum TokenAction {
  type ProjectEnvAction (line 3323) | pub enum ProjectEnvAction {
  type TodoCommand (line 3350) | pub struct TodoCommand {
  type ExtCommand (line 3356) | pub struct ExtCommand {
  type TodoAction (line 3362) | pub enum TodoAction {
  type TodoStatusArg (line 3416) | pub enum TodoStatusArg {
  type DepsCommand (line 3425) | pub struct DepsCommand {
  type DepsAction (line 3434) | pub enum DepsAction {
  type DepsManager (line 3460) | pub enum DepsManager {
  type DepsEcosystem (line 3468) | pub enum DepsEcosystem {
  type UpdateDepsOpts (line 3475) | pub struct UpdateDepsOpts {
  type SkillsCommand (line 3500) | pub struct SkillsCommand {
  type SkillsAction (line 3506) | pub enum SkillsAction {
  type SkillsFetchCommand (line 3557) | pub struct SkillsFetchCommand {
  type SkillsFetchAction (line 3590) | pub enum SkillsFetchAction {
  type UrlCommand (line 3628) | pub struct UrlCommand {
  type UrlAction (line 3634) | pub enum UrlAction {
  type UrlInspectOpts (line 3642) | pub struct UrlInspectOpts {
  type UrlCrawlOpts (line 3660) | pub struct UrlCrawlOpts {
  type UrlInspectProvider (line 3708) | pub enum UrlInspectProvider {
  type UrlCrawlSource (line 3716) | pub enum UrlCrawlSource {
  type ToolsCommand (line 3723) | pub struct ToolsCommand {
  type ToolsAction (line 3729) | pub enum ToolsAction {
  type AgentsCommand (line 3766) | pub struct AgentsCommand {
  type AgentsAction (line 3775) | pub enum AgentsAction {
  type HiveCommand (line 3813) | pub struct HiveCommand {
  type HiveAction (line 3822) | pub enum HiveAction {
  type PublishOpts (line 3855) | pub struct PublishOpts {
  type PublishCommand (line 3883) | pub struct PublishCommand {
  type CloneOpts (line 3889) | pub struct CloneOpts {
  type PublishAction (line 3897) | pub enum PublishAction {
  type ReposCommand (line 3905) | pub struct ReposCommand {
  type CodeCommand (line 3911) | pub struct CodeCommand {
  type CodeAction (line 3920) | pub enum CodeAction {
  type CodeNewOpts (line 3932) | pub struct CodeNewOpts {
  type CodeMigrateOpts (line 3946) | pub struct CodeMigrateOpts {
  type CodeMoveSessionsOpts (line 3966) | pub struct CodeMoveSessionsOpts {
  type MigrateCommand (line 3985) | pub struct MigrateCommand {
  type MigrateAction (line 4007) | pub enum MigrateAction {
  type MigrateCodeOpts (line 4013) | pub struct MigrateCodeOpts {
  type ReposAction (line 4031) | pub enum ReposAction {
  type ReposCloneOpts (line 4043) | pub struct ReposCloneOpts {
  type RepoCapsuleOpts (line 4061) | pub struct RepoCapsuleOpts {
  type RepoAliasCommand (line 4074) | pub struct RepoAliasCommand {
  type RepoAliasAction (line 4080) | pub enum RepoAliasAction {
  type SyncCommand (line 4116) | pub struct SyncCommand {
  type SwitchCommand (line 4156) | pub struct SwitchCommand {
  type CheckoutCommand (line 4180) | pub struct CheckoutCommand {
  type UpstreamCommand (line 4195) | pub struct UpstreamCommand {
  type UpstreamAction (line 4201) | pub enum UpstreamAction {
  type NotifyCommand (line 4235) | pub struct NotifyCommand {
  type CommitsCommand (line 4253) | pub struct CommitsCommand {
  type CommitsAction (line 4261) | pub enum CommitsAction {
  type CommitsOpts (line 4277) | pub struct CommitsOpts {
  type SeqRpcCommand (line 4287) | pub struct SeqRpcCommand {
  type SeqRpcAction (line 4302) | pub enum SeqRpcAction {
  type SeqRpcIdOpts (line 4320) | pub struct SeqRpcIdOpts {
  type SeqRpcOpenAppOpts (line 4333) | pub struct SeqRpcOpenAppOpts {
  type SeqRpcScreenshotOpts (line 4341) | pub struct SeqRpcScreenshotOpts {
  type SeqRpcRawOpts (line 4349) | pub struct SeqRpcRawOpts {
  type ExplainCommitsCommand (line 4360) | pub struct ExplainCommitsCommand {
  type DeployCommand (line 4372) | pub struct DeployCommand {
  type ReleaseOpts (line 4378) | pub struct ReleaseOpts {
  type ReleaseCommand (line 4388) | pub struct ReleaseCommand {
  type ReleaseAction (line 4397) | pub enum ReleaseAction {
  type ReleaseSigningCommand (line 4410) | pub struct ReleaseSigningCommand {
  type ReleaseSigningAction (line 4416) | pub enum ReleaseSigningAction {
  type ReleaseSigningStoreOpts (line 4426) | pub struct ReleaseSigningStoreOpts {
  type ReleaseSigningSyncOpts (line 4442) | pub struct ReleaseSigningSyncOpts {
  type ReleaseTaskOpts (line 4452) | pub struct ReleaseTaskOpts {
  type RegistryReleaseOpts (line 4459) | pub struct RegistryReleaseOpts {
  type InstallOpts (line 4487) | pub struct InstallOpts {
  type InstallCommand (line 4514) | pub struct InstallCommand {
  type InstallAction (line 4523) | pub enum InstallAction {
  type InstallIndexOpts (line 4529) | pub struct InstallIndexOpts {
  type InstallBackend (line 4559) | pub enum InstallBackend {
  type FishInstallOpts (line 4568) | pub struct FishInstallOpts {
  type RegistryCommand (line 4584) | pub struct RegistryCommand {
  type RegistryAction (line 4590) | pub enum RegistryAction {
  type RegistryInitOpts (line 4596) | pub struct RegistryInitOpts {
  type DeployAction (line 4618) | pub enum DeployAction {
  type ParallelCommand (line 4692) | pub struct ParallelCommand {
  type DocsCommand (line 4705) | pub struct DocsCommand {
  type UpgradeOpts (line 4711) | pub struct UpgradeOpts {
  type GhReleaseCommand (line 4738) | pub struct GhReleaseCommand {
  type GhReleaseAction (line 4744) | pub enum GhReleaseAction {
  type GhReleaseCreateOpts (line 4774) | pub struct GhReleaseCreateOpts {
  type DocsAction (line 4808) | pub enum DocsAction {
  type DocsNewOpts (line 4837) | pub struct DocsNewOpts {
  type DocsDeployOpts (line 4847) | pub struct DocsDeployOpts {
  type DocsHubOpts (line 4860) | pub struct DocsHubOpts {
  function parses_codex_resume_with_path_override (line 4896) | fn parses_codex_resume_with_path_override() {
  function parses_codex_continue_with_path_override (line 4922) | fn parses_codex_continue_with_path_override() {
  function parses_codex_find_with_path_and_query (line 4940) | fn parses_codex_find_with_path_and_query() {
  function parses_codex_find_and_copy_with_query (line 4974) | fn parses_codex_find_and_copy_with_query() {
  function parses_codex_open_with_path_and_query (line 5006) | fn parses_codex_open_with_path_and_query() {
  function parses_codex_resolve_json (line 5037) | fn parses_codex_resolve_json() {
  function parses_codex_doctor_assertions (line 5073) | fn parses_codex_doctor_assertions() {
  function parses_codex_enable_global_full (line 5109) | fn parses_codex_enable_global_full() {
  function parses_repos_capsule_with_refresh_and_json (line 5142) | fn parses_repos_capsule_with_refresh_and_json() {
  function parses_repos_alias_set (line 5171) | fn parses_repos_alias_set() {
  function parses_repos_alias_import_shelf (line 5198) | fn parses_repos_alias_import_shelf() {
  function parses_domains_get_with_target_flag (line 5224) | fn parses_domains_get_with_target_flag() {
  function parses_url_crawl_with_filters (line 5248) | fn parses_url_crawl_with_filters() {

FILE: src/code.rs
  constant DEFAULT_CODE_ROOT (line 18) | const DEFAULT_CODE_ROOT: &str = "~/code";
  constant DEFAULT_TEMPLATE_ROOT (line 19) | const DEFAULT_TEMPLATE_ROOT: &str = "~/new";
  constant DEFAULT_AGENT_QA_ZVEC_JSONL (line 20) | const DEFAULT_AGENT_QA_ZVEC_JSONL: &str = "~/repos/alibaba/zvec/data/age...
  constant FLOW_AGENT_QA_ZVEC_JSONL_ENV (line 21) | const FLOW_AGENT_QA_ZVEC_JSONL_ENV: &str = "FLOW_AGENT_QA_ZVEC_JSONL";
  type ZvecMoveSummary (line 23) | struct ZvecMoveSummary {
  type ZvecCopySummary (line 28) | struct ZvecCopySummary {
  function list_templates (line 34) | fn list_templates() -> Result<Vec<String>> {
  function fuzzy_select_template (line 57) | fn fuzzy_select_template() -> Result<Option<String>> {
  function new_from_template (line 89) | pub fn new_from_template(opts: NewOpts) -> Result<()> {
  function run (line 167) | pub fn run(cmd: CodeCommand) -> Result<()> {
  function migrate_sessions_between_paths (line 177) | pub(crate) fn migrate_sessions_between_paths(
  function run_migrate (line 197) | pub fn run_migrate(cmd: MigrateCommand) -> Result<()> {
  function migrate_to_path (line 266) | fn migrate_to_path(
  function list_code (line 343) | fn list_code(root: &str) -> Result<()> {
  function fuzzy_select_code (line 363) | fn fuzzy_select_code(root: &str) -> Result<()> {
  function normalize_root (line 392) | fn normalize_root(root: &str) -> Result<PathBuf> {
  type CodeEntry (line 402) | struct CodeEntry {
  function discover_code_repos (line 407) | fn discover_code_repos(root: &Path) -> Result<Vec<CodeEntry>> {
  function should_skip_dir (line 455) | fn should_skip_dir(name: &str) -> bool {
  function run_fzf (line 483) | fn run_fzf(entries: &[CodeEntry]) -> Result<Option<&CodeEntry>> {
  function open_in_zed (line 513) | fn open_in_zed(path: &Path) -> Result<()> {
  function new_project (line 522) | fn new_project(opts: CodeNewOpts, root: &str) -> Result<()> {
  function migrate_project (line 584) | fn migrate_project(opts: CodeMigrateOpts, root: &str) -> Result<()> {
  function copy_sessions (line 653) | fn copy_sessions(opts: CodeMoveSessionsOpts) -> Result<()> {
  function move_sessions (line 702) | fn move_sessions(opts: CodeMoveSessionsOpts) -> Result<()> {
  function normalize_path (line 795) | fn normalize_path(path: &str) -> Result<PathBuf> {
  function normalize_relative_path (line 801) | fn normalize_relative_path(path: &str) -> Result<PathBuf> {
  function move_dir (line 818) | fn move_dir(from: &Path, to: &Path) -> Result<()> {
  function is_cross_device (line 836) | fn is_cross_device(err: &std::io::Error) -> bool {
  function copy_dir_all (line 848) | fn copy_dir_all(from: &Path, to: &Path) -> Result<()> {
  function copy_symlink (line 874) | fn copy_symlink(target: &Path, dest: &Path) -> Result<()> {
  function relink_bin_symlinks (line 895) | fn relink_bin_symlinks(from: &Path, to: &Path, dry_run: bool) -> Result<...
  function relink_symlink (line 945) | fn relink_symlink(path: &Path, target: &Path) -> Result<()> {
  function claude_projects_dir (line 971) | fn claude_projects_dir() -> PathBuf {
  function codex_projects_dir (line 978) | fn codex_projects_dir() -> PathBuf {
  function codex_sessions_dir (line 985) | fn codex_sessions_dir() -> PathBuf {
  function resolve_agent_qa_zvec_path (line 992) | fn resolve_agent_qa_zvec_path() -> Option<PathBuf> {
  function update_zvec_agent_qa_paths (line 1006) | fn update_zvec_agent_qa_paths(
  function copy_zvec_agent_qa_paths (line 1073) | fn copy_zvec_agent_qa_paths(
  function rewrite_zvec_doc_paths (line 1154) | fn rewrite_zvec_doc_paths(
  function rewrite_path_prefix (line 1192) | fn rewrite_path_prefix(value: &str, from: &str, to: &str) -> Option<Stri...
  function rewrite_project_source_path (line 1203) | fn rewrite_project_source_path(
  function derive_copy_doc_id (line 1218) | fn derive_copy_doc_id(existing_id: Option<&str>, line: &str, to: &str) -...
  function move_project_dir (line 1229) | fn move_project_dir(base: &Path, from: &Path, to: &Path, dry_run: bool) ...
  function copy_project_dir (line 1265) | fn copy_project_dir(base: &Path, from: &Path, to: &Path, dry_run: bool) ...
  function path_to_project_name (line 1295) | fn path_to_project_name(path: &Path) -> String {
  type CodexCopySummary (line 1299) | struct CodexCopySummary {
  function copy_codex_sessions (line 1303) | fn copy_codex_sessions(from: &Path, to: &Path, dry_run: bool) -> Result<...
  type CodexUpdateSummary (line 1330) | struct CodexUpdateSummary {
  function copy_codex_session_file (line 1335) | fn copy_codex_session_file(
  function derive_copy_id (line 1425) | fn derive_copy_id(old_id: &str, to: &str) -> String {
  function derive_copy_path (line 1433) | fn derive_copy_path(path: &Path, old_id: &str, new_id: &str) -> PathBuf {
  function unique_copy_path (line 1451) | fn unique_copy_path(parent: &Path, base_name: &str) -> PathBuf {
  function insert_suffix (line 1466) | fn insert_suffix(filename: &str, suffix: &str) -> String {
  function update_codex_sessions (line 1474) | fn update_codex_sessions(from: &Path, to: &Path, dry_run: bool) -> Resul...
  function try_for_each_codex_session_file (line 1505) | fn try_for_each_codex_session_file(
  type CodexFileUpdate (line 1530) | struct CodexFileUpdate {
  function update_codex_session_file (line 1535) | fn update_codex_session_file(
  function file_has_session_meta_cwd (line 1618) | fn file_has_session_meta_cwd(path: &Path, from: &str) -> Result<bool> {
  function session_meta_cwd_matches (line 1626) | fn session_meta_cwd_matches(line: &str, from: &str) -> bool {
  function ensure_dir (line 1648) | fn ensure_dir(path: &Path, dry_run: bool, planned: &mut Vec<PathBuf>) ->...
  function gitignore_entry_for_target (line 1665) | fn gitignore_entry_for_target(target: &Path) -> Result<Option<(PathBuf, ...
  function find_git_root (line 1685) | fn find_git_root(start: &Path) -> Result<Option<PathBuf>> {
  function ensure_gitignore_entry (line 1703) | fn ensure_gitignore_entry(repo_root: &Path, entry: &str) -> Result<()> {
  function rewrite_path_prefix_rewrites_exact_and_nested_paths (line 1735) | fn rewrite_path_prefix_rewrites_exact_and_nested_paths() {
  function rewrite_zvec_doc_paths_updates_project_and_source_paths (line 1750) | fn rewrite_zvec_doc_paths_updates_project_and_source_paths() {
  function zvec_move_and_copy_update_project_scope (line 1785) | fn zvec_move_and_copy_update_project_scope() -> Result<()> {

FILE: src/codex_memory.rs
  constant MEMORY_ROOT_ENV (line 14) | const MEMORY_ROOT_ENV: &str = "FLOW_CODEX_MEMORY_ROOT";
  constant REPO_SYMBOL_INDEX_KIND (line 15) | const REPO_SYMBOL_INDEX_KIND: &str = "repo_symbols";
  constant REPO_SYMBOL_INDEX_VERSION (line 16) | const REPO_SYMBOL_INDEX_VERSION: u32 = 1;
  constant REPO_SESSION_INDEX_KIND (line 17) | const REPO_SESSION_INDEX_KIND: &str = "repo_sessions";
  constant REPO_SESSION_INDEX_VERSION (line 18) | const REPO_SESSION_INDEX_VERSION: u32 = 1;
  constant MAX_SYMBOL_FILES (line 19) | const MAX_SYMBOL_FILES: usize = 24;
  constant MAX_SYMBOLS_PER_FILE (line 20) | const MAX_SYMBOLS_PER_FILE: usize = 8;
  constant MAX_SYMBOL_FILE_BYTES (line 21) | const MAX_SYMBOL_FILE_BYTES: usize = 256 * 1024;
  constant MAX_SNIPPET_LINES (line 22) | const MAX_SNIPPET_LINES: usize = 4;
  constant MAX_SNIPPET_CHARS (line 23) | const MAX_SNIPPET_CHARS: usize = 220;
  constant MAX_SESSION_THREADS (line 24) | const MAX_SESSION_THREADS: usize = 6;
  constant MAX_SESSION_EXCHANGES_PER_THREAD (line 25) | const MAX_SESSION_EXCHANGES_PER_THREAD: usize = 2;
  constant MAX_SESSION_TEXT_CHARS (line 26) | const MAX_SESSION_TEXT_CHARS: usize = 240;
  type CodexMemoryStats (line 30) | pub struct CodexMemoryStats {
  type CodexMemoryRecentEntry (line 42) | pub struct CodexMemoryRecentEntry {
  type CodexMemorySyncSummary (line 54) | pub struct CodexMemorySyncSummary {
  type CodexMemoryFactHit (line 62) | pub struct CodexMemoryFactHit {
  type CodexMemoryCodeHit (line 73) | pub struct CodexMemoryCodeHit {
  type CodexMemorySnippetHit (line 80) | pub struct CodexMemorySnippetHit {
  type CodexMemoryQueryResult (line 89) | pub struct CodexMemoryQueryResult {
  type RepoSymbolFact (line 99) | struct RepoSymbolFact {
  type QueryProfile (line 107) | struct QueryProfile {
  function root_dir (line 114) | pub fn root_dir() -> PathBuf {
  function db_path (line 124) | pub fn db_path() -> PathBuf {
  function mirror_skill_eval_event (line 128) | pub fn mirror_skill_eval_event(event: &CodexSkillEvalEvent) -> Result<bo...
  function mirror_skill_outcome_event (line 150) | pub fn mirror_skill_outcome_event(outcome: &CodexSkillOutcomeEvent) -> R...
  function stats (line 167) | pub fn stats() -> Result<CodexMemoryStats> {
  function recent (line 199) | pub fn recent(target_path: Option<&Path>, limit: usize) -> Result<Vec<Co...
  function sync_from_skill_eval_logs (line 231) | pub fn sync_from_skill_eval_logs(limit: usize) -> Result<CodexMemorySync...
  function sync_repo_capsule_for_path (line 255) | pub fn sync_repo_capsule_for_path(path: &Path) -> Result<usize> {
  function mirror_repo_capsule (line 260) | pub fn mirror_repo_capsule(capsule: &repo_capsule::RepoCapsule) -> Resul...
  function query_repo_facts (line 350) | pub fn query_repo_facts(
  function open_connection (line 425) | fn open_connection() -> Result<Connection> {
  function open_connection_at (line 429) | fn open_connection_at(path: &Path) -> Result<Connection> {
  function insert_marshaled (line 485) | fn insert_marshaled(
  function event_key (line 527) | fn event_key(event_kind: &str, payload_json: &str) -> String {
  function fact_key (line 535) | fn fact_key(
  function upsert_fact (line 555) | fn upsert_fact(
  function fact_score (line 592) | fn fact_score(
  function tokenize_query (line 667) | fn tokenize_query(query: &str) -> Vec<String> {
  function build_query_profile (line 693) | fn build_query_profile(query: &str) -> QueryProfile {
  function extract_explicit_paths (line 737) | fn extract_explicit_paths(query_lower: &str) -> Vec<String> {
  function trim_chars (line 764) | fn trim_chars(value: &str, limit: usize) -> String {
  function session_label (line 772) | fn session_label(session_id: &str, title: Option<&str>) -> String {
  function session_summary_body (line 782) | fn session_summary_body(row: &ai::CodexRecoverRow) -> String {
  function sync_repo_symbol_facts (line 818) | fn sync_repo_symbol_facts(conn: &Connection, capsule: &repo_capsule::Rep...
  function sync_repo_session_facts (line 860) | fn sync_repo_session_facts(
  function collect_repo_symbol_facts (line 953) | fn collect_repo_symbol_facts(
  function collect_symbol_candidate_paths (line 989) | fn collect_symbol_candidate_paths(
  function entrypoint_path_score (line 1083) | fn entrypoint_path_score(relative_path: &str) -> f64 {
  function entrypoint_body_for_path (line 1126) | fn entrypoint_body_for_path(relative_path: &str) -> Option<&'static str> {
  function extract_symbol_facts (line 1158) | fn extract_symbol_facts(relative_path: &str, content: &str) -> Vec<RepoS...
  function extract_rust_symbol_facts (line 1177) | fn extract_rust_symbol_facts(relative_path: &str, content: &str) -> Vec<...
  function extract_ts_symbol_facts (line 1204) | fn extract_ts_symbol_facts(relative_path: &str, content: &str) -> Vec<Re...
  function extract_python_symbol_facts (line 1242) | fn extract_python_symbol_facts(relative_path: &str, content: &str) -> Ve...
  function extract_go_symbol_facts (line 1262) | fn extract_go_symbol_facts(relative_path: &str, content: &str) -> Vec<Re...
  function extract_markdown_heading_facts (line 1281) | fn extract_markdown_heading_facts(relative_path: &str, content: &str) ->...
  function symbol_fact (line 1305) | fn symbol_fact(relative_path: &str, kind: &str, name: &str) -> RepoSymbo...
  function parse_prefixed_name (line 1314) | fn parse_prefixed_name(trimmed: &str, prefixes: &[&str]) -> Option<Strin...
  function parse_const_name (line 1330) | fn parse_const_name(trimmed: &str) -> Option<String> {
  function parse_go_func_name (line 1345) | fn parse_go_func_name(trimmed: &str) -> Option<String> {
  function index_is_fresh (line 1360) | fn index_is_fresh(
  function mark_index_fresh (line 1381) | fn mark_index_fresh(
  function search_code_paths (line 1411) | fn search_code_paths(
  function search_symbols_for_code_paths (line 1471) | fn search_symbols_for_code_paths(
  function merge_dynamic_symbol_hits (line 1522) | fn merge_dynamic_symbol_hits(
  function extract_symbol_snippets (line 1546) | fn extract_symbol_snippets(
  function find_symbol_snippet (line 1594) | fn find_symbol_snippet(content: &str, symbol_name: &str) -> Option<Strin...
  function matches_code_extension (line 1632) | fn matches_code_extension(path: &Path) -> bool {
  function score_code_path (line 1672) | fn score_code_path(relative_path: &str, profile: &QueryProfile) -> f64 {
  function render_query_result (line 1728) | fn render_query_result(
  function select_render_fact_hits (line 1757) | fn select_render_fact_hits<'a>(
  function map_recent_entry (line 1844) | fn map_recent_entry(row: &rusqlite::Row<'_>) -> Result<CodexMemoryRecent...
  function event_key_changes_with_kind_and_payload (line 1873) | fn event_key_changes_with_kind_and_payload() {
  function inserts_are_deduped_and_recent_rows_roundtrip (line 1882) | fn inserts_are_deduped_and_recent_rows_roundtrip() {
  function stats_query_counts_rows (line 1933) | fn stats_query_counts_rows() {
  function fact_score_prefers_title_and_paths (line 1995) | fn fact_score_prefers_title_and_paths() {
  function upsert_fact_replaces_existing_row (line 2008) | fn upsert_fact_replaces_existing_row() {
  function code_path_search_prefers_matching_files (line 2045) | fn code_path_search_prefers_matching_files() {
  function code_extension_filter_accepts_repo_docs_and_code (line 2061) | fn code_extension_filter_accepts_repo_docs_and_code() {
  function code_path_scoring_prefers_exact_filename_hits (line 2069) | fn code_path_scoring_prefers_exact_filename_hits() {
  function symbol_extraction_finds_rust_and_ts_entrypoints (line 2082) | fn symbol_extraction_finds_rust_and_ts_entrypoints() {
  function symbol_index_freshness_roundtrips (line 2106) | fn symbol_index_freshness_roundtrips() {
  function render_selection_prefers_symbols_before_doc_noise (line 2154) | fn render_selection_prefers_symbols_before_doc_noise() {
  function query_profile_detects_code_intent_and_explicit_path (line 2194) | fn query_profile_detects_code_intent_and_explicit_path() {
  function query_profile_detects_docs_intent (line 2207) | fn query_profile_detects_docs_intent() {
  function session_summary_body_strips_contextual_first_prompt_noise (line 2213) | fn session_summary_body_strips_contextual_first_prompt_noise() {
  function snippet_extraction_returns_compact_symbol_excerpt (line 2235) | fn snippet_extraction_returns_compact_symbol_excerpt() {
  function extract_symbol_snippets_picks_top_symbol_hits (line 2244) | fn extract_symbol_snippets_picks_top_symbol_hits() {
  function render_selection_prefers_session_context_for_general_queries (line 2270) | fn render_selection_prefers_session_context_for_general_queries() {

FILE: src/codex_runtime.rs
  constant RUNTIME_VERSION (line 14) | const RUNTIME_VERSION: u32 = 1;
  constant RUNTIME_PREFIX (line 15) | const RUNTIME_PREFIX: &str = "flow-runtime-";
  type CodexRuntimeSkill (line 19) | pub struct CodexRuntimeSkill {
  type CodexRuntimeState (line 36) | pub struct CodexRuntimeState {
  type CodexRuntimeActivation (line 46) | pub struct CodexRuntimeActivation {
    method prompt_skill_names (line 125) | fn prompt_skill_names(&self) -> Vec<String> {
    method inject_into_prompt (line 138) | pub fn inject_into_prompt(&self, prompt: &str) -> String {
  type CodexExternalSkill (line 53) | pub struct CodexExternalSkill {
  type CodexSkillSourceSnapshot (line 64) | pub struct CodexSkillSourceSnapshot {
  type CodexInstalledSkillSnapshot (line 74) | pub struct CodexInstalledSkillSnapshot {
  type CodexSkillCatalogEntry (line 84) | pub struct CodexSkillCatalogEntry {
  type CodexRuntimeStateSnapshot (line 98) | pub struct CodexRuntimeStateSnapshot {
  type CodexSkillsDashboardSnapshot (line 108) | pub struct CodexSkillsDashboardSnapshot {
  type RuntimeSkillCandidate (line 118) | struct RuntimeSkillCandidate {
  function runtime_root (line 151) | fn runtime_root() -> Result<PathBuf> {
  function runtime_roots (line 157) | fn runtime_roots() -> Vec<PathBuf> {
  function runtime_states_dir (line 164) | fn runtime_states_dir() -> Result<PathBuf> {
  function runtime_skills_dir (line 170) | fn runtime_skills_dir() -> Result<PathBuf> {
  function agents_skill_root (line 176) | fn agents_skill_root() -> PathBuf {
  function codex_global_skill_root (line 183) | fn codex_global_skill_root() -> PathBuf {
  function slugify (line 190) | fn slugify(value: &str) -> String {
  function parse_frontmatter_field (line 214) | fn parse_frontmatter_field(content: &str, field: &str) -> Option<String> {
  function default_skill_sources (line 234) | fn default_skill_sources() -> Vec<config::CodexSkillSourceConfig> {
  function configured_skill_sources (line 246) | fn configured_skill_sources(
  function looks_like_skill_source_root (line 258) | fn looks_like_skill_source_root(root: &Path) -> bool {
  function collect_skill_dirs (line 264) | fn collect_skill_dirs(root: &Path) -> Result<Vec<PathBuf>> {
  function discover_source_skills (line 285) | fn discover_source_skills(
  function tokenize_keywords (line 318) | fn tokenize_keywords(value: &str) -> Vec<String> {
  function contains_any (line 347) | fn contains_any(haystack: &str, needles: &[&str]) -> bool {
  function classify_skill_category (line 351) | fn classify_skill_category(name: &str, description: &str) -> &'static str {
  function match_external_skill (line 475) | fn match_external_skill(query: &str, skill: &CodexExternalSkill) -> f64 {
  function describe_external_skill_match (line 496) | fn describe_external_skill_match(query: &str, skill: &CodexExternalSkill...
  function copy_dir_recursive (line 519) | fn copy_dir_recursive(source: &Path, dest: &Path) -> Result<()> {
  function rewrite_skill_name (line 547) | fn rewrite_skill_name(content: &str, name: &str) -> String {
  function allocate_plan_path (line 573) | fn allocate_plan_path(root: &Path, stem: &str) -> PathBuf {
  function derive_plan_title (line 589) | fn derive_plan_title(body: &str) -> String {
  function append_session_footer (line 606) | fn append_session_footer(body: &str, session_id: Option<&str>) -> String {
  function unix_now (line 618) | fn unix_now() -> u64 {
  function runtime_token (line 625) | fn runtime_token(target_path: &Path, query: &str) -> String {
  function plan_skill_name (line 638) | fn plan_skill_name(token: &str) -> String {
  function build_plan_skill_markdown (line 642) | fn build_plan_skill_markdown(skill_name: &str) -> String {
  function looks_like_plan_request (line 677) | fn looks_like_plan_request(query: &str) -> bool {
  function discover_external_skills (line 691) | pub fn discover_external_skills(
  function dashboard_snapshot (line 703) | pub fn dashboard_snapshot(
  function discover_installed_skills (line 755) | fn discover_installed_skills() -> Result<Vec<CodexInstalledSkillSnapshot...
  function build_skill_catalog (line 791) | fn build_skill_catalog(
  function format_external_skills (line 864) | pub fn format_external_skills(skills: &[CodexExternalSkill]) -> String {
  function sync_external_skills (line 882) | pub fn sync_external_skills(
  function prepare_runtime_activation (line 920) | pub fn prepare_runtime_activation(
  function load_runtime_states (line 1081) | pub fn load_runtime_states() -> Result<Vec<CodexRuntimeState>> {
  function clear_runtime_states (line 1107) | pub fn clear_runtime_states() -> Result<usize> {
  function format_runtime_states (line 1151) | pub fn format_runtime_states(states: &[CodexRuntimeState]) -> String {
  function load_runtime_state_from_env (line 1179) | fn load_runtime_state_from_env() -> Option<CodexRuntimeState> {
  function write_plan_from_stdin (line 1188) | pub fn write_plan_from_stdin(
  function plan_request_detection_stays_specific (line 1281) | fn plan_request_detection_stays_specific() {
  function runtime_prompt_prelude_is_human_readable (line 1289) | fn runtime_prompt_prelude_is_human_readable() {
  function session_footer_is_added_once (line 1311) | fn session_footer_is_added_once() {
  function discover_external_skills_supports_nested_repo_layout (line 1319) | fn discover_external_skills_supports_nested_repo_layout() {
  function discover_external_skills_supports_flat_repo_layout (line 1347) | fn discover_external_skills_supports_flat_repo_layout() {
  function classify_skill_category_prefers_verification_for_driver_skills (line 1375) | fn classify_skill_category_prefers_verification_for_driver_skills() {
  function describe_external_skill_match_reports_name_phrase_hits (line 1386) | fn describe_external_skill_match_reports_name_phrase_hits() {
  function build_skill_catalog_merges_source_and_global_install (line 1406) | fn build_skill_catalog_merges_source_and_global_install() {

FILE: src/codex_skill_eval.rs
  constant SKILL_EVAL_VERSION (line 13) | const SKILL_EVAL_VERSION: u32 = 1;
  constant SKILL_EVAL_REVERSE_SCAN_CHUNK_BYTES (line 14) | const SKILL_EVAL_REVERSE_SCAN_CHUNK_BYTES: usize = 16 * 1024;
  type CodexSkillEvalEvent (line 18) | pub struct CodexSkillEvalEvent {
  type CodexSkillScore (line 49) | pub struct CodexSkillScore {
  type CodexSkillOutcomeEvent (line 63) | pub struct CodexSkillOutcomeEvent {
  type CodexSkillScorecard (line 86) | pub struct CodexSkillScorecard {
  type SkillAggregate (line 95) | struct SkillAggregate {
  function unix_now (line 104) | fn unix_now() -> u64 {
  function skill_eval_root (line 111) | fn skill_eval_root() -> Result<PathBuf> {
  function skill_eval_roots (line 117) | fn skill_eval_roots() -> Vec<PathBuf> {
  function load_events_from_paths (line 124) | fn load_events_from_paths(
  function load_outcomes_from_paths (line 159) | fn load_outcomes_from_paths(
  function events_path (line 197) | fn events_path() -> Result<PathBuf> {
  function events_log_path (line 203) | pub fn events_log_path() -> Result<PathBuf> {
  function outcomes_path (line 207) | fn outcomes_path() -> Result<PathBuf> {
  function outcomes_log_path (line 213) | pub fn outcomes_log_path() -> Result<PathBuf> {
  function scorecards_dir (line 217) | fn scorecards_dir() -> Result<PathBuf> {
  function scorecard_key (line 223) | fn scorecard_key(target_path: &Path) -> String {
  function scorecard_path (line 230) | fn scorecard_path(target_path: &Path) -> Result<PathBuf> {
  function tokenize_words (line 234) | fn tokenize_words(value: &str) -> Vec<String> {
  function affinity_for_skill (line 264) | fn affinity_for_skill(skill_name: &str, query: &str) -> f64 {
  function calculate_normalized_gain (line 283) | fn calculate_normalized_gain(p_with: f64, p_without: f64) -> f64 {
  function path_matches (line 290) | fn path_matches(event: &CodexSkillEvalEvent, target_path: &Path) -> bool {
  function log_event (line 298) | pub fn log_event(event: &CodexSkillEvalEvent) -> Result<()> {
  function log_outcome (line 318) | pub fn log_outcome(outcome: &CodexSkillOutcomeEvent) -> Result<()> {
  function event_count (line 333) | pub fn event_count() -> usize {
  function outcome_count (line 339) | pub fn outcome_count() -> usize {
  function load_events (line 345) | pub fn load_events(target_path: Option<&Path>, limit: usize) -> Result<V...
  function collect_recent_targets (line 356) | fn collect_recent_targets(
  function recent_targets (line 385) | pub fn recent_targets(limit: usize, max_targets: usize, within_hours: u6...
  function load_outcomes (line 393) | pub fn load_outcomes(
  function rebuild_scorecard (line 407) | pub fn rebuild_scorecard(target_path: &Path, limit: usize) -> Result<Cod...
  function build_scorecard (line 417) | fn build_scorecard(
  function load_scorecard (line 591) | pub fn load_scorecard(target_path: &Path) -> Result<Option<CodexSkillSco...
  function visit_lines_reverse (line 607) | fn visit_lines_reverse<T, F>(
  function process_reverse_line_segment (line 674) | fn process_reverse_line_segment<T, F>(
  function score_for_skill (line 695) | pub fn score_for_skill(target_path: &Path, name: &str) -> Option<f64> {
  function format_scorecard (line 708) | pub fn format_scorecard(scorecard: &CodexSkillScorecard) -> String {
  function normalized_gain_behaves_like_skillgrade_formula (line 744) | fn normalized_gain_behaves_like_skillgrade_formula() {
  function affinity_prefers_phrase_matches (line 750) | fn affinity_prefers_phrase_matches() {
  function load_events_reads_both_state_roots (line 758) | fn load_events_reads_both_state_roots() {
  function load_events_sanitizes_contextual_queries (line 817) | fn load_events_sanitizes_contextual_queries() {
  function resolve_events_contribute_outcome_samples (line 850) | fn resolve_events_contribute_outcome_samples() {
  function session_linked_events_contribute_baseline_outcomes (line 901) | fn session_linked_events_contribute_baseline_outcomes() {
  function recent_targets_filters_old_missing_and_excess_targets (line 950) | fn recent_targets_filters_old_missing_and_excess_targets() {

FILE: src/codex_telemetry.rs
  constant CODEX_MAPLE_DEFAULT_SERVICE_NAME (line 19) | const CODEX_MAPLE_DEFAULT_SERVICE_NAME: &str = "flow-codex";
  constant CODEX_MAPLE_DEFAULT_SCOPE_NAME (line 20) | const CODEX_MAPLE_DEFAULT_SCOPE_NAME: &str = "flow.codex";
  constant CODEX_MAPLE_DEFAULT_ENV (line 21) | const CODEX_MAPLE_DEFAULT_ENV: &str = "local";
  constant CODEX_MAPLE_DEFAULT_QUEUE_CAPACITY (line 22) | const CODEX_MAPLE_DEFAULT_QUEUE_CAPACITY: usize = 1024;
  constant CODEX_MAPLE_DEFAULT_MAX_BATCH_SIZE (line 23) | const CODEX_MAPLE_DEFAULT_MAX_BATCH_SIZE: usize = 64;
  constant CODEX_MAPLE_DEFAULT_FLUSH_INTERVAL_MS (line 24) | const CODEX_MAPLE_DEFAULT_FLUSH_INTERVAL_MS: u64 = 100;
  constant CODEX_MAPLE_DEFAULT_CONNECT_TIMEOUT_MS (line 25) | const CODEX_MAPLE_DEFAULT_CONNECT_TIMEOUT_MS: u64 = 400;
  constant CODEX_MAPLE_DEFAULT_REQUEST_TIMEOUT_MS (line 26) | const CODEX_MAPLE_DEFAULT_REQUEST_TIMEOUT_MS: u64 = 800;
  constant DEFAULT_MAPLE_MCP_ENDPOINT (line 27) | const DEFAULT_MAPLE_MCP_ENDPOINT: &str = "https://api.maple.dev/mcp";
  type CodexTelemetryExportState (line 31) | struct CodexTelemetryExportState {
  type CodexTelemetryStatus (line 42) | pub struct CodexTelemetryStatus {
  type CodexTelemetryFlushSummary (line 59) | pub struct CodexTelemetryFlushSummary {
  type CodexTraceStatus (line 72) | pub struct CodexTraceStatus {
  type CodexTraceInspectResult (line 84) | pub struct CodexTraceInspectResult {
  type CodexCurrentSessionTrace (line 95) | pub struct CodexCurrentSessionTrace {
  type MapleReadConfig (line 109) | struct MapleReadConfig {
  function unix_now (line 117) | fn unix_now() -> u64 {
  function env_non_empty (line 124) | fn env_non_empty(key: &str) -> Option<String> {
  function telemetry_env_keys (line 131) | fn telemetry_env_keys() -> Vec<String> {
  function maple_target_env_keys (line 156) | fn maple_target_env_keys() -> &'static [&'static str] {
  function shell_has_explicit_maple_target_env (line 167) | fn shell_has_explicit_maple_target_env() -> bool {
  function env_non_empty_with_store (line 173) | fn env_non_empty_with_store(
  function telemetry_state_path (line 191) | fn telemetry_state_path() -> Result<PathBuf> {
  function load_state (line 197) | fn load_state() -> Result<CodexTelemetryExportState> {
  function save_state (line 215) | fn save_state(state: &CodexTelemetryExportState) -> Result<()> {
  function parse_maple_exporter_config_from_env (line 229) | fn parse_maple_exporter_config_from_env() -> Result<Option<MapleExporter...
  function parse_maple_read_config_from_env (line 337) | fn parse_maple_read_config_from_env() -> Result<Option<MapleReadConfig>> {
  function maple_json_rpc_request (line 376) | fn maple_json_rpc_request(
  function maple_tool_result_error (line 431) | fn maple_tool_result_error(result: &serde_json::Value) -> Option<String> {
  function maple_call_tool (line 446) | fn maple_call_tool(
  function status (line 465) | pub fn status() -> Result<CodexTelemetryStatus> {
  function trace_status (line 494) | pub fn trace_status() -> Result<CodexTraceStatus> {
  function inspect_trace (line 538) | pub fn inspect_trace(trace_id: &str, flush_first: bool) -> Result<CodexT...
  function inspect_current_session_trace (line 569) | pub fn inspect_current_session_trace(flush_first: bool) -> Result<CodexC...
  function stable_hex_id (line 594) | fn stable_hex_id(parts: &[&str], width: usize) -> String {
  function redact_id (line 609) | fn redact_id(value: Option<&str>) -> String {
  function repo_name (line 616) | fn repo_name(path: &str) -> String {
  function path_hash (line 625) | fn path_hash(path: &str) -> String {
  function artifact_name (line 629) | fn artifact_name(path: Option<&str>) -> String {
  function event_span (line 637) | fn event_span(event: &CodexSkillEvalEvent) -> MapleSpan {
  function outcome_span (line 726) | fn outcome_span(outcome: &CodexSkillOutcomeEvent) -> MapleSpan {
  function export_lines (line 823) | fn export_lines<T, F, E>(
  function flush (line 876) | pub fn flush(limit: usize) -> Result<CodexTelemetryFlushSummary> {
  function maybe_flush (line 937) | pub fn maybe_flush(limit: usize) -> Result<usize> {
  function repo_name_uses_leaf_directory (line 947) | fn repo_name_uses_leaf_directory() {
  function redact_id_is_stable_and_short (line 953) | fn redact_id_is_stable_and_short() {

FILE: src/codex_text.rs
  function strip_tagged_block (line 1) | fn strip_tagged_block(text: &str, open_tag: &str, close_tag: &str) -> St...
  function strip_system_reminders (line 15) | fn strip_system_reminders(text: &str) -> String {
  function strip_agents_instruction_block (line 21) | fn strip_agents_instruction_block(text: &str) -> String {
  function truncate_before_heading (line 42) | fn truncate_before_heading(text: &str, heading: &str) -> String {
  function collapse_blank_lines (line 56) | fn collapse_blank_lines(text: &str) -> String {
  function sanitize_codex_memory_rollout_text (line 82) | pub(crate) fn sanitize_codex_memory_rollout_text(text: &str) -> Option<S...
  function sanitize_codex_query_text (line 95) | pub(crate) fn sanitize_codex_query_text(text: &str) -> Option<String> {
  function rollout_sanitizer_drops_agents_and_skills_but_keeps_environment (line 131) | fn rollout_sanitizer_drops_agents_and_skills_but_keeps_environment() {
  function query_sanitizer_keeps_only_real_user_intent (line 148) | fn query_sanitizer_keeps_only_real_user_intent() {
  function query_sanitizer_drops_context_only_messages (line 164) | fn query_sanitizer_drops_context_only_messages() {

FILE: src/codexd.rs
  constant CODEXD_NAME (line 15) | const CODEXD_NAME: &str = "codexd";
  type FileLockGuard (line 19) | struct FileLockGuard {
  method drop (line 25) | fn drop(&mut self) {
  type CodexdRequest (line 32) | enum CodexdRequest {
  type CodexdResponse (line 53) | struct CodexdResponse {
  function builtin_daemon_config (line 60) | pub fn builtin_daemon_config() -> Result<config::DaemonConfig> {
  function socket_path (line 89) | pub fn socket_path() -> Result<PathBuf> {
  function lock_path (line 93) | fn lock_path() -> Result<PathBuf> {
  function acquire_process_lock (line 98) | fn acquire_process_lock(file: &std::fs::File) -> Result<FileLockGuard> {
  function acquire_process_lock (line 113) | fn acquire_process_lock(_file: &std::fs::File) -> Result<()> {
  function ping (line 117) | pub fn ping() -> Result<()> {
  function is_running (line 131) | pub fn is_running() -> bool {
  function ensure_running (line 135) | pub fn ensure_running() -> Result<()> {
  function start (line 142) | pub fn start() -> Result<()> {
  function stop (line 146) | pub fn stop() -> Result<()> {
  function status (line 150) | pub fn status() -> Result<()> {
  function serve (line 154) | pub fn serve(socket_override: Option<&Path>) -> Result<()> {
  function background_poll_secs (line 200) | fn background_poll_secs() -> u64 {
  function start_background_maintenance_loop (line 208) | fn start_background_maintenance_loop() {
  function query_recent (line 228) | pub(crate) fn query_recent(
  function query_session_hint (line 253) | pub(crate) fn query_session_hint(
  function query_find (line 274) | pub(crate) fn query_find(
  function send_request (line 299) | fn send_request(request: &CodexdRequest) -> Result<CodexdResponse> {
  function handle_client (line 323) | fn handle_client(stream: UnixStream) -> Result<()> {
  function handle_request (line 344) | fn handle_request(request: CodexdRequest) -> CodexdResponse {
  function trim_ascii_whitespace (line 414) | fn trim_ascii_whitespace(bytes: &[u8]) -> &[u8] {
  function builtin_daemon_config_uses_socket_health (line 432) | fn builtin_daemon_config_uses_socket_health() {
  function process_lock_rejects_second_holder (line 456) | fn process_lock_rejects_second_holder() {

FILE: src/commit.rs
  constant MODEL (line 45) | const MODEL: &str = "gpt-4.1-nano";
  constant MAX_DIFF_CHARS (line 46) | const MAX_DIFF_CHARS: usize = 12_000;
  constant HUB_HOST (line 47) | const HUB_HOST: IpAddr = IpAddr::V4(std::net::Ipv4Addr::new(127, 0, 0, 1));
  constant HUB_PORT (line 48) | const HUB_PORT: u16 = 9050;
  constant DEFAULT_OPENROUTER_REVIEW_MODEL (line 49) | const DEFAULT_OPENROUTER_REVIEW_MODEL: &str = "arcee-ai/trinity-large-pr...
  constant DEFAULT_OPENCODE_MODEL (line 50) | const DEFAULT_OPENCODE_MODEL: &str = "opencode/minimax-m2.1-free";
  constant DEFAULT_RISE_MODEL (line 51) | const DEFAULT_RISE_MODEL: &str = "zai:glm-4.7";
  constant DEFAULT_GLM5_RISE_MODEL (line 52) | const DEFAULT_GLM5_RISE_MODEL: &str = "zai:glm-5";
  constant SENSITIVE_PATTERNS (line 55) | const SENSITIVE_PATTERNS: &[&str] = &[
  constant SYSTEM_PROMPT (line 83) | const SYSTEM_PROMPT: &str = "You are an expert software engineer who wri...
  type ReviewModelArg (line 86) | pub enum ReviewModelArg {
    method as_arg (line 147) | fn as_arg(&self) -> &'static str {
  type CommitQueueMode (line 96) | pub struct CommitQueueMode {
    method with_open_review (line 103) | pub fn with_open_review(mut self, open_review: bool) -> Self {
  type CommitGateOverrides (line 110) | pub struct CommitGateOverrides {
  type CommitTestingPolicy (line 117) | struct CommitTestingPolicy {
  type CommitSkillGatePolicy (line 129) | struct CommitSkillGatePolicy {
  type SkillGateReport (line 136) | struct SkillGateReport {
  type CodexModel (line 157) | pub enum CodexModel {
    method as_codex_arg (line 163) | fn as_codex_arg(&self) -> &'static str {
  type ClaudeModel (line 172) | pub enum ClaudeModel {
    method as_claude_arg (line 178) | fn as_claude_arg(&self) -> &'static str {
  type ReviewSelection (line 187) | pub enum ReviewSelection {
    method is_codex (line 197) | fn is_codex(&self) -> bool {
    method is_openrouter (line 201) | fn is_openrouter(&self) -> bool {
    method review_model_arg (line 205) | fn review_model_arg(&self) -> Option<ReviewModelArg> {
    method model_label (line 218) | fn model_label(&self) -> String {
  function review_tool_label (line 233) | fn review_tool_label(selection: &ReviewSelection) -> &'static str {
  function check_sensitive_files (line 246) | fn check_sensitive_files(repo_root: &Path) -> Vec<String> {
  function warn_sensitive_files (line 297) | fn warn_sensitive_files(files: &[String]) -> Result<()> {
  function warn_secrets_in_diff (line 320) | fn warn_secrets_in_diff(
  function should_run_sync_for_secret_fixes (line 443) | fn should_run_sync_for_secret_fixes(repo_root: &Path) -> Result<bool> {
  function run_fix_f_commit_agent (line 467) | fn run_fix_f_commit_agent(repo_root: &Path, agent: &str, task: &str) -> ...
  function run_fix_f_commit_ai (line 489) | fn run_fix_f_commit_ai(repo_root: &Path, task: &str) -> Result<()> {
  function build_fix_f_commit_task (line 510) | fn build_fix_f_commit_task(findings: &[(String, usize, String, String)])...
  function print_secret_findings (line 532) | fn print_secret_findings(header: &str, findings: &[(String, usize, Strin...
  function has_unstaged_changes (line 539) | fn has_unstaged_changes(repo_root: &Path, file: &str) -> bool {
  function sanitize_hive_task (line 556) | fn sanitize_hive_task(task: &str) -> String {
  function resolve_hive_env (line 568) | fn resolve_hive_env() -> Vec<(String, String)> {
  constant LARGE_DIFF_THRESHOLD (line 592) | const LARGE_DIFF_THRESHOLD: usize = 500;
  function check_large_diffs (line 596) | fn check_large_diffs(repo_root: &Path) -> Vec<(String, usize)> {
  function warn_large_diffs (line 635) | fn warn_large_diffs(files: &[(String, usize)]) -> Result<()> {
  function resolve_review_selection_from_config (line 657) | pub fn resolve_review_selection_from_config() -> Option<ReviewSelection> {
  function resolve_review_selection (line 714) | pub fn resolve_review_selection(
  function resolve_review_selection_v2 (line 739) | pub fn resolve_review_selection_v2(
  function parse_boolish (line 764) | fn parse_boolish(value: &str) -> Option<bool> {
  function load_ts_commit_config (line 772) | fn load_ts_commit_config() -> Option<config::TsCommitConfig> {
  function load_local_commit_config (line 778) | fn load_local_commit_config(repo_root: &Path) -> Option<config::CommitCo...
  function load_global_commit_config (line 786) | fn load_global_commit_config() -> Option<config::CommitConfig> {
  function commit_quick_default_enabled (line 794) | pub fn commit_quick_default_enabled() -> bool {
  function commit_review_fail_open_enabled (line 823) | fn commit_review_fail_open_enabled(repo_root: &Path) -> bool {
  function commit_message_fail_open_enabled (line 849) | fn commit_message_fail_open_enabled(repo_root: &Path) -> bool {
  function parse_review_selection_spec (line 875) | fn parse_review_selection_spec(spec: &str) -> Option<ReviewSelection> {
  function commit_review_fallback_specs (line 965) | fn commit_review_fallback_specs(repo_root: &Path) -> Vec<String> {
  function review_attempts_for_selection (line 1021) | fn review_attempts_for_selection(
  type CommitMessageSelection (line 1050) | enum CommitMessageSelection {
    method key (line 1062) | fn key(&self) -> String {
    method label (line 1080) | fn label(&self) -> String {
  function parse_commit_message_selection_spec (line 1094) | fn parse_commit_message_selection_spec(spec: &str) -> Option<CommitMessa...
  function parse_commit_message_selection_with_model (line 1203) | fn parse_commit_message_selection_with_model(
  function commit_message_fallback_specs (line 1244) | fn commit_message_fallback_specs(repo_root: &Path) -> Vec<String> {
  function review_selection_to_message_selection (line 1300) | fn review_selection_to_message_selection(
  function commit_message_attempts (line 1321) | fn commit_message_attempts(
  type ReviewJson (line 1354) | struct ReviewJson {
  type RemoteReviewRequest (line 1367) | struct RemoteReviewRequest {
  type RemoteReviewResponse (line 1376) | struct RemoteReviewResponse {
  type RemoteCommitMessageResponse (line 1383) | struct RemoteCommitMessageResponse {
  type ReviewResult (line 1388) | struct ReviewResult {
  type QualityResult (line 1399) | pub(crate) struct QualityResult {
  type FeatureTouched (line 1410) | pub(crate) struct FeatureTouched {
  type NewFeature (line 1422) | pub(crate) struct NewFeature {
  type StagedSnapshot (line 1430) | struct StagedSnapshot {
  type UnhashCommitMetadata (line 1435) | struct UnhashCommitMetadata {
  type UnhashReviewPayload (line 1455) | struct UnhashReviewPayload {
  type ChatRequest (line 1466) | struct ChatRequest {
  type Message (line 1473) | struct Message {
  type ChatResponse (line 1479) | struct ChatResponse {
  type Choice (line 1484) | struct Choice {
  type ResponseMessage (line 1489) | struct ResponseMessage {
  function parse_rise_output (line 1493) | fn parse_rise_output(text: &str) -> Result<String> {
  function is_rise_auth_error (line 1551) | fn is_rise_auth_error(text: &str) -> bool {
  function rise_provider_from_model (line 1558) | fn rise_provider_from_model(model: &str) -> Option<String> {
  function rise_provider_env_key (line 1571) | fn rise_provider_env_key(provider: &str) -> Option<&'static str> {
  function is_local_env_backend (line 1582) | fn is_local_env_backend() -> bool {
  function rise_auth_error_message (line 1604) | fn rise_auth_error_message(model: &str) -> String {
  function rise_url (line 1643) | fn rise_url() -> String {
  function rise_health_url (line 1650) | fn rise_health_url(rise_url: &str) -> Option<String> {
  function wait_for_rise_ready (line 1656) | fn wait_for_rise_ready(client: &Client, rise_url: &str) {
  function try_start_rise_daemon (line 1668) | fn try_start_rise_daemon() -> Result<()> {
  function try_restart_rise_daemon (line 1678) | fn try_restart_rise_daemon() -> Result<()> {
  function send_rise_request_text (line 1689) | fn send_rise_request_text(
  function send_rise_request (line 1750) | fn send_rise_request(
  function dry_run_context (line 1789) | pub fn dry_run_context() -> Result<()> {
  function run (line 1865) | pub fn run(
  function save_commit_checkpoint_for_repo (line 1888) | fn save_commit_checkpoint_for_repo(repo_root: &Path) {
  function git_commit_timestamp_iso (line 1912) | fn git_commit_timestamp_iso(repo_root: &Path, rev: &str) -> Option<Strin...
  type MyflowSessionWindow (line 1920) | struct MyflowSessionWindow {
    method new (line 1928) | fn new(mode: &str, since_ts: Option<String>, until_ts: Option<String>)...
  function collect_sync_sessions_for_commit_with_window (line 1938) | fn collect_sync_sessions_for_commit_with_window(
  function collect_sync_sessions_for_pending_commit_with_window (line 1983) | fn collect_sync_sessions_for_pending_commit_with_window(
  function run_sync (line 2030) | pub fn run_sync(
  function run_fast (line 2254) | pub fn run_fast(
  function run_quick_then_async_review (line 2423) | pub fn run_quick_then_async_review(
  function ensure_commit_queued_for_async_review (line 2476) | fn ensure_commit_queued_for_async_review(repo_root: &Path, commit_sha: &...
  function spawn_async_queue_review (line 2486) | fn spawn_async_queue_review(repo_root: &Path, commit_sha: &str) -> Resul...
  function run_with_check (line 2505) | pub fn run_with_check(
  function run_with_check_with_gitedit (line 2566) | pub fn run_with_check_with_gitedit(
  function commit_with_check_async_enabled (line 2627) | fn commit_with_check_async_enabled() -> bool {
  function commit_with_check_use_repo_root (line 2658) | fn commit_with_check_use_repo_root() -> bool {
  function resolve_commit_with_check_root (line 2678) | fn resolve_commit_with_check_root() -> Result<std::path::PathBuf> {
  constant DEFAULT_COMMIT_WITH_CHECK_TIMEOUT_SECS (line 2700) | const DEFAULT_COMMIT_WITH_CHECK_TIMEOUT_SECS: u64 = 300;
  constant MAX_COMMIT_WITH_CHECK_TIMEOUT_SECS (line 2701) | const MAX_COMMIT_WITH_CHECK_TIMEOUT_SECS: u64 = 3600;
  constant DEFAULT_COMMIT_WITH_CHECK_REVIEW_RETRIES (line 2702) | const DEFAULT_COMMIT_WITH_CHECK_REVIEW_RETRIES: u32 = 2;
  constant MAX_COMMIT_WITH_CHECK_REVIEW_RETRIES (line 2703) | const MAX_COMMIT_WITH_CHECK_REVIEW_RETRIES: u32 = 5;
  constant DEFAULT_COMMIT_WITH_CHECK_RETRY_BACKOFF_SECS (line 2704) | const DEFAULT_COMMIT_WITH_CHECK_RETRY_BACKOFF_SECS: u64 = 3;
  function commit_with_check_timeout_from_env (line 2706) | fn commit_with_check_timeout_from_env() -> Option<u64> {
  function commit_with_check_timeout_secs (line 2722) | fn commit_with_check_timeout_secs() -> u64 {
  function commit_with_check_review_retries (line 2754) | fn commit_with_check_review_retries() -> u32 {
  function commit_with_check_retry_backoff_secs (line 2793) | fn commit_with_check_retry_backoff_secs(attempt: u32) -> u64 {
  function commit_with_check_review_url (line 2805) | fn commit_with_check_review_url() -> Option<String> {
  function commit_with_check_review_token (line 2850) | fn commit_with_check_review_token() -> Option<String> {
  function resolve_commit_queue_mode (line 2893) | pub fn resolve_commit_queue_mode(cli_queue: bool, cli_no_queue: bool) ->...
  function commit_queue_enabled_from_config (line 2916) | fn commit_queue_enabled_from_config() -> bool {
  function commit_queue_on_issues_enabled (line 2953) | fn commit_queue_on_issues_enabled(repo_root: &Path) -> bool {
  function prompt_yes_no (line 2989) | fn prompt_yes_no(message: &str) -> Result<bool> {
  function prompt_yes_no_default_yes (line 2998) | fn prompt_yes_no_default_yes(message: &str) -> Result<bool> {
  function resolve_commit_testing_policy (line 3013) | fn resolve_commit_testing_policy(repo_root: &Path) -> CommitTestingPolicy {
  function resolve_commit_skill_gate_policy (line 3067) | fn resolve_commit_skill_gate_policy(repo_root: &Path) -> CommitSkillGate...
  function run_required_skill_gate (line 3099) | fn run_required_skill_gate(
  function build_required_skills_prompt_context (line 3183) | fn build_required_skills_prompt_context(
  function combine_review_instructions (line 3206) | fn combine_review_instructions(
  type InvariantFinding (line 3231) | struct InvariantFinding {
  type InvariantGateReport (line 3239) | struct InvariantGateReport {
    method to_prompt_context (line 3245) | fn to_prompt_context(&self, inv: &config::InvariantsConfig) -> String {
  function resolve_invariants_config (line 3299) | fn resolve_invariants_config(repo_root: &Path) -> Option<config::Invaria...
  function run_invariant_gate (line 3304) | fn run_invariant_gate(
  function check_unapproved_deps (line 3441) | fn check_unapproved_deps(
  function is_bun_repo_layout (line 3471) | fn is_bun_repo_layout(repo_root: &Path) -> bool {
  function looks_like_source_file_for_test_gate (line 3482) | fn looks_like_source_file_for_test_gate(path: &str) -> bool {
  function is_test_file_path (line 3495) | fn is_test_file_path(path: &str) -> bool {
  function normalize_rel_path (line 3509) | fn normalize_rel_path(path: &Path) -> String {
  function normalize_dir_path (line 3513) | fn normalize_dir_path(path: &str) -> String {
  function path_is_within_dir (line 3521) | fn path_is_within_dir(path: &str, dir: &str) -> bool {
  function find_ai_scratch_tests (line 3530) | fn find_ai_scratch_tests(repo_root: &Path, scratch_dir: &str) -> Vec<Str...
  function collect_candidate_js_test_paths (line 3571) | fn collect_candidate_js_test_paths(rel_path: &Path) -> Vec<PathBuf> {
  function collect_candidate_rust_test_paths (line 3607) | fn collect_candidate_rust_test_paths(rel_path: &Path) -> Vec<PathBuf> {
  function find_related_tests (line 3626) | fn find_related_tests(
  function find_non_bun_test_tasks (line 3672) | fn find_non_bun_test_tasks(repo_root: &Path, strict_bun_repo: bool) -> V...
  function apply_testing_gate_failure (line 3714) | fn apply_testing_gate_failure(mode: &str, message: &str) -> Result<()> {
  function run_pre_commit_test_gate (line 3723) | fn run_pre_commit_test_gate(
  function is_doc_gate_failure (line 3862) | fn is_doc_gate_failure(message: &str) -> bool {
  function is_test_gate_failure (line 3867) | fn is_test_gate_failure(message: &str) -> bool {
  function run_review_attempt (line 3872) | fn run_review_attempt(
  function run_with_check_sync (line 3938) | pub fn run_with_check_sync(
  function codex_write_msg (line 4721) | fn codex_write_msg(writer: &mut dyn Write, msg: &serde_json::Value) -> R...
  type CodexAppServerEvent (line 4729) | enum CodexAppServerEvent {
  type CodexReadOutcome (line 4735) | enum CodexReadOutcome {
  function codex_read_next_message (line 4740) | fn codex_read_next_message(
  function codex_read_response (line 4776) | fn codex_read_response(
  function codex_read_response_with_notifications (line 4800) | fn codex_read_response_with_notifications<F>(
  function openrouter_review_should_use_codex (line 4833) | fn openrouter_review_should_use_codex() -> bool {
  function beads_rust_history_dir (line 4842) | fn beads_rust_history_dir(repo_root: &Path) -> PathBuf {
  function beads_rust_beads_dir (line 4849) | fn beads_rust_beads_dir(repo_root: &Path) -> PathBuf {
  function flow_commit_reports_dir (line 4853) | fn flow_commit_reports_dir() -> Option<PathBuf> {
  function write_commit_review_markdown_report (line 4863) | fn write_commit_review_markdown_report(
  function write_beads_commit_review_record (line 4970) | fn write_beads_commit_review_record(
  function run_codex_review (line 5043) | fn run_codex_review(
  function run_codex_review_once (line 5083) | fn run_codex_review_once(
  function configured_codex_bin_for_workdir (line 5414) | pub(crate) fn configured_codex_bin_for_workdir(workdir: &Path) -> String {
  function normalize_codex_bin_value (line 5463) | fn normalize_codex_bin_value(raw: &str) -> String {
  function normalize_review_url (line 5481) | fn normalize_review_url(url: &str) -> String {
  function run_remote_claude_review (line 5490) | fn run_remote_claude_review(
  function run_claude_review (line 5583) | fn run_claude_review(
  function run_opencode_review (line 5834) | fn run_opencode_review(
  function changed_files_from_diff (line 5950) | fn changed_files_from_diff(diff: &str) -> Vec<String> {
  function issue_mentions_changed_file (line 5964) | fn issue_mentions_changed_file(issue: &str, files: &[String]) -> bool {
  function run_kimi_review (line 5981) | fn run_kimi_review(
  function run_openrouter_review (line 6177) | fn run_openrouter_review(
  constant OPENROUTER_CHAT_URL (line 6324) | const OPENROUTER_CHAT_URL: &str = "https://openrouter.ai/api/v1/chat/com...
  function openrouter_http_client (line 6326) | fn openrouter_http_client(timeout: Duration) -> Result<Client> {
  function openrouter_should_retry_error (line 6337) | fn openrouter_should_retry_error(err: &reqwest::Error) -> bool {
  function openrouter_retry_after (line 6350) | fn openrouter_retry_after(resp: &reqwest::blocking::Response) -> Option<...
  function openrouter_chat_completion_with_retry (line 6357) | fn openrouter_chat_completion_with_retry(
  function run_rise_review (line 6490) | fn run_rise_review(
  function ensure_git_repo (line 6586) | fn ensure_git_repo() -> Result<()> {
  function git_root_or_cwd (line 6601) | fn git_root_or_cwd() -> std::path::PathBuf {
  function warn_if_commit_invoked_from_subdir (line 6608) | fn warn_if_commit_invoked_from_subdir(repo_root: &Path) {
  function ensure_commit_setup (line 6630) | fn ensure_commit_setup(repo_root: &Path) -> Result<()> {
  function ensure_no_internal_staged (line 6638) | fn ensure_no_internal_staged(repo_root: &Path) -> Result<()> {
  function internal_staged_paths (line 6655) | fn internal_staged_paths(repo_root: &Path) -> Vec<String> {
  function ensure_no_unwanted_staged (line 6680) | fn ensure_no_unwanted_staged(repo_root: &Path) -> Result<()> {
  function unwanted_staged_paths (line 6745) | fn unwanted_staged_paths(repo_root: &Path) -> Vec<(String, String)> {
  function unwanted_reason (line 6795) | fn unwanted_reason(path: &str) -> Option<&'static str> {
  function log_commit_event_for_repo (line 6817) | fn log_commit_event_for_repo(
  function record_undo_action (line 6853) | fn record_undo_action(repo_root: &Path, pushed: bool, message: Option<&s...
  constant COMMIT_QUEUE_DIR (line 6896) | const COMMIT_QUEUE_DIR: &str = ".ai/internal/commit-queue";
  type CommitQueueEntry (line 6899) | struct CommitQueueEntry {
  constant RISE_REVIEW_DIR (line 6937) | const RISE_REVIEW_DIR: &str = ".ai/internal/rise-review";
  constant EMPTY_TREE_HASH (line 6938) | const EMPTY_TREE_HASH: &str = "4b825dc642cb6eb9a060e54bf8d69288fbee4904";
  type RiseReviewFileEntry (line 6941) | struct RiseReviewFileEntry {
  type RiseReviewSession (line 6949) | struct RiseReviewSession {
  function short_sha (line 6973) | fn short_sha(sha: &str) -> &str {
  function commit_queue_dir (line 6977) | fn commit_queue_dir(repo_root: &Path) -> PathBuf {
  function commit_queue_entry_path (line 6981) | fn commit_queue_entry_path(repo_root: &Path, sha: &str) -> PathBuf {
  function write_commit_queue_entry (line 6985) | fn write_commit_queue_entry(repo_root: &Path, entry: &CommitQueueEntry) ...
  function format_review_body (line 6994) | fn format_review_body(review: &ReviewResult) -> Option<String> {
  function resolve_commit_parent (line 7009) | fn resolve_commit_parent(repo_root: &Path, commit_sha: &str) -> String {
  function resolve_commit_message (line 7023) | fn resolve_commit_message(repo_root: &Path, entry: &CommitQueueEntry) ->...
  function resolve_review_files (line 7033) | fn resolve_review_files(repo_root: &Path, commit_sha: &str) -> Vec<RiseR...
  function write_rise_review_session (line 7088) | fn write_rise_review_session(repo_root: &Path, entry: &CommitQueueEntry)...
  function rise_review_path (line 7115) | fn rise_review_path(repo_root: &Path, commit_sha: &str) -> PathBuf {
  function delete_rise_review_session (line 7121) | fn delete_rise_review_session(repo_root: &Path, commit_sha: &str) {
  function git_is_ancestor (line 7128) | fn git_is_ancestor(repo_root: &Path, ancestor: &str, descendant: &str) -...
  function load_commit_queue_entries (line 7137) | fn load_commit_queue_entries(repo_root: &Path) -> Result<Vec<CommitQueue...
  function resolve_commit_queue_entry (line 7163) | fn resolve_commit_queue_entry(repo_root: &Path, hash: &str) -> Result<Co...
  function resolve_git_commit_sha (line 7177) | fn resolve_git_commit_sha(repo_root: &Path, hash: &str) -> Result<String> {
  function queue_existing_commit_for_approval (line 7188) | fn queue_existing_commit_for_approval(
  function remove_commit_queue_entry_by_entry (line 7248) | fn remove_commit_queue_entry_by_entry(repo_root: &Path, entry: &CommitQu...
  function queue_commit_for_review (line 7262) | fn queue_commit_for_review(
  function open_review_in_rise (line 7322) | fn open_review_in_rise(repo_root: &Path, commit_sha: &str) {
  function open_latest_queue_review (line 7399) | pub fn open_latest_queue_review() -> Result<()> {
  function latest_review_report_for_commit (line 7416) | fn latest_review_report_for_commit(repo_root: &Path, commit_sha: &str) -...
  function queued_review_counts_excluding (line 7450) | fn queued_review_counts_excluding(
  function print_other_queued_review_count (line 7475) | fn print_other_queued_review_count(repo_root: &Path, commit_sha: &str) {
  function copy_text_to_clipboard (line 7493) | fn copy_text_to_clipboard(text: &str) -> Result<bool> {
  function build_review_prompt_payload (line 7545) | fn build_review_prompt_payload(
  function copy_review_prompt (line 7638) | pub fn copy_review_prompt(hash: Option<&str>) -> Result<()> {
  function print_queue_instructions (line 7674) | fn print_queue_instructions(repo_root: &Path, commit_sha: &str) {
  function queue_review_status_label (line 7687) | fn queue_review_status_label(entry: &CommitQueueEntry) -> &'static str {
  function print_pending_queue_review_hint (line 7705) | fn print_pending_queue_review_hint(repo_root: &Path) {
  function approve_all_queued_commits (line 7760) | fn approve_all_queued_commits(
  function commit_queue_entry_matches (line 7969) | fn commit_queue_entry_matches(entry: &CommitQueueEntry, hash: &str) -> b...
  function refresh_queue_entry_commit (line 7981) | fn refresh_queue_entry_commit(repo_root: &Path, entry: &mut CommitQueueE...
  function current_upstream_ref (line 8022) | fn current_upstream_ref(repo_root: &Path) -> Option<String> {
  function is_ephemeral_upstream_ref (line 8032) | fn is_ephemeral_upstream_ref(upstream: &str) -> bool {
  function find_best_pr_upstream_candidate (line 8039) | fn find_best_pr_upstream_candidate(repo_root: &Path, head_sha: &str) -> ...
  function ensure_safe_upstream_for_commit_queue_push (line 8070) | fn ensure_safe_upstream_for_commit_queue_push(
  function commit_queue_has_entries (line 8115) | pub fn commit_queue_has_entries(repo_root: &Path) -> bool {
  function commit_queue_has_entries_on_branch (line 8129) | pub fn commit_queue_has_entries_on_branch(repo_root: &Path, branch: &str...
  function commit_queue_has_entries_reachable_from_head (line 8139) | pub fn commit_queue_has_entries_reachable_from_head(repo_root: &Path) ->...
  function refresh_commit_queue (line 8157) | pub fn refresh_commit_queue(repo_root: &Path) -> Result<usize> {
  function queued_commit_patch (line 8168) | fn queued_commit_patch(repo_root: &Path, commit_sha: &str) -> Result<Str...
  function with_temp_worktree_for_commit (line 8175) | fn with_temp_worktree_for_commit<T, F>(repo_root: &Path, commit_sha: &st...
  function run_codex_review_for_queued_commit (line 8201) | fn run_codex_review_for_queued_commit(
  function append_unique_ids (line 8216) | fn append_unique_ids(dest: &mut Vec<String>, ids: Vec<String>) {
  function review_queue_entry_with_codex (line 8225) | fn review_queue_entry_with_codex(
  function maybe_sync_queue_review_to_mirrors (line 8302) | fn maybe_sync_queue_review_to_mirrors(
  function queue_flag_for_command (line 8364) | fn queue_flag_for_command(queue: CommitQueueMode) -> String {
  function review_flag_for_command (line 8374) | fn review_flag_for_command(queue: CommitQueueMode) -> String {
  function review_bookmark_prefix (line 8382) | fn review_bookmark_prefix(repo_root: &Path) -> Option<String> {
  function sanitize_review_branch (line 8418) | fn sanitize_review_branch(branch: &str) -> String {
  function create_review_bookmark (line 8434) | fn create_review_bookmark(repo_root: &Path, commit_sha: &str, branch: &s...
  function delete_review_bookmark (line 8477) | fn delete_review_bookmark(repo_root: &Path, bookmark: &str) {
  function jj_bookmark_exists (line 8483) | fn jj_bookmark_exists(repo_root: &Path, name: &str) -> bool {
  function jj_run_in (line 8497) | fn jj_run_in(repo_root: &Path, args: &[&str]) -> Result<()> {
  function jj_capture_in (line 8516) | fn jj_capture_in(repo_root: &Path, args: &[&str]) -> Result<String> {
  function jj_bin (line 8535) | fn jj_bin() -> String {
  function ensure_gh_available (line 8543) | fn ensure_gh_available() -> Result<()> {
  function gh_capture_in (line 8556) | fn gh_capture_in(repo_root: &Path, args: &[&str]) -> Result<String> {
  function github_repo_from_remote_url (line 8572) | fn github_repo_from_remote_url(url: &str) -> Option<String> {
  function resolve_github_repo (line 8591) | fn resolve_github_repo(repo_root: &Path) -> Result<String> {
  function sanitize_ref_component (line 8621) | fn sanitize_ref_component(input: &str) -> String {
  function default_pr_head (line 8636) | fn default_pr_head(entry: &CommitQueueEntry) -> String {
  function ensure_pr_head_pushed (line 8661) | fn ensure_pr_head_pushed(repo_root: &Path, head: &str, commit_sha: &str)...
  function pr_push_remote_candidates (line 8780) | fn pr_push_remote_candidates(repo_root: &Path) -> Vec<String> {
  function pr_head_selector_for_remote (line 8798) | fn pr_head_selector_for_remote(repo_root: &Path, remote: &str, head: &st...
  function extract_pr_url (line 8814) | fn extract_pr_url(text: &str) -> Option<String> {
  function pr_number_from_url (line 8819) | fn pr_number_
Condensed preview — 400 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (5,626K chars).
[
  {
    "path": ".ai/agents.md",
    "chars": 1657,
    "preview": "# Autonomous Agent Instructions\n\nProject: flow\n\nThis project is configured for autonomous AI agent workflows with human-"
  },
  {
    "path": ".ai/docs/.last_sync",
    "chars": 30,
    "preview": "2026-01-01 03:08:07 (4e4a4e7)\n"
  },
  {
    "path": ".ai/docs/architecture.md",
    "chars": 4813,
    "preview": "# Flow Architecture\n\n## Overview\n\nFlow is a CLI tool and task runner written in Rust. It provides project automation, AI"
  },
  {
    "path": ".ai/docs/changelog.md",
    "chars": 2557,
    "preview": "# Changelog\n\nAuto-maintained changelog tracking flow features and changes.\n\n## 2024-12-31\n\n### Added\n- **Documentation s"
  },
  {
    "path": ".ai/docs/commands.md",
    "chars": 10143,
    "preview": "# Flow CLI Commands\n\nAuto-generated documentation for flow CLI commands.\n\n## Task Execution\n\n### `f` (no args)\nOpens fuz"
  },
  {
    "path": ".ai/flox/manifest.toml",
    "chars": 80,
    "preview": "version = 1\n\n[install.cargo]\npkg-path = \"cargo\"\n\n[install.eza]\npkg-path = \"eza\"\n"
  },
  {
    "path": ".ai/health-checks.json",
    "chars": 210,
    "preview": "{\n  \"checks\": [\n    {\n      \"name\": \"share-page\",\n      \"type\": \"gitedit-share\",\n      \"baseUrl\": \"https://gitedit.dev\","
  },
  {
    "path": ".ai/recipes/project/bootstrap-core-tools.md",
    "chars": 563,
    "preview": "---\ntitle: Bootstrap Core CLI Stack\ndescription: Install rise, seq, and seqd via flow install auto backend.\ntags: [boots"
  },
  {
    "path": ".ai/recipes/project/install-rise-auto.md",
    "chars": 449,
    "preview": "---\ntitle: Install Rise Via Flow Auto\ndescription: Validate that flow install rise resolves through auto backend.\ntags: "
  },
  {
    "path": ".ai/recipes/project/installer-smoke-sh.md",
    "chars": 285,
    "preview": "---\ntitle: Installer Smoke Via sh\ndescription: Smoke test myflow installer snippet with pipe-to-sh entrypoint.\ntags: [in"
  },
  {
    "path": ".ai/recipes/project/release-core-toolchain.md",
    "chars": 319,
    "preview": "---\ntitle: Release Core Toolchain\ndescription: Publish flow, rise, and seq/seqd to myflow registry.\ntags: [release, regi"
  },
  {
    "path": ".ai/recipes/project/release-flow-registry.md",
    "chars": 467,
    "preview": "---\ntitle: Release Flow To Registry\ndescription: Publish flow to myflow registry with explicit version.\ntags: [release, "
  },
  {
    "path": ".ai/recipes/project/release-rise-registry.md",
    "chars": 195,
    "preview": "---\ntitle: Release Rise To Registry\ndescription: Publish latest rise binary to myflow registry.\ntags: [release, registry"
  },
  {
    "path": ".ai/recipes/project/release-seq-registry.md",
    "chars": 254,
    "preview": "---\ntitle: Release Seq+Seqd To Registry\ndescription: Stage seq/seqd binaries and publish package seq to myflow registry."
  },
  {
    "path": ".ai/repos.toml",
    "chars": 300,
    "preview": "root = \"~/repos\"\n\n[[repos]]\nowner = \"rust-lang\"\nrepo = \"crates.io-index\"\nurl = \"https://github.com/rust-lang/crates.io-i"
  },
  {
    "path": ".ai/tasks/flow/bench-cli/main.mbt",
    "chars": 1595,
    "preview": "// title: Flow CLI Bench\n// description: Quick CLI benchmark for high-frequency Flow entry points.\n// tags: [flow,bench,"
  },
  {
    "path": ".ai/tasks/flow/bench-cli/moon.mod.json",
    "chars": 140,
    "preview": "{\n  \"name\": \"nikiv/flow-ai-tasks\",\n  \"version\": \"0.1.0\",\n  \"deps\": {\n    \"moonbitlang/async\": \"0.16.6\",\n    \"moonbitlang"
  },
  {
    "path": ".ai/tasks/flow/bench-cli/moon.pkg.json",
    "chars": 187,
    "preview": "{\n  \"is-main\": true,\n  \"import\": [\n    \"moonbitlang/async\",\n    \"moonbitlang/async/process\",\n    \"moonbitlang/async/stdi"
  },
  {
    "path": ".ai/tasks/flow/dev-check/main.mbt",
    "chars": 999,
    "preview": "// title: Flow Dev Check\n// description: Fast local quality gate for Flow code changes.\n// tags: [flow,dev,check]\n\nfn pr"
  },
  {
    "path": ".ai/tasks/flow/dev-check/moon.mod.json",
    "chars": 140,
    "preview": "{\n  \"name\": \"nikiv/flow-ai-tasks\",\n  \"version\": \"0.1.0\",\n  \"deps\": {\n    \"moonbitlang/async\": \"0.16.6\",\n    \"moonbitlang"
  },
  {
    "path": ".ai/tasks/flow/dev-check/moon.pkg.json",
    "chars": 187,
    "preview": "{\n  \"is-main\": true,\n  \"import\": [\n    \"moonbitlang/async\",\n    \"moonbitlang/async/process\",\n    \"moonbitlang/async/stdi"
  },
  {
    "path": ".ai/tasks/flow/noop/main.mbt",
    "chars": 132,
    "preview": "// title: Flow Noop\n// description: Minimal AI task for runtime overhead benchmarking.\n// tags: [flow,bench,noop]\n\nfn ma"
  },
  {
    "path": ".ai/tasks/flow/noop/moon.mod.json",
    "chars": 140,
    "preview": "{\n  \"name\": \"nikiv/flow-ai-tasks\",\n  \"version\": \"0.1.0\",\n  \"deps\": {\n    \"moonbitlang/async\": \"0.16.6\",\n    \"moonbitlang"
  },
  {
    "path": ".ai/tasks/flow/noop/moon.pkg.json",
    "chars": 55,
    "preview": "{\n  \"is-main\": true,\n  \"support-targets\": [\"native\"]\n}\n"
  },
  {
    "path": ".ai/tasks/flow/pr-ready/main.mbt",
    "chars": 1677,
    "preview": "// title: Flow PR Ready\n// description: Pre-PR gate: compile, task checks, docs parity, gitignore hygiene.\n// tags: [flo"
  },
  {
    "path": ".ai/tasks/flow/pr-ready/moon.mod.json",
    "chars": 140,
    "preview": "{\n  \"name\": \"nikiv/flow-ai-tasks\",\n  \"version\": \"0.1.0\",\n  \"deps\": {\n    \"moonbitlang/async\": \"0.16.6\",\n    \"moonbitlang"
  },
  {
    "path": ".ai/tasks/flow/pr-ready/moon.pkg.json",
    "chars": 187,
    "preview": "{\n  \"is-main\": true,\n  \"import\": [\n    \"moonbitlang/async\",\n    \"moonbitlang/async/process\",\n    \"moonbitlang/async/stdi"
  },
  {
    "path": ".ai/tasks/flow/regression-smoke/main.mbt",
    "chars": 1728,
    "preview": "// title: Flow Regression Smoke\n// description: Validate task discovery and AI task execution in a fresh temp project.\n/"
  },
  {
    "path": ".ai/tasks/flow/regression-smoke/moon.mod.json",
    "chars": 140,
    "preview": "{\n  \"name\": \"nikiv/flow-ai-tasks\",\n  \"version\": \"0.1.0\",\n  \"deps\": {\n    \"moonbitlang/async\": \"0.16.6\",\n    \"moonbitlang"
  },
  {
    "path": ".ai/tasks/flow/regression-smoke/moon.pkg.json",
    "chars": 187,
    "preview": "{\n  \"is-main\": true,\n  \"import\": [\n    \"moonbitlang/async\",\n    \"moonbitlang/async/process\",\n    \"moonbitlang/async/stdi"
  },
  {
    "path": ".ai/tasks/flow/release-preflight/main.mbt",
    "chars": 1126,
    "preview": "// title: Flow Release Preflight\n// description: Build release binary and validate core release smoke checks.\n// tags: ["
  },
  {
    "path": ".ai/tasks/flow/release-preflight/moon.mod.json",
    "chars": 140,
    "preview": "{\n  \"name\": \"nikiv/flow-ai-tasks\",\n  \"version\": \"0.1.0\",\n  \"deps\": {\n    \"moonbitlang/async\": \"0.16.6\",\n    \"moonbitlang"
  },
  {
    "path": ".ai/tasks/flow/release-preflight/moon.pkg.json",
    "chars": 187,
    "preview": "{\n  \"is-main\": true,\n  \"import\": [\n    \"moonbitlang/async\",\n    \"moonbitlang/async/process\",\n    \"moonbitlang/async/stdi"
  },
  {
    "path": ".ai/todos/todos.json",
    "chars": 8543,
    "preview": "[\n  {\n    \"id\": \"c1b0f1e0e6d84f33b169b9b0f87f3c4e\",\n    \"title\": \"Evaluate Rolldown for builds and deployment speedups\","
  },
  {
    "path": ".flox.disabled",
    "chars": 31,
    "preview": "flox activate repeatedly failed"
  },
  {
    "path": ".github/workflows/canary.yml",
    "chars": 6068,
    "preview": "name: Canary\n\non:\n  push:\n    branches:\n      - main\n    paths-ignore:\n      - \"docs/**\"\n      - \"**/*.md\"\n  workflow_di"
  },
  {
    "path": ".github/workflows/nightly-validation.yml",
    "chars": 4156,
    "preview": "name: Nightly Validation\n\non:\n  schedule:\n    - cron: \"27 3 * * *\"\n  workflow_dispatch:\n\npermissions:\n  contents: read\n\n"
  },
  {
    "path": ".github/workflows/pr-fast.yml",
    "chars": 2092,
    "preview": "name: PR Fast Check\n\non:\n  pull_request:\n    branches:\n      - main\n    paths-ignore:\n      - \"docs/**\"\n      - \"**/*.md"
  },
  {
    "path": ".github/workflows/release.yml",
    "chars": 5960,
    "preview": "name: Release\n\non:\n  push:\n    tags:\n      - \"v*\"\n\npermissions:\n  contents: write\n\nenv:\n  CARGO_TERM_COLOR: always\n\njobs"
  },
  {
    "path": ".gitignore",
    "chars": 1362,
    "preview": "# flow\n.cargo/\n.ai/internal/\n.ai/web/\n.ai/reviews/\n.ai/test/\n.ai/tmp/\n.ai/cache/\n.ai/artifacts/\n.ai/traces/\n.ai/generate"
  },
  {
    "path": ".goreleaser.yaml",
    "chars": 917,
    "preview": "project_name: flow\n\nbefore:\n  hooks:\n    - rustup default stable\n    - cargo install --locked cargo-zigbuild\n\nbuilds:\n  "
  },
  {
    "path": ".pi/extensions/test-extensibility.ts",
    "chars": 2917,
    "preview": "/**\n * Test Extension - Demonstrates pi-mono extensibility\n *\n * Run with: pi (in ~/code/flow directory)\n * Then ask: \"u"
  },
  {
    "path": "AGENTS.md.bak",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "Cargo.toml",
    "chars": 3469,
    "preview": "[package]\nname = \"flowd\"\nversion = \"0.1.3\"\nedition = \"2024\"\nrepository = \"https://github.com/nikivdev/flow\"\nautobins = f"
  },
  {
    "path": "Support/flow/auth.toml",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "agents.md",
    "chars": 795,
    "preview": "# Assistant Rules (flow)\n\nOnly load skills when the request clearly needs them.\n\n## Skills (on-demand)\n- flow-native: Us"
  },
  {
    "path": "bench/ffi_host_boundary/Cargo.toml",
    "chars": 304,
    "preview": "[package]\nname = \"flow_ffi_host_boundary\"\nversion = \"0.1.0\"\nedition = \"2024\"\n\n[lib]\ncrate-type = [\"staticlib\", \"rlib\"]\n\n"
  },
  {
    "path": "bench/ffi_host_boundary/src/bin/rust_boundary_bench.rs",
    "chars": 2712,
    "preview": "use std::hint::black_box;\n\nuse flow_ffi_host_boundary::{flow_host_add_u64, flow_host_noop, monotonic_now_ns, rust_fn_add"
  },
  {
    "path": "bench/ffi_host_boundary/src/lib.rs",
    "chars": 1117,
    "preview": "use std::hint::black_box;\n\n#[unsafe(no_mangle)]\n#[inline(never)]\npub extern \"C\" fn flow_host_now_ns() -> u64 {\n    monot"
  },
  {
    "path": "bench/moon_ffi_boundary/main.mbt",
    "chars": 1999,
    "preview": "extern \"C\" fn flow_host_now_ns() -> UInt64 = \"flow_host_now_ns\"\nextern \"C\" fn flow_host_noop(x : UInt64) -> UInt64 = \"fl"
  },
  {
    "path": "bench/moon_ffi_boundary/moon.mod.json",
    "chars": 62,
    "preview": "{\n  \"name\": \"nikiv/moon_ffi_boundary\",\n  \"version\": \"0.1.0\"\n}\n"
  },
  {
    "path": "bench/moon_ffi_boundary/moon.pkg.template.json",
    "chars": 171,
    "preview": "{\n  \"is-main\": true,\n  \"support-targets\": [\"native\"],\n  \"link\": {\n    \"native\": {\n      \"cc-flags\": \"__CC_FLAGS__\",\n    "
  },
  {
    "path": "build.rs",
    "chars": 659,
    "preview": "use std::env;\nuse std::fs;\nuse std::path::Path;\nuse std::time::{SystemTime, UNIX_EPOCH};\n\nfn main() {\n    // Embed build"
  },
  {
    "path": "crates/ai_taskd_client/Cargo.toml",
    "chars": 201,
    "preview": "[package]\nname = \"ai-taskd-client\"\nversion = \"0.1.0\"\nedition = \"2024\"\n\n[dependencies]\nserde = { version = \"1\", features "
  },
  {
    "path": "crates/ai_taskd_client/src/main.rs",
    "chars": 49,
    "preview": "include!(\"../../../src/bin/ai_taskd_client.rs\");\n"
  },
  {
    "path": "crates/flow_commit_scan/Cargo.toml",
    "chars": 104,
    "preview": "[package]\nname = \"flow_commit_scan\"\nversion = \"0.1.0\"\nedition = \"2024\"\n\n[dependencies]\nregex = \"1.12.2\"\n"
  },
  {
    "path": "crates/flow_commit_scan/src/lib.rs",
    "chars": 10910,
    "preview": "use std::path::Path;\nuse std::process::Command;\nuse std::sync::OnceLock;\n\nuse regex::Regex;\n\npub type SecretFinding = (S"
  },
  {
    "path": "crates/opentui-lite/Cargo.toml",
    "chars": 163,
    "preview": "[package]\nname = \"opentui-lite\"\nversion = \"0.1.0\"\nedition = \"2024\"\n\n[lib]\npath = \"src/lib.rs\"\n\n[dependencies]\nlibc = { v"
  },
  {
    "path": "crates/opentui-lite/src/lib.rs",
    "chars": 11857,
    "preview": "use std::ffi::{CStr, CString};\nuse std::fmt;\nuse std::path::{Path, PathBuf};\nuse std::sync::Arc;\n\n#[derive(Debug)]\npub s"
  },
  {
    "path": "crates/seq_client/Cargo.toml",
    "chars": 254,
    "preview": "[package]\nname = \"seq_client\"\nversion = \"0.1.0\"\nedition = \"2021\"\ndescription = \"Rust client for seqd Agent RPC v1 over U"
  },
  {
    "path": "crates/seq_client/src/lib.rs",
    "chars": 10885,
    "preview": "use serde::{Deserialize, Serialize};\nuse serde_json::{json, Value};\nuse std::io::{Read, Write};\nuse std::os::unix::net::"
  },
  {
    "path": "crates/seq_everruns_bridge/Cargo.toml",
    "chars": 388,
    "preview": "[package]\nname = \"seq_everruns_bridge\"\nversion = \"0.1.0\"\nedition = \"2021\"\ndescription = \"Everruns client-side tool bridg"
  },
  {
    "path": "crates/seq_everruns_bridge/src/lib.rs",
    "chars": 12459,
    "preview": "use seq_client::{RpcRequest, SeqClient};\nuse serde::{Deserialize, Serialize};\nuse serde_json::{json, Value};\nuse std::ti"
  },
  {
    "path": "crates/seq_everruns_bridge/src/maple.rs",
    "chars": 22427,
    "preview": "use reqwest::blocking::Client;\nuse serde_json::{json, Value};\nuse std::sync::atomic::{AtomicU64, Ordering};\nuse std::syn"
  },
  {
    "path": "docs/ai-dev-layout.md",
    "chars": 1243,
    "preview": "# `.ai/` Dev Layout\n\nUse `.ai/` aggressively for local AI-assisted development, but keep the split\nbetween tracked proje"
  },
  {
    "path": "docs/ai-run-task-fast-path.md",
    "chars": 1404,
    "preview": "# AI Run Task Fast Path\n\nGoal: let AI add a run task in one edit, return a runnable `f ...` command, and optionally push"
  },
  {
    "path": "docs/ai-task-fast-path-guide.md",
    "chars": 6678,
    "preview": "# MoonBit AI Task Fast Path Guide\n\nThis guide is the practical playbook for running Flow MoonBit AI tasks at the lowest "
  },
  {
    "path": "docs/ai-traces.md",
    "chars": 1250,
    "preview": "# AI Traces (Flow)\n\nUse this doc when collecting context for debugging or development work in `~/code/flow`.\nThe goal is"
  },
  {
    "path": "docs/anonymous-telemetry-contract.md",
    "chars": 1082,
    "preview": "# Anonymous Telemetry Contract (Flow CLI)\n\nFlow emits anonymous command telemetry for product/training quality when anal"
  },
  {
    "path": "docs/ascii-commit-visualization-pipeline.md",
    "chars": 6149,
    "preview": "# ASCII Commit Visualization Pipeline\n\nThis explains how commit analysis data becomes ASCII-style diagrams in myflow.\n\nS"
  },
  {
    "path": "docs/bench/cli-startup.md",
    "chars": 1136,
    "preview": "# Flow CLI Startup Benchmark\n\nUse this to measure cold-ish user-facing Flow latency on cheap commands that should stay f"
  },
  {
    "path": "docs/bench/moonbit-rust-ffi-boundary.md",
    "chars": 4161,
    "preview": "# MoonBit <-> Rust FFI Boundary Benchmark\n\nThis benchmark measures raw call overhead between MoonBit (native C backend) "
  },
  {
    "path": "docs/bench/readme.md",
    "chars": 234,
    "preview": "# Bench Docs\n\n- `moonbit-rust-ffi-boundary.md`: raw MoonBit <-> Rust boundary benchmark, commands, results, and optimiza"
  },
  {
    "path": "docs/ci-cd-runbook.md",
    "chars": 6097,
    "preview": "# Flow CI/CD Runbook\n\nThis runbook documents how Flow CI/CD is wired today and how to debug it quickly when jobs fail.\n\n"
  },
  {
    "path": "docs/codex-first-control-plane-roadmap.md",
    "chars": 12013,
    "preview": "# Codex-First Control Plane Roadmap\n\nThis document proposes how Flow should evolve from \"helpful CLI + local skills\"\nint"
  },
  {
    "path": "docs/codex-fork-tasks.md",
    "chars": 3316,
    "preview": "# Codex Fork Tasks\n\nThese Flow tasks automate the personal Codex fork workflow described in:\n\n- `~/docs/codex/codex-fork"
  },
  {
    "path": "docs/codex-maple-telemetry-runbook.md",
    "chars": 3029,
    "preview": "# Codex Maple Telemetry Runbook\n\nUse this when you want shared analytics for Flow-guided Codex usage without\nchanging th"
  },
  {
    "path": "docs/codex-openai-session-resolver.md",
    "chars": 5497,
    "preview": "# Codex OpenAI Repo Session Resolver\n\nThis documents the personal `L` wrapper that opens or resumes Codex sessions with "
  },
  {
    "path": "docs/commands/ai.md",
    "chars": 15281,
    "preview": "# f ai\n\nManage Claude Code, Codex, and Cursor sessions for the current project.\n\nFlow reads local session stores, filter"
  },
  {
    "path": "docs/commands/clone.md",
    "chars": 1093,
    "preview": "# f clone\n\nClone a repository with git-like destination behavior.\n\n## Overview\n\n`f clone` behaves like `git clone` for d"
  },
  {
    "path": "docs/commands/commit.md",
    "chars": 11906,
    "preview": "# f commit\n\nAI-powered commit with deferred Codex review and GitEdit sync.\n\n## Overview\n\nStages all changes, commits qui"
  },
  {
    "path": "docs/commands/commits.md",
    "chars": 451,
    "preview": "# f commits\n\nBrowse commits with AI metadata and mark notable commits for quick access.\n\n## Usage\n\n```bash\nf commits\nf c"
  },
  {
    "path": "docs/commands/db.md",
    "chars": 981,
    "preview": "# db\n\nManage database workflows and backends (Jazz + Postgres).\n\n## Usage\n\n```bash\nf db <provider> <action>\n```\n\n## Jazz"
  },
  {
    "path": "docs/commands/deploy.md",
    "chars": 11957,
    "preview": "# f deploy\n\nDeploy projects to hosts and cloud platforms.\n\n## Overview\n\nThe `deploy` command handles deployment to multi"
  },
  {
    "path": "docs/commands/docs.md",
    "chars": 1936,
    "preview": "# f docs\n\nManage documentation for a project. There are two doc systems:\n\n- `.ai/docs` for AI-maintained internal docs.\n"
  },
  {
    "path": "docs/commands/domains.md",
    "chars": 2988,
    "preview": "# `f domains`\n\nManage shared local `*.localhost` routing with a single proxy on port `80`.\n\n## Why\n\nWithout this, each r"
  },
  {
    "path": "docs/commands/down.md",
    "chars": 1169,
    "preview": "# f down\n\nBring a project down using lifecycle conventions.\n\n## Quick Start\n\n```bash\n# Run lifecycle down task and optio"
  },
  {
    "path": "docs/commands/env.md",
    "chars": 10677,
    "preview": "# f env\n\nSync project environment and manage environment variables.\n\n## Overview\n\nManage environment variables via cloud"
  },
  {
    "path": "docs/commands/fast.md",
    "chars": 1214,
    "preview": "# f fast\n\nRun AI tasks through the low-latency fast client path.\n\nThis command is optimized for hot-loop invocation and "
  },
  {
    "path": "docs/commands/global.md",
    "chars": 769,
    "preview": "# f global\n\nRun tasks from your global flow config (`~/.config/flow/flow.toml`).\n\n## Quick Start\n\n```bash\n# List global "
  },
  {
    "path": "docs/commands/install.md",
    "chars": 1756,
    "preview": "# f install\n\nInstall a CLI/tool binary into your PATH.\n\nDefault backend behavior (`--backend auto`):\n1. Flow registry (`"
  },
  {
    "path": "docs/commands/invariants.md",
    "chars": 1468,
    "preview": "# f invariants\n\nValidate project invariants declared in `flow.toml`.\n\nThis command checks the `[invariants]` section and"
  },
  {
    "path": "docs/commands/jj.md",
    "chars": 4415,
    "preview": "# jj\n\nFlow wraps common Jujutsu (jj) workflows so you can stay in jj while remaining fully Git-compatible.\n\n## Quick sta"
  },
  {
    "path": "docs/commands/migrate.md",
    "chars": 4056,
    "preview": "# f migrate\n\nMove or copy a project folder to a new location, preserving symlinks and AI sessions.\n\n## Overview\n\nRelocat"
  },
  {
    "path": "docs/commands/new.md",
    "chars": 1360,
    "preview": "# f new\n\nCreate a new project from a local starter template under `~/new`.\n\n## Overview\n\n`f new` copies a directory from"
  },
  {
    "path": "docs/commands/pr.md",
    "chars": 2381,
    "preview": "# f pr\n\nCreate or open GitHub pull requests, edit PR text locally, and pull review feedback.\n\n## Quick Start\n\n```bash\n# "
  },
  {
    "path": "docs/commands/publish.md",
    "chars": 3694,
    "preview": "# f publish\n\nPublish projects to GitHub.\n\n## Overview\n\nCreates a new GitHub repository and pushes the current project. A"
  },
  {
    "path": "docs/commands/readme.md",
    "chars": 5262,
    "preview": "# Flow Commands Reference\n\nComplete documentation for all `f` (flow) commands.\n\n## Quick Reference\n\n| Command | Descript"
  },
  {
    "path": "docs/commands/recipe.md",
    "chars": 1109,
    "preview": "# f recipe\n\nLegacy compatibility command.\n\nPreferred model:\n\n- Put shell tasks in `flow.toml` under `[[tasks]]`.\n- Put A"
  },
  {
    "path": "docs/commands/release.md",
    "chars": 779,
    "preview": "# f release\n\nRelease a project based on `flow.toml` defaults or explicit subcommands.\n\n## Usage\n\n```bash\nf release\nf rel"
  },
  {
    "path": "docs/commands/repos.md",
    "chars": 2704,
    "preview": "# f repos\n\nClone repositories into a structured local directory or create new ones.\n\nIf you want standard `git clone` de"
  },
  {
    "path": "docs/commands/reviews-todo.md",
    "chars": 1131,
    "preview": "# f reviews-todo\n\nManage deferred deep-review todos for queued commits.\n\nThis command is a workflow wrapper over `f comm"
  },
  {
    "path": "docs/commands/seq-rpc.md",
    "chars": 1170,
    "preview": "# `f seq-rpc`\n\nNative `seqd` RPC bridge for Flow.\n\nUse this when an agent/workflow needs OS-level actions and you want a"
  },
  {
    "path": "docs/commands/services.md",
    "chars": 1180,
    "preview": "# f services\n\nGuided setup flows for third-party services. These commands prompt for required\nenv vars, store them in cl"
  },
  {
    "path": "docs/commands/setup.md",
    "chars": 2220,
    "preview": "# f setup\n\nBootstrap the project if needed, generate a `flow.toml` if missing, then run the `setup` task or print shell "
  },
  {
    "path": "docs/commands/skills.md",
    "chars": 2368,
    "preview": "# f skills\n\nManage Codex/Claude skills for the current project.\n\nSkills live in `.ai/skills/` and are symlinked to `.cod"
  },
  {
    "path": "docs/commands/sync.md",
    "chars": 6190,
    "preview": "# f sync\n\nSync git repo: pull from tracking remote, merge upstream changes, optionally push.\n\n## Overview\n\nSingle comman"
  },
  {
    "path": "docs/commands/tasks.md",
    "chars": 2797,
    "preview": "# f tasks\n\nList and discover project tasks from:\n\n- `flow.toml` (`[[tasks]]`)\n- `.ai/tasks/*.mbt` (AI MoonBit tasks)\n\nYo"
  },
  {
    "path": "docs/commands/up.md",
    "chars": 1032,
    "preview": "# f up\n\nBring a project up using lifecycle conventions.\n\n## Quick Start\n\n```bash\n# Run lifecycle up (tries task \"up\", th"
  },
  {
    "path": "docs/commands/upstream.md",
    "chars": 4786,
    "preview": "# f upstream\n\nManage upstream fork workflow.\n\n## Overview\n\nSet up and sync forks with their upstream repositories. Creat"
  },
  {
    "path": "docs/commands/url.md",
    "chars": 2051,
    "preview": "# `f url`\n\nInspect or crawl URLs into compact AI-friendly summaries.\n\n## Quick Start\n\n```bash\n# Thin single-page summary"
  },
  {
    "path": "docs/commands/web.md",
    "chars": 952,
    "preview": "# web\n\nOpen the Flow web UI for the current project.\n\n## Usage\n\n```bash\nf web\n```\n\n## What it does\n\n- Serves the `.ai/we"
  },
  {
    "path": "docs/commits/.gitkeep",
    "chars": 1,
    "preview": "\n"
  },
  {
    "path": "docs/commits/readme.md",
    "chars": 519,
    "preview": "# Commit Explanations (Generated)\n\n`f explain-commits` writes generated artifacts into this folder by default:\n\n- `*.md`"
  },
  {
    "path": "docs/dependency-vendoring.md",
    "chars": 9482,
    "preview": "# Dependency Vendoring (Cargo-First)\n\nThis project uses a Cargo-first vendoring model:\n\n- Cargo remains the resolver, lo"
  },
  {
    "path": "docs/dev-server-management.md",
    "chars": 5342,
    "preview": "# Dev Server Management\n\nFlow's supervisor manages dev server lifecycle declaratively. Define servers in `config.ts`, Fl"
  },
  {
    "path": "docs/env-security-roadmap.md",
    "chars": 3966,
    "preview": "# Env Security Roadmap\n\nThis document defines the hardening path for Flow env storage so it is usable in\nlarge orgs with"
  },
  {
    "path": "docs/everruns-maple-runbook.md",
    "chars": 2710,
    "preview": "# Everruns + Maple Runbook\n\nThis is the fastest path to use the new Everruns telemetry export now.\n\nIt sends `f ai everr"
  },
  {
    "path": "docs/everruns-seq-bridge-integration.md",
    "chars": 3883,
    "preview": "# Everruns + Seq Bridge Integration\n\nThis document describes the Flow integration that runs Everruns sessions and execut"
  },
  {
    "path": "docs/fast-commit-deep-review-loop.md",
    "chars": 1874,
    "preview": "# Fast Commit + Deep Codex Review Loop\n\nThis guide configures a speed-first commit workflow with deferred deep review:\n\n"
  },
  {
    "path": "docs/features.md",
    "chars": 10900,
    "preview": "# Flow Features\n\nFlow is a CLI tool for managing project tasks, AI coding sessions, and development workflows.\n\n## Quick"
  },
  {
    "path": "docs/flow-toml-spec.md",
    "chars": 10413,
    "preview": "# flow.toml Specification\n\nMinimal schema for Flow CLI tasks and managed dependencies. Designed for easy refactors and L"
  },
  {
    "path": "docs/how-api-expects-logs-errors-for-automatic-fixes.md",
    "chars": 5715,
    "preview": "# Error Log Format for Automatic Fixes\n\nThe flow server streams errors via SSE for automatic fix agents to consume. Stru"
  },
  {
    "path": "docs/how-flow-daemon-manages-macos-services.md",
    "chars": 6761,
    "preview": "# How Flow Daemon Manages macOS Services\n\nFlow provides a declarative alternative to macOS launchd for managing backgrou"
  },
  {
    "path": "docs/how-to-make-a-project-flow-project.md",
    "chars": 6802,
    "preview": "# How To Make A Project A Flow Project\n\nThis guide is for both:\n\n- a brand-new repository\n- an existing repository that "
  },
  {
    "path": "docs/how-to-use-flow-ai-to-manage-claude-code-sessions.md",
    "chars": 3120,
    "preview": "# Managing Claude and Codex Sessions with Flow\n\nFlow treats Claude and Codex as first-class coding runtimes in the same "
  },
  {
    "path": "docs/how-to-use-flow-to-deploy.md",
    "chars": 6479,
    "preview": "# How to Deploy with Flow\n\nFlow provides a unified `f deploy` command to deploy your projects to Linux hosts, Cloudflare"
  },
  {
    "path": "docs/how-to-use-flow-to-store-and-work-with-env.md",
    "chars": 3885,
    "preview": "# How to Use Flow Env Store (Project + Personal)\n\nThis is the context-optimized workflow for current Flow behavior.\n\n## "
  },
  {
    "path": "docs/ideas.toml",
    "chars": 191,
    "preview": "# f = fuzzy search through commands (builtin and project)\n# f <cmd> = does command\n[[alias]]\nfe = \"f dev\"    # dev\nfd = "
  },
  {
    "path": "docs/index.mdx",
    "chars": 8349,
    "preview": "---\ntitle: Docs\n---\n\n# Flow Docs\n\nHigh-signal docs for the Codex/Claude workflow:\n\n- [`commands/ai.md`](commands/ai.md):"
  },
  {
    "path": "docs/install-script-latest-release-verification.md",
    "chars": 7150,
    "preview": "# Verify `curl -fsSL https://myflow.sh/install.sh | sh` Installs the Latest Flow Release\n\nUse this runbook whenever you "
  },
  {
    "path": "docs/jj-home-branch-workflow.md",
    "chars": 2529,
    "preview": "# JJ Home-Branch Workflow\n\nThis workflow is for teams or individuals who keep one long-lived personal branch on top of t"
  },
  {
    "path": "docs/jj-review-workspaces.md",
    "chars": 3013,
    "preview": "# JJ Review Workspaces\n\nWhen you need an isolated working copy for a review branch, use a **JJ review workspace** instea"
  },
  {
    "path": "docs/jj-workspaces-for-parallel-work.md",
    "chars": 3339,
    "preview": "# JJ Workspaces: Work on Multiple Branches Simultaneously\n\nWhen you need to reference or work with code from another bra"
  },
  {
    "path": "docs/local-domains-domainsd-cpp-spec.md",
    "chars": 4357,
    "preview": "# Local Domains Native Daemon (C++) Spec\n\nThis document defines the native local-domains path for Flow.\n\nGoal:\n- keep st"
  },
  {
    "path": "docs/local-domains-no-random-ports.md",
    "chars": 3771,
    "preview": "# Local Domains, No Random Ports\n\nThis pattern gives stable local URLs like `http://gen.localhost` and `http://linsa.loc"
  },
  {
    "path": "docs/log-ingesting.md",
    "chars": 4467,
    "preview": "# Log Ingestion\n\nFlow includes a log ingestion system for collecting and querying structured logs from your projects. Lo"
  },
  {
    "path": "docs/moonbit-ai-tasks-implementation.md",
    "chars": 6124,
    "preview": "# MoonBit AI Tasks: Implementation Inventory\n\nThis document captures the task-centric MoonBit implementation added in Fl"
  },
  {
    "path": "docs/moonbit-rust-boundary-refactor-plan.md",
    "chars": 4929,
    "preview": "# MoonBit Runtime Refactor Plan (Flow)\n\nThis plan is based on the current implementation in:\n\n- `src/ai_tasks.rs`\n- `src"
  },
  {
    "path": "docs/moving-repos.md",
    "chars": 5795,
    "preview": "# Moving Repos with Flow\n\nHow Flow manages repository locations, migration, and AI session continuity.\n\n## Directory Lay"
  },
  {
    "path": "docs/myflow-localhost-runbook.md",
    "chars": 3294,
    "preview": "# myflow.localhost Runbook (Native Domains)\n\nThis is the concrete setup for running `~/code/myflow` with stable local do"
  },
  {
    "path": "docs/new-branch.md",
    "chars": 2227,
    "preview": "# New Branch (Flow + jj)\n\nUse this when you want a clean feature branch quickly with Flow (which syncs with jj under the"
  },
  {
    "path": "docs/new-pr.md",
    "chars": 2059,
    "preview": "# New PR (Flow + jj)\n\nUse this when you want to create and iterate on a PR with Flow while keeping jj state clean.\n\n## G"
  },
  {
    "path": "docs/outdated-readme.md",
    "chars": 7234,
    "preview": "<!-- todo: remove/update this as its not up to date on whats in code repo -->\n\n## Install\n\n```bash\ncurl -fsSL https://ra"
  },
  {
    "path": "docs/pr-edit-watcher.md",
    "chars": 2258,
    "preview": "---\ntitle: PR Edit Watcher\n---\n\n# PR Edit Watcher\n\nFlow supports editing GitHub PR title/body from local Markdown files "
  },
  {
    "path": "docs/private-fork-flow.md",
    "chars": 2276,
    "preview": "# Private Fork Flow Runbook\n\nUse this as the default AI-safe procedure when work must be pushed to a private fork, not p"
  },
  {
    "path": "docs/private-mirror-sync-workflow.md",
    "chars": 2771,
    "preview": "# Private Mirror Sync Workflow (Upstream/Public + Private Fork)\n\nUse this when you work in a public fork clone locally b"
  },
  {
    "path": "docs/private-repo-fast.md",
    "chars": 4919,
    "preview": "# Fast Private Repo Creation From An Existing Local Checkout\n\nUse this when you already have code locally and want a pri"
  },
  {
    "path": "docs/proxyx-design.md",
    "chars": 24313,
    "preview": "# proxyx: Zero-Cost Traced Reverse Proxy for Flow\n\nA lightweight reverse proxy with always-on observability, designed fo"
  },
  {
    "path": "docs/read-stream-of-logs.md",
    "chars": 11745,
    "preview": "# Reactive Log Stream Processing\n\nThis document describes how to build a TypeScript service that watches the flow logs d"
  },
  {
    "path": "docs/rise-sandbox-feature-test-runbook.md",
    "chars": 2693,
    "preview": "# Rise Sandbox Feature Test Runbook (Flow)\n\nUse this when you want deterministic, isolated feature checks in a VM and fa"
  },
  {
    "path": "docs/rise.md",
    "chars": 6146,
    "preview": "# Rise\n\nThis document explains how Rise integrates with Flow and why installing Rise gives you a high-leverage workflow "
  },
  {
    "path": "docs/rl-for-myflow-harbor.md",
    "chars": 3365,
    "preview": "# RL Plan For myflow -> Harbor System\n\nUse this plan to turn the current export/prep automation into a measurable RL imp"
  },
  {
    "path": "docs/rl-myflow-harbor-task-specs.md",
    "chars": 3824,
    "preview": "# RL Task Specs: myflow -> Harbor\n\nConcrete task contracts for the Harbor RL loop. These map directly to scripts current"
  },
  {
    "path": "docs/rl-signal-capture-runbook.md",
    "chars": 3251,
    "preview": "# RL Signal Capture Runbook (Flow + Seq)\n\nThis is the Phase 1 capture path for low-latency, high-signal RL data.\n\n## 1) "
  },
  {
    "path": "docs/run-repos.md",
    "chars": 2272,
    "preview": "# Run Repos Shortcuts (`f r`, `f ri`, `f rp`, `f rip`)\n\nThis workflow lets you run Flow tasks in `~/run` and `~/run/i` f"
  },
  {
    "path": "docs/seq-agent-rpc-contract.md",
    "chars": 4997,
    "preview": "# Seq Agent RPC Contract (Hard Interface)\n\nThis document defines the required interface between agent runtimes (Flow/AI "
  },
  {
    "path": "docs/session-history-mining.md",
    "chars": 4147,
    "preview": "# Session History Mining for Claude/Codex/Cursor\n\nUse this when you want an AI agent to study recent Claude/Codex/Cursor"
  },
  {
    "path": "docs/session-semantic-recovery-with-seq.md",
    "chars": 2753,
    "preview": "# Semantic Session Recovery with Seq (Claude/Codex)\n\nUse this when local Claude/Codex session state got wiped (for examp"
  },
  {
    "path": "docs/set-env-with-hive.md",
    "chars": 1695,
    "preview": "# Set Env Vars with Hive\n\nThis doc shows how to use `hive` to store env vars in Flow’s **local personal** env store.\nThe"
  },
  {
    "path": "docs/task-failure-hooks.md",
    "chars": 2646,
    "preview": "# Task Failure Hooks\n\nFlow can run a command automatically when a task fails. This is useful for\nopening a tailored prom"
  },
  {
    "path": "docs/usage-analytics-rollout.md",
    "chars": 4265,
    "preview": "# Flow Anonymous Usage Tracking (Zero Cost) - Implementation Checklist\n\nThis is the execution plan to add opt-in anonymo"
  },
  {
    "path": "docs/use-flow-to-write-software-better.md",
    "chars": 10391,
    "preview": "# Use Flow To Write Software Better\n\nThis is a practical, opinionated guide for using Flow as the control plane for soft"
  },
  {
    "path": "docs/vendor-code-intelligence.md",
    "chars": 2819,
    "preview": "# Vendor Code Intelligence (Typesense)\n\nThis document defines the crates-focused equivalent of `opensrc` for Flow vendor"
  },
  {
    "path": "docs/vendor-nix-inspiration.md",
    "chars": 2390,
    "preview": "# Nix Ideas In Cargo-First Vendoring\n\nThis vendoring model does not replace Cargo with Nix, but it borrows core Nix idea"
  },
  {
    "path": "docs/vendor-optimization-loop.md",
    "chars": 2225,
    "preview": "# Vendor Optimization Loop\n\nThis is the practical loop for aggressively optimizing dependencies in `flow`\nwhile keeping "
  },
  {
    "path": "flow.py",
    "chars": 12468,
    "preview": "#!/usr/bin/env python3\n\"\"\"\nFlow CLI - Demonstrate swarms in action\n\nUsage:\n    flow single \"Your question here\"\n    flow"
  },
  {
    "path": "flow.toml",
    "chars": 26627,
    "preview": "version = 1\nname = \"flow\"\n\n[agents]\nreview-agent = \"nikivdev:review-agent\"\n\n[flow]\nprimary_task = \"deploy\"\ndeploy_task ="
  },
  {
    "path": "install.sh",
    "chars": 22607,
    "preview": "#!/bin/sh\nset -eu\n\n# Flow CLI installer\n# Usage: curl -fsSL https://myflow.sh/install.sh | sh\n\n# Security posture:\n# - W"
  },
  {
    "path": "lib/vendor-manifest/axum.toml",
    "chars": 290,
    "preview": "crate = \"axum\"\nversion = \"0.8.8\"\nsource = \"crates.io\"\nsynced_at_utc = \"2026-02-22T18:24:59Z\"\nhistory_repo = \"lib/vendor-"
  },
  {
    "path": "lib/vendor-manifest/clap.toml",
    "chars": 639,
    "preview": "crate = \"clap\"\nversion = \"4.6.0\"\nsource = \"crates.io\"\nregistry_index = \"https://github.com/rust-lang/crates.io-index\"\nca"
  },
  {
    "path": "lib/vendor-manifest/crossterm.toml",
    "chars": 671,
    "preview": "crate = \"crossterm\"\nversion = \"0.29.0\"\nsource = \"crates.io\"\nregistry_index = \"https://github.com/rust-lang/crates.io-ind"
  },
  {
    "path": "lib/vendor-manifest/crypto_secretbox.toml",
    "chars": 338,
    "preview": "crate = \"crypto_secretbox\"\nversion = \"0.1.1\"\nsource = \"crates.io\"\nsynced_at_utc = \"2026-02-22T18:28:40Z\"\nhistory_repo = "
  },
  {
    "path": "lib/vendor-manifest/ctrlc.toml",
    "chars": 688,
    "preview": "crate = \"ctrlc\"\nversion = \"3.5.2\"\nsource = \"crates.io\"\nregistry_index = \"https://github.com/rust-lang/crates.io-index\"\nc"
  },
  {
    "path": "lib/vendor-manifest/futures.toml",
    "chars": 698,
    "preview": "crate = \"futures\"\nversion = \"0.3.32\"\nsource = \"crates.io\"\nregistry_index = \"https://github.com/rust-lang/crates.io-index"
  },
  {
    "path": "lib/vendor-manifest/hmac.toml",
    "chars": 292,
    "preview": "crate = \"hmac\"\nversion = \"0.12.1\"\nsource = \"crates.io\"\nsynced_at_utc = \"2026-02-22T19:00:48Z\"\nhistory_repo = \"lib/vendor"
  },
  {
    "path": "lib/vendor-manifest/ignore.toml",
    "chars": 744,
    "preview": "crate = \"ignore\"\nversion = \"0.4.25\"\nsource = \"crates.io\"\nregistry_index = \"https://github.com/rust-lang/crates.io-index\""
  },
  {
    "path": "lib/vendor-manifest/notify-debouncer-mini.toml",
    "chars": 358,
    "preview": "crate = \"notify-debouncer-mini\"\nversion = \"0.7.0\"\nsource = \"crates.io\"\nsynced_at_utc = \"2026-02-22T19:37:32Z\"\nhistory_re"
  },
  {
    "path": "lib/vendor-manifest/notify.toml",
    "chars": 690,
    "preview": "crate = \"notify\"\nversion = \"8.2.0\"\nsource = \"crates.io\"\nregistry_index = \"https://github.com/rust-lang/crates.io-index\"\n"
  },
  {
    "path": "lib/vendor-manifest/portable-pty.toml",
    "chars": 674,
    "preview": "crate = \"portable-pty\"\nversion = \"0.9.0\"\nsource = \"crates.io\"\nregistry_index = \"https://github.com/rust-lang/crates.io-i"
  },
  {
    "path": "lib/vendor-manifest/ratatui.toml",
    "chars": 674,
    "preview": "crate = \"ratatui\"\nversion = \"0.30.0\"\nsource = \"crates.io\"\nregistry_index = \"https://github.com/rust-lang/crates.io-index"
  },
  {
    "path": "lib/vendor-manifest/regex.toml",
    "chars": 682,
    "preview": "crate = \"regex\"\nversion = \"1.12.3\"\nsource = \"crates.io\"\nregistry_index = \"https://github.com/rust-lang/crates.io-index\"\n"
  },
  {
    "path": "lib/vendor-manifest/reqwest.toml",
    "chars": 660,
    "preview": "crate = \"reqwest\"\nversion = \"0.13.2\"\nsource = \"crates.io\"\nregistry_index = \"https://github.com/rust-lang/crates.io-index"
  },
  {
    "path": "lib/vendor-manifest/rmp-serde.toml",
    "chars": 665,
    "preview": "crate = \"rmp-serde\"\nversion = \"1.3.1\"\nsource = \"crates.io\"\nregistry_index = \"https://github.com/rust-lang/crates.io-inde"
  },
  {
    "path": "lib/vendor-manifest/rusqlite.toml",
    "chars": 662,
    "preview": "crate = \"rusqlite\"\nversion = \"0.39.0\"\nsource = \"crates.io\"\nregistry_index = \"https://github.com/rust-lang/crates.io-inde"
  },
  {
    "path": "lib/vendor-manifest/serde.toml",
    "chars": 665,
    "preview": "crate = \"serde\"\nversion = \"1.0.228\"\nsource = \"crates.io\"\nregistry_index = \"https://github.com/rust-lang/crates.io-index\""
  },
  {
    "path": "lib/vendor-manifest/sha1.toml",
    "chars": 292,
    "preview": "crate = \"sha1\"\nversion = \"0.10.6\"\nsource = \"crates.io\"\nsynced_at_utc = \"2026-02-22T18:57:02Z\"\nhistory_repo = \"lib/vendor"
  },
  {
    "path": "lib/vendor-manifest/sha2.toml",
    "chars": 292,
    "preview": "crate = \"sha2\"\nversion = \"0.10.9\"\nsource = \"crates.io\"\nsynced_at_utc = \"2026-02-22T18:57:49Z\"\nhistory_repo = \"lib/vendor"
  },
  {
    "path": "lib/vendor-manifest/tokio-stream.toml",
    "chars": 324,
    "preview": "crate = \"tokio-stream\"\nversion = \"0.1.18\"\nsource = \"crates.io\"\nsynced_at_utc = \"2026-02-22T18:36:31Z\"\nhistory_repo = \"li"
  },
  {
    "path": "lib/vendor-manifest/tokio.toml",
    "chars": 663,
    "preview": "crate = \"tokio\"\nversion = \"1.50.0\"\nsource = \"crates.io\"\nregistry_index = \"https://github.com/rust-lang/crates.io-index\"\n"
  },
  {
    "path": "lib/vendor-manifest/toml.toml",
    "chars": 661,
    "preview": "crate = \"toml\"\nversion = \"1.0.7+spec-1.1.0\"\nsource = \"crates.io\"\nregistry_index = \"https://github.com/rust-lang/crates.i"
  },
  {
    "path": "lib/vendor-manifest/tower-http.toml",
    "chars": 314,
    "preview": "crate = \"tower-http\"\nversion = \"0.6.8\"\nsource = \"crates.io\"\nsynced_at_utc = \"2026-02-22T18:25:01Z\"\nhistory_repo = \"lib/v"
  },
  {
    "path": "lib/vendor-manifest/tracing-subscriber.toml",
    "chars": 717,
    "preview": "crate = \"tracing-subscriber\"\nversion = \"0.3.23\"\nsource = \"crates.io\"\nregistry_index = \"https://github.com/rust-lang/crat"
  },
  {
    "path": "lib/vendor-manifest/url.toml",
    "chars": 286,
    "preview": "crate = \"url\"\nversion = \"2.5.8\"\nsource = \"crates.io\"\nsynced_at_utc = \"2026-02-22T18:25:03Z\"\nhistory_repo = \"lib/vendor-h"
  },
  {
    "path": "lib/vendor-manifest/x25519-dalek.toml",
    "chars": 771,
    "preview": "crate = \"x25519-dalek\"\nversion = \"2.0.1\"\nsource = \"crates.io\"\nregistry_index = \"https://github.com/rust-lang/crates.io-i"
  },
  {
    "path": "license",
    "chars": 1061,
    "preview": "MIT License\n\nCopyright (c) nikiv.dev\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof th"
  },
  {
    "path": "pyproject.toml",
    "chars": 320,
    "preview": "[project]\nname = \"flow\"\nversion = \"0.1.0\"\ndescription = \"CLI to demonstrate swarms in action\"\nrequires-python = \">=3.10\""
  },
  {
    "path": "readme.md",
    "chars": 3009,
    "preview": "# [flow](https://myflow.sh)\n\n> Everything you need to move your project faster\n\n## Install\n\nInstall the latest release ("
  },
  {
    "path": "scripts/agents-switch.sh",
    "chars": 2203,
    "preview": "#!/usr/bin/env bash\nset -euo pipefail\n\ncmd=\"${1:-}\"\nprofile=\"${2:-}\"\nrepo=\"${3:-$(pwd)}\"\n\nif [[ -z \"$cmd\" ]]; then\n  ech"
  },
  {
    "path": "scripts/ai-taskd-launchd.py",
    "chars": 3970,
    "preview": "#!/usr/bin/env python3\nimport argparse\nimport os\nimport plistlib\nimport shutil\nimport subprocess\nimport sys\nfrom pathlib"
  }
]

// ... and 200 more files (download for full content)

About this extraction

This page contains the full source code of the nikivdev/flow GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 400 files (5.1 MB), approximately 1.4M tokens, and a symbol index with 5847 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!