@5ss/ai-tools 3.0.0 → 3.0.2

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 (85) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/{aws-service-msttbPrz.js → aws-service-Cn_ozX4X.js} +2 -2
  3. package/dist/{aws-service-msttbPrz.js.map → aws-service-Cn_ozX4X.js.map} +1 -1
  4. package/dist/{bedrock-agentcore-browser-o_oqSPMK.js → bedrock-agentcore-browser-DwDSP_YL.js} +2 -2
  5. package/dist/{bedrock-agentcore-browser-o_oqSPMK.js.map → bedrock-agentcore-browser-DwDSP_YL.js.map} +1 -1
  6. package/dist/{bedrock-agentcore-code-interpreter-D4ERRFj1.js → bedrock-agentcore-code-interpreter-F0dnrAm4.js} +2 -2
  7. package/dist/{bedrock-agentcore-code-interpreter-D4ERRFj1.js.map → bedrock-agentcore-code-interpreter-F0dnrAm4.js.map} +1 -1
  8. package/dist/{cloudflare-browser-nLJdH5nG.js → cloudflare-browser-D-HT43hu.js} +3 -3
  9. package/dist/{cloudflare-browser-nLJdH5nG.js.map → cloudflare-browser-D-HT43hu.js.map} +1 -1
  10. package/dist/{cloudflare-email-CSRq8mRd.js → cloudflare-email-BLI3z96V.js} +2 -2
  11. package/dist/{cloudflare-email-CSRq8mRd.js.map → cloudflare-email-BLI3z96V.js.map} +1 -1
  12. package/dist/{cloudflare-sandbox-Be7SeS4-.js → cloudflare-sandbox-6nX5lIev.js} +3 -3
  13. package/dist/{cloudflare-sandbox-Be7SeS4-.js.map → cloudflare-sandbox-6nX5lIev.js.map} +1 -1
  14. package/dist/{eventbridge-scheduler-BhQaReAz.js → eventbridge-scheduler-CDmO2-Te.js} +2 -2
  15. package/dist/{eventbridge-scheduler-BhQaReAz.js.map → eventbridge-scheduler-CDmO2-Te.js.map} +1 -1
  16. package/dist/http/index.d.ts.map +1 -1
  17. package/dist/http/index.js +2 -2
  18. package/dist/{http-service-DDNCO1s4.js → http-service-BMBIryAL.js} +2 -5
  19. package/dist/http-service-BMBIryAL.js.map +1 -0
  20. package/dist/{imessage-CH49-sFn.js → imessage-Dsms04rC.js} +2 -2
  21. package/dist/{imessage-CH49-sFn.js.map → imessage-Dsms04rC.js.map} +1 -1
  22. package/dist/modules/artifacts/index.js +1 -1
  23. package/dist/modules/browser/index.js +2 -2
  24. package/dist/modules/code-sandbox/index.js +2 -2
  25. package/dist/modules/document-extract/index.js +1 -1
  26. package/dist/modules/document-render/index.js +1 -1
  27. package/dist/modules/email/index.js +2 -2
  28. package/dist/modules/files/index.js +1 -1
  29. package/dist/modules/image/index.js +1 -1
  30. package/dist/modules/messaging/index.js +5 -5
  31. package/dist/modules/queue/index.js +1 -1
  32. package/dist/modules/rag/index.js +2 -2
  33. package/dist/modules/scheduler/index.js +1 -1
  34. package/dist/modules/vector-store/index.js +1 -1
  35. package/dist/modules/web-fetch/index.js +1 -1
  36. package/dist/{pinecone-CNnCFmix.js → pinecone-BvdXAZMi.js} +2 -2
  37. package/dist/{pinecone-CNnCFmix.js.map → pinecone-BvdXAZMi.js.map} +1 -1
  38. package/dist/{qdrant-R_FIcG9d.js → qdrant-D2E2Lxrw.js} +2 -2
  39. package/dist/{qdrant-R_FIcG9d.js.map → qdrant-D2E2Lxrw.js.map} +1 -1
  40. package/dist/{resend-Bu0NFO3h.js → resend-A2SnRdQ8.js} +2 -2
  41. package/dist/{resend-Bu0NFO3h.js.map → resend-A2SnRdQ8.js.map} +1 -1
  42. package/dist/{s3-Dj7Teh-A.js → s3-CoZQRTfe.js} +2 -2
  43. package/dist/{s3-Dj7Teh-A.js.map → s3-CoZQRTfe.js.map} +1 -1
  44. package/dist/{slack-AjJDNnXJ.js → slack-C9UJ0b61.js} +2 -2
  45. package/dist/{slack-AjJDNnXJ.js.map → slack-C9UJ0b61.js.map} +1 -1
  46. package/dist/{sqs-CjyXjasF.js → sqs-DxFnfODk.js} +2 -2
  47. package/dist/{sqs-CjyXjasF.js.map → sqs-DxFnfODk.js.map} +1 -1
  48. package/dist/{supabase-vector-BNoJZuft.js → supabase-vector-DT3qfnt2.js} +2 -2
  49. package/dist/{supabase-vector-BNoJZuft.js.map → supabase-vector-DT3qfnt2.js.map} +1 -1
  50. package/dist/{teams-CvxYLAi5.js → teams-NODh3i6U.js} +2 -2
  51. package/dist/{teams-CvxYLAi5.js.map → teams-NODh3i6U.js.map} +1 -1
  52. package/dist/{telegram-B_-Jljk3.js → telegram-CWMHBeKo.js} +2 -2
  53. package/dist/{telegram-B_-Jljk3.js.map → telegram-CWMHBeKo.js.map} +1 -1
  54. package/dist/{textract-CAfnGvua.js → textract-2jkPuRiE.js} +3 -3
  55. package/dist/{textract-CAfnGvua.js.map → textract-2jkPuRiE.js.map} +1 -1
  56. package/dist/{vector-store-DDiu3XPg.js → vector-store-CDQaQXFV.js} +4 -4
  57. package/dist/{vector-store-DDiu3XPg.js.map → vector-store-CDQaQXFV.js.map} +1 -1
  58. package/dist/vendors/amazon-sp-api/index.d.ts +1 -8
  59. package/dist/vendors/amazon-sp-api/index.d.ts.map +1 -1
  60. package/dist/vendors/amazon-sp-api/index.js +11 -22
  61. package/dist/vendors/amazon-sp-api/index.js.map +1 -1
  62. package/dist/vendors/bedrock-agentcore-browser/index.js +1 -1
  63. package/dist/vendors/bedrock-agentcore-code-interpreter/index.js +1 -1
  64. package/dist/vendors/cloudflare-browser/index.js +1 -1
  65. package/dist/vendors/cloudflare-email/index.js +1 -1
  66. package/dist/vendors/cloudflare-sandbox/index.js +1 -1
  67. package/dist/vendors/eventbridge-scheduler/index.js +1 -1
  68. package/dist/vendors/imessage/index.js +1 -1
  69. package/dist/vendors/katana/index.d.ts +112 -56
  70. package/dist/vendors/katana/index.d.ts.map +1 -1
  71. package/dist/vendors/katana/index.js +42 -16
  72. package/dist/vendors/katana/index.js.map +1 -1
  73. package/dist/vendors/pinecone/index.js +1 -1
  74. package/dist/vendors/qdrant/index.js +1 -1
  75. package/dist/vendors/resend/index.js +1 -1
  76. package/dist/vendors/s3/index.js +1 -1
  77. package/dist/vendors/slack/index.js +1 -1
  78. package/dist/vendors/sqs/index.js +1 -1
  79. package/dist/vendors/supabase-vector/index.js +1 -1
  80. package/dist/vendors/teams/index.js +1 -1
  81. package/dist/vendors/telegram/index.js +1 -1
  82. package/dist/vendors/textract/index.js +1 -1
  83. package/dist/vendors/woocommerce/index.js +1 -1
  84. package/package.json +12 -11
  85. package/dist/http-service-DDNCO1s4.js.map +0 -1
@@ -1,9 +1,9 @@
1
1
  import { t as ToolError } from "../../errors-DoSpNHvs.js";
2
2
  import { n as defineModule, r as defineTool } from "../../define-ieoksEQ0.js";
3
3
  import { n as requireAuth } from "../../provider-CgDAlg6K.js";
4
- import { t as HttpService } from "../../http-service-DDNCO1s4.js";
4
+ import { t as HttpService } from "../../http-service-BMBIryAL.js";
5
5
  import { f as vectorMetadataSchema } from "../../schemas-ChOAhdo9.js";
6
- import { a as VectorStoreClient, c as qdrantVectorAuthSchema, l as supabaseVectorSeamAuthSchema, o as mastraVectorSeamAuthSchema, s as pineconeVectorAuthSchema } from "../../vector-store-DDiu3XPg.js";
6
+ import { a as VectorStoreClient, c as qdrantVectorAuthSchema, l as supabaseVectorSeamAuthSchema, o as mastraVectorSeamAuthSchema, s as pineconeVectorAuthSchema } from "../../vector-store-CDQaQXFV.js";
7
7
  import { isPlainObject } from "es-toolkit";
8
8
  import { z } from "zod";
9
9
  //#region src/modules/rag/contracts.ts
@@ -1,6 +1,6 @@
1
1
  import { n as defineModule, r as defineTool } from "../../define-ieoksEQ0.js";
2
2
  import { n as requireAuth } from "../../provider-CgDAlg6K.js";
3
- import { C as scheduleWriteOutputSchema, S as scheduleUpdateInputSchema, _ as scheduleListInputSchema, b as scheduleStateSchema, f as eventBridgeSchedulerAuthSchema, g as scheduleGetOutputSchema, h as scheduleDetailSchema, m as scheduleDeleteOutputSchema, p as scheduleCreateInputSchema, s as EventBridgeSchedulerClient, v as scheduleListOutputSchema, x as scheduleSummarySchema, y as scheduleNameInputSchema } from "../../eventbridge-scheduler-BhQaReAz.js";
3
+ import { C as scheduleWriteOutputSchema, S as scheduleUpdateInputSchema, _ as scheduleListInputSchema, b as scheduleStateSchema, f as eventBridgeSchedulerAuthSchema, g as scheduleGetOutputSchema, h as scheduleDetailSchema, m as scheduleDeleteOutputSchema, p as scheduleCreateInputSchema, s as EventBridgeSchedulerClient, v as scheduleListOutputSchema, x as scheduleSummarySchema, y as scheduleNameInputSchema } from "../../eventbridge-scheduler-CDmO2-Te.js";
4
4
  import { z } from "zod";
5
5
  //#region src/modules/scheduler/contracts.ts
6
6
  /**
@@ -1,3 +1,3 @@
1
1
  import { a as deleteVectorsOutputSchema, c as upsertVectorsInputSchema, d as vectorMatchSchema, f as vectorMetadataSchema, i as deleteVectorsInputSchema, l as upsertVectorsOutputSchema, n as MAX_VECTOR_BATCH, o as queryVectorsInputSchema, p as vectorPointSchema, r as MAX_VECTOR_DIMENSIONS, s as queryVectorsOutputSchema, t as MAX_TOP_K } from "../../schemas-ChOAhdo9.js";
2
- import { a as VectorStoreClient, c as qdrantVectorAuthSchema, i as vectorStoreUpsertTool, l as supabaseVectorSeamAuthSchema, n as vectorStoreModule, o as mastraVectorSeamAuthSchema, r as vectorStoreQueryTool, s as pineconeVectorAuthSchema, t as vectorStoreDeleteTool, u as vectorStoreAuthSchema } from "../../vector-store-DDiu3XPg.js";
2
+ import { a as VectorStoreClient, c as qdrantVectorAuthSchema, i as vectorStoreUpsertTool, l as supabaseVectorSeamAuthSchema, n as vectorStoreModule, o as mastraVectorSeamAuthSchema, r as vectorStoreQueryTool, s as pineconeVectorAuthSchema, t as vectorStoreDeleteTool, u as vectorStoreAuthSchema } from "../../vector-store-CDQaQXFV.js";
3
3
  export { MAX_TOP_K, MAX_VECTOR_BATCH, MAX_VECTOR_DIMENSIONS, VectorStoreClient, deleteVectorsInputSchema, deleteVectorsOutputSchema, mastraVectorSeamAuthSchema, pineconeVectorAuthSchema, qdrantVectorAuthSchema, queryVectorsInputSchema, queryVectorsOutputSchema, supabaseVectorSeamAuthSchema, upsertVectorsInputSchema, upsertVectorsOutputSchema, vectorMatchSchema, vectorMetadataSchema, vectorPointSchema, vectorStoreAuthSchema, vectorStoreDeleteTool, vectorStoreModule, vectorStoreQueryTool, vectorStoreUpsertTool };
@@ -1,7 +1,7 @@
1
1
  import { t as ToolError } from "../../errors-DoSpNHvs.js";
2
2
  import { n as defineModule, r as defineTool } from "../../define-ieoksEQ0.js";
3
3
  import { n as requireAuth } from "../../provider-CgDAlg6K.js";
4
- import { i as mapTransportNetworkError, t as HttpService } from "../../http-service-DDNCO1s4.js";
4
+ import { i as mapTransportNetworkError, t as HttpService } from "../../http-service-BMBIryAL.js";
5
5
  import { z } from "zod";
6
6
  const webFetchAuthSchema = z.object({
7
7
  allowed_origins: z.array(z.string().min(1)).min(1).max(64).describe("Exact origins permitted, for example https://api.example.com"),
@@ -1,7 +1,7 @@
1
1
  import { t as ToolError } from "./errors-DoSpNHvs.js";
2
2
  import { n as defineModule, r as defineTool } from "./define-ieoksEQ0.js";
3
3
  import { n as requireAuth } from "./provider-CgDAlg6K.js";
4
- import { t as HttpService } from "./http-service-DDNCO1s4.js";
4
+ import { t as HttpService } from "./http-service-BMBIryAL.js";
5
5
  import { C as resolveVectorNamespace, _ as parseMetadata, a as deleteVectorsOutputSchema, c as upsertVectorsInputSchema, g as mergeVectorFilter, i as deleteVectorsInputSchema, l as upsertVectorsOutputSchema, m as mapVectorHttpStatus, o as queryVectorsInputSchema, s as queryVectorsOutputSchema, u as vectorDefaultFilterSchema, v as parseNumberArray, w as stampDefaultFilterMetadata, x as parseUpstreamMessage, y as parsePointId } from "./schemas-ChOAhdo9.js";
6
6
  import { isNumber, isPlainObject } from "es-toolkit";
7
7
  import { z } from "zod";
@@ -187,4 +187,4 @@ const pineconeModule = defineModule({
187
187
  //#endregion
188
188
  export { PineconeClient as a, pineconeUpsertTool as i, pineconeModule as n, pineconeAuthSchema as o, pineconeQueryTool as r, pineconeDeleteTool as t };
189
189
 
190
- //# sourceMappingURL=pinecone-CNnCFmix.js.map
190
+ //# sourceMappingURL=pinecone-BvdXAZMi.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pinecone-CNnCFmix.js","names":["#http","#defaultNamespace","#defaultFilter","#namespace"],"sources":["../src/vendors/pinecone/contracts.ts","../src/vendors/pinecone/client.ts","../src/vendors/pinecone/module.ts"],"sourcesContent":["import { z } from 'zod'\n\nimport { vectorDefaultFilterSchema } from '../_vector'\n\nexport {\n\tMAX_TOP_K,\n\tMAX_VECTOR_BATCH,\n\tMAX_VECTOR_DIMENSIONS,\n\tdeleteVectorsInputSchema,\n\tdeleteVectorsOutputSchema,\n\tqueryVectorsInputSchema,\n\tqueryVectorsOutputSchema,\n\tupsertVectorsInputSchema,\n\tupsertVectorsOutputSchema,\n\tvectorMatchSchema,\n\tvectorMetadataSchema,\n\tvectorPointSchema\n} from '../_vector'\nexport type {\n\tDeleteVectorsInput,\n\tDeleteVectorsOutput,\n\tQueryVectorsInput,\n\tQueryVectorsOutput,\n\tUpsertVectorsInput,\n\tUpsertVectorsOutput,\n\tVectorMatch,\n\tVectorMetadata,\n\tVectorPoint\n} from '../_vector'\n\nexport const pineconeAuthSchema = z.object({\n\tapi_key: z.string().min(1).describe('Pinecone API key'),\n\tbase_url: z.string().url().describe('Pinecone index data-plane origin, for example https://xxxx.svc.….pinecone.io'),\n\tdefault_namespace: z\n\t\t.string()\n\t\t.min(1)\n\t\t.optional()\n\t\t.describe('Locked Pinecone namespace for all calls when set (tool cannot switch away)'),\n\tdefault_filter: vectorDefaultFilterSchema\n\t\t.optional()\n\t\t.describe('Host-bound metadata filter always applied on query; flat keys stamped on upsert')\n})\n\nexport type PineconeAuth = z.infer<typeof pineconeAuthSchema>\n","/**\n * Pinecone data-plane REST vendor client.\n * Host: `new PineconeClient(auth)`. Agent tools: `fromContext(ctx)`.\n * @see https://docs.pinecone.io/reference/api/data-plane\n */\n\nimport { isNumber, isPlainObject } from 'es-toolkit'\n\nimport { ToolError } from '../../core/errors'\nimport { requireAuth } from '../../core/provider'\nimport type { ToolContext } from '../../core/types'\nimport { HttpService } from '../../transport/http-service'\nimport type { HttpServiceOptions } from '../../transport/http-service'\nimport {\n\tmapVectorHttpStatus,\n\tmergeVectorFilter,\n\tparseMetadata,\n\tparseNumberArray,\n\tparsePointId,\n\tparseUpstreamMessage,\n\tresolveVectorNamespace,\n\tstampDefaultFilterMetadata\n} from '../_vector/domain'\nimport type { VectorDefaultFilter } from '../_vector/domain'\nimport type {\n\tDeleteVectorsInput,\n\tDeleteVectorsOutput,\n\tPineconeAuth,\n\tQueryVectorsInput,\n\tQueryVectorsOutput,\n\tUpsertVectorsInput,\n\tUpsertVectorsOutput,\n\tVectorMatch\n} from './contracts'\nimport { pineconeAuthSchema } from './contracts'\n\nexport type PineconeClientOptions = {\n\tfetch?: HttpServiceOptions['fetch'] | undefined\n\tsignal?: HttpServiceOptions['signal'] | undefined\n}\n\nexport class PineconeClient {\n\treadonly #http: HttpService\n\treadonly #defaultNamespace: string | undefined\n\treadonly #defaultFilter: VectorDefaultFilter | undefined\n\n\tconstructor(auth: PineconeAuth, options: PineconeClientOptions = {}) {\n\t\tconst parsed = pineconeAuthSchema.safeParse(auth)\n\t\tif (!parsed.success) {\n\t\t\tthrow new ToolError('Invalid Pinecone auth credentials', {\n\t\t\t\tcode: 'bad_auth',\n\t\t\t\tdetails: { issues: parsed.error.issues.map((issue) => issue.message) }\n\t\t\t})\n\t\t}\n\t\tthis.#defaultNamespace = parsed.data.default_namespace\n\t\tthis.#defaultFilter = parsed.data.default_filter\n\t\tconst httpOptions: HttpServiceOptions = {\n\t\t\tbaseURL: parsed.data.base_url,\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t'Api-Key': parsed.data.api_key\n\t\t\t},\n\t\t\tlabel: 'Pinecone'\n\t\t}\n\t\tif (options.fetch) httpOptions.fetch = options.fetch\n\t\tif (options.signal) httpOptions.signal = options.signal\n\t\tthis.#http = new HttpService(httpOptions)\n\t}\n\n\tstatic fromContext(ctx: ToolContext): PineconeClient {\n\t\tconst auth = requireAuth(ctx, pineconeAuthSchema)\n\t\tconst options: PineconeClientOptions = {}\n\t\tif (ctx.fetch) options.fetch = ctx.fetch\n\t\tif (ctx.signal) options.signal = ctx.signal\n\t\treturn new PineconeClient(auth, options)\n\t}\n\n\t#namespace(toolNamespace: string | undefined): string | undefined {\n\t\treturn resolveVectorNamespace(this.#defaultNamespace, toolNamespace)\n\t}\n\n\tasync upsert(input: UpsertVectorsInput): Promise<UpsertVectorsOutput> {\n\t\tconst body: Record<string, unknown> = {\n\t\t\tvectors: input.vectors.map((point) => {\n\t\t\t\tconst metadata = stampDefaultFilterMetadata(point.metadata, this.#defaultFilter)\n\t\t\t\tconst row: Record<string, unknown> = { id: point.id, values: point.values }\n\t\t\t\tif (metadata) row['metadata'] = metadata\n\t\t\t\treturn row\n\t\t\t})\n\t\t}\n\t\tconst ns = this.#namespace(input.namespace)\n\t\tif (ns) body['namespace'] = ns\n\n\t\tconst res = await this.#http.post('/vectors/upsert', body, {\n\t\t\tlabel: 'Pinecone upsert',\n\t\t\tnoThrow: true\n\t\t})\n\t\tif (!res.ok) {\n\t\t\tthrow new ToolError(parseUpstreamMessage(res.data, `Pinecone upsert failed with HTTP ${res.status}`), {\n\t\t\t\tcode: mapVectorHttpStatus(res.status),\n\t\t\t\tdetails: { status: res.status }\n\t\t\t})\n\t\t}\n\t\tconst upserted =\n\t\t\tisPlainObject(res.data) && isNumber(res.data['upsertedCount']) ? res.data['upsertedCount'] : input.vectors.length\n\t\treturn { upserted }\n\t}\n\n\tasync query(input: QueryVectorsInput): Promise<QueryVectorsOutput> {\n\t\tconst topK = input.top_k ?? 8\n\t\tconst includeMetadata = input.include_metadata !== false\n\t\tconst body: Record<string, unknown> = {\n\t\t\tvector: input.vector,\n\t\t\ttopK,\n\t\t\tincludeMetadata,\n\t\t\tincludeValues: input.include_values === true\n\t\t}\n\t\tconst ns = this.#namespace(input.namespace)\n\t\tif (ns) body['namespace'] = ns\n\t\tconst filter = mergeVectorFilter(this.#defaultFilter, input.filter)\n\t\tif (filter) body['filter'] = filter\n\n\t\tconst res = await this.#http.post('/query', body, { label: 'Pinecone query', noThrow: true })\n\t\tif (!res.ok) {\n\t\t\tthrow new ToolError(parseUpstreamMessage(res.data, `Pinecone query failed with HTTP ${res.status}`), {\n\t\t\t\tcode: mapVectorHttpStatus(res.status),\n\t\t\t\tdetails: { status: res.status }\n\t\t\t})\n\t\t}\n\n\t\tconst matchesRaw = isPlainObject(res.data) ? res.data['matches'] : undefined\n\t\tconst rows = Array.isArray(matchesRaw) ? matchesRaw : []\n\t\tconst matches: VectorMatch[] = []\n\t\tfor (const row of rows) {\n\t\t\tif (!isPlainObject(row)) continue\n\t\t\tconst id = parsePointId(row['id'])\n\t\t\tif (!id) continue\n\t\t\tconst score = isNumber(row['score']) ? row['score'] : 0\n\t\t\tconst match: VectorMatch = { id, score }\n\t\t\tif (includeMetadata) {\n\t\t\t\tconst meta = parseMetadata(row['metadata'])\n\t\t\t\tif (meta) match.metadata = meta\n\t\t\t}\n\t\t\tif (input.include_values === true) {\n\t\t\t\tconst values = parseNumberArray(row['values'])\n\t\t\t\tif (values) match.values = values\n\t\t\t}\n\t\t\tmatches.push(match)\n\t\t}\n\t\treturn { matches }\n\t}\n\n\tasync delete(input: DeleteVectorsInput): Promise<DeleteVectorsOutput> {\n\t\tconst body: Record<string, unknown> = { ids: input.ids }\n\t\tconst ns = this.#namespace(input.namespace)\n\t\tif (ns) body['namespace'] = ns\n\n\t\tconst res = await this.#http.post('/vectors/delete', body, {\n\t\t\tlabel: 'Pinecone delete',\n\t\t\tnoThrow: true\n\t\t})\n\t\tif (!res.ok) {\n\t\t\tthrow new ToolError(parseUpstreamMessage(res.data, `Pinecone delete failed with HTTP ${res.status}`), {\n\t\t\t\tcode: mapVectorHttpStatus(res.status),\n\t\t\t\tdetails: { status: res.status }\n\t\t\t})\n\t\t}\n\t\treturn { deleted: input.ids.length }\n\t}\n}\n","import { defineModule, defineTool } from '../../core/define'\nimport { PineconeClient } from './client'\nimport {\n\tdeleteVectorsInputSchema,\n\tdeleteVectorsOutputSchema,\n\tpineconeAuthSchema,\n\tqueryVectorsInputSchema,\n\tqueryVectorsOutputSchema,\n\tupsertVectorsInputSchema,\n\tupsertVectorsOutputSchema\n} from './contracts'\n\nexport const pineconeUpsertTool = defineTool({\n\tid: 'pinecone-upsert',\n\tname: 'pineconeUpsert',\n\tdescription:\n\t\t'Upsert vectors into the configured Pinecone index. Use the optional namespace only when data must be isolated within the index.',\n\tinputSchema: upsertVectorsInputSchema,\n\toutputSchema: upsertVectorsOutputSchema,\n\tsideEffect: 'write',\n\truntime: 'both',\n\texecute: async (input, ctx) => PineconeClient.fromContext(ctx).upsert(input)\n})\n\nexport const pineconeQueryTool = defineTool({\n\tid: 'pinecone-query',\n\tname: 'pineconeQuery',\n\tdescription: 'Nearest-neighbor query against the bound Pinecone index.',\n\tinputSchema: queryVectorsInputSchema,\n\toutputSchema: queryVectorsOutputSchema,\n\tsideEffect: 'read',\n\truntime: 'both',\n\texecute: async (input, ctx) => PineconeClient.fromContext(ctx).query(input)\n})\n\nexport const pineconeDeleteTool = defineTool({\n\tid: 'pinecone-delete',\n\tname: 'pineconeDelete',\n\tdescription: 'Delete vectors by id from the bound Pinecone index.',\n\tinputSchema: deleteVectorsInputSchema,\n\toutputSchema: deleteVectorsOutputSchema,\n\tsideEffect: 'delete',\n\truntime: 'both',\n\texecute: async (input, ctx) => PineconeClient.fromContext(ctx).delete(input)\n})\n\nexport const pineconeModule = defineModule({\n\tid: 'pinecone',\n\ttitle: 'Pinecone',\n\tdescription: 'Pinecone data-plane REST: upsert, query, and delete vectors in a bound index.',\n\truntime: 'both',\n\tauth: { type: 'custom', schema: pineconeAuthSchema },\n\tcategories: ['ai', 'vector'],\n\tclassification: 'pii',\n\ttags: ['pinecone'],\n\ttools: [pineconeUpsertTool, pineconeQueryTool, pineconeD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AW;CAC5C,IAAI;CACJ,MAAM;CACN,aACC;CACD,aAAa;CACb,cAAc;CACd,YAAY;CACZ,SAAS;CACT,SAAS,OAAO,OAAO,QAAQ,eAAe,YAAY,GAAG,CAAC,CAAC,OAAO,KAAK;AAC5E,CAAC;AAED,MAAa,oBAAoB,WAAW;CAC3C,IAAI;CACJ,MAAM;CACN,aAAa;CACb,aAAa;CACb,cAAc;CACd,YAAY;CACZ,SAAS;CACT,SAAS,OAAO,OAAO,QAAQ,eAAe,YAAY,GAAG,CAAC,CAAC,MAAM,KAAK;AAC3E,CAAC;AAED,MAAa,qBAAqB,WAAW;CAC5C,IAAI;CACJ,MAAM;CACN,aAAa;CACb,aAAa;CACb,cAAc;CACd,YAAY;CACZ,SAAS;CACT,SAAS,OAAO,OAAO,QAAQ,eAAe,YAAY,GAAG,CAAC,CAAC,OAAO,KAAK;AAC5E,CAAC;AAED,MAAa,iBAAiB,aAAa;CAC1C,IAAI;CACJ,OAAO;CACP,aAAa;CACb,SAAS;CACT,MAAM;EAAE,MAAM;EAAU,QAAQ;CAAmB;CACnD,YAAY,CAAC,MAAM,QAAQ;CAC3B,gBAAgB;CAChB,MAAM,CAAC,UAAU;CACjB,OAAO;EAAC;EAAoB;EAAmB;CAAkB;AAClE,CAAC"}
1
+ {"version":3,"file":"pinecone-BvdXAZMi.js","names":["#http","#defaultNamespace","#defaultFilter","#namespace"],"sources":["../src/vendors/pinecone/contracts.ts","../src/vendors/pinecone/client.ts","../src/vendors/pinecone/module.ts"],"sourcesContent":["import { z } from 'zod'\n\nimport { vectorDefaultFilterSchema } from '../_vector'\n\nexport {\n\tMAX_TOP_K,\n\tMAX_VECTOR_BATCH,\n\tMAX_VECTOR_DIMENSIONS,\n\tdeleteVectorsInputSchema,\n\tdeleteVectorsOutputSchema,\n\tqueryVectorsInputSchema,\n\tqueryVectorsOutputSchema,\n\tupsertVectorsInputSchema,\n\tupsertVectorsOutputSchema,\n\tvectorMatchSchema,\n\tvectorMetadataSchema,\n\tvectorPointSchema\n} from '../_vector'\nexport type {\n\tDeleteVectorsInput,\n\tDeleteVectorsOutput,\n\tQueryVectorsInput,\n\tQueryVectorsOutput,\n\tUpsertVectorsInput,\n\tUpsertVectorsOutput,\n\tVectorMatch,\n\tVectorMetadata,\n\tVectorPoint\n} from '../_vector'\n\nexport const pineconeAuthSchema = z.object({\n\tapi_key: z.string().min(1).describe('Pinecone API key'),\n\tbase_url: z.string().url().describe('Pinecone index data-plane origin, for example https://xxxx.svc.….pinecone.io'),\n\tdefault_namespace: z\n\t\t.string()\n\t\t.min(1)\n\t\t.optional()\n\t\t.describe('Locked Pinecone namespace for all calls when set (tool cannot switch away)'),\n\tdefault_filter: vectorDefaultFilterSchema\n\t\t.optional()\n\t\t.describe('Host-bound metadata filter always applied on query; flat keys stamped on upsert')\n})\n\nexport type PineconeAuth = z.infer<typeof pineconeAuthSchema>\n","/**\n * Pinecone data-plane REST vendor client.\n * Host: `new PineconeClient(auth)`. Agent tools: `fromContext(ctx)`.\n * @see https://docs.pinecone.io/reference/api/data-plane\n */\n\nimport { isNumber, isPlainObject } from 'es-toolkit'\n\nimport { ToolError } from '../../core/errors'\nimport { requireAuth } from '../../core/provider'\nimport type { ToolContext } from '../../core/types'\nimport { HttpService } from '../../transport/http-service'\nimport type { HttpServiceOptions } from '../../transport/http-service'\nimport {\n\tmapVectorHttpStatus,\n\tmergeVectorFilter,\n\tparseMetadata,\n\tparseNumberArray,\n\tparsePointId,\n\tparseUpstreamMessage,\n\tresolveVectorNamespace,\n\tstampDefaultFilterMetadata\n} from '../_vector/domain'\nimport type { VectorDefaultFilter } from '../_vector/domain'\nimport type {\n\tDeleteVectorsInput,\n\tDeleteVectorsOutput,\n\tPineconeAuth,\n\tQueryVectorsInput,\n\tQueryVectorsOutput,\n\tUpsertVectorsInput,\n\tUpsertVectorsOutput,\n\tVectorMatch\n} from './contracts'\nimport { pineconeAuthSchema } from './contracts'\n\nexport type PineconeClientOptions = {\n\tfetch?: HttpServiceOptions['fetch'] | undefined\n\tsignal?: HttpServiceOptions['signal'] | undefined\n}\n\nexport class PineconeClient {\n\treadonly #http: HttpService\n\treadonly #defaultNamespace: string | undefined\n\treadonly #defaultFilter: VectorDefaultFilter | undefined\n\n\tconstructor(auth: PineconeAuth, options: PineconeClientOptions = {}) {\n\t\tconst parsed = pineconeAuthSchema.safeParse(auth)\n\t\tif (!parsed.success) {\n\t\t\tthrow new ToolError('Invalid Pinecone auth credentials', {\n\t\t\t\tcode: 'bad_auth',\n\t\t\t\tdetails: { issues: parsed.error.issues.map((issue) => issue.message) }\n\t\t\t})\n\t\t}\n\t\tthis.#defaultNamespace = parsed.data.default_namespace\n\t\tthis.#defaultFilter = parsed.data.default_filter\n\t\tconst httpOptions: HttpServiceOptions = {\n\t\t\tbaseURL: parsed.data.base_url,\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t'Api-Key': parsed.data.api_key\n\t\t\t},\n\t\t\tlabel: 'Pinecone'\n\t\t}\n\t\tif (options.fetch) httpOptions.fetch = options.fetch\n\t\tif (options.signal) httpOptions.signal = options.signal\n\t\tthis.#http = new HttpService(httpOptions)\n\t}\n\n\tstatic fromContext(ctx: ToolContext): PineconeClient {\n\t\tconst auth = requireAuth(ctx, pineconeAuthSchema)\n\t\tconst options: PineconeClientOptions = {}\n\t\tif (ctx.fetch) options.fetch = ctx.fetch\n\t\tif (ctx.signal) options.signal = ctx.signal\n\t\treturn new PineconeClient(auth, options)\n\t}\n\n\t#namespace(toolNamespace: string | undefined): string | undefined {\n\t\treturn resolveVectorNamespace(this.#defaultNamespace, toolNamespace)\n\t}\n\n\tasync upsert(input: UpsertVectorsInput): Promise<UpsertVectorsOutput> {\n\t\tconst body: Record<string, unknown> = {\n\t\t\tvectors: input.vectors.map((point) => {\n\t\t\t\tconst metadata = stampDefaultFilterMetadata(point.metadata, this.#defaultFilter)\n\t\t\t\tconst row: Record<string, unknown> = { id: point.id, values: point.values }\n\t\t\t\tif (metadata) row['metadata'] = metadata\n\t\t\t\treturn row\n\t\t\t})\n\t\t}\n\t\tconst ns = this.#namespace(input.namespace)\n\t\tif (ns) body['namespace'] = ns\n\n\t\tconst res = await this.#http.post('/vectors/upsert', body, {\n\t\t\tlabel: 'Pinecone upsert',\n\t\t\tnoThrow: true\n\t\t})\n\t\tif (!res.ok) {\n\t\t\tthrow new ToolError(parseUpstreamMessage(res.data, `Pinecone upsert failed with HTTP ${res.status}`), {\n\t\t\t\tcode: mapVectorHttpStatus(res.status),\n\t\t\t\tdetails: { status: res.status }\n\t\t\t})\n\t\t}\n\t\tconst upserted =\n\t\t\tisPlainObject(res.data) && isNumber(res.data['upsertedCount']) ? res.data['upsertedCount'] : input.vectors.length\n\t\treturn { upserted }\n\t}\n\n\tasync query(input: QueryVectorsInput): Promise<QueryVectorsOutput> {\n\t\tconst topK = input.top_k ?? 8\n\t\tconst includeMetadata = input.include_metadata !== false\n\t\tconst body: Record<string, unknown> = {\n\t\t\tvector: input.vector,\n\t\t\ttopK,\n\t\t\tincludeMetadata,\n\t\t\tincludeValues: input.include_values === true\n\t\t}\n\t\tconst ns = this.#namespace(input.namespace)\n\t\tif (ns) body['namespace'] = ns\n\t\tconst filter = mergeVectorFilter(this.#defaultFilter, input.filter)\n\t\tif (filter) body['filter'] = filter\n\n\t\tconst res = await this.#http.post('/query', body, { label: 'Pinecone query', noThrow: true })\n\t\tif (!res.ok) {\n\t\t\tthrow new ToolError(parseUpstreamMessage(res.data, `Pinecone query failed with HTTP ${res.status}`), {\n\t\t\t\tcode: mapVectorHttpStatus(res.status),\n\t\t\t\tdetails: { status: res.status }\n\t\t\t})\n\t\t}\n\n\t\tconst matchesRaw = isPlainObject(res.data) ? res.data['matches'] : undefined\n\t\tconst rows = Array.isArray(matchesRaw) ? matchesRaw : []\n\t\tconst matches: VectorMatch[] = []\n\t\tfor (const row of rows) {\n\t\t\tif (!isPlainObject(row)) continue\n\t\t\tconst id = parsePointId(row['id'])\n\t\t\tif (!id) continue\n\t\t\tconst score = isNumber(row['score']) ? row['score'] : 0\n\t\t\tconst match: VectorMatch = { id, score }\n\t\t\tif (includeMetadata) {\n\t\t\t\tconst meta = parseMetadata(row['metadata'])\n\t\t\t\tif (meta) match.metadata = meta\n\t\t\t}\n\t\t\tif (input.include_values === true) {\n\t\t\t\tconst values = parseNumberArray(row['values'])\n\t\t\t\tif (values) match.values = values\n\t\t\t}\n\t\t\tmatches.push(match)\n\t\t}\n\t\treturn { matches }\n\t}\n\n\tasync delete(input: DeleteVectorsInput): Promise<DeleteVectorsOutput> {\n\t\tconst body: Record<string, unknown> = { ids: input.ids }\n\t\tconst ns = this.#namespace(input.namespace)\n\t\tif (ns) body['namespace'] = ns\n\n\t\tconst res = await this.#http.post('/vectors/delete', body, {\n\t\t\tlabel: 'Pinecone delete',\n\t\t\tnoThrow: true\n\t\t})\n\t\tif (!res.ok) {\n\t\t\tthrow new ToolError(parseUpstreamMessage(res.data, `Pinecone delete failed with HTTP ${res.status}`), {\n\t\t\t\tcode: mapVectorHttpStatus(res.status),\n\t\t\t\tdetails: { status: res.status }\n\t\t\t})\n\t\t}\n\t\treturn { deleted: input.ids.length }\n\t}\n}\n","import { defineModule, defineTool } from '../../core/define'\nimport { PineconeClient } from './client'\nimport {\n\tdeleteVectorsInputSchema,\n\tdeleteVectorsOutputSchema,\n\tpineconeAuthSchema,\n\tqueryVectorsInputSchema,\n\tqueryVectorsOutputSchema,\n\tupsertVectorsInputSchema,\n\tupsertVectorsOutputSchema\n} from './contracts'\n\nexport const pineconeUpsertTool = defineTool({\n\tid: 'pinecone-upsert',\n\tname: 'pineconeUpsert',\n\tdescription:\n\t\t'Upsert vectors into the configured Pinecone index. Use the optional namespace only when data must be isolated within the index.',\n\tinputSchema: upsertVectorsInputSchema,\n\toutputSchema: upsertVectorsOutputSchema,\n\tsideEffect: 'write',\n\truntime: 'both',\n\texecute: async (input, ctx) => PineconeClient.fromContext(ctx).upsert(input)\n})\n\nexport const pineconeQueryTool = defineTool({\n\tid: 'pinecone-query',\n\tname: 'pineconeQuery',\n\tdescription: 'Nearest-neighbor query against the bound Pinecone index.',\n\tinputSchema: queryVectorsInputSchema,\n\toutputSchema: queryVectorsOutputSchema,\n\tsideEffect: 'read',\n\truntime: 'both',\n\texecute: async (input, ctx) => PineconeClient.fromContext(ctx).query(input)\n})\n\nexport const pineconeDeleteTool = defineTool({\n\tid: 'pinecone-delete',\n\tname: 'pineconeDelete',\n\tdescription: 'Delete vectors by id from the bound Pinecone index.',\n\tinputSchema: deleteVectorsInputSchema,\n\toutputSchema: deleteVectorsOutputSchema,\n\tsideEffect: 'delete',\n\truntime: 'both',\n\texecute: async (input, ctx) => PineconeClient.fromContext(ctx).delete(input)\n})\n\nexport const pineconeModule = defineModule({\n\tid: 'pinecone',\n\ttitle: 'Pinecone',\n\tdescription: 'Pinecone data-plane REST: upsert, query, and delete vectors in a bound index.',\n\truntime: 'both',\n\tauth: { type: 'custom', schema: pineconeAuthSchema },\n\tcategories: ['ai', 'vector'],\n\tclassification: 'pii',\n\ttags: ['pinecone'],\n\ttools: [pineconeUpsertTool, pineconeQueryTool, pineconeDeleteTool]\n})\n"],"mappings":";;;;;;;;AA8BA,MAAa,qBAAqB,EAAE,OAAO;CAC1C,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,kBAAkB;CACtD,UAAU,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,8EAA8E;CAClH,mBAAmB,EACjB,OAAO,CAAC,CACR,IAAI,CAAC,CAAC,CACN,SAAS,CAAC,CACV,SAAS,4EAA4E;CACvF,gBAAgB,0BACd,SAAS,CAAC,CACV,SAAS,iFAAiF;AAC7F,CAAC;;;;;;;;ACAD,IAAa,iBAAb,MAAa,eAAe;CAC3B;CACA;CACA;CAEA,YAAY,MAAoB,UAAiC,CAAC,GAAG;EACpE,MAAM,SAAS,mBAAmB,UAAU,IAAI;EAChD,IAAI,CAAC,OAAO,SACX,MAAM,IAAI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AC5E,CAAC;AAED,MAAa,iBAAiB,aAAa;CAC1C,IAAI;CACJ,OAAO;CACP,aAAa;CACb,SAAS;CACT,MAAM;EAAE,MAAM;EAAU,QAAQ;CAAmB;CACnD,YAAY,CAAC,MAAM,QAAQ;CAC3B,gBAAgB;CAChB,MAAM,CAAC,UAAU;CACjB,OAAO;EAAC;EAAoB;EAAmB;CAAkB;AAClE,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { t as ToolError } from "./errors-DoSpNHvs.js";
2
2
  import { n as defineModule, r as defineTool } from "./define-ieoksEQ0.js";
3
3
  import { n as requireAuth } from "./provider-CgDAlg6K.js";
4
- import { t as HttpService } from "./http-service-DDNCO1s4.js";
4
+ import { t as HttpService } from "./http-service-BMBIryAL.js";
5
5
  import { S as requireCollection, _ as parseMetadata, a as deleteVectorsOutputSchema, c as upsertVectorsInputSchema, h as mergeQdrantFilter, i as deleteVectorsInputSchema, l as upsertVectorsOutputSchema, m as mapVectorHttpStatus, o as queryVectorsInputSchema, s as queryVectorsOutputSchema, u as vectorDefaultFilterSchema, v as parseNumberArray, w as stampDefaultFilterMetadata, x as parseUpstreamMessage, y as parsePointId } from "./schemas-ChOAhdo9.js";
6
6
  import { isNumber, isPlainObject, isString } from "es-toolkit";
7
7
  import { z } from "zod";
@@ -250,4 +250,4 @@ const qdrantModule = defineModule({
250
250
  //#endregion
251
251
  export { QdrantClient as a, qdrantUpsertTool as i, qdrantModule as n, qdrantAuthSchema as o, qdrantQueryTool as r, qdrantDeleteTool as t };
252
252
 
253
- //# sourceMappingURL=qdrant-R_FIcG9d.js.map
253
+ //# sourceMappingURL=qdrant-D2E2Lxrw.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"qdrant-R_FIcG9d.js","names":["#http","#defaultCollection","#defaultFilter"],"sources":["../src/vendors/qdrant/contracts.ts","../src/vendors/qdrant/domain.ts","../src/vendors/qdrant/client.ts","../src/vendors/qdrant/module.ts"],"sourcesContent":["import { z } from 'zod'\n\nimport { vectorDefaultFilterSchema } from '../_vector'\n\nexport {\n\tMAX_TOP_K,\n\tMAX_VECTOR_BATCH,\n\tMAX_VECTOR_DIMENSIONS,\n\tdeleteVectorsInputSchema,\n\tdeleteVectorsOutputSchema,\n\tqueryVectorsInputSchema,\n\tqueryVectorsOutputSchema,\n\tupsertVectorsInputSchema,\n\tupsertVectorsOutputSchema,\n\tvectorMatchSchema,\n\tvectorMetadataSchema,\n\tvectorPointSchema\n} from '../_vector'\nexport type {\n\tDeleteVectorsInput,\n\tDeleteVectorsOutput,\n\tQueryVectorsInput,\n\tQueryVectorsOutput,\n\tUpsertVectorsInput,\n\tUpsertVectorsOutput,\n\tVectorMatch,\n\tVectorMetadata,\n\tVectorPoint\n} from '../_vector'\n\nexport const qdrantAuthSchema = z.object({\n\tbase_url: z\n\t\t.string()\n\t\t.url()\n\t\t.describe('Qdrant HTTP origin, for example http://127.0.0.1:6333 or https://xxx.cloud.qdrant.io'),\n\tapi_key: z.string().min(1).optional().describe('Optional Qdrant API key'),\n\tdefault_collection: z.string().min(1).optional().describe('Default collection name when tool input omits collection'),\n\tdefault_filter: vectorDefaultFilterSchema\n\t\t.optional()\n\t\t.describe(\n\t\t\t'Host-bound filter always applied on query (flat equality or native Qdrant must/should); flat keys stamped on upsert'\n\t\t)\n})\n\nexport type QdrantAuth = z.infer<typeof qdrantAuthSchema>\n","/**\n * Qdrant point-id helpers. Qdrant only accepts unsigned integers or UUIDs;\n * free-form string ids (e.g. RAG `doc#0`) are mapped to a deterministic UUID\n * and the original id is stored under `__logical_id` in the payload.\n */\n\nimport { createHash } from 'node:crypto'\n\nimport { isString } from 'es-toolkit'\n\nexport const QDRANT_LOGICAL_ID_KEY = '__logical_id'\n\nconst UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i\nconst UINT_RE = /^(0|[1-9]\\d*)$/\n\n/** Deterministic UUID (SHA-256 → RFC-like layout) for free-form logical ids. */\nexport function hashToUuid(value: string): string {\n\tconst bytes = Uint8Array.from(createHash('sha256').update(value).digest().subarray(0, 16))\n\tconst versionByte = bytes.at(6)\n\tconst variantByte = bytes.at(8)\n\tif (versionByte === undefined || variantByte === undefined) {\n\t\tthrow new Error('SHA-256 digest shorter than 16 bytes')\n\t}\n\tbytes[6] = (versionByte & 0x0f) | 0x50\n\tbytes[8] = (variantByte & 0x3f) | 0x80\n\tconst hex = Buffer.from(bytes).toString('hex')\n\treturn `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20, 32)}`\n}\n\n/** Map package logical point id → Qdrant wire id. */\nexport function toQdrantPointId(logicalId: string): string | number {\n\tif (UINT_RE.test(logicalId)) {\n\t\tconst n = Number(logicalId)\n\t\tif (Number.isSafeInteger(n) && n >= 0) return n\n\t}\n\tif (UUID_RE.test(logicalId)) return logicalId.toLowerCase()\n\treturn hashToUuid(logicalId)\n}\n\nexport function isNativeQdrantId(logicalId: string): boolean {\n\tif (UINT_RE.test(logicalId)) {\n\t\tconst n = Number(logicalId)\n\t\treturn Number.isSafeInteger(n) && n >= 0\n\t}\n\treturn UUID_RE.test(logicalId)\n}\n\n/** Prefer payload `__logical_id` when present so free-form ids round-trip. */\nexport function resolveLogicalPointId(wireId: string, payload: Record<string, unknown> | undefined): string {\n\tconst logical = payload?.[QDRANT_LOGICAL_ID_KEY]\n\tif (isString(logical) && logical.length > 0) return logical\n\treturn wireId\n}\n\nexport function stripLogicalIdPayload(\n\tpayload: Record<string, string | number | boolean | null> | undefined\n): Record<string, string | number | boolean | null> | undefined {\n\tif (!payload) return undefined\n\tif (!(QDRANT_LOGICAL_ID_KEY in payload)) return payload\n\tconst next: Record<string, string | number | boolean | null> = {}\n\tfor (const [key, value] of Object.entries(payload)) {\n\t\tif (key === QDRANT_LOGICAL_ID_KEY) continue\n\t\tnext[key] = value\n\t}\n\treturn Object.keys(next).length > 0 ? next : undefined\n}\n","/**\n * Qdrant REST vendor client.\n * Host: `new QdrantClient(auth)`. Agent tools: `fromContext(ctx)`.\n * @see https://api.qdrant.tech/api-reference\n */\n\nimport { isNumber, isPlainObject } from 'es-toolkit'\n\nimport { ToolError } from '../../core/errors'\nimport { requireAuth } from '../../core/provider'\nimport type { ToolContext } from '../../core/types'\nimport { HttpService } from '../../transport/http-service'\nimport type { HttpServiceOptions } from '../../transport/http-service'\nimport {\n\tmapVectorHttpStatus,\n\tmergeQdrantFilter,\n\tparseMetadata,\n\tparseNumberArray,\n\tparsePointId,\n\tparseUpstreamMessage,\n\trequireCollection,\n\tstampDefaultFilterMetadata\n} from '../_vector/domain'\nimport type { VectorDefaultFilter } from '../_vector/domain'\nimport type {\n\tDeleteVectorsInput,\n\tDeleteVectorsOutput,\n\tQdrantAuth,\n\tQueryVectorsInput,\n\tQueryVectorsOutput,\n\tUpsertVectorsInput,\n\tUpsertVectorsOutput,\n\tVectorMatch\n} from './contracts'\nimport { qdrantAuthSchema } from './contracts'\nimport {\n\tisNativeQdrantId,\n\tQDRANT_LOGICAL_ID_KEY,\n\tresolveLogicalPointId,\n\tstripLogicalIdPayload,\n\ttoQdrantPointId\n} from './domain'\n\nexport type QdrantClientOptions = {\n\tfetch?: HttpServiceOptions['fetch'] | undefined\n\tsignal?: HttpServiceOptions['signal'] | undefined\n}\n\nexport class QdrantClient {\n\treadonly #http: HttpService\n\treadonly #defaultCollection: string | undefined\n\treadonly #defaultFilter: VectorDefaultFilter | undefined\n\n\tconstructor(auth: QdrantAuth, options: QdrantClientOptions = {}) {\n\t\tconst parsed = qdrantAuthSchema.safeParse(auth)\n\t\tif (!parsed.success) {\n\t\t\tthrow new ToolError('Invalid Qdrant auth credentials', {\n\t\t\t\tcode: 'bad_auth',\n\t\t\t\tdetails: { issues: parsed.error.issues.map((issue) => issue.message) }\n\t\t\t})\n\t\t}\n\t\tthis.#defaultCollection = parsed.data.default_collection\n\t\tthis.#defaultFilter = parsed.data.default_filter\n\t\tconst headers: Record<string, string> = { 'Content-Type': 'application/json' }\n\t\tif (parsed.data.api_key) headers['api-key'] = parsed.data.api_key\n\t\tconst httpOptions: HttpServiceOptions = {\n\t\t\tbaseURL: parsed.data.base_url,\n\t\t\theaders,\n\t\t\tlabel: 'Qdrant'\n\t\t}\n\t\tif (options.fetch) httpOptions.fetch = options.fetch\n\t\tif (options.signal) httpOptions.signal = options.signal\n\t\tthis.#http = new HttpService(httpOptions)\n\t}\n\n\tstatic fromContext(ctx: ToolContext): QdrantClient {\n\t\tconst auth = requireAuth(ctx, qdrantAuthSchema)\n\t\tconst options: QdrantClientOptions = {}\n\t\tif (ctx.fetch) options.fetch = ctx.fetch\n\t\tif (ctx.signal) options.signal = ctx.signal\n\t\treturn new QdrantClient(auth, options)\n\t}\n\n\tasync upsert(input: UpsertVectorsInput): Promise<UpsertVectorsOutput> {\n\t\tconst collection = requireCollection(input.collection, this.#defaultCollection, 'Qdrant upsert')\n\t\tconst points = input.vectors.map((point) => {\n\t\t\tconst wireId = toQdrantPointId(point.id)\n\t\t\tconst stamped = stampDefaultFilterMetadata(point.metadata, this.#defaultFilter)\n\t\t\tconst payload: Record<string, string | number | boolean | null> = stamped ? { ...stamped } : {}\n\t\t\tif (!isNativeQdrantId(point.id)) {\n\t\t\t\tpayload[QDRANT_LOGICAL_ID_KEY] = point.id\n\t\t\t}\n\t\t\tconst row: Record<string, unknown> = { id: wireId, vector: point.values }\n\t\t\tif (Object.keys(payload).length > 0) row['payload'] = payload\n\t\t\treturn row\n\t\t})\n\t\tconst res = await this.#http.put(\n\t\t\t`/collections/${encodeURIComponent(collection)}/points`,\n\t\t\t{ points },\n\t\t\t{ label: 'Qdrant upsert', noThrow: true, query: { wait: 'true' } }\n\t\t)\n\t\tif (!res.ok) {\n\t\t\tthrow new ToolError(parseUpstreamMessage(res.data, `Qdrant upsert failed with HTTP ${res.status}`), {\n\t\t\t\tcode: mapVectorHttpStatus(res.status),\n\t\t\t\tdetails: { status: res.status }\n\t\t\t})\n\t\t}\n\t\treturn { upserted: input.vectors.length, collection }\n\t}\n\n\tasync query(input: QueryVectorsInput): Promise<QueryVectorsOutput> {\n\t\tconst collection = requireCollection(input.collection, this.#defaultCollection, 'Qdrant query')\n\t\tconst topK = input.top_k ?? 8\n\t\tconst includeMetadata = input.include_metadata !== false\n\t\t// Always pull payload so free-form logical ids can be restored.\n\t\tconst body: Record<string, unknown> = {\n\t\t\tvector: input.vector,\n\t\t\tlimit: topK,\n\t\t\twith_payload: true,\n\t\t\twith_vector: input.include_values === true\n\t\t}\n\t\tconst filter = mergeQdrantFilter(this.#defaultFilter, input.filter)\n\t\tif (filter) body['filter'] = filter\n\n\t\tconst res = await this.#http.post(`/collections/${encodeURIComponent(collection)}/points/search`, body, {\n\t\t\tlabel: 'Qdrant search',\n\t\t\tnoThrow: true\n\t\t})\n\t\tif (!res.ok) {\n\t\t\tthrow new ToolError(parseUpstreamMessage(res.data, `Qdrant search failed with HTTP ${res.status}`), {\n\t\t\t\tcode: mapVectorHttpStatus(res.status),\n\t\t\t\tdetails: { status: res.status }\n\t\t\t})\n\t\t}\n\n\t\tconst result = isPlainObject(res.data) ? res.data['result'] : undefined\n\t\tconst rows = Array.isArray(result) ? result : []\n\t\tconst matches: VectorMatch[] = []\n\t\tfor (const row of rows) {\n\t\t\tif (!isPlainObject(row)) continue\n\t\t\tconst wireId = parsePointId(row['id'])\n\t\t\tif (!wireId) continue\n\t\t\tconst rawPayload = isPlainObject(row['payload']) ? row['payload'] : undefined\n\t\t\tconst score = isNumber(row['score']) ? row['score'] : 0\n\t\t\tconst id = resolveLogicalPointId(wireId, rawPayload)\n\t\t\tconst match: VectorMatch = { id, score }\n\t\t\tif (includeMetadata) {\n\t\t\t\tconst meta = stripLogicalIdPayload(parseMetadata(row['payload']))\n\t\t\t\tif (meta) match.metadata = meta\n\t\t\t}\n\t\t\tif (input.include_values === true) {\n\t\t\t\tconst values = parseNumberArray(row['vector'])\n\t\t\t\tif (values) match.values = values\n\t\t\t}\n\t\t\tmatches.push(match)\n\t\t}\n\t\treturn { matches, collection }\n\t}\n\n\tasync delete(input: DeleteVectorsInput): Promise<DeleteVectorsOutput> {\n\t\tconst collection = requireCollection(input.collection, this.#defaultCollection, 'Qdrant delete')\n\t\tconst points = input.ids.map((id) => toQdrantPointId(id))\n\t\tconst res = await this.#http.post(\n\t\t\t`/collections/${encodeURIComponent(collection)}/points/delete`,\n\t\t\t{ points },\n\t\t\t{ label: 'Qdrant delete', noThrow: true, query: { wait: 'true' } }\n\t\t)\n\t\tif (!res.ok) {\n\t\t\tthrow new ToolError(parseUpstreamMessage(res.data, `Qdrant delete failed with HTTP ${res.status}`), {\n\t\t\t\tcode: mapVectorHttpStatus(res.status),\n\t\t\t\tdetails: { status: res.status }\n\t\t\t})\n\t\t}\n\t\treturn { deleted: input.ids.length, collection }\n\t}\n}\n","import { defineModule, defineTool } from '../../core/define'\nimport { QdrantClient } from './client'\nimport {\n\tdeleteVectorsInputSchema,\n\tdeleteVectorsOutputSchema,\n\tqdrantAuthSchema,\n\tqueryVectorsInputSchema,\n\tqueryVectorsOutputSchema,\n\tupsertVectorsInputSchema,\n\tupsertVectorsOutputSchema\n} from './contracts'\n\nexport const qdrantUpsertTool = defineTool({\n\tid: 'qdrant-upsert',\n\tname: 'qdrantUpsert',\n\tdescription: 'Upsert points into a Qdrant collection. Omit collection only when a default collection is configured.',\n\tinputSchema: upsertVectorsInputSchema,\n\toutputSchema: upsertVectorsOutputSchema,\n\tsideEffect: 'write',\n\truntime: 'both',\n\texecute: async (input, ctx) => QdrantClient.fromContext(ctx).upsert(input)\n})\n\nexport const qdrantQueryTool = defineTool({\n\tid: 'qdrant-query',\n\tname: 'qdrantQuery',\n\tdescription: 'Nearest-neighbor search in a Qdrant collection.',\n\tinputSchema: queryVectorsInputSchema,\n\toutputSchema: queryVectorsOutputSchema,\n\tsideEffect: 'read',\n\truntime: 'both',\n\texecute: async (input, ctx) => QdrantClient.fromContext(ctx).query(input)\n})\n\nexport const qdrantDeleteTool = defineTool({\n\tid: 'qdrant-delete',\n\tname: 'qdrantDelete',\n\tdescription: 'Delete points by id from a Qdrant collection.',\n\tinputSchema: deleteVectorsInputSchema,\n\toutputSchema: deleteVectorsOutputSchema,\n\tsideEffect: 'delete',\n\truntime: 'both',\n\texecute: async (input, ctx) => QdrantClient.fromContext(ctx).delete(input)\n})\n\nexport const qdrantModule = defineModule({\n\tid: 'qdrant',\n\ttitle: 'Qdrant',\n\tdescription: 'Qdrant vector database REST: upsert, query, and delete points in a collection.',\n\truntime: 'both',\n\tauth: { type: 'custom', schema: qdrantAuthSchema },\n\tcategories: ['ai', 'vector'],\n\tclassification: 'pii',\n\ttags: ['qdrant'],\n\ttools: [qdrantUpsertTool, qdrantQueryTool, qdrantDeleteTool]\n})\n"],"mappings":";;;;;;;;;AA8BA,MAAa,mBAAmB,EAAE,OAAO;CACxC,UAAU,EACR,OAAO,CAAC,CACR,IAAI,CAAC,CACL,SAAS,sFAAsF;CACjG,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,yBAAyB;CACxE,oBAAoB,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,0DAA0D;CACpH,gBAAgB,0BACd,SAAS,CAAC,CACV,SACA,qHACD;AACF,CAAC;;;;;;;;AChCD,MAAa,wBAAwB;AAErC,MAAM,UAAU;AAChB,MAAM,UAAU;;AAGhB,SAAgB,WAAW,OAAuB;CACjD,MAAM,QAAQ,WAAW,KAAK,WAAW,QAAQ,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,SAAS,GAAG,EAAE,CAAC;CACzF,MAAM,cAAc,MAAM,GAAG,CAAC;CAC9B,MAAM,cAAc,MAAM,GAAG,CAAC;CAC9B,IAAI,gBAAgB,KAAA,KAAa,gBAAgB,KAAA,GAChD,MAAM,IAAI,MAAM,sCAAsC;CAEvD,MAAM,KAAM,cAAc,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ACb,aAAa;CACb,cAAc;CACd,YAAY;CACZ,SAAS;CACT,SAAS,OAAO,OAAO,QAAQ,aAAa,YAAY,GAAG,CAAC,CAAC,OAAO,KAAK;AAC1E,CAAC;AAED,MAAa,kBAAkB,WAAW;CACzC,IAAI;CACJ,MAAM;CACN,aAAa;CACb,aAAa;CACb,cAAc;CACd,YAAY;CACZ,SAAS;CACT,SAAS,OAAO,OAAO,QAAQ,aAAa,YAAY,GAAG,CAAC,CAAC,MAAM,KAAK;AACzE,CAAC;AAED,MAAa,mBAAmB,WAAW;CAC1C,IAAI;CACJ,MAAM;CACN,aAAa;CACb,aAAa;CACb,cAAc;CACd,YAAY;CACZ,SAAS;CACT,SAAS,OAAO,OAAO,QAAQ,aAAa,YAAY,GAAG,CAAC,CAAC,OAAO,KAAK;AAC1E,CAAC;AAED,MAAa,eAAe,aAAa;CACxC,IAAI;CACJ,OAAO;CACP,aAAa;CACb,SAAS;CACT,MAAM;EAAE,MAAM;EAAU,QAAQ;CAAiB;CACjD,YAAY,CAAC,MAAM,QAAQ;CAC3B,gBAAgB;CAChB,MAAM,CAAC,QAAQ;CACf,OAAO;EAAC;EAAkB;EAAiB;CAAgB;AAC5D,CAAC"}
1
+ {"version":3,"file":"qdrant-D2E2Lxrw.js","names":["#http","#defaultCollection","#defaultFilter"],"sources":["../src/vendors/qdrant/contracts.ts","../src/vendors/qdrant/domain.ts","../src/vendors/qdrant/client.ts","../src/vendors/qdrant/module.ts"],"sourcesContent":["import { z } from 'zod'\n\nimport { vectorDefaultFilterSchema } from '../_vector'\n\nexport {\n\tMAX_TOP_K,\n\tMAX_VECTOR_BATCH,\n\tMAX_VECTOR_DIMENSIONS,\n\tdeleteVectorsInputSchema,\n\tdeleteVectorsOutputSchema,\n\tqueryVectorsInputSchema,\n\tqueryVectorsOutputSchema,\n\tupsertVectorsInputSchema,\n\tupsertVectorsOutputSchema,\n\tvectorMatchSchema,\n\tvectorMetadataSchema,\n\tvectorPointSchema\n} from '../_vector'\nexport type {\n\tDeleteVectorsInput,\n\tDeleteVectorsOutput,\n\tQueryVectorsInput,\n\tQueryVectorsOutput,\n\tUpsertVectorsInput,\n\tUpsertVectorsOutput,\n\tVectorMatch,\n\tVectorMetadata,\n\tVectorPoint\n} from '../_vector'\n\nexport const qdrantAuthSchema = z.object({\n\tbase_url: z\n\t\t.string()\n\t\t.url()\n\t\t.describe('Qdrant HTTP origin, for example http://127.0.0.1:6333 or https://xxx.cloud.qdrant.io'),\n\tapi_key: z.string().min(1).optional().describe('Optional Qdrant API key'),\n\tdefault_collection: z.string().min(1).optional().describe('Default collection name when tool input omits collection'),\n\tdefault_filter: vectorDefaultFilterSchema\n\t\t.optional()\n\t\t.describe(\n\t\t\t'Host-bound filter always applied on query (flat equality or native Qdrant must/should); flat keys stamped on upsert'\n\t\t)\n})\n\nexport type QdrantAuth = z.infer<typeof qdrantAuthSchema>\n","/**\n * Qdrant point-id helpers. Qdrant only accepts unsigned integers or UUIDs;\n * free-form string ids (e.g. RAG `doc#0`) are mapped to a deterministic UUID\n * and the original id is stored under `__logical_id` in the payload.\n */\n\nimport { createHash } from 'node:crypto'\n\nimport { isString } from 'es-toolkit'\n\nexport const QDRANT_LOGICAL_ID_KEY = '__logical_id'\n\nconst UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i\nconst UINT_RE = /^(0|[1-9]\\d*)$/\n\n/** Deterministic UUID (SHA-256 → RFC-like layout) for free-form logical ids. */\nexport function hashToUuid(value: string): string {\n\tconst bytes = Uint8Array.from(createHash('sha256').update(value).digest().subarray(0, 16))\n\tconst versionByte = bytes.at(6)\n\tconst variantByte = bytes.at(8)\n\tif (versionByte === undefined || variantByte === undefined) {\n\t\tthrow new Error('SHA-256 digest shorter than 16 bytes')\n\t}\n\tbytes[6] = (versionByte & 0x0f) | 0x50\n\tbytes[8] = (variantByte & 0x3f) | 0x80\n\tconst hex = Buffer.from(bytes).toString('hex')\n\treturn `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20, 32)}`\n}\n\n/** Map package logical point id → Qdrant wire id. */\nexport function toQdrantPointId(logicalId: string): string | number {\n\tif (UINT_RE.test(logicalId)) {\n\t\tconst n = Number(logicalId)\n\t\tif (Number.isSafeInteger(n) && n >= 0) return n\n\t}\n\tif (UUID_RE.test(logicalId)) return logicalId.toLowerCase()\n\treturn hashToUuid(logicalId)\n}\n\nexport function isNativeQdrantId(logicalId: string): boolean {\n\tif (UINT_RE.test(logicalId)) {\n\t\tconst n = Number(logicalId)\n\t\treturn Number.isSafeInteger(n) && n >= 0\n\t}\n\treturn UUID_RE.test(logicalId)\n}\n\n/** Prefer payload `__logical_id` when present so free-form ids round-trip. */\nexport function resolveLogicalPointId(wireId: string, payload: Record<string, unknown> | undefined): string {\n\tconst logical = payload?.[QDRANT_LOGICAL_ID_KEY]\n\tif (isString(logical) && logical.length > 0) return logical\n\treturn wireId\n}\n\nexport function stripLogicalIdPayload(\n\tpayload: Record<string, string | number | boolean | null> | undefined\n): Record<string, string | number | boolean | null> | undefined {\n\tif (!payload) return undefined\n\tif (!(QDRANT_LOGICAL_ID_KEY in payload)) return payload\n\tconst next: Record<string, string | number | boolean | null> = {}\n\tfor (const [key, value] of Object.entries(payload)) {\n\t\tif (key === QDRANT_LOGICAL_ID_KEY) continue\n\t\tnext[key] = value\n\t}\n\treturn Object.keys(next).length > 0 ? next : undefined\n}\n","/**\n * Qdrant REST vendor client.\n * Host: `new QdrantClient(auth)`. Agent tools: `fromContext(ctx)`.\n * @see https://api.qdrant.tech/api-reference\n */\n\nimport { isNumber, isPlainObject } from 'es-toolkit'\n\nimport { ToolError } from '../../core/errors'\nimport { requireAuth } from '../../core/provider'\nimport type { ToolContext } from '../../core/types'\nimport { HttpService } from '../../transport/http-service'\nimport type { HttpServiceOptions } from '../../transport/http-service'\nimport {\n\tmapVectorHttpStatus,\n\tmergeQdrantFilter,\n\tparseMetadata,\n\tparseNumberArray,\n\tparsePointId,\n\tparseUpstreamMessage,\n\trequireCollection,\n\tstampDefaultFilterMetadata\n} from '../_vector/domain'\nimport type { VectorDefaultFilter } from '../_vector/domain'\nimport type {\n\tDeleteVectorsInput,\n\tDeleteVectorsOutput,\n\tQdrantAuth,\n\tQueryVectorsInput,\n\tQueryVectorsOutput,\n\tUpsertVectorsInput,\n\tUpsertVectorsOutput,\n\tVectorMatch\n} from './contracts'\nimport { qdrantAuthSchema } from './contracts'\nimport {\n\tisNativeQdrantId,\n\tQDRANT_LOGICAL_ID_KEY,\n\tresolveLogicalPointId,\n\tstripLogicalIdPayload,\n\ttoQdrantPointId\n} from './domain'\n\nexport type QdrantClientOptions = {\n\tfetch?: HttpServiceOptions['fetch'] | undefined\n\tsignal?: HttpServiceOptions['signal'] | undefined\n}\n\nexport class QdrantClient {\n\treadonly #http: HttpService\n\treadonly #defaultCollection: string | undefined\n\treadonly #defaultFilter: VectorDefaultFilter | undefined\n\n\tconstructor(auth: QdrantAuth, options: QdrantClientOptions = {}) {\n\t\tconst parsed = qdrantAuthSchema.safeParse(auth)\n\t\tif (!parsed.success) {\n\t\t\tthrow new ToolError('Invalid Qdrant auth credentials', {\n\t\t\t\tcode: 'bad_auth',\n\t\t\t\tdetails: { issues: parsed.error.issues.map((issue) => issue.message) }\n\t\t\t})\n\t\t}\n\t\tthis.#defaultCollection = parsed.data.default_collection\n\t\tthis.#defaultFilter = parsed.data.default_filter\n\t\tconst headers: Record<string, string> = { 'Content-Type': 'application/json' }\n\t\tif (parsed.data.api_key) headers['api-key'] = parsed.data.api_key\n\t\tconst httpOptions: HttpServiceOptions = {\n\t\t\tbaseURL: parsed.data.base_url,\n\t\t\theaders,\n\t\t\tlabel: 'Qdrant'\n\t\t}\n\t\tif (options.fetch) httpOptions.fetch = options.fetch\n\t\tif (options.signal) httpOptions.signal = options.signal\n\t\tthis.#http = new HttpService(httpOptions)\n\t}\n\n\tstatic fromContext(ctx: ToolContext): QdrantClient {\n\t\tconst auth = requireAuth(ctx, qdrantAuthSchema)\n\t\tconst options: QdrantClientOptions = {}\n\t\tif (ctx.fetch) options.fetch = ctx.fetch\n\t\tif (ctx.signal) options.signal = ctx.signal\n\t\treturn new QdrantClient(auth, options)\n\t}\n\n\tasync upsert(input: UpsertVectorsInput): Promise<UpsertVectorsOutput> {\n\t\tconst collection = requireCollection(input.collection, this.#defaultCollection, 'Qdrant upsert')\n\t\tconst points = input.vectors.map((point) => {\n\t\t\tconst wireId = toQdrantPointId(point.id)\n\t\t\tconst stamped = stampDefaultFilterMetadata(point.metadata, this.#defaultFilter)\n\t\t\tconst payload: Record<string, string | number | boolean | null> = stamped ? { ...stamped } : {}\n\t\t\tif (!isNativeQdrantId(point.id)) {\n\t\t\t\tpayload[QDRANT_LOGICAL_ID_KEY] = point.id\n\t\t\t}\n\t\t\tconst row: Record<string, unknown> = { id: wireId, vector: point.values }\n\t\t\tif (Object.keys(payload).length > 0) row['payload'] = payload\n\t\t\treturn row\n\t\t})\n\t\tconst res = await this.#http.put(\n\t\t\t`/collections/${encodeURIComponent(collection)}/points`,\n\t\t\t{ points },\n\t\t\t{ label: 'Qdrant upsert', noThrow: true, query: { wait: 'true' } }\n\t\t)\n\t\tif (!res.ok) {\n\t\t\tthrow new ToolError(parseUpstreamMessage(res.data, `Qdrant upsert failed with HTTP ${res.status}`), {\n\t\t\t\tcode: mapVectorHttpStatus(res.status),\n\t\t\t\tdetails: { status: res.status }\n\t\t\t})\n\t\t}\n\t\treturn { upserted: input.vectors.length, collection }\n\t}\n\n\tasync query(input: QueryVectorsInput): Promise<QueryVectorsOutput> {\n\t\tconst collection = requireCollection(input.collection, this.#defaultCollection, 'Qdrant query')\n\t\tconst topK = input.top_k ?? 8\n\t\tconst includeMetadata = input.include_metadata !== false\n\t\t// Always pull payload so free-form logical ids can be restored.\n\t\tconst body: Record<string, unknown> = {\n\t\t\tvector: input.vector,\n\t\t\tlimit: topK,\n\t\t\twith_payload: true,\n\t\t\twith_vector: input.include_values === true\n\t\t}\n\t\tconst filter = mergeQdrantFilter(this.#defaultFilter, input.filter)\n\t\tif (filter) body['filter'] = filter\n\n\t\tconst res = await this.#http.post(`/collections/${encodeURIComponent(collection)}/points/search`, body, {\n\t\t\tlabel: 'Qdrant search',\n\t\t\tnoThrow: true\n\t\t})\n\t\tif (!res.ok) {\n\t\t\tthrow new ToolError(parseUpstreamMessage(res.data, `Qdrant search failed with HTTP ${res.status}`), {\n\t\t\t\tcode: mapVectorHttpStatus(res.status),\n\t\t\t\tdetails: { status: res.status }\n\t\t\t})\n\t\t}\n\n\t\tconst result = isPlainObject(res.data) ? res.data['result'] : undefined\n\t\tconst rows = Array.isArray(result) ? result : []\n\t\tconst matches: VectorMatch[] = []\n\t\tfor (const row of rows) {\n\t\t\tif (!isPlainObject(row)) continue\n\t\t\tconst wireId = parsePointId(row['id'])\n\t\t\tif (!wireId) continue\n\t\t\tconst rawPayload = isPlainObject(row['payload']) ? row['payload'] : undefined\n\t\t\tconst score = isNumber(row['score']) ? row['score'] : 0\n\t\t\tconst id = resolveLogicalPointId(wireId, rawPayload)\n\t\t\tconst match: VectorMatch = { id, score }\n\t\t\tif (includeMetadata) {\n\t\t\t\tconst meta = stripLogicalIdPayload(parseMetadata(row['payload']))\n\t\t\t\tif (meta) match.metadata = meta\n\t\t\t}\n\t\t\tif (input.include_values === true) {\n\t\t\t\tconst values = parseNumberArray(row['vector'])\n\t\t\t\tif (values) match.values = values\n\t\t\t}\n\t\t\tmatches.push(match)\n\t\t}\n\t\treturn { matches, collection }\n\t}\n\n\tasync delete(input: DeleteVectorsInput): Promise<DeleteVectorsOutput> {\n\t\tconst collection = requireCollection(input.collection, this.#defaultCollection, 'Qdrant delete')\n\t\tconst points = input.ids.map((id) => toQdrantPointId(id))\n\t\tconst res = await this.#http.post(\n\t\t\t`/collections/${encodeURIComponent(collection)}/points/delete`,\n\t\t\t{ points },\n\t\t\t{ label: 'Qdrant delete', noThrow: true, query: { wait: 'true' } }\n\t\t)\n\t\tif (!res.ok) {\n\t\t\tthrow new ToolError(parseUpstreamMessage(res.data, `Qdrant delete failed with HTTP ${res.status}`), {\n\t\t\t\tcode: mapVectorHttpStatus(res.status),\n\t\t\t\tdetails: { status: res.status }\n\t\t\t})\n\t\t}\n\t\treturn { deleted: input.ids.length, collection }\n\t}\n}\n","import { defineModule, defineTool } from '../../core/define'\nimport { QdrantClient } from './client'\nimport {\n\tdeleteVectorsInputSchema,\n\tdeleteVectorsOutputSchema,\n\tqdrantAuthSchema,\n\tqueryVectorsInputSchema,\n\tqueryVectorsOutputSchema,\n\tupsertVectorsInputSchema,\n\tupsertVectorsOutputSchema\n} from './contracts'\n\nexport const qdrantUpsertTool = defineTool({\n\tid: 'qdrant-upsert',\n\tname: 'qdrantUpsert',\n\tdescription: 'Upsert points into a Qdrant collection. Omit collection only when a default collection is configured.',\n\tinputSchema: upsertVectorsInputSchema,\n\toutputSchema: upsertVectorsOutputSchema,\n\tsideEffect: 'write',\n\truntime: 'both',\n\texecute: async (input, ctx) => QdrantClient.fromContext(ctx).upsert(input)\n})\n\nexport const qdrantQueryTool = defineTool({\n\tid: 'qdrant-query',\n\tname: 'qdrantQuery',\n\tdescription: 'Nearest-neighbor search in a Qdrant collection.',\n\tinputSchema: queryVectorsInputSchema,\n\toutputSchema: queryVectorsOutputSchema,\n\tsideEffect: 'read',\n\truntime: 'both',\n\texecute: async (input, ctx) => QdrantClient.fromContext(ctx).query(input)\n})\n\nexport const qdrantDeleteTool = defineTool({\n\tid: 'qdrant-delete',\n\tname: 'qdrantDelete',\n\tdescription: 'Delete points by id from a Qdrant collection.',\n\tinputSchema: deleteVectorsInputSchema,\n\toutputSchema: deleteVectorsOutputSchema,\n\tsideEffect: 'delete',\n\truntime: 'both',\n\texecute: async (input, ctx) => QdrantClient.fromContext(ctx).delete(input)\n})\n\nexport const qdrantModule = defineModule({\n\tid: 'qdrant',\n\ttitle: 'Qdrant',\n\tdescription: 'Qdrant vector database REST: upsert, query, and delete points in a collection.',\n\truntime: 'both',\n\tauth: { type: 'custom', schema: qdrantAuthSchema },\n\tcategories: ['ai', 'vector'],\n\tclassification: 'pii',\n\ttags: ['qdrant'],\n\ttools: [qdrantUpsertTool, qdrantQueryTool, qdrantDeleteTool]\n})\n"],"mappings":";;;;;;;;;AA8BA,MAAa,mBAAmB,EAAE,OAAO;CACxC,UAAU,EACR,OAAO,CAAC,CACR,IAAI,CAAC,CACL,SAAS,sFAAsF;CACjG,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,yBAAyB;CACxE,oBAAoB,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,0DAA0D;CACpH,gBAAgB,0BACd,SAAS,CAAC,CACV,SACA,qHACD;AACF,CAAC;;;;;;;;AChCD,MAAa,wBAAwB;AAErC,MAAM,UAAU;AAChB,MAAM,UAAU;;AAGhB,SAAgB,WAAW,OAAuB;CACjD,MAAM,QAAQ,WAAW,KAAK,WAAW,QAAQ,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,SAAS,GAAG,EAAE,CAAC;CACzF,MAAM,cAAc,MAAM,GAAG,CAAC;CAC9B,MAAM,cAAc,MAAM,GAAG,CAAC;CAC9B,IAAI,gBAAgB,KAAA,KAAa,gBAAgB,KAAA,GAChD,MAAM,IAAI,MAAM,sCAAsC;CAEvD,MAAM,KAAM,cAAc,KAAQ;CAClC,MAAM,KAAM,cAAc,KAAQ;CAClC,MAAM,MAAM,OAAO,KAAK,KAAK,CAAC,CAAC,SAAS,KAAK;CAC7C,OAAO,GAAG,IAAI,MAAM,GAAG,CAAC,EAAE,GAAG,IAAI,MAAM,GAAG,EAAE,EAAE,GAAG,IAAI,MAAM,IAAI,EAAE,EAAE,GAAG,IAAI,MAAM,IAAI,EAAE,EAAE,GAAG,IAAI,MAAM,IAAI,EAAE;AAC5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C,MAAM,KAAK;AACzE,CAAC;AAED,MAAa,mBAAmB,WAAW;CAC1C,IAAI;CACJ,MAAM;CACN,aAAa;CACb,aAAa;CACb,cAAc;CACd,YAAY;CACZ,SAAS;CACT,SAAS,OAAO,OAAO,QAAQ,aAAa,YAAY,GAAG,CAAC,CAAC,OAAO,KAAK;AAC1E,CAAC;AAED,MAAa,eAAe,aAAa;CACxC,IAAI;CACJ,OAAO;CACP,aAAa;CACb,SAAS;CACT,MAAM;EAAE,MAAM;EAAU,QAAQ;CAAiB;CACjD,YAAY,CAAC,MAAM,QAAQ;CAC3B,gBAAgB;CAChB,MAAM,CAAC,QAAQ;CACf,OAAO;EAAC;EAAkB;EAAiB;CAAgB;AAC5D,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { t as ToolError } from "./errors-DoSpNHvs.js";
2
2
  import { n as defineModule, r as defineTool } from "./define-ieoksEQ0.js";
3
3
  import { n as requireAuth } from "./provider-CgDAlg6K.js";
4
- import { t as HttpService } from "./http-service-DDNCO1s4.js";
4
+ import { t as HttpService } from "./http-service-BMBIryAL.js";
5
5
  import { n as runBatchItems, t as batchResultSchema } from "./batch-Co1ujeAW.js";
6
6
  import { a as attachmentSchema, n as assertRecipientLimit, o as namedAddressSchema, s as addressList, t as assertEmailSize, u as addressToString } from "./limits-hjrO8zUG.js";
7
7
  import { isPlainObject, isString, pick } from "es-toolkit";
@@ -152,4 +152,4 @@ const resendModule = defineModule({
152
152
  //#endregion
153
153
  export { resendAuthSchema as a, resendSendInputSchema as c, ResendClient as i, resendSendOutputSchema as l, resendSendBatchTool as n, resendSendBatchInputSchema as o, resendSendTool as r, resendSendBatchOutputSchema as s, resendModule as t };
154
154
 
155
- //# sourceMappingURL=resend-Bu0NFO3h.js.map
155
+ //# sourceMappingURL=resend-A2SnRdQ8.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"resend-Bu0NFO3h.js","names":["#http"],"sources":["../src/vendors/resend/contracts.ts","../src/vendors/resend/domain.ts","../src/vendors/resend/client.ts","../src/vendors/resend/module.ts"],"sourcesContent":["import { z } from 'zod'\n\nimport { batchResultSchema } from '../../shared/batch'\nimport type { NamedAddress } from '../_email'\nimport { attachmentSchema, MAX_BATCH_EMAILS, MAX_EMAIL_BYTES, namedAddressSchema } from '../_email'\n\nexport { MAX_BATCH_EMAILS, MAX_EMAIL_BYTES, namedAddressSchema, attachmentSchema }\nexport type { NamedAddress }\n\nexport const resendAuthSchema = z.object({\n\tapi_key: z.string().min(1).describe('Resend API key')\n})\n\nexport type ResendAuth = z.infer<typeof resendAuthSchema>\n\nexport const resendSendInputSchema = z\n\t.object({\n\t\tto: z\n\t\t\t.union([namedAddressSchema, z.array(namedAddressSchema).min(1).max(50)])\n\t\t\t.describe('Primary recipient address or list (max 50 combined to/cc/bcc)'),\n\t\tfrom: namedAddressSchema.describe('Verified sender address on the sending domain'),\n\t\tsubject: z.string().min(1).max(998).describe('Email subject line'),\n\t\thtml: z.string().optional().describe('HTML body. Provide html and/or text'),\n\t\ttext: z.string().optional().describe('Plain text body. Provide html and/or text'),\n\t\tcc: z\n\t\t\t.union([namedAddressSchema, z.array(namedAddressSchema).max(50)])\n\t\t\t.optional()\n\t\t\t.describe('CC recipients'),\n\t\tbcc: z\n\t\t\t.union([namedAddressSchema, z.array(namedAddressSchema).max(50)])\n\t\t\t.optional()\n\t\t\t.describe('BCC recipients'),\n\t\treply_to: namedAddressSchema.optional().describe('Reply-To address'),\n\t\theaders: z.record(z.string(), z.string()).optional().describe('Custom headers as a string map'),\n\t\tattachments: z\n\t\t\t.array(attachmentSchema)\n\t\t\t.max(32)\n\t\t\t.optional()\n\t\t\t.describe('Up to 32 base64 attachments. Total message must stay under 5 MiB')\n\t})\n\t.refine((v) => Boolean(v.html?.trim() || v.text?.trim()), {\n\t\tmessage: 'Provide html and/or text body'\n\t})\n\nexport const resendSendOutputSchema = z.object({\n\tsuccess: z.boolean().describe('Whether Resend accepted the request'),\n\tid: z.string().optional().describe('Resend message id when available')\n})\n\nexport const resendSendBatchInputSchema = z.object({\n\tmessages: z.array(resendSendInputSchema).min(1).max(MAX_BATCH_EMAILS).describe('Messages to send (max 20)')\n})\n\nexport const resendSendBatchOutputSchema = batchResultSchema(resendSendOutputSchema)\n\nexport type ResendSendInput = z.infer<typeof resendSendInputSchema>\nexport type ResendSendOutput = z.infer<typeof resendSendOutputSchema>\nexport type ResendSendBatchInput = z.infer<typeof resendSendBatchInputSchema>\nexport type ResendSendBatchOutput = z.infer<typeof resendSendBatchOutputSchema>\n","/**\n * Resend payload shaping + response parse.\n * Vertical helpers: `vendors/_email`.\n */\n\nimport { isPlainObject, isString, pick } from 'es-toolkit'\n\nimport { ToolError } from '../../core/errors'\nimport { addressList, addressToString, assertEmailSize, assertRecipientLimit } from '../_email'\nimport type { ResendSendInput, ResendSendOutput } from './contracts'\n\nexport function buildSendPayload(input: ResendSendInput): Record<string, unknown> {\n\treturn {\n\t\t...pick(input, ['subject', 'html', 'text', 'headers']),\n\t\tfrom: addressToString(input.from),\n\t\tto: addressList(input.to),\n\t\tcc: addressList(input.cc),\n\t\tbcc: addressList(input.bcc),\n\t\t...(input.reply_to && { reply_to: addressToString(input.reply_to) }),\n\t\t...(input.attachments && {\n\t\t\tattachments: input.attachments.map((att) => ({\n\t\t\t\tfilename: att.filename,\n\t\t\t\tcontent: att.content,\n\t\t\t\tcontent_type: att.type,\n\t\t\t\t...(att.disposition && { content_disposition: att.disposition }),\n\t\t\t\t// Resend REST uses content_id for CID inline images.\n\t\t\t\t...(att.content_id && { content_id: att.content_id })\n\t\t\t}))\n\t\t})\n\t}\n}\n\nexport function preflightSend(input: ResendSendInput): Record<string, unknown> {\n\tassertRecipientLimit(input)\n\tconst payload = buildSendPayload(input)\n\tassertEmailSize(\n\t\tpayload,\n\t\tinput.attachments?.map((a) => a.content)\n\t)\n\treturn payload\n}\n\n/** Map Resend `{ id }` success body to tool output. */\nexport function parseSendResult(data: unknown): ResendSendOutput {\n\tif (!isPlainObject(data)) {\n\t\tthrow new ToolError('Resend returned an unexpected payload', { code: 'upstream' })\n\t}\n\tconst id = data['id']\n\treturn {\n\t\tsuccess: true,\n\t\t...(isString(id) && id.length > 0 && { id })\n\t}\n}\n","/**\n * Resend vendor client.\n * Host: `new ResendClient(auth)`. Agent tools: `fromContext(ctx)`.\n */\n\nimport { ToolError } from '../../core/errors'\nimport { requireAuth } from '../../core/provider'\nimport type { ToolContext } from '../../core/types'\nimport { runBatchItems } from '../../shared/batch'\nimport { HttpService } from '../../transport/http-service'\nimport type { HttpServiceOptions } from '../../transport/http-service'\nimport type {\n\tResendAuth,\n\tResendSendBatchInput,\n\tResendSendBatchOutput,\n\tResendSendInput,\n\tResendSendOutput\n} from './contracts'\nimport { resendAuthSchema } from './contracts'\nimport { parseSendResult, preflightSend } from './domain'\n\nexport type ResendClientOptions = Pick<HttpServiceOptions, 'fetch' | 'signal'>\n\nexport class ResendClient {\n\treadonly #http: HttpService\n\n\tconstructor(auth: ResendAuth, options: ResendClientOptions = {}) {\n\t\tconst parsed = resendAuthSchema.safeParse(auth)\n\t\tif (!parsed.success) {\n\t\t\tthrow new ToolError('Invalid Resend auth credentials', {\n\t\t\t\tcode: 'bad_auth',\n\t\t\t\tdetails: { issues: parsed.error.issues.map((issue) => issue.message) }\n\t\t\t})\n\t\t}\n\t\tthis.#http = new HttpService({\n\t\t\t...options,\n\t\t\tbaseURL: 'https://api.resend.com',\n\t\t\theaders: {\n\t\t\t\tAuthorization: `Bearer ${parsed.data.api_key}`,\n\t\t\t\t'Content-Type': 'application/json'\n\t\t\t},\n\t\t\tlabel: 'Resend'\n\t\t})\n\t}\n\n\tstatic fromContext(ctx: ToolContext): ResendClient {\n\t\tconst auth = requireAuth(ctx, resendAuthSchema)\n\t\treturn new ResendClient(auth, {\n\t\t\t...(ctx.fetch && { fetch: ctx.fetch }),\n\t\t\t...(ctx.signal && { signal: ctx.signal })\n\t\t})\n\t}\n\n\t/** POST /emails */\n\tasync send(input: ResendSendInput): Promise<ResendSendOutput> {\n\t\tconst payload = preflightSend(input)\n\t\tconst { data } = await this.#http.post('/emails', payload, { label: 'Resend send' })\n\t\treturn parseSendResult(data)\n\t}\n\n\t/** Sequential batch of independent sends (partial failure OK). */\n\tasync sendBatch(input: ResendSendBatchInput): Promise<ResendSendBatchOutput> {\n\t\treturn runBatchItems(input.messages, (message) => this.send(message))\n\t}\n}\n","import { defineModule, defineTool } from '../../core/define'\nimport { ResendClient } from './client'\nimport {\n\tresendAuthSchema,\n\tresendSendBatchInputSchema,\n\tresendSendBatchOutputSchema,\n\tresendSendInputSchema,\n\tresendSendOutputSchema\n} from './contracts'\n\n/** Single-email send tool. Host binds auth via withAuth. */\nexport const resendSendTool = defineTool({\n\tid: 'resend-send',\n\tname: 'resendSend',\n\tdescription:\n\t\t'Send one email via Resend. Subject plus html and/or text. Optional cc, bcc, reply_to, headers, base64 attachments. Total under 5 MiB.',\n\tinputSchema: resendSendInputSchema,\n\toutputSchema: resendSendOutputSchema,\n\tsideEffect: 'send',\n\truntime: 'both',\n\texecute: async (input, ctx) => ResendClient.fromContext(ctx).send(input)\n})\n\n/** Batch send (max 20). Per-message success/error; does not abort the batch. */\nexport const resendSendBatchTool = defineTool({\n\tid: 'resend-send-batch',\n\tname: 'resendSendBatch',\n\tdescription: 'Send up to 20 emails via Resend. Per-message success or error without aborting the batch.',\n\tinputSchema: resendSendBatchInputSchema,\n\toutputSchema: resendSendBatchOutputSchema,\n\tsideEffect: 'send',\n\truntime: 'both',\n\texecute: async (input, ctx) => ResendClient.fromContext(ctx).sendBatch(input)\n})\n\nexport const resendModule = defineModule({\n\tid: 'resend',\n\ttitle: 'Resend',\n\tdescription: 'Resend vendor pack: send one email or a batch (max 20). Not a multi-provider email seam.',\n\truntime: 'both',\n\tauth: { type: 'custom', schema: resendAuthSchema },\n\tcategories: ['email'],\n\tclassification: 'pii',\n\ttags: ['send'],\n\ttools: [resendSendTool, resendSendBatchTool]\n})\n"],"mappings":";;;;;;;;;AASA,MAAa,mBAAmB,EAA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,OAAO,OAAO,QAAQ,aAAa,YAAY,GAAG,CAAC,CAAC,UAAU,KAAK;AAC7E,CAAC;AAED,MAAa,eAAe,aAAa;CACxC,IAAI;CACJ,OAAO;CACP,aAAa;CACb,SAAS;CACT,MAAM;EAAE,MAAM;EAAU,QAAQ;CAAiB;CACjD,YAAY,CAAC,OAAO;CACpB,gBAAgB;CAChB,MAAM,CAAC,MAAM;CACb,OAAO,CAAC,gBAAgB,mBAAmB;AAC5C,CAAC"}
1
+ {"version":3,"file":"resend-A2SnRdQ8.js","names":["#http"],"sources":["../src/vendors/resend/contracts.ts","../src/vendors/resend/domain.ts","../src/vendors/resend/client.ts","../src/vendors/resend/module.ts"],"sourcesContent":["import { z } from 'zod'\n\nimport { batchResultSchema } from '../../shared/batch'\nimport type { NamedAddress } from '../_email'\nimport { attachmentSchema, MAX_BATCH_EMAILS, MAX_EMAIL_BYTES, namedAddressSchema } from '../_email'\n\nexport { MAX_BATCH_EMAILS, MAX_EMAIL_BYTES, namedAddressSchema, attachmentSchema }\nexport type { NamedAddress }\n\nexport const resendAuthSchema = z.object({\n\tapi_key: z.string().min(1).describe('Resend API key')\n})\n\nexport type ResendAuth = z.infer<typeof resendAuthSchema>\n\nexport const resendSendInputSchema = z\n\t.object({\n\t\tto: z\n\t\t\t.union([namedAddressSchema, z.array(namedAddressSchema).min(1).max(50)])\n\t\t\t.describe('Primary recipient address or list (max 50 combined to/cc/bcc)'),\n\t\tfrom: namedAddressSchema.describe('Verified sender address on the sending domain'),\n\t\tsubject: z.string().min(1).max(998).describe('Email subject line'),\n\t\thtml: z.string().optional().describe('HTML body. Provide html and/or text'),\n\t\ttext: z.string().optional().describe('Plain text body. Provide html and/or text'),\n\t\tcc: z\n\t\t\t.union([namedAddressSchema, z.array(namedAddressSchema).max(50)])\n\t\t\t.optional()\n\t\t\t.describe('CC recipients'),\n\t\tbcc: z\n\t\t\t.union([namedAddressSchema, z.array(namedAddressSchema).max(50)])\n\t\t\t.optional()\n\t\t\t.describe('BCC recipients'),\n\t\treply_to: namedAddressSchema.optional().describe('Reply-To address'),\n\t\theaders: z.record(z.string(), z.string()).optional().describe('Custom headers as a string map'),\n\t\tattachments: z\n\t\t\t.array(attachmentSchema)\n\t\t\t.max(32)\n\t\t\t.optional()\n\t\t\t.describe('Up to 32 base64 attachments. Total message must stay under 5 MiB')\n\t})\n\t.refine((v) => Boolean(v.html?.trim() || v.text?.trim()), {\n\t\tmessage: 'Provide html and/or text body'\n\t})\n\nexport const resendSendOutputSchema = z.object({\n\tsuccess: z.boolean().describe('Whether Resend accepted the request'),\n\tid: z.string().optional().describe('Resend message id when available')\n})\n\nexport const resendSendBatchInputSchema = z.object({\n\tmessages: z.array(resendSendInputSchema).min(1).max(MAX_BATCH_EMAILS).describe('Messages to send (max 20)')\n})\n\nexport const resendSendBatchOutputSchema = batchResultSchema(resendSendOutputSchema)\n\nexport type ResendSendInput = z.infer<typeof resendSendInputSchema>\nexport type ResendSendOutput = z.infer<typeof resendSendOutputSchema>\nexport type ResendSendBatchInput = z.infer<typeof resendSendBatchInputSchema>\nexport type ResendSendBatchOutput = z.infer<typeof resendSendBatchOutputSchema>\n","/**\n * Resend payload shaping + response parse.\n * Vertical helpers: `vendors/_email`.\n */\n\nimport { isPlainObject, isString, pick } from 'es-toolkit'\n\nimport { ToolError } from '../../core/errors'\nimport { addressList, addressToString, assertEmailSize, assertRecipientLimit } from '../_email'\nimport type { ResendSendInput, ResendSendOutput } from './contracts'\n\nexport function buildSendPayload(input: ResendSendInput): Record<string, unknown> {\n\treturn {\n\t\t...pick(input, ['subject', 'html', 'text', 'headers']),\n\t\tfrom: addressToString(input.from),\n\t\tto: addressList(input.to),\n\t\tcc: addressList(input.cc),\n\t\tbcc: addressList(input.bcc),\n\t\t...(input.reply_to && { reply_to: addressToString(input.reply_to) }),\n\t\t...(input.attachments && {\n\t\t\tattachments: input.attachments.map((att) => ({\n\t\t\t\tfilename: att.filename,\n\t\t\t\tcontent: att.content,\n\t\t\t\tcontent_type: att.type,\n\t\t\t\t...(att.disposition && { content_disposition: att.disposition }),\n\t\t\t\t// Resend REST uses content_id for CID inline images.\n\t\t\t\t...(att.content_id && { content_id: att.content_id })\n\t\t\t}))\n\t\t})\n\t}\n}\n\nexport function preflightSend(input: ResendSendInput): Record<string, unknown> {\n\tassertRecipientLimit(input)\n\tconst payload = buildSendPayload(input)\n\tassertEmailSize(\n\t\tpayload,\n\t\tinput.attachments?.map((a) => a.content)\n\t)\n\treturn payload\n}\n\n/** Map Resend `{ id }` success body to tool output. */\nexport function parseSendResult(data: unknown): ResendSendOutput {\n\tif (!isPlainObject(data)) {\n\t\tthrow new ToolError('Resend returned an unexpected payload', { code: 'upstream' })\n\t}\n\tconst id = data['id']\n\treturn {\n\t\tsuccess: true,\n\t\t...(isString(id) && id.length > 0 && { id })\n\t}\n}\n","/**\n * Resend vendor client.\n * Host: `new ResendClient(auth)`. Agent tools: `fromContext(ctx)`.\n */\n\nimport { ToolError } from '../../core/errors'\nimport { requireAuth } from '../../core/provider'\nimport type { ToolContext } from '../../core/types'\nimport { runBatchItems } from '../../shared/batch'\nimport { HttpService } from '../../transport/http-service'\nimport type { HttpServiceOptions } from '../../transport/http-service'\nimport type {\n\tResendAuth,\n\tResendSendBatchInput,\n\tResendSendBatchOutput,\n\tResendSendInput,\n\tResendSendOutput\n} from './contracts'\nimport { resendAuthSchema } from './contracts'\nimport { parseSendResult, preflightSend } from './domain'\n\nexport type ResendClientOptions = Pick<HttpServiceOptions, 'fetch' | 'signal'>\n\nexport class ResendClient {\n\treadonly #http: HttpService\n\n\tconstructor(auth: ResendAuth, options: ResendClientOptions = {}) {\n\t\tconst parsed = resendAuthSchema.safeParse(auth)\n\t\tif (!parsed.success) {\n\t\t\tthrow new ToolError('Invalid Resend auth credentials', {\n\t\t\t\tcode: 'bad_auth',\n\t\t\t\tdetails: { issues: parsed.error.issues.map((issue) => issue.message) }\n\t\t\t})\n\t\t}\n\t\tthis.#http = new HttpService({\n\t\t\t...options,\n\t\t\tbaseURL: 'https://api.resend.com',\n\t\t\theaders: {\n\t\t\t\tAuthorization: `Bearer ${parsed.data.api_key}`,\n\t\t\t\t'Content-Type': 'application/json'\n\t\t\t},\n\t\t\tlabel: 'Resend'\n\t\t})\n\t}\n\n\tstatic fromContext(ctx: ToolContext): ResendClient {\n\t\tconst auth = requireAuth(ctx, resendAuthSchema)\n\t\treturn new ResendClient(auth, {\n\t\t\t...(ctx.fetch && { fetch: ctx.fetch }),\n\t\t\t...(ctx.signal && { signal: ctx.signal })\n\t\t})\n\t}\n\n\t/** POST /emails */\n\tasync send(input: ResendSendInput): Promise<ResendSendOutput> {\n\t\tconst payload = preflightSend(input)\n\t\tconst { data } = await this.#http.post('/emails', payload, { label: 'Resend send' })\n\t\treturn parseSendResult(data)\n\t}\n\n\t/** Sequential batch of independent sends (partial failure OK). */\n\tasync sendBatch(input: ResendSendBatchInput): Promise<ResendSendBatchOutput> {\n\t\treturn runBatchItems(input.messages, (message) => this.send(message))\n\t}\n}\n","import { defineModule, defineTool } from '../../core/define'\nimport { ResendClient } from './client'\nimport {\n\tresendAuthSchema,\n\tresendSendBatchInputSchema,\n\tresendSendBatchOutputSchema,\n\tresendSendInputSchema,\n\tresendSendOutputSchema\n} from './contracts'\n\n/** Single-email send tool. Host binds auth via withAuth. */\nexport const resendSendTool = defineTool({\n\tid: 'resend-send',\n\tname: 'resendSend',\n\tdescription:\n\t\t'Send one email via Resend. Subject plus html and/or text. Optional cc, bcc, reply_to, headers, base64 attachments. Total under 5 MiB.',\n\tinputSchema: resendSendInputSchema,\n\toutputSchema: resendSendOutputSchema,\n\tsideEffect: 'send',\n\truntime: 'both',\n\texecute: async (input, ctx) => ResendClient.fromContext(ctx).send(input)\n})\n\n/** Batch send (max 20). Per-message success/error; does not abort the batch. */\nexport const resendSendBatchTool = defineTool({\n\tid: 'resend-send-batch',\n\tname: 'resendSendBatch',\n\tdescription: 'Send up to 20 emails via Resend. Per-message success or error without aborting the batch.',\n\tinputSchema: resendSendBatchInputSchema,\n\toutputSchema: resendSendBatchOutputSchema,\n\tsideEffect: 'send',\n\truntime: 'both',\n\texecute: async (input, ctx) => ResendClient.fromContext(ctx).sendBatch(input)\n})\n\nexport const resendModule = defineModule({\n\tid: 'resend',\n\ttitle: 'Resend',\n\tdescription: 'Resend vendor pack: send one email or a batch (max 20). Not a multi-provider email seam.',\n\truntime: 'both',\n\tauth: { type: 'custom', schema: resendAuthSchema },\n\tcategories: ['email'],\n\tclassification: 'pii',\n\ttags: ['send'],\n\ttools: [resendSendTool, resendSendBatchTool]\n})\n"],"mappings":";;;;;;;;;AASA,MAAa,mBAAmB,EAAE,OAAO,EACxC,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,gBAAgB,EACrD,CAAC;AAID,MAAa,wBAAwB,EACnC,OAAO;CACP,IAAI,EACF,MAAM,CAAC,oBAAoB,EAAE,MAAM,kBAAkB,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CACvE,SAAS,+DAA+D;CAC1E,MAAM,mBAAmB,SAAS,+CAA+C;CACjF,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,SAAS,oBAAoB;CACjE,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,qCAAqC;CAC1E,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,2CAA2C;CAChF,IAAI,EACF,MAAM,CAAC,oBAAoB,EAAE,MAAM,kBAAkB,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAChE,SAAS,CAAC,CACV,SAAS,eAAe;CAC1B,KAAK,EACH,MAAM,CAAC,oBAAoB,EAAE,MAAM,kBAAkB,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAChE,SAAS,CAAC,CACV,SAAS,gBAAgB;CAC3B,UAAU,mBAAmB,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AU,OAA6D;EAC5E,OAAO,cAAc,MAAM,WAAW,YAAY,KAAK,KAAK,OAAO,CAAC;CACrE;AACD;;;;ACrDA,MAAa,iBAAiB,WAAW;CACxC,IAAI;CACJ,MAAM;CACN,aACC;CACD,aAAa;CACb,cAAc;CACd,YAAY;CACZ,SAAS;CACT,SAAS,OAAO,OAAO,QAAQ,aAAa,YAAY,GAAG,CAAC,CAAC,KAAK,KAAK;AACxE,CAAC;;AAGD,MAAa,sBAAsB,WAAW;CAC7C,IAAI;CACJ,MAAM;CACN,aAAa;CACb,aAAa;CACb,cAAc;CACd,YAAY;CACZ,SAAS;CACT,SAAS,OAAO,OAAO,QAAQ,aAAa,YAAY,GAAG,CAAC,CAAC,UAAU,KAAK;AAC7E,CAAC;AAED,MAAa,eAAe,aAAa;CACxC,IAAI;CACJ,OAAO;CACP,aAAa;CACb,SAAS;CACT,MAAM;EAAE,MAAM;EAAU,QAAQ;CAAiB;CACjD,YAAY,CAAC,OAAO;CACpB,gBAAgB;CAChB,MAAM,CAAC,MAAM;CACb,OAAO,CAAC,gBAAgB,mBAAmB;AAC5C,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { n as isToolError, t as ToolError } from "./errors-DoSpNHvs.js";
2
2
  import { n as defineModule, r as defineTool } from "./define-ieoksEQ0.js";
3
3
  import { n as requireAuth } from "./provider-CgDAlg6K.js";
4
- import { t as AwsService } from "./aws-service-msttbPrz.js";
4
+ import { t as AwsService } from "./aws-service-Cn_ozX4X.js";
5
5
  import { a as toArrayBuffer, i as encodeObjectKeyPath, n as bytesToBase64, o as utf8ToBytes, r as bytesToUtf8, t as base64ToBytes } from "./bytes-BxpimpQx.js";
6
6
  import { t as batchResultSchema } from "./batch-Co1ujeAW.js";
7
7
  import { isNil, isNumber, isPlainObject, isString } from "es-toolkit";
@@ -952,4 +952,4 @@ const s3Module = defineModule({
952
952
  //#endregion
953
953
  export { getObjectOutputSchema as A, uploadPartOutputSchema as B, copyObjectInputSchema as C, deleteObjectInputSchema as D, createMultipartUploadOutputSchema as E, putObjectInputSchema as F, resolveObjectKey as H, putObjectOutputSchema as I, signedUrlInputSchema as L, headObjectOutputSchema as M, listObjectsInputSchema as N, deleteObjectOutputSchema as O, listObjectsOutputSchema as P, signedUrlOutputSchema as R, completeMultipartUploadOutputSchema as S, createMultipartUploadInputSchema as T, normalizeKeyPrefix as V, MAX_OBJECT_BYTES as _, s3CreateSignedUrlTool as a, abortMultipartUploadOutputSchema as b, s3HeadObjectTool as c, s3PutObjectTool as d, s3UploadPartTool as f, MAX_MULTIPART_PART_BYTES as g, DEFAULT_SIGNED_URL_SECONDS as h, s3CreateMultipartUploadTool as i, headObjectInputSchema as j, getObjectInputSchema as k, s3ListObjectsTool as l, s3AuthSchema as m, s3CompleteMultipartUploadTool as n, s3DeleteObjectTool as o, S3Client as p, s3CopyObjectTool as r, s3GetObjectTool as s, s3AbortMultipartUploadTool as t, s3Module as u, MAX_SIGNED_URL_SECONDS as v, copyObjectOutputSchema as w, completeMultipartUploadInputSchema as x, abortMultipartUploadInputSchema as y, uploadPartInputSchema as z };
954
954
 
955
- //# sourceMappingURL=s3-Dj7Teh-A.js.map
955
+ //# sourceMappingURL=s3-CoZQRTfe.js.map