@7n/tauri-components 0.12.0 → 0.13.1

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,21 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.13.1] - 2026-07-20
4
+
5
+ ### Fixed
6
+
7
+ - AgentDialog.vue: ховає q-select tier, коли в обраного агента взагалі нема тірів (напр. pi) — раніше лишався видимим зі stale-значенням попереднього агента
8
+
9
+ ## [0.13.0] - 2026-07-20
10
+
11
+ ### Added
12
+
13
+ - AgentDialog.vue: мітка агент·модель над кожною відповіддю в чаті — фіксується на request(), не змінюється для наступних respond() у тій самій розмові (перемикання агента/тіру діє лише на нову сесію)
14
+
15
+ ### Fixed
16
+
17
+ - useAcpAgent(): перемикання agent у picker більше не лишає modelTier зі значенням попереднього агента (напр. cursor's AVG="Grok 4.5" після переключення на pi, де тірів взагалі нема) — тепер watch(agentKind) перерезолвлює modelTier під новий агент
18
+
3
19
  ## [0.12.0] - 2026-07-20
4
20
 
5
21
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@7n/tauri-components",
3
- "version": "0.12.0",
3
+ "version": "0.13.1",
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",
@@ -14,6 +14,7 @@
14
14
  <template v-if="showConfig">
15
15
  <q-select v-model="agentKind" :options="availableAgentKinds" dense outlined label="agent" />
16
16
  <q-select
17
+ v-if="availableTiers.length"
17
18
  v-model="modelTier"
18
19
  :options="availableTiers"
19
20
  option-value="id"
@@ -29,7 +30,10 @@
29
30
  <div v-if="turns.length" ref="logEl" class="chat-log">
30
31
  <template v-for="(turn, i) in turns" :key="i">
31
32
  <div v-if="turn.role === 'user'" class="chat-user">{{ turn.text }}</div>
32
- <RequestView v-else :result="turn.result" />
33
+ <template v-else>
34
+ <div class="chat-model-label">{{ turn.agentLabel }}</div>
35
+ <RequestView :result="turn.result" />
36
+ </template>
33
37
  </template>
34
38
  <div v-if="running" class="chat-thinking"><q-spinner-dots size="18px" /> думаю…</div>
35
39
  </div>
@@ -85,6 +89,21 @@ const turns = ref([])
85
89
  const requestId = ref(null)
86
90
  const logEl = ref(null)
87
91
  const showConfig = ref(false)
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.
97
+ const activeAgentLabel = ref('')
98
+
99
+ /**
100
+ * Human-readable "agent · tier" for whichever preset is currently selected.
101
+ * @returns {string} label
102
+ */
103
+ function currentAgentLabel() {
104
+ const tier = availableTiers.value.find(t => t.id === modelTier.value)
105
+ return `${agentKind.value} · ${tier?.label ?? modelTier.value}`
106
+ }
88
107
 
89
108
  // Labels shift once a conversation is under way (fresh request → follow-up).
90
109
  const inputLabel = computed(() => (turns.value.length ? 'Повідомлення' : 'Prompt'))
@@ -115,7 +134,7 @@ async function scrollToEnd() {
115
134
  */
116
135
  function apply(outcome) {
117
136
  if (outcome.requestId) requestId.value = outcome.requestId
118
- turns.value.push({ role: 'agent', result: outcome })
137
+ turns.value.push({ role: 'agent', result: outcome, agentLabel: activeAgentLabel.value })
119
138
  if (outcome.actions?.some(action => action.envelope?.ok)) emit('ran')
120
139
  scrollToEnd()
121
140
  }
@@ -131,6 +150,10 @@ async function send() {
131
150
  scrollToEnd()
132
151
  running.value = true
133
152
  try {
153
+ // Only a fresh request() actually spawns with the currently-selected
154
+ // agent/tier — a respond() keeps talking to whatever the conversation
155
+ // already started with, so the label must not move mid-conversation.
156
+ if (!requestId.value) activeAgentLabel.value = currentAgentLabel()
134
157
  apply(await (requestId.value ? respond(requestId.value, text) : request(text)))
135
158
  } catch (error) {
136
159
  $q.notify({ type: 'negative', message: String(error?.message ?? error) })
@@ -162,6 +185,15 @@ async function send() {
162
185
  line-height: 1.45;
163
186
  }
164
187
 
188
+ .chat-model-label {
189
+ align-self: flex-start;
190
+ font-size: 11px;
191
+ opacity: 0.6;
192
+ text-transform: uppercase;
193
+ letter-spacing: 0.02em;
194
+ margin-bottom: -4px;
195
+ }
196
+
165
197
  .chat-thinking {
166
198
  display: flex;
167
199
  align-items: center;
@@ -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: aa14e51b
6
+ crc: b6f22df0
7
7
  model: omlx/gemma-4-e4b-it-OptiQ-4bit
8
8
  ---
9
9
 
@@ -3,7 +3,7 @@ type: JS Module
3
3
  title: use-acp-agent.js
4
4
  resource: npm/src/vue/use-acp-agent.js
5
5
  docgen:
6
- crc: 0477b0ca
6
+ crc: e5d5b271
7
7
  model: omlx/gemma-4-e4b-it-OptiQ-4bit
8
8
  score: 100
9
9
  issues: judge:inaccurate:0.97
@@ -1,4 +1,4 @@
1
- import { computed, ref } from 'vue'
1
+ import { computed, ref, watch } from 'vue'
2
2
  import { acpConfig, startAcpMcpBridge } from '../core/acp-agent.js'
3
3
  import { createAcpAgentKit } from '../core/acp-kit.js'
4
4
  import { createTauriJournalStore } from './journal-store-tauri.js'
@@ -47,6 +47,16 @@ export function useAcpAgent({
47
47
  const journal = createTauriJournalStore()
48
48
  const kit = createAcpAgentKit({ catalog, journal, transport, actorTiers })
49
49
 
50
+ // Tiers are per-agent presets (see `agents[kind].tiers` above) — a tier id
51
+ // picked for the PREVIOUS agent (e.g. cursor's "AVG" = Grok 4.5) doesn't
52
+ // necessarily exist for the newly selected one (pi has no tiers at all), so
53
+ // switching agentKind must re-resolve modelTier instead of leaving it
54
+ // pointing at a tier the UI can no longer show a matching label for.
55
+ watch(agentKind, kind => {
56
+ const tiers = agents[kind]?.tiers ?? {}
57
+ modelTier.value = defaultTier in tiers ? defaultTier : (Object.keys(tiers)[0] ?? '')
58
+ })
59
+
50
60
  /**
51
61
  * Read the per-machine default agent (`ACP_DEFAULT_AGENT`) and start the
52
62
  * domain MCP bridge. Call once before the first `request()` — mirrors