@axiom-lattice/gateway 2.1.77 → 2.1.79
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 +24 -0
- package/dist/index.js +79 -20
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +80 -21
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
- package/src/channels/lark/LarkChannelAdapter.ts +1 -1
- package/src/channels/lark/controller.ts +4 -3
- package/src/controllers/sandbox.ts +21 -21
- package/src/controllers/workflow-tracking.ts +59 -3
- package/src/router/MessageRouter.ts +15 -5
- package/src/routes/index.ts +5 -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.79 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
|
|
@@ -18,15 +18,15 @@
|
|
|
18
18
|
You need to set the output format to "esm" for "import.meta" to work correctly.
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
[32mCJS[39m [1mdist/index.js [22m[
|
|
22
|
-
[32mCJS[39m [1mdist/index.js.map [22m[
|
|
23
|
-
[32mCJS[39m ⚡️ Build success in
|
|
21
|
+
[32mCJS[39m [1mdist/index.js [22m[32m239.18 KB[39m
|
|
22
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m502.61 KB[39m
|
|
23
|
+
[32mCJS[39m ⚡️ Build success in 411ms
|
|
24
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m234.48 KB[39m
|
|
24
25
|
[32mESM[39m [1mdist/sender-PX32VSHB.mjs [22m[32m873.00 B[39m
|
|
25
|
-
[32mESM[39m [1mdist/index.mjs [22m[32m232.14 KB[39m
|
|
26
26
|
[32mESM[39m [1mdist/sender-PX32VSHB.mjs.map [22m[32m2.07 KB[39m
|
|
27
|
-
[32mESM[39m [1mdist/index.mjs.map [22m[
|
|
28
|
-
[32mESM[39m ⚡️ Build success in
|
|
27
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m501.10 KB[39m
|
|
28
|
+
[32mESM[39m ⚡️ Build success in 412ms
|
|
29
29
|
[34mDTS[39m Build start
|
|
30
|
-
[32mDTS[39m ⚡️ Build success in
|
|
30
|
+
[32mDTS[39m ⚡️ Build success in 13288ms
|
|
31
31
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m5.01 KB[39m
|
|
32
32
|
[32mDTS[39m [1mdist/index.d.mts [22m[32m5.01 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @axiom-lattice/gateway
|
|
2
2
|
|
|
3
|
+
## 2.1.79
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- c560d5d: fix sandbox image & env consistency, unify sandbox creation through getSandboxFromConfig
|
|
8
|
+
- Updated dependencies [c560d5d]
|
|
9
|
+
- @axiom-lattice/core@2.1.69
|
|
10
|
+
- @axiom-lattice/protocols@2.1.36
|
|
11
|
+
- @axiom-lattice/agent-eval@2.1.63
|
|
12
|
+
- @axiom-lattice/pg-stores@1.0.59
|
|
13
|
+
- @axiom-lattice/queue-redis@1.0.35
|
|
14
|
+
|
|
15
|
+
## 2.1.78
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 6446394: up workflow
|
|
20
|
+
- Updated dependencies [6446394]
|
|
21
|
+
- @axiom-lattice/pg-stores@1.0.58
|
|
22
|
+
- @axiom-lattice/protocols@2.1.35
|
|
23
|
+
- @axiom-lattice/core@2.1.68
|
|
24
|
+
- @axiom-lattice/agent-eval@2.1.62
|
|
25
|
+
- @axiom-lattice/queue-redis@1.0.34
|
|
26
|
+
|
|
3
27
|
## 2.1.77
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -2029,6 +2029,41 @@ async function getWorkflowRun(request, reply) {
|
|
|
2029
2029
|
return reply.status(500).send({ success: false, message: "Failed to retrieve workflow run" });
|
|
2030
2030
|
}
|
|
2031
2031
|
}
|
|
2032
|
+
async function deleteWorkflowRun(request, reply) {
|
|
2033
|
+
const { runId } = request.params;
|
|
2034
|
+
const tenantId = getTenantId6(request);
|
|
2035
|
+
try {
|
|
2036
|
+
const store = getTrackingStore();
|
|
2037
|
+
if (!store) {
|
|
2038
|
+
return reply.status(404).send({ success: false, message: "No workflow tracking store configured" });
|
|
2039
|
+
}
|
|
2040
|
+
const run = await store.getWorkflowRun(runId);
|
|
2041
|
+
if (!run) {
|
|
2042
|
+
return reply.status(404).send({ success: false, message: "Workflow run not found" });
|
|
2043
|
+
}
|
|
2044
|
+
if (run.status === "running") {
|
|
2045
|
+
try {
|
|
2046
|
+
const workspace_id = request.headers["x-workspace-id"];
|
|
2047
|
+
const project_id = request.headers["x-project-id"];
|
|
2048
|
+
const agent = import_core13.agentInstanceManager.getAgent({
|
|
2049
|
+
assistant_id: run.assistantId,
|
|
2050
|
+
thread_id: run.threadId,
|
|
2051
|
+
tenant_id: tenantId,
|
|
2052
|
+
workspace_id,
|
|
2053
|
+
project_id
|
|
2054
|
+
});
|
|
2055
|
+
await agent.abort();
|
|
2056
|
+
} catch (err) {
|
|
2057
|
+
request.log.warn({ runId, error: err.message }, "Failed to abort agent, deleting tracking records anyway");
|
|
2058
|
+
}
|
|
2059
|
+
}
|
|
2060
|
+
await store.deleteWorkflowRun(runId);
|
|
2061
|
+
return { success: true, message: "Workflow run deleted" };
|
|
2062
|
+
} catch (error) {
|
|
2063
|
+
request.log.error(error, "Failed to delete workflow run");
|
|
2064
|
+
return reply.status(500).send({ success: false, message: "Failed to delete workflow run" });
|
|
2065
|
+
}
|
|
2066
|
+
}
|
|
2032
2067
|
async function getRunSteps(request, reply) {
|
|
2033
2068
|
const { runId } = request.params;
|
|
2034
2069
|
const { step_type, status: stepStatus } = request.query;
|
|
@@ -2101,6 +2136,14 @@ async function replyInboxTask(request, reply) {
|
|
|
2101
2136
|
workspace_id,
|
|
2102
2137
|
project_id
|
|
2103
2138
|
});
|
|
2139
|
+
const runStatus = await agent.getRunStatus();
|
|
2140
|
+
if (runStatus !== import_core13.ThreadStatus.INTERRUPTED) {
|
|
2141
|
+
return reply.status(409).send({
|
|
2142
|
+
success: false,
|
|
2143
|
+
message: `Cannot resume: graph is not interrupted (current status: ${runStatus})`,
|
|
2144
|
+
data: { runId: run.id, assistantId: run.assistantId, threadId: run.threadId, status: runStatus }
|
|
2145
|
+
});
|
|
2146
|
+
}
|
|
2104
2147
|
agent.addMessage({
|
|
2105
2148
|
input: { message: "Clarification answers submitted" },
|
|
2106
2149
|
command: {
|
|
@@ -2752,13 +2795,17 @@ function registerSandboxProxyRoutes(app2) {
|
|
|
2752
2795
|
if (!vmIsolation) {
|
|
2753
2796
|
return reply.status(500).send({ error: "Assistant sandbox config not found" });
|
|
2754
2797
|
}
|
|
2755
|
-
const
|
|
2756
|
-
|
|
2757
|
-
threadId,
|
|
2758
|
-
vmIsolation
|
|
2759
|
-
);
|
|
2798
|
+
const workspaceId = request.headers["x-workspace-id"];
|
|
2799
|
+
const projectId = request.headers["x-project-id"];
|
|
2760
2800
|
const sandboxManager = (0, import_core16.getSandBoxManager)();
|
|
2761
|
-
const sandbox = await sandboxManager.
|
|
2801
|
+
const sandbox = await sandboxManager.getSandboxFromConfig({
|
|
2802
|
+
assistant_id: assistantId,
|
|
2803
|
+
thread_id: threadId,
|
|
2804
|
+
tenantId,
|
|
2805
|
+
workspaceId,
|
|
2806
|
+
projectId,
|
|
2807
|
+
vmIsolation
|
|
2808
|
+
});
|
|
2762
2809
|
try {
|
|
2763
2810
|
const data = await request.file();
|
|
2764
2811
|
if (!data) {
|
|
@@ -2796,13 +2843,17 @@ function registerSandboxProxyRoutes(app2) {
|
|
|
2796
2843
|
if (!vmIsolation) {
|
|
2797
2844
|
return reply.status(500).send({ error: "Assistant filesystem vmIsolation not found" });
|
|
2798
2845
|
}
|
|
2799
|
-
const
|
|
2800
|
-
|
|
2801
|
-
threadId,
|
|
2802
|
-
vmIsolation
|
|
2803
|
-
);
|
|
2846
|
+
const workspaceId = request.headers["x-workspace-id"];
|
|
2847
|
+
const projectId = request.headers["x-project-id"];
|
|
2804
2848
|
const sandboxManager = (0, import_core16.getSandBoxManager)();
|
|
2805
|
-
const sandbox = await sandboxManager.
|
|
2849
|
+
const sandbox = await sandboxManager.getSandboxFromConfig({
|
|
2850
|
+
assistant_id: assistantId,
|
|
2851
|
+
thread_id: threadId,
|
|
2852
|
+
tenantId,
|
|
2853
|
+
workspaceId,
|
|
2854
|
+
projectId,
|
|
2855
|
+
vmIsolation
|
|
2856
|
+
});
|
|
2806
2857
|
try {
|
|
2807
2858
|
const resolvedPath = filePath.startsWith("/") ? filePath : `/${filePath}`;
|
|
2808
2859
|
const filename = getFilenameFromPath(resolvedPath);
|
|
@@ -5842,7 +5893,7 @@ var larkChannelAdapter = {
|
|
|
5842
5893
|
},
|
|
5843
5894
|
async sendReply(replyTarget, message, installation) {
|
|
5844
5895
|
const { createLarkSender: createLarkSender2 } = await Promise.resolve().then(() => (init_sender(), sender_exports));
|
|
5845
|
-
const sender = createLarkSender2(installation.config);
|
|
5896
|
+
const sender = await createLarkSender2(installation.config);
|
|
5846
5897
|
await sender.sendTextReply({
|
|
5847
5898
|
chatId: replyTarget.rawTarget.chatId,
|
|
5848
5899
|
text: message.text
|
|
@@ -6020,12 +6071,13 @@ function createLarkEventHandler(deps) {
|
|
|
6020
6071
|
reply.status(404).send({ success: false, message: "Installation not found" });
|
|
6021
6072
|
return;
|
|
6022
6073
|
}
|
|
6023
|
-
const
|
|
6074
|
+
const larkInstallation = installation;
|
|
6075
|
+
const body = parseLarkRequestBody(request.body, larkInstallation.config.encryptKey);
|
|
6024
6076
|
if (body.type === "url_verification" && body.challenge) {
|
|
6025
6077
|
reply.status(200).send({ challenge: body.challenge });
|
|
6026
6078
|
return;
|
|
6027
6079
|
}
|
|
6028
|
-
const inboundMessage = await larkChannelAdapter.receive(request.body,
|
|
6080
|
+
const inboundMessage = await larkChannelAdapter.receive(request.body, larkInstallation);
|
|
6029
6081
|
if (!inboundMessage) {
|
|
6030
6082
|
reply.status(200).send();
|
|
6031
6083
|
return;
|
|
@@ -6579,7 +6631,7 @@ var registerLatticeRoutes = (app2, channelDeps) => {
|
|
|
6579
6631
|
const inboundMessage = {
|
|
6580
6632
|
channel: msg.channel,
|
|
6581
6633
|
channelInstallationId: msg.channelInstallationId || "",
|
|
6582
|
-
tenantId: msg.tenantId
|
|
6634
|
+
tenantId: msg.tenantId,
|
|
6583
6635
|
sender: {
|
|
6584
6636
|
id: msg.sender.id,
|
|
6585
6637
|
displayName: msg.sender.displayName
|
|
@@ -6620,6 +6672,7 @@ var registerLatticeRoutes = (app2, channelDeps) => {
|
|
|
6620
6672
|
getWorkflowRuns
|
|
6621
6673
|
);
|
|
6622
6674
|
app2.get("/api/workflows/runs/:runId", getWorkflowRun);
|
|
6675
|
+
app2.delete("/api/workflows/runs/:runId", deleteWorkflowRun);
|
|
6623
6676
|
app2.get("/api/workflows/runs/:runId/steps", getRunSteps);
|
|
6624
6677
|
app2.get("/api/workflows/runs/:runId/tasks", getRunTasks);
|
|
6625
6678
|
app2.post("/api/workflows/inbox/reply", replyInboxTask);
|
|
@@ -6655,11 +6708,17 @@ var MessageRouter = class {
|
|
|
6655
6708
|
};
|
|
6656
6709
|
try {
|
|
6657
6710
|
await this.runMiddlewares(ctx, async () => {
|
|
6711
|
+
const tenantId = message.tenantId || (await this.installationStore.getInstallationById(message.channelInstallationId))?.tenantId;
|
|
6712
|
+
if (!tenantId) {
|
|
6713
|
+
throw new Error(
|
|
6714
|
+
"tenantId is required: provide it in the message or ensure the channelInstallation has a tenantId"
|
|
6715
|
+
);
|
|
6716
|
+
}
|
|
6658
6717
|
let binding = await this.bindingRegistry.resolve({
|
|
6659
6718
|
channel: message.channel,
|
|
6660
6719
|
senderId: message.sender.id,
|
|
6661
6720
|
channelInstallationId: message.channelInstallationId,
|
|
6662
|
-
tenantId
|
|
6721
|
+
tenantId
|
|
6663
6722
|
});
|
|
6664
6723
|
if (!binding) {
|
|
6665
6724
|
const installation = await this.installationStore.getInstallationById(
|
|
@@ -6675,7 +6734,7 @@ var MessageRouter = class {
|
|
|
6675
6734
|
id: "fallback",
|
|
6676
6735
|
channel: message.channel,
|
|
6677
6736
|
channelInstallationId: message.channelInstallationId,
|
|
6678
|
-
tenantId
|
|
6737
|
+
tenantId,
|
|
6679
6738
|
senderId: message.sender.id,
|
|
6680
6739
|
agentId: installation.fallbackAgentId,
|
|
6681
6740
|
threadId: void 0,
|
|
@@ -6701,7 +6760,7 @@ var MessageRouter = class {
|
|
|
6701
6760
|
const threadStore = (0, import_core28.getStoreLattice)("default", "thread").store;
|
|
6702
6761
|
const newThreadId = (0, import_crypto8.randomUUID)();
|
|
6703
6762
|
const newThread = await threadStore.createThread(
|
|
6704
|
-
|
|
6763
|
+
tenantId,
|
|
6705
6764
|
ctx.binding.agentId,
|
|
6706
6765
|
newThreadId,
|
|
6707
6766
|
{
|
|
@@ -6722,7 +6781,7 @@ var MessageRouter = class {
|
|
|
6722
6781
|
}
|
|
6723
6782
|
}
|
|
6724
6783
|
const agent = import_core28.agentInstanceManager.getAgent({
|
|
6725
|
-
tenant_id:
|
|
6784
|
+
tenant_id: tenantId,
|
|
6726
6785
|
assistant_id: ctx.binding.agentId,
|
|
6727
6786
|
thread_id: threadId,
|
|
6728
6787
|
workspace_id: ctx.binding.workspaceId || "",
|