@yeaft/webchat-agent 1.0.248 → 1.0.250

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.
@@ -166,7 +166,12 @@ export class WorkItemWatcher {
166
166
  response: '', summary: '', evidence: [],
167
167
  error: error?.message || String(error),
168
168
  });
169
- this.onEvent({ type: 'run.finished', workItem: this.store.getWorkItemDetail(claim.workItem.id) });
169
+ this.onEvent({
170
+ type: 'run.finished',
171
+ actionId: claim.action.id,
172
+ runId: claim.run.id,
173
+ workItem: this.store.getWorkItemDetail(claim.workItem.id),
174
+ });
170
175
  continue;
171
176
  }
172
177
  this.#startClaim(claim);
@@ -212,7 +217,12 @@ export class WorkItemWatcher {
212
217
  if (this.lifecycle === 'running') queueMicrotask(() => { this.tick().catch(() => {}); });
213
218
  });
214
219
  this.activeRuns.set(key, entry);
215
- this.onEvent({ type: 'run.started', workItem: this.store.getWorkItemDetail(claim.workItem.id) });
220
+ this.onEvent({
221
+ type: 'run.started',
222
+ actionId: claim.action.id,
223
+ runId: claim.run.id,
224
+ workItem: this.store.getWorkItemDetail(claim.workItem.id),
225
+ });
216
226
  }
217
227
 
218
228
  async #execute(claim, signal, registerProgressReader, registerInputWake) {
@@ -232,7 +242,14 @@ export class WorkItemWatcher {
232
242
  claim.run.leaseEpoch,
233
243
  progress,
234
244
  );
235
- if (detail) this.onEvent({ type: 'run.progress', workItem: detail });
245
+ if (detail) {
246
+ this.onEvent({
247
+ type: 'run.progress',
248
+ actionId: claim.action.id,
249
+ runId: claim.run.id,
250
+ workItem: detail,
251
+ });
252
+ }
236
253
  return !!detail;
237
254
  },
238
255
  });
@@ -265,7 +282,12 @@ export class WorkItemWatcher {
265
282
  claim.run.leaseEpoch,
266
283
  result,
267
284
  );
268
- this.onEvent({ type: 'run.finished', workItem });
285
+ this.onEvent({
286
+ type: 'run.finished',
287
+ actionId: claim.action.id,
288
+ runId: claim.run.id,
289
+ workItem,
290
+ });
269
291
  } catch (err) {
270
292
  if (!/stale|cancelled|already finished/i.test(err?.message || '')) throw err;
271
293
  }