@axiom-lattice/gateway 4.6.1 → 4.7.0
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/OrphanRecoveryRuntime-MQDEJX3M.mjs +8 -0
- package/dist/OrphanRecoveryRuntime-MQDEJX3M.mjs.map +1 -0
- package/dist/RecoveryCallerDeps-6SJUYJ5S.mjs +8 -0
- package/dist/RecoveryCallerDeps-6SJUYJ5S.mjs.map +1 -0
- package/dist/{a2a-standard-PIOKEHPS.mjs → a2a-standard-PBYPNHOA.mjs} +59 -21
- package/dist/a2a-standard-PBYPNHOA.mjs.map +1 -0
- package/dist/chunk-KDQKTU3N.mjs +288 -0
- package/dist/chunk-KDQKTU3N.mjs.map +1 -0
- package/dist/chunk-NOXGKYUV.mjs +37 -0
- package/dist/chunk-NOXGKYUV.mjs.map +1 -0
- package/dist/{chunk-526UYVNQ.mjs → chunk-NPHK4SZ6.mjs} +4 -4
- package/dist/embed/{embed-page-AgentDetailSideApp-7NYLPLAX.js → embed-page-AgentDetailSideApp-2C2ZR62Q.js} +1 -1
- package/dist/embed/{embed-page-AgentGovernanceWorkbench-LNGNSI7X.js → embed-page-AgentGovernanceWorkbench-GG4ONSTS.js} +1 -1
- package/dist/embed/{embed-page-MessageGraph-E6DZDT65.js → embed-page-MessageGraph-WMYTVUUC.js} +1 -1
- package/dist/embed/{embed-page-ReactChart-3VE7F5VJ.js → embed-page-ReactChart-7XCMDMH6.js} +1 -1
- package/dist/embed/{embed-page-TasksSideApp-QM5TZ7EG.js → embed-page-TasksSideApp-4ZJ4Q4CL.js} +1 -1
- package/dist/embed/{embed-page-TeamWorkspace-E7RFY3ZY.js → embed-page-TeamWorkspace-H5OOEN3K.js} +1 -1
- package/dist/embed/{embed-page-TopologyRuntimeView-DLPDUB7Z.js → embed-page-TopologyRuntimeView-QMXWERVC.js} +1 -1
- package/dist/embed/{embed-page-WorkflowAutomationView-FKSVOHHB.js → embed-page-WorkflowAutomationView-L2OEGCA5.js} +1 -1
- package/dist/embed/{embed-page-chunk-H6TK3FAR.js → embed-page-chunk-2G54EIW2.js} +1 -1
- package/dist/embed/{embed-page-chunk-I7PWCKAG.js → embed-page-chunk-CZE4IEB3.js} +1 -1
- package/dist/embed/{embed-page-chunk-WWTU55RX.js → embed-page-chunk-N2ISCAS7.js} +1 -1
- package/dist/embed/{embed-page-chunk-EXCJ42IB.js → embed-page-chunk-OHDEKFTU.js} +1 -1
- package/dist/embed/{embed-page-chunk-KN7D66KL.js → embed-page-chunk-SUMYB6ZA.js} +1 -1
- package/dist/embed/{embed-page-chunk-U276WBDI.js → embed-page-chunk-XIXSRYJY.js} +6 -6
- package/dist/embed/embed-page.js +1 -1
- package/dist/index.d.mts +226 -3
- package/dist/index.d.ts +226 -3
- package/dist/index.js +638 -257
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +86 -78
- package/dist/index.mjs.map +1 -1
- package/dist/{open-AMEMJOFJ.mjs → open-STFMNRO5.mjs} +8 -8
- package/dist/{open-exposure-I44Q4M3T.mjs → open-exposure-VU227IO3.mjs} +5 -5
- package/dist/{open-files-EJ6O2SGX.mjs → open-files-NPNQQ6TY.mjs} +4 -4
- package/dist/{open-session-LBTCU3AE.mjs → open-session-IHDGAXL3.mjs} +4 -4
- package/package.json +7 -7
- package/dist/a2a-standard-PIOKEHPS.mjs.map +0 -1
- /package/dist/{chunk-526UYVNQ.mjs.map → chunk-NPHK4SZ6.mjs.map} +0 -0
- /package/dist/{open-AMEMJOFJ.mjs.map → open-STFMNRO5.mjs.map} +0 -0
- /package/dist/{open-exposure-I44Q4M3T.mjs.map → open-exposure-VU227IO3.mjs.map} +0 -0
- /package/dist/{open-files-EJ6O2SGX.mjs.map → open-files-NPNQQ6TY.mjs.map} +0 -0
- /package/dist/{open-session-LBTCU3AE.mjs.map → open-session-IHDGAXL3.mjs.map} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -14,6 +14,19 @@ import "./chunk-WKNZ7GBC.mjs";
|
|
|
14
14
|
import {
|
|
15
15
|
CollectionService
|
|
16
16
|
} from "./chunk-PWHUWFXL.mjs";
|
|
17
|
+
import {
|
|
18
|
+
createOrphanRecoveryRuntime,
|
|
19
|
+
isProjectLifecycleTask,
|
|
20
|
+
isRosterExemptProject,
|
|
21
|
+
recoverTask,
|
|
22
|
+
recoverTopCaller,
|
|
23
|
+
resolveTaskOwnerMembership,
|
|
24
|
+
resolveTopCaller,
|
|
25
|
+
runOrphanRecovery
|
|
26
|
+
} from "./chunk-KDQKTU3N.mjs";
|
|
27
|
+
import {
|
|
28
|
+
createRecoveryCallerDeps
|
|
29
|
+
} from "./chunk-NOXGKYUV.mjs";
|
|
17
30
|
import {
|
|
18
31
|
Logger,
|
|
19
32
|
getQrCode,
|
|
@@ -710,7 +723,7 @@ var getAgentGraph = async (request, reply) => {
|
|
|
710
723
|
try {
|
|
711
724
|
const { assistantId } = request.params;
|
|
712
725
|
const tenant_id = getTenantId(request);
|
|
713
|
-
const agent = agentInstanceManager.
|
|
726
|
+
const agent = agentInstanceManager.getAgentForRead({ assistant_id: assistantId, tenant_id, thread_id: "" });
|
|
714
727
|
const imageData = await agent.get_draw_graph();
|
|
715
728
|
reply.header("Content-Type", "application/json").send({
|
|
716
729
|
image: imageData
|
|
@@ -849,6 +862,21 @@ import {
|
|
|
849
862
|
} from "@axiom-lattice/core";
|
|
850
863
|
import { MessageChunkTypes } from "@axiom-lattice/protocols";
|
|
851
864
|
|
|
865
|
+
// src/utils/agentScope.ts
|
|
866
|
+
function headerValue(value) {
|
|
867
|
+
if (Array.isArray(value)) return value[0];
|
|
868
|
+
return value;
|
|
869
|
+
}
|
|
870
|
+
function resolveAgentScope(request) {
|
|
871
|
+
const workspace = headerValue(request.headers["x-workspace-id"]);
|
|
872
|
+
const project = headerValue(request.headers["x-project-id"]);
|
|
873
|
+
return {
|
|
874
|
+
tenant_id: headerValue(request.headers["x-tenant-id"]),
|
|
875
|
+
workspace_id: workspace || "default",
|
|
876
|
+
project_id: project || void 0
|
|
877
|
+
};
|
|
878
|
+
}
|
|
879
|
+
|
|
852
880
|
// src/services/agents/ScopedAgentExecution.ts
|
|
853
881
|
async function executeScopedAgentMessage(agent, request, stopTypes, options) {
|
|
854
882
|
const { messageId } = options === void 0 ? await agent.addMessage(request) : await agent.addMessage(request, options.queueMode);
|
|
@@ -950,9 +978,7 @@ var createRun = async (request, reply) => {
|
|
|
950
978
|
mode,
|
|
951
979
|
...input
|
|
952
980
|
} = request.body;
|
|
953
|
-
const tenant_id = request
|
|
954
|
-
const workspace_id = request.headers["x-workspace-id"];
|
|
955
|
-
const project_id = request.headers["x-project-id"];
|
|
981
|
+
const { tenant_id, workspace_id, project_id } = resolveAgentScope(request);
|
|
956
982
|
const x_request_id = request.headers["x-request-id"] || v4();
|
|
957
983
|
const user_id = getUserId2(request);
|
|
958
984
|
const mergedConfig = {
|
|
@@ -1051,9 +1077,7 @@ var createRun = async (request, reply) => {
|
|
|
1051
1077
|
var resumeStream = async (request, reply) => {
|
|
1052
1078
|
try {
|
|
1053
1079
|
const { thread_id, message_id, assistant_id, known_content, poll_interval } = request.body;
|
|
1054
|
-
const tenant_id = request
|
|
1055
|
-
const workspace_id = request.headers["x-workspace-id"];
|
|
1056
|
-
const project_id = request.headers["x-project-id"];
|
|
1080
|
+
const { tenant_id, workspace_id, project_id } = resolveAgentScope(request);
|
|
1057
1081
|
if (!thread_id || !message_id || !assistant_id || known_content === void 0) {
|
|
1058
1082
|
reply.status(400).send({
|
|
1059
1083
|
success: false,
|
|
@@ -1111,9 +1135,7 @@ var resumeStream = async (request, reply) => {
|
|
|
1111
1135
|
var abortRun = async (request, reply) => {
|
|
1112
1136
|
try {
|
|
1113
1137
|
const { assistantId, threadId } = request.params;
|
|
1114
|
-
const tenant_id = request
|
|
1115
|
-
const workspace_id = request.headers["x-workspace-id"] || "default";
|
|
1116
|
-
const project_id = request.headers["x-project-id"] || "default";
|
|
1138
|
+
const { tenant_id, workspace_id, project_id } = resolveAgentScope(request);
|
|
1117
1139
|
const agent = agentInstanceManager2.getAgent({
|
|
1118
1140
|
assistant_id: assistantId,
|
|
1119
1141
|
thread_id: threadId,
|
|
@@ -1136,9 +1158,7 @@ var abortRun = async (request, reply) => {
|
|
|
1136
1158
|
var recoverRun = async (request, reply) => {
|
|
1137
1159
|
try {
|
|
1138
1160
|
const { assistantId, threadId } = request.params;
|
|
1139
|
-
const tenant_id = request
|
|
1140
|
-
const workspace_id = request.headers["x-workspace-id"] || "default";
|
|
1141
|
-
const project_id = request.headers["x-project-id"];
|
|
1161
|
+
const { tenant_id, workspace_id, project_id } = resolveAgentScope(request);
|
|
1142
1162
|
const agent = agentInstanceManager2.getAgent({
|
|
1143
1163
|
assistant_id: assistantId,
|
|
1144
1164
|
thread_id: threadId,
|
|
@@ -1226,7 +1246,7 @@ var getAllMemoryItems = async (request, reply) => {
|
|
|
1226
1246
|
});
|
|
1227
1247
|
return;
|
|
1228
1248
|
}
|
|
1229
|
-
const agent = agentInstanceManager3.
|
|
1249
|
+
const agent = agentInstanceManager3.getAgentForRead({ assistant_id: assistantId, tenant_id, thread_id });
|
|
1230
1250
|
const result = await agent.getCurrentMessages();
|
|
1231
1251
|
if (!result) {
|
|
1232
1252
|
reply.status(500).send(result);
|
|
@@ -1258,7 +1278,7 @@ var getAgentState = async (request, reply) => {
|
|
|
1258
1278
|
return;
|
|
1259
1279
|
}
|
|
1260
1280
|
const tenant_id = request.headers["x-tenant-id"];
|
|
1261
|
-
const agent = agentInstanceManager3.
|
|
1281
|
+
const agent = agentInstanceManager3.getAgentForRead({ assistant_id: assistantId, tenant_id, thread_id });
|
|
1262
1282
|
const result = await agent.getCurrentState();
|
|
1263
1283
|
const pendingMessages = await agent.getPendingMessages();
|
|
1264
1284
|
if (!result) {
|
|
@@ -3079,7 +3099,7 @@ async function getInboxItems(request, reply) {
|
|
|
3079
3099
|
store.getRunSteps(r.id).catch(() => []),
|
|
3080
3100
|
(async () => {
|
|
3081
3101
|
try {
|
|
3082
|
-
return agentInstanceManager4.
|
|
3102
|
+
return agentInstanceManager4.getAgentForRead({
|
|
3083
3103
|
assistant_id: r.assistantId,
|
|
3084
3104
|
thread_id: r.threadId,
|
|
3085
3105
|
tenant_id: r.tenantId
|
|
@@ -10331,7 +10351,7 @@ function verifyLarkParsedBody(body, config) {
|
|
|
10331
10351
|
}
|
|
10332
10352
|
return extractVerificationToken(body) === config.verificationToken;
|
|
10333
10353
|
}
|
|
10334
|
-
function
|
|
10354
|
+
function headerValue2(request, name) {
|
|
10335
10355
|
const value = request.headers[name];
|
|
10336
10356
|
return Array.isArray(value) ? value[0] : value;
|
|
10337
10357
|
}
|
|
@@ -10339,9 +10359,9 @@ function verifyLarkRequestSignature(request, config) {
|
|
|
10339
10359
|
if (!config.encryptKey) {
|
|
10340
10360
|
return true;
|
|
10341
10361
|
}
|
|
10342
|
-
const timestamp =
|
|
10343
|
-
const nonce =
|
|
10344
|
-
const signature =
|
|
10362
|
+
const timestamp = headerValue2(request, "x-lark-request-timestamp");
|
|
10363
|
+
const nonce = headerValue2(request, "x-lark-request-nonce");
|
|
10364
|
+
const signature = headerValue2(request, "x-lark-signature");
|
|
10345
10365
|
if (!timestamp || !nonce || !signature) {
|
|
10346
10366
|
return false;
|
|
10347
10367
|
}
|
|
@@ -11975,39 +11995,6 @@ function isTaskFileRef(value) {
|
|
|
11975
11995
|
return !!row && typeof row.uri === "string" && !!row.uri && (row.name === void 0 || typeof row.name === "string") && (row.mimeType === void 0 || typeof row.mimeType === "string") && (row.addedBy === void 0 || row.addedBy === "user" || row.addedBy === "agent");
|
|
11976
11996
|
}
|
|
11977
11997
|
|
|
11978
|
-
// src/services/collaboration/projectTaskScope.ts
|
|
11979
|
-
function isProjectLifecycleTask(task) {
|
|
11980
|
-
const source = task.context?.source;
|
|
11981
|
-
return typeof task.workspaceId === "string" && task.workspaceId.length > 0 && typeof task.projectId === "string" && task.projectId.length > 0 && (source === "project_room" || source === "project_task" || source === "user");
|
|
11982
|
-
}
|
|
11983
|
-
function isRosterExemptProject(project) {
|
|
11984
|
-
return project?.kind === "public";
|
|
11985
|
-
}
|
|
11986
|
-
function resolveTaskOwnerMembership(task, project, room, membership) {
|
|
11987
|
-
const active = membership && membership.status === "active" && membership.tenantId === task.tenantId && membership.workspaceId === task.workspaceId && membership.projectId === task.projectId && membership.assistantId === task.ownerId && membership.roomId === room.id;
|
|
11988
|
-
if (active) return membership;
|
|
11989
|
-
if (!isRosterExemptProject(project)) return void 0;
|
|
11990
|
-
return syntheticPublicProjectOwnerMembership(task, room);
|
|
11991
|
-
}
|
|
11992
|
-
function syntheticPublicProjectOwnerMembership(task, room) {
|
|
11993
|
-
const threadId = typeof task.context?.thread_id === "string" && task.context.thread_id.length > 0 ? task.context.thread_id : task.ownerId;
|
|
11994
|
-
return {
|
|
11995
|
-
id: `public-project-owner:${task.projectId}:${task.ownerId}`,
|
|
11996
|
-
tenantId: task.tenantId,
|
|
11997
|
-
workspaceId: task.workspaceId,
|
|
11998
|
-
projectId: task.projectId,
|
|
11999
|
-
roomId: room.id,
|
|
12000
|
-
assistantId: task.ownerId,
|
|
12001
|
-
role: "specialist",
|
|
12002
|
-
title: task.ownerId,
|
|
12003
|
-
mentionName: task.ownerId,
|
|
12004
|
-
status: "active",
|
|
12005
|
-
roomThreadId: threadId,
|
|
12006
|
-
joinedAt: task.createdAt,
|
|
12007
|
-
updatedAt: task.updatedAt
|
|
12008
|
-
};
|
|
12009
|
-
}
|
|
12010
|
-
|
|
12011
11998
|
// src/services/collaboration/ProjectTaskThreadService.ts
|
|
12012
11999
|
var ProjectTaskThreadError = class extends Error {
|
|
12013
12000
|
/**
|
|
@@ -19470,7 +19457,7 @@ var ProjectTaskObserver = class {
|
|
|
19470
19457
|
try {
|
|
19471
19458
|
await this.requireActiveOwner(task);
|
|
19472
19459
|
} catch (error) {
|
|
19473
|
-
await this.
|
|
19460
|
+
await this.convergeFailed(task, `No active executor: ${errorMessage3(error)}`);
|
|
19474
19461
|
return;
|
|
19475
19462
|
}
|
|
19476
19463
|
}
|
|
@@ -19569,7 +19556,7 @@ var ProjectTaskObserver = class {
|
|
|
19569
19556
|
const classification = await this.deps.execution.classifyRecovery(current, ensured.thread);
|
|
19570
19557
|
if (signal?.aborted || this.disposed) return;
|
|
19571
19558
|
if (classification.kind === "invalid") {
|
|
19572
|
-
await this.
|
|
19559
|
+
await this.convergeFailed(
|
|
19573
19560
|
current,
|
|
19574
19561
|
`Task execution state is not recoverable: ${classification.reason}`
|
|
19575
19562
|
);
|
|
@@ -19836,25 +19823,26 @@ var ProjectTaskObserver = class {
|
|
|
19836
19823
|
}
|
|
19837
19824
|
}
|
|
19838
19825
|
/**
|
|
19839
|
-
* Converges
|
|
19826
|
+
* Converges a mechanically unexecutable task to a durable failure.
|
|
19840
19827
|
*
|
|
19841
19828
|
* @param task Exact task snapshot that cannot make progress through automation.
|
|
19842
|
-
* @param
|
|
19829
|
+
* @param failureReason Human-readable reason recorded with the failure.
|
|
19843
19830
|
* @remarks Never leaves a task silently pending behind a warning; an `in_progress`
|
|
19844
19831
|
* task with no dispatched queue rows is intentionally left untouched by recovery.
|
|
19845
|
-
*
|
|
19832
|
+
* A no-executor/unrecoverable state is a mechanical failure (`failed`), not HITL
|
|
19833
|
+
* (ADR-143); `failed` remains retryable.
|
|
19846
19834
|
*/
|
|
19847
|
-
async
|
|
19835
|
+
async convergeFailed(task, failureReason) {
|
|
19848
19836
|
if (this.disposed) return;
|
|
19849
19837
|
try {
|
|
19850
19838
|
const result = await this.runBridge.settleRun({
|
|
19851
19839
|
tenantId: task.tenantId,
|
|
19852
19840
|
task,
|
|
19853
19841
|
actor: SYSTEM_ACTOR2,
|
|
19854
|
-
outcome: { kind: "
|
|
19842
|
+
outcome: { kind: "failed", lifecycleHandled: false, error: failureReason }
|
|
19855
19843
|
});
|
|
19856
19844
|
if (!result.success && result.code !== "TASK_STATUS_CONFLICT") {
|
|
19857
|
-
await this.safeWarning(task, "converge", `${result.code ?? "LIFECYCLE_REJECTED"}: ${result.error ??
|
|
19845
|
+
await this.safeWarning(task, "converge", `${result.code ?? "LIFECYCLE_REJECTED"}: ${result.error ?? failureReason}`);
|
|
19858
19846
|
}
|
|
19859
19847
|
} catch (error) {
|
|
19860
19848
|
await this.safeWarning(task, "converge", error);
|
|
@@ -22462,7 +22450,7 @@ var registerLatticeRoutes = (app2, channelDeps, options = {}) => {
|
|
|
22462
22450
|
label: (key) => key
|
|
22463
22451
|
},
|
|
22464
22452
|
messageReader: {
|
|
22465
|
-
getCurrentMessages: ({ tenantId, assistantId, threadId, workspaceId, projectId }) => agentInstanceManager6.
|
|
22453
|
+
getCurrentMessages: ({ tenantId, assistantId, threadId, workspaceId, projectId }) => agentInstanceManager6.getAgentForRead({
|
|
22466
22454
|
tenant_id: tenantId,
|
|
22467
22455
|
assistant_id: assistantId,
|
|
22468
22456
|
thread_id: threadId,
|
|
@@ -24508,6 +24496,7 @@ var configureSwagger = async (app2, customSwaggerConfig, customSwaggerUiConfig)
|
|
|
24508
24496
|
// src/services/agent_task_consumer.ts
|
|
24509
24497
|
import { randomUUID as randomUUID26 } from "crypto";
|
|
24510
24498
|
import { eventBus as eventBus3, AGENT_TASK_EVENT, agentInstanceManager as agentInstanceManager7, QueueMode as QueueMode2 } from "@axiom-lattice/core";
|
|
24499
|
+
import { resolveRunScope } from "@axiom-lattice/protocols";
|
|
24511
24500
|
var handleAgentTask = async (taskRequest, retryCount = 0) => {
|
|
24512
24501
|
const {
|
|
24513
24502
|
assistant_id,
|
|
@@ -24525,7 +24514,8 @@ var handleAgentTask = async (taskRequest, retryCount = 0) => {
|
|
|
24525
24514
|
console.log(
|
|
24526
24515
|
`\u5F00\u59CB\u5904\u7406\u4EFB\u52A1 [assistant_id: ${assistant_id}, thread_id: ${thread_id}]`
|
|
24527
24516
|
);
|
|
24528
|
-
const
|
|
24517
|
+
const scope = resolveRunScope(runConfig);
|
|
24518
|
+
const agent = agentInstanceManager7.getAgent({ assistant_id, thread_id, tenant_id, workspace_id: scope.workspaceId, project_id: scope.projectId, custom_run_config: runConfig });
|
|
24529
24519
|
if (callback_event) {
|
|
24530
24520
|
const callbackEvent = callback_event;
|
|
24531
24521
|
const messageId = typeof input?.id === "string" && input.id !== "" ? input.id : randomUUID26();
|
|
@@ -24556,8 +24546,8 @@ var handleAgentTask = async (taskRequest, retryCount = 0) => {
|
|
|
24556
24546
|
assistant_id: main_assistant_id ?? assistant_id,
|
|
24557
24547
|
thread_id: main_thread_id,
|
|
24558
24548
|
tenant_id: main_tenant_id,
|
|
24559
|
-
workspace_id:
|
|
24560
|
-
project_id:
|
|
24549
|
+
workspace_id: scope.workspaceId,
|
|
24550
|
+
project_id: scope.projectId
|
|
24561
24551
|
});
|
|
24562
24552
|
if (mainAgent) {
|
|
24563
24553
|
const messages = evt.state?.values?.messages;
|
|
@@ -25744,7 +25734,7 @@ var start = async (config) => {
|
|
|
25744
25734
|
});
|
|
25745
25735
|
try {
|
|
25746
25736
|
const { A2AAuthService, parseEnvKeys } = await import("./A2AAuthService-7UGQ7GMW.mjs");
|
|
25747
|
-
const { registerA2AStandardRoutes } = await import("./a2a-standard-
|
|
25737
|
+
const { registerA2AStandardRoutes } = await import("./a2a-standard-PBYPNHOA.mjs");
|
|
25748
25738
|
const a2a = await import("./a2a-FGYX2HH3.mjs");
|
|
25749
25739
|
const a2aKeyStore = getStoreLattice28("default", "a2aApiKey").store;
|
|
25750
25740
|
const assistantStore = getStoreLattice28("default", "assistant").store;
|
|
@@ -25774,12 +25764,12 @@ var start = async (config) => {
|
|
|
25774
25764
|
});
|
|
25775
25765
|
}
|
|
25776
25766
|
try {
|
|
25777
|
-
const { registerOpenRoutes } = await import("./open-
|
|
25778
|
-
const { registerOpenSessionRoutes } = await import("./open-session-
|
|
25767
|
+
const { registerOpenRoutes } = await import("./open-STFMNRO5.mjs");
|
|
25768
|
+
const { registerOpenSessionRoutes } = await import("./open-session-IHDGAXL3.mjs");
|
|
25779
25769
|
const { registerOpenCatalogRoutes } = await import("./open-catalog-SZQ435AY.mjs");
|
|
25780
|
-
const { registerOpenFilesRoutes } = await import("./open-files-
|
|
25770
|
+
const { registerOpenFilesRoutes } = await import("./open-files-NPNQQ6TY.mjs");
|
|
25781
25771
|
const { registerOpenAuditRoutes } = await import("./open-audit-UJ3NXCGW.mjs");
|
|
25782
|
-
const { registerOpenExposureRoutes } = await import("./open-exposure-
|
|
25772
|
+
const { registerOpenExposureRoutes } = await import("./open-exposure-VU227IO3.mjs");
|
|
25783
25773
|
const { openLattice } = await import("./openLattice-Q6M5S6CY.mjs");
|
|
25784
25774
|
const { createKbProvider } = await import("./kbProvider-2D6DZ34N.mjs");
|
|
25785
25775
|
const { createOpenSandboxProvider } = await import("./sandboxProvider-I3P66VXT.mjs");
|
|
@@ -25850,6 +25840,25 @@ var start = async (config) => {
|
|
|
25850
25840
|
if (routes.projectTaskRuntime) {
|
|
25851
25841
|
await prepareProjectTaskRuntime(routes.projectTaskRuntime, logger6);
|
|
25852
25842
|
}
|
|
25843
|
+
if (process.env.AXIOM_TASK_ORPHAN_RECOVERY === "true") {
|
|
25844
|
+
try {
|
|
25845
|
+
const { createOrphanRecoveryRuntime: createOrphanRecoveryRuntime2 } = await import("./OrphanRecoveryRuntime-MQDEJX3M.mjs");
|
|
25846
|
+
const { createRecoveryCallerDeps: createRecoveryCallerDeps2 } = await import("./RecoveryCallerDeps-6SJUYJ5S.mjs");
|
|
25847
|
+
const taskStore = getStoreLattice28("default", "task").store;
|
|
25848
|
+
const workItemStore = getStoreLattice28("default", "taskWorkItem").store;
|
|
25849
|
+
const tenantStore = getStoreLattice28("default", "tenant").store;
|
|
25850
|
+
const runtime = createOrphanRecoveryRuntime2({
|
|
25851
|
+
taskStore,
|
|
25852
|
+
workItemStore,
|
|
25853
|
+
tenantStore,
|
|
25854
|
+
...createRecoveryCallerDeps2(),
|
|
25855
|
+
log: logger6
|
|
25856
|
+
});
|
|
25857
|
+
await runtime.recoverAll();
|
|
25858
|
+
} catch (err) {
|
|
25859
|
+
logger6.warn("Task orphan recovery failed", { error: err instanceof Error ? err.message : String(err) });
|
|
25860
|
+
}
|
|
25861
|
+
}
|
|
25853
25862
|
await app.listen({ port: target_port, host: "0.0.0.0" });
|
|
25854
25863
|
logger6.info(`Lattice Gateway is running on port: ${target_port}`);
|
|
25855
25864
|
const queueServiceConfig = config?.queueServiceConfig;
|
|
@@ -25860,13 +25869,6 @@ var start = async (config) => {
|
|
|
25860
25869
|
agentTaskConsumer.startPollingQueue();
|
|
25861
25870
|
}
|
|
25862
25871
|
}
|
|
25863
|
-
if (process.env.AXIOM_RESTORE_PENDING_ON_STARTUP === "true") {
|
|
25864
|
-
agentInstanceManager9.restore().then((stats) => {
|
|
25865
|
-
logger6.info(`Agent recovery complete: ${stats.restored} threads restored, ${stats.errors} errors`);
|
|
25866
|
-
}).catch((error) => {
|
|
25867
|
-
logger6.error("Agent recovery failed", { error });
|
|
25868
|
-
});
|
|
25869
|
-
}
|
|
25870
25872
|
restoreMcpConnections().catch((error) => {
|
|
25871
25873
|
logger6.error("MCP connection restoration failed", { error });
|
|
25872
25874
|
});
|
|
@@ -25883,6 +25885,12 @@ var LatticeGateway = {
|
|
|
25883
25885
|
AgentTaskConsumer
|
|
25884
25886
|
};
|
|
25885
25887
|
export {
|
|
25886
|
-
LatticeGateway
|
|
25888
|
+
LatticeGateway,
|
|
25889
|
+
createOrphanRecoveryRuntime,
|
|
25890
|
+
createRecoveryCallerDeps,
|
|
25891
|
+
recoverTask,
|
|
25892
|
+
recoverTopCaller,
|
|
25893
|
+
resolveTopCaller,
|
|
25894
|
+
runOrphanRecovery
|
|
25887
25895
|
};
|
|
25888
25896
|
//# sourceMappingURL=index.mjs.map
|