@eggjs/tegg-types 3.80.0 → 3.81.0

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.
@@ -31,6 +31,14 @@ export interface ThreadRecord {
31
31
  messages: AgentMessage[];
32
32
  metadata: Record<string, unknown>;
33
33
  createdAt: number;
34
+ /**
35
+ * Id of the most recently created run on this thread, maintained by
36
+ * `createRun` as a best-effort pointer so callers can resolve a thread's
37
+ * latest run without an external index. Absent on threads that have no
38
+ * runs yet, and on threads created before this field existed — a missing
39
+ * value must be treated as "no recent run".
40
+ */
41
+ latestRunId?: string;
34
42
  }
35
43
  export interface RunRecord {
36
44
  id: string;
@@ -63,5 +71,12 @@ export interface AgentStore {
63
71
  appendMessages(threadId: string, messages: AgentMessage[]): Promise<void>;
64
72
  createRun(input: InputMessage[], threadId?: string, config?: AgentRunConfig, metadata?: Record<string, unknown>): Promise<RunRecord>;
65
73
  getRun(runId: string): Promise<RunRecord>;
74
+ /**
75
+ * Id of the most recent run created on the thread, or `null` when the
76
+ * thread exists but has no recorded run (including threads created before
77
+ * run tracking existed). Throws AgentNotFoundError when the thread itself
78
+ * does not exist.
79
+ */
80
+ getLatestRunId(threadId: string): Promise<string | null>;
66
81
  updateRun(runId: string, updates: Partial<RunRecord>): Promise<void>;
67
82
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eggjs/tegg-types",
3
- "version": "3.80.0",
3
+ "version": "3.81.0",
4
4
  "description": "tegg types",
5
5
  "keywords": [
6
6
  "egg",
@@ -45,5 +45,5 @@
45
45
  "ts-node": "^10.9.1",
46
46
  "typescript": "^5.0.4"
47
47
  },
48
- "gitHead": "5d903573ace371df82778ebe7d92d3532cc38813"
48
+ "gitHead": "32079c65e245fd36270e79b3d6217a294dd9aeee"
49
49
  }