open-swarm 0.1.1743070217__py3-none-any.whl → 0.1.1743362777__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.
- open_swarm-0.1.1743362777.dist-info/METADATA +217 -0
- open_swarm-0.1.1743362777.dist-info/RECORD +260 -0
- {open_swarm-0.1.1743070217.dist-info → open_swarm-0.1.1743362777.dist-info}/WHEEL +1 -2
- open_swarm-0.1.1743362777.dist-info/entry_points.txt +2 -0
- swarm/__init__.py +0 -2
- swarm/auth.py +53 -49
- swarm/blueprints/README.md +67 -0
- swarm/blueprints/burnt_noodles/blueprint_burnt_noodles.py +412 -0
- swarm/blueprints/chatbot/blueprint_chatbot.py +98 -0
- swarm/blueprints/chatbot/templates/chatbot/chatbot.html +33 -0
- swarm/blueprints/digitalbutlers/blueprint_digitalbutlers.py +183 -0
- swarm/blueprints/dilbot_universe/blueprint_dilbot_universe.py +285 -0
- swarm/blueprints/divine_code/__init__.py +0 -0
- swarm/blueprints/divine_code/apps.py +11 -0
- swarm/blueprints/divine_code/blueprint_divine_code.py +219 -0
- swarm/blueprints/django_chat/apps.py +6 -0
- swarm/blueprints/django_chat/blueprint_django_chat.py +84 -0
- swarm/blueprints/django_chat/templates/django_chat/django_chat_webpage.html +37 -0
- swarm/blueprints/django_chat/urls.py +8 -0
- swarm/blueprints/django_chat/views.py +32 -0
- swarm/blueprints/echocraft/blueprint_echocraft.py +44 -0
- swarm/blueprints/family_ties/apps.py +11 -0
- swarm/blueprints/family_ties/blueprint_family_ties.py +152 -0
- swarm/blueprints/family_ties/models.py +19 -0
- swarm/blueprints/family_ties/serializers.py +7 -0
- swarm/blueprints/family_ties/settings.py +16 -0
- swarm/blueprints/family_ties/urls.py +10 -0
- swarm/blueprints/family_ties/views.py +26 -0
- swarm/blueprints/flock/__init__.py +0 -0
- swarm/blueprints/gaggle/blueprint_gaggle.py +184 -0
- swarm/blueprints/gotchaman/blueprint_gotchaman.py +232 -0
- swarm/blueprints/mcp_demo/blueprint_mcp_demo.py +133 -0
- swarm/blueprints/messenger/templates/messenger/messenger.html +46 -0
- swarm/blueprints/mission_improbable/blueprint_mission_improbable.py +234 -0
- swarm/blueprints/monkai_magic/blueprint_monkai_magic.py +248 -0
- swarm/blueprints/nebula_shellz/blueprint_nebula_shellz.py +156 -0
- swarm/blueprints/omniplex/blueprint_omniplex.py +221 -0
- swarm/blueprints/rue_code/__init__.py +0 -0
- swarm/blueprints/rue_code/blueprint_rue_code.py +291 -0
- swarm/blueprints/suggestion/blueprint_suggestion.py +110 -0
- swarm/blueprints/unapologetic_press/blueprint_unapologetic_press.py +298 -0
- swarm/blueprints/whiskeytango_foxtrot/__init__.py +0 -0
- swarm/blueprints/whiskeytango_foxtrot/apps.py +11 -0
- swarm/blueprints/whiskeytango_foxtrot/blueprint_whiskeytango_foxtrot.py +256 -0
- swarm/extensions/blueprint/__init__.py +30 -15
- swarm/extensions/blueprint/agent_utils.py +16 -40
- swarm/extensions/blueprint/blueprint_base.py +141 -543
- swarm/extensions/blueprint/blueprint_discovery.py +112 -98
- swarm/extensions/blueprint/cli_handler.py +185 -0
- swarm/extensions/blueprint/config_loader.py +122 -0
- swarm/extensions/blueprint/django_utils.py +181 -79
- swarm/extensions/blueprint/interactive_mode.py +1 -1
- swarm/extensions/config/config_loader.py +83 -200
- swarm/extensions/launchers/build_swarm_wrapper.py +0 -0
- swarm/extensions/launchers/swarm_cli.py +199 -287
- swarm/llm/chat_completion.py +26 -55
- swarm/management/__init__.py +0 -0
- swarm/management/commands/__init__.py +0 -0
- swarm/management/commands/runserver.py +58 -0
- swarm/permissions.py +38 -0
- swarm/serializers.py +96 -5
- swarm/settings.py +95 -110
- swarm/static/contrib/fonts/fontawesome-webfont.ttf +7 -0
- swarm/static/contrib/fonts/fontawesome-webfont.woff +7 -0
- swarm/static/contrib/fonts/fontawesome-webfont.woff2 +7 -0
- swarm/static/contrib/markedjs/marked.min.js +6 -0
- swarm/static/contrib/tabler-icons/adjustments-horizontal.svg +27 -0
- swarm/static/contrib/tabler-icons/alert-triangle.svg +21 -0
- swarm/static/contrib/tabler-icons/archive.svg +21 -0
- swarm/static/contrib/tabler-icons/artboard.svg +27 -0
- swarm/static/contrib/tabler-icons/automatic-gearbox.svg +23 -0
- swarm/static/contrib/tabler-icons/box-multiple.svg +19 -0
- swarm/static/contrib/tabler-icons/carambola.svg +19 -0
- swarm/static/contrib/tabler-icons/copy.svg +20 -0
- swarm/static/contrib/tabler-icons/download.svg +21 -0
- swarm/static/contrib/tabler-icons/edit.svg +21 -0
- swarm/static/contrib/tabler-icons/filled/carambola.svg +13 -0
- swarm/static/contrib/tabler-icons/filled/paint.svg +13 -0
- swarm/static/contrib/tabler-icons/headset.svg +22 -0
- swarm/static/contrib/tabler-icons/layout-sidebar-left-collapse.svg +21 -0
- swarm/static/contrib/tabler-icons/layout-sidebar-left-expand.svg +21 -0
- swarm/static/contrib/tabler-icons/layout-sidebar-right-collapse.svg +21 -0
- swarm/static/contrib/tabler-icons/layout-sidebar-right-expand.svg +21 -0
- swarm/static/contrib/tabler-icons/message-chatbot.svg +22 -0
- swarm/static/contrib/tabler-icons/message-star.svg +22 -0
- swarm/static/contrib/tabler-icons/message-x.svg +23 -0
- swarm/static/contrib/tabler-icons/message.svg +21 -0
- swarm/static/contrib/tabler-icons/paperclip.svg +18 -0
- swarm/static/contrib/tabler-icons/playlist-add.svg +22 -0
- swarm/static/contrib/tabler-icons/robot.svg +26 -0
- swarm/static/contrib/tabler-icons/search.svg +19 -0
- swarm/static/contrib/tabler-icons/settings.svg +20 -0
- swarm/static/contrib/tabler-icons/thumb-down.svg +19 -0
- swarm/static/contrib/tabler-icons/thumb-up.svg +19 -0
- swarm/static/css/dropdown.css +22 -0
- swarm/static/htmx/htmx.min.js +0 -0
- swarm/static/js/dropdown.js +23 -0
- swarm/static/rest_mode/css/base.css +470 -0
- swarm/static/rest_mode/css/chat-history.css +286 -0
- swarm/static/rest_mode/css/chat.css +251 -0
- swarm/static/rest_mode/css/chatbot.css +74 -0
- swarm/static/rest_mode/css/chatgpt.css +62 -0
- swarm/static/rest_mode/css/colors/corporate.css +74 -0
- swarm/static/rest_mode/css/colors/pastel.css +81 -0
- swarm/static/rest_mode/css/colors/tropical.css +82 -0
- swarm/static/rest_mode/css/general.css +142 -0
- swarm/static/rest_mode/css/layout.css +167 -0
- swarm/static/rest_mode/css/layouts/messenger-layout.css +17 -0
- swarm/static/rest_mode/css/layouts/minimalist-layout.css +57 -0
- swarm/static/rest_mode/css/layouts/mobile-layout.css +8 -0
- swarm/static/rest_mode/css/messages.css +84 -0
- swarm/static/rest_mode/css/messenger.css +135 -0
- swarm/static/rest_mode/css/settings.css +91 -0
- swarm/static/rest_mode/css/simple.css +44 -0
- swarm/static/rest_mode/css/slack.css +58 -0
- swarm/static/rest_mode/css/style.css +156 -0
- swarm/static/rest_mode/css/theme.css +30 -0
- swarm/static/rest_mode/css/toast.css +40 -0
- swarm/static/rest_mode/js/auth.js +9 -0
- swarm/static/rest_mode/js/blueprint.js +41 -0
- swarm/static/rest_mode/js/blueprintUtils.js +12 -0
- swarm/static/rest_mode/js/chatLogic.js +79 -0
- swarm/static/rest_mode/js/debug.js +63 -0
- swarm/static/rest_mode/js/events.js +98 -0
- swarm/static/rest_mode/js/main.js +19 -0
- swarm/static/rest_mode/js/messages.js +264 -0
- swarm/static/rest_mode/js/messengerLogic.js +355 -0
- swarm/static/rest_mode/js/modules/apiService.js +84 -0
- swarm/static/rest_mode/js/modules/blueprintManager.js +162 -0
- swarm/static/rest_mode/js/modules/chatHistory.js +110 -0
- swarm/static/rest_mode/js/modules/debugLogger.js +14 -0
- swarm/static/rest_mode/js/modules/eventHandlers.js +107 -0
- swarm/static/rest_mode/js/modules/messageProcessor.js +120 -0
- swarm/static/rest_mode/js/modules/state.js +7 -0
- swarm/static/rest_mode/js/modules/userInteractions.js +29 -0
- swarm/static/rest_mode/js/modules/validation.js +23 -0
- swarm/static/rest_mode/js/rendering.js +119 -0
- swarm/static/rest_mode/js/settings.js +130 -0
- swarm/static/rest_mode/js/sidebar.js +94 -0
- swarm/static/rest_mode/js/simpleLogic.js +37 -0
- swarm/static/rest_mode/js/slackLogic.js +66 -0
- swarm/static/rest_mode/js/splash.js +76 -0
- swarm/static/rest_mode/js/theme.js +111 -0
- swarm/static/rest_mode/js/toast.js +36 -0
- swarm/static/rest_mode/js/ui.js +265 -0
- swarm/static/rest_mode/js/validation.js +57 -0
- swarm/static/rest_mode/svg/animated_spinner.svg +12 -0
- swarm/static/rest_mode/svg/arrow_down.svg +5 -0
- swarm/static/rest_mode/svg/arrow_left.svg +5 -0
- swarm/static/rest_mode/svg/arrow_right.svg +5 -0
- swarm/static/rest_mode/svg/arrow_up.svg +5 -0
- swarm/static/rest_mode/svg/attach.svg +8 -0
- swarm/static/rest_mode/svg/avatar.svg +7 -0
- swarm/static/rest_mode/svg/canvas.svg +6 -0
- swarm/static/rest_mode/svg/chat_history.svg +4 -0
- swarm/static/rest_mode/svg/close.svg +5 -0
- swarm/static/rest_mode/svg/copy.svg +4 -0
- swarm/static/rest_mode/svg/dark_mode.svg +3 -0
- swarm/static/rest_mode/svg/edit.svg +5 -0
- swarm/static/rest_mode/svg/layout.svg +9 -0
- swarm/static/rest_mode/svg/logo.svg +29 -0
- swarm/static/rest_mode/svg/logout.svg +5 -0
- swarm/static/rest_mode/svg/mobile.svg +5 -0
- swarm/static/rest_mode/svg/new_chat.svg +4 -0
- swarm/static/rest_mode/svg/not_visible.svg +5 -0
- swarm/static/rest_mode/svg/plus.svg +7 -0
- swarm/static/rest_mode/svg/run_code.svg +6 -0
- swarm/static/rest_mode/svg/save.svg +4 -0
- swarm/static/rest_mode/svg/search.svg +6 -0
- swarm/static/rest_mode/svg/settings.svg +4 -0
- swarm/static/rest_mode/svg/speaker.svg +5 -0
- swarm/static/rest_mode/svg/stop.svg +6 -0
- swarm/static/rest_mode/svg/thumbs_down.svg +3 -0
- swarm/static/rest_mode/svg/thumbs_up.svg +3 -0
- swarm/static/rest_mode/svg/toggle_off.svg +6 -0
- swarm/static/rest_mode/svg/toggle_on.svg +6 -0
- swarm/static/rest_mode/svg/trash.svg +10 -0
- swarm/static/rest_mode/svg/undo.svg +3 -0
- swarm/static/rest_mode/svg/visible.svg +8 -0
- swarm/static/rest_mode/svg/voice.svg +10 -0
- swarm/templates/account/login.html +22 -0
- swarm/templates/account/signup.html +32 -0
- swarm/templates/base.html +30 -0
- swarm/templates/chat.html +43 -0
- swarm/templates/index.html +35 -0
- swarm/templates/rest_mode/components/chat_sidebar.html +55 -0
- swarm/templates/rest_mode/components/header.html +45 -0
- swarm/templates/rest_mode/components/main_chat_pane.html +41 -0
- swarm/templates/rest_mode/components/settings_dialog.html +97 -0
- swarm/templates/rest_mode/components/splash_screen.html +7 -0
- swarm/templates/rest_mode/components/top_bar.html +28 -0
- swarm/templates/rest_mode/message_ui.html +50 -0
- swarm/templates/rest_mode/slackbot.html +30 -0
- swarm/templates/simple_blueprint_page.html +24 -0
- swarm/templates/websocket_partials/final_system_message.html +3 -0
- swarm/templates/websocket_partials/system_message.html +4 -0
- swarm/templates/websocket_partials/user_message.html +5 -0
- swarm/urls.py +57 -74
- swarm/utils/log_utils.py +63 -0
- swarm/views/api_views.py +48 -39
- swarm/views/chat_views.py +156 -70
- swarm/views/core_views.py +85 -90
- swarm/views/model_views.py +64 -121
- swarm/views/utils.py +65 -441
- open_swarm-0.1.1743070217.dist-info/METADATA +0 -258
- open_swarm-0.1.1743070217.dist-info/RECORD +0 -89
- open_swarm-0.1.1743070217.dist-info/entry_points.txt +0 -3
- open_swarm-0.1.1743070217.dist-info/top_level.txt +0 -1
- swarm/agent/agent.py +0 -49
- swarm/core.py +0 -326
- swarm/extensions/mcp/__init__.py +0 -1
- swarm/extensions/mcp/cache_utils.py +0 -36
- swarm/extensions/mcp/mcp_client.py +0 -341
- swarm/extensions/mcp/mcp_constants.py +0 -7
- swarm/extensions/mcp/mcp_tool_provider.py +0 -110
- swarm/types.py +0 -126
- {open_swarm-0.1.1743070217.dist-info → open_swarm-0.1.1743362777.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,135 @@
|
|
1
|
+
.container[data-theme-layout="messenger-layout"] {
|
2
|
+
display: flex;
|
3
|
+
height: 100vh;
|
4
|
+
}
|
5
|
+
|
6
|
+
.chat-history-pane {
|
7
|
+
width: 250px;
|
8
|
+
background: #361A42; /* Slack light sidebar purple */
|
9
|
+
color: #FFFFFF; /* White text */
|
10
|
+
padding: 10px;
|
11
|
+
display: flex;
|
12
|
+
flex-direction: column;
|
13
|
+
}
|
14
|
+
|
15
|
+
.chat-history-header {
|
16
|
+
display: flex;
|
17
|
+
align-items: center;
|
18
|
+
justify-content: flex-start;
|
19
|
+
padding: 10px 15px;
|
20
|
+
background: #361A42; /* Match sidebar */
|
21
|
+
border-bottom: 1px solid #4A2A55; /* Subtle purple border */
|
22
|
+
}
|
23
|
+
|
24
|
+
.chat-history-header > div {
|
25
|
+
display: flex;
|
26
|
+
flex-direction: row; /* Force horizontal */
|
27
|
+
align-items: center;
|
28
|
+
justify-content: flex-start;
|
29
|
+
gap: 10px;
|
30
|
+
flex-wrap: nowrap;
|
31
|
+
width: 100%;
|
32
|
+
}
|
33
|
+
|
34
|
+
.chat-history-header .input-button {
|
35
|
+
background: none;
|
36
|
+
border: none;
|
37
|
+
cursor: pointer;
|
38
|
+
padding: 8px;
|
39
|
+
display: flex;
|
40
|
+
align-items: center;
|
41
|
+
justify-content: center;
|
42
|
+
transition: background-color 0.3s, transform 0.2s;
|
43
|
+
}
|
44
|
+
|
45
|
+
.chat-history-header .input-button:hover {
|
46
|
+
background-color: rgba(255, 255, 255, 0.1); /* Light hover */
|
47
|
+
transform: scale(1.05);
|
48
|
+
}
|
49
|
+
|
50
|
+
.chat-history-header .input-button img {
|
51
|
+
width: 20px;
|
52
|
+
height: 20px;
|
53
|
+
filter: brightness(0) invert(1); /* White icons on purple */
|
54
|
+
}
|
55
|
+
|
56
|
+
.chat-history-list {
|
57
|
+
list-style: none;
|
58
|
+
padding: 0;
|
59
|
+
flex-grow: 1;
|
60
|
+
overflow-y: auto;
|
61
|
+
}
|
62
|
+
|
63
|
+
.chat-history-list li {
|
64
|
+
padding: 10px;
|
65
|
+
cursor: pointer;
|
66
|
+
color: #FFFFFF;
|
67
|
+
}
|
68
|
+
|
69
|
+
.chat-history-list li:hover {
|
70
|
+
background: #4A2A55; /* Darker purple hover */
|
71
|
+
}
|
72
|
+
|
73
|
+
.main-pane {
|
74
|
+
flex-grow: 1;
|
75
|
+
display: flex;
|
76
|
+
flex-direction: column;
|
77
|
+
background: #F5F5F5; /* Slack light main area */
|
78
|
+
color: #2E2E2E;
|
79
|
+
}
|
80
|
+
|
81
|
+
/* Dark Mode Adjustments */
|
82
|
+
[data-theme-dark="true"] .chat-history-pane {
|
83
|
+
background: #2E0F36; /* Slack dark sidebar purple */
|
84
|
+
}
|
85
|
+
|
86
|
+
[data-theme-dark="true"] .chat-history-header {
|
87
|
+
background: #2E0F36;
|
88
|
+
border-bottom: 1px solid #3F1A48;
|
89
|
+
}
|
90
|
+
|
91
|
+
[data-theme-dark="true"] .chat-history-header .input-button:hover {
|
92
|
+
background-color: rgba(255, 255, 255, 0.2); /* Light hover in dark mode */
|
93
|
+
}
|
94
|
+
|
95
|
+
[data-theme-dark="true"] .main-pane {
|
96
|
+
background: #2E2E2E; /* Slack dark main area */
|
97
|
+
color: #E0E0E0;
|
98
|
+
}
|
99
|
+
|
100
|
+
.message-container {
|
101
|
+
flex-grow: 1;
|
102
|
+
overflow-y: auto;
|
103
|
+
padding: 20px;
|
104
|
+
}
|
105
|
+
|
106
|
+
.user-message {
|
107
|
+
background: #DCF8C6;
|
108
|
+
padding: 10px;
|
109
|
+
margin: 5px 0;
|
110
|
+
border-radius: 5px;
|
111
|
+
align-self: flex-end;
|
112
|
+
max-width: 70%;
|
113
|
+
}
|
114
|
+
|
115
|
+
.assistant-message {
|
116
|
+
background: #E6E6E6;
|
117
|
+
padding: 10px;
|
118
|
+
margin: 5px 0;
|
119
|
+
border-radius: 5px;
|
120
|
+
align-self: flex-start;
|
121
|
+
max-width: 70%;
|
122
|
+
}
|
123
|
+
|
124
|
+
.error-message {
|
125
|
+
background: #F8D7DA;
|
126
|
+
color: #721C24;
|
127
|
+
padding: 10px;
|
128
|
+
margin: 5px 0;
|
129
|
+
border-radius: 5px;
|
130
|
+
}
|
131
|
+
|
132
|
+
.send-container {
|
133
|
+
padding: 10px;
|
134
|
+
border-top: 1px solid #ddd;
|
135
|
+
}
|
@@ -0,0 +1,91 @@
|
|
1
|
+
/* Full-Screen Settings Pane */
|
2
|
+
.settings-dialog {
|
3
|
+
position: fixed;
|
4
|
+
top: 10%; /* Leave 10% margin from the top */
|
5
|
+
left: 10%; /* Leave 10% margin from the left */
|
6
|
+
width: 80%; /* Take up 80% of the viewport width */
|
7
|
+
height: 80%; /* Take up 80% of the viewport height */
|
8
|
+
background-color: var(--bg-primary); /* Match app's primary background color */
|
9
|
+
border-radius: 8px; /* Slightly rounded corners */
|
10
|
+
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); /* Subtle shadow for pop-out effect */
|
11
|
+
z-index: 1000; /* Higher than other elements */
|
12
|
+
overflow-y: auto; /* Scroll if content overflows */
|
13
|
+
padding: 20px;
|
14
|
+
display: none; /* Initially hidden */
|
15
|
+
}
|
16
|
+
|
17
|
+
/* Visible settings pane */
|
18
|
+
.settings-pane.visible {
|
19
|
+
display: block; /* Make visible when toggled */
|
20
|
+
}
|
21
|
+
|
22
|
+
/* Overlay to dim the background */
|
23
|
+
.settings-overlay {
|
24
|
+
position: fixed;
|
25
|
+
top: 0;
|
26
|
+
left: 0;
|
27
|
+
width: 100vw; /* Full viewport width */
|
28
|
+
height: 100vh; /* Full viewport height */
|
29
|
+
background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent black */
|
30
|
+
z-index: 999; /* Just below the settings pane */
|
31
|
+
display: none; /* Initially hidden */
|
32
|
+
}
|
33
|
+
|
34
|
+
/* Show overlay when settings are active */
|
35
|
+
.settings-overlay.visible {
|
36
|
+
display: block;
|
37
|
+
}
|
38
|
+
|
39
|
+
/* Shaded Container for Settings Sections */
|
40
|
+
.settings-container-section {
|
41
|
+
margin-bottom: 15px;
|
42
|
+
padding: 10px;
|
43
|
+
border-radius: 8px;
|
44
|
+
border: 1px solid var(--border-primary, #ccc);
|
45
|
+
}
|
46
|
+
|
47
|
+
/* Collapsible Sections */
|
48
|
+
.collapsible-toggle {
|
49
|
+
cursor: pointer;
|
50
|
+
font-weight: bold;
|
51
|
+
margin-bottom: 5px;
|
52
|
+
display: flex;
|
53
|
+
justify-content: space-between;
|
54
|
+
align-items: center;
|
55
|
+
}
|
56
|
+
|
57
|
+
.collapsible-content.hidden {
|
58
|
+
display: none;
|
59
|
+
}
|
60
|
+
|
61
|
+
/* Inline Toggle Alignment */
|
62
|
+
.toggle-title, .nested-toggle {
|
63
|
+
display: flex;
|
64
|
+
align-items: center; /* Align items vertically */
|
65
|
+
justify-content: space-between; /* Push toggle to the right */
|
66
|
+
padding: 5px 0; /* Add vertical spacing */
|
67
|
+
}
|
68
|
+
|
69
|
+
.toggle-title label, .nested-toggle label {
|
70
|
+
font-weight: bold;
|
71
|
+
color: var(--text-primary, #333); /* Default text color */
|
72
|
+
flex: 1; /* Take up available space */
|
73
|
+
margin-right: 10px; /* Add space between label and toggle */
|
74
|
+
}
|
75
|
+
|
76
|
+
/* SVG Toggles */
|
77
|
+
.svg-toggle {
|
78
|
+
width: 40px; /* Adjust toggle size */
|
79
|
+
height: 20px;
|
80
|
+
cursor: pointer;
|
81
|
+
}
|
82
|
+
|
83
|
+
.svg-toggle img {
|
84
|
+
width: 100%;
|
85
|
+
height: auto;
|
86
|
+
}
|
87
|
+
|
88
|
+
.svg-toggle.disabled {
|
89
|
+
opacity: 0.5;
|
90
|
+
pointer-events: none;
|
91
|
+
}
|
@@ -0,0 +1,44 @@
|
|
1
|
+
.container[data-theme-layout="simple-layout"] {
|
2
|
+
display: flex;
|
3
|
+
height: 100vh;
|
4
|
+
justify-content: center;
|
5
|
+
align-items: center;
|
6
|
+
}
|
7
|
+
.main-pane {
|
8
|
+
width: 80%;
|
9
|
+
max-width: 800px;
|
10
|
+
display: flex;
|
11
|
+
flex-direction: column;
|
12
|
+
}
|
13
|
+
.message-container {
|
14
|
+
flex-grow: 1;
|
15
|
+
overflow-y: auto;
|
16
|
+
padding: 20px;
|
17
|
+
}
|
18
|
+
.user-message {
|
19
|
+
background: #DCF8C6;
|
20
|
+
padding: 10px;
|
21
|
+
margin: 5px 0;
|
22
|
+
border-radius: 5px;
|
23
|
+
align-self: flex-end;
|
24
|
+
max-width: 70%;
|
25
|
+
}
|
26
|
+
.assistant-message {
|
27
|
+
background: #E6E6E6;
|
28
|
+
padding: 10px;
|
29
|
+
margin: 5px 0;
|
30
|
+
border-radius: 5px;
|
31
|
+
align-self: flex-start;
|
32
|
+
max-width: 70%;
|
33
|
+
}
|
34
|
+
.error-message {
|
35
|
+
background: #F8D7DA;
|
36
|
+
color: #721C24;
|
37
|
+
padding: 10px;
|
38
|
+
margin: 5px 0;
|
39
|
+
border-radius: 5px;
|
40
|
+
}
|
41
|
+
.send-container {
|
42
|
+
padding: 10px;
|
43
|
+
border-top: 1px solid #ddd;
|
44
|
+
}
|
@@ -0,0 +1,58 @@
|
|
1
|
+
.container[data-theme-layout="slack-layout"] {
|
2
|
+
display: flex;
|
3
|
+
height: 100vh;
|
4
|
+
}
|
5
|
+
.channel-pane {
|
6
|
+
width: 250px;
|
7
|
+
background: #3F0E40;
|
8
|
+
color: white;
|
9
|
+
padding: 10px;
|
10
|
+
}
|
11
|
+
.channel-list {
|
12
|
+
list-style: none;
|
13
|
+
padding: 0;
|
14
|
+
}
|
15
|
+
.channel-list li {
|
16
|
+
padding: 10px;
|
17
|
+
cursor: pointer;
|
18
|
+
}
|
19
|
+
.channel-list li:hover {
|
20
|
+
background: #522653;
|
21
|
+
}
|
22
|
+
.main-pane {
|
23
|
+
flex-grow: 1;
|
24
|
+
display: flex;
|
25
|
+
flex-direction: column;
|
26
|
+
}
|
27
|
+
.message-container {
|
28
|
+
flex-grow: 1;
|
29
|
+
overflow-y: auto;
|
30
|
+
padding: 20px;
|
31
|
+
}
|
32
|
+
.user-message {
|
33
|
+
background: #DCF8C6;
|
34
|
+
padding: 10px;
|
35
|
+
margin: 5px 0;
|
36
|
+
border-radius: 5px;
|
37
|
+
align-self: flex-end;
|
38
|
+
max-width: 70%;
|
39
|
+
}
|
40
|
+
.assistant-message {
|
41
|
+
background: #E6E6E6;
|
42
|
+
padding: 10px;
|
43
|
+
margin: 5px 0;
|
44
|
+
border-radius: 5px;
|
45
|
+
align-self: flex-start;
|
46
|
+
max-width: 70%;
|
47
|
+
}
|
48
|
+
.error-message {
|
49
|
+
background: #F8D7DA;
|
50
|
+
color: #721C24;
|
51
|
+
padding: 10px;
|
52
|
+
margin: 5px 0;
|
53
|
+
border-radius: 5px;
|
54
|
+
}
|
55
|
+
.send-container {
|
56
|
+
padding: 10px;
|
57
|
+
border-top: 1px solid #ddd;
|
58
|
+
}
|
@@ -0,0 +1,156 @@
|
|
1
|
+
/* style.css - Shared Styles and Modular Imports */
|
2
|
+
|
3
|
+
/* Modular Imports */
|
4
|
+
@import './layout.css';
|
5
|
+
@import './theme.css';
|
6
|
+
@import './toast.css';
|
7
|
+
|
8
|
+
/* Base Styles */
|
9
|
+
* {
|
10
|
+
box-sizing: border-box;
|
11
|
+
margin: 0;
|
12
|
+
padding: 0;
|
13
|
+
}
|
14
|
+
|
15
|
+
body {
|
16
|
+
font-family: Arial, sans-serif;
|
17
|
+
border-style: solid;
|
18
|
+
border-width: 0 0 0 0;
|
19
|
+
background-color: var(--bg-primary);
|
20
|
+
box-sizing: border-box;
|
21
|
+
margin: 0 0 0 0;
|
22
|
+
color: var(--text-primary);
|
23
|
+
height: 100vh;
|
24
|
+
justify-content: center;
|
25
|
+
align-items: center;
|
26
|
+
transition: background-color var(--transition-duration), color var(--transition-duration);
|
27
|
+
overflow-x: visible;
|
28
|
+
overflow-y: visible;
|
29
|
+
}
|
30
|
+
|
31
|
+
/* Sidebar Reveal Buttons */
|
32
|
+
.sidebar-reveal-btn {
|
33
|
+
position: absolute;
|
34
|
+
top: 10px; /* Adjusted from 20px */
|
35
|
+
z-index: 1000;
|
36
|
+
background-color: var(--button-primary);
|
37
|
+
color: #fff;
|
38
|
+
border: none;
|
39
|
+
border-radius: 50%;
|
40
|
+
width: 40px;
|
41
|
+
height: 40px;
|
42
|
+
cursor: pointer;
|
43
|
+
transition: background-color var(--transition-duration) ease;
|
44
|
+
font-size: 1em;
|
45
|
+
display: flex;
|
46
|
+
align-items: center;
|
47
|
+
justify-content: center;
|
48
|
+
opacity: 0.7; /* Dimmed by default */
|
49
|
+
}
|
50
|
+
|
51
|
+
.sidebar-reveal-btn:hover {
|
52
|
+
opacity: 1; /* Fully visible on hover */
|
53
|
+
}
|
54
|
+
|
55
|
+
.sidebar-reveal-btn + .sidebar-reveal-btn {
|
56
|
+
top: 60px; /* Reduced gap between buttons */
|
57
|
+
opacity: 0.7;
|
58
|
+
}
|
59
|
+
|
60
|
+
.sidebar-reveal-btn:hover + .sidebar-reveal-btn {
|
61
|
+
opacity: 1;
|
62
|
+
}
|
63
|
+
|
64
|
+
/* Toast Container */
|
65
|
+
.toast-container {
|
66
|
+
position: fixed;
|
67
|
+
top: 20px;
|
68
|
+
right: 20px;
|
69
|
+
z-index: 10000;
|
70
|
+
display: flex;
|
71
|
+
flex-direction: column;
|
72
|
+
gap: 10px;
|
73
|
+
}
|
74
|
+
|
75
|
+
/* Logo Styling */
|
76
|
+
.chat-logo {
|
77
|
+
width: 90px;
|
78
|
+
height: 90px;
|
79
|
+
display: block;
|
80
|
+
margin: 0 auto;
|
81
|
+
}
|
82
|
+
|
83
|
+
.logo-container {
|
84
|
+
text-align: center;
|
85
|
+
margin: 20px auto;
|
86
|
+
}
|
87
|
+
|
88
|
+
/* Form Container Adjustments */
|
89
|
+
.form-container {
|
90
|
+
display: flex;
|
91
|
+
flex-direction: column;
|
92
|
+
align-items: stretch;
|
93
|
+
gap: 5px;
|
94
|
+
width: 100%;
|
95
|
+
padding: 10px;
|
96
|
+
border-radius: 8px;
|
97
|
+
box-sizing: border-box;
|
98
|
+
}
|
99
|
+
|
100
|
+
/* Input and Submit Button Row */
|
101
|
+
.send-container {
|
102
|
+
display: flex;
|
103
|
+
align-items: stretch;
|
104
|
+
width: 100%;
|
105
|
+
margin-bottom: 5px;
|
106
|
+
position: relative;
|
107
|
+
border-radius: 20px;
|
108
|
+
overflow: hidden;
|
109
|
+
padding: 0; /* Remove extra padding causing gap */
|
110
|
+
}
|
111
|
+
|
112
|
+
/* Input Field Styling */
|
113
|
+
.rounded-input {
|
114
|
+
flex-grow: 1;
|
115
|
+
border: none;
|
116
|
+
border-radius: 0;
|
117
|
+
outline: none;
|
118
|
+
box-sizing: border-box;
|
119
|
+
font-size: 18px;
|
120
|
+
margin: 0;
|
121
|
+
width: 100%;
|
122
|
+
color: var(--text-primary);
|
123
|
+
background-color: var(--bg-secondary);
|
124
|
+
padding: 10px 15px; /* Ensure padding is consistent */
|
125
|
+
}
|
126
|
+
|
127
|
+
/* Submit Button Styling */
|
128
|
+
.half-cut-button {
|
129
|
+
padding: 0 20px;
|
130
|
+
background-color: #707070;
|
131
|
+
color: white;
|
132
|
+
border: none;
|
133
|
+
border-radius: 0;
|
134
|
+
cursor: pointer;
|
135
|
+
font-size: 16px;
|
136
|
+
font-weight: bold;
|
137
|
+
white-space: nowrap;
|
138
|
+
display: flex;
|
139
|
+
align-items: center;
|
140
|
+
justify-content: center;
|
141
|
+
height: auto;
|
142
|
+
transition: background-color 0.3s ease;
|
143
|
+
margin: 0;
|
144
|
+
}
|
145
|
+
|
146
|
+
.send-container .rounded-input {
|
147
|
+
border-radius: 20px 0 0 20px;
|
148
|
+
}
|
149
|
+
|
150
|
+
.send-container .half-cut-button {
|
151
|
+
border-radius: 0 20px 20px 0;
|
152
|
+
}
|
153
|
+
|
154
|
+
.half-cut-button:hover {
|
155
|
+
background-color: #505050;
|
156
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
/* theme.css - Theme Variables and Colors */
|
2
|
+
|
3
|
+
/* Light Mode Variables */
|
4
|
+
:root {
|
5
|
+
--bg-primary: #ffffff;
|
6
|
+
--bg-container: #f0f8ff;
|
7
|
+
--text-primary: #333333;
|
8
|
+
--text-secondary: #666666;
|
9
|
+
--border-color: #d3d3d3;
|
10
|
+
--button-primary: #87cefa;
|
11
|
+
--button-hover: #00bfff;
|
12
|
+
--bg-hover: #e6f7ff; /* Light hover for messages */
|
13
|
+
--bg-message-other: #f9f9f9; /* Subtle contrast for message toolbars */
|
14
|
+
--transition-duration: 0.3s;
|
15
|
+
|
16
|
+
--icon-size: 1.5rem; /* Shared size for SVG icons */
|
17
|
+
}
|
18
|
+
|
19
|
+
/* Dark Mode Variables */
|
20
|
+
[data-theme-dark="true"] {
|
21
|
+
--bg-primary: #1a1a1a;
|
22
|
+
--bg-container: #2a2a2a;
|
23
|
+
--text-primary: #f0f0f0;
|
24
|
+
--text-secondary: #bbbbbb;
|
25
|
+
--border-color: #555555;
|
26
|
+
--button-primary: #00bfff;
|
27
|
+
--button-hover: #87cefa;
|
28
|
+
--bg-hover: #333333; /* Dark hover for messages */
|
29
|
+
--bg-message-other: #444444; /* Subtle contrast for message toolbars */
|
30
|
+
}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
#toastContainer {
|
2
|
+
position: fixed;
|
3
|
+
top: 20px;
|
4
|
+
right: 20px;
|
5
|
+
z-index: 9999;
|
6
|
+
display: flex;
|
7
|
+
flex-direction: column;
|
8
|
+
gap: 10px;
|
9
|
+
}
|
10
|
+
|
11
|
+
.toast {
|
12
|
+
padding: 10px 15px;
|
13
|
+
border-radius: 5px;
|
14
|
+
color: white;
|
15
|
+
font-size: 0.9rem;
|
16
|
+
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
|
17
|
+
opacity: 1;
|
18
|
+
transition: opacity 0.5s ease-out;
|
19
|
+
}
|
20
|
+
|
21
|
+
.toast.info {
|
22
|
+
background-color: #007bff; /* Blue for info */
|
23
|
+
}
|
24
|
+
|
25
|
+
.toast.success {
|
26
|
+
background-color: #28a745; /* Green for success */
|
27
|
+
}
|
28
|
+
|
29
|
+
.toast.error {
|
30
|
+
background-color: #dc3545; /* Red for error */
|
31
|
+
}
|
32
|
+
|
33
|
+
.toast.warning {
|
34
|
+
background-color: #ffc107; /* Yellow for warning */
|
35
|
+
}
|
36
|
+
|
37
|
+
/* Fade-out animation */
|
38
|
+
.toast.fade-out {
|
39
|
+
opacity: 0;
|
40
|
+
}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import { showToast } from './toast.js';
|
2
|
+
|
3
|
+
const DEBUG_MODE = true;
|
4
|
+
|
5
|
+
/**
|
6
|
+
* Logs debug messages if debug mode is enabled.
|
7
|
+
* @param {string} message - The message to log.
|
8
|
+
* @param {any} data - Additional data to include in the log.
|
9
|
+
*/
|
10
|
+
function debugLog(message, data = null) {
|
11
|
+
if (DEBUG_MODE) {
|
12
|
+
console.log(`[DEBUG] ${message}`, data);
|
13
|
+
showToast(`${message}`, "info");
|
14
|
+
}
|
15
|
+
}
|
16
|
+
|
17
|
+
/**
|
18
|
+
* Fetches the list of blueprints (models) from the server.
|
19
|
+
* @returns {Promise<Array>} - A promise resolving to the list of blueprints.
|
20
|
+
*/
|
21
|
+
export async function fetchBlueprints() {
|
22
|
+
debugLog("Fetching blueprints from /v1/models/...");
|
23
|
+
try {
|
24
|
+
const response = await fetch('/v1/models/');
|
25
|
+
if (!response.ok) throw new Error(`HTTP Error: ${response.status}`);
|
26
|
+
|
27
|
+
const data = await response.json();
|
28
|
+
debugLog("Blueprints fetched successfully.", data);
|
29
|
+
|
30
|
+
// Show an info notification
|
31
|
+
showToast("Blueprints fetched successfully.", "success", 5000);
|
32
|
+
|
33
|
+
return data.data || [];
|
34
|
+
} catch (error) {
|
35
|
+
console.error("Error fetching blueprints:", error);
|
36
|
+
// Show an error notification
|
37
|
+
showToast("Error fetching blueprints.", "error");
|
38
|
+
throw error;
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
@@ -0,0 +1,12 @@
|
|
1
|
+
export async function fetchBlueprints() {
|
2
|
+
try {
|
3
|
+
const response = await fetch('/v1/models/');
|
4
|
+
if (!response.ok) throw new Error(`HTTP error! Status: ${response.status}`);
|
5
|
+
const data = await response.json();
|
6
|
+
console.log('Raw blueprint data:', data);
|
7
|
+
return data.data.filter(model => model.object === 'model');
|
8
|
+
} catch (error) {
|
9
|
+
console.error('Error fetching blueprints:', error);
|
10
|
+
return [];
|
11
|
+
}
|
12
|
+
}
|
@@ -0,0 +1,79 @@
|
|
1
|
+
async function fetchBlueprints() {
|
2
|
+
const response = await fetch('/v1/models/');
|
3
|
+
const data = await response.json();
|
4
|
+
return data.data.filter(model => model.object === 'model');
|
5
|
+
}
|
6
|
+
|
7
|
+
function populateBlueprintDropdown(blueprints) {
|
8
|
+
const dropdown = document.getElementById('blueprintDropdown');
|
9
|
+
dropdown.innerHTML = '<option value="">Select a Blueprint</option>';
|
10
|
+
blueprints.forEach(bp => {
|
11
|
+
const option = document.createElement('option');
|
12
|
+
option.value = bp.id;
|
13
|
+
option.textContent = bp.title;
|
14
|
+
dropdown.appendChild(option);
|
15
|
+
});
|
16
|
+
}
|
17
|
+
|
18
|
+
let currentBlueprint = null;
|
19
|
+
let currentMode = 'default';
|
20
|
+
function switchBlueprint(blueprintId) {
|
21
|
+
currentBlueprint = blueprintId;
|
22
|
+
document.getElementById('messageHistory').innerHTML = '';
|
23
|
+
document.getElementById('blueprintTitle').textContent = blueprintId || 'No Blueprint Selected';
|
24
|
+
console.log(`Switched to blueprint: ${blueprintId}, mode: ${currentMode}`);
|
25
|
+
}
|
26
|
+
|
27
|
+
function setMode(mode) {
|
28
|
+
currentMode = mode;
|
29
|
+
console.log(`Mode set to: ${mode}`);
|
30
|
+
}
|
31
|
+
|
32
|
+
async function handleSubmit(event) {
|
33
|
+
event.preventDefault();
|
34
|
+
const input = document.getElementById('userInput');
|
35
|
+
const message = input.value.trim();
|
36
|
+
if (!message || !currentBlueprint) {
|
37
|
+
console.log('No message or blueprint selected');
|
38
|
+
return;
|
39
|
+
}
|
40
|
+
|
41
|
+
input.value = '';
|
42
|
+
const history = document.getElementById('messageHistory');
|
43
|
+
history.innerHTML += `<div class="user-message">${message} (Mode: ${currentMode})</div>`;
|
44
|
+
|
45
|
+
try {
|
46
|
+
const response = await fetch('/v1/chat/completions/', {
|
47
|
+
method: 'POST',
|
48
|
+
headers: {
|
49
|
+
'Content-Type': 'application/json',
|
50
|
+
'X-CSRFToken': document.querySelector('meta[name="csrf-token"]').content
|
51
|
+
},
|
52
|
+
body: JSON.stringify({
|
53
|
+
model: currentBlueprint,
|
54
|
+
messages: [{ role: 'user', content: message }],
|
55
|
+
context_variables: { mode: currentMode }
|
56
|
+
})
|
57
|
+
});
|
58
|
+
const data = await response.json();
|
59
|
+
history.innerHTML += `<div class="assistant-message">${data.choices[0].message.content}</div>`;
|
60
|
+
history.scrollTop = history.scrollHeight;
|
61
|
+
} catch (error) {
|
62
|
+
history.innerHTML += `<div class="error-message">Error: ${error.message}</div>`;
|
63
|
+
}
|
64
|
+
}
|
65
|
+
|
66
|
+
document.addEventListener('DOMContentLoaded', async () => {
|
67
|
+
const blueprints = await fetchBlueprints();
|
68
|
+
populateBlueprintDropdown(blueprints);
|
69
|
+
if (blueprints.length > 0) switchBlueprint(blueprints[0].id);
|
70
|
+
|
71
|
+
document.getElementById('blueprintDropdown').addEventListener('change', (e) => switchBlueprint(e.target.value));
|
72
|
+
document.querySelectorAll('.mode-button').forEach(button => {
|
73
|
+
button.addEventListener('click', () => setMode(button.dataset.mode));
|
74
|
+
});
|
75
|
+
document.getElementById('sendButton')?.addEventListener('click', handleSubmit);
|
76
|
+
document.getElementById('userInput').addEventListener('keypress', (e) => {
|
77
|
+
if (e.key === 'Enter') handleSubmit(e);
|
78
|
+
});
|
79
|
+
});
|