@axiom-lattice/core 2.1.40 → 2.1.41

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 CHANGED
@@ -5005,6 +5005,7 @@ declare class Agent {
5005
5005
  project_id: string | undefined;
5006
5006
  custom_run_config: any;
5007
5007
  queueMode: ThreadQueueConfig;
5008
+ private isWaitingForQueueEnd;
5008
5009
  constructor({ assistant_id, thread_id, tenant_id, workspace_id, project_id, custom_run_config, }: AgentThreadInterface);
5009
5010
  /**
5010
5011
  * Initialize with message queue store
@@ -5024,6 +5025,7 @@ declare class Agent {
5024
5025
  private agentExecutor;
5025
5026
  getPendingMessages(): Promise<PendingMessage[]>;
5026
5027
  private agentStreamExecutor;
5028
+ private tryToCompleteThread;
5027
5029
  private waitingForQueueEnd;
5028
5030
  private getQueueStore;
5029
5031
  private getDefaultQueueConfig;
package/dist/index.d.ts CHANGED
@@ -5005,6 +5005,7 @@ declare class Agent {
5005
5005
  project_id: string | undefined;
5006
5006
  custom_run_config: any;
5007
5007
  queueMode: ThreadQueueConfig;
5008
+ private isWaitingForQueueEnd;
5008
5009
  constructor({ assistant_id, thread_id, tenant_id, workspace_id, project_id, custom_run_config, }: AgentThreadInterface);
5009
5010
  /**
5010
5011
  * Initialize with message queue store
@@ -5024,6 +5025,7 @@ declare class Agent {
5024
5025
  private agentExecutor;
5025
5026
  getPendingMessages(): Promise<PendingMessage[]>;
5026
5027
  private agentStreamExecutor;
5028
+ private tryToCompleteThread;
5027
5029
  private waitingForQueueEnd;
5028
5030
  private getQueueStore;
5029
5031
  private getDefaultQueueConfig;
package/dist/index.js CHANGED
@@ -12264,17 +12264,11 @@ ${BASE_PROMPT}` : BASE_PROMPT;
12264
12264
  todoListMiddleware(),
12265
12265
  // Enables filesystem operations and optional long-term memory storage
12266
12266
  createFilesystemMiddleware({ backend: filesystemBackend }),
12267
- createClawMiddleware({
12268
- backend: filesystemBackend
12269
- }),
12270
12267
  // Enables delegation to specialized subagents for complex tasks
12271
12268
  createSubAgentMiddleware({
12272
12269
  defaultModel: model,
12273
12270
  defaultTools: tools,
12274
12271
  defaultMiddleware: [
12275
- createClawMiddleware({
12276
- backend: filesystemBackend
12277
- }),
12278
12272
  // Subagent middleware: Todo list management
12279
12273
  todoListMiddleware(),
12280
12274
  // Subagent middleware: Filesystem operations
@@ -14732,6 +14726,7 @@ var InMemoryChunkBuffer = class extends ChunkBuffer {
14732
14726
  buffer2.status = "active" /* ACTIVE */;
14733
14727
  }
14734
14728
  async completeThread(threadId) {
14729
+ console.log("completeThread");
14735
14730
  const buffer2 = this.getBufferIfValid(threadId);
14736
14731
  if (buffer2) {
14737
14732
  buffer2.status = "completed" /* COMPLETED */;
@@ -14890,7 +14885,6 @@ var InMemoryChunkBuffer = class extends ChunkBuffer {
14890
14885
  if (!chunk) continue;
14891
14886
  if (chunk.data?.id === messageId) {
14892
14887
  startYieldChunk = true;
14893
- accumulatedContent += chunk.data?.content || "";
14894
14888
  }
14895
14889
  if (startYieldChunk) {
14896
14890
  yield chunk;
@@ -16968,6 +16962,7 @@ var Agent = class {
16968
16962
  this.chunkBuffer = getChunkBuffer("default");
16969
16963
  this.abortController = null;
16970
16964
  this.queueMode = this.getDefaultQueueConfig();
16965
+ this.isWaitingForQueueEnd = false;
16971
16966
  this.agentExecutor = async ({ input, command, custom_run_config }, signal) => {
16972
16967
  const { runnable_agent, runConfig } = await this.getLatticeClientAndRuntimeConfig(custom_run_config);
16973
16968
  const { messages, ...rest } = input;
@@ -17114,7 +17109,7 @@ var Agent = class {
17114
17109
  while (!signal?.aborted) {
17115
17110
  const pendings = await this.getPendingMessages();
17116
17111
  if (pendings.length === 0) {
17117
- await this.chunkBuffer.completeThread(this.thread_id);
17112
+ await this.tryToCompleteThread();
17118
17113
  const state = await this.getCurrentState();
17119
17114
  const pendingCount = await this.getQueueStore().getQueueSize(this.thread_id);
17120
17115
  this.publish("thread:idle", {
@@ -17141,11 +17136,13 @@ var Agent = class {
17141
17136
  queueMode: this.queueMode.mode
17142
17137
  });
17143
17138
  const input = {
17144
- messages: [new import_langchain61.HumanMessage({ id: p.content.id, content: p.content.message })],
17145
- command: p.content.command
17139
+ messages: [new import_langchain61.HumanMessage({ id: p.content.id, content: p.content.message })]
17146
17140
  };
17147
17141
  try {
17148
- await this.agentStreamExecutor({ input }, signal);
17142
+ await this.agentStreamExecutor({
17143
+ input,
17144
+ command: p.content.command
17145
+ }, signal);
17149
17146
  await this.queueStore?.markCompleted(p.id);
17150
17147
  const state = await this.getCurrentState();
17151
17148
  this.publish("message:completed", {
@@ -17322,6 +17319,11 @@ var Agent = class {
17322
17319
  const store = this.getQueueStore();
17323
17320
  return await store.getPendingMessages(this.thread_id);
17324
17321
  }
17322
+ async tryToCompleteThread() {
17323
+ setTimeout(async () => {
17324
+ await this.chunkBuffer.completeThread(this.thread_id);
17325
+ }, 100);
17326
+ }
17325
17327
  getQueueStore() {
17326
17328
  if (!this.queueStore) {
17327
17329
  try {