From 30b4e43d43dc885a8b1c445c0ea7ca88aec119c6 Mon Sep 17 00:00:00 2001 From: Willow Sparks Date: Wed, 11 Nov 2026 10:56:47 +0000 Subject: [PATCH] feat: rename the product to Weave and the CLI to wv Rename the downstream Rust port from Prime Agent to Weave, ship the binary as wv at 0.1.0, and move packaging, installers, update paths, and docs to share/weave, .weave-install, and wv-* release assets. Wire protocol names, internal pa-* crates, PRIME_AGENT_* variables, the prime-agent-runtime sidecar, and ~/.prime/agent stay unchanged for compatibility. --- .forgejo/workflows/ci.yml | 2 +- .gitignore | 1 + AGENTS.md | 41 ++- CONTRIBUTING.md | 68 ++-- Cargo.lock | 18 +- Cargo.toml | 8 +- GLOSSARY.md | 4 +- Makefile | 4 +- README.md | 220 +++++-------- crates/pa-agent/Cargo.toml | 2 +- crates/pa-agent/src/lib.rs | 2 +- crates/pa-ai/Cargo.toml | 4 +- crates/pa-ai/src/lib.rs | 2 +- crates/pa-ai/src/oauth/anthropic_callback.rs | 4 +- crates/pa-ai/src/oauth/callback.rs | 4 +- crates/pa-ai/src/providers/anthropic/mod.rs | 2 +- crates/pa-ai/src/providers/google.rs | 2 +- crates/pa-ai/src/providers/google_shared.rs | 2 +- .../providers/openai_completions/params.rs | 2 +- .../pa-ai/src/providers/openai_responses.rs | 2 +- .../pa-ai/src/providers/opencode_headers.rs | 10 +- crates/pa-cli/Cargo.toml | 18 +- crates/pa-cli/README.md | 10 +- crates/pa-cli/src/args.rs | 10 +- crates/pa-cli/src/bin/pa-tui-replay.rs | 5 +- crates/pa-cli/src/client_update.rs | 2 +- crates/pa-cli/src/command_registry.rs | 18 +- crates/pa-cli/src/config.rs | 2 +- crates/pa-cli/src/config_command.rs | 2 +- crates/pa-cli/src/daemon_client.rs | 14 +- crates/pa-cli/src/daemon_command.rs | 12 +- crates/pa-cli/src/daemon_discovery/mod.rs | 6 +- crates/pa-cli/src/daemon_discovery/plan.rs | 5 +- crates/pa-cli/src/daemon_discovery/scan.rs | 6 +- crates/pa-cli/src/daemon_discovery/stop.rs | 5 +- crates/pa-cli/src/incident/mod.rs | 4 +- crates/pa-cli/src/incident/report.rs | 2 +- crates/pa-cli/src/incident/report_tests.rs | 10 +- crates/pa-cli/src/incident/source_tests.rs | 2 +- crates/pa-cli/src/installer_update.rs | 29 +- crates/pa-cli/src/interactive_mode.rs | 4 +- crates/pa-cli/src/interactive_mode/daemon.rs | 8 +- .../src/interactive_mode/daemon_tests.rs | 2 +- crates/pa-cli/src/interactive_mode/tests.rs | 2 +- crates/pa-cli/src/lib.rs | 4 +- crates/pa-cli/src/list_models.rs | 2 +- crates/pa-cli/src/package_command.rs | 4 +- crates/pa-cli/src/print_runtime.rs | 4 +- crates/pa-cli/src/prompt_command.rs | 8 +- crates/pa-cli/src/provider_login.rs | 2 +- crates/pa-cli/src/public_command.rs | 34 +- crates/pa-cli/src/self_update.rs | 8 +- crates/pa-cli/src/session_export.rs | 2 +- crates/pa-cli/src/sessions_table_format.rs | 4 +- crates/pa-cli/src/update_flow/coordinator.rs | 20 +- crates/pa-cli/src/update_flow/plan.rs | 2 +- crates/pa-cli/src/update_flow/report.rs | 4 +- crates/pa-cli/src/update_flow/swap.rs | 28 +- .../pa-cli/src/update_flow/update_command.rs | 14 +- crates/pa-cli/tests/acp_config_option_e2e.rs | 2 +- crates/pa-cli/tests/acp_mode_e2e.rs | 18 +- crates/pa-cli/tests/agents_view_anchor_e2e.rs | 4 +- crates/pa-cli/tests/agents_view_flash_e2e.rs | 4 +- .../tests/agents_view_refusal_panel_e2e.rs | 4 +- crates/pa-cli/tests/agents_view_reply_e2e.rs | 4 +- crates/pa-cli/tests/agents_view_search_e2e.rs | 4 +- .../pa-cli/tests/agents_view_subagents_e2e.rs | 4 +- .../tests/chat_agents_chat_roundtrip_e2e.rs | 4 +- .../tests/chat_open_first_frame_pty_e2e.rs | 2 +- .../tests/clipboard_auth_commands_e2e.rs | 8 +- crates/pa-cli/tests/continue_guard_e2e.rs | 8 +- crates/pa-cli/tests/daemon_commands_e2e.rs | 52 +-- crates/pa-cli/tests/daemon_discovery_e2e.rs | 12 +- crates/pa-cli/tests/differential_cli.rs | 24 +- .../pa-cli/tests/dock_scope_exit_focus_e2e.rs | 4 +- .../tests/editor_handoff_paint_pty_e2e.rs | 4 +- .../pa-cli/tests/export_live_differential.rs | 6 +- crates/pa-cli/tests/export_share_e2e.rs | 4 +- .../native-cli-contract/native-help.txt | 8 +- .../native-package-help.txt | 2 +- .../native-update-help.txt | 4 +- .../pa-cli/tests/input_live_open_pty_e2e.rs | 2 +- crates/pa-cli/tests/installer_platform_map.rs | 34 +- crates/pa-cli/tests/installer_update_e2e.rs | 124 ++++--- crates/pa-cli/tests/interactive_daemon_e2e.rs | 12 +- crates/pa-cli/tests/interactive_fork_e2e.rs | 6 +- crates/pa-cli/tests/lock_compat_e2e.rs | 10 +- crates/pa-cli/tests/mcp_view_e2e.rs | 4 +- .../mermaid_titled_empty_subgraph_e2e.rs | 4 +- crates/pa-cli/tests/nix_managed_update.rs | 2 +- crates/pa-cli/tests/package_e2e.rs | 4 +- crates/pa-cli/tests/package_resources_e2e.rs | 2 +- crates/pa-cli/tests/packaged_layout_e2e.rs | 42 +-- crates/pa-cli/tests/plugin_headless_e2e.rs | 2 +- .../tests/print_inline_subagents_e2e.rs | 2 +- crates/pa-cli/tests/print_runtime_e2e.rs | 10 +- crates/pa-cli/tests/refresh_models_e2e.rs | 2 +- crates/pa-cli/tests/rpc_mode_e2e.rs | 4 +- crates/pa-cli/tests/settings_mcp_save.rs | 4 +- crates/pa-cli/tests/subagent_panel_nav_e2e.rs | 4 +- .../tests/subagent_panel_nested_count_e2e.rs | 4 +- .../pa-cli/tests/view_switch_latency_e2e.rs | 4 +- .../tests/windows_runtime_triage_e2e.rs | 10 +- crates/pa-core/Cargo.toml | 2 +- crates/pa-core/src/export_html/mod.rs | 4 +- .../pa-core/src/kernel/bootstrap/dir_lock.rs | 2 +- crates/pa-core/src/kernel/bootstrap/mod.rs | 4 +- .../kernel/bootstrap/venv/runtime_source.rs | 2 +- crates/pa-core/src/kernel/manager/startup.rs | 2 +- crates/pa-core/src/kernel/provisioner.rs | 2 +- crates/pa-core/src/mcp/oauth_callback.rs | 16 +- crates/pa-core/src/mcp/oauth_discovery.rs | 2 +- crates/pa-core/src/models/prime_inference.rs | 2 +- crates/pa-core/src/models/resolver.rs | 4 +- crates/pa-core/src/packages/tests.rs | 8 +- crates/pa-core/src/prompts/layers/core.md | 16 +- crates/pa-core/src/prompts/model_prompts.rs | 2 +- crates/pa-core/src/prompts/system_prompt.rs | 4 +- .../engine/append_system_tests.rs | 2 +- .../src/session_engine/engine/tests.rs | 2 +- crates/pa-core/src/session_engine/rlm_host.rs | 2 +- crates/pa-core/src/update/download.rs | 32 +- crates/pa-core/src/update/homebrew.rs | 32 +- crates/pa-core/src/update/install.rs | 55 ++-- crates/pa-core/src/update/installer.rs | 120 ++++--- crates/pa-core/src/update/managed.rs | 16 +- crates/pa-core/src/update/mod.rs | 2 +- crates/pa-core/src/update/release.rs | 14 +- crates/pa-core/tests/git_context.rs | 2 +- crates/pa-daemon/Cargo.toml | 10 +- crates/pa-daemon/src/acp/daemon.rs | 4 +- crates/pa-daemon/src/acp/meta.rs | 10 +- crates/pa-daemon/src/acp/types.rs | 8 +- crates/pa-daemon/src/acp/wire_events.rs | 2 +- crates/pa-daemon/src/boot_reap.rs | 22 +- crates/pa-daemon/src/herdr.rs | 26 +- crates/pa-daemon/src/hold_refusal.rs | 71 ++-- crates/pa-daemon/src/journal.rs | 2 +- crates/pa-daemon/src/lib.rs | 2 +- crates/pa-daemon/src/main.rs | 2 +- crates/pa-daemon/src/supervisor/clients.rs | 2 +- crates/pa-daemon/src/update_restore.rs | 8 +- .../pa-daemon/testdata/acp/rust-cancel.jsonl | 2 +- .../testdata/acp/rust-compact_command.jsonl | 2 +- .../testdata/acp/rust-cwd_mismatch.jsonl | 2 +- .../pa-daemon/testdata/acp/rust-errors.jsonl | 2 +- .../testdata/acp/rust-goal_command.jsonl | 2 +- .../testdata/acp/rust-happy_path.jsonl | 2 +- .../testdata/acp/rust-mcp_errors.jsonl | 2 +- .../testdata/acp/rust-mcp_replace.jsonl | 2 +- .../testdata/acp/rust-mcp_stdio.jsonl | 2 +- .../testdata/acp/rust-second_initialize.jsonl | 4 +- .../testdata/acp/rust-tool_call.jsonl | 2 +- .../tests/compaction_mega_trace_e2e.rs | 4 +- crates/pa-daemon/tests/herdr_pane_e2e.rs | 4 +- crates/pa-daemon/tests/hold_refusal_e2e.rs | 4 +- .../tests/supervisor_e2e/lifecycle.rs | 2 +- crates/pa-models/Cargo.toml | 4 +- crates/pa-models/src/bundled.rs | 10 +- crates/pa-models/src/lib.rs | 2 +- crates/pa-tui/Cargo.toml | 4 +- .../pa-tui/src/agents_view/tests/notices.rs | 8 +- crates/pa-tui/src/agents_view_search.rs | 4 +- crates/pa-tui/src/app.rs | 2 +- crates/pa-tui/src/autocomplete/tests.rs | 22 +- crates/pa-tui/src/chrome.rs | 4 +- crates/pa-tui/src/chrome/tests.rs | 2 +- crates/pa-tui/src/clipboard_image.rs | 4 +- crates/pa-tui/src/config_selector.rs | 2 +- crates/pa-tui/src/daemon_client.rs | 14 +- crates/pa-tui/src/daemon_client/errors.rs | 2 +- crates/pa-tui/src/editor/mod.rs | 29 +- crates/pa-tui/src/exit_guard.rs | 2 +- crates/pa-tui/src/exit_restore.rs | 2 +- crates/pa-tui/src/external_editor.rs | 2 +- crates/pa-tui/src/incident_notice_tests.rs | 4 +- crates/pa-tui/src/incident_notices.rs | 6 +- crates/pa-tui/src/interactive/onboarding.rs | 2 +- crates/pa-tui/src/interactive/reconnect.rs | 2 +- crates/pa-tui/src/interactive/run.rs | 16 +- crates/pa-tui/src/interactive/tests.rs | 2 +- crates/pa-tui/src/lib.rs | 2 +- crates/pa-tui/src/onboarding.rs | 2 +- crates/pa-tui/src/session_open_error.rs | 16 +- crates/pa-tui/src/session_ui.rs | 4 +- crates/pa-tui/src/session_ui/apply.rs | 4 +- crates/pa-tui/src/session_ui/commands.rs | 10 +- crates/pa-tui/src/session_ui/heartbeats.rs | 2 +- crates/pa-tui/src/session_ui/lifecycle.rs | 2 +- crates/pa-tui/src/session_ui/prompt.rs | 8 +- crates/pa-tui/src/session_ui/share.rs | 2 +- crates/pa-tui/src/session_ui/stream.rs | 2 +- crates/pa-tui/src/settings_menu/mod.rs | 2 +- crates/pa-tui/src/update_command.rs | 2 +- crates/pa-tui/src/update_restart_wait.rs | 58 ++-- crates/pa-tui/src/view/lazy_tests.rs | 2 +- crates/pa-tui/src/view/tests.rs | 2 +- .../tests/agents_view_incident_notice_e2e.rs | 10 +- crates/pa-tui/tests/bash_bang_headless.rs | 2 +- .../tests/chat_open_first_frame_headless.rs | 4 +- .../pa-tui/tests/daemon_rejection_headless.rs | 8 +- .../daemon_shutdown_reconnect_headless.rs | 4 +- .../daemon_shutdown_turn_end_headless.rs | 4 +- .../pa-tui/tests/nightly_command_headless.rs | 2 +- crates/pa-types/Cargo.toml | 2 +- crates/pa-types/README.md | 2 +- .../pa-types/src/incident/classify_tests.rs | 8 +- crates/pa-types/src/incident/patterns.rs | 6 +- crates/pa-types/src/lib.rs | 2 +- crates/pa-types/src/platform/terminal.rs | 2 +- crates/pa-types/src/platform/transport.rs | 25 +- crates/pa-types/src/slash_commands.rs | 4 +- crates/pa-types/src/themes.rs | 2 +- docs/daily-stats.md | 7 +- docs/slack-mcp.md | 16 +- flake.nix | 14 +- install-rust.sh | 310 +++++++++--------- install.ps1 | 110 +++---- nix/build.nix | 14 +- nix/catalog.nix | 2 +- nix/check_privacy.py | 4 +- nix/checks.nix | 6 +- nix/checks/transcript_pty.py | 6 +- nix/package.nix | 20 +- nix/privacy_lifecycle.py | 8 +- nix/runtime_smoke.py | 4 +- nix/tests/test_packaging.py | 4 +- nix/tests/test_privacy_lifecycle.py | 4 +- .../homebrew/Casks/{prime-agent.rb => wv.rb} | 16 +- .../Formula/{prime-agent.rb => weave.rb} | 28 +- scripts/downstream-hooks.py | 8 +- scripts/package_release.py | 36 +- scripts/release/README.md | 21 +- scripts/release/assemble_artifacts.py | 48 +-- scripts/release/assemble_source.py | 10 +- scripts/release/bundle_catalog.py | 2 +- scripts/release/fold_changelog.py | 2 +- scripts/release/native_compat.py | 14 +- scripts/release/npm_bridge.py | 2 +- scripts/release/npm_bridge_assets/cli.cjs | 4 +- scripts/release/restamp_continuous.py | 12 +- scripts/release/split_debug.py | 8 +- scripts/release/test_catalog_assets.py | 24 +- scripts/release/test_channel_install.py | 4 +- scripts/release/test_channel_version.py | 45 --- scripts/release/test_decoder_manifest.py | 4 +- .../release/test_kernel_runtime_payload.py | 6 +- scripts/release/test_legacy_npm_fallback.py | 10 +- scripts/release/test_legacy_npm_upgrade.py | 2 +- .../release/test_legacy_runtime_restart.py | 4 +- scripts/release/test_legacy_tui_upgrade.py | 2 +- scripts/release/test_legacy_upgrade.py | 14 +- scripts/release/test_native_compat.py | 13 +- scripts/release/test_npm_bridge.py | 62 ++-- scripts/release/test_release_publication.py | 298 ----------------- scripts/release/test_restamp.py | 36 +- .../release/test_windows_channel_fallback.ps1 | 18 +- scripts/release/test_windows_install.ps1 | 20 +- scripts/release/verify_decoders.py | 4 +- scripts/release/verify_release.py | 20 +- scripts/review_socket_pin_parity.py | 10 +- scripts/test_ci_pr_crates.py | 4 +- scripts/test_daily_stats.py | 6 +- scripts/test_downstream_hooks.py | 12 +- skills/agent-message/pyproject.toml | 2 +- .../src/agent_message/__init__.py | 4 +- skills/agent-observe/pyproject.toml | 2 +- .../src/agent_observe/__init__.py | 4 +- skills/compact/pyproject.toml | 2 +- skills/compact/src/compact/__init__.py | 4 +- skills/goal/pyproject.toml | 2 +- skills/goal/src/goal/__init__.py | 4 +- skills/mcp/SKILL.md | 4 +- skills/prime-intellect/SKILL.md | 84 +++-- skills/prime-intellect/references/compute.md | 6 +- .../references/environments.md | 2 +- .../prime-intellect/references/inference.md | 6 +- .../prime-intellect/references/sandboxes.md | 4 +- skills/rlm-heartbeat/pyproject.toml | 2 +- .../src/rlm_heartbeat/__init__.py | 4 +- skills/skill-creator/SKILL.md | 4 +- .../skill-creator/references/python-skills.md | 10 +- skills/websearch/SKILL.md | 6 +- skills/websearch/pyproject.toml | 2 +- skills/websearch/src/websearch/websearch.py | 4 +- 285 files changed, 1587 insertions(+), 2049 deletions(-) rename packaging/homebrew/Casks/{prime-agent.rb => wv.rb} (56%) rename packaging/homebrew/Formula/{prime-agent.rb => weave.rb} (58%) delete mode 100644 scripts/release/test_channel_version.py delete mode 100644 scripts/release/test_release_publication.py diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 3cf831a32..5b305d5ab 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -104,7 +104,7 @@ jobs: if: needs.lint.outputs.docs_only != 'true' timeout-minutes: 20 run: | - nix build .#prime-agent-ci --no-update-lock-file --print-build-logs --out-link "$RUNNER_TEMP/pa-package" + nix build .#weave-ci --no-update-lock-file --print-build-logs --out-link "$RUNNER_TEMP/pa-package" nix build .#checks.x86_64-linux.static --no-update-lock-file --print-build-logs --out-link "$RUNNER_TEMP/pa-static" - name: Documentation-only change if: needs.lint.outputs.docs_only == 'true' diff --git a/.gitignore b/.gitignore index c2fc67868..604bfad8d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ /target +/result /bin/ __pycache__/ steer-queue-runs/ diff --git a/AGENTS.md b/AGENTS.md index 9f1ab9697..86cc6fb84 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,6 +1,6 @@ # AGENTS.md -Development rules for the downstream Prime Agent Rust fork at `sigilzero/prime-agent`. +Development rules for Weave, the downstream Rust harness at `sigilzero/weave`. Every contributor (human or agent) must read this before working on this repo. ## Repository @@ -137,17 +137,30 @@ present. Debug-build behavior alone is not privacy evidence. ## Branding -The product is Prime Agent - we are not a pi fork. Scrub "pi"/"pi-mono"/"pi-ai"/ -"Prime Intellect"-style naming from all user-visible surfaces (docs, READMEs, -CLI help text, error messages, splash/onboarding strings, keybinding hints, TUI -labels, and code comments that quote user-facing strings); brand everything -Prime Agent. Audit with a repo-wide grep and classify every hit (user-visible -vs wire-internal vs comment) before scrubbing, and list the preserved wire -identifiers in the PR body so the reviewer can verify none were wrongly scrubbed. - -EXPLICIT EXCEPTION: wire-protocol identifiers that must stay byte-compatible with the TS product (e.g. the PI_PACKAGE_DIR env var, settings keys, provider IDs like prime-inference, lockfile names) stay until/unless the TS side renames them — PARITY BEATS BRANDING ON THE WIRE. - - +The product is Weave and the CLI is `wv`; we are not a pi fork. Scrub +"pi"/"pi-mono"/"pi-ai" and "Prime Intellect"-style naming from all user-visible +surfaces (docs, READMEs, CLI help text, error messages, splash/onboarding +strings, keybinding hints, TUI labels, and code comments that quote user-facing +strings); brand everything Weave. Audit with a repo-wide grep and classify every +hit (user-visible vs wire-internal vs comment) before scrubbing, and list the +preserved wire identifiers in the PR body so the reviewer can verify none were +wrongly scrubbed. + +EXPLICIT EXCEPTION: these identifiers stay unchanged until a later phase renames +them on both sides of the wire: + +- Rust crate names and paths prefixed `pa-` +- environment variables `PRIME_AGENT_*`, `PA_*`, and `PI_*` (for example + `PI_PACKAGE_DIR` and `PI_SKIP_VERSION_CHECK`) +- config and state directory `~/.prime/agent` +- Python package `prime-agent-runtime` +- daemon protocol identifier `prime-agent.daemon` +- ACP `_meta` namespace `ai.primeintellect.prime-agent` +- settings keys, provider IDs such as `prime-inference`, and lockfile names +- detection of the legacy TypeScript `prime-agent` and `prime-agent-rust` + installs in migration, hold-refusal, and boot-reap code + +PARITY BEATS BRANDING ON THE WIRE. ## Surface contract @@ -156,7 +169,7 @@ EXPLICIT EXCEPTION: wire-protocol identifiers that must stay byte-compatible wit - Preserve core RLM execution and messaging: `rlm.spawn/find_models/collect/list_subagents/delete_subagent/create_session/progress_note`, `agent_message.send`, `agent_observe`, `compact`, `goal`, `attach_image`, and the markdown/Python skill contract. - Plugin-owned `plugin..*` exports and plugin slash commands replace former hardwired interfaces. Preserve accumulated data, not obsolete function names. A disabled plugin contributes no callable namespace, commands, instructions, hooks, jobs, or context; its saved data remains intact. - Keep canonical history independent of the model-facing context view. A session selects one context strategy. That strategy may use an explicit ordered compaction chain; server-side compaction and standard summarization can be fallback strategies. OptChat-style summary-tree context is a separate context strategy, not a compaction fallback. -- Keep cache-stable mandatory prompt layers followed by a dynamic tail. Plugin instructions, callable inventories, and digest contributions reflect active plugins. `prime-agent prompt` exposes the assembled prompt and its layer breakdown without requiring any optional plugin. +- Keep cache-stable mandatory prompt layers followed by a dynamic tail. Plugin instructions, callable inventories, and digest contributions reflect active plugins. `wv prompt` exposes the assembled prompt and its layer breakdown without requiring any optional plugin. - Preserve existing CLI/headless behavior except for the explicitly authorized plugin changes. Negotiate optional daemon command/metadata changes; keep startup usable with older peers. ## Crates @@ -174,7 +187,7 @@ The table summarizes each crate's current direct workspace dependencies: | `pa-core` | Session engine, tools, skills, kernel, settings | `pa-types`, `pa-ai`, `pa-models`, `pa-agent` | | `pa-daemon` | Supervisor, workers, wire protocol | `pa-types`, `pa-core`, `pa-agent`, `pa-ai`, `pa-models` | | `pa-tui` | Terminal UI, daemon-wire client | `pa-types` | -| `pa-cli` | `prime-agent` binary, composition root | `pa-types`, `pa-core`, `pa-ai`, `pa-agent`, `pa-daemon`, `pa-tui` | +| `pa-cli` | `wv` binary, composition root | `pa-types`, `pa-core`, `pa-ai`, `pa-agent`, `pa-daemon`, `pa-tui` | Layering rules: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 871d6a9ef..514ec125c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,43 +1,51 @@ -# Contributing to Prime Agent +# Contributing to Weave -Thanks for your interest in contributing to Prime Agent! Prime Agent is developed in public, and we welcome bug reports, feature requests, questions, and other feedback. To keep the project maintainable, public contributions begin in [GitHub Discussions](https://github.com/PrimeIntellect-ai/prime-agent/discussions). +Weave runs on user machines and can execute code with the user's permissions. Read +[AGENTS.md](AGENTS.md) before contributing; it holds the engineering, testing, and +merge rules for this repository. -With the influx of agent-generated contributions, we do not review unsolicited pull requests or use public Issues as the initial intake queue. While we are open to contributions by agents, you are responsible for your code and must understand how it interacts with the entire project. +## Start with an issue -## Start with a Discussion +Use the [Forgejo issue tracker](https://mnemosyne.sigilzero.dev/sigilzero/weave/issues) +and search it before opening a new issue. For a bug, include the `wv --version` +output, your platform, the command you ran, and the expected and actual results. +Keep the report reproducible. Never share API keys, tokens, private prompts, +transcripts, or other sensitive information. -Choose the category that best matches what you want to share: +Report security vulnerabilities privately to the maintainers instead of posting +them publicly. -- [General discussion or question](https://github.com/PrimeIntellect-ai/prime-agent/discussions/categories/general) -- [Bug report](https://github.com/PrimeIntellect-ai/prime-agent/discussions/categories/bug-reports) -- [Feature request](https://github.com/PrimeIntellect-ai/prime-agent/discussions/categories/feature-requests) +An existing issue does not mean an external pull request is wanted. Ask in the +issue before starting substantial work; maintainers may decline changes that do +not fit the project. -Search existing Discussions before creating a new one. Include enough detail for someone else to understand and reproduce the problem, but do not share API keys, tokens, private prompts, or other sensitive information. +## Pull requests -For security vulnerabilities, report them privately to the maintainers instead of posting publicly. +If a maintainer invites a pull request, open it against `main` on Mnemosyne: +. GitHub is a mirror; push +only to `origin`. -## Issues +- Keep one logical change per pull request. Do not mix unrelated refactors or + dependency changes into it. +- Follow AGENTS.md and the existing conventions. +- Explain the scope and how you validated the change. +- Add or update tests for behavioral changes. Bug fixes need a regression test + that fails without the fix. +- User-visible changes need the parity-diff evidence described in + [AGENTS.md](AGENTS.md). +- State ownership compliance for crate changes as [AGENTS.md](AGENTS.md) requires. -GitHub Issues track work that maintainers have accepted and intend to investigate or implement. A maintainer may create an Issue from a Discussion when the scope is clear and the work fits the roadmap. An existing Issue does not automatically mean that an external pull request is wanted. Wait for a maintainer to invite implementation before starting substantial work. +Run the gates before requesting review: -Issues opened by unapproved contributors are automatically closed and redirected to Discussions. To contribute, share interest in Discussions or corresponding issues, and maintainers can invite implementation for requested work. +```bash +make check +nix flake check --no-update-lock-file +``` -## Pull Requests and Trusted Contributors +Use `nix develop --no-update-lock-file` for the pinned tools. Keep test state +isolated and never use live user credentials. -Prime Agent runs on user machines and can execute code with the user's permissions. We therefore limit pull requests to maintainers and trusted contributors who have been explicitly vouched for. Maintainers may vouch for someone after they have consistently demonstrated a useful understanding of the project through Discussions, issue investigation, testing, documentation, or other collaboration. There is no separate application process and no guarantee that participation will result in approval. +## Commits -Pull requests from unvouched contributors are automatically closed. If you are interested in contributing code, begin with a Discussion and work with the maintainers on the problem first. - -## Preparing an Approved Pull Request - -If a maintainer has invited a pull request: - -1. Keep the change focused on the accepted Issue or Discussion. -2. Follow the repository's development rules and existing conventions. -3. Add or update tests for behavioral changes. -4. Run the relevant checks locally and describe the validation in the pull request. -5. Avoid unrelated refactors or dependency changes. - -Development rules, setup, and commands for this branch are documented in [AGENTS.md](AGENTS.md) and the Makefile gate targets (`make check`, `make deny`, `make windows-cross`). - -Maintainers may close a pull request that changes scope, cannot be validated safely, or no longer fits the project roadmap. +Never set git identity for commits to this repository and never add +`Co-authored-by` trailers; [AGENTS.md](AGENTS.md) explains both rules. diff --git a/Cargo.lock b/Cargo.lock index 0f5148ebc..7d817c488 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1519,7 +1519,7 @@ dependencies = [ [[package]] name = "pa-agent" -version = "0.10.0" +version = "0.1.0" dependencies = [ "anyhow", "pa-test-scratch", @@ -1531,7 +1531,7 @@ dependencies = [ [[package]] name = "pa-ai" -version = "0.10.0" +version = "0.1.0" dependencies = [ "anyhow", "base64 0.22.1", @@ -1567,7 +1567,7 @@ dependencies = [ [[package]] name = "pa-cli" -version = "0.10.0" +version = "0.1.0" dependencies = [ "anyhow", "base64 0.22.1", @@ -1598,7 +1598,7 @@ dependencies = [ [[package]] name = "pa-core" -version = "0.10.0" +version = "0.1.0" dependencies = [ "anyhow", "base64 0.22.1", @@ -1639,7 +1639,7 @@ dependencies = [ [[package]] name = "pa-daemon" -version = "0.10.0" +version = "0.1.0" dependencies = [ "anyhow", "filetime", @@ -1666,7 +1666,7 @@ dependencies = [ [[package]] name = "pa-models" -version = "0.10.0" +version = "0.1.0" dependencies = [ "hex", "hmac", @@ -1695,7 +1695,7 @@ dependencies = [ [[package]] name = "pa-test-scratch" -version = "0.10.0" +version = "0.1.0" dependencies = [ "libc", "pa-test-macros", @@ -1704,7 +1704,7 @@ dependencies = [ [[package]] name = "pa-tui" -version = "0.10.0" +version = "0.1.0" dependencies = [ "anyhow", "base64 0.22.1", @@ -1732,7 +1732,7 @@ dependencies = [ [[package]] name = "pa-types" -version = "0.10.0" +version = "0.1.0" dependencies = [ "anyhow", "libc", diff --git a/Cargo.toml b/Cargo.toml index db4bcc3e0..9aa5c050e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,7 +30,7 @@ mmdflux = { path = "vendor/mmdflux" } mlua = { path = "vendor/mlua" } [workspace.package] -version = "0.10.0" +version = "0.1.0" edition = "2021" license = "MIT" @@ -47,9 +47,9 @@ anyhow = "1" tokio = { version = "1", features = ["full"] } tokio-util = "0.7" tracing = { version = "0.1", features = ["attributes"] } -pa-types = { path = "crates/pa-types", version = "0.10.0" } -pa-ai = { path = "crates/pa-ai", version = "0.10.0" } -pa-agent = { path = "crates/pa-agent", version = "0.10.0" } +pa-types = { path = "crates/pa-types", version = "0.1.0" } +pa-ai = { path = "crates/pa-ai", version = "0.1.0" } +pa-agent = { path = "crates/pa-agent", version = "0.1.0" } thiserror = "2" futures = "0.3" toml = "0.9" diff --git a/GLOSSARY.md b/GLOSSARY.md index e1e091b55..7960a94f2 100644 --- a/GLOSSARY.md +++ b/GLOSSARY.md @@ -1,6 +1,6 @@ -# Prime Agent +# Weave -Prime Agent runs durable agent conversations and lets optional plugins customize inference, execution, context, and memory. This language distinguishes the recorded conversation from the context presented to a model. +Weave runs durable agent conversations and lets optional plugins customize inference, execution, context, and memory. This language distinguishes the recorded conversation from the context presented to a model. ## Conversations and execution diff --git a/Makefile b/Makefile index f7670b9e1..02dfaff52 100644 --- a/Makefile +++ b/Makefile @@ -50,7 +50,7 @@ hooks-check: # These are intentional, manual source builds; no upstream release scripts, # binary downloads, npm commands, tag creation, or publishing steps. package: - nix build --no-update-lock-file .#prime-agent + nix build --no-update-lock-file .#weave package-check: nix flake check --no-update-lock-file @@ -80,7 +80,7 @@ windows-msvc-cross: audit-build: @command -v cargo-auditable >/dev/null 2>&1 || { echo 'cargo-auditable unavailable; enter a Nix shell that provides it' >&2; exit 1; } - cargo auditable build --release --locked -p pa-cli --bin prime-agent + cargo auditable build --release --locked -p pa-cli --bin wv .PHONY: help check fmt-check lint typecheck test hooks-check package package-check \ workspace-check deny windows-cross windows-msvc-cross audit-build diff --git a/README.md b/README.md index 667db62bb..7ea1efc10 100644 --- a/README.md +++ b/README.md @@ -1,81 +1,102 @@ -

-Prime Agent: A Self-Improving RLM Harness -

+# Weave -

- Documentation • - Verifiers • - PRIME-RL -

+Weave is a terminal agent for coding and research. The model works through a +persistent Python REPL. Sessions run in a background daemon and can be resumed +after the client exits. -

- Downstream CI - - arXiv - -

+The CLI is `wv`. This is the downstream Rust repository; Mnemosyne is the +source of truth and GitHub is a mirror. -

- - PrimeIntellect-ai%2Fprime-agent | Trendshift - -

+- Repository: +- Issues: +- Version: 0.1.0 +- License: MIT -Prime Agent is an open-source coding and research agent for general and long-running work. It is designed around two core abstractions: +## Build -- The **[Recursive Language Model (RLM)](https://www.primeintellect.ai/blog/rlm)** treats context as variables (*prompt-as-a-variable*) and tools like recursive subagents as function calls (*programmatic tool /sub-agent calling*) inside a persistent REPL. +Build the application with its Python runtime, skills, and catalogs: -## Install +```bash +nix build +./result/bin/wv --version +``` -This is Willow's downstream Rust fork. Mnemosyne is the source of truth; -GitHub is its mirror. It preserves native Ollama Cloud support, provider catalog -refresh, local transcript history, and the fork's no-vendor-reporting policy. +`nix develop` provides the pinned development tools. On Willow's NixOS fleet, +`/config` owns the installation; do not use upstream installers, global npm +packages, or self-update for a Nix-owned installation. -Build the complete application with its Python runtime, skills, and catalogs: +## Run + +Start Weave from the directory you want it to work in: ```bash -nix build -./result/bin/prime-agent +cd /path/to/project +wv ``` -Use `nix develop` for the pinned development tools. On Willow's NixOS fleet, -`/config` owns installation and pins this repository through `prime-agent-src`. -Update that pin with the guarded fleet updater and deploy through the fleet pipeline; -do not use upstream installers, global npm packages, or self-update for a Nix-owned -installation. - -Downstream releases are manual, source-only Forgejo Releases tagged -`fork-YYYY.MM.DD.N` at an exact reviewed commit. The package version remains -`0.10.0`; the source tag does not restamp the application. CI validates but never -publishes. No downstream binaries, npm packages, catalogs, or installers are -published. Portable packaging tools and archived upstream workflows are reference -material, not the downstream installation path. See the -[source release procedure](scripts/release/README.md). - -Before integration, `make check` runs the full workspace formatting, clippy, test, -and hook gates. `nix flake check --no-update-lock-file` adds the Nix package, -privacy, and audited runtime checks; it does not replace the full Rust gate. -For credential-isolated validation with a prepared real kernel, enter -`nix develop --no-update-lock-file`, then run: +On first launch, run `/login` to choose a subscription or API-key provider. +Weave works in the current directory and can run commands and modify files there. +Use a disposable clone, clean worktree, or another checkpoint you can inspect and +restore. + +> [!WARNING] +> Weave executes model-generated Python and project commands with your user +> permissions. Worker and kernel processes isolate session lifecycles and support +> recovery; they are **not** a security sandbox. Review changes and use trusted +> repositories, instructions, and skills only. Run untrusted code or instructions +> in an external sandbox or restricted environment. + +Useful commands: ```bash -python3 -B scripts/check_workspace.py +wv agents # Browse running, idle, and saved sessions +wv attach # Reattach to a running session +wv --resume [path|id] # Browse sessions or resume one directly +wv status # Inspect background service state +wv doctor [--fix] # Inspect or repair background services +wv update [--force] # Update Weave +wv shutdown [--force] # Stop every agent, worker, and background service ``` -This can download locked build/Python dependencies. It never needs live provider -or MCP credentials. It uses private test state and one reusable Cargo target; -see the release procedure for limits and explicit cache/kernel reuse options. +## Configuration -## Why Prime Agent +Weave trusts your operating system's trust store together with the bundled +Mozilla roots. For a server behind a custom CA, point `NODE_EXTRA_CA_CERTS` at a +PEM bundle: + +```bash +export NODE_EXTRA_CA_CERTS=/path/to/your-ca.pem +``` -Prime Agent combines a persistent Python control environment with durable sessions, so useful working context and reusable operating patterns can outlive a single chat window. +Each transport reads the variable once when its first client is initialized. The +background daemon keeps the environment it started with, so run `wv shutdown` +after changing it. -- **Everything is programmatic:** a persistent Python REPL is the built-in model tool; file operations, shell commands, tool use, subagents, and context management happen through code. -- **Subagents are built in:** `rlm.spawn(...)` spawns real child agents for parallel or background work and returns their results programmatically. -- **Skills are executable:** skills are importable Python packages, and the built-in skill creator can turn recurring workflows into project or personal skills. -- **Sessions run in the background:** daemon-backed agents keep running when the terminal disconnects and can be reattached later. -- **Agents communicate directly:** running agents can exchange messages and orchestrate one another without routing everything through the user. -- **Long tasks keep moving:** automatic compaction, persistent goals, heartbeats, schedules, and retained subagents preserve progress across turns and terminal sessions. +Clipboard copy uses the local clipboard tool when available. In tmux it forwards +through the attached client; without tmux it falls back to OSC 52 over SSH. +Delivery cannot always be confirmed, so the UI reports it as unconfirmed. + +Connect Slack from `/mcp` or with `/mcp login slack`. See the +[Slack connector guide](docs/slack-mcp.md) for setup and troubleshooting. + +## Development + +Read [AGENTS.md](AGENTS.md) before contributing. Before integration, `make check` +runs the workspace formatting, clippy, test, and hook gates. +`nix flake check --no-update-lock-file` adds the Nix package, privacy, and audited +runtime checks; it does not replace the full Rust gate. + +For credential-isolated validation with a prepared real kernel, enter +`nix develop --no-update-lock-file`, then run: + +```bash +python3 -B scripts/check_workspace.py +``` + +This can download locked build and Python dependencies. It never needs live +provider or MCP credentials. It uses private test state and one reusable Cargo +target. See [CONTRIBUTING.md](CONTRIBUTING.md) and [GLOSSARY.md](GLOSSARY.md) for +contribution and domain guidance. ## Context compaction @@ -100,87 +121,6 @@ to `null` to disable the server probe, or supply an exact `{provider, endpoint, route override; a mismatched override is an error. Custom context strategies keep control of their own chains. -## Slack - -Connect Slack from `/mcp` or run `/mcp login slack` inside Prime Agent to search -your workspace and use Slack tools. See the [Slack connector guide](docs/slack-mcp.md) -for OAuth setup and troubleshooting. - -## Clipboard over SSH and tmux - -Prime Agent uses the local clipboard tool (such as `pbcopy`) when available. In tmux it asks the attached tmux client to forward a clipboard buffer if that client advertises the `Ms` capability. This works with tmux's default `set-clipboard external`, unlike application-origin OSC 52. Without tmux, remote copies request delivery using OSC 52. Terminal requests cannot confirm that your local clipboard changed, so Prime Agent reports them as unconfirmed. - -Nested tmux servers and terminals may still block delivery. An outer tmux with `set-clipboard external` can reject the inner server's OSC 52. In that case, run `tmux set -s set-clipboard on` on the outer server, or use native terminal selection (Shift-drag in most terminals; Option-drag in iTerm2) followed by Cmd-C. macOS Terminal.app does not support OSC 52; iTerm2 requires its “Applications in terminal may access clipboard” setting. - -## Custom certificate authorities - -HTTPS requests trust your operating system's trust store together with the bundled Mozilla roots. For servers behind a custom CA, point `NODE_EXTRA_CA_CERTS` at a PEM bundle of your CA certificates — the same variable the Node/TypeScript build honors: - -```bash -export NODE_EXTRA_CA_CERTS=/path/to/your-ca.pem -``` - -Each transport reads the variable once when its first client is initialized. The background daemon keeps the environment it started with, so run `prime-agent shutdown` after changing it. - -## Getting Started - -Start Prime Agent from the repository or directory you want it to work in: - -```bash -cd /path/to/project -prime-agent -``` - -On first launch, run `/login` to choose a subscription or API-key provider. Prime Agent works in the current directory and can run commands and modify files there. Use a disposable clone, clean worktree, or another checkpoint you can inspect and restore. - -> [!WARNING] -> Prime Agent executes model-generated Python and project commands with your user permissions. Its worker and kernel processes improve lifecycle isolation and recovery; they are **not** a security sandbox. Review changes and use trusted repositories, instructions, and skills only. Run untrusted code or instructions in an external sandbox or restricted environment. - -Useful commands: - -```bash -prime-agent agents # Browse running, idle, and saved sessions -prime-agent attach # Reattach to a running session -prime-agent --resume [path|id] # Browse sessions or resume one directly -prime-agent status # Inspect background service state -prime-agent doctor [--fix] # Inspect or repair background services -prime-agent update [--force] # Update Prime Agent -prime-agent shutdown [--force] # Stop every agent, worker, and background service -``` - -## Built for Long-Running Work -Prime Agent is built for long-running work, especially for evaluations in research. These features are available in the TUI and in daemon-backed sessions. - -- **Direct agent-to-agent communication:** running agents and retained subagents can discover one another, exchange messages, and steer active work. -- **Daemon-backed continuity:** active sessions, Python REPL state, schedules, and subagents keep running when the terminal detaches and can be reattached later. -- **Heartbeats and schedules:** `/heartbeat`, `rlm_heartbeat`, and `prime-agent schedule` can re-enter a session periodically or at a specific time. -- **Persistent goals:** `/goal` keeps an objective and its progress active across turns until it is completed, paused, or cleared. - -## Contributing - -Read [AGENTS.md](AGENTS.md) before contributing. Use the downstream -[Forgejo issues](https://mnemosyne.sigilzero.dev/sigilzero/prime-agent/issues) and -[pull requests](https://mnemosyne.sigilzero.dev/sigilzero/prime-agent/pulls). -GitHub and archived upstream automation are not downstream publication authority. - -## License - -Prime Agent is fully open source and released under the [MIT License](LICENSE). - -## Citation - -If you use this codebase in your research, please cite Prime Agent: - -```bibtex -@article{karten2026prime, - title={Prime Agent: A Self-Improving RLM Harness}, - author={Karten, Seth and Zhang, Alex L. and Thomas, Kevin and Müller, Sebastian and Bakouch, Elie and Auras, Daniel and Senghaas, Mika and Obeid, Fares and Dunas, Konstantin and Hagemann, Johannes and Jaghouar, Sami}, - journal={arXiv preprint arXiv:2608.23552}, - year={2026} -} -``` - -Available at [https://arxiv.org/abs/2608.23552](https://arxiv.org/abs/2608.23552). ### Automatic compaction settings diff --git a/crates/pa-agent/Cargo.toml b/crates/pa-agent/Cargo.toml index afbef5465..c93681836 100644 --- a/crates/pa-agent/Cargo.toml +++ b/crates/pa-agent/Cargo.toml @@ -3,7 +3,7 @@ name = "pa-agent" version.workspace = true edition.workspace = true license.workspace = true -description = "Agent loop for Prime Agent." +description = "Agent loop for Weave." [dependencies] anyhow.workspace = true diff --git a/crates/pa-agent/src/lib.rs b/crates/pa-agent/src/lib.rs index 5c7b8bb08..9d1b459d3 100644 --- a/crates/pa-agent/src/lib.rs +++ b/crates/pa-agent/src/lib.rs @@ -1,4 +1,4 @@ -//! Agent loop for Prime Agent: the loop works with [`types::AgentMessage`] +//! Agent loop for Weave: the loop works with [`types::AgentMessage`] //! throughout and converts to LLM-bound [`types::Message`] values only at //! the model call boundary. diff --git a/crates/pa-ai/Cargo.toml b/crates/pa-ai/Cargo.toml index 512ed47fb..1b53c6c27 100644 --- a/crates/pa-ai/Cargo.toml +++ b/crates/pa-ai/Cargo.toml @@ -3,10 +3,10 @@ name = "pa-ai" version.workspace = true edition.workspace = true license.workspace = true -description = "Provider APIs, model registry, and streaming for Prime Agent." +description = "Provider APIs, model registry, and streaming for Weave." [dependencies] -pa-types = { path = "../pa-types", version = "0.10.0" } +pa-types = { path = "../pa-types", version = "0.1.0" } serde = { workspace = true } serde_json = { workspace = true } anyhow = { workspace = true } diff --git a/crates/pa-ai/src/lib.rs b/crates/pa-ai/src/lib.rs index 79aca43b9..eeaa8ddf1 100644 --- a/crates/pa-ai/src/lib.rs +++ b/crates/pa-ai/src/lib.rs @@ -1,4 +1,4 @@ -//! Provider APIs and model registry for Prime Agent. +//! Provider APIs and model registry for Weave. //! //! The wire/domain types live in `pa-types` (the only dependency, one-way) and are re-exported //! from [`types`]; per-provider internals are `pub(crate)`. diff --git a/crates/pa-ai/src/oauth/anthropic_callback.rs b/crates/pa-ai/src/oauth/anthropic_callback.rs index b1a9ab58e..11388d162 100644 --- a/crates/pa-ai/src/oauth/anthropic_callback.rs +++ b/crates/pa-ai/src/oauth/anthropic_callback.rs @@ -365,11 +365,11 @@ fn render_page(title: &str, message: &str, details: Option<&str>) -> String { } fn success_page(message: &str) -> String { - render_page("Prime Agent authentication completed", message, None) + render_page("Weave authentication completed", message, None) } fn error_page(message: &str, details: Option<&str>) -> String { - render_page("Prime Agent authentication failed", message, details) + render_page("Weave authentication failed", message, details) } #[cfg(test)] diff --git a/crates/pa-ai/src/oauth/callback.rs b/crates/pa-ai/src/oauth/callback.rs index 522e1a3f5..5a7d7c503 100644 --- a/crates/pa-ai/src/oauth/callback.rs +++ b/crates/pa-ai/src/oauth/callback.rs @@ -320,11 +320,11 @@ fn render_page(title: &str, message: &str) -> String { } fn success_page(message: &str) -> String { - render_page("Prime Agent authentication completed", message) + render_page("Weave authentication completed", message) } fn error_page(message: &str) -> String { - render_page("Prime Agent authentication failed", message) + render_page("Weave authentication failed", message) } #[cfg(test)] diff --git a/crates/pa-ai/src/providers/anthropic/mod.rs b/crates/pa-ai/src/providers/anthropic/mod.rs index 2198e6f4e..9b079e741 100644 --- a/crates/pa-ai/src/providers/anthropic/mod.rs +++ b/crates/pa-ai/src/providers/anthropic/mod.rs @@ -626,7 +626,7 @@ mod subscription_identity_tests { .find(|(key, _)| key.eq_ignore_ascii_case(name)) .map(|(_, value)| value.as_str()) }; - assert_eq!(header("User-Agent"), Some("prime-agent")); + assert_eq!(header("User-Agent"), Some("weave")); assert_eq!(header("x-opencode-session"), Some("session-1")); assert_eq!(header("session_id"), None); } diff --git a/crates/pa-ai/src/providers/google.rs b/crates/pa-ai/src/providers/google.rs index b9ee9e71f..1339f89a4 100644 --- a/crates/pa-ai/src/providers/google.rs +++ b/crates/pa-ai/src/providers/google.rs @@ -515,7 +515,7 @@ mod tests { .find(|(key, _)| key.eq_ignore_ascii_case(name)) .map(|(_, value)| value.as_str()) }; - assert_eq!(header("User-Agent"), Some("prime-agent")); + assert_eq!(header("User-Agent"), Some("weave")); assert_eq!(header("x-opencode-session"), Some("session-1")); assert_eq!(header("session_id"), None); } diff --git a/crates/pa-ai/src/providers/google_shared.rs b/crates/pa-ai/src/providers/google_shared.rs index 5950f17c7..6dff16dfc 100644 --- a/crates/pa-ai/src/providers/google_shared.rs +++ b/crates/pa-ai/src/providers/google_shared.rs @@ -527,7 +527,7 @@ pub fn get_disabled_thinking_config(model_id: &str) -> Value { json!({ "thinkingBudget": 0 }) } -/// Map a Prime Agent thinking level to a Gemini 3 thinking level. +/// Map a Weave thinking level to a Gemini 3 thinking level. pub fn get_thinking_level( effort: crate::types::ModelThinkingLevel, model_id: &str, diff --git a/crates/pa-ai/src/providers/openai_completions/params.rs b/crates/pa-ai/src/providers/openai_completions/params.rs index eb69d816f..fb12efbc0 100644 --- a/crates/pa-ai/src/providers/openai_completions/params.rs +++ b/crates/pa-ai/src/providers/openai_completions/params.rs @@ -438,7 +438,7 @@ mod tests { .find(|(key, _)| key.eq_ignore_ascii_case(name)) .map(|(_, value)| value.as_str()) }; - assert_eq!(header("User-Agent"), Some("prime-agent")); + assert_eq!(header("User-Agent"), Some("weave")); assert_eq!(header("x-opencode-session"), Some("session-1")); assert_eq!(header("session_id"), None); diff --git a/crates/pa-ai/src/providers/openai_responses.rs b/crates/pa-ai/src/providers/openai_responses.rs index f420f97a1..816875916 100644 --- a/crates/pa-ai/src/providers/openai_responses.rs +++ b/crates/pa-ai/src/providers/openai_responses.rs @@ -614,7 +614,7 @@ mod tests { .find(|(key, _)| key.eq_ignore_ascii_case(name)) .map(|(_, value)| value.as_str()) }; - assert_eq!(header("User-Agent"), Some("prime-agent")); + assert_eq!(header("User-Agent"), Some("weave")); assert_eq!(header("x-opencode-session"), Some("session-1")); assert_eq!(header("session_id"), None); } diff --git a/crates/pa-ai/src/providers/opencode_headers.rs b/crates/pa-ai/src/providers/opencode_headers.rs index 5095437e1..6741be06b 100644 --- a/crates/pa-ai/src/providers/opencode_headers.rs +++ b/crates/pa-ai/src/providers/opencode_headers.rs @@ -2,7 +2,7 @@ /// Add the `OpenCode` routing identity to a request's merged headers. /// -/// TS contract: start with `User-Agent: prime-agent`, add +/// TS contract: start with `User-Agent: weave`, add /// `x-opencode-session` only when a session id is present, then let model and /// caller headers override either value case-insensitively. This helper runs /// after those merges, so it only fills values the caller did not supply. @@ -18,7 +18,7 @@ pub(crate) fn with_opencode_headers( .iter() .any(|(name, _)| name.eq_ignore_ascii_case("User-Agent")) { - headers.push(("User-Agent".to_string(), "prime-agent".to_string())); + headers.push(("User-Agent".to_string(), "weave".to_string())); } if let Some(session_id) = session_id.filter(|session_id| !session_id.is_empty()) { if !headers @@ -59,7 +59,7 @@ mod tests { fn adds_both_identity_headers_for_opencode() { let mut headers = Vec::new(); with_opencode_headers("opencode", Some("session-1"), &mut headers); - assert_eq!(header(&headers, "User-Agent"), Some("prime-agent")); + assert_eq!(header(&headers, "User-Agent"), Some("weave")); assert_eq!(header(&headers, "x-opencode-session"), Some("session-1")); } @@ -67,7 +67,7 @@ mod tests { fn adds_user_agent_without_a_session_id() { let mut headers = Vec::new(); with_opencode_headers("opencode-go", None, &mut headers); - assert_eq!(header(&headers, "User-Agent"), Some("prime-agent")); + assert_eq!(header(&headers, "User-Agent"), Some("weave")); assert_eq!(header(&headers, "x-opencode-session"), None); } @@ -89,7 +89,7 @@ mod tests { fn empty_session_id_is_not_an_identity() { let mut headers = Vec::new(); with_opencode_headers("opencode", Some(""), &mut headers); - assert_eq!(header(&headers, "User-Agent"), Some("prime-agent")); + assert_eq!(header(&headers, "User-Agent"), Some("weave")); assert_eq!(header(&headers, "x-opencode-session"), None); } } diff --git a/crates/pa-cli/Cargo.toml b/crates/pa-cli/Cargo.toml index 80936afb4..62ee1e7af 100644 --- a/crates/pa-cli/Cargo.toml +++ b/crates/pa-cli/Cargo.toml @@ -3,16 +3,16 @@ name = "pa-cli" version.workspace = true edition.workspace = true license.workspace = true -description = "The prime-agent binary." -default-run = "prime-agent" +description = "The weave binary." +default-run = "wv" [dependencies] -pa-types = { path = "../pa-types", version = "0.10.0" } -pa-core = { path = "../pa-core", version = "0.10.0" } -pa-ai = { path = "../pa-ai", version = "0.10.0" } -pa-agent = { path = "../pa-agent", version = "0.10.0" } -pa-daemon = { path = "../pa-daemon", version = "0.10.0" } -pa-tui = { path = "../pa-tui", version = "0.10.0" } +pa-types = { path = "../pa-types", version = "0.1.0" } +pa-core = { path = "../pa-core", version = "0.1.0" } +pa-ai = { path = "../pa-ai", version = "0.1.0" } +pa-agent = { path = "../pa-agent", version = "0.1.0" } +pa-daemon = { path = "../pa-daemon", version = "0.1.0" } +pa-tui = { path = "../pa-tui", version = "0.1.0" } uuid = { version = "1", features = ["v4", "v7"] } tokio = { workspace = true } anyhow = { workspace = true } @@ -21,7 +21,7 @@ serde_json = { workspace = true } clap = { version = "4", features = ["derive"] } [[bin]] -name = "prime-agent" +name = "wv" path = "src/main.rs" [[bin]] diff --git a/crates/pa-cli/README.md b/crates/pa-cli/README.md index ee6065568..1084705c3 100644 --- a/crates/pa-cli/README.md +++ b/crates/pa-cli/README.md @@ -1,15 +1,15 @@ # pa-cli -The `prime-agent` binary. +The `wv` binary. ## Scope -Argument parsing matching the TS CLI exactly, mode selection (interactive/headless/json/daemon subcommands), binary wiring of crates into processes, exit codes and user-facing errors. The daemon-forensics CLI (`incident.rs`, TS `src/cli/incident.ts`): the `prime-agent incident` timeline command — log-source discovery (agent.jsonl plus its `.old` rotation, falling back to the newest per-daemon log), `--since`/`--until` window and `--session` filter parsing, and the report rendering; the shared classifier lives in pa-types (`pa_types::incident`) and the agents-view notice in pa-tui. Client-side MCP auth flows (`mcp_login.rs`): the `/mcp login`/`/mcp logout` hook the TUI calls — the TS interactive client's placement — resolving a server (settings `mcpServers` + the builtin catalog), running the pa-core OAuth login on the suspended terminal, and persisting through the shared auth store. The same placement serves the TUI's client-command hooks: provider auth (`provider_login.rs` — the `/login`/`/logout` catalog, the API-key store, the MCP device flow, the Prime Inference terminal login (`prime_inference_login.rs` — the API-key flow: prime-cli credential reuse, the paste prompt with the whoami access check, the numbered team selector); the subscription OAuth and the Prime browser challenge stay unported and report it), and the `/update` runner (`client_update.rs` — the out-of-band installer funnel with the output captured, the same body `prime-agent update` runs; `installer_update.rs` is that CLI command's own driver, `--check` included), plus the TS-parity staged update flow (`update_flow/`, `self_update.rs` — the `package update` self target's body, kept for the TS-parity package corpus). +Argument parsing matching the TS CLI exactly, mode selection (interactive/headless/json/daemon subcommands), binary wiring of crates into processes, exit codes and user-facing errors. The daemon-forensics CLI (`incident.rs`, TS `src/cli/incident.ts`): the `wv incident` timeline command — log-source discovery (agent.jsonl plus its `.old` rotation, falling back to the newest per-daemon log), `--since`/`--until` window and `--session` filter parsing, and the report rendering; the shared classifier lives in pa-types (`pa_types::incident`) and the agents-view notice in pa-tui. Client-side MCP auth flows (`mcp_login.rs`): the `/mcp login`/`/mcp logout` hook the TUI calls — the TS interactive client's placement — resolving a server (settings `mcpServers` + the builtin catalog), running the pa-core OAuth login on the suspended terminal, and persisting through the shared auth store. The same placement serves the TUI's client-command hooks: provider auth (`provider_login.rs` — the `/login`/`/logout` catalog, the API-key store, the MCP device flow, the Prime Inference terminal login (`prime_inference_login.rs` — the API-key flow: prime-cli credential reuse, the paste prompt with the whoami access check, the numbered team selector); the subscription OAuth and the Prime browser challenge stay unported and report it), and the `/update` runner (`client_update.rs` — the out-of-band installer funnel with the output captured, the same body `wv update` runs; `installer_update.rs` is that CLI command's own driver, `--check` included), plus the TS-parity staged update flow (`update_flow/`, `self_update.rs` — the `package update` self target's body, kept for the TS-parity package corpus). ## Non-goals No business logic; it composes pa-daemon, pa-core, pa-tui, pa-ai via their public APIs only. ## Public API -The `prime-agent` executable surface (flags, subcommands, exit codes). Internal lib types `pub(crate)`, plus the daemon wiring (`interactive_mode::{ensure_daemon_running, ensure_daemon_running_with, resolve_socket_path}`) exported for the integration verifier. +The `wv` executable surface (flags, subcommands, exit codes). Internal lib types `pub(crate)`, plus the daemon wiring (`interactive_mode::{ensure_daemon_running, ensure_daemon_running_with, resolve_socket_path}`) exported for the integration verifier. ## Depends on pa-types, pa-ai, pa-agent, pa-core, pa-daemon, pa-tui (one-way, composition root). @@ -51,7 +51,7 @@ prompt wait (the raw error to stderr, exit 1, no later prompts). Client commands (`/model`, `/tree`, ...) and unknown slash input are rejected in headless mode instead of becoming model prompts. Active native plugin commands use the same core executor. `/reload` reconciles the plugin host without command history rows; -`prime-agent prompt` includes its active contribution inventory. Dynamic +`wv prompt` includes its active contribution inventory. Dynamic `context_contribution` instructions are evaluated at the model boundary; the prompt dump does not preview them. Print mode joins admitted plugin jobs before the next input or process exit, @@ -90,7 +90,7 @@ test-created fixture directories only. ## Update flow (staged activation) -`prime-agent update` (the `update_flow` module): the invoking CLI plans, downloads, and +`wv update` (the `update_flow` module): the invoking CLI plans, downloads, and stages the candidate (`Acquire`..`Staged`), then spawns the detached coordinator - the new binary running from its release dir - which adopts the status file and owns the FSM to a terminal state (`Preparing..Complete`, diff --git a/crates/pa-cli/src/args.rs b/crates/pa-cli/src/args.rs index 96740dc01..7effa2a60 100644 --- a/crates/pa-cli/src/args.rs +++ b/crates/pa-cli/src/args.rs @@ -260,7 +260,7 @@ pub fn parse_args(args: &[String]) -> Args { "--export" => { if !internal_runtime_command { result.diagnostics.push(Diagnostic::error( - "--export was removed. Use \"prime-agent session export [output]\".", + "--export was removed. Use \"wv session export [output]\".", )); if let Some(next) = args.get(i + 1) { if !next.starts_with('-') { @@ -312,7 +312,7 @@ pub fn parse_args(args: &[String]) -> Args { .is_some_and(|next| !next.starts_with('-') && !next.starts_with('@')); if !internal_runtime_command { result.diagnostics.push(Diagnostic::error( - "--list-models was removed. Use \"prime-agent model list [search]\".", + "--list-models was removed. Use \"wv model list [search]\".", )); if has_search { i += 1; @@ -337,12 +337,12 @@ pub fn parse_args(args: &[String]) -> Args { } _ if arg.starts_with("--export=") => { result.diagnostics.push(Diagnostic::error( - "--export was removed. Use \"prime-agent session export [output]\".", + "--export was removed. Use \"wv session export [output]\".", )); } _ if arg.starts_with("--list-models=") => { result.diagnostics.push(Diagnostic::error( - "--list-models was removed. Use \"prime-agent model list [search]\".", + "--list-models was removed. Use \"wv model list [search]\".", )); } _ if arg.starts_with('@') => { @@ -451,7 +451,7 @@ mod tests { let parsed = parse(&["--export", "foo"]); assert_eq!( last_error(&parsed), - "--export was removed. Use \"prime-agent session export [output]\"." + "--export was removed. Use \"wv session export [output]\"." ); let marker: Vec = vec![ INTERNAL_RUNTIME_COMMAND_MARKER.into(), diff --git a/crates/pa-cli/src/bin/pa-tui-replay.rs b/crates/pa-cli/src/bin/pa-tui-replay.rs index d36e34c4a..1a3b4988d 100644 --- a/crates/pa-cli/src/bin/pa-tui-replay.rs +++ b/crates/pa-cli/src/bin/pa-tui-replay.rs @@ -26,10 +26,7 @@ use pa_tui::theme::{ColorMode, Theme}; use pa_tui::view::AgentView; #[derive(Parser, Debug)] -#[command( - name = "pa-tui-replay", - about = "Replay a prime-agent session in the TUI" -)] +#[command(name = "pa-tui-replay", about = "Replay a wv session in the TUI")] struct Args { /// Path to the session JSONL file (defaults to the newest session). session: Option, diff --git a/crates/pa-cli/src/client_update.rs b/crates/pa-cli/src/client_update.rs index 826708a6c..ada616f62 100644 --- a/crates/pa-cli/src/client_update.rs +++ b/crates/pa-cli/src/client_update.rs @@ -2,7 +2,7 @@ //! output captured — the TUI stays mounted while the install runs, so the //! installer's own progress never writes to the live frame, and the //! failure tail becomes the error row's message. It follows the same -//! update channel as `prime-agent update`. Both surfaces consult the +//! update channel as `wv update`. Both surfaces consult the //! same pa-core Homebrew detector before entering the installer funnel. use pa_core::update::homebrew; diff --git a/crates/pa-cli/src/command_registry.rs b/crates/pa-cli/src/command_registry.rs index 82852276d..de321ccf1 100644 --- a/crates/pa-cli/src/command_registry.rs +++ b/crates/pa-cli/src/command_registry.rs @@ -231,15 +231,15 @@ pub const COMMAND_SPECS: &[CommandSpec] = &[ "--source The https:// origin recorded as the release's install source (managed installs; required there with --archive)", ]) .description( - "Move from the TypeScript version to the Rust port in one step: `prime-agent update` \ - fetches the update channel's installer (stable: \ - https://app.primeintellect.ai/prime-agent/install.sh; nightly: install-beta.sh from the \ - release download base — never a GitHub raw or workflow URL) and runs it, which \ - uninstalls the TypeScript version and installs the latest Rust build; your sessions and \ - configuration (~/.prime/agent) are never touched. Restart prime-agent after the update \ - to run the new build. This command exists only in the Rust binary — the TypeScript \ - version does not have it; the move happens when you run the installer's curl|sh URL (the \ - README's Install section) or `prime-agent update` (after the Rust install exists).", + "Move from the TypeScript version to the Rust port in one step: `wv update` \ + fetches the update channel's installer (stable: install.sh from the release \ + download base; nightly: install-beta.sh — never a GitHub raw or workflow URL) \ + and runs it, which uninstalls the TypeScript version and installs the latest \ + Rust build; your sessions and configuration (~/.prime/agent) are never touched. \ + Restart wv after the update to run the new build. This command exists only in \ + the Rust binary — the TypeScript version does not have it; the move happens \ + when you run the installer's curl|sh URL or `wv update` (after the Rust install \ + exists).", ), CommandSpec::new(&["model"], "model list [search]", "Inspect available models"), CommandSpec::new(&["model", "list"], "model list [search]", "List available models"), diff --git a/crates/pa-cli/src/config.rs b/crates/pa-cli/src/config.rs index 2ba269a6b..1260bbebe 100644 --- a/crates/pa-cli/src/config.rs +++ b/crates/pa-cli/src/config.rs @@ -2,7 +2,7 @@ use std::path::PathBuf; -pub const APP_NAME: &str = "prime-agent"; +pub const APP_NAME: &str = "wv"; pub const CONFIG_DIR_NAME: &str = ".prime/agent"; diff --git a/crates/pa-cli/src/config_command.rs b/crates/pa-cli/src/config_command.rs index e24e11304..6d67054ea 100644 --- a/crates/pa-cli/src/config_command.rs +++ b/crates/pa-cli/src/config_command.rs @@ -1,4 +1,4 @@ -//! `prime-agent config`: the resource-configuration view — resolve session +//! `wv config`: the resource-configuration view — resolve session //! resources, report settings errors, then open the interactive selector. use std::path::PathBuf; diff --git a/crates/pa-cli/src/daemon_client.rs b/crates/pa-cli/src/daemon_client.rs index 683d1d10b..27a62fc21 100644 --- a/crates/pa-cli/src/daemon_client.rs +++ b/crates/pa-cli/src/daemon_client.rs @@ -40,7 +40,7 @@ impl DaemonClient { pub(crate) fn connect(socket_path: &Path) -> Result { Self::connect_raw(socket_path).map_err(|error| { anyhow!( - "Failed to connect to the Prime Agent daemon: {}. {}", + "Failed to connect to the Weave daemon: {}. {}", node_connect_error(&error, socket_path), endpoint_details(socket_path) ) @@ -87,7 +87,7 @@ impl DaemonClient { let protocol = daemon_protocol(&hello)?; if protocol.version < DAEMON_PROTOCOL_VERSION { return Err(anyhow!( - "The running Prime Agent daemon does not support {command_type}." + "The running Weave daemon does not support {command_type}." )); } self.request_id += 1; @@ -179,7 +179,7 @@ impl DaemonClient { .map(|reason| format!(" Reason: {reason}.")) .unwrap_or_default(); return Err(anyhow!( - "Connection to the Prime Agent daemon closed.{reason} {}", + "Connection to the Weave daemon closed.{reason} {}", endpoint_details(&self.socket_path) )); } @@ -221,9 +221,9 @@ enum Operation<'a> { impl Operation<'_> { fn wait_description(&self) -> String { match self { - Operation::Handshake => "waiting for the Prime Agent daemon handshake".to_string(), + Operation::Handshake => "waiting for the Weave daemon handshake".to_string(), Operation::Command(command_type) => { - format!("waiting for the Prime Agent daemon response to \"{command_type}\"") + format!("waiting for the Weave daemon response to \"{command_type}\"") } } } @@ -311,7 +311,7 @@ mod tests { let error = DaemonClient::connect(&socket).unwrap_err(); let text = error.to_string(); assert!( - text.starts_with("Failed to connect to the Prime Agent daemon: connect ENOENT "), + text.starts_with("Failed to connect to the Weave daemon: connect ENOENT "), "{text}" ); assert!(text.contains("Socket: "), "{text}"); @@ -344,7 +344,7 @@ mod tests { let error = client.request(list_command("daemon_1")).unwrap_err(); let text = error.to_string(); assert!( - text.starts_with("Connection to the Prime Agent daemon closed. Reason: shutdown."), + text.starts_with("Connection to the Weave daemon closed. Reason: shutdown."), "{text}" ); assert!(text.contains("Socket: "), "{text}"); diff --git a/crates/pa-cli/src/daemon_command.rs b/crates/pa-cli/src/daemon_command.rs index b6a1685f9..245ebc6d2 100644 --- a/crates/pa-cli/src/daemon_command.rs +++ b/crates/pa-cli/src/daemon_command.rs @@ -258,7 +258,7 @@ fn list_command(all: bool) -> DaemonCommand { } } -/// The same list RPC as `prime-agent list`, rendered as the +/// The same list RPC as `wv list`, rendered as the /// one-line-per-agent operator table. fn run_sessions(client: &mut DaemonClient, args: &[String], json: bool) -> Result<()> { if args.first().map(String::as_str) == Some("delete") { @@ -596,7 +596,7 @@ fn run_rename(client: &mut DaemonClient, args: &[String], json: bool) -> Result< let active_session_id = require_active_session_id(args)?; let name = args[1..].join(" ").trim().to_string(); if name.is_empty() { - bail!("Usage: prime-agent rename "); + bail!("Usage: wv rename "); } let response = client.request(DaemonCommand::Rename { id: None, @@ -725,14 +725,14 @@ fn parse_send_args(args: &[String]) -> Result { message_parts.push(arg.to_string()); } if explicit_message.is_some() && !message_parts.is_empty() { - bail!("Usage: prime-agent send [--from ] [--message |]"); + bail!("Usage: wv send [--from ] [--message |]"); } let message = explicit_message .unwrap_or_else(|| message_parts.join(" ")) .trim() .to_string(); if target_active_session_id.is_none() || message.is_empty() { - bail!("Usage: prime-agent send [--from ] [--message |]"); + bail!("Usage: wv send [--from ] [--message |]"); } Ok(ParsedSendArgs { target_active_session_id: target_active_session_id.expect("checked above"), @@ -787,7 +787,7 @@ fn run_cron_list(client: &mut DaemonClient, args: &[String], json: bool) -> Resu } fn run_cron_add(client: &mut DaemonClient, args: &[String], json: bool) -> Result<()> { - let usage = "Usage: prime-agent schedule add -- "; + let usage = "Usage: wv schedule add -- "; let separator = args .iter() .position(|arg| arg == "--") @@ -825,7 +825,7 @@ fn run_cron_add(client: &mut DaemonClient, args: &[String], json: bool) -> Resul fn run_cron_cancel(client: &mut DaemonClient, args: &[String], json: bool) -> Result<()> { let Some(job_id) = args.get(1) else { - bail!("Usage: prime-agent schedule cancel "); + bail!("Usage: wv schedule cancel "); }; let response = client.request(DaemonCommand::CronCancel { id: None, diff --git a/crates/pa-cli/src/daemon_discovery/mod.rs b/crates/pa-cli/src/daemon_discovery/mod.rs index 3736f10e2..e826ad569 100644 --- a/crates/pa-cli/src/daemon_discovery/mod.rs +++ b/crates/pa-cli/src/daemon_discovery/mod.rs @@ -53,10 +53,10 @@ pub(crate) struct DaemonStateRoot { /// protection silently disappears at uid 0. pub(crate) const NEVER_TOUCH_SOCKET_DIRS: &[&str] = &[ "/tmp/prime-agent-1000", - "/tmp/mission-tmp/prime-agent-1000", + "/tmp/mission-tmp/wv-1000", "/tmp/mission-daemon", "/tmp/prime-agent-0", - "/tmp/mission-tmp/prime-agent-0", + "/tmp/mission-tmp/wv-0", ]; pub(crate) fn is_never_touch(path: &Path) -> bool { @@ -652,7 +652,7 @@ mod tests { #[test] fn a_scan_rooted_on_a_never_touch_dir_surfaces_no_listeners() { // The ambient mission daemon's workers listen under these dirs, owned - // by real `prime-agent` processes: root matching alone would find them. + // by real `wv` processes: root matching alone would find them. for dir in NEVER_TOUCH_SOCKET_DIRS { let dir = *dir; let root = DaemonStateRoot { diff --git a/crates/pa-cli/src/daemon_discovery/plan.rs b/crates/pa-cli/src/daemon_discovery/plan.rs index e01ef373d..4677e2a4a 100644 --- a/crates/pa-cli/src/daemon_discovery/plan.rs +++ b/crates/pa-cli/src/daemon_discovery/plan.rs @@ -56,8 +56,7 @@ pub(crate) fn plan_reap(daemons: &[DaemonInfo], force: bool) -> Vec kind: ReapActionKind::Skip, daemon: daemon.clone(), reason: Some( - r#"unreachable; use "prime-agent shutdown --force" to stop it"# - .to_string(), + r#"unreachable; use "wv shutdown --force" to stop it"#.to_string(), ), }; } @@ -220,7 +219,7 @@ mod tests { assert_eq!(kinds(&without), vec![ReapActionKind::Skip]); assert_eq!( without[0].reason.as_deref(), - Some(r#"unreachable; use "prime-agent shutdown --force" to stop it"#) + Some(r#"unreachable; use "wv shutdown --force" to stop it"#) ); let with = plan_reap(&daemons, true); assert_eq!(kinds(&with), vec![ReapActionKind::Kill]); diff --git a/crates/pa-cli/src/daemon_discovery/scan.rs b/crates/pa-cli/src/daemon_discovery/scan.rs index ba743d49a..5fa924fad 100644 --- a/crates/pa-cli/src/daemon_discovery/scan.rs +++ b/crates/pa-cli/src/daemon_discovery/scan.rs @@ -428,8 +428,8 @@ mod tests { #[cfg(target_os = "linux")] #[test] fn proc_and_ss_parsers_agree_on_one_listener() { - let ss_line = "u_str LISTEN 0 4096 /tmp/agent/daemon.sock 21049121 * 0 users:((\"prime-agent\",pid=123,fd=14))\n"; - let ss = parse_ss_listeners(ss_line, "prime-agent"); + let ss_line = "u_str LISTEN 0 4096 /tmp/agent/daemon.sock 21049121 * 0 users:((\"wv\",pid=123,fd=14))\n"; + let ss = parse_ss_listeners(ss_line, "wv"); let proc_rows = parse_proc_net_unix( b"Num RefCount Protocol Flags Type St Inode Path\n0000000047ecc27d: 00000002 00000000 00010000 0001 01 9703 /tmp/agent/daemon.sock\n", ); @@ -445,6 +445,6 @@ mod tests { #[test] fn ss_parse_skips_foreign_process_names() { let sample = "u_str LISTEN 0 4096 /tmp/bus.sock 1 * 0 users:((\"dbus-daemon\",pid=7,fd=3))\n"; - assert!(parse_ss_listeners(sample, "prime-agent").is_empty()); + assert!(parse_ss_listeners(sample, "wv").is_empty()); } } diff --git a/crates/pa-cli/src/daemon_discovery/stop.rs b/crates/pa-cli/src/daemon_discovery/stop.rs index 4dc076b4b..765e6042b 100644 --- a/crates/pa-cli/src/daemon_discovery/stop.rs +++ b/crates/pa-cli/src/daemon_discovery/stop.rs @@ -160,8 +160,7 @@ pub(crate) fn run_shutdown_all(json: bool, force: bool, root: &DaemonStateRoot) .map(|daemon| { ( daemon.socket_path.display().to_string(), - r#"confirmation required; use "prime-agent shutdown --force --json""# - .to_string(), + r#"confirmation required; use "wv shutdown --force --json""#.to_string(), ) }) .collect(); @@ -172,7 +171,7 @@ pub(crate) fn run_shutdown_all(json: bool, force: bool, root: &DaemonStateRoot) // The public-command wrapper turns the throw into the standard `Error: …` // failure (stderr + exit 1); only reachable once there are daemons to stop. eprintln!( - "Error: Shutdown requires confirmation in an interactive terminal. Use \"prime-agent shutdown --force\"." + "Error: Shutdown requires confirmation in an interactive terminal. Use \"wv shutdown --force\"." ); 1 } diff --git a/crates/pa-cli/src/incident/mod.rs b/crates/pa-cli/src/incident/mod.rs index 88f44e20b..b888a7f2b 100644 --- a/crates/pa-cli/src/incident/mod.rs +++ b/crates/pa-cli/src/incident/mod.rs @@ -1,4 +1,4 @@ -//! `prime-agent incident`: reconstructs what the daemon did during a time +//! `wv incident`: reconstructs what the daemon did during a time //! window from its diagnostic logs (the shared classifier lives in //! `pa_types::incident`). The primary source is the shared structured log //! (`~/.prime/agent/logs/agent.jsonl` plus its `.old` rotation); when it is @@ -292,7 +292,7 @@ pub(crate) fn incident_report_text( Ok(Some(report.text)) } -/// Entry point for `prime-agent incident`; prints the timeline (or the +/// Entry point for `wv incident`; prints the timeline (or the /// missing-logs message) to stdout. A passed-back window resolves relative /// `HH:MM` bounds exactly once. /// diff --git a/crates/pa-cli/src/incident/report.rs b/crates/pa-cli/src/incident/report.rs index a38ef481f..db8847e8e 100644 --- a/crates/pa-cli/src/incident/report.rs +++ b/crates/pa-cli/src/incident/report.rs @@ -199,7 +199,7 @@ pub(crate) fn build_incident_report( sections.push(vec![title.to_string()].into_iter().chain(lines).collect()); } - let mut header = vec!["Prime Agent incident timeline".to_string()]; + let mut header = vec!["Weave incident timeline".to_string()]; header.push(format!( "Window: {} → {} UTC ({})", format_incident_time(options.since_ms), diff --git a/crates/pa-cli/src/incident/report_tests.rs b/crates/pa-cli/src/incident/report_tests.rs index d14f1fe1c..f1528ce16 100644 --- a/crates/pa-cli/src/incident/report_tests.rs +++ b/crates/pa-cli/src/incident/report_tests.rs @@ -54,7 +54,7 @@ fn worker_start_line(ts: &str, socket_path: &str, pid: i64) -> String { "component": "coding-agent.daemon", "socketPath": socket_path, "pid": pid, - "msg": format!("Prime Agent daemon listening on {socket_path}"), + "msg": format!("Weave daemon listening on {socket_path}"), }) .to_string() } @@ -196,12 +196,12 @@ fn a_clean_run_shows_no_anomalies() { let text = report_for(&[ supervisor_line( "2026-09-10T20:00:05.000Z", - "Prime Agent daemon supervisor e14de15c listening on /tmp/prime-agent-501/daemon.sock", + "Weave daemon supervisor e14de15c listening on /tmp/prime-agent-501/daemon.sock", &json!({}), ), supervisor_line( "2026-09-10T20:01:00.000Z", - "Session worker 477fef4e85a8 stderr: Prime Agent daemon listening on /tmp/prime-agent-501/worker-a-477fef4e85a8.sock", + "Session worker 477fef4e85a8 stderr: Weave daemon listening on /tmp/prime-agent-501/worker-a-477fef4e85a8.sock", &json!({}), ), supervisor_line("2026-09-10T20:02:00.000Z", "Migrated 2 scheduled jobs into session artifacts", &json!({})), @@ -415,13 +415,13 @@ fn the_report_layout_matches_the_ts_shape() { let options = default_options(); let lines = vec![supervisor_line( "2026-09-10T20:00:05.000Z", - "Prime Agent daemon supervisor e14de15c listening on /tmp/prime-agent-501/daemon.sock", + "Weave daemon supervisor e14de15c listening on /tmp/prime-agent-501/daemon.sock", &json!({}), )]; let text = build_incident_report(&entries(&lines), &options).text; let severity = format!("{:<8}", "info"); let expected = [ - "Prime Agent incident timeline", + "Weave incident timeline", "Window: 09-10 20:00:00 → 09-10 20:30:00 UTC (30m)", "", "Supervisor events", diff --git a/crates/pa-cli/src/incident/source_tests.rs b/crates/pa-cli/src/incident/source_tests.rs index 2df50afdf..1579113e3 100644 --- a/crates/pa-cli/src/incident/source_tests.rs +++ b/crates/pa-cli/src/incident/source_tests.rs @@ -71,7 +71,7 @@ fn keeps_structured_lines_around_a_torn_multibyte_tail() { with_agent_dir(|agent_dir| { let listening = supervisor_line( "2026-09-10T20:02:39.764Z", - "Prime Agent daemon supervisor e14de15c listening on /tmp/prime-agent-501/daemon.sock", + "Weave daemon supervisor e14de15c listening on /tmp/prime-agent-501/daemon.sock", ); // The stderr-forward classifier keys on a 12-hex worker id // (STDERR_FORWARD), so the fixture carries one. diff --git a/crates/pa-cli/src/installer_update.rs b/crates/pa-cli/src/installer_update.rs index 02d623a80..e5bfd1de8 100644 --- a/crates/pa-cli/src/installer_update.rs +++ b/crates/pa-cli/src/installer_update.rs @@ -1,8 +1,7 @@ -//! The `prime-agent update` body: the TS->Rust migration path. One step — -//! the update fetches the update channel's installer (stable: the official -//! domain's `https://app.primeintellect.ai/prime-agent/install.sh`; -//! nightly: the download base's `install-beta.sh`; never a GitHub raw or -//! workflow URL) and runs it; the script uninstalls the +//! The `wv update` body: the TS->Rust migration path. One step — +//! the update fetches the update channel's installer (stable: the release +//! download base's `install.sh`; nightly: its `install-beta.sh`; never a +//! GitHub raw or workflow URL) and runs it; the script uninstalls the //! TypeScript version, installs the latest Rust build of the update //! channel, and never touches `~/.prime/agent` (the sessions and //! configuration). The TUI's `/update` runs the same core out-of-band @@ -127,12 +126,10 @@ pub fn run(options: &UpdateOptions) -> i32 { Ok(installed) => { match installed.version { Some(version) => { - println!("updated to {version} — restart prime-agent to run the new build"); + println!("updated to {version} — restart wv to run the new build"); } None => { - println!( - "updated to the latest build — restart prime-agent to run the new build" - ); + println!("updated to the latest build — restart wv to run the new build"); } } if let Some(channel) = options.channel { @@ -200,7 +197,7 @@ pub fn run_local(prefix: &std::path::Path, archive: Option<&std::path::Path>) -> "rolled back to" }; let version = installed.version.as_deref().unwrap_or("the previous build"); - println!("{done} {version} — restart prime-agent to run it"); + println!("{done} {version} — restart wv to run it"); 0 } Err(failure) => { @@ -293,9 +290,9 @@ fn check_verdict( ); } let command = match flag { - Some(UpdateChannel::Nightly) => "prime-agent update --nightly", - Some(UpdateChannel::Stable) => "prime-agent update --stable", - None => "prime-agent update", + Some(UpdateChannel::Nightly) => "wv update --nightly", + Some(UpdateChannel::Stable) => "wv update --stable", + None => "wv update", }; format!("An update is available — run `{command}` to install it.") } @@ -313,7 +310,7 @@ mod tests { version: version.to_string(), artifacts: vec![ReleaseArtifact { platform: platform.to_string(), - file: format!("prime-agent-{version}-{platform}.tar.gz"), + file: format!("wv-{version}-{platform}.tar.gz"), sha256: "0".repeat(64), }], } @@ -327,7 +324,7 @@ mod tests { ); assert_eq!( check_verdict(&release("1.2.4"), "1.2.3", UpdateChannel::Stable, None), - "An update is available — run `prime-agent update` to install it." + "An update is available — run `wv update` to install it." ); // A switch onto nightly accepts the same-base prerelease the // installer would install. @@ -338,7 +335,7 @@ mod tests { UpdateChannel::Nightly, Some(UpdateChannel::Nightly) ), - "An update is available — run `prime-agent update --nightly` to install it." + "An update is available — run `wv update --nightly` to install it." ); assert_eq!( check_verdict( diff --git a/crates/pa-cli/src/interactive_mode.rs b/crates/pa-cli/src/interactive_mode.rs index 3b0ab8e25..2092778b0 100644 --- a/crates/pa-cli/src/interactive_mode.rs +++ b/crates/pa-cli/src/interactive_mode.rs @@ -42,7 +42,7 @@ pub fn run_interactive_mode(options: &RunOptions) -> Result { .context("build the interactive runtime")?; runtime.block_on(async { ensure_daemon_running(&tui_options.socket_path, &tui_options.cwd).await?; - // `prime-agent agents` and bare `--resume` open the agents view + // `wv agents` and bare `--resume` open the agents view // (TS `agentsViewRequested`); the view then opens sessions, and a // session exits back into the view until the user exits it. TS gates // the explicit `agents` request on completed onboarding (a fresh @@ -372,7 +372,7 @@ fn build_tui_options( config.agent_dir.clone(), )), )), - // `/update`: the same body `prime-agent update` runs, output + // `/update`: the same body `wv update` runs, output // captured — the TUI stays mounted. update_commands: Some(pa_tui::update_command::UpdateCommandsHandle( std::sync::Arc::new(crate::client_update::ClientUpdate), diff --git a/crates/pa-cli/src/interactive_mode/daemon.rs b/crates/pa-cli/src/interactive_mode/daemon.rs index 7c2cfd932..cf2387c24 100644 --- a/crates/pa-cli/src/interactive_mode/daemon.rs +++ b/crates/pa-cli/src/interactive_mode/daemon.rs @@ -93,7 +93,7 @@ async fn probe_daemon(socket_path: &Path) -> Result { fn refuse_peer(socket_path: &Path, reason: &str) -> anyhow::Error { anyhow!( - "The Prime Agent Rust client cannot use the peer on selected socket {}: {reason}. No shutdown or replacement was attempted. Select a separate private socket with --daemon-socket, or use the matching client for that runtime.", + "The Weave Rust client cannot use the peer on selected socket {}: {reason}. No shutdown or replacement was attempted. Select a separate private socket with --daemon-socket, or use the matching client for that runtime.", socket_path.display() ) } @@ -110,7 +110,7 @@ pub async fn ensure_daemon_running(socket_path: &Path, spawn_cwd: &Path) -> Resu if matches!(probe_daemon(socket_path).await?, DaemonProbe::Current) { return Ok(()); } - let exe = std::env::current_exe().context("resolve the prime-agent executable")?; + let exe = std::env::current_exe().context("resolve the wv executable")?; ensure_daemon_running_with(&exe, socket_path, spawn_cwd).await } @@ -136,7 +136,7 @@ pub async fn ensure_daemon_running_with( } if Instant::now() > deadline { return Err(anyhow!( - "Timed out waiting for the Prime Agent Rust daemon to start on selected socket {}. Check the selected socket and daemon diagnostics, then retry.", + "Timed out waiting for the Weave Rust daemon to start on selected socket {}. Check the selected socket and daemon diagnostics, then retry.", socket_path.display() )); } @@ -166,6 +166,6 @@ fn spawn_supervisor_detached(socket_path: &Path, spawn_cwd: &Path, exe: &Path) - pa_core::platform::process::set_new_process_group(&mut command); command .spawn() - .with_context(|| format!("spawn the Prime Agent daemon on {}", socket_path.display()))?; + .with_context(|| format!("spawn the Weave daemon on {}", socket_path.display()))?; Ok(()) } diff --git a/crates/pa-cli/src/interactive_mode/daemon_tests.rs b/crates/pa-cli/src/interactive_mode/daemon_tests.rs index a4f8b30de..ca7a98c47 100644 --- a/crates/pa-cli/src/interactive_mode/daemon_tests.rs +++ b/crates/pa-cli/src/interactive_mode/daemon_tests.rs @@ -91,7 +91,7 @@ async fn start_peer(socket: &Path, hello: String) -> (oneshot::Sender<()>, JoinH fn assert_refusal(error: &anyhow::Error, socket: &Path) { let message = error.to_string(); - assert!(message.contains("Prime Agent Rust client"), "{message}"); + assert!(message.contains("Weave Rust client"), "{message}"); assert!(message.contains(&socket.display().to_string()), "{message}"); assert!(message.contains("--daemon-socket"), "{message}"); assert!( diff --git a/crates/pa-cli/src/interactive_mode/tests.rs b/crates/pa-cli/src/interactive_mode/tests.rs index 42f599bfc..cd77af15b 100644 --- a/crates/pa-cli/src/interactive_mode/tests.rs +++ b/crates/pa-cli/src/interactive_mode/tests.rs @@ -550,7 +550,7 @@ fn fork_startup_selection_reports_the_ts_contracts() { "unexpected error: {rendered}" ); assert!( - rendered.contains("Open prime-agent and press left-arrow to browse sessions."), + rendered.contains("Open Weave and press left-arrow to browse sessions."), "unexpected error: {rendered}" ); } diff --git a/crates/pa-cli/src/lib.rs b/crates/pa-cli/src/lib.rs index f83d92a10..6e247426e 100644 --- a/crates/pa-cli/src/lib.rs +++ b/crates/pa-cli/src/lib.rs @@ -10,7 +10,7 @@ clippy::cast_precision_loss )] -//! pa-cli: the `prime-agent` binary. The argument surface, command routing, +//! pa-cli: the `wv` binary. The argument surface, command routing, //! help output, and validation are faithful ports of the TypeScript product. // Internal ported modules are crate-private: the only public API is the @@ -60,7 +60,7 @@ pub(crate) mod sessions_table_format; pub(crate) mod subscription_login; /// The runtime boundary: everything a mode-runner crate implements to plug -/// into the `prime-agent` binary, plus the entry point that drives it. +/// into the `wv` binary, plus the entry point that drives it. pub use mode::{AppMode, MissingSubsystem, RunOptions, Runtime, UnavailableRuntime}; pub(crate) mod piped_stdin; pub(crate) mod print_boundary; diff --git a/crates/pa-cli/src/list_models.rs b/crates/pa-cli/src/list_models.rs index 575c15f16..54741ae6a 100644 --- a/crates/pa-cli/src/list_models.rs +++ b/crates/pa-cli/src/list_models.rs @@ -1,4 +1,4 @@ -//! `prime-agent model list [search]`: the models catalog table — registry +//! `wv model list [search]`: the models catalog table — registry //! refresh, fuzzy search, and the columns rendered. use crate::mode::RunOptions; diff --git a/crates/pa-cli/src/package_command.rs b/crates/pa-cli/src/package_command.rs index f1e5ba288..25d4826c0 100644 --- a/crates/pa-cli/src/package_command.rs +++ b/crates/pa-cli/src/package_command.rs @@ -316,13 +316,13 @@ fn parse_package_command(args: &[String]) -> Option { && (extensions_flag || extension_flag_source.is_some() || positional_source_not_self) { options.conflicting_options = - Some("--rollback only applies to Prime Agent itself".to_string()); + Some("--rollback only applies to Weave itself".to_string()); } if channel.is_some() && (extensions_flag || extension_flag_source.is_some() || positional_source_not_self) { options.conflicting_options.get_or_insert_with(|| { - "--nightly and --stable only apply to Prime Agent itself".to_string() + "--nightly and --stable only apply to Weave itself".to_string() }); } } diff --git a/crates/pa-cli/src/print_runtime.rs b/crates/pa-cli/src/print_runtime.rs index e9bb41cd5..8556d7ba1 100644 --- a/crates/pa-cli/src/print_runtime.rs +++ b/crates/pa-cli/src/print_runtime.rs @@ -90,7 +90,7 @@ fn run_acp_mode(options: &RunOptions) -> Result { async fn acp_mode_main(options: &RunOptions) -> Result { // Flag > env > default: the same `PRIME_AGENT_DAEMON_SOCKET` contract - // as every other mode (the `prime-agent` launcher written by + // as every other mode (the `wv` launcher written by // install-rust.sh pins that env, so the ACP path must honor it or it // would target the TypeScript default socket and treat the schema // mismatch as a stale daemon). @@ -1368,7 +1368,7 @@ fn stored_session_cwd( pub(crate) fn render_selector_error(error: &SessionSelectorError) -> String { format!( - "{}.{}\nOpen prime-agent and press left-arrow to browse sessions.", + "{}.{}\nOpen Weave and press left-arrow to browse sessions.", error.message(), error.suggestion().unwrap_or_default() ) diff --git a/crates/pa-cli/src/prompt_command.rs b/crates/pa-cli/src/prompt_command.rs index 41a8a1332..9dedfc11e 100644 --- a/crates/pa-cli/src/prompt_command.rs +++ b/crates/pa-cli/src/prompt_command.rs @@ -1,4 +1,4 @@ -//! `prime-agent prompt`: dump the fully-assembled effective system prompt with +//! `wv prompt`: dump the fully-assembled effective system prompt with //! its per-layer breakdown, without a provider call or persisted session. use pa_core::resources::{load_resources, ResourceLoaderOptions}; @@ -48,7 +48,7 @@ pub fn run_prompt_command(args: &[String]) -> i32 { Err(help_request) if help_request.is_empty() => return 0, Err(error) => { eprintln!("Error: {error}"); - eprintln!("Run `prime-agent help prompt` for usage."); + eprintln!("Run `wv help prompt` for usage."); return 1; } }; @@ -174,7 +174,7 @@ fn assemble_breakdown( } fn print_text(breakdown: &pa_core::prompts::SystemPromptBreakdown) { - println!("# prime-agent system prompt breakdown"); + println!("# weave system prompt breakdown"); println!(); println!("cached prefix (static layers, byte-stable across sessions):"); for segment in &breakdown.segments { @@ -267,7 +267,7 @@ mod tests { let dir = tempfile::tempdir().unwrap(); let (breakdown, errors) = assemble_breakdown(dir.path(), Some("mock/mock-1")).unwrap(); assert!(errors.is_empty()); - assert!(breakdown.assembled.starts_with("# prime-agent harness")); + assert!(breakdown.assembled.starts_with("# weave harness")); assert!(breakdown .assembled .contains("Recursive agent depth: 0 (root)")); diff --git a/crates/pa-cli/src/provider_login.rs b/crates/pa-cli/src/provider_login.rs index 8c450e06f..74af24a53 100644 --- a/crates/pa-cli/src/provider_login.rs +++ b/crates/pa-cli/src/provider_login.rs @@ -182,7 +182,7 @@ fn ts_row_order(a: &ProviderRow, b: &ProviderRow) -> std::cmp::Ordering { /// Subscription requests identify as Claude Code, which may violate Anthropic's terms; an API key /// avoids the risk (#2645). -const ANTHROPIC_SUBSCRIPTION_AUTH_WARNING: &str = "Anthropic subscription auth is active. Usage draws from your plan limits, but Prime Agent identifies as Claude Code and this may violate Anthropic's terms — your account can be restricted or banned. An Anthropic API key avoids the risk. Manage usage at https://claude.ai/settings/usage."; +const ANTHROPIC_SUBSCRIPTION_AUTH_WARNING: &str = "Anthropic subscription auth is active. Usage draws from your plan limits, but Weave identifies as Claude Code and this may violate Anthropic's terms — your account can be restricted or banned. An Anthropic API key avoids the risk. Manage usage at https://claude.ai/settings/usage."; /// The provider auth surface against one daemon's shared directories. #[derive(Clone)] diff --git a/crates/pa-cli/src/public_command.rs b/crates/pa-cli/src/public_command.rs index 004f8b87c..b456b03ad 100644 --- a/crates/pa-cli/src/public_command.rs +++ b/crates/pa-cli/src/public_command.rs @@ -242,11 +242,11 @@ fn reject_removed_command(args: &[String]) -> PublicCommandResult { let command = args.first().map(String::as_str).unwrap_or_default(); let subcommand = args.get(1).map(String::as_str); let replacement = match (command, subcommand) { - ("daemon", _) => Some("Run \"prime-agent help\" to see the agent commands.".to_string()), - ("app", Some("update")) => Some("Use \"prime-agent update\".".to_string()), - ("install", _) => Some("Use \"prime-agent package install\".".to_string()), - ("remove" | "uninstall", _) => Some("Use \"prime-agent package remove\".".to_string()), - ("manage", _) => Some("Use \"prime-agent agents\".".to_string()), + ("daemon", _) => Some("Run \"wv help\" to see the agent commands.".to_string()), + ("app", Some("update")) => Some("Use \"wv update\".".to_string()), + ("install", _) => Some("Use \"wv package install\".".to_string()), + ("remove" | "uninstall", _) => Some("Use \"wv package remove\".".to_string()), + ("manage", _) => Some("Use \"wv agents\".".to_string()), _ => None, }; let joined: Vec<&str> = args.iter().take(2).map(String::as_str).collect(); @@ -306,18 +306,12 @@ fn validate_schedule_args(args: &[String]) -> bool { continue; } if arg.starts_with('-') { - fail( - "Usage: prime-agent schedule list [--all] [agent] [--json]", - None, - ); + fail("Usage: wv schedule list [--all] [agent] [--json]", None); return false; } agent_count += 1; if agent_count > 1 { - fail( - "Usage: prime-agent schedule list [--all] [agent] [--json]", - None, - ); + fail("Usage: wv schedule list [--all] [agent] [--json]", None); return false; } } @@ -328,7 +322,7 @@ fn validate_schedule_args(args: &[String]) -> bool { if operands.len() == 1 && !operands[0].starts_with('-') { return true; } - fail("Usage: prime-agent schedule cancel ", None); + fail("Usage: wv schedule cancel ", None); return false; } true @@ -476,7 +470,7 @@ fn run_doctor(args: &[String]) -> PublicCommandResult { handled() } -/// `prime-agent incident` (TS `runIncidentCommand`): parse the options, +/// `wv incident` (TS `runIncidentCommand`): parse the options, /// resolve the window once, and print the timeline. fn run_incident_command(args: &[String]) -> PublicCommandResult { let options = match crate::incident::parse_incident_options(args) { @@ -536,13 +530,13 @@ fn run_package(args: &[String]) -> PublicCommandResult { let Some(subcommand) = args.first().map(String::as_str) else { return fail( "Missing package command.", - Some("Run \"prime-agent help package\" for usage.".to_string()), + Some("Run \"wv help package\" for usage.".to_string()), ); }; if subcommand == "uninstall" { return fail( "Unknown package command: uninstall", - Some("Use \"prime-agent package remove\".".to_string()), + Some("Use \"wv package remove\".".to_string()), ); } let children: Vec<&str> = get_child_command_specs(&["package"]) @@ -554,7 +548,7 @@ fn run_package(args: &[String]) -> PublicCommandResult { return fail( format!("Unknown package command: {subcommand}"), Some(suggestion.map_or_else( - || "Run \"prime-agent help package\" for usage.".to_string(), + || "Run \"wv help package\" for usage.".to_string(), |s| format!("Did you mean \"{APP_NAME} package {s}\"?"), )), ); @@ -568,7 +562,7 @@ fn run_package(args: &[String]) -> PublicCommandResult { arg == "--self" || arg == "--extensions" || arg == "--extension" || arg == "--force" }) { return fail( - "Package updates accept only an optional source. Use \"prime-agent update\" to update Prime Agent.", + "Package updates accept only an optional source. Use \"wv update\" to update Weave.", None, ); } @@ -577,7 +571,7 @@ fn run_package(args: &[String]) -> PublicCommandResult { } if let Some(source) = rest.first() { if is_self_update_source(source) { - return fail("Use \"prime-agent update\" to update Prime Agent.", None); + return fail("Use \"wv update\" to update Weave.", None); } } let mut package_args: Vec = vec!["update".to_string()]; diff --git a/crates/pa-cli/src/self_update.rs b/crates/pa-cli/src/self_update.rs index e0b9275ac..e97ab2c71 100644 --- a/crates/pa-cli/src/self_update.rs +++ b/crates/pa-cli/src/self_update.rs @@ -1,18 +1,18 @@ //! The self-update command core: the nightly-switch confirmation, the //! staged-activation update, and the completed-run channel persist. -//! `prime-agent update` and `prime-agent package update`'s self target +//! `wv update` and `wv package update`'s self target //! both run this one body, so the two entry points cannot diverge. use pa_core::update::version::UpdateChannel; -/// One parsed self-update invocation: `prime-agent update`'s options or the +/// One parsed self-update invocation: `wv update`'s options or the /// `package update` self target's. #[derive(Debug, Clone, Default, PartialEq, Eq)] pub struct SelfUpdateOptions { pub force: bool, pub rollback: bool, pub channel: Option, - /// The manual/direct install payload (`prime-agent update --archive`). + /// The manual/direct install payload (`wv update --archive`). pub archive: Option, /// The `http(s)://` origin recorded as the release's install source. pub source: Option, @@ -40,7 +40,7 @@ pub fn confirm_nightly_switch( return None; } println!( - "Nightly releases are unreleased Prime Agent builds. They can be broken, and a broken update can leave Prime Agent unusable until you roll back or reinstall." + "Nightly releases are unreleased Weave builds. They can be broken, and a broken update can leave Weave unusable until you roll back or reinstall." ); let abort_code = if std::env::var(crate::public_command::SELF_UPDATE_INTERACTIVE_CHILD_ENV) .as_deref() diff --git a/crates/pa-cli/src/session_export.rs b/crates/pa-cli/src/session_export.rs index de0b45c0b..a5d29c238 100644 --- a/crates/pa-cli/src/session_export.rs +++ b/crates/pa-cli/src/session_export.rs @@ -1,4 +1,4 @@ -//! `prime-agent session export [output]`: the HTML export of a saved +//! `wv session export [output]`: the HTML export of a saved //! session file (the export itself is pa-core's `export_from_file`). use crate::args::Args; diff --git a/crates/pa-cli/src/sessions_table_format.rs b/crates/pa-cli/src/sessions_table_format.rs index ceaf6211f..a8e85527e 100644 --- a/crates/pa-cli/src/sessions_table_format.rs +++ b/crates/pa-cli/src/sessions_table_format.rs @@ -1,4 +1,4 @@ -//! The `prime-agent sessions` operator table: one line per agent — name, id, +//! The `wv sessions` operator table: one line per agent — name, id, //! status, activity, staleness, last error, usage, log size, artifact size — //! from the same daemon `list` summaries, with the activity wording from the //! shared roster branch table (color-free, like TS piped output). @@ -35,7 +35,7 @@ const SESSIONS_HEADERS: [&str; 9] = [ "artifacts", ]; -/// One-line-per-agent operator table for `prime-agent sessions`. +/// One-line-per-agent operator table for `wv sessions`. pub(crate) fn format_sessions_table(sessions: &[&Value], now_ms: u64) -> String { let mut sorted = sessions.to_vec(); sorted.sort_by_key(|summary| sessions_sort_key(summary)); diff --git a/crates/pa-cli/src/update_flow/coordinator.rs b/crates/pa-cli/src/update_flow/coordinator.rs index dbeb00f52..d81037f49 100644 --- a/crates/pa-cli/src/update_flow/coordinator.rs +++ b/crates/pa-cli/src/update_flow/coordinator.rs @@ -183,7 +183,7 @@ async fn drive( .set_state(UpdateState::Stopped) .map_err(PhaseFailure::after_stop)?; // `Activating`: validate the staged candidate BEFORE the swap, then record - // `.activation-state` and repoint `bin/prime-agent` (spec §7). + // `.activation-state` and repoint `bin/wv` (spec §7). writer .lock() .await @@ -302,7 +302,7 @@ async fn finish_failure( Ok(root) => root, Err(error) => { fail_hard(format!( - "The rollback is unavailable ({error}); the update failed ({reason}). Sessions persist on disk - prime-agent attach recovers them." + "The rollback is unavailable ({error}); the update failed ({reason}). Sessions persist on disk - wv attach recovers them." )) .await; return Ok(()); @@ -312,7 +312,7 @@ async fn finish_failure( Ok(previous) => previous, Err(error) => { fail_hard(format!( - "No valid previous release to roll back to ({error}); the update failed ({reason}). Sessions persist on disk - prime-agent attach recovers them." + "No valid previous release to roll back to ({error}); the update failed ({reason}). Sessions persist on disk - wv attach recovers them." )) .await; return Ok(()); @@ -325,7 +325,7 @@ async fn finish_failure( Ok(target) => target, Err(error) => { fail_hard(format!( - "The rollback launcher is missing ({error}); the update failed ({reason}). Sessions persist on disk - prime-agent attach recovers them." + "The rollback launcher is missing ({error}); the update failed ({reason}). Sessions persist on disk - wv attach recovers them." )) .await; return Ok(()); @@ -333,7 +333,7 @@ async fn finish_failure( }; if let Err(error) = swap::restore_previous(&root, &previous_target) { fail_hard(format!( - "The rollback repoint failed ({error}); the update failed ({reason}). Sessions persist on disk - prime-agent attach recovers them." + "The rollback repoint failed ({error}); the update failed ({reason}). Sessions persist on disk - wv attach recovers them." )) .await; return Ok(()); @@ -348,7 +348,7 @@ async fn finish_failure( ) { writer.lock().await.set_state(UpdateState::Failed)?; writer.lock().await.set_message(Some(format!( - "The rollback supervisor could not spawn ({error}); the update failed ({reason}). Sessions persist on disk - prime-agent attach recovers them." + "The rollback supervisor could not spawn ({error}); the update failed ({reason}). Sessions persist on disk - wv attach recovers them." )))?; return Ok(()); } @@ -359,13 +359,13 @@ async fn finish_failure( writer.lock().await.set_counts(counts)?; writer.lock().await.set_state(UpdateState::Complete)?; writer.lock().await.set_message(Some(format!( - "Rolled back to the previous Prime Agent version ({reason})" + "Rolled back to the previous Weave version ({reason})" )))?; Ok(()) } else { writer.lock().await.set_state(UpdateState::Failed)?; writer.lock().await.set_message(Some(format!( - "The rollback supervisor did not greet within its boot budget; the update failed ({reason}). Sessions persist on disk - prime-agent attach recovers them." + "The rollback supervisor did not greet within its boot budget; the update failed ({reason}). Sessions persist on disk - wv attach recovers them." )))?; Ok(()) } @@ -385,7 +385,7 @@ fn activation_plan() -> Result { let candidate_dir = std::env::var(UPDATE_CANDIDATE_DIR_ENV) .context("the coordinator was spawned without a staged candidate")?; let candidate_dir = PathBuf::from(candidate_dir); - let executable = candidate_dir.join("prime-agent"); + let executable = candidate_dir.join("wv"); let root = super::activation_root()?; let directory_name = candidate_dir .file_name() @@ -396,7 +396,7 @@ fn activation_plan() -> Result { .context("the staged release directory name does not carry a version")?; Ok(ActivationPlan { current_target: swap::launcher_target(&root, pa_core::update::install::CURRENT_LAUNCHER)?, - candidate_target: format!("../releases/{directory_name}/prime-agent"), + candidate_target: format!("../releases/{directory_name}/wv"), executable, version, root, diff --git a/crates/pa-cli/src/update_flow/plan.rs b/crates/pa-cli/src/update_flow/plan.rs index 985671968..6bf52b098 100644 --- a/crates/pa-cli/src/update_flow/plan.rs +++ b/crates/pa-cli/src/update_flow/plan.rs @@ -117,7 +117,7 @@ pub async fn plan( // name the same release (a launcher pointing elsewhere selected an obsolete // train over newer code). let running = running_release_anchor().map_err(|error| { - anyhow!("This binary does not run from a managed release directory: {error:#}. Update from a binary installed by the Prime Agent installer.") + anyhow!("This binary does not run from a managed release directory: {error:#}. Update from a binary installed by the Weave installer.") })?; // The directory's version and the binary's own report must agree: // a release directory named around a binary it lacks is inconsistent. diff --git a/crates/pa-cli/src/update_flow/report.rs b/crates/pa-cli/src/update_flow/report.rs index 5b1fe59a3..40cfcf4df 100644 --- a/crates/pa-cli/src/update_flow/report.rs +++ b/crates/pa-cli/src/update_flow/report.rs @@ -24,7 +24,7 @@ impl UpdateReport { // TS #2515: the failed restart leaves the OLD daemon running (the update is // on disk but not live) - say what to do next. report.warnings.push( - "The daemon still runs the previous version; run `prime-agent shutdown`, then run `prime-agent` to restart and apply the update." + "The daemon still runs the previous version; run `wv shutdown`, then run `wv` to restart and apply the update." .to_string(), ); } @@ -146,7 +146,7 @@ mod tests { "Updated, but could not restart the daemon (boot timed out).", // TS #2515: the second warning names the shutdown+restart hint (the old daemon is // still running). - "The daemon still runs the previous version; run `prime-agent shutdown`, then run `prime-agent` to restart and apply the update.", + "The daemon still runs the previous version; run `wv shutdown`, then run `wv` to restart and apply the update.", ] ); let running = diff --git a/crates/pa-cli/src/update_flow/swap.rs b/crates/pa-cli/src/update_flow/swap.rs index 67c50f646..0c1a47701 100644 --- a/crates/pa-cli/src/update_flow/swap.rs +++ b/crates/pa-cli/src/update_flow/swap.rs @@ -1,6 +1,6 @@ //! The staged activation (spec §4 `Activating`): the `.activation-state` //! rollback pointer, the `bin/previous` symlink, and the atomic -//! `bin/prime-agent` repoint. +//! `bin/wv` repoint. use std::path::Path; use std::time::Duration; @@ -30,7 +30,7 @@ impl ActivationState { /// Repoint the launcher symlinks for one activation (spec §4): record the /// recovery state, move the old target to `bin/previous`, then atomically -/// point `bin/prime-agent` at the candidate. Every symlink write is +/// point `bin/wv` at the candidate. Every symlink write is /// create-tmp + rename (a reader never observes a missing launcher). /// /// # Errors @@ -179,10 +179,10 @@ mod tests { std::fs::create_dir_all(root.join("bin")).unwrap(); std::fs::create_dir_all(root.join("releases").join("0.1.0-linux-x64-0")).unwrap(); std::fs::create_dir_all(root.join("releases").join("0.2.0-linux-x64-0")).unwrap(); - std::fs::write(root.join(".managed"), "prime-agent-native-v1").unwrap(); + std::fs::write(root.join(".managed"), "weave-native-v1").unwrap(); std::os::unix::fs::symlink( - "../releases/0.1.0-linux-x64-0/prime-agent", - root.join("bin").join("prime-agent"), + "../releases/0.1.0-linux-x64-0/wv", + root.join("bin").join("wv"), ) .unwrap(); root @@ -194,26 +194,26 @@ mod tests { let root = managed_root(dir.path()); activate( &root, - "../releases/0.1.0-linux-x64-0/prime-agent", - "../releases/0.2.0-linux-x64-0/prime-agent", + "../releases/0.1.0-linux-x64-0/wv", + "../releases/0.2.0-linux-x64-0/wv", "u1", ) .unwrap(); assert_eq!( - launcher_target(&root, "prime-agent").unwrap(), - "../releases/0.2.0-linux-x64-0/prime-agent" + launcher_target(&root, "wv").unwrap(), + "../releases/0.2.0-linux-x64-0/wv" ); assert_eq!( launcher_target(&root, "previous").unwrap(), - "../releases/0.1.0-linux-x64-0/prime-agent" + "../releases/0.1.0-linux-x64-0/wv" ); let state = std::fs::read_to_string(root.join(".activation-state")).unwrap(); - assert!(state.starts_with("../releases/0.1.0-linux-x64-0/prime-agent\n")); + assert!(state.starts_with("../releases/0.1.0-linux-x64-0/wv\n")); assert!(state.ends_with("u1\n")); - restore_previous(&root, "../releases/0.1.0-linux-x64-0/prime-agent").unwrap(); + restore_previous(&root, "../releases/0.1.0-linux-x64-0/wv").unwrap(); assert_eq!( - launcher_target(&root, "prime-agent").unwrap(), - "../releases/0.1.0-linux-x64-0/prime-agent" + launcher_target(&root, "wv").unwrap(), + "../releases/0.1.0-linux-x64-0/wv" ); clear_activation_state(&root).unwrap(); assert!(!root.join(".activation-state").exists()); diff --git a/crates/pa-cli/src/update_flow/update_command.rs b/crates/pa-cli/src/update_flow/update_command.rs index 3246f172a..3c4092341 100644 --- a/crates/pa-cli/src/update_flow/update_command.rs +++ b/crates/pa-cli/src/update_flow/update_command.rs @@ -1,4 +1,4 @@ -//! The `prime-agent update` driver: the invoking CLI's phases (spec §4 +//! The `wv update` driver: the invoking CLI's phases (spec §4 //! `Acquire`..`Staged`) plus the spawn of the detached coordinator and the //! status tail. The terminal status drives the printed report and the exit //! code. @@ -34,7 +34,7 @@ pub struct UpdateCommandOptions { pub source: Option, } -/// `prime-agent update`: plan, stage, spawn the coordinator, and relay its +/// `wv update`: plan, stage, spawn the coordinator, and relay its /// terminal status. Returns the process exit code. /// /// # Errors @@ -48,7 +48,7 @@ pub async fn run_update_command(options: &UpdateCommandOptions) -> Result { let socket_path = pa_daemon::socket::default_daemon_socket_path(); let install_root = super::activation_root().map_err(|_| { anyhow::anyhow!( - "This compiled application is not owned by the Prime Agent installer. Update it using its original installer." + "This compiled application is not owned by the Weave installer. Update it using its original installer." ) })?; let update_id = pa_types::daemon::update_flow::UpdateId::from(uuid::Uuid::now_v7().to_string()); @@ -117,8 +117,8 @@ pub async fn run_update_command(options: &UpdateCommandOptions) -> Result { base_url.as_str(), )?; let _ = std::fs::remove_file(&archive); - super::swap::validate_candidate(&release_dir.join("prime-agent"), &version).await?; - (release_dir.join("prime-agent"), release_dir) + super::swap::validate_candidate(&release_dir.join("wv"), &version).await?; + (release_dir.join("wv"), release_dir) } Ok(UpdatePlan::Direct { version, @@ -127,8 +127,8 @@ pub async fn run_update_command(options: &UpdateCommandOptions) -> Result { // `Staged` directly: `plan_direct` already staged the payload; // the probe below re-checks the binary's `--version`. writer.set_state(UpdateState::Staged)?; - super::swap::validate_candidate(&candidate_dir.join("prime-agent"), &version).await?; - (candidate_dir.join("prime-agent"), candidate_dir) + super::swap::validate_candidate(&candidate_dir.join("wv"), &version).await?; + (candidate_dir.join("wv"), candidate_dir) } Ok(UpdatePlan::Rollback { coordinator_exe, diff --git a/crates/pa-cli/tests/acp_config_option_e2e.rs b/crates/pa-cli/tests/acp_config_option_e2e.rs index ea0bd2c0c..4814638d6 100644 --- a/crates/pa-cli/tests/acp_config_option_e2e.rs +++ b/crates/pa-cli/tests/acp_config_option_e2e.rs @@ -206,7 +206,7 @@ fn acp_daemon_attached_config_option_pickers() { .to_string(), ) .unwrap(); - let bin = env!("CARGO_BIN_EXE_prime-agent"); + let bin = env!("CARGO_BIN_EXE_wv"); let mut child = Command::new(bin) .args([ "--mode", diff --git a/crates/pa-cli/tests/acp_mode_e2e.rs b/crates/pa-cli/tests/acp_mode_e2e.rs index 50b5fea6c..adbacf2c0 100644 --- a/crates/pa-cli/tests/acp_mode_e2e.rs +++ b/crates/pa-cli/tests/acp_mode_e2e.rs @@ -228,7 +228,7 @@ fn daemon_attached_command( socket: &std::path::Path, args: &[&str], ) -> Command { - let mut command = Command::new(env!("CARGO_BIN_EXE_prime-agent")); + let mut command = Command::new(env!("CARGO_BIN_EXE_wv")); command .args(args) .arg("--daemon-socket") @@ -310,7 +310,7 @@ const TIMEOUT: Duration = Duration::from_mins(1); /// Assert a settled turn's stop reason, printing the whole response /// envelope on mismatch: an `internal_error`'s failure text (the -/// `prime-agent turn failed: ` message) is otherwise lost — the +/// `wv turn failed: ` message) is otherwise lost — the /// `stopReason: null` arms of `assert_eq!` show only the null. fn assert_end_turn(response: &Value) { assert_eq!( @@ -341,8 +341,8 @@ fn acp_initialize_matches_the_ts_golden() { // ACP MCP server admission is served, so the http capability is advertised. assert_eq!(capabilities["mcpCapabilities"], json!({ "http": true })); let info = &result["agentInfo"]; - assert_eq!(info["name"], "prime-agent"); - assert_eq!(info["title"], "Prime Agent"); + assert_eq!(info["name"], "wv"); + assert_eq!(info["title"], "Weave"); assert_eq!( result["_meta"], json!({ "ai.primeintellect.prime-agent": {} }) @@ -542,7 +542,7 @@ fn acp_error_shapes_match_the_ts_goldens() { assert_eq!(response["error"]["code"], -32603); assert_eq!( response["error"]["data"]["details"], - "prime-agent ACP mode hosts one session per connection; start another prime-agent process for a second session" + "Weave ACP mode hosts one session per connection; start another wv process for a second session" ); // Unknown method (ts-errors.jsonl). @@ -679,7 +679,7 @@ fn acp_mcp_admission_rejects_a_second_session_only_when_open() { assert_eq!(second_response["error"]["message"], "Internal error"); assert_eq!( second_response["error"]["data"]["details"], - "prime-agent ACP mode hosts one session per connection; start another prime-agent process for a second session" + "Weave ACP mode hosts one session per connection; start another wv process for a second session" ); let close = client.request("session/close", &json!({ "sessionId": session_id })); let (close_response, _) = client.wait_response(close, TIMEOUT); @@ -908,7 +908,7 @@ fn acp_mode_daemon_unreachable_exits_1_without_fallback() { ); assert!( stderr.contains(&format!( - "Timed out waiting for the Prime Agent Rust daemon to start on selected socket {}.", + "Timed out waiting for the Weave Rust daemon to start on selected socket {}.", socket.display() )), "the daemon never became reachable: {stderr}" @@ -2136,7 +2136,7 @@ fn kernel_python() -> Option { None } -/// The namespaced prime-agent payload of one session/update frame. +/// The namespaced wv payload of one session/update frame. fn update_meta(frame: &Value) -> &Value { &frame["params"]["update"]["_meta"]["ai.primeintellect.prime-agent"] } @@ -2479,7 +2479,7 @@ fn acp_daemon_attached_close_stop_failure_fences_the_session() { let (refused_response, _) = client.wait_response(refused, TIMEOUT); assert_eq!( refused_response["error"]["data"]["details"], - "prime-agent ACP mode hosts one session per connection; start another prime-agent process for a second session", + "Weave ACP mode hosts one session per connection; start another wv process for a second session", "the close-failed session keeps the single-session slot: {refused_response}" ); diff --git a/crates/pa-cli/tests/agents_view_anchor_e2e.rs b/crates/pa-cli/tests/agents_view_anchor_e2e.rs index 319ac2760..f89e52965 100644 --- a/crates/pa-cli/tests/agents_view_anchor_e2e.rs +++ b/crates/pa-cli/tests/agents_view_anchor_e2e.rs @@ -81,7 +81,7 @@ fn spawn_supervisor(dir: &Path) -> Supervisor { let socket = dir.join("daemon.sock"); let agent_dir = dir.join("agent"); std::fs::create_dir_all(&agent_dir).expect("agent dir"); - let mut command = Command::new(env!("CARGO_BIN_EXE_prime-agent")); + let mut command = Command::new(env!("CARGO_BIN_EXE_wv")); command .args(["--mode", "daemon", "--daemon-socket"]) .arg(&socket) @@ -105,7 +105,7 @@ fn spawn_supervisor(dir: &Path) -> Supervisor { pa_daemon::worker::WORKER_SUPERVISOR_LOST_EXIT_MS_ENV, "15000", ); - let child = command.spawn().expect("spawn prime-agent --mode daemon"); + let child = command.spawn().expect("spawn wv --mode daemon"); let deadline = Instant::now() + Duration::from_secs(15); while Instant::now() < deadline { if socket.exists() { diff --git a/crates/pa-cli/tests/agents_view_flash_e2e.rs b/crates/pa-cli/tests/agents_view_flash_e2e.rs index 1eed1de79..c6b017369 100644 --- a/crates/pa-cli/tests/agents_view_flash_e2e.rs +++ b/crates/pa-cli/tests/agents_view_flash_e2e.rs @@ -81,7 +81,7 @@ fn spawn_supervisor(dir: &Path) -> Supervisor { let socket = dir.join("daemon.sock"); let agent_dir = dir.join("agent"); std::fs::create_dir_all(&agent_dir).expect("agent dir"); - let mut command = Command::new(env!("CARGO_BIN_EXE_prime-agent")); + let mut command = Command::new(env!("CARGO_BIN_EXE_wv")); command .args(["--mode", "daemon", "--daemon-socket"]) .arg(&socket) @@ -111,7 +111,7 @@ fn spawn_supervisor(dir: &Path) -> Supervisor { pa_daemon::worker::WORKER_SUPERVISOR_LOST_EXIT_MS_ENV, "15000", ); - let child = command.spawn().expect("spawn prime-agent --mode daemon"); + let child = command.spawn().expect("spawn wv --mode daemon"); let deadline = Instant::now() + Duration::from_secs(15); while Instant::now() < deadline { if socket.exists() { diff --git a/crates/pa-cli/tests/agents_view_refusal_panel_e2e.rs b/crates/pa-cli/tests/agents_view_refusal_panel_e2e.rs index c0623cb47..6e8104cc6 100644 --- a/crates/pa-cli/tests/agents_view_refusal_panel_e2e.rs +++ b/crates/pa-cli/tests/agents_view_refusal_panel_e2e.rs @@ -40,7 +40,7 @@ impl Drop for Daemon { #[allow(clippy::zombie_processes)] fn spawn_daemon(socket: &Path, agent_dir: &Path) -> Daemon { - let mut command = Command::new(env!("CARGO_BIN_EXE_prime-agent")); + let mut command = Command::new(env!("CARGO_BIN_EXE_wv")); command .args(["--mode", "daemon", "--daemon-socket"]) .arg(socket) @@ -64,7 +64,7 @@ fn spawn_daemon(socket: &Path, agent_dir: &Path) -> Daemon { pa_daemon::worker::WORKER_SUPERVISOR_LOST_EXIT_MS_ENV, "15000", ); - let child = command.spawn().expect("spawn prime-agent --mode daemon"); + let child = command.spawn().expect("spawn wv --mode daemon"); let deadline = Instant::now() + Duration::from_secs(15); while Instant::now() < deadline { if socket.exists() { diff --git a/crates/pa-cli/tests/agents_view_reply_e2e.rs b/crates/pa-cli/tests/agents_view_reply_e2e.rs index 360df1dc9..8fafa138c 100644 --- a/crates/pa-cli/tests/agents_view_reply_e2e.rs +++ b/crates/pa-cli/tests/agents_view_reply_e2e.rs @@ -75,7 +75,7 @@ fn spawn_supervisor(dir: &Path) -> Supervisor { let socket = dir.join("daemon.sock"); let agent_dir = dir.join("agent"); std::fs::create_dir_all(&agent_dir).expect("agent dir"); - let mut command = Command::new(env!("CARGO_BIN_EXE_prime-agent")); + let mut command = Command::new(env!("CARGO_BIN_EXE_wv")); command .args(["--mode", "daemon", "--daemon-socket"]) .arg(&socket) @@ -99,7 +99,7 @@ fn spawn_supervisor(dir: &Path) -> Supervisor { pa_daemon::worker::WORKER_SUPERVISOR_LOST_EXIT_MS_ENV, "15000", ); - let child = command.spawn().expect("spawn prime-agent --mode daemon"); + let child = command.spawn().expect("spawn wv --mode daemon"); let deadline = Instant::now() + Duration::from_secs(15); while Instant::now() < deadline { if socket.exists() { diff --git a/crates/pa-cli/tests/agents_view_search_e2e.rs b/crates/pa-cli/tests/agents_view_search_e2e.rs index 42ebdfc12..d72125767 100644 --- a/crates/pa-cli/tests/agents_view_search_e2e.rs +++ b/crates/pa-cli/tests/agents_view_search_e2e.rs @@ -83,7 +83,7 @@ fn spawn_supervisor(dir: &Path) -> Supervisor { let socket = dir.join("daemon.sock"); let agent_dir = dir.join("agent"); std::fs::create_dir_all(&agent_dir).expect("agent dir"); - let mut command = Command::new(env!("CARGO_BIN_EXE_prime-agent")); + let mut command = Command::new(env!("CARGO_BIN_EXE_wv")); command .args(["--mode", "daemon", "--daemon-socket"]) .arg(&socket) @@ -107,7 +107,7 @@ fn spawn_supervisor(dir: &Path) -> Supervisor { pa_daemon::worker::WORKER_SUPERVISOR_LOST_EXIT_MS_ENV, "15000", ); - let child = command.spawn().expect("spawn prime-agent --mode daemon"); + let child = command.spawn().expect("spawn wv --mode daemon"); let deadline = Instant::now() + Duration::from_secs(15); while Instant::now() < deadline { if socket.exists() { diff --git a/crates/pa-cli/tests/agents_view_subagents_e2e.rs b/crates/pa-cli/tests/agents_view_subagents_e2e.rs index 635a6c21b..846f982b4 100644 --- a/crates/pa-cli/tests/agents_view_subagents_e2e.rs +++ b/crates/pa-cli/tests/agents_view_subagents_e2e.rs @@ -81,7 +81,7 @@ fn spawn_supervisor(dir: &Path) -> Supervisor { let socket = dir.join("daemon.sock"); let agent_dir = dir.join("agent"); std::fs::create_dir_all(&agent_dir).expect("agent dir"); - let mut command = Command::new(env!("CARGO_BIN_EXE_prime-agent")); + let mut command = Command::new(env!("CARGO_BIN_EXE_wv")); command .args(["--mode", "daemon", "--daemon-socket"]) .arg(&socket) @@ -105,7 +105,7 @@ fn spawn_supervisor(dir: &Path) -> Supervisor { pa_daemon::worker::WORKER_SUPERVISOR_LOST_EXIT_MS_ENV, "15000", ); - let child = command.spawn().expect("spawn prime-agent --mode daemon"); + let child = command.spawn().expect("spawn wv --mode daemon"); let deadline = Instant::now() + Duration::from_secs(15); while Instant::now() < deadline { if socket.exists() { diff --git a/crates/pa-cli/tests/chat_agents_chat_roundtrip_e2e.rs b/crates/pa-cli/tests/chat_agents_chat_roundtrip_e2e.rs index aefadeccc..72b8d921e 100644 --- a/crates/pa-cli/tests/chat_agents_chat_roundtrip_e2e.rs +++ b/crates/pa-cli/tests/chat_agents_chat_roundtrip_e2e.rs @@ -75,7 +75,7 @@ fn spawn_supervisor(dir: &Path) -> Supervisor { let socket = dir.join("daemon.sock"); let agent_dir = dir.join("agent"); std::fs::create_dir_all(&agent_dir).expect("agent dir"); - let mut command = Command::new(env!("CARGO_BIN_EXE_prime-agent")); + let mut command = Command::new(env!("CARGO_BIN_EXE_wv")); command .args(["--mode", "daemon", "--daemon-socket"]) .arg(&socket) @@ -99,7 +99,7 @@ fn spawn_supervisor(dir: &Path) -> Supervisor { pa_daemon::worker::WORKER_SUPERVISOR_LOST_EXIT_MS_ENV, "15000", ); - let child = command.spawn().expect("spawn prime-agent --mode daemon"); + let child = command.spawn().expect("spawn wv --mode daemon"); let deadline = Instant::now() + Duration::from_secs(15); while Instant::now() < deadline { if socket.exists() { diff --git a/crates/pa-cli/tests/chat_open_first_frame_pty_e2e.rs b/crates/pa-cli/tests/chat_open_first_frame_pty_e2e.rs index 752774e1b..12538fdb8 100644 --- a/crates/pa-cli/tests/chat_open_first_frame_pty_e2e.rs +++ b/crates/pa-cli/tests/chat_open_first_frame_pty_e2e.rs @@ -102,7 +102,7 @@ fn chat_open_first_frame_pins_the_first_paint() { // The brand splash never paints (no flash, no one-row shift under the title). assert!( - find_subsequence(stream, b"prime agent").is_none(), + find_subsequence(stream, b"weave").is_none(), "the brand splash never paints for a direct open into content — \ the whole stream carries the splash bytes" ); diff --git a/crates/pa-cli/tests/clipboard_auth_commands_e2e.rs b/crates/pa-cli/tests/clipboard_auth_commands_e2e.rs index 1036a64e4..b2f7c72a9 100644 --- a/crates/pa-cli/tests/clipboard_auth_commands_e2e.rs +++ b/crates/pa-cli/tests/clipboard_auth_commands_e2e.rs @@ -138,7 +138,7 @@ fn spawn_supervisor(dir: &Path) -> Supervisor { let agent_dir = dir.join("agent"); std::fs::create_dir_all(&agent_dir).expect("agent dir"); let stderr_path = dir.join("supervisor.stderr"); - let mut command = Command::new(env!("CARGO_BIN_EXE_prime-agent")); + let mut command = Command::new(env!("CARGO_BIN_EXE_wv")); command .args(["--mode", "daemon", "--daemon-socket"]) .arg(&socket) @@ -170,7 +170,7 @@ fn spawn_supervisor(dir: &Path) -> Supervisor { pa_daemon::worker::WORKER_SUPERVISOR_LOST_EXIT_MS_ENV, "15000", ); - let mut child = command.spawn().expect("spawn prime-agent --mode daemon"); + let mut child = command.spawn().expect("spawn wv --mode daemon"); let deadline = Instant::now() + Duration::from_secs(15); while Instant::now() < deadline { if let Some(status) = child.try_wait().expect("check supervisor exit") { @@ -1259,9 +1259,7 @@ async fn tui_update_runs_out_of_band_during_a_turn() { "the confirm carries the preserve invariant:\n{rendered}" ); assert!( - rendered.contains( - "updated to 9.9.9-continuous.0123456789abcdef — restart prime-agent to run it" - ), + rendered.contains("updated to 9.9.9-continuous.0123456789abcdef — restart wv to run it"), "the outcome note renders:\n{rendered}" ); assert_eq!( diff --git a/crates/pa-cli/tests/continue_guard_e2e.rs b/crates/pa-cli/tests/continue_guard_e2e.rs index e9a374878..f34ccbc3c 100644 --- a/crates/pa-cli/tests/continue_guard_e2e.rs +++ b/crates/pa-cli/tests/continue_guard_e2e.rs @@ -40,7 +40,7 @@ impl Drop for Daemon { #[allow(clippy::zombie_processes)] fn spawn_daemon(socket: &Path, agent_dir: &Path) -> Daemon { - let mut command = Command::new(env!("CARGO_BIN_EXE_prime-agent")); + let mut command = Command::new(env!("CARGO_BIN_EXE_wv")); command .args(["--mode", "daemon", "--daemon-socket"]) .arg(socket) @@ -69,7 +69,7 @@ fn spawn_daemon(socket: &Path, agent_dir: &Path) -> Daemon { pa_daemon::worker::WORKER_SUPERVISOR_LOST_EXIT_MS_ENV, "15000", ); - let child = command.spawn().expect("spawn prime-agent --mode daemon"); + let child = command.spawn().expect("spawn wv --mode daemon"); let deadline = Instant::now() + Duration::from_secs(15); while Instant::now() < deadline { if socket.exists() { @@ -136,7 +136,7 @@ fn make_session_active(socket: &Path, session_path: &Path, cwd: &Path) -> String } fn run_print(args: &[&str], env: &[(String, String)]) -> (String, String, i32) { - let mut command = Command::new(env!("CARGO_BIN_EXE_prime-agent")); + let mut command = Command::new(env!("CARGO_BIN_EXE_wv")); command.args(args); for (key, value) in env { command.env(key, value); @@ -243,7 +243,7 @@ fn print_continue_refuses_an_active_daemon_session() { ); assert!( stderr.contains(&format!( - "Attach to it instead: prime-agent --resume '{active_session_id}'\n" + "Attach to it instead: wv --resume '{active_session_id}'\n" )), "the refusal suggests attaching to the live session (the holder id rides shell-quoted): {stderr}" ); diff --git a/crates/pa-cli/tests/daemon_commands_e2e.rs b/crates/pa-cli/tests/daemon_commands_e2e.rs index e1b64d697..238110c21 100644 --- a/crates/pa-cli/tests/daemon_commands_e2e.rs +++ b/crates/pa-cli/tests/daemon_commands_e2e.rs @@ -10,33 +10,33 @@ )] //! End-to-end daemon-command tests: spawn the real `pa-daemon` supervisor on a -//! temp socket, drive `prime-agent` list/stop/rename against it, and diff the +//! temp socket, drive `wv` list/stop/rename against it, and diff the //! output against goldens captured from the installed TS `prime-agent` binary. //! A second test gives each CLI a private TS counterpart at its own product default. //! //! Goldens (captured from the live TS binary, protocol 7): //! //! ```text -//! $ prime-agent list # one live session named "research" +//! $ wv list # one live session named "research" //! name id status age model messages clients //! research b72ad7009b11 idle 3s prime-inference/z-ai/glm-5.3 0 0 //! -//! $ prime-agent list # no live sessions +//! $ wv list # no live sessions //! No active agents. //! -//! $ prime-agent list --all # no saved sessions +//! $ wv list --all # no saved sessions //! No agents. //! -//! $ prime-agent stop +//! $ wv stop //! ok //! -//! $ prime-agent rename gamma +//! $ wv rename gamma //! Renamed 0f04b31cb2b6 to gamma //! -//! $ prime-agent schedule add gamma "every 5 minutes" -- "do the thing" +//! $ wv schedule add gamma "every 5 minutes" -- "do the thing" //! Scheduled 0451e5a9-951c-457b-ae76-ea3142ea5d25 next=2026-09-16T18:36:59.287Z //! -//! $ prime-agent schedule list +//! $ wv schedule list //! 0451e5a9-951c-457b-ae76-ea3142ea5d25 active next=9/16/2026, 6:36:59 PM last=- runs=0 schedule="every 5 minutes" prompt="do the thing" //! ``` #![cfg(unix)] @@ -68,12 +68,12 @@ const SCRUB_ENV: [&str; 10] = [ "PRIME_AGENT_DAEMON_SOCKET", ]; -/// Locate the built `pa-daemon` binary next to this crate's `prime-agent` +/// Locate the built `pa-daemon` binary next to this crate's `wv` /// binary (cargo builds the tested crate's bins only). fn daemon_binary() -> PathBuf { - let profile_dir = Path::new(env!("CARGO_BIN_EXE_prime-agent")) + let profile_dir = Path::new(env!("CARGO_BIN_EXE_wv")) .parent() - .expect("profile directory of the prime-agent binary") + .expect("profile directory of the wv binary") .to_path_buf(); let daemon = profile_dir.join("pa-daemon"); assert!( @@ -91,13 +91,13 @@ fn ts_binary() -> Option { let path = PathBuf::from(path); return path.exists().then_some(path); } - let probe = Command::new("prime-agent") + let probe = Command::new("wv") .arg("--version") .output() .ok()? .status .success() - .then(|| PathBuf::from("prime-agent")); + .then(|| PathBuf::from("wv")); probe } @@ -572,7 +572,7 @@ impl CliPair { } } -// Rust end-to-end: pa-daemon + prime-agent +// Rust end-to-end: pa-daemon + wv #[pa_test_scratch::pa_test] #[test] @@ -582,7 +582,7 @@ fn rust_daemon_cli_commands_end_to_end() { let sessions = agent_dir.join("sessions"); std::fs::create_dir_all(&sessions).expect("sessions dir"); let socket = dir.path().join("daemon.sock"); - let cli = PathBuf::from(env!("CARGO_BIN_EXE_prime-agent")); + let cli = PathBuf::from(env!("CARGO_BIN_EXE_wv")); let daemon = spawn_daemon(&daemon_binary(), &socket, &agent_dir); let socket_str = socket.to_string_lossy().to_string(); @@ -1057,7 +1057,7 @@ fn cli_connect_error_matches_ts_golden() { let dir = tempfile::TempDir::new().expect("temp dir"); let agent_dir = dir.path().join("agent"); let missing = dir.path().join("missing.sock"); - let cli = PathBuf::from(env!("CARGO_BIN_EXE_prime-agent")); + let cli = PathBuf::from(env!("CARGO_BIN_EXE_wv")); let output = run_cli( &cli, dir.path(), @@ -1072,7 +1072,7 @@ fn cli_connect_error_matches_ts_golden() { let text = stderr(&output).trim_end().to_string(); let expected_prefix = format!( - "Error: Failed to connect to the Prime Agent daemon: connect ENOENT {missing}. Socket: {missing}. Daemon log: ", + "Error: Failed to connect to the Weave daemon: connect ENOENT {missing}. Socket: {missing}. Daemon log: ", missing = missing.display() ); assert!( @@ -1113,26 +1113,26 @@ fn schedule_usage_errors_and_valid_invocations() { let dir = tempfile::TempDir::new().expect("temp dir"); let agent_dir = dir.path().join("agent"); std::fs::create_dir_all(agent_dir.join("sessions")).expect("sessions dir"); - let cli = PathBuf::from(env!("CARGO_BIN_EXE_prime-agent")); + let cli = PathBuf::from(env!("CARGO_BIN_EXE_wv")); let rotated_socket = dir.path().join("bogus.sock"); let rotated_socket = rotated_socket.to_str().expect("socket path"); let usage_shapes = [ ( vec!["schedule", "cancel"], - "Error: Usage: prime-agent schedule cancel \n", + "Error: Usage: wv schedule cancel \n", ), ( vec!["schedule", "cancel", "a", "b"], - "Error: Usage: prime-agent schedule cancel \n", + "Error: Usage: wv schedule cancel \n", ), ( vec!["schedule", "list", "--bogus-flag"], - "Error: Usage: prime-agent schedule list [--all] [agent] [--json]\n", + "Error: Usage: wv schedule list [--all] [agent] [--json]\n", ), ( vec!["--daemon-socket", rotated_socket, "schedule", "list"], - "Error: Usage: prime-agent schedule list [--all] [agent] [--json]\n", + "Error: Usage: wv schedule list [--all] [agent] [--json]\n", ), ( vec![ @@ -1142,7 +1142,7 @@ fn schedule_usage_errors_and_valid_invocations() { "cancel", "id", ], - "Error: Usage: prime-agent schedule cancel \n", + "Error: Usage: wv schedule cancel \n", ), ]; for (args, golden) in usage_shapes { @@ -1167,7 +1167,7 @@ fn schedule_usage_errors_and_valid_invocations() { assert_eq!(out.status.code(), Some(1), "{args:?}"); let err = stderr(&out); assert!( - err.starts_with("Error: Failed to connect to the Prime Agent daemon:"), + err.starts_with("Error: Failed to connect to the Weave daemon:"), "{args:?}: {err}" ); } @@ -1340,7 +1340,7 @@ fn ts_daemon_differential_cli_output() { // SCRUB_ENV removes the gate's inherited Rust override before either CLI. // Do not mutate the test process's TMPDIR or alias either live endpoint. let uid = pa_core::platform::process::current_user_id(); - let ts_socket = dir.path().join(format!("prime-agent-{uid}/daemon.sock")); + let ts_socket = dir.path().join(format!("wv-{uid}/daemon.sock")); let rust_socket = dir .path() .join(format!("prime-agent-rust-{uid}/daemon.sock")); @@ -1358,7 +1358,7 @@ fn ts_daemon_differential_cli_output() { "Rust selected-default reachability" ); assert!(ts_socket.starts_with(dir.path()) && rust_socket.starts_with(dir.path())); - let rust = PathBuf::from(env!("CARGO_BIN_EXE_prime-agent")); + let rust = PathBuf::from(env!("CARGO_BIN_EXE_wv")); let pair = CliPair { ts: ts.clone(), rust: rust.clone(), diff --git a/crates/pa-cli/tests/daemon_discovery_e2e.rs b/crates/pa-cli/tests/daemon_discovery_e2e.rs index 2ed37559d..01df9f17c 100644 --- a/crates/pa-cli/tests/daemon_discovery_e2e.rs +++ b/crates/pa-cli/tests/daemon_discovery_e2e.rs @@ -25,7 +25,7 @@ use std::time::{Duration, Instant}; use serde_json::{json, Value}; -/// Environment keys this box's own prime-agent worker sets; they must not +/// Environment keys this box's own wv worker sets; they must not /// leak into spawned supervisors. const SCRUB_ENV: [&str; 8] = [ "PRIME_AGENT_INTERNAL_DAEMON_WORKER", @@ -43,7 +43,7 @@ const SCRUB_ENV: [&str; 8] = [ const LAUNCHER_CLIENT_SOCKET_ENV: &str = "PRIME_AGENT_TEST_LAUNCHER_CLIENT_SOCKET"; fn cli_binary() -> PathBuf { - PathBuf::from(env!("CARGO_BIN_EXE_prime-agent")) + PathBuf::from(env!("CARGO_BIN_EXE_wv")) } /// A spawned supervisor, killed on drop so a failed test never leaks a @@ -60,7 +60,7 @@ impl Drop for Daemon { } /// Spawn the real supervisor on a fixture socket the way production does -/// (`prime-agent --mode daemon --daemon-socket`), with agent dir and TMPDIR +/// (`wv --mode daemon --daemon-socket`), with agent dir and TMPDIR /// pinned inside the fixture root so every socket it ever makes stays there. #[allow(clippy::zombie_processes)] fn spawn_daemon(socket: &Path, agent_dir: &Path, tmp_dir: &Path) -> Daemon { @@ -398,7 +398,7 @@ fn shutdown_without_force_requires_confirmation_and_harms_nothing() { assert_eq!(tty_error.status.code(), Some(1)); assert!( stderr(&tty_error).contains( - "Shutdown requires confirmation in an interactive terminal. Use \"prime-agent shutdown --force\"." + "Shutdown requires confirmation in an interactive terminal. Use \"wv shutdown --force\"." ), "router error mismatch: {}{}", stdout(&tty_error), @@ -421,7 +421,7 @@ fn shutdown_without_force_requires_confirmation_and_harms_nothing() { ); assert_eq!( failed[0].get("reason").and_then(Value::as_str), - Some("confirmation required; use \"prime-agent shutdown --force --json\"") + Some("confirmation required; use \"wv shutdown --force --json\"") ); assert!( report @@ -1024,7 +1024,7 @@ fn a_pinned_root_with_an_overlapping_agent_dir_never_stops_foreign_workers() { /// A fresh top-level invocation must not inherit an ancestor worker's /// identity: a kernel bash hands a worker's full environment to every -/// child, so `prime-agent --mode daemon --daemon-socket B` launched from +/// child, so `wv --mode daemon --daemon-socket B` launched from /// inside a worker must come up as B's supervisor — never as a second /// worker of the live supervisor the inherited env points at. #[pa_test_scratch::pa_test] diff --git a/crates/pa-cli/tests/differential_cli.rs b/crates/pa-cli/tests/differential_cli.rs index b3b104bc3..2593d990a 100644 --- a/crates/pa-cli/tests/differential_cli.rs +++ b/crates/pa-cli/tests/differential_cli.rs @@ -218,7 +218,7 @@ const CORPUS: &[&[&str]] = &[ &["package", "update", "--self"], &["package", "update", "a", "b"], &["package", "update", "self"], - &["package", "update", "prime-agent"], + &["package", "update", "wv"], &["package", "update", "pi"], &["package", "update", "--force"], &["package", "install"], @@ -377,7 +377,7 @@ fn ts_binary_on_path(search_path: &std::ffi::OsStr) -> Result { #[test] fn path_reference_rejects_rust_binary() { let directory = tempfile::tempdir().unwrap(); - let rust = PathBuf::from(env!("CARGO_BIN_EXE_prime-agent")); + let rust = PathBuf::from(env!("CARGO_BIN_EXE_wv")); let candidate = directory.path().join("prime-agent"); std::os::unix::fs::symlink(&rust, &candidate).unwrap(); let error = ts_binary_on_path(directory.path().as_os_str()).unwrap_err(); @@ -641,27 +641,27 @@ fn declared_native_contract( ), ["update", "--self"] | ["update", "--force", "--self"] => Some( ts.is_none_or(|ts| declared_output_matches(ts, 1, "", "Error: An update target is no longer needed.\nUse \"prime-agent update [--force]\".\n", roots)) - && declared_output_matches(native, 1, "", "Error: Unknown option for update: --self\nRun \"prime-agent help update\" for usage.\n", roots), + && declared_output_matches(native, 1, "", "Error: Unknown option for update: --self\nRun \"wv help update\" for usage.\n", roots), ), ["update", "package"] => Some( ts.is_none_or(|ts| declared_output_matches(ts, 1, "", "Error: Package updates moved to the package command.\nUse \"prime-agent package update [source]\".\n", roots)) - && declared_output_matches(native, 1, "", "Error: Unknown option for update: package\nRun \"prime-agent help update\" for usage.\n", roots), + && declared_output_matches(native, 1, "", "Error: Unknown option for update: package\nRun \"wv help update\" for usage.\n", roots), ), ["update", "--extensions"] => Some( ts.is_none_or(|ts| declared_output_matches(ts, 1, "", "Error: Package updates moved to the package command.\nUse \"prime-agent package update [source]\".\n", roots)) - && declared_output_matches(native, 1, "", "Error: Unknown option for update: --extensions\nRun \"prime-agent help update\" for usage.\n", roots), + && declared_output_matches(native, 1, "", "Error: Unknown option for update: --extensions\nRun \"wv help update\" for usage.\n", roots), ), ["update", "--self", "package"] => Some( ts.is_none_or(|ts| declared_output_matches(ts, 1, "", "Error: Prime Agent and package updates are now separate.\nRun \"prime-agent update [--force]\" and \"prime-agent package update [source]\" separately.\n", roots)) - && declared_output_matches(native, 1, "", "Error: Unknown option for update: --self\nRun \"prime-agent help update\" for usage.\n", roots), + && declared_output_matches(native, 1, "", "Error: Unknown option for update: --self\nRun \"wv help update\" for usage.\n", roots), ), ["update", "self", "pkg"] => Some( ts.is_none_or(|ts| declared_output_matches(ts, 1, "", "Error: Prime Agent and package updates are now separate.\nRun \"prime-agent update [--force]\" and \"prime-agent package update [source]\" separately.\n", roots)) - && declared_output_matches(native, 1, "", "Error: Unknown option for update: self\nRun \"prime-agent help update\" for usage.\n", roots), + && declared_output_matches(native, 1, "", "Error: Unknown option for update: self\nRun \"wv help update\" for usage.\n", roots), ), ["package", "update", "--self" | "--force"] | ["package", "update", "--extension", "x", "--self" | "y"] | ["package", "update", "--extensions", "--rollback"] => Some( ts.is_none_or(|ts| declared_output_matches(ts, 1, "", "Error: Package updates accept only an optional source. Use \"prime-agent update --force\" to update Prime Agent.\n", roots)) - && declared_output_matches(native, 1, "", "Error: Package updates accept only an optional source. Use \"prime-agent update\" to update Prime Agent.\n", roots), + && declared_output_matches(native, 1, "", "Error: Package updates accept only an optional source. Use \"wv update\" to update Weave.\n", roots), ), _ => None, } @@ -688,7 +688,7 @@ fn declared_late_console_case(case: &[&str]) -> bool { #[pa_test_scratch::pa_test] #[test] fn native_cli_contract_fixtures() { - let rust = PathBuf::from(env!("CARGO_BIN_EXE_prime-agent")); + let rust = PathBuf::from(env!("CARGO_BIN_EXE_wv")); let sandbox = sandbox("native-contract"); for case in [ &["--help"][..], @@ -732,7 +732,7 @@ fn differential_corpus_matches_ts_binary() { let Some(ts) = ts_binary() else { return; }; - let rust = PathBuf::from(env!("CARGO_BIN_EXE_prime-agent")); + let rust = PathBuf::from(env!("CARGO_BIN_EXE_wv")); let ts_sandbox = sandbox("ts"); let rs_sandbox = sandbox("rs"); let sandbox_roots: Vec<&Path> = vec![&ts_sandbox, &rs_sandbox]; @@ -808,7 +808,7 @@ fn differential_env_flag_cases_match_ts_binary() { let Some(ts) = ts_binary() else { return; }; - let rust = PathBuf::from(env!("CARGO_BIN_EXE_prime-agent")); + let rust = PathBuf::from(env!("CARGO_BIN_EXE_wv")); let ts_sandbox = sandbox("ts-env"); let rs_sandbox = sandbox("rs-env"); let sandbox_roots: Vec<&Path> = vec![&ts_sandbox, &rs_sandbox]; @@ -879,7 +879,7 @@ fn differential_session_export_matches_ts_binary() { let Some(ts) = ts_binary() else { return; }; - let rust = PathBuf::from(env!("CARGO_BIN_EXE_prime-agent")); + let rust = PathBuf::from(env!("CARGO_BIN_EXE_wv")); let ts_sandbox = sandbox("ts-export"); let rs_sandbox = sandbox("rs-export"); let sandbox_roots: Vec<&Path> = vec![&ts_sandbox, &rs_sandbox]; diff --git a/crates/pa-cli/tests/dock_scope_exit_focus_e2e.rs b/crates/pa-cli/tests/dock_scope_exit_focus_e2e.rs index 79b8fa3de..1c076a159 100644 --- a/crates/pa-cli/tests/dock_scope_exit_focus_e2e.rs +++ b/crates/pa-cli/tests/dock_scope_exit_focus_e2e.rs @@ -87,7 +87,7 @@ fn spawn_supervisor(dir: &Path) -> Supervisor { let socket = dir.join("daemon.sock"); let agent_dir = dir.join("agent"); std::fs::create_dir_all(&agent_dir).expect("agent dir"); - let mut command = Command::new(env!("CARGO_BIN_EXE_prime-agent")); + let mut command = Command::new(env!("CARGO_BIN_EXE_wv")); command .args(["--mode", "daemon", "--daemon-socket"]) .arg(&socket) @@ -111,7 +111,7 @@ fn spawn_supervisor(dir: &Path) -> Supervisor { pa_daemon::worker::WORKER_SUPERVISOR_LOST_EXIT_MS_ENV, "15000", ); - let child = command.spawn().expect("spawn prime-agent --mode daemon"); + let child = command.spawn().expect("spawn wv --mode daemon"); // Readiness is the socket appearing (observable), not the wait: the // sleep is only the poll interval between checks, and the deadline // bounds failure — a missing socket panics, it never passes. diff --git a/crates/pa-cli/tests/editor_handoff_paint_pty_e2e.rs b/crates/pa-cli/tests/editor_handoff_paint_pty_e2e.rs index 0fa317332..aeacb74e9 100644 --- a/crates/pa-cli/tests/editor_handoff_paint_pty_e2e.rs +++ b/crates/pa-cli/tests/editor_handoff_paint_pty_e2e.rs @@ -138,7 +138,7 @@ fn spawn_supervisor(dir: &Path) -> Supervisor { let socket = dir.join("daemon.sock"); let agent_dir = dir.join("agent"); std::fs::create_dir_all(agent_dir.join("sessions")).expect("agent dir"); - let mut command = Command::new(env!("CARGO_BIN_EXE_prime-agent")); + let mut command = Command::new(env!("CARGO_BIN_EXE_wv")); command .args(["--mode", "daemon", "--daemon-socket"]) .arg(&socket) @@ -179,7 +179,7 @@ fn spawn_supervisor(dir: &Path) -> Supervisor { } command.env_remove("PRIME_TEAM_ID"); command.env_remove("PRIME_API_KEY"); - let child = command.spawn().expect("spawn prime-agent --mode daemon"); + let child = command.spawn().expect("spawn wv --mode daemon"); let deadline = Instant::now() + Duration::from_secs(15); while Instant::now() < deadline { if socket.exists() { diff --git a/crates/pa-cli/tests/export_live_differential.rs b/crates/pa-cli/tests/export_live_differential.rs index d698cd7f6..01b05b7a2 100644 --- a/crates/pa-cli/tests/export_live_differential.rs +++ b/crates/pa-cli/tests/export_live_differential.rs @@ -47,13 +47,13 @@ fn ts_binary() -> Option { let path = PathBuf::from(path); return path.exists().then_some(path); } - Command::new("prime-agent") + Command::new("wv") .arg("--version") .output() .ok()? .status .success() - .then(|| PathBuf::from("prime-agent")) + .then(|| PathBuf::from("wv")) } struct Supervisor { @@ -448,7 +448,7 @@ fn differential_live_export_matches_ts_binary() { eprintln!("SKIPPED: TS prime-agent binary not found (set PA_TS_BINARY)"); return; }; - let rust = PathBuf::from(env!("CARGO_BIN_EXE_prime-agent")); + let rust = PathBuf::from(env!("CARGO_BIN_EXE_wv")); let ts_base = tempfile::TempDir::new().expect("temp dir"); let rs_base = tempfile::TempDir::new().expect("temp dir"); let ts_data = live_export(&ts, ts_base.path(), true); diff --git a/crates/pa-cli/tests/export_share_e2e.rs b/crates/pa-cli/tests/export_share_e2e.rs index e2a731f89..fcbc9adfa 100644 --- a/crates/pa-cli/tests/export_share_e2e.rs +++ b/crates/pa-cli/tests/export_share_e2e.rs @@ -138,7 +138,7 @@ fn spawn_supervisor(dir: &Path) -> Supervisor { let socket = dir.join("daemon.sock"); let agent_dir = dir.join("agent"); std::fs::create_dir_all(&agent_dir).expect("agent dir"); - let mut command = Command::new(env!("CARGO_BIN_EXE_prime-agent")); + let mut command = Command::new(env!("CARGO_BIN_EXE_wv")); command .args(["--mode", "daemon", "--daemon-socket"]) .arg(&socket) @@ -170,7 +170,7 @@ fn spawn_supervisor(dir: &Path) -> Supervisor { pa_daemon::worker::WORKER_SUPERVISOR_LOST_EXIT_MS_ENV, "15000", ); - let child = command.spawn().expect("spawn prime-agent --mode daemon"); + let child = command.spawn().expect("spawn wv --mode daemon"); let deadline = Instant::now() + Duration::from_secs(15); while Instant::now() < deadline { if socket.exists() { diff --git a/crates/pa-cli/tests/fixtures/native-cli-contract/native-help.txt b/crates/pa-cli/tests/fixtures/native-cli-contract/native-help.txt index 7d5ed62b5..1d66b1f70 100644 --- a/crates/pa-cli/tests/fixtures/native-cli-contract/native-help.txt +++ b/crates/pa-cli/tests/fixtures/native-cli-contract/native-help.txt @@ -1,8 +1,8 @@ -prime-agent - AI coding assistant with a Python REPL tool +wv - AI coding assistant with a Python REPL tool Usage: - prime-agent [options] [@files...] [message...] - prime-agent [args...] + wv [options] [@files...] [message...] + wv [args...] Options: Run options: @@ -70,4 +70,4 @@ Commands: config Configure package resources prompt Print the assembled system prompt with its layer breakdown -Run "prime-agent help " for command details. +Run "wv help " for command details. diff --git a/crates/pa-cli/tests/fixtures/native-cli-contract/native-package-help.txt b/crates/pa-cli/tests/fixtures/native-cli-contract/native-package-help.txt index d02f7253f..cd98b1eb3 100644 --- a/crates/pa-cli/tests/fixtures/native-cli-contract/native-package-help.txt +++ b/crates/pa-cli/tests/fixtures/native-cli-contract/native-package-help.txt @@ -1,5 +1,5 @@ Usage: - prime-agent package + wv package Manage capability packages. diff --git a/crates/pa-cli/tests/fixtures/native-cli-contract/native-update-help.txt b/crates/pa-cli/tests/fixtures/native-cli-contract/native-update-help.txt index d9d7613d9..30abc873d 100644 --- a/crates/pa-cli/tests/fixtures/native-cli-contract/native-update-help.txt +++ b/crates/pa-cli/tests/fixtures/native-cli-contract/native-update-help.txt @@ -1,9 +1,9 @@ Usage: - prime-agent update [--check] [--nightly|--stable] + wv update [--check] [--nightly|--stable] Update to the latest Rust build (uninstalls the TypeScript version). -Move from the TypeScript version to the Rust port in one step: `prime-agent update` fetches the update channel's installer (stable: https://app.primeintellect.ai/prime-agent/install.sh; nightly: install-beta.sh from the release download base — never a GitHub raw or workflow URL) and runs it, which uninstalls the TypeScript version and installs the latest Rust build; your sessions and configuration (~/.prime/agent) are never touched. Restart prime-agent after the update to run the new build. This command exists only in the Rust binary — the TypeScript version does not have it; the move happens when you run the installer's curl|sh URL (the README's Install section) or `prime-agent update` (after the Rust install exists). +Move from the TypeScript version to the Rust port in one step: `wv update` fetches the update channel's installer (stable: install.sh from the release download base; nightly: install-beta.sh — never a GitHub raw or workflow URL) and runs it, which uninstalls the TypeScript version and installs the latest Rust build; your sessions and configuration (~/.prime/agent) are never touched. Restart wv after the update to run the new build. This command exists only in the Rust binary — the TypeScript version does not have it; the move happens when you run the installer's curl|sh URL or `wv update` (after the Rust install exists). Options: --check Print the update channel's latest release vs the running version, without installing diff --git a/crates/pa-cli/tests/input_live_open_pty_e2e.rs b/crates/pa-cli/tests/input_live_open_pty_e2e.rs index 0a7679d18..3af2f440d 100644 --- a/crates/pa-cli/tests/input_live_open_pty_e2e.rs +++ b/crates/pa-cli/tests/input_live_open_pty_e2e.rs @@ -106,7 +106,7 @@ fn typing_echoes_while_the_session_open_is_stalled() { // The startup chrome (the new chat's brand splash) paints first: the // surface is mounted and in raw mode by then. - harness.wait_from_start("prime agent", "the startup chrome painted"); + harness.wait_from_start("weave", "the startup chrome painted"); // Type while the open is still stalled. The echo must land inside the // echo deadline — far inside the attach's stall window. diff --git a/crates/pa-cli/tests/installer_platform_map.rs b/crates/pa-cli/tests/installer_platform_map.rs index 44e1f21dd..352cb614d 100644 --- a/crates/pa-cli/tests/installer_platform_map.rs +++ b/crates/pa-cli/tests/installer_platform_map.rs @@ -81,40 +81,32 @@ fn map_row(output: &Output) -> String { #[test] fn the_uname_map_resolves_the_published_platforms() { let cases = [ - ( - "Darwin", - "arm64", - "aarch64-apple-darwin|darwin-arm64|no|prime-agent", - ), - ( - "Darwin", - "x86_64", - "x86_64-apple-darwin|darwin-x64|no|prime-agent", - ), + ("Darwin", "arm64", "aarch64-apple-darwin|darwin-arm64|no|wv"), + ("Darwin", "x86_64", "x86_64-apple-darwin|darwin-x64|no|wv"), ( "Linux", "x86_64", - "x86_64-unknown-linux-gnu|linux-x64|no|prime-agent", + "x86_64-unknown-linux-gnu|linux-x64|no|wv", ), ( "Linux", "aarch64", - "aarch64-unknown-linux-gnu|linux-arm64|no|prime-agent", + "aarch64-unknown-linux-gnu|linux-arm64|no|wv", ), ( "MINGW64_NT-10.0-19045", "x86_64", - "x86_64-pc-windows-msvc|win32-x64|yes|prime-agent.exe", + "x86_64-pc-windows-msvc|win32-x64|yes|wv.exe", ), ( "MSYS_NT-10.0-19045", "x86_64", - "x86_64-pc-windows-msvc|win32-x64|yes|prime-agent.exe", + "x86_64-pc-windows-msvc|win32-x64|yes|wv.exe", ), ( "CYGWIN_NT-10.0-19045", "x86_64", - "x86_64-pc-windows-msvc|win32-x64|yes|prime-agent.exe", + "x86_64-pc-windows-msvc|win32-x64|yes|wv.exe", ), ]; for (os, arch, expected) in cases { @@ -171,7 +163,7 @@ fn install_ps1_carries_the_windows_contract() { "the ps1 serves win32-x64" ); assert!( - text.contains("prime-agent-$version-$platform.tar.gz"), + text.contains("wv-$version-$platform.tar.gz"), "the ps1 validates the channel-named artifact row" ); // The arch refusal: an ARM64 Windows machine fails loudly. @@ -189,10 +181,10 @@ fn install_ps1_carries_the_windows_contract() { text.contains("$ReleaseChannelDefault = '"), "the channel-default line the publish stamps must exist" ); - // The same layout as install-rust.sh (share\prime-agent + bin): + // The same layout as install-rust.sh (share\weave + bin): // the two routes must interoperate on one install. assert!( - text.contains("share\\prime-agent") && text.contains("prime-agent.exe"), + text.contains("share\\weave") && text.contains("wv.exe"), "the ps1 publishes the same payload layout with the .exe name" ); // The marker write: the same ownership proof the sh installer writes @@ -365,7 +357,7 @@ fn install_ps1_names_the_dll_not_found_failure_honestly() { /// Windows HAS a canonical user-PATH setting (the registry's User scope, /// no admin needed), so the installer ADDS the launcher's bin dir there /// itself: idempotent (appended only when the entry is absent, never -/// duplicated), mirrored into the CURRENT session so `prime-agent` works +/// duplicated), mirrored into the CURRENT session so `wv` works /// in the same console immediately, and the printed hint says a NEW /// terminal gets it automatically instead of telling the user to go edit /// the registry by hand. @@ -442,7 +434,7 @@ fn install_ps1_adds_bin_to_the_user_path_and_the_session_path() { // The printed note never tells the user to edit their own PATH by hand // anymore: the installer did it. assert!( - !section.contains("add it for the prime-agent command"), + !section.contains("add it for the wv command"), "the PATH note must not tell the user to edit their own PATH by hand" ); // The flattened write route is gone: SetEnvironmentVariable turns a @@ -682,7 +674,7 @@ fn install_ps1_runs_a_step_ledger_and_its_own_download_progress() { /// uv when it is missing (the astral one-liner with the destination /// passed explicitly via `UV_INSTALL_DIR`, the fetch and the script run /// checked SEPARATELY so a dead network cannot masquerade as success) and -/// then pre-warms the kernel (`prime-agent --prime-agent-bootstrap`); the +/// then pre-warms the kernel (`wv --prime-agent-bootstrap`); the /// ps1 only printed a note. The ps1 mirrors the whole flow: the astral /// installer is FETCHED (into a file, checked non-empty), RUN with /// `UV_INSTALL_DIR` set explicitly, and its verdict is never trusted - the diff --git a/crates/pa-cli/tests/installer_update_e2e.rs b/crates/pa-cli/tests/installer_update_e2e.rs index 019d0b27d..6e721a4b4 100644 --- a/crates/pa-cli/tests/installer_update_e2e.rs +++ b/crates/pa-cli/tests/installer_update_e2e.rs @@ -9,7 +9,7 @@ clippy::cast_precision_loss )] -//! The `prime-agent update` e2e (the TS->Rust migration path): the real +//! The `wv update` e2e (the TS->Rust migration path): the real //! binary, a mocked installer-script download (a local one-shot HTTP server), //! and a sandboxed HOME — the launcher lands under the sandbox prefix, the //! success line names the new build, and the sandbox session file is @@ -30,8 +30,8 @@ const ENV_PREFIX: &str = "PRIME_AGENT_RUST_PREFIX"; const MOCK_INSTALLER: &str = r#"#!/bin/sh set -eu mkdir -p "${PRIME_AGENT_RUST_PREFIX}/bin" -printf '#!/bin/sh\necho "9.9.9-continuous.0123456789abcdef"\n' > "${PRIME_AGENT_RUST_PREFIX}/bin/prime-agent" -chmod 0755 "${PRIME_AGENT_RUST_PREFIX}/bin/prime-agent" +printf '#!/bin/sh\necho "9.9.9-continuous.0123456789abcdef"\n' > "${PRIME_AGENT_RUST_PREFIX}/bin/wv" +chmod 0755 "${PRIME_AGENT_RUST_PREFIX}/bin/wv" echo "installed: 9.9.9-continuous.0123456789abcdef" "#; @@ -140,11 +140,11 @@ fn uuid_probe() -> String { fn run_prime_agent(args: &[&str], sandbox: &Sandbox, url: &str) -> std::process::Output { let mut command = prime_agent(args, sandbox); command.env(ENV_INSTALLER_URL, url); - command.output().expect("run the prime-agent binary") + command.output().expect("run the wv binary") } fn prime_agent(args: &[&str], sandbox: &Sandbox) -> Command { - let mut command = Command::new(env!("CARGO_BIN_EXE_prime-agent")); + let mut command = Command::new(env!("CARGO_BIN_EXE_wv")); command .args(args) .env("HOME", sandbox.root.join("home")) @@ -175,10 +175,10 @@ fn update_runs_the_downloaded_installer_and_preserves_the_session_store() { "the success line names the new build:\n{stdout}" ); assert!( - stdout.contains("restart prime-agent to run the new build"), + stdout.contains("restart wv to run the new build"), "the success line carries the restart hint:\n{stdout}" ); - let launcher = sandbox.prefix.join("bin/prime-agent"); + let launcher = sandbox.prefix.join("bin/wv"); assert!(launcher.is_file(), "the launcher landed"); let version = Command::new(&launcher) .arg("--version") @@ -191,17 +191,17 @@ fn update_runs_the_downloaded_installer_and_preserves_the_session_store() { sandbox.assert_session_preserved(); } -/// A nightly install's `prime-agent update` fetches `install-beta.sh` from +/// A nightly install's `wv update` fetches `install-beta.sh` from /// the download base (no installer override): the domain only forwards /// the stable `install.sh`, so nightly updates go to the bucket directly. #[pa_test_scratch::pa_test] #[test] fn a_nightly_update_fetches_install_beta_from_the_download_base() { let sandbox = Sandbox::new(); - let share = sandbox.prefix.join("share/prime-agent"); + let share = sandbox.prefix.join("share/weave"); std::fs::create_dir_all(&share).expect("share dir"); std::fs::write( - share.join(".prime-agent-install"), + share.join(".weave-install"), "install-rust.sh channel beta\nversion 0.9.9-beta.11\n", ) .expect("install marker"); @@ -209,7 +209,7 @@ fn a_nightly_update_fetches_install_beta_from_the_download_base() { let output = prime_agent(&["update"], &sandbox) .env("PRIME_AGENT_DOWNLOAD_BASE_URL", &base) .output() - .expect("run the prime-agent binary"); + .expect("run the wv binary"); let stdout = String::from_utf8_lossy(&output.stdout); assert!( output.status.success(), @@ -236,7 +236,7 @@ fn a_failing_installer_keeps_the_previous_install() { let sandbox = Sandbox::new(); // A previous install exists; the funnel must leave it in place. std::fs::create_dir_all(sandbox.prefix.join("bin")).expect("bin dir"); - let previous = sandbox.prefix.join("bin/prime-agent"); + let previous = sandbox.prefix.join("bin/wv"); std::fs::write(&previous, "#!/bin/sh\necho 9.9.7-continuous.0000001\n").expect("launcher"); make_executable(&previous); let url = serve(FAILING_INSTALLER); @@ -324,19 +324,17 @@ fn installer_env(command: &mut Command, sandbox: &Sandbox) { fn fake_release(sandbox: &Sandbox, version: &str) -> PathBuf { let payload = sandbox.root.join(format!("payload-{version}")); std::fs::create_dir_all(&payload).expect("payload dir"); - let binary = payload.join("prime-agent"); + let binary = payload.join("wv"); std::fs::write(&binary, format!("#!/bin/sh\necho {version}\n")).expect("payload binary"); make_executable(&binary); let platform = pa_core::update::install::current_platform_alias(); - let archive = sandbox - .root - .join(format!("prime-agent-{version}-{platform}.tar.gz")); + let archive = sandbox.root.join(format!("wv-{version}-{platform}.tar.gz")); let status = Command::new("tar") .arg("-czf") .arg(&archive) .arg("-C") .arg(&payload) - .arg("prime-agent") + .arg("wv") .status() .expect("run tar"); assert!(status.success(), "tar the fake release"); @@ -355,12 +353,8 @@ fn assert_ran(output: &std::process::Output, what: &str) -> String { /// The version the live payload's install marker records. fn live_version(sandbox: &Sandbox) -> String { - let marker = std::fs::read_to_string( - sandbox - .prefix - .join("share/prime-agent/.prime-agent-install"), - ) - .expect("the live payload's marker"); + let marker = std::fs::read_to_string(sandbox.prefix.join("share/weave/.weave-install")) + .expect("the live payload's marker"); marker .lines() .nth(1) @@ -379,12 +373,12 @@ fn live_version(sandbox: &Sandbox) -> String { fn update_archive_and_rollback_swap_installer_payloads() { let sandbox = Sandbox::new(); // This build, published as an installer payload. - let live = sandbox.prefix.join("share/prime-agent"); + let live = sandbox.prefix.join("share/weave"); std::fs::create_dir_all(&live).expect("payload dir"); - let binary = live.join("prime-agent"); - std::fs::copy(env!("CARGO_BIN_EXE_prime-agent"), &binary).expect("copy this build"); + let binary = live.join("wv"); + std::fs::copy(env!("CARGO_BIN_EXE_wv"), &binary).expect("copy this build"); std::fs::write( - live.join(".prime-agent-install"), + live.join(".weave-install"), "install-rust.sh channel beta\nversion 9.9.9\n", ) .expect("install marker"); @@ -439,12 +433,12 @@ fn update_archive_and_rollback_swap_installer_payloads() { #[test] fn rollback_check_answers_synchronously_without_touching_the_payload() { let sandbox = Sandbox::new(); - let live = sandbox.prefix.join("share/prime-agent"); + let live = sandbox.prefix.join("share/weave"); std::fs::create_dir_all(&live).expect("payload dir"); - let binary = live.join("prime-agent"); - std::fs::copy(env!("CARGO_BIN_EXE_prime-agent"), &binary).expect("copy this build"); + let binary = live.join("wv"); + std::fs::copy(env!("CARGO_BIN_EXE_wv"), &binary).expect("copy this build"); std::fs::write( - live.join(".prime-agent-install"), + live.join(".weave-install"), "install-rust.sh channel beta\nversion 9.9.9\n", ) .expect("install marker"); @@ -484,7 +478,7 @@ fn rollback_check_answers_synchronously_without_touching_the_payload() { let source = stdout.lines().last().unwrap_or_default().to_string(); let kept = source.strip_prefix(sandbox.prefix.display().to_string().as_str()); assert!( - kept.is_some_and(|rest| rest.starts_with("/share/prime-agent.old.")), + kept.is_some_and(|rest| rest.starts_with("/share/weave.old.")), "the source names the kept generation: {source}" ); assert_eq!(live_version(&sandbox), "1.0.0", "the check touched nothing"); @@ -492,7 +486,7 @@ fn rollback_check_answers_synchronously_without_touching_the_payload() { .expect("tmp dir") .filter_map(std::result::Result::ok) .filter_map(|entry| entry.file_name().into_string().ok()) - .filter(|name| name.contains("prime-agent-download")) + .filter(|name| name.contains("wv-download")) .collect(); assert!( leftovers.is_empty(), @@ -509,30 +503,28 @@ fn rollback_check_answers_synchronously_without_touching_the_payload() { #[test] fn update_archive_refuses_a_misnamed_payload_version() { let sandbox = Sandbox::new(); - let live = sandbox.prefix.join("share/prime-agent"); + let live = sandbox.prefix.join("share/weave"); std::fs::create_dir_all(&live).expect("payload dir"); - let binary = live.join("prime-agent"); - std::fs::copy(env!("CARGO_BIN_EXE_prime-agent"), &binary).expect("copy this build"); + let binary = live.join("wv"); + std::fs::copy(env!("CARGO_BIN_EXE_wv"), &binary).expect("copy this build"); std::fs::write( - live.join(".prime-agent-install"), + live.join(".weave-install"), "install-rust.sh channel beta\nversion 9.9.9\n", ) .expect("install marker"); let platform = pa_core::update::install::current_platform_alias(); let payload_dir = sandbox.root.join("payload-misnamed"); std::fs::create_dir_all(&payload_dir).expect("payload dir"); - let payload = payload_dir.join("prime-agent"); + let payload = payload_dir.join("wv"); std::fs::write(&payload, "#!/bin/sh\necho 0.9.7\n").expect("payload binary"); make_executable(&payload); - let archive = sandbox - .root - .join(format!("prime-agent-9.9.9-{platform}.tar.gz")); + let archive = sandbox.root.join(format!("wv-9.9.9-{platform}.tar.gz")); let status = Command::new("tar") .arg("-czf") .arg(&archive) .arg("-C") .arg(&payload_dir) - .arg("prime-agent") + .arg("wv") .status() .expect("run tar"); assert!(status.success(), "tar the misnamed release"); @@ -555,33 +547,33 @@ fn update_archive_refuses_a_misnamed_payload_version() { } /// The install.ps1 slot: the Windows-native installer keeps its replaced -/// payload at the un-suffixed `prime-agent.old` and never writes the +/// payload at the un-suffixed `wv.old` and never writes the /// generations record, so the CLI's rollback must fall back to that /// slot — a ps1-updated machine's only automated rollback path. #[pa_test_scratch::pa_test] #[test] fn update_rollback_reads_the_unsuffixed_installer_slot() { let sandbox = Sandbox::new(); - let live = sandbox.prefix.join("share/prime-agent"); + let live = sandbox.prefix.join("share/weave"); std::fs::create_dir_all(&live).expect("payload dir"); - let binary = live.join("prime-agent"); - std::fs::copy(env!("CARGO_BIN_EXE_prime-agent"), &binary).expect("copy this build"); + let binary = live.join("wv"); + std::fs::copy(env!("CARGO_BIN_EXE_wv"), &binary).expect("copy this build"); std::fs::write( - live.join(".prime-agent-install"), + live.join(".weave-install"), "install-rust.sh channel beta\nversion 9.9.9\n", ) .expect("install marker"); // The install.ps1 era: the replaced payload sits at the un-suffixed // name, and no generations record exists. - let slot = sandbox.prefix.join("share/prime-agent.old"); + let slot = sandbox.prefix.join("share/weave.old"); std::fs::create_dir_all(&slot).expect("slot dir"); std::fs::write( - slot.join(".prime-agent-install"), + slot.join(".weave-install"), "install-rust.sh channel beta\nversion 1.0.0\n", ) .expect("slot marker"); - std::fs::write(slot.join("prime-agent"), b"#!/bin/sh\necho 1.0.0\n").expect("slot payload"); - make_executable(&slot.join("prime-agent")); + std::fs::write(slot.join("wv"), b"#!/bin/sh\necho 1.0.0\n").expect("slot payload"); + make_executable(&slot.join("wv")); let mut command = Command::new(&binary); command.args(["update", "--rollback"]); @@ -597,9 +589,7 @@ fn update_rollback_reads_the_unsuffixed_installer_slot() { ); // The displaced live tree becomes a recorded generation: the machine // converts to the sh bookkeeping, so the toggle keeps working. - let record = sandbox - .prefix - .join("share/.prime-agent-install-generations"); + let record = sandbox.prefix.join("share/.weave-install-generations"); assert!( record.exists(), "the publish recorded the displaced payload" @@ -613,12 +603,12 @@ fn update_rollback_reads_the_unsuffixed_installer_slot() { #[test] fn update_rollback_without_a_kept_version_changes_nothing() { let sandbox = Sandbox::new(); - let live = sandbox.prefix.join("share/prime-agent"); + let live = sandbox.prefix.join("share/weave"); std::fs::create_dir_all(&live).expect("payload dir"); - let binary = live.join("prime-agent"); - std::fs::copy(env!("CARGO_BIN_EXE_prime-agent"), &binary).expect("copy this build"); + let binary = live.join("wv"); + std::fs::copy(env!("CARGO_BIN_EXE_wv"), &binary).expect("copy this build"); std::fs::write( - live.join(".prime-agent-install"), + live.join(".weave-install"), "install-rust.sh channel beta\nversion 9.9.9\n", ) .expect("install marker"); @@ -665,12 +655,12 @@ fn update_rollback_without_a_kept_version_changes_nothing() { #[test] fn archive_check_answers_synchronously_without_publishing() { let sandbox = Sandbox::new(); - let live = sandbox.prefix.join("share/prime-agent"); + let live = sandbox.prefix.join("share/weave"); std::fs::create_dir_all(&live).expect("payload dir"); - let binary = live.join("prime-agent"); - std::fs::copy(env!("CARGO_BIN_EXE_prime-agent"), &binary).expect("copy this build"); + let binary = live.join("wv"); + std::fs::copy(env!("CARGO_BIN_EXE_wv"), &binary).expect("copy this build"); std::fs::write( - live.join(".prime-agent-install"), + live.join(".weave-install"), "install-rust.sh channel beta\nversion 9.9.9\n", ) .expect("install marker"); @@ -699,7 +689,7 @@ fn archive_check_answers_synchronously_without_publishing() { .expect("share dir") .filter_map(std::result::Result::ok) .filter_map(|entry| entry.file_name().into_string().ok()) - .filter(|name| name.contains("prime-agent.stage")) + .filter(|name| name.contains("wv.stage")) .collect(); assert!(leftovers.is_empty(), "no stage dir survives: {leftovers:?}"); @@ -723,19 +713,17 @@ fn archive_check_answers_synchronously_without_publishing() { fn fake_release_payload(sandbox: &Sandbox, named: &str, reported: &str) -> PathBuf { let payload = sandbox.root.join(format!("payload-mismatch-{named}")); std::fs::create_dir_all(&payload).expect("payload dir"); - let binary = payload.join("prime-agent"); + let binary = payload.join("wv"); std::fs::write(&binary, format!("#!/bin/sh\necho {reported}\n")).expect("payload binary"); make_executable(&binary); let platform = pa_core::update::install::current_platform_alias(); - let archive = sandbox - .root - .join(format!("prime-agent-{named}-{platform}.tar.gz")); + let archive = sandbox.root.join(format!("wv-{named}-{platform}.tar.gz")); let status = Command::new("tar") .arg("-czf") .arg(&archive) .arg("-C") .arg(&payload) - .arg("prime-agent") + .arg("wv") .status() .expect("run tar"); assert!(status.success(), "tar the mismatched release"); diff --git a/crates/pa-cli/tests/interactive_daemon_e2e.rs b/crates/pa-cli/tests/interactive_daemon_e2e.rs index d1a607fc8..74def80f5 100644 --- a/crates/pa-cli/tests/interactive_daemon_e2e.rs +++ b/crates/pa-cli/tests/interactive_daemon_e2e.rs @@ -10,7 +10,7 @@ )] //! End-to-end verifier for the interactive TUI: spawn the real supervisor -//! (`prime-agent --mode daemon`), drive the TUI headlessly against a scripted +//! (`wv --mode daemon`), drive the TUI headlessly against a scripted //! daemon session, and assert on rendered frames plus daemon-side state. The //! `script` seam is the faux provider contract; the product never sets it. #![cfg(unix)] @@ -284,7 +284,7 @@ fn spawn_supervisor(dir: &Path) -> Supervisor { let socket = dir.join("daemon.sock"); let agent_dir = dir.join("agent"); std::fs::create_dir_all(&agent_dir).expect("agent dir"); - let mut command = Command::new(env!("CARGO_BIN_EXE_prime-agent")); + let mut command = Command::new(env!("CARGO_BIN_EXE_wv")); command .args(["--mode", "daemon", "--daemon-socket"]) .arg(&socket) @@ -339,7 +339,7 @@ fn spawn_supervisor(dir: &Path) -> Supervisor { Ok(()) }); } - let child = command.spawn().expect("spawn prime-agent --mode daemon"); + let child = command.spawn().expect("spawn wv --mode daemon"); let deadline = Instant::now() + Duration::from_mins(1); while Instant::now() < deadline { if socket.exists() { @@ -975,7 +975,7 @@ async fn ensure_daemon_running_spawns_supervisor_and_tui_attaches() { let _guard = DetachedDaemon { socket: socket.clone(), }; - let exe = std::path::PathBuf::from(env!("CARGO_BIN_EXE_prime-agent")); + let exe = std::path::PathBuf::from(env!("CARGO_BIN_EXE_wv")); pa_cli::ensure_daemon_running_with(&exe, &socket, dir.path()) .await .expect("spawn the daemon"); @@ -4611,7 +4611,7 @@ async fn tui_idle_session_event_repaints_without_input() { } /// The bare-launch safety regression (the P6 continue-recent trap): a plain -/// `prime-agent` run must open a FRESH session even when a newer saved session +/// `wv` run must open a FRESH session even when a newer saved session /// exists for the cwd — resuming it blindly would resurrect whatever it holds. #[tokio::test] #[pa_test_scratch::pa_test] @@ -5268,7 +5268,7 @@ async fn tui_accepted_then_killed_turn_renders_closed_error() { #[pa_test_scratch::pa_test] async fn tui_close_reason_rows_survive_late_turn_status() { for (reason, explanation) in [ - ("shutdown", "The Prime Agent daemon shut down while this window was attached. The session transcript remains saved; restart Prime Agent and reopen it from Agents View."), + ("shutdown", "The Weave daemon shut down while this window was attached. The session transcript remains saved; restart Weave and reopen it from Agents View."), ("replaced", "The daemon replaced this agent session with another session. Reopen the current session from Agents View."), ] { assert_close_reason_survives_late_turn_status(reason, explanation).await; diff --git a/crates/pa-cli/tests/interactive_fork_e2e.rs b/crates/pa-cli/tests/interactive_fork_e2e.rs index defb99611..0df407115 100644 --- a/crates/pa-cli/tests/interactive_fork_e2e.rs +++ b/crates/pa-cli/tests/interactive_fork_e2e.rs @@ -176,7 +176,7 @@ fn graceful_shutdown(socket: &Path) -> Option { // the kill, and the wait; the lint wants the reap inline instead. #[allow(clippy::zombie_processes)] fn spawn_supervisor(socket: &Path, agent_dir: &Path, session_dir: &Path) -> Supervisor { - let mut command = Command::new(env!("CARGO_BIN_EXE_prime-agent")); + let mut command = Command::new(env!("CARGO_BIN_EXE_wv")); command .args(["--mode", "daemon", "--daemon-socket"]) .arg(socket) @@ -206,7 +206,7 @@ fn spawn_supervisor(socket: &Path, agent_dir: &Path, session_dir: &Path) -> Supe "15000", ); command.env("PA_DAEMON_WORKER_CONNECT_TIMEOUT_MS", "90000"); - let child = command.spawn().expect("spawn prime-agent --mode daemon"); + let child = command.spawn().expect("spawn wv --mode daemon"); let deadline = Instant::now() + Duration::from_secs(15); while Instant::now() < deadline { if socket.exists() { @@ -382,7 +382,7 @@ async fn interactive_fork_launch_copies_and_the_daemon_opens_the_fork() { // The source session: a real print-mode run of the real binary (the // same isolated-home contract the print runtime e2e uses). The print // runtime reads the script env as the script JSON itself. - let seeded = Command::new(env!("CARGO_BIN_EXE_prime-agent")) + let seeded = Command::new(env!("CARGO_BIN_EXE_wv")) .args(["-p", "seedphrase4fork tell me"]) .current_dir(&cwd) .env("PRIME_AGENT_CODING_AGENT_DIR", &agent_dir) diff --git a/crates/pa-cli/tests/lock_compat_e2e.rs b/crates/pa-cli/tests/lock_compat_e2e.rs index ac0ba2c94..b335f6e94 100644 --- a/crates/pa-cli/tests/lock_compat_e2e.rs +++ b/crates/pa-cli/tests/lock_compat_e2e.rs @@ -10,7 +10,7 @@ )] //! Lock-convention compatibility, binary level: the TS `prime-agent` and the -//! Rust `prime-agent` must agree on the lock artifact at `.lock`. The +//! Rust `wv` must agree on the lock artifact at `.lock`. The //! TS product locks with `proper-lockfile`: an empty DIRECTORY whose mtime is //! refreshed while held; its release path `rmdir`s the lock path, so a //! regular FILE there is fatal (ENOTDIR), and a stale directory is reclaimed @@ -26,14 +26,14 @@ use std::path::{Path, PathBuf}; use pa_core::platform::LockDir; /// The TS binary ground truth, located like `differential_cli.rs` -/// (`PA_TS_BINARY` or `prime-agent` on PATH; skipped when absent). +/// (`PA_TS_BINARY` or `wv` on PATH; skipped when absent). fn ts_binary() -> Option { if let Ok(path) = std::env::var("PA_TS_BINARY") { let path = PathBuf::from(path); return path.exists().then_some(path); } let found = Command::new("which") - .arg("prime-agent") + .arg("wv") .output() .ok() .filter(|out| out.status.success())?; @@ -255,7 +255,7 @@ fn ts_binary_sees_a_rust_held_lock_as_contention() { #[pa_test_scratch::pa_test] #[test] fn rust_binary_reclaims_stale_lock_directory_artifact() { - let rust = PathBuf::from(env!("CARGO_BIN_EXE_prime-agent")); + let rust = PathBuf::from(env!("CARGO_BIN_EXE_wv")); let sandbox = sandbox("rs-stale-dir"); seed_stale_lock_dir(&sandbox); let (exit, stdout, stderr) = run( @@ -283,7 +283,7 @@ fn rust_binary_reclaims_stale_lock_directory_artifact() { fn rust_binary_heals_stale_lock_file_artifact() { // Pre-compat Rust builds left flock FILEs at the lock path. The Rust // binary removes the foreign artifact and proceeds; the TS binary cannot. - let rust = PathBuf::from(env!("CARGO_BIN_EXE_prime-agent")); + let rust = PathBuf::from(env!("CARGO_BIN_EXE_wv")); let sandbox = sandbox("rs-stale-file"); seed_stale_lock_file(&sandbox); let (exit, stdout, stderr) = run( diff --git a/crates/pa-cli/tests/mcp_view_e2e.rs b/crates/pa-cli/tests/mcp_view_e2e.rs index 645be85fa..d0c92dd90 100644 --- a/crates/pa-cli/tests/mcp_view_e2e.rs +++ b/crates/pa-cli/tests/mcp_view_e2e.rs @@ -183,7 +183,7 @@ fn spawn_supervisor(dir: &Path) -> Supervisor { .to_string(), ) .expect("write settings"); - let mut command = Command::new(env!("CARGO_BIN_EXE_prime-agent")); + let mut command = Command::new(env!("CARGO_BIN_EXE_wv")); command .args(["--mode", "daemon", "--daemon-socket"]) .arg(&socket) @@ -218,7 +218,7 @@ fn spawn_supervisor(dir: &Path) -> Supervisor { pa_daemon::worker::WORKER_SUPERVISOR_LOST_EXIT_MS_ENV, "15000", ); - let child = command.spawn().expect("spawn prime-agent --mode daemon"); + let child = command.spawn().expect("spawn wv --mode daemon"); let deadline = Instant::now() + Duration::from_secs(15); while Instant::now() < deadline { if socket.exists() { diff --git a/crates/pa-cli/tests/mermaid_titled_empty_subgraph_e2e.rs b/crates/pa-cli/tests/mermaid_titled_empty_subgraph_e2e.rs index 10e7cb89d..bf990e343 100644 --- a/crates/pa-cli/tests/mermaid_titled_empty_subgraph_e2e.rs +++ b/crates/pa-cli/tests/mermaid_titled_empty_subgraph_e2e.rs @@ -182,7 +182,7 @@ fn spawn_supervisor(dir: &Path) -> Supervisor { let socket = dir.join("daemon.sock"); let agent_dir = dir.join("agent"); std::fs::create_dir_all(&agent_dir).expect("agent dir"); - let mut command = Command::new(env!("CARGO_BIN_EXE_prime-agent")); + let mut command = Command::new(env!("CARGO_BIN_EXE_wv")); command .args(["--mode", "daemon", "--daemon-socket"]) .arg(&socket) @@ -225,7 +225,7 @@ fn spawn_supervisor(dir: &Path) -> Supervisor { // A full workspace run can starve a session worker's boot far past the // 30s default connect budget; this keeps session creates deterministic. command.env("PA_DAEMON_WORKER_CONNECT_TIMEOUT_MS", "90000"); - let child = command.spawn().expect("spawn prime-agent --mode daemon"); + let child = command.spawn().expect("spawn wv --mode daemon"); let deadline = Instant::now() + Duration::from_secs(15); while Instant::now() < deadline { if socket.exists() { diff --git a/crates/pa-cli/tests/nix_managed_update.rs b/crates/pa-cli/tests/nix_managed_update.rs index 9f7143e15..36fe5eb0d 100644 --- a/crates/pa-cli/tests/nix_managed_update.rs +++ b/crates/pa-cli/tests/nix_managed_update.rs @@ -61,7 +61,7 @@ async fn nix_ownership_blocks_cli_and_both_direct_installer_boundaries() { "https://example.invalid", ], ] { - let output = Command::new(env!("CARGO_BIN_EXE_prime-agent")) + let output = Command::new(env!("CARGO_BIN_EXE_wv")) .args(&arguments) .env_clear() .env("PATH", std::env::var_os("PATH").unwrap_or_default()) diff --git a/crates/pa-cli/tests/package_e2e.rs b/crates/pa-cli/tests/package_e2e.rs index 98f9e3ae3..15e155c50 100644 --- a/crates/pa-cli/tests/package_e2e.rs +++ b/crates/pa-cli/tests/package_e2e.rs @@ -450,7 +450,7 @@ fn ts_binary() -> Option { return path.exists().then_some(path); } let found = Command::new("which") - .arg("prime-agent") + .arg("wv") .output() .ok() .filter(|out| out.status.success())?; @@ -533,7 +533,7 @@ fn package_manager_corpus_matches_ts_binary() { eprintln!("SKIPPED: TS prime-agent binary not installed"); return; }; - let rust_bin = PathBuf::from(env!("CARGO_BIN_EXE_prime-agent")); + let rust_bin = PathBuf::from(env!("CARGO_BIN_EXE_wv")); let fixtures = make_fixtures(); let base = std::env::temp_dir().join(format!("pa-package-e2e-{}", std::process::id())); diff --git a/crates/pa-cli/tests/package_resources_e2e.rs b/crates/pa-cli/tests/package_resources_e2e.rs index 842732d7d..dcb31084e 100644 --- a/crates/pa-cli/tests/package_resources_e2e.rs +++ b/crates/pa-cli/tests/package_resources_e2e.rs @@ -59,7 +59,7 @@ fn sandbox(settings: &serde_json::Value) -> Sandbox { } fn run(sandbox: &Sandbox, script: &serde_json::Value) -> (String, String, i32) { - let output = Command::new(env!("CARGO_BIN_EXE_prime-agent")) + let output = Command::new(env!("CARGO_BIN_EXE_wv")) .args(["--mode", "json", "-p", "hi"]) .env("HOME", sandbox.home.path()) .env("PRIME_AGENT_CODING_AGENT_DIR", &sandbox.agent_dir) diff --git a/crates/pa-cli/tests/packaged_layout_e2e.rs b/crates/pa-cli/tests/packaged_layout_e2e.rs index 8922941cf..2d9d9a41e 100644 --- a/crates/pa-cli/tests/packaged_layout_e2e.rs +++ b/crates/pa-cli/tests/packaged_layout_e2e.rs @@ -53,15 +53,15 @@ fn serial_lock() -> std::sync::MutexGuard<'static, ()> { } } -/// The staged binary name: Cargo's MSVC linker emits `prime-agent.exe` on +/// The staged binary name: Cargo's MSVC linker emits `wv.exe` on /// Windows (`std::env::consts::EXE_SUFFIX`), and the packaged layout - the /// installer's extract target and the binary's own exe-adjacent resolution /// - names the platform's spelling. fn packaged_binary_name() -> &'static str { if cfg!(windows) { - "prime-agent.exe" + "wv.exe" } else { - "prime-agent" + "wv" } } @@ -70,12 +70,12 @@ fn packaged_binary_name() -> &'static str { fn stage_packaged_layout(dir: &Path, with_runtime: bool) { std::fs::create_dir_all(dir).expect("stage dir"); let binary = dir.join(packaged_binary_name()); - std::fs::copy(env!("CARGO_BIN_EXE_prime-agent"), &binary).expect("copy binary"); + std::fs::copy(env!("CARGO_BIN_EXE_wv"), &binary).expect("copy binary"); set_executable(&binary); std::fs::write( dir.join("package.json"), format!( - r#"{{"name":"prime-agent","version":"{}","piConfig":{{"name":"prime-agent","configDir":".prime/agent"}}}}"#, + r#"{{"name":"wv","version":"{}","piConfig":{{"name":"wv","configDir":".prime/agent"}}}}"#, env!("CARGO_PKG_VERSION") ), ) @@ -313,7 +313,7 @@ fn packaged_binary_reports_manifest_version() { stage_packaged_layout(staged, false); std::fs::write( staged.join("package.json"), - r#"{"name":"prime-agent","version":"9.8.7-test"}"#, + r#"{"name":"wv","version":"9.8.7-test"}"#, ) .expect("version manifest"); let box_ = sandbox(); @@ -461,7 +461,7 @@ fn packaged_layout_stays_hermetic_under_hostile_host_env() { stage_packaged_layout(staged, false); std::fs::write( staged.join("package.json"), - format!(r#"{{"name":"prime-agent","version":"{HOSTILE_STAGED_VERSION}"}}"#), + format!(r#"{{"name":"wv","version":"{HOSTILE_STAGED_VERSION}"}}"#), ) .expect("version manifest"); @@ -471,7 +471,7 @@ fn packaged_layout_stays_hermetic_under_hostile_host_env() { std::fs::create_dir_all(&package_decoy).expect("package decoy dir"); std::fs::write( package_decoy.join("package.json"), - r#"{"name":"prime-agent","version":"0.0.0-decoy"}"#, + r#"{"name":"wv","version":"0.0.0-decoy"}"#, ) .expect("decoy manifest"); let venv_decoy = decoys.path().join("kernel-venv"); @@ -512,13 +512,13 @@ struct PairedFixture { fn split_paired_fixture(python: &str, version: &str, target: &str, alias: &str) -> PairedFixture { let dir = tempfile::TempDir::new().expect("split fixture dir"); - let source = dir.path().join("prime-agent.c"); + let source = dir.path().join("wv.c"); // The packer's version pin runs `--version`: the fixture answers the pinned version. let program = format!( "#include \nint main(int argc, char **argv) {{ (void)argc; (void)argv; puts(\"{version}\"); return 0; }}\n" ); std::fs::write(&source, program).expect("fixture source"); - let raw = dir.path().join("cargo-prime-agent"); + let raw = dir.path().join("cargo-wv"); let compiled = Command::new("gcc") .arg("-g") .arg("-Wl,--build-id") @@ -533,7 +533,7 @@ fn split_paired_fixture(python: &str, version: &str, target: &str, alias: &str) "fixture gcc failed: {}", String::from_utf8_lossy(&compiled.stderr) ); - let shipped = dir.path().join("prime-agent"); + let shipped = dir.path().join("wv"); let split = Command::new(python) .arg( repo_root() @@ -559,9 +559,7 @@ fn split_paired_fixture(python: &str, version: &str, target: &str, alias: &str) "fixture split failed: {}", String::from_utf8_lossy(&split.stderr) ); - let decoder = dir - .path() - .join(format!("prime-agent-{version}-{alias}.debug.gz")); + let decoder = dir.path().join(format!("wv-{version}-{alias}.debug.gz")); assert!(shipped.is_file(), "shipped fixture missing"); assert!(decoder.is_file(), "decoder fixture missing"); PairedFixture { @@ -674,7 +672,7 @@ fn packaging_dry_run_produces_artifact() { Some(fixture.dir), ) } else { - (env!("CARGO_BIN_EXE_prime-agent").into(), None, None) + (env!("CARGO_BIN_EXE_wv").into(), None, None) }; // The platform tag the packer derives on this host: linux-x64 on the // linux CI host, win32-x64 on the windows-latest battery (the channel @@ -685,11 +683,7 @@ fn packaging_dry_run_produces_artifact() { } else { "linux-x64" }; - let staged_binary_name = if cfg!(windows) { - "prime-agent.exe" - } else { - "prime-agent" - }; + let staged_binary_name = if cfg!(windows) { "wv.exe" } else { "wv" }; let mut command = Command::new(python); command .arg(repo_root().join("scripts").join("package_release.py")) @@ -713,9 +707,7 @@ fn packaging_dry_run_produces_artifact() { ); let version = env!("CARGO_PKG_VERSION"); - let stage = out - .path() - .join(format!("prime-agent-{version}-{host_platform}")); + let stage = out.path().join(format!("wv-{version}-{host_platform}")); assert!( stage.join(staged_binary_name).is_file(), "staged binary missing" @@ -725,7 +717,7 @@ fn packaging_dry_run_produces_artifact() { ) .expect("manifest json"); assert_eq!(manifest["version"], version, "version pin: {manifest}"); - assert_eq!(manifest["piConfig"]["name"], "prime-agent"); + assert_eq!(manifest["piConfig"]["name"], "wv"); assert!( stage .join("prime-agent-runtime") @@ -784,7 +776,7 @@ fn packaging_dry_run_produces_artifact() { let archive = out .path() - .join(format!("prime-agent-{version}-{host_platform}.tar.gz")); + .join(format!("wv-{version}-{host_platform}.tar.gz")); assert!(archive.is_file(), "tarball missing"); let sums = std::fs::read_to_string(out.path().join("SHA256SUMS")).expect("SHA256SUMS"); let sha256 = sha256_file(&archive); diff --git a/crates/pa-cli/tests/plugin_headless_e2e.rs b/crates/pa-cli/tests/plugin_headless_e2e.rs index 38f6166dc..1f7a24189 100644 --- a/crates/pa-cli/tests/plugin_headless_e2e.rs +++ b/crates/pa-cli/tests/plugin_headless_e2e.rs @@ -85,7 +85,7 @@ impl Fixture { } fn command(&self) -> Command { - let mut command = Command::new(env!("CARGO_BIN_EXE_prime-agent")); + let mut command = Command::new(env!("CARGO_BIN_EXE_wv")); command.env_clear(); for name in ["PATH", "LD_LIBRARY_PATH", "PI_PACKAGE_DIR"] { if let Some(value) = std::env::var_os(name) { diff --git a/crates/pa-cli/tests/print_inline_subagents_e2e.rs b/crates/pa-cli/tests/print_inline_subagents_e2e.rs index cf0c9dda5..59dda4a34 100644 --- a/crates/pa-cli/tests/print_inline_subagents_e2e.rs +++ b/crates/pa-cli/tests/print_inline_subagents_e2e.rs @@ -68,7 +68,7 @@ impl PrintLane { kernel_python: &Path, env_extra: &[(&str, &str)], ) -> (String, String, i32) { - let bin = env!("CARGO_BIN_EXE_prime-agent"); + let bin = env!("CARGO_BIN_EXE_wv"); // An explicitly selected kernel bypasses skill installation. Exercise // the checkout's messaging and goal skills even in a fresh kernel venv. let skills = Path::new(env!("CARGO_MANIFEST_DIR")).join("../../skills"); diff --git a/crates/pa-cli/tests/print_runtime_e2e.rs b/crates/pa-cli/tests/print_runtime_e2e.rs index ffc3a21d6..2fe113664 100644 --- a/crates/pa-cli/tests/print_runtime_e2e.rs +++ b/crates/pa-cli/tests/print_runtime_e2e.rs @@ -19,7 +19,7 @@ use pa_test_scratch::Command; fn run(args: &[&str], script: &serde_json::Value) -> (String, String, i32) { let home = tempfile::TempDir::new().unwrap(); - let bin = env!("CARGO_BIN_EXE_prime-agent"); + let bin = env!("CARGO_BIN_EXE_wv"); let output = Command::new(bin) .args(args) .env("HOME", home.path()) @@ -115,7 +115,7 @@ fn run_in_home( args: &[&str], script: &serde_json::Value, ) -> (String, String, i32) { - let bin = env!("CARGO_BIN_EXE_prime-agent"); + let bin = env!("CARGO_BIN_EXE_wv"); let output = Command::new(bin) .args(args) .env("HOME", home) @@ -311,7 +311,7 @@ fn fresh_lease_failure_rejects_print_json_and_rpc_before_model_http_or_journal_a "models":[{"id":"lease-model","name":"Lease model","reasoning":false,"input":["text"], "contextWindow":10000,"maxTokens":1000,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0}}] }}}).to_string()).unwrap(); - let output = Command::new(env!("CARGO_BIN_EXE_prime-agent")) + let output = Command::new(env!("CARGO_BIN_EXE_wv")) .args(&args) .args(["--provider", "lease-fixture", "--model", "lease-model"]) .env("HOME", home.path()) @@ -480,7 +480,7 @@ fn print_mode_resume_unknown_selector_fails_with_browse_hint() { "stderr: {stderr}" ); assert!( - stderr.contains("Open prime-agent and press left-arrow to browse sessions."), + stderr.contains("Open wv and press left-arrow to browse sessions."), "stderr: {stderr}" ); } @@ -967,7 +967,7 @@ fn run_in_home_cwd( args: &[&str], script: &serde_json::Value, ) -> (String, String, i32) { - let bin = env!("CARGO_BIN_EXE_prime-agent"); + let bin = env!("CARGO_BIN_EXE_wv"); let output = Command::new(bin) .args(args) .env("HOME", home) diff --git a/crates/pa-cli/tests/refresh_models_e2e.rs b/crates/pa-cli/tests/refresh_models_e2e.rs index ba9afb93c..14a7ca24e 100644 --- a/crates/pa-cli/tests/refresh_models_e2e.rs +++ b/crates/pa-cli/tests/refresh_models_e2e.rs @@ -10,7 +10,7 @@ use std::path::Path; use std::process::{Output, Stdio}; fn cli_command(dir: &Path, args: &[&str]) -> Command { - let mut command = Command::new(env!("CARGO_BIN_EXE_prime-agent")); + let mut command = Command::new(env!("CARGO_BIN_EXE_wv")); command .args(args) .env_clear() diff --git a/crates/pa-cli/tests/rpc_mode_e2e.rs b/crates/pa-cli/tests/rpc_mode_e2e.rs index fc085660f..b823c7ada 100644 --- a/crates/pa-cli/tests/rpc_mode_e2e.rs +++ b/crates/pa-cli/tests/rpc_mode_e2e.rs @@ -52,7 +52,7 @@ impl RpcChild { std::fs::create_dir_all(&agent_dir).unwrap(); std::fs::write(agent_dir.join("models.json"), models.to_string()).unwrap(); } - let bin = env!("CARGO_BIN_EXE_prime-agent"); + let bin = env!("CARGO_BIN_EXE_wv"); let mut child = Command::new(bin) .args(args) .env("HOME", home.path()) @@ -1154,7 +1154,7 @@ impl TimedRpcChild { /// Spawn with the reader deferred (stdout held unread until `begin_reading`). fn spawn_stalled(fixture: &std::path::Path, script: &Value) -> TimedRpcChild { let home = tempfile::TempDir::new().unwrap(); - let bin = env!("CARGO_BIN_EXE_prime-agent"); + let bin = env!("CARGO_BIN_EXE_wv"); let mut child = Command::new(bin) .args(["--mode", "rpc", "--resume", fixture.to_str().unwrap()]) .env("HOME", home.path()) diff --git a/crates/pa-cli/tests/settings_mcp_save.rs b/crates/pa-cli/tests/settings_mcp_save.rs index a1199e8e1..e21df5d3f 100644 --- a/crates/pa-cli/tests/settings_mcp_save.rs +++ b/crates/pa-cli/tests/settings_mcp_save.rs @@ -20,7 +20,7 @@ fn first_mcp_server_can_be_added_after_chat_detail_save_or_legacy_null() { let mut manager = SettingsManager::create(dir.path(), &agent); manager.set_chat_detail("details").unwrap(); let mut expected: Value = serde_json::from_slice(&std::fs::read(&path).unwrap()).unwrap(); - let output = Command::new(env!("CARGO_BIN_EXE_prime-agent")) + let output = Command::new(env!("CARGO_BIN_EXE_wv")) .args(["mcp", "add", "fixture", "--", "fixture-command"]) .env("PRIME_AGENT_CODING_AGENT_DIR", &agent) .env("DO_NOT_TRACK", "1") @@ -48,7 +48,7 @@ fn mcp_registration_preserves_invalid_documents_and_non_null_maps() { let dir = tempfile::tempdir().unwrap(); let path = dir.path().join("settings.json"); std::fs::write(&path, content).unwrap(); - let output = Command::new(env!("CARGO_BIN_EXE_prime-agent")) + let output = Command::new(env!("CARGO_BIN_EXE_wv")) .args(["mcp", "add", "fixture", "--", "fixture-command"]) .env("PRIME_AGENT_CODING_AGENT_DIR", dir.path()) .env("DO_NOT_TRACK", "1") diff --git a/crates/pa-cli/tests/subagent_panel_nav_e2e.rs b/crates/pa-cli/tests/subagent_panel_nav_e2e.rs index 78d7381d5..ad74eba81 100644 --- a/crates/pa-cli/tests/subagent_panel_nav_e2e.rs +++ b/crates/pa-cli/tests/subagent_panel_nav_e2e.rs @@ -81,7 +81,7 @@ fn spawn_supervisor(dir: &Path) -> Supervisor { let socket = dir.join("daemon.sock"); let agent_dir = dir.join("agent"); std::fs::create_dir_all(&agent_dir).expect("agent dir"); - let mut command = Command::new(env!("CARGO_BIN_EXE_prime-agent")); + let mut command = Command::new(env!("CARGO_BIN_EXE_wv")); command .args(["--mode", "daemon", "--daemon-socket"]) .arg(&socket) @@ -110,7 +110,7 @@ fn spawn_supervisor(dir: &Path) -> Supervisor { pa_daemon::worker::WORKER_SUPERVISOR_LOST_EXIT_MS_ENV, "15000", ); - let child = command.spawn().expect("spawn prime-agent --mode daemon"); + let child = command.spawn().expect("spawn wv --mode daemon"); let deadline = Instant::now() + Duration::from_secs(15); while Instant::now() < deadline { if socket.exists() { diff --git a/crates/pa-cli/tests/subagent_panel_nested_count_e2e.rs b/crates/pa-cli/tests/subagent_panel_nested_count_e2e.rs index 21c02b7f4..e5e0be799 100644 --- a/crates/pa-cli/tests/subagent_panel_nested_count_e2e.rs +++ b/crates/pa-cli/tests/subagent_panel_nested_count_e2e.rs @@ -49,7 +49,7 @@ fn spawn_supervisor(dir: &Path) -> Supervisor { let socket = dir.join("daemon.sock"); let agent_dir = dir.join("agent"); std::fs::create_dir_all(&agent_dir).expect("agent dir"); - let mut command = Command::new(env!("CARGO_BIN_EXE_prime-agent")); + let mut command = Command::new(env!("CARGO_BIN_EXE_wv")); command .args(["--mode", "daemon", "--daemon-socket"]) .arg(&socket) @@ -73,7 +73,7 @@ fn spawn_supervisor(dir: &Path) -> Supervisor { pa_daemon::worker::WORKER_SUPERVISOR_LOST_EXIT_MS_ENV, "15000", ); - let child = command.spawn().expect("spawn prime-agent --mode daemon"); + let child = command.spawn().expect("spawn wv --mode daemon"); let deadline = Instant::now() + Duration::from_secs(15); while Instant::now() < deadline { if socket.exists() { diff --git a/crates/pa-cli/tests/view_switch_latency_e2e.rs b/crates/pa-cli/tests/view_switch_latency_e2e.rs index 4683cee7b..4235ccd41 100644 --- a/crates/pa-cli/tests/view_switch_latency_e2e.rs +++ b/crates/pa-cli/tests/view_switch_latency_e2e.rs @@ -90,7 +90,7 @@ fn spawn_supervisor(dir: &Path) -> Supervisor { let socket = dir.join("daemon.sock"); let agent_dir = dir.join("agent"); std::fs::create_dir_all(&agent_dir).expect("agent dir"); - let mut command = Command::new(env!("CARGO_BIN_EXE_prime-agent")); + let mut command = Command::new(env!("CARGO_BIN_EXE_wv")); command .args(["--mode", "daemon", "--daemon-socket"]) .arg(&socket) @@ -114,7 +114,7 @@ fn spawn_supervisor(dir: &Path) -> Supervisor { pa_daemon::worker::WORKER_SUPERVISOR_LOST_EXIT_MS_ENV, "15000", ); - let child = command.spawn().expect("spawn prime-agent --mode daemon"); + let child = command.spawn().expect("spawn wv --mode daemon"); let deadline = Instant::now() + Duration::from_secs(15); while Instant::now() < deadline { if socket.exists() { diff --git a/crates/pa-cli/tests/windows_runtime_triage_e2e.rs b/crates/pa-cli/tests/windows_runtime_triage_e2e.rs index 120c4fbf4..dab6f75d6 100644 --- a/crates/pa-cli/tests/windows_runtime_triage_e2e.rs +++ b/crates/pa-cli/tests/windows_runtime_triage_e2e.rs @@ -6,7 +6,7 @@ //! need to give you an easy way to test things"): three scripted TUI //! scenarios that boot the freshly-built binary against a real daemon and //! assert the Windows-reported breakages stay fixed. The workflow -//! `.github/workflows/windows-runtime-triage.yml` runs this battery on +//! The Windows runtime triage runbook runs this battery on //! windows-2022 for Windows-touched PRs and nightly on main, and uploads //! the captured pane dumps (`WINDOWS_RUNTIME_TRIAGE_DUMP_DIR`) as run //! artifacts the fleet can read. @@ -50,7 +50,7 @@ use pa_tui::interactive::{ use serde_json::{json, Map, Value}; /// The daemon supervisor spawned as the freshly-built binary -/// (`CARGO_BIN_EXE_prime-agent --mode daemon`). +/// (`CARGO_BIN_EXE_wv --mode daemon`). struct Supervisor { child: Child, socket: PathBuf, @@ -115,7 +115,7 @@ fn daemon_endpoint(dir: &Path) -> PathBuf { .map(|stamp| stamp.as_nanos()) .unwrap_or_default(); PathBuf::from(format!( - r"\\.\pipe\prime-agent-triage-{}-{unique}", + r"\\.\pipe\wv-triage-{}-{unique}", std::process::id() )) } @@ -128,7 +128,7 @@ fn spawn_supervisor(dir: &Path) -> Supervisor { let socket = daemon_endpoint(dir); let agent_dir = dir.join("agent"); std::fs::create_dir_all(&agent_dir).expect("agent dir"); - let mut command = Command::new(env!("CARGO_BIN_EXE_prime-agent")); + let mut command = Command::new(env!("CARGO_BIN_EXE_wv")); command .args(["--mode", "daemon", "--daemon-socket"]) .arg(&socket) @@ -182,7 +182,7 @@ fn spawn_supervisor(dir: &Path) -> Supervisor { Ok(()) }); } - let child = command.spawn().expect("spawn prime-agent --mode daemon"); + let child = command.spawn().expect("spawn wv --mode daemon"); Supervisor { child, socket } } diff --git a/crates/pa-core/Cargo.toml b/crates/pa-core/Cargo.toml index 8cfd21932..fe9ea8919 100644 --- a/crates/pa-core/Cargo.toml +++ b/crates/pa-core/Cargo.toml @@ -17,7 +17,7 @@ thiserror.workspace = true tracing.workspace = true pa-types.workspace = true pa-ai.workspace = true -pa-models = { path = "../pa-models", version = "0.10.0" } +pa-models = { path = "../pa-models", version = "0.1.0" } pa-agent.workspace = true base64 = "0.22" fancy-regex = "0.14" diff --git a/crates/pa-core/src/export_html/mod.rs b/crates/pa-core/src/export_html/mod.rs index d6f7aa714..097ff4b58 100644 --- a/crates/pa-core/src/export_html/mod.rs +++ b/crates/pa-core/src/export_html/mod.rs @@ -25,7 +25,7 @@ pub use self::tool_render::{ }; /// The app name in generated export file names. -pub const EXPORT_APP_NAME: &str = "prime-agent"; +pub const EXPORT_APP_NAME: &str = "wv"; const TEMPLATE_HTML: &str = include_str!("../../assets/export-html/template.html"); const TEMPLATE_CSS: &str = include_str!("../../assets/export-html/template.css"); @@ -267,7 +267,7 @@ mod tests { std::env::set_current_dir(cwd.path()).expect("chdir"); let returned = export_from_file(&session, None, &agent_dir).expect("export"); std::env::set_current_dir(previous).expect("restore cwd"); - assert_eq!(returned, "prime-agent-session-fixture-session.html"); + assert_eq!(returned, "wv-session-fixture-session.html"); assert!(cwd.path().join(&returned).exists()); } diff --git a/crates/pa-core/src/kernel/bootstrap/dir_lock.rs b/crates/pa-core/src/kernel/bootstrap/dir_lock.rs index b108ab468..c2aaf3dab 100644 --- a/crates/pa-core/src/kernel/bootstrap/dir_lock.rs +++ b/crates/pa-core/src/kernel/bootstrap/dir_lock.rs @@ -70,7 +70,7 @@ pub(crate) async fn acquire_bootstrap_lock(venv: &Path) -> anyhow::Result= deadline { anyhow::bail!( "Timed out after {} seconds waiting for the Python kernel bootstrap lock at {}. \ - Another Prime Agent process may still be setting up this runtime. \ + Another Weave process may still be setting up this runtime. \ Retry after it finishes. If setup was interrupted, verify that no process \ is setting up this runtime before removing this lock and retrying.", BOOTSTRAP_LOCK_WAIT.as_secs(), diff --git a/crates/pa-core/src/kernel/bootstrap/mod.rs b/crates/pa-core/src/kernel/bootstrap/mod.rs index 5f8d689ac..87a987ef2 100644 --- a/crates/pa-core/src/kernel/bootstrap/mod.rs +++ b/crates/pa-core/src/kernel/bootstrap/mod.rs @@ -108,7 +108,7 @@ impl EnsureKernelPythonOptions { fn format_bootstrap_failure(error: &anyhow::Error) -> anyhow::Error { let mut message = format!( "Failed to set up the Python kernel runtime. {error:#}\n\ - First-time setup needs the bundled local runtime and internet to install uv, Python, and default Python packages; once set up, Prime Agent runs offline. \ + First-time setup needs the bundled local runtime and internet to install uv, Python, and default Python packages; once set up, Weave runs offline. \ An interrupted runtime upgrade needs network once more, so re-run this while online. \ Set PRIME_AGENT_KERNEL_PYTHON to a Python with a current prime-agent-runtime and default Python packages installed to skip auto-bootstrap." ); @@ -117,7 +117,7 @@ fn format_bootstrap_failure(error: &anyhow::Error) -> anyhow::Error { if venv::packaged_runtime_dir().is_none() { let package = venv::package_dir(); let _ = write!(message, - "\nThe packaged prime-agent-runtime directory was not found (looked next to the executable at {} and PI_PACKAGE_DIR); reinstall prime-agent so the kernel runtime ships beside the binary.", + "\nThe packaged prime-agent-runtime directory was not found (looked next to the executable at {} and PI_PACKAGE_DIR); reinstall wv so the kernel runtime ships beside the binary.", package.display() ); } diff --git a/crates/pa-core/src/kernel/bootstrap/venv/runtime_source.rs b/crates/pa-core/src/kernel/bootstrap/venv/runtime_source.rs index 049f648cc..5766793a1 100644 --- a/crates/pa-core/src/kernel/bootstrap/venv/runtime_source.rs +++ b/crates/pa-core/src/kernel/bootstrap/venv/runtime_source.rs @@ -59,7 +59,7 @@ fn resolve_runtime_source_dir(package: &Path, checkout: Option<&Path>) -> Option pub(in crate::kernel::bootstrap) fn require_runtime_source_dir() -> anyhow::Result { resolve_runtime_source_dir(&package_dir(), crate::packages::source_checkout_root()).context( - "Prime Agent requires a local prime-agent-runtime directory containing its pyproject.toml, uv.lock and src/rlm sources; reinstall Prime Agent with the runtime beside the binary, or set PI_PACKAGE_DIR to the complete trusted package directory. The runtime will not be downloaded from a package index.", + "Weave requires a local prime-agent-runtime directory containing its pyproject.toml, uv.lock and src/rlm sources; reinstall Weave with the runtime beside the binary, or set PI_PACKAGE_DIR to the complete trusted package directory. The runtime will not be downloaded from a package index.", ) } diff --git a/crates/pa-core/src/kernel/manager/startup.rs b/crates/pa-core/src/kernel/manager/startup.rs index 9bbd33135..aaf6616e5 100644 --- a/crates/pa-core/src/kernel/manager/startup.rs +++ b/crates/pa-core/src/kernel/manager/startup.rs @@ -272,7 +272,7 @@ impl Inner { crate::kernel::bootstrap::invalidate_runtime_probe_cache(); return Err(anyhow!( "Kernel runtime speaks protocol {protocol}, expected {REPL_PROTOCOL_VERSION}. \ - Update prime-agent-runtime in the kernel Python (PRIME_AGENT_KERNEL_PYTHON) to match this prime-agent." + Update prime-agent-runtime in the kernel Python (PRIME_AGENT_KERNEL_PYTHON) to match this wv." )); } { diff --git a/crates/pa-core/src/kernel/provisioner.rs b/crates/pa-core/src/kernel/provisioner.rs index dc459d88f..48517f1e5 100644 --- a/crates/pa-core/src/kernel/provisioner.rs +++ b/crates/pa-core/src/kernel/provisioner.rs @@ -1692,7 +1692,7 @@ mod tests { ))); assert!(!startup_failure_is_retryable(&anyhow!( "Kernel runtime speaks protocol 2, expected 3. \ - Update prime-agent-runtime in the kernel Python (PRIME_AGENT_KERNEL_PYTHON) to match this prime-agent." + Update prime-agent-runtime in the kernel Python (PRIME_AGENT_KERNEL_PYTHON) to match this wv." ))); } diff --git a/crates/pa-core/src/mcp/oauth_callback.rs b/crates/pa-core/src/mcp/oauth_callback.rs index 1047d93c1..965d261e0 100644 --- a/crates/pa-core/src/mcp/oauth_callback.rs +++ b/crates/pa-core/src/mcp/oauth_callback.rs @@ -420,7 +420,7 @@ async fn serve_callback(mut stream: CallbackConnection, shared: &CallbackShared) let _ = write_response( &mut stream, "400 Bad Request", - oauth_error_page("Prime Agent", "Callback route not found."), + oauth_error_page("Weave", "Callback route not found."), ) .await; return; @@ -451,7 +451,7 @@ async fn serve_callback(mut stream: CallbackConnection, shared: &CallbackShared) let _ = write_response( &mut stream, "404 Not Found", - oauth_error_page("Prime Agent", "Callback route not found."), + oauth_error_page("Weave", "Callback route not found."), ) .await; return; @@ -466,8 +466,8 @@ async fn serve_callback(mut stream: CallbackConnection, shared: &CallbackShared) &mut stream, "400 Bad Request", oauth_error_page( - "Prime Agent", - &format!("Prime Agent authentication failed. Error: {error}"), + "Weave", + &format!("Weave authentication failed. Error: {error}"), ), ) .await; @@ -479,9 +479,7 @@ async fn serve_callback(mut stream: CallbackConnection, shared: &CallbackShared) let _ = write_response( &mut stream, "200 OK", - oauth_success_page( - "Prime Agent authentication completed. You can close this window.", - ), + oauth_success_page("Weave authentication completed. You can close this window."), ) .await; } @@ -490,7 +488,7 @@ async fn serve_callback(mut stream: CallbackConnection, shared: &CallbackShared) let _ = write_response( &mut stream, "400 Bad Request", - oauth_error_page("Prime Agent", "Missing code or state parameter."), + oauth_error_page("Weave", "Missing code or state parameter."), ) .await; } @@ -620,7 +618,7 @@ fn render_page(title: &str, message: &str) -> String { } fn oauth_success_page(message: &str) -> String { - render_page("Prime Agent authentication completed", message) + render_page("Weave authentication completed", message) } fn oauth_error_page(label: &str, message: &str) -> String { diff --git a/crates/pa-core/src/mcp/oauth_discovery.rs b/crates/pa-core/src/mcp/oauth_discovery.rs index 17c2064a4..1cdce393a 100644 --- a/crates/pa-core/src/mcp/oauth_discovery.rs +++ b/crates/pa-core/src/mcp/oauth_discovery.rs @@ -434,7 +434,7 @@ pub(crate) async fn register_client( ) -> Result { validated_https_url(registration_endpoint, "Registration endpoint")?; let mut body = serde_json::json!({ - "client_name": format!("Prime Agent ({label})"), + "client_name": format!("Weave ({label})"), "redirect_uris": super::oauth_callback::redirect_uris(callback_port)?, "grant_types": ["authorization_code", "refresh_token"], "response_types": ["code"], diff --git a/crates/pa-core/src/models/prime_inference.rs b/crates/pa-core/src/models/prime_inference.rs index 04b70c2dc..263d99139 100644 --- a/crates/pa-core/src/models/prime_inference.rs +++ b/crates/pa-core/src/models/prime_inference.rs @@ -74,7 +74,7 @@ mod tests { let path = std::path::PathBuf::from(path); return path.is_dir().then_some(path); } - let path = pa_types::platform::home_dir()?.join("prime-agent"); + let path = pa_types::platform::home_dir()?.join("wv"); path.is_dir().then_some(path) } diff --git a/crates/pa-core/src/models/resolver.rs b/crates/pa-core/src/models/resolver.rs index 9036a077e..8283569d1 100644 --- a/crates/pa-core/src/models/resolver.rs +++ b/crates/pa-core/src/models/resolver.rs @@ -389,7 +389,7 @@ pub fn resolve_cli_model( provider = Some(p); } else { result.error = Some(format!( - "Unknown provider \"{cli_provider}\". Use \"prime-agent model list\" to see available providers/models." + "Unknown provider \"{cli_provider}\". Use \"wv model list\" to see available providers/models." )); return result; } @@ -504,7 +504,7 @@ pub fn resolve_cli_model( None => cli_model.to_string(), }; result.error = Some(format!( - "Model \"{display}\" not found. Use \"prime-agent model list\" to see available models." + "Model \"{display}\" not found. Use \"wv model list\" to see available models." )); result } diff --git a/crates/pa-core/src/packages/tests.rs b/crates/pa-core/src/packages/tests.rs index fc3c3bca0..adad7b2de 100644 --- a/crates/pa-core/src/packages/tests.rs +++ b/crates/pa-core/src/packages/tests.rs @@ -358,10 +358,10 @@ fn exe_dir_of_resolves_a_launcher_symlink() { let bin = root.path().join("bin"); std::fs::create_dir_all(&libexec).unwrap(); std::fs::create_dir_all(&bin).unwrap(); - std::fs::write(libexec.join("prime-agent"), b"binary").unwrap(); - let launcher = bin.join("prime-agent"); - std::os::unix::fs::symlink(libexec.join("prime-agent"), &launcher).unwrap(); - let real = libexec.join("prime-agent"); + std::fs::write(libexec.join("wv"), b"binary").unwrap(); + let launcher = bin.join("wv"); + std::os::unix::fs::symlink(libexec.join("wv"), &launcher).unwrap(); + let real = libexec.join("wv"); assert_eq!(exe_dir_of(&launcher), Some(libexec.clone())); assert_eq!(exe_dir_of(&real), Some(libexec)); } diff --git a/crates/pa-core/src/prompts/layers/core.md b/crates/pa-core/src/prompts/layers/core.md index 9fd63fddb..82d6dacd9 100644 --- a/crates/pa-core/src/prompts/layers/core.md +++ b/crates/pa-core/src/prompts/layers/core.md @@ -1,6 +1,6 @@ -# prime-agent harness +# weave harness -The prime-agent harness has one tool: `python_repl`, a persistent CPython REPL. All other tools are "programmatic tools", functions inside the Python REPL called via "programmatic tool calling" (PTC). All programmatic tools are async unless described otherwise and can be run in the background. `await` works directly and globally in the REPL. +The weave harness has one tool: `python_repl`, a persistent CPython REPL. All other tools are "programmatic tools", functions inside the Python REPL called via "programmatic tool calling" (PTC). All programmatic tools are async unless described otherwise and can be run in the background. `await` works directly and globally in the REPL. The harness often sends messages to the agent. These are user messages starting with `[(: )(
)]` followed by a newline and then the content. They are not user-generated. @@ -77,7 +77,7 @@ Saved export callables keep their original session and generation. After a plugi ## Subagents -prime-agent is a recursive harness. Each session builds a tree of agents, starting at depth 0. Each agent up to a user-configured limit can launch subagents. These subagents are persistent, just like the root session. Each agent can communicate with its nuclear family: its singular parent (except for depth 0 sessions which have no parent), its siblings (other subagents under the same parent), and its children (its own subagents). +weave is a recursive harness. Each session builds a tree of agents, starting at depth 0. Each agent up to a user-configured limit can launch subagents. These subagents are persistent, just like the root session. Each agent can communicate with its nuclear family: its singular parent (except for depth 0 sessions which have no parent), its siblings (other subagents under the same parent), and its children (its own subagents). The following programmatic tools are available in the REPL for subagent management: @@ -123,14 +123,14 @@ The following programmatic tools are available in the REPL for a2a communication ## Compaction -prime-agent compacts automatically before the context fills the model's window: at 95% of it, or earlier when the request needs room for its output and for a reserve. The user and the agent can also trigger compaction. Compaction keeps the most recent part of the conversation in place. REPL state persists across compactions. +Weave compacts automatically before the context fills the model's window: at 95% of it, or earlier when the request needs room for its output and for a reserve. The user and the agent can also trigger compaction. Compaction keeps the most recent part of the conversation in place. REPL state persists across compactions. - `compact.run(instructions: str | None = None) -> dict`: schedule a compaction at the next assistant turn boundary - `compact.status() -> dict`: context usage & threshold before auto-compaction ## Goal -In goal mode prime-agent helps an agent stay on track until a task is fully finished, and handles interruptions and other issues. Goals can be user- or agent-created. +In goal mode weave helps an agent stay on track until a task is fully finished, and handles interruptions and other issues. Goals can be user- or agent-created. - `goal.create(objective: str, token_budget: int | None = None) -> dict`: create goal and return goal state - `goal.get() -> dict`: get goal status (only one goal can be active at a time) @@ -138,7 +138,7 @@ In goal mode prime-agent helps an agent stay on track until a task is fully fini ## Heartbeat -In prime-agent, agents can create heartbeats to wake themselves up after a given period of time with remembered instructions, recurrently on a given schedule. +In weave, agents can create heartbeats to wake themselves up after a given period of time with remembered instructions, recurrently on a given schedule. - `rlm_heartbeat.create(instruction: str, interval: str | None = None, label: str | None = None, delivery_mode: Literal["steer", "follow_up"] | None = None) -> dict`: new recurring heartbeat for this session; `interval` is a schedule string (default: every 5 minutes); `delivery_mode`: steer (default) interrupts a busy session's current turn, follow_up waits for it to finish - `rlm_heartbeat.list(include_inactive: bool = False) -> dict` @@ -147,7 +147,7 @@ In prime-agent, agents can create heartbeats to wake themselves up after a given ## MCP -prime-agent has support for programmatic tools that are defined in the MCP format. Their schema is discovered at runtime. +weave has support for programmatic tools that are defined in the MCP format. Their schema is discovered at runtime. - `mcp.list_tools(server: str) -> list[dict]`: returns tool schemas - `mcp.call_tool(server: str, tool: str, arguments: dict | None = None) -> Any` @@ -156,6 +156,6 @@ prime-agent has support for programmatic tools that are defined in the MCP forma ## Skills -prime-agent provides multiple executable skills, described by their SKILL.md and executable code. A skill's module can be inspected with `help()` or `dir()`, and the callable with `inspect.signature(.)`, if information is missing. The executable code is always pre-imported in the REPL as a programmatic tool, and a callable skill module can be called directly (`await (...)`). +weave provides multiple executable skills, described by their SKILL.md and executable code. A skill's module can be inspected with `help()` or `dir()`, and the callable with `inspect.signature(.)`, if information is missing. The executable code is always pre-imported in the REPL as a programmatic tool, and a callable skill module can be called directly (`await (...)`). All programmatic tools described above except for `bash`, `rlm.*`, `mcp.*`, and `plugin.*` are implemented as executable skills and will be listed again in the dynamic tail of this prompt. Additional executable and non-executable skills may exist as well; non-executable (markdown) skills are documentation read from disk, and each skill is also available as a shell command by the same name. diff --git a/crates/pa-core/src/prompts/model_prompts.rs b/crates/pa-core/src/prompts/model_prompts.rs index 15bc48bff..f0e88f7cd 100644 --- a/crates/pa-core/src/prompts/model_prompts.rs +++ b/crates/pa-core/src/prompts/model_prompts.rs @@ -184,7 +184,7 @@ fn resolve_model_prompts( agent_dir: &Path, ) -> ModelPromptResolution { // Both layers are validated regardless; the selector only gates which - // rules match, so `prime-agent prompt` with no `--model` still reports + // rules match, so `wv prompt` with no `--model` still reports // a broken map. let segments = selector.map(selector_segments); let mut errors = Vec::new(); diff --git a/crates/pa-core/src/prompts/system_prompt.rs b/crates/pa-core/src/prompts/system_prompt.rs index 2b01564a1..2d7d02546 100644 --- a/crates/pa-core/src/prompts/system_prompt.rs +++ b/crates/pa-core/src/prompts/system_prompt.rs @@ -425,7 +425,7 @@ mod tests { fn default_prompt_is_layered_with_static_prefix_first() { let breakdown = system_prompt_breakdown(&base_options()); let prompt = &breakdown.assembled; - assert!(prompt.starts_with("# prime-agent harness")); + assert!(prompt.starts_with("# weave harness")); assert_eq!(breakdown.segments[0].kind, SegmentKind::Static); assert_eq!(breakdown.segments[0].name, "core"); let names: Vec<&str> = breakdown @@ -492,7 +492,7 @@ mod tests { assert!(prompt.contains("## AGENTS.md\n\nRule one.")); assert!(prompt.contains("Working directory: /w")); assert!(prompt.contains("Current date: ")); - assert!(!prompt.contains("# prime-agent harness")); + assert!(!prompt.contains("# weave harness")); assert!(!prompt.contains("Tier-2 guidance.")); } diff --git a/crates/pa-core/src/session_engine/engine/append_system_tests.rs b/crates/pa-core/src/session_engine/engine/append_system_tests.rs index 4bcdcbfb6..bc659cc3b 100644 --- a/crates/pa-core/src/session_engine/engine/append_system_tests.rs +++ b/crates/pa-core/src/session_engine/engine/append_system_tests.rs @@ -75,7 +75,7 @@ async fn assert_prompt_case(case: PromptCase) { if case.custom_system { assert!(prompt.starts_with("CUSTOM_SYSTEM_SENTINEL")); } else { - assert!(prompt.starts_with("# prime-agent harness")); + assert!(prompt.starts_with("# weave harness")); } for context in ["PROJECT_CONTEXT_SENTINEL", "GLOBAL_CONTEXT_SENTINEL"] { assert_eq!(prompt.matches(context).count(), 1); diff --git a/crates/pa-core/src/session_engine/engine/tests.rs b/crates/pa-core/src/session_engine/engine/tests.rs index b2b8696ad..1e15c220d 100644 --- a/crates/pa-core/src/session_engine/engine/tests.rs +++ b/crates/pa-core/src/session_engine/engine/tests.rs @@ -101,7 +101,7 @@ async fn engine_runs_tool_loop_and_persists() { // The system prompt is the layered assembly: static core layer // first, dynamic tail after. - assert!(engine.system_prompt.starts_with("# prime-agent harness")); + assert!(engine.system_prompt.starts_with("# weave harness")); assert!(engine .system_prompt .contains("Recursive agent depth: 0 (root)")); diff --git a/crates/pa-core/src/session_engine/rlm_host.rs b/crates/pa-core/src/session_engine/rlm_host.rs index ca4f5d3fd..efe3aa722 100644 --- a/crates/pa-core/src/session_engine/rlm_host.rs +++ b/crates/pa-core/src/session_engine/rlm_host.rs @@ -311,7 +311,7 @@ pub fn rlm_child_session_dir( .join("session-artifacts") .join(session_id) .join(child_id), - None => std::env::temp_dir().join(format!("prime-agent-rlm-{child_id}")), + None => std::env::temp_dir().join(format!("wv-rlm-{child_id}")), }; std::fs::create_dir_all(&base).map_err(|error| { anyhow::anyhow!("create RLM child session dir {}: {error}", base.display()) diff --git a/crates/pa-core/src/update/download.rs b/crates/pa-core/src/update/download.rs index 44ef97f80..433ce0ca2 100644 --- a/crates/pa-core/src/update/download.rs +++ b/crates/pa-core/src/update/download.rs @@ -237,8 +237,8 @@ fn file_digest(path: &Path) -> Result { Ok(hex(&digest.finalize())) } -/// The manual/direct install (`prime-agent update --archive`): stage a -/// The manual/direct install (`prime-agent update --archive`): stage a +/// The manual/direct install (`wv update --archive`): stage a +/// The manual/direct install (`wv update --archive`): stage a /// locally-built payload (directory or archive) into /// `releases/--/`, its name the digest of the /// STAGED tree; a manual install can never write over a running binary. @@ -323,9 +323,9 @@ async fn stage_payload_version(payload: &Path, staging: &Path) -> Result } else { unpack_archive_into(payload, staging)?; } - let binary = staging.join("prime-agent"); + let binary = staging.join("wv"); if !binary.is_file() { - anyhow::bail!("the release payload is missing prime-agent"); + anyhow::bail!("the release payload is missing wv"); } make_executable(&binary)?; let version = binary_reported_version(&binary).await?; @@ -420,7 +420,7 @@ fn finish_staging( anyhow::bail!("the staged release is missing {asset}"); } } - let binary = staging.join("prime-agent"); + let binary = staging.join("wv"); make_executable(&binary)?; std::fs::write(staging.join(".archive-sha256"), archive_sha256)?; std::fs::write(staging.join(".install-source"), install_source)?; @@ -565,14 +565,14 @@ mod tests { let staging = dir.join("staging"); std::fs::create_dir_all(staging.join("prime-agent-runtime")).unwrap(); std::fs::create_dir_all(staging.join("skills")).unwrap(); - for file in ["prime-agent", "LICENSE", "README.md"] { + for file in ["wv", "LICENSE", "README.md"] { std::fs::write(staging.join(file), "payload").unwrap(); } let archive = dir.join(name); let file = std::fs::File::create(&archive).unwrap(); let encoder = flate2::write::GzEncoder::new(file, flate2::Compression::default()); let mut tar = tar::Builder::new(encoder); - for entry in ["prime-agent", "LICENSE", "README.md"] { + for entry in ["wv", "LICENSE", "README.md"] { tar.append_path_with_name(staging.join(entry), entry) .unwrap(); } @@ -642,7 +642,7 @@ mod tests { assert!(stage_archive(&archive, &sha, &root, "0.2.0", "https://example.com").is_err()); } - /// A payload directory whose `prime-agent` is a script binary reporting + /// A payload directory whose `wv` is a script binary reporting /// a fixed version — the probe path is the same as a real binary's. fn fixture_payload(dir: &Path, name: &str, version: &str) -> PathBuf { let payload = dir.join(name); @@ -651,7 +651,7 @@ mod tests { for file in ["LICENSE", "README.md"] { std::fs::write(payload.join(file), "payload").unwrap(); } - let binary = payload.join("prime-agent"); + let binary = payload.join("wv"); std::fs::write( &binary, format!("#!/bin/sh\nif [ \"$1\" = \"--version\" ]; then echo {version}; fi\nexit 0\n"), @@ -732,7 +732,7 @@ mod tests { assert_ne!(second, first); } - /// A release archive whose `prime-agent` is an executable script reporting a fixed + /// A release archive whose `wv` is an executable script reporting a fixed /// version. Unix only: its callers are the unix symlink/exec probe tests. #[cfg(unix)] fn fixture_versioned_archive(dir: &Path, name: &str, version: &str) -> (PathBuf, String) { @@ -741,7 +741,7 @@ mod tests { let file = std::fs::File::create(&archive).unwrap(); let encoder = flate2::write::GzEncoder::new(file, flate2::Compression::default()); let mut tar = tar::Builder::new(encoder); - for entry in ["prime-agent", "LICENSE", "README.md"] { + for entry in ["wv", "LICENSE", "README.md"] { tar.append_path_with_name(payload.join(entry), entry) .unwrap(); } @@ -869,11 +869,11 @@ mod tests { let dir = tempfile::tempdir().unwrap(); let destination = dir.path().join(destination_name); download_archive( - &format!("{base_url}/prime-agent-1.2.3.tar.gz"), + &format!("{base_url}/wv-1.2.3.tar.gz"), &sha, &destination, budget, - "prime-agent/1.2.2 (test)", + "wv/1.2.2 (test)", ) .await .expect("the digest matches, the download completes"); @@ -884,7 +884,7 @@ mod tests { ); let head = head_rx.await.expect("the head was captured").to_lowercase(); assert!( - head.contains("user-agent: prime-agent/1.2.2 (test)"), + head.contains("user-agent: wv/1.2.2 (test)"), "the request identifies the release updater: {head}" ); } @@ -893,11 +893,11 @@ mod tests { let dir = tempfile::tempdir().unwrap(); let destination = dir.path().join(destination_name); let error = download_archive( - &format!("{base_url}/prime-agent-1.2.3.tar.gz"), + &format!("{base_url}/wv-1.2.3.tar.gz"), &format!("{sha}ff"), &destination, budget, - "prime-agent/1.2.2 (test)", + "wv/1.2.2 (test)", ) .await; assert!(error.is_err(), "a wrong digest is never installed"); diff --git a/crates/pa-core/src/update/homebrew.rs b/crates/pa-core/src/update/homebrew.rs index 0f7a91537..ccd5d998f 100644 --- a/crates/pa-core/src/update/homebrew.rs +++ b/crates/pa-core/src/update/homebrew.rs @@ -1,5 +1,5 @@ -//! Detect Homebrew-owned Prime Agent binaries before the installer update funnel. -//! Homebrew links `/bin/prime-agent` into a Cellar formula or a +//! Detect Homebrew-owned Weave binaries before the installer update funnel. +//! Homebrew links `/bin/wv` into a Cellar formula or a //! Caskroom cask: resolving the executable symlink is load-bearing because //! checking only the invoked `bin` path would miss both managed installs. @@ -9,9 +9,9 @@ use std::path::Path; /// The Homebrew package layout that owns the running binary. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum HomebrewKind { - /// A formula keg under `Cellar/prime-agent`. + /// A formula keg under `Cellar/weave`. Formula, - /// A cask version under `Caskroom/prime-agent`. + /// A cask version under `Caskroom/weave`. Cask, } @@ -32,7 +32,7 @@ impl HomebrewKind { pub fn managed_kind(executable: &Path) -> Option { let resolved = executable.canonicalize().ok()?; for ancestor in resolved.ancestors() { - if ancestor.file_name() != Some(OsStr::new("prime-agent")) { + if ancestor.file_name() != Some(OsStr::new("weave")) { continue; } let owner = ancestor.parent().and_then(Path::file_name); @@ -50,8 +50,8 @@ pub fn managed_kind(executable: &Path) -> Option { #[must_use] pub fn upgrade_instruction(kind: HomebrewKind) -> String { match kind { - HomebrewKind::Formula => "Update with: brew upgrade prime-agent".to_string(), - HomebrewKind::Cask => "Update with: brew upgrade --cask prime-agent".to_string(), + HomebrewKind::Formula => "Update with: brew upgrade wv".to_string(), + HomebrewKind::Cask => "Update with: brew upgrade --cask wv".to_string(), } } @@ -63,10 +63,8 @@ mod tests { #[test] fn detects_formula_and_cask_layouts() { let root = tempfile::tempdir().unwrap(); - let formula = root - .path() - .join("Cellar/prime-agent/1.0.0/libexec/prime-agent"); - let cask = root.path().join("Caskroom/prime-agent/1.0.0/prime-agent"); + let formula = root.path().join("Cellar/weave/1.0.0/libexec/wv"); + let cask = root.path().join("Caskroom/weave/1.0.0/wv"); std::fs::create_dir_all(formula.parent().unwrap()).unwrap(); std::fs::create_dir_all(cask.parent().unwrap()).unwrap(); std::fs::write(&formula, b"binary").unwrap(); @@ -80,10 +78,8 @@ mod tests { #[test] fn resolves_brew_bin_symlinks_into_the_formula_keg() { let root = tempfile::tempdir().unwrap(); - let formula = root - .path() - .join("Cellar/prime-agent/1.0.0/libexec/prime-agent"); - let launcher = root.path().join("bin/prime-agent"); + let formula = root.path().join("Cellar/weave/1.0.0/libexec/wv"); + let launcher = root.path().join("bin/wv"); std::fs::create_dir_all(formula.parent().unwrap()).unwrap(); std::fs::create_dir_all(launcher.parent().unwrap()).unwrap(); std::fs::write(&formula, b"binary").unwrap(); @@ -96,9 +92,9 @@ mod tests { fn ignores_other_kegs_and_non_homebrew_installs() { let root = tempfile::tempdir().unwrap(); for path in [ - "Cellar/other-tool/1.0.0/libexec/prime-agent", - "releases/1.0.0-darwin-arm64-abc123/prime-agent", - "plain/prime-agent", + "Cellar/other-tool/1.0.0/libexec/wv", + "releases/1.0.0-darwin-arm64-abc123/wv", + "plain/wv", ] { let executable = root.path().join(path); std::fs::create_dir_all(executable.parent().unwrap()).unwrap(); diff --git a/crates/pa-core/src/update/install.rs b/crates/pa-core/src/update/install.rs index 97bcc3b60..3905d28be 100644 --- a/crates/pa-core/src/update/install.rs +++ b/crates/pa-core/src/update/install.rs @@ -1,4 +1,4 @@ -//! The managed install-root layout: `bin/prime-agent` and `bin/previous` symlinks into +//! The managed install-root layout: `bin/wv` and `bin/previous` symlinks into //! `releases/--/`, the `.managed` marker, and the `.activation-state` //! rollback pointer. Divergence: the release payload is the Rust asset list, never the TS one. @@ -77,12 +77,12 @@ impl Installation { } } -/// The marker file proving the root belongs to the Prime Agent installer layout. -pub const MANAGED_MARKER: &str = "prime-agent-native-v1"; +/// The marker file proving the root belongs to the Weave installer layout. +pub const MANAGED_MARKER: &str = "weave-native-v1"; /// The payload every staged release must carry. pub const RELEASE_ASSETS: &[&str] = &[ - "prime-agent", + "wv", "prime-agent-runtime", "skills", "LICENSE", @@ -90,7 +90,7 @@ pub const RELEASE_ASSETS: &[&str] = &[ ]; /// The launcher symlink names under `/bin/`. -pub const CURRENT_LAUNCHER: &str = "prime-agent"; +pub const CURRENT_LAUNCHER: &str = "wv"; pub const PREVIOUS_LAUNCHER: &str = "previous"; /// Read the install root of `executable`'s managed layout: the executable resolves @@ -98,7 +98,7 @@ pub const PREVIOUS_LAUNCHER: &str = "previous"; #[must_use] pub fn install_root_of(executable: &Path) -> Option { let resolved = executable.canonicalize().ok()?; - // The resolved executable is /releases//prime-agent: walk up + // The resolved executable is /releases//wv: walk up // through the release directory to `releases`, then one more level. let releases = resolved.parent()?.parent()?; if !releases.ends_with("releases") { @@ -113,7 +113,7 @@ pub fn install_root_of(executable: &Path) -> Option { } /// Parse one launcher's symlink into a validated [`InstallTarget`]: the -/// link must point at `../releases/--/prime-agent`, +/// link must point at `../releases/--/wv`, /// the payload must exist, and `.archive-sha256` must match the recorded digest. fn read_target(root: &Path, link: &str) -> Result { let launcher = root.join("bin").join(link); @@ -126,7 +126,7 @@ fn read_target(root: &Path, link: &str) -> Result { ) })?; let release_dir = root.join("releases").join(release_directory_name(&target)); - let executable = release_dir.join("prime-agent"); + let executable = release_dir.join("wv"); validate_release_dir(&release_dir, &target.sha256)?; Ok(InstallTarget { root: root.to_path_buf(), @@ -143,10 +143,8 @@ fn read_target(root: &Path, link: &str) -> Result { /// same shape; `None` for anything that is not a managed release name). #[must_use] pub fn release_version_of(directory_name: &str) -> Option { - parse_release_link(Path::new(&format!( - "../releases/{directory_name}/prime-agent" - ))) - .map(|link| link.version) + parse_release_link(Path::new(&format!("../releases/{directory_name}/wv"))) + .map(|link| link.version) } /// The `releases/` directory name of a parsed link (`--`). @@ -213,15 +211,15 @@ struct ReleaseLink { sha256: String, } -/// Parse `../releases/--/prime-agent` (TS `NATIVE_RELEASE_DIRECTORY`): +/// Parse `../releases/--/wv` (TS `NATIVE_RELEASE_DIRECTORY`): /// strip the digest from the right, then match the longest known platform suffix (the TS layout /// allows an optional 6-character build id after the digest, which must be accepted too). fn parse_release_link(target: &Path) -> Option { let text = target.to_str()?; - if !text.starts_with("../releases/") || !text.ends_with("/prime-agent") { + if !text.starts_with("../releases/") || !text.ends_with("/wv") { return None; } - let directory = &text["../releases/".len()..text.len() - "/prime-agent".len()]; + let directory = &text["../releases/".len()..text.len() - "/wv".len()]; let digest_start = directory.rfind('-')?; let mut sha256 = &directory[digest_start + 1..]; if sha256.len() > 64 + 1 + 6 { @@ -280,7 +278,7 @@ pub(super) fn validate_release_dir(release_dir: &Path, archive_sha256: &str) -> Ok(()) } -/// Read the active installation (`bin/prime-agent`). Falls back to +/// Read the active installation (`bin/wv`). Falls back to /// `bin/previous` when the active link is missing (the coordinator's /// rollback planning path). /// @@ -335,7 +333,7 @@ pub fn read_rollback_installation(root: &Path) -> Result { let base_url = std::fs::read_to_string(release_dir.join(".install-source"))? .trim() .to_string(); - let executable = release_dir.join("prime-agent"); + let executable = release_dir.join("wv"); Ok(Installation { target: InstallTarget { root: root.to_path_buf(), @@ -374,7 +372,7 @@ mod tests { std::fs::write(root.join(".managed"), MANAGED_MARKER).unwrap(); #[cfg(unix)] std::os::unix::fs::symlink( - format!("../releases/{release}/prime-agent"), + format!("../releases/{release}/wv"), root.join("bin").join(link), ) .unwrap(); @@ -392,7 +390,7 @@ mod tests { assert_eq!(installation.base_url, "https://example.com"); assert!(installation .executable() - .ends_with("releases/0.2.0-linux-x64-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/prime-agent")); + .ends_with("releases/0.2.0-linux-x64-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/wv")); assert_eq!(installation.target.platform, "linux-x64"); } @@ -420,7 +418,7 @@ mod tests { std::fs::write( root.join(".activation-state"), format!( - "../releases/0.2.0-linux-x64-{new_sha}/prime-agent\n../releases/0.1.0-linux-x64-{old_sha}/prime-agent\n" + "../releases/0.2.0-linux-x64-{new_sha}/wv\n../releases/0.1.0-linux-x64-{old_sha}/wv\n" ), ) .unwrap(); @@ -446,7 +444,7 @@ mod tests { let release = format!("0.1.0-linux-x64-{}", "a".repeat(64)); let release_dir = dir.path().join(&release); std::fs::create_dir_all(&release_dir).unwrap(); - let exe = release_dir.join("prime-agent"); + let exe = release_dir.join("wv"); std::fs::write(&exe, "binary").unwrap(); let running = running_release(&exe).unwrap(); assert_eq!(running.version, "0.1.0"); @@ -454,7 +452,7 @@ mod tests { // A hand-named dogfood directory is not a managed release name. let dogfood = dir.path().join("0.10.0-rust-64f66e3d"); std::fs::create_dir_all(&dogfood).unwrap(); - let stray = dogfood.join("prime-agent"); + let stray = dogfood.join("wv"); std::fs::write(&stray, "binary").unwrap(); assert!(running_release(&stray).is_err()); } @@ -472,16 +470,11 @@ mod tests { #[test] fn parses_release_link_shapes_only() { assert!(parse_release_link(Path::new( - "../releases/1.2.3-linux-x64-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef/prime-agent" + "../releases/1.2.3-linux-x64-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef/wv" )) .is_some()); - assert!( - parse_release_link(Path::new("../releases/1.2.3-other-thing/prime-agent")).is_none() - ); - assert!(parse_release_link(Path::new("/opt/somewhere/else/prime-agent")).is_none()); - assert!( - parse_release_link(Path::new("../releases/1.2.3-linux-x64-short/prime-agent")) - .is_none() - ); + assert!(parse_release_link(Path::new("../releases/1.2.3-other-thing/wv")).is_none()); + assert!(parse_release_link(Path::new("/opt/somewhere/else/wv")).is_none()); + assert!(parse_release_link(Path::new("../releases/1.2.3-linux-x64-short/wv")).is_none()); } } diff --git a/crates/pa-core/src/update/installer.rs b/crates/pa-core/src/update/installer.rs index 7cb2da127..fdb47ebbe 100644 --- a/crates/pa-core/src/update/installer.rs +++ b/crates/pa-core/src/update/installer.rs @@ -1,4 +1,4 @@ -//! The installer-takeover update funnel: `prime-agent update` and the TUI's +//! The installer-takeover update funnel: `wv update` and the TUI's //! `/update` download the update channel's installer and run it — the //! official domain endpoint for stable, the download base's //! `install-beta.sh` for nightly; never a GitHub raw or workflow URL. The @@ -35,26 +35,23 @@ pub const ENV_DOWNLOAD_BASE_URL: &str = "PRIME_AGENT_DOWNLOAD_BASE_URL"; /// manifests (`latest.json`, `beta.json`) are published. pub const DEFAULT_DOWNLOAD_BASE_URL: &str = "https://pub-728493de92a943e2a9b2d17b4719f318.r2.dev"; -/// The official domain's install endpoint — the stable channel's installer -/// source; never a GitHub raw or workflow URL (the override env var stays -/// for tests and pinned installs). -pub const OFFICIAL_INSTALLER_URL: &str = "https://app.primeintellect.ai/prime-agent/install.sh"; +/// The stable installer's file under the download base. The release +/// workflow publishes this repo's `install-rust.sh` there as `install.sh`; +/// never a GitHub raw or workflow URL (the override env var stays for +/// tests and pinned installs). +pub const STABLE_INSTALLER_FILE: &str = "install.sh"; /// The nightly installer's file under the download base (the domain only /// forwards `install.sh`, so nightly updates fetch it from the base). pub const BETA_INSTALLER_FILE: &str = "install-beta.sh"; /// `install-rust.sh` as this build shipped it. The local operations -/// (`prime-agent update --rollback` and `--archive`) run this copy: they +/// (`wv update --rollback` and `--archive`) run this copy: they /// need no network, and the script matches the layout this build was /// installed with. const BUNDLED_INSTALLER: &str = include_str!("../../../../install-rust.sh"); -/// The payload binary's file name under `/share/prime-agent`. -const PAYLOAD_BINARY: &str = if cfg!(windows) { - "prime-agent.exe" -} else { - "prime-agent" -}; +/// The payload binary's file name under `/share/weave`. +const PAYLOAD_BINARY: &str = if cfg!(windows) { "wv.exe" } else { "wv" }; /// The small-file budget for the script download (the script is a few KB; /// a hung fetch must not hang the update). @@ -75,13 +72,11 @@ pub fn installer_script_url(channel: Option<&str>) -> String { return url; } } - match channel { - Some("beta") => format!( - "{}/{BETA_INSTALLER_FILE}", - download_base_url().trim_end_matches('/') - ), - _ => OFFICIAL_INSTALLER_URL.to_string(), - } + let file = match channel { + Some("beta") => BETA_INSTALLER_FILE, + _ => STABLE_INSTALLER_FILE, + }; + format!("{}/{file}", download_base_url().trim_end_matches('/')) } /// The download base `--check` reads the channel manifest from: the @@ -267,7 +262,7 @@ pub async fn run_bundled_installer( #[cfg(windows)] if caller_owns_payload(prefix) { // THE HANDOFF (Windows rename rule): this process's image sits inside - // /share/prime-agent and Windows refuses to rename a directory + // /share/weave and Windows refuses to rename a directory // that contains a running image, so the script's publish step can only // succeed after this process exits. The child is spawned without // waiting and inherits the terminal, so the installer's own steps and @@ -350,7 +345,7 @@ pub async fn run_bundled_installer( } /// The install prefix of an installer-owned binary: `exe` is -/// `/share/prime-agent/prime-agent` (`prime-agent.exe` on Windows) +/// `/share/weave/wv` (`wv.exe` on Windows) /// and that payload carries the installer's marker. `None` for any other /// binary (a managed release, a development build). #[must_use] @@ -358,14 +353,14 @@ fn installer_prefix_of(exe: &Path) -> Option { let payload = exe.parent()?; let share = payload.parent()?; let owned = exe.file_name()? == PAYLOAD_BINARY - && payload.file_name()? == "prime-agent" + && payload.file_name()? == "weave" && share.file_name()? == "share"; let prefix = share.parent()?; (owned && installed_channel(prefix).is_some()).then(|| prefix.to_path_buf()) } /// The install prefix of the running binary when the installer owns it -/// (`/share/prime-agent/prime-agent` in a marked payload). +/// (`/share/weave/wv` in a marked payload). #[must_use] pub fn running_installer_prefix() -> Option { let exe = std::env::current_exe().ok()?; @@ -378,7 +373,7 @@ pub fn running_installer_prefix() -> Option { } /// True when this process's own image is the payload binary of `prefix` -/// (`/share/prime-agent/prime-agent.exe` with the install marker): +/// (`/share/weave/wv.exe` with the install marker): /// the Windows rename rule — a running image locks its directory, so an /// installer child can only publish this payload after this process exits. /// On unix a rename never fights a running image, so the answer is false. @@ -472,7 +467,7 @@ fn normalize_marker_bytes(bytes: &[u8]) -> std::borrow::Cow<'_, [u8]> { /// [`installed_channel`]: a ps1-written marker can be UTF-16 or /// BOM-prefixed, and the version line of an encoded marker must read too. fn installed_version(prefix: &Path) -> Option { - let bytes = std::fs::read(prefix.join("share/prime-agent/.prime-agent-install")).ok()?; + let bytes = std::fs::read(prefix.join("share/weave/.weave-install")).ok()?; let normalized = normalize_marker_bytes(&bytes).into_owned(); let marker = String::from_utf8_lossy(&normalized); let version = marker.lines().nth(1)?.strip_prefix("version ")?.trim(); @@ -480,7 +475,7 @@ fn installed_version(prefix: &Path) -> Option { } /// The installed payload's channel, read from the install marker (the -/// installer's own `.prime-agent-install` under the prefix's share dir; +/// installer's own `.weave-install` under the prefix's share dir; /// its first line is "channel "). `None` when the marker is absent /// (a pre-marker install or a foreign tree) or carries no known channel — /// the update then rides the fetched script's own default. @@ -493,7 +488,7 @@ pub fn installed_channel(prefix: &Path) -> Option<&'static str> { // Flattening the NULs and stripping a leading BOM keeps the exact // prefix check working for this script's own ASCII writes and for the // ps1-written ones alike (a plain marker passes through untouched). - let bytes = std::fs::read(prefix.join("share/prime-agent/.prime-agent-install")).ok()?; + let bytes = std::fs::read(prefix.join("share/weave/.weave-install")).ok()?; let bytes = normalize_marker_bytes(&bytes); let marker = String::from_utf8_lossy(&bytes); // The marker's first line must be the installer's OWN write shape — @@ -555,10 +550,8 @@ async fn fetch_script(url: &str) -> Result<(PathBuf, std::fs::File)> { /// the bytes written here, and the name only serves the post-run /// cleanup. fn write_script(bytes: &[u8]) -> Result<(PathBuf, std::fs::File)> { - let script = std::env::temp_dir().join(format!( - "prime-agent-update-{}.sh", - uuid::Uuid::now_v7().simple() - )); + let script = + std::env::temp_dir().join(format!("wv-update-{}.sh", uuid::Uuid::now_v7().simple())); let mut options = std::fs::OpenOptions::new(); options.create_new(true).read(true).write(true); #[cfg(unix)] @@ -752,7 +745,7 @@ fn output_tail(captured: &std::process::Output) -> Option { (!joined.is_empty()).then_some(joined) } -/// The installed launcher's `--version` answer: the takeover layout's `bin/prime-agent` first, the +/// The installed launcher's `--version` answer: the takeover layout's `bin/wv` first, the /// pre-takeover `bin/prime-agent-rust` second, and only answers stamped `-continuous.` /// count (the TS product's launcher never matches). async fn launcher_version(prefix: &Path) -> Option { @@ -760,9 +753,9 @@ async fn launcher_version(prefix: &Path) -> Option { // cannot be exec'd by CreateProcess; Rust runs .cmd through cmd.exe), // the sh launcher pair on unix (the pre-takeover name second). #[cfg(windows)] - const LAUNCHER_NAMES: [&str; 2] = ["prime-agent.cmd", "prime-agent"]; + const LAUNCHER_NAMES: [&str; 2] = ["wv.cmd", "wv"]; #[cfg(not(windows))] - const LAUNCHER_NAMES: [&str; 2] = ["prime-agent", "prime-agent-rust"]; + const LAUNCHER_NAMES: [&str; 2] = ["wv", "prime-agent-rust"]; for name in LAUNCHER_NAMES { let launcher = prefix.join("bin").join(name); if !launcher.is_file() { @@ -793,7 +786,7 @@ async fn launcher_version(prefix: &Path) -> Option { mod tests { use super::*; - /// The platform map `prime-agent update --check` names on every + /// The platform map `wv update --check` names on every /// supported platform pair (the same set install-rust.sh's uname case /// resolves): the Windows pair ships the MSVC target, and the refusal /// covers every other pair with the full matrix in the message. @@ -834,7 +827,7 @@ mod tests { fn installed_channel_reads_the_ps1_encoded_marker() { let dir = tempfile::TempDir::new().unwrap(); let prefix = dir.path().join("prefix"); - let payload = prefix.join("share/prime-agent"); + let payload = prefix.join("share/weave"); std::fs::create_dir_all(&payload).unwrap(); let cases: [(&str, Vec, &str); 4] = [ ( @@ -881,7 +874,7 @@ mod tests { ), ]; for (name, bytes, expected) in cases { - std::fs::write(payload.join(".prime-agent-install"), &bytes).unwrap(); + std::fs::write(payload.join(".weave-install"), &bytes).unwrap(); assert_eq!( installed_channel(&prefix), Some(expected), @@ -905,29 +898,29 @@ mod tests { let dir = tempfile::TempDir::new().unwrap(); let prefix = dir.path().join("prefix"); assert_eq!(installed_channel(&prefix), None); - let share = prefix.join("share/prime-agent"); + let share = prefix.join("share/weave"); std::fs::create_dir_all(&share).unwrap(); std::fs::write( - share.join(".prime-agent-install"), + share.join(".weave-install"), "install-rust.sh channel beta\nversion 0.10.0\n", ) .unwrap(); assert_eq!(installed_channel(&prefix), Some("beta")); std::fs::write( - share.join(".prime-agent-install"), + share.join(".weave-install"), "install-rust.sh channel stable\nversion 0.10.0\n", ) .unwrap(); assert_eq!(installed_channel(&prefix), Some("stable")); - std::fs::write(share.join(".prime-agent-install"), "nightly\n").unwrap(); + std::fs::write(share.join(".weave-install"), "nightly\n").unwrap(); assert_eq!(installed_channel(&prefix), None); std::fs::write( - share.join(".prime-agent-install"), + share.join(".weave-install"), "other installer channel beta\n", ) .unwrap(); assert_eq!(installed_channel(&prefix), None); - std::fs::write(share.join(".prime-agent-install"), "channel beta\n").unwrap(); + std::fs::write(share.join(".weave-install"), "channel beta\n").unwrap(); assert_eq!(installed_channel(&prefix), None); } @@ -939,12 +932,12 @@ mod tests { fn installer_prefix_of_needs_the_payload_path_and_the_marker() { let dir = tempfile::TempDir::new().unwrap(); let prefix = dir.path().join("prefix"); - let payload = prefix.join("share/prime-agent"); + let payload = prefix.join("share/weave"); std::fs::create_dir_all(&payload).unwrap(); let exe = payload.join(PAYLOAD_BINARY); assert_eq!(installer_prefix_of(&exe), None, "no marker: not owned"); std::fs::write( - payload.join(".prime-agent-install"), + payload.join(".weave-install"), "install-rust.sh channel beta\nversion 0.9.9-beta.10\n", ) .unwrap(); @@ -952,10 +945,7 @@ mod tests { assert_eq!(installed_version(&prefix).as_deref(), Some("0.9.9-beta.10")); // A binary elsewhere in the tree, or a managed release, is not. assert_eq!(installer_prefix_of(&payload.join("other")), None); - assert_eq!( - installer_prefix_of(&prefix.join("releases/0.9.8/prime-agent")), - None - ); + assert_eq!(installer_prefix_of(&prefix.join("releases/0.9.8/wv")), None); } /// The handoff gate never opens on unix: a rename never fights a @@ -968,10 +958,10 @@ mod tests { fn caller_owns_payload_stays_false_for_a_staged_prefix_on_unix() { let dir = tempfile::TempDir::new().unwrap(); let prefix = dir.path().join("prefix"); - let payload = prefix.join("share/prime-agent"); + let payload = prefix.join("share/weave"); std::fs::create_dir_all(&payload).unwrap(); std::fs::write( - payload.join(".prime-agent-install"), + payload.join(".weave-install"), "install-rust.sh channel beta\nversion 0.9.9-beta.10\n", ) .unwrap(); @@ -992,10 +982,10 @@ mod tests { fn caller_owns_payload_needs_the_running_image_on_windows() { let dir = tempfile::TempDir::new().unwrap(); let prefix = dir.path().join("prefix"); - let payload = prefix.join("share/prime-agent"); + let payload = prefix.join("share/weave"); std::fs::create_dir_all(&payload).unwrap(); std::fs::write( - payload.join(".prime-agent-install"), + payload.join(".weave-install"), "install-rust.sh channel beta\nversion 0.9.9-beta.10\n", ) .unwrap(); @@ -1086,8 +1076,8 @@ set -eu # Fails only under a controlling terminal (a developer run or `script`); headless CI has none. if ( : <>/dev/tty ) 2>/dev/null || [ -t 0 ]; then echo "the captured installer reached the terminal" >&2; exit 9; fi mkdir -p "${PRIME_AGENT_RUST_PREFIX}/bin" -printf '#!/bin/sh\necho "9.9.9-continuous.0123456789abcdef"\n' > "${PRIME_AGENT_RUST_PREFIX}/bin/prime-agent" -chmod 0755 "${PRIME_AGENT_RUST_PREFIX}/bin/prime-agent" +printf '#!/bin/sh\necho "9.9.9-continuous.0123456789abcdef"\n' > "${PRIME_AGENT_RUST_PREFIX}/bin/wv" +chmod 0755 "${PRIME_AGENT_RUST_PREFIX}/bin/wv" printf '%s' "${PRIME_AGENT_RELEASE_CHANNEL:-}" > "${PRIME_AGENT_RUST_PREFIX}/channel" echo "installed: 9.9.9-continuous.0123456789abcdef" "#; @@ -1127,9 +1117,12 @@ echo "installed: 9.9.8-continuous.fedcba9876543210" std::env::remove_var(ENV_DOWNLOAD_BASE_URL); assert_eq!( installer_script_url(Some("stable")), - "https://app.primeintellect.ai/prime-agent/install.sh" + "https://pub-728493de92a943e2a9b2d17b4719f318.r2.dev/install.sh" + ); + assert_eq!( + installer_script_url(None), + format!("{DEFAULT_DOWNLOAD_BASE_URL}/install.sh") ); - assert_eq!(installer_script_url(None), OFFICIAL_INSTALLER_URL); assert_eq!( installer_script_url(Some("beta")), "https://pub-728493de92a943e2a9b2d17b4719f318.r2.dev/install-beta.sh" @@ -1139,7 +1132,10 @@ echo "installed: 9.9.8-continuous.fedcba9876543210" installer_script_url(Some("beta")), "https://mirror.example/install-beta.sh" ); - assert_eq!(installer_script_url(Some("stable")), OFFICIAL_INSTALLER_URL); + assert_eq!( + installer_script_url(Some("stable")), + "https://mirror.example/install.sh" + ); std::env::set_var(ENV_INSTALLER_URL, "http://127.0.0.1:9/pinned.sh"); assert_eq!( installer_script_url(Some("beta")), @@ -1218,10 +1214,10 @@ echo "installed: 9.9.8-continuous.fedcba9876543210" #[cfg(unix)] async fn the_requested_channel_wins_over_the_install_marker() { let (root, _preserve, prefix) = sandbox(); - let share = prefix.join("share/prime-agent"); + let share = prefix.join("share/weave"); std::fs::create_dir_all(&share).unwrap(); std::fs::write( - share.join(".prime-agent-install"), + share.join(".weave-install"), "install-rust.sh channel beta\nversion 0.10.0\n", ) .unwrap(); @@ -1262,7 +1258,7 @@ echo "installed: 9.9.8-continuous.fedcba9876543210" Some("9.9.9-continuous.0123456789abcdef"), "the probe reads the launcher's own --version answer" ); - let launcher = prefix.join("bin/prime-agent"); + let launcher = prefix.join("bin/wv"); assert!(launcher.is_file(), "the launcher landed"); let mode = std::fs::metadata(&launcher).expect("launcher metadata"); assert!(unix_mode_is_executable(&mode), "the launcher is executable"); @@ -1297,7 +1293,7 @@ echo "installed: 9.9.8-continuous.fedcba9876543210" async fn a_failed_installer_keeps_the_previous_install_and_reports_the_error() { let (root, preserve, prefix) = sandbox(); std::fs::create_dir_all(prefix.join("bin")).expect("bin dir"); - let previous = prefix.join("bin/prime-agent"); + let previous = prefix.join("bin/wv"); std::fs::write(&previous, "#!/bin/sh\necho 9.9.7-continuous.0000001\n") .expect("previous launcher"); make_executable(&previous); diff --git a/crates/pa-core/src/update/managed.rs b/crates/pa-core/src/update/managed.rs index 34fd58df0..256c0017e 100644 --- a/crates/pa-core/src/update/managed.rs +++ b/crates/pa-core/src/update/managed.rs @@ -2,7 +2,7 @@ use std::path::Path; -const NIX_INSTRUCTION: &str = "Prime Agent is managed by Nix. Run `cd /config && just update-prime`, then review and deploy the source pin through /config. Self-update and rollback are disabled."; +const NIX_INSTRUCTION: &str = "Weave is managed by Nix. Run `cd /config && just update-prime`, then review and deploy the source pin through /config. Self-update and rollback are disabled."; /// Explain why mutation through the upstream installer is forbidden. /// Both client surfaces and installer boundaries consult this before any I/O. @@ -29,21 +29,15 @@ mod tests { #[test] fn nix_owner_and_store_payloads_refuse_self_update_without_prefix_collisions() { assert_eq!( - refusal(Some("nix"), Some(Path::new("/opt/prime-agent"))), + refusal(Some("nix"), Some(Path::new("/opt/wv"))), Some(NIX_INSTRUCTION) ); assert_eq!( - refusal( - None, - Some(Path::new("/nix/store/hash-prime/bin/prime-agent")) - ), + refusal(None, Some(Path::new("/nix/store/hash-prime/bin/wv"))), Some(NIX_INSTRUCTION) ); - assert_eq!( - refusal(None, Some(Path::new("/nix/storefront/prime-agent"))), - None - ); - assert_eq!(refusal(None, Some(Path::new("/opt/prime-agent"))), None); + assert_eq!(refusal(None, Some(Path::new("/nix/storefront/wv"))), None); + assert_eq!(refusal(None, Some(Path::new("/opt/wv"))), None); assert_eq!(refusal(None, None), None); } } diff --git a/crates/pa-core/src/update/mod.rs b/crates/pa-core/src/update/mod.rs index bea9e87e9..b812be561 100644 --- a/crates/pa-core/src/update/mod.rs +++ b/crates/pa-core/src/update/mod.rs @@ -4,7 +4,7 @@ //! driver lives in pa-cli; everything here is the mechanism it drives, kept //! daemon-free so pa-core stays the shared client/service layer. The //! `installer` module is the other update body: the installer-takeover -//! funnel `prime-agent update` and the TUI's `/update` run — the update +//! funnel `wv update` and the TUI's `/update` run — the update //! channel's installer (never a GitHub raw or workflow URL) owns the whole //! move, exec'd through the trusted absolute `/bin/sh` (never a //! `PATH`-resolved interpreter), kept beside the staged flow the diff --git a/crates/pa-core/src/update/release.rs b/crates/pa-core/src/update/release.rs index f5bf9938b..eae2d8ea5 100644 --- a/crates/pa-core/src/update/release.rs +++ b/crates/pa-core/src/update/release.rs @@ -50,7 +50,7 @@ struct RawArtifact { #[must_use] pub fn update_user_agent(version: &str) -> String { format!( - "prime-agent/{version} ({}; rust/{}; {})", + "weave/{version} ({}; rust/{}; {})", std::env::consts::OS, env!("CARGO_PKG_VERSION"), std::env::consts::ARCH @@ -128,7 +128,7 @@ pub fn parse_channel_manifest(body: &[u8]) -> Option { if !KNOWN_PLATFORMS.contains(&artifact.platform.as_str()) { continue; } - let file = format!("prime-agent-{version}-{}.tar.gz", artifact.platform); + let file = format!("wv-{version}-{}.tar.gz", artifact.platform); let sha_valid = artifact.sha256.len() == 64 && artifact.sha256.bytes().all(|b| b.is_ascii_hexdigit()); if artifact.file != file || !sha_valid || !seen.insert(artifact.platform.clone()) { @@ -180,7 +180,7 @@ mod tests { version: "1.2.3".into(), artifacts: vec![ReleaseArtifact { platform: "linux-x64".into(), - file: "prime-agent-1.2.3-linux-x64.tar.gz".into(), + file: "wv-1.2.3-linux-x64.tar.gz".into(), sha256: "a".repeat(64), }], }; @@ -205,7 +205,7 @@ mod tests { let row = |platform: &str| { serde_json::json!({ "platform": platform, - "file": format!("prime-agent-1.2.3-{platform}.tar.gz"), + "file": format!("wv-1.2.3-{platform}.tar.gz"), "sha256": sha, }) }; @@ -231,7 +231,7 @@ mod tests { "version": "v1.2.3", "binaries": [{ "platform": "linux-x64", - "file": "prime-agent-1.2.3-x86_64-unknown-linux-gnu.tar.gz", + "file": "wv-1.2.3-x86_64-unknown-linux-gnu.tar.gz", "sha256": "b".repeat(64), }], }); @@ -249,7 +249,7 @@ mod tests { #[test] fn user_agent_keeps_the_ts_shape() { let agent = update_user_agent("1.2.3"); - assert!(agent.starts_with("prime-agent/1.2.3 (")); + assert!(agent.starts_with("weave/1.2.3 (")); assert!(agent.contains("; rust/")); } @@ -298,7 +298,7 @@ mod tests { "version": "1.2.3", "binaries_v2": [{ "platform": "linux-x64", - "file": "prime-agent-1.2.3-linux-x64.tar.gz", + "file": "wv-1.2.3-linux-x64.tar.gz", "sha256": "a".repeat(64), }], }) diff --git a/crates/pa-core/tests/git_context.rs b/crates/pa-core/tests/git_context.rs index 0e5b4b681..bd638289b 100644 --- a/crates/pa-core/tests/git_context.rs +++ b/crates/pa-core/tests/git_context.rs @@ -172,7 +172,7 @@ fn dirty_tree_does_not_change_capture() { /// Byte-parity pin: a session header captured by the installed TS binary (0.9.5) in a fixture repo /// parses into the same Rust git context, wire shape included. The line below is the verbatim first -/// line of `~/.prime/sessions/.jsonl` produced by `prime-agent -p --session-dir ... "say hi"` +/// line of `~/.prime/sessions/.jsonl` produced by `wv -p --session-dir ... "say hi"` /// in that repo (the header is written before any model call). #[pa_test_scratch::pa_test] #[test] diff --git a/crates/pa-daemon/Cargo.toml b/crates/pa-daemon/Cargo.toml index c8ecf4aac..f5dc9eb5f 100644 --- a/crates/pa-daemon/Cargo.toml +++ b/crates/pa-daemon/Cargo.toml @@ -6,10 +6,10 @@ license.workspace = true description = "Session supervisor, worker processes, and wire protocol." [dependencies] -pa-types = { path = "../pa-types", version = "0.10.0" } -pa-core = { path = "../pa-core", version = "0.10.0" } -pa-agent = { path = "../pa-agent", version = "0.10.0" } -pa-ai = { path = "../pa-ai", version = "0.10.0" } +pa-types = { path = "../pa-types", version = "0.1.0" } +pa-core = { path = "../pa-core", version = "0.1.0" } +pa-agent = { path = "../pa-agent", version = "0.1.0" } +pa-ai = { path = "../pa-ai", version = "0.1.0" } anyhow = { workspace = true } futures = { workspace = true } serde = { workspace = true } @@ -36,7 +36,7 @@ proptest = { workspace = true } # catalog-repo child-resolution regression writes the layer-A disk cache # in the pa-models snapshot shape; the crate's runtime surface goes # through pa-core. -pa-models = { path = "../pa-models", version = "0.10.0" } +pa-models = { path = "../pa-models", version = "0.1.0" } url = "2" # `test-util` (tokio time pause) is test-only: the mutation-drain latch test # drives real timeouts through the paused clock. diff --git a/crates/pa-daemon/src/acp/daemon.rs b/crates/pa-daemon/src/acp/daemon.rs index d0865ea01..bdf34af01 100644 --- a/crates/pa-daemon/src/acp/daemon.rs +++ b/crates/pa-daemon/src/acp/daemon.rs @@ -1089,7 +1089,7 @@ async fn handle_session_new( { let _ = tx.send(super::internal_error( &id, - "prime-agent ACP mode hosts one session per connection; start another prime-agent process for a second session", + "Weave ACP mode hosts one session per connection; start another wv process for a second session", )); return; } @@ -1504,7 +1504,7 @@ async fn prompt_turn( eprintln!("pa-daemon: acp turn failed: {failure}"); publish_error_boundary(&producer, turn_id).await; producer.finish_prompt(turn_id).await; - return super::internal_error(&id, &format!("prime-agent turn failed: {failure}")); + return super::internal_error(&id, &format!("wv turn failed: {failure}")); } // The completion waits for the session to settle before observing the // roster. A failed wait degrades: the envelope still settles. diff --git a/crates/pa-daemon/src/acp/meta.rs b/crates/pa-daemon/src/acp/meta.rs index bd9313eea..f4ebd2690 100644 --- a/crates/pa-daemon/src/acp/meta.rs +++ b/crates/pa-daemon/src/acp/meta.rs @@ -1,12 +1,12 @@ -//! Namespaced `_meta` payloads for prime-agent capabilities that ACP has +//! Namespaced `_meta` payloads for wv capabilities that ACP has //! no native concept for (cwd reporting, quiescence observation, -//! correlation). Vanilla ACP clients ignore `_meta` keys; a prime-agent-aware +//! correlation). Vanilla ACP clients ignore `_meta` keys; a wv-aware //! client reads them; non-standard fields never appear at an ACP root. use serde::{Deserialize, Serialize}; use serde_json::{json, Value}; -/// Reverse-domain namespace for every prime-agent `_meta` payload. +/// Reverse-domain namespace for every wv `_meta` payload. pub const PRIME_AGENT_META_NAMESPACE: &str = "ai.primeintellect.prime-agent"; /// A client-requested cwd that differs from the agent's actual startup cwd. @@ -48,7 +48,7 @@ pub enum PrimeAgentOutcome { Error, } -/// The prime-agent payload under the `_meta` namespace key. +/// The wv payload under the `_meta` namespace key. /// /// `prompt_turn_id` is allocated when ACP accepts a prompt, never inferred /// from the running prompt; `0` means a session-scoped event with no prompt @@ -159,7 +159,7 @@ pub fn acp_stop_reason( } } -/// Wrap a prime-agent payload in its reverse-domain `_meta` envelope. +/// Wrap a wv payload in its reverse-domain `_meta` envelope. pub fn prime_agent_meta(payload: &PrimeAgentSessionMeta) -> Value { json!({ PRIME_AGENT_META_NAMESPACE: payload }) } diff --git a/crates/pa-daemon/src/acp/types.rs b/crates/pa-daemon/src/acp/types.rs index 8a33818f1..9544ef05d 100644 --- a/crates/pa-daemon/src/acp/types.rs +++ b/crates/pa-daemon/src/acp/types.rs @@ -168,7 +168,7 @@ pub enum AcpSessionUpdate { #[serde(rename = "_meta", skip_serializing_if = "Option::is_none")] meta: Option, }, - /// Namespaced prime-agent state (compaction, quiescence, ...). + /// Namespaced wv state (compaction, quiescence, ...). #[serde(rename = "session_info_update")] SessionInfoUpdate { #[serde(rename = "_meta")] @@ -397,8 +397,8 @@ pub fn initialize_result(product_version: &str) -> InitializeResult { }, }, agent_info: AgentInfo { - name: "prime-agent".to_string(), - title: "Prime Agent".to_string(), + name: "wv".to_string(), + title: "Weave".to_string(), version: product_version.to_string(), }, meta: super::meta::prime_agent_meta(&super::meta::PrimeAgentSessionMeta::default()), @@ -424,7 +424,7 @@ mod tests { "mcpCapabilities": { "http": true }, "sessionCapabilities": { "close": {} }, }, - "agentInfo": { "name": "prime-agent", "title": "Prime Agent", "version": "9.9.9" }, + "agentInfo": { "name": "wv", "title": "Weave", "version": "9.9.9" }, "_meta": { "ai.primeintellect.prime-agent": {} }, }) ); diff --git a/crates/pa-daemon/src/acp/wire_events.rs b/crates/pa-daemon/src/acp/wire_events.rs index e1a0eade9..7ffef7cf6 100644 --- a/crates/pa-daemon/src/acp/wire_events.rs +++ b/crates/pa-daemon/src/acp/wire_events.rs @@ -363,7 +363,7 @@ pub fn wire_updates(event: &Value, state: &mut WireMappingState) -> Vec) -> String { match run_id { Some(run_id) => format!("prime-agent-bash-{run_id}"), - None => "prime-agent-bash".to_string(), + None => "wv-bash".to_string(), } } diff --git a/crates/pa-daemon/src/boot_reap.rs b/crates/pa-daemon/src/boot_reap.rs index e31ac200b..62a3e1adb 100644 --- a/crates/pa-daemon/src/boot_reap.rs +++ b/crates/pa-daemon/src/boot_reap.rs @@ -328,14 +328,14 @@ fn socket_spelling_of(pid: u32, value: &str) -> String { } } -/// The product's own binary names: `prime-agent` (release/install) and +/// The product's own binary names: `wv` (release/install) and /// `pa-daemon` (the workspace binary). Unix only, as [`is_worker_argv`]. #[cfg(unix)] #[cfg_attr(not(target_os = "linux"), allow(dead_code))] pub(crate) fn is_product_binary(exe: &str) -> bool { matches!( Path::new(exe).file_name().and_then(|name| name.to_str()), - Some("prime-agent" | "pa-daemon") + Some("wv" | "pa-daemon") ) } @@ -839,7 +839,7 @@ mod tests { #[pa_test_scratch::pa_test] #[test] fn worker_argv_shapes() { - let worker = ["/bin/prime-agent", "worker"] + let worker = ["/bin/wv", "worker"] .iter() .map(ToString::to_string) .collect::>(); @@ -859,11 +859,11 @@ mod tests { .iter() .map(ToString::to_string) .collect::>(); - let bare = ["/usr/local/bin/prime-agent"] + let bare = ["/usr/local/bin/wv"] .iter() .map(ToString::to_string) .collect::>(); - let worker_flag_second = ["/usr/local/bin/prime-agent", "--mode", "worker"] + let worker_flag_second = ["/usr/local/bin/wv", "--mode", "worker"] .iter() .map(ToString::to_string) .collect::>(); @@ -914,7 +914,7 @@ mod tests { #[pa_test_scratch::pa_test] #[test] fn the_exe_gate_accepts_replaced_binaries() { - let replaced = "/opt/prime-agent/bin/prime-agent (deleted)"; + let replaced = "/opt/wv/bin/wv (deleted)"; assert!( is_product_binary(replaced.trim_end_matches(" (deleted)")), "the deleted-suffix spelling still identifies the product binary" @@ -926,7 +926,7 @@ mod tests { #[test] fn the_supervisor_match_normalizes_both_spellings() { let direct = [ - "/usr/bin/prime-agent", + "/usr/bin/wv", "--mode", "daemon", "--daemon-socket", @@ -940,7 +940,7 @@ mod tests { &normalize_socket_spelling(Path::new("/tmp/x/daemon.sock")) )); let dotted = [ - "/usr/bin/prime-agent", + "/usr/bin/wv", "--mode", "daemon", "--daemon-socket", @@ -991,7 +991,7 @@ mod tests { #[test] fn supervisor_argv_shapes() { let product = [ - "/usr/local/bin/prime-agent", + "/usr/local/bin/wv", "--mode", "daemon", "--daemon-socket", @@ -1012,7 +1012,7 @@ mod tests { .map(ToString::to_string) .collect::>(); let other_socket = [ - "/usr/local/bin/prime-agent", + "/usr/local/bin/wv", "--mode", "daemon", "--daemon-socket", @@ -1021,7 +1021,7 @@ mod tests { .iter() .map(ToString::to_string) .collect::>(); - let interactive = ["/usr/local/bin/prime-agent"] + let interactive = ["/usr/local/bin/wv"] .iter() .map(ToString::to_string) .collect::>(); diff --git a/crates/pa-daemon/src/herdr.rs b/crates/pa-daemon/src/herdr.rs index c06da71d8..99af709cf 100644 --- a/crates/pa-daemon/src/herdr.rs +++ b/crates/pa-daemon/src/herdr.rs @@ -5,7 +5,7 @@ //! (`HERDR_ENV=1`, `HERDR_PANE_ID`, `HERDR_SOCKET_PATH` — the socket of //! its pane-state API) for the processes running inside them. This module //! reports this session's lifecycle state (`working` / `blocked` / -//! `idle`) to that socket, so a Herdr pane shows its Prime Agent session +//! `idle`) to that socket, so a Herdr pane shows its Weave session //! as live, done, or stuck — the in-tree counterpart of the TS //! `herdr-agent-state.ts` extension (`herdr integration install pi` also //! writes one; the built-in ships so the pane reports out of the box). @@ -25,8 +25,8 @@ //! response byte, an error, or 500 ms): //! //! ```json -//! {"id":"herdr:pi::","method":"pane.report_agent","params":{"pane_id":"","source":"herdr:pi","agent":"prime-agent","state":"working","seq":1780000000000000,"agent_session_path":"/home/me/.prime/agent/sessions/.jsonl"}} -//! {"id":"herdr:pi:release::","method":"pane.release_agent","params":{"pane_id":"…","source":"herdr:pi","agent":"prime-agent","seq":1780000000000001}} +//! {"id":"herdr:pi::","method":"pane.report_agent","params":{"pane_id":"","source":"herdr:pi","agent":"wv","state":"working","seq":1780000000000000,"agent_session_path":"/home/me/.prime/agent/sessions/.jsonl"}} +//! {"id":"herdr:pi:release::","method":"pane.release_agent","params":{"pane_id":"…","source":"herdr:pi","agent":"wv","seq":1780000000000001}} //! ``` //! //! `message` rides only blocked reports. `seq` is per-process monotonic @@ -66,7 +66,7 @@ const SEND_TIMEOUT_MS: u64 = 500; /// The reporter identity on every report (TS main `herdr:pi` source; /// `herdr integration install pi` reports under the same pair). pub(crate) const HERDR_SOURCE: &str = "herdr:pi"; -pub(crate) const HERDR_AGENT: &str = "prime-agent"; +pub(crate) const HERDR_AGENT: &str = "wv"; /// The Herdr socket target (TS `herdrSocketTarget`): Herdr exports a /// Unix-style socket path; on Windows that dials the local named-pipe @@ -892,7 +892,7 @@ pub(crate) fn valid_resume_argv(target: Option<&str>) -> Option> { if target.is_empty() || target.contains('\'') || target.chars().any(char::is_control) { return None; } - let argv = ["prime-agent", "--resume", target] + let argv = ["wv", "--resume", target] .into_iter() .map(str::to_string) .collect::>(); @@ -1073,18 +1073,14 @@ mod tests { assert_eq!( argv, Some(vec![ - "prime-agent".to_string(), + "wv".to_string(), "--resume".to_string(), "019e71ec-e08a-75a9-b573-000000000001.jsonl".to_string(), ]) ); assert_eq!( valid_resume_argv(Some(" trimmed-id ")), - Some(vec![ - "prime-agent".into(), - "--resume".into(), - "trimmed-id".into() - ]) + Some(vec!["wv".into(), "--resume".into(), "trimmed-id".into()]) ); // Missing, empty, or hostile targets carry no resume command. assert_eq!(valid_resume_argv(None), None); @@ -1233,7 +1229,7 @@ mod tests { let params = &report["params"]; assert_eq!(params["pane_id"], "w1:p1"); assert_eq!(params["source"], "herdr:pi"); - assert_eq!(params["agent"], "prime-agent"); + assert_eq!(params["agent"], "wv"); assert_eq!(params["state"], "idle"); assert_eq!( params["agent_session_path"], @@ -1241,11 +1237,7 @@ mod tests { ); assert_eq!( params["resume_argv"], - json!([ - "prime-agent", - "--resume", - "/home/me/.prime/agent/sessions/s1.jsonl" - ]) + json!(["wv", "--resume", "/home/me/.prime/agent/sessions/s1.jsonl"]) ); // The id carries the source prefix; the seq is a number. assert!(report["id"].as_str().unwrap().starts_with("herdr:pi:")); diff --git a/crates/pa-daemon/src/hold_refusal.rs b/crates/pa-daemon/src/hold_refusal.rs index 597c6d950..d56aba9fa 100644 --- a/crates/pa-daemon/src/hold_refusal.rs +++ b/crates/pa-daemon/src/hold_refusal.rs @@ -107,23 +107,23 @@ fn classify_from(exe: Option<&Path>, own_exe: Option<&Path>) -> HolderFlavor { return HolderFlavor::ThisBuild; } // The keyword-takeover install layout: the payload sits DIRECTLY - // inside the share dir (`.../share/prime-agent/prime-agent`), while a + // inside the share dir (`.../share/weave/wv`), while a // TS release binary sits one level deeper // (`.../releases//prime-agent`), so the parent component claims // this product. - if components.len() >= 2 && components.last().map(String::as_str) == Some("prime-agent") { + if components.len() >= 2 && components.last().map(String::as_str) == Some("wv") { let parent = components[components.len() - 2].as_str(); // The parent alone is the layout signal (a TS release binary's - // parent is the release name, never `prime-agent`). + // parent is the release name, never `wv`). let is_publish_byproduct = - parent.starts_with("prime-agent.old.") || parent.starts_with("prime-agent.stage."); - if parent == "prime-agent" || is_publish_byproduct { + parent.starts_with("weave.old.") || parent.starts_with("weave.stage."); + if parent == "weave" || is_publish_byproduct { return HolderFlavor::ThisBuild; } } // The exe filename gate keeps a node/bun/deno runtime that merely runs - // FROM a `prime-agent`-named directory from claiming this build: only - // the payload binary named `prime-agent` is claimed. + // FROM a `wv`-named directory from claiming this build: only + // the payload binary named `wv` is claimed. if let Some(index) = components .iter() .position(|component| component == "target") @@ -280,8 +280,8 @@ the same daemon, so this build cannot open the file while that process holds it. )); lines.push(String::new()); lines.push("• Continue where you left off:".to_string()); - // The Rust port owns the `prime-agent` keyword, so naming - // `prime-agent --resume` here would launch THIS build. The + // The Rust port is now `wv`, so naming + // `prime-agent --resume` runs the TypeScript binary that holds the // continue path names the TypeScript binary that holds the // lease, derived from the holder's live process image. match (holder_exe, id) { @@ -305,17 +305,17 @@ the same daemon, so this build cannot open the file while that process holds it. } _ => { lines.push( - " (continue in the TypeScript product — its daemon owns this session; the prime-agent keyword launches this Rust build, so use the TypeScript binary from its preserved install)" + " (continue in the TypeScript product — its daemon owns this session; use the TypeScript binary from its preserved install)" .to_string(), ); } } lines.push(String::new()); - lines.extend(take_over_lines(hold, "prime-agent", holder_exe)); + lines.extend(take_over_lines(hold, "wv", holder_exe)); } HolderFlavor::ThisBuild => { lines.push(format!( - "This session is currently open in another Rust build of Prime Agent \ + "This session is currently open in another Rust build of Weave \ (active in {holder_id}) — another daemon or window of this product holds the file's \ runtime lease." )); @@ -323,7 +323,7 @@ runtime lease." lines.push("• Continue where you left off:".to_string()); if let Some(id) = id { lines.push(format!( - " prime-agent --daemon-socket --resume {}", + " wv --daemon-socket --resume {}", shell_quote(&single_line(id)) )); lines.push( @@ -332,7 +332,7 @@ you started it — that daemon owns this session)" .to_string(), ); } else { - lines.push(" prime-agent --resume".to_string()); + lines.push(" wv --resume".to_string()); lines.push( " (switch to the window or shell where that instance is running — its \ daemon owns this session)" @@ -340,7 +340,7 @@ daemon owns this session)" ); } lines.push(String::new()); - lines.extend(take_over_lines(hold, "prime-agent", holder_exe)); + lines.extend(take_over_lines(hold, "wv", holder_exe)); } HolderFlavor::AnotherProcess => { lines.push(format!( @@ -349,7 +349,7 @@ daemon owns this session)" runtime lease." )); lines.push(String::new()); - lines.extend(take_over_lines(hold, "prime-agent", holder_exe)); + lines.extend(take_over_lines(hold, "wv", holder_exe)); } } lines.push(String::new()); @@ -428,12 +428,12 @@ Session: ts01ab"; let message = refusal_for_flavor(HolderFlavor::TypeScriptProduct, &hold, None, None); assert!( - message.contains("the prime-agent keyword launches this Rust build"), + message.contains("use the TypeScript binary from its preserved install"), "the unresolvable-exe continue path states the takeover: {message}" ); assert!( !message.contains("prime-agent --resume"), - "no bare `prime-agent --resume` hint remains (it launches this build): {message}" + "no bare `prime-agent --resume` hint remains: {message}" ); } @@ -485,7 +485,7 @@ Session: ts01ab"; "a runtime image never becomes the resume command: {message}" ); assert!( - message.contains("the prime-agent keyword launches this Rust build"), + message.contains("use the TypeScript binary from its preserved install"), "the runtime holder gets the takeover wording: {message}" ); @@ -514,7 +514,7 @@ Session: ts01ab"; }; let message = refusal_for_flavor(HolderFlavor::ThisBuild, &hold, None, None); assert!( - message.contains("prime-agent --daemon-socket --resume 'rs01cd'"), + message.contains("wv --daemon-socket --resume 'rs01cd'"), "the attach command names the flag and the session: {message}" ); assert!( @@ -536,7 +536,7 @@ Session: ts01ab"; "the anonymous holder id renders: {message}" ); assert!( - message.contains("prime-agent shutdown --force"), + message.contains("wv shutdown --force"), "without a pid the sweep command is the take-over path: {message}" ); } @@ -612,22 +612,20 @@ Session: ts01ab"; #[pa_test_scratch::pa_test] #[test] fn the_holder_classification_matrix() { - let own = Path::new("/Users/k/.local/share/prime-agent/prime-agent"); + let own = Path::new("/Users/k/.local/share/weave/wv"); assert_eq!(classify_from(Some(own), Some(own)), HolderFlavor::ThisBuild); assert_eq!( classify_from( - Some(Path::new("/Users/k/.local/share/prime-agent/prime-agent")), - Some(Path::new("/opt/pa/prime-agent")) + Some(Path::new("/Users/k/.local/share/weave/wv")), + Some(Path::new("/opt/pa/wv")) ), HolderFlavor::ThisBuild ); // A daemon still running from the renamed rollback tree. assert_eq!( classify_from( - Some(Path::new( - "/Users/k/.local/share/prime-agent.old.123/prime-agent" - )), - Some(Path::new("/opt/pa/prime-agent")) + Some(Path::new("/Users/k/.local/share/weave.old.123/wv")), + Some(Path::new("/opt/pa/wv")) ), HolderFlavor::ThisBuild ); @@ -635,16 +633,13 @@ Session: ts01ab"; assert_eq!( classify_from( Some(Path::new("/opt/pa/prime-agent-rust")), - Some(Path::new("/opt/pa/prime-agent")) + Some(Path::new("/opt/pa/wv")) ), HolderFlavor::ThisBuild ); // A cargo dev build: the /target/ shape names this product. assert_eq!( - classify_from( - Some(Path::new("/w/repo/target/release/prime-agent")), - Some(own) - ), + classify_from(Some(Path::new("/w/repo/target/release/wv")), Some(own)), HolderFlavor::ThisBuild ); // The deployed TS release binary, and the preserved legacy tree @@ -677,9 +672,7 @@ Session: ts01ab"; // mis-reject the flat takeover layout. assert_eq!( classify_from( - Some(Path::new( - "/opt/releases/user/share/prime-agent/prime-agent" - )), + Some(Path::new("/opt/releases/user/share/weave/wv")), Some(own) ), HolderFlavor::ThisBuild @@ -687,7 +680,7 @@ Session: ts01ab"; assert_eq!( classify_from( Some(Path::new( - "/Users/k/.local/share/prime-agent.old.123/prime-agent (deleted)" + "/Users/k/.local/share/weave.old.123/wv (deleted)" )), Some(own) ), @@ -735,8 +728,8 @@ Session: ts01ab"; classify_from(Some(Path::new("/usr/bin/less")), Some(own)), HolderFlavor::AnotherProcess ); - // The own-exe equality wins even under the prime-agent substring. - let dev = Path::new("/w/repo/target/debug/prime-agent"); + // The own-exe equality wins even under the shared name family. + let dev = Path::new("/w/repo/target/debug/wv"); assert_eq!(classify_from(Some(dev), Some(dev)), HolderFlavor::ThisBuild); } diff --git a/crates/pa-daemon/src/journal.rs b/crates/pa-daemon/src/journal.rs index 78bd9c1a6..a3dab10ae 100644 --- a/crates/pa-daemon/src/journal.rs +++ b/crates/pa-daemon/src/journal.rs @@ -127,7 +127,7 @@ impl Drop for JournalWriteOwner { // Drop has no error channel; report without panicking if stderr is unavailable. let _ = writeln!( std::io::stderr(), - "Prime Agent: failed to release journal ownership: {error}" + "Weave: failed to release journal ownership: {error}" ); } } diff --git a/crates/pa-daemon/src/lib.rs b/crates/pa-daemon/src/lib.rs index f69e9ce2f..d8c1f6fa9 100644 --- a/crates/pa-daemon/src/lib.rs +++ b/crates/pa-daemon/src/lib.rs @@ -1,4 +1,4 @@ -//! Session supervisor, worker processes, and wire protocol for Prime Agent: +//! Session supervisor, worker processes, and wire protocol for Weave: //! the supervisor spawns one worker process per active session, supervises //! restarts with backoff, and routes clients; sessions persist as //! append-only JSONL in the same layout as the TS product. diff --git a/crates/pa-daemon/src/main.rs b/crates/pa-daemon/src/main.rs index fb82829c9..93b1bdd64 100644 --- a/crates/pa-daemon/src/main.rs +++ b/crates/pa-daemon/src/main.rs @@ -6,7 +6,7 @@ use anyhow::{anyhow, Result}; #[tokio::main] async fn main() -> Result<()> { - // Same allocator cap as the prime-agent binary: large transient phases + // Same allocator cap as the wv binary: large transient phases // (session loads, attach snapshots) must not leave per-arena high-water // pages resident. pa_types::memory_release::cap_thread_arenas(); diff --git a/crates/pa-daemon/src/supervisor/clients.rs b/crates/pa-daemon/src/supervisor/clients.rs index 484a6558f..065c8478a 100644 --- a/crates/pa-daemon/src/supervisor/clients.rs +++ b/crates/pa-daemon/src/supervisor/clients.rs @@ -113,7 +113,7 @@ impl Supervisor { schema_revision: Some(DAEMON_SCHEMA_REVISION), app_version: Some(app_version().to_string()), runtime: Some(DaemonRuntimeIdentity { - build_id: concat!("pa-daemon-rs-", env!("CARGO_PKG_VERSION")).to_string(), + build_id: concat!("weave-daemon-", env!("CARGO_PKG_VERSION")).to_string(), executable_path: std::env::current_exe() .map(|p| p.to_string_lossy().to_string()) .unwrap_or_default(), diff --git a/crates/pa-daemon/src/update_restore.rs b/crates/pa-daemon/src/update_restore.rs index 1391114ad..f96ffa23d 100644 --- a/crates/pa-daemon/src/update_restore.rs +++ b/crates/pa-daemon/src/update_restore.rs @@ -26,7 +26,7 @@ use crate::supervisor::Supervisor; pub(crate) const UPDATE_RESTORE_CLIENT_ID: &str = "update-restore"; /// TS `UPDATE_RESTART_CONTINUATION_PROMPT`, verbatim (spec §10.5). -pub(crate) const UPDATE_RESTART_CONTINUATION_PROMPT: &str = "Prime Agent restarted after an update. Continue the interrupted task from the saved transcript and restored tool/kernel state. Inspect current state before retrying commands when needed."; +pub(crate) const UPDATE_RESTART_CONTINUATION_PROMPT: &str = "Weave restarted after an update. Continue the interrupted task from the saved transcript and restored tool/kernel state. Inspect current state before retrying commands when needed."; /// How long a client attach queues behind an in-flight restore pass (spec §10.4). const RESTORE_ATTACH_WAIT_MS: u64 = 120_000; @@ -583,7 +583,7 @@ where if origin == Some(row.active_session_id.as_str()) { commands.push(("append_custom_message", json!({ "message": { "customType": "prime-agent.update_complete", - "content": format!("[update-complete]\n\nPrime Agent updated to v{version}. This daemon session was restored after the update."), + "content": format!("[update-complete]\n\nWeave updated to v{version}. This daemon session was restored after the update."), "display": true, "details": { "version": version }, }}))); @@ -829,7 +829,7 @@ impl Supervisor { .map(|(session_file, message)| { format!( "Session {selector} failed to restore: {message}. The session file is at \ - {session_file} — run `prime-agent attach` to resume it manually." + {session_file} — run `wv attach` to resume it manually." ) }) } @@ -953,7 +953,7 @@ mod tests { "append_custom_message", json!({ "message": { "customType": "prime-agent.update_complete", - "content": "[update-complete]\n\nPrime Agent updated to v1.0.0. This daemon session was restored after the update.", + "content": "[update-complete]\n\nWeave updated to v1.0.0. This daemon session was restored after the update.", "display": true, "details": { "version": "1.0.0" } }}) ), diff --git a/crates/pa-daemon/testdata/acp/rust-cancel.jsonl b/crates/pa-daemon/testdata/acp/rust-cancel.jsonl index a91519499..8ca7e5708 100644 --- a/crates/pa-daemon/testdata/acp/rust-cancel.jsonl +++ b/crates/pa-daemon/testdata/acp/rust-cancel.jsonl @@ -1,5 +1,5 @@ {"scenario": "cancel", "direction": "out", "frame": {"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocolVersion": 1, "clientCapabilities": {}, "clientInfo": {"name": "differential-capture", "title": "Differential Capture", "version": "0.0.1"}}}} -{"scenario": "cancel", "direction": "in", "frame": {"id": 1, "jsonrpc": "2.0", "result": {"_meta": {"ai.primeintellect.prime-agent": {}}, "agentCapabilities": {"loadSession": false, "mcpCapabilities": {"http": true}, "promptCapabilities": {"embeddedContext": true, "image": true}, "sessionCapabilities": {"close": {}}}, "agentInfo": {"name": "prime-agent", "title": "Prime Agent", "version": "0.1.0"}, "protocolVersion": 1}}} +{"scenario": "cancel", "direction": "in", "frame": {"id": 1, "jsonrpc": "2.0", "result": {"_meta": {"ai.primeintellect.prime-agent": {}}, "agentCapabilities": {"loadSession": false, "mcpCapabilities": {"http": true}, "promptCapabilities": {"embeddedContext": true, "image": true}, "sessionCapabilities": {"close": {}}}, "agentInfo": {"name": "wv", "title": "Weave", "version": "0.1.0"}, "protocolVersion": 1}}} {"scenario": "cancel", "direction": "out", "frame": {"jsonrpc": "2.0", "id": 2, "method": "session/new", "params": {"cwd": "/tmp/acp-capture-rust3", "mcpServers": []}}} {"scenario": "cancel", "direction": "in", "frame": {"id": 2, "jsonrpc": "2.0", "result": {"sessionId": "ac07af6b-74c2-4e10-9442-09d74f2da759"}}} {"scenario": "cancel", "direction": "out", "frame": {"jsonrpc": "2.0", "id": 3, "method": "session/prompt", "params": {"sessionId": "ac07af6b-74c2-4e10-9442-09d74f2da759", "prompt": [{"type": "text", "text": "Write a 500-word essay about the history of computing."}]}}} diff --git a/crates/pa-daemon/testdata/acp/rust-compact_command.jsonl b/crates/pa-daemon/testdata/acp/rust-compact_command.jsonl index 29f81098c..3a6126626 100644 --- a/crates/pa-daemon/testdata/acp/rust-compact_command.jsonl +++ b/crates/pa-daemon/testdata/acp/rust-compact_command.jsonl @@ -1,5 +1,5 @@ {"scenario": "compact_command", "direction": "out", "frame": {"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocolVersion": 1, "clientCapabilities": {}, "clientInfo": {"name": "differential-capture", "title": "Differential Capture", "version": "0.0.1"}}}} -{"scenario": "compact_command", "direction": "in", "frame": {"id": 1, "jsonrpc": "2.0", "result": {"_meta": {"ai.primeintellect.prime-agent": {}}, "agentCapabilities": {"loadSession": false, "mcpCapabilities": {"http": true}, "promptCapabilities": {"embeddedContext": true, "image": true}, "sessionCapabilities": {"close": {}}}, "agentInfo": {"name": "prime-agent", "title": "Prime Agent", "version": "0.1.0"}, "protocolVersion": 1}}} +{"scenario": "compact_command", "direction": "in", "frame": {"id": 1, "jsonrpc": "2.0", "result": {"_meta": {"ai.primeintellect.prime-agent": {}}, "agentCapabilities": {"loadSession": false, "mcpCapabilities": {"http": true}, "promptCapabilities": {"embeddedContext": true, "image": true}, "sessionCapabilities": {"close": {}}}, "agentInfo": {"name": "wv", "title": "Weave", "version": "0.1.0"}, "protocolVersion": 1}}} {"scenario": "compact_command", "direction": "out", "frame": {"jsonrpc": "2.0", "id": 2, "method": "session/new", "params": {"cwd": "/tmp/acp-capture-rust4", "mcpServers": []}}} {"scenario": "compact_command", "direction": "in", "frame": {"id": 2, "jsonrpc": "2.0", "result": {"sessionId": "4056d693-3131-4fa5-a63a-667ca228256b"}}} {"scenario": "compact_command", "direction": "out", "frame": {"jsonrpc": "2.0", "id": 3, "method": "session/prompt", "params": {"sessionId": "4056d693-3131-4fa5-a63a-667ca228256b", "prompt": [{"type": "text", "text": "Tell me three facts about rivers."}]}}} diff --git a/crates/pa-daemon/testdata/acp/rust-cwd_mismatch.jsonl b/crates/pa-daemon/testdata/acp/rust-cwd_mismatch.jsonl index 70df70d59..62a9c1e07 100644 --- a/crates/pa-daemon/testdata/acp/rust-cwd_mismatch.jsonl +++ b/crates/pa-daemon/testdata/acp/rust-cwd_mismatch.jsonl @@ -1,5 +1,5 @@ {"scenario": "cwd_mismatch", "direction": "out", "frame": {"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocolVersion": 1, "clientCapabilities": {}, "clientInfo": {"name": "differential-capture", "title": "Differential Capture", "version": "0.0.1"}}}} -{"scenario": "cwd_mismatch", "direction": "in", "frame": {"id": 1, "jsonrpc": "2.0", "result": {"_meta": {"ai.primeintellect.prime-agent": {}}, "agentCapabilities": {"loadSession": false, "mcpCapabilities": {"http": true}, "promptCapabilities": {"embeddedContext": true, "image": true}, "sessionCapabilities": {"close": {}}}, "agentInfo": {"name": "prime-agent", "title": "Prime Agent", "version": "0.1.0"}, "protocolVersion": 1}}} +{"scenario": "cwd_mismatch", "direction": "in", "frame": {"id": 1, "jsonrpc": "2.0", "result": {"_meta": {"ai.primeintellect.prime-agent": {}}, "agentCapabilities": {"loadSession": false, "mcpCapabilities": {"http": true}, "promptCapabilities": {"embeddedContext": true, "image": true}, "sessionCapabilities": {"close": {}}}, "agentInfo": {"name": "wv", "title": "Weave", "version": "0.1.0"}, "protocolVersion": 1}}} {"scenario": "cwd_mismatch", "direction": "out", "frame": {"jsonrpc": "2.0", "id": 2, "method": "session/new", "params": {"cwd": "/tmp", "mcpServers": []}}} {"scenario": "cwd_mismatch", "direction": "in", "frame": {"id": 2, "jsonrpc": "2.0", "result": {"_meta": {"ai.primeintellect.prime-agent": {"cwd": {"actual": "/tmp/acp-capture-rust4", "requested": "/tmp"}}}, "sessionId": "61a4d27b-59b8-44e5-9c58-76e0e38a74c8"}}} {"scenario": "cwd_mismatch", "direction": "out", "frame": {"jsonrpc": "2.0", "id": 3, "method": "session/close", "params": {"sessionId": "61a4d27b-59b8-44e5-9c58-76e0e38a74c8"}}} diff --git a/crates/pa-daemon/testdata/acp/rust-errors.jsonl b/crates/pa-daemon/testdata/acp/rust-errors.jsonl index 47b13b0ca..ae77dca0a 100644 --- a/crates/pa-daemon/testdata/acp/rust-errors.jsonl +++ b/crates/pa-daemon/testdata/acp/rust-errors.jsonl @@ -1,5 +1,5 @@ {"scenario": "errors", "direction": "out", "frame": {"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocolVersion": 1, "clientCapabilities": {}, "clientInfo": {"name": "differential-capture", "title": "Differential Capture", "version": "0.0.1"}}}} -{"scenario": "errors", "direction": "in", "frame": {"id": 1, "jsonrpc": "2.0", "result": {"_meta": {"ai.primeintellect.prime-agent": {}}, "agentCapabilities": {"loadSession": false, "mcpCapabilities": {"http": true}, "promptCapabilities": {"embeddedContext": true, "image": true}, "sessionCapabilities": {"close": {}}}, "agentInfo": {"name": "prime-agent", "title": "Prime Agent", "version": "0.1.0"}, "protocolVersion": 1}}} +{"scenario": "errors", "direction": "in", "frame": {"id": 1, "jsonrpc": "2.0", "result": {"_meta": {"ai.primeintellect.prime-agent": {}}, "agentCapabilities": {"loadSession": false, "mcpCapabilities": {"http": true}, "promptCapabilities": {"embeddedContext": true, "image": true}, "sessionCapabilities": {"close": {}}}, "agentInfo": {"name": "wv", "title": "Weave", "version": "0.1.0"}, "protocolVersion": 1}}} {"scenario": "errors", "direction": "out", "frame": {"jsonrpc": "2.0", "id": 2, "method": "session/prompt", "params": {"sessionId": "bogus-session", "prompt": [{"type": "text", "text": "hi"}]}}} {"scenario": "errors", "direction": "in", "frame": {"error": {"code": -32603, "data": {"details": "Unknown ACP session: bogus-session"}, "message": "Internal error"}, "id": 2, "jsonrpc": "2.0"}} {"scenario": "errors", "direction": "out", "frame": {"jsonrpc": "2.0", "id": 3, "method": "session/close", "params": {"sessionId": "bogus-session"}}} diff --git a/crates/pa-daemon/testdata/acp/rust-goal_command.jsonl b/crates/pa-daemon/testdata/acp/rust-goal_command.jsonl index df28c8259..451077f27 100644 --- a/crates/pa-daemon/testdata/acp/rust-goal_command.jsonl +++ b/crates/pa-daemon/testdata/acp/rust-goal_command.jsonl @@ -1,5 +1,5 @@ {"scenario": "goal_command", "direction": "out", "frame": {"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocolVersion": 1, "clientCapabilities": {}, "clientInfo": {"name": "differential-capture", "title": "Differential Capture", "version": "0.0.1"}}}} -{"scenario": "goal_command", "direction": "in", "frame": {"id": 1, "jsonrpc": "2.0", "result": {"_meta": {"ai.primeintellect.prime-agent": {}}, "agentCapabilities": {"loadSession": false, "mcpCapabilities": {"http": true}, "promptCapabilities": {"embeddedContext": true, "image": true}, "sessionCapabilities": {"close": {}}}, "agentInfo": {"name": "prime-agent", "title": "Prime Agent", "version": "0.1.0"}, "protocolVersion": 1}}} +{"scenario": "goal_command", "direction": "in", "frame": {"id": 1, "jsonrpc": "2.0", "result": {"_meta": {"ai.primeintellect.prime-agent": {}}, "agentCapabilities": {"loadSession": false, "mcpCapabilities": {"http": true}, "promptCapabilities": {"embeddedContext": true, "image": true}, "sessionCapabilities": {"close": {}}}, "agentInfo": {"name": "wv", "title": "Weave", "version": "0.1.0"}, "protocolVersion": 1}}} {"scenario": "goal_command", "direction": "out", "frame": {"jsonrpc": "2.0", "id": 2, "method": "session/new", "params": {"cwd": "/tmp/acp-capture-rust3", "mcpServers": []}}} {"scenario": "goal_command", "direction": "in", "frame": {"id": 2, "jsonrpc": "2.0", "result": {"sessionId": "e90b279e-a781-4695-bb20-6da6fe6164ef"}}} {"scenario": "goal_command", "direction": "out", "frame": {"jsonrpc": "2.0", "id": 3, "method": "session/prompt", "params": {"sessionId": "e90b279e-a781-4695-bb20-6da6fe6164ef", "prompt": [{"type": "text", "text": "/goal reply with exactly: GOAL-DONE"}]}}} diff --git a/crates/pa-daemon/testdata/acp/rust-happy_path.jsonl b/crates/pa-daemon/testdata/acp/rust-happy_path.jsonl index 55b912d5c..0c25e2230 100644 --- a/crates/pa-daemon/testdata/acp/rust-happy_path.jsonl +++ b/crates/pa-daemon/testdata/acp/rust-happy_path.jsonl @@ -1,5 +1,5 @@ {"scenario": "happy_path", "direction": "out", "frame": {"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocolVersion": 1, "clientCapabilities": {}, "clientInfo": {"name": "differential-capture", "title": "Differential Capture", "version": "0.0.1"}}}} -{"scenario": "happy_path", "direction": "in", "frame": {"id": 1, "jsonrpc": "2.0", "result": {"_meta": {"ai.primeintellect.prime-agent": {}}, "agentCapabilities": {"loadSession": false, "mcpCapabilities": {"http": true}, "promptCapabilities": {"embeddedContext": true, "image": true}, "sessionCapabilities": {"close": {}}}, "agentInfo": {"name": "prime-agent", "title": "Prime Agent", "version": "0.1.0"}, "protocolVersion": 1}}} +{"scenario": "happy_path", "direction": "in", "frame": {"id": 1, "jsonrpc": "2.0", "result": {"_meta": {"ai.primeintellect.prime-agent": {}}, "agentCapabilities": {"loadSession": false, "mcpCapabilities": {"http": true}, "promptCapabilities": {"embeddedContext": true, "image": true}, "sessionCapabilities": {"close": {}}}, "agentInfo": {"name": "wv", "title": "Weave", "version": "0.1.0"}, "protocolVersion": 1}}} {"scenario": "happy_path", "direction": "out", "frame": {"jsonrpc": "2.0", "id": 2, "method": "session/new", "params": {"cwd": "/tmp/acp-capture-rust4", "mcpServers": []}}} {"scenario": "happy_path", "direction": "in", "frame": {"id": 2, "jsonrpc": "2.0", "result": {"sessionId": "f76652b5-2e1d-4f06-82c9-4533709742c6"}}} {"scenario": "happy_path", "direction": "out", "frame": {"jsonrpc": "2.0", "id": 3, "method": "session/prompt", "params": {"sessionId": "f76652b5-2e1d-4f06-82c9-4533709742c6", "prompt": [{"type": "text", "text": "Reply with exactly: ACP-OK"}]}}} diff --git a/crates/pa-daemon/testdata/acp/rust-mcp_errors.jsonl b/crates/pa-daemon/testdata/acp/rust-mcp_errors.jsonl index 533c91c54..f061bd45e 100644 --- a/crates/pa-daemon/testdata/acp/rust-mcp_errors.jsonl +++ b/crates/pa-daemon/testdata/acp/rust-mcp_errors.jsonl @@ -1,5 +1,5 @@ {"scenario": "mcp_errors", "direction": "out", "frame": {"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocolVersion": 1, "clientCapabilities": {}, "clientInfo": {"name": "differential-capture", "title": "Differential Capture", "version": "0.0.1"}}}} -{"scenario": "mcp_errors", "direction": "in", "frame": {"id": 1, "jsonrpc": "2.0", "result": {"_meta": {"ai.primeintellect.prime-agent": {}}, "agentCapabilities": {"loadSession": false, "mcpCapabilities": {"http": true}, "promptCapabilities": {"embeddedContext": true, "image": true}, "sessionCapabilities": {"close": {}}}, "agentInfo": {"name": "prime-agent", "title": "Prime Agent", "version": "0.1.0"}, "protocolVersion": 1}}} +{"scenario": "mcp_errors", "direction": "in", "frame": {"id": 1, "jsonrpc": "2.0", "result": {"_meta": {"ai.primeintellect.prime-agent": {}}, "agentCapabilities": {"loadSession": false, "mcpCapabilities": {"http": true}, "promptCapabilities": {"embeddedContext": true, "image": true}, "sessionCapabilities": {"close": {}}}, "agentInfo": {"name": "wv", "title": "Weave", "version": "0.1.0"}, "protocolVersion": 1}}} {"scenario": "mcp_errors", "direction": "out", "frame": {"jsonrpc": "2.0", "id": 2, "method": "session/new", "params": {"cwd": "/tmp/acp-capture-rust4", "mcpServers": [{"name": "-bad", "type": "stdio", "command": "cat", "args": [], "env": []}]}}} {"scenario": "mcp_errors", "direction": "in", "frame": {"error": {"code": -32602, "data": {"reason": "MCP server names must start with an alphanumeric character and contain at most 64 alphanumeric, underscore, or hyphen characters"}, "message": "Invalid params"}, "id": 2, "jsonrpc": "2.0"}} {"scenario": "mcp_errors", "direction": "out", "frame": {"jsonrpc": "2.0", "id": 3, "method": "session/new", "params": {"cwd": "/tmp/acp-capture-rust4", "mcpServers": [{"name": "dup", "type": "stdio", "command": "cat", "args": [], "env": []}, {"name": "dup", "type": "http", "url": "https://mcp.invalid/x", "headers": []}]}}} diff --git a/crates/pa-daemon/testdata/acp/rust-mcp_replace.jsonl b/crates/pa-daemon/testdata/acp/rust-mcp_replace.jsonl index 39d5e907d..5aa15fad9 100644 --- a/crates/pa-daemon/testdata/acp/rust-mcp_replace.jsonl +++ b/crates/pa-daemon/testdata/acp/rust-mcp_replace.jsonl @@ -1,5 +1,5 @@ {"scenario": "mcp_replace", "direction": "out", "frame": {"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocolVersion": 1, "clientCapabilities": {}, "clientInfo": {"name": "differential-capture", "title": "Differential Capture", "version": "0.0.1"}}}} -{"scenario": "mcp_replace", "direction": "in", "frame": {"id": 1, "jsonrpc": "2.0", "result": {"_meta": {"ai.primeintellect.prime-agent": {}}, "agentCapabilities": {"loadSession": false, "mcpCapabilities": {"http": true}, "promptCapabilities": {"embeddedContext": true, "image": true}, "sessionCapabilities": {"close": {}}}, "agentInfo": {"name": "prime-agent", "title": "Prime Agent", "version": "0.1.0"}, "protocolVersion": 1}}} +{"scenario": "mcp_replace", "direction": "in", "frame": {"id": 1, "jsonrpc": "2.0", "result": {"_meta": {"ai.primeintellect.prime-agent": {}}, "agentCapabilities": {"loadSession": false, "mcpCapabilities": {"http": true}, "promptCapabilities": {"embeddedContext": true, "image": true}, "sessionCapabilities": {"close": {}}}, "agentInfo": {"name": "wv", "title": "Weave", "version": "0.1.0"}, "protocolVersion": 1}}} {"scenario": "mcp_replace", "direction": "out", "frame": {"jsonrpc": "2.0", "id": 2, "method": "session/new", "params": {"cwd": "/tmp/acp-capture-rust4", "mcpServers": [{"name": "capture-stdio", "type": "stdio", "command": "cat", "args": [], "env": []}]}}} {"scenario": "mcp_replace", "direction": "in", "frame": {"id": 2, "jsonrpc": "2.0", "result": {"sessionId": "192ef47e-c903-426a-b632-89542f7fa04d"}}} {"scenario": "mcp_replace", "direction": "out", "frame": {"jsonrpc": "2.0", "id": 3, "method": "session/close", "params": {"sessionId": "192ef47e-c903-426a-b632-89542f7fa04d"}}} diff --git a/crates/pa-daemon/testdata/acp/rust-mcp_stdio.jsonl b/crates/pa-daemon/testdata/acp/rust-mcp_stdio.jsonl index 3af48da1e..54fdfb1e7 100644 --- a/crates/pa-daemon/testdata/acp/rust-mcp_stdio.jsonl +++ b/crates/pa-daemon/testdata/acp/rust-mcp_stdio.jsonl @@ -1,5 +1,5 @@ {"scenario": "mcp_stdio", "direction": "out", "frame": {"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocolVersion": 1, "clientCapabilities": {}, "clientInfo": {"name": "differential-capture", "title": "Differential Capture", "version": "0.0.1"}}}} -{"scenario": "mcp_stdio", "direction": "in", "frame": {"id": 1, "jsonrpc": "2.0", "result": {"_meta": {"ai.primeintellect.prime-agent": {}}, "agentCapabilities": {"loadSession": false, "mcpCapabilities": {"http": true}, "promptCapabilities": {"embeddedContext": true, "image": true}, "sessionCapabilities": {"close": {}}}, "agentInfo": {"name": "prime-agent", "title": "Prime Agent", "version": "0.1.0"}, "protocolVersion": 1}}} +{"scenario": "mcp_stdio", "direction": "in", "frame": {"id": 1, "jsonrpc": "2.0", "result": {"_meta": {"ai.primeintellect.prime-agent": {}}, "agentCapabilities": {"loadSession": false, "mcpCapabilities": {"http": true}, "promptCapabilities": {"embeddedContext": true, "image": true}, "sessionCapabilities": {"close": {}}}, "agentInfo": {"name": "wv", "title": "Weave", "version": "0.1.0"}, "protocolVersion": 1}}} {"scenario": "mcp_stdio", "direction": "out", "frame": {"jsonrpc": "2.0", "id": 2, "method": "session/new", "params": {"cwd": "/tmp/acp-capture-rust4", "mcpServers": [{"name": "capture-stdio", "type": "stdio", "command": "cat", "args": [], "env": [{"name": "CAPTURE_MODE", "value": "stdio"}]}, {"name": "capture-http", "type": "http", "url": "https://mcp.invalid/capture", "headers": [{"name": "X-Capture", "value": "yes"}]}, {"name": "dropped-no-env", "type": "stdio", "command": "cat", "args": []}]}}} {"scenario": "mcp_stdio", "direction": "in", "frame": {"id": 2, "jsonrpc": "2.0", "result": {"sessionId": "fe7df832-0013-4be5-93ec-0f4e1ddde8b7"}}} {"scenario": "mcp_stdio", "direction": "out", "frame": {"jsonrpc": "2.0", "id": 3, "method": "session/close", "params": {"sessionId": "fe7df832-0013-4be5-93ec-0f4e1ddde8b7"}}} diff --git a/crates/pa-daemon/testdata/acp/rust-second_initialize.jsonl b/crates/pa-daemon/testdata/acp/rust-second_initialize.jsonl index ed35fc55d..679d68285 100644 --- a/crates/pa-daemon/testdata/acp/rust-second_initialize.jsonl +++ b/crates/pa-daemon/testdata/acp/rust-second_initialize.jsonl @@ -1,5 +1,5 @@ {"scenario": "second_initialize", "direction": "out", "frame": {"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocolVersion": 1, "clientCapabilities": {}, "clientInfo": {"name": "differential-capture", "title": "Differential Capture", "version": "0.0.1"}}}} -{"scenario": "second_initialize", "direction": "in", "frame": {"id": 1, "jsonrpc": "2.0", "result": {"_meta": {"ai.primeintellect.prime-agent": {}}, "agentCapabilities": {"loadSession": false, "mcpCapabilities": {"http": true}, "promptCapabilities": {"embeddedContext": true, "image": true}, "sessionCapabilities": {"close": {}}}, "agentInfo": {"name": "prime-agent", "title": "Prime Agent", "version": "0.1.0"}, "protocolVersion": 1}}} +{"scenario": "second_initialize", "direction": "in", "frame": {"id": 1, "jsonrpc": "2.0", "result": {"_meta": {"ai.primeintellect.prime-agent": {}}, "agentCapabilities": {"loadSession": false, "mcpCapabilities": {"http": true}, "promptCapabilities": {"embeddedContext": true, "image": true}, "sessionCapabilities": {"close": {}}}, "agentInfo": {"name": "wv", "title": "Weave", "version": "0.1.0"}, "protocolVersion": 1}}} {"scenario": "second_initialize", "direction": "out", "frame": {"jsonrpc": "2.0", "id": 2, "method": "initialize", "params": {"protocolVersion": 1, "clientCapabilities": {}, "clientInfo": {"name": "differential-capture", "title": "Differential Capture", "version": "0.0.1"}}}} -{"scenario": "second_initialize", "direction": "in", "frame": {"id": 2, "jsonrpc": "2.0", "result": {"_meta": {"ai.primeintellect.prime-agent": {}}, "agentCapabilities": {"loadSession": false, "mcpCapabilities": {"http": true}, "promptCapabilities": {"embeddedContext": true, "image": true}, "sessionCapabilities": {"close": {}}}, "agentInfo": {"name": "prime-agent", "title": "Prime Agent", "version": "0.1.0"}, "protocolVersion": 1}}} +{"scenario": "second_initialize", "direction": "in", "frame": {"id": 2, "jsonrpc": "2.0", "result": {"_meta": {"ai.primeintellect.prime-agent": {}}, "agentCapabilities": {"loadSession": false, "mcpCapabilities": {"http": true}, "promptCapabilities": {"embeddedContext": true, "image": true}, "sessionCapabilities": {"close": {}}}, "agentInfo": {"name": "wv", "title": "Weave", "version": "0.1.0"}, "protocolVersion": 1}}} {"scenario": "second_initialize", "direction": "meta", "frame": {"exitCode": 0, "stderr": ""}} diff --git a/crates/pa-daemon/testdata/acp/rust-tool_call.jsonl b/crates/pa-daemon/testdata/acp/rust-tool_call.jsonl index 03226e2f5..8c97e0127 100644 --- a/crates/pa-daemon/testdata/acp/rust-tool_call.jsonl +++ b/crates/pa-daemon/testdata/acp/rust-tool_call.jsonl @@ -1,5 +1,5 @@ {"scenario": "tool_call", "direction": "out", "frame": {"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocolVersion": 1, "clientCapabilities": {}, "clientInfo": {"name": "differential-capture", "title": "Differential Capture", "version": "0.0.1"}}}} -{"scenario": "tool_call", "direction": "in", "frame": {"id": 1, "jsonrpc": "2.0", "result": {"_meta": {"ai.primeintellect.prime-agent": {}}, "agentCapabilities": {"loadSession": false, "mcpCapabilities": {"http": true}, "promptCapabilities": {"embeddedContext": true, "image": true}, "sessionCapabilities": {"close": {}}}, "agentInfo": {"name": "prime-agent", "title": "Prime Agent", "version": "0.1.0"}, "protocolVersion": 1}}} +{"scenario": "tool_call", "direction": "in", "frame": {"id": 1, "jsonrpc": "2.0", "result": {"_meta": {"ai.primeintellect.prime-agent": {}}, "agentCapabilities": {"loadSession": false, "mcpCapabilities": {"http": true}, "promptCapabilities": {"embeddedContext": true, "image": true}, "sessionCapabilities": {"close": {}}}, "agentInfo": {"name": "wv", "title": "Weave", "version": "0.1.0"}, "protocolVersion": 1}}} {"scenario": "tool_call", "direction": "out", "frame": {"jsonrpc": "2.0", "id": 2, "method": "session/new", "params": {"cwd": "/tmp/acp-capture-rust4", "mcpServers": []}}} {"scenario": "tool_call", "direction": "in", "frame": {"id": 2, "jsonrpc": "2.0", "result": {"sessionId": "37669583-5f57-4e2c-8647-e356b3fa144c"}}} {"scenario": "tool_call", "direction": "out", "frame": {"jsonrpc": "2.0", "id": 3, "method": "session/prompt", "params": {"sessionId": "37669583-5f57-4e2c-8647-e356b3fa144c", "prompt": [{"type": "text", "text": "Use the ipython tool to compute 6*7 in one cell, then reply with only the result number."}]}}} diff --git a/crates/pa-daemon/tests/compaction_mega_trace_e2e.rs b/crates/pa-daemon/tests/compaction_mega_trace_e2e.rs index a26c4e991..d314c846e 100644 --- a/crates/pa-daemon/tests/compaction_mega_trace_e2e.rs +++ b/crates/pa-daemon/tests/compaction_mega_trace_e2e.rs @@ -143,7 +143,7 @@ fn serve(mut stream: TcpStream, requests: &Arc>>) -> std::io::R .first() .and_then(|message| message.get("content")) .and_then(Value::as_str) - .is_some_and(|content| content.starts_with("# prime-agent harness")) + .is_some_and(|content| content.starts_with("# wv harness")) }); let index = requests.lock().expect("mock lock").len(); requests.lock().expect("mock lock").push(body); @@ -165,7 +165,7 @@ fn serve(mut stream: TcpStream, requests: &Arc>>) -> std::io::R .first() .and_then(|message| message.get("content")) .and_then(Value::as_str) - .is_some_and(|content| content.starts_with("# prime-agent harness")) + .is_some_and(|content| content.starts_with("# wv harness")) }) }) .count() diff --git a/crates/pa-daemon/tests/herdr_pane_e2e.rs b/crates/pa-daemon/tests/herdr_pane_e2e.rs index 887b71815..1ab907fde 100644 --- a/crates/pa-daemon/tests/herdr_pane_e2e.rs +++ b/crates/pa-daemon/tests/herdr_pane_e2e.rs @@ -321,13 +321,13 @@ fn the_session_reports_its_payload_pane_across_the_lifecycle() { let params = &report["params"]; assert_eq!(params["pane_id"], "w1:payload"); assert_eq!(params["source"], "herdr:pi"); - assert_eq!(params["agent"], "prime-agent"); + assert_eq!(params["agent"], "wv"); assert_eq!(params["state"], "idle"); assert!(params.get("message").is_none(), "idle carries no message"); assert_eq!(params["agent_session_path"], session_file); assert_eq!( params["resume_argv"], - json!(["prime-agent", "--resume", session_file]) + json!(["wv", "--resume", session_file]) ); assert!(params["seq"].as_u64().expect("seq") > 0); assert_no_boot_pane(&requests, "w1:payload"); diff --git a/crates/pa-daemon/tests/hold_refusal_e2e.rs b/crates/pa-daemon/tests/hold_refusal_e2e.rs index 093c84523..20d1aaf9d 100644 --- a/crates/pa-daemon/tests/hold_refusal_e2e.rs +++ b/crates/pa-daemon/tests/hold_refusal_e2e.rs @@ -267,7 +267,7 @@ fn a_foreign_lease_holder_rejects_the_create_with_the_hold_refusal() { ); assert!( error.contains(&format!( - "prime-agent --daemon-socket --resume '{holder_id}'" + "wv --daemon-socket --resume '{holder_id}'" )), "the continue path is the exact attach command: {error}" ); @@ -282,7 +282,7 @@ fn a_foreign_lease_holder_rejects_the_create_with_the_hold_refusal() { // The holder worker runs the refusing supervisor's executable, so it is // another Rust build, never the TypeScript product. assert!( - error.starts_with("This session is currently open in another Rust build of Prime Agent"), + error.starts_with("This session is currently open in another Rust build of Weave"), "the holder is classified, not guessed: {error}" ); assert!( diff --git a/crates/pa-daemon/tests/supervisor_e2e/lifecycle.rs b/crates/pa-daemon/tests/supervisor_e2e/lifecycle.rs index 622a1efc1..1ea9fbe05 100644 --- a/crates/pa-daemon/tests/supervisor_e2e/lifecycle.rs +++ b/crates/pa-daemon/tests/supervisor_e2e/lifecycle.rs @@ -17,7 +17,7 @@ fn supervisor_end_to_end_scripted_session_lifecycle() { let (mut client, hello) = Client::connect(&socket); assert_eq!(hello["type"], "daemon_hello"); // Differential goldens captured from the TS supervisor - // (`prime-agent --mode daemon`, protocol 7, schema 29). + // (`wv --mode daemon`, protocol 7, schema 29). assert_eq!( hello["protocol"], serde_json::json!({ diff --git a/crates/pa-models/Cargo.toml b/crates/pa-models/Cargo.toml index 32b3ae35b..58f526d86 100644 --- a/crates/pa-models/Cargo.toml +++ b/crates/pa-models/Cargo.toml @@ -6,8 +6,8 @@ license.workspace = true description = "Live model catalog: fetch, no-cold-start chain, transport pinning, Prime Inference." [dependencies] -pa-ai = { path = "../pa-ai", version = "0.10.0" } -pa-types = { path = "../pa-types", version = "0.10.0" } +pa-ai = { path = "../pa-ai", version = "0.1.0" } +pa-types = { path = "../pa-types", version = "0.1.0" } serde = { workspace = true } serde_json = { workspace = true } thiserror = { workspace = true } diff --git a/crates/pa-models/src/bundled.rs b/crates/pa-models/src/bundled.rs index 1978c21a9..5d6409d84 100644 --- a/crates/pa-models/src/bundled.rs +++ b/crates/pa-models/src/bundled.rs @@ -131,11 +131,11 @@ mod tests { let bin = root.path().join("bin"); std::fs::create_dir_all(&libexec).unwrap(); std::fs::create_dir_all(&bin).unwrap(); - std::fs::write(libexec.join("prime-agent"), b"binary").unwrap(); - // The Homebrew formula layout: bin/prime-agent -> Cellar libexec. - let launcher = bin.join("prime-agent"); - std::os::unix::fs::symlink(libexec.join("prime-agent"), &launcher).unwrap(); - let real = libexec.join("prime-agent"); + std::fs::write(libexec.join("wv"), b"binary").unwrap(); + // The Homebrew formula layout: bin/wv -> Cellar libexec. + let launcher = bin.join("wv"); + std::os::unix::fs::symlink(libexec.join("wv"), &launcher).unwrap(); + let real = libexec.join("wv"); assert_eq!(exe_dir_of(&launcher), Some(libexec.clone())); assert_eq!(exe_dir_of(&real), Some(libexec)); } diff --git a/crates/pa-models/src/lib.rs b/crates/pa-models/src/lib.rs index 97c592e28..93b36e758 100644 --- a/crates/pa-models/src/lib.rs +++ b/crates/pa-models/src/lib.rs @@ -1,4 +1,4 @@ -//! Live model catalog subsystem for Prime Agent. +//! Live model catalog subsystem for Weave. //! Everything the catalog can do is select among transports the client //! compiled in; it can never introduce a transport or change what a //! request sends. Depends on pa-ai and pa-types; nothing above pa-agent. diff --git a/crates/pa-tui/Cargo.toml b/crates/pa-tui/Cargo.toml index 9c03f71f3..cf846f9b9 100644 --- a/crates/pa-tui/Cargo.toml +++ b/crates/pa-tui/Cargo.toml @@ -3,11 +3,11 @@ name = "pa-tui" version.workspace = true edition.workspace = true license.workspace = true -description = "Terminal UI for Prime Agent." +description = "Terminal UI for Weave." [dependencies] uuid = { version = "1", features = ["v4"] } -pa-types = { path = "../pa-types", version = "0.10.0" } +pa-types = { path = "../pa-types", version = "0.1.0" } ratatui = { version = "0.29", default-features = false, features = ["crossterm"] } crossterm = { version = "0.28", features = ["event-stream"] } unicode-width = "0.2" diff --git a/crates/pa-tui/src/agents_view/tests/notices.rs b/crates/pa-tui/src/agents_view/tests/notices.rs index ac9ed4ca9..483604eb6 100644 --- a/crates/pa-tui/src/agents_view/tests/notices.rs +++ b/crates/pa-tui/src/agents_view/tests/notices.rs @@ -31,12 +31,12 @@ fn mode_with_notice(notice: &str) -> AgentsViewMode { /// the panel: the full text stays visible, and any key dismisses it. #[test] fn a_multiline_refusal_notice_renders_as_a_dismissible_panel() { - let refusal = "This session is currently open in another Rust build of Prime Agent \ + let refusal = "This session is currently open in another Rust build of Weave \ (active in 6b558be357e3) — another daemon or window of this product holds the file's \ -runtime lease.\n\n• Continue where you left off:\n prime-agent --daemon-socket \ +runtime lease.\n\n• Continue where you left off:\n wv --daemon-socket \ --resume 'sess-1'\n ( is that instance's daemon socket, from the \ shell where you started it — that daemon owns this session)\n\n• Take over on this \ -daemon:\n kill 4242 # the holder is prime-agent\n Then retry — the file unlocks when \ +daemon:\n kill 4242 # the holder is wv\n Then retry — the file unlocks when \ the holder exits."; let render = |mode: &mut AgentsViewMode| { let (lines, _) = mode.render_frame(120, 40); @@ -56,7 +56,7 @@ the holder exits."; "Continue where you left off", "--daemon-socket --resume 'sess-1'", "Take over on this daemon", - "kill 4242 # the holder is prime-agent", + "kill 4242 # the holder is wv", ] { assert!( shown.contains(way_out), diff --git a/crates/pa-tui/src/agents_view_search.rs b/crates/pa-tui/src/agents_view_search.rs index 257ce682e..5387d1eec 100644 --- a/crates/pa-tui/src/agents_view_search.rs +++ b/crates/pa-tui/src/agents_view_search.rs @@ -285,7 +285,7 @@ mod tests { // One word: tier comparisons below stay single-token queries. name: "gatewayworker".to_string(), id: "01a0b6b3-2e8d-71ab-b1c2-2a7db1bf8077".to_string(), - cwd: "/home/dev/work/prime-agent".to_string(), + cwd: "/home/dev/work/wv".to_string(), } } @@ -349,7 +349,7 @@ mod tests { #[test] fn the_cwd_targets_basename_first() { - assert!(score("prime-agent").is_some(), "cwd basename matches"); + assert!(score("wv").is_some(), "cwd basename matches"); assert!(score("dev/work").is_some(), "cwd path fragments match"); } diff --git a/crates/pa-tui/src/app.rs b/crates/pa-tui/src/app.rs index 44f47f43a..c71de81e7 100644 --- a/crates/pa-tui/src/app.rs +++ b/crates/pa-tui/src/app.rs @@ -42,7 +42,7 @@ pub fn load_theme(name: &str) -> Theme { match crate::theme::load_named_theme(name, mode) { Ok(theme) => theme, Err(error) => { - eprintln!("Prime Agent: {error:#}; using prime theme."); + eprintln!("Weave: {error:#}; using prime theme."); Theme::builtin("prime", mode) } } diff --git a/crates/pa-tui/src/autocomplete/tests.rs b/crates/pa-tui/src/autocomplete/tests.rs index f4f5be355..aa91b4325 100644 --- a/crates/pa-tui/src/autocomplete/tests.rs +++ b/crates/pa-tui/src/autocomplete/tests.rs @@ -627,25 +627,25 @@ fn at_item_values(provider: &CombinedAutocompleteProvider, text: &str) -> Vec String { /// Where a session runs; drives labels that depend on persistence. #[derive(Debug, Clone, Default)] pub struct ChromeState { - /// Product version shown in the splash (`prime agent vX`). + /// Product version shown in the splash (`weave vX`). pub version: String, /// Session working directory (splash `cwd` line; `~`-compressed). pub cwd: String, @@ -299,7 +299,7 @@ pub fn render_splash(state: &ChromeState, theme: &Theme, width: usize) -> Vec
  • = Vec::new(); if str_width(&format!("{title} {version}")) <= content_width { diff --git a/crates/pa-tui/src/chrome/tests.rs b/crates/pa-tui/src/chrome/tests.rs index 28a307dcc..302b6ea72 100644 --- a/crates/pa-tui/src/chrome/tests.rs +++ b/crates/pa-tui/src/chrome/tests.rs @@ -558,7 +558,7 @@ fn splash_renders_version_model_and_cwd() { let lines = render_splash(&state, &theme(), 120); assert_eq!(lines[0], Vec::new()); let text = |line: &Line| line.iter().map(|s| s.content.as_str()).collect::(); - assert!(lines.iter().any(|l| text(l).contains("prime agent v0.0.0"))); + assert!(lines.iter().any(|l| text(l).contains("weave v0.0.0"))); assert!(lines.iter().any(|l| text(l).contains("model faux-1"))); assert!(lines.iter().any(|l| text(l).contains("cwd /tmp/project"))); } diff --git a/crates/pa-tui/src/clipboard_image.rs b/crates/pa-tui/src/clipboard_image.rs index d13d59b51..cea9d5ac6 100644 --- a/crates/pa-tui/src/clipboard_image.rs +++ b/crates/pa-tui/src/clipboard_image.rs @@ -160,7 +160,7 @@ fn clipboard_image_from_bytes(bytes: Vec) -> Option { async fn read_via_powershell() -> Option { let temp_dir = std::env::temp_dir(); std::fs::create_dir_all(&temp_dir).ok()?; - let temp_path = temp_dir.join(format!("prime-agent-clip-{}.png", unique_suffix())); + let temp_path = temp_dir.join(format!("wv-clip-{}.png", unique_suffix())); let windows_path = String::from_utf8_lossy( &run_command( "wslpath", @@ -219,7 +219,7 @@ fn unique_suffix() -> String { async fn read_via_osascript() -> Option { let temp_dir = std::env::temp_dir(); std::fs::create_dir_all(&temp_dir).ok()?; - let temp_path = temp_dir.join(format!("prime-agent-clip-{}.png", unique_suffix())); + let temp_path = temp_dir.join(format!("wv-clip-{}.png", unique_suffix())); let path_str = temp_path.to_str()?.to_string(); let script = format!( r"ObjC.import('Cocoa'); diff --git a/crates/pa-tui/src/config_selector.rs b/crates/pa-tui/src/config_selector.rs index a99383349..fe2670256 100644 --- a/crates/pa-tui/src/config_selector.rs +++ b/crates/pa-tui/src/config_selector.rs @@ -48,7 +48,7 @@ const MAX_VISIBLE: usize = 15; /// filter, and selection behavior are shared). #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum SelectorKind { - /// The resource-configuration modal (`prime-agent config`): checkbox + /// The resource-configuration modal (`wv config`): checkbox /// semantics, Space toggles. ResourceConfig, /// The `/effort` picker: single-select semantics, Enter applies. diff --git a/crates/pa-tui/src/daemon_client.rs b/crates/pa-tui/src/daemon_client.rs index 86df6a1c8..bad81bb99 100644 --- a/crates/pa-tui/src/daemon_client.rs +++ b/crates/pa-tui/src/daemon_client.rs @@ -352,13 +352,13 @@ impl DaemonClient { .await .map_err(|_| { anyhow!( - "Timed out after {CONNECT_TIMEOUT_MS}ms connecting to the Prime Agent daemon. Socket: {}.", + "Timed out after {CONNECT_TIMEOUT_MS}ms connecting to the Weave daemon. Socket: {}.", socket_path.display() ) })? .with_context(|| { format!( - "Failed to connect to the Prime Agent daemon. Socket: {}.", + "Failed to connect to the Weave daemon. Socket: {}.", socket_path.display() ) })?; @@ -440,7 +440,7 @@ impl DaemonClient { .map_err(|_| { reader_task.abort(); anyhow!( - "Timed out after {HELLO_TIMEOUT_MS}ms waiting for the Prime Agent daemon handshake. Socket: {}.", + "Timed out after {HELLO_TIMEOUT_MS}ms waiting for the Weave daemon handshake. Socket: {}.", socket_path.display() ) })? @@ -685,13 +685,13 @@ impl DaemonClient { // The reader task died before resolving this request: the // connection was already gone. Ok(Err(_)) => Err(anyhow!( - "Connection to the Prime Agent daemon closed. Socket: {}.", + "Connection to the Weave daemon closed. Socket: {}.", self.socket_path.display() )), Err(_) => { self.shared.pending.lock().unwrap().remove(&id); Err(anyhow!( - "Timed out after {timeout_ms}ms waiting for the Prime Agent daemon response. Socket: {}.", + "Timed out after {timeout_ms}ms waiting for the Weave daemon response. Socket: {}.", self.socket_path.display() )) } @@ -750,9 +750,9 @@ impl DaemonClient { ) { if name == "plugin_command" { - return Err(anyhow!("The running Prime Agent daemon cannot execute native plugin commands; restart or update it and try again.")); + return Err(anyhow!("The running Weave daemon cannot execute native plugin commands; restart or update it and try again.")); } - return Err(anyhow!("The running Prime Agent daemon cannot refresh models; restart or update it and try again.")); + return Err(anyhow!("The running Weave daemon cannot refresh models; restart or update it and try again.")); } Ok(()) } diff --git a/crates/pa-tui/src/daemon_client/errors.rs b/crates/pa-tui/src/daemon_client/errors.rs index b729cdd3e..c68113124 100644 --- a/crates/pa-tui/src/daemon_client/errors.rs +++ b/crates/pa-tui/src/daemon_client/errors.rs @@ -93,7 +93,7 @@ pub fn is_daemon_unreachable(error: &anyhow::Error) -> bool { || error.chain().any(|cause| { let cause = cause.to_string().to_lowercase(); cause.contains("daemon connection") - || cause.contains("prime agent daemon closed") + || cause.contains("weave daemon closed") || cause.contains("direct session connection closed") || cause.contains("the session connection closed") }) diff --git a/crates/pa-tui/src/editor/mod.rs b/crates/pa-tui/src/editor/mod.rs index c18704f1b..18a4d4b88 100644 --- a/crates/pa-tui/src/editor/mod.rs +++ b/crates/pa-tui/src/editor/mod.rs @@ -938,12 +938,12 @@ mod tests { } /// An editor completing `@` tokens over a base holding the - /// `prime-agent/` directory with two children beside an unrelated file. + /// `wv/` directory with two children beside an unrelated file. fn at_editor() -> (tempfile::TempDir, Editor) { let base = tempfile::TempDir::new().expect("temp dir"); - std::fs::create_dir_all(base.path().join("prime-agent")).expect("mkdir"); - std::fs::write(base.path().join("prime-agent/a.rs"), "x").expect("write"); - std::fs::write(base.path().join("prime-agent/b.rs"), "x").expect("write"); + std::fs::create_dir_all(base.path().join("wv")).expect("mkdir"); + std::fs::write(base.path().join("wv/a.rs"), "x").expect("write"); + std::fs::write(base.path().join("wv/b.rs"), "x").expect("write"); std::fs::write(base.path().join("other.md"), "x").expect("write"); let mut e = Editor::new(); e.set_autocomplete_provider(Box::new( @@ -964,21 +964,15 @@ mod tests { #[test] fn applying_a_directory_completion_lists_its_children() { - let children = Some(vec![ - "@prime-agent/a.rs".to_string(), - "@prime-agent/b.rs".to_string(), - ]); + let children = Some(vec!["@wv/a.rs".to_string(), "@wv/b.rs".to_string()]); // Tab on the open menu applies the directory item. let (_base, mut e) = at_editor(); for ch in "@prime-ag".chars() { e.handle_input(&ch.to_string()); } - assert_eq!( - settled_menu(&mut e), - Some(vec!["@prime-agent/".to_string()]) - ); + assert_eq!(settled_menu(&mut e), Some(vec!["@wv/".to_string()])); e.handle_input("tab"); - assert_eq!(e.get_text(), "@prime-agent/"); + assert_eq!(e.get_text(), "@wv/"); assert_eq!(settled_menu(&mut e), children); // Tab before the menu opens applies the single match inline. let (_base, mut e) = at_editor(); @@ -987,7 +981,7 @@ mod tests { } e.handle_input("tab"); assert_eq!(settled_menu(&mut e), children); - assert_eq!(e.get_text(), "@prime-agent/"); + assert_eq!(e.get_text(), "@wv/"); } #[test] @@ -1055,7 +1049,7 @@ mod tests { #[test] fn a_slash_typed_while_the_search_runs_lists_the_children() { let (_base, mut e) = at_editor(); - for ch in "@prime-agent".chars() { + for ch in "@wv".chars() { e.handle_input(&ch.to_string()); } e.materialize_autocomplete(); @@ -1066,10 +1060,7 @@ mod tests { e.handle_input("/"); assert_eq!( settled_menu(&mut e), - Some(vec![ - "@prime-agent/a.rs".to_string(), - "@prime-agent/b.rs".to_string(), - ]) + Some(vec!["@wv/a.rs".to_string(), "@wv/b.rs".to_string(),]) ); } diff --git a/crates/pa-tui/src/exit_guard.rs b/crates/pa-tui/src/exit_guard.rs index 6e501d673..fbb10d31e 100644 --- a/crates/pa-tui/src/exit_guard.rs +++ b/crates/pa-tui/src/exit_guard.rs @@ -249,7 +249,7 @@ fn spawn_watchdog(state: &Arc) { /// process with code 0 (the exit is deliberate, not a crash). fn force_quit() -> ! { crate::exit_restore::restore_terminal(); - eprintln!("Prime Agent: shutdown stalled; forced exit."); + eprintln!("Weave: shutdown stalled; forced exit."); std::process::exit(0) } diff --git a/crates/pa-tui/src/exit_restore.rs b/crates/pa-tui/src/exit_restore.rs index 6ffca0664..ca1421286 100644 --- a/crates/pa-tui/src/exit_restore.rs +++ b/crates/pa-tui/src/exit_restore.rs @@ -129,7 +129,7 @@ fn report_cooked_repair() -> std::io::Result<()> { use std::io::Write; writeln!( std::io::stderr(), - "Prime Agent: repaired a raw terminal left by a previous run." + "Weave: repaired a raw terminal left by a previous run." ) } else { Ok(()) diff --git a/crates/pa-tui/src/external_editor.rs b/crates/pa-tui/src/external_editor.rs index 39a5412d0..6c6a1fa28 100644 --- a/crates/pa-tui/src/external_editor.rs +++ b/crates/pa-tui/src/external_editor.rs @@ -30,7 +30,7 @@ pub(crate) async fn edit(command: &str, text: &str) -> Result> { .unwrap_or_default(); // The name shows in the user's editor buffer; the TS `pi-editor-*` // form is scrubbed per the branding rule (a deliberate deviation). - let path = std::env::temp_dir().join(format!("prime-agent-editor-{millis}.md")); + let path = std::env::temp_dir().join(format!("wv-editor-{millis}.md")); // O_EXCL (`create_new`): the draft never follows or truncates a // pre-planted path or symlink, and 0600 keeps the prompt draft // owner-only in the shared temp dir. A pre-existing path fails the create diff --git a/crates/pa-tui/src/incident_notice_tests.rs b/crates/pa-tui/src/incident_notice_tests.rs index 6159e0b9b..9c97e6089 100644 --- a/crates/pa-tui/src/incident_notice_tests.rs +++ b/crates/pa-tui/src/incident_notice_tests.rs @@ -46,7 +46,7 @@ fn supervisor_start_line(base_ms: i64, minutes_ago: i64, generation: &str) -> In ( "msg", serde_json::json!(format!( - "Prime Agent daemon supervisor {generation} listening on {DAEMON_SOCKET}" + "Weave daemon supervisor {generation} listening on {DAEMON_SOCKET}" )), ), ("socketPath", serde_json::json!(DAEMON_SOCKET)), @@ -287,7 +287,7 @@ fn skips_the_old_bridge_when_a_rotation_makes_it_the_live_logs_own_generation() let start = serde_json::json!({ "ts": ts_ago(BASE_MS, 600 * 60_000), "component": "coding-agent.daemon-supervisor", - "msg": format!("Prime Agent daemon supervisor e14de15c listening on {DAEMON_SOCKET}"), + "msg": format!("Weave daemon supervisor e14de15c listening on {DAEMON_SOCKET}"), "socketPath": DAEMON_SOCKET, "pid": 15026, }) diff --git a/crates/pa-tui/src/incident_notices.rs b/crates/pa-tui/src/incident_notices.rs index 56e26bd02..d6d8238ca 100644 --- a/crates/pa-tui/src/incident_notices.rs +++ b/crates/pa-tui/src/incident_notices.rs @@ -1,4 +1,4 @@ -//! Daemon incident notices for the agents view: reuse the `prime-agent +//! Daemon incident notices for the agents view: reuse the `wv //! incident` classifier (`pa_types::incident`) to surface one collapsed, //! dismissible notice line (worker crash, command-timeout burst, or an //! update restart). @@ -12,7 +12,7 @@ use std::collections::HashMap; use std::io::{Read, Seek, SeekFrom}; use std::path::Path; -/// Recent-log window, matching the `prime-agent incident` default. +/// Recent-log window, matching the `wv incident` default. pub const INCIDENT_NOTICE_WINDOW_MS: i64 = 24 * 60 * 60 * 1000; /// Initial tail bound: incidents older than the tail bytes are simply not seen. @@ -25,7 +25,7 @@ pub const INCIDENT_NOTICE_MAX_WINDOW_ENTRIES: usize = 20_000; pub const INCIDENT_NOTICE_POLL_INTERVAL_MS: u64 = 30_000; /// The pointer to the full timeline. -pub const INCIDENT_NOTICE_POINTER: &str = "— run prime-agent incident for the timeline"; +pub const INCIDENT_NOTICE_POINTER: &str = "— run wv incident for the timeline"; const NEWLINE_BYTE: u8 = 0x0a; diff --git a/crates/pa-tui/src/interactive/onboarding.rs b/crates/pa-tui/src/interactive/onboarding.rs index 35ae8a6d3..ce59d7399 100644 --- a/crates/pa-tui/src/interactive/onboarding.rs +++ b/crates/pa-tui/src/interactive/onboarding.rs @@ -746,7 +746,7 @@ mod tests { #[tokio::test] async fn a_barrier_the_first_paint_satisfies_releases_the_queued_batch() { let error = marker_consumed_behind(UiInput::WaitRender { - needle: "Welcome to PRIME Agent".to_string(), + needle: "Welcome to Weave".to_string(), timeout_ms: 5_000, }) .await; diff --git a/crates/pa-tui/src/interactive/reconnect.rs b/crates/pa-tui/src/interactive/reconnect.rs index 09f8665fe..657c3824f 100644 --- a/crates/pa-tui/src/interactive/reconnect.rs +++ b/crates/pa-tui/src/interactive/reconnect.rs @@ -136,7 +136,7 @@ pub(super) fn arm_shutdown_recovery( return false; } session.note_as( - "the Prime Agent daemon shut down; waiting for it to come back…", + "the Weave daemon shut down; waiting for it to come back…", crate::chat::StatusKind::Warning, view, ); diff --git a/crates/pa-tui/src/interactive/run.rs b/crates/pa-tui/src/interactive/run.rs index 0f3d9190f..cb1dfda8d 100644 --- a/crates/pa-tui/src/interactive/run.rs +++ b/crates/pa-tui/src/interactive/run.rs @@ -90,7 +90,7 @@ fn next_spinner_deadline(started: Instant, now: Instant) -> Instant { /// daemon update restart (TS #2391) instead of failing the open hard. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub(crate) enum SessionOpenRoute { - /// The CLI's open (`prime-agent`, `--resume`, `--attach`): a single attempt. + /// The CLI's open (`wv`, `--resume`, `--attach`): a single attempt. Cli, /// The agents view's open: waits through the update-restart window and retries. AgentsView, @@ -1698,19 +1698,19 @@ async fn run_interactive_surface( // The daemon never came back within the reconnect timeout — the // saved-transcript close (the session file survives on disk). session.note( - "The Prime Agent daemon shut down while this window was attached. The session transcript remains saved; restart Prime Agent and reopen it from Agents View.", + "The Weave daemon shut down while this window was attached. The session transcript remains saved; restart Weave and reopen it from Agents View.", &mut view, ); } RecoveryKind::Lost => { session.note( - "could not reconnect to the daemon within 10 minutes — run `prime-agent attach` to resume.", + "could not reconnect to the daemon within 10 minutes — run `wv attach` to resume.", &mut view, ); } RecoveryKind::Update => { session.note( - "could not reconnect to the daemon within 10 minutes — the update finished but this window is detached. Run `prime-agent attach` to resume.", + "could not reconnect to the daemon within 10 minutes — the update finished but this window is detached. Run `wv attach` to resume.", &mut view, ); } @@ -1766,19 +1766,19 @@ async fn run_interactive_surface( // The daemon never came back within the reconnect timeout — the // saved-transcript close (the session file survives on disk). session.note( - "The Prime Agent daemon shut down while this window was attached. The session transcript remains saved; restart Prime Agent and reopen it from Agents View.", + "The Weave daemon shut down while this window was attached. The session transcript remains saved; restart Weave and reopen it from Agents View.", &mut view, ); } RecoveryKind::Lost => { session.note( - "could not reconnect to the daemon within 10 minutes — run `prime-agent attach` to resume.", + "could not reconnect to the daemon within 10 minutes — run `wv attach` to resume.", &mut view, ); } RecoveryKind::Update => { session.note( - "could not reconnect to the daemon within 10 minutes — the update finished but this window is detached. Run `prime-agent attach` to resume.", + "could not reconnect to the daemon within 10 minutes — the update finished but this window is detached. Run `wv attach` to resume.", &mut view, ); } @@ -1841,7 +1841,7 @@ async fn run_interactive_surface( } } else { session.note( - &format!("reattach after the update failed: {error:#} — run `prime-agent attach` to resume"), + &format!("reattach after the update failed: {error:#} — run `wv attach` to resume"), &mut view, ); session.dirty = true; diff --git a/crates/pa-tui/src/interactive/tests.rs b/crates/pa-tui/src/interactive/tests.rs index e4a953169..991936f14 100644 --- a/crates/pa-tui/src/interactive/tests.rs +++ b/crates/pa-tui/src/interactive/tests.rs @@ -242,7 +242,7 @@ fn resume_hint_names_a_flushed_session() { }); assert_eq!( crate::session_ui::resume_hint_from_stats(&stats), - Some("Resume this session with: prime-agent --resume s1".to_string()) + Some("Resume this session with: wv --resume s1".to_string()) ); // An unflushed empty session and a missing session file are both unresumable // (TS omits the hint for either). diff --git a/crates/pa-tui/src/lib.rs b/crates/pa-tui/src/lib.rs index 2602f5241..3f82b2793 100644 --- a/crates/pa-tui/src/lib.rs +++ b/crates/pa-tui/src/lib.rs @@ -1,4 +1,4 @@ -//! Terminal UI for Prime Agent. +//! Terminal UI for Weave. //! //! Rust port of the TS reference TUI (packages/tui) plus the interactive agent view //! from `coding-agent/src/modes/interactive`. Components render styled lines; diff --git a/crates/pa-tui/src/onboarding.rs b/crates/pa-tui/src/onboarding.rs index c7b93e057..c1ccc82c8 100644 --- a/crates/pa-tui/src/onboarding.rs +++ b/crates/pa-tui/src/onboarding.rs @@ -9,7 +9,7 @@ use crate::theme::{Theme, ThemeColor}; use crate::{Line, Span}; use ratatui::style::{Color, Modifier, Style}; -pub const TEAM_QUESTION_PROMPT: &str = "Which account should Prime Agent use?"; +pub const TEAM_QUESTION_PROMPT: &str = "Which account should Weave use?"; pub const PERSONAL_ACCOUNT_LABEL: &str = "Personal account"; /// The team question's rows: the personal account first, then one row per diff --git a/crates/pa-tui/src/session_open_error.rs b/crates/pa-tui/src/session_open_error.rs index 8847b31bd..7c6ef2260 100644 --- a/crates/pa-tui/src/session_open_error.rs +++ b/crates/pa-tui/src/session_open_error.rs @@ -166,7 +166,7 @@ pub fn already_active_error(holder: &SessionHolder, session_path: &Path) -> Stri } lines.push(identity); lines.push(format!( - "Attach to it instead: prime-agent {}", + "Attach to it instead: wv {}", quoted_resume_arg(&holder.id) )); lines.push("Or wait: the file unlocks when that session exits.".to_string()); @@ -196,12 +196,12 @@ pub fn decorate_interactive_refusal( let _ = write!(identity, " \u{b7} model {model}"); } format!( - "{identity} \u{b7} Attach instead: prime-agent {} \u{b7} The file unlocks when that session exits", + "{identity} \u{b7} Attach instead: wv {} \u{b7} The file unlocks when that session exits", quoted_resume_arg(&h.id) ) } None if owner.starts_with("another process") => format!( - "The holder is {owner} \u{b7} It unlocks when that process exits \u{b7} Browse live sessions: prime-agent agents" + "The holder is {owner} \u{b7} It unlocks when that process exits \u{b7} Browse live sessions: wv agents" ), // A session-id holder the roster cannot see: "retry shortly" would be a false promise — no // worker on THIS daemon will ever answer that id — so the guidance names what the holder @@ -272,7 +272,7 @@ mod tests { file.display() ))); assert!(text.contains("Holder: session holder-1 \u{201c}lane work\u{201d} \u{b7} cwd /w")); - assert!(text.contains("Attach to it instead: prime-agent --resume 'holder-1'")); + assert!(text.contains("Attach to it instead: wv --resume 'holder-1'")); assert!(text.contains("the file unlocks when that session exits")); } @@ -285,9 +285,7 @@ mod tests { model: None, }; let text = already_active_error(&holder, Path::new("/s/a.jsonl")); - assert!(text.contains( - "Holder: session live-9\nAttach to it instead: prime-agent --resume 'live-9'" - )); + assert!(text.contains("Holder: session live-9\nAttach to it instead: wv --resume 'live-9'")); } #[test] @@ -382,7 +380,7 @@ mod decorate_tests { "{text}" ); assert!( - text.contains("Attach instead: prime-agent --resume 'abc123'"), + text.contains("Attach instead: wv --resume 'abc123'"), "{text}" ); } @@ -483,7 +481,7 @@ mod decorate_tests { text.contains("The holder is another process (pid 42)"), "{text}" ); - assert!(text.contains("prime-agent agents"), "{text}"); + assert!(text.contains("wv agents"), "{text}"); } } diff --git a/crates/pa-tui/src/session_ui.rs b/crates/pa-tui/src/session_ui.rs index 4d3fa19c1..2ccefde22 100644 --- a/crates/pa-tui/src/session_ui.rs +++ b/crates/pa-tui/src/session_ui.rs @@ -113,7 +113,7 @@ const EXIT_STATS_TIMEOUT_MS: u64 = 500; /// Ban-risk warning a completed Anthropic subscription login shows once /// per session; the settings toggle `warnings.anthropicExtraUsage` gates it. -const ANTHROPIC_SUBSCRIPTION_AUTH_WARNING: &str = "Anthropic subscription auth is active. Usage draws from your plan limits, but Prime Agent identifies as Claude Code and this may violate Anthropic's terms — your account can be restricted or banned. An Anthropic API key avoids the risk. Manage usage at https://claude.ai/settings/usage."; +const ANTHROPIC_SUBSCRIPTION_AUTH_WARNING: &str = "Anthropic subscription auth is active. Usage draws from your plan limits, but Weave identifies as Claude Code and this may violate Anthropic's terms — your account can be restricted or banned. An Anthropic API key avoids the risk. Manage usage at https://claude.ai/settings/usage."; /// A landed `get_commands` refresh: the session's `skill:` commands for /// the autocomplete provider; an older refresh never applies. @@ -515,7 +515,7 @@ impl SessionUi { .await .map_err(|_| { anyhow!( - "timed out after {}ms waiting for the Prime Agent daemon response", + "timed out after {}ms waiting for the Weave daemon response", timeout.as_millis() ) })? diff --git a/crates/pa-tui/src/session_ui/apply.rs b/crates/pa-tui/src/session_ui/apply.rs index ed5eac602..d91f350ff 100644 --- a/crates/pa-tui/src/session_ui/apply.rs +++ b/crates/pa-tui/src/session_ui/apply.rs @@ -407,7 +407,7 @@ impl SessionUi { view.working = None; match reason.as_str() { "shutdown" => self.error_row( - "The Prime Agent daemon shut down while this window was attached. The session transcript remains saved; restart Prime Agent and reopen it from Agents View.", + "The Weave daemon shut down while this window was attached. The session transcript remains saved; restart Weave and reopen it from Agents View.", view, ), "replaced" => self.error_row( @@ -454,7 +454,7 @@ impl SessionUi { .join(", "); view.push_entry(crate::chat::ChatEntry::Status { text: format!( - "Prime Agent is updating — restarting the daemon (about {}s). {} will resume automatically.", + "Weave is updating — restarting the daemon (about {}s). {} will resume automatically.", update.est_seconds.max(1), if names.is_empty() { "Your session".to_string() } else { names } ), diff --git a/crates/pa-tui/src/session_ui/commands.rs b/crates/pa-tui/src/session_ui/commands.rs index b0479d1be..2b0f1adc6 100644 --- a/crates/pa-tui/src/session_ui/commands.rs +++ b/crates/pa-tui/src/session_ui/commands.rs @@ -27,7 +27,7 @@ impl SessionUi { // become the request. view.editor.set_text(&format!("{text} ")); self.note( - "add your request after the skill, e.g. /skill:prime-agent-release make a release of PR #2731", + "add your request after the skill, e.g. /skill:wv-release make a release of PR #2731", view, ); return Ok(()); @@ -411,7 +411,7 @@ impl SessionUi { // `/nightly [on|off|status]` (TS `interactive-mode.ts` // 5455-5484): status resolves the effective channel; on (or // bare) and off/stable save the `updateChannel` setting that - // `/update` and `prime-agent update` follow. + // `/update` and `wv update` follow. "nightly" => { let arg = resolved.args.trim().to_lowercase(); if arg == "status" { @@ -499,8 +499,8 @@ impl SessionUi { // The message is hand-wrapped to fit the panel rows (the // confirm renders each line truncated, never wrapped). view.confirm = Some(crate::confirm::ConfirmPanel::yes_no( - "Update Prime Agent", - "Update uninstalls the TypeScript version and installs the latest Rust build;\nyour sessions and configuration (~/.prime/agent) are never touched.\n\nThe update runs in the background — restart prime-agent after it\nfinishes to run the new build.", + "Update Weave", + "Update uninstalls the TypeScript version and installs the latest Rust build;\nyour sessions and configuration (~/.prime/agent) are never touched.\n\nThe update runs in the background — restart wv after it\nfinishes to run the new build.", )); self.pending_confirm = Some(PendingConfirm::Update); self.dirty = true; @@ -783,7 +783,7 @@ impl SessionUi { .to_string() }), Ok(Err(error)) if error.to_string().contains("cannot refresh models") => Err( - "The running Prime Agent daemon cannot refresh models; restart or update it and try again.".to_string(), + "The running Weave daemon cannot refresh models; restart or update it and try again.".to_string(), ), Ok(Err(_)) | Err(_) => Err( "Model catalog refresh failed. Check the agent log for details." diff --git a/crates/pa-tui/src/session_ui/heartbeats.rs b/crates/pa-tui/src/session_ui/heartbeats.rs index f737482a0..683927315 100644 --- a/crates/pa-tui/src/session_ui/heartbeats.rs +++ b/crates/pa-tui/src/session_ui/heartbeats.rs @@ -204,7 +204,7 @@ impl SessionUi { epoch, heartbeats: Vec::new(), fetch_error: Some( - "timed out waiting for the Prime Agent daemon response".to_string(), + "timed out waiting for the Weave daemon response".to_string(), ), }); } diff --git a/crates/pa-tui/src/session_ui/lifecycle.rs b/crates/pa-tui/src/session_ui/lifecycle.rs index cf064662d..91c02a7b4 100644 --- a/crates/pa-tui/src/session_ui/lifecycle.rs +++ b/crates/pa-tui/src/session_ui/lifecycle.rs @@ -271,7 +271,7 @@ impl SessionUi { }), _ => view.push_entry(crate::chat::ChatEntry::Status { text: format!( - "Reconnected to Prime Agent (update {update_id}) — your session and queued work resumed." + "Reconnected to Weave (update {update_id}) — your session and queued work resumed." ), kind: crate::chat::StatusKind::Info, }), diff --git a/crates/pa-tui/src/session_ui/prompt.rs b/crates/pa-tui/src/session_ui/prompt.rs index bd770c75c..b8a8e22a0 100644 --- a/crates/pa-tui/src/session_ui/prompt.rs +++ b/crates/pa-tui/src/session_ui/prompt.rs @@ -71,7 +71,7 @@ fn prompt_may_have_been_sent(error: &anyhow::Error) -> bool { && error.chain().any(|cause| { let message = cause.to_string().to_lowercase(); message.contains("connection closed") - || message.starts_with("connection to the prime agent daemon closed") + || message.starts_with("connection to the weave daemon closed") }))) } @@ -721,7 +721,7 @@ impl SessionUi { .await .map_err(|_| { anyhow!( - "timed out after {UI_REQUEST_TIMEOUT_MS}ms waiting for the Prime Agent daemon response" + "timed out after {UI_REQUEST_TIMEOUT_MS}ms waiting for the Weave daemon response" ) }) .and_then(|result| result.map(|_| ())); @@ -923,8 +923,8 @@ mod prompt_delivery_tests { for message in [ "the daemon connection closed", "the session connection closed", - "Connection to the Prime Agent daemon closed. Socket: fixture.", - "Timed out after 100ms waiting for the Prime Agent daemon response", + "Connection to the Weave daemon closed. Socket: fixture.", + "Timed out after 100ms waiting for the Weave daemon response", ] { assert!(prompt_may_have_been_sent(&anyhow::anyhow!(message))); } diff --git a/crates/pa-tui/src/session_ui/share.rs b/crates/pa-tui/src/session_ui/share.rs index 207525503..48c7f6d47 100644 --- a/crates/pa-tui/src/session_ui/share.rs +++ b/crates/pa-tui/src/session_ui/share.rs @@ -51,7 +51,7 @@ impl SessionUi { match outcome { Ok(version) => { self.note( - &format!("updated to {version} — restart prime-agent to run it"), + &format!("updated to {version} — restart wv to run it"), view, ); } diff --git a/crates/pa-tui/src/session_ui/stream.rs b/crates/pa-tui/src/session_ui/stream.rs index 098301f9b..f0b4ffc7f 100644 --- a/crates/pa-tui/src/session_ui/stream.rs +++ b/crates/pa-tui/src/session_ui/stream.rs @@ -219,7 +219,7 @@ pub(crate) fn resume_hint_from_stats(stats: &Value) -> Option { return None; } Some(format!( - "Resume this session with: prime-agent --resume {session_id}" + "Resume this session with: wv --resume {session_id}" )) } diff --git a/crates/pa-tui/src/settings_menu/mod.rs b/crates/pa-tui/src/settings_menu/mod.rs index ce1291d4c..50311a393 100644 --- a/crates/pa-tui/src/settings_menu/mod.rs +++ b/crates/pa-tui/src/settings_menu/mod.rs @@ -197,7 +197,7 @@ pub fn settings_menu_rows(current: &SettingsCurrentValues) -> Vec; pub type UpdateRunFuture = Pin + Send>>; /// The update funnel the composition root owns: the same body -/// `prime-agent update` runs, so the two surfaces cannot diverge. +/// `wv update` runs, so the two surfaces cannot diverge. pub trait UpdateCommands: Send + Sync { /// Run the download+install and report the new build's version (or /// the failure message); the caller spawns this, and the run may diff --git a/crates/pa-tui/src/update_restart_wait.rs b/crates/pa-tui/src/update_restart_wait.rs index 5c6936fe3..a7e6fa924 100644 --- a/crates/pa-tui/src/update_restart_wait.rs +++ b/crates/pa-tui/src/update_restart_wait.rs @@ -18,7 +18,7 @@ pub(crate) const DAEMON_UPDATE_RESTART_OPEN_RETRY_MS: u64 = 500; /// The notice a waited-through open surfaces (TS `updateRestartWaitNotice`). pub(crate) const DAEMON_UPDATE_RESTART_WAIT_NOTICE: &str = - "Waited for the Prime Agent daemon update restart to finish before opening this agent"; + "Waited for the Weave daemon update restart to finish before opening this agent"; /// True when an open failure is part of the normal update-restart /// window: the preparing-restart rejection, transport failures while @@ -44,10 +44,10 @@ pub(crate) fn is_update_restart_transient_error(error: &anyhow::Error) -> bool { } } let text = cause.to_string(); - text.starts_with("Connection to the Prime Agent daemon closed") + text.starts_with("Connection to the Weave daemon closed") || text.starts_with("the daemon connection closed") || text.starts_with("the daemon connection is closed") - || text.starts_with("Failed to connect to the Prime Agent daemon") + || text.starts_with("Failed to connect to the Weave daemon") || is_daemon_transport_timeout(&text) }) } @@ -58,7 +58,7 @@ pub(crate) fn is_update_restart_deadline_error(error: &anyhow::Error) -> bool { error.chain().any(|cause| { cause .to_string() - .starts_with("The Prime Agent daemon did not finish its update restart within") + .starts_with("The Weave daemon did not finish its update restart within") }) } @@ -76,9 +76,9 @@ fn is_daemon_transport_timeout(text: &str) -> bool { if digits.is_empty() || !digits.bytes().all(|b| b.is_ascii_digit()) { return false; } - tail.starts_with("connecting to the prime agent daemon") - || tail.starts_with("waiting for the prime agent daemon handshake") - || tail.starts_with("waiting for the prime agent daemon response") + tail.starts_with("connecting to the weave daemon") + || tail.starts_with("waiting for the weave daemon handshake") + || tail.starts_with("waiting for the weave daemon response") } /// The bounded wait's failure, carrying the last error for diagnosis. @@ -91,7 +91,7 @@ fn update_restart_deadline_error( None => "none yet".to_string(), }; anyhow!( - "The Prime Agent daemon did not finish its update restart within {} seconds. Try opening this agent again once the update finishes. Last error: {}", + "The Weave daemon did not finish its update restart within {} seconds. Try opening this agent again once the update finishes. Last error: {}", wait_ms / 1000, last ) @@ -260,17 +260,14 @@ mod tests { #[tokio::test] async fn retries_every_restart_transient_failure_and_reports_the_wait() { let transient_failures: Vec<(&str, anyhow::Error)> = vec![ - ( - "the preparing rejection", - preparing_rejection(), - ), + ("the preparing rejection", preparing_rejection()), ( "connect refused", - anyhow!("Failed to connect to the Prime Agent daemon. Socket: /s."), + anyhow!("Failed to connect to the Weave daemon. Socket: /s."), ), ( "closed", - anyhow!("Connection to the Prime Agent daemon closed. Socket: /s."), + anyhow!("Connection to the Weave daemon closed. Socket: /s."), ), ( "pending-fail closed", @@ -280,21 +277,22 @@ mod tests { "pre-handshake closed", anyhow!("the daemon connection closed before the handshake"), ), - ( - "dead writer", - anyhow!("the daemon connection is closed"), - ), + ("dead writer", anyhow!("the daemon connection is closed")), ( "response timeout", - anyhow!("Timed out after 30000ms waiting for the Prime Agent daemon response. Socket: /s."), + anyhow!( + "Timed out after 30000ms waiting for the Weave daemon response. Socket: /s." + ), ), ( "connect timeout", - anyhow!("Timed out after 5000ms connecting to the Prime Agent daemon. Socket: /s."), + anyhow!("Timed out after 5000ms connecting to the Weave daemon. Socket: /s."), ), ( "handshake timeout", - anyhow!("Timed out after 5000ms waiting for the Prime Agent daemon handshake. Socket: /s."), + anyhow!( + "Timed out after 5000ms waiting for the Weave daemon handshake. Socket: /s." + ), ), ( "unknown session", @@ -373,7 +371,7 @@ mod tests { assert!( deadline_error .to_string() - .starts_with("The Prime Agent daemon did not finish its update restart within"), + .starts_with("The Weave daemon did not finish its update restart within"), "the deadline error is actionable: {deadline_error}" ); assert!( @@ -402,11 +400,11 @@ mod tests { #[test] fn the_transport_timeout_shapes_classify_exactly() { for text in [ - "Timed out after 5000ms connecting to the Prime Agent daemon. Socket: /s.", - "Timed out after 5000ms waiting for the Prime Agent daemon handshake. Socket: /s.", - "Timed out after 30000ms waiting for the Prime Agent daemon response. Socket: /s.", - "Timed out after 30000ms waiting for the Prime Agent daemon response to \"create\".", - "timed out after 30000ms waiting for the Prime Agent daemon response", + "Timed out after 5000ms connecting to the Weave daemon. Socket: /s.", + "Timed out after 5000ms waiting for the Weave daemon handshake. Socket: /s.", + "Timed out after 30000ms waiting for the Weave daemon response. Socket: /s.", + "Timed out after 30000ms waiting for the Weave daemon response to \"create\".", + "timed out after 30000ms waiting for the Weave daemon response", ] { assert!(is_daemon_transport_timeout(text), "{text}"); assert!( @@ -421,7 +419,7 @@ mod tests { "Timed out after ms connecting" )); assert!(!is_daemon_transport_timeout( - "Timed out after 5x00ms connecting to the Prime Agent daemon" + "Timed out after 5x00ms connecting to the Weave daemon" )); } @@ -432,7 +430,7 @@ mod tests { assert!( deadline .to_string() - .starts_with("The Prime Agent daemon did not finish its update restart within"), + .starts_with("The Weave daemon did not finish its update restart within"), "{deadline}" ); assert!(deadline.to_string().contains("Last error:")); @@ -447,7 +445,7 @@ mod tests { assert_eq!(DAEMON_UPDATE_RESTART_OPEN_WAIT_MS, 240_000); assert_eq!( DAEMON_UPDATE_RESTART_WAIT_NOTICE, - "Waited for the Prime Agent daemon update restart to finish before opening this agent" + "Waited for the Weave daemon update restart to finish before opening this agent" ); assert_eq!( pa_types::daemon::UPDATE_RESTART_PREPARING_MESSAGE, diff --git a/crates/pa-tui/src/view/lazy_tests.rs b/crates/pa-tui/src/view/lazy_tests.rs index 720d1aa0a..a380b4986 100644 --- a/crates/pa-tui/src/view/lazy_tests.rs +++ b/crates/pa-tui/src/view/lazy_tests.rs @@ -83,7 +83,7 @@ fn frames_render_an_end_section_only_when_the_window_reaches_it() { assert_eq!(SPLASH_RENDERS.with(std::cell::Cell::get), 1); assert_eq!(TAIL_RENDERS.with(std::cell::Cell::get), 0); let rows = text_of(&top); - assert!(rows.iter().any(|row| row.contains("prime agent"))); + assert!(rows.iter().any(|row| row.contains("weave"))); assert!(!rows.iter().any(|row| row.contains("Thinking"))); view.scroll_to_bottom(); reset_section_counters(); diff --git a/crates/pa-tui/src/view/tests.rs b/crates/pa-tui/src/view/tests.rs index b9df126bc..8afbe2083 100644 --- a/crates/pa-tui/src/view/tests.rs +++ b/crates/pa-tui/src/view/tests.rs @@ -259,7 +259,7 @@ fn frame_is_exactly_height_rows() { assert_eq!(frame.len(), 24); assert!(frame.iter().all(|l| str_width(&text_of(l)) <= 80)); let joined = frame.iter().map(text_of).collect::>().join("\n"); - assert!(joined.contains("prime agent v0.0.0")); + assert!(joined.contains("weave v0.0.0")); assert!(joined.contains("Collapsed mode (Ctrl+O to expand)")); assert!(joined.contains('>')); } diff --git a/crates/pa-tui/tests/agents_view_incident_notice_e2e.rs b/crates/pa-tui/tests/agents_view_incident_notice_e2e.rs index 76f00c512..ddff10e02 100644 --- a/crates/pa-tui/tests/agents_view_incident_notice_e2e.rs +++ b/crates/pa-tui/tests/agents_view_incident_notice_e2e.rs @@ -207,7 +207,7 @@ fn supervisor_start_line() -> String { "ts": iso_ago(600_000), "level": "warn", "component": "coding-agent.daemon-supervisor", - "msg": "Prime Agent daemon supervisor e14de15c listening on /tmp/prime-agent-501/daemon.sock", + "msg": "Weave daemon supervisor e14de15c listening on /tmp/prime-agent-501/daemon.sock", "socketPath": "/tmp/prime-agent-501/daemon.sock", "pid": 15026, }) @@ -293,7 +293,7 @@ async fn renders_the_collapsed_worker_crash_notice_line() { "{frames_text}" ); assert!( - frames_text.contains("run prime-agent incident for the timeline"), + frames_text.contains("run wv incident for the timeline"), "{frames_text}" ); assert!(frames_text.contains("⚠"), "{frames_text}"); @@ -354,12 +354,12 @@ async fn dismisses_with_esc_and_the_dismissal_survives_reentry() { "{last_frame}" ); assert!( - !last_frame.contains("prime-agent incident for the timeline"), + !last_frame.contains("wv incident for the timeline"), "{last_frame}" ); assert!(outcome.frames.iter().any(|frame| { frame.contains("worker 5b1d3aeb91ee crashed at") - && frame.contains("prime-agent incident for the timeline") + && frame.contains("wv incident for the timeline") })); // Re-entry with the carried state: the dismissal horizon hides the same incident; no poll @@ -384,7 +384,7 @@ async fn dismisses_with_esc_and_the_dismissal_survives_reentry() { let frames_text = second.frames.join("\n"); assert!( - !frames_text.contains("prime-agent incident for the timeline"), + !frames_text.contains("wv incident for the timeline"), "{frames_text}" ); assert!( diff --git a/crates/pa-tui/tests/bash_bang_headless.rs b/crates/pa-tui/tests/bash_bang_headless.rs index d4fc8df55..12f1fd68e 100644 --- a/crates/pa-tui/tests/bash_bang_headless.rs +++ b/crates/pa-tui/tests/bash_bang_headless.rs @@ -971,7 +971,7 @@ fn an_update_restart_settles_the_held_bang_card_on_reattach() { }); let all = run.frames.join("\n"); assert!( - all.contains("Reconnected to Prime Agent"), + all.contains("Reconnected to Weave"), "the reattach banner landed:\n{all}" ); let settled = run diff --git a/crates/pa-tui/tests/chat_open_first_frame_headless.rs b/crates/pa-tui/tests/chat_open_first_frame_headless.rs index 891fa3d07..63dc68297 100644 --- a/crates/pa-tui/tests/chat_open_first_frame_headless.rs +++ b/crates/pa-tui/tests/chat_open_first_frame_headless.rs @@ -333,7 +333,7 @@ fn a_direct_open_into_content_never_renders_the_splash() { "the pinned title row rides the first content frame:\n{first}" ); assert!( - frames.iter().all(|frame| !frame.contains("prime agent")), + frames.iter().all(|frame| !frame.contains("weave")), "the brand splash never renders for a direct open into content:\n{}", frames.join("\n---frame---\n") ); @@ -347,7 +347,7 @@ fn an_empty_open_keeps_the_brand_splash() { let frames = run_open(&OpeningTranscript::Empty); assert!(!frames.is_empty(), "frames were captured"); assert!( - frames.iter().any(|frame| frame.contains("prime agent")), + frames.iter().any(|frame| frame.contains("weave")), "the empty chat renders its header splash:\n{}", frames.join("\n---frame---\n") ); diff --git a/crates/pa-tui/tests/daemon_rejection_headless.rs b/crates/pa-tui/tests/daemon_rejection_headless.rs index f7ac84474..ef86a1f9b 100644 --- a/crates/pa-tui/tests/daemon_rejection_headless.rs +++ b/crates/pa-tui/tests/daemon_rejection_headless.rs @@ -894,7 +894,7 @@ fn an_agents_view_open_waits_through_the_update_restart_window() { let frames = run.frames.join("\n"); assert!( frames.contains( - "Waited for the Prime Agent daemon update restart to finish before opening this agent" + "Waited for the Weave daemon update restart to finish before opening this agent" ), "the session shows the wait row: {frames}" ); @@ -903,9 +903,7 @@ fn an_agents_view_open_waits_through_the_update_restart_window() { assert!(run.return_to_agents_view); assert_eq!( run.agents_view_notice.as_deref(), - Some( - "Waited for the Prime Agent daemon update restart to finish before opening this agent" - ) + Some("Waited for the Weave daemon update restart to finish before opening this agent") ); } @@ -938,7 +936,7 @@ fn a_permanent_create_failure_after_the_window_surfaces_unmasked() { "the refusal surfaces unmasked: {notice}" ); assert!( - !notice.contains("Waited for the Prime Agent daemon update restart"), + !notice.contains("Waited for the Weave daemon update restart"), "no wait notice for an open that never completed: {notice}" ); } diff --git a/crates/pa-tui/tests/daemon_shutdown_reconnect_headless.rs b/crates/pa-tui/tests/daemon_shutdown_reconnect_headless.rs index 955cbbb70..a4ade4153 100644 --- a/crates/pa-tui/tests/daemon_shutdown_reconnect_headless.rs +++ b/crates/pa-tui/tests/daemon_shutdown_reconnect_headless.rs @@ -410,7 +410,7 @@ fn an_announced_shutdown_reconnects_when_the_daemon_comes_back() { // TS #2458's waiting row: the announced closing armed the bounded shutdown recovery (not the // hiccup loop). assert!( - all.contains("the Prime Agent daemon shut down; waiting for it to come back"), + all.contains("the Weave daemon shut down; waiting for it to come back"), "the shutdown recovery armed at the notice:\n{all}" ); let equal_banner = format!( @@ -440,7 +440,7 @@ fn an_announced_shutdown_reconnects_when_the_daemon_comes_back() { "the reattach reached the successor by durable id: {requests:?}" ); assert!( - !all.contains("The Prime Agent daemon shut down while this window was attached"), + !all.contains("The Weave daemon shut down while this window was attached"), "the expiry row must not appear when the daemon came back:\n{all}" ); } diff --git a/crates/pa-tui/tests/daemon_shutdown_turn_end_headless.rs b/crates/pa-tui/tests/daemon_shutdown_turn_end_headless.rs index baa4e21af..87451be53 100644 --- a/crates/pa-tui/tests/daemon_shutdown_turn_end_headless.rs +++ b/crates/pa-tui/tests/daemon_shutdown_turn_end_headless.rs @@ -431,7 +431,7 @@ fn a_turn_settling_with_the_shutdown_does_not_stall_the_recovery() { // TS #2458's waiting row: the announced closing armed the bounded shutdown recovery (not the // hiccup loop). assert!( - all.contains("the Prime Agent daemon shut down; waiting for it to come back"), + all.contains("the Weave daemon shut down; waiting for it to come back"), "the shutdown recovery armed at the notice:\n{all}" ); let equal_banner = format!( @@ -461,7 +461,7 @@ fn a_turn_settling_with_the_shutdown_does_not_stall_the_recovery() { "the reattach reached the successor by durable id: {requests:?}" ); assert!( - !all.contains("The Prime Agent daemon shut down while this window was attached"), + !all.contains("The Weave daemon shut down while this window was attached"), "the expiry row must not appear when the daemon came back:\n{all}" ); } diff --git a/crates/pa-tui/tests/nightly_command_headless.rs b/crates/pa-tui/tests/nightly_command_headless.rs index 8bee32c89..bd8877f6b 100644 --- a/crates/pa-tui/tests/nightly_command_headless.rs +++ b/crates/pa-tui/tests/nightly_command_headless.rs @@ -408,7 +408,7 @@ fn nightly_status_and_usage_error_render_the_ts_wording() { } /// `/nightly on` (or bare) saves the nightly channel that `/update` and -/// `prime-agent update` follow. +/// `wv update` follow. #[pa_test_scratch::pa_test] #[test] fn nightly_on_saves_the_nightly_channel() { diff --git a/crates/pa-types/Cargo.toml b/crates/pa-types/Cargo.toml index c445eb43d..fca839737 100644 --- a/crates/pa-types/Cargo.toml +++ b/crates/pa-types/Cargo.toml @@ -3,7 +3,7 @@ name = "pa-types" version.workspace = true edition.workspace = true license.workspace = true -description = "Shared domain and wire types for Prime Agent." +description = "Shared domain and wire types for Weave." [dependencies] serde = { workspace = true } diff --git a/crates/pa-types/README.md b/crates/pa-types/README.md index 2d0b87804..2f24a0e0c 100644 --- a/crates/pa-types/README.md +++ b/crates/pa-types/README.md @@ -24,7 +24,7 @@ Daemon wire mechanics shared by the serving side (pa-daemon) and clients (pa-tui CLI suggestion help) plus its pure parse/suggestion helpers — the TS product keeps the same single table in core and imports it from its TUI. - `incident`: the daemon incident classifier shared by the incident CLI - (pa-cli's `prime-agent incident`, TS `src/cli/incident.ts`) and the + (pa-cli's `wv incident`, TS `src/cli/incident.ts`) and the agents-view incident notice (pa-tui's `incident_notices`, TS `src/modes/agents-view/incident-notices.ts`) — pa-tui depends on pa-types alone, and the TS product keeps the same single classifier in diff --git a/crates/pa-types/src/incident/classify_tests.rs b/crates/pa-types/src/incident/classify_tests.rs index c60ebb388..089c62af2 100644 --- a/crates/pa-types/src/incident/classify_tests.rs +++ b/crates/pa-types/src/incident/classify_tests.rs @@ -43,7 +43,7 @@ fn worker_start_line(ts: &str, socket_path: &str, pid: i64) -> IncidentLogEntry ("pid", serde_json::json!(pid)), ( "msg", - serde_json::json!(format!("Prime Agent daemon listening on {socket_path}")), + serde_json::json!(format!("Weave daemon listening on {socket_path}")), ), ]) } @@ -131,9 +131,7 @@ fn worker_ids_parse_from_unix_and_named_pipe_socket_paths() { Some("5b1d3aeb91ee") ); assert_eq!( - worker_id_from_socket_path(Some( - r"\\.\pipe\prime-agent-worker-98ed5cb228d2-5b1d3aeb91ee" - )), + worker_id_from_socket_path(Some(r"\\.\pipe\wv-worker-98ed5cb228d2-5b1d3aeb91ee")), Some("5b1d3aeb91ee") ); assert_eq!( @@ -145,7 +143,7 @@ fn worker_ids_parse_from_unix_and_named_pipe_socket_paths() { #[test] fn classifies_worker_events_for_windows_named_pipe_sockets() { - let socket_path = r"\\.\pipe\prime-agent-worker-98ed5cb228d2-5b1d3aeb91ee"; + let socket_path = r"\\.\pipe\wv-worker-98ed5cb228d2-5b1d3aeb91ee"; let entries = vec![ worker_start_line("2026-09-10T20:00:00.000Z", socket_path, 53615), // The worker's own crash line: the daemon component with the named-pipe path. diff --git a/crates/pa-types/src/incident/patterns.rs b/crates/pa-types/src/incident/patterns.rs index 3cc269d65..b6f7d5094 100644 --- a/crates/pa-types/src/incident/patterns.rs +++ b/crates/pa-types/src/incident/patterns.rs @@ -5,7 +5,7 @@ use regex::Regex; use std::sync::LazyLock; pub(super) static WORKER_SOCKET: LazyLock = LazyLock::new(|| { - Regex::new(r"^(?:prime-agent-)?worker-[0-9a-f]+-([0-9a-f]{12})(?:\.sock)?$") + Regex::new(r"^(?:wv-)?worker-[0-9a-f]+-([0-9a-f]{12})(?:\.sock)?$") .expect("valid worker socket pattern") }); @@ -15,12 +15,12 @@ pub(super) static STDERR_FORWARD: LazyLock = LazyLock::new(|| { }); pub(super) static SUPERVISOR_LISTENING: LazyLock = LazyLock::new(|| { - Regex::new(r"^Prime Agent daemon supervisor \S+ listening on \S+$") + Regex::new(r"^Weave daemon supervisor \S+ listening on \S+$") .expect("valid supervisor listening pattern") }); pub(super) static WORKER_LISTENING: LazyLock = LazyLock::new(|| { - Regex::new(r"^Prime Agent daemon listening on \S+$").expect("valid worker listening pattern") + Regex::new(r"^Weave daemon listening on \S+$").expect("valid worker listening pattern") }); pub(super) static CRASH_LINE: LazyLock = LazyLock::new(|| { diff --git a/crates/pa-types/src/lib.rs b/crates/pa-types/src/lib.rs index 31a85e041..3adc4e9a0 100644 --- a/crates/pa-types/src/lib.rs +++ b/crates/pa-types/src/lib.rs @@ -1,4 +1,4 @@ -//! Shared domain and wire types for Prime Agent: the serde port of the TypeScript wire and domain +//! Shared domain and wire types for Weave: the serde port of the TypeScript wire and domain //! contracts ([`ai`] holds the model-facing message surface from TS `packages/ai/src/types.ts`). //! //! # Lossless round-trips diff --git a/crates/pa-types/src/platform/terminal.rs b/crates/pa-types/src/platform/terminal.rs index af1de4f63..1d523d387 100644 --- a/crates/pa-types/src/platform/terminal.rs +++ b/crates/pa-types/src/platform/terminal.rs @@ -145,7 +145,7 @@ pub fn ensure_cooked_tty() -> TtyCooked { if unsafe { libc::tcsetattr(fd, libc::TCSANOW, &raw const attrs) } != 0 { let _ = io::Write::write_all( &mut io::stderr(), - b"Prime Agent: a raw terminal could not be repaired.\n", + b"Weave: a raw terminal could not be repaired.\n", ); return TtyCooked::Unavailable; } diff --git a/crates/pa-types/src/platform/transport.rs b/crates/pa-types/src/platform/transport.rs index c8d4ba27f..51c250f36 100644 --- a/crates/pa-types/src/platform/transport.rs +++ b/crates/pa-types/src/platform/transport.rs @@ -258,7 +258,7 @@ fn pipe_name(path: &Path) -> Result { .with_context(|| format!("pipe name is not UTF-8: {}", absolute.display()))? .to_ascii_lowercase(); Ok(format!( - r"\\.\pipe\prime-agent-explicit-{:016x}", + r"\\.\pipe\wv-explicit-{:016x}", fnv1a64(&normalized) )) } @@ -488,12 +488,12 @@ mod pipe_name_tests { #[test] fn pipe_namespace_names_pass_through_unchanged() { - let fixed = Path::new(r"\\.\pipe\prime-agent-daemon"); - assert_eq!(pipe_name(fixed).unwrap(), r"\\.\pipe\prime-agent-daemon"); - let worker = Path::new(r"\\.\pipe\prime-agent-worker-abc123-0123456789ab"); + let fixed = Path::new(r"\\.\pipe\wv-daemon"); + assert_eq!(pipe_name(fixed).unwrap(), r"\\.\pipe\wv-daemon"); + let worker = Path::new(r"\\.\pipe\wv-worker-abc123-0123456789ab"); assert_eq!( pipe_name(worker).unwrap(), - r"\\.\pipe\prime-agent-worker-abc123-0123456789ab" + r"\\.\pipe\wv-worker-abc123-0123456789ab" ); } @@ -503,7 +503,7 @@ mod pipe_name_tests { let a = pipe_name(socket).expect("derives"); let b = pipe_name(socket).expect("derives again"); assert_eq!(a, b, "the derivation is deterministic"); - assert!(a.starts_with(r"\\.\pipe\prime-agent-explicit-"), "{a}"); + assert!(a.starts_with(r"\\.\pipe\wv-explicit-"), "{a}"); } #[test] @@ -521,10 +521,10 @@ mod pipe_name_tests { #[test] fn pipe_paths_match_case_insensitively_and_remote_forms_pass_through() { - let upper = Path::new(r"\\.\PIPE\prime-agent-daemon"); - assert_eq!(pipe_name(upper).unwrap(), r"\\.\PIPE\prime-agent-daemon"); - let remote = Path::new(r"\\fileserver\pipe\prime-agent"); - assert_eq!(pipe_name(remote).unwrap(), r"\\fileserver\pipe\prime-agent"); + let upper = Path::new(r"\\.\PIPE\wv-daemon"); + assert_eq!(pipe_name(upper).unwrap(), r"\\.\PIPE\wv-daemon"); + let remote = Path::new(r"\\fileserver\pipe\wv"); + assert_eq!(pipe_name(remote).unwrap(), r"\\fileserver\pipe\wv"); } #[test] @@ -554,10 +554,7 @@ mod pipe_name_tests { here, elsewhere, "the same relative name derives per working directory" ); - assert!( - here.starts_with(r"\\.\pipe\prime-agent-explicit-"), - "{here}" - ); + assert!(here.starts_with(r"\\.\pipe\wv-explicit-"), "{here}"); } /// Restores the process working directory on scope exit (including panics). diff --git a/crates/pa-types/src/slash_commands.rs b/crates/pa-types/src/slash_commands.rs index 00321f30e..dcd6b79e9 100644 --- a/crates/pa-types/src/slash_commands.rs +++ b/crates/pa-types/src/slash_commands.rs @@ -56,7 +56,7 @@ const CANONICAL_BUILTIN_SLASH_COMMANDS: &[BuiltinSlashCommand] = &[ BuiltinSlashCommand { name: "context", description: "Show token, cost, and context usage for agent and sub-agents", execution: SlashCommandExecution::Client, argument_hint: None, aliases: &["usage"], takes_argument: false }, BuiltinSlashCommand { name: "changelog", description: "Show changelog entries", execution: SlashCommandExecution::Client, argument_hint: None, aliases: &[], takes_argument: false }, BuiltinSlashCommand { name: "update", description: "Update to the latest Rust build (uninstalls the TypeScript version; sessions preserved)", execution: SlashCommandExecution::Client, argument_hint: None, aliases: &[], takes_argument: false }, - BuiltinSlashCommand { name: "nightly", description: "Switch Prime Agent updates to the nightly channel (unreleased builds, may be broken)", execution: SlashCommandExecution::Client, argument_hint: Some("[on|off|status]"), aliases: &[], takes_argument: true }, + BuiltinSlashCommand { name: "nightly", description: "Switch Weave updates to the nightly channel (unreleased builds, may be broken)", execution: SlashCommandExecution::Client, argument_hint: Some("[on|off|status]"), aliases: &[], takes_argument: true }, BuiltinSlashCommand { name: "hotkeys", description: "Show all keyboard shortcuts", execution: SlashCommandExecution::Client, argument_hint: None, aliases: &[], takes_argument: false }, BuiltinSlashCommand { name: "fork", description: "Create a new fork from a previous user message", execution: SlashCommandExecution::Client, argument_hint: None, aliases: &[], takes_argument: false }, BuiltinSlashCommand { name: "clone", description: "Duplicate the current session at the current position", execution: SlashCommandExecution::Client, argument_hint: None, aliases: &[], takes_argument: false }, @@ -75,7 +75,7 @@ const CANONICAL_BUILTIN_SLASH_COMMANDS: &[BuiltinSlashCommand] = &[ BuiltinSlashCommand { name: "refresh", description: "Refresh model catalogs without reloading session resources", execution: SlashCommandExecution::Client, argument_hint: None, aliases: &[], takes_argument: false }, BuiltinSlashCommand { name: "reload", description: "Reload native plugins, session resources, keybindings, and themes", execution: SlashCommandExecution::Client, argument_hint: None, aliases: &[], takes_argument: false }, BuiltinSlashCommand { name: "speed", description: "Toggle footer readout of model output tok/sec (latest response and session average)", execution: SlashCommandExecution::Client, argument_hint: Some("[on|off]"), aliases: &[], takes_argument: true }, - BuiltinSlashCommand { name: "quit", description: "Quit Prime Agent", execution: SlashCommandExecution::Client, argument_hint: None, aliases: &[], takes_argument: false }, + BuiltinSlashCommand { name: "quit", description: "Quit Weave", execution: SlashCommandExecution::Client, argument_hint: None, aliases: &[], takes_argument: false }, ]; /// The registry with alias resolution maps prebuilt. diff --git a/crates/pa-types/src/themes.rs b/crates/pa-types/src/themes.rs index 94ccac147..8bebf21c1 100644 --- a/crates/pa-types/src/themes.rs +++ b/crates/pa-types/src/themes.rs @@ -6,7 +6,7 @@ /// The bundled theme names, in builtin resolution order. pub const BUILTIN_THEME_NAMES: [&str; 3] = ["prime", "dark", "light"]; -/// The `prime` theme file (Prime Agent's default, dark-first). +/// The `prime` theme file (Weave's default, dark-first). pub const PRIME_THEME_JSON: &str = include_str!("../themes/prime.json"); pub const DARK_THEME_JSON: &str = include_str!("../themes/dark.json"); pub const LIGHT_THEME_JSON: &str = include_str!("../themes/light.json"); diff --git a/docs/daily-stats.md b/docs/daily-stats.md index 366ff7b0c..178212f4a 100644 --- a/docs/daily-stats.md +++ b/docs/daily-stats.md @@ -1,9 +1,8 @@ -# Daily Prime Agent stats +# Daily Weave stats -The GitHub Actions workflow `Prime Agent daily stats` prepares a report at 9 AM +The daily stats GitHub Actions workflow prepares a report at 9 AM America/Los_Angeles, including daylight saving changes. GitHub may start scheduled -runs late. The report covers the previous completed **UTC day**, matching the -[Prime Agent Overview dashboard](https://eu.posthog.com/project/22174/dashboard/999378). +runs late. The report covers the previous completed **UTC day**. It reports DAU, WAU, MAU, token usage, completed runs, and run success rate. Daily values compare with yesterday and the same weekday last week. WAU compares with diff --git a/docs/slack-mcp.md b/docs/slack-mcp.md index 9093e4ba8..74700eecc 100644 --- a/docs/slack-mcp.md +++ b/docs/slack-mcp.md @@ -1,7 +1,7 @@ # Slack MCP connector Open `/mcp` (or `/plugins`), search for **Slack**, and connect. You can also -run `/mcp login slack` inside Prime Agent. Complete Slack's consent screen in +run `/mcp login slack` inside Weave. Complete Slack's consent screen in your browser. The connection becomes available to the current session through the generic `mcp` Python API: @@ -10,22 +10,22 @@ tools = await mcp.list_tools("slack") # Read the returned inputSchema before calling a tool. ``` -Prime Agent connects to Slack's hosted Streamable HTTP server at +Weave connects to Slack's hosted Streamable HTTP server at `https://mcp.slack.com/mcp`. It uses the public desktop OAuth client published in [Slack's agent harness guide](https://docs.slack.dev/ai/slack-mcp-server/connect-to-harnesses/): client ID `1601185624273.8899143856786` and callback `http://localhost:3118/callback`. This is the client used by Slack's Claude Code -plugin, so Slack's consent screen may identify the app as Claude. Prime Agent -uses PKCE and state validation, then stores the grant in its own auth store; -no Claude installation or credentials are needed. +plugin, so Slack's consent screen may identify the app as Claude. Weave uses +PKCE and state validation, then stores the grant in its own auth store; no +Claude installation or credentials are needed. Slack does not offer dynamic client registration. Workspace administrators still control app approval and granted scopes. The desktop client registration is controlled by Slack and its partner; changes there can require an update. If port `3118` is occupied, finish or close the other login attempt and retry. -Prime Agent reports the conflict instead of redirecting to an unregistered -port. For SSH sessions, forward local port `3118` to port `3118` on the host -running Prime Agent, or paste the final redirect URL into the auth panel. +Weave reports the conflict instead of redirecting to an unregistered port. For +SSH sessions, forward local port `3118` to port `3118` on the host running +Weave, or paste the final redirect URL into the auth panel. Disconnect with `/mcp logout slack`. diff --git a/flake.nix b/flake.nix index 583a1af7a..7ae65a42a 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - description = "Prime Agent downstream Rust source build"; + description = "Weave downstream Rust source build"; inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; @@ -11,19 +11,19 @@ # CI has already run the full workspace gate; rebuilding the audited # test profile here used to duplicate the package checkPhase. compiled-ci = compiled.overrideAttrs (_: { doCheck = false; }); - prime-agent = pkgs.callPackage ./nix/package.nix { inherit compiled; }; - prime-agent-ci = pkgs.callPackage ./nix/package.nix { compiled = compiled-ci; }; + weave = pkgs.callPackage ./nix/package.nix { inherit compiled; }; + weave-ci = pkgs.callPackage ./nix/package.nix { compiled = compiled-ci; }; in { packages.${system} = { - inherit prime-agent compiled prime-agent-ci; - default = prime-agent; + inherit weave compiled weave-ci; + default = weave; }; apps.${system}.default = { type = "app"; - program = pkgs.lib.getExe prime-agent; + program = pkgs.lib.getExe weave; }; checks.${system} = import ./nix/checks.nix { - inherit pkgs compiled prime-agent; + inherit pkgs compiled weave; }; devShells.${system}.default = pkgs.mkShell { packages = with pkgs; [ diff --git a/install-rust.sh b/install-rust.sh index d7d4f2c7e..fcdd96930 100755 --- a/install-rust.sh +++ b/install-rust.sh @@ -1,17 +1,16 @@ #!/bin/sh -# install-rust.sh — one-command installer for the Rust build of Prime Agent. +# install-rust.sh — one-command installer for the Rust build of Weave. # -# THE KEYWORD TAKEOVER: the Rust port installs under the product keyword -# PRIME-AGENT — the launcher lands at ~/.local/bin/prime-agent, the payload -# at ~/.local/share/prime-agent/, and users type `prime-agent`. The old -# prime-agent-rust layout (a TS-safe side-by-side name) is migrated: the -# share tree moves to the new name with a one-generation .old rollback, and -# this script's own launcher replaces the prime-agent-rust one it wrote in -# past installs. The FILENAME stays install-rust.sh deliberately: the -# curl|sh URL and the update entry points (`prime-agent update`, the TUI -# /update — both exec this script with --update) already point at it, and -# the filename is invisible to users; the command they type is what -# changed. +# THE INSTALL: the Rust port installs as WEAVE — the launcher lands at +# ~/.local/bin/wv, the payload at ~/.local/share/weave/, and users type +# `wv`. The old prime-agent-rust layout (a TS-safe side-by-side name) is +# migrated: the share tree moves to the new name with a one-generation +# .old rollback, and this script's launcher retires the prime-agent-rust +# one it wrote in past installs. The FILENAME stays install-rust.sh +# deliberately: the curl|sh URL and the update entry points (`wv update`, +# the TUI /update — both exec this script with --update) already point at +# it, and the filename is invisible to users; the command they type is +# what changed. # # SOURCE: the R2-backed release channel (this repo file is the source the # release workflow uploads to the bucket as install.sh / install-beta.sh; @@ -26,14 +25,14 @@ # signal one that will not stop), but only AFTER the new payload and # launcher are published — the retirement steps (daemon stops, npm # uninstall) never leave the machine without a -# working prime-agent if the install aborts mid-way. The probed +# working wv if the install aborts mid-way. The probed # candidates: the TS daemon's default socket # (${TMPDIR:-/tmp}/prime-agent-$(id -u)/daemon.sock), # PRIME_AGENT_DAEMON_SOCKET when a profile exported it (the # non-default socket the first field install had), and this # product's own pinned rust socket. The daemon that answers a # candidate is classified by IDENTITY first — a hello whose -# runtime build id is this product's ("pa-daemon-rs-", +# runtime build id is this product's ("weave-daemon-", # carried since the port) is OUR daemon of any build (the update # flow: the running daemon holds the old binary and venv state, the # update needs it down, the next invocation boots the new daemon — @@ -121,8 +120,8 @@ # PRIME_AGENT_VERSION pin an exact version instead of reading # the channel pointer # PRIME_AGENT_RUST_PREFIX install prefix (default: ~/.local; the -# launcher lands at $PREFIX/bin/prime-agent, -# the payload at $PREFIX/share/prime-agent/) +# launcher lands at $PREFIX/bin/wv, +# the payload at $PREFIX/share/weave/) # PRIME_AGENT_UV_BIN_DIR uv install dir (default: ~/.local/bin) # # THE CHANNEL (the R2 form, the TS install.sh parity): the script reads @@ -140,7 +139,7 @@ # takeover steps as no-ops when there is nothing left to take over). # install-rust.sh --rollback republishes that kept generation, and # install-rust.sh --archive publishes a local release archive -# instead of a channel download (`prime-agent update --rollback` and +# instead of a channel download (`wv update --rollback` and # `--archive` run the copy of this script bundled into the binary). # # PREREQUISITES: curl + sh (+ the network for the download). The installer @@ -169,33 +168,33 @@ die() { echo "install-rust.sh: $1" >&2; exit 1; } usage() { cat <<'USAGE' -install-rust.sh — install the Rust build of Prime Agent under the prime-agent keyword. +install-rust.sh — install the Rust build of Weave under the wv command. -The launcher lands at $PRIME_AGENT_RUST_PREFIX/bin/prime-agent and the payload at -$PRIME_AGENT_RUST_PREFIX/share/prime-agent/ (default prefix ~/.local). The installed -TypeScript product is taken over: its daemon is stopped with its own shutdown request, -its native install is preserved under share/prime-agent-legacy, and its npm package is -uninstalled (the restore command is printed). ~/.prime/agent (the shared session store) -is never touched. Both the default and --update install the channel's current version. +The launcher lands at $PRIME_AGENT_RUST_PREFIX/bin/wv and the payload at +$PRIME_AGENT_RUST_PREFIX/share/weave/ (default prefix ~/.local). The installed +TypeScript product is retired: its daemon is stopped with its own shutdown request and +its unbridged npm package is uninstalled (the restore command is printed). ~/.prime/agent (the +shared session store) is never touched. Both the default and --update install +the channel's current version. Needs curl + sh (+ the network): the installer bootstraps its own Python via uv — no system python3 required. It also pre-warms the Python kernel (uv + -`prime-agent --prime-agent-bootstrap`); offline, that step degrades to a +`wv --prime-agent-bootstrap`); offline, that step degrades to a warning and the first session bootstraps the kernel itself — it needs the network once. Options: --update the documented alias the update entry points exec (identical run) - --force if a Prime Agent daemon (TypeScript or Rust) is still up after the + --force if a Weave daemon (TypeScript or Rust) is still up after the shutdown requests and the drain wait, send it SIGTERM, then SIGKILL. Never applies to the daemon this install runs under. (from a pipe: curl -fsSL /install.sh | sh -s -- --force) --verbose the detail also goes to stdout, not just fd 3 (no animation) --rollback restore the previous version the last install kept - (share/prime-agent.old.*); the replaced version is kept in + (share/weave.old.*); the replaced version is kept in its place, so a second --rollback undoes the first --archive - install a local prime-agent--.tar.gz + install a local wv--.tar.gz release archive instead of downloading from the channel Output: stderr the title, one line per step, warnings with the command that @@ -228,7 +227,7 @@ USAGE # --- arguments --------------------------------------------------------------- # No positional arguments. --update is the documented alias the update entry -# points (`prime-agent update`, the TUI /update) exec — identical to the default +# points (`wv update`, the TUI /update) exec — identical to the default # run because the flow is idempotent by construction. --verbose folds the fd-3 # progress detail onto stdout (PRIME_AGENT_RUST_VERBOSE=1 does the same). # --rollback and --archive pick the payload source (MODE); the default is the @@ -256,7 +255,7 @@ elif [ -x /c/Windows/System32/tasklist.exe ]; then fi # THE HANDOFF PARENT WAIT: the Windows update command spawns THIS script # and exits precisely so its own payload image stops locking -# /share/prime-agent for the publish below — but a fast child +# /share/weave for the publish below — but a fast child # could reach that rename while the parent still lives. The handoff sets # the parent's pid here; the payload touch happens many steps below, and # this bounded wait (the parent is normally gone in milliseconds) makes @@ -269,7 +268,7 @@ if [ -n "${PRIME_AGENT_INSTALLER_PARENT_PID:-}" ] && [ -n "$TASKLIST" ]; then /FI "PID eq ${PRIME_AGENT_INSTALLER_PARENT_PID}" 2>/dev/null \ | grep -qw "${PRIME_AGENT_INSTALLER_PARENT_PID}"; do parent_waits=$((parent_waits + 1)) - [ "$parent_waits" -gt 300 ] && die "the prime-agent process that started this installer (pid ${PRIME_AGENT_INSTALLER_PARENT_PID}) is still running after 30s; the payload it holds cannot be replaced while it lives — stop that process and re-run" + [ "$parent_waits" -gt 300 ] && die "the wv process that started this installer (pid ${PRIME_AGENT_INSTALLER_PARENT_PID}) is still running after 30s; the payload it holds cannot be replaced while it lives — stop that process and re-run" sleep 0.1 2>/dev/null || sleep 1 done fi @@ -496,7 +495,7 @@ BEGIN { # BANNER_AWK_END ' -dl="$(mktemp -d "${TMPDIR:-/tmp}/prime-agent-download.XXXXXX")" +dl="$(mktemp -d "${TMPDIR:-/tmp}/weave-download.XXXXXX")" # The renderer's inputs: the active step (label, detail, the file being # downloaded, its size), the finished lines, the title's version text, and # the stop flag. Warnings wait in ui_notes and print in full once the @@ -576,7 +575,7 @@ title() { if [ -n "$ui_pid" ]; then printf '%s\n' "$1" > "$ui_brand" else - printf ' %sInstalling PRIME Agent%s %s%s%s\n\n' "$C_BOLD" "$C_RESET" "$C_DIM" "$1" "$C_RESET" >&2 + printf ' %sInstalling Weave%s %s%s%s\n\n' "$C_BOLD" "$C_RESET" "$C_DIM" "$1" "$C_RESET" >&2 fi } # step_start