@axiom-lattice/gateway 8.4.0 → 10.0.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/{a2a-TDZ3TT6H.mjs → a2a-YLKZE5JG.mjs} +6 -4
- package/dist/{a2a-standard-INVCUSAW.mjs → a2a-standard-NOAVPYXJ.mjs} +42 -127
- package/dist/a2a-standard-NOAVPYXJ.mjs.map +1 -0
- package/dist/chunk-NYYSBNDG.mjs +575 -0
- package/dist/chunk-NYYSBNDG.mjs.map +1 -0
- package/dist/{chunk-2SR4F3ZD.mjs → chunk-PHWGCRW2.mjs} +2 -1
- package/dist/{chunk-2SR4F3ZD.mjs.map → chunk-PHWGCRW2.mjs.map} +1 -1
- package/dist/{chunk-W3YH4S6G.mjs → chunk-SIMEG2JT.mjs} +19 -2
- package/dist/chunk-SIMEG2JT.mjs.map +1 -0
- package/dist/embed/{embed-page-AgentDetailSideApp-TQEJK6ZF.js → embed-page-AgentDetailSideApp-X5HKDN3N.js} +1 -1
- package/dist/embed/embed-page-AgentGovernanceWorkbench-MFXL7BOW.js +1 -0
- package/dist/embed/{embed-page-LangfuseDashboard-7OANGQXY.js → embed-page-LangfuseDashboard-NPYFMKK3.js} +1 -1
- package/dist/embed/{embed-page-MessageGraph-KJPQWTHE.js → embed-page-MessageGraph-JUCEXYLU.js} +1 -1
- package/dist/embed/{embed-page-ReactChart-2CAIM4JD.js → embed-page-ReactChart-2QJ3QRBH.js} +1 -1
- package/dist/embed/{embed-page-SkillFlow-243MXRXC.js → embed-page-SkillFlow-PFEXQ75Z.js} +1 -1
- package/dist/embed/{embed-page-TasksSideApp-OA7CULHS.js → embed-page-TasksSideApp-SBHVHNVT.js} +1 -1
- package/dist/embed/{embed-page-ThreadMaintenancePanel-Z4424X3J.js → embed-page-ThreadMaintenancePanel-LCCRUA75.js} +1 -1
- package/dist/embed/{embed-page-TopologyRuntimeView-THTCZUS7.js → embed-page-TopologyRuntimeView-ATA23XXF.js} +1 -1
- package/dist/embed/embed-page-WorkflowAutomationView-OVGOUVXH.js +3 -0
- package/dist/embed/embed-page-chunk-7F5BSMP3.js +211 -0
- package/dist/embed/embed-page-chunk-HLBQ5JKL.js +6968 -0
- package/dist/embed/{embed-page-chunk-RKQJBKN2.js → embed-page-chunk-HUH33Z2E.js} +1 -1
- package/dist/embed/embed-page-chunk-LZ4ITV3M.js +242 -0
- package/dist/embed/{embed-page-chunk-LDQGH44H.js → embed-page-chunk-ODTY6SE7.js} +1 -1
- package/dist/embed/embed-page-chunk-Q7Z7MHOM.js +76 -0
- package/dist/embed/embed-page-chunk-QOPHOXA7.js +3 -0
- package/dist/embed/{embed-page-chunk-FZX4A32D.js → embed-page-chunk-RFF7S4H5.js} +5 -5
- package/dist/embed/{embed-page-chunk-L2EGVVJS.js → embed-page-chunk-VNRFN74K.js} +1 -1
- package/dist/embed/{embed-page-chunk-JMP7EQEF.js → embed-page-chunk-WE6PZS2N.js} +1 -1
- package/dist/embed/{embed-page-en-DNDGCPMA.js → embed-page-en-4HTY4XK4.js} +1 -1
- package/dist/embed/embed-page-en-KZQZS4JN.js +1 -0
- package/dist/embed/embed-page-en-VHD2WUUG.js +1 -0
- package/dist/embed/embed-page-zh-A7DSGF6P.js +1 -0
- package/dist/embed/embed-page-zh-KSZOJPOV.js +1 -0
- package/dist/embed/{embed-page-zh-2H4EB3F3.js → embed-page-zh-UHTZEW5G.js} +1 -1
- package/dist/embed/embed-page.js +1 -1
- package/dist/embed/mcp-app-page.js +76 -15
- package/dist/index.js +1699 -1498
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +241 -382
- package/dist/index.mjs.map +1 -1
- package/dist/{open-27ZPLBIW.mjs → open-PCOORPQ5.mjs} +63 -16
- package/dist/open-PCOORPQ5.mjs.map +1 -0
- package/dist/{open-exposure-BPLYUIX6.mjs → open-exposure-HGYT5VFC.mjs} +5 -6
- package/dist/open-exposure-HGYT5VFC.mjs.map +1 -0
- package/package.json +18 -13
- package/dist/a2a-standard-INVCUSAW.mjs.map +0 -1
- package/dist/chunk-OBODBHIS.mjs +0 -230
- package/dist/chunk-OBODBHIS.mjs.map +0 -1
- package/dist/chunk-W3YH4S6G.mjs.map +0 -1
- package/dist/embed/embed-page-AgentGovernanceWorkbench-II2MRGCG.js +0 -1
- package/dist/embed/embed-page-WorkflowAutomationView-YDIDG35E.js +0 -3
- package/dist/embed/embed-page-chunk-7ULTMRM2.js +0 -211
- package/dist/embed/embed-page-chunk-OMN6G52V.js +0 -3
- package/dist/embed/embed-page-chunk-VYS3TAK4.js +0 -242
- package/dist/embed/embed-page-chunk-W5OP2CZG.js +0 -15
- package/dist/embed/embed-page-chunk-Z6KWW64I.js +0 -6837
- package/dist/embed/embed-page-en-D4M3DPFT.js +0 -1
- package/dist/embed/embed-page-en-JOTELYAL.js +0 -1
- package/dist/embed/embed-page-zh-BPO6ZSJM.js +0 -1
- package/dist/embed/embed-page-zh-NEXLMDHF.js +0 -1
- package/dist/open-27ZPLBIW.mjs.map +0 -1
- package/dist/open-exposure-BPLYUIX6.mjs.map +0 -1
- /package/dist/{a2a-TDZ3TT6H.mjs.map → a2a-YLKZE5JG.mjs.map} +0 -0
|
@@ -3,8 +3,9 @@ import {
|
|
|
3
3
|
refreshStoreKeyMap,
|
|
4
4
|
registerA2ARoutes,
|
|
5
5
|
setA2AAuthService,
|
|
6
|
-
setA2AKeyStore
|
|
7
|
-
|
|
6
|
+
setA2AKeyStore,
|
|
7
|
+
setA2AProjectAccess
|
|
8
|
+
} from "./chunk-NYYSBNDG.mjs";
|
|
8
9
|
import "./chunk-LCM4OQTI.mjs";
|
|
9
10
|
import "./chunk-NFEGQTCC.mjs";
|
|
10
11
|
export {
|
|
@@ -12,6 +13,7 @@ export {
|
|
|
12
13
|
refreshStoreKeyMap,
|
|
13
14
|
registerA2ARoutes,
|
|
14
15
|
setA2AAuthService,
|
|
15
|
-
setA2AKeyStore
|
|
16
|
+
setA2AKeyStore,
|
|
17
|
+
setA2AProjectAccess
|
|
16
18
|
};
|
|
17
|
-
//# sourceMappingURL=a2a-
|
|
19
|
+
//# sourceMappingURL=a2a-YLKZE5JG.mjs.map
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildAgentCardForAssistant,
|
|
3
|
-
deriveAgentSkills
|
|
4
|
-
|
|
3
|
+
deriveAgentSkills,
|
|
4
|
+
resolveRequestBaseUrl
|
|
5
|
+
} from "./chunk-SIMEG2JT.mjs";
|
|
5
6
|
import {
|
|
6
7
|
formatFileRefsSection,
|
|
7
8
|
getRunCancelRouter,
|
|
8
9
|
resolveRunTaskMaxActivePerTenant,
|
|
9
10
|
saveProjectFile,
|
|
10
11
|
wakeRunTaskQueue
|
|
11
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-PHWGCRW2.mjs";
|
|
12
13
|
import {
|
|
13
14
|
getRateLimitService
|
|
14
15
|
} from "./chunk-A7YNAU5L.mjs";
|
|
@@ -18,13 +19,10 @@ import {
|
|
|
18
19
|
import "./chunk-NFEGQTCC.mjs";
|
|
19
20
|
|
|
20
21
|
// src/routes/a2a-standard.ts
|
|
21
|
-
import { v4 as uuidv42 } from "uuid";
|
|
22
22
|
import {
|
|
23
23
|
A2AError as A2AError3,
|
|
24
|
-
DefaultExecutionEventBus as DefaultExecutionEventBus2,
|
|
25
24
|
DefaultRequestHandler,
|
|
26
|
-
JsonRpcTransportHandler
|
|
27
|
-
RequestContext
|
|
25
|
+
JsonRpcTransportHandler
|
|
28
26
|
} from "@a2a-js/sdk/server";
|
|
29
27
|
import { AgentCard as AgentCardV1 } from "@a2a-js/sdk-v1";
|
|
30
28
|
import {
|
|
@@ -1391,6 +1389,8 @@ var A2ATaskStoreAdapter = class {
|
|
|
1391
1389
|
if (!item || !this.isInScope(item)) return void 0;
|
|
1392
1390
|
const pageSize = 100;
|
|
1393
1391
|
let selected;
|
|
1392
|
+
let latestCompleted;
|
|
1393
|
+
let authoritative;
|
|
1394
1394
|
for (let offset = 0; ; offset += pageSize) {
|
|
1395
1395
|
const activities = await this.workItemStore.list({
|
|
1396
1396
|
tenantId: this.scope.tenantId,
|
|
@@ -1412,6 +1412,12 @@ var A2ATaskStoreAdapter = class {
|
|
|
1412
1412
|
id: activity.id
|
|
1413
1413
|
};
|
|
1414
1414
|
if (!selected || this.isLaterSnapshot(candidate, selected)) selected = candidate;
|
|
1415
|
+
if (candidate.task.status?.state === "completed" && (!latestCompleted || this.isLaterSnapshot(candidate, latestCompleted))) {
|
|
1416
|
+
latestCompleted = candidate;
|
|
1417
|
+
}
|
|
1418
|
+
if (candidate.task.status?.state === "completed" && candidate.task.metadata?.resultArtifactSource === "agent_output" && (!authoritative || this.isLaterSnapshot(candidate, authoritative))) {
|
|
1419
|
+
authoritative = candidate;
|
|
1420
|
+
}
|
|
1415
1421
|
}
|
|
1416
1422
|
if (activities.length < pageSize) break;
|
|
1417
1423
|
}
|
|
@@ -1431,8 +1437,13 @@ var A2ATaskStoreAdapter = class {
|
|
|
1431
1437
|
...contextThreadId === void 0 ? {} : { threadId: contextThreadId },
|
|
1432
1438
|
...interruption && typeof interruption === "object" ? { interruption } : {}
|
|
1433
1439
|
};
|
|
1434
|
-
const
|
|
1435
|
-
const
|
|
1440
|
+
const artifactSnapshot = item.status === "completed" ? latestCompleted?.task ?? snapshot : snapshot;
|
|
1441
|
+
const nonResultArtifacts = (artifactSnapshot.artifacts ?? []).filter((artifact) => artifact.name !== "result");
|
|
1442
|
+
const latestResult = (artifactSnapshot.artifacts ?? []).filter((artifact) => artifact.name === "result").at(-1);
|
|
1443
|
+
const markedResult = (authoritative?.task.artifacts ?? []).filter((artifact) => artifact.name === "result").at(-1);
|
|
1444
|
+
const markedResultMatchesLatest = item.status === "completed" && latestCompleted !== void 0 && latestResult !== void 0 && markedResult !== void 0 && extractText(latestResult.parts) === extractText(markedResult.parts);
|
|
1445
|
+
const authoritativeSnapshotResult = item.status === "completed" && markedResultMatchesLatest ? latestResult : void 0;
|
|
1446
|
+
const artifacts = item.status !== "completed" ? nonResultArtifacts : authoritativeSnapshotResult ? [...nonResultArtifacts, authoritativeSnapshotResult] : item.result?.trim() ? [...nonResultArtifacts, {
|
|
1436
1447
|
artifactId: `${item.id}:result`,
|
|
1437
1448
|
name: "result",
|
|
1438
1449
|
parts: [{ kind: "text", text: item.result }]
|
|
@@ -2160,14 +2171,28 @@ var AxiomAgentExecutor = class {
|
|
|
2160
2171
|
}
|
|
2161
2172
|
const canonicalResult = canonical?.artifacts?.find((artifact) => artifact.name === "result");
|
|
2162
2173
|
const canonicalText = canonicalResult ? extractText2(canonicalResult.parts).trim() : "";
|
|
2163
|
-
const
|
|
2174
|
+
const agentOutputText = outputText.trim();
|
|
2175
|
+
const resultText = agentOutputText || canonicalText || "(no output)";
|
|
2164
2176
|
const resultArtifact = {
|
|
2165
2177
|
artifactId: uuidv4(),
|
|
2166
2178
|
name: "result",
|
|
2167
2179
|
parts: [{ kind: "text", text: resultText }]
|
|
2168
2180
|
};
|
|
2181
|
+
const baseTask = this.taskFor(
|
|
2182
|
+
ctx,
|
|
2183
|
+
threadId,
|
|
2184
|
+
projection.inputFiles,
|
|
2185
|
+
projection.dependencies,
|
|
2186
|
+
projection
|
|
2187
|
+
);
|
|
2169
2188
|
const completed = {
|
|
2170
|
-
...
|
|
2189
|
+
...baseTask,
|
|
2190
|
+
...agentOutputText ? {
|
|
2191
|
+
metadata: {
|
|
2192
|
+
...baseTask.metadata ?? {},
|
|
2193
|
+
resultArtifactSource: "agent_output"
|
|
2194
|
+
}
|
|
2195
|
+
} : {},
|
|
2171
2196
|
artifacts: [...existing?.artifacts ?? [], resultArtifact],
|
|
2172
2197
|
status: { state: "completed", timestamp: isoNow() }
|
|
2173
2198
|
};
|
|
@@ -3120,15 +3145,6 @@ function getHeader(value) {
|
|
|
3120
3145
|
if (Array.isArray(value)) return value[0];
|
|
3121
3146
|
return value;
|
|
3122
3147
|
}
|
|
3123
|
-
function getSessionUser(request) {
|
|
3124
|
-
return request.user;
|
|
3125
|
-
}
|
|
3126
|
-
function buildBaseUrl(request) {
|
|
3127
|
-
const protocol = getHeader(request.headers["x-forwarded-proto"]) ?? request.protocol;
|
|
3128
|
-
const forwardedHost = getHeader(request.headers["x-forwarded-host"]);
|
|
3129
|
-
const host = forwardedHost ? forwardedHost.split(",")[0].trim() : request.host;
|
|
3130
|
-
return `${protocol}://${host}`;
|
|
3131
|
-
}
|
|
3132
3148
|
function makeFileIngestor(tenantId, maxFileBytes) {
|
|
3133
3149
|
return new A2AFileIngestor({
|
|
3134
3150
|
saveProjectFile: (params) => saveProjectFile({ tenantId, ...params }),
|
|
@@ -3601,7 +3617,7 @@ function registerA2AStandardRoutes(app, deps) {
|
|
|
3601
3617
|
reply.status(200).send(
|
|
3602
3618
|
buildAgentCardForAssistant({
|
|
3603
3619
|
assistant,
|
|
3604
|
-
baseUrl:
|
|
3620
|
+
baseUrl: resolveRequestBaseUrl(request),
|
|
3605
3621
|
pushNotifications: hasPushStore(),
|
|
3606
3622
|
...officialAlias ? { jsonRpcPath: `/a2a/${assistant.id}` } : {}
|
|
3607
3623
|
})
|
|
@@ -3694,7 +3710,7 @@ function registerA2AStandardRoutes(app, deps) {
|
|
|
3694
3710
|
}
|
|
3695
3711
|
const extendedCard = buildAgentCardForAssistant({
|
|
3696
3712
|
assistant,
|
|
3697
|
-
baseUrl:
|
|
3713
|
+
baseUrl: resolveRequestBaseUrl(request),
|
|
3698
3714
|
pushNotifications: hasPushStore(),
|
|
3699
3715
|
...request.url.split("?")[0].startsWith("/a2a/") ? { jsonRpcPath: `/a2a/${assistant.id}` } : {}
|
|
3700
3716
|
});
|
|
@@ -3757,7 +3773,7 @@ function registerA2AStandardRoutes(app, deps) {
|
|
|
3757
3773
|
}
|
|
3758
3774
|
const card = buildAgentCardForAssistant({
|
|
3759
3775
|
assistant,
|
|
3760
|
-
baseUrl:
|
|
3776
|
+
baseUrl: resolveRequestBaseUrl(request),
|
|
3761
3777
|
pushNotifications: pushStore !== void 0,
|
|
3762
3778
|
...request.url.split("?")[0].startsWith("/a2a/") ? { jsonRpcPath: `/a2a/${assistant.id}` } : {}
|
|
3763
3779
|
});
|
|
@@ -3838,110 +3854,9 @@ data: ${JSON.stringify(errorResponse)}
|
|
|
3838
3854
|
"/a2a/:assistantId",
|
|
3839
3855
|
handleJsonRpc
|
|
3840
3856
|
);
|
|
3841
|
-
app.post(
|
|
3842
|
-
"/api/a2a/agents/:assistantId/test-call",
|
|
3843
|
-
async (request, reply) => {
|
|
3844
|
-
const user = getSessionUser(request);
|
|
3845
|
-
if (!user?.tenantId) {
|
|
3846
|
-
reply.status(401).send({ success: false, error: "Unauthorized" });
|
|
3847
|
-
return;
|
|
3848
|
-
}
|
|
3849
|
-
const tenantId = user.tenantId;
|
|
3850
|
-
const body = request.body ?? {};
|
|
3851
|
-
const { projectId, message } = body;
|
|
3852
|
-
if (!projectId) {
|
|
3853
|
-
reply.status(400).send({ error: "projectId is required" });
|
|
3854
|
-
return;
|
|
3855
|
-
}
|
|
3856
|
-
if (!message || !message.trim()) {
|
|
3857
|
-
reply.status(400).send({ error: "message is required" });
|
|
3858
|
-
return;
|
|
3859
|
-
}
|
|
3860
|
-
const assistant = await getAssistantStore().getAssistantById(
|
|
3861
|
-
tenantId,
|
|
3862
|
-
request.params.assistantId
|
|
3863
|
-
);
|
|
3864
|
-
if (!assistant) {
|
|
3865
|
-
reply.status(404).send({ error: "Assistant not found" });
|
|
3866
|
-
return;
|
|
3867
|
-
}
|
|
3868
|
-
const project = await getProjectStore().getProjectById(
|
|
3869
|
-
tenantId,
|
|
3870
|
-
projectId
|
|
3871
|
-
);
|
|
3872
|
-
if (!project || project.tenantId !== tenantId) {
|
|
3873
|
-
reply.status(403).send({ error: "Project not found" });
|
|
3874
|
-
return;
|
|
3875
|
-
}
|
|
3876
|
-
const scope = {
|
|
3877
|
-
tenantId,
|
|
3878
|
-
projectId,
|
|
3879
|
-
workspaceId: project.workspaceId,
|
|
3880
|
-
assistantId: assistant.id
|
|
3881
|
-
};
|
|
3882
|
-
const ingestor = makeFileIngestor(scope.tenantId, deps.maxFileBytes);
|
|
3883
|
-
const internalTasks = resolveTasks();
|
|
3884
|
-
const workItems = resolveTaskWorkItems();
|
|
3885
|
-
const taskStore = taskStoreFor(scope, internalTasks, workItems);
|
|
3886
|
-
const executor = new AxiomAgentExecutor({
|
|
3887
|
-
scope,
|
|
3888
|
-
assistant,
|
|
3889
|
-
taskStore,
|
|
3890
|
-
ingestor,
|
|
3891
|
-
runService: runServiceFor(scope),
|
|
3892
|
-
blocking: true,
|
|
3893
|
-
getInterrupts: (threadId) => stateResolver.getInterrupts(threadId, assistant.id, scope)
|
|
3894
|
-
});
|
|
3895
|
-
const taskId = uuidv42();
|
|
3896
|
-
const contextId = uuidv42();
|
|
3897
|
-
const userMessage = {
|
|
3898
|
-
kind: "message",
|
|
3899
|
-
messageId: uuidv42(),
|
|
3900
|
-
role: "user",
|
|
3901
|
-
parts: [{ kind: "text", text: message }]
|
|
3902
|
-
};
|
|
3903
|
-
const requestContext = new RequestContext(userMessage, taskId, contextId);
|
|
3904
|
-
const bus = new DefaultExecutionEventBus2();
|
|
3905
|
-
reply.hijack();
|
|
3906
|
-
reply.raw.writeHead(200, SSE_HEADERS);
|
|
3907
|
-
const sendEvent = (event, data) => {
|
|
3908
|
-
reply.raw.write(`event: ${event}
|
|
3909
|
-
data: ${JSON.stringify(data)}
|
|
3910
|
-
|
|
3911
|
-
`);
|
|
3912
|
-
};
|
|
3913
|
-
bus.on("event", (event) => {
|
|
3914
|
-
sendEvent(event.kind, event);
|
|
3915
|
-
});
|
|
3916
|
-
try {
|
|
3917
|
-
await executor.execute(requestContext, bus);
|
|
3918
|
-
} catch (err) {
|
|
3919
|
-
request.log.error({ err }, "a2a:test-call:execution");
|
|
3920
|
-
try {
|
|
3921
|
-
await taskStore.save({
|
|
3922
|
-
kind: "task",
|
|
3923
|
-
id: taskId,
|
|
3924
|
-
contextId,
|
|
3925
|
-
status: { state: "failed", timestamp: (/* @__PURE__ */ new Date()).toISOString() }
|
|
3926
|
-
});
|
|
3927
|
-
} catch (saveError) {
|
|
3928
|
-
request.log.error({ err: saveError }, "a2a:test-call:settle");
|
|
3929
|
-
}
|
|
3930
|
-
sendEvent("status-update", {
|
|
3931
|
-
kind: "status-update",
|
|
3932
|
-
taskId,
|
|
3933
|
-
contextId,
|
|
3934
|
-
status: { state: "failed", timestamp: (/* @__PURE__ */ new Date()).toISOString() },
|
|
3935
|
-
final: true
|
|
3936
|
-
});
|
|
3937
|
-
} finally {
|
|
3938
|
-
reply.raw.end();
|
|
3939
|
-
}
|
|
3940
|
-
}
|
|
3941
|
-
);
|
|
3942
3857
|
const v1CardFor = (request, assistant, pushNotifications) => buildAgentCardForAssistantV1({
|
|
3943
3858
|
assistant,
|
|
3944
|
-
baseUrl:
|
|
3859
|
+
baseUrl: resolveRequestBaseUrl(request),
|
|
3945
3860
|
pushNotifications
|
|
3946
3861
|
});
|
|
3947
3862
|
const authenticateV1 = async (request) => {
|
|
@@ -4126,7 +4041,7 @@ data: ${JSON.stringify(data)}
|
|
|
4126
4041
|
}
|
|
4127
4042
|
const card = buildAgentCardForAssistant({
|
|
4128
4043
|
assistant: auth.assistant,
|
|
4129
|
-
baseUrl:
|
|
4044
|
+
baseUrl: resolveRequestBaseUrl(request),
|
|
4130
4045
|
pushNotifications: pushStore !== void 0,
|
|
4131
4046
|
jsonRpcPath: `/a2a/v1/${auth.assistant.id}`
|
|
4132
4047
|
});
|
|
@@ -4222,4 +4137,4 @@ data: ${JSON.stringify(errorResponse)}
|
|
|
4222
4137
|
export {
|
|
4223
4138
|
registerA2AStandardRoutes
|
|
4224
4139
|
};
|
|
4225
|
-
//# sourceMappingURL=a2a-standard-
|
|
4140
|
+
//# sourceMappingURL=a2a-standard-NOAVPYXJ.mjs.map
|