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,266 @@
|
|
|
1
|
+
/** Workflow engine (F3, docs/design/sdk-blueprint.md §4).
|
|
2
|
+
*
|
|
3
|
+
* A workflow is a DAG of steps over the ONE agent loop: an agent step runs through the
|
|
4
|
+
* runtime's TaskManager (ADR-003/ADR-013 hold — the engine schedules, it never loops), so
|
|
5
|
+
* every step is visible on the Mission Control agent tree for free. A gate step pauses for
|
|
6
|
+
* a human answer through the injected askGate.
|
|
7
|
+
*
|
|
8
|
+
* Durability is "crash-safe, DB'siz": every step transition is appended to
|
|
9
|
+
* .rovecode/workflows/<runId>.jsonl; resumeWorkflow(runId) reads it and skips finished
|
|
10
|
+
* steps. Cancellation: the deps signal stops scheduling and cancels running steps; finished
|
|
11
|
+
* steps stay finished — a resumed run picks up exactly where the killed one left off. */
|
|
12
|
+
|
|
13
|
+
import { appendFileSync, existsSync, mkdirSync, readFileSync, readdirSync } from "node:fs";
|
|
14
|
+
import { join } from "node:path";import type { TokenUsage } from "../core/types.ts";
|
|
15
|
+
|
|
16
|
+
// ---------- spec ----------
|
|
17
|
+
|
|
18
|
+
export interface AgentStep {
|
|
19
|
+
kind: "agent";
|
|
20
|
+
/** TaskManager agent id; default "main" */
|
|
21
|
+
agent?: string;
|
|
22
|
+
goal: string;
|
|
23
|
+
after?: string[];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface GateStep {
|
|
27
|
+
kind: "gate";
|
|
28
|
+
prompt: string;
|
|
29
|
+
after?: string[];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type WorkflowStep = AgentStep | GateStep;
|
|
33
|
+
|
|
34
|
+
export interface WorkflowSpec {
|
|
35
|
+
name: string;
|
|
36
|
+
steps: Record<string, WorkflowStep>;
|
|
37
|
+
/** per-step retry; default 1 attempt total (no retry) */
|
|
38
|
+
retry?: { maxAttempts?: number };
|
|
39
|
+
/** run-level ceiling; a run that crosses it stops scheduling and ends "budget" */
|
|
40
|
+
budget?: { maxTokens?: number };
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Identity + validation. A bad spec fails HERE, at definition time, not mid-run. */
|
|
44
|
+
export function defineWorkflow(spec: WorkflowSpec): WorkflowSpec {
|
|
45
|
+
if (!spec.name || typeof spec.name !== "string") throw new Error("workflow needs a name");
|
|
46
|
+
const names = Object.keys(spec.steps ?? {});
|
|
47
|
+
if (names.length === 0) throw new Error("workflow needs at least one step");
|
|
48
|
+
for (const [name, step] of Object.entries(spec.steps)) {
|
|
49
|
+
if (step.kind !== "agent" && step.kind !== "gate") throw new Error(`step '${name}': kind must be "agent" | "gate"`);
|
|
50
|
+
if (step.kind === "agent" && (typeof step.goal !== "string" || step.goal.trim() === "")) throw new Error(`step '${name}': agent step needs a goal`);
|
|
51
|
+
for (const dep of step.after ?? []) {
|
|
52
|
+
if (!(dep in spec.steps)) throw new Error(`step '${name}': unknown dependency '${dep}'`);
|
|
53
|
+
if (dep === name) throw new Error(`step '${name}': cannot depend on itself`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
// cycle check, iterative DFS over `after` edges
|
|
57
|
+
const color = new Map<string, 0 | 1 | 2>(); // 0 white, 1 grey, 2 black
|
|
58
|
+
const visit = (n: string, stack: string[]): void => {
|
|
59
|
+
const c = color.get(n) ?? 0;
|
|
60
|
+
if (c === 2) return;
|
|
61
|
+
if (c === 1) throw new Error(`workflow has a cycle: ${[...stack, n].join(" → ")}`);
|
|
62
|
+
color.set(n, 1);
|
|
63
|
+
for (const d of spec.steps[n]!.after ?? []) visit(d, [...stack, n]);
|
|
64
|
+
color.set(n, 2);
|
|
65
|
+
};
|
|
66
|
+
for (const n of names) visit(n, []);
|
|
67
|
+
return spec;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// ---------- events / results ----------
|
|
71
|
+
|
|
72
|
+
export type WorkflowEvent =
|
|
73
|
+
| { type: "workflow_started"; runId: string; name: string; steps: number }
|
|
74
|
+
| { type: "step_started"; runId: string; step: string; attempt: number }
|
|
75
|
+
| { type: "step_done"; runId: string; step: string; summary: string }
|
|
76
|
+
| { type: "step_failed"; runId: string; step: string; error: string; attempt: number }
|
|
77
|
+
| { type: "gate_waiting"; runId: string; step: string; prompt: string }
|
|
78
|
+
| { type: "workflow_done"; runId: string; status: WorkflowStatus };
|
|
79
|
+
|
|
80
|
+
export type WorkflowStatus = "done" | "failed" | "cancelled" | "budget";
|
|
81
|
+
|
|
82
|
+
export interface StepOutcome { status: "done" | "failed" | "skipped"; summary?: string; error?: string; attempts: number }
|
|
83
|
+
|
|
84
|
+
export interface WorkflowResult {
|
|
85
|
+
runId: string;
|
|
86
|
+
status: WorkflowStatus;
|
|
87
|
+
steps: Record<string, StepOutcome>;
|
|
88
|
+
usage: { input: number; output: number };
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// ---------- executor seam ----------
|
|
92
|
+
|
|
93
|
+
export interface WorkflowExecutor {
|
|
94
|
+
/** run one agent step to completion; the TaskManager adapter doubles as the
|
|
95
|
+
* Mission Control feed (the step appears in the agent tree while it runs) */
|
|
96
|
+
runAgent(step: AgentStep & { name: string }): Promise<{ ok: boolean; summary: string; usage?: TokenUsage }>;
|
|
97
|
+
/** a gate's question; false = rejected, the workflow fails that step */
|
|
98
|
+
askGate(prompt: string): Promise<boolean>;
|
|
99
|
+
/** cancel a running step (engine shutdown) */
|
|
100
|
+
cancelAgent?(name: string): void;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export interface RunWorkflowOptions {
|
|
104
|
+
runId?: string;
|
|
105
|
+
signal?: AbortSignal;
|
|
106
|
+
maxConcurrency?: number;
|
|
107
|
+
/** checkpoint file; default <cwd>/.rovecode/workflows/<runId>.jsonl */
|
|
108
|
+
dir?: string;
|
|
109
|
+
emit?: (e: WorkflowEvent) => void;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// ---------- checkpoint ----------
|
|
113
|
+
|
|
114
|
+
interface CkLine { v: 1; type: "step"; step: string; status: "done" | "failed"; summary?: string; error?: string }
|
|
115
|
+
|
|
116
|
+
function checkpointPath(dir: string, runId: string): string { return join(dir, `${runId}.jsonl`); }
|
|
117
|
+
|
|
118
|
+
/** step names the checkpoint records as done — resume skips exactly these */
|
|
119
|
+
export function readCheckpoint(path: string): Map<string, string> {
|
|
120
|
+
const done = new Map<string, string>();
|
|
121
|
+
if (!existsSync(path)) return done;
|
|
122
|
+
for (const line of readFileSync(path, "utf8").split("\n")) {
|
|
123
|
+
if (line.trim() === "") continue;
|
|
124
|
+
try {
|
|
125
|
+
const l = JSON.parse(line) as CkLine;
|
|
126
|
+
if (l.type === "step" && l.status === "done") done.set(l.step, l.summary ?? "");
|
|
127
|
+
} catch { /* a torn tail line (killed mid-append) is ignored, never fatal */ }
|
|
128
|
+
}
|
|
129
|
+
return done;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// ---------- engine ----------
|
|
133
|
+
|
|
134
|
+
export async function runWorkflow(spec: WorkflowSpec, exec: WorkflowExecutor, opts: RunWorkflowOptions = {}): Promise<WorkflowResult> {
|
|
135
|
+
defineWorkflow(spec); // a hand-built spec gets the same validation
|
|
136
|
+
const runId = opts.runId ?? `wf-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 6)}`;
|
|
137
|
+
const dir = opts.dir ?? join(process.cwd(), ".rovecode", "workflows");
|
|
138
|
+
mkdirSync(dir, { recursive: true });
|
|
139
|
+
const ckPath = checkpointPath(dir, runId);
|
|
140
|
+
const resumed = readCheckpoint(ckPath);
|
|
141
|
+
const emit = (e: WorkflowEvent): void => { opts.emit?.(e); };
|
|
142
|
+
const maxConc = Math.max(1, opts.maxConcurrency ?? 3);
|
|
143
|
+
const maxAttempts = Math.max(1, spec.retry?.maxAttempts ?? 1);
|
|
144
|
+
const maxTokens = spec.budget?.maxTokens;
|
|
145
|
+
|
|
146
|
+
const steps = new Map(Object.entries(spec.steps));
|
|
147
|
+
const outcomes: Record<string, StepOutcome> = {};
|
|
148
|
+
const done = new Set<string>();
|
|
149
|
+
const failed = new Set<string>();
|
|
150
|
+
const running = new Set<string>();
|
|
151
|
+
const usage = { input: 0, output: 0 };
|
|
152
|
+
let spent = 0;
|
|
153
|
+
|
|
154
|
+
for (const [name, summary] of resumed) {
|
|
155
|
+
done.add(name);
|
|
156
|
+
outcomes[name] = { status: "done", summary, attempts: 0 };
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
emit({ type: "workflow_started", runId, name: spec.name, steps: steps.size });
|
|
160
|
+
|
|
161
|
+
const depsDone = (s: WorkflowStep): boolean => (s.after ?? []).every((d) => done.has(d));
|
|
162
|
+
const depsFailed = (s: WorkflowStep): boolean => (s.after ?? []).some((d) => failed.has(d));
|
|
163
|
+
|
|
164
|
+
const record = (l: CkLine): void => {
|
|
165
|
+
try { appendFileSync(ckPath, JSON.stringify(l) + "\n"); } catch { /* checkpoint is best-effort; the run continues */ }
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
const runStep = async (name: string, step: WorkflowStep): Promise<void> => {
|
|
169
|
+
running.add(name);
|
|
170
|
+
try {
|
|
171
|
+
if (step.kind === "gate") {
|
|
172
|
+
emit({ type: "gate_waiting", runId, step: name, prompt: step.prompt });
|
|
173
|
+
const yes = opts.signal?.aborted ? false : await exec.askGate(step.prompt);
|
|
174
|
+
if (yes) {
|
|
175
|
+
done.add(name); outcomes[name] = { status: "done", summary: "approved", attempts: 1 };
|
|
176
|
+
record({ v: 1, type: "step", step: name, status: "done", summary: "approved" });
|
|
177
|
+
emit({ type: "step_done", runId, step: name, summary: "approved" });
|
|
178
|
+
} else {
|
|
179
|
+
failed.add(name); outcomes[name] = { status: "failed", error: "gate rejected", attempts: 1 };
|
|
180
|
+
emit({ type: "step_failed", runId, step: name, error: "gate rejected", attempt: 1 });
|
|
181
|
+
}
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
let attempt = 0;
|
|
185
|
+
let lastErr = "unknown";
|
|
186
|
+
while (attempt < maxAttempts) {
|
|
187
|
+
attempt++;
|
|
188
|
+
if (opts.signal?.aborted) { exec.cancelAgent?.(name); failed.add(name); outcomes[name] = { status: "failed", error: "cancelled", attempts: attempt }; return; }
|
|
189
|
+
emit({ type: "step_started", runId, step: name, attempt });
|
|
190
|
+
const r = await exec.runAgent({ ...step, name });
|
|
191
|
+
if (r.usage) { usage.input += r.usage.input; usage.output += r.usage.output; spent += r.usage.input + r.usage.output; }
|
|
192
|
+
if (r.ok) {
|
|
193
|
+
done.add(name); outcomes[name] = { status: "done", summary: r.summary, attempts: attempt };
|
|
194
|
+
record({ v: 1, type: "step", step: name, status: "done", summary: r.summary });
|
|
195
|
+
emit({ type: "step_done", runId, step: name, summary: r.summary });
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
lastErr = r.summary;
|
|
199
|
+
emit({ type: "step_failed", runId, step: name, error: r.summary, attempt });
|
|
200
|
+
}
|
|
201
|
+
failed.add(name); outcomes[name] = { status: "failed", error: lastErr, attempts: attempt };
|
|
202
|
+
record({ v: 1, type: "step", step: name, status: "failed", error: lastErr });
|
|
203
|
+
} finally {
|
|
204
|
+
running.delete(name);
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
// scheduler loop: launch every dep-satisfied step up to the concurrency bound,
|
|
209
|
+
// until nothing can start and nothing runs
|
|
210
|
+
const inFlight = new Set<Promise<void>>();
|
|
211
|
+
let status: WorkflowStatus = "done";
|
|
212
|
+
for (;;) {
|
|
213
|
+
if (opts.signal?.aborted) status = "cancelled";
|
|
214
|
+
if (maxTokens !== undefined && spent >= maxTokens) status = "budget";
|
|
215
|
+
const terminal = status !== "done";
|
|
216
|
+
let launched = false;
|
|
217
|
+
if (!terminal && failed.size === 0) {
|
|
218
|
+
for (const [name, step] of steps) {
|
|
219
|
+
if (done.has(name) || failed.has(name) || running.has(name) || outcomes[name] !== undefined) continue;
|
|
220
|
+
if (!depsDone(step)) continue;
|
|
221
|
+
if (running.size >= maxConc) break;
|
|
222
|
+
const p = runStep(name, step);
|
|
223
|
+
inFlight.add(p);
|
|
224
|
+
void p.finally(() => inFlight.delete(p));
|
|
225
|
+
launched = true;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
if (failed.size > 0) {
|
|
229
|
+
// fail-fast: mark never-launched dependents skipped, let in-flight finish
|
|
230
|
+
for (const [name, step] of steps) {
|
|
231
|
+
if (outcomes[name] === undefined && !running.has(name) && (depsFailed(step) || !depsDone(step))) {
|
|
232
|
+
if ((step.after ?? []).length > 0) { outcomes[name] = { status: "skipped", error: "upstream failed", attempts: 0 }; }
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
if (inFlight.size === 0) {
|
|
237
|
+
if (!launched) break;
|
|
238
|
+
} else {
|
|
239
|
+
await Promise.race(inFlight);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
for (const [name] of steps) {
|
|
244
|
+
if (outcomes[name] === undefined) outcomes[name] = { status: "skipped", error: status === "done" ? "dependency failed" : status, attempts: 0 };
|
|
245
|
+
}
|
|
246
|
+
if (failed.size > 0 && status === "done") status = "failed";
|
|
247
|
+
emit({ type: "workflow_done", runId, status });
|
|
248
|
+
return { runId, status, steps: outcomes, usage };
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/** Resume: point at the same dir/runId — checkpointed steps are skipped, the rest run. */
|
|
252
|
+
export async function resumeWorkflow(runId: string, spec: WorkflowSpec, exec: WorkflowExecutor, opts: Omit<RunWorkflowOptions, "runId"> = {}): Promise<WorkflowResult> {
|
|
253
|
+
return runWorkflow(spec, exec, { ...opts, runId });
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/** Known workflow runs in a dir (for `rovecode workflow list`): each checkpoint file
|
|
257
|
+
* with the steps it records as done. A torn tail line is ignored (readCheckpoint). */
|
|
258
|
+
export function listWorkflowRuns(dir: string): { runId: string; done: string[] }[] {
|
|
259
|
+
if (!existsSync(dir)) return [];
|
|
260
|
+
let files: string[] = [];
|
|
261
|
+
try { files = readdirSync(dir); } catch { return []; }
|
|
262
|
+
return files
|
|
263
|
+
.filter((f) => f.endsWith(".jsonl"))
|
|
264
|
+
.map((f) => ({ runId: f.slice(0, -".jsonl".length), done: [...readCheckpoint(join(dir, f)).keys()] }))
|
|
265
|
+
.sort((a, b) => a.runId.localeCompare(b.runId));
|
|
266
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
// ES2024: vendored pi-tui uses /v regex flags (vendor/pi-tui/src/utils.ts:40-48)
|
|
4
|
+
"target": "ES2024",
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"moduleResolution": "bundler",
|
|
7
|
+
// package.json import in src/cli/main.ts (--version, port #36)
|
|
8
|
+
"resolveJsonModule": true,
|
|
9
|
+
"strict": true,
|
|
10
|
+
"noUncheckedIndexedAccess": true,
|
|
11
|
+
"noImplicitOverride": true,
|
|
12
|
+
"skipLibCheck": true,
|
|
13
|
+
"types": ["bun-types"],
|
|
14
|
+
"allowImportingTsExtensions": true,
|
|
15
|
+
// compiler-setting parity with upstream pi-tui (their tsconfig.base.json) for
|
|
16
|
+
// the vendored source. Typecheck-only: Bun's runtime transpiler does NOT read
|
|
17
|
+
// this flag (bun 1.3.14 — output is byte-identical with it flipped or this
|
|
18
|
+
// file absent), and tsc passes either way today. tsconfig ships in files[]
|
|
19
|
+
// so the installed source stays typecheckable in place (`bun x tsc --noEmit`).
|
|
20
|
+
"useDefineForClassFields": false,
|
|
21
|
+
"noEmit": true
|
|
22
|
+
},
|
|
23
|
+
"include": ["src", "test", "scripts"],
|
|
24
|
+
// test/fixtures/design-site is INPUT to design_audit, not project code: a synthetic Next.js app-router
|
|
25
|
+
// tree whose .tsx files exist to be read as text (the audit matches route files by path, so they have to
|
|
26
|
+
// keep their real names). They are never imported and never run, and compiling them would only demand a
|
|
27
|
+
// React/JSX setup for files nothing renders. Every other fixture stays in: fixtures/images.ts and
|
|
28
|
+
// fixtures/fake-lsp.ts are real modules that tests import.
|
|
29
|
+
"exclude": ["test/fixtures/design-site"]
|
|
30
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Mario Zechner
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Local patches to vendored pi-tui
|
|
2
|
+
|
|
3
|
+
Every deviation from upstream `853a80d2` is listed here with a reason. Keep this list short;
|
|
4
|
+
prefer adapting on the rovecode side of the seam (src/tui/) over patching vendor code.
|
|
5
|
+
|
|
6
|
+
1. **All `src/**/*.ts`: prepended one `// @ts-nocheck` header line** (2026-09-01, port #1).
|
|
7
|
+
Reason: rovecode's house tsconfig enables `noUncheckedIndexedAccess`, which upstream does not
|
|
8
|
+
compile under; per-file compiler flags don't exist in tsc. The header mutes diagnostics
|
|
9
|
+
for vendor internals only — exported types still flow fully typed across the seam to
|
|
10
|
+
`rovecode/src/tui/*`. Vendor internals remain checked upstream at the pinned SHA. Mechanical,
|
|
11
|
+
reversible: re-vendor = re-run the header loop (see git history of this port).
|
|
12
|
+
No other source lines were modified.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Vendored: @earendil-works/pi-tui
|
|
2
|
+
|
|
3
|
+
- Upstream: https://github.com/earendil-works/pi (packages/tui)
|
|
4
|
+
- Version: 0.84.4 · License: MIT © 2025 Mario Zechner (see ./LICENSE)
|
|
5
|
+
- Vendored from local snapshot `research/source_snapshots/earendil-works-pi`
|
|
6
|
+
at commit `853a80d26c90a14c1886f0ebb8ffaae133ca2185` on 2026-09-01 (rovecode port #1).
|
|
7
|
+
- Contents: `src/` (unmodified except patches logged in ./PATCHES.md),
|
|
8
|
+
`native/win32/prebuilds/` (optional modifier-key addon; absence degrades gracefully,
|
|
9
|
+
see src/native-modifiers.ts), upstream README as README.upstream.md.
|
|
10
|
+
- House rule: only `rovecode/src/tui/*` may import from this tree. Vendored files are exempt
|
|
11
|
+
from the ≤400-line module budget (ADR-002 applies to house code).
|
|
12
|
+
- To update: re-snapshot upstream, diff against this tree, reapply PATCHES.md.
|