@axiom-lattice/gateway 9.0.0 → 10.0.1

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.
Files changed (53) hide show
  1. package/dist/{a2a-standard-MD7WNDTP.mjs → a2a-standard-NOAVPYXJ.mjs} +2 -2
  2. package/dist/{chunk-2SR4F3ZD.mjs → chunk-PHWGCRW2.mjs} +2 -1
  3. package/dist/{chunk-2SR4F3ZD.mjs.map → chunk-PHWGCRW2.mjs.map} +1 -1
  4. package/dist/embed/{embed-page-AgentDetailSideApp-6RYNHS5F.js → embed-page-AgentDetailSideApp-L37KFUAY.js} +1 -1
  5. package/dist/embed/embed-page-AgentGovernanceWorkbench-LDNC3EUU.js +1 -0
  6. package/dist/embed/{embed-page-LangfuseDashboard-ZYGZNW7P.js → embed-page-LangfuseDashboard-CZUVA4MI.js} +1 -1
  7. package/dist/embed/{embed-page-MessageGraph-S2P3WACC.js → embed-page-MessageGraph-KSPQ5GHB.js} +1 -1
  8. package/dist/embed/{embed-page-ReactChart-I3UZVE4Z.js → embed-page-ReactChart-MH7DGSYJ.js} +1 -1
  9. package/dist/embed/{embed-page-SkillFlow-JMIJ46FX.js → embed-page-SkillFlow-TFHDI63I.js} +1 -1
  10. package/dist/embed/{embed-page-TasksSideApp-IVFEFLSH.js → embed-page-TasksSideApp-ZOQ34RII.js} +1 -1
  11. package/dist/embed/{embed-page-ThreadMaintenancePanel-KQPPAEWJ.js → embed-page-ThreadMaintenancePanel-PTUGZRLJ.js} +1 -1
  12. package/dist/embed/{embed-page-TopologyRuntimeView-XCFQ23HF.js → embed-page-TopologyRuntimeView-EHN2VA2Z.js} +1 -1
  13. package/dist/embed/embed-page-WorkflowAutomationView-IUGJ54RV.js +3 -0
  14. package/dist/embed/{embed-page-chunk-7VDAOX3D.js → embed-page-chunk-3E5B2KJT.js} +1 -1
  15. package/dist/embed/{embed-page-chunk-MD4U4DHC.js → embed-page-chunk-3PGODDQW.js} +5 -5
  16. package/dist/embed/embed-page-chunk-4N7B6POU.js +6947 -0
  17. package/dist/embed/{embed-page-chunk-77CQOFKU.js → embed-page-chunk-5DSJCBZF.js} +1 -1
  18. package/dist/embed/embed-page-chunk-5GAHI45T.js +76 -0
  19. package/dist/embed/{embed-page-chunk-5X4MNQAW.js → embed-page-chunk-FU755EE4.js} +2 -2
  20. package/dist/embed/{embed-page-chunk-WHGU76CU.js → embed-page-chunk-K74FZI4X.js} +1 -1
  21. package/dist/embed/{embed-page-chunk-RVIS6CKE.js → embed-page-chunk-UJCEOILF.js} +1 -1
  22. package/dist/embed/{embed-page-chunk-ZZFTCBM6.js → embed-page-chunk-VEBSRO4A.js} +1 -1
  23. package/dist/embed/embed-page-chunk-XVDCWRYF.js +2 -0
  24. package/dist/embed/{embed-page-en-DNDGCPMA.js → embed-page-en-4HTY4XK4.js} +1 -1
  25. package/dist/embed/embed-page-en-N642QNBS.js +1 -0
  26. package/dist/embed/embed-page-en-UDMFINWS.js +1 -0
  27. package/dist/embed/embed-page-en-XKIIMNZ7.js +1 -0
  28. package/dist/embed/embed-page-zh-7MFXKHQB.js +1 -0
  29. package/dist/embed/embed-page-zh-F4WCA6SW.js +1 -0
  30. package/dist/embed/embed-page-zh-N6YLZJ3Z.js +1 -0
  31. package/dist/embed/{embed-page-zh-2H4EB3F3.js → embed-page-zh-UHTZEW5G.js} +1 -1
  32. package/dist/embed/embed-page.js +1 -1
  33. package/dist/embed/mcp-app-page.js +76 -15
  34. package/dist/index.js +126 -157
  35. package/dist/index.js.map +1 -1
  36. package/dist/index.mjs +48 -123
  37. package/dist/index.mjs.map +1 -1
  38. package/dist/{open-27ZPLBIW.mjs → open-PCOORPQ5.mjs} +63 -16
  39. package/dist/open-PCOORPQ5.mjs.map +1 -0
  40. package/package.json +18 -13
  41. package/dist/embed/embed-page-AgentGovernanceWorkbench-UAPXF3SZ.js +0 -1
  42. package/dist/embed/embed-page-WorkflowAutomationView-UTKCKP75.js +0 -3
  43. package/dist/embed/embed-page-chunk-RANB2CUO.js +0 -3
  44. package/dist/embed/embed-page-chunk-SEOTZ4Q7.js +0 -6829
  45. package/dist/embed/embed-page-chunk-TCVPYXPL.js +0 -15
  46. package/dist/embed/embed-page-en-4HSTKY4Q.js +0 -1
  47. package/dist/embed/embed-page-en-MIVBTEEL.js +0 -1
  48. package/dist/embed/embed-page-en-QJRX2NQE.js +0 -1
  49. package/dist/embed/embed-page-zh-7PJNJJZY.js +0 -1
  50. package/dist/embed/embed-page-zh-HTEHFCSL.js +0 -1
  51. package/dist/embed/embed-page-zh-UZ4GPIU7.js +0 -1
  52. package/dist/open-27ZPLBIW.mjs.map +0 -1
  53. /package/dist/{a2a-standard-MD7WNDTP.mjs.map → a2a-standard-NOAVPYXJ.mjs.map} +0 -0
package/dist/index.mjs CHANGED
@@ -33,7 +33,7 @@ import {
33
33
  setRunTaskWakePublisher,
34
34
  setRunTaskWakeStatsSource,
35
35
  wakeRunTaskQueue
36
- } from "./chunk-2SR4F3ZD.mjs";
36
+ } from "./chunk-PHWGCRW2.mjs";
37
37
  import {
38
38
  claimDedupKey,
39
39
  createRateLimitService,
@@ -3860,7 +3860,10 @@ function createRunLifecycleHandlers(deps = {}) {
3860
3860
  const tenantId = getTenantId4(request);
3861
3861
  const { assistantId, threadId } = request.params;
3862
3862
  if (!await ownsThread(tenantId, assistantId, threadId)) {
3863
- return notFound2(reply, THREAD_NOT_FOUND2, "Thread not found");
3863
+ if (!await isNewThread(tenantId, threadId)) {
3864
+ return notFound2(reply, THREAD_NOT_FOUND2, "Thread not found");
3865
+ }
3866
+ return reply.status(200).send({ success: true, data: { runs: [] } });
3864
3867
  }
3865
3868
  const activeOnly = request.query.active === "true" || request.query.active === "1";
3866
3869
  const source = request.query.source;
@@ -8466,78 +8469,6 @@ function getTrackingStore() {
8466
8469
  return null;
8467
8470
  }
8468
8471
  }
8469
- async function getDefinitionsFromAssistants(tenantId) {
8470
- try {
8471
- const storeLattice = getStoreLattice14("default", "assistant");
8472
- const assistantStore = storeLattice.store;
8473
- const assistants = await assistantStore.getAllAssistants(tenantId);
8474
- const results = [];
8475
- for (const a of assistants) {
8476
- const def = a.graphDefinition;
8477
- if (!def || def.type !== "processing") continue;
8478
- if (!def.middleware) continue;
8479
- for (const mw of def.middleware) {
8480
- if (mw.type === "topology" && mw.enabled) {
8481
- results.push({
8482
- assistantId: a.id,
8483
- assistantName: a.name,
8484
- description: a.description,
8485
- topologyEdges: mw.config.edges,
8486
- totalEdges: mw.config.edges.length
8487
- });
8488
- }
8489
- }
8490
- }
8491
- return results;
8492
- } catch {
8493
- return [];
8494
- }
8495
- }
8496
- async function getAllWorkflowDefinitions(request, reply) {
8497
- const tenantId = getTenantId14(request);
8498
- try {
8499
- const configDefs = await getDefinitionsFromAssistants(tenantId);
8500
- if (configDefs.length === 0) {
8501
- return {
8502
- success: true,
8503
- message: "No workflow definitions found",
8504
- data: { records: [] }
8505
- };
8506
- }
8507
- const runMap = /* @__PURE__ */ new Map();
8508
- try {
8509
- const store2 = getTrackingStore();
8510
- if (store2) {
8511
- const runs = await store2.getWorkflowRunsByTenantId(tenantId);
8512
- for (const r of runs) {
8513
- const entry = runMap.get(r.assistantId) || { runCount: 0 };
8514
- entry.runCount++;
8515
- if (!entry.lastRunAt || new Date(r.startedAt) > new Date(entry.lastRunAt)) {
8516
- entry.lastRunAt = r.startedAt instanceof Date ? r.startedAt.toISOString() : String(r.startedAt);
8517
- }
8518
- runMap.set(r.assistantId, entry);
8519
- }
8520
- }
8521
- } catch {
8522
- }
8523
- const definitions = configDefs.map((d) => {
8524
- const runInfo = runMap.get(d.assistantId);
8525
- return {
8526
- ...d,
8527
- lastRunAt: runInfo?.lastRunAt || null,
8528
- runCount: runInfo?.runCount || 0
8529
- };
8530
- });
8531
- return {
8532
- success: true,
8533
- message: "Successfully retrieved workflow definitions",
8534
- data: { records: definitions }
8535
- };
8536
- } catch (error) {
8537
- request.log.error(error, "Failed to get workflow definitions");
8538
- return reply.status(500).send({ success: false, message: "Failed to retrieve workflow definitions" });
8539
- }
8540
- }
8541
8472
  async function getAllWorkflowRuns(request, reply) {
8542
8473
  const tenantId = getTenantId14(request);
8543
8474
  const { assistantId, status } = request.query;
@@ -8699,37 +8630,6 @@ async function getInboxItems(request, reply) {
8699
8630
  return reply.status(500).send({ success: false, message: "Failed to retrieve inbox items" });
8700
8631
  }
8701
8632
  }
8702
- async function getWorkflowDefinitions(request, reply) {
8703
- const { assistantId } = request.params;
8704
- const tenantId = getTenantId14(request);
8705
- try {
8706
- const store2 = getTrackingStore();
8707
- if (!store2) {
8708
- return reply.status(404).send({ success: false, message: "No workflow tracking store configured" });
8709
- }
8710
- const runs = await store2.getWorkflowRunsByAssistantId(tenantId, assistantId);
8711
- const seen = /* @__PURE__ */ new Set();
8712
- const definitions = runs.filter((r) => {
8713
- const key = JSON.stringify(r.topologyEdges);
8714
- if (seen.has(key)) return false;
8715
- seen.add(key);
8716
- return true;
8717
- }).map((r) => ({
8718
- assistantId: r.assistantId,
8719
- topologyEdges: r.topologyEdges,
8720
- totalEdges: r.totalEdges,
8721
- lastRunAt: r.startedAt
8722
- }));
8723
- return {
8724
- success: true,
8725
- message: "Successfully retrieved workflow definitions",
8726
- data: { records: definitions }
8727
- };
8728
- } catch (error) {
8729
- request.log.error(error, "Failed to get workflow definitions");
8730
- return reply.status(500).send({ success: false, message: "Failed to retrieve workflow definitions" });
8731
- }
8732
- }
8733
8633
  async function getWorkflowRuns(request, reply) {
8734
8634
  const { threadId } = request.params;
8735
8635
  const tenantId = getTenantId14(request);
@@ -12936,11 +12836,11 @@ var createBody = z2.object({
12936
12836
  key: z2.string().min(1),
12937
12837
  name: z2.string().min(1),
12938
12838
  description: z2.string().optional(),
12939
- config: z2.record(z2.unknown())
12839
+ config: z2.record(z2.string(), z2.unknown())
12940
12840
  });
12941
12841
  var testOrDiscoverBody = z2.object({
12942
12842
  key: z2.string().optional(),
12943
- config: z2.record(z2.unknown()).optional()
12843
+ config: z2.record(z2.string(), z2.unknown()).optional()
12944
12844
  });
12945
12845
  function getTenant(request) {
12946
12846
  const userTenantId = request.user?.tenantId;
@@ -13037,7 +12937,7 @@ function connectionRoutes(fastify2) {
13037
12937
  return reply.status(400).send(err);
13038
12938
  }
13039
12939
  if (err instanceof z2.ZodError) {
13040
- return reply.status(400).send({ error: err.errors });
12940
+ return reply.status(400).send({ error: err.issues });
13041
12941
  }
13042
12942
  return reply.status(500).send({
13043
12943
  ok: false,
@@ -13065,7 +12965,7 @@ function connectionRoutes(fastify2) {
13065
12965
  return reply.status(400).send(err);
13066
12966
  }
13067
12967
  if (err instanceof z2.ZodError) {
13068
- return reply.status(400).send({ error: err.errors });
12968
+ return reply.status(400).send({ error: err.issues });
13069
12969
  }
13070
12970
  return reply.status(500).send({
13071
12971
  error: err instanceof Error ? err.message : String(err)
@@ -13363,13 +13263,17 @@ async function testMcpServerConnection(request, reply) {
13363
13263
  try {
13364
13264
  const testKey = `__test_${key}_${Date.now()}`;
13365
13265
  const connection = convertToConnection(config.config);
13366
- const { latency } = await McpLatticeManager.testConnection(testKey, connection);
13266
+ const { latency, protocolVersion } = await McpLatticeManager.testConnection(
13267
+ testKey,
13268
+ connection
13269
+ );
13367
13270
  return {
13368
13271
  success: true,
13369
13272
  message: "Connection test successful",
13370
13273
  data: {
13371
13274
  connected: true,
13372
- latency
13275
+ latency,
13276
+ ...protocolVersion ? { protocolVersion } : {}
13373
13277
  }
13374
13278
  };
13375
13279
  } catch (error) {
@@ -14861,6 +14765,11 @@ var AuthController = class {
14861
14765
  });
14862
14766
  }
14863
14767
  }
14768
+ /**
14769
+ * SEC-03: no RBAC check and the response is the full stored `User`, which can
14770
+ * include `metadata.passwordHash`. Sanitizing the response or adding an admin
14771
+ * gate is a breaking API change for existing callers; plan a flagged rollout.
14772
+ */
14864
14773
  async approveUser(request, reply) {
14865
14774
  const { userId, approved } = request.body;
14866
14775
  try {
@@ -14892,6 +14801,11 @@ var AuthController = class {
14892
14801
  });
14893
14802
  }
14894
14803
  }
14804
+ /**
14805
+ * SEC-03: no RBAC check and pending users are returned unsanitized, including
14806
+ * `metadata.passwordHash`. Do not strip fields or add a role gate without a
14807
+ * compatibility plan and client coordination.
14808
+ */
14895
14809
  async listPendingUsers(request, reply) {
14896
14810
  try {
14897
14811
  const users = await this.userStore.getAllUsers();
@@ -14908,6 +14822,11 @@ var AuthController = class {
14908
14822
  });
14909
14823
  }
14910
14824
  }
14825
+ /**
14826
+ * SEC-03: no server-side RBAC/role-transition validation. Adding an
14827
+ * `owner|admin` gate or self-elevation checks is a breaking behavior change
14828
+ * for member sessions; ship it behind an explicit migration/flag.
14829
+ */
14911
14830
  async assignTenant(request, reply) {
14912
14831
  const { userId, tenantId, role = "member" } = request.body;
14913
14832
  try {
@@ -14966,6 +14885,11 @@ var AuthController = class {
14966
14885
  }
14967
14886
  return createConsoleSessionToken(payload, this.config.jwtSecret);
14968
14887
  }
14888
+ /**
14889
+ * SEC-04: password policy/hash scheme is legacy. Changing the hash requires
14890
+ * transparent rehash-on-login; tightening the policy can reject credentials
14891
+ * users already have, so treat it as a breaking migration.
14892
+ */
14969
14893
  async changePassword(request, reply) {
14970
14894
  const userId = request.user?.id;
14971
14895
  const { currentPassword, newPassword } = request.body;
@@ -16208,6 +16132,12 @@ function getTenantId22(request) {
16208
16132
  function errorMessage(err) {
16209
16133
  return err instanceof Error ? err.message : "Unexpected error";
16210
16134
  }
16135
+ function sanitizeUpdatePatch(body) {
16136
+ const patch = { ...body };
16137
+ delete patch.id;
16138
+ delete patch.tenantId;
16139
+ return patch;
16140
+ }
16211
16141
  async function getMenuItemList(request, _reply) {
16212
16142
  const tenantId = getTenantId22(request);
16213
16143
  try {
@@ -16260,7 +16190,10 @@ async function updateMenuItem(request, reply) {
16260
16190
  reply.status(404);
16261
16191
  return { success: false, message: "Menu item not found" };
16262
16192
  }
16263
- const item = await registry.update(request.params.id, request.body);
16193
+ const item = await registry.update(
16194
+ request.params.id,
16195
+ sanitizeUpdatePatch(request.body)
16196
+ );
16264
16197
  return { success: true, message: "Menu item updated", data: item };
16265
16198
  } catch (error) {
16266
16199
  const msg = errorMessage(error);
@@ -21056,7 +20989,7 @@ var createSchema = z8.object({ name: z8.string(), description: z8.string().optio
21056
20989
  var updateSchema = createSchema.partial().extend({ expectedUpdatedAt: z8.string().optional() });
21057
20990
  var bundleIdSchema = z8.string().uuid();
21058
20991
  var bundleParamsSchema = z8.object({ bundleId: bundleIdSchema });
21059
- var projectSchema = z8.object({ bundleIds: z8.array(bundleIdSchema), expectedRevisions: z8.record(z8.string()).optional() }).strict();
20992
+ var projectSchema = z8.object({ bundleIds: z8.array(bundleIdSchema), expectedRevisions: z8.record(z8.string(), z8.string()).optional() }).strict();
21060
20993
  function tenant(request, authRequired2) {
21061
20994
  const authenticated = request.user?.tenantId;
21062
20995
  const header2 = request.headers["x-tenant-id"];
@@ -29568,10 +29501,6 @@ var registerLatticeRoutes = (app2, channelDeps, options = {}) => {
29568
29501
  }
29569
29502
  });
29570
29503
  }
29571
- app2.get(
29572
- "/api/workflows/definitions",
29573
- getAllWorkflowDefinitions
29574
- );
29575
29504
  app2.get(
29576
29505
  "/api/workflows/runs",
29577
29506
  getAllWorkflowRuns
@@ -29580,10 +29509,6 @@ var registerLatticeRoutes = (app2, channelDeps, options = {}) => {
29580
29509
  "/api/workflows/inbox",
29581
29510
  getInboxItems
29582
29511
  );
29583
- app2.get(
29584
- "/api/assistants/:assistantId/workflows/definitions",
29585
- getWorkflowDefinitions
29586
- );
29587
29512
  app2.get(
29588
29513
  "/api/assistants/:assistantId/threads/:threadId/workflows/runs",
29589
29514
  getWorkflowRuns
@@ -38491,7 +38416,7 @@ var start = async (config) => {
38491
38416
  });
38492
38417
  try {
38493
38418
  const { A2AAuthService: A2AAuthService2, parseEnvKeys: parseEnvKeys2 } = await import("./A2AAuthService-UKN53ZGP.mjs");
38494
- const { registerA2AStandardRoutes } = await import("./a2a-standard-MD7WNDTP.mjs");
38419
+ const { registerA2AStandardRoutes } = await import("./a2a-standard-NOAVPYXJ.mjs");
38495
38420
  const a2a = await import("./a2a-YLKZE5JG.mjs");
38496
38421
  const a2aKeyStore = getStoreLattice42("default", "a2aApiKey").store;
38497
38422
  const assistantStore = getStoreLattice42("default", "assistant").store;
@@ -38521,7 +38446,7 @@ var start = async (config) => {
38521
38446
  });
38522
38447
  }
38523
38448
  try {
38524
- const { registerOpenRoutes } = await import("./open-27ZPLBIW.mjs");
38449
+ const { registerOpenRoutes } = await import("./open-PCOORPQ5.mjs");
38525
38450
  const { registerOpenSessionRoutes } = await import("./open-session-CLZT3HVG.mjs");
38526
38451
  const { registerOpenCatalogRoutes } = await import("./open-catalog-NVGP6SQP.mjs");
38527
38452
  const { registerOpenFilesRoutes } = await import("./open-files-JPB2NBL6.mjs");