rovecode 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +662 -0
- package/README.md +737 -0
- package/THIRD_PARTY_NOTICES.md +268 -0
- package/bin/rovecode.ts +21 -0
- package/package.json +56 -0
- package/src/acp/server.ts +374 -0
- package/src/cli/auth-login.ts +122 -0
- package/src/cli/connect.ts +244 -0
- package/src/cli/context-cmd.ts +199 -0
- package/src/cli/dispatch.ts +82 -0
- package/src/cli/doctor.ts +362 -0
- package/src/cli/export.ts +276 -0
- package/src/cli/help.ts +293 -0
- package/src/cli/is-tui-invocation.ts +8 -0
- package/src/cli/main.ts +583 -0
- package/src/cli/market-cmd.ts +658 -0
- package/src/cli/mcp-login.ts +141 -0
- package/src/cli/mcp-market-cmd.ts +302 -0
- package/src/cli/output.ts +382 -0
- package/src/cli/repl.ts +250 -0
- package/src/cli/repomap-root.ts +14 -0
- package/src/cli/resume.ts +57 -0
- package/src/cli/run-flags.ts +43 -0
- package/src/cli/run-limits.ts +78 -0
- package/src/cli/runtime.ts +931 -0
- package/src/cli/session-arg.ts +30 -0
- package/src/cli/sessions-cmd.ts +145 -0
- package/src/cli/setup.ts +153 -0
- package/src/cli/skills-cmd.ts +194 -0
- package/src/cli/start-chat.ts +65 -0
- package/src/cli/trust-cmd.ts +52 -0
- package/src/coding/bash.ts +148 -0
- package/src/coding/checkpoints.ts +327 -0
- package/src/coding/diff.ts +138 -0
- package/src/coding/files.ts +341 -0
- package/src/coding/hashline.ts +274 -0
- package/src/coding/lsp-gate.ts +254 -0
- package/src/coding/lsp-servers.ts +147 -0
- package/src/coding/lsp.ts +283 -0
- package/src/coding/repomap-cache.ts +99 -0
- package/src/coding/repomap-files.ts +192 -0
- package/src/coding/repomap.ts +481 -0
- package/src/core/agents.ts +255 -0
- package/src/core/compaction.ts +259 -0
- package/src/core/config.ts +289 -0
- package/src/core/context-report.ts +228 -0
- package/src/core/context.ts +60 -0
- package/src/core/count-remote.ts +107 -0
- package/src/core/execpolicy-rules.ts +196 -0
- package/src/core/execpolicy.ts +385 -0
- package/src/core/executor.ts +454 -0
- package/src/core/guardrails.ts +400 -0
- package/src/core/hooks.ts +411 -0
- package/src/core/images.ts +230 -0
- package/src/core/intro.ts +266 -0
- package/src/core/loop.ts +567 -0
- package/src/core/modes.ts +372 -0
- package/src/core/orchestrator.ts +245 -0
- package/src/core/proc-group.ts +48 -0
- package/src/core/project-trust.ts +98 -0
- package/src/core/reflection.ts +165 -0
- package/src/core/sandbox-config.ts +186 -0
- package/src/core/session-id.ts +24 -0
- package/src/core/session-images.ts +73 -0
- package/src/core/session-ops.ts +183 -0
- package/src/core/session-text.ts +29 -0
- package/src/core/session.ts +469 -0
- package/src/core/settings.ts +170 -0
- package/src/core/tasks.ts +646 -0
- package/src/core/token-scale.ts +108 -0
- package/src/core/tools.ts +309 -0
- package/src/core/trust.ts +104 -0
- package/src/core/types.ts +330 -0
- package/src/core/update-check.ts +171 -0
- package/src/core/usage.ts +204 -0
- package/src/core/validate.ts +121 -0
- package/src/core/verify-gate.ts +159 -0
- package/src/core/verify.ts +236 -0
- package/src/core/voice.ts +158 -0
- package/src/core/win-job.ts +183 -0
- package/src/core/workspace.ts +184 -0
- package/src/design/audit.ts +797 -0
- package/src/design/direction.ts +190 -0
- package/src/design/rules.ts +157 -0
- package/src/eval/bench.ts +150 -0
- package/src/eval/gauntlet-runner.ts +215 -0
- package/src/eval/gauntlet-support.ts +84 -0
- package/src/eval/gauntlet-wave3.ts +269 -0
- package/src/eval/gauntlet-wave4.ts +217 -0
- package/src/eval/gauntlet.ts +253 -0
- package/src/index.ts +17 -0
- package/src/lanes/agy.ts +95 -0
- package/src/lanes/approval.ts +24 -0
- package/src/lanes/claude.ts +129 -0
- package/src/lanes/codex.ts +127 -0
- package/src/lanes/events.ts +130 -0
- package/src/lanes/job.ts +142 -0
- package/src/lanes/opencode.ts +122 -0
- package/src/lanes/process.ts +184 -0
- package/src/lanes/progress.ts +183 -0
- package/src/lanes/registry.ts +178 -0
- package/src/lanes/runner.ts +124 -0
- package/src/lanes/types.ts +112 -0
- package/src/market/catalogs/mcp-docs.json +111 -0
- package/src/market/catalogs/plugins.json +111 -0
- package/src/market/catalogs/skills.json +478 -0
- package/src/market/clone.ts +72 -0
- package/src/market/context-cost.ts +121 -0
- package/src/market/digest.ts +106 -0
- package/src/market/index.ts +22 -0
- package/src/market/install.ts +578 -0
- package/src/market/manifest.ts +187 -0
- package/src/market/prereq.ts +145 -0
- package/src/market/registry.ts +363 -0
- package/src/market/resolve.ts +111 -0
- package/src/market/types.ts +236 -0
- package/src/market/validate.ts +227 -0
- package/src/mcp/client.ts +449 -0
- package/src/mcp/config.ts +252 -0
- package/src/mcp/local-package.ts +211 -0
- package/src/mcp/market-catalog.ts +84 -0
- package/src/mcp/market-install.ts +289 -0
- package/src/mcp/market.ts +362 -0
- package/src/mcp/oauth.ts +251 -0
- package/src/mcp/prompts-resources.ts +249 -0
- package/src/mcp/shared.ts +149 -0
- package/src/mcp/status.ts +67 -0
- package/src/mcp/tools.ts +275 -0
- package/src/mcp/transport.ts +122 -0
- package/src/mcp/trust.ts +25 -0
- package/src/memory/blocks.ts +278 -0
- package/src/memory/recall.ts +355 -0
- package/src/memory/scope.ts +182 -0
- package/src/memory/store.ts +105 -0
- package/src/memory/tools.ts +99 -0
- package/src/plugins/cli.ts +119 -0
- package/src/plugins/discover.ts +108 -0
- package/src/plugins/index.ts +50 -0
- package/src/plugins/install.ts +184 -0
- package/src/plugins/load.ts +124 -0
- package/src/plugins/manifest.ts +92 -0
- package/src/plugins/state.ts +83 -0
- package/src/providers/auth.ts +408 -0
- package/src/providers/cache.ts +223 -0
- package/src/providers/catalog-local.ts +160 -0
- package/src/providers/catalog.ts +421 -0
- package/src/providers/middleware-context.ts +86 -0
- package/src/providers/middleware.ts +373 -0
- package/src/providers/model-list.ts +23 -0
- package/src/providers/models-index.json +1 -0
- package/src/providers/oauth/common.ts +105 -0
- package/src/providers/oauth/device-code.ts +107 -0
- package/src/providers/oauth/github-copilot.ts +146 -0
- package/src/providers/oauth/loopback.ts +158 -0
- package/src/providers/oauth/openai.ts +163 -0
- package/src/providers/oauth/openrouter.ts +89 -0
- package/src/providers/oauth/pkce.ts +45 -0
- package/src/providers/oauth/registry.ts +39 -0
- package/src/providers/oauth/seam.ts +89 -0
- package/src/providers/profile-glm53.ts +111 -0
- package/src/providers/profile-sonnet5-persona.ts +65 -0
- package/src/providers/profile-sonnet5-voice.ts +23 -0
- package/src/providers/profiles.ts +156 -0
- package/src/providers/provider-config.ts +311 -0
- package/src/providers/registry.ts +333 -0
- package/src/providers/responses.ts +209 -0
- package/src/providers/retry.ts +234 -0
- package/src/providers/router.ts +294 -0
- package/src/providers/sse.ts +26 -0
- package/src/providers/stream-errors.ts +117 -0
- package/src/providers/stream.ts +566 -0
- package/src/providers/thinking.ts +189 -0
- package/src/providers/wire-messages.ts +129 -0
- package/src/providers/wire-responses.ts +79 -0
- package/src/providers/wire-select.ts +53 -0
- package/src/server/http.ts +291 -0
- package/src/server/openapi.ts +246 -0
- package/src/sextant/card-hits.ts +102 -0
- package/src/sextant/card-keys.ts +55 -0
- package/src/sextant/context-source.ts +157 -0
- package/src/sextant/crew-cards.ts +350 -0
- package/src/sextant/draw-agents.ts +273 -0
- package/src/sextant/draw-code.ts +388 -0
- package/src/sextant/draw-context.ts +222 -0
- package/src/sextant/draw-frame.ts +164 -0
- package/src/sextant/draw-market.ts +573 -0
- package/src/sextant/draw-messages.ts +386 -0
- package/src/sextant/draw-pet.ts +230 -0
- package/src/sextant/draw-plan.ts +187 -0
- package/src/sextant/draw-tabs.ts +85 -0
- package/src/sextant/draw-util.ts +65 -0
- package/src/sextant/draw-wizard.ts +378 -0
- package/src/sextant/engine.ts +230 -0
- package/src/sextant/frame-hits.ts +25 -0
- package/src/sextant/frame.ts +101 -0
- package/src/sextant/git-status.ts +197 -0
- package/src/sextant/grid.ts +59 -0
- package/src/sextant/input.ts +119 -0
- package/src/sextant/keys.ts +521 -0
- package/src/sextant/layout.ts +86 -0
- package/src/sextant/local-commands.ts +169 -0
- package/src/sextant/market-source.ts +287 -0
- package/src/sextant/mentions.ts +200 -0
- package/src/sextant/message-hits.ts +26 -0
- package/src/sextant/model.ts +387 -0
- package/src/sextant/overlays.ts +456 -0
- package/src/sextant/panel-hits.ts +38 -0
- package/src/sextant/pet.ts +399 -0
- package/src/sextant/screen.ts +324 -0
- package/src/sextant/scroll-hits.ts +66 -0
- package/src/sextant/scrollbar.ts +82 -0
- package/src/sextant/sextant-bridge.ts +174 -0
- package/src/sextant/sextant-cards.ts +142 -0
- package/src/sextant/sextant-diff-base.ts +63 -0
- package/src/sextant/sextant-files.ts +154 -0
- package/src/sextant/sextant-frame-loop.ts +335 -0
- package/src/sextant/sextant-renderer.ts +574 -0
- package/src/sextant/sextant-repo.ts +140 -0
- package/src/sextant/theme.ts +66 -0
- package/src/sextant/tool-rows.ts +189 -0
- package/src/sextant/types.ts +493 -0
- package/src/skills/index.ts +387 -0
- package/src/skills/pack.ts +220 -0
- package/src/skills/spec.ts +162 -0
- package/src/skills/tools.ts +69 -0
- package/src/skills/versioned.ts +227 -0
- package/src/telemetry/otel-export.ts +122 -0
- package/src/telemetry/otel-lanes.ts +89 -0
- package/src/telemetry/otel-logs.ts +131 -0
- package/src/telemetry/otel-metrics.ts +136 -0
- package/src/telemetry/otel.ts +397 -0
- package/src/telemetry/otlp.ts +76 -0
- package/src/tools/ask-user.ts +156 -0
- package/src/tools/bash-bg.ts +94 -0
- package/src/tools/bash-jobs.ts +237 -0
- package/src/tools/design.ts +151 -0
- package/src/tools/evalcell.ts +338 -0
- package/src/tools/html-text.ts +139 -0
- package/src/tools/provider.ts +149 -0
- package/src/tools/task.ts +250 -0
- package/src/tools/todo.ts +320 -0
- package/src/tools/webfetch.ts +332 -0
- package/src/tools/websearch.ts +359 -0
- package/src/tui/agents-cmd.ts +41 -0
- package/src/tui/app.ts +749 -0
- package/src/tui/attach.ts +127 -0
- package/src/tui/boot-notes.ts +41 -0
- package/src/tui/builtin-prompts.ts +59 -0
- package/src/tui/checkpoints-cmd.ts +70 -0
- package/src/tui/clipboard-image.ts +81 -0
- package/src/tui/clipboard.ts +78 -0
- package/src/tui/commands.ts +283 -0
- package/src/tui/config-view.ts +53 -0
- package/src/tui/context-cmds.ts +282 -0
- package/src/tui/cost.ts +108 -0
- package/src/tui/crash-guard.ts +173 -0
- package/src/tui/focus-terminal.ts +34 -0
- package/src/tui/git-cmds.ts +273 -0
- package/src/tui/git-plain.ts +58 -0
- package/src/tui/info-cmd.ts +150 -0
- package/src/tui/input-plain.ts +76 -0
- package/src/tui/mcp-cmd.ts +128 -0
- package/src/tui/memory-note.ts +77 -0
- package/src/tui/modes-cmd.ts +45 -0
- package/src/tui/notify-seq.ts +100 -0
- package/src/tui/notify.ts +318 -0
- package/src/tui/overlays.ts +97 -0
- package/src/tui/pi-renderer.ts +428 -0
- package/src/tui/providers-cmd.ts +377 -0
- package/src/tui/reasoning-view.ts +56 -0
- package/src/tui/renderer.ts +128 -0
- package/src/tui/replay-marker.ts +29 -0
- package/src/tui/session-cmd.ts +148 -0
- package/src/tui/session-manage.ts +95 -0
- package/src/tui/sextant-attach.ts +102 -0
- package/src/tui/sextant-io.ts +202 -0
- package/src/tui/sextant-smoke.ts +110 -0
- package/src/tui/shell-cmd.ts +158 -0
- package/src/tui/smoke.ts +72 -0
- package/src/tui/staged-terminal.ts +50 -0
- package/src/tui/startup.ts +12 -0
- package/src/tui/theme.ts +59 -0
- package/src/tui/todo-label.ts +7 -0
- package/src/tui/trust-card.ts +107 -0
- package/src/tui/tui-commands.ts +87 -0
- package/tsconfig.json +30 -0
- package/vendor/pi-tui/LICENSE +21 -0
- package/vendor/pi-tui/PATCHES.md +12 -0
- package/vendor/pi-tui/PROVENANCE.md +12 -0
- package/vendor/pi-tui/README.upstream.md +854 -0
- package/vendor/pi-tui/native/win32/prebuilds/win32-arm64/win32-console-mode.node +0 -0
- package/vendor/pi-tui/native/win32/prebuilds/win32-x64/win32-console-mode.node +0 -0
- package/vendor/pi-tui/src/alt-screen-search.ts +158 -0
- package/vendor/pi-tui/src/autocomplete.ts +827 -0
- package/vendor/pi-tui/src/components/alt-screen-flash.ts +52 -0
- package/vendor/pi-tui/src/components/box.ts +138 -0
- package/vendor/pi-tui/src/components/cancellable-loader.ts +41 -0
- package/vendor/pi-tui/src/components/editor.ts +2364 -0
- package/vendor/pi-tui/src/components/h-stack.ts +45 -0
- package/vendor/pi-tui/src/components/image.ts +128 -0
- package/vendor/pi-tui/src/components/input.ts +448 -0
- package/vendor/pi-tui/src/components/loader.ts +93 -0
- package/vendor/pi-tui/src/components/markdown.ts +1016 -0
- package/vendor/pi-tui/src/components/scroll-view.ts +217 -0
- package/vendor/pi-tui/src/components/select-list.ts +230 -0
- package/vendor/pi-tui/src/components/settings-list.ts +277 -0
- package/vendor/pi-tui/src/components/spacer.ts +29 -0
- package/vendor/pi-tui/src/components/stack.ts +155 -0
- package/vendor/pi-tui/src/components/text.ts +108 -0
- package/vendor/pi-tui/src/components/truncated-text.ts +66 -0
- package/vendor/pi-tui/src/components/v-stack.ts +34 -0
- package/vendor/pi-tui/src/editor-component.ts +75 -0
- package/vendor/pi-tui/src/fuzzy.ts +138 -0
- package/vendor/pi-tui/src/index.ts +149 -0
- package/vendor/pi-tui/src/keybindings.ts +321 -0
- package/vendor/pi-tui/src/keys.ts +1402 -0
- package/vendor/pi-tui/src/kill-ring.ts +47 -0
- package/vendor/pi-tui/src/latex.ts +1381 -0
- package/vendor/pi-tui/src/layout-node.ts +52 -0
- package/vendor/pi-tui/src/layout.ts +411 -0
- package/vendor/pi-tui/src/native-modifiers.ts +60 -0
- package/vendor/pi-tui/src/native-module-path.ts +32 -0
- package/vendor/pi-tui/src/stdin-buffer.ts +445 -0
- package/vendor/pi-tui/src/terminal-colors.ts +74 -0
- package/vendor/pi-tui/src/terminal-image.ts +701 -0
- package/vendor/pi-tui/src/terminal.ts +554 -0
- package/vendor/pi-tui/src/tui-alt-screen.ts +1379 -0
- package/vendor/pi-tui/src/tui-main-screen.ts +655 -0
- package/vendor/pi-tui/src/tui.ts +1264 -0
- package/vendor/pi-tui/src/undo-stack.ts +29 -0
- package/vendor/pi-tui/src/utils.ts +1327 -0
- package/vendor/pi-tui/src/word-navigation.ts +118 -0
- package/vendor/pi-tui/test/test-themes.ts +39 -0
- package/vendor/pi-tui/test/virtual-terminal.ts +219 -0
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
<!-- Shipped copy (npm files[] can only reference files inside this package).
|
|
2
|
+
Source of truth: THIRD_PARTY_NOTICES.md at the rovecode WORKSPACE root — the
|
|
3
|
+
directory above this repo that holds BLUEPRINT.md/PORTS.md. Edit there,
|
|
4
|
+
then re-copy here; nothing syncs it automatically. -->
|
|
5
|
+
|
|
6
|
+
# Third-party notices — rovecode
|
|
7
|
+
|
|
8
|
+
rovecode ports behavior from open-source agent harnesses. MIT-licensed sources (earendil-works/pi,
|
|
9
|
+
oh-my-pi, hermes-agent, senpi, opencode, prime-agent, models.dev/@opencode-ai/models,
|
|
10
|
+
@modelcontextprotocol/sdk) are credited in module headers and, where files are vendored
|
|
11
|
+
(vendor/pi-tui), ship with their upstream LICENSE and copyright headers intact. Apache-2.0
|
|
12
|
+
sources additionally get the entries below, per their license's NOTICE expectations.
|
|
13
|
+
No code originates from crush (FSL), claw-code, nanocoder, iflow, or the Claude Agent SDK.
|
|
14
|
+
|
|
15
|
+
## openai/codex (Apache-2.0)
|
|
16
|
+
|
|
17
|
+
Source: https://github.com/openai/codex, © 2025 OpenAI. Snapshot
|
|
18
|
+
`research/source_snapshots/openai-codex` @ 379d50be35d393631f45fde69197f3b9a592aa02.
|
|
19
|
+
|
|
20
|
+
- **execpolicy (port #9)** — `src/core/execpolicy.ts`, `src/core/execpolicy-rules.ts` contain
|
|
21
|
+
code translated from codex: the prefix-rule model, decision ordering, strictest-wins
|
|
22
|
+
evaluation, basename-fallback matching, load-time example validation, dangerous-command
|
|
23
|
+
heuristics, and user-facing reason strings are direct TypeScript translations of
|
|
24
|
+
`codex-rs/execpolicy/src/{decision,rule,policy,parser}.rs`, `codex-rs/core/src/exec_policy.rs`,
|
|
25
|
+
and `codex-rs/shell-command/src/command_safety/is_dangerous_command.rs`. The word-only shell
|
|
26
|
+
parser is a pattern-level reimplementation of `codex-rs/shell-command/src/bash.rs` (hand-rolled
|
|
27
|
+
tokenizer enforcing the same accept/reject contract in place of a tree-sitter walk). The
|
|
28
|
+
Starlark loader is replaced by TS object specs; network rules, host_executable allowlists,
|
|
29
|
+
policy amendments, and the sandbox/approval-mode matrix are not ported.
|
|
30
|
+
- **executor ladder (port #10)** — `src/core/executor.ts` ports AT PATTERN LEVEL (no code
|
|
31
|
+
copied) the sandbox-tier design: per-platform tier selection (SandboxType /
|
|
32
|
+
get_platform_sandbox, `codex-rs/sandboxing/src/manager.rs`), trial-spawn availability probing
|
|
33
|
+
(`bwrap.rs`), hard errors for unprovidable requested tiers (SandboxTransformError). Codex's
|
|
34
|
+
silent downgrade (`unwrap_or(None)`) is intentionally NOT ported. The docker rung follows the
|
|
35
|
+
OpenHands runtime-boundary pattern; OpenHands is not snapshotted — recorded as a provenance gap.
|
|
36
|
+
- **mid-turn cancellation (port #21)** — `src/core/loop.ts` and `src/core/tools.ts` follow AT
|
|
37
|
+
PATTERN LEVEL (no code copied) codex's turn-abort and history-normalization semantics: one
|
|
38
|
+
abortable active turn per session (`codex-rs/core/src/tasks/mod.rs:546-591`
|
|
39
|
+
abort_turn_if_active) and synthesized outputs for tool calls left without a result so the next
|
|
40
|
+
request is wire-well-formed (`codex-rs/core/src/context_manager/normalize.rs:51-67`, the
|
|
41
|
+
"aborted" FunctionCallOutput). The per-run AbortSignal threading follows opencode (MIT,
|
|
42
|
+
credited in the module header); the Windows Job-Object tree kill (`src/core/win-job.ts`) is
|
|
43
|
+
rovecode's own.
|
|
44
|
+
- **sandbox rung config (port #27)** — `src/core/sandbox-config.ts` follows AT PATTERN LEVEL (no
|
|
45
|
+
code copied) codex's sandbox-mode selection: the tier as a config choice layered file <
|
|
46
|
+
override (`codex-rs/app-server/tests/common/config.rs:140` `sandbox_mode`;
|
|
47
|
+
`codex-rs/utils/cli/src/shared_options.rs:40-41` `--sandbox`;
|
|
48
|
+
`codex-rs/utils/cli/src/sandbox_mode_cli_arg.rs:14-25`), and an explicitly requested but
|
|
49
|
+
unprovidable tier as a hard error (`codex-rs/sandboxing/src/manager.rs:203-222`
|
|
50
|
+
SandboxTransformError). Here `.rovecode/sandbox.json` < `ROVECODE_SANDBOX`; rungs direct/wsl/docker only.
|
|
51
|
+
- **OpenAI Responses wire (aion port #75, 2026-09-07)** — `src/providers/responses.ts` follows AT PATTERN
|
|
52
|
+
LEVEL (no code copied) the event set a Responses client consumes and the `event:` + `data:` pairing
|
|
53
|
+
(`codex-rs/codex-api/src/sse/responses.rs:357-518`, fixtures :843-845), the ChatGPT Codex base URL
|
|
54
|
+
(`codex-rs/model-provider-info/src/lib.rs:40`) and an `originator` header on every request
|
|
55
|
+
(`codex-rs/core/src/client.rs:688`; the value here is `rovecode`). The request shape, the output-slot
|
|
56
|
+
state machine and the `chatgpt-account-id` / `OpenAI-Beta` headers follow earendil-works/pi (MIT,
|
|
57
|
+
credited in the module header). Not ported: codex's error taxonomy, websocket and zstd transports.
|
|
58
|
+
- **TUI notifications (aion port #79, 2026-09-07)** — `src/tui/notify-seq.ts` and `src/tui/notify.ts` follow AT
|
|
59
|
+
PATTERN LEVEL (no code copied) codex's terminal-notification design: the `auto` backend chooser and its
|
|
60
|
+
terminal list (`codex-rs/tui/src/notifications/mod.rs`), the tmux DCS passthrough with doubled ESC and its
|
|
61
|
+
test vectors (`codex-rs/tui/src/notifications/osc9.rs`), the env markers per terminal
|
|
62
|
+
(`codex-rs/terminal-detection/src/lib.rs`), the unfocused | always gate with focus starting true and the
|
|
63
|
+
warn-once-then-disable write path (`codex-rs/tui/src/tui.rs`), the event set (`codex-rs/tui/src/chatwidget/
|
|
64
|
+
notifications.rs`) and the `notify` argv hook with the payload as the last argument and nulled stdio
|
|
65
|
+
(`codex-rs/hooks/src/legacy_notify.rs`). Deviations: focus reporting stays on under Windows, and the hook obeys
|
|
66
|
+
the focus gate. OSC 777, the control-byte scrub, the argv parser and the trust gate are rovecode's own.
|
|
67
|
+
|
|
68
|
+
## cline (Apache-2.0)
|
|
69
|
+
|
|
70
|
+
Source: https://github.com/cline/cline. Snapshot `research/source_snapshots/cline-cline` @ 8eb5f3d.
|
|
71
|
+
|
|
72
|
+
- **shadow-git checkpoints (port #11)** — `src/coding/checkpoints.ts` ports cline's shadow-git
|
|
73
|
+
checkpoint design (a second git repository with git-dir under `.rovecode/checkpoints/<session>`
|
|
74
|
+
and the workspace as work-tree; the user's `.git` is never written): init/worktree/identity
|
|
75
|
+
setup (`apps/vscode/src/integrations/checkpoints/CheckpointGitOperations.ts:88-94`), git-dir
|
|
76
|
+
and worktree-mismatch reuse checks (`CheckpointUtils.ts:20-23`, `GitOperations.ts:70-73`),
|
|
77
|
+
info/exclude handling (`CheckpointExclusions.ts:42-46,297-301`), snapshot-per-mutation
|
|
78
|
+
(`CheckpointGitOperations.ts:213`). Ported from cline v3.89.2's last shadow-git
|
|
79
|
+
implementation; cline v4's in-repo `git stash create` approach was deliberately not used
|
|
80
|
+
(it rewrites the user's HEAD).
|
|
81
|
+
- **Plan/Act modes (port #20)** — `src/core/modes.ts` ports cline's Plan/Act mode design: mode
|
|
82
|
+
semantics and defaults, per-mode provider/model configuration with the separate-models
|
|
83
|
+
write-sync gate, plan-mode read-only tool restriction (mapped onto rovecode's deny-default
|
|
84
|
+
permission rules), no-op same-mode toggles, and durable mode-switch notices. Mostly
|
|
85
|
+
pattern-level; code/text-level translations: createModeSwitchNoticeTracker and
|
|
86
|
+
formatModeSwitchNotice (near-verbatim from `sdk/packages/shared/src/prompt/format.ts:41-80`),
|
|
87
|
+
the ACT_MODE_CONTINUATION_PROMPT string (`apps/vscode/src/sdk/sdk-user-message-mapping.ts:9`),
|
|
88
|
+
and the plan-mode prompt section adapted from `sdk/packages/shared/src/prompt/cline.ts:34-59`.
|
|
89
|
+
- **image input (port #34)** — `src/core/images.ts` and `src/providers/wire-messages.ts` follow
|
|
90
|
+
AT PATTERN LEVEL (no code copied) cline's image handling: the supported media-type set and
|
|
91
|
+
5 MiB cap (`sdk/packages/shared/src/llms/media.ts:73-78, :80`), the request-time placeholder
|
|
92
|
+
for models without vision while the stored history keeps the real image (`media.ts:6-12`;
|
|
93
|
+
rovecode's wording is its own), the media-type mismatch rule, and the base64 source ↔
|
|
94
|
+
`data:<mime>;base64,<data>` URL mapping (`apps/vscode/src/shared/messages/content.ts:140-153`).
|
|
95
|
+
Sniffing, header dimensions and the sidecar store follow opencode (MIT, module header).
|
|
96
|
+
Snapshot `cline-cline` @ 8eb5f3d.
|
|
97
|
+
|
|
98
|
+
## Aider (Apache-2.0)
|
|
99
|
+
|
|
100
|
+
Source: https://github.com/Aider-AI/aider. Snapshot `research/source_snapshots/Aider-AI-aider` @ 5dc9490.
|
|
101
|
+
|
|
102
|
+
- **repo-map (port #12)** — `src/coding/repomap.ts` ports aider's `aider/repomap.py` algorithm:
|
|
103
|
+
Tag shape + mtime-keyed tags cache (L29, L233-264), def/ref classification (L318-336),
|
|
104
|
+
def/ref graph with ident multipliers (L365-514), PageRank + rank→definition spread
|
|
105
|
+
(L519-550), ranked file append (L560-574), binary-search token budgeting (L666-706), grouped
|
|
106
|
+
tree rendering (L748-784). Symbol extraction uses @ast-grep/napi (tree-sitter) in place of
|
|
107
|
+
aider's .scm tag queries.
|
|
108
|
+
- **reflection loop (port #28)** — `src/core/reflection.ts` + the rejection text in
|
|
109
|
+
`src/coding/hashline.ts` follow aider's reflection pattern (no code copied):
|
|
110
|
+
`aider/coders/base_coder.py` run_one reflection loop with `max_reflections` (L101,
|
|
111
|
+
L924-944), per-message reset (L864-871), edit-apply / lint / test errors fed back as the
|
|
112
|
+
next user message (L1596-1623, L2296-2328); the actionable failed-block report shape from
|
|
113
|
+
`aider/coders/editblock_coder.py` L84-124 ("Did you mean to match some of these actual
|
|
114
|
+
lines", the exact-match rule). Snapshot SHA 5dc9490.
|
|
115
|
+
|
|
116
|
+
## google-gemini/gemini-cli (Apache-2.0)
|
|
117
|
+
|
|
118
|
+
Source: https://github.com/google-gemini/gemini-cli. Snapshot
|
|
119
|
+
`research/source_snapshots/google-gemini-gemini-cli` @ 0bd1d43.
|
|
120
|
+
|
|
121
|
+
- **provider fallback chains (port #14, fallback half)** — `src/providers/router.ts` ports the
|
|
122
|
+
fallback-trigger conditions and chain-advance semantics from `packages/core/src`
|
|
123
|
+
(retryable-status classification incl. 429/5xx, immediate first attempt on the fallback model
|
|
124
|
+
— `retry.ts:404,459`, availability/model-policy chain — `modelPolicy.ts:52-56`, mid-stream
|
|
125
|
+
failure handling adapted from `core/geminiChat.ts:655-679`). The role table half of the
|
|
126
|
+
router follows oh-my-pi (MIT), credited in the module header.
|
|
127
|
+
|
|
128
|
+
### Port #22 — glob/grep/ls tools
|
|
129
|
+
`src/coding/files.ts` contains code translated from gemini-cli: the glob
|
|
130
|
+
recency-then-alphabetical sort comparator is a direct TypeScript translation of
|
|
131
|
+
`packages/core/src/tools/glob.ts:47-70` (sortFileEntries), and the ls output contract —
|
|
132
|
+
directories-first alphabetical sort, `[DIR] name` / `name (N bytes)` rows, the
|
|
133
|
+
`(N ignored)` gitignore note, and the empty-directory / not-a-directory messages — is
|
|
134
|
+
translated from `packages/core/src/tools/ls.ts:191-271`. Snapshot
|
|
135
|
+
`research/source_snapshots/google-gemini-gemini-cli` @ 0bd1d43. Tool limits,
|
|
136
|
+
truncation-marker strings, and the per-line cap follow opencode (MIT, credited in the
|
|
137
|
+
module header); the ripgrep dependency both upstreams share is replaced by a
|
|
138
|
+
pure-TypeScript matcher over a `git ls-files` enumeration.
|
|
139
|
+
|
|
140
|
+
### Port #23 — same-model retry with backoff
|
|
141
|
+
`src/providers/retry.ts` ports the retryWithBackoff loop shape and retry policy from
|
|
142
|
+
`packages/core/src/utils/retry.ts` (attempt/doubling loop :296-310, :494-501, :517-524; defaults
|
|
143
|
+
:20, :42-47; retryable set and the explicit no-retry-on-400 rule :193-199, :49-62, :174-189; abort
|
|
144
|
+
passthrough :337-340; server-suggested delay as a floor :472-476), the abortable delay from
|
|
145
|
+
`utils/delay.ts:22-48`, and the "suggested delay beyond the cap is terminal" rule from
|
|
146
|
+
`utils/googleQuotaErrors.ts:120, :286-289`. Deviations: full jitter (AWS-style) instead of
|
|
147
|
+
+-30%/+20% jitter, a per-invocation total-time budget, the Retry-After header (RFC 9110 s10.2.3)
|
|
148
|
+
as the delay source, and 499 not retried. Snapshot
|
|
149
|
+
`research/source_snapshots/google-gemini-gemini-cli` @ 0bd1d43. Classification is shared with
|
|
150
|
+
the port #14 router (`classifyStreamError`).
|
|
151
|
+
|
|
152
|
+
### Port #24 — approval diff preview
|
|
153
|
+
`src/coding/diff.ts` follows AT PATTERN LEVEL (no code copied) the confirmation-diff shaping of
|
|
154
|
+
`packages/core/src/tools/diffOptions.ts:10-18` (structuredPatch, small context) and the
|
|
155
|
+
CR-tolerant line comparison of `diff-utils.ts:22`. Snapshot
|
|
156
|
+
`research/source_snapshots/google-gemini-gemini-cli` @ 0bd1d43.
|
|
157
|
+
|
|
158
|
+
### Port #31 — web_fetch tool
|
|
159
|
+
`src/tools/webfetch.ts` contains code adapted from gemini-cli: the bounded streaming body
|
|
160
|
+
reader is a TypeScript adaptation of `readResponseWithLimit`
|
|
161
|
+
(`packages/core/src/tools/web-fetch.ts:555-587`, changed to truncate with a marker instead of
|
|
162
|
+
throwing); the timer-driven AbortController chained to the caller's signal follows
|
|
163
|
+
`fetchWithTimeout` (`packages/core/src/utils/fetch.ts:190-230`); the private-host refusal
|
|
164
|
+
semantics — localhost/loopback names, resolve-then-check over all addresses, IPv4-mapped
|
|
165
|
+
unmapping, the 198.18.0.0/15 benchmark range — follow `isBlockedHost`/`isAddressPrivate`/
|
|
166
|
+
`isPrivateIpAsync` (`web-fetch.ts:270-281`, `fetch.ts:94-169`) reimplemented without ipaddr.js.
|
|
167
|
+
Snapshot `research/source_snapshots/google-gemini-gemini-cli` @ 0bd1d43. Tool contract, scheme
|
|
168
|
+
gate, default timeout and html/passthrough split follow opencode (MIT, credited in the module
|
|
169
|
+
header); html-to-text/htmlparser2/turndown are replaced by `src/tools/html-text.ts`.
|
|
170
|
+
|
|
171
|
+
### Port #32 — todo/plan tool
|
|
172
|
+
`src/tools/todo.ts` ports the todo-list validation contract from gemini-cli
|
|
173
|
+
`packages/core/src/tools/write-todos.ts:100-129` (validateToolParamValues: array check, per-item
|
|
174
|
+
object / non-empty description / status-enum checks, and the "only one task can be in_progress at
|
|
175
|
+
a time" rule :120-126), translated into rovecode's ok/error result shape with ids and size bounds
|
|
176
|
+
added; the "Cleared todo list" wording (:52, :68) is gemini's. Snapshot
|
|
177
|
+
`research/source_snapshots/google-gemini-gemini-cli` @ 0bd1d43. Tool contract (whole-list replace,
|
|
178
|
+
content/status/priority) and when-to-use guidance follow opencode (MIT, module header).
|
|
179
|
+
|
|
180
|
+
### Port #30 — custom slash commands
|
|
181
|
+
`src/tui/commands.ts` follows AT PATTERN LEVEL (no code copied) gemini-cli's file-command loader:
|
|
182
|
+
user directory first, project directory second with "last wins" conflict resolution
|
|
183
|
+
(`packages/cli/src/services/FileCommandLoader.ts:85-90`, `:204-228`), a single scan when the
|
|
184
|
+
project dir is the user's home (`:221-228`), and invalid command files skipped with a report,
|
|
185
|
+
never fatal (`:277-298`). Snapshot `research/source_snapshots/google-gemini-gemini-cli` @ 0bd1d43.
|
|
186
|
+
Discovery, frontmatter/template split, precedence and `$ARGUMENTS`/`$N` templating follow
|
|
187
|
+
opencode (MIT, credited in the module header).
|
|
188
|
+
|
|
189
|
+
### Port #33 — ask_user tool
|
|
190
|
+
`src/tools/ask-user.ts` follows AT PATTERN LEVEL (no code copied) gemini-cli's headless rule for
|
|
191
|
+
user-facing questions: with no human present the ask-user tool is excluded and ASK_USER decisions
|
|
192
|
+
translate to DENY (`packages/cli/src/config/config.ts:794-803`); rovecode keeps the tool registered on
|
|
193
|
+
every surface and fails closed at execute time instead. Snapshot
|
|
194
|
+
`research/source_snapshots/google-gemini-gemini-cli` @ 0bd1d43. The tool contract (option labels,
|
|
195
|
+
typed answer, dismissed question = error) follows opencode (MIT, credited in the module header).
|
|
196
|
+
|
|
197
|
+
### Port #81 — workspace roots (`--add-dir`)
|
|
198
|
+
`src/core/workspace.ts` follows AT PATTERN LEVEL (no code copied) opencode's external-directory
|
|
199
|
+
handling (`external-directory.ts` and `fs-util.ts` `contains()`: an added directory is a peer of the
|
|
200
|
+
cwd, and containment is decided on canonical paths, not on string prefixes) and gemini-cli's
|
|
201
|
+
`isPathWithinRoot`. Snapshots `research/source_snapshots/opencode-2026` @ ebece6e and
|
|
202
|
+
`research/source_snapshots/google-gemini-gemini-cli` @ 0bd1d43. What is not followed: neither project
|
|
203
|
+
puts the boundary in the permission ladder as its own action — rovecode evaluates `file.external` at
|
|
204
|
+
dispatch so the refusal is a card a person can answer, and so an "always" is remembered per directory.
|
|
205
|
+
|
|
206
|
+
### Port #57/#76 — MCP prompts, resources, status and OAuth
|
|
207
|
+
`src/mcp/prompts-resources.ts` follows AT PATTERN LEVEL (no code copied) gemini-cli's
|
|
208
|
+
`list-mcp-resources.ts` / `read-mcp-resource.ts`: server-scoped listing, text content returned
|
|
209
|
+
verbatim, binary content summarized rather than inlined. `src/mcp/status.ts` follows its `/mcp`
|
|
210
|
+
per-server status rows (state, tool and prompt counts, the remedy line). `src/mcp/oauth.ts` follows
|
|
211
|
+
`packages/core/src/mcp/oauth-provider.ts:399-405` — start the loopback callback server FIRST so the
|
|
212
|
+
redirect URI names a port that is already listening, rather than racing the browser. Snapshot
|
|
213
|
+
`research/source_snapshots/google-gemini-gemini-cli` @ 0bd1d43.
|
|
214
|
+
|
|
215
|
+
The provider-class shape over the SDK's own seam was additionally read from opencode's
|
|
216
|
+
`packages/opencode/src/mcp/oauth-provider.ts` (MIT); its FIXED callback port is deliberately not
|
|
217
|
+
followed — rovecode allocates an ephemeral one, so two logins cannot collide and a stuck listener
|
|
218
|
+
cannot block the next attempt.
|
|
219
|
+
|
|
220
|
+
MCP OAuth itself is done through `@modelcontextprotocol/sdk`'s `OAuthClientProvider` seam (MIT —
|
|
221
|
+
dependency, API usage, not a port): the SDK performs discovery, dynamic client registration, PKCE and
|
|
222
|
+
refresh; rovecode supplies persistence (`~/.rovecode/credentials.json`, 0600), the loopback redirect
|
|
223
|
+
and the `rovecode mcp login` command.
|
|
224
|
+
|
|
225
|
+
## Zed Industries — agent-client-protocol (Apache-2.0)
|
|
226
|
+
|
|
227
|
+
- **ACP endpoint (port #15)** — `src/acp/server.ts` speaks ACP v1 via the official SDK
|
|
228
|
+
dependency `@zed-industries/agent-client-protocol@0.4.5` (Apache-2.0, © Zed Industries).
|
|
229
|
+
The SDK is consumed as a package dependency; no SDK code is vendored or modified.
|
|
230
|
+
|
|
231
|
+
## jsdiff — `diff` npm package (BSD-3-Clause)
|
|
232
|
+
|
|
233
|
+
Source: https://github.com/kpdecker/jsdiff. Consumed unmodified as the package dependency
|
|
234
|
+
`diff@9.0.0` by `src/coding/diff.ts` (port #24, approval-overlay diff preview). The compiled
|
|
235
|
+
single binary (scripts/build.ts) bundles it; per BSD-3-Clause clause 2 the notice below is
|
|
236
|
+
reproduced verbatim for binary redistribution.
|
|
237
|
+
|
|
238
|
+
```
|
|
239
|
+
BSD 3-Clause License
|
|
240
|
+
|
|
241
|
+
Copyright (c) 2009-2015, Kevin Decker <kpdecker@gmail.com>
|
|
242
|
+
All rights reserved.
|
|
243
|
+
|
|
244
|
+
Redistribution and use in source and binary forms, with or without
|
|
245
|
+
modification, are permitted provided that the following conditions are met:
|
|
246
|
+
|
|
247
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
248
|
+
list of conditions and the following disclaimer.
|
|
249
|
+
|
|
250
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
251
|
+
this list of conditions and the following disclaimer in the documentation
|
|
252
|
+
and/or other materials provided with the distribution.
|
|
253
|
+
|
|
254
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
255
|
+
contributors may be used to endorse or promote products derived from
|
|
256
|
+
this software without specific prior written permission.
|
|
257
|
+
|
|
258
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
259
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
260
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
261
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
262
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
263
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
264
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
265
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
266
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
267
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
268
|
+
```
|
package/bin/rovecode.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
/** Entrypoint wrapper: routes TUI invocations through the pre-bundled dist/cli/main.js for fast
|
|
3
|
+
* cold start (~90 ms vs ~230 ms), and falls back to src/cli/main.ts for lightweight subcommands
|
|
4
|
+
* (--help, --version, provider, model, …) which are already instant from source.
|
|
5
|
+
* Run `bun run build:cli` to produce dist/cli/main.js; re-run after `git pull`. */
|
|
6
|
+
import { existsSync } from "node:fs";
|
|
7
|
+
import { join } from "node:path";
|
|
8
|
+
import { isTuiInvocation } from "../src/cli/is-tui-invocation.ts";
|
|
9
|
+
|
|
10
|
+
const bundled = join(import.meta.dir, "..", "dist", "cli", "main.js");
|
|
11
|
+
const useDist = isTuiInvocation(process.argv) && existsSync(bundled);
|
|
12
|
+
|
|
13
|
+
if (process.env.ROVECODE_TRACE_BOOT === "1") {
|
|
14
|
+
process.stderr.write(`[boot] dist=${useDist}\n`);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
if (useDist) {
|
|
18
|
+
await import(bundled);
|
|
19
|
+
} else {
|
|
20
|
+
await import("../src/cli/main.ts");
|
|
21
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "rovecode",
|
|
3
|
+
"version": "0.3.2",
|
|
4
|
+
"license": "AGPL-3.0-only",
|
|
5
|
+
"author": "9Code Labs",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/9Code-Labs/rovecode.git"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/9Code-Labs/rovecode",
|
|
11
|
+
"description": "Rovecode: a coding agent for the terminal. Research-derived harness on Bun/TypeScript with evidence-based ports from open-source harnesses (sextant TUI, MCP, ACP, headless server, repo-map, shadow-git checkpoints, execpolicy, model routers).",
|
|
12
|
+
"type": "module",
|
|
13
|
+
"module": "src/index.ts",
|
|
14
|
+
"bin": {
|
|
15
|
+
"rovecode": "bin/rovecode.ts"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"bin",
|
|
19
|
+
"src",
|
|
20
|
+
"vendor",
|
|
21
|
+
"tsconfig.json",
|
|
22
|
+
"THIRD_PARTY_NOTICES.md"
|
|
23
|
+
],
|
|
24
|
+
"engines": {
|
|
25
|
+
"bun": ">=1.3.14"
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "bun run scripts/build.ts",
|
|
29
|
+
"build:cli": "bun -e \"require('node:fs').rmSync('dist/cli', { recursive: true, force: true })\" && bun build --target=bun --splitting --sourcemap=external src/cli/main.ts --outdir dist/cli && bun -e \"require('node:fs').copyFileSync('src/providers/models-index.json', 'dist/cli/models-index.json')\" && bun run smoke:cli && bun run smoke:dist",
|
|
30
|
+
"smoke:cli": "bun dist/cli/main.js --version",
|
|
31
|
+
"smoke:dist": "bun dist/cli/main.js smoke-tui --sextant",
|
|
32
|
+
"test": "bun test",
|
|
33
|
+
"gauntlet": "bun src/cli/main.ts gauntlet",
|
|
34
|
+
"typecheck": "tsc --noEmit",
|
|
35
|
+
"check": "node scripts/build-model-index.mjs --check && tsc --noEmit && bun test",
|
|
36
|
+
"smoke": "bun src/cli/main.ts smoke-tui --sextant",
|
|
37
|
+
"publish:site": "bash scripts/publish-site-data.sh",
|
|
38
|
+
"build:model-index": "node scripts/build-model-index.mjs"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@ast-grep/napi": "^0.45.3",
|
|
42
|
+
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
43
|
+
"@zed-industries/agent-client-protocol": "^0.4.5",
|
|
44
|
+
"diff": "^9.0.0",
|
|
45
|
+
"get-east-asian-width": "1.6.0",
|
|
46
|
+
"gpt-tokenizer": "^4.0.0",
|
|
47
|
+
"marked": "18.0.11",
|
|
48
|
+
"tokenlens": "^1.3.1"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@opencode-ai/models": "^0.0.64",
|
|
52
|
+
"@types/bun": "latest",
|
|
53
|
+
"@xterm/headless": "6.0.0",
|
|
54
|
+
"typescript": "^5.9.3"
|
|
55
|
+
}
|
|
56
|
+
}
|