Skip to content

Commit 2cdd362

Browse files
gregmeldrumRohanSreeleshgithub-actions[bot]actions-userartyom-morozov
authored
AI-772: Push web dev branch to main (#18)
* Update the use effect for darkmode in authcallback * Update readme * Update ci to run on dev branch * chore: update built files * Fix token refresh issue (#4) * AI-542 and AI-595: HTML/Mermaid rendering + new preview panel + new status message display (#7) * Responsive file panel * Make it more responsive * Working html rendering * Working mermaid rendering * Add a run button to directly render supported content * html + mermaid rendering * Update rendering components * Fix scroll arrow positioning relative to preview * standardize imports * Cleanup * Cleanup + close preview panel on new session * Improve file handling * chore: update built files * AI-628: Add UTF-8 support in rendering (#8) * Add helper for decoding base 64 content * Revert file row changes * chore: update built files * chore: Revert static files for release (#10) * Release 0.1.1 (#5) * Update the use effect for darkmode in authcallback * Update readme * Update ci to run on dev branch * chore: update built files * Fix token refresh issue (#4) --------- * [ci skip] Bump version to 0.1.1 * Revert all static files to main for release --------- Co-authored-by: GitHub Action <action@github.com> * Fix base64 rendering (#11) * Fix raw base 64 rendering * Address sonarqube changes * chore: update built files * Update logo to new SAM logo (#13) * Update logo * Revert static files for release * Fix conflicts for release (#15) * Release 0.1.1 (#5) * Update the use effect for darkmode in authcallback * Update readme * Update ci to run on dev branch * chore: update built files * Fix token refresh issue (#4) --------- * [ci skip] Bump version to 0.1.1 * Release 0.2.0 (#9) * Update the use effect for darkmode in authcallback * Update readme * Update ci to run on dev branch * chore: update built files * Fix token refresh issue (#4) * AI-542 and AI-595: HTML/Mermaid rendering + new preview panel + new status message display (#7) * Responsive file panel * Make it more responsive * Working html rendering * Working mermaid rendering * Add a run button to directly render supported content * html + mermaid rendering * Update rendering components * Fix scroll arrow positioning relative to preview * standardize imports * Cleanup * Cleanup + close preview panel on new session * Improve file handling * chore: update built files * AI-628: Add UTF-8 support in rendering (#8) * Add helper for decoding base 64 content * Revert file row changes * chore: update built files * chore: Revert static files for release (#10) * Release 0.1.1 (#5) * Update the use effect for darkmode in authcallback * Update readme * Update ci to run on dev branch * chore: update built files * Fix token refresh issue (#4) --------- * [ci skip] Bump version to 0.1.1 * Revert all static files to main for release --------- Co-authored-by: GitHub Action <action@github.com> --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: GitHub Action <action@github.com> * chore: update built files * [ci skip] Bump version to 0.2.0 --------- Co-authored-by: GitHub Action <action@github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * chore(DATAGO-98386): set min python version to 3.10.16 (#6) * chore(DATAGO-96612): set min python version to 3.11 * Add static files to gitignore * Use custom build scripts for static assets * remove package-lock from .gitignore * include lock file * use updated reusable workflow * use main * use 3.10.16 as min version * bump max version * Fix localhost cors bug (#16) --------- Co-authored-by: RohanSreelesh <Rohansreelesh02@gmail.com> Co-authored-by: Rohan <31416057+RohanSreelesh@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: GitHub Action <action@github.com> Co-authored-by: Art Morozov <art.morozov@solace.com>
1 parent 22d990d commit 2cdd362

File tree

10 files changed

+19722
-60
lines changed

10 files changed

+19722
-60
lines changed

.github/workflows/ci.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ on:
77
types: [opened, synchronize]
88

99
permissions:
10+
repository-projects: read
11+
contents: write
1012
id-token: write
13+
packages: write
1114
checks: write
1215
pull-requests: write
13-
contents: write
1416

1517
jobs:
1618
ci:
@@ -19,6 +21,9 @@ jobs:
1921
min-python-version: "3.10"
2022
whitesource_product_name: "solace-ai-connector-web"
2123
whitesource_config_file: "wss-unified-agent.config"
24+
npm_package_path: src/solace_ai_connector_web/frontend
25+
node_version: 20
26+
npm_lock_file: package-lock.json
2227
secrets:
2328
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
2429
SONAR_HOST_URL: ${{ secrets.SONARQUBE_HOST_URL }}

.github/workflows/commit_build_files_push.yaml

Lines changed: 0 additions & 47 deletions
This file was deleted.

.github/workflows/release.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,17 @@ permissions:
1515
id-token: write
1616
checks: write
1717
contents: write
18+
packages: write
1819

1920
jobs:
2021
release:
2122
uses: SolaceDev/solace-public-workflows/.github/workflows/hatch_release_pypi.yml@main
2223
with:
2324
ENVIRONMENT: pypi
2425
version: ${{ github.event.inputs.version }}
26+
npm_package_path: src/solace_ai_connector_web/frontend
27+
node_version: 20
28+
npm_lock_file: package-lock.json
2529
pypi-project: solace-ai-connector-web
2630
secrets:
2731
COMMIT_KEY: ${{ secrets.COMMIT_KEY }}

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ node_modules
55
build
66
.env
77
dist
8-
src/solace_ai_connector_web/frontend/package-lock.json
9-
package-lock.json
108

119
src/solace_ai_connector_web/__pycache__
1210
__pycache__
1311

1412
src/solace_ai_connector_web/frontend/static
15-
src/solace_ai_connector_web/frontend/static/client
13+
src/solace_ai_connector_web/frontend/static/client/*
14+
src/solace_ai_connector_web/frontend/static/client/assets/*

Makefile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
include .env
22
VERSION ?= local
33

4+
check-hatch:
5+
@which hatch > /dev/null || (echo "Hatch is not installed. Please install it with 'pip install hatch'" && exit 1)
6+
47
gen-docs:
58
@solace-ai-connector-gen-docs src/solace_ai_connector_web
69

7-
build: gen-docs
8-
@python3 -m build
10+
build: check-hatch
11+
@hatch build
912

10-
test:
11-
@pytest
13+
test: check-hatch
14+
@hatch test

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@ classifiers = [
1515
"Programming Language :: Python :: 3.10",
1616
"Programming Language :: Python :: 3.11",
1717
"Programming Language :: Python :: 3.12",
18+
"Programming Language :: Python :: 3.13",
1819
"Programming Language :: Python :: Implementation :: CPython",
1920
"Programming Language :: Python :: Implementation :: PyPy",
2021
]
2122

2223
description = "Web interface for Solace Agent Mesh"
23-
requires-python = ">=3.11"
24+
requires-python = ">=3.10.16"
2425
dependencies = [
2526
"flask~=3.0.3",
2627
"requests~=2.32.3",
@@ -62,7 +63,7 @@ installer = "pip"
6263

6364
# Specify minimum and maximum Python versions to test
6465
[[tool.hatch.envs.hatch-test.matrix]]
65-
python = ["3.10", "3.12"]
66+
python = ["3.10", "3.13"]
6667

6768

6869
[tool.ruff]

src/solace_ai_connector_web/backend/server_base.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from flask_cors import CORS
44
from solace_ai_connector.components.component_base import ComponentBase
55
from flask_wtf import CSRFProtect
6+
from urllib.parse import urlparse
67
import os
78

89
info = {
@@ -216,13 +217,24 @@ def init_app(self):
216217
self.app.config['SECRET_KEY'] = self.csrf_key
217218
csrf.init_app(self.app)
218219

220+
frontend_origins = [self.frontend_url]
221+
222+
# if frontend_url is using localhost or 127.0.0.1, then add them both to cors origins
223+
if "localhost" in self.frontend_url or "127.0.0.1" in self.frontend_url:
224+
parsed_url = urlparse(self.frontend_url)
225+
scheme = parsed_url.scheme
226+
port = f":{parsed_url.port}" if parsed_url.port else ""
227+
228+
if "localhost" in self.frontend_url:
229+
frontend_origins.append(f"{scheme}://127.0.0.1{port}")
230+
else:
231+
frontend_origins.append(f"{scheme}://localhost{port}")
232+
219233
CORS(
220234
self.app,
221235
resources={
222236
r"/*": {
223-
"origins": [
224-
self.frontend_url,
225-
],
237+
"origins": frontend_origins,
226238
"supports_credentials": True
227239
},
228240
},

0 commit comments

Comments
 (0)