@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.
- package/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +9 -0
- package/dist/index.js +28 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/controllers/threads.ts +39 -4
- package/src/services/agent_task_consumer.ts +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @axiom-lattice/gateway@2.1.
|
|
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
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
[34mCLI[39m Cleaning output folder
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
11
|
[34mESM[39m Build start
|
|
12
|
-
[
|
|
13
|
-
[
|
|
14
|
-
[
|
|
15
|
-
[
|
|
16
|
-
[
|
|
17
|
-
[
|
|
12
|
+
[32mCJS[39m [1mdist/index.js [22m[32m172.91 KB[39m
|
|
13
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m368.66 KB[39m
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 267ms
|
|
15
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m169.50 KB[39m
|
|
16
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m369.17 KB[39m
|
|
17
|
+
[32mESM[39m ⚡️ Build success in 266ms
|
|
18
18
|
[34mDTS[39m Build start
|
|
19
|
-
[32mDTS[39m ⚡️ Build success in
|
|
19
|
+
[32mDTS[39m ⚡️ Build success in 9608ms
|
|
20
20
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m3.76 KB[39m
|
|
21
21
|
[32mDTS[39m [1mdist/index.d.mts [22m[32m3.76 KB[39m
|
package/CHANGELOG.md
CHANGED
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(
|
|
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,
|
|
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, {
|