@eggjs/tegg-types 3.81.0 → 3.82.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.
|
@@ -47,6 +47,14 @@ export interface CreateRunInput {
|
|
|
47
47
|
messages: import('./AgentMessage').InputMessage[];
|
|
48
48
|
};
|
|
49
49
|
config?: AgentRunConfig;
|
|
50
|
+
/**
|
|
51
|
+
* Metadata for the run. Stored verbatim on the run record, and additionally
|
|
52
|
+
* shallow-merged into the thread metadata (`meta.json`):
|
|
53
|
+
* - For an auto-created thread, it initializes the thread metadata.
|
|
54
|
+
* - For an existing thread, the keys are shallow-merged: new values overwrite
|
|
55
|
+
* matching keys, while keys not present are preserved.
|
|
56
|
+
* - An omitted or empty object leaves the thread metadata unchanged.
|
|
57
|
+
*/
|
|
50
58
|
metadata?: Record<string, unknown>;
|
|
51
59
|
}
|
|
52
60
|
/**
|
|
@@ -54,8 +62,7 @@ export interface CreateRunInput {
|
|
|
54
62
|
*
|
|
55
63
|
* `metadata` is forwarded verbatim to {@link AgentStore.createThread} so callers
|
|
56
64
|
* can persist additional business semantics on the thread record (e.g. the
|
|
57
|
-
* resolved agent name, owning sandbox id, trace id).
|
|
58
|
-
* creation time and never overwritten by subsequent runs on the same thread.
|
|
65
|
+
* resolved agent name, owning sandbox id, trace id).
|
|
59
66
|
*/
|
|
60
67
|
export interface CreateThreadOptions {
|
|
61
68
|
metadata?: Record<string, unknown>;
|
|
@@ -68,6 +68,11 @@ export interface AgentStore {
|
|
|
68
68
|
destroy?(): Promise<void>;
|
|
69
69
|
createThread(metadata?: Record<string, unknown>): Promise<ThreadRecord>;
|
|
70
70
|
getThread(threadId: string, options?: GetThreadOptions): Promise<ThreadRecord>;
|
|
71
|
+
/**
|
|
72
|
+
* Shallow-merge metadata into an existing thread.
|
|
73
|
+
* New values overwrite matching keys; omitted keys are preserved.
|
|
74
|
+
*/
|
|
75
|
+
updateThreadMetadata?(threadId: string, metadata: Record<string, unknown>): Promise<void>;
|
|
71
76
|
appendMessages(threadId: string, messages: AgentMessage[]): Promise<void>;
|
|
72
77
|
createRun(input: InputMessage[], threadId?: string, config?: AgentRunConfig, metadata?: Record<string, unknown>): Promise<RunRecord>;
|
|
73
78
|
getRun(runId: string): Promise<RunRecord>;
|
|
@@ -7,6 +7,13 @@ export declare class AgentNotFoundError extends Error {
|
|
|
7
7
|
status: number;
|
|
8
8
|
constructor(message: string);
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Error thrown when an agent API request contains invalid input.
|
|
12
|
+
*/
|
|
13
|
+
export declare class AgentInvalidRequestError extends Error {
|
|
14
|
+
status: number;
|
|
15
|
+
constructor(message: string);
|
|
16
|
+
}
|
|
10
17
|
/**
|
|
11
18
|
* Error thrown when an operation conflicts with the current state
|
|
12
19
|
* (e.g., cancelling a completed run).
|
package/agent-runtime/errors.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AgentTimeoutError = exports.InvalidRunStateTransitionError = exports.AgentConflictError = exports.AgentNotFoundError = void 0;
|
|
3
|
+
exports.AgentTimeoutError = exports.InvalidRunStateTransitionError = exports.AgentConflictError = exports.AgentInvalidRequestError = exports.AgentNotFoundError = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Error thrown when a thread or run is not found.
|
|
6
6
|
* The `status` property is recognized by Koa/Egg error handling
|
|
@@ -14,6 +14,17 @@ class AgentNotFoundError extends Error {
|
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
exports.AgentNotFoundError = AgentNotFoundError;
|
|
17
|
+
/**
|
|
18
|
+
* Error thrown when an agent API request contains invalid input.
|
|
19
|
+
*/
|
|
20
|
+
class AgentInvalidRequestError extends Error {
|
|
21
|
+
constructor(message) {
|
|
22
|
+
super(message);
|
|
23
|
+
this.status = 400;
|
|
24
|
+
this.name = 'AgentInvalidRequestError';
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.AgentInvalidRequestError = AgentInvalidRequestError;
|
|
17
28
|
/**
|
|
18
29
|
* Error thrown when an operation conflicts with the current state
|
|
19
30
|
* (e.g., cancelling a completed run).
|
|
@@ -53,4 +64,4 @@ class AgentTimeoutError extends Error {
|
|
|
53
64
|
}
|
|
54
65
|
}
|
|
55
66
|
exports.AgentTimeoutError = AgentTimeoutError;
|
|
56
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
67
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXJyb3JzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiZXJyb3JzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBOzs7O0dBSUc7QUFDSCxNQUFhLGtCQUFtQixTQUFRLEtBQUs7SUFHM0MsWUFBWSxPQUFlO1FBQ3pCLEtBQUssQ0FBQyxPQUFPLENBQUMsQ0FBQztRQUhqQixXQUFNLEdBQUcsR0FBRyxDQUFDO1FBSVgsSUFBSSxDQUFDLElBQUksR0FBRyxvQkFBb0IsQ0FBQztJQUNuQyxDQUFDO0NBQ0Y7QUFQRCxnREFPQztBQUVEOztHQUVHO0FBQ0gsTUFBYSx3QkFBeUIsU0FBUSxLQUFLO0lBR2pELFlBQVksT0FBZTtRQUN6QixLQUFLLENBQUMsT0FBTyxDQUFDLENBQUM7UUFIakIsV0FBTSxHQUFHLEdBQUcsQ0FBQztRQUlYLElBQUksQ0FBQyxJQUFJLEdBQUcsMEJBQTBCLENBQUM7SUFDekMsQ0FBQztDQUNGO0FBUEQsNERBT0M7QUFFRDs7O0dBR0c7QUFDSCxNQUFhLGtCQUFtQixTQUFRLEtBQUs7SUFHM0MsWUFBWSxPQUFlO1FBQ3pCLEtBQUssQ0FBQyxPQUFPLENBQUMsQ0FBQztRQUhqQixXQUFNLEdBQUcsR0FBRyxDQUFDO1FBSVgsSUFBSSxDQUFDLElBQUksR0FBRyxvQkFBb0IsQ0FBQztJQUNuQyxDQUFDO0NBQ0Y7QUFQRCxnREFPQztBQUVEOzs7R0FHRztBQUNILE1BQWEsOEJBQStCLFNBQVEsS0FBSztJQUd2RCxZQUFZLElBQVksRUFBRSxFQUFVO1FBQ2xDLEtBQUssQ0FBQyxrQ0FBa0MsSUFBSSxTQUFTLEVBQUUsR0FBRyxDQUFDLENBQUM7UUFIOUQsV0FBTSxHQUFHLEdBQUcsQ0FBQztRQUlYLElBQUksQ0FBQyxJQUFJLEdBQUcsZ0NBQWdDLENBQUM7SUFDL0MsQ0FBQztDQUNGO0FBUEQsd0VBT0M7QUFFRDs7Ozs7O0dBTUc7QUFDSCxNQUFhLGlCQUFrQixTQUFRLEtBQUs7SUFHMUMsWUFBWSxPQUFlO1FBQ3pCLEtBQUssQ0FBQyxPQUFPLENBQUMsQ0FBQztRQUhqQixXQUFNLEdBQUcsR0FBRyxDQUFDO1FBSVgsSUFBSSxDQUFDLElBQUksR0FBRyxtQkFBbUIsQ0FBQztJQUNsQyxDQUFDO0NBQ0Y7QUFQRCw4Q0FPQyJ9
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eggjs/tegg-types",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.82.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": "
|
|
48
|
+
"gitHead": "19b3a51a3fb53ea6e2afa3798e838f229a3077b6"
|
|
49
49
|
}
|