@axiom-lattice/core 2.1.43 → 2.1.44
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/dist/index.d.mts +31 -6
- package/dist/index.d.ts +31 -6
- package/dist/index.js +52 -35
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +52 -35
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -2253,21 +2253,44 @@ interface ThreadQueueConfig {
|
|
|
2253
2253
|
}
|
|
2254
2254
|
interface PendingMessage {
|
|
2255
2255
|
id: string;
|
|
2256
|
-
content:
|
|
2256
|
+
content: PendingMessageContent;
|
|
2257
2257
|
type: "human" | "system";
|
|
2258
2258
|
sequence: number;
|
|
2259
2259
|
createdAt: Date;
|
|
2260
2260
|
priority?: number;
|
|
2261
|
-
command?:
|
|
2261
|
+
command?: CommandParams<unknown>;
|
|
2262
2262
|
}
|
|
2263
|
+
interface PendingQueueMessageInput {
|
|
2264
|
+
message: string;
|
|
2265
|
+
id?: string;
|
|
2266
|
+
messages?: unknown[];
|
|
2267
|
+
[key: string]: unknown;
|
|
2268
|
+
}
|
|
2269
|
+
interface PendingQueueMessage {
|
|
2270
|
+
input: PendingQueueMessageInput;
|
|
2271
|
+
command?: CommandParams<unknown>;
|
|
2272
|
+
custom_run_config?: unknown;
|
|
2273
|
+
}
|
|
2274
|
+
interface HumanPendingMessageContent {
|
|
2275
|
+
id: string;
|
|
2276
|
+
message: string;
|
|
2277
|
+
queueMessage: PendingQueueMessage;
|
|
2278
|
+
}
|
|
2279
|
+
interface SystemPendingMessageContent {
|
|
2280
|
+
role: "system";
|
|
2281
|
+
content: string;
|
|
2282
|
+
metadata?: Record<string, unknown>;
|
|
2283
|
+
}
|
|
2284
|
+
type PendingMessageContent = HumanPendingMessageContent | SystemPendingMessageContent | string;
|
|
2263
2285
|
interface AddMessageParams {
|
|
2264
2286
|
threadId: string;
|
|
2265
2287
|
tenantId: string;
|
|
2266
2288
|
assistantId: string;
|
|
2267
|
-
content:
|
|
2289
|
+
content: PendingMessageContent;
|
|
2268
2290
|
type?: "human" | "system";
|
|
2269
2291
|
priority?: number;
|
|
2270
|
-
command?:
|
|
2292
|
+
command?: CommandParams<unknown>;
|
|
2293
|
+
id?: string;
|
|
2271
2294
|
}
|
|
2272
2295
|
interface ThreadInfo {
|
|
2273
2296
|
tenantId: string;
|
|
@@ -2280,7 +2303,7 @@ interface ThreadInfo {
|
|
|
2280
2303
|
*/
|
|
2281
2304
|
interface IMessageQueueStore {
|
|
2282
2305
|
addMessage(params: AddMessageParams): Promise<PendingMessage>;
|
|
2283
|
-
addMessageAtHead(threadId: string, content:
|
|
2306
|
+
addMessageAtHead(threadId: string, content: PendingMessageContent, type?: "human" | "system", id?: string, command?: CommandParams<unknown>): Promise<PendingMessage>;
|
|
2284
2307
|
getPendingMessages(threadId: string): Promise<PendingMessage[]>;
|
|
2285
2308
|
getProcessingMessages(threadId: string): Promise<PendingMessage[]>;
|
|
2286
2309
|
getQueueSize(threadId: string): Promise<number>;
|
|
@@ -2848,7 +2871,7 @@ declare class InMemoryThreadMessageQueueStore implements IMessageQueueStore {
|
|
|
2848
2871
|
private generateId;
|
|
2849
2872
|
private getMessagesForThread;
|
|
2850
2873
|
addMessage(params: AddMessageParams): Promise<PendingMessage>;
|
|
2851
|
-
addMessageAtHead(threadId: string, content:
|
|
2874
|
+
addMessageAtHead(threadId: string, content: PendingMessageContent, type?: "human" | "system", id?: string, command?: CommandParams<unknown>): Promise<PendingMessage>;
|
|
2852
2875
|
getPendingMessages(threadId: string): Promise<PendingMessage[]>;
|
|
2853
2876
|
getProcessingMessages(threadId: string): Promise<PendingMessage[]>;
|
|
2854
2877
|
getQueueSize(threadId: string): Promise<number>;
|
|
@@ -4928,6 +4951,7 @@ interface ThreadState {
|
|
|
4928
4951
|
interface QueueMessage {
|
|
4929
4952
|
input: {
|
|
4930
4953
|
message: string;
|
|
4954
|
+
id?: string;
|
|
4931
4955
|
};
|
|
4932
4956
|
command?: CommandParams<any>;
|
|
4933
4957
|
custom_run_config?: any;
|
|
@@ -5009,6 +5033,7 @@ declare class Agent {
|
|
|
5009
5033
|
queueMode: ThreadQueueConfig;
|
|
5010
5034
|
private isWaitingForQueueEnd;
|
|
5011
5035
|
constructor({ assistant_id, thread_id, tenant_id, workspace_id, project_id, custom_run_config, }: AgentThreadInterface);
|
|
5036
|
+
private getHumanPendingContent;
|
|
5012
5037
|
/**
|
|
5013
5038
|
* Initialize with message queue store
|
|
5014
5039
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -2253,21 +2253,44 @@ interface ThreadQueueConfig {
|
|
|
2253
2253
|
}
|
|
2254
2254
|
interface PendingMessage {
|
|
2255
2255
|
id: string;
|
|
2256
|
-
content:
|
|
2256
|
+
content: PendingMessageContent;
|
|
2257
2257
|
type: "human" | "system";
|
|
2258
2258
|
sequence: number;
|
|
2259
2259
|
createdAt: Date;
|
|
2260
2260
|
priority?: number;
|
|
2261
|
-
command?:
|
|
2261
|
+
command?: CommandParams<unknown>;
|
|
2262
2262
|
}
|
|
2263
|
+
interface PendingQueueMessageInput {
|
|
2264
|
+
message: string;
|
|
2265
|
+
id?: string;
|
|
2266
|
+
messages?: unknown[];
|
|
2267
|
+
[key: string]: unknown;
|
|
2268
|
+
}
|
|
2269
|
+
interface PendingQueueMessage {
|
|
2270
|
+
input: PendingQueueMessageInput;
|
|
2271
|
+
command?: CommandParams<unknown>;
|
|
2272
|
+
custom_run_config?: unknown;
|
|
2273
|
+
}
|
|
2274
|
+
interface HumanPendingMessageContent {
|
|
2275
|
+
id: string;
|
|
2276
|
+
message: string;
|
|
2277
|
+
queueMessage: PendingQueueMessage;
|
|
2278
|
+
}
|
|
2279
|
+
interface SystemPendingMessageContent {
|
|
2280
|
+
role: "system";
|
|
2281
|
+
content: string;
|
|
2282
|
+
metadata?: Record<string, unknown>;
|
|
2283
|
+
}
|
|
2284
|
+
type PendingMessageContent = HumanPendingMessageContent | SystemPendingMessageContent | string;
|
|
2263
2285
|
interface AddMessageParams {
|
|
2264
2286
|
threadId: string;
|
|
2265
2287
|
tenantId: string;
|
|
2266
2288
|
assistantId: string;
|
|
2267
|
-
content:
|
|
2289
|
+
content: PendingMessageContent;
|
|
2268
2290
|
type?: "human" | "system";
|
|
2269
2291
|
priority?: number;
|
|
2270
|
-
command?:
|
|
2292
|
+
command?: CommandParams<unknown>;
|
|
2293
|
+
id?: string;
|
|
2271
2294
|
}
|
|
2272
2295
|
interface ThreadInfo {
|
|
2273
2296
|
tenantId: string;
|
|
@@ -2280,7 +2303,7 @@ interface ThreadInfo {
|
|
|
2280
2303
|
*/
|
|
2281
2304
|
interface IMessageQueueStore {
|
|
2282
2305
|
addMessage(params: AddMessageParams): Promise<PendingMessage>;
|
|
2283
|
-
addMessageAtHead(threadId: string, content:
|
|
2306
|
+
addMessageAtHead(threadId: string, content: PendingMessageContent, type?: "human" | "system", id?: string, command?: CommandParams<unknown>): Promise<PendingMessage>;
|
|
2284
2307
|
getPendingMessages(threadId: string): Promise<PendingMessage[]>;
|
|
2285
2308
|
getProcessingMessages(threadId: string): Promise<PendingMessage[]>;
|
|
2286
2309
|
getQueueSize(threadId: string): Promise<number>;
|
|
@@ -2848,7 +2871,7 @@ declare class InMemoryThreadMessageQueueStore implements IMessageQueueStore {
|
|
|
2848
2871
|
private generateId;
|
|
2849
2872
|
private getMessagesForThread;
|
|
2850
2873
|
addMessage(params: AddMessageParams): Promise<PendingMessage>;
|
|
2851
|
-
addMessageAtHead(threadId: string, content:
|
|
2874
|
+
addMessageAtHead(threadId: string, content: PendingMessageContent, type?: "human" | "system", id?: string, command?: CommandParams<unknown>): Promise<PendingMessage>;
|
|
2852
2875
|
getPendingMessages(threadId: string): Promise<PendingMessage[]>;
|
|
2853
2876
|
getProcessingMessages(threadId: string): Promise<PendingMessage[]>;
|
|
2854
2877
|
getQueueSize(threadId: string): Promise<number>;
|
|
@@ -4928,6 +4951,7 @@ interface ThreadState {
|
|
|
4928
4951
|
interface QueueMessage {
|
|
4929
4952
|
input: {
|
|
4930
4953
|
message: string;
|
|
4954
|
+
id?: string;
|
|
4931
4955
|
};
|
|
4932
4956
|
command?: CommandParams<any>;
|
|
4933
4957
|
custom_run_config?: any;
|
|
@@ -5009,6 +5033,7 @@ declare class Agent {
|
|
|
5009
5033
|
queueMode: ThreadQueueConfig;
|
|
5010
5034
|
private isWaitingForQueueEnd;
|
|
5011
5035
|
constructor({ assistant_id, thread_id, tenant_id, workspace_id, project_id, custom_run_config, }: AgentThreadInterface);
|
|
5036
|
+
private getHumanPendingContent;
|
|
5012
5037
|
/**
|
|
5013
5038
|
* Initialize with message queue store
|
|
5014
5039
|
*/
|
package/dist/index.js
CHANGED
|
@@ -6635,10 +6635,10 @@ var InMemoryThreadMessageQueueStore = class {
|
|
|
6635
6635
|
return this.messages.get(threadId);
|
|
6636
6636
|
}
|
|
6637
6637
|
async addMessage(params) {
|
|
6638
|
-
const { threadId, tenantId, assistantId, content, type = "human", priority = 0, command } = params;
|
|
6638
|
+
const { threadId, tenantId, assistantId, content, type = "human", priority = 0, command, id } = params;
|
|
6639
6639
|
const threadMessages = this.getMessagesForThread(threadId);
|
|
6640
6640
|
const message = {
|
|
6641
|
-
id: this.generateId(),
|
|
6641
|
+
id: id || this.generateId(),
|
|
6642
6642
|
content,
|
|
6643
6643
|
type,
|
|
6644
6644
|
sequence: threadMessages.length,
|
|
@@ -6652,7 +6652,7 @@ var InMemoryThreadMessageQueueStore = class {
|
|
|
6652
6652
|
threadMessages.push(message);
|
|
6653
6653
|
return message;
|
|
6654
6654
|
}
|
|
6655
|
-
async addMessageAtHead(threadId, content, type = "system") {
|
|
6655
|
+
async addMessageAtHead(threadId, content, type = "system", id, command) {
|
|
6656
6656
|
const threadMessages = this.getMessagesForThread(threadId);
|
|
6657
6657
|
let tenantId = "default";
|
|
6658
6658
|
let assistantId = "";
|
|
@@ -6662,7 +6662,7 @@ var InMemoryThreadMessageQueueStore = class {
|
|
|
6662
6662
|
}
|
|
6663
6663
|
const nextSequence = threadMessages.length;
|
|
6664
6664
|
const message = {
|
|
6665
|
-
id: this.generateId(),
|
|
6665
|
+
id: id || this.generateId(),
|
|
6666
6666
|
content,
|
|
6667
6667
|
type,
|
|
6668
6668
|
sequence: nextSequence,
|
|
@@ -6670,8 +6670,9 @@ var InMemoryThreadMessageQueueStore = class {
|
|
|
6670
6670
|
status: "pending",
|
|
6671
6671
|
tenantId,
|
|
6672
6672
|
assistantId,
|
|
6673
|
-
priority: 100
|
|
6673
|
+
priority: 100,
|
|
6674
6674
|
// High priority for head messages (STEER/Command)
|
|
6675
|
+
command
|
|
6675
6676
|
};
|
|
6676
6677
|
threadMessages.push(message);
|
|
6677
6678
|
return message;
|
|
@@ -17098,28 +17099,29 @@ var Agent = class {
|
|
|
17098
17099
|
break;
|
|
17099
17100
|
}
|
|
17100
17101
|
const firstMessage = pendings[0];
|
|
17101
|
-
const hasCommand = firstMessage.
|
|
17102
|
+
const hasCommand = firstMessage.command;
|
|
17102
17103
|
if (hasCommand) {
|
|
17103
17104
|
for (const p of pendings) {
|
|
17104
17105
|
if (signal?.aborted) break;
|
|
17105
|
-
if (!p.
|
|
17106
|
+
if (!p.command) break;
|
|
17106
17107
|
await this.queueStore?.markProcessing(p.id);
|
|
17107
17108
|
const startTime = Date.now();
|
|
17108
17109
|
this.publish("message:started", {
|
|
17109
17110
|
type: "message:started",
|
|
17110
|
-
messageId: p.
|
|
17111
|
-
messageContent: p.
|
|
17111
|
+
messageId: this.getHumanPendingContent(p).id,
|
|
17112
|
+
messageContent: this.getHumanPendingContent(p).message,
|
|
17112
17113
|
timestamp: /* @__PURE__ */ new Date(),
|
|
17113
17114
|
queueMode: this.queueMode.mode
|
|
17114
17115
|
});
|
|
17116
|
+
const humanContent = p.content;
|
|
17115
17117
|
const input = {
|
|
17116
|
-
messages: [new import_langchain61.HumanMessage({ id:
|
|
17118
|
+
messages: [new import_langchain61.HumanMessage({ id: humanContent.id, content: humanContent.message })]
|
|
17117
17119
|
};
|
|
17118
|
-
const queueMessageData =
|
|
17120
|
+
const queueMessageData = humanContent.queueMessage;
|
|
17119
17121
|
try {
|
|
17120
17122
|
await this.agentStreamExecutor({
|
|
17121
17123
|
input,
|
|
17122
|
-
command:
|
|
17124
|
+
command: p.command,
|
|
17123
17125
|
custom_run_config: queueMessageData.custom_run_config
|
|
17124
17126
|
}, signal);
|
|
17125
17127
|
await this.queueStore?.markCompleted(p.id);
|
|
@@ -17128,7 +17130,7 @@ var Agent = class {
|
|
|
17128
17130
|
if (runStatus === "interrupted" /* INTERRUPTED */) {
|
|
17129
17131
|
this.publish("message:interrupted", {
|
|
17130
17132
|
type: "message:interrupted",
|
|
17131
|
-
messageId:
|
|
17133
|
+
messageId: humanContent.id,
|
|
17132
17134
|
timestamp: /* @__PURE__ */ new Date(),
|
|
17133
17135
|
duration: Date.now() - startTime,
|
|
17134
17136
|
state
|
|
@@ -17137,13 +17139,13 @@ var Agent = class {
|
|
|
17137
17139
|
this.addChunk({
|
|
17138
17140
|
type: "message_completed",
|
|
17139
17141
|
data: {
|
|
17140
|
-
id:
|
|
17142
|
+
id: humanContent.id,
|
|
17141
17143
|
content: ""
|
|
17142
17144
|
}
|
|
17143
17145
|
});
|
|
17144
17146
|
this.publish("message:completed", {
|
|
17145
17147
|
type: "message:completed",
|
|
17146
|
-
messageId:
|
|
17148
|
+
messageId: humanContent.id,
|
|
17147
17149
|
timestamp: /* @__PURE__ */ new Date(),
|
|
17148
17150
|
duration: Date.now() - startTime,
|
|
17149
17151
|
state
|
|
@@ -17154,13 +17156,13 @@ var Agent = class {
|
|
|
17154
17156
|
this.addChunk({
|
|
17155
17157
|
type: "message_failed",
|
|
17156
17158
|
data: {
|
|
17157
|
-
id:
|
|
17159
|
+
id: humanContent.id,
|
|
17158
17160
|
content: error instanceof Error ? error.message : String(error)
|
|
17159
17161
|
}
|
|
17160
17162
|
});
|
|
17161
17163
|
this.publish("message:failed", {
|
|
17162
17164
|
type: "message:failed",
|
|
17163
|
-
messageId:
|
|
17165
|
+
messageId: humanContent.id,
|
|
17164
17166
|
error: error instanceof Error ? error.message : String(error),
|
|
17165
17167
|
timestamp: /* @__PURE__ */ new Date()
|
|
17166
17168
|
});
|
|
@@ -17175,20 +17177,21 @@ var Agent = class {
|
|
|
17175
17177
|
const startTime = Date.now();
|
|
17176
17178
|
remainingPendings.forEach((p) => {
|
|
17177
17179
|
this.queueStore?.markProcessing(p.id);
|
|
17178
|
-
|
|
17180
|
+
const humanContent = p.content;
|
|
17181
|
+
userMessages.push(new import_langchain61.HumanMessage({ id: humanContent.id, content: humanContent.message }));
|
|
17179
17182
|
this.publish("message:started", {
|
|
17180
17183
|
type: "message:started",
|
|
17181
|
-
messageId:
|
|
17182
|
-
messageContent:
|
|
17184
|
+
messageId: humanContent.id,
|
|
17185
|
+
messageContent: humanContent.message,
|
|
17183
17186
|
timestamp: /* @__PURE__ */ new Date(),
|
|
17184
17187
|
queueMode: "collect" /* COLLECT */
|
|
17185
17188
|
});
|
|
17186
17189
|
});
|
|
17187
|
-
const firstQueueMessage = remainingPendings[0]
|
|
17190
|
+
const firstQueueMessage = remainingPendings[0] ? this.getHumanPendingContent(remainingPendings[0]).queueMessage : void 0;
|
|
17188
17191
|
try {
|
|
17189
17192
|
await this.agentStreamExecutor({
|
|
17190
17193
|
input: { messages: userMessages },
|
|
17191
|
-
custom_run_config: firstQueueMessage
|
|
17194
|
+
custom_run_config: firstQueueMessage?.custom_run_config
|
|
17192
17195
|
}, signal);
|
|
17193
17196
|
const runStatus = await this.getRunStatus();
|
|
17194
17197
|
const state = await this.getCurrentState();
|
|
@@ -17242,16 +17245,17 @@ var Agent = class {
|
|
|
17242
17245
|
for (const p of remainingPendings) {
|
|
17243
17246
|
if (signal?.aborted) break;
|
|
17244
17247
|
await this.queueStore?.markProcessing(p.id);
|
|
17245
|
-
const
|
|
17248
|
+
const humanContent = p.content;
|
|
17249
|
+
const message = new import_langchain61.HumanMessage({ id: humanContent.id, content: humanContent.message });
|
|
17246
17250
|
const startTime = Date.now();
|
|
17247
17251
|
this.publish("message:started", {
|
|
17248
17252
|
type: "message:started",
|
|
17249
|
-
messageId:
|
|
17250
|
-
messageContent:
|
|
17253
|
+
messageId: humanContent.id,
|
|
17254
|
+
messageContent: humanContent.message,
|
|
17251
17255
|
timestamp: /* @__PURE__ */ new Date(),
|
|
17252
17256
|
queueMode: "followup" /* FOLLOWUP */
|
|
17253
17257
|
});
|
|
17254
|
-
const queueMessageData =
|
|
17258
|
+
const queueMessageData = humanContent.queueMessage || {};
|
|
17255
17259
|
try {
|
|
17256
17260
|
await this.agentStreamExecutor({
|
|
17257
17261
|
input: { messages: [message] },
|
|
@@ -17263,7 +17267,7 @@ var Agent = class {
|
|
|
17263
17267
|
if (runStatus === "interrupted" /* INTERRUPTED */) {
|
|
17264
17268
|
this.publish("message:interrupted", {
|
|
17265
17269
|
type: "message:interrupted",
|
|
17266
|
-
messageId:
|
|
17270
|
+
messageId: humanContent.id,
|
|
17267
17271
|
timestamp: /* @__PURE__ */ new Date(),
|
|
17268
17272
|
duration: Date.now() - startTime,
|
|
17269
17273
|
state
|
|
@@ -17272,13 +17276,13 @@ var Agent = class {
|
|
|
17272
17276
|
this.addChunk({
|
|
17273
17277
|
type: "message_completed",
|
|
17274
17278
|
data: {
|
|
17275
|
-
id:
|
|
17279
|
+
id: humanContent.id,
|
|
17276
17280
|
content: ""
|
|
17277
17281
|
}
|
|
17278
17282
|
});
|
|
17279
17283
|
this.publish("message:completed", {
|
|
17280
17284
|
type: "message:completed",
|
|
17281
|
-
messageId:
|
|
17285
|
+
messageId: humanContent.id,
|
|
17282
17286
|
timestamp: /* @__PURE__ */ new Date(),
|
|
17283
17287
|
duration: Date.now() - startTime,
|
|
17284
17288
|
state
|
|
@@ -17289,13 +17293,13 @@ var Agent = class {
|
|
|
17289
17293
|
this.addChunk({
|
|
17290
17294
|
type: "message_failed",
|
|
17291
17295
|
data: {
|
|
17292
|
-
id:
|
|
17296
|
+
id: humanContent.id,
|
|
17293
17297
|
content: error instanceof Error ? error.message : String(error)
|
|
17294
17298
|
}
|
|
17295
17299
|
});
|
|
17296
17300
|
this.publish("message:failed", {
|
|
17297
17301
|
type: "message:failed",
|
|
17298
|
-
messageId:
|
|
17302
|
+
messageId: humanContent.id,
|
|
17299
17303
|
error: error instanceof Error ? error.message : String(error),
|
|
17300
17304
|
timestamp: /* @__PURE__ */ new Date()
|
|
17301
17305
|
});
|
|
@@ -17313,6 +17317,12 @@ var Agent = class {
|
|
|
17313
17317
|
this.project_id = project_id;
|
|
17314
17318
|
this.custom_run_config = custom_run_config;
|
|
17315
17319
|
}
|
|
17320
|
+
getHumanPendingContent(message) {
|
|
17321
|
+
if (typeof message.content === "string" || !message.content || !("id" in message.content) || !("message" in message.content)) {
|
|
17322
|
+
throw new Error(`Expected human pending message content for message ${message.id}`);
|
|
17323
|
+
}
|
|
17324
|
+
return message.content;
|
|
17325
|
+
}
|
|
17316
17326
|
/**
|
|
17317
17327
|
* Initialize with message queue store
|
|
17318
17328
|
*/
|
|
@@ -17427,7 +17437,7 @@ var Agent = class {
|
|
|
17427
17437
|
*/
|
|
17428
17438
|
async addMessage(queueMessage, mode) {
|
|
17429
17439
|
const useMode = mode ?? this.queueMode.mode;
|
|
17430
|
-
const messageId = (0, import_uuid2.v4)();
|
|
17440
|
+
const messageId = queueMessage.input.id || (0, import_uuid2.v4)();
|
|
17431
17441
|
const isHighPriority = useMode === "steer" /* STEER */ || !!queueMessage.command;
|
|
17432
17442
|
const store = this.getQueueStore();
|
|
17433
17443
|
const currentSize = await store.getQueueSize(this.thread_id);
|
|
@@ -17446,14 +17456,21 @@ var Agent = class {
|
|
|
17446
17456
|
}
|
|
17447
17457
|
};
|
|
17448
17458
|
if (isHighPriority) {
|
|
17449
|
-
await store.addMessageAtHead(this.thread_id, content, "human");
|
|
17459
|
+
await store.addMessageAtHead(this.thread_id, content, "human", messageId, queueMessage.command);
|
|
17460
|
+
if (useMode === "steer" /* STEER */) {
|
|
17461
|
+
this.stopQueueProcessor();
|
|
17462
|
+
await store.resetProcessingToPending(this.thread_id);
|
|
17463
|
+
console.log(`[Agent] STEER mode: stopped current processing, reset queue, message ${messageId} will execute next`);
|
|
17464
|
+
}
|
|
17450
17465
|
} else {
|
|
17451
17466
|
await store.addMessage({
|
|
17452
17467
|
threadId: this.thread_id,
|
|
17453
17468
|
tenantId: this.tenant_id,
|
|
17454
17469
|
assistantId: this.assistant_id,
|
|
17455
17470
|
content,
|
|
17456
|
-
type: "human"
|
|
17471
|
+
type: "human",
|
|
17472
|
+
command: queueMessage.command,
|
|
17473
|
+
id: messageId
|
|
17457
17474
|
});
|
|
17458
17475
|
}
|
|
17459
17476
|
this.startQueueProcessorIfNeeded().catch((err) => {
|
|
@@ -17486,7 +17503,7 @@ var Agent = class {
|
|
|
17486
17503
|
this.publish("thread:busy", {
|
|
17487
17504
|
type: "thread:busy",
|
|
17488
17505
|
timestamp: /* @__PURE__ */ new Date(),
|
|
17489
|
-
messageId: firstMessage
|
|
17506
|
+
messageId: firstMessage ? this.getHumanPendingContent(firstMessage).id : void 0
|
|
17490
17507
|
});
|
|
17491
17508
|
this.waitingForQueueEnd(this.abortController.signal).catch((error) => {
|
|
17492
17509
|
console.error(`Queue processing error for thread ${this.thread_id}:`, error);
|