@downcity/agent 1.1.314 → 1.1.317
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/bin/session/SessionMessages.d.ts +2 -0
- package/bin/session/SessionMessages.d.ts.map +1 -1
- package/bin/session/SessionMessages.js +42 -0
- package/bin/session/SessionMessages.js.map +1 -1
- package/bin/session/messages/SessionAssistantMessageWriter.d.ts.map +1 -1
- package/bin/session/messages/SessionAssistantMessageWriter.js +7 -6
- package/bin/session/messages/SessionAssistantMessageWriter.js.map +1 -1
- package/bin/types/session/SessionMutation.d.ts +17 -4
- package/bin/types/session/SessionMutation.d.ts.map +1 -1
- package/bin/types/session/SessionMutation.js.map +1 -1
- package/package.json +6 -6
- package/scripts/session-messages.test.mjs +20 -0
- package/src/session/SessionMessages.ts +53 -0
- package/src/session/messages/SessionAssistantMessageWriter.ts +13 -6
- package/src/types/session/SessionMutation.ts +21 -4
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -56,12 +56,10 @@ export type SessionPartMutation = {
|
|
|
56
56
|
};
|
|
57
57
|
}[SessionAssistantMessagePart["type"]];
|
|
58
58
|
|
|
59
|
-
/** Assistant
|
|
60
|
-
|
|
59
|
+
/** Assistant Part 原始增量 Mutation 的公共字段。 */
|
|
60
|
+
interface SessionDeltaMutationBase extends SessionMutationBase {
|
|
61
61
|
/** Mutation 层级固定为 delta。 */
|
|
62
62
|
variant: "delta";
|
|
63
|
-
/** Delta 只允许可见文本或推理文本。 */
|
|
64
|
-
type: "text" | "reasoning";
|
|
65
63
|
/** 当前 Delta 所属 Message 标识。 */
|
|
66
64
|
message_id: string;
|
|
67
65
|
/** 当前 Mutation 所属 Turn 标识。 */
|
|
@@ -74,6 +72,25 @@ export interface SessionDeltaMutation extends SessionMutationBase {
|
|
|
74
72
|
delta: string;
|
|
75
73
|
}
|
|
76
74
|
|
|
75
|
+
/** Assistant 文本或推理的原始增量 Mutation。 */
|
|
76
|
+
interface SessionTextDeltaMutation extends SessionDeltaMutationBase {
|
|
77
|
+
/** Delta 属于可见文本或推理文本。 */
|
|
78
|
+
type: "text" | "reasoning";
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** Assistant Tool 输入的原始增量 Mutation。 */
|
|
82
|
+
interface SessionToolInputDeltaMutation extends SessionDeltaMutationBase {
|
|
83
|
+
/** Delta 属于 Tool 输入参数原文。 */
|
|
84
|
+
type: "tool_input";
|
|
85
|
+
/** 当前 Delta 所属 Tool Call 标识。 */
|
|
86
|
+
tool_call_id: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** Assistant 文本、推理或 Tool 输入的原始增量 Mutation。 */
|
|
90
|
+
export type SessionDeltaMutation =
|
|
91
|
+
| SessionTextDeltaMutation
|
|
92
|
+
| SessionToolInputDeltaMutation;
|
|
93
|
+
|
|
77
94
|
/** Turn 生命周期 Mutation。 */
|
|
78
95
|
export type SessionTurnMutation = SessionMutationBase & {
|
|
79
96
|
/** Mutation 层级固定为 turn。 */
|