@5ss/ai-tools 3.7.0 → 3.7.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.
- package/CHANGELOG.md +4 -0
- package/dist/{bedrock-agentcore-browser-DwDSP_YL.js → bedrock-agentcore-browser-yrEY9cUi.js} +2 -2
- package/dist/{bedrock-agentcore-browser-DwDSP_YL.js.map → bedrock-agentcore-browser-yrEY9cUi.js.map} +1 -1
- package/dist/{bedrock-agentcore-code-interpreter-F0dnrAm4.js → bedrock-agentcore-code-interpreter-BnJnDxCp.js} +2 -2
- package/dist/{bedrock-agentcore-code-interpreter-F0dnrAm4.js.map → bedrock-agentcore-code-interpreter-BnJnDxCp.js.map} +1 -1
- package/dist/{cloudflare-browser-D-HT43hu.js → cloudflare-browser-D9pG4RTj.js} +3 -3
- package/dist/{cloudflare-browser-D-HT43hu.js.map → cloudflare-browser-D9pG4RTj.js.map} +1 -1
- package/dist/{cloudflare-email-BLI3z96V.js → cloudflare-email-bsq902dg.js} +2 -2
- package/dist/{cloudflare-email-BLI3z96V.js.map → cloudflare-email-bsq902dg.js.map} +1 -1
- package/dist/{cloudflare-sandbox-DII392Z9.js → cloudflare-sandbox-DHE4fmiq.js} +3 -3
- package/dist/{cloudflare-sandbox-DII392Z9.js.map → cloudflare-sandbox-DHE4fmiq.js.map} +1 -1
- package/dist/core/index.js +1 -1
- package/dist/{define-ieoksEQ0.js → define-DdFALdNf.js} +2 -1
- package/dist/define-DdFALdNf.js.map +1 -0
- package/dist/{eventbridge-scheduler-CDmO2-Te.js → eventbridge-scheduler-ICepMPWG.js} +2 -2
- package/dist/{eventbridge-scheduler-CDmO2-Te.js.map → eventbridge-scheduler-ICepMPWG.js.map} +1 -1
- package/dist/{imessage-Dsms04rC.js → imessage-B-0DZfMa.js} +2 -2
- package/dist/{imessage-Dsms04rC.js.map → imessage-B-0DZfMa.js.map} +1 -1
- package/dist/index-CZX5OeOF.d.ts.map +1 -1
- package/dist/{mastra-vector-B8HjvdMT.js → mastra-vector-qKG3L-Rw.js} +2 -2
- package/dist/{mastra-vector-B8HjvdMT.js.map → mastra-vector-qKG3L-Rw.js.map} +1 -1
- package/dist/modules/artifacts/index.js +2 -2
- package/dist/modules/browser/index.js +3 -3
- package/dist/modules/calendar/index.js +1 -1
- package/dist/modules/code-sandbox/index.js +3 -3
- package/dist/modules/content-type/index.js +1 -1
- package/dist/modules/crypto/index.js +1 -1
- package/dist/modules/document-extract/index.js +2 -2
- package/dist/modules/document-render/index.js +2 -2
- package/dist/modules/email/index.js +3 -3
- package/dist/modules/email-message/index.js +1 -1
- package/dist/modules/files/index.js +2 -2
- package/dist/modules/image/index.js +2 -2
- package/dist/modules/messaging/index.js +6 -6
- package/dist/modules/queue/index.js +2 -2
- package/dist/modules/rag/index.js +2 -2
- package/dist/modules/scheduler/index.js +2 -2
- package/dist/modules/skills/index.js +1 -1
- package/dist/modules/tasks/index.js +1 -1
- package/dist/modules/vector-store/index.js +1 -1
- package/dist/modules/web-fetch/index.js +1 -1
- package/dist/{pinecone-BvdXAZMi.js → pinecone-tmtu3ZS5.js} +2 -2
- package/dist/{pinecone-BvdXAZMi.js.map → pinecone-tmtu3ZS5.js.map} +1 -1
- package/dist/{qdrant-D2E2Lxrw.js → qdrant-zbCHUsnv.js} +2 -2
- package/dist/{qdrant-D2E2Lxrw.js.map → qdrant-zbCHUsnv.js.map} +1 -1
- package/dist/{resend-A2SnRdQ8.js → resend-Cfgm4HuV.js} +2 -2
- package/dist/{resend-A2SnRdQ8.js.map → resend-Cfgm4HuV.js.map} +1 -1
- package/dist/{s3-CoZQRTfe.js → s3-TKCIZZ2q.js} +2 -2
- package/dist/{s3-CoZQRTfe.js.map → s3-TKCIZZ2q.js.map} +1 -1
- package/dist/{slack-C9UJ0b61.js → slack-D6XzBS3b.js} +2 -2
- package/dist/{slack-C9UJ0b61.js.map → slack-D6XzBS3b.js.map} +1 -1
- package/dist/{sqs-DxFnfODk.js → sqs-B50DWyTf.js} +2 -2
- package/dist/{sqs-DxFnfODk.js.map → sqs-B50DWyTf.js.map} +1 -1
- package/dist/{supabase-vector-DT3qfnt2.js → supabase-vector-CDKOyvj1.js} +2 -2
- package/dist/{supabase-vector-DT3qfnt2.js.map → supabase-vector-CDKOyvj1.js.map} +1 -1
- package/dist/{teams-NODh3i6U.js → teams-bGfle6pU.js} +2 -2
- package/dist/{teams-NODh3i6U.js.map → teams-bGfle6pU.js.map} +1 -1
- package/dist/{telegram-CWMHBeKo.js → telegram-B-TZi9fM.js} +2 -2
- package/dist/{telegram-CWMHBeKo.js.map → telegram-B-TZi9fM.js.map} +1 -1
- package/dist/{textract-2jkPuRiE.js → textract-CthgcP6w.js} +3 -3
- package/dist/{textract-2jkPuRiE.js.map → textract-CthgcP6w.js.map} +1 -1
- package/dist/{vector-store-CDQaQXFV.js → vector-store-DrwuMOne.js} +6 -6
- package/dist/{vector-store-CDQaQXFV.js.map → vector-store-DrwuMOne.js.map} +1 -1
- package/dist/vendors/amazon-sp-api/index.js +1 -1
- package/dist/vendors/bedrock-agentcore-browser/index.js +1 -1
- package/dist/vendors/bedrock-agentcore-code-interpreter/index.js +1 -1
- package/dist/vendors/cloudflare-browser/index.js +1 -1
- package/dist/vendors/cloudflare-email/index.js +1 -1
- package/dist/vendors/cloudflare-sandbox/index.js +1 -1
- package/dist/vendors/eventbridge-scheduler/index.js +1 -1
- package/dist/vendors/imessage/index.js +1 -1
- package/dist/vendors/katana/index.js +1 -1
- package/dist/vendors/mastra-vector/index.js +1 -1
- package/dist/vendors/pinecone/index.js +1 -1
- package/dist/vendors/qdrant/index.js +1 -1
- package/dist/vendors/resend/index.js +1 -1
- package/dist/vendors/s3/index.js +1 -1
- package/dist/vendors/shipstation/index.js +1 -1
- package/dist/vendors/slack/index.js +1 -1
- package/dist/vendors/sqs/index.js +1 -1
- package/dist/vendors/supabase-vector/index.js +1 -1
- package/dist/vendors/teams/index.js +1 -1
- package/dist/vendors/telegram/index.js +1 -1
- package/dist/vendors/textract/index.js +1 -1
- package/dist/vendors/woocommerce/index.js +1 -1
- package/logos/README.md +1 -0
- package/logos/pack-logos.json +1 -0
- package/logos/shipstation.svg +12 -0
- package/package.json +11 -11
- package/dist/define-ieoksEQ0.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mastra-vector-B8HjvdMT.js","names":["#store","#defaultIndex","#defaultFilter","#dimension","#autoCreateIndex","#ownsStore","#ensureIndex"],"sources":["../src/vendors/mastra-vector/contracts.ts","../src/vendors/mastra-vector/client.ts","../src/vendors/mastra-vector/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\n/**\n * Mastra PgVector auth (`@mastra/pg`).\n * Host owns Postgres connection + schema; package does not invent org policy.\n */\nexport const mastraVectorAuthSchema = z.object({\n\tconnection_string: z\n\t\t.string()\n\t\t.min(1)\n\t\t.describe('Postgres connection string for Mastra PgVector (e.g. Supabase DB URL)'),\n\tid: z.string().min(1).describe('Mastra vector store id (stable string for this store instance)'),\n\tschema_name: z\n\t\t.string()\n\t\t.min(1)\n\t\t.optional()\n\t\t.describe('Postgres schema for vector tables (e.g. agent); omit for package default'),\n\tdefault_index: z.string().min(1).optional().describe('Default index name when tool input omits collection'),\n\tdimension: z\n\t\t.number()\n\t\t.int()\n\t\t.positive()\n\t\t.optional()\n\t\t.describe('Embedding dimension; required when auto_create_index is true'),\n\tauto_create_index: z\n\t\t.boolean()\n\t\t.optional()\n\t\t.describe('When true, create the index on upsert if missing (needs dimension)'),\n\tdisable_init: z.boolean().optional().describe('Pass disableInit to PgVector (host manages migration/init)'),\n\tdefault_filter: vectorDefaultFilterSchema\n\t\t.optional()\n\t\t.describe(\n\t\t\t'Host-bound metadata filter always applied on query (Mongo-style / Mastra PG filter); flat keys stamped on upsert'\n\t\t)\n})\n\nexport type MastraVectorAuth = z.infer<typeof mastraVectorAuthSchema>\n","/**\n * Mastra PgVector vendor client (`@mastra/pg`).\n * Host: `new MastraVectorClient(auth)`. Agent tools: `fromContext(ctx)`.\n * Runtime: node (Postgres). Optional peer: `@mastra/pg`.\n */\n\nimport { PgVector } from '@mastra/pg'\nimport { isNumber, isPlainObject, isString } from 'es-toolkit'\n\nimport { ToolError } from '../../core/errors'\nimport { requireAuth } from '../../core/provider'\nimport type { ToolContext } from '../../core/types'\nimport { mergeVectorFilter, parseMetadata, requireCollection, stampDefaultFilterMetadata } from '../_vector/domain'\nimport type { VectorDefaultFilter } from '../_vector/domain'\nimport type {\n\tDeleteVectorsInput,\n\tDeleteVectorsOutput,\n\tMastraVectorAuth,\n\tQueryVectorsInput,\n\tQueryVectorsOutput,\n\tUpsertVectorsInput,\n\tUpsertVectorsOutput,\n\tVectorMatch\n} from './contracts'\nimport { mastraVectorAuthSchema } from './contracts'\n\n/** Injected / real store surface (filter is opaque Record for seam compatibility). */\ntype MastraStore = {\n\tupsert: (input: {\n\t\tindexName: string\n\t\tids: string[]\n\t\tvectors: number[][]\n\t\tmetadata: Array<Record<string, unknown>>\n\t}) => Promise<unknown>\n\tquery: (input: {\n\t\tindexName: string\n\t\tqueryVector: number[]\n\t\ttopK?: number\n\t\tincludeVector?: boolean\n\t\tfilter?: Record<string, unknown>\n\t}) => Promise<Array<{ id?: string; score?: number; metadata?: unknown; vector?: number[] }>>\n\tdeleteVectors: (input: { indexName: string; ids: string[] }) => Promise<unknown>\n\tcreateIndex: (input: { indexName: string; dimension: number }) => Promise<unknown>\n\tdisconnect?: () => Promise<void>\n}\n\ntype PgQueryArgs = Parameters<PgVector['query']>[0]\n\n/** Narrow a built arg bag to PgVector query params (Mongo-style filter is structural). */\nfunction isPgQueryArgs(value: unknown): value is PgQueryArgs {\n\treturn (\n\t\tisPlainObject(value) &&\n\t\tisString(value['indexName']) &&\n\t\tvalue['indexName'].length > 0 &&\n\t\tArray.isArray(value['queryVector'])\n\t)\n}\n\nexport type MastraVectorClientOptions = {\n\t/**\n\t * Test injection — production uses PgVector.\n\t * Must implement the same method names as PgVector for upsert/query/deleteVectors/createIndex.\n\t */\n\tstore?: MastraStore\n}\n\nexport class MastraVectorClient {\n\treadonly #store: MastraStore\n\treadonly #defaultIndex: string | undefined\n\treadonly #defaultFilter: VectorDefaultFilter | undefined\n\treadonly #dimension: number | undefined\n\treadonly #autoCreateIndex: boolean\n\treadonly #ownsStore: boolean\n\n\tconstructor(auth: MastraVectorAuth, options: MastraVectorClientOptions = {}) {\n\t\tconst parsed = mastraVectorAuthSchema.safeParse(auth)\n\t\tif (!parsed.success) {\n\t\t\tthrow new ToolError('Invalid Mastra vector 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\tconst data = parsed.data\n\t\tthis.#defaultIndex = data.default_index\n\t\tthis.#defaultFilter = data.default_filter\n\t\tthis.#dimension = data.dimension\n\t\tthis.#autoCreateIndex = data.auto_create_index === true\n\n\t\tif (options.store) {\n\t\t\tthis.#store = options.store\n\t\t\tthis.#ownsStore = false\n\t\t\treturn\n\t\t}\n\n\t\tconst config: {\n\t\t\tconnectionString: string\n\t\t\tid: string\n\t\t\tschemaName?: string\n\t\t\tdisableInit?: boolean\n\t\t} = {\n\t\t\tconnectionString: data.connection_string,\n\t\t\tid: data.id\n\t\t}\n\t\tif (data.schema_name) config.schemaName = data.schema_name\n\t\tif (data.disable_init === true) config.disableInit = true\n\n\t\tconst pg = new PgVector(config)\n\t\t// Adapt PgVector to opaque Record filters (Mongo-style / flat equality is native).\n\t\tthis.#store = {\n\t\t\tupsert: (input) =>\n\t\t\t\tpg.upsert({\n\t\t\t\t\tindexName: input.indexName,\n\t\t\t\t\tids: input.ids,\n\t\t\t\t\tvectors: input.vectors,\n\t\t\t\t\tmetadata: input.metadata\n\t\t\t\t}),\n\t\t\tquery: (input) => {\n\t\t\t\tconst args: Record<string, unknown> = {\n\t\t\t\t\tindexName: input.indexName,\n\t\t\t\t\tqueryVector: input.queryVector,\n\t\t\t\t\t...(input.topK !== undefined && { topK: input.topK }),\n\t\t\t\t\t...(input.includeVector !== undefined && { includeVector: input.includeVector }),\n\t\t\t\t\t...(input.filter !== undefined && { filter: input.filter })\n\t\t\t\t}\n\t\t\t\tif (!isPgQueryArgs(args)) {\n\t\t\t\t\tthrow new ToolError('Invalid Mastra vector query args', { code: 'internal' })\n\t\t\t\t}\n\t\t\t\treturn pg.query(args)\n\t\t\t},\n\t\t\tdeleteVectors: (input) => pg.deleteVectors({ indexName: input.indexName, ids: input.ids }),\n\t\t\tcreateIndex: (input) => pg.createIndex({ indexName: input.indexName, dimension: input.dimension }),\n\t\t\tdisconnect: () => pg.disconnect()\n\t\t}\n\t\tthis.#ownsStore = true\n\t}\n\n\tstatic fromContext(ctx: ToolContext): MastraVectorClient {\n\t\tconst auth = requireAuth(ctx, mastraVectorAuthSchema)\n\t\treturn new MastraVectorClient(auth)\n\t}\n\n\tasync upsert(input: UpsertVectorsInput): Promise<UpsertVectorsOutput> {\n\t\tconst indexName = requireCollection(input.collection, this.#defaultIndex, 'Mastra vector upsert')\n\t\tawait this.#ensureIndex(indexName, input.vectors[0]?.values.length)\n\n\t\tawait this.#store.upsert({\n\t\t\tindexName,\n\t\t\tids: input.vectors.map((point) => point.id),\n\t\t\tvectors: input.vectors.map((point) => point.values),\n\t\t\tmetadata: input.vectors.map((point) => stampDefaultFilterMetadata(point.metadata, this.#defaultFilter) ?? {})\n\t\t})\n\t\treturn { upserted: input.vectors.length, collection: indexName }\n\t}\n\n\tasync query(input: QueryVectorsInput): Promise<QueryVectorsOutput> {\n\t\tconst indexName = requireCollection(input.collection, this.#defaultIndex, 'Mastra vector query')\n\t\tconst topK = input.top_k ?? 8\n\t\tconst includeVector = input.include_values === true\n\t\tconst filter = mergeVectorFilter(this.#defaultFilter, input.filter)\n\n\t\tconst rows = await this.#store.query({\n\t\t\tindexName,\n\t\t\tqueryVector: input.vector,\n\t\t\ttopK,\n\t\t\tincludeVector,\n\t\t\t...(filter && { filter })\n\t\t})\n\n\t\tconst includeMetadata = input.include_metadata !== false\n\t\tconst matches: VectorMatch[] = []\n\t\tfor (const row of rows) {\n\t\t\tif (!isString(row.id) || row.id.length === 0) continue\n\t\t\tconst score = isNumber(row.score) ? row.score : 0\n\t\t\tconst match: VectorMatch = { id: row.id, score }\n\t\t\tif (includeMetadata && row.metadata !== undefined) {\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 (includeVector && Array.isArray(row.vector)) {\n\t\t\t\tconst values = row.vector.filter((n): n is number => isNumber(n) && Number.isFinite(n))\n\t\t\t\tif (values.length === row.vector.length) match.values = values\n\t\t\t}\n\t\t\tmatches.push(match)\n\t\t}\n\t\treturn { matches, collection: indexName }\n\t}\n\n\tasync delete(input: DeleteVectorsInput): Promise<DeleteVectorsOutput> {\n\t\tconst indexName = requireCollection(input.collection, this.#defaultIndex, 'Mastra vector delete')\n\t\tawait this.#store.deleteVectors({ indexName, ids: input.ids })\n\t\treturn { deleted: input.ids.length, collection: indexName }\n\t}\n\n\tasync disconnect(): Promise<void> {\n\t\tif (this.#ownsStore && this.#store.disconnect) {\n\t\t\tawait this.#store.disconnect()\n\t\t}\n\t}\n\n\tasync #ensureIndex(indexName: string, inferredDimension: number | undefined): Promise<void> {\n\t\tif (!this.#autoCreateIndex) return\n\t\tconst dimension = this.#dimension ?? inferredDimension\n\t\tif (dimension === undefined) {\n\t\t\tthrow new ToolError('Mastra auto_create_index requires dimension on auth or non-empty vectors', {\n\t\t\t\tcode: 'bad_input'\n\t\t\t})\n\t\t}\n\t\ttry {\n\t\t\tawait this.#store.createIndex({ indexName, dimension })\n\t\t} catch (error) {\n\t\t\tconst message = error instanceof Error ? error.message : String(error)\n\t\t\tif (/already exists|duplicate|exist/i.test(message)) return\n\t\t\tthrow new ToolError(`Mastra createIndex failed: ${message}`, {\n\t\t\t\tcode: 'upstream',\n\t\t\t\tcause: error\n\t\t\t})\n\t\t}\n\t}\n}\n","import { defineModule, defineTool } from '../../core/define'\nimport { MastraVectorClient } from './client'\nimport {\n\tdeleteVectorsInputSchema,\n\tdeleteVectorsOutputSchema,\n\tmastraVectorAuthSchema,\n\tqueryVectorsInputSchema,\n\tqueryVectorsOutputSchema,\n\tupsertVectorsInputSchema,\n\tupsertVectorsOutputSchema\n} from './contracts'\n\nexport const mastraVectorUpsertTool = defineTool({\n\tid: 'mastra-vector-upsert',\n\tname: 'mastraVectorUpsert',\n\tdescription: 'Upsert vectors into a Mastra PgVector index. collection maps to indexName.',\n\tinputSchema: upsertVectorsInputSchema,\n\toutputSchema: upsertVectorsOutputSchema,\n\tsideEffect: 'write',\n\truntime: 'node',\n\texecute: async (input, ctx) => MastraVectorClient.fromContext(ctx).upsert(input)\n})\n\nexport const mastraVectorQueryTool = defineTool({\n\tid: 'mastra-vector-query',\n\tname: 'mastraVectorQuery',\n\tdescription: 'Nearest-neighbor query against a Mastra PgVector index.',\n\tinputSchema: queryVectorsInputSchema,\n\toutputSchema: queryVectorsOutputSchema,\n\tsideEffect: 'read',\n\truntime: 'node',\n\texecute: async (input, ctx) => MastraVectorClient.fromContext(ctx).query(input)\n})\n\nexport const mastraVectorDeleteTool = defineTool({\n\tid: 'mastra-vector-delete',\n\tname: 'mastraVectorDelete',\n\tdescription: 'Delete vectors by id from a Mastra PgVector index.',\n\tinputSchema: deleteVectorsInputSchema,\n\toutputSchema: deleteVectorsOutputSchema,\n\tsideEffect: 'delete',\n\truntime: 'node',\n\texecute: async (input, ctx) => MastraVectorClient.fromContext(ctx).delete(input)\n})\n\nexport const mastraVectorModule = defineModule({\n\tid: 'mastra-vector',\n\ttitle: 'Mastra Vector',\n\tdescription:\n\t\t'Mastra PgVector over Postgres: upsert, query, and delete vectors. Index names map from collection. Node runtime.',\n\truntime: 'node',\n\tauth: { type: 'custom', schema: mastraVectorAuthSchema },\n\tcategories: ['ai', 'vector'],\n\tclassification: 'pii',\n\ttags: ['pgvector', 'mastra'],\n\ttools: [mastraVectorUpsertTool, mastraVectorQueryTool, mastraVectorDeleteTool]\n})\n"],"mappings":";;;;;;;;;;;;AAkCA,MAAa,yBAAyB,EAAE,OAAO;CAC9C,mBAAmB,EACjB,OAAO,CAAC,CACR,IAAI,CAAC,CAAC,CACN,SAAS,uEAAuE;CAClF,IAAI,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,gEAAgE;CAC/F,aAAa,EACX,OAAO,CAAC,CACR,IAAI,CAAC,CAAC,CACN,SAAS,CAAC,CACV,SAAS,0EAA0E;CACrF,eAAe,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,qDAAqD;CAC1G,WAAW,EACT,OAAO,CAAC,CACR,IAAI,CAAC,CACL,SAAS,CAAC,CACV,SAAS,CAAC,CACV,SAAS,8DAA8D;CACzE,mBAAmB,EACjB,QAAQ,CAAC,CACT,SAAS,CAAC,CACV,SAAS,oEAAoE;CAC/E,cAAc,EAAE,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,4DAA4D;CAC1G,gBAAgB,0BACd,SAAS,CAAC,CACV,SACA,kHACD;AACF,CAAC;;;;;;;;;ACbD,SAAS,cAAc,OAAsC;CAC5D,OACC,cAAc,K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U,OAAO,KAAK;GACrE,IAAI,kCAAkC,KAAK,OAAO,GAAG;GACrD,MAAM,IAAI,UAAU,8BAA8B,WAAW;IAC5D,MAAM;IACN,OAAO;GACR,CAAC;EACF;CACD;AACD;;;AC9MA,MAAa,yBAAyB,WAAW;CAChD,IAAI;CACJ,MAAM;CACN,aAAa;CACb,aAAa;CACb,cAAc;CACd,YAAY;CACZ,SAAS;CACT,SAAS,OAAO,OAAO,QAAQ,mBAAmB,YAAY,GAAG,CAAC,CAAC,OAAO,KAAK;AAChF,CAAC;AAED,MAAa,wBAAwB,WAAW;CAC/C,IAAI;CACJ,MAAM;CACN,aAAa;CACb,aAAa;CACb,cAAc;CACd,YAAY;CACZ,SAAS;CACT,SAAS,OAAO,OAAO,QAAQ,mBAAmB,YAAY,GAAG,CAAC,CAAC,MAAM,KAAK;AAC/E,CAAC;AAED,MAAa,yBAAyB,WAAW;CAChD,IAAI;CACJ,MAAM;CACN,aAAa;CACb,aAAa;CACb,cAAc;CACd,YAAY;CACZ,SAAS;CACT,SAAS,OAAO,OAAO,QAAQ,mBAAmB,YAAY,GAAG,CAAC,CAAC,OAAO,KAAK;AAChF,CAAC;AAED,MAAa,qBAAqB,aAAa;CAC9C,IAAI;CACJ,OAAO;CACP,aACC;CACD,SAAS;CACT,MAAM;EAAE,MAAM;EAAU,QAAQ;CAAuB;CACvD,YAAY,CAAC,MAAM,QAAQ;CAC3B,gBAAgB;CAChB,MAAM,CAAC,YAAY,QAAQ;CAC3B,OAAO;EAAC;EAAwB;EAAuB;CAAsB;AAC9E,CAAC"}
|
|
1
|
+
{"version":3,"file":"mastra-vector-qKG3L-Rw.js","names":["#store","#defaultIndex","#defaultFilter","#dimension","#autoCreateIndex","#ownsStore","#ensureIndex"],"sources":["../src/vendors/mastra-vector/contracts.ts","../src/vendors/mastra-vector/client.ts","../src/vendors/mastra-vector/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\n/**\n * Mastra PgVector auth (`@mastra/pg`).\n * Host owns Postgres connection + schema; package does not invent org policy.\n */\nexport const mastraVectorAuthSchema = z.object({\n\tconnection_string: z\n\t\t.string()\n\t\t.min(1)\n\t\t.describe('Postgres connection string for Mastra PgVector (e.g. Supabase DB URL)'),\n\tid: z.string().min(1).describe('Mastra vector store id (stable string for this store instance)'),\n\tschema_name: z\n\t\t.string()\n\t\t.min(1)\n\t\t.optional()\n\t\t.describe('Postgres schema for vector tables (e.g. agent); omit for package default'),\n\tdefault_index: z.string().min(1).optional().describe('Default index name when tool input omits collection'),\n\tdimension: z\n\t\t.number()\n\t\t.int()\n\t\t.positive()\n\t\t.optional()\n\t\t.describe('Embedding dimension; required when auto_create_index is true'),\n\tauto_create_index: z\n\t\t.boolean()\n\t\t.optional()\n\t\t.describe('When true, create the index on upsert if missing (needs dimension)'),\n\tdisable_init: z.boolean().optional().describe('Pass disableInit to PgVector (host manages migration/init)'),\n\tdefault_filter: vectorDefaultFilterSchema\n\t\t.optional()\n\t\t.describe(\n\t\t\t'Host-bound metadata filter always applied on query (Mongo-style / Mastra PG filter); flat keys stamped on upsert'\n\t\t)\n})\n\nexport type MastraVectorAuth = z.infer<typeof mastraVectorAuthSchema>\n","/**\n * Mastra PgVector vendor client (`@mastra/pg`).\n * Host: `new MastraVectorClient(auth)`. Agent tools: `fromContext(ctx)`.\n * Runtime: node (Postgres). Optional peer: `@mastra/pg`.\n */\n\nimport { PgVector } from '@mastra/pg'\nimport { isNumber, isPlainObject, isString } from 'es-toolkit'\n\nimport { ToolError } from '../../core/errors'\nimport { requireAuth } from '../../core/provider'\nimport type { ToolContext } from '../../core/types'\nimport { mergeVectorFilter, parseMetadata, requireCollection, stampDefaultFilterMetadata } from '../_vector/domain'\nimport type { VectorDefaultFilter } from '../_vector/domain'\nimport type {\n\tDeleteVectorsInput,\n\tDeleteVectorsOutput,\n\tMastraVectorAuth,\n\tQueryVectorsInput,\n\tQueryVectorsOutput,\n\tUpsertVectorsInput,\n\tUpsertVectorsOutput,\n\tVectorMatch\n} from './contracts'\nimport { mastraVectorAuthSchema } from './contracts'\n\n/** Injected / real store surface (filter is opaque Record for seam compatibility). */\ntype MastraStore = {\n\tupsert: (input: {\n\t\tindexName: string\n\t\tids: string[]\n\t\tvectors: number[][]\n\t\tmetadata: Array<Record<string, unknown>>\n\t}) => Promise<unknown>\n\tquery: (input: {\n\t\tindexName: string\n\t\tqueryVector: number[]\n\t\ttopK?: number\n\t\tincludeVector?: boolean\n\t\tfilter?: Record<string, unknown>\n\t}) => Promise<Array<{ id?: string; score?: number; metadata?: unknown; vector?: number[] }>>\n\tdeleteVectors: (input: { indexName: string; ids: string[] }) => Promise<unknown>\n\tcreateIndex: (input: { indexName: string; dimension: number }) => Promise<unknown>\n\tdisconnect?: () => Promise<void>\n}\n\ntype PgQueryArgs = Parameters<PgVector['query']>[0]\n\n/** Narrow a built arg bag to PgVector query params (Mongo-style filter is structural). */\nfunction isPgQueryArgs(value: unknown): value is PgQueryArgs {\n\treturn (\n\t\tisPlainObject(value) &&\n\t\tisString(value['indexName']) &&\n\t\tvalue['indexName'].length > 0 &&\n\t\tArray.isArray(value['queryVector'])\n\t)\n}\n\nexport type MastraVectorClientOptions = {\n\t/**\n\t * Test injection — production uses PgVector.\n\t * Must implement the same method names as PgVector for upsert/query/deleteVectors/createIndex.\n\t */\n\tstore?: MastraStore\n}\n\nexport class MastraVectorClient {\n\treadonly #store: MastraStore\n\treadonly #defaultIndex: string | undefined\n\treadonly #defaultFilter: VectorDefaultFilter | undefined\n\treadonly #dimension: number | undefined\n\treadonly #autoCreateIndex: boolean\n\treadonly #ownsStore: boolean\n\n\tconstructor(auth: MastraVectorAuth, options: MastraVectorClientOptions = {}) {\n\t\tconst parsed = mastraVectorAuthSchema.safeParse(auth)\n\t\tif (!parsed.success) {\n\t\t\tthrow new ToolError('Invalid Mastra vector 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\tconst data = parsed.data\n\t\tthis.#defaultIndex = data.default_index\n\t\tthis.#defaultFilter = data.default_filter\n\t\tthis.#dimension = data.dimension\n\t\tthis.#autoCreateIndex = data.auto_create_index === true\n\n\t\tif (options.store) {\n\t\t\tthis.#store = options.store\n\t\t\tthis.#ownsStore = false\n\t\t\treturn\n\t\t}\n\n\t\tconst config: {\n\t\t\tconnectionString: string\n\t\t\tid: string\n\t\t\tschemaName?: string\n\t\t\tdisableInit?: boolean\n\t\t} = {\n\t\t\tconnectionString: data.connection_string,\n\t\t\tid: data.id\n\t\t}\n\t\tif (data.schema_name) config.schemaName = data.schema_name\n\t\tif (data.disable_init === true) config.disableInit = true\n\n\t\tconst pg = new PgVector(config)\n\t\t// Adapt PgVector to opaque Record filters (Mongo-style / flat equality is native).\n\t\tthis.#store = {\n\t\t\tupsert: (input) =>\n\t\t\t\tpg.upsert({\n\t\t\t\t\tindexName: input.indexName,\n\t\t\t\t\tids: input.ids,\n\t\t\t\t\tvectors: input.vectors,\n\t\t\t\t\tmetadata: input.metadata\n\t\t\t\t}),\n\t\t\tquery: (input) => {\n\t\t\t\tconst args: Record<string, unknown> = {\n\t\t\t\t\tindexName: input.indexName,\n\t\t\t\t\tqueryVector: input.queryVector,\n\t\t\t\t\t...(input.topK !== undefined && { topK: input.topK }),\n\t\t\t\t\t...(input.includeVector !== undefined && { includeVector: input.includeVector }),\n\t\t\t\t\t...(input.filter !== undefined && { filter: input.filter })\n\t\t\t\t}\n\t\t\t\tif (!isPgQueryArgs(args)) {\n\t\t\t\t\tthrow new ToolError('Invalid Mastra vector query args', { code: 'internal' })\n\t\t\t\t}\n\t\t\t\treturn pg.query(args)\n\t\t\t},\n\t\t\tdeleteVectors: (input) => pg.deleteVectors({ indexName: input.indexName, ids: input.ids }),\n\t\t\tcreateIndex: (input) => pg.createIndex({ indexName: input.indexName, dimension: input.dimension }),\n\t\t\tdisconnect: () => pg.disconnect()\n\t\t}\n\t\tthis.#ownsStore = true\n\t}\n\n\tstatic fromContext(ctx: ToolContext): MastraVectorClient {\n\t\tconst auth = requireAuth(ctx, mastraVectorAuthSchema)\n\t\treturn new MastraVectorClient(auth)\n\t}\n\n\tasync upsert(input: UpsertVectorsInput): Promise<UpsertVectorsOutput> {\n\t\tconst indexName = requireCollection(input.collection, this.#defaultIndex, 'Mastra vector upsert')\n\t\tawait this.#ensureIndex(indexName, input.vectors[0]?.values.length)\n\n\t\tawait this.#store.upsert({\n\t\t\tindexName,\n\t\t\tids: input.vectors.map((point) => point.id),\n\t\t\tvectors: input.vectors.map((point) => point.values),\n\t\t\tmetadata: input.vectors.map((point) => stampDefaultFilterMetadata(point.metadata, this.#defaultFilter) ?? {})\n\t\t})\n\t\treturn { upserted: input.vectors.length, collection: indexName }\n\t}\n\n\tasync query(input: QueryVectorsInput): Promise<QueryVectorsOutput> {\n\t\tconst indexName = requireCollection(input.collection, this.#defaultIndex, 'Mastra vector query')\n\t\tconst topK = input.top_k ?? 8\n\t\tconst includeVector = input.include_values === true\n\t\tconst filter = mergeVectorFilter(this.#defaultFilter, input.filter)\n\n\t\tconst rows = await this.#store.query({\n\t\t\tindexName,\n\t\t\tqueryVector: input.vector,\n\t\t\ttopK,\n\t\t\tincludeVector,\n\t\t\t...(filter && { filter })\n\t\t})\n\n\t\tconst includeMetadata = input.include_metadata !== false\n\t\tconst matches: VectorMatch[] = []\n\t\tfor (const row of rows) {\n\t\t\tif (!isString(row.id) || row.id.length === 0) continue\n\t\t\tconst score = isNumber(row.score) ? row.score : 0\n\t\t\tconst match: VectorMatch = { id: row.id, score }\n\t\t\tif (includeMetadata && row.metadata !== undefined) {\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 (includeVector && Array.isArray(row.vector)) {\n\t\t\t\tconst values = row.vector.filter((n): n is number => isNumber(n) && Number.isFinite(n))\n\t\t\t\tif (values.length === row.vector.length) match.values = values\n\t\t\t}\n\t\t\tmatches.push(match)\n\t\t}\n\t\treturn { matches, collection: indexName }\n\t}\n\n\tasync delete(input: DeleteVectorsInput): Promise<DeleteVectorsOutput> {\n\t\tconst indexName = requireCollection(input.collection, this.#defaultIndex, 'Mastra vector delete')\n\t\tawait this.#store.deleteVectors({ indexName, ids: input.ids })\n\t\treturn { deleted: input.ids.length, collection: indexName }\n\t}\n\n\tasync disconnect(): Promise<void> {\n\t\tif (this.#ownsStore && this.#store.disconnect) {\n\t\t\tawait this.#store.disconnect()\n\t\t}\n\t}\n\n\tasync #ensureIndex(indexName: string, inferredDimension: number | undefined): Promise<void> {\n\t\tif (!this.#autoCreateIndex) return\n\t\tconst dimension = this.#dimension ?? inferredDimension\n\t\tif (dimension === undefined) {\n\t\t\tthrow new ToolError('Mastra auto_create_index requires dimension on auth or non-empty vectors', {\n\t\t\t\tcode: 'bad_input'\n\t\t\t})\n\t\t}\n\t\ttry {\n\t\t\tawait this.#store.createIndex({ indexName, dimension })\n\t\t} catch (error) {\n\t\t\tconst message = error instanceof Error ? error.message : String(error)\n\t\t\tif (/already exists|duplicate|exist/i.test(message)) return\n\t\t\tthrow new ToolError(`Mastra createIndex failed: ${message}`, {\n\t\t\t\tcode: 'upstream',\n\t\t\t\tcause: error\n\t\t\t})\n\t\t}\n\t}\n}\n","import { defineModule, defineTool } from '../../core/define'\nimport { MastraVectorClient } from './client'\nimport {\n\tdeleteVectorsInputSchema,\n\tdeleteVectorsOutputSchema,\n\tmastraVectorAuthSchema,\n\tqueryVectorsInputSchema,\n\tqueryVectorsOutputSchema,\n\tupsertVectorsInputSchema,\n\tupsertVectorsOutputSchema\n} from './contracts'\n\nexport const mastraVectorUpsertTool = defineTool({\n\tid: 'mastra-vector-upsert',\n\tname: 'mastraVectorUpsert',\n\tdescription: 'Upsert vectors into a Mastra PgVector index. collection maps to indexName.',\n\tinputSchema: upsertVectorsInputSchema,\n\toutputSchema: upsertVectorsOutputSchema,\n\tsideEffect: 'write',\n\truntime: 'node',\n\texecute: async (input, ctx) => MastraVectorClient.fromContext(ctx).upsert(input)\n})\n\nexport const mastraVectorQueryTool = defineTool({\n\tid: 'mastra-vector-query',\n\tname: 'mastraVectorQuery',\n\tdescription: 'Nearest-neighbor query against a Mastra PgVector index.',\n\tinputSchema: queryVectorsInputSchema,\n\toutputSchema: queryVectorsOutputSchema,\n\tsideEffect: 'read',\n\truntime: 'node',\n\texecute: async (input, ctx) => MastraVectorClient.fromContext(ctx).query(input)\n})\n\nexport const mastraVectorDeleteTool = defineTool({\n\tid: 'mastra-vector-delete',\n\tname: 'mastraVectorDelete',\n\tdescription: 'Delete vectors by id from a Mastra PgVector index.',\n\tinputSchema: deleteVectorsInputSchema,\n\toutputSchema: deleteVectorsOutputSchema,\n\tsideEffect: 'delete',\n\truntime: 'node',\n\texecute: async (input, ctx) => MastraVectorClient.fromContext(ctx).delete(input)\n})\n\nexport const mastraVectorModule = defineModule({\n\tid: 'mastra-vector',\n\ttitle: 'Mastra Vector',\n\tdescription:\n\t\t'Mastra PgVector over Postgres: upsert, query, and delete vectors. Index names map from collection. Node runtime.',\n\truntime: 'node',\n\tauth: { type: 'custom', schema: mastraVectorAuthSchema },\n\tcategories: ['ai', 'vector'],\n\tclassification: 'pii',\n\ttags: ['pgvector', 'mastra'],\n\ttools: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,SAAS;CACT,SAAS,OAAO,OAAO,QAAQ,mBAAmB,YAAY,GAAG,CAAC,CAAC,MAAM,KAAK;AAC/E,CAAC;AAED,MAAa,yBAAyB,WAAW;CAChD,IAAI;CACJ,MAAM;CACN,aAAa;CACb,aAAa;CACb,cAAc;CACd,YAAY;CACZ,SAAS;CACT,SAAS,OAAO,OAAO,QAAQ,mBAAmB,YAAY,GAAG,CAAC,CAAC,OAAO,KAAK;AAChF,CAAC;AAED,MAAa,qBAAqB,aAAa;CAC9C,IAAI;CACJ,OAAO;CACP,aACC;CACD,SAAS;CACT,MAAM;EAAE,MAAM;EAAU,QAAQ;CAAuB;CACvD,YAAY,CAAC,MAAM,QAAQ;CAC3B,gBAAgB;CAChB,MAAM,CAAC,YAAY,QAAQ;CAC3B,OAAO;EAAC;EAAwB;EAAuB;CAAsB;AAC9E,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as ToolError } from "../../errors-DoSpNHvs.js";
|
|
2
|
-
import { n as defineModule, r as defineTool } from "../../define-
|
|
2
|
+
import { n as defineModule, r as defineTool } from "../../define-DdFALdNf.js";
|
|
3
3
|
import { n as requireAuth } from "../../provider-CgDAlg6K.js";
|
|
4
4
|
import { n as findArtifactRefs, t as artifactRefSchema } from "../../artifact-D064mHfK.js";
|
|
5
5
|
import { n as bytesToBase64, o as utf8ToBytes, r as bytesToUtf8, t as base64ToBytes } from "../../bytes-BxpimpQx.js";
|
|
6
|
-
import { _ as MAX_OBJECT_BYTES, m as s3AuthSchema, p as S3Client } from "../../s3-
|
|
6
|
+
import { _ as MAX_OBJECT_BYTES, m as s3AuthSchema, p as S3Client } from "../../s3-TKCIZZ2q.js";
|
|
7
7
|
import { r as mediaTypeFromPath } from "../../content-type-E4_Qdoa0.js";
|
|
8
8
|
import { isFunction } from "es-toolkit";
|
|
9
9
|
import { z } from "zod";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as ToolError } from "../../errors-DoSpNHvs.js";
|
|
2
|
-
import { n as defineModule, r as defineTool } from "../../define-
|
|
2
|
+
import { n as defineModule, r as defineTool } from "../../define-DdFALdNf.js";
|
|
3
3
|
import { n as requireAuth } from "../../provider-CgDAlg6K.js";
|
|
4
4
|
import { t as artifactRefSchema } from "../../artifact-D064mHfK.js";
|
|
5
|
-
import { a as BedrockAgentCoreBrowserClient, c as browserSessionIdInputSchema, d as browserStreamSchema, l as browserSessionOutputSchema, s as bedrockAgentCoreBrowserAuthSchema, u as browserStartSessionInputSchema } from "../../bedrock-agentcore-browser-
|
|
6
|
-
import { c as CloudflareBrowserClient, l as plainTextFromHtml, p as cloudflareBrowserClientAuthSchema } from "../../cloudflare-browser-
|
|
5
|
+
import { a as BedrockAgentCoreBrowserClient, c as browserSessionIdInputSchema, d as browserStreamSchema, l as browserSessionOutputSchema, s as bedrockAgentCoreBrowserAuthSchema, u as browserStartSessionInputSchema } from "../../bedrock-agentcore-browser-yrEY9cUi.js";
|
|
6
|
+
import { c as CloudflareBrowserClient, l as plainTextFromHtml, p as cloudflareBrowserClientAuthSchema } from "../../cloudflare-browser-D9pG4RTj.js";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
//#region src/modules/browser/contracts.ts
|
|
9
9
|
const agentCoreBrowserSeamAuthSchema = bedrockAgentCoreBrowserAuthSchema.extend({ provider: z.literal("bedrock-agentcore") });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as ToolError } from "../../errors-DoSpNHvs.js";
|
|
2
|
-
import { n as defineModule, r as defineTool } from "../../define-
|
|
2
|
+
import { n as defineModule, r as defineTool } from "../../define-DdFALdNf.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import ICAL from "ical.js";
|
|
5
5
|
//#region src/modules/calendar/contracts.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as ToolError } from "../../errors-DoSpNHvs.js";
|
|
2
|
-
import { n as defineModule, r as defineTool } from "../../define-
|
|
2
|
+
import { n as defineModule, r as defineTool } from "../../define-DdFALdNf.js";
|
|
3
3
|
import { n as requireAuth } from "../../provider-CgDAlg6K.js";
|
|
4
|
-
import { _ as MAX_COMMAND_CHARS, g as MAX_CODE_CHARS, m as BedrockAgentCoreCodeInterpreterClient, x as bedrockAgentCoreCodeInterpreterAuthSchema, y as MAX_FILE_TEXT } from "../../bedrock-agentcore-code-interpreter-
|
|
5
|
-
import { F as cloudflareSandboxAuthSchema, v as CloudflareSandboxClient } from "../../cloudflare-sandbox-
|
|
4
|
+
import { _ as MAX_COMMAND_CHARS, g as MAX_CODE_CHARS, m as BedrockAgentCoreCodeInterpreterClient, x as bedrockAgentCoreCodeInterpreterAuthSchema, y as MAX_FILE_TEXT } from "../../bedrock-agentcore-code-interpreter-BnJnDxCp.js";
|
|
5
|
+
import { F as cloudflareSandboxAuthSchema, v as CloudflareSandboxClient } from "../../cloudflare-sandbox-DHE4fmiq.js";
|
|
6
6
|
import { isPlainObject, isString } from "es-toolkit";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
//#region src/modules/code-sandbox/contracts.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as defineModule, r as defineTool } from "../../define-
|
|
1
|
+
import { n as defineModule, r as defineTool } from "../../define-DdFALdNf.js";
|
|
2
2
|
import { n as extensionFromMediaType, r as mediaTypeFromPath, t as allExtensionsFromMediaType } from "../../content-type-E4_Qdoa0.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/modules/content-type/module.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as ToolError } from "../../errors-DoSpNHvs.js";
|
|
2
|
-
import { n as defineModule, r as defineTool } from "../../define-
|
|
2
|
+
import { n as defineModule, r as defineTool } from "../../define-DdFALdNf.js";
|
|
3
3
|
import { n as requireAuth } from "../../provider-CgDAlg6K.js";
|
|
4
4
|
import { a as toArrayBuffer, n as bytesToBase64, o as utf8ToBytes, t as base64ToBytes } from "../../bytes-BxpimpQx.js";
|
|
5
5
|
import { z } from "zod";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as defineModule, r as defineTool } from "../../define-
|
|
1
|
+
import { n as defineModule, r as defineTool } from "../../define-DdFALdNf.js";
|
|
2
2
|
import { n as requireAuth } from "../../provider-CgDAlg6K.js";
|
|
3
|
-
import { S as textractStatusInputSchema, _ as textractExtractResultSchema, a as TextractClient, b as textractExtractTextInputSchema, f as MAX_INLINE_EXTRACT_CHARS, h as textractAuthSchema, u as MAX_BATCH_EXTRACT, v as textractExtractTextBatchInputSchema, x as textractOutputModeSchema, y as textractExtractTextBatchOutputSchema } from "../../textract-
|
|
3
|
+
import { S as textractStatusInputSchema, _ as textractExtractResultSchema, a as TextractClient, b as textractExtractTextInputSchema, f as MAX_INLINE_EXTRACT_CHARS, h as textractAuthSchema, u as MAX_BATCH_EXTRACT, v as textractExtractTextBatchInputSchema, x as textractOutputModeSchema, y as textractExtractTextBatchOutputSchema } from "../../textract-CthgcP6w.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region src/modules/document-extract/contracts.ts
|
|
6
6
|
/** Host auth: vendor credentials + provider discriminator. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as defineModule, r as defineTool } from "../../define-
|
|
1
|
+
import { n as defineModule, r as defineTool } from "../../define-DdFALdNf.js";
|
|
2
2
|
import { n as requireAuth } from "../../provider-CgDAlg6K.js";
|
|
3
3
|
import { n as runBatchItems, t as batchResultSchema } from "../../batch-Co1ujeAW.js";
|
|
4
|
-
import { _ as cloudflareBrowserRenderScreenshotInputSchema, c as CloudflareBrowserClient, f as cloudflareBrowserAuthSchema, g as cloudflareBrowserRenderPdfInputSchema, h as cloudflareBrowserRenderOutputSchema } from "../../cloudflare-browser-
|
|
4
|
+
import { _ as cloudflareBrowserRenderScreenshotInputSchema, c as CloudflareBrowserClient, f as cloudflareBrowserAuthSchema, g as cloudflareBrowserRenderPdfInputSchema, h as cloudflareBrowserRenderOutputSchema } from "../../cloudflare-browser-D9pG4RTj.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
/** Host auth: vendor credentials + provider discriminator. */
|
|
7
7
|
const cloudflareBrowserDocumentRenderAuthSchema = cloudflareBrowserAuthSchema.extend({ provider: z.literal("cloudflare-browser") });
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { n as isToolError, t as ToolError } from "../../errors-DoSpNHvs.js";
|
|
2
|
-
import { n as defineModule, r as defineTool } from "../../define-
|
|
2
|
+
import { n as defineModule, r as defineTool } from "../../define-DdFALdNf.js";
|
|
3
3
|
import { n as requireAuth } from "../../provider-CgDAlg6K.js";
|
|
4
4
|
import { n as runBatchItems, t as batchResultSchema } from "../../batch-Co1ujeAW.js";
|
|
5
5
|
import { a as attachmentSchema, i as MAX_EMAIL_BYTES, o as namedAddressSchema, r as MAX_BATCH_EMAILS } from "../../limits-hjrO8zUG.js";
|
|
6
|
-
import { a as cloudflareEmailAuthSchema, i as CloudflareEmailClient } from "../../cloudflare-email-
|
|
7
|
-
import { a as resendAuthSchema, c as resendSendInputSchema, i as ResendClient } from "../../resend-
|
|
6
|
+
import { a as cloudflareEmailAuthSchema, i as CloudflareEmailClient } from "../../cloudflare-email-bsq902dg.js";
|
|
7
|
+
import { a as resendAuthSchema, c as resendSendInputSchema, i as ResendClient } from "../../resend-Cfgm4HuV.js";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
//#region src/modules/email/contracts.ts
|
|
10
10
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as ToolError } from "../../errors-DoSpNHvs.js";
|
|
2
|
-
import { n as defineModule, r as defineTool } from "../../define-
|
|
2
|
+
import { n as defineModule, r as defineTool } from "../../define-DdFALdNf.js";
|
|
3
3
|
import { n as bytesToBase64, o as utf8ToBytes, t as base64ToBytes } from "../../bytes-BxpimpQx.js";
|
|
4
4
|
import { isNil, isPlainObject, isString } from "es-toolkit";
|
|
5
5
|
import { castArray, has, isArray } from "es-toolkit/compat";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as ToolError } from "../../errors-DoSpNHvs.js";
|
|
2
|
-
import { n as defineModule, r as defineTool } from "../../define-
|
|
2
|
+
import { n as defineModule, r as defineTool } from "../../define-DdFALdNf.js";
|
|
3
3
|
import { n as requireAuth } from "../../provider-CgDAlg6K.js";
|
|
4
4
|
import { t as artifactRefSchema } from "../../artifact-D064mHfK.js";
|
|
5
5
|
import { n as bytesToBase64, r as bytesToUtf8 } from "../../bytes-BxpimpQx.js";
|
|
6
|
-
import { m as s3AuthSchema, p as S3Client } from "../../s3-
|
|
6
|
+
import { m as s3AuthSchema, p as S3Client } from "../../s3-TKCIZZ2q.js";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
//#region src/modules/files/contracts.ts
|
|
9
9
|
/** Max bytes for a single range read through files tools. */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as ToolError } from "../../errors-DoSpNHvs.js";
|
|
2
|
-
import { n as defineModule, r as defineTool } from "../../define-
|
|
2
|
+
import { n as defineModule, r as defineTool } from "../../define-DdFALdNf.js";
|
|
3
3
|
import { n as requireAuth } from "../../provider-CgDAlg6K.js";
|
|
4
4
|
import { t as artifactRefSchema } from "../../artifact-D064mHfK.js";
|
|
5
|
-
import { m as s3AuthSchema, p as S3Client } from "../../s3-
|
|
5
|
+
import { m as s3AuthSchema, p as S3Client } from "../../s3-TKCIZZ2q.js";
|
|
6
6
|
import { n as extensionFromMediaType, r as mediaTypeFromPath } from "../../content-type-E4_Qdoa0.js";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
import sharp from "sharp";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { t as ToolError } from "../../errors-DoSpNHvs.js";
|
|
2
|
-
import { n as defineModule, r as defineTool } from "../../define-
|
|
2
|
+
import { n as defineModule, r as defineTool } from "../../define-DdFALdNf.js";
|
|
3
3
|
import { n as requireAuth } from "../../provider-CgDAlg6K.js";
|
|
4
4
|
import { n as bytesToBase64, t as base64ToBytes } from "../../bytes-BxpimpQx.js";
|
|
5
|
-
import { m as s3AuthSchema, p as S3Client } from "../../s3-
|
|
5
|
+
import { m as s3AuthSchema, p as S3Client } from "../../s3-TKCIZZ2q.js";
|
|
6
6
|
import { n as runBatchItems, t as batchResultSchema } from "../../batch-Co1ujeAW.js";
|
|
7
|
-
import { d as ImessageClient, g as imessageAuthSchema, h as MAX_MEDIA_BYTES, m as isImessageOutcomeUnknown, p as isImessageDefiniteRejection } from "../../imessage-
|
|
7
|
+
import { d as ImessageClient, g as imessageAuthSchema, h as MAX_MEDIA_BYTES, m as isImessageOutcomeUnknown, p as isImessageDefiniteRejection } from "../../imessage-B-0DZfMa.js";
|
|
8
8
|
import { n as createTypingPulse, t as createLiveMessage } from "../../transport-B4vn-XiQ.js";
|
|
9
|
-
import { A as slackAuthSchema, C as isSlackOutcomeUnknown, S as isSlackDefiniteRejection, b as SlackClient, w as MAX_MEDIA_BYTES$1 } from "../../slack-
|
|
10
|
-
import { _ as isTeamsOutcomeUnknown, b as teamsAuthSchema, g as isTeamsDefiniteRejection, m as TeamsClient, v as MAX_MEDIA_BYTES$2 } from "../../teams-
|
|
11
|
-
import { _ as isTelegramOutcomeUnknown, b as telegramAuthSchema, g as isTelegramDefiniteRejection, m as TelegramClient, v as MAX_MEDIA_BYTES$3 } from "../../telegram-
|
|
9
|
+
import { A as slackAuthSchema, C as isSlackOutcomeUnknown, S as isSlackDefiniteRejection, b as SlackClient, w as MAX_MEDIA_BYTES$1 } from "../../slack-D6XzBS3b.js";
|
|
10
|
+
import { _ as isTeamsOutcomeUnknown, b as teamsAuthSchema, g as isTeamsDefiniteRejection, m as TeamsClient, v as MAX_MEDIA_BYTES$2 } from "../../teams-bGfle6pU.js";
|
|
11
|
+
import { _ as isTelegramOutcomeUnknown, b as telegramAuthSchema, g as isTelegramDefiniteRejection, m as TelegramClient, v as MAX_MEDIA_BYTES$3 } from "../../telegram-B-TZi9fM.js";
|
|
12
12
|
import { isError } from "es-toolkit";
|
|
13
13
|
import { z } from "zod";
|
|
14
14
|
//#region src/modules/messaging/contracts.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as defineModule, r as defineTool } from "../../define-
|
|
1
|
+
import { n as defineModule, r as defineTool } from "../../define-DdFALdNf.js";
|
|
2
2
|
import { n as requireAuth } from "../../provider-CgDAlg6K.js";
|
|
3
|
-
import { _ as sqsAuthSchema, c as queueAcknowledgeOutputSchema, d as queueExtendVisibilityInputSchema, f as queueExtendVisibilityOutputSchema, g as queueReceiveOutputSchema, h as queueReceiveInputSchema, l as queueEnqueueInputSchema, m as queueReceiptInputSchema, o as SqsClient, p as queueMessageSchema, u as queueEnqueueOutputSchema } from "../../sqs-
|
|
3
|
+
import { _ as sqsAuthSchema, c as queueAcknowledgeOutputSchema, d as queueExtendVisibilityInputSchema, f as queueExtendVisibilityOutputSchema, g as queueReceiveOutputSchema, h as queueReceiveInputSchema, l as queueEnqueueInputSchema, m as queueReceiptInputSchema, o as SqsClient, p as queueMessageSchema, u as queueEnqueueOutputSchema } from "../../sqs-B50DWyTf.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region src/modules/queue/contracts.ts
|
|
6
6
|
const sqsQueueAuthSchema = sqsAuthSchema.extend({ provider: z.literal("sqs") });
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as ToolError } from "../../errors-DoSpNHvs.js";
|
|
2
|
-
import { n as defineModule, r as defineTool } from "../../define-
|
|
2
|
+
import { n as defineModule, r as defineTool } from "../../define-DdFALdNf.js";
|
|
3
3
|
import { n as requireAuth } from "../../provider-CgDAlg6K.js";
|
|
4
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-
|
|
6
|
+
import { a as VectorStoreClient, c as qdrantVectorAuthSchema, l as supabaseVectorSeamAuthSchema, o as mastraVectorSeamAuthSchema, s as pineconeVectorAuthSchema } from "../../vector-store-DrwuMOne.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
|
-
import { n as defineModule, r as defineTool } from "../../define-
|
|
1
|
+
import { n as defineModule, r as defineTool } from "../../define-DdFALdNf.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-
|
|
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-ICepMPWG.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region src/modules/scheduler/contracts.ts
|
|
6
6
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as ToolError } from "../../errors-DoSpNHvs.js";
|
|
2
|
-
import { n as defineModule, r as defineTool } from "../../define-
|
|
2
|
+
import { n as defineModule, r as defineTool } from "../../define-DdFALdNf.js";
|
|
3
3
|
import { n as requireAuth } from "../../provider-CgDAlg6K.js";
|
|
4
4
|
import { isString } from "es-toolkit";
|
|
5
5
|
import { z } from "zod";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as defineModule, r as defineTool } from "../../define-
|
|
1
|
+
import { n as defineModule, r as defineTool } from "../../define-DdFALdNf.js";
|
|
2
2
|
import { n as requireAuth } from "../../provider-CgDAlg6K.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/modules/tasks/contracts.ts
|
|
@@ -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-
|
|
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-DrwuMOne.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,5 +1,5 @@
|
|
|
1
1
|
import { t as ToolError } from "../../errors-DoSpNHvs.js";
|
|
2
|
-
import { n as defineModule, r as defineTool } from "../../define-
|
|
2
|
+
import { n as defineModule, r as defineTool } from "../../define-DdFALdNf.js";
|
|
3
3
|
import { n as requireAuth } from "../../provider-CgDAlg6K.js";
|
|
4
4
|
import { i as mapTransportNetworkError, t as HttpService } from "../../http-service-BMBIryAL.js";
|
|
5
5
|
import { z } from "zod";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as ToolError } from "./errors-DoSpNHvs.js";
|
|
2
|
-
import { n as defineModule, r as defineTool } from "./define-
|
|
2
|
+
import { n as defineModule, r as defineTool } from "./define-DdFALdNf.js";
|
|
3
3
|
import { n as requireAuth } from "./provider-CgDAlg6K.js";
|
|
4
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";
|
|
@@ -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-
|
|
190
|
+
//# sourceMappingURL=pinecone-tmtu3ZS5.js.map
|
|
@@ -1 +1 @@
|
|
|
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,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AAe,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-tmtu3ZS5.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,UAAU,qCAAqC;GACxD,MAAM;GACN,SAAS,EAAE,QAAQ,OAAO,MAAM,OAAO,KAAK,UAAU,MAAM,OAAO,EAAE;EACtE,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;EAAU,QAAQ;CAAmB;CACnD,YAAY,CAAC,MAAM,QAAQ;CAC3B,gBAAgB;CAChB,MAAM,CAAC,UAAU;CACjB,OAAO;EAAC;EAAoB;EAAmB;CAAkB;AAClE,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as ToolError } from "./errors-DoSpNHvs.js";
|
|
2
|
-
import { n as defineModule, r as defineTool } from "./define-
|
|
2
|
+
import { n as defineModule, r as defineTool } from "./define-DdFALdNf.js";
|
|
3
3
|
import { n as requireAuth } from "./provider-CgDAlg6K.js";
|
|
4
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";
|
|
@@ -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-
|
|
253
|
+
//# sourceMappingURL=qdrant-zbCHUsnv.js.map
|
|
@@ -1 +1 @@
|
|
|
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,CA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Y,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-zbCHUsnv.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\tcateg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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,5 +1,5 @@
|
|
|
1
1
|
import { t as ToolError } from "./errors-DoSpNHvs.js";
|
|
2
|
-
import { n as defineModule, r as defineTool } from "./define-
|
|
2
|
+
import { n as defineModule, r as defineTool } from "./define-DdFALdNf.js";
|
|
3
3
|
import { n as requireAuth } from "./provider-CgDAlg6K.js";
|
|
4
4
|
import { t as HttpService } from "./http-service-BMBIryAL.js";
|
|
5
5
|
import { n as runBatchItems, t as batchResultSchema } from "./batch-Co1ujeAW.js";
|
|
@@ -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-
|
|
155
|
+
//# sourceMappingURL=resend-Cfgm4HuV.js.map
|