rovecode 0.4.0-beta.3 → 0.4.0
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/README.md +57 -72
- package/THIRD_PARTY_NOTICES.md +0 -44
- package/bin/rovecode.ts +21 -0
- package/package.json +16 -38
- package/src/account/keys.ts +97 -0
- package/src/account/login.ts +158 -0
- package/src/account/provision.ts +47 -0
- package/src/account/store.ts +63 -0
- package/src/acp/server.ts +373 -0
- package/src/cli/account-cmd.ts +116 -0
- package/src/cli/connect.ts +244 -0
- package/src/cli/context-cmd.ts +199 -0
- package/src/cli/dispatch.ts +109 -0
- package/src/cli/doctor.ts +324 -0
- package/src/cli/export.ts +278 -0
- package/src/cli/help.ts +240 -0
- package/src/cli/is-tui-invocation.ts +8 -0
- package/src/cli/main.ts +599 -0
- package/src/cli/market-cmd.ts +658 -0
- package/src/cli/mcp-market-cmd.ts +299 -0
- package/src/cli/output.ts +382 -0
- package/src/cli/repl.ts +172 -0
- package/src/cli/resume.ts +32 -0
- package/src/cli/run-limits.ts +78 -0
- package/src/cli/runtime.ts +792 -0
- package/src/cli/setup.ts +187 -0
- package/src/cli/update-cmd.ts +78 -0
- package/src/cli/workflow-cmd.ts +100 -0
- package/src/coding/checkpoints.ts +270 -0
- package/src/coding/diff.ts +136 -0
- package/src/coding/files.ts +339 -0
- package/src/coding/hashline.ts +319 -0
- package/src/coding/lsp.ts +406 -0
- package/src/coding/repomap-cache.ts +99 -0
- package/src/coding/repomap-files.ts +110 -0
- package/src/coding/repomap.ts +392 -0
- package/src/core/compaction.ts +399 -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 +397 -0
- package/src/core/guardrails.ts +400 -0
- package/src/core/hooks.ts +398 -0
- package/src/core/images.ts +230 -0
- package/src/core/intro.ts +236 -0
- package/src/core/loop.ts +621 -0
- package/src/core/modes.ts +372 -0
- package/src/core/orchestrator.ts +207 -0
- package/src/core/reflection.ts +165 -0
- package/src/core/sandbox-config.ts +167 -0
- package/src/core/session-images.ts +73 -0
- package/src/core/session.ts +398 -0
- package/src/core/settings.ts +98 -0
- package/src/core/stuck-detector.ts +273 -0
- package/src/core/tasks.ts +374 -0
- package/src/core/token-scale.ts +108 -0
- package/src/core/tool-output-budget.ts +166 -0
- package/src/core/tools.ts +288 -0
- package/src/core/types.ts +330 -0
- package/src/core/update-check.ts +171 -0
- package/src/core/update.ts +158 -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 +237 -0
- package/src/core/voice.ts +158 -0
- package/src/core/win-job.ts +183 -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 +218 -0
- package/src/eval/gauntlet.ts +226 -0
- package/src/eval/grader.ts +186 -0
- package/src/eval/record.ts +202 -0
- package/src/eval/redact.ts +141 -0
- package/src/eval/replay.ts +147 -0
- package/src/eval/trajectory.ts +373 -0
- package/src/index.ts +17 -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 +431 -0
- package/src/mcp/config.ts +239 -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 +0 -0
- package/src/mcp/tools.ts +131 -0
- package/src/mcp/trust.ts +49 -0
- package/src/memory/blocks.ts +175 -0
- package/src/memory/recall.ts +355 -0
- package/src/memory/store.ts +105 -0
- package/src/memory/tools.ts +99 -0
- package/src/plugins/cli.ts +123 -0
- package/src/plugins/discover.ts +108 -0
- package/src/plugins/index.ts +50 -0
- package/src/plugins/init.ts +140 -0
- package/src/plugins/install.ts +184 -0
- package/src/plugins/load.ts +149 -0
- package/src/plugins/manifest.ts +106 -0
- package/src/plugins/state.ts +83 -0
- package/src/providers/auth.ts +293 -0
- package/src/providers/cache.ts +223 -0
- package/src/providers/catalog-local.ts +160 -0
- package/src/providers/catalog.ts +408 -0
- package/src/providers/middleware-context.ts +86 -0
- package/src/providers/middleware.ts +373 -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 +302 -0
- package/src/providers/response-validation.ts +80 -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 +569 -0
- package/src/providers/thinking.ts +189 -0
- package/src/providers/wire-messages.ts +129 -0
- package/src/sdk/client.ts +225 -0
- package/src/sdk/index.ts +3 -0
- package/src/server/dashboard.ts +144 -0
- package/src/server/http.ts +343 -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/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 +159 -0
- package/src/sextant/draw-tabs.ts +85 -0
- package/src/sextant/draw-util.ts +65 -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 +488 -0
- package/src/sextant/layout.ts +86 -0
- package/src/sextant/local-commands.ts +156 -0
- package/src/sextant/market-source.ts +287 -0
- package/src/sextant/mentions.ts +141 -0
- package/src/sextant/message-hits.ts +26 -0
- package/src/sextant/model.ts +387 -0
- package/src/sextant/overlays.ts +451 -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/selection.ts +123 -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 +314 -0
- package/src/sextant/sextant-renderer.ts +478 -0
- package/src/sextant/sextant-repo.ts +131 -0
- package/src/sextant/theme.ts +66 -0
- package/src/sextant/tool-rows.ts +189 -0
- package/src/sextant/types.ts +473 -0
- package/src/skills/index.ts +306 -0
- package/src/skills/tools.ts +69 -0
- package/src/skills/versioned.ts +227 -0
- package/src/telemetry/otel.ts +353 -0
- package/src/telemetry/otlp.ts +68 -0
- package/src/tools/ask-user.ts +156 -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 +216 -0
- package/src/tools/todo.ts +320 -0
- package/src/tools/webfetch.ts +331 -0
- package/src/tui/app.ts +608 -0
- package/src/tui/attach.ts +127 -0
- package/src/tui/checkpoints-cmd.ts +70 -0
- package/src/tui/clipboard-image.ts +81 -0
- package/src/tui/commands.ts +277 -0
- package/src/tui/cost.ts +108 -0
- package/src/tui/info-cmd.ts +144 -0
- package/src/tui/mcp-cmd.ts +128 -0
- package/src/tui/modes-cmd.ts +45 -0
- package/src/tui/overlays.ts +97 -0
- package/src/tui/pi-renderer.ts +424 -0
- package/src/tui/providers-cmd.ts +366 -0
- package/src/tui/renderer.ts +101 -0
- package/src/tui/replay-marker.ts +29 -0
- package/src/tui/session-cmd.ts +146 -0
- package/src/tui/sextant-attach.ts +68 -0
- package/src/tui/sextant-io.ts +184 -0
- package/src/tui/sextant-smoke.ts +110 -0
- package/src/tui/smoke.ts +72 -0
- package/src/tui/theme.ts +59 -0
- package/src/tui/todo-label.ts +7 -0
- package/src/workflow/engine.ts +266 -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
- package/CHANGELOG.md +0 -527
- package/bin/rovecode.js +0 -24
- package/dist/cli/app-j6gn14w3.js +0 -2
- package/dist/cli/ask-user-cwstt8fz.js +0 -2
- package/dist/cli/auth-login-9bbp9915.js +0 -2
- package/dist/cli/auth-m8p9grty.js +0 -2
- package/dist/cli/bench-16zqdms5.js +0 -9
- package/dist/cli/catalog-1xchffa4.js +0 -2
- package/dist/cli/cli-1n1zb64f.js +0 -2
- package/dist/cli/client-2t9gjkck.js +0 -2
- package/dist/cli/commands-exafvm2b.js +0 -2
- package/dist/cli/connect-6zde0kn3.js +0 -2
- package/dist/cli/context-cmd-5t43wgqt.js +0 -2
- package/dist/cli/context-report-kt01pw8y.js +0 -2
- package/dist/cli/count-remote-ap7x3vh6.js +0 -2
- package/dist/cli/design-ne5zszyh.js +0 -2
- package/dist/cli/dispatch-2r5myxye.js +0 -2
- package/dist/cli/doctor-ws4fh4tn.js +0 -3
- package/dist/cli/executor-bdrjn634.js +0 -2
- package/dist/cli/export-1mxb9g5p.js +0 -2
- package/dist/cli/files-g104xghh.js +0 -2
- package/dist/cli/gauntlet-07xrjpj7.js +0 -2
- package/dist/cli/gauntlet-runner-xvy64436.js +0 -10
- package/dist/cli/gauntlet-wave3-jm91yt5w.js +0 -5
- package/dist/cli/gauntlet-wave4-r13py7p1.js +0 -14
- package/dist/cli/hashline-znvrat11.js +0 -2
- package/dist/cli/http-xafw6fsh.js +0 -143
- package/dist/cli/index-1sgjm25y.js +0 -2
- package/dist/cli/init-g2m0tn4m.js +0 -51
- package/dist/cli/install-avaqjjqq.js +0 -2
- package/dist/cli/loop-mmpfft01.js +0 -2
- package/dist/cli/main-0904f6ps.js +0 -5
- package/dist/cli/main-0ab9fc26.js +0 -9
- package/dist/cli/main-0jys2ccn.js +0 -3
- package/dist/cli/main-0mtcdbs7.js +0 -3
- package/dist/cli/main-0z1w2zsg.js +0 -3
- package/dist/cli/main-1dchs7xv.js +0 -18
- package/dist/cli/main-1ereejm1.js +0 -3
- package/dist/cli/main-1k1kw6b5.js +0 -3
- package/dist/cli/main-27y4sm2k.js +0 -38
- package/dist/cli/main-2wwjex5j.js +0 -58
- package/dist/cli/main-2yeveeve.js +0 -6
- package/dist/cli/main-2yfck9b5.js +0 -3
- package/dist/cli/main-2zmzgkwh.js +0 -3
- package/dist/cli/main-351pz3z7.js +0 -7
- package/dist/cli/main-3gjqfh7a.js +0 -6
- package/dist/cli/main-3nf3kgve.js +0 -3
- package/dist/cli/main-3pjrb2hd.js +0 -3
- package/dist/cli/main-3rxcvgna.js +0 -19
- package/dist/cli/main-4b3jgy66.js +0 -19
- package/dist/cli/main-4wndhjdc.js +0 -7
- package/dist/cli/main-4xcmvxnk.js +0 -3
- package/dist/cli/main-5tbz0wbz.js +0 -4
- package/dist/cli/main-5ywnwthm.js +0 -3
- package/dist/cli/main-6b62vkz0.js +0 -14
- package/dist/cli/main-6dnk69vp.js +0 -3
- package/dist/cli/main-6genrmhs.js +0 -136
- package/dist/cli/main-73g7eff4.js +0 -15
- package/dist/cli/main-7c5thhjd.js +0 -5
- package/dist/cli/main-7rn6bqje.js +0 -3
- package/dist/cli/main-80haw7qk.js +0 -4
- package/dist/cli/main-875s60s2.js +0 -4
- package/dist/cli/main-8kjxbpw4.js +0 -8
- package/dist/cli/main-90ds1z4e.js +0 -10
- package/dist/cli/main-9etavkew.js +0 -3
- package/dist/cli/main-a9njrkk1.js +0 -3
- package/dist/cli/main-aecrjq2d.js +0 -12
- package/dist/cli/main-ck9asesq.js +0 -9
- package/dist/cli/main-cta9racd.js +0 -4
- package/dist/cli/main-ddv7j2ag.js +0 -3
- package/dist/cli/main-dfreez27.js +0 -10
- package/dist/cli/main-f7rw7des.js +0 -3
- package/dist/cli/main-ggcn7rd7.js +0 -5
- package/dist/cli/main-gzkmycnv.js +0 -3
- package/dist/cli/main-hq51jg8v.js +0 -18
- package/dist/cli/main-jft389w9.js +0 -8
- package/dist/cli/main-k1eqkg83.js +0 -3
- package/dist/cli/main-k2y8a2aw.js +0 -9
- package/dist/cli/main-kcpbykxz.js +0 -4
- package/dist/cli/main-kd488vje.js +0 -22
- package/dist/cli/main-kh32yvgk.js +0 -5
- package/dist/cli/main-kqxnqjnv.js +0 -25
- package/dist/cli/main-kyn0xnsg.js +0 -3
- package/dist/cli/main-m1kk6fp5.js +0 -21
- package/dist/cli/main-mv40pcr2.js +0 -4
- package/dist/cli/main-n0t3973w.js +0 -3
- package/dist/cli/main-nqveez48.js +0 -4
- package/dist/cli/main-pknhvrmj.js +0 -3
- package/dist/cli/main-pn1w7a7j.js +0 -3
- package/dist/cli/main-prxxs70n.js +0 -4
- package/dist/cli/main-q3vsesf9.js +0 -3
- package/dist/cli/main-qsevpgsv.js +0 -3
- package/dist/cli/main-rdgdw24b.js +0 -25
- package/dist/cli/main-rfth4tbm.js +0 -16
- package/dist/cli/main-rg0wn0xf.js +0 -5
- package/dist/cli/main-sdmxhtv8.js +0 -4
- package/dist/cli/main-skbp13js.js +0 -18
- package/dist/cli/main-t4xnd213.js +0 -7
- package/dist/cli/main-vqak588n.js +0 -4
- package/dist/cli/main-w2n1303f.js +0 -9
- package/dist/cli/main-wbrdspr2.js +0 -5
- package/dist/cli/main-wsrg79c1.js +0 -7
- package/dist/cli/main-x4r0fne4.js +0 -5
- package/dist/cli/main-xea2f3tn.js +0 -6
- package/dist/cli/main-xg704a3c.js +0 -3
- package/dist/cli/main-xvnrabfp.js +0 -16
- package/dist/cli/main-xy53xf0r.js +0 -4
- package/dist/cli/main-y1fqy60y.js +0 -3
- package/dist/cli/main-yn8cd281.js +0 -34
- package/dist/cli/main-yr0ksc0h.js +0 -4
- package/dist/cli/main-z2ex2vyf.js +0 -4
- package/dist/cli/main-z3aayzvq.js +0 -3
- package/dist/cli/main-zaqh35jg.js +0 -3
- package/dist/cli/main-zc2e8e46.js +0 -4
- package/dist/cli/main-zzrfw6cf.js +0 -13
- package/dist/cli/main.js +0 -280
- package/dist/cli/market-cmd-e14kmx9n.js +0 -5
- package/dist/cli/mcp-login-wq7ktdek.js +0 -2
- package/dist/cli/mcp-market-cmd-9mg3jecy.js +0 -2
- package/dist/cli/notify-b7qc0cjb.js +0 -2
- package/dist/cli/oauth-z8whcgfx.js +0 -2
- package/dist/cli/output-b3ewj3ps.js +0 -16
- package/dist/cli/profiles-6mr5he5e.js +0 -2
- package/dist/cli/provider-config-g7j42q8x.js +0 -2
- package/dist/cli/provider-jr1y8vvm.js +0 -2
- package/dist/cli/registry-s8yk86g0.js +0 -2
- package/dist/cli/registry-t6p8d4mn.js +0 -2
- package/dist/cli/repl-bajwe1mh.js +0 -11
- package/dist/cli/resume-rwn9nz7y.js +0 -2
- package/dist/cli/run-flags-nah7ndpt.js +0 -2
- package/dist/cli/runtime-n7gafzhb.js +0 -2
- package/dist/cli/sandbox-config-emdy18x4.js +0 -2
- package/dist/cli/server-b0nvs2bn.js +0 -5
- package/dist/cli/session-arg-y75wd4kj.js +0 -2
- package/dist/cli/session-j62evmjq.js +0 -2
- package/dist/cli/sessions-cmd-tsnwz0ns.js +0 -7
- package/dist/cli/settings-df10wfez.js +0 -2
- package/dist/cli/setup-jzvv72fg.js +0 -2
- package/dist/cli/sextant-smoke-37m81ke6.js +0 -5
- package/dist/cli/skills-cmd-gjxnxnhx.js +0 -2
- package/dist/cli/smoke-p7748apt.js +0 -8
- package/dist/cli/start-chat-s4st3mm0.js +0 -12
- package/dist/cli/stream-gmeyewds.js +0 -2
- package/dist/cli/task-gh0kkp3n.js +0 -2
- package/dist/cli/tasks-z1kfpe8e.js +0 -2
- package/dist/cli/thinking-0eqkrz6t.js +0 -2
- package/dist/cli/todo-5brcrt9m.js +0 -2
- package/dist/cli/tools-7pzm0vj9.js +0 -2
- package/dist/cli/tools-s635p6s8.js +0 -2
- package/dist/cli/trust-cmd-cjav8zgm.js +0 -2
- package/dist/cli/update-check-pt31bm2f.js +0 -2
- package/dist/cli/update-cmd-tk131s9t.js +0 -2
- package/dist/cli/voice-56nabd8d.js +0 -2
- package/dist/cli/webfetch-xd8q596m.js +0 -2
- package/dist/cli/websearch-5hkf98k1.js +0 -2
- package/dist/cli/workflow-cmd-cy3cvzjp.js +0 -4
- package/dist/cli/workspace-q10g5z3e.js +0 -2
- package/dist/lib/index.js +0 -62
- package/dist/lib/models-index.json +0 -1
- package/dist/lib/plugins.js +0 -55
- package/dist/lib/providers.js +0 -17
- package/dist/lib/public-api.js +0 -20
- package/dist/lib/sdk.js +0 -360
- /package/{dist/cli → src/providers}/models-index.json +0 -0
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Eval trajectory/result persistence (eval P0-1): a VERSIONED JSONL schema, one file per run.
|
|
3
|
+
*
|
|
4
|
+
* line 1 {"kind":"header", "schemaVersion":1, …run identity, task, model, seed, commit, fixture}
|
|
5
|
+
* … {"kind":"step", …user / assistant (tool calls) / tool (results) records}
|
|
6
|
+
* last {"kind":"result", …outcome, duration, usage, cost, failure taxonomy, grader specs+results, evidence}
|
|
7
|
+
*
|
|
8
|
+
* Design rules the file is judged by:
|
|
9
|
+
* - Every string payload is REDACTED (eval/redact.ts) and workspace-relative-ized
|
|
10
|
+
* (portablize: absolute workspace paths become a "<workspace>" token) BEFORE it is
|
|
11
|
+
* written — a trajectory is safe to commit/share and replayable on another machine.
|
|
12
|
+
* - `outputSha` is the sha256 of the path-normalized RAW tool output, so replay compares
|
|
13
|
+
* substance while the stored text stays redacted evidence.
|
|
14
|
+
* - The reader CLASSIFIES problems (unsupported-version / missing-header / malformed-line
|
|
15
|
+
* with its line number / unknown line kinds tolerated) — never a raw JSON crash mid-file.
|
|
16
|
+
* - Fixture snapshots (fixtureSpec) record the pre-run workspace so replay can rebuild it
|
|
17
|
+
* deterministically; binaries are recorded by sha only, never embedded.
|
|
18
|
+
*
|
|
19
|
+
* Schema version 1. Adding optional fields is compatible; bump TRAJECTORY_SCHEMA_VERSION
|
|
20
|
+
* and add the old version to SUPPORTED_TRAJECTORY_VERSIONS when reading old files.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
24
|
+
import { readdirSync, readFileSync, writeFileSync, appendFileSync, mkdirSync, statSync } from "node:fs";
|
|
25
|
+
import { join, relative } from "node:path";
|
|
26
|
+
import { redactDeep } from "./redact.ts";
|
|
27
|
+
import type { PermissionRule } from "../core/types.ts";
|
|
28
|
+
|
|
29
|
+
export const TRAJECTORY_SCHEMA_VERSION = 1;
|
|
30
|
+
export const SUPPORTED_TRAJECTORY_VERSIONS: readonly number[] = [1];
|
|
31
|
+
|
|
32
|
+
export type FailureTaxonomy =
|
|
33
|
+
| "verify-failed" // a strict grader rejected the end state
|
|
34
|
+
| "timeout" // the run's deadline fired
|
|
35
|
+
| "provider-error" // the provider/stream failed (run_end "error" or thrown)
|
|
36
|
+
| "budget" // turn/second/cost budget exhausted (run_end "budget")
|
|
37
|
+
| "loop-guard" // the tool guard stubbed the run into submission
|
|
38
|
+
| "invalid-args" // tool calls the schema rejected
|
|
39
|
+
| "permission-denied" // policy/hook/user denied the needed tool call
|
|
40
|
+
| "workspace-leak" // the runner left temp dirs behind
|
|
41
|
+
| "tool-error" // tool failures without a more specific home
|
|
42
|
+
| "unknown";
|
|
43
|
+
|
|
44
|
+
export interface FixtureSpec {
|
|
45
|
+
/** workspace-relative path → full text content (redacted) */
|
|
46
|
+
files: Record<string, string>;
|
|
47
|
+
/** workspace-relative path → sha256 of content; the content itself is NOT persisted */
|
|
48
|
+
binary: Record<string, string>;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface TrajectoryHeaderLine {
|
|
52
|
+
kind: "header";
|
|
53
|
+
schemaVersion: number;
|
|
54
|
+
runId: string;
|
|
55
|
+
startedAt: number;
|
|
56
|
+
task: { id: string; category: string; prompt: string };
|
|
57
|
+
model: { provider: string; model: string } | null;
|
|
58
|
+
seed: number;
|
|
59
|
+
commit: string | null;
|
|
60
|
+
fixture: FixtureSpec;
|
|
61
|
+
permissionRules?: PermissionRule[];
|
|
62
|
+
env: { platform: string; runtime: string };
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface RecordedToolCall { id: string; tool: string; args: unknown }
|
|
66
|
+
|
|
67
|
+
export interface RecordedToolResult {
|
|
68
|
+
callId: string;
|
|
69
|
+
ok: boolean;
|
|
70
|
+
/** path-normalized + redacted text (evidence, bounded) */
|
|
71
|
+
output: string;
|
|
72
|
+
/** sha256 of the path-normalized RAW output — what replay compares */
|
|
73
|
+
outputSha: string;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface TrajectoryStepLine {
|
|
77
|
+
kind: "step";
|
|
78
|
+
seq: number;
|
|
79
|
+
type: "user" | "assistant" | "tool";
|
|
80
|
+
turn?: number;
|
|
81
|
+
text?: string;
|
|
82
|
+
toolCalls?: RecordedToolCall[];
|
|
83
|
+
results?: RecordedToolResult[];
|
|
84
|
+
stopReason?: string;
|
|
85
|
+
usage?: { input: number; output: number; cacheRead?: number; cacheWrite?: number };
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export interface GraderOutcomeRecord { name: string; pass: boolean; detail: string }
|
|
89
|
+
|
|
90
|
+
export interface TrajectoryResultLine {
|
|
91
|
+
kind: "result";
|
|
92
|
+
schemaVersion: number;
|
|
93
|
+
runId: string;
|
|
94
|
+
outcome: "pass" | "fail" | "error" | "timeout";
|
|
95
|
+
durationMs: number;
|
|
96
|
+
toolCallCount: number;
|
|
97
|
+
usage?: { input: number; output: number; cacheRead?: number; cacheWrite?: number };
|
|
98
|
+
costUsd?: number;
|
|
99
|
+
failure?: { taxonomy: FailureTaxonomy; detail: string };
|
|
100
|
+
graderSpecs?: unknown[];
|
|
101
|
+
graderResults?: GraderOutcomeRecord[];
|
|
102
|
+
evidence: { finalText?: string; toolCalls?: { tool: string; args: unknown }[]; notes?: string[] };
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export type TrajectoryLine = TrajectoryHeaderLine | TrajectoryStepLine | TrajectoryResultLine;
|
|
106
|
+
|
|
107
|
+
// ---------- path portability + stable hashing ----------
|
|
108
|
+
|
|
109
|
+
export const WORKSPACE_TOKEN = "<workspace>";
|
|
110
|
+
|
|
111
|
+
/** Deep-walk a JSON value and replace the workspace's absolute path (both slash styles) inside
|
|
112
|
+
* string values with the "<workspace>" token — the recorded file becomes machine-independent. */
|
|
113
|
+
export function portablize<T>(value: T, workspace: string): T {
|
|
114
|
+
const win = workspace;
|
|
115
|
+
const fwd = workspace.replace(/\\/g, "/");
|
|
116
|
+
const swap = (s: string): string => {
|
|
117
|
+
let out = s.split(win).join(WORKSPACE_TOKEN);
|
|
118
|
+
if (fwd !== win) out = out.split(fwd).join(WORKSPACE_TOKEN);
|
|
119
|
+
return out;
|
|
120
|
+
};
|
|
121
|
+
const walk = (v: unknown, seen: Set<object>): unknown => {
|
|
122
|
+
if (typeof v === "string") return swap(v);
|
|
123
|
+
if (v === null || typeof v !== "object") return v;
|
|
124
|
+
const o = v as object;
|
|
125
|
+
if (seen.has(o)) return "[circular]";
|
|
126
|
+
seen.add(o);
|
|
127
|
+
try {
|
|
128
|
+
if (Array.isArray(o)) return o.map((x) => walk(x, seen));
|
|
129
|
+
const rec = o as Record<string, unknown>;
|
|
130
|
+
const out: Record<string, unknown> = {};
|
|
131
|
+
for (const [k, x] of Object.entries(rec)) out[k] = walk(x, seen);
|
|
132
|
+
return out;
|
|
133
|
+
} finally {
|
|
134
|
+
seen.delete(o);
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
return walk(value, new Set()) as T;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/** Inverse of portablize: "<workspace>" tokens in a recorded value become real paths again. */
|
|
141
|
+
export function deportablize<T>(value: T, workspace: string): T {
|
|
142
|
+
const walk = (v: unknown, seen: Set<object>): unknown => {
|
|
143
|
+
if (typeof v === "string") return v.split(WORKSPACE_TOKEN).join(workspace);
|
|
144
|
+
if (v === null || typeof v !== "object") return v;
|
|
145
|
+
const o = v as object;
|
|
146
|
+
if (seen.has(o)) return "[circular]";
|
|
147
|
+
seen.add(o);
|
|
148
|
+
try {
|
|
149
|
+
if (Array.isArray(o)) return o.map((x) => walk(x, seen));
|
|
150
|
+
const rec = o as Record<string, unknown>;
|
|
151
|
+
const out: Record<string, unknown> = {};
|
|
152
|
+
for (const [k, x] of Object.entries(rec)) out[k] = walk(x, seen);
|
|
153
|
+
return out;
|
|
154
|
+
} finally {
|
|
155
|
+
seen.delete(o);
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
return walk(value, new Set()) as T;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export function sha256Text(text: string): string {
|
|
162
|
+
return createHash("sha256").update(Buffer.from(text, "utf16le")).digest("hex");
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// ---------- fixture snapshots (the deterministic replay input) ----------
|
|
166
|
+
|
|
167
|
+
const FIXTURE_SKIP = new Set([".git", "node_modules", "dist", "out", ".rovecode", ".cumulus", "__pycache__"]);
|
|
168
|
+
|
|
169
|
+
export function snapshotFixture(workspace: string, opts?: { maxFileBytes?: number }): FixtureSpec {
|
|
170
|
+
const maxFileBytes = opts?.maxFileBytes ?? 256 * 1024;
|
|
171
|
+
const files: Record<string, string> = {};
|
|
172
|
+
const binary: Record<string, string> = {};
|
|
173
|
+
const walk = (dir: string): void => {
|
|
174
|
+
let names: string[];
|
|
175
|
+
try {
|
|
176
|
+
names = readdirSync(dir);
|
|
177
|
+
} catch {
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
for (const name of names) {
|
|
181
|
+
if (FIXTURE_SKIP.has(name)) continue;
|
|
182
|
+
const abs = join(dir, name);
|
|
183
|
+
let st;
|
|
184
|
+
try {
|
|
185
|
+
st = statSync(abs);
|
|
186
|
+
} catch {
|
|
187
|
+
continue;
|
|
188
|
+
}
|
|
189
|
+
if (st.isDirectory()) {
|
|
190
|
+
walk(abs);
|
|
191
|
+
continue;
|
|
192
|
+
}
|
|
193
|
+
if (!st.isFile()) continue;
|
|
194
|
+
const rel = relative(workspace, abs).replace(/\\/g, "/");
|
|
195
|
+
try {
|
|
196
|
+
if (st.size > maxFileBytes) {
|
|
197
|
+
binary[rel] = createHash("sha256").update(readFileSync(abs)).digest("hex");
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
200
|
+
const buf = readFileSync(abs);
|
|
201
|
+
if (buf.subarray(0, 1024).includes(0)) {
|
|
202
|
+
binary[rel] = createHash("sha256").update(buf).digest("hex");
|
|
203
|
+
continue;
|
|
204
|
+
}
|
|
205
|
+
files[rel] = buf.toString("utf8");
|
|
206
|
+
} catch {
|
|
207
|
+
// unreadable file: skip, the fixture is a best-effort snapshot of a test workspace
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
walk(workspace);
|
|
212
|
+
return { files, binary };
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export function materializeFixture(fixture: FixtureSpec, dir: string): void {
|
|
216
|
+
for (const [rel, content] of Object.entries(fixture.files)) {
|
|
217
|
+
const abs = join(dir, ...rel.split("/"));
|
|
218
|
+
mkdirSync(join(abs, ".."), { recursive: true });
|
|
219
|
+
writeFileSync(abs, content, "utf8");
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// ---------- writer ----------
|
|
224
|
+
|
|
225
|
+
/** Evidence outputs are bounded: the full redacted text would bloat JSONL for huge tool
|
|
226
|
+
* results; the sha (unbounded input) is what replay actually compares. */
|
|
227
|
+
const EVIDENCE_OUTPUT_CHARS = 2000;
|
|
228
|
+
|
|
229
|
+
export class TrajectoryWriter {
|
|
230
|
+
readonly path: string;
|
|
231
|
+
private readonly workspace: string;
|
|
232
|
+
|
|
233
|
+
constructor(dir: string, runId: string, workspace: string) {
|
|
234
|
+
mkdirSync(dir, { recursive: true });
|
|
235
|
+
this.path = join(dir, `${runId}.trajectory.jsonl`);
|
|
236
|
+
this.workspace = workspace;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
private write(line: TrajectoryLine): void {
|
|
240
|
+
appendFileSync(this.path, JSON.stringify(line) + "\n", "utf8");
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
writeHeader(header: TrajectoryHeaderLine): void {
|
|
244
|
+
const fixture = {
|
|
245
|
+
files: redactDeep(portablize(header.fixture.files, this.workspace)) as Record<string, string>,
|
|
246
|
+
binary: header.fixture.binary,
|
|
247
|
+
};
|
|
248
|
+
this.write({ ...header, task: redactDeep(header.task), fixture, permissionRules: header.permissionRules });
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
writeStep(step: TrajectoryStepLine): void {
|
|
252
|
+
const s: TrajectoryStepLine = { ...step };
|
|
253
|
+
if (s.text !== undefined) s.text = redactSafe(portablize(s.text, this.workspace));
|
|
254
|
+
if (s.toolCalls !== undefined) s.toolCalls = redactDeep(portablize(s.toolCalls, this.workspace)) as RecordedToolCall[];
|
|
255
|
+
if (s.results !== undefined) {
|
|
256
|
+
s.results = (portablize(s.results, this.workspace) as RecordedToolResult[]).map((r) => ({
|
|
257
|
+
...r,
|
|
258
|
+
output: redactSafe(r.output).slice(0, EVIDENCE_OUTPUT_CHARS),
|
|
259
|
+
}));
|
|
260
|
+
}
|
|
261
|
+
this.write(s);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
writeResult(result: TrajectoryResultLine): void {
|
|
265
|
+
const evidence = redactDeep(portablize(result.evidence, this.workspace)) as TrajectoryResultLine["evidence"];
|
|
266
|
+
if (evidence.finalText !== undefined) evidence.finalText = evidence.finalText.slice(0, EVIDENCE_OUTPUT_CHARS);
|
|
267
|
+
const graderSpecs = result.graderSpecs !== undefined
|
|
268
|
+
? (redactDeep(portablize(result.graderSpecs, this.workspace)) as unknown[])
|
|
269
|
+
: undefined;
|
|
270
|
+
this.write({ ...result, graderSpecs, evidence });
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/** String convenience for redactDeep — redacts every pattern hit in one string. */
|
|
275
|
+
export function redactSafe(s: string): string {
|
|
276
|
+
return redactDeep(s) as unknown as string;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// ---------- reader ----------
|
|
280
|
+
|
|
281
|
+
export type EvalTrajectoryErrorKind = "missing-file" | "unsupported-version" | "missing-header" | "malformed-line";
|
|
282
|
+
|
|
283
|
+
export class EvalTrajectoryError extends Error {
|
|
284
|
+
readonly kind: EvalTrajectoryErrorKind;
|
|
285
|
+
readonly line?: number;
|
|
286
|
+
|
|
287
|
+
constructor(kind: EvalTrajectoryErrorKind, message: string, line?: number) {
|
|
288
|
+
super(line === undefined ? message : `${message} (line ${line})`);
|
|
289
|
+
this.name = "EvalTrajectoryError";
|
|
290
|
+
this.kind = kind;
|
|
291
|
+
this.line = line;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
export interface Trajectory {
|
|
296
|
+
header: TrajectoryHeaderLine;
|
|
297
|
+
steps: TrajectoryStepLine[];
|
|
298
|
+
result: TrajectoryResultLine | null;
|
|
299
|
+
/** foreign line kinds (a newer writer) — tolerated and counted, never fatal */
|
|
300
|
+
unknown: number;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
export function readTrajectory(path: string): Trajectory {
|
|
304
|
+
let raw: string;
|
|
305
|
+
try {
|
|
306
|
+
raw = readFileSync(path, "utf8");
|
|
307
|
+
} catch {
|
|
308
|
+
throw new EvalTrajectoryError("missing-file", `trajectory file not readable: ${path}`);
|
|
309
|
+
}
|
|
310
|
+
const lines = raw.split("\n");
|
|
311
|
+
let header: TrajectoryHeaderLine | null = null;
|
|
312
|
+
const steps: TrajectoryStepLine[] = [];
|
|
313
|
+
let result: TrajectoryResultLine | null = null;
|
|
314
|
+
let unknown = 0;
|
|
315
|
+
for (let i = 0; i < lines.length; i++) {
|
|
316
|
+
const text = lines[i]!.trim();
|
|
317
|
+
if (text === "") continue;
|
|
318
|
+
let parsed: unknown;
|
|
319
|
+
try {
|
|
320
|
+
parsed = JSON.parse(text);
|
|
321
|
+
} catch {
|
|
322
|
+
throw new EvalTrajectoryError("malformed-line", "trajectory line is not valid JSON", i + 1);
|
|
323
|
+
}
|
|
324
|
+
if (!parsed || typeof parsed !== "object" || !("kind" in parsed)) {
|
|
325
|
+
unknown++;
|
|
326
|
+
continue;
|
|
327
|
+
}
|
|
328
|
+
const kind = (parsed as { kind: unknown }).kind;
|
|
329
|
+
if (kind === "header") {
|
|
330
|
+
header = parsed as TrajectoryHeaderLine;
|
|
331
|
+
continue;
|
|
332
|
+
}
|
|
333
|
+
if (kind === "step") {
|
|
334
|
+
steps.push(parsed as TrajectoryStepLine);
|
|
335
|
+
continue;
|
|
336
|
+
}
|
|
337
|
+
if (kind === "result") {
|
|
338
|
+
result = parsed as TrajectoryResultLine;
|
|
339
|
+
continue;
|
|
340
|
+
}
|
|
341
|
+
unknown++;
|
|
342
|
+
}
|
|
343
|
+
if (header === null) throw new EvalTrajectoryError("missing-header", "trajectory has no header line");
|
|
344
|
+
if (!SUPPORTED_TRAJECTORY_VERSIONS.includes(header.schemaVersion)) {
|
|
345
|
+
throw new EvalTrajectoryError(
|
|
346
|
+
"unsupported-version",
|
|
347
|
+
`trajectory schemaVersion ${header.schemaVersion} not supported (supported: ${SUPPORTED_TRAJECTORY_VERSIONS.join(", ")})`,
|
|
348
|
+
);
|
|
349
|
+
}
|
|
350
|
+
steps.sort((a, b) => a.seq - b.seq);
|
|
351
|
+
return { header, steps, result, unknown };
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
// ---------- run identity helpers ----------
|
|
355
|
+
|
|
356
|
+
/** Best-effort HEAD commit for the header; null when git is absent (never throws). */
|
|
357
|
+
export function gitCommit(): string | null {
|
|
358
|
+
try {
|
|
359
|
+
const proc = Bun.spawnSync(["git", "rev-parse", "HEAD"], { stdout: "pipe", stderr: "pipe" });
|
|
360
|
+
if (proc.exitCode !== 0) return null;
|
|
361
|
+
const out = proc.stdout.toString().trim();
|
|
362
|
+
return /^[0-9a-f]{7,40}$/.test(out) ? out : null;
|
|
363
|
+
} catch {
|
|
364
|
+
return null;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
/** Filesystem-safe run id with the task prefix and a time+random suffix. */
|
|
369
|
+
export function makeRunId(taskId: string): string {
|
|
370
|
+
const safe = taskId.toLowerCase().replace(/[^a-z0-9_-]+/g, "-");
|
|
371
|
+
const t = Date.now().toString(36);
|
|
372
|
+
return `${safe}-${t}-${randomUUID().slice(0, 4)}`;
|
|
373
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Rovecode public API surface. */
|
|
2
|
+
|
|
3
|
+
export * from "./core/types.ts";
|
|
4
|
+
export { agentLoop, SteeringQueue, extractToolCalls, partsText } from "./core/loop.ts";
|
|
5
|
+
export { ToolRegistry, evaluatePermissions } from "./core/tools.ts";
|
|
6
|
+
export type { ExtensionHooks } from "./core/tools.ts";
|
|
7
|
+
export { SessionStore, chainHash } from "./core/session.ts";
|
|
8
|
+
export type { Entry, Corruption, CorruptionKind, SessionMeta } from "./core/session.ts";
|
|
9
|
+
export { assembleContext, planCompaction, estimateTokens } from "./core/context.ts";
|
|
10
|
+
export { preflightSpawn, runChild, createIsolation, DEFAULT_MAX_DEPTH } from "./core/orchestrator.ts";
|
|
11
|
+
export type { SpawnContext, ChildRunnerDeps, IsolationWorkspace } from "./core/orchestrator.ts";
|
|
12
|
+
export { mockStream, openaiCompatStream, textTurn, toolTurn } from "./providers/stream.ts";
|
|
13
|
+
export type { MockScript } from "./providers/stream.ts";
|
|
14
|
+
export { lineHash, fileTag, readAnchored, renderAnchored, applyEdits, readTool, editTool, writeTool, bashTool } from "./coding/hashline.ts";
|
|
15
|
+
export type { AnchoredFile, EditOp, EditFailure, EditResult } from "./coding/hashline.ts";
|
|
16
|
+
export { MemoryStore, defaultLimits } from "./memory/store.ts";
|
|
17
|
+
export type { MemoryRecord, MemoryKind, MemoryLimits } from "./memory/store.ts";
|