Commit Graph

188 Commits

Author SHA1 Message Date
dal cd8a50403f
Merge branch 'staging' into dallin/bus-1419-enable-sharing-of-dashboards-or-collections-with-workspace 2025-07-17 17:16:07 -06:00
dal b6cf6539ea
Merge branch 'origin/staging' into dallin/bus-1380-fix-unit-tests - Resolved conflicts in CLAUDE.md 2025-07-17 16:52:03 -06:00
Nate Kelley d2cd4fb173
create default them component 2025-07-17 16:24:46 -06:00
dal cc2dd7fa61
Enhance workspace member count integration across various handlers and components
- Introduced `count_workspace_members` utility function to retrieve the number of active users in a workspace.
- Updated chat, collection, dashboard, and metric handlers to include `workspace_member_count` in their responses.
- Modified relevant types to accommodate the new `workspace_member_count` field.
- Adjusted frontend components to display the number of workspace members in the ShareMenu and related UI elements.

These changes improve the visibility of workspace member information and enhance the overall user experience.
2025-07-17 16:21:14 -06:00
dal 4e2b6c235e
Refactor workspace sharing permissions across assets
- Updated the `WorkspaceSharing` enum to use camelCase for serialization.
- Introduced `workspace_permissions` field in update requests for chats, collections, dashboards, and metrics.
- Implemented handling of workspace sharing permissions in respective update handlers, allowing for setting and removing permissions.
- Adjusted frontend components and API interfaces to align with the new `workspace_sharing` naming convention.

This change enhances the consistency and usability of workspace sharing across different asset types.
2025-07-17 15:26:26 -06:00
dal d9f9182ab2
ui components and return the values 2025-07-17 14:51:53 -06:00
Devin AI 077d6de476 feat(slack): implement scope validation and re-installation flow for BUS-1435
- Create centralized OAuth scopes constants file
- Add scope validation to integration status check
- Update OAuth flow to handle re-installations while preserving user settings
- Add yellow 'Re-install Required' button to UI when scopes don't match
- Implement proper error handling and rollback logic for failed re-installations

Co-Authored-By: Dallin Bentley <dallinbentley98@gmail.com>
2025-07-17 19:54:49 +00:00
Nate Kelley 5dd7b20f25
fix broken linting 2025-07-17 13:18:32 -06:00
Nate Kelley b8de7a5c51
update rules 2025-07-17 13:12:11 -06:00
Nate Kelley 16045ced49
Added readme and other stuff for cursor 2025-07-17 12:56:42 -06:00
Nate Kelley 7b24d167b9
hex values checking before insert into database 2025-07-17 12:17:34 -06:00
Nate Kelley ee8cce71f8
Add additional error handling for endpoint 2025-07-17 12:06:57 -06:00
Nate Kelley e55632e074
initial commits for update org 2025-07-17 11:41:31 -06:00
Nate Kelley be6b510685
Merge branch 'staging' into big-nate/bus-1424-default-color-palette-in-workspace-settings 2025-07-17 10:51:17 -06:00
Nate Kelley f725ef9386
add avatar urls to the share 2025-07-17 10:50:49 -06:00
Nate Kelley 3bf3a324aa
equality check example 2025-07-17 10:25:53 -06:00
Nate Kelley 54feda404a
update type checking 2025-07-17 10:05:50 -06:00
Nate Kelley 06d8c1e568
Merge pull request #527 from buster-so/big-nate/bus-1420-add-searchable-menu-to-share-dropdowns
add searchable menu to share dropdowns
2025-07-16 23:48:44 -06:00
Nate Kelley 0be0744bd0
share update 2025-07-16 23:46:34 -06:00
Nate Kelley a24779d40f
Query request in line 2025-07-16 23:01:49 -06:00
dal da380485d9
added in the slack auto-sharing functionality 2025-07-16 16:54:09 -06:00
Nate Kelley bc5b0e4f84
update select 2025-07-16 14:48:33 -06:00
dal d4f216cb66
Merge remote-tracking branch 'origin/staging' into dallin/bus-1363-slack-agent-query-buster-from-slack-direct-query 2025-07-16 12:54:18 -06:00
Nate Kelley f11afec05a
query params update for cursor rules 2025-07-16 10:13:30 -06:00
Nate Kelley a032a966f8
make generic handler 2025-07-16 09:59:30 -06:00
Nate Kelley 0d01dfcb4c
array parter 2025-07-16 09:54:28 -06:00
Nate Kelley d9ed8b1423
finalize pagination endpoint 2025-07-16 09:25:51 -06:00
Nate Kelley fdf70abfb8
update database dev 2025-07-15 22:26:13 -06:00
Nate Kelley 094fc4c251
add pagination type responses 2025-07-15 17:23:32 -06:00
Nate Kelley fb0e79065f
udpate endpoint to accept more params 2025-07-15 16:54:18 -06:00
dal a751d22baa
initial slack challenge verification and receive messages 2025-07-14 16:08:01 -06:00
Nate Kelley 727e66a630
Fix files on lint 2025-07-14 14:30:07 -06:00
dal 69da316f6c
Merge remote-tracking branch 'origin/staging' into dallin/bus-1380-fix-unit-tests 2025-07-14 12:37:15 -06:00
dal 5a971dd8a1
fix on access-control tests 2025-07-14 11:01:53 -06:00
Nate Kelley 5352ae8f10
currency response 2025-07-14 09:41:25 -06:00
dal 2be9784516
Add unit and integration test scripts to package.json files across multiple packages 2025-07-14 09:11:20 -06:00
Nate Kelley 963bf6b2f2
fix all of the bugs 2025-07-12 22:14:08 -06:00
Nate Kelley 4810daef9f
Update packages/server-shared/src/type-utilities/index.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2025-07-12 16:33:53 -06:00
Nate Kelley 5448af614a
lint fixes 👀 2025-07-12 16:32:47 -06:00
Nate Kelley aeaf7dbb57
type updates 2025-07-12 16:19:08 -06:00
Nate Kelley 2c2bf74475
Add prebuild script to server-shared 2025-07-12 16:07:55 -06:00
Nate Kelley d8e0146978
create a db utilities 2025-07-12 15:48:42 -06:00
dal 10431a81d3
add has_more_records to the server shared type 2025-07-11 15:30:53 -06:00
dal 87f3853ce8
stubbed out the cancel endpoint and added the trigger run col 2025-07-10 16:26:30 -06:00
Nate Kelley e7ee256072
move shared to be zod v4 2025-07-10 12:16:34 -06:00
Nate Kelley 7b9892129c
update imports and type checks 2025-07-10 10:52:21 -06:00
dal 4d7f1353ff
clean up tyeps 2025-07-10 07:52:41 -06:00
dal 3ca54c7f28
Refactor integration tests for domain management and workspace settings. Update error messages for permission checks to be more specific. Enhance domain handling logic for consistency and improve test cleanup procedures. 2025-07-10 07:45:04 -06:00
dal 29e6a6ae7f
Workspace Settings Done with auto-add 2025-07-10 07:01:23 -06:00
dal c047d7dd40
Refactor security API handlers to improve organization validation and domain management. Consolidate permission checks and domain operations into utility functions for better code reuse. Update endpoint routes for workspace settings and approved domains, ensuring consistent response formatting. 2025-07-10 05:30:10 -06:00
Nate Kelley c223309df2
Add slack integration endpoints 2025-07-09 14:08:29 -06:00
Nate Kelley 821ed90083
initial slack build out (no apis) 2025-07-09 11:52:33 -06:00
Nate Kelley e22a795326
Add additinal fixes 2025-07-09 11:06:25 -06:00
Nate Kelley 26d77fef53
create workspace settings 2025-07-09 10:58:51 -06:00
Nate Kelley 59e6aacd9d
part 1 of making workspace toggles 2025-07-09 09:42:16 -06:00
Nate Kelley 46c3fccb9b
invite link updates 2025-07-08 17:20:31 -06:00
Nate Kelley 9bd7824586
create security endpoints strucutre 2025-07-08 16:48:13 -06:00
Nate Kelley 7d22c42141
Move organization user to a server type 2025-07-08 15:06:17 -06:00
Nate Kelley 8850b1ffd8
Assumption cards 2025-07-08 12:54:18 -06:00
dal f21690acc0
added in the server shared types for post-processing and moved the type into shared from trigger. 2025-07-08 11:14:30 -06:00
Nate Kelley 6b437d8737
post processing messages 2025-07-08 10:12:51 -06:00
Nate Kelley f4c2515f25
truncate metric headers and values 2025-07-08 09:46:51 -06:00
Nate Kelley aabb6908d7
move types to be on server 2025-07-07 22:26:42 -06:00
Nate Kelley 4e888f9506
Merge pull request #427 from buster-so/big-nate/bus-1181-point-to-google-workspace-profile-pics
Big nate/bus 1181 point to google workspace profile pics
2025-07-07 16:17:54 -06:00
Nate Kelley 2a6bd2f5a8
avatar passthrough 2025-07-07 16:15:10 -06:00
Nate Kelley 0331be1cda
verification pass through avatar url 2025-07-07 15:53:18 -06:00
Nate Kelley 6d02d8900f
move types to server 2025-07-07 15:43:47 -06:00
Cursor Agent 76b18c8765 Convert Slack response types to Zod schemas for runtime validation
Co-authored-by: dallin <dallin@buster.so>
2025-07-07 20:02:29 +00:00
Nate Kelley ebff254da0
Update some zod types 2025-07-07 13:19:53 -06:00
Nate Kelley ba6d1fe043
Fix broken unit tests 2025-07-07 10:28:32 -06:00
Nate Kelley 5d532a2957
additional lint fixes 2025-07-07 10:12:31 -06:00
Nate Kelley 9637fbad86
Fix additional linting errors 2025-07-07 09:18:31 -06:00
Nate Kelley 0b5c8cb2e1
Merge pull request #418 from buster-so/cursor/create-unit-tests-for-schema-defaults-b3ac
Add comprehensive test suites for shared server type schemas
2025-07-07 08:30:12 -06:00
Nate Kelley 02a0986393
Update metric.types.test.ts 2025-07-07 08:29:49 -06:00
Nate Kelley 90461c15b5
Merge branch 'staging' into nate/dashboard-links 2025-07-07 08:17:37 -06:00
Cursor Agent 43873df729 Add comprehensive test suites for shared server type schemas
Co-authored-by: natemkelley <natemkelley@gmail.com>
2025-07-04 13:52:26 +00:00
Nate Kelley c99f95c542
Update chatConfig.defaults.test.ts 2025-07-04 07:34:11 -06:00
Nate Kelley 0d114ee850
Add some unit tests 2025-07-04 01:38:58 -06:00
Nate Kelley 043d2654b0
Move default to individual packages 2025-07-04 01:26:25 -06:00
Nate Kelley 847ea87dde
Export issues resolved 2025-07-04 01:17:35 -06:00
Nate Kelley db66177c62
dashboard type changes 2025-07-03 17:10:08 -06:00
dal 0aa711f599
switch to snake_case 2025-07-03 17:07:13 -06:00
Nate Kelley 2a8db894a3
additional fixes to chart types 2025-07-03 16:52:53 -06:00
dal f5eb9496c5
Refactor Slack handler to utilize shared types and remove local schema definitions 2025-07-03 16:23:59 -06:00
Cursor Agent 3a3836761f Add Slack integration request and response type definitions
Co-authored-by: dallin <dallin@buster.so>
2025-07-03 22:04:11 +00:00
Nate Kelley 4cdde9203f
update server shared to include new types 2025-07-03 15:54:31 -06:00
Nate Kelley 7364f328d4
added additional server shared types 2025-07-03 14:33:55 -06:00
dal 58f9d261e6
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-02 14:33:40 -07:00