• 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
名称
最后提交
最后更新
..
app_env_vars_handlers.ts 正在载入提交数据...
app_handlers.ts 正在载入提交数据...
app_upgrade_handlers.ts 正在载入提交数据...
capacitor_handlers.ts 正在载入提交数据...
chat_handlers.ts 正在载入提交数据...
chat_stream_handlers.ts 正在载入提交数据...
context_paths_handlers.ts 正在载入提交数据...
createFromTemplate.ts 正在载入提交数据...
debug_handlers.ts 正在载入提交数据...
dependency_handlers.ts 正在载入提交数据...
git_branch_handlers.ts 正在载入提交数据...
github_handlers.ts 正在载入提交数据...
help_bot_handlers.ts 正在载入提交数据...
import_handlers.ts 正在载入提交数据...
language_model_handlers.ts 正在载入提交数据...
local_model_handlers.ts 正在载入提交数据...
local_model_lmstudio_handler.ts 正在载入提交数据...
local_model_ollama_handler.ts 正在载入提交数据...
mcp_handlers.ts 正在载入提交数据...
neon_handlers.ts 正在载入提交数据...
node_handlers.ts 正在载入提交数据...
portal_handlers.ts 正在载入提交数据...
pro_handlers.ts 正在载入提交数据...
problems_handlers.ts 正在载入提交数据...
prompt_handlers.ts 正在载入提交数据...
proposal_handlers.ts 正在载入提交数据...
release_note_handlers.ts 正在载入提交数据...
safe_handle.ts 正在载入提交数据...
security_handlers.ts 正在载入提交数据...
session_handlers.ts 正在载入提交数据...
settings_handlers.ts 正在载入提交数据...
shell_handler.ts 正在载入提交数据...
supabase_handlers.ts 正在载入提交数据...
template_handlers.ts 正在载入提交数据...
testing_chat_handlers.ts 正在载入提交数据...
themes_handlers.ts 正在载入提交数据...
token_count_handlers.ts 正在载入提交数据...
upload_handlers.ts 正在载入提交数据...
vercel_handlers.ts 正在载入提交数据...
version_handlers.ts 正在载入提交数据...
window_handlers.ts 正在载入提交数据...