@axiom-lattice/gateway 2.1.105 → 2.1.107

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @axiom-lattice/gateway@2.1.105 build /home/runner/work/agentic/agentic/packages/gateway
2
+ > @axiom-lattice/gateway@2.1.107 build /home/runner/work/agentic/agentic/packages/gateway
3
3
  > tsup src/index.ts --format cjs,esm --dts --clean --sourcemap
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -18,25 +18,25 @@
18
18
  You need to set the output format to "esm" for "import.meta" to work correctly.
19
19
 
20
20
 
21
- CJS dist/index.js 323.03 KB
22
- CJS dist/index.js.map 662.42 KB
23
- CJS ⚡️ Build success in 632ms
24
- ESM dist/index.mjs 271.42 KB
25
- ESM dist/sender-PX32VSHB.mjs 873.00 B
21
+ CJS dist/index.js 324.07 KB
22
+ CJS dist/index.js.map 664.13 KB
23
+ CJS ⚡️ Build success in 477ms
24
+ ESM dist/index.mjs 272.20 KB
26
25
  ESM dist/WechatChannelAdapter-WSDKR4OA.mjs 8.27 KB
26
+ ESM dist/sender-PX32VSHB.mjs 873.00 B
27
27
  ESM dist/chunk-6CUQGDJI.mjs 6.42 KB
28
28
  ESM dist/a2a-ERG5RMUW.mjs 15.95 KB
29
- ESM dist/resources-NE6DFF5I.mjs 10.75 KB
30
- ESM dist/chunk-R4ZO3HZ3.mjs 1.44 KB
31
- ESM dist/sender-PX32VSHB.mjs.map 2.07 KB
29
+ ESM dist/resources-HEVGN3JM.mjs 10.92 KB
30
+ ESM dist/chunk-LHQY46YB.mjs 1.46 KB
32
31
  ESM dist/WechatChannelAdapter-WSDKR4OA.mjs.map 16.28 KB
33
- ESM dist/a2a-ERG5RMUW.mjs.map 32.14 KB
32
+ ESM dist/sender-PX32VSHB.mjs.map 2.07 KB
34
33
  ESM dist/chunk-6CUQGDJI.mjs.map 14.04 KB
35
- ESM dist/resources-NE6DFF5I.mjs.map 19.57 KB
36
- ESM dist/chunk-R4ZO3HZ3.mjs.map 2.35 KB
37
- ESM dist/index.mjs.map 575.75 KB
38
- ESM ⚡️ Build success in 655ms
34
+ ESM dist/a2a-ERG5RMUW.mjs.map 32.14 KB
35
+ ESM dist/resources-HEVGN3JM.mjs.map 19.82 KB
36
+ ESM dist/chunk-LHQY46YB.mjs.map 2.39 KB
37
+ ESM dist/index.mjs.map 577.17 KB
38
+ ESM ⚡️ Build success in 515ms
39
39
  DTS Build start
40
- DTS ⚡️ Build success in 23567ms
40
+ DTS ⚡️ Build success in 19498ms
41
41
  DTS dist/index.d.ts 7.57 KB
42
42
  DTS dist/index.d.mts 7.57 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @axiom-lattice/gateway
2
2
 
3
+ ## 2.1.107
4
+
5
+ ### Patch Changes
6
+
7
+ - 67491bd: fix issue
8
+
9
+ ## 2.1.106
10
+
11
+ ### Patch Changes
12
+
13
+ - 2954442: fix issue
14
+ - Updated dependencies [c8749a0]
15
+ - Updated dependencies [2954442]
16
+ - @axiom-lattice/pg-stores@1.0.85
17
+ - @axiom-lattice/core@2.1.94
18
+ - @axiom-lattice/protocols@2.1.48
19
+ - @axiom-lattice/agent-eval@2.1.88
20
+ - @axiom-lattice/queue-redis@1.0.47
21
+
3
22
  ## 2.1.105
4
23
 
5
24
  ### Patch Changes
@@ -1,6 +1,7 @@
1
1
  // src/utils/mime.ts
2
2
  var EXT_TO_MIME = {
3
3
  ".txt": "text/plain",
4
+ ".md": "text/markdown",
4
5
  ".html": "text/html",
5
6
  ".htm": "text/html",
6
7
  ".css": "text/css",
@@ -43,4 +44,4 @@ export {
43
44
  getContentTypeFromFilename,
44
45
  getFilenameFromPath
45
46
  };
46
- //# sourceMappingURL=chunk-R4ZO3HZ3.mjs.map
47
+ //# sourceMappingURL=chunk-LHQY46YB.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utils/mime.ts"],"sourcesContent":["const EXT_TO_MIME: Record<string, string> = {\n \".txt\": \"text/plain\",\n \".md\": \"text/markdown\",\n \".html\": \"text/html\",\n \".htm\": \"text/html\",\n \".css\": \"text/css\",\n \".js\": \"application/javascript\",\n \".mjs\": \"application/javascript\",\n \".json\": \"application/json\",\n \".pdf\": \"application/pdf\",\n \".png\": \"image/png\",\n \".jpg\": \"image/jpeg\",\n \".jpeg\": \"image/jpeg\",\n \".gif\": \"image/gif\",\n \".webp\": \"image/webp\",\n \".svg\": \"image/svg+xml\",\n \".ico\": \"image/x-icon\",\n \".zip\": \"application/zip\",\n \".csv\": \"text/csv\",\n \".xml\": \"application/xml\",\n \".xlsx\": \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\",\n \".xls\": \"application/vnd.ms-excel\",\n \".pptx\": \"application/vnd.openxmlformats-officedocument.presentationml.presentation\",\n \".ppt\": \"application/vnd.ms-powerpoint\",\n \".docx\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",\n \".doc\": \"application/msword\",\n \".mp4\": \"video/mp4\",\n \".webm\": \"video/webm\",\n \".mp3\": \"audio/mpeg\",\n \".wav\": \"audio/wav\",\n \".ogg\": \"audio/ogg\",\n};\n\nexport function getContentTypeFromFilename(filename: string): string {\n const ext = filename.includes(\".\")\n ? filename.slice(filename.lastIndexOf(\".\")).toLowerCase()\n : \"\";\n return EXT_TO_MIME[ext] ?? \"application/octet-stream\";\n}\n\nexport function getFilenameFromPath(path: string): string {\n const segments = path.replace(/\\/+$/, \"\").split(\"/\");\n return segments[segments.length - 1] || \"download\";\n}\n"],"mappings":";AAAA,IAAM,cAAsC;AAAA,EAC1C,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AACV;AAEO,SAAS,2BAA2B,UAA0B;AACnE,QAAM,MAAM,SAAS,SAAS,GAAG,IAC7B,SAAS,MAAM,SAAS,YAAY,GAAG,CAAC,EAAE,YAAY,IACtD;AACJ,SAAO,YAAY,GAAG,KAAK;AAC7B;AAEO,SAAS,oBAAoB,MAAsB;AACxD,QAAM,WAAW,KAAK,QAAQ,QAAQ,EAAE,EAAE,MAAM,GAAG;AACnD,SAAO,SAAS,SAAS,SAAS,CAAC,KAAK;AAC1C;","names":[]}
package/dist/index.js CHANGED
@@ -45,6 +45,7 @@ var init_mime = __esm({
45
45
  "use strict";
46
46
  EXT_TO_MIME = {
47
47
  ".txt": "text/plain",
48
+ ".md": "text/markdown",
48
49
  ".html": "text/html",
49
50
  ".htm": "text/html",
50
51
  ".css": "text/css",
@@ -1244,7 +1245,7 @@ var init_resources = __esm({
1244
1245
  }
1245
1246
  async updateShare(request, reply) {
1246
1247
  const { token } = request.params;
1247
- const userId = request.user ? request.user.id : void 0;
1248
+ const userId = request.user ? request.user.id ?? "unknown" : "unknown";
1248
1249
  const patch = request.body;
1249
1250
  const record = await this.deps.store.findByToken(token);
1250
1251
  if (!record || record.createdBy !== userId) {
@@ -1258,7 +1259,7 @@ var init_resources = __esm({
1258
1259
  }
1259
1260
  async revokeShare(request, reply) {
1260
1261
  const { token } = request.params;
1261
- const userId = request.user ? request.user.id : void 0;
1262
+ const userId = request.user ? request.user.id ?? "unknown" : "unknown";
1262
1263
  const record = await this.deps.store.findByToken(token);
1263
1264
  if (!record || record.createdBy !== userId) {
1264
1265
  return reply.status(404).send({ error: "Share not found" });
@@ -1337,10 +1338,17 @@ var init_resources = __esm({
1337
1338
  if (!valid) {
1338
1339
  return reply.status(401).send({ error: "Incorrect password" });
1339
1340
  }
1340
- reply.header(
1341
- "Set-Cookie",
1342
- `share_unlock_${token}=1; Max-Age=86400; Path=/s/${token}; SameSite=Lax; HttpOnly; Secure`
1343
- );
1341
+ const cookieOpts = [
1342
+ `share_unlock_${token}=1`,
1343
+ "Max-Age=86400",
1344
+ `Path=/s/${token}`,
1345
+ "SameSite=Lax",
1346
+ "HttpOnly"
1347
+ ];
1348
+ if (request.protocol === "https") {
1349
+ cookieOpts.push("Secure");
1350
+ }
1351
+ reply.header("Set-Cookie", cookieOpts.join("; "));
1344
1352
  return reply.send({ ok: true });
1345
1353
  }
1346
1354
  _isInternalRequest(request) {
@@ -1619,6 +1627,21 @@ async function deleteAssistant(request, reply) {
1619
1627
  });
1620
1628
  }
1621
1629
  import_core2.eventBus.publish("assistant:deleted", { id, tenantId });
1630
+ const userId = getUserId(request);
1631
+ if (userId) {
1632
+ try {
1633
+ const linkStore = (0, import_core.getStoreLattice)("default", "userTenantLink").store;
1634
+ const link = await linkStore.getLink(userId, tenantId);
1635
+ const meta = link?.metadata || {};
1636
+ if (meta.personalAssistantId === id) {
1637
+ delete meta.personalAssistantId;
1638
+ delete meta.personalProjectId;
1639
+ delete meta.personalWorkspaceId;
1640
+ await linkStore.updateLink(userId, tenantId, { metadata: meta });
1641
+ }
1642
+ } catch {
1643
+ }
1644
+ }
1622
1645
  return {
1623
1646
  success: true,
1624
1647
  message: "Successfully deleted assistant"
@@ -7280,6 +7303,18 @@ var AuthController = class {
7280
7303
  const token = await this.generateToken(userId, tenantId);
7281
7304
  const link = await this.userTenantLinkStore.getLink(userId, tenantId);
7282
7305
  const linkMeta = link?.metadata || {};
7306
+ let personalAssistant = null;
7307
+ if (linkMeta.personalAssistantId) {
7308
+ const assistantStore = (0, import_core29.getStoreLattice)("default", "assistant").store;
7309
+ const exists = await assistantStore.hasAssistant(tenantId, linkMeta.personalAssistantId);
7310
+ if (exists) {
7311
+ personalAssistant = {
7312
+ assistantId: linkMeta.personalAssistantId,
7313
+ projectId: linkMeta.personalProjectId || "default",
7314
+ workspaceId: linkMeta.personalWorkspaceId || "default"
7315
+ };
7316
+ }
7317
+ }
7283
7318
  return {
7284
7319
  success: true,
7285
7320
  data: {
@@ -7289,11 +7324,7 @@ var AuthController = class {
7289
7324
  status: tenant.status
7290
7325
  },
7291
7326
  token,
7292
- personalAssistant: linkMeta.personalAssistantId ? {
7293
- assistantId: linkMeta.personalAssistantId,
7294
- projectId: linkMeta.personalProjectId || "default",
7295
- workspaceId: linkMeta.personalWorkspaceId || "default"
7296
- } : null
7327
+ personalAssistant
7297
7328
  }
7298
7329
  };
7299
7330
  } catch (error) {