@7n/tauri-components 0.13.6 → 0.13.7

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.7] - 2026-07-20
4
+
5
+ ### Fixed
6
+
7
+ - acp_spawn_agent тепер чекає на реальний успіх/провал initialize+session/new перед поверненням session key (усуває гонку з acp_prompt, яка проявлялась як незрозуміла 'dropped the reply channel'); request() у acp-kit.js журналить провал спавну сесії як 'failed' замість непійманого throw
8
+
3
9
  ## [0.13.6] - 2026-07-20
4
10
 
5
11
  ### Changed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@7n/tauri-components",
3
- "version": "0.13.6",
3
+ "version": "0.13.7",
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",
@@ -125,6 +125,28 @@ export function createAcpAgentKit({
125
125
  await deps.onAcpPermissionRequest(handlePermissionRequest)
126
126
  }
127
127
 
128
+ /**
129
+ * Journal a request as failed and return its structured result envelope —
130
+ * shared by a session that never spawned and a turn that errored mid-flight.
131
+ * @param {string} requestId journal record id
132
+ * @param {object[]} baseActions actions already recorded for this request
133
+ * @param {unknown} error the thrown/rejected value
134
+ * @returns {Promise<object>} structured result envelope
135
+ */
136
+ async function failedResult(requestId, baseActions, error) {
137
+ const message = String(error?.message ?? error)
138
+ await journal.update(requestId, { status: 'failed', error: message })
139
+ return {
140
+ requestId,
141
+ status: 'failed',
142
+ summary: null,
143
+ error: message,
144
+ actions: baseActions,
145
+ question: null,
146
+ pendingApproval: null
147
+ }
148
+ }
149
+
128
150
  /**
129
151
  * Run one turn, journal the result, and reset `pendingApproval`. Callers
130
152
  * must set `activeRequestId` themselves *before* starting the turn — a
@@ -141,17 +163,7 @@ export function createAcpAgentKit({
141
163
  try {
142
164
  turn = await turnPromise
143
165
  } catch (error) {
144
- const message = String(error?.message ?? error)
145
- await journal.update(requestId, { status: 'failed', error: message })
146
- return {
147
- requestId,
148
- status: 'failed',
149
- summary: null,
150
- error: message,
151
- actions: baseActions,
152
- question: null,
153
- pendingApproval: null
154
- }
166
+ return failedResult(requestId, baseActions, error)
155
167
  }
156
168
  const fields = finalizeTurn(turn)
157
169
  const actions = [...baseActions, ...turn.trace]
@@ -170,7 +182,12 @@ export function createAcpAgentKit({
170
182
  await ensureListening()
171
183
  const id = await journal.create({ intent, actor: AGENT_ACTOR })
172
184
  await journal.update(id, { status: 'running' })
173
- const session = await deps.createAcpSession(agent)
185
+ let session
186
+ try {
187
+ session = await deps.createAcpSession(agent)
188
+ } catch (error) {
189
+ return failedResult(id, [], error)
190
+ }
174
191
  activeSessionKey = session.sessionKey
175
192
  activeRequestId = id
176
193
  await journal.update(id, { acp: { agentKind: session.agentKind, sessionKey: session.sessionKey } })
@@ -3,7 +3,7 @@ type: JS Module
3
3
  title: acp-kit.js
4
4
  resource: npm/src/core/acp-kit.js
5
5
  docgen:
6
- crc: f5342002
6
+ crc: e42fda83
7
7
  model: omlx/gemma-4-e4b-it-OptiQ-4bit
8
8
  score: 100
9
9
  judgeModel: openai-codex/gpt-5.4-mini