Commit Graph

63 Commits

Author SHA1 Message Date
Will Chen
06ad1a7546 Smart Context: deep (#1527)
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Introduce a new "deep" Smart Context mode that supplies versioned
files (by commit) to the engine, adds code search rendering, stores
source commit hashes, improves search-replace recovery, and updates
UI/tests.
> 
> - **Smart Context (deep)**:
> - Replace `conservative` with `deep`; limit context to ~200 turns;
send `sourceCommitHash` per message.
> - Build and pass `versioned_files` (hash-id map + per-message file
refs) and `app_id` to engine.
> - **DB**:
>   - Add `messages.source_commit_hash` (+ migration/snapshot).
> - **Engine/Processing**:
> - Retry Turbo Edits v2: first re-read then fallback to `dyad-write` if
search-replace fails.
> - Include provider options and versioned files in requests; add
`getCurrentCommitHash`/`getFileAtCommit`.
> - **UI**:
>   - Pro mode selector: new `deep` option; tooltips polish.
> - Add `DyadCodeSearch` and `DyadCodeSearchResult` components; parser
supports new tags.
> - **Tests/E2E**:
> - New `smart_context_deep` e2e; update snapshots to include `app_id`
and deep mode; adjust Playwright timeout.
>   - Unit tests for versioned codebase context.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
e3d3bffabb2bc6caf52103461f9d6f2d5ad39df8. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2025-11-06 10:45:39 -08:00
Will Chen
95e1829910 Better error log (#1696)
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Enhances AI stream error logging to include request ID and detailed
error info in `chat_stream_handlers.ts`.
> 
> - **Backend**
> - **Logging**: In `src/ipc/handlers/chat_stream_handlers.ts` `onError`
handler for `streamText` now logs a detailed message including request
ID and `errorMessage`, replacing the previous generic error log.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
3519f494e8e400403973f014cede9ff771d5a9ad. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Improve error logging in chat text streaming by replacing the generic
log with a structured entry that includes the request ID (when
available), the parsed error message, and the full error object. This
makes failures easier to trace and correlate with backend requests.

<sup>Written for commit 3519f494e8e400403973f014cede9ff771d5a9ad.
Summary will update automatically on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2025-11-03 17:10:35 -08:00
Will Chen
ceed060c6f Don't show upgrade button for non AI streaming errors (#1680)
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Show the upgrade button only for AI streaming errors by checking a
shared error prefix; introduce and use a shared constant for consistent
error messages.
> 
> - **Chat UI**
> - Update `ChatErrorBox.tsx` to display "Upgrade to Dyad Pro" only when
`error` includes `AI_STREAMING_ERROR_MESSAGE_PREFIX` and user is not Pro
(still hides on `TypeError: terminated`).
> - **IPC/Streaming**
> - In `chat_stream_handlers.ts`, prefix emitted streaming errors with
`AI_STREAMING_ERROR_MESSAGE_PREFIX` instead of hardcoded text for
consistency.
> - **Shared**
> - Add `AI_STREAMING_ERROR_MESSAGE_PREFIX` in `src/shared/texts.ts` and
import where needed.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
83b1aa3555a3c1e710ee644f7bfb64cabc0ff5e6. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2025-11-03 09:34:18 -08:00
Will Chen
c50527b4c0 Security Panel MVP (#1660)
TODOs:

- [x] Add documentation
- [x] e2e tests: run security review, update knowledge, and fix issue
- [x] more stringent risk rating


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Introduces a new Security mode with a Security Review panel that runs
reviews, edits rules, parses findings via IPC, and supports fixing
issues, with tests and prompt/runtime support.
> 
> - **UI/Preview Panel**:
> - Add `security` preview mode to `previewModeAtom` and ActionHeader
(Shield button).
> - New `SecurityPanel` showing findings table (sorted by severity), run
review, fix issue flow, and edit `SECURITY_RULES.md` dialog.
>   - Wire into `PreviewPanel` content switch.
> - **Hooks**:
>   - `useSecurityReview(appId)`: fetch latest review via IPC.
> - `useStreamChat`: add `onSettled` callback to invoke refreshes after
streams.
> - **IPC/Main**:
> - `security_handlers`: `get-latest-security-review` parses
`<dyad-security-finding>` from latest assistant message.
>   - Register handler in `ipc_host`; expose channel in `preload`.
>   - `ipc_client`: add `getLatestSecurityReview(appId)`.
> - `chat_stream_handlers`: detect `/security-review`, use dedicated
system prompt, optionally append `SECURITY_RULES.md`, suppress
Supabase-not-available note in this mode.
> - **Prompts**:
> - Add `SECURITY_REVIEW_SYSTEM_PROMPT` with structured finding output.
> - **Supabase**:
> - Enhance schema query to include `rls_enabled`, split policy
`using_clause`/`with_check_clause`.
> - **E2E Tests**:
> - New `security_review.spec.ts` plus snapshots and fixture findings;
update test helper for `security` mode and findings table snapshot.
> - Fake LLM server streams security findings for `/security-review` and
increases batch size.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
5022d01e22a2dd929a968eeba0da592e0aeece01. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2025-10-29 17:32:52 -07:00
Will Chen
a8f3c97396 Turbo edits v2 (#1653)
Fixes #1222 #1646 

TODOs
- [x] description?
- [x] collect errors across all files for turbo edits
- [x] be forgiving around whitespaces
- [x] write e2e tests
- [x] do more manual testing across different models



<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Adds Turbo Edits v2 search-replace flow with settings/UI selector,
parser/renderer, dry-run validation + fallback, proposal integration,
and comprehensive tests; updates licensing.
> 
> - **Engine/Processing**:
> - Add `dyad-search-replace` end-to-end: parsing
(`getDyadSearchReplaceTags`), markdown rendering (`DyadSearchReplace`),
and application (`applySearchReplace`) with dry-run validation and
fallback to `dyad-write`.
> - Inject Turbo Edits v2 system prompt; toggle via
`isTurboEditsV2Enabled`; disable classic lazy edits when v2 is on.
> - Include search-replace edits in proposals and full-response
processing.
> - **Settings/UI**:
> - Introduce `proLazyEditsMode` (`off`|`v1`|`v2`) and helper selectors;
update `ProModeSelector` with Turbo Edits and Smart Context selectors
(`data-testid`s).
> - **LLM/token flow**:
> - Construct system prompt conditionally; update token counting and
chat stream to validate and repair search-replace responses.
> - **Tests**:
> - Add unit tests for search-replace processor; e2e tests for Turbo
Edits v2 and options; fixtures and snapshots.
> - **Licensing/Docs**:
> - Add `src/pro/LICENSE` (FSL 1.1 ALv2 future), update root `LICENSE`
and README license section.
> - **Tooling**:
> - Update `.prettierignore`; enhance test helpers (selectors, path
normalization, snapshot filtering).
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
7aefa02bfae2fe22a25c7d87f3c4c326f820f1e6. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2025-10-28 11:36:20 -07:00
Will Chen
d571d303eb Selected component engine (#1562)
<!-- This is an auto-generated description by cubic. -->

## Summary by cubic
Enable the Dyad Engine to prioritize a user-selected component by
flagging the file as focused and sending codebase files per request.
Keeps full context when the engine is on; falls back to path-scoped
context when it’s off.

- **New Features**
- Mark the selected component file as focused when the engine is
enabled.
- Send codebase files to the engine via dyadFiles, applied to
dyad_options unless disabled.
- Maintain full chatContext with engine; restrict to the selected file
path only when engine is off.

- **Refactors**
- Removed files from getModelClient and provider APIs; file transport
moved into request payload.
- Stream handlers now pass files to model calls and include
dyadDisableFiles/dyadFiles in the request.
  - Added focused flag to CodebaseFile.

<!-- End of auto-generated description by cubic. -->

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Sends codebase files per request to the Dyad Engine, focuses the
selected component when smart context is enabled, and refactors model
client/provider APIs to remove file parameters.
> 
> - **Engine integration**:
> - Send codebase files per request via `dyadFiles` in provider options;
propagate through `simpleStreamText` and `dyad-engine` options.
> - Add `isSmartContextEnabled` from `get_model_client` and gate context
behavior accordingly.
> - **Selected component focus**:
> - When smart context is on and a component is selected, mark its file
as `focused` in `CodebaseFile` and avoid broad smart context includes;
allow on-demand reads.
> - When smart context is off, restrict `chatContext` to the selected
file path.
> - **Refactors**:
> - Remove `files` parameter from `getModelClient` and Dyad provider;
move file transport into request body.
> - Update `llm_engine_provider` to read `dyadFiles` from request and
populate `dyad_options.files` unless `dyadDisableFiles`.
> - Extend `CodebaseFile` with optional `focused` flag; thread `files`
through `chat_stream_handlers` calls.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
022b26d0197ab5b5d4f5b589f45bc230de36e0e5. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2025-10-16 17:19:30 -07:00
Will Chen
ffa4c3ad01 Copy request id (for Dyad Pro) (#1523)
Based on #1488 by [vedantbhatotia](https://github.com/vedantbhatotia)

<!-- CURSOR_SUMMARY -->
> [!NOTE]
> <sup>[Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) is
generating a summary for commit
cc504f6d56ff72407dd5d0135befbf5d9cc695b5. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: vedantbhatotia <vedantbhatotia@gmail.com>
2025-10-13 16:41:46 -07:00
Will Chen
9691c9834b Support concurrent chats (#1478)
Fixes #212 


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Add concurrent chat support with per-chat state, chat activity UI, IPC
per-chat handling, and accompanying tests.
> 
> - **Frontend (Chat concurrency)**
> - Replace global chat atoms with per-chat maps:
`chatMessagesByIdAtom`, `isStreamingByIdAtom`, `chatErrorByIdAtom`,
`chatStreamCountByIdAtom`, `recentStreamChatIdsAtom`.
> - Update `ChatPanel`, `ChatInput`, `MessagesList`,
`DyadMarkdownParser`, and `useVersions` to read/write per-chat state.
> - Add `useSelectChat` to centralize selecting/navigating chats; wire
into `ChatList`.
> - **UI**
> - Add chat activity popover: `ChatActivityButton` and list; integrate
into `preview_panel/ActionHeader` (renamed from `PreviewHeader`) and
swap in `TitleBar`.
> - **IPC/Main**
> - Send error payloads with `chatId` on `chat:response:error`; update
`ipc_client` to route errors per chat.
> - Persist streaming partial assistant content periodically; improve
cancellation/end handling.
> - Make `FileUploadsState` per-chat (`addFileUpload({chatId,fileId},
...)`, `clear(chatId)`, `getFileUploadsForChat(chatId)`); update
handlers/processors accordingly.
> - **Testing**
> - Add e2e `concurrent_chat.spec.ts` and snapshots; extend helpers
(`snapshotMessages` timeout, chat activity helpers).
> - Fake LLM server: support `tc=` with options, optional sleep delay to
simulate concurrency.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
9035f30b73a1f2e5a366a0cac1c63411742b16f3. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2025-10-09 10:51:01 -07:00
Will Chen
390d20ae44 Max step count is 20 for toolcalls (#1464)
getting user feedback that the max of 3 is not enough and it's ending
abruptly
2025-10-07 16:35:11 -07:00
Will Chen
75b4b7c299 Handle mentioned apps via smart context (#1412)
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Send mentioned apps (names + files) to the engine through
dyad_options, omit inline other-apps prefix when engine is enabled, and
adjust e2e to snapshot request payload.
> 
> - **Engine/Backend**:
> - Pass mentioned apps to engine via
`providerOptions['dyad-engine'].dyadMentionedApps` and forward as
`dyad_options.mentioned_apps` in `llm_engine_provider`.
> - Gate inline other-apps context: only include `otherCodebasePrefix`
when `isEngineEnabled` is false.
> - Enhance `extractMentionedAppsCodebases` to return `files` alongside
`codebaseInfo`.
> - **Tests**:
> - e2e: change `mention app (with pro)` snapshot to
`snapshotServerDump("request")` and update snapshot to assert request
payload contents.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
7ddddf6c16c53cd36b4c7e4ec6a57da0616d1bb0. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2025-09-30 17:05:18 -07:00
Will Chen
9cca1d2af0 Fix MCP & title bar (#1348)
<!-- This is an auto-generated description by cubic. -->

## Summary by cubic
Fixes MCP handoff by detecting an edit-code tool call and stopping
generation. Simplifies the title bar credit tooltip; also blocks dyad-*
tags in the system prompt and updates tests.

- **Bug Fixes**
- Stop generation on edit-code via hasToolCall; add a no-op edit-code
tool to signal handoff.
  - Combine tool-call stop with existing step limit for reliability.
  - Forbid <dyad-*> tags in the system prompt to prevent misuse.
- Remove credit usage/reset details from the title bar tooltip; keep the
delay note.
  - Update e2e snapshot to reflect the new prompt rule.

<!-- End of auto-generated description by cubic. -->
2025-09-22 15:50:18 -07:00
Will Chen
6d3c397d40 Add MCP support (#1028) 2025-09-19 15:43:39 -07:00
Will Chen
74edefcb8f Support 1M tokens for anthropic (drive-by: make aws bedrock secondary… (#1233)
… provider)
    
<!-- This is an auto-generated description by cubic. -->
---

## Summary by cubic
Enables 1M-token context for Anthropic Claude 4 Sonnet and marks AWS
Bedrock as a secondary provider. Adds the required Anthropic beta header
and updates model metadata and pricing indicator.

- **New Features**
- Send header anthropic-beta: context-1m-2025-08-07 when using the
Anthropic provider.
- Update Claude 4 Sonnet configs: contextWindow to 1,000,000; add cost
warning; increase pricing tier to 5 (applies to Anthropic and Bedrock
model IDs).
  - Set AWS Bedrock as a secondary provider.

<!-- End of auto-generated description by cubic. -->
2025-09-09 11:37:04 -07:00
Md Rakibul Islam Rocky
4db6d63b72 Add Google Vertex AI provider (#1163)
# Summary

* Adds first-class **Google Vertex AI provider** using
`@ai-sdk/google-vertex`.
* Supports **Gemini 2.5** models and partner **MaaS (Model Garden)**
models via full publisher IDs.
* New **Vertex-specific settings UI** for Project, Location, and Service
Account JSON.
* Implements a **“thinking” toggle** for Gemini 2.5 Flash

  * Pro: always on
  * Flash: toggleable
  * Flash Lite: none
* Fixes *“AI not found”* for Vertex built-ins by mapping to
`publishers/google` paths.
* Hardens **cross-platform file ops** and ensures all tests pass.

---

# What’s New

### Vertex AI Provider

* Uses `@ai-sdk/google-vertex` with `googleAuthOptions.credentials` from
pasted Service Account JSON.
* Configurable **project** and **location**.
* Base URL → `/projects/{project}/locations/{location}`

  * Built-ins: `publishers/google/models/<id>`
  * Partner MaaS: `publishers/<partner>/models/...`

### Built-in Vertex Models

* `gemini-2.5-pro`
* `gemini-2.5-flash`
* `gemini-2.5-flash-lite`

### Thinking Behavior

* Vertex + Google marked as thinking-capable.
* Pro: always thinking
* Flash: toggle in UI
* Flash Lite: none

### Vertex Settings UI

* New **Google Vertex AI panel** for Project ID, Location, Service
Account JSON.
* Keys encrypted like other secrets.

---

# Fixes

* **Model resolution:** built-ins auto-map to
`publishers/google/models/<id>`.
* **Partner MaaS support:** full publisher IDs work directly (e.g.
DeepSeek).
* **Cross-platform paths:** normalize file ops with `toPosixPath`,
preserve `safeJoin` semantics.

---

# Why This Is Better

* Users can select **Vertex alongside other providers**.
* **More models** available through Model Garden.
* **Dedicated setup UI** reduces misconfig.
* **Thinking toggle** gives control over cost vs. reasoning depth.

---

# Files Changed

* **Provider & Models**: `language_model_helpers.ts`,
`get_model_client.ts`
* **Streaming**: `chat_stream_handlers.ts`
* **Schemas & Encryption**: `schemas.ts`, `settings.ts`
* **Settings UI**: `VertexConfiguration.tsx`, `ApiKeyConfiguration.tsx`
* **Models UI**: `ModelsSection.tsx` (Flash toggle)
* **Setup Detection**: `useLanguageModelProviders.ts`
* **Path Utils**: `path_utils.ts`, `response_processor.ts`
* **Deps**: `package.json` → `@ai-sdk/google-vertex@3.0.16`

---

# Tests & Validation

* **TypeScript**: `npm run ts` → 
* **Lint**: `npm run lint` → 
* **Unit tests**: `npm test` →  231 passed, 0 failed

---

# Migration / Notes

* No breaking changes.
* For Vertex usage:

  * Ensure Vertex AI API is enabled.
  * Service Account needs `roles/aiplatform.user`.
  * Region must support model (e.g. `us-central1`).
* Thinking toggle currently affects **only** Gemini 2.5 Flash.

---

# Manual QA

1. Configure Vertex with Project/Location/Service Account JSON.
2. Test built-ins:

   * `gemini-2.5-pro`
   * `gemini-2.5-flash` (toggle on/off)
   * `gemini-2.5-flash-lite`
3. Test MaaS partner model (e.g., DeepSeek) via full publisher ID.
4. Verify other providers remain unaffected.
    
<!-- This is an auto-generated description by cubic. -->
---

## Summary by cubic
Adds a first-class Google Vertex AI provider with Gemini 2.5 models, a
Vertex settings panel, and a “thinking” toggle for Gemini 2.5 Flash.
Also fixes model resolution for Vertex and hardens cross-platform file
operations.

- **New Features**
- Vertex AI provider via @ai-sdk/google-vertex with project, location,
and service account JSON.
- Built-in models: gemini-2.5-pro, gemini-2.5-flash,
gemini-2.5-flash-lite.
- “Thinking” support: Pro always on; Flash toggle in Models UI; Flash
Lite none.
- MaaS partners supported via full publisher paths (e.g.,
publishers/<partner>/models/...).
  - Vertex settings UI with encrypted service account key storage.

- **Bug Fixes**
  - Built-in Vertex models auto-map to publishers/google/models/<id>.
  - Consistent file ops across platforms using toPosixPath.
- Vertex readiness detection requires project/location/service account
JSON.
- Streaming “thinking” behavior respects Vertex Flash toggle and Pro
always-on.

<!-- End of auto-generated description by cubic. -->

---------

Co-authored-by: Md Rakibul Islam Rocky <mdrirocky08@gmail.com>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: Will Chen <willchen90@gmail.com>
2025-09-08 22:41:12 -07:00
Will Chen
d535db6251 Upgrade to AI sdk with codemod (#1000) 2025-08-18 22:21:27 -07:00
Will Chen
573642ae5f Prompt gallery (#957)
- [x] show prompt instead of app in autocomplete
- [x] use proper array/list for db (tags)
- [x] don't do <dyad-prompt> - replace inline
2025-08-18 13:25:11 -07:00
Will Chen
a6dca76d29 Allow referencing other apps (#692)
- [x] Update chat_stream_handlers
- [x] Update token handlers
- [x] Update HomeChatInput
- [x] update lexical chat input: do not allow referencing same app
(current app, or other already selected apps)
- [x] I don't think smart context will work on this...
- [x] Enter doesn't clear...
2025-08-13 16:22:49 -07:00
Will Chen
ab757d2b96 Add GPT 5 support (#902) 2025-08-11 15:00:02 -07:00
Will Chen
b0f08eaf15 Neon / portal template support (#713)
TODOs:
- [x] Do restart when checkout / restore if there is a DB
- [x] List all branches (branch id, name, date)
- [x] Allow checking out versions with no DB
- [x] safeguard to never delete main branches
- [x] create app hook for neon template
- [x] weird UX with connector on configure panel
- [x] tiny neon logo in connector
- [x] deploy to vercel
- [x] build forgot password page
- [x] what about email setup
- [x] lots of imgix errors
- [x] edit file - db snapshot
- [x] DYAD_DISABLE_DB_PUSH
- [ ] update portal doc
- [x] switch preview branch to be read-only endpoint
- [x] disable supabase sys prompt if neon is enabled
- [ ] https://payloadcms.com/docs/upload/storage-adapters
- [x] need to use main branch...

Phase 2?
- [x] generate DB migrations
2025-08-04 16:36:09 -07:00
Will Chen
64a7ddd364 Log request id (#730) 2025-07-29 11:03:26 -07:00
Will Chen
9edd0fa80f Upload image via chat (#686) 2025-07-22 15:45:30 -07:00
Will Chen
cb60a0562b Send request id for LLM engine calls (#659) 2025-07-17 14:16:23 -07:00
Will Chen
bc38f9b2d7 Improve check error performance by off-loading to worker thread w/ incremental compilation (#575) 2025-07-07 12:47:33 -07:00
Will Chen
f60a6c4829 Skip auto-fix if there's deps being added (#553) 2025-07-03 10:07:03 -07:00
Will Chen
7d9776243d Remove thinking tags from incremental fixes (#552) 2025-07-03 10:02:34 -07:00
Will Chen
678cd3277e Problems: auto-fix & problem panel (#541)
Test cases:
- [x] create-ts-errors
  - [x] with auto-fix
  - [x] without auto-fix 
- [x] create-unfixable-ts-errors
- [x] manually edit file & click recheck
- [x] fix all
- [x] delete and rename case

THINGS
- [x] error handling for checkProblems isn't working as expected
- [x] make sure it works for both default templates (add tests) 
- [x] fix bad animation
- [x] change file context (prompt/files)

IF everything passes in Windows AND defensive try catch... then enable
by default
- [x] enable auto-fix by default
2025-07-02 15:43:26 -07:00
Will Chen
2ea9500f73 Configurable thinking budget (default to medium) (#494) 2025-06-25 15:36:05 -07:00
Will Chen
ed4ec1ef58 Optimize summarization (#487)
Fixes #435
2025-06-24 21:01:09 -07:00
Will Chen
3041563809 Finish incomplete dyad write (#475)
Fixes #452 
Fixes #456 
Fixes #195
2025-06-23 22:53:55 -07:00
Will Chen
9fbd7031d9 build ask mode (#444) 2025-06-19 10:42:51 -07:00
Will Chen
8464609ba8 Fix parsing dyad tags with nested tags: < > (#445)
Fixes #441
2025-06-19 10:08:26 -07:00
Will Chen
d6d6918d1b Safe send (#421) 2025-06-16 21:58:20 -07:00
Will Chen
30b5c0d0ef Replace thinking with native Gemini thinking summaries (#400)
This uses Gemini's native [thinking
summaries](https://cloud.google.com/vertex-ai/generative-ai/docs/thinking#thought-summaries)
which were recently added to the API.

Why? The grafted thinking would sometimes cause weird issues where the
model, especially Gemini 2.5 Flash, got confused and put dyad tags like
`<dyad-write>` inside the `<think>` tags.

This also improves the UX because you can see the native thoughts rather
than having the Gemini response load for a while without any feedback.

I tried adding Anthropic extended thinking, however it requires temp to
be set at 1, which isn't ideal for Dyad's use case where we need precise
syntax following.
2025-06-16 17:29:32 -07:00
Will Chen
c1aa6803ce Click to edit UI (#385)
- [x] add e2e test - happy case (make sure it clears selection and next
prompt is empty, and preview is cleared); de-selection case
- [x] shim - old & new file
- [x] upgrade path
- [x] add docs
- [x] add try-catch to parser script
- [x] make it work for next.js
- [x] extract npm package
- [x] make sure plugin doesn't apply in prod
2025-06-11 13:05:27 -07:00
Will Chen
fa80014e16 Remove budget saver mode (#378)
This code was quite complex and hairy and resulted in very opaque errors
(for both free and pro users). There's not much benefit to budget saver
because Google removed 2.5 Pro free quota a while ago (after it
graduated the model from experimental to preview). Dyad Pro users can
still use 2.5 Flash free quota by disabling Dyad Pro by clicking on the
Dyad Pro button at the top.
2025-06-10 13:54:27 -07:00
Will Chen
534cbad909 Allow manual context management (#376) 2025-06-10 13:52:20 -07:00
Will Chen
f4c7d614bd Escape dyad tags inside thinking blocks (#229) 2025-05-22 16:06:28 -07:00
Will Chen
b5671c0a59 Auto-commit extra files (#197)
Whenever Dyad does a commit from a proposal, it will automatically amend
the commit with outside changes (e.g. made outside of Dyad).

This helps avoid a lot of user confusion, e.g.
https://github.com/dyad-sh/dyad/issues/187

https://www.reddit.com/r/dyadbuilders/comments/1kjysc0/error_pushing_images/

Edge cases:
If a user adds a file outside of Dyad, and then they hit retry, it will
revert these outside changes, but it's still technically in the version
history, so I think it's OK. This should also be a pretty unusual
situation.

Fixes #164 
Fixes #187
2025-05-19 13:42:27 -07:00
Will Chen
59c18c3859 Extract AI rules (#188) 2025-05-17 23:04:48 -07:00
Will Chen
f9f33596bd Smart files context (#184) 2025-05-16 22:21:45 -07:00
Will Chen
35b459d82d Support turbo edits (pro) (#166) 2025-05-14 23:35:50 -07:00
Will Chen
069c221292 Implement saver mode (#154) 2025-05-13 15:34:41 -07:00
Will Chen
14d9a12464 Max chat turns settings (default to 5) (#152) 2025-05-13 11:51:44 -07:00
Will Chen
877c8f7f4f Simplify provider logic and migrate getContextWindow (#142) 2025-05-12 22:18:49 -07:00
Will Chen
cd7eaa8ece Prep for custom models: support reading custom providers (#131) 2025-05-12 14:52:48 -07:00
Will Chen
2537fbb342 lint using oxlint (#106) 2025-05-08 17:21:35 -07:00
Will Chen
0d56651220 Run prettier on everything (#104) 2025-05-06 23:02:28 -07:00
Will Chen
45b1738f03 check supabase token before retrieving context (#99) 2025-05-06 12:54:28 -07:00
Will Chen
c425daf893 Show warning if there's uncommitted changes (#92) 2025-05-06 11:07:31 -07:00
Will Chen
ac8ef73bee Support image/file attachments (#80) 2025-05-05 12:38:09 -07:00