2025-07-23 21:58:11 +08:00
|
|
|
import { BaseFrom, ColumnRefItem, Join, Parser, type Select } from 'node-sql-parser';
|
Mastra braintrust (#391)
* type fixes
* biome clean on ai
* add user to flag chat
* attempt to get vercel deployed
* Update tsup.config.ts
* Update pnpm-lock.yaml
* Add @buster/server2 Hono API app with Vercel deployment configuration
* slack oauth integration
* mainly some clean up and biome formatting
* slack oauth
* slack migration + snapshot
* remove unused files
* finalized docker image for porter
* Create porter_app_buster-server_3155.yml file
* Add integration tests for Slack handler and refactor Slack OAuth service
- Introduced integration tests for the Slack handler, covering OAuth initiation, callback handling, and integration status retrieval.
- Refactored Slack OAuth service to improve error handling and ensure proper integration state management.
- Updated token storage implementation to use a database vault instead of Supabase.
- Enhanced existing tests for better coverage and reliability, including cleanup of test data.
- Added new utility functions for managing vault secrets in the database.
* docker image update
* new prompts
* individual tests and a schema fix
* server build
* final working dockerfile
* Update Dockerfile
* new messages to slack messages (#369)
* Update dockerfile
* Update validate-env.js
* update build pipeline
* Update the dockerfile flow
* finalize logging for pino
* stable base
* Update cors middleware logger
* Update cors.ts
* update docker to be more imformative
* Update index.ts
* Update auth.ts
* Update cors.ts
* Update cors.ts
* Update logger.ts
* remove logs
* more cors updates
* build server shared
* Refactor PostgreSQL credentials handling and remove unused memory storage. Update package dependencies. (#370)
* tons of file parsing errors (#371)
* Refactor PostgreSQL credentials handling and remove unused memory storage. Update package dependencies.
* tons of file parsing errors
* Dev mode updates
* more stable electric handler
* Dal/agent-self-healing-fixes (#372)
* change to 6 min
* optmizations around saving and non-blocking actions.
* stream optimizations
* Dal/agent-self-healing-fixes (#373)
* change to 6 min
* optmizations around saving and non-blocking actions.
* stream optimizations
* change porter staging deploy to mastra-braintrust.
* new path for porter deploy
* deploy to staging fix
* Create porter_app_mastra-braintrust-api_3155.yml file (#375)
Co-authored-by: porter-deployment-app[bot] <87230664+porter-deployment-app[bot]@users.noreply.github.com>
* Update sizing and opacity
* supe up the instance for mastra
* environment staging
* ssl script
* copy path
* Update list padding
* no throttle and the anthropic cached
* move select to the top
* Update margin inline start
* shrink reasoning vertical space to 2px
* semi bold font for headers
* update animation timing
* haiku
* Add createTodoList tool and integrate into create-todos-step
* chat helper on post chat
* only trigger cicd when change made
* Start created streaming text components
* Refactor analyst agent task to initialize Braintrust logging asynchronously and parallelize database queries for improved performance. Adjusted cleanup timeout for Braintrust traces to reduce delays.
* fixed reasoned for X, so that it rounds down to the minute
* Update users page
* update build pipeline for new web
* document title update
* Named chats for page
* Datasets titles
* Refactor visualization tools and enhance error handling in retryable agent stream. Removed unused metricValueLabel from metrics file tool, updated metric configuration schemas, and improved healing mechanism for tool errors during streaming.
* analyst
* document title updates
* Update useDocumentTitle.tsx
* Refactor tool choice configuration in create-todos-step to use structured object. Remove exponential backoff logic from retryable agent stream for healable errors. Introduce new test for real-world healing scenarios in retryable agent stream.
* Refactor SQL validation logic in modify-metrics-file-tool to skip unnecessary checks when SQL has not changed. Enhance error handling and update validation messages. Clean up code formatting for improved readability.
* update collapse for filecard
* chevron collapse
* Jacob prompt changes (#376)
* prompt changes to improve filtering logic and handle priv/sec errors
* prompt changes to make aggregation better and improved filter best practices
* Update packages/ai/src/steps/create-todos-step.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* Update packages/ai/src/agents/think-and-prep-agent/think-and-prep-instructions.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* Update packages/ai/src/steps/create-todos-step.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
---------
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
Co-authored-by: dal <dallin@buster.so>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* think and prep
* change header and strong fonts weights
* Update get collection
* combo chart x axis update
* Create a chart schemas as types
* schema types
* simple unit tests for line chart props
* fix the response file ordering iwth active selection.
* copy around reasoning messages taken care of
* fix nullable user message and file processing and such.
* update ticks for chart config
* fix todo parsing.
* app markdown update
* Update splitter to use border instead of width
* change ml
* If no file is found we should auto redirect
* Refactor database connection handling to support SSL modes. Introduced functions to extract SSL parameters and manage connections based on SSL requirements, including a custom verifier for unverified connections.
* black box message update
* chat title updates
* optimizations for trigger.
* some keepalive logic on the anthropic cached
* keep title empty until new one
* no duplicate messages
* null user message on asset pull
* posthog error handling
* 20 sec idle timeout on anthropic
* null req message
* fixed modificiation names missing
* Refactor tool call handling to support new content array format in asset messages and context loaders
* cache most recent file from workflow
* Enhance date and number detection in createDataMetadata function to improve data type handling for metrics files
* group hover effect for message
* logging for chat
* Add messageId handling and file association tracking in dashboard and metrics tools
- Updated runtime context to include messageId in create and modify dashboard and metrics file tools.
- Implemented file association tracking based on messageId in create and modify functions for both dashboards and metrics.
- Ensured type consistency by using AnalystRuntimeContext in runtime context parameters.
* logging for chat
* message type update
* Route to first file instead
* trigger moved to catalog
* Enhance file selection logic to support YAML parsing and improve logging
- Updated `extractMetricIdsFromDashboard` to first attempt JSON parsing, falling back to a regex-based YAML parsing for metric IDs.
- Added detailed debug logging in `selectFilesForResponse` to track file selection process, including metrics and dashboards involved.
- Introduced tests for various scenarios in `file-selection.test.ts` to ensure correct behavior with dashboard context and edge cases.
* trigger dev v4-beta
* Retry + Self Healing (#381)
* Refactor retry logic in analyst and think-and-prep steps
Co-authored-by: dallin <dallin@buster.so>
* some fixes
* console log error
* self healing
* todos retry
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* remove lots of logs
* Remove chat streaming
* Remove chat streaming
* timeout
* Change to updated at field
* link to home
* Update timeout settings for HTTP and HTTPS agents from 20 seconds to 10 seconds for improved responsiveness.
* Add utils module and integrate message conversion in post_chat_handler
* Implement error handling for extract values (#382)
* Remove chat streaming
* Improve error handling and logging in extract values and chat title steps
Co-authored-by: dallin <dallin@buster.so>
---------
Co-authored-by: Nate Kelley <nate@buster.so>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* loading icon for buster avatar
* finalize tooltip cache
* upgrade mastra
* increase retries
* Add redo functionality for chat messages
- Introduced `redoFromMessageId` parameter in `handleExistingChat` to allow users to specify a message to redo from.
- Implemented validation to ensure the specified message belongs to the current chat.
- Added `softDeleteMessagesFromPoint` function to soft delete a message and all subsequent messages in the same chat, facilitating the redo feature.
* fix electric potential memory leak
* tooltip cache and chart cleanup
* Update bullet to be more indented
* latest version number
* add support endpoint to new server
* Fix jank in combo bar charts
* index check for dashboard
* Collapse only if there are metrics
* Is finished reasoing back
* Update dependencies and enhance chat message handling
- Upgraded `@mastra/core` to version 0.10.8 and added `node-sql-parser` at version 5.3.10 in the lock file.
- Improved integration tests for chat message redo functionality, ensuring correct behavior when deriving `chat_id` from `message_id`.
- Enhanced error handling and validation in the `initializeChat` function to manage cases where `chat_id` is not provided.
* Update pnpm-lock and enhance chat message integration tests
- Added `node-sql-parser` version 5.3.10 to dependencies and updated the lock file.
- Improved integration tests for chat message redo functionality, ensuring accurate deletion and retrieval of messages.
- Enhanced the `initializeChat` function to derive `chat_id` from `message_id` when not provided, improving error handling and validation.
* remove .env import breaking build
* add updated at to the get chat handler
* zmall runtime error fix
* permission tests passing
* return updated at on the get chat handler now
* slq parser fixes
* Implement chat access control logic and add comprehensive tests
- Developed the `canUserAccessChat` function to determine user access to chats based on direct permissions, collection permissions, creator status, and organizational roles.
- Introduced helper functions for checking permissions and retrieving chat information.
- Added integration tests to validate access control logic, covering various scenarios including direct permissions, collection permissions, and user roles.
- Created unit tests to ensure the correctness of the access control function with mocked database interactions.
- Included simple integration tests to verify functionality with existing database data.
* sql parser and int tests working.
* fix test and lint issues
* comment to kick off deployment lo
* access controls on datasets
* electric context bug fix with sql helpers.
* permission and read only
* Add lru-cache dependency and export cache management functions
- Added `lru-cache` as a dependency in the access-controls package.
- Exported new cache management functions from `chats-cached` module, including `canUserAccessChatCached`, `getCacheStats`, `resetCacheStats`, `clearCache`, `invalidateAccess`, `invalidateUserAccess`, and `invalidateChatAccess`.
* packages deploy as well
* wrong workflow lol
* Update AppVerticalCodeSplitter.tsx
* Add error handling for query run and SQL save operations
Co-authored-by: natemkelley <natemkelley@gmail.com>
* Trim whitespace from input values before sending chat prompts
Co-authored-by: natemkelley <natemkelley@gmail.com>
* type in think-and-prep
* use the cached access chat
* update package version
* new asset import message
* Error fallback for login
* Update BusterChart.BarChart.stories.tsx
* Staging changes to fix number card titles, combo chart axis, and using dynamic filters (#386)
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
* db init command pass through
* combo chart fixes (#387)
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
* clarifying question and connection logic
* pino pretty error fix
* clarifying is a finishing tool
* change update latest version logic
* Update support endpoint
* fixes for horizontal bar charts and added the combo chart logic to update metrics (#388)
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
* permission fix on dashboard metric handlers for workspace and data admin
* Add more try catches
* Hide avatar is no more
* Horizontal bar fixes (#389)
* fixes for horizontal bar charts and added the combo chart logic to update metrics
* hopefully fixed horizontal bar charts
---------
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
* reasoning shimmer update
* Make the embed flow work with versions
* new account warning update
* Move support modal
* compact number for pie label
* Add final reasoning message tracking and workflow start time to chunk processor and related steps
- Introduced `finalReasoningMessage` to schemas in `analyst-step`, `mark-message-complete-step`, and `create-todos-step`.
- Updated `ChunkProcessor` to calculate and store the final reasoning message based on workflow duration.
- Enhanced various steps to utilize the new `workflowStartTime` for better tracking of execution duration.
- Improved database update logic to include `finalReasoningMessage` when applicable.
* 9 digit cutoff for pie
* trigger update
* test on mastra braintrust
* test deployment
* testing
* pnpm install
* pnpm
* node 22
* pnpm version
* trigger main
* get initial chat file
* hono main deploymenbt
* clear timeouts
* Remove console logs
* migration test to staging
* db url
* try again
* k get rid of tls var
* hmmm lets try this
* mark migrations
* fix migration file?
* drizzle-kit upgrade
* tweaks to the github actions
---------
Co-authored-by: Nate Kelley <nate@buster.so>
Co-authored-by: porter-deployment-app[bot] <87230664+porter-deployment-app[bot]@users.noreply.github.com>
Co-authored-by: Nate Kelley <133379588+nate-kelley-buster@users.noreply.github.com>
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
Co-authored-by: jacob-buster <jacob@buster.so>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: natemkelley <natemkelley@gmail.com>
2025-07-03 05:33:40 +08:00
|
|
|
import * as yaml from 'yaml';
|
|
|
|
|
|
|
|
export interface ParsedTable {
|
|
|
|
database?: string;
|
|
|
|
schema?: string;
|
|
|
|
table: string;
|
|
|
|
fullName: string;
|
|
|
|
alias?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface QueryTypeCheckResult {
|
|
|
|
isReadOnly: boolean;
|
|
|
|
queryType?: string;
|
|
|
|
error?: string;
|
|
|
|
}
|
|
|
|
|
2025-07-23 21:34:56 +08:00
|
|
|
export interface WildcardValidationResult {
|
|
|
|
isValid: boolean;
|
|
|
|
error?: string;
|
|
|
|
blockedTables?: string[];
|
|
|
|
}
|
|
|
|
|
Mastra braintrust (#391)
* type fixes
* biome clean on ai
* add user to flag chat
* attempt to get vercel deployed
* Update tsup.config.ts
* Update pnpm-lock.yaml
* Add @buster/server2 Hono API app with Vercel deployment configuration
* slack oauth integration
* mainly some clean up and biome formatting
* slack oauth
* slack migration + snapshot
* remove unused files
* finalized docker image for porter
* Create porter_app_buster-server_3155.yml file
* Add integration tests for Slack handler and refactor Slack OAuth service
- Introduced integration tests for the Slack handler, covering OAuth initiation, callback handling, and integration status retrieval.
- Refactored Slack OAuth service to improve error handling and ensure proper integration state management.
- Updated token storage implementation to use a database vault instead of Supabase.
- Enhanced existing tests for better coverage and reliability, including cleanup of test data.
- Added new utility functions for managing vault secrets in the database.
* docker image update
* new prompts
* individual tests and a schema fix
* server build
* final working dockerfile
* Update Dockerfile
* new messages to slack messages (#369)
* Update dockerfile
* Update validate-env.js
* update build pipeline
* Update the dockerfile flow
* finalize logging for pino
* stable base
* Update cors middleware logger
* Update cors.ts
* update docker to be more imformative
* Update index.ts
* Update auth.ts
* Update cors.ts
* Update cors.ts
* Update logger.ts
* remove logs
* more cors updates
* build server shared
* Refactor PostgreSQL credentials handling and remove unused memory storage. Update package dependencies. (#370)
* tons of file parsing errors (#371)
* Refactor PostgreSQL credentials handling and remove unused memory storage. Update package dependencies.
* tons of file parsing errors
* Dev mode updates
* more stable electric handler
* Dal/agent-self-healing-fixes (#372)
* change to 6 min
* optmizations around saving and non-blocking actions.
* stream optimizations
* Dal/agent-self-healing-fixes (#373)
* change to 6 min
* optmizations around saving and non-blocking actions.
* stream optimizations
* change porter staging deploy to mastra-braintrust.
* new path for porter deploy
* deploy to staging fix
* Create porter_app_mastra-braintrust-api_3155.yml file (#375)
Co-authored-by: porter-deployment-app[bot] <87230664+porter-deployment-app[bot]@users.noreply.github.com>
* Update sizing and opacity
* supe up the instance for mastra
* environment staging
* ssl script
* copy path
* Update list padding
* no throttle and the anthropic cached
* move select to the top
* Update margin inline start
* shrink reasoning vertical space to 2px
* semi bold font for headers
* update animation timing
* haiku
* Add createTodoList tool and integrate into create-todos-step
* chat helper on post chat
* only trigger cicd when change made
* Start created streaming text components
* Refactor analyst agent task to initialize Braintrust logging asynchronously and parallelize database queries for improved performance. Adjusted cleanup timeout for Braintrust traces to reduce delays.
* fixed reasoned for X, so that it rounds down to the minute
* Update users page
* update build pipeline for new web
* document title update
* Named chats for page
* Datasets titles
* Refactor visualization tools and enhance error handling in retryable agent stream. Removed unused metricValueLabel from metrics file tool, updated metric configuration schemas, and improved healing mechanism for tool errors during streaming.
* analyst
* document title updates
* Update useDocumentTitle.tsx
* Refactor tool choice configuration in create-todos-step to use structured object. Remove exponential backoff logic from retryable agent stream for healable errors. Introduce new test for real-world healing scenarios in retryable agent stream.
* Refactor SQL validation logic in modify-metrics-file-tool to skip unnecessary checks when SQL has not changed. Enhance error handling and update validation messages. Clean up code formatting for improved readability.
* update collapse for filecard
* chevron collapse
* Jacob prompt changes (#376)
* prompt changes to improve filtering logic and handle priv/sec errors
* prompt changes to make aggregation better and improved filter best practices
* Update packages/ai/src/steps/create-todos-step.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* Update packages/ai/src/agents/think-and-prep-agent/think-and-prep-instructions.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* Update packages/ai/src/steps/create-todos-step.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
---------
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
Co-authored-by: dal <dallin@buster.so>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* think and prep
* change header and strong fonts weights
* Update get collection
* combo chart x axis update
* Create a chart schemas as types
* schema types
* simple unit tests for line chart props
* fix the response file ordering iwth active selection.
* copy around reasoning messages taken care of
* fix nullable user message and file processing and such.
* update ticks for chart config
* fix todo parsing.
* app markdown update
* Update splitter to use border instead of width
* change ml
* If no file is found we should auto redirect
* Refactor database connection handling to support SSL modes. Introduced functions to extract SSL parameters and manage connections based on SSL requirements, including a custom verifier for unverified connections.
* black box message update
* chat title updates
* optimizations for trigger.
* some keepalive logic on the anthropic cached
* keep title empty until new one
* no duplicate messages
* null user message on asset pull
* posthog error handling
* 20 sec idle timeout on anthropic
* null req message
* fixed modificiation names missing
* Refactor tool call handling to support new content array format in asset messages and context loaders
* cache most recent file from workflow
* Enhance date and number detection in createDataMetadata function to improve data type handling for metrics files
* group hover effect for message
* logging for chat
* Add messageId handling and file association tracking in dashboard and metrics tools
- Updated runtime context to include messageId in create and modify dashboard and metrics file tools.
- Implemented file association tracking based on messageId in create and modify functions for both dashboards and metrics.
- Ensured type consistency by using AnalystRuntimeContext in runtime context parameters.
* logging for chat
* message type update
* Route to first file instead
* trigger moved to catalog
* Enhance file selection logic to support YAML parsing and improve logging
- Updated `extractMetricIdsFromDashboard` to first attempt JSON parsing, falling back to a regex-based YAML parsing for metric IDs.
- Added detailed debug logging in `selectFilesForResponse` to track file selection process, including metrics and dashboards involved.
- Introduced tests for various scenarios in `file-selection.test.ts` to ensure correct behavior with dashboard context and edge cases.
* trigger dev v4-beta
* Retry + Self Healing (#381)
* Refactor retry logic in analyst and think-and-prep steps
Co-authored-by: dallin <dallin@buster.so>
* some fixes
* console log error
* self healing
* todos retry
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* remove lots of logs
* Remove chat streaming
* Remove chat streaming
* timeout
* Change to updated at field
* link to home
* Update timeout settings for HTTP and HTTPS agents from 20 seconds to 10 seconds for improved responsiveness.
* Add utils module and integrate message conversion in post_chat_handler
* Implement error handling for extract values (#382)
* Remove chat streaming
* Improve error handling and logging in extract values and chat title steps
Co-authored-by: dallin <dallin@buster.so>
---------
Co-authored-by: Nate Kelley <nate@buster.so>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* loading icon for buster avatar
* finalize tooltip cache
* upgrade mastra
* increase retries
* Add redo functionality for chat messages
- Introduced `redoFromMessageId` parameter in `handleExistingChat` to allow users to specify a message to redo from.
- Implemented validation to ensure the specified message belongs to the current chat.
- Added `softDeleteMessagesFromPoint` function to soft delete a message and all subsequent messages in the same chat, facilitating the redo feature.
* fix electric potential memory leak
* tooltip cache and chart cleanup
* Update bullet to be more indented
* latest version number
* add support endpoint to new server
* Fix jank in combo bar charts
* index check for dashboard
* Collapse only if there are metrics
* Is finished reasoing back
* Update dependencies and enhance chat message handling
- Upgraded `@mastra/core` to version 0.10.8 and added `node-sql-parser` at version 5.3.10 in the lock file.
- Improved integration tests for chat message redo functionality, ensuring correct behavior when deriving `chat_id` from `message_id`.
- Enhanced error handling and validation in the `initializeChat` function to manage cases where `chat_id` is not provided.
* Update pnpm-lock and enhance chat message integration tests
- Added `node-sql-parser` version 5.3.10 to dependencies and updated the lock file.
- Improved integration tests for chat message redo functionality, ensuring accurate deletion and retrieval of messages.
- Enhanced the `initializeChat` function to derive `chat_id` from `message_id` when not provided, improving error handling and validation.
* remove .env import breaking build
* add updated at to the get chat handler
* zmall runtime error fix
* permission tests passing
* return updated at on the get chat handler now
* slq parser fixes
* Implement chat access control logic and add comprehensive tests
- Developed the `canUserAccessChat` function to determine user access to chats based on direct permissions, collection permissions, creator status, and organizational roles.
- Introduced helper functions for checking permissions and retrieving chat information.
- Added integration tests to validate access control logic, covering various scenarios including direct permissions, collection permissions, and user roles.
- Created unit tests to ensure the correctness of the access control function with mocked database interactions.
- Included simple integration tests to verify functionality with existing database data.
* sql parser and int tests working.
* fix test and lint issues
* comment to kick off deployment lo
* access controls on datasets
* electric context bug fix with sql helpers.
* permission and read only
* Add lru-cache dependency and export cache management functions
- Added `lru-cache` as a dependency in the access-controls package.
- Exported new cache management functions from `chats-cached` module, including `canUserAccessChatCached`, `getCacheStats`, `resetCacheStats`, `clearCache`, `invalidateAccess`, `invalidateUserAccess`, and `invalidateChatAccess`.
* packages deploy as well
* wrong workflow lol
* Update AppVerticalCodeSplitter.tsx
* Add error handling for query run and SQL save operations
Co-authored-by: natemkelley <natemkelley@gmail.com>
* Trim whitespace from input values before sending chat prompts
Co-authored-by: natemkelley <natemkelley@gmail.com>
* type in think-and-prep
* use the cached access chat
* update package version
* new asset import message
* Error fallback for login
* Update BusterChart.BarChart.stories.tsx
* Staging changes to fix number card titles, combo chart axis, and using dynamic filters (#386)
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
* db init command pass through
* combo chart fixes (#387)
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
* clarifying question and connection logic
* pino pretty error fix
* clarifying is a finishing tool
* change update latest version logic
* Update support endpoint
* fixes for horizontal bar charts and added the combo chart logic to update metrics (#388)
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
* permission fix on dashboard metric handlers for workspace and data admin
* Add more try catches
* Hide avatar is no more
* Horizontal bar fixes (#389)
* fixes for horizontal bar charts and added the combo chart logic to update metrics
* hopefully fixed horizontal bar charts
---------
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
* reasoning shimmer update
* Make the embed flow work with versions
* new account warning update
* Move support modal
* compact number for pie label
* Add final reasoning message tracking and workflow start time to chunk processor and related steps
- Introduced `finalReasoningMessage` to schemas in `analyst-step`, `mark-message-complete-step`, and `create-todos-step`.
- Updated `ChunkProcessor` to calculate and store the final reasoning message based on workflow duration.
- Enhanced various steps to utilize the new `workflowStartTime` for better tracking of execution duration.
- Improved database update logic to include `finalReasoningMessage` when applicable.
* 9 digit cutoff for pie
* trigger update
* test on mastra braintrust
* test deployment
* testing
* pnpm install
* pnpm
* node 22
* pnpm version
* trigger main
* get initial chat file
* hono main deploymenbt
* clear timeouts
* Remove console logs
* migration test to staging
* db url
* try again
* k get rid of tls var
* hmmm lets try this
* mark migrations
* fix migration file?
* drizzle-kit upgrade
* tweaks to the github actions
---------
Co-authored-by: Nate Kelley <nate@buster.so>
Co-authored-by: porter-deployment-app[bot] <87230664+porter-deployment-app[bot]@users.noreply.github.com>
Co-authored-by: Nate Kelley <133379588+nate-kelley-buster@users.noreply.github.com>
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
Co-authored-by: jacob-buster <jacob@buster.so>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: natemkelley <natemkelley@gmail.com>
2025-07-03 05:33:40 +08:00
|
|
|
// Map data source syntax to node-sql-parser dialect
|
|
|
|
const DIALECT_MAPPING: Record<string, string> = {
|
|
|
|
// Direct mappings
|
|
|
|
mysql: 'mysql',
|
|
|
|
postgresql: 'postgresql',
|
|
|
|
sqlite: 'sqlite',
|
|
|
|
mariadb: 'mariadb',
|
|
|
|
bigquery: 'bigquery',
|
|
|
|
snowflake: 'snowflake',
|
|
|
|
redshift: 'postgresql', // Redshift uses PostgreSQL dialect
|
|
|
|
transactsql: 'transactsql',
|
|
|
|
flinksql: 'flinksql',
|
|
|
|
hive: 'hive',
|
|
|
|
|
|
|
|
// Alternative names
|
|
|
|
postgres: 'postgresql',
|
|
|
|
mssql: 'transactsql',
|
|
|
|
sqlserver: 'transactsql',
|
|
|
|
athena: 'postgresql', // Athena uses Presto/PostgreSQL syntax
|
|
|
|
db2: 'db2',
|
|
|
|
noql: 'mysql', // Default fallback for NoQL
|
|
|
|
};
|
|
|
|
|
|
|
|
function getParserDialect(dataSourceSyntax?: string): string {
|
|
|
|
if (!dataSourceSyntax) {
|
|
|
|
return 'postgresql';
|
|
|
|
}
|
|
|
|
|
|
|
|
const dialect = DIALECT_MAPPING[dataSourceSyntax.toLowerCase()];
|
|
|
|
if (!dialect) {
|
|
|
|
return 'postgresql';
|
|
|
|
}
|
|
|
|
|
|
|
|
return dialect;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Extracts physical tables from SQL query, excluding CTEs
|
|
|
|
* Returns database.schema.table references with proper qualification
|
|
|
|
*/
|
|
|
|
export function extractPhysicalTables(sql: string, dataSourceSyntax?: string): ParsedTable[] {
|
|
|
|
const dialect = getParserDialect(dataSourceSyntax);
|
|
|
|
const parser = new Parser();
|
|
|
|
|
|
|
|
try {
|
|
|
|
// Parse SQL into AST with the appropriate dialect
|
|
|
|
const ast = parser.astify(sql, { database: dialect });
|
|
|
|
|
|
|
|
// Get all table references from parser with the appropriate dialect
|
|
|
|
const allTables = parser.tableList(sql, { database: dialect });
|
|
|
|
|
|
|
|
// Extract CTE names to exclude them
|
|
|
|
const cteNames = new Set<string>();
|
|
|
|
|
|
|
|
// Handle single statement or array of statements
|
|
|
|
const statements = Array.isArray(ast) ? ast : [ast];
|
|
|
|
|
|
|
|
for (const statement of statements) {
|
|
|
|
// Type guard to check if statement has 'with' property
|
|
|
|
if ('with' in statement && statement.with && Array.isArray(statement.with)) {
|
|
|
|
for (const cte of statement.with) {
|
|
|
|
if (cte.name?.value) {
|
|
|
|
cteNames.add(cte.name.value.toLowerCase());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Parse table references and filter out CTEs
|
|
|
|
const physicalTables: ParsedTable[] = [];
|
|
|
|
const processedTables = new Set<string>();
|
|
|
|
|
|
|
|
for (const tableRef of allTables) {
|
|
|
|
const parsed = parseTableReference(tableRef);
|
|
|
|
|
|
|
|
// Skip if it's a CTE
|
|
|
|
if (cteNames.has(parsed.table.toLowerCase())) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Skip duplicates
|
|
|
|
const tableKey = `${parsed.database || ''}.${parsed.schema || ''}.${parsed.table}`;
|
|
|
|
if (processedTables.has(tableKey)) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
processedTables.add(tableKey);
|
|
|
|
physicalTables.push(parsed);
|
|
|
|
}
|
|
|
|
|
|
|
|
return physicalTables;
|
|
|
|
} catch (error) {
|
|
|
|
throw new Error(
|
|
|
|
`Failed to parse SQL: ${error instanceof Error ? error.message : 'Unknown error'}`
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Parses a table reference string into its components
|
|
|
|
* Handles formats like:
|
|
|
|
* - table
|
|
|
|
* - schema.table
|
|
|
|
* - database.schema.table
|
|
|
|
* - type::database::table (node-sql-parser format)
|
|
|
|
* - type::schema.table (node-sql-parser format)
|
|
|
|
*/
|
|
|
|
export function parseTableReference(tableRef: string): ParsedTable {
|
|
|
|
// Remove any quotes and trim
|
|
|
|
let cleanRef = tableRef.replace(/["'`\[\]]/g, '').trim();
|
|
|
|
|
|
|
|
// Handle node-sql-parser format: "type::database::table" or "type::table"
|
|
|
|
if (cleanRef.includes('::')) {
|
|
|
|
const parts = cleanRef.split('::');
|
|
|
|
// Remove the type prefix (select, insert, update, etc.)
|
|
|
|
const firstPart = parts[0];
|
|
|
|
if (
|
|
|
|
parts.length >= 2 &&
|
|
|
|
firstPart &&
|
|
|
|
['select', 'insert', 'update', 'delete', 'create', 'drop', 'alter'].includes(firstPart)
|
|
|
|
) {
|
|
|
|
parts.shift(); // Remove type
|
|
|
|
}
|
|
|
|
cleanRef = parts.join('.');
|
|
|
|
}
|
|
|
|
|
|
|
|
// Split by . for schema/table
|
|
|
|
const parts = cleanRef.split('.').filter((p) => p && p !== 'null');
|
|
|
|
|
|
|
|
if (parts.length === 3) {
|
|
|
|
const [database, schema, table] = parts;
|
|
|
|
if (!database || !schema || !table) {
|
|
|
|
return {
|
|
|
|
table: cleanRef,
|
|
|
|
fullName: cleanRef,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
return {
|
|
|
|
database,
|
|
|
|
schema,
|
|
|
|
table,
|
|
|
|
fullName: `${database}.${schema}.${table}`,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
if (parts.length === 2) {
|
|
|
|
const [schema, table] = parts;
|
|
|
|
if (!schema || !table) {
|
|
|
|
return {
|
|
|
|
table: cleanRef,
|
|
|
|
fullName: cleanRef,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
return {
|
|
|
|
schema,
|
|
|
|
table,
|
|
|
|
fullName: `${schema}.${table}`,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
if (parts.length === 1) {
|
|
|
|
const [table] = parts;
|
|
|
|
if (!table) {
|
|
|
|
return {
|
|
|
|
table: cleanRef,
|
|
|
|
fullName: cleanRef,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
return {
|
|
|
|
table,
|
|
|
|
fullName: table,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
table: cleanRef,
|
|
|
|
fullName: cleanRef,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Normalizes a table identifier for comparison
|
|
|
|
* Converts to lowercase and handles different qualification levels
|
|
|
|
*/
|
|
|
|
export function normalizeTableIdentifier(identifier: ParsedTable): string {
|
|
|
|
const parts = [];
|
|
|
|
|
|
|
|
if (identifier.database) {
|
|
|
|
parts.push(identifier.database.toLowerCase());
|
|
|
|
}
|
|
|
|
if (identifier.schema) {
|
|
|
|
parts.push(identifier.schema.toLowerCase());
|
|
|
|
}
|
|
|
|
parts.push(identifier.table.toLowerCase());
|
|
|
|
|
|
|
|
return parts.join('.');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Checks if two table identifiers match, considering different qualification levels
|
|
|
|
* For example, "schema.table" matches "database.schema.table" if schema and table match
|
|
|
|
*/
|
|
|
|
export function tablesMatch(queryTable: ParsedTable, permissionTable: ParsedTable): boolean {
|
|
|
|
// Exact table name must match
|
|
|
|
if (queryTable.table.toLowerCase() !== permissionTable.table.toLowerCase()) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// If permission specifies schema, query must match
|
|
|
|
if (permissionTable.schema && queryTable.schema) {
|
|
|
|
if (permissionTable.schema.toLowerCase() !== queryTable.schema.toLowerCase()) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// If permission specifies database, query must match
|
|
|
|
if (permissionTable.database && queryTable.database) {
|
|
|
|
if (permissionTable.database.toLowerCase() !== queryTable.database.toLowerCase()) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// If permission has schema but query doesn't, it's not a match
|
|
|
|
// (we require explicit schema matching for security)
|
|
|
|
if (permissionTable.schema && !queryTable.schema) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Extracts table references from dataset YML content
|
|
|
|
* Handles multiple formats:
|
|
|
|
* 1. Flat format (top-level fields):
|
|
|
|
* name: table_name
|
|
|
|
* schema: schema_name
|
|
|
|
* database: database_name
|
|
|
|
* 2. Models array with separate fields:
|
|
|
|
* models:
|
|
|
|
* - name: table_name
|
|
|
|
* schema: schema_name
|
|
|
|
* database: database_name
|
|
|
|
*/
|
|
|
|
export function extractTablesFromYml(ymlContent: string): ParsedTable[] {
|
|
|
|
const tables: ParsedTable[] = [];
|
|
|
|
const processedTables = new Set<string>();
|
|
|
|
|
|
|
|
try {
|
|
|
|
// Parse YML content
|
|
|
|
const parsed = yaml.parse(ymlContent);
|
|
|
|
|
|
|
|
// Check for flat format (top-level name, schema, database)
|
|
|
|
if (parsed?.name && !parsed?.models && (parsed?.schema || parsed?.database)) {
|
|
|
|
const parsedTable: ParsedTable = {
|
|
|
|
table: parsed.name,
|
|
|
|
fullName: parsed.name,
|
|
|
|
};
|
|
|
|
|
|
|
|
// Add schema if present
|
|
|
|
if (parsed.schema) {
|
|
|
|
parsedTable.schema = parsed.schema;
|
|
|
|
parsedTable.fullName = `${parsed.schema}.${parsed.name}`;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Add database if present
|
|
|
|
if (parsed.database) {
|
|
|
|
parsedTable.database = parsed.database;
|
|
|
|
if (parsed.schema) {
|
|
|
|
parsedTable.fullName = `${parsed.database}.${parsed.schema}.${parsed.name}`;
|
|
|
|
} else {
|
|
|
|
parsedTable.fullName = `${parsed.database}.${parsed.name}`;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const key = normalizeTableIdentifier(parsedTable);
|
|
|
|
if (!processedTables.has(key)) {
|
|
|
|
processedTables.add(key);
|
|
|
|
tables.push(parsedTable);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Look for models array
|
|
|
|
if (parsed?.models && Array.isArray(parsed.models)) {
|
|
|
|
for (const model of parsed.models) {
|
|
|
|
// Process models that have name and at least schema or database
|
|
|
|
if (model.name && (model.schema || model.database)) {
|
|
|
|
const parsedTable: ParsedTable = {
|
|
|
|
table: model.name,
|
|
|
|
fullName: model.name,
|
|
|
|
};
|
|
|
|
|
|
|
|
// Add schema if present
|
|
|
|
if (model.schema) {
|
|
|
|
parsedTable.schema = model.schema;
|
|
|
|
parsedTable.fullName = `${model.schema}.${model.name}`;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Add database if present
|
|
|
|
if (model.database) {
|
|
|
|
parsedTable.database = model.database;
|
|
|
|
if (model.schema) {
|
|
|
|
parsedTable.fullName = `${model.database}.${model.schema}.${model.name}`;
|
|
|
|
} else {
|
|
|
|
parsedTable.fullName = `${model.database}.${model.name}`;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const key = normalizeTableIdentifier(parsedTable);
|
|
|
|
if (!processedTables.has(key)) {
|
|
|
|
processedTables.add(key);
|
|
|
|
tables.push(parsedTable);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (_error) {
|
|
|
|
// If YML parsing fails, return empty array
|
|
|
|
}
|
|
|
|
|
|
|
|
return tables;
|
|
|
|
}
|
|
|
|
|
2025-07-23 21:34:56 +08:00
|
|
|
/**
|
|
|
|
* Validates that wildcards (SELECT *) are not used on physical tables
|
|
|
|
* Allows wildcards on CTEs but blocks them on physical database tables
|
|
|
|
*/
|
2025-07-23 21:58:11 +08:00
|
|
|
export function validateWildcardUsage(
|
|
|
|
sql: string,
|
|
|
|
dataSourceSyntax?: string
|
|
|
|
): WildcardValidationResult {
|
2025-07-23 21:34:56 +08:00
|
|
|
const dialect = getParserDialect(dataSourceSyntax);
|
|
|
|
const parser = new Parser();
|
|
|
|
|
|
|
|
try {
|
|
|
|
// Parse SQL into AST with the appropriate dialect
|
|
|
|
const ast = parser.astify(sql, { database: dialect });
|
|
|
|
|
|
|
|
// Handle single statement or array of statements
|
|
|
|
const statements = Array.isArray(ast) ? ast : [ast];
|
|
|
|
|
|
|
|
// Extract CTE names to allow wildcards on them
|
|
|
|
const cteNames = new Set<string>();
|
|
|
|
for (const statement of statements) {
|
|
|
|
if ('with' in statement && statement.with && Array.isArray(statement.with)) {
|
|
|
|
for (const cte of statement.with) {
|
|
|
|
if (cte.name?.value) {
|
|
|
|
cteNames.add(cte.name.value.toLowerCase());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2025-07-23 21:43:26 +08:00
|
|
|
const tableList = parser.tableList(sql, { database: dialect });
|
|
|
|
const tableAliasMap = new Map<string, string>(); // alias -> table name
|
2025-07-23 21:58:11 +08:00
|
|
|
|
2025-07-23 21:43:26 +08:00
|
|
|
if (Array.isArray(tableList)) {
|
|
|
|
for (const tableRef of tableList) {
|
|
|
|
if (typeof tableRef === 'string') {
|
|
|
|
// Simple table name
|
|
|
|
tableAliasMap.set(tableRef.toLowerCase(), tableRef);
|
|
|
|
} else if (tableRef && typeof tableRef === 'object') {
|
2025-07-23 21:58:11 +08:00
|
|
|
const tableRefObj = tableRef as Record<string, unknown>;
|
2025-07-23 21:43:26 +08:00
|
|
|
const tableName = tableRefObj.table || tableRefObj.name;
|
|
|
|
const alias = tableRefObj.as || tableRefObj.alias;
|
2025-07-23 21:58:11 +08:00
|
|
|
if (tableName && typeof tableName === 'string') {
|
|
|
|
if (alias && typeof alias === 'string') {
|
2025-07-23 21:43:26 +08:00
|
|
|
tableAliasMap.set(alias.toLowerCase(), tableName);
|
|
|
|
}
|
|
|
|
tableAliasMap.set(tableName.toLowerCase(), tableName);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2025-07-23 21:34:56 +08:00
|
|
|
// Check each statement for wildcard usage
|
|
|
|
const blockedTables: string[] = [];
|
2025-07-23 21:58:11 +08:00
|
|
|
|
2025-07-23 21:34:56 +08:00
|
|
|
for (const statement of statements) {
|
|
|
|
if ('type' in statement && statement.type === 'select') {
|
2025-07-23 21:58:11 +08:00
|
|
|
const wildcardTables = findWildcardUsageOnPhysicalTables(
|
|
|
|
statement as unknown as Record<string, unknown>,
|
|
|
|
cteNames
|
|
|
|
);
|
2025-07-23 21:34:56 +08:00
|
|
|
blockedTables.push(...wildcardTables);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (blockedTables.length > 0) {
|
|
|
|
return {
|
|
|
|
isValid: false,
|
2025-07-24 11:09:56 +08:00
|
|
|
error: `You're not allowed to use a wildcard on physical tables, please be specific about which columns you'd like to work with`,
|
2025-07-23 21:34:56 +08:00
|
|
|
blockedTables,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
return { isValid: true };
|
|
|
|
} catch (error) {
|
|
|
|
return {
|
|
|
|
isValid: false,
|
|
|
|
error: `Failed to validate wildcard usage: ${error instanceof Error ? error.message : 'Unknown error'}`,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Recursively finds wildcard usage on physical tables in a SELECT statement
|
|
|
|
*/
|
2025-07-23 21:58:11 +08:00
|
|
|
function findWildcardUsageOnPhysicalTables(
|
|
|
|
selectStatement: Record<string, unknown>,
|
|
|
|
cteNames: Set<string>
|
|
|
|
): string[] {
|
2025-07-23 21:34:56 +08:00
|
|
|
const blockedTables: string[] = [];
|
|
|
|
|
2025-07-23 21:43:26 +08:00
|
|
|
// Build alias mapping for this statement
|
|
|
|
const aliasToTableMap = new Map<string, string>();
|
|
|
|
if (selectStatement.from && Array.isArray(selectStatement.from)) {
|
|
|
|
for (const fromItem of selectStatement.from) {
|
2025-07-23 21:58:11 +08:00
|
|
|
const fromItemAny = fromItem as unknown as Record<string, unknown>;
|
|
|
|
if (fromItemAny.table && fromItemAny.as) {
|
2025-07-23 21:43:26 +08:00
|
|
|
let tableName: string;
|
2025-07-23 21:58:11 +08:00
|
|
|
if (typeof fromItemAny.table === 'string') {
|
|
|
|
tableName = fromItemAny.table;
|
|
|
|
} else if (fromItemAny.table && typeof fromItemAny.table === 'object') {
|
|
|
|
const tableObj = fromItemAny.table as Record<string, unknown>;
|
|
|
|
tableName = String(
|
|
|
|
tableObj.table || tableObj.name || tableObj.value || fromItemAny.table
|
|
|
|
);
|
2025-07-23 21:43:26 +08:00
|
|
|
} else {
|
|
|
|
continue;
|
|
|
|
}
|
2025-07-23 21:58:11 +08:00
|
|
|
aliasToTableMap.set(String(fromItemAny.as).toLowerCase(), tableName.toLowerCase());
|
2025-07-23 21:43:26 +08:00
|
|
|
}
|
2025-07-23 21:58:11 +08:00
|
|
|
|
2025-07-23 21:43:26 +08:00
|
|
|
// Handle JOINs
|
2025-07-23 21:58:11 +08:00
|
|
|
if (fromItemAny.join && Array.isArray(fromItemAny.join)) {
|
|
|
|
for (const joinItem of fromItemAny.join) {
|
2025-07-23 21:43:26 +08:00
|
|
|
if (joinItem.table && joinItem.as) {
|
|
|
|
let tableName: string;
|
|
|
|
if (typeof joinItem.table === 'string') {
|
|
|
|
tableName = joinItem.table;
|
|
|
|
} else if (joinItem.table && typeof joinItem.table === 'object') {
|
2025-07-23 21:58:11 +08:00
|
|
|
const tableObj = joinItem.table as Record<string, unknown>;
|
|
|
|
tableName = String(
|
|
|
|
tableObj.table || tableObj.name || tableObj.value || joinItem.table
|
|
|
|
);
|
2025-07-23 21:43:26 +08:00
|
|
|
} else {
|
|
|
|
continue;
|
|
|
|
}
|
2025-07-23 21:58:11 +08:00
|
|
|
aliasToTableMap.set(String(joinItem.as).toLowerCase(), tableName.toLowerCase());
|
2025-07-23 21:43:26 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2025-07-23 21:34:56 +08:00
|
|
|
if (selectStatement.columns && Array.isArray(selectStatement.columns)) {
|
|
|
|
for (const column of selectStatement.columns) {
|
|
|
|
if (column.expr && column.expr.type === 'column_ref') {
|
|
|
|
// Check for unqualified wildcard (SELECT *)
|
|
|
|
if (column.expr.column === '*' && !column.expr.table) {
|
|
|
|
// Get all tables in FROM clause that are not CTEs
|
2025-07-23 21:58:11 +08:00
|
|
|
const physicalTables = getPhysicalTablesFromFrom(
|
|
|
|
selectStatement.from as unknown as Record<string, unknown>[],
|
|
|
|
cteNames
|
|
|
|
);
|
2025-07-23 21:34:56 +08:00
|
|
|
blockedTables.push(...physicalTables);
|
|
|
|
}
|
|
|
|
// Check for qualified wildcard (SELECT table.*)
|
|
|
|
else if (column.expr.column === '*' && column.expr.table) {
|
2025-07-23 21:43:26 +08:00
|
|
|
// Handle table reference - could be string or object
|
|
|
|
let tableName: string;
|
|
|
|
if (typeof column.expr.table === 'string') {
|
|
|
|
tableName = column.expr.table;
|
|
|
|
} else if (column.expr.table && typeof column.expr.table === 'object') {
|
|
|
|
// Handle object format - could have table property or be the table name itself
|
2025-07-23 21:58:11 +08:00
|
|
|
const tableRefObj = column.expr.table as Record<string, unknown>;
|
|
|
|
tableName = String(
|
|
|
|
tableRefObj.table || tableRefObj.name || tableRefObj.value || column.expr.table
|
|
|
|
);
|
2025-07-23 21:43:26 +08:00
|
|
|
} else {
|
|
|
|
continue; // Skip if we can't determine table name
|
|
|
|
}
|
2025-07-23 21:58:11 +08:00
|
|
|
|
2025-07-23 21:43:26 +08:00
|
|
|
// Check if this is an alias that maps to a CTE
|
|
|
|
const actualTableName = aliasToTableMap.get(tableName.toLowerCase());
|
|
|
|
const isAliasToCte = actualTableName && cteNames.has(actualTableName);
|
|
|
|
const isDirectCte = cteNames.has(tableName.toLowerCase());
|
2025-07-23 21:58:11 +08:00
|
|
|
|
2025-07-23 21:43:26 +08:00
|
|
|
if (!isAliasToCte && !isDirectCte) {
|
2025-07-23 21:34:56 +08:00
|
|
|
blockedTables.push(tableName);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2025-07-23 21:43:26 +08:00
|
|
|
// Check CTEs for nested wildcard usage
|
2025-07-23 21:34:56 +08:00
|
|
|
if (selectStatement.with && Array.isArray(selectStatement.with)) {
|
|
|
|
for (const cte of selectStatement.with) {
|
2025-07-23 21:58:11 +08:00
|
|
|
const cteAny = cte as unknown as Record<string, unknown>;
|
|
|
|
if (cteAny.stmt && typeof cteAny.stmt === 'object' && cteAny.stmt !== null) {
|
|
|
|
const stmt = cteAny.stmt as Record<string, unknown>;
|
|
|
|
if (stmt.type === 'select') {
|
|
|
|
const subBlocked = findWildcardUsageOnPhysicalTables(stmt, cteNames);
|
|
|
|
blockedTables.push(...subBlocked);
|
|
|
|
}
|
2025-07-23 21:34:56 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (selectStatement.from && Array.isArray(selectStatement.from)) {
|
|
|
|
for (const fromItem of selectStatement.from) {
|
2025-07-23 21:58:11 +08:00
|
|
|
const fromItemAny = fromItem as unknown as Record<string, unknown>;
|
|
|
|
if (fromItemAny.expr && typeof fromItemAny.expr === 'object' && fromItemAny.expr !== null) {
|
|
|
|
const expr = fromItemAny.expr as Record<string, unknown>;
|
|
|
|
if (expr.type === 'select') {
|
|
|
|
const subBlocked = findWildcardUsageOnPhysicalTables(expr, cteNames);
|
|
|
|
blockedTables.push(...subBlocked);
|
|
|
|
}
|
2025-07-23 21:34:56 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return blockedTables;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Extracts physical table names from FROM clause, excluding CTEs
|
|
|
|
*/
|
2025-07-23 21:58:11 +08:00
|
|
|
function getPhysicalTablesFromFrom(
|
|
|
|
fromClause: Record<string, unknown>[],
|
|
|
|
cteNames: Set<string>
|
|
|
|
): string[] {
|
2025-07-23 21:34:56 +08:00
|
|
|
const tables: string[] = [];
|
|
|
|
|
|
|
|
if (!fromClause || !Array.isArray(fromClause)) {
|
|
|
|
return tables;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (const fromItem of fromClause) {
|
2025-07-23 21:43:26 +08:00
|
|
|
// Extract table name from fromItem
|
2025-07-23 21:34:56 +08:00
|
|
|
if (fromItem.table) {
|
2025-07-23 21:43:26 +08:00
|
|
|
let tableName: string;
|
|
|
|
if (typeof fromItem.table === 'string') {
|
|
|
|
tableName = fromItem.table;
|
|
|
|
} else if (fromItem.table && typeof fromItem.table === 'object') {
|
2025-07-23 21:58:11 +08:00
|
|
|
const tableObj = fromItem.table as Record<string, unknown>;
|
|
|
|
tableName = String(tableObj.table || tableObj.name || tableObj.value || fromItem.table);
|
2025-07-23 21:43:26 +08:00
|
|
|
} else {
|
|
|
|
continue;
|
|
|
|
}
|
2025-07-23 21:58:11 +08:00
|
|
|
|
2025-07-23 21:34:56 +08:00
|
|
|
if (tableName && !cteNames.has(tableName.toLowerCase())) {
|
2025-07-23 21:43:26 +08:00
|
|
|
const aliasName = fromItem.as || tableName;
|
2025-07-23 21:58:11 +08:00
|
|
|
tables.push(String(aliasName));
|
2025-07-23 21:34:56 +08:00
|
|
|
}
|
|
|
|
}
|
2025-07-23 21:58:11 +08:00
|
|
|
|
2025-07-23 21:34:56 +08:00
|
|
|
// Handle JOINs
|
|
|
|
if (fromItem.join && Array.isArray(fromItem.join)) {
|
|
|
|
for (const joinItem of fromItem.join) {
|
|
|
|
if (joinItem.table) {
|
2025-07-23 21:43:26 +08:00
|
|
|
let tableName: string;
|
|
|
|
if (typeof joinItem.table === 'string') {
|
|
|
|
tableName = joinItem.table;
|
|
|
|
} else if (joinItem.table && typeof joinItem.table === 'object') {
|
2025-07-23 21:58:11 +08:00
|
|
|
const tableObj = joinItem.table as Record<string, unknown>;
|
|
|
|
tableName = String(tableObj.table || tableObj.name || tableObj.value || joinItem.table);
|
2025-07-23 21:43:26 +08:00
|
|
|
} else {
|
|
|
|
continue;
|
|
|
|
}
|
2025-07-23 21:58:11 +08:00
|
|
|
|
2025-07-23 21:34:56 +08:00
|
|
|
if (tableName && !cteNames.has(tableName.toLowerCase())) {
|
2025-07-23 21:43:26 +08:00
|
|
|
const aliasName = joinItem.as || tableName;
|
2025-07-23 21:58:11 +08:00
|
|
|
tables.push(String(aliasName));
|
2025-07-23 21:34:56 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return tables;
|
|
|
|
}
|
|
|
|
|
Mastra braintrust (#391)
* type fixes
* biome clean on ai
* add user to flag chat
* attempt to get vercel deployed
* Update tsup.config.ts
* Update pnpm-lock.yaml
* Add @buster/server2 Hono API app with Vercel deployment configuration
* slack oauth integration
* mainly some clean up and biome formatting
* slack oauth
* slack migration + snapshot
* remove unused files
* finalized docker image for porter
* Create porter_app_buster-server_3155.yml file
* Add integration tests for Slack handler and refactor Slack OAuth service
- Introduced integration tests for the Slack handler, covering OAuth initiation, callback handling, and integration status retrieval.
- Refactored Slack OAuth service to improve error handling and ensure proper integration state management.
- Updated token storage implementation to use a database vault instead of Supabase.
- Enhanced existing tests for better coverage and reliability, including cleanup of test data.
- Added new utility functions for managing vault secrets in the database.
* docker image update
* new prompts
* individual tests and a schema fix
* server build
* final working dockerfile
* Update Dockerfile
* new messages to slack messages (#369)
* Update dockerfile
* Update validate-env.js
* update build pipeline
* Update the dockerfile flow
* finalize logging for pino
* stable base
* Update cors middleware logger
* Update cors.ts
* update docker to be more imformative
* Update index.ts
* Update auth.ts
* Update cors.ts
* Update cors.ts
* Update logger.ts
* remove logs
* more cors updates
* build server shared
* Refactor PostgreSQL credentials handling and remove unused memory storage. Update package dependencies. (#370)
* tons of file parsing errors (#371)
* Refactor PostgreSQL credentials handling and remove unused memory storage. Update package dependencies.
* tons of file parsing errors
* Dev mode updates
* more stable electric handler
* Dal/agent-self-healing-fixes (#372)
* change to 6 min
* optmizations around saving and non-blocking actions.
* stream optimizations
* Dal/agent-self-healing-fixes (#373)
* change to 6 min
* optmizations around saving and non-blocking actions.
* stream optimizations
* change porter staging deploy to mastra-braintrust.
* new path for porter deploy
* deploy to staging fix
* Create porter_app_mastra-braintrust-api_3155.yml file (#375)
Co-authored-by: porter-deployment-app[bot] <87230664+porter-deployment-app[bot]@users.noreply.github.com>
* Update sizing and opacity
* supe up the instance for mastra
* environment staging
* ssl script
* copy path
* Update list padding
* no throttle and the anthropic cached
* move select to the top
* Update margin inline start
* shrink reasoning vertical space to 2px
* semi bold font for headers
* update animation timing
* haiku
* Add createTodoList tool and integrate into create-todos-step
* chat helper on post chat
* only trigger cicd when change made
* Start created streaming text components
* Refactor analyst agent task to initialize Braintrust logging asynchronously and parallelize database queries for improved performance. Adjusted cleanup timeout for Braintrust traces to reduce delays.
* fixed reasoned for X, so that it rounds down to the minute
* Update users page
* update build pipeline for new web
* document title update
* Named chats for page
* Datasets titles
* Refactor visualization tools and enhance error handling in retryable agent stream. Removed unused metricValueLabel from metrics file tool, updated metric configuration schemas, and improved healing mechanism for tool errors during streaming.
* analyst
* document title updates
* Update useDocumentTitle.tsx
* Refactor tool choice configuration in create-todos-step to use structured object. Remove exponential backoff logic from retryable agent stream for healable errors. Introduce new test for real-world healing scenarios in retryable agent stream.
* Refactor SQL validation logic in modify-metrics-file-tool to skip unnecessary checks when SQL has not changed. Enhance error handling and update validation messages. Clean up code formatting for improved readability.
* update collapse for filecard
* chevron collapse
* Jacob prompt changes (#376)
* prompt changes to improve filtering logic and handle priv/sec errors
* prompt changes to make aggregation better and improved filter best practices
* Update packages/ai/src/steps/create-todos-step.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* Update packages/ai/src/agents/think-and-prep-agent/think-and-prep-instructions.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* Update packages/ai/src/steps/create-todos-step.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
---------
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
Co-authored-by: dal <dallin@buster.so>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* think and prep
* change header and strong fonts weights
* Update get collection
* combo chart x axis update
* Create a chart schemas as types
* schema types
* simple unit tests for line chart props
* fix the response file ordering iwth active selection.
* copy around reasoning messages taken care of
* fix nullable user message and file processing and such.
* update ticks for chart config
* fix todo parsing.
* app markdown update
* Update splitter to use border instead of width
* change ml
* If no file is found we should auto redirect
* Refactor database connection handling to support SSL modes. Introduced functions to extract SSL parameters and manage connections based on SSL requirements, including a custom verifier for unverified connections.
* black box message update
* chat title updates
* optimizations for trigger.
* some keepalive logic on the anthropic cached
* keep title empty until new one
* no duplicate messages
* null user message on asset pull
* posthog error handling
* 20 sec idle timeout on anthropic
* null req message
* fixed modificiation names missing
* Refactor tool call handling to support new content array format in asset messages and context loaders
* cache most recent file from workflow
* Enhance date and number detection in createDataMetadata function to improve data type handling for metrics files
* group hover effect for message
* logging for chat
* Add messageId handling and file association tracking in dashboard and metrics tools
- Updated runtime context to include messageId in create and modify dashboard and metrics file tools.
- Implemented file association tracking based on messageId in create and modify functions for both dashboards and metrics.
- Ensured type consistency by using AnalystRuntimeContext in runtime context parameters.
* logging for chat
* message type update
* Route to first file instead
* trigger moved to catalog
* Enhance file selection logic to support YAML parsing and improve logging
- Updated `extractMetricIdsFromDashboard` to first attempt JSON parsing, falling back to a regex-based YAML parsing for metric IDs.
- Added detailed debug logging in `selectFilesForResponse` to track file selection process, including metrics and dashboards involved.
- Introduced tests for various scenarios in `file-selection.test.ts` to ensure correct behavior with dashboard context and edge cases.
* trigger dev v4-beta
* Retry + Self Healing (#381)
* Refactor retry logic in analyst and think-and-prep steps
Co-authored-by: dallin <dallin@buster.so>
* some fixes
* console log error
* self healing
* todos retry
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* remove lots of logs
* Remove chat streaming
* Remove chat streaming
* timeout
* Change to updated at field
* link to home
* Update timeout settings for HTTP and HTTPS agents from 20 seconds to 10 seconds for improved responsiveness.
* Add utils module and integrate message conversion in post_chat_handler
* Implement error handling for extract values (#382)
* Remove chat streaming
* Improve error handling and logging in extract values and chat title steps
Co-authored-by: dallin <dallin@buster.so>
---------
Co-authored-by: Nate Kelley <nate@buster.so>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* loading icon for buster avatar
* finalize tooltip cache
* upgrade mastra
* increase retries
* Add redo functionality for chat messages
- Introduced `redoFromMessageId` parameter in `handleExistingChat` to allow users to specify a message to redo from.
- Implemented validation to ensure the specified message belongs to the current chat.
- Added `softDeleteMessagesFromPoint` function to soft delete a message and all subsequent messages in the same chat, facilitating the redo feature.
* fix electric potential memory leak
* tooltip cache and chart cleanup
* Update bullet to be more indented
* latest version number
* add support endpoint to new server
* Fix jank in combo bar charts
* index check for dashboard
* Collapse only if there are metrics
* Is finished reasoing back
* Update dependencies and enhance chat message handling
- Upgraded `@mastra/core` to version 0.10.8 and added `node-sql-parser` at version 5.3.10 in the lock file.
- Improved integration tests for chat message redo functionality, ensuring correct behavior when deriving `chat_id` from `message_id`.
- Enhanced error handling and validation in the `initializeChat` function to manage cases where `chat_id` is not provided.
* Update pnpm-lock and enhance chat message integration tests
- Added `node-sql-parser` version 5.3.10 to dependencies and updated the lock file.
- Improved integration tests for chat message redo functionality, ensuring accurate deletion and retrieval of messages.
- Enhanced the `initializeChat` function to derive `chat_id` from `message_id` when not provided, improving error handling and validation.
* remove .env import breaking build
* add updated at to the get chat handler
* zmall runtime error fix
* permission tests passing
* return updated at on the get chat handler now
* slq parser fixes
* Implement chat access control logic and add comprehensive tests
- Developed the `canUserAccessChat` function to determine user access to chats based on direct permissions, collection permissions, creator status, and organizational roles.
- Introduced helper functions for checking permissions and retrieving chat information.
- Added integration tests to validate access control logic, covering various scenarios including direct permissions, collection permissions, and user roles.
- Created unit tests to ensure the correctness of the access control function with mocked database interactions.
- Included simple integration tests to verify functionality with existing database data.
* sql parser and int tests working.
* fix test and lint issues
* comment to kick off deployment lo
* access controls on datasets
* electric context bug fix with sql helpers.
* permission and read only
* Add lru-cache dependency and export cache management functions
- Added `lru-cache` as a dependency in the access-controls package.
- Exported new cache management functions from `chats-cached` module, including `canUserAccessChatCached`, `getCacheStats`, `resetCacheStats`, `clearCache`, `invalidateAccess`, `invalidateUserAccess`, and `invalidateChatAccess`.
* packages deploy as well
* wrong workflow lol
* Update AppVerticalCodeSplitter.tsx
* Add error handling for query run and SQL save operations
Co-authored-by: natemkelley <natemkelley@gmail.com>
* Trim whitespace from input values before sending chat prompts
Co-authored-by: natemkelley <natemkelley@gmail.com>
* type in think-and-prep
* use the cached access chat
* update package version
* new asset import message
* Error fallback for login
* Update BusterChart.BarChart.stories.tsx
* Staging changes to fix number card titles, combo chart axis, and using dynamic filters (#386)
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
* db init command pass through
* combo chart fixes (#387)
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
* clarifying question and connection logic
* pino pretty error fix
* clarifying is a finishing tool
* change update latest version logic
* Update support endpoint
* fixes for horizontal bar charts and added the combo chart logic to update metrics (#388)
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
* permission fix on dashboard metric handlers for workspace and data admin
* Add more try catches
* Hide avatar is no more
* Horizontal bar fixes (#389)
* fixes for horizontal bar charts and added the combo chart logic to update metrics
* hopefully fixed horizontal bar charts
---------
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
* reasoning shimmer update
* Make the embed flow work with versions
* new account warning update
* Move support modal
* compact number for pie label
* Add final reasoning message tracking and workflow start time to chunk processor and related steps
- Introduced `finalReasoningMessage` to schemas in `analyst-step`, `mark-message-complete-step`, and `create-todos-step`.
- Updated `ChunkProcessor` to calculate and store the final reasoning message based on workflow duration.
- Enhanced various steps to utilize the new `workflowStartTime` for better tracking of execution duration.
- Improved database update logic to include `finalReasoningMessage` when applicable.
* 9 digit cutoff for pie
* trigger update
* test on mastra braintrust
* test deployment
* testing
* pnpm install
* pnpm
* node 22
* pnpm version
* trigger main
* get initial chat file
* hono main deploymenbt
* clear timeouts
* Remove console logs
* migration test to staging
* db url
* try again
* k get rid of tls var
* hmmm lets try this
* mark migrations
* fix migration file?
* drizzle-kit upgrade
* tweaks to the github actions
---------
Co-authored-by: Nate Kelley <nate@buster.so>
Co-authored-by: porter-deployment-app[bot] <87230664+porter-deployment-app[bot]@users.noreply.github.com>
Co-authored-by: Nate Kelley <133379588+nate-kelley-buster@users.noreply.github.com>
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
Co-authored-by: jacob-buster <jacob@buster.so>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: natemkelley <natemkelley@gmail.com>
2025-07-03 05:33:40 +08:00
|
|
|
/**
|
|
|
|
* Checks if a SQL query is read-only (SELECT statements only)
|
|
|
|
* Returns error if query contains write operations
|
|
|
|
*/
|
|
|
|
export function checkQueryIsReadOnly(sql: string, dataSourceSyntax?: string): QueryTypeCheckResult {
|
|
|
|
const dialect = getParserDialect(dataSourceSyntax);
|
|
|
|
const parser = new Parser();
|
|
|
|
|
|
|
|
try {
|
|
|
|
// Parse SQL into AST with the appropriate dialect
|
|
|
|
const ast = parser.astify(sql, { database: dialect });
|
2025-07-07 23:57:04 +08:00
|
|
|
|
Mastra braintrust (#391)
* type fixes
* biome clean on ai
* add user to flag chat
* attempt to get vercel deployed
* Update tsup.config.ts
* Update pnpm-lock.yaml
* Add @buster/server2 Hono API app with Vercel deployment configuration
* slack oauth integration
* mainly some clean up and biome formatting
* slack oauth
* slack migration + snapshot
* remove unused files
* finalized docker image for porter
* Create porter_app_buster-server_3155.yml file
* Add integration tests for Slack handler and refactor Slack OAuth service
- Introduced integration tests for the Slack handler, covering OAuth initiation, callback handling, and integration status retrieval.
- Refactored Slack OAuth service to improve error handling and ensure proper integration state management.
- Updated token storage implementation to use a database vault instead of Supabase.
- Enhanced existing tests for better coverage and reliability, including cleanup of test data.
- Added new utility functions for managing vault secrets in the database.
* docker image update
* new prompts
* individual tests and a schema fix
* server build
* final working dockerfile
* Update Dockerfile
* new messages to slack messages (#369)
* Update dockerfile
* Update validate-env.js
* update build pipeline
* Update the dockerfile flow
* finalize logging for pino
* stable base
* Update cors middleware logger
* Update cors.ts
* update docker to be more imformative
* Update index.ts
* Update auth.ts
* Update cors.ts
* Update cors.ts
* Update logger.ts
* remove logs
* more cors updates
* build server shared
* Refactor PostgreSQL credentials handling and remove unused memory storage. Update package dependencies. (#370)
* tons of file parsing errors (#371)
* Refactor PostgreSQL credentials handling and remove unused memory storage. Update package dependencies.
* tons of file parsing errors
* Dev mode updates
* more stable electric handler
* Dal/agent-self-healing-fixes (#372)
* change to 6 min
* optmizations around saving and non-blocking actions.
* stream optimizations
* Dal/agent-self-healing-fixes (#373)
* change to 6 min
* optmizations around saving and non-blocking actions.
* stream optimizations
* change porter staging deploy to mastra-braintrust.
* new path for porter deploy
* deploy to staging fix
* Create porter_app_mastra-braintrust-api_3155.yml file (#375)
Co-authored-by: porter-deployment-app[bot] <87230664+porter-deployment-app[bot]@users.noreply.github.com>
* Update sizing and opacity
* supe up the instance for mastra
* environment staging
* ssl script
* copy path
* Update list padding
* no throttle and the anthropic cached
* move select to the top
* Update margin inline start
* shrink reasoning vertical space to 2px
* semi bold font for headers
* update animation timing
* haiku
* Add createTodoList tool and integrate into create-todos-step
* chat helper on post chat
* only trigger cicd when change made
* Start created streaming text components
* Refactor analyst agent task to initialize Braintrust logging asynchronously and parallelize database queries for improved performance. Adjusted cleanup timeout for Braintrust traces to reduce delays.
* fixed reasoned for X, so that it rounds down to the minute
* Update users page
* update build pipeline for new web
* document title update
* Named chats for page
* Datasets titles
* Refactor visualization tools and enhance error handling in retryable agent stream. Removed unused metricValueLabel from metrics file tool, updated metric configuration schemas, and improved healing mechanism for tool errors during streaming.
* analyst
* document title updates
* Update useDocumentTitle.tsx
* Refactor tool choice configuration in create-todos-step to use structured object. Remove exponential backoff logic from retryable agent stream for healable errors. Introduce new test for real-world healing scenarios in retryable agent stream.
* Refactor SQL validation logic in modify-metrics-file-tool to skip unnecessary checks when SQL has not changed. Enhance error handling and update validation messages. Clean up code formatting for improved readability.
* update collapse for filecard
* chevron collapse
* Jacob prompt changes (#376)
* prompt changes to improve filtering logic and handle priv/sec errors
* prompt changes to make aggregation better and improved filter best practices
* Update packages/ai/src/steps/create-todos-step.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* Update packages/ai/src/agents/think-and-prep-agent/think-and-prep-instructions.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* Update packages/ai/src/steps/create-todos-step.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
---------
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
Co-authored-by: dal <dallin@buster.so>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* think and prep
* change header and strong fonts weights
* Update get collection
* combo chart x axis update
* Create a chart schemas as types
* schema types
* simple unit tests for line chart props
* fix the response file ordering iwth active selection.
* copy around reasoning messages taken care of
* fix nullable user message and file processing and such.
* update ticks for chart config
* fix todo parsing.
* app markdown update
* Update splitter to use border instead of width
* change ml
* If no file is found we should auto redirect
* Refactor database connection handling to support SSL modes. Introduced functions to extract SSL parameters and manage connections based on SSL requirements, including a custom verifier for unverified connections.
* black box message update
* chat title updates
* optimizations for trigger.
* some keepalive logic on the anthropic cached
* keep title empty until new one
* no duplicate messages
* null user message on asset pull
* posthog error handling
* 20 sec idle timeout on anthropic
* null req message
* fixed modificiation names missing
* Refactor tool call handling to support new content array format in asset messages and context loaders
* cache most recent file from workflow
* Enhance date and number detection in createDataMetadata function to improve data type handling for metrics files
* group hover effect for message
* logging for chat
* Add messageId handling and file association tracking in dashboard and metrics tools
- Updated runtime context to include messageId in create and modify dashboard and metrics file tools.
- Implemented file association tracking based on messageId in create and modify functions for both dashboards and metrics.
- Ensured type consistency by using AnalystRuntimeContext in runtime context parameters.
* logging for chat
* message type update
* Route to first file instead
* trigger moved to catalog
* Enhance file selection logic to support YAML parsing and improve logging
- Updated `extractMetricIdsFromDashboard` to first attempt JSON parsing, falling back to a regex-based YAML parsing for metric IDs.
- Added detailed debug logging in `selectFilesForResponse` to track file selection process, including metrics and dashboards involved.
- Introduced tests for various scenarios in `file-selection.test.ts` to ensure correct behavior with dashboard context and edge cases.
* trigger dev v4-beta
* Retry + Self Healing (#381)
* Refactor retry logic in analyst and think-and-prep steps
Co-authored-by: dallin <dallin@buster.so>
* some fixes
* console log error
* self healing
* todos retry
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* remove lots of logs
* Remove chat streaming
* Remove chat streaming
* timeout
* Change to updated at field
* link to home
* Update timeout settings for HTTP and HTTPS agents from 20 seconds to 10 seconds for improved responsiveness.
* Add utils module and integrate message conversion in post_chat_handler
* Implement error handling for extract values (#382)
* Remove chat streaming
* Improve error handling and logging in extract values and chat title steps
Co-authored-by: dallin <dallin@buster.so>
---------
Co-authored-by: Nate Kelley <nate@buster.so>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* loading icon for buster avatar
* finalize tooltip cache
* upgrade mastra
* increase retries
* Add redo functionality for chat messages
- Introduced `redoFromMessageId` parameter in `handleExistingChat` to allow users to specify a message to redo from.
- Implemented validation to ensure the specified message belongs to the current chat.
- Added `softDeleteMessagesFromPoint` function to soft delete a message and all subsequent messages in the same chat, facilitating the redo feature.
* fix electric potential memory leak
* tooltip cache and chart cleanup
* Update bullet to be more indented
* latest version number
* add support endpoint to new server
* Fix jank in combo bar charts
* index check for dashboard
* Collapse only if there are metrics
* Is finished reasoing back
* Update dependencies and enhance chat message handling
- Upgraded `@mastra/core` to version 0.10.8 and added `node-sql-parser` at version 5.3.10 in the lock file.
- Improved integration tests for chat message redo functionality, ensuring correct behavior when deriving `chat_id` from `message_id`.
- Enhanced error handling and validation in the `initializeChat` function to manage cases where `chat_id` is not provided.
* Update pnpm-lock and enhance chat message integration tests
- Added `node-sql-parser` version 5.3.10 to dependencies and updated the lock file.
- Improved integration tests for chat message redo functionality, ensuring accurate deletion and retrieval of messages.
- Enhanced the `initializeChat` function to derive `chat_id` from `message_id` when not provided, improving error handling and validation.
* remove .env import breaking build
* add updated at to the get chat handler
* zmall runtime error fix
* permission tests passing
* return updated at on the get chat handler now
* slq parser fixes
* Implement chat access control logic and add comprehensive tests
- Developed the `canUserAccessChat` function to determine user access to chats based on direct permissions, collection permissions, creator status, and organizational roles.
- Introduced helper functions for checking permissions and retrieving chat information.
- Added integration tests to validate access control logic, covering various scenarios including direct permissions, collection permissions, and user roles.
- Created unit tests to ensure the correctness of the access control function with mocked database interactions.
- Included simple integration tests to verify functionality with existing database data.
* sql parser and int tests working.
* fix test and lint issues
* comment to kick off deployment lo
* access controls on datasets
* electric context bug fix with sql helpers.
* permission and read only
* Add lru-cache dependency and export cache management functions
- Added `lru-cache` as a dependency in the access-controls package.
- Exported new cache management functions from `chats-cached` module, including `canUserAccessChatCached`, `getCacheStats`, `resetCacheStats`, `clearCache`, `invalidateAccess`, `invalidateUserAccess`, and `invalidateChatAccess`.
* packages deploy as well
* wrong workflow lol
* Update AppVerticalCodeSplitter.tsx
* Add error handling for query run and SQL save operations
Co-authored-by: natemkelley <natemkelley@gmail.com>
* Trim whitespace from input values before sending chat prompts
Co-authored-by: natemkelley <natemkelley@gmail.com>
* type in think-and-prep
* use the cached access chat
* update package version
* new asset import message
* Error fallback for login
* Update BusterChart.BarChart.stories.tsx
* Staging changes to fix number card titles, combo chart axis, and using dynamic filters (#386)
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
* db init command pass through
* combo chart fixes (#387)
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
* clarifying question and connection logic
* pino pretty error fix
* clarifying is a finishing tool
* change update latest version logic
* Update support endpoint
* fixes for horizontal bar charts and added the combo chart logic to update metrics (#388)
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
* permission fix on dashboard metric handlers for workspace and data admin
* Add more try catches
* Hide avatar is no more
* Horizontal bar fixes (#389)
* fixes for horizontal bar charts and added the combo chart logic to update metrics
* hopefully fixed horizontal bar charts
---------
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
* reasoning shimmer update
* Make the embed flow work with versions
* new account warning update
* Move support modal
* compact number for pie label
* Add final reasoning message tracking and workflow start time to chunk processor and related steps
- Introduced `finalReasoningMessage` to schemas in `analyst-step`, `mark-message-complete-step`, and `create-todos-step`.
- Updated `ChunkProcessor` to calculate and store the final reasoning message based on workflow duration.
- Enhanced various steps to utilize the new `workflowStartTime` for better tracking of execution duration.
- Improved database update logic to include `finalReasoningMessage` when applicable.
* 9 digit cutoff for pie
* trigger update
* test on mastra braintrust
* test deployment
* testing
* pnpm install
* pnpm
* node 22
* pnpm version
* trigger main
* get initial chat file
* hono main deploymenbt
* clear timeouts
* Remove console logs
* migration test to staging
* db url
* try again
* k get rid of tls var
* hmmm lets try this
* mark migrations
* fix migration file?
* drizzle-kit upgrade
* tweaks to the github actions
---------
Co-authored-by: Nate Kelley <nate@buster.so>
Co-authored-by: porter-deployment-app[bot] <87230664+porter-deployment-app[bot]@users.noreply.github.com>
Co-authored-by: Nate Kelley <133379588+nate-kelley-buster@users.noreply.github.com>
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
Co-authored-by: jacob-buster <jacob@buster.so>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: natemkelley <natemkelley@gmail.com>
2025-07-03 05:33:40 +08:00
|
|
|
// Handle single statement or array of statements
|
|
|
|
const statements = Array.isArray(ast) ? ast : [ast];
|
2025-07-07 23:57:04 +08:00
|
|
|
|
Mastra braintrust (#391)
* type fixes
* biome clean on ai
* add user to flag chat
* attempt to get vercel deployed
* Update tsup.config.ts
* Update pnpm-lock.yaml
* Add @buster/server2 Hono API app with Vercel deployment configuration
* slack oauth integration
* mainly some clean up and biome formatting
* slack oauth
* slack migration + snapshot
* remove unused files
* finalized docker image for porter
* Create porter_app_buster-server_3155.yml file
* Add integration tests for Slack handler and refactor Slack OAuth service
- Introduced integration tests for the Slack handler, covering OAuth initiation, callback handling, and integration status retrieval.
- Refactored Slack OAuth service to improve error handling and ensure proper integration state management.
- Updated token storage implementation to use a database vault instead of Supabase.
- Enhanced existing tests for better coverage and reliability, including cleanup of test data.
- Added new utility functions for managing vault secrets in the database.
* docker image update
* new prompts
* individual tests and a schema fix
* server build
* final working dockerfile
* Update Dockerfile
* new messages to slack messages (#369)
* Update dockerfile
* Update validate-env.js
* update build pipeline
* Update the dockerfile flow
* finalize logging for pino
* stable base
* Update cors middleware logger
* Update cors.ts
* update docker to be more imformative
* Update index.ts
* Update auth.ts
* Update cors.ts
* Update cors.ts
* Update logger.ts
* remove logs
* more cors updates
* build server shared
* Refactor PostgreSQL credentials handling and remove unused memory storage. Update package dependencies. (#370)
* tons of file parsing errors (#371)
* Refactor PostgreSQL credentials handling and remove unused memory storage. Update package dependencies.
* tons of file parsing errors
* Dev mode updates
* more stable electric handler
* Dal/agent-self-healing-fixes (#372)
* change to 6 min
* optmizations around saving and non-blocking actions.
* stream optimizations
* Dal/agent-self-healing-fixes (#373)
* change to 6 min
* optmizations around saving and non-blocking actions.
* stream optimizations
* change porter staging deploy to mastra-braintrust.
* new path for porter deploy
* deploy to staging fix
* Create porter_app_mastra-braintrust-api_3155.yml file (#375)
Co-authored-by: porter-deployment-app[bot] <87230664+porter-deployment-app[bot]@users.noreply.github.com>
* Update sizing and opacity
* supe up the instance for mastra
* environment staging
* ssl script
* copy path
* Update list padding
* no throttle and the anthropic cached
* move select to the top
* Update margin inline start
* shrink reasoning vertical space to 2px
* semi bold font for headers
* update animation timing
* haiku
* Add createTodoList tool and integrate into create-todos-step
* chat helper on post chat
* only trigger cicd when change made
* Start created streaming text components
* Refactor analyst agent task to initialize Braintrust logging asynchronously and parallelize database queries for improved performance. Adjusted cleanup timeout for Braintrust traces to reduce delays.
* fixed reasoned for X, so that it rounds down to the minute
* Update users page
* update build pipeline for new web
* document title update
* Named chats for page
* Datasets titles
* Refactor visualization tools and enhance error handling in retryable agent stream. Removed unused metricValueLabel from metrics file tool, updated metric configuration schemas, and improved healing mechanism for tool errors during streaming.
* analyst
* document title updates
* Update useDocumentTitle.tsx
* Refactor tool choice configuration in create-todos-step to use structured object. Remove exponential backoff logic from retryable agent stream for healable errors. Introduce new test for real-world healing scenarios in retryable agent stream.
* Refactor SQL validation logic in modify-metrics-file-tool to skip unnecessary checks when SQL has not changed. Enhance error handling and update validation messages. Clean up code formatting for improved readability.
* update collapse for filecard
* chevron collapse
* Jacob prompt changes (#376)
* prompt changes to improve filtering logic and handle priv/sec errors
* prompt changes to make aggregation better and improved filter best practices
* Update packages/ai/src/steps/create-todos-step.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* Update packages/ai/src/agents/think-and-prep-agent/think-and-prep-instructions.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* Update packages/ai/src/steps/create-todos-step.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
---------
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
Co-authored-by: dal <dallin@buster.so>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* think and prep
* change header and strong fonts weights
* Update get collection
* combo chart x axis update
* Create a chart schemas as types
* schema types
* simple unit tests for line chart props
* fix the response file ordering iwth active selection.
* copy around reasoning messages taken care of
* fix nullable user message and file processing and such.
* update ticks for chart config
* fix todo parsing.
* app markdown update
* Update splitter to use border instead of width
* change ml
* If no file is found we should auto redirect
* Refactor database connection handling to support SSL modes. Introduced functions to extract SSL parameters and manage connections based on SSL requirements, including a custom verifier for unverified connections.
* black box message update
* chat title updates
* optimizations for trigger.
* some keepalive logic on the anthropic cached
* keep title empty until new one
* no duplicate messages
* null user message on asset pull
* posthog error handling
* 20 sec idle timeout on anthropic
* null req message
* fixed modificiation names missing
* Refactor tool call handling to support new content array format in asset messages and context loaders
* cache most recent file from workflow
* Enhance date and number detection in createDataMetadata function to improve data type handling for metrics files
* group hover effect for message
* logging for chat
* Add messageId handling and file association tracking in dashboard and metrics tools
- Updated runtime context to include messageId in create and modify dashboard and metrics file tools.
- Implemented file association tracking based on messageId in create and modify functions for both dashboards and metrics.
- Ensured type consistency by using AnalystRuntimeContext in runtime context parameters.
* logging for chat
* message type update
* Route to first file instead
* trigger moved to catalog
* Enhance file selection logic to support YAML parsing and improve logging
- Updated `extractMetricIdsFromDashboard` to first attempt JSON parsing, falling back to a regex-based YAML parsing for metric IDs.
- Added detailed debug logging in `selectFilesForResponse` to track file selection process, including metrics and dashboards involved.
- Introduced tests for various scenarios in `file-selection.test.ts` to ensure correct behavior with dashboard context and edge cases.
* trigger dev v4-beta
* Retry + Self Healing (#381)
* Refactor retry logic in analyst and think-and-prep steps
Co-authored-by: dallin <dallin@buster.so>
* some fixes
* console log error
* self healing
* todos retry
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* remove lots of logs
* Remove chat streaming
* Remove chat streaming
* timeout
* Change to updated at field
* link to home
* Update timeout settings for HTTP and HTTPS agents from 20 seconds to 10 seconds for improved responsiveness.
* Add utils module and integrate message conversion in post_chat_handler
* Implement error handling for extract values (#382)
* Remove chat streaming
* Improve error handling and logging in extract values and chat title steps
Co-authored-by: dallin <dallin@buster.so>
---------
Co-authored-by: Nate Kelley <nate@buster.so>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* loading icon for buster avatar
* finalize tooltip cache
* upgrade mastra
* increase retries
* Add redo functionality for chat messages
- Introduced `redoFromMessageId` parameter in `handleExistingChat` to allow users to specify a message to redo from.
- Implemented validation to ensure the specified message belongs to the current chat.
- Added `softDeleteMessagesFromPoint` function to soft delete a message and all subsequent messages in the same chat, facilitating the redo feature.
* fix electric potential memory leak
* tooltip cache and chart cleanup
* Update bullet to be more indented
* latest version number
* add support endpoint to new server
* Fix jank in combo bar charts
* index check for dashboard
* Collapse only if there are metrics
* Is finished reasoing back
* Update dependencies and enhance chat message handling
- Upgraded `@mastra/core` to version 0.10.8 and added `node-sql-parser` at version 5.3.10 in the lock file.
- Improved integration tests for chat message redo functionality, ensuring correct behavior when deriving `chat_id` from `message_id`.
- Enhanced error handling and validation in the `initializeChat` function to manage cases where `chat_id` is not provided.
* Update pnpm-lock and enhance chat message integration tests
- Added `node-sql-parser` version 5.3.10 to dependencies and updated the lock file.
- Improved integration tests for chat message redo functionality, ensuring accurate deletion and retrieval of messages.
- Enhanced the `initializeChat` function to derive `chat_id` from `message_id` when not provided, improving error handling and validation.
* remove .env import breaking build
* add updated at to the get chat handler
* zmall runtime error fix
* permission tests passing
* return updated at on the get chat handler now
* slq parser fixes
* Implement chat access control logic and add comprehensive tests
- Developed the `canUserAccessChat` function to determine user access to chats based on direct permissions, collection permissions, creator status, and organizational roles.
- Introduced helper functions for checking permissions and retrieving chat information.
- Added integration tests to validate access control logic, covering various scenarios including direct permissions, collection permissions, and user roles.
- Created unit tests to ensure the correctness of the access control function with mocked database interactions.
- Included simple integration tests to verify functionality with existing database data.
* sql parser and int tests working.
* fix test and lint issues
* comment to kick off deployment lo
* access controls on datasets
* electric context bug fix with sql helpers.
* permission and read only
* Add lru-cache dependency and export cache management functions
- Added `lru-cache` as a dependency in the access-controls package.
- Exported new cache management functions from `chats-cached` module, including `canUserAccessChatCached`, `getCacheStats`, `resetCacheStats`, `clearCache`, `invalidateAccess`, `invalidateUserAccess`, and `invalidateChatAccess`.
* packages deploy as well
* wrong workflow lol
* Update AppVerticalCodeSplitter.tsx
* Add error handling for query run and SQL save operations
Co-authored-by: natemkelley <natemkelley@gmail.com>
* Trim whitespace from input values before sending chat prompts
Co-authored-by: natemkelley <natemkelley@gmail.com>
* type in think-and-prep
* use the cached access chat
* update package version
* new asset import message
* Error fallback for login
* Update BusterChart.BarChart.stories.tsx
* Staging changes to fix number card titles, combo chart axis, and using dynamic filters (#386)
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
* db init command pass through
* combo chart fixes (#387)
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
* clarifying question and connection logic
* pino pretty error fix
* clarifying is a finishing tool
* change update latest version logic
* Update support endpoint
* fixes for horizontal bar charts and added the combo chart logic to update metrics (#388)
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
* permission fix on dashboard metric handlers for workspace and data admin
* Add more try catches
* Hide avatar is no more
* Horizontal bar fixes (#389)
* fixes for horizontal bar charts and added the combo chart logic to update metrics
* hopefully fixed horizontal bar charts
---------
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
* reasoning shimmer update
* Make the embed flow work with versions
* new account warning update
* Move support modal
* compact number for pie label
* Add final reasoning message tracking and workflow start time to chunk processor and related steps
- Introduced `finalReasoningMessage` to schemas in `analyst-step`, `mark-message-complete-step`, and `create-todos-step`.
- Updated `ChunkProcessor` to calculate and store the final reasoning message based on workflow duration.
- Enhanced various steps to utilize the new `workflowStartTime` for better tracking of execution duration.
- Improved database update logic to include `finalReasoningMessage` when applicable.
* 9 digit cutoff for pie
* trigger update
* test on mastra braintrust
* test deployment
* testing
* pnpm install
* pnpm
* node 22
* pnpm version
* trigger main
* get initial chat file
* hono main deploymenbt
* clear timeouts
* Remove console logs
* migration test to staging
* db url
* try again
* k get rid of tls var
* hmmm lets try this
* mark migrations
* fix migration file?
* drizzle-kit upgrade
* tweaks to the github actions
---------
Co-authored-by: Nate Kelley <nate@buster.so>
Co-authored-by: porter-deployment-app[bot] <87230664+porter-deployment-app[bot]@users.noreply.github.com>
Co-authored-by: Nate Kelley <133379588+nate-kelley-buster@users.noreply.github.com>
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
Co-authored-by: jacob-buster <jacob@buster.so>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: natemkelley <natemkelley@gmail.com>
2025-07-03 05:33:40 +08:00
|
|
|
// Check each statement
|
|
|
|
for (const statement of statements) {
|
|
|
|
// Check if statement has a type property
|
|
|
|
if ('type' in statement && statement.type) {
|
|
|
|
const queryType = statement.type.toLowerCase();
|
2025-07-07 23:57:04 +08:00
|
|
|
|
Mastra braintrust (#391)
* type fixes
* biome clean on ai
* add user to flag chat
* attempt to get vercel deployed
* Update tsup.config.ts
* Update pnpm-lock.yaml
* Add @buster/server2 Hono API app with Vercel deployment configuration
* slack oauth integration
* mainly some clean up and biome formatting
* slack oauth
* slack migration + snapshot
* remove unused files
* finalized docker image for porter
* Create porter_app_buster-server_3155.yml file
* Add integration tests for Slack handler and refactor Slack OAuth service
- Introduced integration tests for the Slack handler, covering OAuth initiation, callback handling, and integration status retrieval.
- Refactored Slack OAuth service to improve error handling and ensure proper integration state management.
- Updated token storage implementation to use a database vault instead of Supabase.
- Enhanced existing tests for better coverage and reliability, including cleanup of test data.
- Added new utility functions for managing vault secrets in the database.
* docker image update
* new prompts
* individual tests and a schema fix
* server build
* final working dockerfile
* Update Dockerfile
* new messages to slack messages (#369)
* Update dockerfile
* Update validate-env.js
* update build pipeline
* Update the dockerfile flow
* finalize logging for pino
* stable base
* Update cors middleware logger
* Update cors.ts
* update docker to be more imformative
* Update index.ts
* Update auth.ts
* Update cors.ts
* Update cors.ts
* Update logger.ts
* remove logs
* more cors updates
* build server shared
* Refactor PostgreSQL credentials handling and remove unused memory storage. Update package dependencies. (#370)
* tons of file parsing errors (#371)
* Refactor PostgreSQL credentials handling and remove unused memory storage. Update package dependencies.
* tons of file parsing errors
* Dev mode updates
* more stable electric handler
* Dal/agent-self-healing-fixes (#372)
* change to 6 min
* optmizations around saving and non-blocking actions.
* stream optimizations
* Dal/agent-self-healing-fixes (#373)
* change to 6 min
* optmizations around saving and non-blocking actions.
* stream optimizations
* change porter staging deploy to mastra-braintrust.
* new path for porter deploy
* deploy to staging fix
* Create porter_app_mastra-braintrust-api_3155.yml file (#375)
Co-authored-by: porter-deployment-app[bot] <87230664+porter-deployment-app[bot]@users.noreply.github.com>
* Update sizing and opacity
* supe up the instance for mastra
* environment staging
* ssl script
* copy path
* Update list padding
* no throttle and the anthropic cached
* move select to the top
* Update margin inline start
* shrink reasoning vertical space to 2px
* semi bold font for headers
* update animation timing
* haiku
* Add createTodoList tool and integrate into create-todos-step
* chat helper on post chat
* only trigger cicd when change made
* Start created streaming text components
* Refactor analyst agent task to initialize Braintrust logging asynchronously and parallelize database queries for improved performance. Adjusted cleanup timeout for Braintrust traces to reduce delays.
* fixed reasoned for X, so that it rounds down to the minute
* Update users page
* update build pipeline for new web
* document title update
* Named chats for page
* Datasets titles
* Refactor visualization tools and enhance error handling in retryable agent stream. Removed unused metricValueLabel from metrics file tool, updated metric configuration schemas, and improved healing mechanism for tool errors during streaming.
* analyst
* document title updates
* Update useDocumentTitle.tsx
* Refactor tool choice configuration in create-todos-step to use structured object. Remove exponential backoff logic from retryable agent stream for healable errors. Introduce new test for real-world healing scenarios in retryable agent stream.
* Refactor SQL validation logic in modify-metrics-file-tool to skip unnecessary checks when SQL has not changed. Enhance error handling and update validation messages. Clean up code formatting for improved readability.
* update collapse for filecard
* chevron collapse
* Jacob prompt changes (#376)
* prompt changes to improve filtering logic and handle priv/sec errors
* prompt changes to make aggregation better and improved filter best practices
* Update packages/ai/src/steps/create-todos-step.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* Update packages/ai/src/agents/think-and-prep-agent/think-and-prep-instructions.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* Update packages/ai/src/steps/create-todos-step.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
---------
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
Co-authored-by: dal <dallin@buster.so>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* think and prep
* change header and strong fonts weights
* Update get collection
* combo chart x axis update
* Create a chart schemas as types
* schema types
* simple unit tests for line chart props
* fix the response file ordering iwth active selection.
* copy around reasoning messages taken care of
* fix nullable user message and file processing and such.
* update ticks for chart config
* fix todo parsing.
* app markdown update
* Update splitter to use border instead of width
* change ml
* If no file is found we should auto redirect
* Refactor database connection handling to support SSL modes. Introduced functions to extract SSL parameters and manage connections based on SSL requirements, including a custom verifier for unverified connections.
* black box message update
* chat title updates
* optimizations for trigger.
* some keepalive logic on the anthropic cached
* keep title empty until new one
* no duplicate messages
* null user message on asset pull
* posthog error handling
* 20 sec idle timeout on anthropic
* null req message
* fixed modificiation names missing
* Refactor tool call handling to support new content array format in asset messages and context loaders
* cache most recent file from workflow
* Enhance date and number detection in createDataMetadata function to improve data type handling for metrics files
* group hover effect for message
* logging for chat
* Add messageId handling and file association tracking in dashboard and metrics tools
- Updated runtime context to include messageId in create and modify dashboard and metrics file tools.
- Implemented file association tracking based on messageId in create and modify functions for both dashboards and metrics.
- Ensured type consistency by using AnalystRuntimeContext in runtime context parameters.
* logging for chat
* message type update
* Route to first file instead
* trigger moved to catalog
* Enhance file selection logic to support YAML parsing and improve logging
- Updated `extractMetricIdsFromDashboard` to first attempt JSON parsing, falling back to a regex-based YAML parsing for metric IDs.
- Added detailed debug logging in `selectFilesForResponse` to track file selection process, including metrics and dashboards involved.
- Introduced tests for various scenarios in `file-selection.test.ts` to ensure correct behavior with dashboard context and edge cases.
* trigger dev v4-beta
* Retry + Self Healing (#381)
* Refactor retry logic in analyst and think-and-prep steps
Co-authored-by: dallin <dallin@buster.so>
* some fixes
* console log error
* self healing
* todos retry
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* remove lots of logs
* Remove chat streaming
* Remove chat streaming
* timeout
* Change to updated at field
* link to home
* Update timeout settings for HTTP and HTTPS agents from 20 seconds to 10 seconds for improved responsiveness.
* Add utils module and integrate message conversion in post_chat_handler
* Implement error handling for extract values (#382)
* Remove chat streaming
* Improve error handling and logging in extract values and chat title steps
Co-authored-by: dallin <dallin@buster.so>
---------
Co-authored-by: Nate Kelley <nate@buster.so>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* loading icon for buster avatar
* finalize tooltip cache
* upgrade mastra
* increase retries
* Add redo functionality for chat messages
- Introduced `redoFromMessageId` parameter in `handleExistingChat` to allow users to specify a message to redo from.
- Implemented validation to ensure the specified message belongs to the current chat.
- Added `softDeleteMessagesFromPoint` function to soft delete a message and all subsequent messages in the same chat, facilitating the redo feature.
* fix electric potential memory leak
* tooltip cache and chart cleanup
* Update bullet to be more indented
* latest version number
* add support endpoint to new server
* Fix jank in combo bar charts
* index check for dashboard
* Collapse only if there are metrics
* Is finished reasoing back
* Update dependencies and enhance chat message handling
- Upgraded `@mastra/core` to version 0.10.8 and added `node-sql-parser` at version 5.3.10 in the lock file.
- Improved integration tests for chat message redo functionality, ensuring correct behavior when deriving `chat_id` from `message_id`.
- Enhanced error handling and validation in the `initializeChat` function to manage cases where `chat_id` is not provided.
* Update pnpm-lock and enhance chat message integration tests
- Added `node-sql-parser` version 5.3.10 to dependencies and updated the lock file.
- Improved integration tests for chat message redo functionality, ensuring accurate deletion and retrieval of messages.
- Enhanced the `initializeChat` function to derive `chat_id` from `message_id` when not provided, improving error handling and validation.
* remove .env import breaking build
* add updated at to the get chat handler
* zmall runtime error fix
* permission tests passing
* return updated at on the get chat handler now
* slq parser fixes
* Implement chat access control logic and add comprehensive tests
- Developed the `canUserAccessChat` function to determine user access to chats based on direct permissions, collection permissions, creator status, and organizational roles.
- Introduced helper functions for checking permissions and retrieving chat information.
- Added integration tests to validate access control logic, covering various scenarios including direct permissions, collection permissions, and user roles.
- Created unit tests to ensure the correctness of the access control function with mocked database interactions.
- Included simple integration tests to verify functionality with existing database data.
* sql parser and int tests working.
* fix test and lint issues
* comment to kick off deployment lo
* access controls on datasets
* electric context bug fix with sql helpers.
* permission and read only
* Add lru-cache dependency and export cache management functions
- Added `lru-cache` as a dependency in the access-controls package.
- Exported new cache management functions from `chats-cached` module, including `canUserAccessChatCached`, `getCacheStats`, `resetCacheStats`, `clearCache`, `invalidateAccess`, `invalidateUserAccess`, and `invalidateChatAccess`.
* packages deploy as well
* wrong workflow lol
* Update AppVerticalCodeSplitter.tsx
* Add error handling for query run and SQL save operations
Co-authored-by: natemkelley <natemkelley@gmail.com>
* Trim whitespace from input values before sending chat prompts
Co-authored-by: natemkelley <natemkelley@gmail.com>
* type in think-and-prep
* use the cached access chat
* update package version
* new asset import message
* Error fallback for login
* Update BusterChart.BarChart.stories.tsx
* Staging changes to fix number card titles, combo chart axis, and using dynamic filters (#386)
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
* db init command pass through
* combo chart fixes (#387)
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
* clarifying question and connection logic
* pino pretty error fix
* clarifying is a finishing tool
* change update latest version logic
* Update support endpoint
* fixes for horizontal bar charts and added the combo chart logic to update metrics (#388)
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
* permission fix on dashboard metric handlers for workspace and data admin
* Add more try catches
* Hide avatar is no more
* Horizontal bar fixes (#389)
* fixes for horizontal bar charts and added the combo chart logic to update metrics
* hopefully fixed horizontal bar charts
---------
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
* reasoning shimmer update
* Make the embed flow work with versions
* new account warning update
* Move support modal
* compact number for pie label
* Add final reasoning message tracking and workflow start time to chunk processor and related steps
- Introduced `finalReasoningMessage` to schemas in `analyst-step`, `mark-message-complete-step`, and `create-todos-step`.
- Updated `ChunkProcessor` to calculate and store the final reasoning message based on workflow duration.
- Enhanced various steps to utilize the new `workflowStartTime` for better tracking of execution duration.
- Improved database update logic to include `finalReasoningMessage` when applicable.
* 9 digit cutoff for pie
* trigger update
* test on mastra braintrust
* test deployment
* testing
* pnpm install
* pnpm
* node 22
* pnpm version
* trigger main
* get initial chat file
* hono main deploymenbt
* clear timeouts
* Remove console logs
* migration test to staging
* db url
* try again
* k get rid of tls var
* hmmm lets try this
* mark migrations
* fix migration file?
* drizzle-kit upgrade
* tweaks to the github actions
---------
Co-authored-by: Nate Kelley <nate@buster.so>
Co-authored-by: porter-deployment-app[bot] <87230664+porter-deployment-app[bot]@users.noreply.github.com>
Co-authored-by: Nate Kelley <133379588+nate-kelley-buster@users.noreply.github.com>
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
Co-authored-by: jacob-buster <jacob@buster.so>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: natemkelley <natemkelley@gmail.com>
2025-07-03 05:33:40 +08:00
|
|
|
// Only allow SELECT statements
|
|
|
|
if (queryType !== 'select') {
|
|
|
|
return {
|
|
|
|
isReadOnly: false,
|
|
|
|
queryType: statement.type,
|
2025-07-07 23:57:04 +08:00
|
|
|
error: `Query type '${statement.type}' is not allowed. Only SELECT statements are permitted for read-only access.`,
|
Mastra braintrust (#391)
* type fixes
* biome clean on ai
* add user to flag chat
* attempt to get vercel deployed
* Update tsup.config.ts
* Update pnpm-lock.yaml
* Add @buster/server2 Hono API app with Vercel deployment configuration
* slack oauth integration
* mainly some clean up and biome formatting
* slack oauth
* slack migration + snapshot
* remove unused files
* finalized docker image for porter
* Create porter_app_buster-server_3155.yml file
* Add integration tests for Slack handler and refactor Slack OAuth service
- Introduced integration tests for the Slack handler, covering OAuth initiation, callback handling, and integration status retrieval.
- Refactored Slack OAuth service to improve error handling and ensure proper integration state management.
- Updated token storage implementation to use a database vault instead of Supabase.
- Enhanced existing tests for better coverage and reliability, including cleanup of test data.
- Added new utility functions for managing vault secrets in the database.
* docker image update
* new prompts
* individual tests and a schema fix
* server build
* final working dockerfile
* Update Dockerfile
* new messages to slack messages (#369)
* Update dockerfile
* Update validate-env.js
* update build pipeline
* Update the dockerfile flow
* finalize logging for pino
* stable base
* Update cors middleware logger
* Update cors.ts
* update docker to be more imformative
* Update index.ts
* Update auth.ts
* Update cors.ts
* Update cors.ts
* Update logger.ts
* remove logs
* more cors updates
* build server shared
* Refactor PostgreSQL credentials handling and remove unused memory storage. Update package dependencies. (#370)
* tons of file parsing errors (#371)
* Refactor PostgreSQL credentials handling and remove unused memory storage. Update package dependencies.
* tons of file parsing errors
* Dev mode updates
* more stable electric handler
* Dal/agent-self-healing-fixes (#372)
* change to 6 min
* optmizations around saving and non-blocking actions.
* stream optimizations
* Dal/agent-self-healing-fixes (#373)
* change to 6 min
* optmizations around saving and non-blocking actions.
* stream optimizations
* change porter staging deploy to mastra-braintrust.
* new path for porter deploy
* deploy to staging fix
* Create porter_app_mastra-braintrust-api_3155.yml file (#375)
Co-authored-by: porter-deployment-app[bot] <87230664+porter-deployment-app[bot]@users.noreply.github.com>
* Update sizing and opacity
* supe up the instance for mastra
* environment staging
* ssl script
* copy path
* Update list padding
* no throttle and the anthropic cached
* move select to the top
* Update margin inline start
* shrink reasoning vertical space to 2px
* semi bold font for headers
* update animation timing
* haiku
* Add createTodoList tool and integrate into create-todos-step
* chat helper on post chat
* only trigger cicd when change made
* Start created streaming text components
* Refactor analyst agent task to initialize Braintrust logging asynchronously and parallelize database queries for improved performance. Adjusted cleanup timeout for Braintrust traces to reduce delays.
* fixed reasoned for X, so that it rounds down to the minute
* Update users page
* update build pipeline for new web
* document title update
* Named chats for page
* Datasets titles
* Refactor visualization tools and enhance error handling in retryable agent stream. Removed unused metricValueLabel from metrics file tool, updated metric configuration schemas, and improved healing mechanism for tool errors during streaming.
* analyst
* document title updates
* Update useDocumentTitle.tsx
* Refactor tool choice configuration in create-todos-step to use structured object. Remove exponential backoff logic from retryable agent stream for healable errors. Introduce new test for real-world healing scenarios in retryable agent stream.
* Refactor SQL validation logic in modify-metrics-file-tool to skip unnecessary checks when SQL has not changed. Enhance error handling and update validation messages. Clean up code formatting for improved readability.
* update collapse for filecard
* chevron collapse
* Jacob prompt changes (#376)
* prompt changes to improve filtering logic and handle priv/sec errors
* prompt changes to make aggregation better and improved filter best practices
* Update packages/ai/src/steps/create-todos-step.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* Update packages/ai/src/agents/think-and-prep-agent/think-and-prep-instructions.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* Update packages/ai/src/steps/create-todos-step.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
---------
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
Co-authored-by: dal <dallin@buster.so>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* think and prep
* change header and strong fonts weights
* Update get collection
* combo chart x axis update
* Create a chart schemas as types
* schema types
* simple unit tests for line chart props
* fix the response file ordering iwth active selection.
* copy around reasoning messages taken care of
* fix nullable user message and file processing and such.
* update ticks for chart config
* fix todo parsing.
* app markdown update
* Update splitter to use border instead of width
* change ml
* If no file is found we should auto redirect
* Refactor database connection handling to support SSL modes. Introduced functions to extract SSL parameters and manage connections based on SSL requirements, including a custom verifier for unverified connections.
* black box message update
* chat title updates
* optimizations for trigger.
* some keepalive logic on the anthropic cached
* keep title empty until new one
* no duplicate messages
* null user message on asset pull
* posthog error handling
* 20 sec idle timeout on anthropic
* null req message
* fixed modificiation names missing
* Refactor tool call handling to support new content array format in asset messages and context loaders
* cache most recent file from workflow
* Enhance date and number detection in createDataMetadata function to improve data type handling for metrics files
* group hover effect for message
* logging for chat
* Add messageId handling and file association tracking in dashboard and metrics tools
- Updated runtime context to include messageId in create and modify dashboard and metrics file tools.
- Implemented file association tracking based on messageId in create and modify functions for both dashboards and metrics.
- Ensured type consistency by using AnalystRuntimeContext in runtime context parameters.
* logging for chat
* message type update
* Route to first file instead
* trigger moved to catalog
* Enhance file selection logic to support YAML parsing and improve logging
- Updated `extractMetricIdsFromDashboard` to first attempt JSON parsing, falling back to a regex-based YAML parsing for metric IDs.
- Added detailed debug logging in `selectFilesForResponse` to track file selection process, including metrics and dashboards involved.
- Introduced tests for various scenarios in `file-selection.test.ts` to ensure correct behavior with dashboard context and edge cases.
* trigger dev v4-beta
* Retry + Self Healing (#381)
* Refactor retry logic in analyst and think-and-prep steps
Co-authored-by: dallin <dallin@buster.so>
* some fixes
* console log error
* self healing
* todos retry
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* remove lots of logs
* Remove chat streaming
* Remove chat streaming
* timeout
* Change to updated at field
* link to home
* Update timeout settings for HTTP and HTTPS agents from 20 seconds to 10 seconds for improved responsiveness.
* Add utils module and integrate message conversion in post_chat_handler
* Implement error handling for extract values (#382)
* Remove chat streaming
* Improve error handling and logging in extract values and chat title steps
Co-authored-by: dallin <dallin@buster.so>
---------
Co-authored-by: Nate Kelley <nate@buster.so>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* loading icon for buster avatar
* finalize tooltip cache
* upgrade mastra
* increase retries
* Add redo functionality for chat messages
- Introduced `redoFromMessageId` parameter in `handleExistingChat` to allow users to specify a message to redo from.
- Implemented validation to ensure the specified message belongs to the current chat.
- Added `softDeleteMessagesFromPoint` function to soft delete a message and all subsequent messages in the same chat, facilitating the redo feature.
* fix electric potential memory leak
* tooltip cache and chart cleanup
* Update bullet to be more indented
* latest version number
* add support endpoint to new server
* Fix jank in combo bar charts
* index check for dashboard
* Collapse only if there are metrics
* Is finished reasoing back
* Update dependencies and enhance chat message handling
- Upgraded `@mastra/core` to version 0.10.8 and added `node-sql-parser` at version 5.3.10 in the lock file.
- Improved integration tests for chat message redo functionality, ensuring correct behavior when deriving `chat_id` from `message_id`.
- Enhanced error handling and validation in the `initializeChat` function to manage cases where `chat_id` is not provided.
* Update pnpm-lock and enhance chat message integration tests
- Added `node-sql-parser` version 5.3.10 to dependencies and updated the lock file.
- Improved integration tests for chat message redo functionality, ensuring accurate deletion and retrieval of messages.
- Enhanced the `initializeChat` function to derive `chat_id` from `message_id` when not provided, improving error handling and validation.
* remove .env import breaking build
* add updated at to the get chat handler
* zmall runtime error fix
* permission tests passing
* return updated at on the get chat handler now
* slq parser fixes
* Implement chat access control logic and add comprehensive tests
- Developed the `canUserAccessChat` function to determine user access to chats based on direct permissions, collection permissions, creator status, and organizational roles.
- Introduced helper functions for checking permissions and retrieving chat information.
- Added integration tests to validate access control logic, covering various scenarios including direct permissions, collection permissions, and user roles.
- Created unit tests to ensure the correctness of the access control function with mocked database interactions.
- Included simple integration tests to verify functionality with existing database data.
* sql parser and int tests working.
* fix test and lint issues
* comment to kick off deployment lo
* access controls on datasets
* electric context bug fix with sql helpers.
* permission and read only
* Add lru-cache dependency and export cache management functions
- Added `lru-cache` as a dependency in the access-controls package.
- Exported new cache management functions from `chats-cached` module, including `canUserAccessChatCached`, `getCacheStats`, `resetCacheStats`, `clearCache`, `invalidateAccess`, `invalidateUserAccess`, and `invalidateChatAccess`.
* packages deploy as well
* wrong workflow lol
* Update AppVerticalCodeSplitter.tsx
* Add error handling for query run and SQL save operations
Co-authored-by: natemkelley <natemkelley@gmail.com>
* Trim whitespace from input values before sending chat prompts
Co-authored-by: natemkelley <natemkelley@gmail.com>
* type in think-and-prep
* use the cached access chat
* update package version
* new asset import message
* Error fallback for login
* Update BusterChart.BarChart.stories.tsx
* Staging changes to fix number card titles, combo chart axis, and using dynamic filters (#386)
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
* db init command pass through
* combo chart fixes (#387)
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
* clarifying question and connection logic
* pino pretty error fix
* clarifying is a finishing tool
* change update latest version logic
* Update support endpoint
* fixes for horizontal bar charts and added the combo chart logic to update metrics (#388)
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
* permission fix on dashboard metric handlers for workspace and data admin
* Add more try catches
* Hide avatar is no more
* Horizontal bar fixes (#389)
* fixes for horizontal bar charts and added the combo chart logic to update metrics
* hopefully fixed horizontal bar charts
---------
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
* reasoning shimmer update
* Make the embed flow work with versions
* new account warning update
* Move support modal
* compact number for pie label
* Add final reasoning message tracking and workflow start time to chunk processor and related steps
- Introduced `finalReasoningMessage` to schemas in `analyst-step`, `mark-message-complete-step`, and `create-todos-step`.
- Updated `ChunkProcessor` to calculate and store the final reasoning message based on workflow duration.
- Enhanced various steps to utilize the new `workflowStartTime` for better tracking of execution duration.
- Improved database update logic to include `finalReasoningMessage` when applicable.
* 9 digit cutoff for pie
* trigger update
* test on mastra braintrust
* test deployment
* testing
* pnpm install
* pnpm
* node 22
* pnpm version
* trigger main
* get initial chat file
* hono main deploymenbt
* clear timeouts
* Remove console logs
* migration test to staging
* db url
* try again
* k get rid of tls var
* hmmm lets try this
* mark migrations
* fix migration file?
* drizzle-kit upgrade
* tweaks to the github actions
---------
Co-authored-by: Nate Kelley <nate@buster.so>
Co-authored-by: porter-deployment-app[bot] <87230664+porter-deployment-app[bot]@users.noreply.github.com>
Co-authored-by: Nate Kelley <133379588+nate-kelley-buster@users.noreply.github.com>
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
Co-authored-by: jacob-buster <jacob@buster.so>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: natemkelley <natemkelley@gmail.com>
2025-07-03 05:33:40 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2025-07-07 23:57:04 +08:00
|
|
|
|
Mastra braintrust (#391)
* type fixes
* biome clean on ai
* add user to flag chat
* attempt to get vercel deployed
* Update tsup.config.ts
* Update pnpm-lock.yaml
* Add @buster/server2 Hono API app with Vercel deployment configuration
* slack oauth integration
* mainly some clean up and biome formatting
* slack oauth
* slack migration + snapshot
* remove unused files
* finalized docker image for porter
* Create porter_app_buster-server_3155.yml file
* Add integration tests for Slack handler and refactor Slack OAuth service
- Introduced integration tests for the Slack handler, covering OAuth initiation, callback handling, and integration status retrieval.
- Refactored Slack OAuth service to improve error handling and ensure proper integration state management.
- Updated token storage implementation to use a database vault instead of Supabase.
- Enhanced existing tests for better coverage and reliability, including cleanup of test data.
- Added new utility functions for managing vault secrets in the database.
* docker image update
* new prompts
* individual tests and a schema fix
* server build
* final working dockerfile
* Update Dockerfile
* new messages to slack messages (#369)
* Update dockerfile
* Update validate-env.js
* update build pipeline
* Update the dockerfile flow
* finalize logging for pino
* stable base
* Update cors middleware logger
* Update cors.ts
* update docker to be more imformative
* Update index.ts
* Update auth.ts
* Update cors.ts
* Update cors.ts
* Update logger.ts
* remove logs
* more cors updates
* build server shared
* Refactor PostgreSQL credentials handling and remove unused memory storage. Update package dependencies. (#370)
* tons of file parsing errors (#371)
* Refactor PostgreSQL credentials handling and remove unused memory storage. Update package dependencies.
* tons of file parsing errors
* Dev mode updates
* more stable electric handler
* Dal/agent-self-healing-fixes (#372)
* change to 6 min
* optmizations around saving and non-blocking actions.
* stream optimizations
* Dal/agent-self-healing-fixes (#373)
* change to 6 min
* optmizations around saving and non-blocking actions.
* stream optimizations
* change porter staging deploy to mastra-braintrust.
* new path for porter deploy
* deploy to staging fix
* Create porter_app_mastra-braintrust-api_3155.yml file (#375)
Co-authored-by: porter-deployment-app[bot] <87230664+porter-deployment-app[bot]@users.noreply.github.com>
* Update sizing and opacity
* supe up the instance for mastra
* environment staging
* ssl script
* copy path
* Update list padding
* no throttle and the anthropic cached
* move select to the top
* Update margin inline start
* shrink reasoning vertical space to 2px
* semi bold font for headers
* update animation timing
* haiku
* Add createTodoList tool and integrate into create-todos-step
* chat helper on post chat
* only trigger cicd when change made
* Start created streaming text components
* Refactor analyst agent task to initialize Braintrust logging asynchronously and parallelize database queries for improved performance. Adjusted cleanup timeout for Braintrust traces to reduce delays.
* fixed reasoned for X, so that it rounds down to the minute
* Update users page
* update build pipeline for new web
* document title update
* Named chats for page
* Datasets titles
* Refactor visualization tools and enhance error handling in retryable agent stream. Removed unused metricValueLabel from metrics file tool, updated metric configuration schemas, and improved healing mechanism for tool errors during streaming.
* analyst
* document title updates
* Update useDocumentTitle.tsx
* Refactor tool choice configuration in create-todos-step to use structured object. Remove exponential backoff logic from retryable agent stream for healable errors. Introduce new test for real-world healing scenarios in retryable agent stream.
* Refactor SQL validation logic in modify-metrics-file-tool to skip unnecessary checks when SQL has not changed. Enhance error handling and update validation messages. Clean up code formatting for improved readability.
* update collapse for filecard
* chevron collapse
* Jacob prompt changes (#376)
* prompt changes to improve filtering logic and handle priv/sec errors
* prompt changes to make aggregation better and improved filter best practices
* Update packages/ai/src/steps/create-todos-step.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* Update packages/ai/src/agents/think-and-prep-agent/think-and-prep-instructions.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* Update packages/ai/src/steps/create-todos-step.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
---------
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
Co-authored-by: dal <dallin@buster.so>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* think and prep
* change header and strong fonts weights
* Update get collection
* combo chart x axis update
* Create a chart schemas as types
* schema types
* simple unit tests for line chart props
* fix the response file ordering iwth active selection.
* copy around reasoning messages taken care of
* fix nullable user message and file processing and such.
* update ticks for chart config
* fix todo parsing.
* app markdown update
* Update splitter to use border instead of width
* change ml
* If no file is found we should auto redirect
* Refactor database connection handling to support SSL modes. Introduced functions to extract SSL parameters and manage connections based on SSL requirements, including a custom verifier for unverified connections.
* black box message update
* chat title updates
* optimizations for trigger.
* some keepalive logic on the anthropic cached
* keep title empty until new one
* no duplicate messages
* null user message on asset pull
* posthog error handling
* 20 sec idle timeout on anthropic
* null req message
* fixed modificiation names missing
* Refactor tool call handling to support new content array format in asset messages and context loaders
* cache most recent file from workflow
* Enhance date and number detection in createDataMetadata function to improve data type handling for metrics files
* group hover effect for message
* logging for chat
* Add messageId handling and file association tracking in dashboard and metrics tools
- Updated runtime context to include messageId in create and modify dashboard and metrics file tools.
- Implemented file association tracking based on messageId in create and modify functions for both dashboards and metrics.
- Ensured type consistency by using AnalystRuntimeContext in runtime context parameters.
* logging for chat
* message type update
* Route to first file instead
* trigger moved to catalog
* Enhance file selection logic to support YAML parsing and improve logging
- Updated `extractMetricIdsFromDashboard` to first attempt JSON parsing, falling back to a regex-based YAML parsing for metric IDs.
- Added detailed debug logging in `selectFilesForResponse` to track file selection process, including metrics and dashboards involved.
- Introduced tests for various scenarios in `file-selection.test.ts` to ensure correct behavior with dashboard context and edge cases.
* trigger dev v4-beta
* Retry + Self Healing (#381)
* Refactor retry logic in analyst and think-and-prep steps
Co-authored-by: dallin <dallin@buster.so>
* some fixes
* console log error
* self healing
* todos retry
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* remove lots of logs
* Remove chat streaming
* Remove chat streaming
* timeout
* Change to updated at field
* link to home
* Update timeout settings for HTTP and HTTPS agents from 20 seconds to 10 seconds for improved responsiveness.
* Add utils module and integrate message conversion in post_chat_handler
* Implement error handling for extract values (#382)
* Remove chat streaming
* Improve error handling and logging in extract values and chat title steps
Co-authored-by: dallin <dallin@buster.so>
---------
Co-authored-by: Nate Kelley <nate@buster.so>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* loading icon for buster avatar
* finalize tooltip cache
* upgrade mastra
* increase retries
* Add redo functionality for chat messages
- Introduced `redoFromMessageId` parameter in `handleExistingChat` to allow users to specify a message to redo from.
- Implemented validation to ensure the specified message belongs to the current chat.
- Added `softDeleteMessagesFromPoint` function to soft delete a message and all subsequent messages in the same chat, facilitating the redo feature.
* fix electric potential memory leak
* tooltip cache and chart cleanup
* Update bullet to be more indented
* latest version number
* add support endpoint to new server
* Fix jank in combo bar charts
* index check for dashboard
* Collapse only if there are metrics
* Is finished reasoing back
* Update dependencies and enhance chat message handling
- Upgraded `@mastra/core` to version 0.10.8 and added `node-sql-parser` at version 5.3.10 in the lock file.
- Improved integration tests for chat message redo functionality, ensuring correct behavior when deriving `chat_id` from `message_id`.
- Enhanced error handling and validation in the `initializeChat` function to manage cases where `chat_id` is not provided.
* Update pnpm-lock and enhance chat message integration tests
- Added `node-sql-parser` version 5.3.10 to dependencies and updated the lock file.
- Improved integration tests for chat message redo functionality, ensuring accurate deletion and retrieval of messages.
- Enhanced the `initializeChat` function to derive `chat_id` from `message_id` when not provided, improving error handling and validation.
* remove .env import breaking build
* add updated at to the get chat handler
* zmall runtime error fix
* permission tests passing
* return updated at on the get chat handler now
* slq parser fixes
* Implement chat access control logic and add comprehensive tests
- Developed the `canUserAccessChat` function to determine user access to chats based on direct permissions, collection permissions, creator status, and organizational roles.
- Introduced helper functions for checking permissions and retrieving chat information.
- Added integration tests to validate access control logic, covering various scenarios including direct permissions, collection permissions, and user roles.
- Created unit tests to ensure the correctness of the access control function with mocked database interactions.
- Included simple integration tests to verify functionality with existing database data.
* sql parser and int tests working.
* fix test and lint issues
* comment to kick off deployment lo
* access controls on datasets
* electric context bug fix with sql helpers.
* permission and read only
* Add lru-cache dependency and export cache management functions
- Added `lru-cache` as a dependency in the access-controls package.
- Exported new cache management functions from `chats-cached` module, including `canUserAccessChatCached`, `getCacheStats`, `resetCacheStats`, `clearCache`, `invalidateAccess`, `invalidateUserAccess`, and `invalidateChatAccess`.
* packages deploy as well
* wrong workflow lol
* Update AppVerticalCodeSplitter.tsx
* Add error handling for query run and SQL save operations
Co-authored-by: natemkelley <natemkelley@gmail.com>
* Trim whitespace from input values before sending chat prompts
Co-authored-by: natemkelley <natemkelley@gmail.com>
* type in think-and-prep
* use the cached access chat
* update package version
* new asset import message
* Error fallback for login
* Update BusterChart.BarChart.stories.tsx
* Staging changes to fix number card titles, combo chart axis, and using dynamic filters (#386)
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
* db init command pass through
* combo chart fixes (#387)
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
* clarifying question and connection logic
* pino pretty error fix
* clarifying is a finishing tool
* change update latest version logic
* Update support endpoint
* fixes for horizontal bar charts and added the combo chart logic to update metrics (#388)
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
* permission fix on dashboard metric handlers for workspace and data admin
* Add more try catches
* Hide avatar is no more
* Horizontal bar fixes (#389)
* fixes for horizontal bar charts and added the combo chart logic to update metrics
* hopefully fixed horizontal bar charts
---------
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
* reasoning shimmer update
* Make the embed flow work with versions
* new account warning update
* Move support modal
* compact number for pie label
* Add final reasoning message tracking and workflow start time to chunk processor and related steps
- Introduced `finalReasoningMessage` to schemas in `analyst-step`, `mark-message-complete-step`, and `create-todos-step`.
- Updated `ChunkProcessor` to calculate and store the final reasoning message based on workflow duration.
- Enhanced various steps to utilize the new `workflowStartTime` for better tracking of execution duration.
- Improved database update logic to include `finalReasoningMessage` when applicable.
* 9 digit cutoff for pie
* trigger update
* test on mastra braintrust
* test deployment
* testing
* pnpm install
* pnpm
* node 22
* pnpm version
* trigger main
* get initial chat file
* hono main deploymenbt
* clear timeouts
* Remove console logs
* migration test to staging
* db url
* try again
* k get rid of tls var
* hmmm lets try this
* mark migrations
* fix migration file?
* drizzle-kit upgrade
* tweaks to the github actions
---------
Co-authored-by: Nate Kelley <nate@buster.so>
Co-authored-by: porter-deployment-app[bot] <87230664+porter-deployment-app[bot]@users.noreply.github.com>
Co-authored-by: Nate Kelley <133379588+nate-kelley-buster@users.noreply.github.com>
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
Co-authored-by: jacob-buster <jacob@buster.so>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: natemkelley <natemkelley@gmail.com>
2025-07-03 05:33:40 +08:00
|
|
|
return {
|
|
|
|
isReadOnly: true,
|
2025-07-07 23:57:04 +08:00
|
|
|
queryType: 'select',
|
Mastra braintrust (#391)
* type fixes
* biome clean on ai
* add user to flag chat
* attempt to get vercel deployed
* Update tsup.config.ts
* Update pnpm-lock.yaml
* Add @buster/server2 Hono API app with Vercel deployment configuration
* slack oauth integration
* mainly some clean up and biome formatting
* slack oauth
* slack migration + snapshot
* remove unused files
* finalized docker image for porter
* Create porter_app_buster-server_3155.yml file
* Add integration tests for Slack handler and refactor Slack OAuth service
- Introduced integration tests for the Slack handler, covering OAuth initiation, callback handling, and integration status retrieval.
- Refactored Slack OAuth service to improve error handling and ensure proper integration state management.
- Updated token storage implementation to use a database vault instead of Supabase.
- Enhanced existing tests for better coverage and reliability, including cleanup of test data.
- Added new utility functions for managing vault secrets in the database.
* docker image update
* new prompts
* individual tests and a schema fix
* server build
* final working dockerfile
* Update Dockerfile
* new messages to slack messages (#369)
* Update dockerfile
* Update validate-env.js
* update build pipeline
* Update the dockerfile flow
* finalize logging for pino
* stable base
* Update cors middleware logger
* Update cors.ts
* update docker to be more imformative
* Update index.ts
* Update auth.ts
* Update cors.ts
* Update cors.ts
* Update logger.ts
* remove logs
* more cors updates
* build server shared
* Refactor PostgreSQL credentials handling and remove unused memory storage. Update package dependencies. (#370)
* tons of file parsing errors (#371)
* Refactor PostgreSQL credentials handling and remove unused memory storage. Update package dependencies.
* tons of file parsing errors
* Dev mode updates
* more stable electric handler
* Dal/agent-self-healing-fixes (#372)
* change to 6 min
* optmizations around saving and non-blocking actions.
* stream optimizations
* Dal/agent-self-healing-fixes (#373)
* change to 6 min
* optmizations around saving and non-blocking actions.
* stream optimizations
* change porter staging deploy to mastra-braintrust.
* new path for porter deploy
* deploy to staging fix
* Create porter_app_mastra-braintrust-api_3155.yml file (#375)
Co-authored-by: porter-deployment-app[bot] <87230664+porter-deployment-app[bot]@users.noreply.github.com>
* Update sizing and opacity
* supe up the instance for mastra
* environment staging
* ssl script
* copy path
* Update list padding
* no throttle and the anthropic cached
* move select to the top
* Update margin inline start
* shrink reasoning vertical space to 2px
* semi bold font for headers
* update animation timing
* haiku
* Add createTodoList tool and integrate into create-todos-step
* chat helper on post chat
* only trigger cicd when change made
* Start created streaming text components
* Refactor analyst agent task to initialize Braintrust logging asynchronously and parallelize database queries for improved performance. Adjusted cleanup timeout for Braintrust traces to reduce delays.
* fixed reasoned for X, so that it rounds down to the minute
* Update users page
* update build pipeline for new web
* document title update
* Named chats for page
* Datasets titles
* Refactor visualization tools and enhance error handling in retryable agent stream. Removed unused metricValueLabel from metrics file tool, updated metric configuration schemas, and improved healing mechanism for tool errors during streaming.
* analyst
* document title updates
* Update useDocumentTitle.tsx
* Refactor tool choice configuration in create-todos-step to use structured object. Remove exponential backoff logic from retryable agent stream for healable errors. Introduce new test for real-world healing scenarios in retryable agent stream.
* Refactor SQL validation logic in modify-metrics-file-tool to skip unnecessary checks when SQL has not changed. Enhance error handling and update validation messages. Clean up code formatting for improved readability.
* update collapse for filecard
* chevron collapse
* Jacob prompt changes (#376)
* prompt changes to improve filtering logic and handle priv/sec errors
* prompt changes to make aggregation better and improved filter best practices
* Update packages/ai/src/steps/create-todos-step.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* Update packages/ai/src/agents/think-and-prep-agent/think-and-prep-instructions.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* Update packages/ai/src/steps/create-todos-step.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
---------
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
Co-authored-by: dal <dallin@buster.so>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* think and prep
* change header and strong fonts weights
* Update get collection
* combo chart x axis update
* Create a chart schemas as types
* schema types
* simple unit tests for line chart props
* fix the response file ordering iwth active selection.
* copy around reasoning messages taken care of
* fix nullable user message and file processing and such.
* update ticks for chart config
* fix todo parsing.
* app markdown update
* Update splitter to use border instead of width
* change ml
* If no file is found we should auto redirect
* Refactor database connection handling to support SSL modes. Introduced functions to extract SSL parameters and manage connections based on SSL requirements, including a custom verifier for unverified connections.
* black box message update
* chat title updates
* optimizations for trigger.
* some keepalive logic on the anthropic cached
* keep title empty until new one
* no duplicate messages
* null user message on asset pull
* posthog error handling
* 20 sec idle timeout on anthropic
* null req message
* fixed modificiation names missing
* Refactor tool call handling to support new content array format in asset messages and context loaders
* cache most recent file from workflow
* Enhance date and number detection in createDataMetadata function to improve data type handling for metrics files
* group hover effect for message
* logging for chat
* Add messageId handling and file association tracking in dashboard and metrics tools
- Updated runtime context to include messageId in create and modify dashboard and metrics file tools.
- Implemented file association tracking based on messageId in create and modify functions for both dashboards and metrics.
- Ensured type consistency by using AnalystRuntimeContext in runtime context parameters.
* logging for chat
* message type update
* Route to first file instead
* trigger moved to catalog
* Enhance file selection logic to support YAML parsing and improve logging
- Updated `extractMetricIdsFromDashboard` to first attempt JSON parsing, falling back to a regex-based YAML parsing for metric IDs.
- Added detailed debug logging in `selectFilesForResponse` to track file selection process, including metrics and dashboards involved.
- Introduced tests for various scenarios in `file-selection.test.ts` to ensure correct behavior with dashboard context and edge cases.
* trigger dev v4-beta
* Retry + Self Healing (#381)
* Refactor retry logic in analyst and think-and-prep steps
Co-authored-by: dallin <dallin@buster.so>
* some fixes
* console log error
* self healing
* todos retry
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* remove lots of logs
* Remove chat streaming
* Remove chat streaming
* timeout
* Change to updated at field
* link to home
* Update timeout settings for HTTP and HTTPS agents from 20 seconds to 10 seconds for improved responsiveness.
* Add utils module and integrate message conversion in post_chat_handler
* Implement error handling for extract values (#382)
* Remove chat streaming
* Improve error handling and logging in extract values and chat title steps
Co-authored-by: dallin <dallin@buster.so>
---------
Co-authored-by: Nate Kelley <nate@buster.so>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* loading icon for buster avatar
* finalize tooltip cache
* upgrade mastra
* increase retries
* Add redo functionality for chat messages
- Introduced `redoFromMessageId` parameter in `handleExistingChat` to allow users to specify a message to redo from.
- Implemented validation to ensure the specified message belongs to the current chat.
- Added `softDeleteMessagesFromPoint` function to soft delete a message and all subsequent messages in the same chat, facilitating the redo feature.
* fix electric potential memory leak
* tooltip cache and chart cleanup
* Update bullet to be more indented
* latest version number
* add support endpoint to new server
* Fix jank in combo bar charts
* index check for dashboard
* Collapse only if there are metrics
* Is finished reasoing back
* Update dependencies and enhance chat message handling
- Upgraded `@mastra/core` to version 0.10.8 and added `node-sql-parser` at version 5.3.10 in the lock file.
- Improved integration tests for chat message redo functionality, ensuring correct behavior when deriving `chat_id` from `message_id`.
- Enhanced error handling and validation in the `initializeChat` function to manage cases where `chat_id` is not provided.
* Update pnpm-lock and enhance chat message integration tests
- Added `node-sql-parser` version 5.3.10 to dependencies and updated the lock file.
- Improved integration tests for chat message redo functionality, ensuring accurate deletion and retrieval of messages.
- Enhanced the `initializeChat` function to derive `chat_id` from `message_id` when not provided, improving error handling and validation.
* remove .env import breaking build
* add updated at to the get chat handler
* zmall runtime error fix
* permission tests passing
* return updated at on the get chat handler now
* slq parser fixes
* Implement chat access control logic and add comprehensive tests
- Developed the `canUserAccessChat` function to determine user access to chats based on direct permissions, collection permissions, creator status, and organizational roles.
- Introduced helper functions for checking permissions and retrieving chat information.
- Added integration tests to validate access control logic, covering various scenarios including direct permissions, collection permissions, and user roles.
- Created unit tests to ensure the correctness of the access control function with mocked database interactions.
- Included simple integration tests to verify functionality with existing database data.
* sql parser and int tests working.
* fix test and lint issues
* comment to kick off deployment lo
* access controls on datasets
* electric context bug fix with sql helpers.
* permission and read only
* Add lru-cache dependency and export cache management functions
- Added `lru-cache` as a dependency in the access-controls package.
- Exported new cache management functions from `chats-cached` module, including `canUserAccessChatCached`, `getCacheStats`, `resetCacheStats`, `clearCache`, `invalidateAccess`, `invalidateUserAccess`, and `invalidateChatAccess`.
* packages deploy as well
* wrong workflow lol
* Update AppVerticalCodeSplitter.tsx
* Add error handling for query run and SQL save operations
Co-authored-by: natemkelley <natemkelley@gmail.com>
* Trim whitespace from input values before sending chat prompts
Co-authored-by: natemkelley <natemkelley@gmail.com>
* type in think-and-prep
* use the cached access chat
* update package version
* new asset import message
* Error fallback for login
* Update BusterChart.BarChart.stories.tsx
* Staging changes to fix number card titles, combo chart axis, and using dynamic filters (#386)
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
* db init command pass through
* combo chart fixes (#387)
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
* clarifying question and connection logic
* pino pretty error fix
* clarifying is a finishing tool
* change update latest version logic
* Update support endpoint
* fixes for horizontal bar charts and added the combo chart logic to update metrics (#388)
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
* permission fix on dashboard metric handlers for workspace and data admin
* Add more try catches
* Hide avatar is no more
* Horizontal bar fixes (#389)
* fixes for horizontal bar charts and added the combo chart logic to update metrics
* hopefully fixed horizontal bar charts
---------
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
* reasoning shimmer update
* Make the embed flow work with versions
* new account warning update
* Move support modal
* compact number for pie label
* Add final reasoning message tracking and workflow start time to chunk processor and related steps
- Introduced `finalReasoningMessage` to schemas in `analyst-step`, `mark-message-complete-step`, and `create-todos-step`.
- Updated `ChunkProcessor` to calculate and store the final reasoning message based on workflow duration.
- Enhanced various steps to utilize the new `workflowStartTime` for better tracking of execution duration.
- Improved database update logic to include `finalReasoningMessage` when applicable.
* 9 digit cutoff for pie
* trigger update
* test on mastra braintrust
* test deployment
* testing
* pnpm install
* pnpm
* node 22
* pnpm version
* trigger main
* get initial chat file
* hono main deploymenbt
* clear timeouts
* Remove console logs
* migration test to staging
* db url
* try again
* k get rid of tls var
* hmmm lets try this
* mark migrations
* fix migration file?
* drizzle-kit upgrade
* tweaks to the github actions
---------
Co-authored-by: Nate Kelley <nate@buster.so>
Co-authored-by: porter-deployment-app[bot] <87230664+porter-deployment-app[bot]@users.noreply.github.com>
Co-authored-by: Nate Kelley <133379588+nate-kelley-buster@users.noreply.github.com>
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
Co-authored-by: jacob-buster <jacob@buster.so>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: natemkelley <natemkelley@gmail.com>
2025-07-03 05:33:40 +08:00
|
|
|
};
|
|
|
|
} catch (error) {
|
|
|
|
return {
|
|
|
|
isReadOnly: false,
|
2025-07-07 23:57:04 +08:00
|
|
|
error: `Failed to parse SQL for query type check: ${error instanceof Error ? error.message : 'Unknown error'}`,
|
Mastra braintrust (#391)
* type fixes
* biome clean on ai
* add user to flag chat
* attempt to get vercel deployed
* Update tsup.config.ts
* Update pnpm-lock.yaml
* Add @buster/server2 Hono API app with Vercel deployment configuration
* slack oauth integration
* mainly some clean up and biome formatting
* slack oauth
* slack migration + snapshot
* remove unused files
* finalized docker image for porter
* Create porter_app_buster-server_3155.yml file
* Add integration tests for Slack handler and refactor Slack OAuth service
- Introduced integration tests for the Slack handler, covering OAuth initiation, callback handling, and integration status retrieval.
- Refactored Slack OAuth service to improve error handling and ensure proper integration state management.
- Updated token storage implementation to use a database vault instead of Supabase.
- Enhanced existing tests for better coverage and reliability, including cleanup of test data.
- Added new utility functions for managing vault secrets in the database.
* docker image update
* new prompts
* individual tests and a schema fix
* server build
* final working dockerfile
* Update Dockerfile
* new messages to slack messages (#369)
* Update dockerfile
* Update validate-env.js
* update build pipeline
* Update the dockerfile flow
* finalize logging for pino
* stable base
* Update cors middleware logger
* Update cors.ts
* update docker to be more imformative
* Update index.ts
* Update auth.ts
* Update cors.ts
* Update cors.ts
* Update logger.ts
* remove logs
* more cors updates
* build server shared
* Refactor PostgreSQL credentials handling and remove unused memory storage. Update package dependencies. (#370)
* tons of file parsing errors (#371)
* Refactor PostgreSQL credentials handling and remove unused memory storage. Update package dependencies.
* tons of file parsing errors
* Dev mode updates
* more stable electric handler
* Dal/agent-self-healing-fixes (#372)
* change to 6 min
* optmizations around saving and non-blocking actions.
* stream optimizations
* Dal/agent-self-healing-fixes (#373)
* change to 6 min
* optmizations around saving and non-blocking actions.
* stream optimizations
* change porter staging deploy to mastra-braintrust.
* new path for porter deploy
* deploy to staging fix
* Create porter_app_mastra-braintrust-api_3155.yml file (#375)
Co-authored-by: porter-deployment-app[bot] <87230664+porter-deployment-app[bot]@users.noreply.github.com>
* Update sizing and opacity
* supe up the instance for mastra
* environment staging
* ssl script
* copy path
* Update list padding
* no throttle and the anthropic cached
* move select to the top
* Update margin inline start
* shrink reasoning vertical space to 2px
* semi bold font for headers
* update animation timing
* haiku
* Add createTodoList tool and integrate into create-todos-step
* chat helper on post chat
* only trigger cicd when change made
* Start created streaming text components
* Refactor analyst agent task to initialize Braintrust logging asynchronously and parallelize database queries for improved performance. Adjusted cleanup timeout for Braintrust traces to reduce delays.
* fixed reasoned for X, so that it rounds down to the minute
* Update users page
* update build pipeline for new web
* document title update
* Named chats for page
* Datasets titles
* Refactor visualization tools and enhance error handling in retryable agent stream. Removed unused metricValueLabel from metrics file tool, updated metric configuration schemas, and improved healing mechanism for tool errors during streaming.
* analyst
* document title updates
* Update useDocumentTitle.tsx
* Refactor tool choice configuration in create-todos-step to use structured object. Remove exponential backoff logic from retryable agent stream for healable errors. Introduce new test for real-world healing scenarios in retryable agent stream.
* Refactor SQL validation logic in modify-metrics-file-tool to skip unnecessary checks when SQL has not changed. Enhance error handling and update validation messages. Clean up code formatting for improved readability.
* update collapse for filecard
* chevron collapse
* Jacob prompt changes (#376)
* prompt changes to improve filtering logic and handle priv/sec errors
* prompt changes to make aggregation better and improved filter best practices
* Update packages/ai/src/steps/create-todos-step.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* Update packages/ai/src/agents/think-and-prep-agent/think-and-prep-instructions.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* Update packages/ai/src/steps/create-todos-step.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
---------
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
Co-authored-by: dal <dallin@buster.so>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* think and prep
* change header and strong fonts weights
* Update get collection
* combo chart x axis update
* Create a chart schemas as types
* schema types
* simple unit tests for line chart props
* fix the response file ordering iwth active selection.
* copy around reasoning messages taken care of
* fix nullable user message and file processing and such.
* update ticks for chart config
* fix todo parsing.
* app markdown update
* Update splitter to use border instead of width
* change ml
* If no file is found we should auto redirect
* Refactor database connection handling to support SSL modes. Introduced functions to extract SSL parameters and manage connections based on SSL requirements, including a custom verifier for unverified connections.
* black box message update
* chat title updates
* optimizations for trigger.
* some keepalive logic on the anthropic cached
* keep title empty until new one
* no duplicate messages
* null user message on asset pull
* posthog error handling
* 20 sec idle timeout on anthropic
* null req message
* fixed modificiation names missing
* Refactor tool call handling to support new content array format in asset messages and context loaders
* cache most recent file from workflow
* Enhance date and number detection in createDataMetadata function to improve data type handling for metrics files
* group hover effect for message
* logging for chat
* Add messageId handling and file association tracking in dashboard and metrics tools
- Updated runtime context to include messageId in create and modify dashboard and metrics file tools.
- Implemented file association tracking based on messageId in create and modify functions for both dashboards and metrics.
- Ensured type consistency by using AnalystRuntimeContext in runtime context parameters.
* logging for chat
* message type update
* Route to first file instead
* trigger moved to catalog
* Enhance file selection logic to support YAML parsing and improve logging
- Updated `extractMetricIdsFromDashboard` to first attempt JSON parsing, falling back to a regex-based YAML parsing for metric IDs.
- Added detailed debug logging in `selectFilesForResponse` to track file selection process, including metrics and dashboards involved.
- Introduced tests for various scenarios in `file-selection.test.ts` to ensure correct behavior with dashboard context and edge cases.
* trigger dev v4-beta
* Retry + Self Healing (#381)
* Refactor retry logic in analyst and think-and-prep steps
Co-authored-by: dallin <dallin@buster.so>
* some fixes
* console log error
* self healing
* todos retry
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* remove lots of logs
* Remove chat streaming
* Remove chat streaming
* timeout
* Change to updated at field
* link to home
* Update timeout settings for HTTP and HTTPS agents from 20 seconds to 10 seconds for improved responsiveness.
* Add utils module and integrate message conversion in post_chat_handler
* Implement error handling for extract values (#382)
* Remove chat streaming
* Improve error handling and logging in extract values and chat title steps
Co-authored-by: dallin <dallin@buster.so>
---------
Co-authored-by: Nate Kelley <nate@buster.so>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* loading icon for buster avatar
* finalize tooltip cache
* upgrade mastra
* increase retries
* Add redo functionality for chat messages
- Introduced `redoFromMessageId` parameter in `handleExistingChat` to allow users to specify a message to redo from.
- Implemented validation to ensure the specified message belongs to the current chat.
- Added `softDeleteMessagesFromPoint` function to soft delete a message and all subsequent messages in the same chat, facilitating the redo feature.
* fix electric potential memory leak
* tooltip cache and chart cleanup
* Update bullet to be more indented
* latest version number
* add support endpoint to new server
* Fix jank in combo bar charts
* index check for dashboard
* Collapse only if there are metrics
* Is finished reasoing back
* Update dependencies and enhance chat message handling
- Upgraded `@mastra/core` to version 0.10.8 and added `node-sql-parser` at version 5.3.10 in the lock file.
- Improved integration tests for chat message redo functionality, ensuring correct behavior when deriving `chat_id` from `message_id`.
- Enhanced error handling and validation in the `initializeChat` function to manage cases where `chat_id` is not provided.
* Update pnpm-lock and enhance chat message integration tests
- Added `node-sql-parser` version 5.3.10 to dependencies and updated the lock file.
- Improved integration tests for chat message redo functionality, ensuring accurate deletion and retrieval of messages.
- Enhanced the `initializeChat` function to derive `chat_id` from `message_id` when not provided, improving error handling and validation.
* remove .env import breaking build
* add updated at to the get chat handler
* zmall runtime error fix
* permission tests passing
* return updated at on the get chat handler now
* slq parser fixes
* Implement chat access control logic and add comprehensive tests
- Developed the `canUserAccessChat` function to determine user access to chats based on direct permissions, collection permissions, creator status, and organizational roles.
- Introduced helper functions for checking permissions and retrieving chat information.
- Added integration tests to validate access control logic, covering various scenarios including direct permissions, collection permissions, and user roles.
- Created unit tests to ensure the correctness of the access control function with mocked database interactions.
- Included simple integration tests to verify functionality with existing database data.
* sql parser and int tests working.
* fix test and lint issues
* comment to kick off deployment lo
* access controls on datasets
* electric context bug fix with sql helpers.
* permission and read only
* Add lru-cache dependency and export cache management functions
- Added `lru-cache` as a dependency in the access-controls package.
- Exported new cache management functions from `chats-cached` module, including `canUserAccessChatCached`, `getCacheStats`, `resetCacheStats`, `clearCache`, `invalidateAccess`, `invalidateUserAccess`, and `invalidateChatAccess`.
* packages deploy as well
* wrong workflow lol
* Update AppVerticalCodeSplitter.tsx
* Add error handling for query run and SQL save operations
Co-authored-by: natemkelley <natemkelley@gmail.com>
* Trim whitespace from input values before sending chat prompts
Co-authored-by: natemkelley <natemkelley@gmail.com>
* type in think-and-prep
* use the cached access chat
* update package version
* new asset import message
* Error fallback for login
* Update BusterChart.BarChart.stories.tsx
* Staging changes to fix number card titles, combo chart axis, and using dynamic filters (#386)
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
* db init command pass through
* combo chart fixes (#387)
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
* clarifying question and connection logic
* pino pretty error fix
* clarifying is a finishing tool
* change update latest version logic
* Update support endpoint
* fixes for horizontal bar charts and added the combo chart logic to update metrics (#388)
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
* permission fix on dashboard metric handlers for workspace and data admin
* Add more try catches
* Hide avatar is no more
* Horizontal bar fixes (#389)
* fixes for horizontal bar charts and added the combo chart logic to update metrics
* hopefully fixed horizontal bar charts
---------
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
* reasoning shimmer update
* Make the embed flow work with versions
* new account warning update
* Move support modal
* compact number for pie label
* Add final reasoning message tracking and workflow start time to chunk processor and related steps
- Introduced `finalReasoningMessage` to schemas in `analyst-step`, `mark-message-complete-step`, and `create-todos-step`.
- Updated `ChunkProcessor` to calculate and store the final reasoning message based on workflow duration.
- Enhanced various steps to utilize the new `workflowStartTime` for better tracking of execution duration.
- Improved database update logic to include `finalReasoningMessage` when applicable.
* 9 digit cutoff for pie
* trigger update
* test on mastra braintrust
* test deployment
* testing
* pnpm install
* pnpm
* node 22
* pnpm version
* trigger main
* get initial chat file
* hono main deploymenbt
* clear timeouts
* Remove console logs
* migration test to staging
* db url
* try again
* k get rid of tls var
* hmmm lets try this
* mark migrations
* fix migration file?
* drizzle-kit upgrade
* tweaks to the github actions
---------
Co-authored-by: Nate Kelley <nate@buster.so>
Co-authored-by: porter-deployment-app[bot] <87230664+porter-deployment-app[bot]@users.noreply.github.com>
Co-authored-by: Nate Kelley <133379588+nate-kelley-buster@users.noreply.github.com>
Co-authored-by: Jacob Anderson <jacobanderson@Jacobs-MacBook-Air.local>
Co-authored-by: jacob-buster <jacob@buster.so>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: natemkelley <natemkelley@gmail.com>
2025-07-03 05:33:40 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|