savant-code 0.0.16 → 0.0.19
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/.agents/skills/coding-csharp/SKILL.md +82 -0
- package/.agents/skills/coding-go/SKILL.md +76 -0
- package/.agents/skills/coding-java/SKILL.md +79 -0
- package/.agents/skills/coding-python/SKILL.md +87 -0
- package/.agents/skills/coding-rust/SKILL.md +83 -0
- package/.agents/skills/coding-typescript/SKILL.md +90 -0
- package/.agents/skills/release-workflow/SKILL.md +69 -0
- package/.bun-version +1 -0
- package/.commandcode/settings.json +11 -0
- package/.commandcode/taste/workflow/taste.md +6 -0
- package/.env.example +95 -0
- package/.gitattributes +43 -0
- package/.githooks/pre-push +35 -0
- package/.github/workflows/build-release-binaries.yml +163 -0
- package/.markdownlint.json +42 -0
- package/.markdownlintignore +21 -0
- package/.prettierignore +9 -0
- package/.prettierrc +23 -0
- package/.savantignore +3 -0
- package/AGENTS.md +97 -0
- package/ARCHITECTURE.md +241 -0
- package/CHANGELOG.md +2631 -0
- package/CONTRIBUTING.md +88 -0
- package/ECHO-freebuff.md +22 -0
- package/ECHO.md +722 -0
- package/FREEREADME.md +35 -0
- package/LEARNINGS.md +345 -0
- package/NOTICE +15 -0
- package/README.md +550 -216
- package/README.zh-CN.md +479 -0
- package/SECURITY.md +8 -0
- package/VERSION +1 -0
- package/WINDOWS.md +238 -0
- package/agents/README.md +41 -0
- package/agents/base-chat.ts +44 -0
- package/agents/basher.ts +107 -0
- package/agents/browser-use/browser-use.test.ts +211 -0
- package/agents/browser-use/browser-use.ts +259 -0
- package/agents/constants.ts +1 -0
- package/agents/context-pruner.ts +1076 -0
- package/agents/detective/detective.ts +168 -0
- package/agents/editor/best-of-n/best-of-n-selector2.ts +148 -0
- package/agents/editor/best-of-n/editor-implementor-gpt-5.ts +7 -0
- package/agents/editor/best-of-n/editor-implementor-opus.ts +7 -0
- package/agents/editor/best-of-n/editor-implementor.ts +196 -0
- package/agents/editor/best-of-n/editor-multi-prompt.ts +265 -0
- package/agents/file-explorer/directory-lister.ts +92 -0
- package/agents/file-explorer/glob-matcher.ts +96 -0
- package/agents/forge/forge.ts +146 -0
- package/agents/librarian/librarian.test.ts +289 -0
- package/agents/librarian/librarian.ts +158 -0
- package/agents/package.json +11 -0
- package/agents/recorder/recorder.ts +104 -0
- package/agents/researcher/researcher-docs.ts +32 -0
- package/agents/researcher/researcher-web.ts +40 -0
- package/agents/savant/savant-analyze.ts +11 -0
- package/agents/savant/savant-free-deepseek-flash.ts +13 -0
- package/agents/savant/savant-free-deepseek.ts +13 -0
- package/agents/savant/savant-free-evals.ts +9 -0
- package/agents/savant/savant-free-glm.ts +13 -0
- package/agents/savant/savant-free-kimi.ts +13 -0
- package/agents/savant/savant-free-mimo-pro.ts +13 -0
- package/agents/savant/savant-free-mimo.ts +13 -0
- package/agents/savant/savant-free-minimax-m3.ts +13 -0
- package/agents/savant/savant-free.ts +9 -0
- package/agents/savant/savant-scaffold.ts +15 -0
- package/agents/savant/savant.ts +706 -0
- package/agents/scout/scout.ts +305 -0
- package/agents/scribe/scribe.ts +54 -0
- package/agents/thinker/thinker-gemini.ts +26 -0
- package/agents/thinker/thinker-gpt.ts +21 -0
- package/agents/thinker/thinker-with-files-gemini.ts +66 -0
- package/agents/thinker/thinker.ts +99 -0
- package/agents/tmux-cli.ts +724 -0
- package/agents/tsconfig.json +12 -0
- package/agents/types/agent-definition.ts +1 -0
- package/agents/types/secret-agent-definition.ts +103 -0
- package/agents/types/tools.ts +465 -0
- package/agents/types/util-types.ts +167 -0
- package/agents/verifier/verifier.ts +80 -0
- package/art/savant-redesign.md +7 -0
- package/art/savant-text-graf.md +5 -0
- package/art/savant_ascii.md +88 -0
- package/assets/banner.png +0 -0
- package/bun.lock +1979 -0
- package/bunfig.toml +7 -0
- package/cli/README.md +111 -0
- package/cli/bunfig.toml +2 -0
- package/cli/cli_exit +1 -0
- package/cli/package.json +66 -0
- package/cli/release/README.md +348 -0
- package/{index.js → cli/release/index.js} +0 -0
- package/cli/release/package.json +56 -0
- package/cli/release-core/README.md +20 -0
- package/cli/release-core/package.json +4 -0
- package/cli/release-core/prepare-package.js +31 -0
- package/cli/release-staging/README.md +70 -0
- package/cli/release-staging/index.js +42 -0
- package/cli/release-staging/package.json +43 -0
- package/cli/scripts/build-binary.ts +469 -0
- package/cli/scripts/clean.ts +16 -0
- package/cli/scripts/prebuild-agents.ts +250 -0
- package/cli/scripts/release.ts +103 -0
- package/cli/scripts/smoke-binary.ts +280 -0
- package/cli/scripts/test-sdk-file-hooks.sh +87 -0
- package/cli/scripts/validate-cli-with-tmux.sh +43 -0
- package/cli/src/__tests__/README.md +256 -0
- package/cli/src/__tests__/bash-mode.test.ts +442 -0
- package/cli/src/__tests__/cli-args.test.ts +241 -0
- package/cli/src/__tests__/e2e/first-time-login.test.ts +173 -0
- package/cli/src/__tests__/e2e/logout-relogin-flow.test.ts +110 -0
- package/cli/src/__tests__/e2e/returning-user-auth.test.ts +111 -0
- package/cli/src/__tests__/e2e-cli.test.ts +185 -0
- package/cli/src/__tests__/helpers/mock-api-client.ts +64 -0
- package/cli/src/__tests__/helpers/terminal-watchdog-fixture.ts +50 -0
- package/cli/src/__tests__/home-directory-detection.test.ts +213 -0
- package/cli/src/__tests__/integration/agent-toolnames-validation.test.ts +63 -0
- package/cli/src/__tests__/integration/api-integration.test.ts +289 -0
- package/cli/src/__tests__/integration/credentials-storage.test.ts +453 -0
- package/cli/src/__tests__/integration/local-agents.test.ts +1187 -0
- package/cli/src/__tests__/integration/login-flow-instrumentation.test.ts +146 -0
- package/cli/src/__tests__/integration/login-polling-working.test.ts +287 -0
- package/cli/src/__tests__/integration/usage-refresh-on-completion.test.ts +177 -0
- package/cli/src/__tests__/integration-tmux.test.ts +186 -0
- package/cli/src/__tests__/mocks/hover-toggle-controller.ts +71 -0
- package/cli/src/__tests__/path-completion.test.ts +243 -0
- package/cli/src/__tests__/project-files-chat-id.test.ts +34 -0
- package/cli/src/__tests__/release/proxy-http-get.test.ts +670 -0
- package/cli/src/__tests__/release/wrapper-safety.test.ts +177 -0
- package/cli/src/__tests__/rerender-perf.integration.test.ts +283 -0
- package/cli/src/__tests__/terminal-reset-sequences.test.ts +36 -0
- package/cli/src/__tests__/terminal-watchdog.test.ts +114 -0
- package/cli/src/__tests__/test-utils.ts +266 -0
- package/cli/src/__tests__/tmux-poc.ts +150 -0
- package/cli/src/__tests__/unit/agent-mode-toggle.test.ts +138 -0
- package/cli/src/__tests__/unit/copy-button.test.tsx +188 -0
- package/cli/src/__tests__/unit/create-run-config.test.ts +77 -0
- package/cli/src/__tests__/unit/publish-confirmation.test.ts +70 -0
- package/cli/src/__tests__/unit/segmented-control.test.ts +167 -0
- package/cli/src/__tests__/utils/env.test.ts +210 -0
- package/cli/src/__tests__/utils/project-picker.test.ts +39 -0
- package/cli/src/agents/bundled-agents.generated.d.ts +14 -0
- package/cli/src/agents/bundled-agents.generated.ts +1962 -0
- package/cli/src/app.tsx +383 -0
- package/cli/src/chat.tsx +2008 -0
- package/cli/src/cli-args.ts +183 -0
- package/cli/src/commands/__tests__/bash-command.test.ts +449 -0
- package/cli/src/commands/__tests__/command-args.test.ts +325 -0
- package/cli/src/commands/__tests__/copy-conversation.test.ts +240 -0
- package/cli/src/commands/__tests__/dev-command.test.ts +128 -0
- package/cli/src/commands/__tests__/diagnostics-command.test.ts +35 -0
- package/cli/src/commands/__tests__/image.test.ts +99 -0
- package/cli/src/commands/__tests__/init.test.ts +479 -0
- package/cli/src/commands/__tests__/loop-command.test.ts +89 -0
- package/cli/src/commands/__tests__/new-command-rotates-chat.test.ts +87 -0
- package/cli/src/commands/__tests__/permissions-command.test.ts +93 -0
- package/cli/src/commands/__tests__/process-diagnostics.test.ts +54 -0
- package/cli/src/commands/__tests__/prompt-builders.test.ts +69 -0
- package/cli/src/commands/__tests__/registry-gating.test.ts +125 -0
- package/cli/src/commands/__tests__/rewind-command.test.ts +227 -0
- package/cli/src/commands/__tests__/router-connect-chatgpt.test.ts +72 -0
- package/cli/src/commands/__tests__/router-input.test.ts +302 -0
- package/cli/src/commands/__tests__/router-provider-setup.test.ts +180 -0
- package/cli/src/commands/__tests__/savant-free-command-aliases.test.ts +56 -0
- package/cli/src/commands/ads.ts +45 -0
- package/cli/src/commands/command-registry.ts +1112 -0
- package/cli/src/commands/copy-conversation.ts +386 -0
- package/cli/src/commands/goal.ts +87 -0
- package/cli/src/commands/health-command.ts +61 -0
- package/cli/src/commands/help.ts +13 -0
- package/cli/src/commands/image.ts +20 -0
- package/cli/src/commands/init.ts +121 -0
- package/cli/src/commands/loop.ts +182 -0
- package/cli/src/commands/process-diagnostics.ts +120 -0
- package/cli/src/commands/prompt-builders.ts +140 -0
- package/cli/src/commands/publish.ts +261 -0
- package/cli/src/commands/rewind.ts +130 -0
- package/cli/src/commands/router-utils.ts +80 -0
- package/cli/src/commands/router.ts +589 -0
- package/cli/src/commands/telemetry.ts +68 -0
- package/cli/src/commands/usage.ts +26 -0
- package/cli/src/components/__tests__/ad-banner.test.tsx +84 -0
- package/cli/src/components/__tests__/block-helpers.test.tsx +139 -0
- package/cli/src/components/__tests__/clickable.test.tsx +39 -0
- package/cli/src/components/__tests__/grid-layout.integration.test.tsx +365 -0
- package/cli/src/components/__tests__/grid-layout.test.tsx +1033 -0
- package/cli/src/components/__tests__/markdown-content.test.tsx +163 -0
- package/cli/src/components/__tests__/message-block.completion.test.tsx +104 -0
- package/cli/src/components/__tests__/message-block.streaming.test.tsx +78 -0
- package/cli/src/components/__tests__/message-with-agents.test.tsx +571 -0
- package/cli/src/components/__tests__/multiline-input.test.tsx +1129 -0
- package/cli/src/components/__tests__/selectable-list.test.ts +232 -0
- package/cli/src/components/__tests__/shimmer-text.test.tsx +32 -0
- package/cli/src/components/__tests__/status-indicator.test.tsx +184 -0
- package/cli/src/components/__tests__/user-error-banner.test.tsx +100 -0
- package/cli/src/components/ad-banner.tsx +351 -0
- package/cli/src/components/agent-checklist.tsx +385 -0
- package/cli/src/components/agent-mode-toggle.tsx +294 -0
- package/cli/src/components/ask-user/__tests__/multiple-choice-form.test.ts +432 -0
- package/cli/src/components/ask-user/__tests__/validation.test.ts +213 -0
- package/cli/src/components/ask-user/components/accordion-question.tsx +153 -0
- package/cli/src/components/ask-user/components/custom-answer-input.tsx +66 -0
- package/cli/src/components/ask-user/components/options-list.tsx +139 -0
- package/cli/src/components/ask-user/components/question-header.tsx +80 -0
- package/cli/src/components/ask-user/components/question-option.tsx +94 -0
- package/cli/src/components/ask-user/constants.ts +35 -0
- package/cli/src/components/ask-user/index.tsx +660 -0
- package/cli/src/components/ask-user/utils/validation.ts +85 -0
- package/cli/src/components/attachment-card.tsx +67 -0
- package/cli/src/components/blocks/agent-block-grid.tsx +58 -0
- package/cli/src/components/blocks/agent-branch-item.tsx +230 -0
- package/cli/src/components/blocks/agent-branch-wrapper.tsx +524 -0
- package/cli/src/components/blocks/agent-list-branch.tsx +77 -0
- package/cli/src/components/blocks/ask-user-branch.tsx +98 -0
- package/cli/src/components/blocks/block-helpers.tsx +257 -0
- package/cli/src/components/blocks/blocks-renderer.tsx +296 -0
- package/cli/src/components/blocks/content-with-markdown.tsx +34 -0
- package/cli/src/components/blocks/copy-button.tsx +106 -0
- package/cli/src/components/blocks/copyable-block.tsx +47 -0
- package/cli/src/components/blocks/image-block.tsx +128 -0
- package/cli/src/components/blocks/implementor-row.tsx +453 -0
- package/cli/src/components/blocks/markdown-content.tsx +360 -0
- package/cli/src/components/blocks/markdown-renderables.tsx +347 -0
- package/cli/src/components/blocks/single-block.tsx +210 -0
- package/cli/src/components/blocks/thinking-block.tsx +77 -0
- package/cli/src/components/blocks/tool-block-group.tsx +72 -0
- package/cli/src/components/blocks/tool-branch.tsx +196 -0
- package/cli/src/components/blocks/user-content-copy.tsx +171 -0
- package/cli/src/components/bottom-banner.tsx +145 -0
- package/cli/src/components/build-mode-buttons.tsx +110 -0
- package/cli/src/components/button.tsx +75 -0
- package/cli/src/components/chat-header.tsx +11 -0
- package/cli/src/components/chat-history-screen.tsx +417 -0
- package/cli/src/components/chat-input-bar.tsx +535 -0
- package/cli/src/components/chatgpt-connect-banner.tsx +234 -0
- package/cli/src/components/clickable.tsx +149 -0
- package/cli/src/components/collapse-button.tsx +36 -0
- package/cli/src/components/command-palette.tsx +166 -0
- package/cli/src/components/copy-button.tsx +219 -0
- package/cli/src/components/dialog.tsx +111 -0
- package/cli/src/components/elapsed-timer.tsx +56 -0
- package/cli/src/components/error-boundary.tsx +63 -0
- package/cli/src/components/feedback-container.tsx +206 -0
- package/cli/src/components/feedback-icon-button.tsx +89 -0
- package/cli/src/components/feedback-input-mode.tsx +352 -0
- package/cli/src/components/file-attachment-card.tsx +89 -0
- package/cli/src/components/grid-layout.tsx +83 -0
- package/cli/src/components/help-banner.tsx +136 -0
- package/cli/src/components/highlighted-text.tsx +52 -0
- package/cli/src/components/image-card.tsx +167 -0
- package/cli/src/components/image-thumbnail.tsx +112 -0
- package/cli/src/components/input-cursor.tsx +77 -0
- package/cli/src/components/input-mode-banner.tsx +70 -0
- package/cli/src/components/load-previous-button.tsx +48 -0
- package/cli/src/components/login-modal.tsx +450 -0
- package/cli/src/components/message-block.tsx +337 -0
- package/cli/src/components/message-footer.tsx +269 -0
- package/cli/src/components/message-with-agents.tsx +594 -0
- package/cli/src/components/mode-divider.tsx +43 -0
- package/cli/src/components/model-picker.tsx +371 -0
- package/cli/src/components/multiline-input.tsx +1276 -0
- package/cli/src/components/out-of-credits-banner.tsx +155 -0
- package/cli/src/components/pending-attachments-banner.tsx +125 -0
- package/cli/src/components/pending-bash-message.tsx +57 -0
- package/cli/src/components/progress-bar.tsx +81 -0
- package/cli/src/components/project-picker-screen.tsx +469 -0
- package/cli/src/components/provider-picker.tsx +139 -0
- package/cli/src/components/publish-confirmation.tsx +514 -0
- package/cli/src/components/publish-container.tsx +737 -0
- package/cli/src/components/raised-pill.tsx +89 -0
- package/cli/src/components/renderers/plan-box.tsx +70 -0
- package/cli/src/components/review-screen.tsx +114 -0
- package/cli/src/components/rewind-picker.tsx +276 -0
- package/cli/src/components/right-sidebar.tsx +296 -0
- package/cli/src/components/savant-free-active-session-summary.tsx +63 -0
- package/cli/src/components/savant-free-landing-screen.tsx +756 -0
- package/cli/src/components/savant-free-model-selector.tsx +815 -0
- package/cli/src/components/savant-free-referral-banner.tsx +423 -0
- package/cli/src/components/savant-free-superseded-screen.tsx +62 -0
- package/cli/src/components/savant-ui/animation/pulse.tsx +26 -0
- package/cli/src/components/savant-ui/animation/typewriter.tsx +40 -0
- package/cli/src/components/savant-ui/branding.tsx +59 -0
- package/cli/src/components/savant-ui/data-display/badge.tsx +52 -0
- package/cli/src/components/savant-ui/data-display/code-block.tsx +55 -0
- package/cli/src/components/savant-ui/data-display/key-value.tsx +34 -0
- package/cli/src/components/savant-ui/data-display/sparkline.tsx +42 -0
- package/cli/src/components/savant-ui/data-display/timeline.tsx +44 -0
- package/cli/src/components/savant-ui/data-display/tree-view.tsx +55 -0
- package/cli/src/components/savant-ui/echo/__tests__/sidebar-collapse.test.tsx +90 -0
- package/cli/src/components/savant-ui/echo/agent-stack.tsx +72 -0
- package/cli/src/components/savant-ui/echo/agent-status.tsx +66 -0
- package/cli/src/components/savant-ui/echo/fid-card.tsx +89 -0
- package/cli/src/components/savant-ui/echo/fid-list.tsx +68 -0
- package/cli/src/components/savant-ui/echo/loop-status-panel.tsx +64 -0
- package/cli/src/components/savant-ui/echo/perfection-loop.tsx +118 -0
- package/cli/src/components/savant-ui/echo/phase-indicator.tsx +68 -0
- package/cli/src/components/savant-ui/echo/phase-info.ts +72 -0
- package/cli/src/components/savant-ui/echo/token-meter.tsx +39 -0
- package/cli/src/components/savant-ui/feedback/alert.tsx +45 -0
- package/cli/src/components/savant-ui/feedback/cost-tracker.tsx +54 -0
- package/cli/src/components/savant-ui/feedback/progress-bar.tsx +71 -0
- package/cli/src/components/savant-ui/feedback/spinner.tsx +40 -0
- package/cli/src/components/savant-ui/icon-theme-keys.ts +67 -0
- package/cli/src/components/savant-ui/icon.tsx +53 -0
- package/cli/src/components/savant-ui/index.ts +75 -0
- package/cli/src/components/savant-ui/input/select.tsx +26 -0
- package/cli/src/components/savant-ui/input/toggle.tsx +28 -0
- package/cli/src/components/savant-ui/layout/grid.tsx +52 -0
- package/cli/src/components/savant-ui/layout/header.tsx +28 -0
- package/cli/src/components/savant-ui/navigation/stepper.tsx +41 -0
- package/cli/src/components/savant-ui/primitives/key-hint.tsx +45 -0
- package/cli/src/components/savant-ui/primitives/key-value-row.tsx +41 -0
- package/cli/src/components/savant-ui/primitives/panel.tsx +42 -0
- package/cli/src/components/savant-ui/primitives/separator.tsx +34 -0
- package/cli/src/components/savant-ui/primitives/sidebar-section.tsx +64 -0
- package/cli/src/components/savant-ui/primitives/spacer.tsx +13 -0
- package/cli/src/components/savant-ui/primitives/stack.tsx +35 -0
- package/cli/src/components/savant-ui/theme.ts +45 -0
- package/cli/src/components/scroll-to-bottom-button.tsx +34 -0
- package/cli/src/components/segmented-control.tsx +199 -0
- package/cli/src/components/selectable-list.tsx +249 -0
- package/cli/src/components/selected-chips.tsx +86 -0
- package/cli/src/components/separator.tsx +40 -0
- package/cli/src/components/session-ended-banner.tsx +183 -0
- package/cli/src/components/shimmer-text.tsx +254 -0
- package/cli/src/components/status-bar.tsx +279 -0
- package/cli/src/components/subscription-limit-banner.tsx +269 -0
- package/cli/src/components/suggested-prompts.tsx +184 -0
- package/cli/src/components/suggestion-menu.tsx +219 -0
- package/cli/src/components/terminal-command-display.tsx +152 -0
- package/cli/src/components/terminal-link.tsx +97 -0
- package/cli/src/components/text-attachment-card.tsx +77 -0
- package/cli/src/components/thinking.tsx +108 -0
- package/cli/src/components/toast.tsx +109 -0
- package/cli/src/components/tools/__tests__/apply-patch.test.tsx +97 -0
- package/cli/src/components/tools/__tests__/code-search.test.tsx +45 -0
- package/cli/src/components/tools/__tests__/gravity-index.test.ts +76 -0
- package/cli/src/components/tools/__tests__/render-ui.test.tsx +556 -0
- package/cli/src/components/tools/__tests__/run-terminal-command.test.ts +274 -0
- package/cli/src/components/tools/__tests__/tool-call-item.test.tsx +73 -0
- package/cli/src/components/tools/apply-patch.tsx +101 -0
- package/cli/src/components/tools/code-search.tsx +50 -0
- package/cli/src/components/tools/composio.tsx +140 -0
- package/cli/src/components/tools/diff-viewer.tsx +21 -0
- package/cli/src/components/tools/glob.tsx +66 -0
- package/cli/src/components/tools/gravity-index.tsx +80 -0
- package/cli/src/components/tools/list-directory.tsx +66 -0
- package/cli/src/components/tools/read-docs.tsx +36 -0
- package/cli/src/components/tools/read-files.tsx +97 -0
- package/cli/src/components/tools/read-subtree.tsx +40 -0
- package/cli/src/components/tools/read-url.tsx +32 -0
- package/cli/src/components/tools/registry.ts +131 -0
- package/cli/src/components/tools/render-ui.tsx +466 -0
- package/cli/src/components/tools/run-terminal-command.tsx +86 -0
- package/cli/src/components/tools/skill.tsx +26 -0
- package/cli/src/components/tools/str-replace.tsx +77 -0
- package/cli/src/components/tools/suggest-followups.tsx +373 -0
- package/cli/src/components/tools/task-completed.tsx +16 -0
- package/cli/src/components/tools/tool-call-item.tsx +163 -0
- package/cli/src/components/tools/types.ts +100 -0
- package/cli/src/components/tools/web-search.tsx +32 -0
- package/cli/src/components/tools/write-file.tsx +20 -0
- package/cli/src/components/tools/write-todos.tsx +105 -0
- package/cli/src/components/top-banner.tsx +187 -0
- package/cli/src/components/usage-banner.tsx +296 -0
- package/cli/src/components/user-error-banner.tsx +54 -0
- package/cli/src/components/validation-error-popover.tsx +191 -0
- package/cli/src/data/slash-commands.ts +306 -0
- package/cli/src/hooks/__tests__/holds-live-savant-free-slot.test.ts +49 -0
- package/cli/src/hooks/__tests__/run-outcome.test.ts +178 -0
- package/cli/src/hooks/__tests__/session-fetch-signal.test.ts +45 -0
- package/cli/src/hooks/__tests__/use-activity-query.test.ts +810 -0
- package/cli/src/hooks/__tests__/use-ask-user-bridge.test.ts +175 -0
- package/cli/src/hooks/__tests__/use-auth-query.test.ts +21 -0
- package/cli/src/hooks/__tests__/use-chat-messages-collapse.test.ts +96 -0
- package/cli/src/hooks/__tests__/use-connection-status.test.ts +112 -0
- package/cli/src/hooks/__tests__/use-directory-browser.test.ts +215 -0
- package/cli/src/hooks/__tests__/use-gravity-ad.test.ts +73 -0
- package/cli/src/hooks/__tests__/use-grid-layout.test.ts +346 -0
- package/cli/src/hooks/__tests__/use-input-history.test.ts +704 -0
- package/cli/src/hooks/__tests__/use-loop-scheduler.test.ts +247 -0
- package/cli/src/hooks/__tests__/use-path-tab-completion.test.ts +324 -0
- package/cli/src/hooks/__tests__/use-queue-controls.test.ts +68 -0
- package/cli/src/hooks/__tests__/use-searchable-list.test.ts +364 -0
- package/cli/src/hooks/__tests__/use-send-message-timer.test.ts +146 -0
- package/cli/src/hooks/__tests__/use-suggestion-engine-mention.test.ts +364 -0
- package/cli/src/hooks/__tests__/use-suggestion-engine.test.ts +485 -0
- package/cli/src/hooks/__tests__/use-terminal-focus.test.ts +66 -0
- package/cli/src/hooks/__tests__/use-terminal-layout.test.ts +675 -0
- package/cli/src/hooks/__tests__/use-timeout.test.ts +330 -0
- package/cli/src/hooks/__tests__/use-usage-query.test.ts +526 -0
- package/cli/src/hooks/__tests__/use-user-details-query.test.ts +225 -0
- package/cli/src/hooks/helpers/__tests__/send-message.test.ts +1851 -0
- package/cli/src/hooks/helpers/send-message.ts +553 -0
- package/cli/src/hooks/run-outcome.ts +64 -0
- package/cli/src/hooks/stream-state.ts +106 -0
- package/cli/src/hooks/use-activity-query.ts +696 -0
- package/cli/src/hooks/use-agent-validation.ts +80 -0
- package/cli/src/hooks/use-ask-user-bridge.ts +102 -0
- package/cli/src/hooks/use-auth-query.ts +261 -0
- package/cli/src/hooks/use-auth-state.ts +155 -0
- package/cli/src/hooks/use-chat-input.ts +87 -0
- package/cli/src/hooks/use-chat-keyboard.ts +325 -0
- package/cli/src/hooks/use-chat-messages.ts +273 -0
- package/cli/src/hooks/use-chat-state.ts +219 -0
- package/cli/src/hooks/use-chat-streaming.ts +270 -0
- package/cli/src/hooks/use-chat-ui.ts +136 -0
- package/cli/src/hooks/use-clipboard.ts +154 -0
- package/cli/src/hooks/use-connection-status.ts +156 -0
- package/cli/src/hooks/use-directory-browser.ts +88 -0
- package/cli/src/hooks/use-elapsed-time.ts +116 -0
- package/cli/src/hooks/use-event.ts +36 -0
- package/cli/src/hooks/use-exit-handler.ts +108 -0
- package/cli/src/hooks/use-fetch-login-url.ts +65 -0
- package/cli/src/hooks/use-fids.ts +48 -0
- package/cli/src/hooks/use-fingerprint.ts +64 -0
- package/cli/src/hooks/use-gravity-ad.ts +688 -0
- package/cli/src/hooks/use-grid-layout.ts +78 -0
- package/cli/src/hooks/use-input-history.ts +173 -0
- package/cli/src/hooks/use-login-keyboard-handlers.ts +74 -0
- package/cli/src/hooks/use-login-polling.ts +120 -0
- package/cli/src/hooks/use-logo.tsx +178 -0
- package/cli/src/hooks/use-loop-scheduler.ts +481 -0
- package/cli/src/hooks/use-message-queue.ts +301 -0
- package/cli/src/hooks/use-now.ts +20 -0
- package/cli/src/hooks/use-path-tab-completion.ts +88 -0
- package/cli/src/hooks/use-publish-mutation.ts +60 -0
- package/cli/src/hooks/use-queue-controls.ts +70 -0
- package/cli/src/hooks/use-queue-ui.ts +55 -0
- package/cli/src/hooks/use-savant-free-ctrl-c-exit.ts +23 -0
- package/cli/src/hooks/use-savant-free-session-progress.ts +34 -0
- package/cli/src/hooks/use-savant-free-session.ts +679 -0
- package/cli/src/hooks/use-savant-free-streak-query.ts +72 -0
- package/cli/src/hooks/use-scaffold-confirm.ts +62 -0
- package/cli/src/hooks/use-scaffold-revert-subscriber.ts +66 -0
- package/cli/src/hooks/use-scroll-management.ts +182 -0
- package/cli/src/hooks/use-searchable-list.ts +99 -0
- package/cli/src/hooks/use-send-message.ts +1038 -0
- package/cli/src/hooks/use-sheen-animation.tsx +88 -0
- package/cli/src/hooks/use-subscription-query.ts +106 -0
- package/cli/src/hooks/use-suggestion-engine.ts +793 -0
- package/cli/src/hooks/use-terminal-breakpoints.ts +77 -0
- package/cli/src/hooks/use-terminal-dimensions.ts +50 -0
- package/cli/src/hooks/use-terminal-focus.ts +146 -0
- package/cli/src/hooks/use-terminal-layout.ts +189 -0
- package/cli/src/hooks/use-theme.tsx +140 -0
- package/cli/src/hooks/use-timeout.ts +88 -0
- package/cli/src/hooks/use-toast.ts +114 -0
- package/cli/src/hooks/use-update-preference.ts +77 -0
- package/cli/src/hooks/use-usage-monitor.ts +59 -0
- package/cli/src/hooks/use-usage-query.ts +138 -0
- package/cli/src/hooks/use-user-details-query.ts +104 -0
- package/cli/src/hooks/use-why-did-you-update.ts +178 -0
- package/cli/src/index.tsx +484 -0
- package/cli/src/init/__tests__/init-direnv.test.ts +597 -0
- package/cli/src/init/init-app.ts +54 -0
- package/cli/src/init/init-direnv.ts +133 -0
- package/cli/src/login/constants.ts +71 -0
- package/cli/src/login/login-flow.ts +224 -0
- package/cli/src/login/plain-login.ts +107 -0
- package/cli/src/login/utils.ts +183 -0
- package/cli/src/native/ripgrep.ts +82 -0
- package/cli/src/polyfills/bun-strip-ansi.ts +12 -0
- package/cli/src/pre-init/load-dev-env.ts +98 -0
- package/cli/src/pre-init/tree-sitter-wasm.ts +98 -0
- package/cli/src/project-files.ts +102 -0
- package/cli/src/state/__tests__/chat-store-focus.test.ts +22 -0
- package/cli/src/state/__tests__/feedback-store.test.ts +260 -0
- package/cli/src/state/chat-history-store.ts +27 -0
- package/cli/src/state/chat-store.ts +791 -0
- package/cli/src/state/feedback-store.ts +162 -0
- package/cli/src/state/gateway-catalog-store.ts +45 -0
- package/cli/src/state/login-store.ts +150 -0
- package/cli/src/state/message-block-store.ts +143 -0
- package/cli/src/state/model-picker-store.ts +67 -0
- package/cli/src/state/provider-picker-store.ts +53 -0
- package/cli/src/state/publish-store.ts +141 -0
- package/cli/src/state/review-store.ts +24 -0
- package/cli/src/state/rewind-picker-store.ts +74 -0
- package/cli/src/state/savant-free-model-store.ts +59 -0
- package/cli/src/state/savant-free-session-store.ts +32 -0
- package/cli/src/test-setup.ts +20 -0
- package/cli/src/testing/env.ts +46 -0
- package/cli/src/types/chat-state.ts +15 -0
- package/cli/src/types/chat.ts +242 -0
- package/cli/src/types/contracts/send-message.ts +16 -0
- package/cli/src/types/env.ts +107 -0
- package/cli/src/types/function-params.ts +35 -0
- package/cli/src/types/opentui-augmentation.d.ts +11 -0
- package/cli/src/types/react19-compat.d.ts +19 -0
- package/cli/src/types/savant-free-session.ts +17 -0
- package/cli/src/types/store.ts +112 -0
- package/cli/src/types/theme-system.ts +194 -0
- package/cli/src/types/utils.ts +3 -0
- package/cli/src/utils/__tests__/activity-tracker.test.ts +440 -0
- package/cli/src/utils/__tests__/agent-display.test.ts +139 -0
- package/cli/src/utils/__tests__/analytics-client.test.ts +311 -0
- package/cli/src/utils/__tests__/anonymous-id.test.ts +74 -0
- package/cli/src/utils/__tests__/arrays.test.ts +264 -0
- package/cli/src/utils/__tests__/bash-context-processor.test.ts +38 -0
- package/cli/src/utils/__tests__/block-processor.test.ts +690 -0
- package/cli/src/utils/__tests__/chat-history.test.ts +247 -0
- package/cli/src/utils/__tests__/chat-input-key-intercept.test.ts +40 -0
- package/cli/src/utils/__tests__/chat-layout.test.ts +32 -0
- package/cli/src/utils/__tests__/chat-meta.test.ts +160 -0
- package/cli/src/utils/__tests__/chatgpt-oauth.test.ts +50 -0
- package/cli/src/utils/__tests__/clipboard.test.ts +998 -0
- package/cli/src/utils/__tests__/code-search-summary.test.ts +84 -0
- package/cli/src/utils/__tests__/collapse-helpers.test.ts +1272 -0
- package/cli/src/utils/__tests__/error-handling.test.ts +611 -0
- package/cli/src/utils/__tests__/feedback-helpers.test.ts +452 -0
- package/cli/src/utils/__tests__/feedback-submission.test.ts +26 -0
- package/cli/src/utils/__tests__/fetch-usage.test.ts +355 -0
- package/cli/src/utils/__tests__/fingerprint.test.ts +147 -0
- package/cli/src/utils/__tests__/format-elapsed-time.test.ts +103 -0
- package/cli/src/utils/__tests__/format-timeout.test.ts +87 -0
- package/cli/src/utils/__tests__/image-dimensions.test.ts +243 -0
- package/cli/src/utils/__tests__/image-processor.test.ts +250 -0
- package/cli/src/utils/__tests__/implementor-helpers.test.ts +1457 -0
- package/cli/src/utils/__tests__/keyboard-actions.test.ts +686 -0
- package/cli/src/utils/__tests__/layout-helpers.test.ts +36 -0
- package/cli/src/utils/__tests__/lazy-response-ads.test.ts +167 -0
- package/cli/src/utils/__tests__/logger-sanitize-secrets.test.ts +80 -0
- package/cli/src/utils/__tests__/markdown-renderer.test.tsx +518 -0
- package/cli/src/utils/__tests__/markdown-streaming.test.ts +64 -0
- package/cli/src/utils/__tests__/message-block-helpers.test.ts +1197 -0
- package/cli/src/utils/__tests__/message-updater.test.ts +659 -0
- package/cli/src/utils/__tests__/ollama-onboarding.test.ts +239 -0
- package/cli/src/utils/__tests__/openrouter-models.test.ts +295 -0
- package/cli/src/utils/__tests__/osc-timeout-scenarios.test.ts +172 -0
- package/cli/src/utils/__tests__/pending-attachments.test.ts +278 -0
- package/cli/src/utils/__tests__/provider-setup.test.ts +183 -0
- package/cli/src/utils/__tests__/run-state-storage.test.ts +741 -0
- package/cli/src/utils/__tests__/savant-code-api.test.ts +634 -0
- package/cli/src/utils/__tests__/savant-free-instance-owner.test.ts +69 -0
- package/cli/src/utils/__tests__/savant-free-model-navigation.test.ts +104 -0
- package/cli/src/utils/__tests__/savant-free-premium-reset.test.ts +81 -0
- package/cli/src/utils/__tests__/savant-free-referral-cache.test.ts +67 -0
- package/cli/src/utils/__tests__/savant-free-session-display.test.ts +23 -0
- package/cli/src/utils/__tests__/savant-free-streak-line.test.ts +76 -0
- package/cli/src/utils/__tests__/sdk-event-handlers.test.ts +615 -0
- package/cli/src/utils/__tests__/send-message-helpers.test.ts +1875 -0
- package/cli/src/utils/__tests__/send-message-timer.test.ts +68 -0
- package/cli/src/utils/__tests__/settings.test.ts +138 -0
- package/cli/src/utils/__tests__/strings.test.ts +210 -0
- package/cli/src/utils/__tests__/syntax-theme.test.ts +91 -0
- package/cli/src/utils/__tests__/terminal-color-detection.test.ts +425 -0
- package/cli/src/utils/__tests__/terminal-enter-detection.test.ts +77 -0
- package/cli/src/utils/__tests__/text-layout.test.ts +82 -0
- package/cli/src/utils/__tests__/think-tag-parser.test.ts +159 -0
- package/cli/src/utils/__tests__/trace-writer.test.ts +193 -0
- package/cli/src/utils/__tests__/trim-chat-logs.test.ts +79 -0
- package/cli/src/utils/__tests__/usage-banner-state.test.ts +298 -0
- package/cli/src/utils/__tests__/validation-error-formatting.test.ts +126 -0
- package/cli/src/utils/__tests__/write-file-atomic.test.ts +130 -0
- package/cli/src/utils/active-run.ts +22 -0
- package/cli/src/utils/activity-tracker.ts +66 -0
- package/cli/src/utils/agent-display.ts +87 -0
- package/cli/src/utils/agent-helpers.ts +47 -0
- package/cli/src/utils/ai-message-id.ts +12 -0
- package/cli/src/utils/analytics.ts +407 -0
- package/cli/src/utils/anonymous-id.ts +87 -0
- package/cli/src/utils/arrays.ts +117 -0
- package/cli/src/utils/auth.ts +258 -0
- package/cli/src/utils/bash-context-processor.ts +47 -0
- package/cli/src/utils/bash-messages.ts +108 -0
- package/cli/src/utils/block-margins.ts +35 -0
- package/cli/src/utils/block-operations.ts +548 -0
- package/cli/src/utils/block-processor.ts +212 -0
- package/cli/src/utils/chat-history.ts +265 -0
- package/cli/src/utils/chat-input-key-intercept.ts +52 -0
- package/cli/src/utils/chat-layout.ts +44 -0
- package/cli/src/utils/chat-meta.ts +101 -0
- package/cli/src/utils/chat-scroll-accel.ts +151 -0
- package/cli/src/utils/chatgpt-oauth.ts +350 -0
- package/cli/src/utils/clipboard-image.ts +610 -0
- package/cli/src/utils/clipboard.ts +307 -0
- package/cli/src/utils/code-search-summary.ts +69 -0
- package/cli/src/utils/collapse-helpers.ts +265 -0
- package/cli/src/utils/config-dir.ts +30 -0
- package/cli/src/utils/constants.ts +159 -0
- package/cli/src/utils/create-event-handler-state.ts +79 -0
- package/cli/src/utils/create-run-config.ts +160 -0
- package/cli/src/utils/db-storage.ts +254 -0
- package/cli/src/utils/detect-shell.ts +112 -0
- package/cli/src/utils/directory-browser.ts +74 -0
- package/cli/src/utils/engagement.ts +55 -0
- package/cli/src/utils/env.ts +109 -0
- package/cli/src/utils/error-handling.ts +246 -0
- package/cli/src/utils/error-messages.ts +84 -0
- package/cli/src/utils/feedback-helpers.ts +115 -0
- package/cli/src/utils/feedback-submission.ts +24 -0
- package/cli/src/utils/fetch-usage.ts +75 -0
- package/cli/src/utils/fid-loader.ts +135 -0
- package/cli/src/utils/fingerprint.ts +263 -0
- package/cli/src/utils/finish-logic.ts +154 -0
- package/cli/src/utils/format-elapsed-time.ts +33 -0
- package/cli/src/utils/format-session-units.ts +6 -0
- package/cli/src/utils/format-timeout.ts +28 -0
- package/cli/src/utils/format-validation-errors-for-message.ts +85 -0
- package/cli/src/utils/git.ts +17 -0
- package/cli/src/utils/glyphs.ts +188 -0
- package/cli/src/utils/helpers.ts +47 -0
- package/cli/src/utils/image-display.ts +73 -0
- package/cli/src/utils/image-handler.ts +336 -0
- package/cli/src/utils/image-processor.ts +133 -0
- package/cli/src/utils/image-thumbnail.ts +83 -0
- package/cli/src/utils/implementor-helpers.ts +817 -0
- package/cli/src/utils/input-modes.ts +196 -0
- package/cli/src/utils/keyboard-actions.ts +394 -0
- package/cli/src/utils/keypad-keys.ts +47 -0
- package/cli/src/utils/layout-helpers.ts +36 -0
- package/cli/src/utils/lazy-response-ads.ts +1 -0
- package/cli/src/utils/loading-phrases.ts +68 -0
- package/cli/src/utils/local-agent-registry.ts +611 -0
- package/cli/src/utils/log-shipper.ts +116 -0
- package/cli/src/utils/logger.ts +435 -0
- package/cli/src/utils/markdown-renderer.tsx +1315 -0
- package/cli/src/utils/math.ts +3 -0
- package/cli/src/utils/message-block-helpers.ts +667 -0
- package/cli/src/utils/message-history.ts +153 -0
- package/cli/src/utils/message-tree-utils.ts +67 -0
- package/cli/src/utils/message-updater.ts +279 -0
- package/cli/src/utils/ollama-onboarding.ts +215 -0
- package/cli/src/utils/open-file.ts +144 -0
- package/cli/src/utils/open-url.ts +63 -0
- package/cli/src/utils/openrouter-models.ts +945 -0
- package/cli/src/utils/path-completion.ts +111 -0
- package/cli/src/utils/path-helpers.ts +38 -0
- package/cli/src/utils/pending-attachments.ts +363 -0
- package/cli/src/utils/post-processing.ts +99 -0
- package/cli/src/utils/project-picker.ts +12 -0
- package/cli/src/utils/provider-setup.ts +259 -0
- package/cli/src/utils/recent-projects.ts +156 -0
- package/cli/src/utils/renderer-cleanup.ts +142 -0
- package/cli/src/utils/response-ad-positions.ts +1 -0
- package/cli/src/utils/rewind.ts +175 -0
- package/cli/src/utils/run-state-storage.ts +480 -0
- package/cli/src/utils/savant-code-api.ts +686 -0
- package/cli/src/utils/savant-code-client.ts +217 -0
- package/cli/src/utils/savant-free-agent-selection.ts +12 -0
- package/cli/src/utils/savant-free-exit.ts +24 -0
- package/cli/src/utils/savant-free-instance-owner.ts +66 -0
- package/cli/src/utils/savant-free-model-navigation.ts +46 -0
- package/cli/src/utils/savant-free-premium-reset.ts +52 -0
- package/cli/src/utils/savant-free-referral-cache.ts +35 -0
- package/cli/src/utils/savant-free-session-display.ts +21 -0
- package/cli/src/utils/savant-free-streak-line.ts +67 -0
- package/cli/src/utils/sdk-event-handlers.ts +587 -0
- package/cli/src/utils/send-message-helpers.ts +199 -0
- package/cli/src/utils/send-message-timer.ts +110 -0
- package/cli/src/utils/settings.ts +388 -0
- package/cli/src/utils/skill-registry.ts +100 -0
- package/cli/src/utils/spawn-agent-matcher.ts +56 -0
- package/cli/src/utils/status-indicator-state.ts +100 -0
- package/cli/src/utils/stream-chunk-processor.ts +65 -0
- package/cli/src/utils/strings.ts +272 -0
- package/cli/src/utils/subscription.ts +31 -0
- package/cli/src/utils/syntax-highlighter.tsx +19 -0
- package/cli/src/utils/syntax-theme.ts +131 -0
- package/cli/src/utils/terminal-color-detection.ts +472 -0
- package/cli/src/utils/terminal-enter-detection.ts +63 -0
- package/cli/src/utils/terminal-images.ts +223 -0
- package/cli/src/utils/terminal-reset-sequences.ts +33 -0
- package/cli/src/utils/terminal-title.ts +113 -0
- package/cli/src/utils/terminal-watchdog.ts +246 -0
- package/cli/src/utils/text-layout.ts +153 -0
- package/cli/src/utils/theme-config.ts +143 -0
- package/cli/src/utils/theme-system.ts +1265 -0
- package/cli/src/utils/think-tag-parser.ts +105 -0
- package/cli/src/utils/trace-writer.ts +147 -0
- package/cli/src/utils/ui-constants.ts +69 -0
- package/cli/src/utils/usage-banner-state.ts +146 -0
- package/cli/src/utils/validation-error-formatting.ts +92 -0
- package/cli/src/utils/validation-error-helpers.ts +19 -0
- package/cli/src/utils/version.ts +23 -0
- package/cli/src/utils/word-wrap-utils.ts +53 -0
- package/cli/src/utils/write-file-atomic.ts +82 -0
- package/cli/src/utils/yield-to-event-loop.ts +9 -0
- package/cli/tsconfig.json +26 -0
- package/coding-standards/csharp.md +77 -0
- package/coding-standards/go.md +71 -0
- package/coding-standards/java.md +74 -0
- package/coding-standards/python.md +82 -0
- package/coding-standards/rust.md +78 -0
- package/coding-standards/typescript.md +85 -0
- package/coding-standards/x402.md +227 -0
- package/common/README.md +41 -0
- package/common/common_exit +1 -0
- package/common/package.json +45 -0
- package/common/src/__tests__/agent-validation.test.ts +861 -0
- package/common/src/__tests__/agents.test.ts +16 -0
- package/common/src/__tests__/dynamic-agent-template-schema.test.ts +420 -0
- package/common/src/__tests__/env-ci.test.ts +167 -0
- package/common/src/__tests__/env-process.test.ts +145 -0
- package/common/src/__tests__/free-agents.test.ts +269 -0
- package/common/src/__tests__/handlesteps-parsing.test.ts +247 -0
- package/common/src/__tests__/model-config.test.ts +41 -0
- package/common/src/__tests__/project-file-tree.test.ts +82 -0
- package/common/src/__tests__/response-ad-positions.test.ts +78 -0
- package/common/src/__tests__/savant-free-models.test.ts +460 -0
- package/common/src/__tests__/savant-free-referral-tiers.test.ts +122 -0
- package/common/src/__tests__/user-state.test.ts +30 -0
- package/common/src/actions.ts +215 -0
- package/common/src/analytics-core.ts +73 -0
- package/common/src/analytics.ts +96 -0
- package/common/src/api-keys/constants.ts +26 -0
- package/common/src/browser-actions.ts +414 -0
- package/common/src/constants/agents.ts +250 -0
- package/common/src/constants/analytics-events.ts +318 -0
- package/common/src/constants/anthropic.ts +72 -0
- package/common/src/constants/byok.ts +2 -0
- package/common/src/constants/chatgpt-oauth.ts +85 -0
- package/common/src/constants/composio.ts +34 -0
- package/common/src/constants/feedback.ts +18 -0
- package/common/src/constants/free-agents.ts +347 -0
- package/common/src/constants/gemini.ts +6 -0
- package/common/src/constants/grant-priorities.ts +13 -0
- package/common/src/constants/hosts.ts +6 -0
- package/common/src/constants/images.ts +53 -0
- package/common/src/constants/index.ts +8 -0
- package/common/src/constants/knowledge.ts +46 -0
- package/common/src/constants/limits.ts +23 -0
- package/common/src/constants/model-config.ts +469 -0
- package/common/src/constants/paths.ts +69 -0
- package/common/src/constants/savant-code-config.ts +12 -0
- package/common/src/constants/savant-free-gemini-thinker.ts +30 -0
- package/common/src/constants/savant-free-models.ts +855 -0
- package/common/src/constants/savant-free-referral-tiers.ts +169 -0
- package/common/src/constants/skills.ts +60 -0
- package/common/src/constants/subscription-plans.ts +54 -0
- package/common/src/constants/ui.ts +25 -0
- package/common/src/env-ci.ts +36 -0
- package/common/src/env-process.ts +95 -0
- package/common/src/env-schema.ts +42 -0
- package/common/src/env.ts +69 -0
- package/common/src/mcp/client.ts +308 -0
- package/common/src/old-constants.ts +10 -0
- package/common/src/project-file-tree.ts +361 -0
- package/common/src/reddit-capi.ts +175 -0
- package/common/src/schemas/feedback.ts +57 -0
- package/common/src/schemas/logs.ts +66 -0
- package/common/src/templates/agent-validation.ts +436 -0
- package/common/src/templates/initial-agents-dir/LICENSE +202 -0
- package/common/src/templates/initial-agents-dir/README.md +314 -0
- package/common/src/templates/initial-agents-dir/examples/01-basic-diff-reviewer.ts +17 -0
- package/common/src/templates/initial-agents-dir/examples/02-intermediate-git-committer.ts +78 -0
- package/common/src/templates/initial-agents-dir/examples/03-advanced-file-explorer.ts +76 -0
- package/common/src/templates/initial-agents-dir/my-custom-agent.ts +40 -0
- package/common/src/templates/initial-agents-dir/package.json +6 -0
- package/common/src/templates/initial-agents-dir/skills/README.md +66 -0
- package/common/src/templates/initial-agents-dir/skills/example-skill/SKILL.md +29 -0
- package/common/src/templates/initial-agents-dir/types/agent-definition.ts +484 -0
- package/common/src/templates/initial-agents-dir/types/tools.ts +452 -0
- package/common/src/templates/initial-agents-dir/types/util-types.ts +167 -0
- package/common/src/testing/TESTING_PATTERNS.md +353 -0
- package/common/src/testing/errors.ts +33 -0
- package/common/src/testing/fixtures/agent-runtime.ts +325 -0
- package/common/src/testing/impl/agent-runtime.ts +6 -0
- package/common/src/testing/index.ts +84 -0
- package/common/src/testing/mock-modules.ts +54 -0
- package/common/src/testing/mock-types.ts +123 -0
- package/common/src/testing/mocks/analytics.ts +262 -0
- package/common/src/testing/mocks/child-process.ts +93 -0
- package/common/src/testing/mocks/crypto.ts +218 -0
- package/common/src/testing/mocks/database.ts +337 -0
- package/common/src/testing/mocks/filesystem.ts +166 -0
- package/common/src/testing/mocks/index.ts +83 -0
- package/common/src/testing/mocks/logger.ts +136 -0
- package/common/src/testing/mocks/stream.ts +314 -0
- package/common/src/testing/mocks/timers.ts +132 -0
- package/common/src/testing/mocks/tree-sitter.ts +127 -0
- package/common/src/testing/setup.ts +282 -0
- package/common/src/testing-env-ci.ts +15 -0
- package/common/src/testing-env-process.ts +78 -0
- package/common/src/tools/__tests__/compile-tool-definitions.test.ts +34 -0
- package/common/src/tools/__tests__/thought-session.test.ts +256 -0
- package/common/src/tools/compile-tool-definitions.ts +194 -0
- package/common/src/tools/constants.ts +132 -0
- package/common/src/tools/list.ts +193 -0
- package/common/src/tools/params/__tests__/coerce-to-array.test.ts +237 -0
- package/common/src/tools/params/__tests__/sequential-thinking-coercion.test.ts +98 -0
- package/common/src/tools/params/tool/add-message.ts +36 -0
- package/common/src/tools/params/tool/add-subgoal.ts +57 -0
- package/common/src/tools/params/tool/apply-patch.ts +110 -0
- package/common/src/tools/params/tool/ask-user.ts +181 -0
- package/common/src/tools/params/tool/browser-logs.ts +85 -0
- package/common/src/tools/params/tool/code-search.ts +144 -0
- package/common/src/tools/params/tool/composio.ts +131 -0
- package/common/src/tools/params/tool/create-plan.ts +80 -0
- package/common/src/tools/params/tool/end-turn.ts +54 -0
- package/common/src/tools/params/tool/find-files.ts +60 -0
- package/common/src/tools/params/tool/glob.ts +74 -0
- package/common/src/tools/params/tool/gravity-index.ts +92 -0
- package/common/src/tools/params/tool/list-directory.ts +58 -0
- package/common/src/tools/params/tool/lookup-agent-info.ts +37 -0
- package/common/src/tools/params/tool/propose-str-replace.ts +103 -0
- package/common/src/tools/params/tool/propose-write-file.ts +71 -0
- package/common/src/tools/params/tool/read-docs.ts +85 -0
- package/common/src/tools/params/tool/read-files.ts +61 -0
- package/common/src/tools/params/tool/read-subtree.ts +83 -0
- package/common/src/tools/params/tool/read-url.ts +81 -0
- package/common/src/tools/params/tool/render-ui.ts +203 -0
- package/common/src/tools/params/tool/run-file-change-hooks.ts +57 -0
- package/common/src/tools/params/tool/run-readonly-command.ts +76 -0
- package/common/src/tools/params/tool/run-terminal-command.ts +185 -0
- package/common/src/tools/params/tool/sequential-thinking.ts +110 -0
- package/common/src/tools/params/tool/set-messages.ts +42 -0
- package/common/src/tools/params/tool/set-output.ts +62 -0
- package/common/src/tools/params/tool/set-scaffold-complete.ts +51 -0
- package/common/src/tools/params/tool/skill.ts +56 -0
- package/common/src/tools/params/tool/spawn-agent-inline.ts +57 -0
- package/common/src/tools/params/tool/spawn-agents.ts +154 -0
- package/common/src/tools/params/tool/str-replace.ts +107 -0
- package/common/src/tools/params/tool/suggest-followups.ts +94 -0
- package/common/src/tools/params/tool/task-completed.ts +58 -0
- package/common/src/tools/params/tool/think-deeply.ts +53 -0
- package/common/src/tools/params/tool/transition-phase.ts +57 -0
- package/common/src/tools/params/tool/update-subgoal.ts +89 -0
- package/common/src/tools/params/tool/web-search.ts +73 -0
- package/common/src/tools/params/tool/write-file.ts +71 -0
- package/common/src/tools/params/tool/write-todos.ts +67 -0
- package/common/src/tools/params/utils.ts +152 -0
- package/common/src/tools/safety-registry.ts +274 -0
- package/common/src/tools/safety.ts +42 -0
- package/common/src/tools/sequential-thinking.ts +340 -0
- package/common/src/tools/utils.ts +25 -0
- package/common/src/types/__tests__/dynamic-agent-template.test.ts +20 -0
- package/common/src/types/agent-template.ts +223 -0
- package/common/src/types/api/agents/publish.ts +63 -0
- package/common/src/types/contracts/agent-runtime.ts +84 -0
- package/common/src/types/contracts/analytics.ts +12 -0
- package/common/src/types/contracts/bigquery.ts +55 -0
- package/common/src/types/contracts/billing.ts +46 -0
- package/common/src/types/contracts/client.ts +52 -0
- package/common/src/types/contracts/database.ts +104 -0
- package/common/src/types/contracts/env.ts +203 -0
- package/common/src/types/contracts/llm.ts +183 -0
- package/common/src/types/contracts/logger.ts +29 -0
- package/common/src/types/contracts/logs.ts +34 -0
- package/common/src/types/contracts/trace.ts +21 -0
- package/common/src/types/dynamic-agent-template.ts +290 -0
- package/common/src/types/filesystem.ts +10 -0
- package/common/src/types/function-params.ts +35 -0
- package/common/src/types/grant.ts +20 -0
- package/common/src/types/gravity-index.ts +170 -0
- package/common/src/types/json.ts +26 -0
- package/common/src/types/mcp.ts +26 -0
- package/common/src/types/messages/content-part.ts +59 -0
- package/common/src/types/messages/data-content.ts +14 -0
- package/common/src/types/messages/provider-metadata.ts +10 -0
- package/common/src/types/messages/savant-code-message.ts +55 -0
- package/common/src/types/organization.ts +118 -0
- package/common/src/types/print-mode.ts +167 -0
- package/common/src/types/publisher.ts +67 -0
- package/common/src/types/savant-free-session.ts +295 -0
- package/common/src/types/savant-free-streak.ts +6 -0
- package/common/src/types/session-state.ts +237 -0
- package/common/src/types/skill.ts +56 -0
- package/common/src/types/source.ts +11 -0
- package/common/src/types/spawn.ts +13 -0
- package/common/src/types/subscription.ts +68 -0
- package/common/src/types/usage.ts +16 -0
- package/common/src/types/util.ts +3 -0
- package/common/src/util/__tests__/analytics-dispatcher.test.ts +145 -0
- package/common/src/util/__tests__/analytics-log.test.ts +110 -0
- package/common/src/util/__tests__/analytics-sampling.test.ts +131 -0
- package/common/src/util/__tests__/axiom-only-log.test.ts +64 -0
- package/common/src/util/__tests__/engagement-tracker.test.ts +115 -0
- package/common/src/util/__tests__/error-abort.test.ts +822 -0
- package/common/src/util/__tests__/error-api-details.test.ts +190 -0
- package/common/src/util/__tests__/format-code-search.test.ts +60 -0
- package/common/src/util/__tests__/log-mirror.test.ts +31 -0
- package/common/src/util/__tests__/messages.test.ts +1118 -0
- package/common/src/util/__tests__/partial-json-delta.test.ts +505 -0
- package/common/src/util/__tests__/paths.test.ts +289 -0
- package/common/src/util/__tests__/promise.test.ts +334 -0
- package/common/src/util/__tests__/protocol-config.test.ts +119 -0
- package/common/src/util/__tests__/rate-limit.test.ts +28 -0
- package/common/src/util/__tests__/reddit-savant-free-retention.test.ts +120 -0
- package/common/src/util/__tests__/savant-free-streak.test.ts +142 -0
- package/common/src/util/__tests__/saxy.test.ts +1008 -0
- package/common/src/util/__tests__/string.test.ts +238 -0
- package/common/src/util/__tests__/zoned-time.test.ts +88 -0
- package/common/src/util/agent-file-utils.ts +110 -0
- package/common/src/util/agent-id-parsing.ts +147 -0
- package/common/src/util/agent-name-normalization.ts +39 -0
- package/common/src/util/analytics-dispatcher.ts +81 -0
- package/common/src/util/analytics-log.ts +84 -0
- package/common/src/util/analytics-sampling.ts +225 -0
- package/common/src/util/array.ts +63 -0
- package/common/src/util/axiom-only-log.ts +79 -0
- package/common/src/util/cache-debug.ts +191 -0
- package/common/src/util/credentials.ts +12 -0
- package/common/src/util/currency.ts +25 -0
- package/common/src/util/dates.ts +81 -0
- package/common/src/util/engagement-tracker.ts +133 -0
- package/common/src/util/error.ts +580 -0
- package/common/src/util/file.ts +363 -0
- package/common/src/util/format-code-search.ts +115 -0
- package/common/src/util/lazy-response-ads.ts +93 -0
- package/common/src/util/log-data.ts +57 -0
- package/common/src/util/log-mirror.ts +34 -0
- package/common/src/util/lru-cache.ts +67 -0
- package/common/src/util/messages.ts +600 -0
- package/common/src/util/model-utils.ts +25 -0
- package/common/src/util/object.ts +137 -0
- package/common/src/util/param-helpers.ts +49 -0
- package/common/src/util/partial-json-delta.ts +100 -0
- package/common/src/util/paths.ts +194 -0
- package/common/src/util/promise.ts +87 -0
- package/common/src/util/protocol-config.ts +141 -0
- package/common/src/util/random.ts +15 -0
- package/common/src/util/rate-limit.ts +56 -0
- package/common/src/util/reddit-capi-events.ts +40 -0
- package/common/src/util/reddit-savant-free-retention.ts +69 -0
- package/common/src/util/response-ad-positions.ts +54 -0
- package/common/src/util/savant-free-privacy.ts +78 -0
- package/common/src/util/savant-free-streak.ts +153 -0
- package/common/src/util/saxy.ts +739 -0
- package/common/src/util/skills.ts +32 -0
- package/common/src/util/stop-sequence.ts +60 -0
- package/common/src/util/string.ts +419 -0
- package/common/src/util/system-info.ts +51 -0
- package/common/src/util/type-narrowing.ts +125 -0
- package/common/src/util/xml.ts +17 -0
- package/common/src/util/zod-schema.ts +80 -0
- package/common/src/util/zoned-time.ts +136 -0
- package/common/src/utils/ask-user-bridge.ts +47 -0
- package/common/tsconfig.json +8 -0
- package/database.db +0 -0
- package/dev/LEARNINGS.md +309 -0
- package/dev/fids/.gitkeep +0 -0
- package/dev/fids/archive/.gitkeep +0 -0
- package/dev/fids/archive/FID-2026-0802-008-sdk-package-audit-client-run-run-state.md +238 -0
- package/dev/fids/archive/FID-2026-0803-001-echo-enforcement-layer-drift.md +404 -0
- package/dev/fids/archive/FID-2026-0803-002-llm-providers-database-audit.md +348 -0
- package/dev/fids/archive/FID-2026-0803-003-sdk-impl-common-util-audit.md +277 -0
- package/dev/fids/archive/FID-2026-0803-004-checkpoint-rewind.md +181 -0
- package/dev/fids/archive/FID-2026-0803-005-quality-scan-hygiene-fixes.md +265 -0
- package/dev/fids/archive/FID-2026-0803-006-code-map-audit-hygiene.md +243 -0
- package/dev/fids/archive/FID-2026-0803-007-evals-benchmark-audit-hygiene.md +296 -0
- package/dev/fids/archive/FID-2026-0803-009-echo-enforcement-doc-drift.md +112 -0
- package/dev/fids/archive/FID-2026-0803-010-database-llm-providers-low-fixes.md +255 -0
- package/dev/fids/archive/FID-2026-0803-011-build-artifact-hygiene.md +169 -0
- package/dev/fids/archive/FID-2026-0803-012-release-readiness-audit.md +162 -0
- package/dev/fids/archive/FID-2026-0803-013-agent-roster-over-reporting.md +146 -0
- package/dev/fids/archive/FID-2026-0803-014-freebuff-to-savant-rebrand-sweep.md +185 -0
- package/dev/nova/reports/2026-08-02-top-25-ai-inference-providers-competitive-intel.md +213 -0
- package/dev/nova/specs/echo-v0.1.2-freebuff.md +391 -0
- package/dev/nova/specs/goal-loop-feature-spec.md +245 -0
- package/dev/nova/specs/launch-strategy-research-prompt.md +88 -0
- package/dev/releases/README.md +50 -0
- package/dev/scratchpad/.gitkeep +0 -0
- package/dev/session-summaries/.gitkeep +0 -0
- package/dev/session-summaries/2026-07-16-1255.md +128 -0
- package/dev/session-summaries/2026-07-17-1000.md +64 -0
- package/dev/session-summaries/2026-07-19-eslint-zero-tolerance-cleanup.md +145 -0
- package/dev/session-summaries/2026-07-19-fid-026-debugging-and-rename.md +79 -0
- package/dev/session-summaries/2026-07-19-fid-026-phase-b-rebrand.md +76 -0
- package/dev/session-summaries/2026-07-19-fid-027-clean-break.md +47 -0
- package/dev/session-summaries/2026-07-19-pre-push-house-cleaning.md +100 -0
- package/dev/session-summaries/2026-07-19-v0.0.2-release-session.md +229 -0
- package/dev/session-summaries/2026-07-20-1805-fid-loop-closure.md +95 -0
- package/dev/session-summaries/2026-07-22-1800.md +52 -0
- package/dev/session-summaries/2026-07-23-fsm-optimization.md +88 -0
- package/dev/session-summaries/2026-07-25-0000.md +80 -0
- package/dev/session-summaries/2026-07-25-1200-context-compaction.md +154 -0
- package/dev/session-summaries/2026-07-25-1600-layer4-reactive-compact.md +96 -0
- package/dev/session-summaries/2026-07-25-1700-dev-folder-audit.md +161 -0
- package/dev/session-summaries/2026-07-25-2000-benchmark-v2-filters.md +147 -0
- package/dev/session-summaries/2026-07-25-2000.md +77 -0
- package/dev/session-summaries/2026-07-27-0000.md +63 -0
- package/dev/session-summaries/2026-07-28-history-capture-handoff.md +206 -0
- package/dev/session-summaries/2026-07-31-freebuff-echo-compliance-remediation.md +156 -0
- package/dev/session-summaries/2026-07-31-pre-launch-optimization-execution.md +46 -0
- package/dev/session-summaries/2026-0721-1800.md +44 -0
- package/dev/session-summaries/2026-08-01-sidebar-folded-startup.md +159 -0
- package/dev/session-summaries/2026-08-02-0.0.15-release-closeout.md +32 -0
- package/dev/session-summaries/2026-08-02-repository-hygiene.md +51 -0
- package/dev/session-summaries/2026-08-03-agent-roster-fix-and-ready-check-closeout.md +73 -0
- package/dev/session-summaries/2026-08-03-build-artifact-hygiene-closeout.md +40 -0
- package/dev/session-summaries/2026-08-03-code-map-audit-closeout.md +44 -0
- package/dev/session-summaries/2026-08-03-database-llm-providers-low-fixes-closeout.md +47 -0
- package/dev/session-summaries/2026-08-03-echo-enforcement-doc-drift-closeout.md +43 -0
- package/dev/session-summaries/2026-08-03-evals-benchmark-audit-closeout.md +50 -0
- package/dev/session-summaries/2026-08-03-quality-scan-hygiene-fixes-closeout.md +57 -0
- package/dev/session-summaries/2026-08-03-quality-session-checkpoint-rewind-closeout.md +56 -0
- package/dev/session-summaries/2026-08-03-release-readiness-audit-closeout.md +60 -0
- package/dev/test-prompts/archive/0.0.2-final-pass.md +209 -0
- package/dev/test-prompts/archive/agent-capabilities-full-test.md +361 -0
- package/dev/test-prompts/archive/agent-capabilities-test.md +471 -0
- package/dev/test-prompts/archive/comprehensive-az-system-test-v1.md +441 -0
- package/dev/test-prompts/archive/comprehensive-az-system-test-v2-report.md +377 -0
- package/dev/test-prompts/archive/comprehensive-az-system-test-v2.md +544 -0
- package/dev/test-prompts/archive/comprehensive-az-system-test.md +396 -0
- package/dev/test-prompts/archive/comprehensive-az-test-final.md +900 -0
- package/dev/test-prompts/archive/comprehensive-az-test-v11.md +141 -0
- package/dev/test-prompts/archive/comprehensive-az-test-v12.md +29 -0
- package/dev/test-prompts/archive/comprehensive-az-test-v6.md +631 -0
- package/dev/test-prompts/archive/comprehensive-az-test-v7.md +625 -0
- package/dev/test-prompts/archive/fid-007-ability-confirmation.md +248 -0
- package/dev/test-prompts/archive/fid-2026-0801-006-thinker-tool-call-boundary.md +86 -0
- package/dev/test-prompts/archive/fid-2026-0801-007-child-tool-set-fallback-cli.md +101 -0
- package/dev/test-prompts/archive/fid-2026-0801-008-provider-tool-call-accumulation-cli.md +111 -0
- package/dev/test-prompts/archive/fid-2026-0801-012-thinker-state-output-cli.md +134 -0
- package/dev/test-prompts/archive/gemini-deep-research-sidebar-highlight.md +598 -0
- package/dev/test-prompts/archive/goal-loop-cli-test.md +142 -0
- package/dev/test-prompts/archive/rebrand-qa.md +258 -0
- package/dev/test-prompts/archive/release-az-test-fid-085.md +306 -0
- package/dev/test-prompts/archive/release-az-test-fid-087.md +219 -0
- package/dev/test-prompts/archive/release-az-test-fid-2026-0726-001.md +270 -0
- package/dev/test-prompts/archive/release-az-test-fid-2026-0728-008.md +213 -0
- package/dev/test-prompts/archive/release-az-test-fid-2026-0728-launch-tracks.md +253 -0
- package/dev/test-prompts/archive/release-az-test-fid-2026-0731-pre-launch.md +102 -0
- package/docs/AI Coding Agents Market Research.md +516 -0
- package/docs/Agent Harness Feature Pairing Research.md +166 -0
- package/docs/CLI Agent Inference Backend Research.md +446 -0
- package/docs/Codebuff Rebranding And Migration Plan.md +418 -0
- package/docs/ECHO-EVOLUTION-ARCH.md +77 -0
- package/docs/Harness Engineering for Coding Agents Research.md +196 -0
- package/docs/Launch Plan Review and Optimization.md +178 -0
- package/docs/OpenTUI Sidebar Bug Fix.md +245 -0
- package/docs/SAVANT-VERSIONING.md +31 -0
- package/docs/Savant Code Launch Strategy.md +270 -0
- package/docs/Savant-Code Business And Backend Research.md +222 -0
- package/docs/agents-and-tools.md +217 -0
- package/docs/cloudflare-llms-full.md +9623 -0
- package/docs/design/OpenTUI Terminal Visualization Guide.md +471 -0
- package/docs/design/database-architecture.md +217 -0
- package/docs/design/deep-research-report.md +295 -0
- package/docs/design/thinker-sequentialthinking-regression-diagnostic.md +366 -0
- package/docs/discord-server-design.md +167 -0
- package/docs/gravity-integration-starter.md +202 -0
- package/docs/launch/hn-first-comment.md +44 -0
- package/docs/launch/hn-post.md +35 -0
- package/docs/launch/incident-response.md +88 -0
- package/docs/launch/landing/index.html +233 -0
- package/docs/launch/mastodon-thread.md +52 -0
- package/docs/launch/newsletter-pitch.md +49 -0
- package/docs/launch/twitter-thread.md +62 -0
- package/docs/privacy.md +186 -0
- package/docs/reports/Savant-Code Benchmark Specification.md +206 -0
- package/docs/reports/Thinker Agent Architecture Research.md +284 -0
- package/docs/reports/adoptable-features-2026-07-25.md +604 -0
- package/docs/reports/adoptable-features-master.md +480 -0
- package/docs/reports/codebuff-discord-feedback.md +43 -0
- package/docs/reports/feature-parity-report.md +810 -0
- package/docs/reports/repos/AionUi.md +75 -0
- package/docs/reports/repos/OpenHands.md +76 -0
- package/docs/reports/repos/SWE-agent.md +82 -0
- package/docs/reports/repos/agno.md +89 -0
- package/docs/reports/repos/aider.md +74 -0
- package/docs/reports/repos/cline.md +83 -0
- package/docs/reports/repos/codex.md +83 -0
- package/docs/reports/repos/gemini-cli.md +92 -0
- package/docs/reports/repos/goose.md +65 -0
- package/docs/reports/repos/gpt-pilot.md +52 -0
- package/docs/reports/repos/hermes-agent.md +101 -0
- package/docs/reports/repos/kilocode.md +79 -0
- package/docs/reports/repos/openclaude.md +99 -0
- package/docs/reports/repos/openclaw.md +100 -0
- package/docs/reports/repos/opencode-dev.md +78 -0
- package/docs/reports/repos/zero.md +123 -0
- package/docs/reports/savant-code-benchmark-v2-2026-08-03.md +76 -0
- package/docs/savant-code-modes.md +338 -0
- package/docs/testing.md +51 -0
- package/docs/visual-mockup-neon-slate.txt +41 -0
- package/eslint.config.js +211 -0
- package/evals/README.md +45 -0
- package/evals/benchmark/README.md +449 -0
- package/evals/benchmark/agent-runner.ts +217 -0
- package/evals/benchmark/analyze-task-scores.ts +496 -0
- package/evals/benchmark/eval-codebuff-hard.json +3343 -0
- package/evals/benchmark/eval-codebuff.json +3193 -0
- package/evals/benchmark/eval-codebuff2.json +2494 -0
- package/evals/benchmark/eval-manifold-hard.json +2525 -0
- package/evals/benchmark/eval-manifold.json +1675 -0
- package/evals/benchmark/eval-manifold2.json +1945 -0
- package/evals/benchmark/eval-plane-hard.json +4372 -0
- package/evals/benchmark/eval-plane.json +2028 -0
- package/evals/benchmark/eval-plane2.json +3517 -0
- package/evals/benchmark/eval-saleor-hard.json +6081 -0
- package/evals/benchmark/eval-saleor.json +1829 -0
- package/evals/benchmark/eval-saleor2.json +3273 -0
- package/evals/benchmark/eval-task-generator.ts +158 -0
- package/evals/benchmark/filter-supplemental-files.ts +225 -0
- package/evals/benchmark/format-output.ts +215 -0
- package/evals/benchmark/gen-evals.ts +294 -0
- package/evals/benchmark/gen-repo-eval.ts +71 -0
- package/evals/benchmark/judge.ts +308 -0
- package/evals/benchmark/lessons-extractor.ts +247 -0
- package/evals/benchmark/main-hard-tasks.ts +49 -0
- package/evals/benchmark/main-single-eval.ts +23 -0
- package/evals/benchmark/main.ts +29 -0
- package/evals/benchmark/meta-analyzer.ts +329 -0
- package/evals/benchmark/pick-commits.ts +627 -0
- package/evals/benchmark/run-benchmark.ts +657 -0
- package/evals/benchmark/runners/claude.ts +176 -0
- package/evals/benchmark/runners/codex.ts +143 -0
- package/evals/benchmark/runners/index.ts +4 -0
- package/evals/benchmark/runners/opencode.ts +253 -0
- package/evals/benchmark/runners/runner.ts +13 -0
- package/evals/benchmark/runners/savant.ts +148 -0
- package/evals/benchmark/setup-test-repo.ts +314 -0
- package/evals/benchmark/trace-analyzer.ts +257 -0
- package/evals/benchmark/trace-utils.ts +80 -0
- package/evals/benchmark/types.ts +83 -0
- package/evals/bunfig.toml +4 -0
- package/evals/logger.ts +87 -0
- package/evals/package.json +31 -0
- package/evals/subagents/test-repo-utils.ts +131 -0
- package/evals/tsconfig.json +13 -0
- package/evals/v2/README.md +149 -0
- package/evals/v2/reports/report.json +261 -0
- package/evals/v2/reports/report.md +15 -0
- package/evals/v2/schema/task.schema.json +172 -0
- package/evals/v2/src/cli.ts +216 -0
- package/evals/v2/src/golden.ts +73 -0
- package/evals/v2/src/harness.ts +293 -0
- package/evals/v2/src/metrics.ts +326 -0
- package/evals/v2/src/registry.ts +179 -0
- package/evals/v2/src/reports.ts +126 -0
- package/evals/v2/src/runner.ts +143 -0
- package/evals/v2/src/runners/savant.ts +105 -0
- package/evals/v2/src/sandbox.ts +42 -0
- package/evals/v2/src/sandboxes/docker.ts +49 -0
- package/evals/v2/src/sandboxes/tempdir.ts +120 -0
- package/evals/v2/src/schema.ts +83 -0
- package/evals/v2/src/trace.ts +186 -0
- package/evals/v2/src/verify.ts +199 -0
- package/evals/v2/tasks/error_recovery/env-fault/calculator.js +11 -0
- package/evals/v2/tasks/error_recovery/env-fault/calculator.test.js +15 -0
- package/evals/v2/tasks/error_recovery/env-fault/golden.patch +15 -0
- package/evals/v2/tasks/error_recovery/env-fault/task.yaml +20 -0
- package/evals/v2/tasks/multi_agent_orchestration/options-contract/app.js +5 -0
- package/evals/v2/tasks/multi_agent_orchestration/options-contract/app.test.js +7 -0
- package/evals/v2/tasks/multi_agent_orchestration/options-contract/golden.patch +19 -0
- package/evals/v2/tasks/multi_agent_orchestration/options-contract/greet.js +3 -0
- package/evals/v2/tasks/multi_agent_orchestration/options-contract/orchestration.test.js +30 -0
- package/evals/v2/tasks/multi_agent_orchestration/options-contract/task.yaml +29 -0
- package/evals/v2/tasks/pure_coding/add-fix/add.js +3 -0
- package/evals/v2/tasks/pure_coding/add-fix/add.test.js +11 -0
- package/evals/v2/tasks/pure_coding/add-fix/golden.patch +7 -0
- package/evals/v2/tasks/pure_coding/add-fix/task.yaml +20 -0
- package/evals/v2/tasks/pure_coding/rename-greet/app.js +5 -0
- package/evals/v2/tasks/pure_coding/rename-greet/app.test.js +32 -0
- package/evals/v2/tasks/pure_coding/rename-greet/golden.patch +19 -0
- package/evals/v2/tasks/pure_coding/rename-greet/greet.js +5 -0
- package/evals/v2/tasks/pure_coding/rename-greet/task.yaml +21 -0
- package/evals/v2/tests/golden.test.ts +104 -0
- package/evals/v2/tests/harness.test.ts +204 -0
- package/evals/v2/tests/metrics.test.ts +353 -0
- package/evals/v2/tests/registry.test.ts +210 -0
- package/evals/v2/tests/reports.test.ts +218 -0
- package/evals/v2/tests/savant-runner.test.ts +218 -0
- package/evals/v2/tests/schema.test.ts +127 -0
- package/evals/v2/tests/tempdir-sandbox.test.ts +49 -0
- package/evals/v2/tests/trace.test.ts +76 -0
- package/evals/v2/tests/verify.test.ts +224 -0
- package/license +202 -0
- package/package.json +71 -44
- package/packages/agent-runtime/README.md +46 -0
- package/packages/agent-runtime/agent_exit +1 -0
- package/packages/agent-runtime/bunfig.toml +2 -0
- package/packages/agent-runtime/package.json +34 -0
- package/packages/agent-runtime/src/__tests__/apply-patch-tool.test.ts +202 -0
- package/packages/agent-runtime/src/__tests__/cost-aggregation.test.ts +397 -0
- package/packages/agent-runtime/src/__tests__/generate-diffs-prompt.test.ts +107 -0
- package/packages/agent-runtime/src/__tests__/get-file-reading-updates.test.ts +59 -0
- package/packages/agent-runtime/src/__tests__/gravity-index-tool.test.ts +501 -0
- package/packages/agent-runtime/src/__tests__/loop-agent-steps.test.ts +1512 -0
- package/packages/agent-runtime/src/__tests__/main-prompt.test.ts +452 -0
- package/packages/agent-runtime/src/__tests__/n-parameter.test.ts +984 -0
- package/packages/agent-runtime/src/__tests__/process-file-block.test.ts +196 -0
- package/packages/agent-runtime/src/__tests__/process-str-replace.test.ts +512 -0
- package/packages/agent-runtime/src/__tests__/programmatic-tool-authorization.test.ts +219 -0
- package/packages/agent-runtime/src/__tests__/prompt-caching-subagents.test.ts +749 -0
- package/packages/agent-runtime/src/__tests__/prompts-schema-handling.test.ts +454 -0
- package/packages/agent-runtime/src/__tests__/propose-tools.test.ts +824 -0
- package/packages/agent-runtime/src/__tests__/read-docs-tool.test.ts +394 -0
- package/packages/agent-runtime/src/__tests__/run-agent-step-prefill.test.ts +161 -0
- package/packages/agent-runtime/src/__tests__/run-agent-step-tools.test.ts +612 -0
- package/packages/agent-runtime/src/__tests__/run-programmatic-step.test.ts +1743 -0
- package/packages/agent-runtime/src/__tests__/sandbox-generator.test.ts +154 -0
- package/packages/agent-runtime/src/__tests__/spawn-agents-image-content.test.ts +354 -0
- package/packages/agent-runtime/src/__tests__/spawn-agents-message-history.test.ts +280 -0
- package/packages/agent-runtime/src/__tests__/spawn-agents-permissions.test.ts +664 -0
- package/packages/agent-runtime/src/__tests__/stream-parser-abort.test.ts +250 -0
- package/packages/agent-runtime/src/__tests__/stream-parser-reasoning.test.ts +194 -0
- package/packages/agent-runtime/src/__tests__/subagent-streaming.test.ts +230 -0
- package/packages/agent-runtime/src/__tests__/test-utils.ts +96 -0
- package/packages/agent-runtime/src/__tests__/thinker-convergence-gate.test.ts +242 -0
- package/packages/agent-runtime/src/__tests__/to-token-count-input-schema.test.ts +81 -0
- package/packages/agent-runtime/src/__tests__/tool-executor-sandbox.test.ts +167 -0
- package/packages/agent-runtime/src/__tests__/tool-stream-parser.test.ts +682 -0
- package/packages/agent-runtime/src/__tests__/tool-validation-error.test.ts +1380 -0
- package/packages/agent-runtime/src/__tests__/web-search-tool.test.ts +402 -0
- package/packages/agent-runtime/src/__tests__/xml-tool-result-ordering.test.ts +264 -0
- package/packages/agent-runtime/src/constants.ts +12 -0
- package/packages/agent-runtime/src/context-compactor.ts +425 -0
- package/packages/agent-runtime/src/find-files/__tests__/request-files-prompt.test.ts +190 -0
- package/packages/agent-runtime/src/find-files/custom-file-picker-config.ts +61 -0
- package/packages/agent-runtime/src/find-files/request-files-prompt.ts +462 -0
- package/packages/agent-runtime/src/generate-diffs-prompt.ts +38 -0
- package/packages/agent-runtime/src/get-file-reading-updates.ts +27 -0
- package/packages/agent-runtime/src/llm-api/__tests__/gemini-with-fallbacks.test.ts +267 -0
- package/packages/agent-runtime/src/llm-api/__tests__/serper-api.test.ts +297 -0
- package/packages/agent-runtime/src/llm-api/claude.ts +7 -0
- package/packages/agent-runtime/src/llm-api/context7-api.ts +290 -0
- package/packages/agent-runtime/src/llm-api/gemini-with-fallbacks.ts +104 -0
- package/packages/agent-runtime/src/llm-api/savant-code-web-api.ts +370 -0
- package/packages/agent-runtime/src/llm-api/serper-api.ts +193 -0
- package/packages/agent-runtime/src/main-prompt.ts +251 -0
- package/packages/agent-runtime/src/mcp-constants.ts +12 -0
- package/packages/agent-runtime/src/mcp.ts +83 -0
- package/packages/agent-runtime/src/process-file-block.ts +118 -0
- package/packages/agent-runtime/src/process-str-replace.ts +213 -0
- package/packages/agent-runtime/src/prompt-agent-stream.ts +119 -0
- package/packages/agent-runtime/src/run-agent-step.ts +1632 -0
- package/packages/agent-runtime/src/run-programmatic-step.ts +633 -0
- package/packages/agent-runtime/src/system-prompt/prompts.ts +215 -0
- package/packages/agent-runtime/src/system-prompt/search-system-prompt.ts +89 -0
- package/packages/agent-runtime/src/system-prompt/truncate-file-tree.ts +414 -0
- package/packages/agent-runtime/src/templates/README.md +160 -0
- package/packages/agent-runtime/src/templates/__tests__/agent-registry.test.ts +489 -0
- package/packages/agent-runtime/src/templates/__tests__/strings.test.ts +465 -0
- package/packages/agent-runtime/src/templates/agent-registry.ts +122 -0
- package/packages/agent-runtime/src/templates/prompts.ts +189 -0
- package/packages/agent-runtime/src/templates/strings.ts +292 -0
- package/packages/agent-runtime/src/templates/types.ts +61 -0
- package/packages/agent-runtime/src/tool-stream-parser.ts +260 -0
- package/packages/agent-runtime/src/tools/filter-tool-set.ts +18 -0
- package/packages/agent-runtime/src/tools/handlers/__tests__/glob.test.ts +331 -0
- package/packages/agent-runtime/src/tools/handlers/__tests__/read-subtree.test.ts +346 -0
- package/packages/agent-runtime/src/tools/handlers/__tests__/run-readonly-command.test.ts +284 -0
- package/packages/agent-runtime/src/tools/handlers/handler-function-type.ts +77 -0
- package/packages/agent-runtime/src/tools/handlers/list.ts +105 -0
- package/packages/agent-runtime/src/tools/handlers/tool/__tests__/checkpoint-store.test.ts +394 -0
- package/packages/agent-runtime/src/tools/handlers/tool/__tests__/skill.test.ts +98 -0
- package/packages/agent-runtime/src/tools/handlers/tool/__tests__/write-file.test.ts +24 -0
- package/packages/agent-runtime/src/tools/handlers/tool/add-message.ts +37 -0
- package/packages/agent-runtime/src/tools/handlers/tool/add-subgoal.ts +30 -0
- package/packages/agent-runtime/src/tools/handlers/tool/apply-patch.ts +120 -0
- package/packages/agent-runtime/src/tools/handlers/tool/ask-user.ts +25 -0
- package/packages/agent-runtime/src/tools/handlers/tool/browser-logs.ts +21 -0
- package/packages/agent-runtime/src/tools/handlers/tool/checkpoint-store.ts +378 -0
- package/packages/agent-runtime/src/tools/handlers/tool/code-search.ts +21 -0
- package/packages/agent-runtime/src/tools/handlers/tool/composio.ts +52 -0
- package/packages/agent-runtime/src/tools/handlers/tool/create-plan.ts +63 -0
- package/packages/agent-runtime/src/tools/handlers/tool/end-turn.ts +15 -0
- package/packages/agent-runtime/src/tools/handlers/tool/find-files.ts +161 -0
- package/packages/agent-runtime/src/tools/handlers/tool/glob.ts +22 -0
- package/packages/agent-runtime/src/tools/handlers/tool/gravity-index.ts +230 -0
- package/packages/agent-runtime/src/tools/handlers/tool/list-directory.ts +22 -0
- package/packages/agent-runtime/src/tools/handlers/tool/lookup-agent-info.ts +105 -0
- package/packages/agent-runtime/src/tools/handlers/tool/propose-str-replace.ts +111 -0
- package/packages/agent-runtime/src/tools/handlers/tool/propose-write-file.ts +89 -0
- package/packages/agent-runtime/src/tools/handlers/tool/proposed-content-store.ts +64 -0
- package/packages/agent-runtime/src/tools/handlers/tool/read-docs.ts +160 -0
- package/packages/agent-runtime/src/tools/handlers/tool/read-files.ts +43 -0
- package/packages/agent-runtime/src/tools/handlers/tool/read-subtree.ts +198 -0
- package/packages/agent-runtime/src/tools/handlers/tool/read-url.ts +21 -0
- package/packages/agent-runtime/src/tools/handlers/tool/render-ui.ts +15 -0
- package/packages/agent-runtime/src/tools/handlers/tool/run-file-change-hooks.ts +20 -0
- package/packages/agent-runtime/src/tools/handlers/tool/run-readonly-command.ts +215 -0
- package/packages/agent-runtime/src/tools/handlers/tool/run-terminal-command.ts +33 -0
- package/packages/agent-runtime/src/tools/handlers/tool/sequential-thinking.ts +53 -0
- package/packages/agent-runtime/src/tools/handlers/tool/set-messages.ts +19 -0
- package/packages/agent-runtime/src/tools/handlers/tool/set-output.ts +104 -0
- package/packages/agent-runtime/src/tools/handlers/tool/set-scaffold-complete.ts +32 -0
- package/packages/agent-runtime/src/tools/handlers/tool/skill.ts +146 -0
- package/packages/agent-runtime/src/tools/handlers/tool/spawn-agent-inline.ts +149 -0
- package/packages/agent-runtime/src/tools/handlers/tool/spawn-agent-utils.ts +436 -0
- package/packages/agent-runtime/src/tools/handlers/tool/spawn-agents.ts +286 -0
- package/packages/agent-runtime/src/tools/handlers/tool/str-replace.ts +135 -0
- package/packages/agent-runtime/src/tools/handlers/tool/suggest-followups.ts +20 -0
- package/packages/agent-runtime/src/tools/handlers/tool/task-completed.ts +15 -0
- package/packages/agent-runtime/src/tools/handlers/tool/think-deeply.ts +25 -0
- package/packages/agent-runtime/src/tools/handlers/tool/transition-phase.ts +160 -0
- package/packages/agent-runtime/src/tools/handlers/tool/update-subgoal.ts +48 -0
- package/packages/agent-runtime/src/tools/handlers/tool/web-search.ts +151 -0
- package/packages/agent-runtime/src/tools/handlers/tool/write-file.ts +281 -0
- package/packages/agent-runtime/src/tools/handlers/tool/write-todos.ts +19 -0
- package/packages/agent-runtime/src/tools/prompts.ts +233 -0
- package/packages/agent-runtime/src/tools/sandbox/__tests__/engine.test.ts +169 -0
- package/packages/agent-runtime/src/tools/sandbox/__tests__/shell-denylist.test.ts +104 -0
- package/packages/agent-runtime/src/tools/sandbox/engine.ts +109 -0
- package/packages/agent-runtime/src/tools/sandbox/index.ts +14 -0
- package/packages/agent-runtime/src/tools/sandbox/shell-denylist.ts +119 -0
- package/packages/agent-runtime/src/tools/stream-parser.ts +407 -0
- package/packages/agent-runtime/src/tools/thinker-convergence-gate.ts +162 -0
- package/packages/agent-runtime/src/tools/thought-session-store.ts +43 -0
- package/packages/agent-runtime/src/tools/tool-executor.ts +1098 -0
- package/packages/agent-runtime/src/util/__tests__/messages.test.ts +995 -0
- package/packages/agent-runtime/src/util/__tests__/parse-tool-calls-from-text.test.ts +363 -0
- package/packages/agent-runtime/src/util/__tests__/simplify-tool-results.test.ts +382 -0
- package/packages/agent-runtime/src/util/__tests__/stream-xml-parser.test.ts +285 -0
- package/packages/agent-runtime/src/util/__tests__/think-tags.test.ts +49 -0
- package/packages/agent-runtime/src/util/__tests__/token-counter.test.ts +121 -0
- package/packages/agent-runtime/src/util/activity-tracking.ts +252 -0
- package/packages/agent-runtime/src/util/agent-output.ts +102 -0
- package/packages/agent-runtime/src/util/cache-debug.ts +330 -0
- package/packages/agent-runtime/src/util/format-value.ts +16 -0
- package/packages/agent-runtime/src/util/messages.ts +461 -0
- package/packages/agent-runtime/src/util/parse-tool-calls-from-text.ts +122 -0
- package/packages/agent-runtime/src/util/render-read-files-result.ts +18 -0
- package/packages/agent-runtime/src/util/simplify-tool-results.ts +61 -0
- package/packages/agent-runtime/src/util/stream-xml-parser.ts +259 -0
- package/packages/agent-runtime/src/util/think-tags.ts +33 -0
- package/packages/agent-runtime/src/util/token-counter.ts +136 -0
- package/packages/agent-runtime/tsconfig.json +8 -0
- package/packages/code-map/README.md +43 -0
- package/packages/code-map/__tests__/integration.test.ts +278 -0
- package/packages/code-map/__tests__/languages.test.ts +240 -0
- package/packages/code-map/__tests__/parse.test.ts +640 -0
- package/packages/code-map/__tests__/test-langs/test.c +42 -0
- package/packages/code-map/__tests__/test-langs/test.cpp +34 -0
- package/packages/code-map/__tests__/test-langs/test.cs +34 -0
- package/packages/code-map/__tests__/test-langs/test.go +27 -0
- package/packages/code-map/__tests__/test-langs/test.java +31 -0
- package/packages/code-map/__tests__/test-langs/test.js +50 -0
- package/packages/code-map/__tests__/test-langs/test.php +34 -0
- package/packages/code-map/__tests__/test-langs/test.py +25 -0
- package/packages/code-map/__tests__/test-langs/test.rb +28 -0
- package/packages/code-map/__tests__/test-langs/test.rs +28 -0
- package/packages/code-map/__tests__/test-langs/test.ts +31 -0
- package/packages/code-map/package.json +33 -0
- package/packages/code-map/src/index.ts +4 -0
- package/packages/code-map/src/init-node.ts +185 -0
- package/packages/code-map/src/languages.ts +344 -0
- package/packages/code-map/src/parse.ts +410 -0
- package/packages/code-map/src/tree-sitter-queries/readme.md +24 -0
- package/packages/code-map/src/tree-sitter-queries/tree-sitter-c-tags.scm +16 -0
- package/packages/code-map/src/tree-sitter-queries/tree-sitter-c_sharp-tags.scm +23 -0
- package/packages/code-map/src/tree-sitter-queries/tree-sitter-cpp-tags.scm +29 -0
- package/packages/code-map/src/tree-sitter-queries/tree-sitter-go-tags.scm +26 -0
- package/packages/code-map/src/tree-sitter-queries/tree-sitter-java-tags.scm +19 -0
- package/packages/code-map/src/tree-sitter-queries/tree-sitter-javascript-tags.scm +16 -0
- package/packages/code-map/src/tree-sitter-queries/tree-sitter-php-tags.scm +23 -0
- package/packages/code-map/src/tree-sitter-queries/tree-sitter-python-tags.scm +12 -0
- package/packages/code-map/src/tree-sitter-queries/tree-sitter-ruby-tags.scm +58 -0
- package/packages/code-map/src/tree-sitter-queries/tree-sitter-rust-tags.scm +26 -0
- package/packages/code-map/src/tree-sitter-queries/tree-sitter-typescript-tags.scm +22 -0
- package/packages/code-map/src/types.ts +11 -0
- package/packages/code-map/src/utils.ts +12 -0
- package/packages/code-map/tsconfig.json +10 -0
- package/packages/database/README.md +43 -0
- package/packages/database/package.json +28 -0
- package/packages/database/src/__tests__/service.test.ts +167 -0
- package/packages/database/src/index.ts +146 -0
- package/packages/database/src/service.ts +342 -0
- package/packages/database/tsconfig.json +9 -0
- package/packages/llm-providers/README.md +42 -0
- package/packages/llm-providers/package.json +42 -0
- package/packages/llm-providers/src/ollama/__tests__/detect.test.ts +59 -0
- package/packages/llm-providers/src/ollama/detect.ts +113 -0
- package/packages/llm-providers/src/ollama/index.ts +2 -0
- package/packages/llm-providers/src/openai-compatible/chat/convert-to-openai-compatible-chat-messages.test.ts +855 -0
- package/packages/llm-providers/src/openai-compatible/chat/convert-to-openai-compatible-chat-messages.ts +177 -0
- package/packages/llm-providers/src/openai-compatible/chat/get-response-metadata.ts +15 -0
- package/packages/llm-providers/src/openai-compatible/chat/map-openai-compatible-finish-reason.ts +19 -0
- package/packages/llm-providers/src/openai-compatible/chat/openai-compatible-api-types.ts +60 -0
- package/packages/llm-providers/src/openai-compatible/chat/openai-compatible-chat-language-model.test.ts +549 -0
- package/packages/llm-providers/src/openai-compatible/chat/openai-compatible-chat-language-model.ts +474 -0
- package/packages/llm-providers/src/openai-compatible/chat/openai-compatible-chat-options.ts +25 -0
- package/packages/llm-providers/src/openai-compatible/chat/openai-compatible-metadata-extractor.ts +49 -0
- package/packages/llm-providers/src/openai-compatible/chat/openai-compatible-prepare-tools.ts +162 -0
- package/packages/llm-providers/src/openai-compatible/chat/stream-transform.test.ts +106 -0
- package/packages/llm-providers/src/openai-compatible/chat/stream-transform.ts +585 -0
- package/packages/llm-providers/src/openai-compatible/completion/convert-to-openai-compatible-completion-prompt.ts +98 -0
- package/packages/llm-providers/src/openai-compatible/completion/openai-compatible-completion-language-model.test.ts +173 -0
- package/packages/llm-providers/src/openai-compatible/completion/openai-compatible-completion-language-model.ts +414 -0
- package/packages/llm-providers/src/openai-compatible/completion/openai-compatible-completion-options.ts +33 -0
- package/packages/llm-providers/src/openai-compatible/embedding/openai-compatible-embedding-model.ts +143 -0
- package/packages/llm-providers/src/openai-compatible/embedding/openai-compatible-embedding-options.ts +21 -0
- package/packages/llm-providers/src/openai-compatible/image/openai-compatible-image-model.ts +129 -0
- package/packages/llm-providers/src/openai-compatible/image/openai-compatible-image-settings.ts +1 -0
- package/packages/llm-providers/src/openai-compatible/index.ts +27 -0
- package/packages/llm-providers/src/openai-compatible/openai-compatible-error.ts +34 -0
- package/packages/llm-providers/src/openai-compatible/openai-compatible-provider.ts +174 -0
- package/packages/llm-providers/src/openai-compatible/version.ts +5 -0
- package/packages/llm-providers/tsconfig.json +9 -0
- package/protocol.config.yaml +113 -0
- package/savant-free/README.md +73 -0
- package/savant-free/SPEC.md +385 -0
- package/savant-free/cli/build.ts +49 -0
- package/savant-free/cli/release/README.md +55 -0
- package/savant-free/cli/release/index.js +37 -0
- package/savant-free/cli/release/package.json +43 -0
- package/savant-free/cli/release.ts +128 -0
- package/savant-free/cli/smoke-test.test.ts +257 -0
- package/savant-free/e2e/README.md +173 -0
- package/savant-free/e2e/agent/savant-free-tester.ts +52 -0
- package/savant-free/e2e/tests/ads-behavior.e2e.test.ts +51 -0
- package/savant-free/e2e/tests/agent-startup.e2e.test.ts +61 -0
- package/savant-free/e2e/tests/code-edit.e2e.test.ts +78 -0
- package/savant-free/e2e/tests/help-command.e2e.test.ts +97 -0
- package/savant-free/e2e/tests/knowledge-file.e2e.test.ts +66 -0
- package/savant-free/e2e/tests/slash-commands.e2e.test.ts +119 -0
- package/savant-free/e2e/tests/startup.e2e.test.ts +56 -0
- package/savant-free/e2e/tests/terminal-command.e2e.test.ts +71 -0
- package/savant-free/e2e/tests/version.e2e.test.ts +50 -0
- package/savant-free/e2e/utils/binary-helpers.ts +24 -0
- package/savant-free/e2e/utils/index.ts +17 -0
- package/savant-free/e2e/utils/savant-free-session.ts +229 -0
- package/savant-free/e2e/utils/tmux-custom-tools.ts +156 -0
- package/savant-free/e2e/utils/tmux-helpers.ts +79 -0
- package/savant-free/package.json +20 -0
- package/scripts/eslint-rules/__fixtures__/debug-ast.mjs +20 -0
- package/scripts/eslint-rules/__fixtures__/probe.mjs +41 -0
- package/scripts/eslint-rules/__fixtures__/probe2.mjs +43 -0
- package/scripts/eslint-rules/__fixtures__/rule-test.mjs +44 -0
- package/scripts/eslint-rules/__fixtures__/rule-test2.mjs +27 -0
- package/scripts/eslint-rules/__fixtures__/unknown-bad.ts +21 -0
- package/scripts/eslint-rules/__fixtures__/unknown-good.ts +35 -0
- package/scripts/eslint-rules/no-unknown-in-signatures.js +141 -0
- package/scripts/release.py +360 -0
- package/scripts/run-az-test.sh +1150 -0
- package/scripts/sync-agents.py +337 -0
- package/scripts/tmux/README.md +359 -0
- package/scripts/tmux/package.json +9 -0
- package/scripts/tmux/tmux-capture.sh +231 -0
- package/scripts/tmux/tmux-cli.sh +160 -0
- package/scripts/tmux/tmux-env.sh +34 -0
- package/scripts/tmux/tmux-send.sh +339 -0
- package/scripts/tmux/tmux-start.sh +264 -0
- package/scripts/tmux/tmux-stop.sh +157 -0
- package/scripts/tmux/tmux-viewer/README.md +254 -0
- package/scripts/tmux/tmux-viewer/components/session-viewer.tsx +556 -0
- package/scripts/tmux/tmux-viewer/components/theme.ts +54 -0
- package/scripts/tmux/tmux-viewer/gif-encoder-2.d.ts +28 -0
- package/scripts/tmux/tmux-viewer/gif-exporter.ts +278 -0
- package/scripts/tmux/tmux-viewer/index.tsx +237 -0
- package/scripts/tmux/tmux-viewer/package.json +9 -0
- package/scripts/tmux/tmux-viewer/session-loader.ts +234 -0
- package/scripts/tmux/tmux-viewer/tsconfig.json +9 -0
- package/scripts/tmux/tmux-viewer/types.ts +76 -0
- package/sdk/CHANGELOG.md +126 -0
- package/sdk/PUBLISHING.md +55 -0
- package/sdk/README.md +334 -0
- package/sdk/bunfig.toml +6 -0
- package/sdk/e2e/README.md +158 -0
- package/sdk/e2e/custom-agents/api-integration-agent.e2e.test.ts +145 -0
- package/sdk/e2e/custom-agents/apply-patch-tool.e2e.test.ts +62 -0
- package/sdk/e2e/custom-agents/database-query-agent.e2e.test.ts +135 -0
- package/sdk/e2e/custom-agents/weather-agent.e2e.test.ts +120 -0
- package/sdk/e2e/examples/code-explainer.example.ts +62 -0
- package/sdk/e2e/examples/code-reviewer.example.ts +52 -0
- package/sdk/e2e/examples/commit-message-generator.example.ts +61 -0
- package/sdk/e2e/examples/sdk-lint.example.ts +65 -0
- package/sdk/e2e/examples/sdk-refactor.example.ts +63 -0
- package/sdk/e2e/examples/sdk-test-gen.example.ts +62 -0
- package/sdk/e2e/features/knowledge-files.e2e.test.ts +82 -0
- package/sdk/e2e/features/max-agent-steps.e2e.test.ts +65 -0
- package/sdk/e2e/features/project-files.e2e.test.ts +80 -0
- package/sdk/e2e/integration/connection-check.integration.test.ts +33 -0
- package/sdk/e2e/integration/event-ordering.integration.test.ts +186 -0
- package/sdk/e2e/integration/event-types.integration.test.ts +183 -0
- package/sdk/e2e/integration/stream-chunks.integration.test.ts +191 -0
- package/sdk/e2e/streaming/concurrent-streams.e2e.test.ts +164 -0
- package/sdk/e2e/streaming/subagent-streaming.e2e.test.ts +158 -0
- package/sdk/e2e/utils/__tests__/event-collector.test.ts +297 -0
- package/sdk/e2e/utils/e2e-mocks.ts +458 -0
- package/sdk/e2e/utils/event-collector.ts +145 -0
- package/sdk/e2e/utils/get-api-key.ts +76 -0
- package/sdk/e2e/utils/index.ts +3 -0
- package/sdk/e2e/utils/test-fixtures.ts +196 -0
- package/sdk/e2e/workflows/error-recovery.e2e.test.ts +112 -0
- package/sdk/e2e/workflows/multi-turn-conversation.e2e.test.ts +132 -0
- package/sdk/examples/readme-example-1.ts +34 -0
- package/sdk/examples/readme-example-2.ts +76 -0
- package/sdk/package.json +82 -0
- package/sdk/scripts/build.ts +349 -0
- package/sdk/scripts/fetch-ripgrep.ts +172 -0
- package/sdk/scripts/publish.ts +51 -0
- package/sdk/scripts/release.js +100 -0
- package/sdk/scripts/verify.ts +204 -0
- package/sdk/sdk_exit +1 -0
- package/sdk/smoke-test-dist.ts +248 -0
- package/sdk/src/__tests__/apply-overrides-resume.test.ts +83 -0
- package/sdk/src/__tests__/apply-patch.test.ts +438 -0
- package/sdk/src/__tests__/build-file-tree.test.ts +31 -0
- package/sdk/src/__tests__/change-file.test.ts +212 -0
- package/sdk/src/__tests__/client.test.ts +142 -0
- package/sdk/src/__tests__/clone-session-state.test.ts +158 -0
- package/sdk/src/__tests__/code-search.test.ts +896 -0
- package/sdk/src/__tests__/composio.test.ts +86 -0
- package/sdk/src/__tests__/credentials.test.ts +344 -0
- package/sdk/src/__tests__/database.test.ts +153 -0
- package/sdk/src/__tests__/env.test.ts +137 -0
- package/sdk/src/__tests__/error-utils.test.ts +253 -0
- package/sdk/src/__tests__/fixtures/windows-stubborn-grandchild.ts +26 -0
- package/sdk/src/__tests__/initial-session-state.test.ts +447 -0
- package/sdk/src/__tests__/knowledge-file-selection.test.ts +335 -0
- package/sdk/src/__tests__/load-agents.test.ts +935 -0
- package/sdk/src/__tests__/load-mcp-config.test.ts +285 -0
- package/sdk/src/__tests__/load-skills.test.ts +325 -0
- package/sdk/src/__tests__/model-provider.test.ts +44 -0
- package/sdk/src/__tests__/path-utils.test.ts +66 -0
- package/sdk/src/__tests__/read-files.test.ts +573 -0
- package/sdk/src/__tests__/read-url.test.ts +371 -0
- package/sdk/src/__tests__/researcher-web.integration.test.ts +130 -0
- package/sdk/src/__tests__/run-cancellation.test.ts +1321 -0
- package/sdk/src/__tests__/run-error-preserves-history.test.ts +335 -0
- package/sdk/src/__tests__/run-event-dispatch.test.ts +80 -0
- package/sdk/src/__tests__/run-file-filter.test.ts +530 -0
- package/sdk/src/__tests__/run-handle-event.test.ts +142 -0
- package/sdk/src/__tests__/run-mcp-tool-filter.test.ts +124 -0
- package/sdk/src/__tests__/run-state-child-process.test.ts +72 -0
- package/sdk/src/__tests__/run-terminal-command.test.ts +236 -0
- package/sdk/src/__tests__/run.integration.test.ts +170 -0
- package/sdk/src/__tests__/user-knowledge-files.test.ts +361 -0
- package/sdk/src/__tests__/validate-agents.test.ts +943 -0
- package/sdk/src/agents/load-agents.ts +339 -0
- package/sdk/src/agents/load-mcp-config.ts +275 -0
- package/sdk/src/client.ts +87 -0
- package/sdk/src/composio.ts +78 -0
- package/sdk/src/constants.ts +29 -0
- package/sdk/src/credentials.ts +303 -0
- package/sdk/src/custom-tool.ts +66 -0
- package/sdk/src/env.ts +116 -0
- package/sdk/src/error-utils.ts +127 -0
- package/sdk/src/impl/__tests__/llm-chatgpt-oauth-policy.test.ts +67 -0
- package/sdk/src/impl/__tests__/llm-native-tool-call.test.ts +38 -0
- package/sdk/src/impl/__tests__/llm-stream-yielded-content.test.ts +118 -0
- package/sdk/src/impl/__tests__/model-provider-free-mode.test.ts +166 -0
- package/sdk/src/impl/__tests__/prompt-result.test.ts +210 -0
- package/sdk/src/impl/__tests__/provider-options-metadata.test.ts +67 -0
- package/sdk/src/impl/agent-runtime.ts +159 -0
- package/sdk/src/impl/chatgpt-backend-fetch.ts +588 -0
- package/sdk/src/impl/database.ts +516 -0
- package/sdk/src/impl/llm.ts +852 -0
- package/sdk/src/impl/model-provider.ts +638 -0
- package/sdk/src/impl/openrouter-key-resolver.ts +78 -0
- package/sdk/src/index.ts +133 -0
- package/sdk/src/native/ripgrep.ts +141 -0
- package/sdk/src/retry-config.ts +51 -0
- package/sdk/src/run-state.ts +897 -0
- package/sdk/src/run.ts +1222 -0
- package/sdk/src/skills/load-skills.ts +253 -0
- package/sdk/src/testing/env.ts +19 -0
- package/sdk/src/tools/apply-patch.ts +690 -0
- package/sdk/src/tools/change-file.ts +155 -0
- package/sdk/src/tools/code-search.ts +547 -0
- package/sdk/src/tools/glob.ts +58 -0
- package/sdk/src/tools/index.ts +19 -0
- package/sdk/src/tools/list-directory.ts +52 -0
- package/sdk/src/tools/path-utils.ts +101 -0
- package/sdk/src/tools/read-files.ts +110 -0
- package/sdk/src/tools/read-url.ts +469 -0
- package/sdk/src/tools/run-file-change-hooks.ts +22 -0
- package/sdk/src/tools/run-terminal-command.ts +483 -0
- package/sdk/src/tools/ssrf.ts +120 -0
- package/sdk/src/types/env.ts +40 -0
- package/sdk/src/utils/logger.ts +15 -0
- package/sdk/src/validate-agents.ts +157 -0
- package/sdk/test/cjs-compatibility/package-lock.json +423 -0
- package/sdk/test/cjs-compatibility/package.json +21 -0
- package/sdk/test/cjs-compatibility/test-imports.js +77 -0
- package/sdk/test/cjs-compatibility/test-types.ts +54 -0
- package/sdk/test/cjs-compatibility/tsconfig.json +17 -0
- package/sdk/test/esm-compatibility/package-lock.json +423 -0
- package/sdk/test/esm-compatibility/package.json +21 -0
- package/sdk/test/esm-compatibility/test-imports.js +83 -0
- package/sdk/test/esm-compatibility/test-types.ts +59 -0
- package/sdk/test/esm-compatibility/tsconfig.json +17 -0
- package/sdk/test/ripgrep-bundling/package-lock.json +423 -0
- package/sdk/test/ripgrep-bundling/package.json +21 -0
- package/sdk/test/ripgrep-bundling/test-ripgrep-types.ts +132 -0
- package/sdk/test/ripgrep-bundling/test-ripgrep.js +257 -0
- package/sdk/test/ripgrep-bundling/tsconfig.json +15 -0
- package/sdk/test/setup-env.ts +54 -0
- package/sdk/test/test-sdk.ts +25 -0
- package/sdk/test/tree-sitter-queries/package-lock.json +47 -0
- package/sdk/test/tree-sitter-queries/package.json +12 -0
- package/sdk/test/tree-sitter-queries/test-query-files.js +256 -0
- package/sdk/tsconfig.build.json +32 -0
- package/sdk/tsconfig.json +27 -0
- package/sdk/vendor/ripgrep/arm64-darwin/rg +0 -0
- package/sdk/vendor/ripgrep/arm64-linux/rg +0 -0
- package/sdk/vendor/ripgrep/x64-darwin/rg +0 -0
- package/sdk/vendor/ripgrep/x64-linux/rg +0 -0
- package/sdk/vendor/ripgrep/x64-win32/rg.exe +0 -0
- package/templates/FID-TEMPLATE.md +125 -0
- package/templates/README-TEMPLATE.md +87 -0
- package/templates/SESSION-SUMMARY.md +135 -0
- package/tsconfig.base.json +18 -0
- package/tsconfig.json +27 -0
- /package/{http.js → cli/release-core/http.js} +0 -0
- /package/{launcher.js → cli/release-core/launcher.js} +0 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Newsletter Pitch (Console.dev style)
|
|
2
|
+
|
|
3
|
+
**To:** Console.dev submissions
|
|
4
|
+
**Subject:** Submission: Savant Code — local-first AI coding CLI with a 9-agent
|
|
5
|
+
auditing loop
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
Hi Console.dev team,
|
|
10
|
+
|
|
11
|
+
I would like to submit Savant Code for consideration.
|
|
12
|
+
|
|
13
|
+
## What it is
|
|
14
|
+
|
|
15
|
+
Savant Code is an open-source, terminal-native AI coding assistant. Instead of
|
|
16
|
+
racing to generate code as fast as possible, it runs a 9-agent "perfection
|
|
17
|
+
loop" that audits, critiques, and rewrites changes before they touch your
|
|
18
|
+
codebase.
|
|
19
|
+
|
|
20
|
+
## Why it matters
|
|
21
|
+
|
|
22
|
+
Most AI coding tools optimize for speed. Savant Code optimizes for correctness.
|
|
23
|
+
The loop is slower by design, but the output is code that actually works. It is
|
|
24
|
+
built for developers who are tired of debugging hallucinated patches.
|
|
25
|
+
|
|
26
|
+
## Local-first and provider choice
|
|
27
|
+
|
|
28
|
+
- Local-first: auto-detects Ollama and routes inference locally.
|
|
29
|
+
- BYOK: bring your own API keys if you prefer; remote providers receive the
|
|
30
|
+
prompt and context you choose to send them.
|
|
31
|
+
- No mandatory account is required for a local Ollama workflow.
|
|
32
|
+
- Telemetry/privacy policy remains an explicit pre-launch decision and is not
|
|
33
|
+
asserted as resolved by this submission.
|
|
34
|
+
|
|
35
|
+
## Built with
|
|
36
|
+
|
|
37
|
+
- TypeScript + Bun
|
|
38
|
+
- React + OpenTUI for the terminal UI
|
|
39
|
+
- ECHO Protocol for agent governance
|
|
40
|
+
- Apache-2.0 license
|
|
41
|
+
|
|
42
|
+
## Links
|
|
43
|
+
|
|
44
|
+
- GitHub: <https://github.com/savant0x/savant-code>
|
|
45
|
+
- Docs: <https://github.com/savant0x/savant-code/blob/main/ECHO.md>
|
|
46
|
+
|
|
47
|
+
Thanks for considering it.
|
|
48
|
+
|
|
49
|
+
— The Savant Code team
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Twitter/X Launch Thread
|
|
2
|
+
|
|
3
|
+
Tweet 1/5 — hook
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
Stop babysitting your AI coding assistant.
|
|
7
|
+
|
|
8
|
+
Most agents ship fast code. Savant Code ships code that actually works.
|
|
9
|
+
|
|
10
|
+
A 9-agent perfection loop audits every change before it touches your repo.
|
|
11
|
+
|
|
12
|
+
Install: npm install -g savant-code
|
|
13
|
+
|
|
14
|
+
#AI #OpenSource #CLI #DevTools
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Tweet 2/5 — privacy angle
|
|
18
|
+
|
|
19
|
+
```text
|
|
20
|
+
Your codebase is valuable. You should not have to ship it to someone else's
|
|
21
|
+
server.
|
|
22
|
+
|
|
23
|
+
Savant Code is local-first with Ollama auto-detection. No API key. No account.
|
|
24
|
+
No setup prompts.
|
|
25
|
+
|
|
26
|
+
BYOK mode is there if you want it, but local is the default.
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Tweet 3/5 — demo
|
|
30
|
+
|
|
31
|
+
```text
|
|
32
|
+
Here is what the perfection loop looks like in practice:
|
|
33
|
+
|
|
34
|
+
A terminal demo asset is not yet available; the workflow is documented in the
|
|
35
|
+
repository and ECHO Protocol.
|
|
36
|
+
|
|
37
|
+
The red phase finds it. The green phase fixes it. The audit phase verifies it.
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Tweet 4/5 — competition
|
|
41
|
+
|
|
42
|
+
```text
|
|
43
|
+
vs. Copilot/Cursor: we audit before writing, not after.
|
|
44
|
+
vs. Cline: BYOK and local Ollama by default, no plaintext key storage.
|
|
45
|
+
vs. OpenHands: no Docker required, single-command install.
|
|
46
|
+
|
|
47
|
+
Built with TypeScript, Bun, React, and the ECHO Protocol.
|
|
48
|
+
Apache-2.0 licensed.
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Tweet 5/5 — call to action
|
|
52
|
+
|
|
53
|
+
```text
|
|
54
|
+
We are stress-testing the local Ollama integration before a wider launch.
|
|
55
|
+
|
|
56
|
+
If you have a real codebase and 5 minutes, try it and break it.
|
|
57
|
+
|
|
58
|
+
GitHub: <https://github.com/savant0x/savant-code>
|
|
59
|
+
Discord: not yet available; please use GitHub Issues for feedback.
|
|
60
|
+
|
|
61
|
+
Issues with repros are love letters.
|
|
62
|
+
```
|
package/docs/privacy.md
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
# Savant Code Privacy Architecture
|
|
2
|
+
|
|
3
|
+
> **Scope:** This document describes what data Savant Code collects, where it
|
|
4
|
+
> goes, and how users control it. It covers the CLI, SDK, and agent-runtime.
|
|
5
|
+
>
|
|
6
|
+
> **Version:** v0.0.18
|
|
7
|
+
>
|
|
8
|
+
> **Applies to:** `cli`, `sdk`, `packages/agent-runtime`, `common`
|
|
9
|
+
|
|
10
|
+
## 1. Core Privacy Principles
|
|
11
|
+
|
|
12
|
+
1. **Local-first by default.** Code, prompts, and file contents stay on the
|
|
13
|
+
user's machine unless the user explicitly chooses a cloud provider.
|
|
14
|
+
2. **Bring Your Own Key (BYOK).** The user supplies their own API keys. Savant
|
|
15
|
+
Code does not vend, own, or proxy inference credentials.
|
|
16
|
+
3. **Telemetry is user-controlled.** Remote analytics and error reporting
|
|
17
|
+
default to enabled for new users, can be disabled at any time with `/telemetry disable`, and are separate from ad
|
|
18
|
+
consent.
|
|
19
|
+
4. **Controlled credential storage in the BYOK flow.** Provider API keys may be read from environment variables or
|
|
20
|
+
secure masked user input. Explicit environment variables take precedence; keys entered through `/provider` are
|
|
21
|
+
stored locally in the user's `credentials.json` with the existing backend credential profile preserved.
|
|
22
|
+
5. **Transparent network calls.** Every network request the CLI makes is
|
|
23
|
+
documented below.
|
|
24
|
+
|
|
25
|
+
## 2. Data Boundaries
|
|
26
|
+
|
|
27
|
+
### What Stays on the Machine
|
|
28
|
+
|
|
29
|
+
- Source code and project files
|
|
30
|
+
- User prompts and chat history
|
|
31
|
+
- Model outputs generated through local or BYOK providers
|
|
32
|
+
- Settings (`~/.savant-code[-env]/settings.json`) and locally stored provider credentials (`credentials.json`)
|
|
33
|
+
- Sandbox permission mode and safety registry state
|
|
34
|
+
|
|
35
|
+
### What May Leave the Machine
|
|
36
|
+
|
|
37
|
+
- **Inference requests** to the user's chosen provider (OpenRouter, Ollama,
|
|
38
|
+
gateway, etc.) when using BYOK mode.
|
|
39
|
+
- **Authentication requests** to Savant Code backend when the user logs in.
|
|
40
|
+
- **Telemetry events** while remote analytics is enabled; users can disable them
|
|
41
|
+
with `/telemetry disable`.
|
|
42
|
+
- **Ad impression/click events** while ads are enabled; ad consent remains
|
|
43
|
+
separate from telemetry.
|
|
44
|
+
- **Update-check requests** to determine whether a newer CLI version is
|
|
45
|
+
available.
|
|
46
|
+
- **Error/crash logs** when the user explicitly opts into full telemetry.
|
|
47
|
+
|
|
48
|
+
## 3. Credential Storage
|
|
49
|
+
|
|
50
|
+
### BYOK API Keys
|
|
51
|
+
|
|
52
|
+
- Environment-provided BYOK keys are read at runtime and are never copied to
|
|
53
|
+
disk by Savant Code. Current direct-provider variables include
|
|
54
|
+
`OPENCODE_GO_API_KEY`, `TOKENROUTER_API_KEY`, `NVIDIA_API_KEY`, and
|
|
55
|
+
`COMMAND_CODE_API_KEY`.
|
|
56
|
+
- Keys entered through the masked `/provider` flow are stored in the user's
|
|
57
|
+
local `credentials.json` so npm-installed users can configure a provider
|
|
58
|
+
without editing shell profiles.
|
|
59
|
+
- Explicit environment variables take precedence over stored provider keys.
|
|
60
|
+
- Provider keys are excluded from chat history and rendered user messages.
|
|
61
|
+
- Users can remove stored credentials with `/logout` or by deleting the local
|
|
62
|
+
credentials file.
|
|
63
|
+
|
|
64
|
+
### Backend Auth Token
|
|
65
|
+
|
|
66
|
+
- When a user logs in to the Savant Code backend, an `authToken` is received.
|
|
67
|
+
- The token is stored in `~/.savant-code[-env]/credentials.json` for session
|
|
68
|
+
continuity (dev: `.savant-code-dev`, test: `.savant-code-test`, prod:
|
|
69
|
+
`.savant-code`).
|
|
70
|
+
- This file is created with the user's OS permissions and is not shared or
|
|
71
|
+
transmitted.
|
|
72
|
+
- Users can clear this file at any time with the `/logout` command.
|
|
73
|
+
- **Future work (separate FID):** Evaluate migrating the backend auth token to the OS keychain or encrypted local
|
|
74
|
+
storage. For launch, plaintext credential storage is limited to the backend session token and provider keys
|
|
75
|
+
explicitly entered through `/provider`; environment-provided keys are not copied to disk.
|
|
76
|
+
|
|
77
|
+
## 4. Network Calls
|
|
78
|
+
|
|
79
|
+
### Update Check
|
|
80
|
+
|
|
81
|
+
- **Endpoint:** Public registry/GitHub releases API.
|
|
82
|
+
- **Data sent:** Current CLI version and user-agent string only.
|
|
83
|
+
- **Data NOT sent:** Code, prompts, file names, or identifiers.
|
|
84
|
+
- **Trigger:** On CLI startup (when enabled) or when the user runs
|
|
85
|
+
`/version --check`.
|
|
86
|
+
|
|
87
|
+
### Provider Inference (BYOK)
|
|
88
|
+
|
|
89
|
+
- **Endpoint:** Chosen by the user (OpenRouter, Ollama, etc.).
|
|
90
|
+
- **Data sent:** Model prompt and any context required by the model.
|
|
91
|
+
- **Data NOT sent:** Savant Code does not add tracking headers or identifiers.
|
|
92
|
+
|
|
93
|
+
### Analytics / Telemetry
|
|
94
|
+
|
|
95
|
+
- **Destination:** PostHog and/or Axiom (when enabled).
|
|
96
|
+
- **Data sent:** Aggregated event types, error names, and feature usage
|
|
97
|
+
summaries.
|
|
98
|
+
- **Secret redaction:** All payloads are run through `sanitizeSecrets` before
|
|
99
|
+
transmission.
|
|
100
|
+
- **Default:** `true` for new users and legacy settings without an explicit
|
|
101
|
+
value; users can disable remote analytics with `/telemetry disable`.
|
|
102
|
+
|
|
103
|
+
### Ads (SavantFree Tier)
|
|
104
|
+
|
|
105
|
+
- **Destination:** Carbon Ads or Gravity Index network.
|
|
106
|
+
- **Data sent:** Minimal impression/click events required for ad serving.
|
|
107
|
+
- **Default:** `false` for paid tiers; free tier may prompt for opt-in on first
|
|
108
|
+
use.
|
|
109
|
+
|
|
110
|
+
## 5. Telemetry & Ad Controls
|
|
111
|
+
|
|
112
|
+
<!-- markdownlint-disable MD013 -->
|
|
113
|
+
|
|
114
|
+
| Setting | Location | Default | How to Change |
|
|
115
|
+
| ------------------ | ------------------------------------ | -------------------------------------------------------- | ----------------------------------------------------------------- |
|
|
116
|
+
| `adsEnabled` | `~/.savant-code[-env]/settings.json` | `false` | `/ads enable` / `/ads disable` |
|
|
117
|
+
| `analyticsEnabled` | `~/.savant-code[-env]/settings.json` | `true` for new/legacy settings without an explicit value | `/telemetry status`, `/telemetry enable`, `/telemetry disable` |
|
|
118
|
+
| `permissionMode` | `~/.savant-code[-env]/settings.json` | `prompt` | `/permissions safe`, `/permissions prompt`, `/permissions unsafe` |
|
|
119
|
+
|
|
120
|
+
<!-- markdownlint-enable MD013 -->
|
|
121
|
+
|
|
122
|
+
## 6. Secret Sanitization
|
|
123
|
+
|
|
124
|
+
All debug logs, analytics payloads, and error reports are processed through a
|
|
125
|
+
`sanitizeSecrets` helper. The following keys are redacted to `[REDACTED]`:
|
|
126
|
+
|
|
127
|
+
- `authToken`
|
|
128
|
+
- `apiKey` / `api_key`
|
|
129
|
+
- `token`
|
|
130
|
+
- `accessToken`
|
|
131
|
+
- `refreshToken`
|
|
132
|
+
- `secret`
|
|
133
|
+
- `password`
|
|
134
|
+
- `authorization`
|
|
135
|
+
|
|
136
|
+
## 7. Retention
|
|
137
|
+
|
|
138
|
+
- **Local chat logs:** Stored in the per-project `debug/` directory or per-chat
|
|
139
|
+
log file. Cleared when the user runs `/clear` or deletes the files.
|
|
140
|
+
- **Settings:** Retained until the user deletes `~/.savant-code[-env]/`.
|
|
141
|
+
- **Backend sessions:** Governed by the Savant Code backend terms of service.
|
|
142
|
+
- **Telemetry/analytics:** Governed by PostHog/Axiom retention policies once
|
|
143
|
+
enabled.
|
|
144
|
+
|
|
145
|
+
## 8. User Controls
|
|
146
|
+
|
|
147
|
+
- `/permissions safe|prompt|unsafe` — control how aggressively the agent can run
|
|
148
|
+
shell/network tools.
|
|
149
|
+
- `/ads enable` / `/ads disable` — toggle ad display independently.
|
|
150
|
+
- `/telemetry status|enable|disable` — inspect or change remote analytics and
|
|
151
|
+
error-reporting consent.
|
|
152
|
+
- `/logout` — remove stored backend credentials.
|
|
153
|
+
|
|
154
|
+
Remote analytics consent is stored separately from `adsEnabled`; disabling
|
|
155
|
+
telemetry does not disable local debug logs or inference-provider network
|
|
156
|
+
requests.
|
|
157
|
+
|
|
158
|
+
### Config directory
|
|
159
|
+
|
|
160
|
+
The runtime stores local config in `~/.savant-code[-env]/` (e.g.
|
|
161
|
+
`.savant-code-dev`, `.savant-code-test`, `.savant-code`). This unifies the CLI
|
|
162
|
+
and SDK path and matches the public launch brand. Existing
|
|
163
|
+
`~/.config/manicode[-env]/` data is not migrated; users will need to
|
|
164
|
+
re-authenticate after updating.
|
|
165
|
+
|
|
166
|
+
### Contributor / test override
|
|
167
|
+
|
|
168
|
+
Tests and advanced users can set `SAVANT_CODE_CONFIG_DIR` (non-production only)
|
|
169
|
+
to override the config directory. This is used by
|
|
170
|
+
`cli/src/utils/__tests__/settings.test.ts` to isolate on-disk state.
|
|
171
|
+
|
|
172
|
+
## 9. Verification
|
|
173
|
+
|
|
174
|
+
- Verify that environment-provided keys are not persisted, while `/provider`
|
|
175
|
+
storage is limited to the local credentials file and excludes chat history.
|
|
176
|
+
- Run the settings and analytics-client tests in `cli/src/utils/__tests__/` to
|
|
177
|
+
confirm the active default, explicit disable behavior, and secret redaction.
|
|
178
|
+
- Inspect `~/.savant-code[-env]/settings.json` after a fresh install —
|
|
179
|
+
`analyticsEnabled` is `true` and `adsEnabled` is `false` unless changed by the
|
|
180
|
+
user.
|
|
181
|
+
|
|
182
|
+
## 10. Open Questions / Future Work
|
|
183
|
+
|
|
184
|
+
- Evaluate OS-native keychain/keyring integration for the backend `authToken`.
|
|
185
|
+
- Add per-provider audit trail for network calls in `unsafe` mode.
|
|
186
|
+
- Provide a one-click "purge all local data" command.
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
# **Deep Research Brief: A World-Class Benchmark Harness for Savant-Code**
|
|
2
|
+
|
|
3
|
+
## **Strategic Benchmarking Philosophy**
|
|
4
|
+
|
|
5
|
+
The rapid evolution of autonomous coding assistants has exposed severe limitations in traditional software engineering benchmarking frameworks. Historically, the industry has relied on output-centric evaluations, evaluating systems predominantly on a terminal state: the successful application of a final patch to resolve a given issue, evaluated via fail-to-pass unit tests1. While this diff-comparison approach provides a baseline for raw code generation quality, it is fundamentally inadequate for evaluating a highly orchestrated, deterministic, multi-agent runtime like Savant-Code.
|
|
6
|
+
A multi-agent, Finite State Machine (FSM)-aware benchmark is an absolute necessity because the architectural value of Savant-Code resides in its internal execution process, not solely its final output. The ECHO Protocol v0.2.0 enforces a strict lifecycle governing state transitions. The system must navigate through an analytical RED phase, transition into an execution-focused GREEN phase, verify outputs in an AUDIT phase, and, if necessary, initiate a SELF-CORRECT phase before reaching a COMPLETE state. This FSM governs which of the nine canonical agents—including the Orchestrator, Detective, Forge, Verifier, Recorder, Thinker, Scout, Researcher, and Scribe—execute at any given moment. Crucially, the protocol restricts tool usage based on the active phase; for example, write operations such as write\_file or apply\_patch are strictly prohibited during the RED phase, while terminal commands are gated to the AUDIT and GREEN phases.
|
|
7
|
+
Evaluating Savant-Code exclusively on final code correctness is akin to grading a surgical team solely on patient survival, ignoring whether sterile procedures were followed, whether the correct specialist performed the incision, or whether vital signs were monitored throughout the procedure. A world-class benchmark must measure orchestration efficiency, strict role separation, tool-permission compliance, and state-transition integrity. This requires capturing the full trajectory of the agent, analyzing how tasks are delegated, and verifying that the internal architecture operates as designed.
|
|
8
|
+
To achieve this, the benchmark design must strike a deliberate balance between real-world software engineering tasks and highly targeted synthetic tasks. Real-world tasks, analogous to those found in SWE-bench Verified, demonstrate applied utility in complex, massive codebases3. These tasks prove that the system can navigate genuine enterprise challenges. Conversely, synthetic tasks are designed to systematically exercise specific ECHO constraints and agent capabilities. For instance, a synthetic task might force an environmental error state to guarantee the activation of the Verifier agent, or provide a highly specific, custom-defined tool to test whether the Orchestrator accurately delegates the workload to the Researcher. Deterministic verification—comprising compilation, strict type-checking, and isolated test execution—remains the primary signal of success. This ensures that the evaluation relies on objective compiler states and system exit codes rather than the variable, non-deterministic output of Large Language Model (LLM) judges.
|
|
9
|
+
|
|
10
|
+
## **Task Taxonomy and Concrete Execution Scenarios**
|
|
11
|
+
|
|
12
|
+
To robustly measure the unique capabilities of the Savant-Code architecture, the evaluation suite relies on a formalized task taxonomy. Each category isolates specific architectural behaviors, ensuring that all nine canonical agents and the FSM state transitions are exhaustively tested. The taxonomy covers pure algorithmic problem solving, complex multi-agent orchestration, protocol compliance, tool integration, and programmatic determinism.
|
|
13
|
+
|
|
14
|
+
| Category | Concrete Prompt | Expected Agent Workflow & FSM Transitions | Deterministic Verification & Pass Criteria |
|
|
15
|
+
| :---- | :---- | :---- | :---- |
|
|
16
|
+
| **1\. Pure Coding / Bug Fix** | "Fix the off-by-one error in TreeTraversal.ts where the final leaf node is skipped during depth-first search." | **Workflow:** Orchestrator delegates to Detective (locates file), then to Forge (modifies loop logic). **FSM:** RED \-\> GREEN \-\> AUDIT \-\> COMPLETE. | **Command:** bun test tree.test.ts **Pass:** Exit code 0\. Fail-to-pass tests resolve successfully. |
|
|
17
|
+
| **2\. Multi-Agent Orchestration** | "Analyze the deprecated database schema, write a migration script, and verify it against the local test database." | **Workflow:** Orchestrator \-\> Scout (schema analysis) \-\> Forge (script generation) \-\> Verifier (test execution). **FSM:** RED \-\> GREEN \-\> AUDIT \-\> COMPLETE. | **Command:** psql \-f migration.sql && pg\_dump **Pass:** Zero schema diffs against golden schema validation file. |
|
|
18
|
+
| **3\. ECHO FSM Compliance** | "Refactor auth.ts to use JWTs. *Hidden constraint: Harness intercepts and simulates a test failure on first attempt.*" | **Workflow:** Agent must transition from AUDIT to SELF-CORRECT upon detecting the simulated failure, before returning to GREEN. **FSM:** RED \-\> GREEN \-\> AUDIT \-\> SELF-CORRECT \-\> GREEN \-\> AUDIT \-\> COMPLETE. | **Command:** Harness trace parsing. **Pass:** FSM transition log confirms the explicit AUDIT \-\> SELF-CORRECT path. Write tools must not execute in RED phase. |
|
|
19
|
+
| **4\. Custom Tool Execution** | "Use the provided generate\_ast\_graph tool to map core/ and output the dependencies to deps.json." | **Workflow:** Orchestrator \-\> Researcher (invokes the custom generate\_ast\_graph tool). **FSM:** RED \-\> GREEN \-\> COMPLETE. | **Command:** jq '.nodes' deps.json **Pass:** JSON output exactly matches the expected AST topology. |
|
|
20
|
+
| **5\. MCP Tool Execution** | "Query the internal mock-jira MCP server for ticket ENG-102 and implement the specified CSS changes." | **Workflow:** Orchestrator queries MCP tool \-\> Forge edits CSS \-\> Verifier checks styles. **FSM:** RED \-\> GREEN \-\> AUDIT \-\> COMPLETE. | **Command:** mock-mcp-verify ENG-102 **Pass:** MCP server state indicates ticket transitioned to "Resolved"; CSS compiles without errors4. |
|
|
21
|
+
| **6\. Skill-Driven Task** | "Implement the new payment gateway. Ensure strict adherence to the rules specified in SKILL.md." | **Workflow:** Scribe reads SKILL.md \-\> Orchestrator adopts singleton patterns specified in the file \-\> Forge writes code. | **Command:** eslint \--rule 'no-multiple-instances: error' **Pass:** Code compiles and strictly follows the abstract syntax tree pattern defined in the skill file. |
|
|
22
|
+
| **7\. Programmatic Agent** | "Execute the BatchProcessor programmatic agent to refactor all 50 text files in the /data directory." | **Workflow:** Agent executes a handleSteps generator yielding STEP\_ALL and GENERATE\_N directives sequentially. | **Command:** find /data \-type f | xargs grep \-L 'old\_string' **Pass:** Generator exhausts completely without infinite loops; exactly 50 files are verified as modified. |
|
|
23
|
+
| **8\. Slash Command / CLI** | "/goal Update the global logging format. /verify run npm run lint." | **Workflow:** CLI interpreter sets global context. Orchestrator modifies files, CLI loop intercepts the /verify hook. | **Command:** Harness state inspection. **Pass:** Output artifacts show updated logs, trace shows /verify hook executed successfully natively. |
|
|
24
|
+
| **9\. Context-Heavy Refactor** | "Rename the UserModel to ClientEntity across the entire src/ directory (45 files)." | **Workflow:** Detective utilizes code\_search and read\_files across directories \-\> Forge issues multiple str\_replace tools. | **Command:** tsc \--noEmit && bun test **Pass:** Type-checker passes with 0 errors; no orphaned UserModel imports remain in the project. |
|
|
25
|
+
| **10\. Error Recovery** | "Implement the sorting algorithm. *Hidden constraint: Harness injects a faulty type definition in the environment.*" | **Workflow:** Forge writes valid code \-\> Verifier detects tsc failure \-\> Thinker analyzes error \-\> Forge applies workaround. | **Command:** tsc **Pass:** The agent detects the environmental error in the AUDIT phase, adapts the implementation, and successfully compiles. |
|
|
26
|
+
|
|
27
|
+
## **Dataset Construction and Curation**
|
|
28
|
+
|
|
29
|
+
The integrity and long-term validity of the evaluation suite rely entirely on eliminating data contamination. Public datasets frequently suffer from training data leakage because the open-source GitHub issues, pull requests, and discussions used to construct the tests were previously ingested by the massive web-scraping pipelines that train frontier models6. If an underlying language model has memorized the exact patch for a specific public issue, the benchmark ceases to measure the autonomous reasoning capabilities of the agent and instead measures mere recall. This artificially inflates scores and renders the evaluation useless for comparing architectural agent improvements.
|
|
30
|
+
To construct a resilient, leak-proof dataset, the harness requires three distinct sourcing and curation pipelines. The first pipeline focuses on post-cutoff curation. This involves scraping closed pull requests and complex issues strictly from repositories created after the known training cut-off dates of major LLMs, such as the latest iterations of Claude 3.5 Sonnet or GPT-4o. The second pipeline utilizes execution-grounded synthesis. Automated frameworks are employed to generate synthetic, highly complex codebases featuring paired bugs that have never existed on the public internet, thereby guaranteeing a zero-shot evaluation scenario7. The third pipeline applies advanced Abstract Syntax Tree (AST) obfuscation. High-quality existing issues are programmatically refactored to rename variables, restructure directory hierarchies, and alter domain contexts. The core algorithmic challenge remains completely intact, but the lexical triggers that might prompt memorized recall are systematically neutralized.
|
|
31
|
+
Every task within the dataset is standardized using a strict JSON/YAML schema that integrates directly into the harness architecture. This schema provides all necessary initialization parameters, required environmental contexts, and validation mechanisms needed by the benchmarking engine.
|
|
32
|
+
|
|
33
|
+
YAML
|
|
34
|
+
schema\_version: "2.0"
|
|
35
|
+
task\_id: "savant-core-auth-001"
|
|
36
|
+
category: "mcp\_tool\_execution"
|
|
37
|
+
metadata:
|
|
38
|
+
difficulty: "hard"
|
|
39
|
+
expected\_fsm\_phases: \["RED", "GREEN", "AUDIT", "COMPLETE"\]
|
|
40
|
+
required\_agents: \["Orchestrator", "Forge", "Verifier"\]
|
|
41
|
+
environment:
|
|
42
|
+
base\_image: "savant-eval-base:1.2"
|
|
43
|
+
setup\_script: "npm ci && npm run db:migrate"
|
|
44
|
+
mcp\_servers:
|
|
45
|
+
\- name: "mock-jira"
|
|
46
|
+
endpoint: "http://localhost:8080/mcp"
|
|
47
|
+
inputs:
|
|
48
|
+
prompt: "Query the internal mock-jira MCP server for ticket ENG-102 and implement the specified CSS changes."
|
|
49
|
+
validation:
|
|
50
|
+
timeout\_seconds: 300
|
|
51
|
+
deterministic\_checks:
|
|
52
|
+
\- command: "npm run build:css"
|
|
53
|
+
expected\_exit\_code: 0
|
|
54
|
+
\- command: "node scripts/verify\_mcp\_state.js ENG-102"
|
|
55
|
+
expected\_exit\_code: 0
|
|
56
|
+
fsm\_assertions:
|
|
57
|
+
strict\_phase\_order: true
|
|
58
|
+
allow\_write\_in\_red: false
|
|
59
|
+
|
|
60
|
+
Accepting new tasks into the registry requires a rigorous reproducibility process. A task is strictly rejected if it exhibits non-deterministic behavior during validation. Before merging a new task definition into the repository, a baseline agent must execute the setup\_script, apply a golden patch, and pass all deterministic\_checks consistently over five independent executions. This multi-trial validation strategy ensures that flaky infrastructure or poorly written tests do not poison the leaderboard.
|
|
61
|
+
|
|
62
|
+
## **Harness Architecture Pipeline**
|
|
63
|
+
|
|
64
|
+
The benchmarking harness is designed as a highly concurrent, fault-tolerant pipeline optimized for headless execution and rich, persistent telemetry collection. To ensure scalability and isolation, the architecture is segregated into seven distinct, decoupled stages that process tasks asynchronously.
|
|
65
|
+
The pipeline begins with the Task Registry, which ingests the YAML task definitions from the filesystem, validates the schema constraints, and queues instances for execution based on the available compute resources of the host machine. The Sandbox Factory then provisions hermetic, isolated environments for each queued task, handling the mounting of dependencies, the initialization of network mocks, and the establishment of the baseline filesystem state.
|
|
66
|
+
Once the environment is active, the Agent Runner takes over as the primary execution engine. It interfaces dynamically with the SavantCodeClient, injects the parsed prompt, exposes the necessary custom tool definitions, and manages the execution via subprocesses. Concurrently, the Trace Collector actively intercepts all runtime events emitted by the agent. It records every subagent spawn, FSM phase transition, tool invocation, payload size, and token consumption metric, writing these details into an SQLite-backed structured trace log in real-time8.
|
|
67
|
+
Following the completion or termination of the agent's execution, the Deterministic Evaluator takes control of the sandbox. It executes the task's predefined validation scripts within the isolated environment, meticulously capturing standard output (stdout), standard error (stderr), and system exit codes to verify functional correctness. The Metric Aggregator then processes the outputs from both the Evaluator and the Trace Collector, computing composite scores that combine deterministic pass rates with FSM compliance and orchestration efficiency metrics. Finally, the Report Generator outputs the ultimate evaluation artifacts, synthesizing the data into comprehensive markdown summaries, JSON-Lines (JSONL) raw traces for external parsing, and side-by-side terminal diff comparisons for manual review8.
|
|
68
|
+
Concurrency across this pipeline is managed via an asynchronous worker pool. The maximum parallel execution limit is strictly defined by the available memory footprint constraints of the host machine and the isolated sandboxes. Timeouts are rigorously enforced at both the global task level and the individual tool-call level. The system utilizes exponential backoff strategies to handle expected API rate limits, ensuring that transient HTTP 429 errors from underlying language models do not artificially induce benchmark failures.
|
|
69
|
+
|
|
70
|
+
## **Sandboxing and Environment Control**
|
|
71
|
+
|
|
72
|
+
The validity of a coding benchmark relies entirely on the strict isolation and reproducibility of its execution environment. Autonomous agents write files, install untrusted dependencies, execute arbitrary shell commands, and continuously mutate the system state. Allowing these operations to run natively on the host machine or in weakly isolated environments introduces catastrophic security vulnerabilities and non-deterministic evaluation outcomes.
|
|
73
|
+
Selecting the appropriate isolation layer is the most critical infrastructural decision for the harness. Docker relies on Linux control groups (cgroups) and namespaces, which provide fast cold starts but suffer from weak security boundaries because all containers share the host operating system's kernel9. A kernel-level exploit generated by an untrusted agent could breach the sandbox. Furthermore, Docker lacks native, performant mechanisms for sub-second memory state freezing and restoration. Alternatively, gVisor employs a user-space kernel to intercept system calls, drastically enhancing security by providing a robust boundary between the container and the host9. However, the overhead of system call interception incurs significant performance penalties, often slowing down I/O-heavy workloads—such as dependency installation and language compilation—by up to 30 percent, rendering it suboptimal for high-throughput testing9.
|
|
74
|
+
For the Savant-Code benchmark harness, Firecracker microVMs are the mandated isolation technology. Developed for serverless platforms, Firecracker utilizes the Kernel-based Virtual Machine (KVM) to provide hardware-enforced isolation, booting entirely dedicated kernels for each workload in approximately 125 milliseconds9. Most importantly, Firecracker supports advanced snapshot-restore capabilities, similar to mechanisms deployed in specialized agent testing environments9. Multi-turn agent tasks require persistent filesystem and memory states across dozens of sequential tool calls. Initializing a fresh Docker container for every single evaluation requires rebuilding the environment continuously. Using Firecracker, a base microVM is booted, dependencies are installed, and language servers are initialized. A snapshot of the memory and the block device state is then saved to local NVMe storage. When an agent is evaluated, the sandbox is restored from this exact snapshot in 5 to 30 milliseconds13. This mechanism allows the harness to process hundreds of task variations with near-zero cold-start latency, leveraging Copy-on-Write (CoW) page faults to drastically optimize memory consumption14.
|
|
75
|
+
Beyond compute isolation, environment mutability and network access must be strictly controlled. Unrestricted network access introduces non-determinism, such as tests failing due to a temporary NPM registry outage, and allows agents to circumvent problem-solving by searching the internet for the exact solution. To prevent this, package registries like NPM and PyPI are proxied locally within the host machine or pre-cached within the base snapshot, guaranteeing that dependency resolution is instantaneous and entirely deterministic. External API resources are mocked using localized Model Context Protocol (MCP) validation tools. The harness pairs a WebSocket bridge with mock MCP servers that simulate authentication flows, database states, and error conditions, ensuring the agent interacts with a highly predictable schema4.
|
|
76
|
+
The harness captures the entire filesystem state before the agent initiates execution, performing a cryptographic hash of the working directory. Post-execution, a delta diff is generated to identify exactly which bytes were modified. Sensitive information, such as API keys and authentication tokens, are injected via secure environmental variables directly into the microVM's isolated memory space and are explicitly masked in the Trace Collector logs to prevent leakage in the generated reports.
|
|
77
|
+
|
|
78
|
+
## **Runner Abstraction**
|
|
79
|
+
|
|
80
|
+
To ensure that Savant-Code can be directly compared against other leading autonomous engineering tools, such as Claude Code, Codex, and OpenCode, the harness employs a polymorphic Runner interface. This abstraction layer acts as the universal adapter between the standardized benchmark pipeline and the specific execution dynamics of the agent under test.
|
|
81
|
+
The architecture defines a strict TypeScript interface that all specific runner implementations must satisfy. This guarantees that the benchmark treats every agent uniformly, injecting the prompt, enforcing boundaries, and collecting terminal states through identical mechanisms.
|
|
82
|
+
|
|
83
|
+
TypeScript
|
|
84
|
+
export interface AgentRunner {
|
|
85
|
+
// Initializes the agent with task parameters and environment bindings
|
|
86
|
+
initialize(config: RunnerConfig): Promise\<void\>;
|
|
87
|
+
|
|
88
|
+
// Executes the prompt and captures the asynchronous stream
|
|
89
|
+
executePrompt(prompt: string): Promise\<RunState\>;
|
|
90
|
+
|
|
91
|
+
// Collects comprehensive telemetry post-execution
|
|
92
|
+
collectTrace(): TraceDocument;
|
|
93
|
+
|
|
94
|
+
// Handles simulated user interaction if the agent requests input
|
|
95
|
+
handleInteractivePrompt(request: string): Promise\<string\>;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
For the evaluation of Savant-Code, the implementation natively consumes the @savant-code/sdk. The SavantCodeClient.run() function is invoked directly within the node process. The runner leverages the handleEvent callback to stream realtime FSM transitions, tool payloads, and context token counts directly into the TraceDocument. Because the SDK provides deep introspection, the runner can capture the internal state of the ECHO FSM continuously without relying on output parsing.
|
|
99
|
+
When evaluating external, closed ecosystem agents like Claude Code, the runner operates by spawning an interactive child process. Given the runtime architecture of the testing framework, Bun.spawn is heavily utilized to manage these external binaries. The runner streams the standard output of the external agent using stdout: "pipe" and intercepts the output via a ReadableStream implementation18. The runner analyzes this asynchronous text buffer using complex regular expressions to detect tool usage signatures, phase changes, and prompts for user interaction, thereby normalizing external agent behaviors into a comparable telemetry format. Global timeouts and limits on maxAgentSteps are strictly enforced at the runner layer. By passing an AbortSignal or invoking the kill() method on the subprocess, the runner can immediately send a SIGTERM to the process if execution bounds are exceeded, preventing runaway resource consumption19.
|
|
100
|
+
|
|
101
|
+
## **Deterministic Verification Layer**
|
|
102
|
+
|
|
103
|
+
The deterministic verification layer provides the indisputable, primary signal of agent performance. Operating sequentially inside the post-execution sandbox, it removes subjectivity from the evaluation of functional correctness.
|
|
104
|
+
The verification process executes a strict sequence of validation steps. First, if the agent output is provided as a unified diff rather than through direct file manipulation tools, the harness attempts to apply the patch using system tools like git apply. Any failure at this stage yields an immediate syntax-resolution error. Second, the project is subjected to a build step. The harness executes compilation commands relevant to the environment, such as npm run build or tsc. An exit code of 0 is strictly required to proceed, and all standard error (stderr) outputs are captured for the trace log.
|
|
105
|
+
Following successful compilation, the verification layer enforces static type-checking. This ensures the agent did not resort to bypass techniques, such as applying any casting or ignoring architectural interfaces, to force a superficial solution. Once type safety is confirmed, the task's specific test suite is executed. Whether the environment uses jest, pytest, or native binary testing frameworks, the harness expects a 0 exit code, confirming that the algorithmic logic satisfies the problem statement. The code is then evaluated against linting and formatting rules to ensure the patch integrates seamlessly with the repository's stylistic standards. Finally, custom bash validators can be executed to verify complex state changes, such as checking that an MCP mock server properly transitioned a ticket status.
|
|
106
|
+
To combat the inherent non-determinism present in complex testing environments, the verification layer implements robust handling for flaky tests. Any failing test suite is automatically re-run up to three consecutive times within an isolated, reset state. If the test passes on a subsequent run, it is flagged with a FLAKY\_PASS marker, allowing the metric aggregator to acknowledge the success while noting the instability. Test outputs are ingested via structured reporting formats, such as the JSON Test Reporting Format, allowing the harness to precisely surface which specific assertion failed and mapping it directly to the agent's modification trace21.
|
|
107
|
+
|
|
108
|
+
## **Multi-Agent and ECHO-Specific Metrics**
|
|
109
|
+
|
|
110
|
+
Traditional pass/fail resolution rates are entirely insufficient to evaluate the sophisticated architecture of the ECHO Protocol. The harness introduces novel quantitative metrics specifically engineered to evaluate the internal health and efficiency of the multi-agent system.
|
|
111
|
+
The most critical unique metric is FSM Strict Compliance. This evaluates the trajectory of the agent through the RED, GREEN, AUDIT, and SELF-CORRECT lifecycle. A boolean matrix tracks every action against the current phase. A perfect score is awarded only if the agent strictly adhered to phase constraints, meaning no write tool invocations occurred during the analytical RED phase, and test commands were strictly reserved for the AUDIT phase. Any violation triggers a severe penalty in the compliance score.
|
|
112
|
+
The Subagent Utilization Ratio measures the diversity of agent orchestration. If a highly complex task requires the Orchestrator to logically spawn the Scout, Forge, and Verifier, but the Orchestrator instead attempts a monolithic, error-prone change using only the Forge, the utilization ratio drops significantly, highlighting a failure in delegation strategy.
|
|
113
|
+
Detective Precision and Recall specifically evaluate the efficiency of codebase exploration. Recall is calculated as the ratio of relevant files successfully identified by the agent out of the total files required to generate the golden patch. Precision is calculated as the ratio of relevant files identified out of the total files read or searched by the agent during the task. This mathematical approach heavily penalizes agents that inefficiently dump entire directories into their context window, proving that the system is targeted in its research.
|
|
114
|
+
Forge Minimality calculates the Levenshtein distance between the agent's proposed edits and the canonical golden patch. It penalizes unnecessary refactoring, formatting changes, or hallucinated additions that fall outside the strict scope of the prompt. The Verifier Impact metric acts as a boolean flag indicating whether the Verifier successfully detected a failing test suite in the AUDIT phase and successfully initiated a SELF-CORRECT loop that ultimately drove the system back to a GREEN phase and a COMPLETE state. Recorder Compliance validates that File Identity Document (FID) lifecycles were correctly instantiated, updated, or archived following file modifications. Tool Permission Respect tracks instances where any subagent attempted to execute a tool outside its explicitly assigned capability array, providing a strict measure of system prompt adherence.
|
|
115
|
+
|
|
116
|
+
## **Subjective and LLM Scoring**
|
|
117
|
+
|
|
118
|
+
While deterministic checks absolutely govern the evaluation of functional correctness, LLM judging is selectively applied to evaluate qualitative attributes that compilers cannot mathematically assess. To minimize exorbitant API costs and the inherent variance of AI judges, LLM scoring is restricted exclusively to tasks where qualitative outputs are the primary deliverable, such as architectural documentation generation, code maintainability reviews, or human-facing instruction adherence22.
|
|
119
|
+
LLM judging is strictly excluded from verifying whether code compiles, whether tests pass, or whether a diff matches a functional baseline. Instead of asking a judge the overly broad question, "Is this diff correct?", the harness utilizes structured output evaluation evaluated against a highly specific rubric by a frontier model acting as a judge.
|
|
120
|
+
The prompt provided to the LLM judge is deliberately lightweight and highly constrained: You are an expert software architect evaluating a codebase modification. Do NOT evaluate whether the code compiles or passes tests; this has already been verified deterministically. Evaluate the code strictly on the following three dimensions using a 1-5 scale:
|
|
121
|
+
|
|
122
|
+
> 1. Maintainability: Does the new code introduce technical debt, magic numbers, or excessive cyclomatic complexity?
|
|
123
|
+
> 2. Instruction Adherence: Did the implementation adhere strictly to the architectural constraints requested in the prompt?
|
|
124
|
+
> 3. Explanation Quality: If the agent provided a summary to the user, is it concise, accurate, and free of hallucinations? Return your evaluation exactly adhering to the provided JSON schema. Do not include markdown explanations outside the JSON object. By enforcing a structured JSON output schema, the variance of the judge is dramatically reduced. The scores can be programmatically parsed by the Metric Aggregator, completely avoiding the fragility of text-based parsing and ensuring that the subjective assessment maps directly to the quantitative reporting pipeline8.
|
|
125
|
+
|
|
126
|
+
## **Cost, Latency, and Token Tracking**
|
|
127
|
+
|
|
128
|
+
Tracking deep telemetry is essential for measuring the operational viability and commercial practicality of Savant-Code. The AgentState object embedded in the runtime natively provides the necessary instrumentation, and the harness extracts, normalizes, and contextualizes this data into actionable performance metrics.
|
|
129
|
+
The Trace Collector intercepts the sessionState.mainAgentState payload at every tick of the FSM to continuously extract creditsUsed, directCreditsUsed, and contextTokenCount. This telemetry is split granularly into input tokens, output tokens, and caching tokens. By mapping this real-time consumption data against pinned provider pricing tables, the harness calculates the exact fractional inference cost per task24. This allows the platform to compute the most critical enterprise metric: the exact cost in dollars per successfully resolved issue.
|
|
130
|
+
Latency profiling is equally rigorous. Wall-clock execution time is measured not just globally, but per subagent invocation. By parsing the structured trace logs, the harness calculates the average time spent analyzing code in the Detective phase versus the time spent generating code in the Forge phase. This granular timing highlights execution bottlenecks and API latency delays.
|
|
131
|
+
Crucially, this deep telemetry enables advanced regression detection. If a new version update to Savant-Code slightly improves pass rates by two percent but simultaneously increases context token consumption by forty percent due to inefficient, runaway subagent looping, the Metric Aggregator will explicitly flag a cost regression. This ensures that improvements in capability do not secretly compromise the economic viability of the tool.
|
|
132
|
+
|
|
133
|
+
## **Anti-Cheating and Robustness**
|
|
134
|
+
|
|
135
|
+
To maintain the absolute validity of the benchmark over successive product iterations, the harness must rigorously defend against both intentional dataset circumvention and systemic infrastructural instability.
|
|
136
|
+
To prevent data contamination, all newly authored tasks embed a unique cryptographic canary string within the repository files. This strategy is analogous to the mechanisms used to secure the Big-Bench evaluation suites21. If this specific, randomized string ever appears in the output of future language models attempting the task, training data leakage is immediately confirmed, and the task can be safely deprecated from the leaderboard.
|
|
137
|
+
Fault isolation is guaranteed by the hermetic nature of the sandboxing environment. A fatal crash, an infinite loop, or a massive memory leak triggered by one agent process is completely isolated by the Firecracker hypervisor, preventing it from corrupting the host machine. The Agent Runner continuously monitors process health; if a subprocess hangs and fails to yield output, a SIGKILL is issued, the trace is saved as a TIMEOUT\_FAIL, and the harness cleanly proceeds to the next task20.
|
|
138
|
+
API resilience is built directly into the execution layer. Interactions with upstream LLM providers are wrapped in a resilient network protocol implementing exponential backoff and randomized jitter. If an API endpoint returns a rate limit error or a bad gateway response, the harness intercepts the error, pauses the FSM execution tick without failing the task, and retries the connection. This ensures that transient external API instability does not falsely register as an agent logic failure. Furthermore, because the Firecracker microVMs are systematically destroyed and instantly restored from pristine baseline snapshots post-execution, there is zero risk of filesystem residue, temporary files, or mutated network states persisting between tasks and influencing subsequent evaluations14.
|
|
139
|
+
|
|
140
|
+
## **CLI and SDK Integration**
|
|
141
|
+
|
|
142
|
+
The benchmark suite is meticulously designed as a standalone, highly portable utility that seamlessly integrates with Savant-Code without requiring invasive modifications to the core runtime codebase.
|
|
143
|
+
The harness is invoked via a standard, intuitive command-line interface command, enabling engineers to run comprehensive evaluations directly from their terminal:savant-code benchmark run \--taskset evals/v2/suite.yaml \--concurrency 4 \--report json
|
|
144
|
+
When executed, the CLI operates in a headless SDK mode, bypassing all interactive terminal UI elements and instantiating the SavantCodeClient directly as a library component. To capture the necessary deep traces, the harness injects a custom handleEvent middleware hook into the client initialization parameters. As the Orchestrator yields internal runtime events—such as STEP, TOOL\_CALL, or PHASE\_TRANSITION—the middleware synchronously serializes the payload into the SQLite trace database before seamlessly passing the event back to the standard runtime flow.
|
|
145
|
+
When evaluating external agents for direct comparison, the CLI executes tools like Claude Code or Codex as isolated subprocesses utilizing the Bun.spawn utility19. It programmatically injects simulated user input through the standard input (stdin) stream, echoing affirmative responses to confirmation prompts or providing required context, and parses the standard output (stdout) to determine when the agent believes the task is complete. This architecture maintains a highly uniform, unbiased evaluation surface across vastly disparate autonomous tools22.
|
|
146
|
+
|
|
147
|
+
## **Implementation Roadmap**
|
|
148
|
+
|
|
149
|
+
The development and deployment of the v2 benchmark harness are structured across a rigorous eight-week implementation roadmap, translating the architectural design into actionable engineering phases.
|
|
150
|
+
|
|
151
|
+
| Week | Phase | Key Deliverables |
|
|
152
|
+
| :---- | :---- | :---- |
|
|
153
|
+
| **Week 1** | Core Architecture & Schema Design | Finalize JSON/YAML task schemas. Build the core Task Registry logic and define the strict AgentRunner TypeScript interfaces. |
|
|
154
|
+
| **Week 2** | Runner & SDK Integration | Implement the SavantCodeClient wrapper. Build the handleEvent interceptors to accurately stream state data to the SQLite Trace Collector. |
|
|
155
|
+
| **Week 3** | Sandboxing Infrastructure | Integrate Firecracker microVM management9. Implement the low-level CRIU snapshot-restore logic for sub-30ms environment resets13. |
|
|
156
|
+
| **Week 4** | Deterministic Verification Layer | Build the shell execution parsers for build, test, and type-check steps. Implement flaky test detection and the three-attempt retry logic. |
|
|
157
|
+
| **Week 5** | Dataset Migration & Creation | Translate legacy benchmark tasks into the new v2 schema. Author 20 highly specific synthetic tasks targeting FSM compliance and MCP tool usage. |
|
|
158
|
+
| **Week 6** | Advanced Metrics & LLM Judging | Implement FSM transition tracking algorithms and mathematical scoring models. Integrate the structured-output LLM judge for qualitative checks. |
|
|
159
|
+
| **Week 7** | External Agent Adapters | Build subprocess wrappers using Bun.spawn for Claude Code, Codex, and OpenCode19. Calibrate timeout and regex parsing logic. |
|
|
160
|
+
| **Week 8** | CLI Integration & Pipeline | Finalize the savant-code benchmark run command. Generate automated markdown leaderboards. Deploy the complete harness into automated CI/CD pipelines. |
|
|
161
|
+
|
|
162
|
+
## **Comparison to SWE-bench Verified and Aider**
|
|
163
|
+
|
|
164
|
+
This comprehensive harness introduces evaluation paradigms that are fundamentally absent in current industry standards, providing a much deeper assessment of agent capabilities.
|
|
165
|
+
Compared to SWE-bench and SWE-bench Verified, which operate entirely on a single-shot terminal diff validation, this harness evaluates the entire lifecycle of problem resolution1. SWE-bench has no awareness of how a solution was generated; a model that correctly guesses a patch is scored identically to a model that methodically explores a codebase and builds a robust solution. The Savant-Code harness validates the internal architecture—ensuring proper subagent delegation, correct FSM transitions, and appropriate tool usage—providing an architectural health check rather than just a code check.
|
|
166
|
+
Compared to Aider Polyglot and Exercism benchmarks, which effectively measure cross-language problem-solving and single-file algorithmic logic, this harness expands the scope to true enterprise engineering28. While Polyglot is excellent for testing multi-language syntax, it lacks deep environmental validation, MCP server testing, and multi-agent topology assertions. The Savant-Code harness introduces highly complex enterprise scenarios involving mock APIs, Jira servers, database migrations, and programmatic tool execution that reflect the reality of modern, real-world agentic workflows4.
|
|
167
|
+
|
|
168
|
+
## **Deliverable Format and Directory Structure**
|
|
169
|
+
|
|
170
|
+
The benchmarking suite will be cleanly structured within the evals/v2/ directory of the Savant-Code repository, adhering to a modular layout that separates execution logic, task definitions, and generated reports.
|
|
171
|
+
evals/v2/ ├── README.md \# Execution instructions and architecture overview ├── schema/ │ └── task\_schema\_v2.json \# JSON schema enforcing task definitions ├── tasks/ │ ├── pure\_coding/ \# SWE-bench style real-world tasks │ ├── mcp\_tooling/ \# Mock server integration synthetic tasks │ └── fsm\_compliance/ \# Synthetic FSM violation testing tasks ├── runner/ │ ├── index.ts \# Core benchmark pipeline execution logic │ ├── SavantRunner.ts \# SDK integration and trace collection │ └── ExternalRunner.ts \# Bun.spawn wrappers for external CLIs ├── sandbox/ │ ├── firecracker\_config.json \# MicroVM provisioning hardware constraints │ └── snapshot\_manager.ts \# CoW memory state restoration logic ├── scoring/ │ ├── metrics.ts \# FSM and orchestration mathematical formulas │ └── llm\_judge.ts \# Structured output evaluation prompts └── reports/ \# Aggregated SQLite traces and MD leaderboards
|
|
172
|
+
This comprehensive, highly detailed harness transforms the evaluation of Savant-Code from a simple, output-focused diff-comparison tool into a world-class, architectural capability benchmark, providing rigorous, reproducible, and deeply actionable metrics for future development.
|
|
173
|
+
|
|
174
|
+
### **Works cited**
|
|
175
|
+
|
|
176
|
+
> 1. Introducing SWE-bench Verified \- OpenAI, [https://openai.com/index/introducing-swe-bench-verified/](https://openai.com/index/introducing-swe-bench-verified/)
|
|
177
|
+
> 2. Can Language Models Resolve Real-world Github Issues \- SWE-bench, [https://www.swebench.com/original.html](https://www.swebench.com/original.html)
|
|
178
|
+
> 3. SWE-bench Verified, [https://www.swebench.com/verified.html](https://www.swebench.com/verified.html)
|
|
179
|
+
> 4. AI Protocol Mocking (MCP & A2A) \- MockServer, [https://www.mock-server.com/mock\_server/ai\_protocol\_mocking.html](https://www.mock-server.com/mock_server/ai_protocol_mocking.html)
|
|
180
|
+
> 5. Mock MCP Server \- AI-driven mock data orchestration with OpenAPI JSON Schema for testing \- GitHub, [https://github.com/mcpland/mock-mcp](https://github.com/mcpland/mock-mcp)
|
|
181
|
+
> 6. Does SWE-Bench-Verified Test Agent Ability or Model Memory? \- arXiv, [https://arxiv.org/html/2512.10218v1](https://arxiv.org/html/2512.10218v1)
|
|
182
|
+
> 7. Daily Papers \- Hugging Face, [https://huggingface.co/papers?q=Docker-based%20environment%20isolation](https://huggingface.co/papers?q=Docker-based+environment+isolation)
|
|
183
|
+
> 8. README.md \- BryanZaneee/llmbench \- GitHub, [https://github.com/BryanZaneee/llmbench/blob/main/README.md](https://github.com/BryanZaneee/llmbench/blob/main/README.md)
|
|
184
|
+
> 9. Firecracker vs gVisor: Which isolation technology should you use? | Blog \- Northflank, [https://northflank.com/blog/firecracker-vs-gvisor](https://northflank.com/blog/firecracker-vs-gvisor)
|
|
185
|
+
> 10. The Container Runtime Nobody Told You About (And Four Others) \- DEV Community, [https://dev.to/copyleftdev/the-container-runtime-nobody-told-you-about-and-four-others-25e1](https://dev.to/copyleftdev/the-container-runtime-nobody-told-you-about-and-four-others-25e1)
|
|
186
|
+
> 11. Agent Sandbox Guide: A Complete Solution for Safely Running AI, [https://eastondev.com/blog/en/posts/ai/20260323-agent-sandbox-guide/](https://eastondev.com/blog/en/posts/ai/20260323-agent-sandbox-guide/)
|
|
187
|
+
> 12. Kata Containers vs Firecracker vs gvisor : r/docker \- Reddit, [https://www.reddit.com/r/docker/comments/1fmuv5b/kata\_containers\_vs\_firecracker\_vs\_gvisor/](https://www.reddit.com/r/docker/comments/1fmuv5b/kata_containers_vs_firecracker_vs_gvisor/)
|
|
188
|
+
> 13. AI Agent Code Execution Sandboxes on GPU Cloud: E2B, Daytona, and Firecracker Setup Guide (2026) | Spheron Blog, [https://www.spheron.network/blog/ai-agent-code-execution-sandbox-e2b-daytona-firecracker/](https://www.spheron.network/blog/ai-agent-code-execution-sandbox-e2b-daytona-firecracker/)
|
|
189
|
+
> 14. DeltaBox: Scaling Stateful AI Agents with Millisecond-Level Sandbox Checkpoint/Rollback, [https://arxiv.org/html/2605.22781v2](https://arxiv.org/html/2605.22781v2)
|
|
190
|
+
> 15. forkd/README.md at main · deeplethe/forkd \- GitHub, [https://github.com/deeplethe/forkd/blob/main/README.md](https://github.com/deeplethe/forkd/blob/main/README.md)
|
|
191
|
+
> 16. mock-mcp | MCP Servers \- LobeHub, [https://lobehub.com/mcp/mcpland-mock-mcp](https://lobehub.com/mcp/mcpland-mock-mcp)
|
|
192
|
+
> 17. MCP Test Client — Validate Your MCP Client Against Hosted Mock Servers, [https://mcpplaygroundonline.com/mcp-test-client](https://mcpplaygroundonline.com/mcp-test-client)
|
|
193
|
+
> 18. Read stdout from a child process \- Bun, [https://bun.com/docs/guides/process/spawn-stdout](https://bun.com/docs/guides/process/spawn-stdout)
|
|
194
|
+
> 19. Spawn \- Bun, [https://bun.com/docs/runtime/child-process](https://bun.com/docs/runtime/child-process)
|
|
195
|
+
> 20. Child Processes \- Bun.spawn(), [https://oven-sh-bun.mintlify.app/runtime/child-process](https://oven-sh-bun.mintlify.app/runtime/child-process)
|
|
196
|
+
> 21. Terminal-Bench 2.0: The AI Agent Benchmark That Actually | explainx.ai Blog, [https://explainx.ai/blog/terminal-bench-2-0-ai-agent-benchmark-evaluation](https://explainx.ai/blog/terminal-bench-2-0-ai-agent-benchmark-evaluation)
|
|
197
|
+
> 22. Keep your Agents Under Control with agent-belt \- JFrog, [https://jfrog.com/blog/keep-agents-under-control-with-agent-belt/](https://jfrog.com/blog/keep-agents-under-control-with-agent-belt/)
|
|
198
|
+
> 23. Simon Willison on ai-assisted-programming, [https://simonwillison.net/tags/ai-assisted-programming/?page=10](https://simonwillison.net/tags/ai-assisted-programming/?page=10)
|
|
199
|
+
> 24. 62.2% on Aider Polyglot from a MacBook Pro. Then the other model we tried scored 4%. Here's what actually happened, with a working cost loop attached. \- LLMKube, [https://llmkube.com/blog/m5-max-aider-polyglot-and-finops](https://llmkube.com/blog/m5-max-aider-polyglot-and-finops)
|
|
200
|
+
> 25. RunanywhereAI/hybrid-arena \- GitHub, [https://github.com/RunanywhereAI/hybrid-arena](https://github.com/RunanywhereAI/hybrid-arena)
|
|
201
|
+
> 26. GitHub \- jfrog/agent-belt: Reproducible evaluation for AI coding agents. Multi-turn scenarios against Claude Code, Codex, Copilot, Cursor, Gemini CLI, Goose, OpenCode, or any custom agent you plug in; verify behavior with rule checks, workspace diffs, multi-judge LLM consensus; pin reliability with pass^k variance across trials. Git worktrees, optional Docker sandbox., [https://github.com/jfrog/agent-belt](https://github.com/jfrog/agent-belt)
|
|
202
|
+
> 27. Best Stateful Sandboxes for Code Execution in 2026 \- Beam Cloud, [https://www.beam.cloud/blog/best-stateful-sandbox-code-execution-2026](https://www.beam.cloud/blog/best-stateful-sandbox-code-execution-2026)
|
|
203
|
+
> 28. Aider Polyglot: A New Paradigm for AI-Assisted Development? \- Skywork, [https://skywork.ai/skypage/en/Aider-Polyglot-A-New-Paradigm-for-AI-Assisted-Development/1972872987328704512](https://skywork.ai/skypage/en/Aider-Polyglot-A-New-Paradigm-for-AI-Assisted-Development/1972872987328704512)
|
|
204
|
+
> 29. o1 tops aider's new polyglot leaderboard, [https://aider.chat/2024/12/21/polyglot.html](https://aider.chat/2024/12/21/polyglot.html)
|
|
205
|
+
> 30. Our AI Agent \+ 3.7 Sonnet ranked \#1 on Aider's polyglot bench — a 76.4% score, [https://dev.to/refact/our-ai-agent-37-sonnet-ranked-1-on-aiders-polyglot-bench-a-764-score-10d0](https://dev.to/refact/our-ai-agent-37-sonnet-ranked-1-on-aiders-polyglot-bench-a-764-score-10d0)
|
|
206
|
+
> 31. The Step-By-Step Guide to MCP Evaluation \- Confident AI, [https://www.confident-ai.com/blog/the-step-by-step-guide-to-mcp-evaluation](https://www.confident-ai.com/blog/the-step-by-step-guide-to-mcp-evaluation)
|