mindroot 8.6.0__py3-none-any.whl → 8.8.0__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 mindroot might be problematic. Click here for more details.

@@ -1,17 +1,12 @@
1
1
  import { LitElement, html, css } from './lit-core.min.js';
2
2
  import { BaseEl } from './base.js';
3
3
  import './agent-form.js';
4
- import './agent-list.js';
5
4
  import './indexed-agents.js';
6
5
  import './github-import.js';
7
6
  import './missing-commands.js';
8
7
 
9
8
  class AgentEditor extends BaseEl {
10
9
  static properties = {
11
- agent: { type: Object, reflect: true },
12
- name: { type: String, reflect: true },
13
- agents: { type: Array, reflect: true },
14
- newAgent: { type: Boolean, reflect: true},
15
10
  loading: { type: Boolean, reflect: true },
16
11
  errorMessage: { type: String, reflect: true },
17
12
  importStatus: { type: String, reflect: true }
@@ -52,69 +47,15 @@ class AgentEditor extends BaseEl {
52
47
 
53
48
  constructor() {
54
49
  super();
55
- this.agent = {};
56
- this.agents = [];
57
50
  this.attachShadow({ mode: 'open' });
58
- this.newAgent = false;
59
51
  this.loading = false;
60
52
  this.errorMessage = '';
61
53
  this.importStatus = '';
62
- this.fetchAgents();
63
- }
64
-
65
- async fetchAgents() {
66
- try {
67
- this.loading = true;
68
- const response = await fetch('/agents/local');
69
- if (!response.ok) throw new Error('Failed to fetch agents');
70
- this.agents = await response.json();
71
- console.log({agents: this.agents})
72
- } catch (error) {
73
- this.errorMessage = `Error loading agents: ${error.message}`;
74
- } finally {
75
- this.loading = false;
76
- }
77
- }
78
-
79
- handleAgentSelected(e) {
80
- this.agent = e.detail;
81
- this.newAgent = false;
82
- this.name = e.detail.name;
83
- }
84
-
85
- handleNewAgent() {
86
- this.agent = {
87
- commands: [],
88
- preferred_providers: []
89
- };
90
- this.newAgent = true;
91
- this.name = '';
92
54
  }
93
55
 
94
56
  handleAgentSaved(e) {
95
57
  this.importStatus = 'Agent saved successfully';
96
58
 
97
- // Refresh the agents list to include newly saved agents
98
- this.fetchAgents();
99
-
100
- // Only change newAgent to false if we were actually creating a new agent
101
- if (this.newAgent && e.detail.name) {
102
- this.newAgent = false;
103
- }
104
-
105
- // Update the current agent with saved data while preserving form state
106
- this.agent = {
107
- ...this.agent, // Keep current state
108
- ...e.detail,
109
- commands: e.detail.commands || this.agent.commands || [],
110
- preferred_providers: e.detail.preferred_providers || this.agent.preferred_providers || []
111
- };
112
-
113
- // Update the name if this was a new agent
114
- if (e.detail.name) {
115
- this.name = e.detail.name;
116
- }
117
-
118
59
  setTimeout(() => {
119
60
  this.importStatus = '';
120
61
  }, 3000);
@@ -122,7 +63,13 @@ class AgentEditor extends BaseEl {
122
63
 
123
64
  handleAgentInstalled(e) {
124
65
  this.importStatus = `Successfully installed ${e.detail.name}`;
125
- this.fetchAgents();
66
+
67
+ // Notify the agent-form to refresh its agent list
68
+ const agentForm = this.shadowRoot.querySelector('agent-form');
69
+ if (agentForm) {
70
+ agentForm.fetchAgents();
71
+ }
72
+
126
73
  setTimeout(() => {
127
74
  this.importStatus = '';
128
75
  }, 3000);
@@ -150,28 +97,16 @@ class AgentEditor extends BaseEl {
150
97
  @error=${this.handleError}>
151
98
  </indexed-agents>
152
99
 
153
- <agent-list
154
- .agents=${this.agents}
155
- .selectedAgent=${this.agent}
156
- @agent-selected=${this.handleAgentSelected}
157
- @new-agent=${this.handleNewAgent}>
158
- </agent-list>
159
-
160
- ${(true || this.newAgent || this.agent.name) ? html`
161
- <agent-form
162
- .agent=${this.agent}
163
- .newAgent=${this.newAgent}
164
- @agent-saved=${this.handleAgentSaved}
165
- @error=${this.handleError}>
166
- </agent-form>
167
- ` : ''}
100
+ <agent-form
101
+ @agent-saved=${this.handleAgentSaved}
102
+ @error=${this.handleError}>
103
+ </agent-form>
168
104
 
169
105
  <github-import
170
106
  @agent-installed=${this.handleAgentInstalled}
171
107
  @error=${this.handleError}>
172
108
  </github-import>
173
109
 
174
-
175
110
  </div>
176
111
  `;
177
112
  }