@axiom-lattice/gateway 2.1.46 → 2.1.48
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 +20 -0
- package/dist/index.js +24 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +20 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
- package/src/controllers/memory.ts +9 -1
- package/src/controllers/run.ts +22 -9
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @axiom-lattice/gateway@2.1.
|
|
2
|
+
> @axiom-lattice/gateway@2.1.48 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[32m168.46 KB[39m
|
|
13
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m359.44 KB[39m
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 322ms
|
|
15
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m165.00 KB[39m
|
|
16
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m359.85 KB[39m
|
|
17
|
+
[32mESM[39m ⚡️ Build success in 321ms
|
|
18
18
|
[34mDTS[39m Build start
|
|
19
|
-
[32mDTS[39m ⚡️ Build success in
|
|
19
|
+
[32mDTS[39m ⚡️ Build success in 9889ms
|
|
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
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @axiom-lattice/gateway
|
|
2
2
|
|
|
3
|
+
## 2.1.48
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 9a4f338: update sse
|
|
8
|
+
- Updated dependencies [9a4f338]
|
|
9
|
+
- @axiom-lattice/protocols@2.1.23
|
|
10
|
+
- @axiom-lattice/core@2.1.42
|
|
11
|
+
- @axiom-lattice/pg-stores@1.0.32
|
|
12
|
+
- @axiom-lattice/queue-redis@1.0.22
|
|
13
|
+
|
|
14
|
+
## 2.1.47
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- fc60965: fix schedule issue
|
|
19
|
+
- Updated dependencies [fc60965]
|
|
20
|
+
- @axiom-lattice/core@2.1.41
|
|
21
|
+
- @axiom-lattice/pg-stores@1.0.31
|
|
22
|
+
|
|
3
23
|
## 2.1.46
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -234,6 +234,7 @@ var getAgentGraph = async (request, reply) => {
|
|
|
234
234
|
// src/controllers/run.ts
|
|
235
235
|
var import_uuid = require("uuid");
|
|
236
236
|
var import_core3 = require("@axiom-lattice/core");
|
|
237
|
+
var import_protocols = require("@axiom-lattice/protocols");
|
|
237
238
|
var createRun = async (request, reply) => {
|
|
238
239
|
try {
|
|
239
240
|
const {
|
|
@@ -278,9 +279,8 @@ var createRun = async (request, reply) => {
|
|
|
278
279
|
command,
|
|
279
280
|
custom_run_config
|
|
280
281
|
});
|
|
281
|
-
const stream = agent.chunkStream(result.messageId);
|
|
282
|
+
const stream = agent.chunkStream(result.messageId, [import_protocols.MessageChunkTypes.MESSAGE_COMPLETED]);
|
|
282
283
|
for await (const chunk of stream) {
|
|
283
|
-
console.log(input.message, chunk.data.content);
|
|
284
284
|
const success = reply.raw.write(`data: ${JSON.stringify(chunk)}
|
|
285
285
|
|
|
286
286
|
`);
|
|
@@ -323,11 +323,14 @@ var createRun = async (request, reply) => {
|
|
|
323
323
|
};
|
|
324
324
|
var resumeStream = async (request, reply) => {
|
|
325
325
|
try {
|
|
326
|
-
const { thread_id, message_id, known_content, poll_interval } = request.body;
|
|
327
|
-
|
|
326
|
+
const { thread_id, message_id, assistant_id, known_content, poll_interval } = request.body;
|
|
327
|
+
const tenant_id = request.headers["x-tenant-id"];
|
|
328
|
+
const workspace_id = request.headers["x-workspace-id"];
|
|
329
|
+
const project_id = request.headers["x-project-id"];
|
|
330
|
+
if (!thread_id || !message_id || !assistant_id || known_content === void 0) {
|
|
328
331
|
reply.status(400).send({
|
|
329
332
|
success: false,
|
|
330
|
-
error: "thread_id, message_id, and known_content are required"
|
|
333
|
+
error: "thread_id, message_id, assistant_id, and known_content are required"
|
|
331
334
|
});
|
|
332
335
|
return;
|
|
333
336
|
}
|
|
@@ -339,12 +342,15 @@ var resumeStream = async (request, reply) => {
|
|
|
339
342
|
"Access-Control-Allow-Origin": "*"
|
|
340
343
|
});
|
|
341
344
|
try {
|
|
342
|
-
const agent =
|
|
343
|
-
assistant_id
|
|
345
|
+
const agent = import_core3.agentInstanceManager.getAgent({
|
|
346
|
+
assistant_id,
|
|
344
347
|
thread_id,
|
|
345
|
-
tenant_id
|
|
348
|
+
tenant_id,
|
|
349
|
+
workspace_id,
|
|
350
|
+
project_id
|
|
346
351
|
});
|
|
347
|
-
|
|
352
|
+
console.log("[UI]message_id", message_id);
|
|
353
|
+
const stream = agent.chunkStream(message_id, [import_protocols.MessageChunkTypes.THREAD_IDLE]);
|
|
348
354
|
for await (const chunk of stream) {
|
|
349
355
|
reply.raw.write(`data: ${JSON.stringify(chunk)}
|
|
350
356
|
|
|
@@ -477,9 +483,13 @@ var getAgentState = async (request, reply) => {
|
|
|
477
483
|
reply.status(500).send(result);
|
|
478
484
|
return;
|
|
479
485
|
}
|
|
486
|
+
const normalizedPendingMessages = pendingMessages.map((msg) => ({
|
|
487
|
+
...msg,
|
|
488
|
+
content: typeof msg.content === "object" && msg.content !== null ? msg.content.message || JSON.stringify(msg.content) : String(msg.content || "")
|
|
489
|
+
}));
|
|
480
490
|
const mergedResult = {
|
|
481
491
|
...result,
|
|
482
|
-
pendingMessages
|
|
492
|
+
pendingMessages: normalizedPendingMessages
|
|
483
493
|
};
|
|
484
494
|
reply.send(mergedResult);
|
|
485
495
|
} catch (error) {
|
|
@@ -963,7 +973,7 @@ var configService = new ConfigService();
|
|
|
963
973
|
|
|
964
974
|
// src/services/queue_service.ts
|
|
965
975
|
var import_core8 = require("@axiom-lattice/core");
|
|
966
|
-
var
|
|
976
|
+
var import_protocols2 = require("@axiom-lattice/protocols");
|
|
967
977
|
var import_queue_redis = require("@axiom-lattice/queue-redis");
|
|
968
978
|
var DEFAULT_QUEUE_KEY = "default";
|
|
969
979
|
var queueServiceType = process.env.QUEUE_SERVICE_TYPE || "memory";
|
|
@@ -974,7 +984,7 @@ var setQueueServiceType = (type) => {
|
|
|
974
984
|
const config = {
|
|
975
985
|
name: "Default Queue Service",
|
|
976
986
|
description: `Default ${type} queue service`,
|
|
977
|
-
type: type === "redis" ?
|
|
987
|
+
type: type === "redis" ? import_protocols2.QueueType.REDIS : import_protocols2.QueueType.MEMORY,
|
|
978
988
|
queueName,
|
|
979
989
|
options: type === "redis" ? {
|
|
980
990
|
redisUrl: process.env.REDIS_URL,
|
|
@@ -5149,14 +5159,14 @@ var AgentTaskConsumer = _AgentTaskConsumer;
|
|
|
5149
5159
|
|
|
5150
5160
|
// src/index.ts
|
|
5151
5161
|
var import_core26 = require("@axiom-lattice/core");
|
|
5152
|
-
var
|
|
5162
|
+
var import_protocols3 = require("@axiom-lattice/protocols");
|
|
5153
5163
|
process.on("unhandledRejection", (reason, promise) => {
|
|
5154
5164
|
console.error("\u672A\u5904\u7406\u7684Promise\u62D2\u7EDD:", reason);
|
|
5155
5165
|
});
|
|
5156
5166
|
var DEFAULT_LOGGER_CONFIG = {
|
|
5157
5167
|
name: "default",
|
|
5158
5168
|
description: "Default logger for lattice-gateway service",
|
|
5159
|
-
type:
|
|
5169
|
+
type: import_protocols3.LoggerType.PINO,
|
|
5160
5170
|
serviceName: "lattice/gateway",
|
|
5161
5171
|
loggerName: "lattice/gateway"
|
|
5162
5172
|
};
|