• Will Chen's avatar
    Refactor Supabase prompt to use dynamic code injection (#2222) · f9c21979
    Will Chen 提交于
    Changed the Supabase prompt from using $$SUPABASE_CLIENT_CODE$$
    placeholder replacement to dynamically constructing the system prompt
    with the actual Supabase client code. This is more reliable and removes
    the need for post-processing the AI response.
    
    Changes:
    - Convert SUPABASE_AVAILABLE_SYSTEM_PROMPT to
    getSupabaseAvailableSystemPrompt() function
    - Pass supabaseClientCode parameter when constructing system prompt
    - Remove response chunk processing that replaced
    $$SUPABASE_CLIENT_CODE$$
    - Update prompt to instruct AI to write to appropriate file path instead
    of hardcoding <dyad-write>
    - Update test fixture to contain actual expected Supabase client code
    
    <!-- CURSOR_SUMMARY -->
    ---
    
    > [!NOTE]
    > Refactors Supabase integration to embed real client code directly in
    the system prompt, eliminating placeholder replacement and making
    generation deterministic.
    > 
    > - Replace `SUPABASE_AVAILABLE_SYSTEM_PROMPT` with
    `getSupabaseAvailableSystemPrompt(supabaseClientCode)` and update
    instructions to create `src/integrations/supabase/client.ts` and add
    `@supabase/supabase-js`
    > - In `chat_stream_handlers.ts` and `token_count_handlers.ts`, fetch
    `supabaseClientCode` via `getSupabaseClientCode` and append
    `getSupabaseAvailableSystemPrompt(...)` to `systemPrompt`
    > - Remove response-time placeholder replacement logic for
    `$$SUPABASE_CLIENT_CODE$$` in streaming handler
    > - Update e2e fixture `generate-supabase-client.md` to include the
    concrete client implementation
    > 
    > <sup>Written by [Cursor
    Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
    dfec59bfd59df71af534db92b4d8f1a6f1606047. 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
    Refactors the Supabase prompt to inject the real client code into the
    system prompt, replacing the $$SUPABASE_CLIENT_CODE$$ placeholder. This
    removes response post-processing and makes client file creation more
    reliable.
    
    - **Refactors**
    - Replace SUPABASE_AVAILABLE_SYSTEM_PROMPT constant with
    getSupabaseAvailableSystemPrompt(supabaseClientCode).
    - Build the system prompt with supabaseClientCode in chat and token
    count handlers.
      - Remove placeholder replacement from chat stream response handling.
    - Update prompt to embed the actual client code, instruct the correct
    file path, and add the @supabase/supabase-js dependency.
      - Update e2e fixture to include the expected Supabase client code.
    
    <sup>Written for commit dfec59bfd59df71af534db92b4d8f1a6f1606047.
    Summary will update on new commits.</sup>
    
    <!-- End of auto-generated description by cubic. -->
    
    ---------
    Co-authored-by: 's avatarClaude <noreply@anthropic.com>
    f9c21979
名称
最后提交
最后更新
.claude 正在载入提交数据...
.cursor/rules 正在载入提交数据...
.devcontainer 正在载入提交数据...
.github 正在载入提交数据...
.husky 正在载入提交数据...
assets 正在载入提交数据...
docs 正在载入提交数据...
drizzle 正在载入提交数据...
e2e-tests 正在载入提交数据...
packages/@dyad-sh 正在载入提交数据...
scaffold 正在载入提交数据...
scripts 正在载入提交数据...
shared 正在载入提交数据...
src 正在载入提交数据...
testing 正在载入提交数据...
tools 正在载入提交数据...
worker 正在载入提交数据...
workers/tsc 正在载入提交数据...
.cursorignore 正在载入提交数据...
.env.example 正在载入提交数据...
.eslintrc.json 正在载入提交数据...
.gitattributes 正在载入提交数据...
.gitignore 正在载入提交数据...
.oxlintrc.json 正在载入提交数据...
.prettierignore 正在载入提交数据...
.prettierrc 正在载入提交数据...
AGENTS.md 正在载入提交数据...
CLA.md 正在载入提交数据...
CONTRIBUTING.md 正在载入提交数据...
LICENSE 正在载入提交数据...
README.md 正在载入提交数据...
SECURITY.md 正在载入提交数据...
biome.json 正在载入提交数据...
components.json 正在载入提交数据...
drizzle.config.ts 正在载入提交数据...
forge.config.ts 正在载入提交数据...
forge.env.d.ts 正在载入提交数据...
index.html 正在载入提交数据...
lint-staged.config.js 正在载入提交数据...
merge.config.ts 正在载入提交数据...
package-lock.json 正在载入提交数据...
package.json 正在载入提交数据...
playwright.config.ts 正在载入提交数据...
tsconfig.app.json 正在载入提交数据...
tsconfig.json 正在载入提交数据...
tsconfig.node.json 正在载入提交数据...
vite.main.config.mts 正在载入提交数据...
vite.preload.config.mts 正在载入提交数据...
vite.renderer.config.mts 正在载入提交数据...
vite.worker.config.mts 正在载入提交数据...
vitest.config.ts 正在载入提交数据...