@7n/tauri-components 0.13.3 → 0.13.4

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.13.4] - 2026-07-20
4
+
5
+ ### Fixed
6
+
7
+ - AgentDialog: зміна агента/tier під час активної розмови перезапускає розмову на новообраному агенті замість мовчазного продовження зі старим
8
+
3
9
  ## [0.13.3] - 2026-07-20
4
10
 
5
11
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@7n/tauri-components",
3
- "version": "0.13.3",
3
+ "version": "0.13.4",
4
4
  "type": "module",
5
5
  "description": "Shared LLM agent engine + Vue/Quasar UI for Tauri apps (chat, journal, trust-tier approval).",
6
6
  "license": "MIT",
@@ -90,11 +90,14 @@ const requestId = ref(null)
90
90
  const logEl = ref(null)
91
91
  const showConfig = ref(false)
92
92
  // Latched at the start of a conversation (request()) and reused for every
93
- // respond() in it: resuming a session keeps talking to whichever agent/tier
94
- // spawned it changing the dropdowns mid-conversation only takes effect on
95
- // the NEXT fresh request(), so re-reading agentKind/modelTier live at every
96
- // send() would mislabel turns with a model that isn't actually answering.
93
+ // respond() in it, so turns are labeled with whichever agent/tier actually
94
+ // answered rather than whatever the dropdowns currently show.
97
95
  const activeAgentLabel = ref('')
96
+ // Spawn identity of the running session — compared against the live
97
+ // dropdowns at send() time so switching agent/tier mid-conversation is
98
+ // detected and restarts the conversation instead of silently talking to the
99
+ // stale agent (see send()).
100
+ const activeSpawnKey = ref('')
98
101
 
99
102
  /**
100
103
  * Human-readable "agent · tier" for whichever preset is currently selected.
@@ -105,6 +108,15 @@ function currentAgentLabel() {
105
108
  return `${agentKind.value} · ${tier?.label ?? modelTier.value}`
106
109
  }
107
110
 
111
+ /**
112
+ * Identity key for the currently selected agent+tier, used to detect when the
113
+ * dropdowns have moved away from whichever agent spawned the active session.
114
+ * @returns {string} spawn key
115
+ */
116
+ function currentSpawnKey() {
117
+ return `${agentKind.value}::${modelTier.value}`
118
+ }
119
+
108
120
  // Labels shift once a conversation is under way (fresh request → follow-up).
109
121
  const inputLabel = computed(() => (turns.value.length ? 'Повідомлення' : 'Prompt'))
110
122
  const sendLabel = computed(() => (turns.value.length ? 'Надіслати' : 'Запустити'))
@@ -140,11 +152,19 @@ function apply(outcome) {
140
152
  }
141
153
 
142
154
  /**
143
- * Send the current message: start a new request, or resume the conversation.
155
+ * Send the current message: start a new request, or resume the conversation
156
+ * — unless the agent/tier dropdowns have moved away from whichever agent
157
+ * spawned the active session, in which case restart as a fresh conversation
158
+ * (equivalent to closing and reopening the dialog) so the new message
159
+ * actually goes to the newly selected agent.
144
160
  */
145
161
  async function send() {
146
162
  const text = prompt.value.trim()
147
163
  if (!text || running.value) return
164
+ if (requestId.value && currentSpawnKey() !== activeSpawnKey.value) {
165
+ turns.value = []
166
+ requestId.value = null
167
+ }
148
168
  prompt.value = ''
149
169
  turns.value.push({ role: 'user', text })
150
170
  scrollToEnd()
@@ -153,7 +173,10 @@ async function send() {
153
173
  // Only a fresh request() actually spawns with the currently-selected
154
174
  // agent/tier — a respond() keeps talking to whatever the conversation
155
175
  // already started with, so the label must not move mid-conversation.
156
- if (!requestId.value) activeAgentLabel.value = currentAgentLabel()
176
+ if (!requestId.value) {
177
+ activeAgentLabel.value = currentAgentLabel()
178
+ activeSpawnKey.value = currentSpawnKey()
179
+ }
157
180
  apply(await (requestId.value ? respond(requestId.value, text) : request(text)))
158
181
  } catch (error) {
159
182
  $q.notify({ type: 'negative', message: String(error?.message ?? error) })
@@ -3,7 +3,7 @@ type: Vue Component
3
3
  title: AgentDialog.vue
4
4
  resource: npm/src/components/AgentDialog.vue
5
5
  docgen:
6
- crc: b6f22df0
6
+ crc: 0c46e2c2
7
7
  model: omlx/gemma-4-e4b-it-OptiQ-4bit
8
8
  ---
9
9