flock-core 0.4.516__py3-none-any.whl → 0.4.518__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of flock-core might be problematic. Click here for more details.
- flock/webapp/app/api/execution.py +4 -3
- flock/webapp/app/main.py +30 -80
- flock/webapp/app/middleware.py +113 -0
- flock/webapp/templates/partials/_agent_list.html +1 -1
- flock/webapp/templates/partials/_chat_messages.html +4 -7
- flock/webapp/templates/partials/_execution_form.html +4 -3
- {flock_core-0.4.516.dist-info → flock_core-0.4.518.dist-info}/METADATA +1 -1
- {flock_core-0.4.516.dist-info → flock_core-0.4.518.dist-info}/RECORD +11 -10
- {flock_core-0.4.516.dist-info → flock_core-0.4.518.dist-info}/WHEEL +0 -0
- {flock_core-0.4.516.dist-info → flock_core-0.4.518.dist-info}/entry_points.txt +0 -0
- {flock_core-0.4.516.dist-info → flock_core-0.4.518.dist-info}/licenses/LICENSE +0 -0
|
@@ -154,14 +154,14 @@ async def htmx_run_flock(
|
|
|
154
154
|
raw_json_for_template = json.dumps(result_data, indent=2)
|
|
155
155
|
# Unescape newlines for proper display in HTML <pre> tag
|
|
156
156
|
result_data_raw_json_str = raw_json_for_template.replace('\\n', '\n')
|
|
157
|
-
|
|
157
|
+
root_path = request.scope.get("root_path", "")
|
|
158
158
|
return templates.TemplateResponse(
|
|
159
159
|
"partials/_results_display.html",
|
|
160
160
|
{
|
|
161
161
|
"request": request,
|
|
162
162
|
"result": result_data,
|
|
163
163
|
"result_raw_json": result_data_raw_json_str,
|
|
164
|
-
"feedback_endpoint": "/ui/api/flock/htmx/feedback",
|
|
164
|
+
"feedback_endpoint": f"{root_path}/ui/api/flock/htmx/feedback",
|
|
165
165
|
"share_id": None,
|
|
166
166
|
"flock_name": current_flock_from_state.name,
|
|
167
167
|
"agent_name": start_agent_name,
|
|
@@ -226,6 +226,7 @@ async def htmx_run_shared_flock(
|
|
|
226
226
|
except Exception as e:
|
|
227
227
|
shared_logger.error(f"HTMX Run Shared: Error during execution for '{start_agent_name}' (share_id: {share_id}): {e}", exc_info=True)
|
|
228
228
|
return HTMLResponse(f"<p class='error'>An unexpected error occurred: {e!s}</p>")
|
|
229
|
+
root_path = request.scope.get("root_path", "")
|
|
229
230
|
|
|
230
231
|
return templates.TemplateResponse(
|
|
231
232
|
"partials/_results_display.html",
|
|
@@ -233,7 +234,7 @@ async def htmx_run_shared_flock(
|
|
|
233
234
|
"request": request,
|
|
234
235
|
"result": result_data,
|
|
235
236
|
"result_raw_json": result_data_raw_json_str,
|
|
236
|
-
"feedback_endpoint": "/ui/api/flock/htmx/feedback-shared",
|
|
237
|
+
"feedback_endpoint": f"{root_path}/ui/api/flock/htmx/feedback-shared",
|
|
237
238
|
"share_id": share_id,
|
|
238
239
|
"flock_name": temp_flock.name,
|
|
239
240
|
"agent_name": start_agent_name,
|
flock/webapp/app/main.py
CHANGED
|
@@ -3,7 +3,6 @@ import asyncio
|
|
|
3
3
|
import json
|
|
4
4
|
import os # Added import
|
|
5
5
|
import shutil
|
|
6
|
-
import urllib.parse
|
|
7
6
|
|
|
8
7
|
# Added for share link creation
|
|
9
8
|
import uuid
|
|
@@ -27,70 +26,6 @@ from fastapi.staticfiles import StaticFiles
|
|
|
27
26
|
from fastapi.templating import Jinja2Templates
|
|
28
27
|
from pydantic import BaseModel
|
|
29
28
|
|
|
30
|
-
# Custom middleware for handling proxy headers
|
|
31
|
-
# from starlette.middleware.base import BaseHTTPMiddleware
|
|
32
|
-
# from starlette.requests import Request as StarletteRequest
|
|
33
|
-
from uvicorn.middleware.proxy_headers import ProxyHeadersMiddleware
|
|
34
|
-
|
|
35
|
-
# class ProxyHeadersMiddleware(BaseHTTPMiddleware):
|
|
36
|
-
# """Middleware to handle proxy headers for HTTPS detection.
|
|
37
|
-
# This ensures url_for() generates HTTPS URLs when behind an HTTPS proxy.
|
|
38
|
-
# """
|
|
39
|
-
# async def dispatch(self, request: StarletteRequest, call_next):
|
|
40
|
-
# import logging
|
|
41
|
-
# logger = logging.getLogger(__name__)
|
|
42
|
-
# # Log original scheme and relevant headers for debugging
|
|
43
|
-
# original_scheme = request.scope.get("scheme", "unknown")
|
|
44
|
-
# logger.debug(f"Original scheme: {original_scheme}, URL: {request.url}")
|
|
45
|
-
# # Check for common proxy headers that indicate HTTPS
|
|
46
|
-
# forwarded_proto = request.headers.get("x-forwarded-proto")
|
|
47
|
-
# forwarded_scheme = request.headers.get("x-forwarded-scheme")
|
|
48
|
-
# cloudflare_proto = request.headers.get("cf-visitor")
|
|
49
|
-
# # Log proxy headers for debugging
|
|
50
|
-
# proxy_headers = {
|
|
51
|
-
# "x-forwarded-proto": forwarded_proto,
|
|
52
|
-
# "x-forwarded-scheme": forwarded_scheme,
|
|
53
|
-
# "cf-visitor": cloudflare_proto,
|
|
54
|
-
# "x-forwarded-for": request.headers.get("x-forwarded-for"),
|
|
55
|
-
# "host": request.headers.get("host")
|
|
56
|
-
# }
|
|
57
|
-
# logger.debug(f"Proxy headers: {proxy_headers}")
|
|
58
|
-
# scheme_updated = False
|
|
59
|
-
# # Handle X-Forwarded-Proto header
|
|
60
|
-
# if forwarded_proto:
|
|
61
|
-
# # Update the request scope to reflect the original protocol
|
|
62
|
-
# request.scope["scheme"] = forwarded_proto.lower()
|
|
63
|
-
# scheme_updated = True
|
|
64
|
-
# logger.debug(f"Updated scheme from X-Forwarded-Proto: {forwarded_proto}")
|
|
65
|
-
# # Handle X-Forwarded-Scheme header
|
|
66
|
-
# elif forwarded_scheme:
|
|
67
|
-
# request.scope["scheme"] = forwarded_scheme.lower()
|
|
68
|
-
# scheme_updated = True
|
|
69
|
-
# logger.debug(f"Updated scheme from X-Forwarded-Scheme: {forwarded_scheme}")
|
|
70
|
-
# # Handle Cloudflare's CF-Visitor header (JSON format)
|
|
71
|
-
# elif cloudflare_proto:
|
|
72
|
-
# try:
|
|
73
|
-
# import json
|
|
74
|
-
# visitor_info = json.loads(cloudflare_proto)
|
|
75
|
-
# if visitor_info.get("scheme"):
|
|
76
|
-
# request.scope["scheme"] = visitor_info["scheme"].lower()
|
|
77
|
-
# scheme_updated = True
|
|
78
|
-
# logger.debug(f"Updated scheme from CF-Visitor: {visitor_info['scheme']}")
|
|
79
|
-
# except (json.JSONDecodeError, KeyError) as e:
|
|
80
|
-
# logger.warning(f"Failed to parse CF-Visitor header: {e}")
|
|
81
|
-
# if not scheme_updated:
|
|
82
|
-
# logger.debug("No proxy headers found, keeping original scheme")
|
|
83
|
-
# # Handle X-Forwarded-For for client IP (optional but good practice)
|
|
84
|
-
# forwarded_for = request.headers.get("x-forwarded-for")
|
|
85
|
-
# if forwarded_for:
|
|
86
|
-
# # Take the first IP in the chain (the original client)
|
|
87
|
-
# client_ip = forwarded_for.split(",")[0].strip()
|
|
88
|
-
# request.scope["client"] = (client_ip, request.scope.get("client", ["", 0])[1])
|
|
89
|
-
# # Log final scheme
|
|
90
|
-
# final_scheme = request.scope.get("scheme")
|
|
91
|
-
# logger.debug(f"Final scheme: {final_scheme}")
|
|
92
|
-
# response = await call_next(request)
|
|
93
|
-
# return response
|
|
94
29
|
from flock.core.api.endpoints import create_api_router
|
|
95
30
|
from flock.core.api.run_store import RunStore
|
|
96
31
|
|
|
@@ -123,6 +58,7 @@ from flock.webapp.app.dependencies import (
|
|
|
123
58
|
)
|
|
124
59
|
|
|
125
60
|
# Import service functions (which now expect app_state)
|
|
61
|
+
from flock.webapp.app.middleware import ProxyHeadersMiddleware
|
|
126
62
|
from flock.webapp.app.services.flock_service import (
|
|
127
63
|
clear_current_flock_service,
|
|
128
64
|
create_new_flock_service,
|
|
@@ -359,8 +295,10 @@ app = FastAPI(title="Flock Web UI & API", lifespan=lifespan, docs_url="/docs",
|
|
|
359
295
|
openapi_url="/openapi.json", root_path=os.getenv("FLOCK_ROOT_PATH", ""))
|
|
360
296
|
|
|
361
297
|
# Add middleware for handling proxy headers (HTTPS detection)
|
|
362
|
-
|
|
363
|
-
|
|
298
|
+
# You can force HTTPS by setting FLOCK_FORCE_HTTPS=true
|
|
299
|
+
force_https = os.getenv("FLOCK_FORCE_HTTPS", "false").lower() == "true"
|
|
300
|
+
app.add_middleware(ProxyHeadersMiddleware, force_https=force_https)
|
|
301
|
+
logger.info(f"FastAPI booting complete with proxy headers middleware (force_https={force_https}).")
|
|
364
302
|
|
|
365
303
|
BASE_DIR = Path(__file__).resolve().parent.parent
|
|
366
304
|
app.mount("/static", StaticFiles(directory=str(BASE_DIR / "static")), name="static")
|
|
@@ -774,7 +712,9 @@ async def page_dashboard(
|
|
|
774
712
|
# Handle initial redirect if flagged during app startup
|
|
775
713
|
if getattr(request.app.state, "initial_redirect_to_chat", False):
|
|
776
714
|
logger.info("Initial redirect to CHAT page triggered from dashboard (FLOCK_START_MODE='chat').")
|
|
777
|
-
|
|
715
|
+
# Use url_for to respect the root_path setting
|
|
716
|
+
chat_url = str(request.url_for("page_chat"))
|
|
717
|
+
return RedirectResponse(url=chat_url, status_code=307)
|
|
778
718
|
|
|
779
719
|
effective_ui_mode = ui_mode
|
|
780
720
|
flock_is_preloaded = hasattr(request.app.state, "flock_instance") and request.app.state.flock_instance is not None
|
|
@@ -782,7 +722,11 @@ async def page_dashboard(
|
|
|
782
722
|
if effective_ui_mode is None:
|
|
783
723
|
effective_ui_mode = "scoped" if flock_is_preloaded else "standalone"
|
|
784
724
|
if effective_ui_mode == "scoped":
|
|
785
|
-
|
|
725
|
+
# Manually construct URL with root_path to ensure it works with proxy setups
|
|
726
|
+
root_path = request.scope.get("root_path", "")
|
|
727
|
+
redirect_url = f"{root_path}/?ui_mode=scoped&initial_load=true"
|
|
728
|
+
logger.info(f"Dashboard redirect: {redirect_url} (root_path: '{root_path}')")
|
|
729
|
+
return RedirectResponse(url=redirect_url, status_code=307)
|
|
786
730
|
|
|
787
731
|
if effective_ui_mode == "standalone" and flock_is_preloaded:
|
|
788
732
|
clear_current_flock_service(request.app.state) # Pass app.state
|
|
@@ -792,9 +736,9 @@ async def page_dashboard(
|
|
|
792
736
|
flock_in_state = hasattr(request.app.state, "flock_instance") and request.app.state.flock_instance is not None
|
|
793
737
|
|
|
794
738
|
if effective_ui_mode == "scoped":
|
|
795
|
-
context["initial_content_url"] = "
|
|
739
|
+
context["initial_content_url"] = str(request.url_for("htmx_get_execution_view_container")) if flock_in_state else str(request.url_for("htmx_scoped_no_flock_view"))
|
|
796
740
|
else:
|
|
797
|
-
context["initial_content_url"] = "
|
|
741
|
+
context["initial_content_url"] = str(request.url_for("htmx_get_load_flock_view"))
|
|
798
742
|
return templates.TemplateResponse("base.html", context)
|
|
799
743
|
|
|
800
744
|
@app.get("/ui/editor/{section:path}", response_class=HTMLResponse, tags=["UI Pages"])
|
|
@@ -804,31 +748,36 @@ async def page_editor_section(
|
|
|
804
748
|
flock_instance_from_state: Flock | None = getattr(request.app.state, "flock_instance", None)
|
|
805
749
|
if not flock_instance_from_state:
|
|
806
750
|
err_msg = "No flock loaded. Please load or create a flock first."
|
|
807
|
-
|
|
808
|
-
|
|
751
|
+
# Use url_for to respect the root_path setting
|
|
752
|
+
redirect_url = str(request.url_for("page_dashboard").include_query_params(error=err_msg))
|
|
753
|
+
if ui_mode == "scoped":
|
|
754
|
+
redirect_url = str(request.url_for("page_dashboard").include_query_params(error=err_msg, ui_mode="scoped"))
|
|
809
755
|
return RedirectResponse(url=redirect_url, status_code=303)
|
|
810
756
|
|
|
811
757
|
context = get_base_context_web(request, error, success, ui_mode)
|
|
758
|
+
root_path = request.scope.get("root_path", "")
|
|
812
759
|
content_map = {
|
|
813
|
-
"properties": "/ui/api/flock/htmx/flock-properties-form",
|
|
814
|
-
"agents": "/ui/htmx/agent-manager-view",
|
|
815
|
-
"execute": "/ui/htmx/execution-view-container"
|
|
760
|
+
"properties": f"{root_path}/ui/api/flock/htmx/flock-properties-form",
|
|
761
|
+
"agents": f"{root_path}/ui/htmx/agent-manager-view",
|
|
762
|
+
"execute": f"{root_path}/ui/htmx/execution-view-container"
|
|
816
763
|
}
|
|
817
|
-
context["initial_content_url"] = content_map.get(section, "/ui/htmx/load-flock-view")
|
|
764
|
+
context["initial_content_url"] = content_map.get(section, f"{root_path}/ui/htmx/load-flock-view")
|
|
818
765
|
if section not in content_map: context["error_message"] = "Invalid editor section."
|
|
819
766
|
return templates.TemplateResponse("base.html", context)
|
|
820
767
|
|
|
821
768
|
@app.get("/ui/registry", response_class=HTMLResponse, tags=["UI Pages"])
|
|
822
769
|
async def page_registry(request: Request, error: str = None, success: str = None, ui_mode: str = Query("standalone")):
|
|
823
770
|
context = get_base_context_web(request, error, success, ui_mode)
|
|
824
|
-
|
|
771
|
+
root_path = request.scope.get("root_path", "")
|
|
772
|
+
context["initial_content_url"] = f"{root_path}/ui/htmx/registry-viewer"
|
|
825
773
|
return templates.TemplateResponse("base.html", context)
|
|
826
774
|
|
|
827
775
|
@app.get("/ui/create", response_class=HTMLResponse, tags=["UI Pages"])
|
|
828
776
|
async def page_create(request: Request, error: str = None, success: str = None, ui_mode: str = Query("standalone")):
|
|
829
777
|
clear_current_flock_service(request.app.state) # Pass app.state
|
|
830
778
|
context = get_base_context_web(request, error, success, "standalone")
|
|
831
|
-
|
|
779
|
+
root_path = request.scope.get("root_path", "")
|
|
780
|
+
context["initial_content_url"] = f"{root_path}/ui/htmx/create-flock-form"
|
|
832
781
|
return templates.TemplateResponse("base.html", context)
|
|
833
782
|
|
|
834
783
|
@app.get("/ui/htmx/sidebar", response_class=HTMLResponse, tags=["UI HTMX Partials"])
|
|
@@ -953,7 +902,8 @@ async def ui_create_flock_action(request: Request, flock_name: str = Form(...),
|
|
|
953
902
|
@app.get("/ui/settings", response_class=HTMLResponse, tags=["UI Pages"])
|
|
954
903
|
async def page_settings(request: Request, error: str = None, success: str = None, ui_mode: str = Query("standalone")):
|
|
955
904
|
context = get_base_context_web(request, error, success, ui_mode)
|
|
956
|
-
|
|
905
|
+
root_path = request.scope.get("root_path", "")
|
|
906
|
+
context["initial_content_url"] = f"{root_path}/ui/htmx/settings-view"
|
|
957
907
|
return templates.TemplateResponse("base.html", context)
|
|
958
908
|
|
|
959
909
|
def _prepare_env_vars_for_template_web():
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
|
|
2
|
+
# Custom middleware for handling proxy headers
|
|
3
|
+
from starlette.middleware.base import BaseHTTPMiddleware
|
|
4
|
+
from starlette.requests import Request as StarletteRequest
|
|
5
|
+
|
|
6
|
+
#from uvicorn.middleware.proxy_headers import ProxyHeadersMiddleware
|
|
7
|
+
|
|
8
|
+
class ProxyHeadersMiddleware(BaseHTTPMiddleware):
|
|
9
|
+
"""Middleware to handle proxy headers for HTTPS detection.
|
|
10
|
+
This ensures url_for() generates HTTPS URLs when behind an HTTPS proxy.
|
|
11
|
+
"""
|
|
12
|
+
def __init__(self, app, force_https: bool = False):
|
|
13
|
+
super().__init__(app)
|
|
14
|
+
self.force_https = force_https
|
|
15
|
+
|
|
16
|
+
async def dispatch(self, request: StarletteRequest, call_next):
|
|
17
|
+
import json
|
|
18
|
+
import logging
|
|
19
|
+
logger = logging.getLogger(__name__)
|
|
20
|
+
|
|
21
|
+
# Log original scheme and relevant headers for debugging
|
|
22
|
+
original_scheme = request.scope.get("scheme", "unknown")
|
|
23
|
+
original_host = request.headers.get("host")
|
|
24
|
+
logger.info(f"ProxyHeadersMiddleware - Original scheme: {original_scheme}, Host: {original_host}, URL: {request.url}")
|
|
25
|
+
|
|
26
|
+
# If force_https is enabled, always use HTTPS
|
|
27
|
+
if self.force_https:
|
|
28
|
+
request.scope["scheme"] = "https"
|
|
29
|
+
logger.info("ProxyHeadersMiddleware - Force HTTPS enabled, setting scheme to https")
|
|
30
|
+
else:
|
|
31
|
+
# Check for common proxy headers that indicate HTTPS
|
|
32
|
+
forwarded_proto = request.headers.get("x-forwarded-proto")
|
|
33
|
+
forwarded_scheme = request.headers.get("x-forwarded-scheme")
|
|
34
|
+
forwarded_host = request.headers.get("x-forwarded-host")
|
|
35
|
+
cloudflare_proto = request.headers.get("cf-visitor")
|
|
36
|
+
forwarded_ssl = request.headers.get("x-forwarded-ssl")
|
|
37
|
+
front_end_https = request.headers.get("front-end-https")
|
|
38
|
+
|
|
39
|
+
# Log proxy headers for debugging
|
|
40
|
+
proxy_headers = {
|
|
41
|
+
"x-forwarded-proto": forwarded_proto,
|
|
42
|
+
"x-forwarded-scheme": forwarded_scheme,
|
|
43
|
+
"x-forwarded-host": forwarded_host,
|
|
44
|
+
"cf-visitor": cloudflare_proto,
|
|
45
|
+
"x-forwarded-ssl": forwarded_ssl,
|
|
46
|
+
"front-end-https": front_end_https,
|
|
47
|
+
"x-forwarded-for": request.headers.get("x-forwarded-for"),
|
|
48
|
+
"host": request.headers.get("host")
|
|
49
|
+
}
|
|
50
|
+
logger.info(f"ProxyHeadersMiddleware - Proxy headers: {proxy_headers}")
|
|
51
|
+
|
|
52
|
+
scheme_updated = False
|
|
53
|
+
|
|
54
|
+
# Handle X-Forwarded-Proto header (most common)
|
|
55
|
+
if forwarded_proto:
|
|
56
|
+
request.scope["scheme"] = forwarded_proto.lower()
|
|
57
|
+
scheme_updated = True
|
|
58
|
+
logger.info(f"ProxyHeadersMiddleware - Updated scheme from X-Forwarded-Proto: {forwarded_proto}")
|
|
59
|
+
|
|
60
|
+
# Handle X-Forwarded-Scheme header
|
|
61
|
+
elif forwarded_scheme:
|
|
62
|
+
request.scope["scheme"] = forwarded_scheme.lower()
|
|
63
|
+
scheme_updated = True
|
|
64
|
+
logger.info(f"ProxyHeadersMiddleware - Updated scheme from X-Forwarded-Scheme: {forwarded_scheme}")
|
|
65
|
+
|
|
66
|
+
# Handle X-Forwarded-SSL header (on/off)
|
|
67
|
+
elif forwarded_ssl and forwarded_ssl.lower() == "on":
|
|
68
|
+
request.scope["scheme"] = "https"
|
|
69
|
+
scheme_updated = True
|
|
70
|
+
logger.info(f"ProxyHeadersMiddleware - Updated scheme from X-Forwarded-SSL: on -> https")
|
|
71
|
+
|
|
72
|
+
# Handle Front-End-Https header (on/off)
|
|
73
|
+
elif front_end_https and front_end_https.lower() == "on":
|
|
74
|
+
request.scope["scheme"] = "https"
|
|
75
|
+
scheme_updated = True
|
|
76
|
+
logger.info(f"ProxyHeadersMiddleware - Updated scheme from Front-End-Https: on -> https")
|
|
77
|
+
|
|
78
|
+
# Handle Cloudflare's CF-Visitor header (JSON format)
|
|
79
|
+
elif cloudflare_proto:
|
|
80
|
+
try:
|
|
81
|
+
visitor_info = json.loads(cloudflare_proto)
|
|
82
|
+
if visitor_info.get("scheme"):
|
|
83
|
+
request.scope["scheme"] = visitor_info["scheme"].lower()
|
|
84
|
+
scheme_updated = True
|
|
85
|
+
logger.info(f"ProxyHeadersMiddleware - Updated scheme from CF-Visitor: {visitor_info['scheme']}")
|
|
86
|
+
except (json.JSONDecodeError, KeyError) as e:
|
|
87
|
+
logger.warning(f"ProxyHeadersMiddleware - Failed to parse CF-Visitor header: {e}")
|
|
88
|
+
|
|
89
|
+
if not scheme_updated:
|
|
90
|
+
logger.info("ProxyHeadersMiddleware - No proxy headers found, keeping original scheme")
|
|
91
|
+
|
|
92
|
+
# Handle X-Forwarded-Host for proper host handling
|
|
93
|
+
forwarded_host = request.headers.get("x-forwarded-host")
|
|
94
|
+
if forwarded_host:
|
|
95
|
+
# Update the server scope to reflect the original host
|
|
96
|
+
request.scope["server"] = (forwarded_host, 443 if request.scope.get("scheme") == "https" else 80)
|
|
97
|
+
logger.info(f"ProxyHeadersMiddleware - Updated host from X-Forwarded-Host: {forwarded_host}")
|
|
98
|
+
|
|
99
|
+
# Handle X-Forwarded-For for client IP (optional but good practice)
|
|
100
|
+
forwarded_for = request.headers.get("x-forwarded-for")
|
|
101
|
+
if forwarded_for:
|
|
102
|
+
# Take the first IP in the chain (the original client)
|
|
103
|
+
client_ip = forwarded_for.split(",")[0].strip()
|
|
104
|
+
request.scope["client"] = (client_ip, request.scope.get("client", ["", 0])[1])
|
|
105
|
+
|
|
106
|
+
# Log final scheme and reconstructed URL
|
|
107
|
+
final_scheme = request.scope.get("scheme")
|
|
108
|
+
final_server = request.scope.get("server", ("unknown", 0))
|
|
109
|
+
logger.info(f"ProxyHeadersMiddleware - Final scheme: {final_scheme}, server: {final_server}")
|
|
110
|
+
logger.info(f"ProxyHeadersMiddleware - Reconstructed URL would be: {final_scheme}://{final_server[0]}{request.url.path}")
|
|
111
|
+
|
|
112
|
+
response = await call_next(request)
|
|
113
|
+
return response
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
{% endif %}
|
|
6
6
|
{% if flock.agents %}
|
|
7
7
|
<ul class="item-list">
|
|
8
|
-
{% for agent_name, agent in flock.agents.items() %} <li hx-get="{{ url_for('htmx_get_agent_details_form', agent_name=agent.name) }}" hx-target="#agent-detail-panel" hx-swap="innerHTML" hx-indicator="#agent-detail-loading" onclick="this.closest('ul').querySelectorAll('li').forEach(li => li.classList.remove('selected-item')); this.classList.add('selected-item');">
|
|
8
|
+
{% for agent_name, agent in flock.agents.items() %} <li hx-get="{{ url_for('htmx_get_agent_details_form', agent_name=agent.name) }}" hx-target="#agent-detail-panel" hx-swap="innerHTML" hx-indicator="#agent-detail-loading-indicator" onclick="this.closest('ul').querySelectorAll('li').forEach(li => li.classList.remove('selected-item')); this.classList.add('selected-item');">
|
|
9
9
|
<strong>{{ agent.name }}</strong><br>
|
|
10
10
|
<small>{{ agent.resolved_description|truncate(80) if agent.resolved_description else 'No description' }}</small>
|
|
11
11
|
</li>
|
|
@@ -19,10 +19,8 @@
|
|
|
19
19
|
<input type="hidden" name="agent_name" value="{{ entry.agent }}">
|
|
20
20
|
<input type="hidden" name="actual_response" value='{{ entry.raw_json | replace("'", "'") }}'>
|
|
21
21
|
<input type="hidden" name="reason" value="positive">
|
|
22
|
-
</form>
|
|
23
|
-
|
|
24
|
-
<a href="#"
|
|
25
|
-
hx-post="{% if share_id %}/chat/htmx/feedback-shared{% else %}/chat/htmx/feedback{% endif %}"
|
|
22
|
+
</form> <a href="#"
|
|
23
|
+
hx-post="{% if share_id %}{{ url_for('chat_feedback_shared') }}{% else %}{{ url_for('chat_feedback') }}{% endif %}"
|
|
26
24
|
hx-include="closest .feedback-meta"
|
|
27
25
|
hx-target="closest .bubble"
|
|
28
26
|
hx-swap="innerHTML"
|
|
@@ -34,9 +32,8 @@
|
|
|
34
32
|
</div>
|
|
35
33
|
|
|
36
34
|
<!-- Feedback form (initially hidden, toggled by 👎 link) -->
|
|
37
|
-
<div x-show="showForm" style="width: 800px;">
|
|
38
|
-
|
|
39
|
-
hx-post="{% if share_id %}/chat/htmx/feedback-shared{% else %}/chat/htmx/feedback{% endif %}"
|
|
35
|
+
<div x-show="showForm" style="width: 800px;"> <form
|
|
36
|
+
hx-post="{% if share_id %}{{ url_for('chat_feedback_shared') }}{% else %}{{ url_for('chat_feedback') }}{% endif %}"
|
|
40
37
|
hx-target="closest .bubble"
|
|
41
38
|
hx-swap="innerHTML"
|
|
42
39
|
x-on:htmx:afterRequest="showForm=false"
|
|
@@ -38,9 +38,7 @@ window.agentInputFormUrlTemplate = '{{ url_for("htmx_get_agent_input_form", agen
|
|
|
38
38
|
<progress indeterminate></progress> Loading input form...
|
|
39
39
|
</div>
|
|
40
40
|
|
|
41
|
-
<button type="submit" {% if not flock.agents %}disabled{% endif %}>Run Flock</button>
|
|
42
|
-
|
|
43
|
-
<div id="share-agent-link-container" style="margin-top: 0.5rem;"> <a href="#"
|
|
41
|
+
<button type="submit" {% if not flock.agents %}disabled{% endif %}>Run Flock</button> <div id="share-agent-link-container" style="margin-top: 0.5rem;"> <a href="#"
|
|
44
42
|
id="shareAgentHtmxLink"
|
|
45
43
|
hx-post="{{ url_for('htmx_generate_share_link') }}"
|
|
46
44
|
hx-target="#shareLinkDisplayArea"
|
|
@@ -50,6 +48,9 @@ window.agentInputFormUrlTemplate = '{{ url_for("htmx_get_agent_input_form", agen
|
|
|
50
48
|
style="text-decoration: underline; cursor: pointer; color: var(--pico-primary);">
|
|
51
49
|
Create shareable link...
|
|
52
50
|
</a>
|
|
51
|
+
<span id="share-loading-indicator" class="htmx-indicator">
|
|
52
|
+
<progress indeterminate></progress> Generating link...
|
|
53
|
+
</span>
|
|
53
54
|
</div>
|
|
54
55
|
|
|
55
56
|
<span id="run-loading-indicator" class="htmx-indicator">
|
|
@@ -495,13 +495,14 @@ flock/webapp/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,
|
|
|
495
495
|
flock/webapp/app/chat.py,sha256=d5a_mr3H2nuWNFSpSlI_HyqX-J_4krndd4A-8S25EKM,28679
|
|
496
496
|
flock/webapp/app/config.py,sha256=lqmneujnNZk-EFJV5cWpvxkqisxH3T3zT_YOI0JYThE,4809
|
|
497
497
|
flock/webapp/app/dependencies.py,sha256=JUcwY1N6SZplU141lMN2wk9dOC9er5HCedrKTJN9wJk,5533
|
|
498
|
-
flock/webapp/app/main.py,sha256=
|
|
498
|
+
flock/webapp/app/main.py,sha256=J3NiwW4fFTrp_YKa-HFXs3gLtLC6qu9LjIb_i-jJHMk,58426
|
|
499
|
+
flock/webapp/app/middleware.py,sha256=5gkM-gqD7C6-JrsoTB1_UWpf05JI1N8KIWajn60QZk0,5721
|
|
499
500
|
flock/webapp/app/models_ui.py,sha256=vrEBLbhEp6FziAgBSFOLT1M7ckwadsTdT7qus5_NduE,329
|
|
500
501
|
flock/webapp/app/theme_mapper.py,sha256=QzWwLWpED78oYp3FjZ9zxv1KxCyj43m8MZ0fhfzz37w,34302
|
|
501
502
|
flock/webapp/app/utils.py,sha256=RF8DMKKAj1XPmm4txUdo2OdswI1ATQ7cqUm6G9JFDzA,2942
|
|
502
503
|
flock/webapp/app/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
503
504
|
flock/webapp/app/api/agent_management.py,sha256=5xqO94QjjAYvxImyjKV9EGUQOvo4n3eqs7pGwGPSQJ4,10394
|
|
504
|
-
flock/webapp/app/api/execution.py,sha256=
|
|
505
|
+
flock/webapp/app/api/execution.py,sha256=tmExz11EPYmltYsQ-xB58ueXZbmlpW1fJFi0s6LjWnU,13120
|
|
505
506
|
flock/webapp/app/api/flock_management.py,sha256=1o-6-36kTnUjI3am_BqLpdrcz0aqFXrxE-hQHIFcCsg,4869
|
|
506
507
|
flock/webapp/app/api/registry_viewer.py,sha256=IoInxJiRR0yFlecG_l2_eRc6l35RQQyEDMG9BcBkipY,1020
|
|
507
508
|
flock/webapp/app/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -523,11 +524,11 @@ flock/webapp/templates/index.html,sha256=1SDfAfaGBNJhI26bc6z7qBo9mrOK7HKQIS9aRGv
|
|
|
523
524
|
flock/webapp/templates/registry_viewer.html,sha256=Rq0Ao3r6mqwgF6bWM73d-KmnslwQoz79a2PGbL5M4Fo,3349
|
|
524
525
|
flock/webapp/templates/shared_run_page.html,sha256=RX1J3hgEuIJXaGYlquY7m54yxPTIrJJAZH2HB6v33WY,8109
|
|
525
526
|
flock/webapp/templates/partials/_agent_detail_form.html,sha256=jpcbj2-zN_eWH6vlhWGBAviObmK2IZvezU_b2_UW-Tc,6067
|
|
526
|
-
flock/webapp/templates/partials/_agent_list.html,sha256=
|
|
527
|
+
flock/webapp/templates/partials/_agent_list.html,sha256=0TcutldXJncQP6jMsXh8cnbjdzaVuEF-VTddQ6DZli0,1058
|
|
527
528
|
flock/webapp/templates/partials/_agent_manager_view.html,sha256=8oJlxjtgeOkCQcfhaAmE4s_tklk25Jw0XScXpS_MVr0,2571
|
|
528
529
|
flock/webapp/templates/partials/_agent_tools_checklist.html,sha256=T60fb7OrJYHUw0hJLC_otskgvbH9dZXbv5klgWBkSWk,686
|
|
529
530
|
flock/webapp/templates/partials/_chat_container.html,sha256=MHj9yRHy_wVZD6f_Csc0bZBhtxJMfr2V5bRRAaXiqtU,843
|
|
530
|
-
flock/webapp/templates/partials/_chat_messages.html,sha256=
|
|
531
|
+
flock/webapp/templates/partials/_chat_messages.html,sha256=CEvNAVLCanBXRW6-3Oy11XzUUlWdUEZml9nujO92kPQ,3831
|
|
531
532
|
flock/webapp/templates/partials/_chat_settings_form.html,sha256=iPb0XT52VLyU9HDsoFH41uXosGJsuXwaU1smKDWc_ms,4538
|
|
532
533
|
flock/webapp/templates/partials/_create_flock_form.html,sha256=7IukF4rQwdn3D5fVXqusGlTmNeoJXEwclhzQt57NVDY,2823
|
|
533
534
|
flock/webapp/templates/partials/_dashboard_flock_detail.html,sha256=RWPshcq3-11j13jw5j-x4r3AMULdNHsWK4ejfLYD4MM,1044
|
|
@@ -536,7 +537,7 @@ flock/webapp/templates/partials/_dashboard_flock_properties_preview.html,sha256=
|
|
|
536
537
|
flock/webapp/templates/partials/_dashboard_upload_flock_form.html,sha256=UWU_WpIsq6iw5FwK989ANmhzcCOcDKVjdakZ4kxY8lU,961
|
|
537
538
|
flock/webapp/templates/partials/_dynamic_input_form_content.html,sha256=WYr2M7Mb5vKITFhIVXXEHppRx9IjGew91yLo1_I9kkI,1230
|
|
538
539
|
flock/webapp/templates/partials/_env_vars_table.html,sha256=st8bRQpIJ3TJ_znEdyOwDT43ZhO2QTLne2IZNxQdQNM,1106
|
|
539
|
-
flock/webapp/templates/partials/_execution_form.html,sha256=
|
|
540
|
+
flock/webapp/templates/partials/_execution_form.html,sha256=yQbYgFYlfva4hgRAs791MR2IFgZnQBLbo4vvlPrDGeU,3686
|
|
540
541
|
flock/webapp/templates/partials/_execution_view_container.html,sha256=w4QEr-yPs0k1vF2oxMhhPoOr-ki0YJzzUltGmZgfRfY,1672
|
|
541
542
|
flock/webapp/templates/partials/_flock_file_list.html,sha256=3F1RE1EaeRSQeyIWeA2ALHU2j4oGwureDtY6k1aZVjQ,1261
|
|
542
543
|
flock/webapp/templates/partials/_flock_properties_form.html,sha256=kUHoxB6_C_R9nMDD_ClLRDL_9zQ6E8gFCrlkEkqcUYo,2904
|
|
@@ -561,8 +562,8 @@ flock/workflow/agent_execution_activity.py,sha256=Gy6FtuVAjf0NiUXmC3syS2eJpNQF4R
|
|
|
561
562
|
flock/workflow/flock_workflow.py,sha256=iSUF_soFvWar0ffpkzE4irkDZRx0p4HnwmEBi_Ne2sY,9666
|
|
562
563
|
flock/workflow/temporal_config.py,sha256=3_8O7SDEjMsSMXsWJBfnb6XTp0TFaz39uyzSlMTSF_I,3988
|
|
563
564
|
flock/workflow/temporal_setup.py,sha256=YIHnSBntzOchHfMSh8hoLeNXrz3B1UbR14YrR6soM7A,1606
|
|
564
|
-
flock_core-0.4.
|
|
565
|
-
flock_core-0.4.
|
|
566
|
-
flock_core-0.4.
|
|
567
|
-
flock_core-0.4.
|
|
568
|
-
flock_core-0.4.
|
|
565
|
+
flock_core-0.4.518.dist-info/METADATA,sha256=50iDWHL1rHH4LX9gJIF53tA9afqFS6QNqccVFcZX-Io,22786
|
|
566
|
+
flock_core-0.4.518.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
567
|
+
flock_core-0.4.518.dist-info/entry_points.txt,sha256=rWaS5KSpkTmWySURGFZk6PhbJ87TmvcFQDi2uzjlagQ,37
|
|
568
|
+
flock_core-0.4.518.dist-info/licenses/LICENSE,sha256=iYEqWy0wjULzM9GAERaybP4LBiPeu7Z1NEliLUdJKSc,1072
|
|
569
|
+
flock_core-0.4.518.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|