@axiom-lattice/gateway 2.1.50 → 2.1.51

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @axiom-lattice/gateway@2.1.50 build /home/runner/work/agentic/agentic/packages/gateway
2
+ > @axiom-lattice/gateway@2.1.51 build /home/runner/work/agentic/agentic/packages/gateway
3
3
  > tsup src/index.ts --format cjs,esm --dts --clean --sourcemap
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -9,13 +9,13 @@
9
9
  CLI Cleaning output folder
10
10
  CJS Build start
11
11
  ESM Build start
12
- ESM dist/index.mjs 168.83 KB
13
- ESM dist/index.mjs.map 367.69 KB
14
- ESM ⚡️ Build success in 298ms
15
- CJS dist/index.js 172.24 KB
16
- CJS dist/index.js.map 367.18 KB
17
- CJS ⚡️ Build success in 321ms
12
+ CJS dist/index.js 172.91 KB
13
+ CJS dist/index.js.map 368.66 KB
14
+ CJS ⚡️ Build success in 267ms
15
+ ESM dist/index.mjs 169.50 KB
16
+ ESM dist/index.mjs.map 369.17 KB
17
+ ESM ⚡️ Build success in 266ms
18
18
  DTS Build start
19
- DTS ⚡️ Build success in 8843ms
19
+ DTS ⚡️ Build success in 9608ms
20
20
  DTS dist/index.d.ts 3.76 KB
21
21
  DTS dist/index.d.mts 3.76 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @axiom-lattice/gateway
2
2
 
3
+ ## 2.1.51
4
+
5
+ ### Patch Changes
6
+
7
+ - 4c4ca60: fix subagent state issue
8
+ - Updated dependencies [4c4ca60]
9
+ - @axiom-lattice/pg-stores@1.0.35
10
+ - @axiom-lattice/core@2.1.45
11
+
3
12
  ## 2.1.50
4
13
 
5
14
  ### Patch Changes
package/dist/index.js CHANGED
@@ -597,9 +597,20 @@ function getTenantId2(request) {
597
597
  async function getThreadList(request, reply) {
598
598
  const tenantId = getTenantId2(request);
599
599
  const { assistantId } = request.params;
600
+ const metadataFilter = {};
601
+ if (request.query.workspaceId) {
602
+ metadataFilter.workspaceId = request.query.workspaceId;
603
+ }
604
+ if (request.query.projectId) {
605
+ metadataFilter.projectId = request.query.projectId;
606
+ }
600
607
  const storeLattice = (0, import_core6.getStoreLattice)("default", "thread");
601
608
  const threadStore = storeLattice.store;
602
- const threads = await threadStore.getThreadsByAssistantId(tenantId, assistantId);
609
+ const threads = await threadStore.getThreadsByAssistantId(
610
+ tenantId,
611
+ assistantId,
612
+ Object.keys(metadataFilter).length > 0 ? metadataFilter : void 0
613
+ );
603
614
  return {
604
615
  success: true,
605
616
  message: "Successfully retrieved thread list",
@@ -632,9 +643,23 @@ async function createThread(request, reply) {
632
643
  const { assistantId } = request.params;
633
644
  const data = request.body;
634
645
  const threadId = (0, import_crypto2.randomUUID)();
646
+ const workspaceId = request.headers["x-workspace-id"];
647
+ const projectId = request.headers["x-project-id"];
648
+ const enrichedMetadata = {
649
+ ...data.metadata,
650
+ tenantId
651
+ };
652
+ if (workspaceId) {
653
+ enrichedMetadata.workspaceId = workspaceId;
654
+ }
655
+ if (projectId) {
656
+ enrichedMetadata.projectId = projectId;
657
+ }
635
658
  const storeLattice = (0, import_core6.getStoreLattice)("default", "thread");
636
659
  const threadStore = storeLattice.store;
637
- const newThread = await threadStore.createThread(tenantId, assistantId, threadId, data);
660
+ const newThread = await threadStore.createThread(tenantId, assistantId, threadId, {
661
+ metadata: enrichedMetadata
662
+ });
638
663
  return reply.status(201).send({
639
664
  success: true,
640
665
  message: "Successfully created thread",
@@ -5061,7 +5086,7 @@ var handleAgentTask = async (taskRequest, retryCount = 0) => {
5061
5086
  `\u5F00\u59CB\u5904\u7406\u4EFB\u52A1 [assistant_id: ${assistant_id}, thread_id: ${thread_id}]`
5062
5087
  );
5063
5088
  const agent = import_core26.agentInstanceManager.getAgent({ assistant_id, thread_id, tenant_id, workspace_id: runConfig?.workspaceId, project_id: runConfig?.projectId, custom_run_config: runConfig });
5064
- await agent.addMessage({ input, command }, import_core26.QueueMode.STEER);
5089
+ await agent.addMessage({ input, command, custom_run_config: runConfig }, import_core26.QueueMode.STEER);
5065
5090
  if (callback_event) {
5066
5091
  agent.subscribeOnce("message:completed", (evt) => {
5067
5092
  import_core26.eventBus.publish(callback_event, {