Commit Graph
28 Commits
Author SHA1 Message Date
Charis d897c74896 fix nimbus search (#45331)
Nimbus search is broken because it expects the page section to be joined
with the page table, but this table is called page_nimbus in Nimbus
mode.

Resolves AI-682

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Fixed source reference attribution to use the correct path when using
the alternate search index option.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-04-28 16:02:54 +00:00
Joshen Lim 7f5865872a Enforce noUnusedLocals and noUnusedParameters in tsconfig.json + fix all related issues (#45264)
## Context

Enforce `noUnusedLocals` and `noUnusedParameters` in tsconfig.json + fix
all related issues
2026-04-27 17:42:34 +08:00
Ivan Vasilov 1cd1ebfc7f chire: Sort imports in all packages, cms, design-system and ui-library apps (#41610)
Sorted all imports in all packages, `cms`, `design-system` and
`ui-library` apps by running `pnpm format` on them.

All changes in this PR are done by the script.
2026-02-05 13:54:10 +01:00
Charis 8cd5e10038 feat: alternate search index for nimbus (#38662)
* feat: alternate search index for nimbus

Create an alternate search index for Nimbus that filters out
feature-flagged pages (equivalent to setting all feature flags to
false).

Notes:
- Creates two new DB tables, `page_nimbus` and `page_section_nimbus`,
  which are filtered versions of `page` and `page_section`
- Makes `nimbus` versions of all the DB search functions
- Refactored the embedding upload script. Changes to make it faster (got
  annoyed by how slow it was when testing...), incorporate retries, and
  produce better summary logs.
- Upload script, when run with the environment variable
  ENABLED_FEATURES_OVERRIDE_DISABLE_ALL, produces and uploads the
  alternate search index
- Changed all the search calls in frontend/API to check for
  `isFeatureEnabled('search:fullIndex')` to determine whether to search
  the full or alternate index

* ci: produce nimbus search indexes on merge

* fix: turn full search index on
2025-09-16 12:37:53 -04:00
Terry SuttonandIvan Vasilov f9921569a9 Nudge feedback widget, move request to bedrock (#38074)
* Nudge feedback widget, move request to bedrock

* Fix the response object

* Remove an import to deleted file.

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2025-08-21 08:56:54 -02:30
d52e2c252b Update AI SDK 5 (#37656)
* attempt to update packages and useChat

* update endpoints

* update zod

* zod

* update to v5

* message update

* Revert "zod"

This reverts commit ec39bac6b6.

* revert zod

* zod i

* fix complete endpoints

* remove async

* change to content

* type cleanup

* Revert the package bumps to rebuild them.

* Bump zod to 2.25.76 in all packages.

* Bump openai in all packages.

* Bump ai and ai-related packages.

* Remove unneeded files.

* Fix the rest of the migration stuff.

* Prettier fixes.

* zod

* v4 again

---------

Co-authored-by: Jordi Enric <jordi.err@gmail.com>
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2025-08-08 14:15:39 +07:00
Bobbie Soedirgo 226d05fb83 fix: warning message on upgrade guards (#36646)
* fix: warning message on upgrade guards

When users are blocked from an upgrade because they have objects that
need to be dropped, the message in the warning is incorrect. It asks
users to "drop these extensions". But they're not extensions, they're
user-defined tables, foreign keys, etc. This will cause confusion.

Here we use a different messaging when users need to drop their objects.

* chore: prettier
2025-06-25 16:06:47 +08:00
Charis 97d80a7166 feat(clippy): add source links to chat responses (#36343)
This change:
- Updates the clippy prompt to encourage it to list its sources
- Parses and extracts source links from AI responses to display them as clickable links in the UI
- Adds tests for the source parsing functionality
2025-06-18 09:00:58 -04:00
Terry SuttonandJoshen Lim 8fe31d903b Chore/feedback classifier (#36147)
* First

* Update

* Cleanup

* Reduce debounce

* Add a picker before displaying feedback widget

* Update styles

* Clean up

* Fix error msg

* More prompt examples

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-06-06 16:01:10 -02:30
Ivan Vasilov 8693222124 chore: AI-commands tests with pnpm (#31250)
* Remove jest and add vitest in its place. Refactor the jest setup into vitest.

* Modify the expect extensions to work with vitest.

* FIx the tests.
2024-12-20 17:32:19 +01:00
Terry SuttonandIvan Vasilov b97a2636cb Chore/cron UI seconds 2 (#30673)
* Check if pg_cron supports seconds

* Add cron parser

* Lock file

* Update prompt to handle seconds

* Various fixes for the createCronJobSheet.

* Remove extra code.

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2024-11-28 10:22:29 +01:00
Terry SuttonandJoshen Lim 4fb9b58486 Chore/cron ai nudges (#30527)
* Adjust prompt, ui

* Account for seconds properly

* More minute adjustments

* Account for seconds properly, again

* Lint

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-11-20 08:18:22 -03:30
Terry SuttonandJoshen Lim 95219d3e2a Chore/cron nl (#30345)
* Add NL input

* Add chart to sidebar

* Better loading animation

* Redo api route to not use edge

* Remove edge stuff

* Allow sheet to close

* Cleanup

* Adjust loading state

* Add timezone

* CR comments

* Replace query with useCompletion

* Set the form value

* Tiny clean up

* Tinyyyyy tweaks

* Fix missing syntax

* Smol refactor

* Fixy

* Remove console log

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-11-12 11:55:01 -03:30
Joshen Lim 225d461381 Hook up RLS to new assistant if feature flag is enabled (#30357)
* Hook up RLS to new assistant if feature flag is enabled

* Reset conversation if opening a different entity

* Add prompt to use alter policy if policy definition is provided

* Remove console log
2024-11-08 18:03:30 +08:00
Joshen Lim 01e81fd400 Chore/assistant tweaks 281024 (#30134)
* Add alpha notice

* Close assistant via cmd i if not focused on monaco

* Add edit with assistant CTA for database functions

* Attach existing function definition when editing a function to prompt

* Leave comments

* Small refactor
2024-10-29 15:10:00 +08:00
Joshen Lim f521109ce2 Chore/database functions v2 (#29969)
* Init AiAssistantPanel

* Temp

* Temp

* iterating on assistant ux

* More spiking

* Tweaking...

* Moar tweaking..

* Even more tweaking

* Tweek

* More tweaks

* Final tweaking...

* TWEAK

* Spelling

* Fix

* Assistant error handling and small bug fix in context for message

* Add feature flag

* Fix

* Address all feedback

* Minor
2024-10-23 16:43:38 +08:00
Terry Sutton a40ccd11bc rls changes (#29118)
* Inital setup

* Add suggest feature to the RLS Assistant

* Add AI button

* Use existing policies in AI editor

* Remove old feature preview

* Cleanup

* Tooltip

* Update

* Change panel width

* Fix type

* Fix types again

* Flag cleanup

* Add tooltip

* Cleanup

* Add a clear history button
2024-10-02 08:52:36 -02:30
Terry SuttonandIvan Vasilov e81beac7ec Replace 3.5 with 4o (#29145)
* Replace 3.5 with 4o

* Update

* Fix tests

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2024-09-13 14:15:22 -02:30
Terry SuttonandIvan Vasilov 024ccfcc04 Update to 4o-mini (#28818)
* Update to 4o-mini

* Package lock

* Copy packagelock from master, use specific model version

* Fix the package.lock.

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2024-08-22 15:42:58 +00:00
Kevin Grüneberg 33142c2340 chore: type imports / avoid barrel file (#28100) 2024-07-23 09:55:41 +08:00
Greg RichardsonandIvan Vasilov 801ad65603 RLS AI improvements (#26895)
* chore: libpg-query types

* feat: improved rls ai tests

* feat: simplify assertitions for sql expressions

* refactor: split ai logic into separate files

* feat(rls-ai): test select, insert, update, delete policies

* feat: adds withMetadata wrapper for failed tests

* chore: remove custom libpg-query types

* feat(rls-ai): make tests concurrent

* fix(rls-ai): rules for 'using' and 'with check'

* feat(rls-ai): discourages restrictive policies

* feat(ai): makes withMetadata util sync or async

* refactor(ai): moves withMetadata to generic test utils

* feat(rls-ai): test joined table

* feat(rls-ai): test mfa

* chore(ai): make all tests concurrent

* fix(ai): chatSql function rename in studio

* refactor(ai): isolate logic into separate files

* chore(ai): remove trailing comma in tsconfig

* chore(ai): remove unused dep

* Reset some of the package versions to the versions from master.

* chore(ai): remove unused imports

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2024-06-05 14:33:56 +02:00
Ivan Vasilov 6f5cabdc62 feat: Make the conversational AI in the SQL editor default (#23142)
* Remove feature preview for the conversational AI for SQL editor.

* Remove all code related to the previous implementation of editor ai.

* Update the snapshots for the ai commands.

* Remove unneeded code from the ai panel.

* Show the diff bar when debugging.

* Convert the updateEditor function into a callback.

* Simplify the debugging functionality by using react state instead of react context.

* Erase the AI disclaimer when formatting code as modification.

* Add a button to clear the chat history.
2024-05-14 15:40:42 +02:00
Terry Sutton a5d00f9923 Chore/rename open ai key name (#21856)
* Rename OPENAI_KEY to OPENAI_API_KEY

* Force a redeploy
2024-04-25 09:38:56 -02:30
7548fd1850 feat: Conversational AI for the SQL Editor (#21388)
* Add a API endpoint for generating queries for the SQL editor.

* Merge all multiline props.

* Add a new component for diff actions.

* Copy components for the AI panel.

* Add useChat hook.

* Add a feature preview for the this feature. The preview is dependent on the feature flag.

* Reorder the nesting in the SQL editor to accomodate the AI assistant.

* Try to fit both AI assistants in the SQL editor, available via a feature preview.

* Refactor the SQL editor to make the diff work correctly in all cases.

* Minor fixes for the old AI feature.

* Fix the debug functionality to work with both assistants.

* Fix some copy-paste leftovers.

* Remove unneeded code.

* Make the icons softer.

* Fix the name of the panel component.

* Fix console.logs.

* Add overflow to the AI assistant.

* surface opt in config in ai settings button

* Skip diffing if editor is empty

* Add selected state when selecting a message to insert/replace code

* Add sample prompts

* Add SQL ai dislaimer when replacing code

* Light mode action bar nudges

* Add text for the feature preview.

* lang nudges

* Hide the command suggestions for now.

* Set the discussion url to undefined.

* Don't add the disclaimer twice.

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
Co-authored-by: Terry Sutton <saltcod@gmail.com>
2024-03-05 17:26:11 +01:00
Ivan Vasilov 4dac01e378 chore: Migrate Clippy to Nextjs API docs (#20903)
* Add a new function to ai-commands package.

* Add a new API route to all three apps.

* Refactor the Command component to use the new URL.

* Resort the imports.
2024-02-12 10:10:52 +01:00
Greg Richardson 17a982f24d Update AI models to gpt-3.5-turbo-0125 (#21090)
* chore: update ai models to gpt-3.5-turbo-0125

* fix(ai): prompt to use semicolons in sql gen

* fix: parse multiline policy expressions
2024-02-09 12:29:12 -07:00
Greg Richardson 1a244b79a5 Automated AI tests via GitHub Actions (#19880)
* ci: ai tests

* chore(ai-commands): update readme

* fix: dont load .env.local in ci environment

* fix: pass openai env variable into ci job

* feat(ai): llm evaluated tests

* chore(ai): remove unused jest snapshots
2023-12-20 09:34:30 -07:00
Greg RichardsonandIvan Vasilov a6f1313490 AI SQL: Update model + add test suite (#19644)
* refactor: ai sql logic to common package

* feat: ai sql tests

* feat: test rls policy ai chat assistant

* refactor: jest env loading

* feat(ai): improve sql title and description quality

* fix: ai message role type

* Move the new files to a separate package.

* Remove a forgotten console.log.

* Migrate the tests to use snapshots and commit the snapshots.

* Separate the functions which require edge runtime to be exported via /edge subpath.

* Bust the turbo cache when one of the deps has been rebuilt.

* chore: fix package main/type references

* fix: package lock out of sync

* fix: ai sql debugging to fix typos

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2023-12-18 11:23:59 -07:00