Skip to content

Commit

Permalink
Merge pull request #32 from BBai-Tips/staging
Browse files Browse the repository at this point in the history
BUI startDir preference and case-insensitive project searching
  • Loading branch information
cngarrison authored Sep 29, 2024
2 parents 9a1589d + 88a1aa0 commit 2bb15e5
Show file tree
Hide file tree
Showing 12 changed files with 149 additions and 73 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Deploy to Chat server

on:
push:
branches:
- main # or your default branch name
workflow_dispatch: # Allows manual triggering

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x # Use the latest Deno version

- name: Build site
run: |
cd bui/src/
deno task build
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SERVER_SSH_KEY }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}

- name: Deploy to Chat server
env:
HOST: site.bbai.tips
USER: deploy
DEPLOY_PATH: "/var/www/chat.bbai.tips/bbai/bui/src"
TEMP_DEPLOY_PATH: "/home/deploy/temp_deploy"
run: |
# Install rsync if not already installed
if ! command -v rsync &> /dev/null; then
sudo apt-get update
sudo apt-get install -y rsync
fi
ssh $USER@$HOST << EOF
# Create temporary directory for deployment
mkdir -p $TEMP_DEPLOY_PATH
EOF
# Deploy the built files to temporary directory
rsync -avz --delete bui/src/ $USER@$HOST:$TEMP_DEPLOY_PATH/
ssh $USER@$HOST << EOF
# Move files from temporary directory to final location
#echo rsync -avz --delete $TEMP_DEPLOY_PATH/ $DEPLOY_PATH/
sudo rsync -avz --delete $TEMP_DEPLOY_PATH/ $DEPLOY_PATH/
# Set correct ownership and permissions
#echo chown -R www-data:www-data $DEPLOY_PATH/
sudo chown -R www-data:www-data $DEPLOY_PATH/
#echo find $DEPLOY_PATH/ -type d -exec chmod 755 {} \;
sudo find $DEPLOY_PATH/ -type d -exec chmod 755 {} \;
#echo find $DEPLOY_PATH/ -type f -exec chmod 644 {} \;
sudo find $DEPLOY_PATH/ -type f -exec chmod 644 {} \;
# Clean up temporary directory
rm -rf $TEMP_DEPLOY_PATH
# Restart the service
sudo systemctl restart bbai-bui.service
EOF
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0



## [0.0.18-beta] - 2024-09-29

### Changed

- Changed BUI to prefer StartDir from URL
- Changed search project tool to default to case-insensitive and ignore git when searching


## [0.0.17-beta] - 2024-09-28

### Changed
Expand Down
2 changes: 1 addition & 1 deletion api/deno.jsonc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bbai-api",
"version": "0.0.17-beta",
"version": "0.0.18-beta",
"exports": "./src/main.ts",
"tasks": {
"start": "deno run --allow-read --allow-write --allow-run --allow-net --allow-env src/main.ts",
Expand Down
6 changes: 3 additions & 3 deletions api/src/llms/tools/searchProjectTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ export default class LLMToolSearchProject extends LLMTool {
caseSensitive: {
type: 'boolean',
description:
'Whether the `contentPattern` is a case sensitive regex. The default is true, to use case sensitive regex.',
default: true,
'Whether the `contentPattern` is a case sensitive regex. The default is false, to use case insensitive regex.',
default: false,
},
filePattern: {
type: 'string',
Expand Down Expand Up @@ -79,7 +79,7 @@ export default class LLMToolSearchProject extends LLMTool {
projectEditor: ProjectEditor,
): Promise<LLMToolRunResult> {
const { toolInput } = toolUse;
const { contentPattern, caseSensitive = true, filePattern, dateAfter, dateBefore, sizeMin, sizeMax } =
const { contentPattern, caseSensitive = false, filePattern, dateAfter, dateBefore, sizeMin, sizeMax } =
toolInput as {
contentPattern?: string;
caseSensitive?: boolean;
Expand Down
Loading

0 comments on commit 2bb15e5

Please sign in to comment.