@yeaft/webchat-agent 1.0.239 → 1.0.240

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yeaft/webchat-agent",
3
- "version": "1.0.239",
3
+ "version": "1.0.240",
4
4
  "description": "Remote worker agent for Yeaft Web Code Agent — connects the native Yeaft engine, CLI providers, and workbench tools",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -33,7 +33,7 @@ const BROWSER_FILE_FIELDS = Object.freeze({
33
33
  retry_action: ['id', 'actionId', 'revision', 'generation'],
34
34
  delete: ['id', 'revision'],
35
35
  guide: ['id', 'guidance', 'actionId', 'revision', 'generation', 'files'],
36
- get_action_messages: ['id', 'actionId', 'cursor', 'limit'],
36
+ get_action_messages: ['id', 'actionId', 'generation', 'cursor', 'limit'],
37
37
  get_action_requests: ['id', 'actionId'],
38
38
  get_action_request: ['id', 'actionId', 'runId', 'requestId'],
39
39
  });
@@ -50,6 +50,7 @@ function projectCurrentActionSummary(action, projectedAction = action) {
50
50
  id: projectedAction.id,
51
51
  type: projectedAction.type,
52
52
  stageId: projectedAction.stageId,
53
+ generation: actionGeneration(projectedAction.generation),
53
54
  assignmentMode: projectedAction.assignmentPolicy?.mode || (projectedAction.requiredRole ? 'fixed' : null),
54
55
  status: projectedAction.status,
55
56
  objective: truncateUtf8(action?.brief?.objective, 1_000) || null,
@@ -652,6 +653,7 @@ function projectActionStats(detail) {
652
653
  );
653
654
  const stats = {
654
655
  id: projected.id,
656
+ generation: actionGeneration(projected.generation),
655
657
  status: projected.status,
656
658
  assignedVp: projected.assignedVp,
657
659
  contentSummary: projected.contentSummary,
@@ -133,6 +133,15 @@ export class WorkCenterService {
133
133
  case 'get_action_messages': {
134
134
  const detail = this.#requiredItem(payload.id);
135
135
  const action = this.#requiredAction(detail, payload.actionId);
136
+ const expectedGeneration = payload.generation == null
137
+ ? Number(action.generation)
138
+ : Number(payload.generation);
139
+ if (!Number.isInteger(expectedGeneration) || expectedGeneration < 1) {
140
+ throw new Error('generation must be a positive integer');
141
+ }
142
+ if (Number(action.generation) !== expectedGeneration) {
143
+ throw new Error('Action generation changed before messages were loaded');
144
+ }
136
145
  return projectActionMessagePage(action, detail.runs, this.store.listActionEvents(action.id), {
137
146
  cursor: payload.cursor,
138
147
  limit: payload.limit,