@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.mjs CHANGED
@@ -12103,17 +12103,11 @@ ${BASE_PROMPT}` : BASE_PROMPT;
12103
12103
  todoListMiddleware(),
12104
12104
  // Enables filesystem operations and optional long-term memory storage
12105
12105
  createFilesystemMiddleware({ backend: filesystemBackend }),
12106
- createClawMiddleware({
12107
- backend: filesystemBackend
12108
- }),
12109
12106
  // Enables delegation to specialized subagents for complex tasks
12110
12107
  createSubAgentMiddleware({
12111
12108
  defaultModel: model,
12112
12109
  defaultTools: tools,
12113
12110
  defaultMiddleware: [
12114
- createClawMiddleware({
12115
- backend: filesystemBackend
12116
- }),
12117
12111
  // Subagent middleware: Todo list management
12118
12112
  todoListMiddleware(),
12119
12113
  // Subagent middleware: Filesystem operations
@@ -14579,6 +14573,7 @@ var InMemoryChunkBuffer = class extends ChunkBuffer {
14579
14573
  buffer2.status = "active" /* ACTIVE */;
14580
14574
  }
14581
14575
  async completeThread(threadId) {
14576
+ console.log("completeThread");
14582
14577
  const buffer2 = this.getBufferIfValid(threadId);
14583
14578
  if (buffer2) {
14584
14579
  buffer2.status = "completed" /* COMPLETED */;
@@ -14737,7 +14732,6 @@ var InMemoryChunkBuffer = class extends ChunkBuffer {
14737
14732
  if (!chunk) continue;
14738
14733
  if (chunk.data?.id === messageId) {
14739
14734
  startYieldChunk = true;
14740
- accumulatedContent += chunk.data?.content || "";
14741
14735
  }
14742
14736
  if (startYieldChunk) {
14743
14737
  yield chunk;
@@ -16824,6 +16818,7 @@ var Agent = class {
16824
16818
  this.chunkBuffer = getChunkBuffer("default");
16825
16819
  this.abortController = null;
16826
16820
  this.queueMode = this.getDefaultQueueConfig();
16821
+ this.isWaitingForQueueEnd = false;
16827
16822
  this.agentExecutor = async ({ input, command, custom_run_config }, signal) => {
16828
16823
  const { runnable_agent, runConfig } = await this.getLatticeClientAndRuntimeConfig(custom_run_config);
16829
16824
  const { messages, ...rest } = input;
@@ -16970,7 +16965,7 @@ var Agent = class {
16970
16965
  while (!signal?.aborted) {
16971
16966
  const pendings = await this.getPendingMessages();
16972
16967
  if (pendings.length === 0) {
16973
- await this.chunkBuffer.completeThread(this.thread_id);
16968
+ await this.tryToCompleteThread();
16974
16969
  const state = await this.getCurrentState();
16975
16970
  const pendingCount = await this.getQueueStore().getQueueSize(this.thread_id);
16976
16971
  this.publish("thread:idle", {
@@ -16997,11 +16992,13 @@ var Agent = class {
16997
16992
  queueMode: this.queueMode.mode
16998
16993
  });
16999
16994
  const input = {
17000
- messages: [new HumanMessage2({ id: p.content.id, content: p.content.message })],
17001
- command: p.content.command
16995
+ messages: [new HumanMessage2({ id: p.content.id, content: p.content.message })]
17002
16996
  };
17003
16997
  try {
17004
- await this.agentStreamExecutor({ input }, signal);
16998
+ await this.agentStreamExecutor({
16999
+ input,
17000
+ command: p.content.command
17001
+ }, signal);
17005
17002
  await this.queueStore?.markCompleted(p.id);
17006
17003
  const state = await this.getCurrentState();
17007
17004
  this.publish("message:completed", {
@@ -17178,6 +17175,11 @@ var Agent = class {
17178
17175
  const store = this.getQueueStore();
17179
17176
  return await store.getPendingMessages(this.thread_id);
17180
17177
  }
17178
+ async tryToCompleteThread() {
17179
+ setTimeout(async () => {
17180
+ await this.chunkBuffer.completeThread(this.thread_id);
17181
+ }, 100);
17182
+ }
17181
17183
  getQueueStore() {
17182
17184
  if (!this.queueStore) {
17183
17185
  try {