django-agent-studio 0.1.0__py3-none-any.whl → 0.1.4__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.
@@ -277,11 +277,33 @@
277
277
  <span class="text-lg">🧪</span>
278
278
  <h2 class="font-medium text-gray-700">Test Your Agent</h2>
279
279
  </div>
280
- <button @click="refreshTestAgent"
281
- class="text-gray-500 hover:text-gray-700 p-1 rounded hover:bg-gray-200"
282
- title="Refresh agent config">
283
- <i class="pi pi-refresh text-sm"></i>
284
- </button>
280
+ <div class="flex items-center space-x-3">
281
+ <!-- Auth Mode Toggle -->
282
+ <div class="flex items-center space-x-2 text-xs">
283
+ <span class="text-gray-500">Test as:</span>
284
+ <button @click="setTestAuthMode('authenticated')"
285
+ :class="testAuthMode === 'authenticated'
286
+ ? 'bg-blue-100 text-blue-700 border-blue-300'
287
+ : 'bg-white text-gray-600 border-gray-300 hover:bg-gray-50'"
288
+ class="px-2 py-1 border rounded-l text-xs font-medium transition-colors"
289
+ title="Test as logged-in user (memories will be saved to your account)">
290
+ <i class="pi pi-user text-xs mr-1"></i>Logged In
291
+ </button>
292
+ <button @click="setTestAuthMode('anonymous')"
293
+ :class="testAuthMode === 'anonymous'
294
+ ? 'bg-orange-100 text-orange-700 border-orange-300'
295
+ : 'bg-white text-gray-600 border-gray-300 hover:bg-gray-50'"
296
+ class="px-2 py-1 border border-l-0 rounded-r text-xs font-medium transition-colors"
297
+ title="Test as anonymous visitor (no persistent memories)">
298
+ <i class="pi pi-eye-slash text-xs mr-1"></i>Anonymous
299
+ </button>
300
+ </div>
301
+ <button @click="refreshTestAgent"
302
+ class="text-gray-500 hover:text-gray-700 p-1 rounded hover:bg-gray-200"
303
+ title="Refresh agent config">
304
+ <i class="pi pi-refresh text-sm"></i>
305
+ </button>
306
+ </div>
285
307
  </div>
286
308
  <div class="flex-1 relative bg-gray-100">
287
309
  <div id="test-chat-container" class="absolute inset-0"></div>
@@ -638,7 +660,7 @@ const agentConfig = {
638
660
  const backendUrl = window.location.origin;
639
661
 
640
662
  // Initialize the test agent chat widget
641
- function initTestChat(agentSlug = null) {
663
+ function initTestChat(agentSlug = null, authMode = 'authenticated', anonymousToken = null) {
642
664
  const container = document.getElementById('test-chat-container');
643
665
  if (!container) return; // Container not ready yet
644
666
 
@@ -664,18 +686,29 @@ function initTestChat(agentSlug = null) {
664
686
  window.testChatWidget.destroy();
665
687
  }
666
688
 
689
+ // Configure auth based on mode
690
+ const authConfig = authMode === 'anonymous'
691
+ ? {
692
+ authStrategy: 'anonymous',
693
+ authToken: anonymousToken,
694
+ anonymousSessionEndpoint: '/api/accounts/anonymous-session/',
695
+ }
696
+ : {
697
+ authStrategy: 'session',
698
+ };
699
+
667
700
  window.testChatWidget = ChatWidget.createInstance({
668
701
  containerId: 'test-chat-container',
669
702
  backendUrl: backendUrl,
670
703
  agentKey: slugToUse,
671
- title: 'Test Agent',
672
- primaryColor: '#3b82f6',
704
+ title: authMode === 'anonymous' ? 'Test Agent (Anonymous)' : 'Test Agent',
705
+ primaryColor: authMode === 'anonymous' ? '#f97316' : '#3b82f6',
673
706
  showClearButton: true,
674
707
  showDebugButton: true,
675
708
  showExpandButton: false,
676
709
  showModelSelector: true,
677
710
  embedded: true,
678
- authStrategy: 'session',
711
+ ...authConfig,
679
712
  apiPaths: {
680
713
  runs: '/api/agent-runtime/runs/',
681
714
  runEvents: '/api/agent-runtime/runs/{runId}/events/',
@@ -790,6 +823,9 @@ createApp({
790
823
  deleteConfirmOpen: false,
791
824
  deleteConfirmMessage: '',
792
825
  deleteConfirmCallback: null,
826
+ // Test auth mode
827
+ testAuthMode: 'authenticated',
828
+ anonymousToken: null,
793
829
  }
794
830
  },
795
831
  computed: {
@@ -937,7 +973,30 @@ createApp({
937
973
 
938
974
  refreshTestAgent() {
939
975
  const agent = this.selectedAgent;
940
- initTestChat(agent ? agent.slug : null);
976
+ initTestChat(agent ? agent.slug : null, this.testAuthMode, this.anonymousToken);
977
+ },
978
+
979
+ async setTestAuthMode(mode) {
980
+ this.testAuthMode = mode;
981
+
982
+ // If switching to anonymous and we don't have a token, create one
983
+ if (mode === 'anonymous' && !this.anonymousToken) {
984
+ try {
985
+ const response = await fetch('/api/accounts/anonymous-session/', {
986
+ method: 'POST',
987
+ headers: { 'Content-Type': 'application/json' },
988
+ });
989
+ if (response.ok) {
990
+ const data = await response.json();
991
+ this.anonymousToken = data.token;
992
+ }
993
+ } catch (e) {
994
+ console.warn('Failed to create anonymous session:', e);
995
+ }
996
+ }
997
+
998
+ // Refresh the test chat with new auth mode
999
+ this.refreshTestAgent();
941
1000
  },
942
1001
 
943
1002
  refreshBuilderChat() {
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: django-agent-studio
3
- Version: 0.1.0
3
+ Version: 0.1.4
4
4
  Summary: Visual agent builder and management studio for Django - build custom GPTs with a two-pane interface
5
5
  Author: Chris Barry
6
6
  License-Expression: MIT
@@ -2,6 +2,9 @@ django_agent_studio/__init__.py,sha256=E2vGoil7ZmwTebaB5ap9Lt0ptAzqYB5xJpyi4bFbq
2
2
  django_agent_studio/apps.py,sha256=L89QWn4XOvPBs2z6qHAhaE4uZQpasJntYD75aSd2p_k,607
3
3
  django_agent_studio/urls.py,sha256=O_rrobaxpmg8gR0JmeUzQ0TI3E8mGdcz27p4OJlcI8s,743
4
4
  django_agent_studio/views.py,sha256=bQxSIeL9-D4MzKwWkeHEFXrzo1CD911qicrt_A8t_6M,3153
5
+ django_agent_studio/agents/__init__.py,sha256=VYL_ato0DtggIo4BGRkyiz9cm1ARPXhhTQFzoG__NVM,800
6
+ django_agent_studio/agents/builder.py,sha256=aUH5swcBYKmVByB2C9cMoTDmoGhvxmXDM0BXY6_ut1k,77147
7
+ django_agent_studio/agents/dynamic.py,sha256=M1pSfwfujKKikdDZPcEcd7DCsM-0ZTWGRvEC9HuIWMs,13681
5
8
  django_agent_studio/api/__init__.py,sha256=vtBwuvBENyFFhFqCWyFsI6cYu4N9ZGqSMmHIRhr9a_U,45
6
9
  django_agent_studio/api/permissions.py,sha256=MutmA8TxZb4ZwGfeEoolK-QI04Gbcxs7DPNzkXe_Bss,5302
7
10
  django_agent_studio/api/serializers.py,sha256=rkn9xtACbJZlCBr6TLD5r-HsE1AWlaX39WYegtwEIig,18268
@@ -9,15 +12,21 @@ django_agent_studio/api/urls.py,sha256=q5pNIc3IRSZA3P-MMl4DoOj4InsqptcAp2HlDBUIV
9
12
  django_agent_studio/api/views.py,sha256=sR47fQFxXOOvEmybYr4vGc8dwGn1t-5BzEZGQnISBcg,54848
10
13
  django_agent_studio/management/__init__.py,sha256=6O9RHMN_xMDrEzKWytpai6QqgTXZVqwRg4h9mIQWtA8,52
11
14
  django_agent_studio/management/commands/__init__.py,sha256=6O9RHMN_xMDrEzKWytpai6QqgTXZVqwRg4h9mIQWtA8,52
15
+ django_agent_studio/migrations/0001_initial.py,sha256=ThIhf1X6ZaACQd-5GjJG-MDjIm6ETl0Nc2hcYK0L2Wg,4292
16
+ django_agent_studio/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
+ django_agent_studio/models/__init__.py,sha256=WHG-kXQ0NlooRn0SBu9DddbURTY-oo9jFH2pr3S7LRA,347
18
+ django_agent_studio/models/permissions.py,sha256=NepltvQzeehv5EwcOTqULj8n3N5XGVTeFaZjoPJJxtk,6060
19
+ django_agent_studio/services/__init__.py,sha256=06cc1eLnAbROTKFxBgvkeCpsYV5cQsyJVGXaE_rcp3M,244
20
+ django_agent_studio/services/permissions.py,sha256=-cwe0YZCFBFYh_ScXKncsPwEkCfEyIrtOzp8Wt9GSco,7785
12
21
  django_agent_studio/static/agent-frontend/chat-widget-markdown.js,sha256=_TQCux4HPRynCiLKydITO-docIRoi454jLpX0fegAFM,3722
13
- django_agent_studio/static/agent-frontend/chat-widget.css,sha256=GN58Zo9M0QAo8aMqYCE3ds-IDBFkUo37PLFg0W4bvmQ,25657
14
- django_agent_studio/static/agent-frontend/chat-widget.js,sha256=788K2EPphHUVZljRElnwlawCIVwWBPpLDDrLmA7mBoM,43849
22
+ django_agent_studio/static/agent-frontend/chat-widget.css,sha256=q8uUMiVEO5gaucJoiU46Qb4xDf4HnZIvG_1sedLwSJc,26607
23
+ django_agent_studio/static/agent-frontend/chat-widget.js,sha256=eZSRNwVi3ty9rxXA7BCPCU4yOCNc6xQwzXHv0Mz-gkY,45715
15
24
  django_agent_studio/templates/django_agent_studio/agent_list.html,sha256=Qw2Jz39qrde69mI4EjhfWyc5elyKcpFYhicrLqOJZzU,4521
16
- django_agent_studio/templates/django_agent_studio/base.html,sha256=GrNaBQZi9tdSBQbQLg7HvJd69Ae8Zww8np3xfkDXDC8,6029
17
- django_agent_studio/templates/django_agent_studio/builder.html,sha256=qy7ZymSSFG8YKIw-iFdtbCWHq5GpU7LD49SkVxE_iNk,58325
25
+ django_agent_studio/templates/django_agent_studio/base.html,sha256=rpHmr7CAWGwRkrk21p4KHvCS9m-IKT59T1meBaKZDOw,6028
26
+ django_agent_studio/templates/django_agent_studio/builder.html,sha256=L2KX-RLVpnC2mmYsIl_aSeJIc6b63knTYVrDg8aaU1g,61425
18
27
  django_agent_studio/templates/django_agent_studio/home.html,sha256=pgwKPjiQe9UxYYLGSsKT-6erEPDUdW9MZ5D-MOjIxK4,4385
19
28
  django_agent_studio/templates/django_agent_studio/test.html,sha256=h9aTtTD1eYcgG-n410qMSryHdpXyKny0hjiKYAoGsic,3779
20
- django_agent_studio-0.1.0.dist-info/METADATA,sha256=GPmaohLGFe_8PrlgrbCmii10ATvRztfbiQ7i3C7fmEE,11294
21
- django_agent_studio-0.1.0.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
22
- django_agent_studio-0.1.0.dist-info/top_level.txt,sha256=O1kqZzXPOsJlqnPSAcB2fH5WpJNY8ZNfHEJzX9_SZ0A,20
23
- django_agent_studio-0.1.0.dist-info/RECORD,,
29
+ django_agent_studio-0.1.4.dist-info/METADATA,sha256=WltdK6F9mB4hg3Koj_ydk-I6rEuzqPzqiBksIM0xiR0,11294
30
+ django_agent_studio-0.1.4.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
31
+ django_agent_studio-0.1.4.dist-info/top_level.txt,sha256=O1kqZzXPOsJlqnPSAcB2fH5WpJNY8ZNfHEJzX9_SZ0A,20
32
+ django_agent_studio-0.1.4.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.10.1)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5