@tool-bridge/server 0.21.1 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin.js +170 -0
- package/dist/airtable-VMQVXLHK.js +790 -0
- package/dist/{alt_text_generator_ai-W7O34SNG.js → alt_text_generator_ai-FTWY4RU4.js} +12 -11
- package/dist/{amap-VOX4T2AW.js → amap-OK5VBHYC.js} +221 -220
- package/dist/anthropic-S67AZFZ3.js +203 -0
- package/dist/apify-ZE6MYQI3.js +248 -0
- package/dist/brave_search-TG2M2KOD.js +302 -0
- package/dist/chunk-2JNAI4OC.js +161 -0
- package/dist/{chunk-KMTT3I6D.js → chunk-4XJPN3DY.js} +19392 -26136
- package/dist/chunk-5ICRY3VU.js +8432 -0
- package/dist/chunk-7CTWGTDU.js +302 -0
- package/dist/chunk-BADVCN6K.js +378 -0
- package/dist/{chunk-XYBU3WZH.js → chunk-TDAWLMDE.js} +3 -3
- package/dist/chunk-U7PTOA3U.js +7320 -0
- package/dist/{chunk-E6JCVKW6.js → chunk-VWRUGUSU.js} +3 -3
- package/dist/{chunk-ATK45BXV.js → chunk-WJHG6OK7.js} +4 -2
- package/dist/circleci-3L3WJVSK.js +389 -0
- package/dist/clerk-EZPF2V7T.js +1019 -0
- package/dist/cohere-U27DPO64.js +185 -0
- package/dist/{confluence-B3EWPZVE.js → confluence-G2KL6ERH.js} +105 -104
- package/dist/{convertapi-EUWSQYPF.js → convertapi-L4CLJ2M3.js} +32 -31
- package/dist/{currencyapi-KVTIK3GL.js → currencyapi-YPYXG7YY.js} +71 -71
- package/dist/deepseek-6HT6WF3M.js +210 -0
- package/dist/docker_hub-LPE3PCVB.js +933 -0
- package/dist/dropbox-V56ABHTA.js +1305 -0
- package/dist/dub-6OKQ7MHT.js +680 -0
- package/dist/e2b-JS2U2QFU.js +278 -0
- package/dist/exa-DPWVYXSP.js +332 -0
- package/dist/{fal_ai-23E7JPNT.js → fal_ai-DK6Y27ZF.js} +81 -80
- package/dist/{feishu-7QRIDUV6.js → feishu-K7EGSRF3.js} +528 -572
- package/dist/{feishu_custom_bot-TJ4K7QNJ.js → feishu_custom_bot-2JUGFYNG.js} +57 -53
- package/dist/figma-FT5I7ITD.js +777 -0
- package/dist/firehydrant-EIKLKHX2.js +563 -0
- package/dist/{fixer-BWON27UO.js → fixer-U5QXIAKD.js} +34 -33
- package/dist/fly-T3JYFZ2M.js +469 -0
- package/dist/{front-QCGXYEDJ.js → front-D72MGVOR.js} +104 -104
- package/dist/geocodio-BOTD5TI5.js +213 -0
- package/dist/ghost-KYP7SZGB.js +338 -0
- package/dist/github-AGMZT3VY.js +5421 -0
- package/dist/gmail-BLJNJOBG.js +1887 -0
- package/dist/googlecalendar-GTHWNCF6.js +2524 -0
- package/dist/{googledocs-BUHL4J2H.js → googledocs-6EEDMEBQ.js} +341 -340
- package/dist/{grafana-GLU2DWF2.js → grafana-GMW6EKSQ.js} +221 -220
- package/dist/graphhopper-6OLGBDGB.js +325 -0
- package/dist/index.d.ts +1132 -332
- package/dist/index.js +31 -14
- package/dist/{ip2proxy-EZ64Y4ZH.js → ip2proxy-4QN42E6T.js} +28 -27
- package/dist/ipgeolocation_io-SK4XKDA2.js +315 -0
- package/dist/ipqualityscore-6ANBPXKT.js +279 -0
- package/dist/{jina_ai-EFBHTBXL.js → jina_ai-IHPSVRM5.js} +23 -23
- package/dist/{jira-HQSHAA5K.js → jira-46KKM4LC.js} +118 -117
- package/dist/langsmith-JZA345I5.js +593 -0
- package/dist/lemlist-43IV7DK6.js +289 -0
- package/dist/{linear-K7RYFYAD.js → linear-5LFH7XNL.js} +327 -326
- package/dist/logsnag-5RMYAHIL.js +150 -0
- package/dist/main.js +57 -280
- package/dist/{mattermost-S2BRCWLQ.js → mattermost-XFL6SHGG.js} +59 -58
- package/dist/mem0-NYO4DTP6.js +544 -0
- package/dist/memos-37MPQOLV.js +744 -0
- package/dist/{metabase-MMSEPCOF.js → metabase-KYBKZFMG.js} +90 -89
- package/dist/mistral_ai-6PL3K4PM.js +1196 -0
- package/dist/{mother_duck-H7PCQNZ2.js → mother_duck-2NH7W5M5.js} +94 -93
- package/dist/ngrok-UO6CDYCA.js +356 -0
- package/dist/{notes-PFMKRO33.js → notes-I3P32WP4.js} +11 -9
- package/dist/notion-BEAJFUOE.js +940 -0
- package/dist/open_exchange_rates-CMF62JB4.js +215 -0
- package/dist/openai-IHOMKVND.js +800 -0
- package/dist/opengraph_io-ZQ2FGLHX.js +362 -0
- package/dist/openrouter-HXLW3NR5.js +441 -0
- package/dist/outline-ELCP4NEU.js +599 -0
- package/dist/paddle-O77LALVN.js +454 -0
- package/dist/perplexity-JCU654QV.js +220 -0
- package/dist/pinecone-W5W4LRKL.js +571 -0
- package/dist/{pipedrive-Y2O7QGFF.js → pipedrive-ITMJLLPZ.js} +99 -98
- package/dist/polar-R33XU4L3.js +395 -0
- package/dist/posthog-JVNTOLTV.js +3464 -0
- package/dist/postmark-6SBG7HWV.js +427 -0
- package/dist/{prerender-MENYM2TY.js → prerender-GPNKTNFC.js} +31 -30
- package/dist/{pubmed-GOXUVVH5.js → pubmed-UP6ZEEIH.js} +239 -238
- package/dist/{railway-V2SID4WV.js → railway-KWEWXHTY.js} +118 -117
- package/dist/readwise-BLATSMC3.js +470 -0
- package/dist/render-QYRVIXII.js +461 -0
- package/dist/{replicate-756MXPYX.js → replicate-JYTWH4NF.js} +81 -80
- package/dist/{resend-ZKH3BTBI.js → resend-L5N75SZM.js} +20 -16
- package/dist/rootly-MHCPEQ26.js +336 -0
- package/dist/{scrapfly-NSRHFDIQ.js → scrapfly-PTPGYSJM.js} +62 -61
- package/dist/{scrapingbee-OQHLAVEY.js → scrapingbee-JN6UH5PY.js} +56 -56
- package/dist/{screenshot_fyi-DVWG3AXC.js → screenshot_fyi-4QRVSV55.js} +16 -16
- package/dist/semantic_scholar-LRSWA2GE.js +611 -0
- package/dist/{sentry-546MNDJG.js → sentry-2G6PF5W6.js} +208 -207
- package/dist/{shodan-C3OON3Z3.js → shodan-WKKPP5C6.js} +62 -61
- package/dist/shopify-64YDK5T2.js +610 -0
- package/dist/stripe-QAIGGOTF.js +585 -0
- package/dist/{supabase-U2SL4D63.js → supabase-WHTGR6ND.js} +245 -244
- package/dist/tavily-QIXCDDWO.js +326 -0
- package/dist/telegram-E6G7CWI6.js +1767 -0
- package/dist/{telnyx-CXQ4EZUX.js → telnyx-ZDVVS7PK.js} +57 -56
- package/dist/todoist-DMYF3G7J.js +664 -0
- package/dist/trello-HY2RYIRP.js +1080 -0
- package/dist/turso-HAQWMGRP.js +416 -0
- package/dist/{twilio-4PDBJKWX.js → twilio-MLXYPHJE.js} +70 -69
- package/dist/umami-DZHBLPVG.js +389 -0
- package/dist/unsplash-GS2OPXKE.js +351 -0
- package/dist/{upstash_redis-G4LQBYHA.js → upstash_redis-XMXWTNAJ.js} +51 -50
- package/dist/uptimerobot-TF5WRZ4G.js +483 -0
- package/dist/v2ex-2BVXAPDF.js +667 -0
- package/dist/vercel-YMJGQYJE.js +1076 -0
- package/dist/{wolfram_alpha_api-3G4PUJWB.js → wolfram_alpha_api-I56SXWFZ.js} +36 -35
- package/dist/wordpress-R7TDFZ2P.js +812 -0
- package/dist/workos-HDNHWVMS.js +664 -0
- package/dist/zhihu-LX6AGGDS.js +254 -0
- package/package.json +18 -9
- package/dist/airtable-LLZDFN7M.js +0 -789
- package/dist/anthropic-G23NN3X5.js +0 -202
- package/dist/apify-Y3SS734K.js +0 -247
- package/dist/brave_search-ZC7OAPSZ.js +0 -301
- package/dist/chunk-R6P4XAE5.js +0 -248
- package/dist/chunk-U7B6DS2O.js +0 -977
- package/dist/chunk-UZM2RXZH.js +0 -23436
- package/dist/circleci-3BAX5FCG.js +0 -388
- package/dist/clerk-6LEM6TNU.js +0 -1019
- package/dist/cloudflare_dns-KINYTJUD.js +0 -588
- package/dist/cohere-XCJ5AJ6B.js +0 -185
- package/dist/deepseek-PC5YGNC5.js +0 -209
- package/dist/docker_hub-C3MA5FU6.js +0 -932
- package/dist/dropbox-XBV7Z2IR.js +0 -1304
- package/dist/dub-LDOFG3HC.js +0 -679
- package/dist/e2b-JMCPSVBW.js +0 -277
- package/dist/exa-RAK7O7RD.js +0 -331
- package/dist/figma-E6IX5DTH.js +0 -773
- package/dist/firehydrant-ZBLPQREE.js +0 -562
- package/dist/fly-ZH3HFCZJ.js +0 -468
- package/dist/geocodio-YGNI7DA4.js +0 -212
- package/dist/ghost-EVSGKH2Q.js +0 -337
- package/dist/github-MA2BGRCJ.js +0 -5420
- package/dist/gmail-E5E6AADE.js +0 -1886
- package/dist/googlecalendar-BTLFPXTD.js +0 -2523
- package/dist/graphhopper-WSMB3TCD.js +0 -324
- package/dist/ipgeolocation_io-AA7HAS22.js +0 -315
- package/dist/ipqualityscore-BHJXVTJT.js +0 -277
- package/dist/langsmith-5W6SCT6F.js +0 -592
- package/dist/lemlist-HJWH6UMK.js +0 -288
- package/dist/logsnag-4KFOHL37.js +0 -150
- package/dist/mem0-CAW43CIC.js +0 -543
- package/dist/memos-TWEGPKFM.js +0 -740
- package/dist/mistral_ai-64BGZQHP.js +0 -1195
- package/dist/ngrok-GQCUGZKJ.js +0 -356
- package/dist/notion-DQWZWP4N.js +0 -936
- package/dist/open_exchange_rates-QMMD735E.js +0 -214
- package/dist/openai-W6PX32NZ.js +0 -799
- package/dist/opengraph_io-HNDBXYNW.js +0 -361
- package/dist/openrouter-JJYMEAUL.js +0 -437
- package/dist/outline-MCBNQZYY.js +0 -595
- package/dist/paddle-D2SKLUDN.js +0 -453
- package/dist/perplexity-XIFMKUAE.js +0 -219
- package/dist/pinecone-HUFTALV2.js +0 -570
- package/dist/polar-TYTOMOSR.js +0 -394
- package/dist/posthog-43JAR3VW.js +0 -3463
- package/dist/postmark-KL2QJYSG.js +0 -426
- package/dist/readwise-CI4GIMMJ.js +0 -469
- package/dist/render-SUBJ6YRZ.js +0 -460
- package/dist/rootly-CD2LJHPI.js +0 -336
- package/dist/semantic_scholar-T4A252KW.js +0 -610
- package/dist/shopify-Y2HN2MCQ.js +0 -609
- package/dist/stripe-VE3CD3AY.js +0 -584
- package/dist/tavily-KCZHK6HE.js +0 -326
- package/dist/telegram-3URFBCMY.js +0 -1766
- package/dist/todoist-HNPWNYTD.js +0 -663
- package/dist/trello-3W2MIXRP.js +0 -1079
- package/dist/turso-2EQF7C2Z.js +0 -415
- package/dist/umami-5REN7TGP.js +0 -388
- package/dist/unsplash-EIXL424F.js +0 -350
- package/dist/uptimerobot-KNJ3EYLY.js +0 -482
- package/dist/v2ex-RHJ234PZ.js +0 -666
- package/dist/vercel-AS6NCIC7.js +0 -1075
- package/dist/wordpress-KNDAAUV7.js +0 -811
- package/dist/workos-R6UITSJ7.js +0 -663
- package/dist/zhihu-AGK4HILK.js +0 -253
|
@@ -1,570 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createAuthedClient
|
|
3
|
-
} from "./chunk-XYBU3WZH.js";
|
|
4
|
-
import "./chunk-E6JCVKW6.js";
|
|
5
|
-
import {
|
|
6
|
-
asJsonObject,
|
|
7
|
-
compactDefined,
|
|
8
|
-
trimmedText
|
|
9
|
-
} from "./chunk-JXHMDBAY.js";
|
|
10
|
-
import {
|
|
11
|
-
createProviderPlugin,
|
|
12
|
-
upstreamError
|
|
13
|
-
} from "./chunk-ATK45BXV.js";
|
|
14
|
-
import "./chunk-U7B6DS2O.js";
|
|
15
|
-
import {
|
|
16
|
-
TBError,
|
|
17
|
-
external_exports
|
|
18
|
-
} from "./chunk-UZM2RXZH.js";
|
|
19
|
-
import "./chunk-U67V476Y.js";
|
|
20
|
-
|
|
21
|
-
// ../plugins/src/pinecone/api.ts
|
|
22
|
-
var SERVICE = "pinecone";
|
|
23
|
-
var CONTROL_API_BASE = "https://api.pinecone.io";
|
|
24
|
-
var API_VERSION = "2026-04";
|
|
25
|
-
function requireText(value, field) {
|
|
26
|
-
const result = trimmedText(value);
|
|
27
|
-
if (result === void 0) throw new TBError("invalid_argument", `${field} is required.`);
|
|
28
|
-
return result;
|
|
29
|
-
}
|
|
30
|
-
function compactDeep(value) {
|
|
31
|
-
if (Array.isArray(value)) return value.map((item) => compactDeep(item));
|
|
32
|
-
const fields = asJsonObject(value);
|
|
33
|
-
if (fields === void 0) return value;
|
|
34
|
-
return Object.fromEntries(
|
|
35
|
-
Object.entries(fields).filter(([, child]) => child !== void 0).map(([key, child]) => [key, compactDeep(child)])
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
function requireIndexHost(value) {
|
|
39
|
-
const host = requireText(value, "indexHost");
|
|
40
|
-
let parsed;
|
|
41
|
-
try {
|
|
42
|
-
parsed = new URL(host);
|
|
43
|
-
} catch {
|
|
44
|
-
throw new TBError("invalid_argument", "indexHost must be a valid absolute URL");
|
|
45
|
-
}
|
|
46
|
-
if (parsed.protocol !== "https:") throw new TBError("invalid_argument", "indexHost must use https");
|
|
47
|
-
if (parsed.username !== "" || parsed.password !== "") {
|
|
48
|
-
throw new TBError("invalid_argument", "indexHost must not include credentials");
|
|
49
|
-
}
|
|
50
|
-
parsed.search = "";
|
|
51
|
-
parsed.hash = "";
|
|
52
|
-
return parsed.origin;
|
|
53
|
-
}
|
|
54
|
-
function errorMessage(payload, status) {
|
|
55
|
-
if (typeof payload === "string") {
|
|
56
|
-
const message2 = trimmedText(payload);
|
|
57
|
-
if (message2 !== void 0) return message2;
|
|
58
|
-
}
|
|
59
|
-
const fields = asJsonObject(payload);
|
|
60
|
-
const message = trimmedText(fields?.message) ?? trimmedText(asJsonObject(fields?.error)?.message);
|
|
61
|
-
return message ?? `Pinecone request failed with status ${status}`;
|
|
62
|
-
}
|
|
63
|
-
var http = createAuthedClient({
|
|
64
|
-
service: SERVICE,
|
|
65
|
-
auth: { kind: "header", name: "api-key" },
|
|
66
|
-
// 每个请求都带 `x-pinecone-api-version`,它决定响应形状,不是可选优化项。
|
|
67
|
-
headers: { "accept": "application/json", "x-pinecone-api-version": API_VERSION },
|
|
68
|
-
mapError: ({ bodyKind, data, status }) => bodyKind === "invalid-json" ? upstreamError(502, "Pinecone returned invalid JSON") : upstreamError(status, errorMessage(data, status)),
|
|
69
|
-
mapTransportError: ({ message }) => upstreamError(
|
|
70
|
-
502,
|
|
71
|
-
message === void 0 ? "Pinecone request failed" : `Pinecone request failed: ${message}`
|
|
72
|
-
)
|
|
73
|
-
});
|
|
74
|
-
async function request(ctx, input) {
|
|
75
|
-
const result = await http.request(ctx, {
|
|
76
|
-
baseUrl: `${(input.baseUrl ?? CONTROL_API_BASE).replace(/\/+$/, "")}/`,
|
|
77
|
-
path: input.path,
|
|
78
|
-
method: input.method,
|
|
79
|
-
query: Object.entries(input.query ?? {}),
|
|
80
|
-
...input.body === void 0 ? {} : { json: compactDeep(input.body) },
|
|
81
|
-
invalidJsonMessage: "Pinecone returned invalid JSON"
|
|
82
|
-
});
|
|
83
|
-
return result.data === void 0 ? {} : result.data;
|
|
84
|
-
}
|
|
85
|
-
function requireObject(payload, label) {
|
|
86
|
-
const fields = asJsonObject(payload);
|
|
87
|
-
if (fields === void 0) throw upstreamError(502, `${label} must be a JSON object`);
|
|
88
|
-
return fields;
|
|
89
|
-
}
|
|
90
|
-
function objectArray(value) {
|
|
91
|
-
return Array.isArray(value) ? value : [];
|
|
92
|
-
}
|
|
93
|
-
function dataRequest(ctx, indexHost, input) {
|
|
94
|
-
return request(ctx, { ...input, baseUrl: requireIndexHost(indexHost) });
|
|
95
|
-
}
|
|
96
|
-
async function listIndexes(_input, ctx) {
|
|
97
|
-
const payload = requireObject(
|
|
98
|
-
await request(ctx, { method: "GET", path: "/indexes" }),
|
|
99
|
-
"Pinecone indexes response"
|
|
100
|
-
);
|
|
101
|
-
return { indexes: objectArray(payload.indexes) };
|
|
102
|
-
}
|
|
103
|
-
async function describeIndex(input, ctx) {
|
|
104
|
-
const payload = await request(ctx, {
|
|
105
|
-
method: "GET",
|
|
106
|
-
path: `/indexes/${encodeURIComponent(requireText(input.name, "name"))}`
|
|
107
|
-
});
|
|
108
|
-
return { index: requireObject(payload, "Pinecone index response") };
|
|
109
|
-
}
|
|
110
|
-
async function createIndex(input, ctx) {
|
|
111
|
-
const payload = await request(ctx, {
|
|
112
|
-
method: "POST",
|
|
113
|
-
path: "/indexes",
|
|
114
|
-
// camelCase 入参 → snake_case 请求体,且 spec 恒存在(只支持 serverless)。
|
|
115
|
-
body: compactDefined({
|
|
116
|
-
name: requireText(input.name, "name"),
|
|
117
|
-
dimension: typeof input.dimension === "number" ? input.dimension : void 0,
|
|
118
|
-
metric: trimmedText(input.metric),
|
|
119
|
-
vector_type: trimmedText(input.vectorType),
|
|
120
|
-
deletion_protection: trimmedText(input.deletionProtection),
|
|
121
|
-
tags: asJsonObject(input.tags),
|
|
122
|
-
spec: {
|
|
123
|
-
serverless: {
|
|
124
|
-
cloud: requireText(input.cloud, "cloud"),
|
|
125
|
-
region: requireText(input.region, "region")
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
})
|
|
129
|
-
});
|
|
130
|
-
return { index: requireObject(payload, "Pinecone create index response") };
|
|
131
|
-
}
|
|
132
|
-
async function configureIndex(input, ctx) {
|
|
133
|
-
const payload = await request(ctx, {
|
|
134
|
-
method: "PATCH",
|
|
135
|
-
path: `/indexes/${encodeURIComponent(requireText(input.name, "name"))}`,
|
|
136
|
-
body: compactDefined({
|
|
137
|
-
deletion_protection: trimmedText(input.deletionProtection),
|
|
138
|
-
tags: asJsonObject(input.tags),
|
|
139
|
-
// 没给 readCapacity 就整个不发 spec:发一个空 spec 会被 Pinecone 当成"改成空配置"。
|
|
140
|
-
spec: input.readCapacity ? { serverless: { read_capacity: asJsonObject(input.readCapacity) } } : void 0
|
|
141
|
-
})
|
|
142
|
-
});
|
|
143
|
-
return { index: requireObject(payload, "Pinecone configure index response") };
|
|
144
|
-
}
|
|
145
|
-
async function deleteIndex(input, ctx) {
|
|
146
|
-
await request(ctx, {
|
|
147
|
-
method: "DELETE",
|
|
148
|
-
path: `/indexes/${encodeURIComponent(requireText(input.name, "name"))}`
|
|
149
|
-
});
|
|
150
|
-
return { accepted: true };
|
|
151
|
-
}
|
|
152
|
-
async function getIndexStats(input, ctx) {
|
|
153
|
-
const payload = await dataRequest(ctx, input.indexHost, {
|
|
154
|
-
method: "POST",
|
|
155
|
-
path: "/describe_index_stats",
|
|
156
|
-
body: { filter: asJsonObject(input.filter) }
|
|
157
|
-
});
|
|
158
|
-
return { stats: requireObject(payload, "Pinecone index stats response") };
|
|
159
|
-
}
|
|
160
|
-
async function upsertVectors(input, ctx) {
|
|
161
|
-
const payload = requireObject(
|
|
162
|
-
await dataRequest(ctx, input.indexHost, {
|
|
163
|
-
method: "POST",
|
|
164
|
-
path: "/vectors/upsert",
|
|
165
|
-
body: { vectors: input.vectors, namespace: trimmedText(input.namespace) }
|
|
166
|
-
}),
|
|
167
|
-
"Pinecone upsert response"
|
|
168
|
-
);
|
|
169
|
-
return {
|
|
170
|
-
upsertedCount: typeof payload.upsertedCount === "number" ? payload.upsertedCount : 0,
|
|
171
|
-
raw: payload
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
async function queryVectors(input, ctx) {
|
|
175
|
-
if (!input.values && !input.sparseValues && !input.id) {
|
|
176
|
-
throw new TBError("invalid_argument", "query_vectors requires values, sparseValues, or id");
|
|
177
|
-
}
|
|
178
|
-
const payload = requireObject(
|
|
179
|
-
await dataRequest(ctx, input.indexHost, {
|
|
180
|
-
method: "POST",
|
|
181
|
-
path: "/query",
|
|
182
|
-
// 入参名与线上字段名不同:values → vector、sparseValues → sparseVector。
|
|
183
|
-
body: {
|
|
184
|
-
vector: input.values,
|
|
185
|
-
sparseVector: input.sparseValues,
|
|
186
|
-
id: trimmedText(input.id),
|
|
187
|
-
topK: input.topK,
|
|
188
|
-
namespace: trimmedText(input.namespace),
|
|
189
|
-
filter: asJsonObject(input.filter),
|
|
190
|
-
includeValues: input.includeValues,
|
|
191
|
-
includeMetadata: input.includeMetadata
|
|
192
|
-
}
|
|
193
|
-
}),
|
|
194
|
-
"Pinecone query response"
|
|
195
|
-
);
|
|
196
|
-
return {
|
|
197
|
-
matches: objectArray(payload.matches),
|
|
198
|
-
// null 与"字段缺席"是两回事:前者是上游明确说"这次没有 namespace"。
|
|
199
|
-
namespace: trimmedText(payload.namespace) ?? null,
|
|
200
|
-
usage: asJsonObject(payload.usage) ?? null,
|
|
201
|
-
raw: payload
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
async function fetchVectors(input, ctx) {
|
|
205
|
-
const payload = requireObject(
|
|
206
|
-
await dataRequest(ctx, input.indexHost, {
|
|
207
|
-
method: "GET",
|
|
208
|
-
path: "/vectors/fetch",
|
|
209
|
-
// fetch 是 GET:ids 展开成重复的同名 query 参数,不进请求体。
|
|
210
|
-
query: {
|
|
211
|
-
namespace: trimmedText(input.namespace),
|
|
212
|
-
ids: Array.isArray(input.ids) ? input.ids.map((id) => String(id)) : []
|
|
213
|
-
}
|
|
214
|
-
}),
|
|
215
|
-
"Pinecone fetch response"
|
|
216
|
-
);
|
|
217
|
-
return {
|
|
218
|
-
vectors: asJsonObject(payload.vectors) ?? {},
|
|
219
|
-
namespace: trimmedText(payload.namespace) ?? null,
|
|
220
|
-
usage: asJsonObject(payload.usage) ?? null,
|
|
221
|
-
raw: payload
|
|
222
|
-
};
|
|
223
|
-
}
|
|
224
|
-
async function listVectorIds(input, ctx) {
|
|
225
|
-
const payload = requireObject(
|
|
226
|
-
await dataRequest(ctx, input.indexHost, {
|
|
227
|
-
method: "GET",
|
|
228
|
-
path: "/vectors/list",
|
|
229
|
-
query: {
|
|
230
|
-
namespace: trimmedText(input.namespace),
|
|
231
|
-
prefix: trimmedText(input.prefix),
|
|
232
|
-
limit: input.limit === void 0 ? void 0 : String(input.limit),
|
|
233
|
-
paginationToken: trimmedText(input.paginationToken)
|
|
234
|
-
}
|
|
235
|
-
}),
|
|
236
|
-
"Pinecone list vectors response"
|
|
237
|
-
);
|
|
238
|
-
return {
|
|
239
|
-
vectors: objectArray(payload.vectors),
|
|
240
|
-
// 翻页靠它:上游没有下一页时给 null,把它压成 undefined 会让调用方分不清"到底了"。
|
|
241
|
-
pagination: asJsonObject(payload.pagination) ?? null,
|
|
242
|
-
raw: payload
|
|
243
|
-
};
|
|
244
|
-
}
|
|
245
|
-
async function deleteVectors(input, ctx) {
|
|
246
|
-
if (!input.ids && !input.filter && input.deleteAll !== true) {
|
|
247
|
-
throw new TBError("invalid_argument", "delete_vectors requires ids, filter, or deleteAll");
|
|
248
|
-
}
|
|
249
|
-
const payload = await dataRequest(ctx, input.indexHost, {
|
|
250
|
-
method: "POST",
|
|
251
|
-
path: "/vectors/delete",
|
|
252
|
-
body: {
|
|
253
|
-
ids: input.ids,
|
|
254
|
-
namespace: trimmedText(input.namespace),
|
|
255
|
-
filter: asJsonObject(input.filter),
|
|
256
|
-
deleteAll: input.deleteAll
|
|
257
|
-
}
|
|
258
|
-
});
|
|
259
|
-
return { raw: requireObject(payload, "Pinecone delete vectors response") };
|
|
260
|
-
}
|
|
261
|
-
async function updateVector(input, ctx) {
|
|
262
|
-
if (!input.id && !input.filter) {
|
|
263
|
-
throw new TBError("invalid_argument", "update_vector requires id or filter");
|
|
264
|
-
}
|
|
265
|
-
const payload = requireObject(
|
|
266
|
-
await dataRequest(ctx, input.indexHost, {
|
|
267
|
-
method: "POST",
|
|
268
|
-
path: "/vectors/update",
|
|
269
|
-
body: {
|
|
270
|
-
id: trimmedText(input.id),
|
|
271
|
-
values: input.values,
|
|
272
|
-
sparseValues: input.sparseValues,
|
|
273
|
-
setMetadata: asJsonObject(input.setMetadata),
|
|
274
|
-
namespace: trimmedText(input.namespace),
|
|
275
|
-
filter: asJsonObject(input.filter),
|
|
276
|
-
dryRun: input.dryRun
|
|
277
|
-
}
|
|
278
|
-
}),
|
|
279
|
-
"Pinecone update vector response"
|
|
280
|
-
);
|
|
281
|
-
return {
|
|
282
|
-
matchedRecords: typeof payload.matchedRecords === "number" ? payload.matchedRecords : null,
|
|
283
|
-
raw: payload
|
|
284
|
-
};
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
// ../plugins/src/pinecone/schema.ts
|
|
288
|
-
var listIndexesInput = external_exports.strictObject({}).describe("The input for listing Pinecone indexes.");
|
|
289
|
-
var listIndexesOutput = external_exports.strictObject({
|
|
290
|
-
indexes: external_exports.array(external_exports.looseObject({
|
|
291
|
-
name: external_exports.string().describe("The index name."),
|
|
292
|
-
host: external_exports.string().describe("The index host for data-plane operations.").optional(),
|
|
293
|
-
dimension: external_exports.int().describe("The vector dimension when present.").nullable().optional(),
|
|
294
|
-
metric: external_exports.string().describe("The similarity metric used by the index.").optional(),
|
|
295
|
-
vector_type: external_exports.string().describe("The vector type stored by the index.").optional(),
|
|
296
|
-
deletion_protection: external_exports.string().describe("Whether deletion protection is enabled for the index.").optional(),
|
|
297
|
-
spec: external_exports.looseObject({}).describe("A JSON object accepted or returned by Pinecone.").optional(),
|
|
298
|
-
status: external_exports.looseObject({}).describe("A JSON object accepted or returned by Pinecone.").optional(),
|
|
299
|
-
tags: external_exports.looseObject({}).describe("A JSON object accepted or returned by Pinecone.").optional()
|
|
300
|
-
}).describe("A Pinecone index description.")).describe("The indexes returned by Pinecone.").optional()
|
|
301
|
-
}).describe("The Pinecone indexes response.");
|
|
302
|
-
var describeIndexInput = external_exports.strictObject({
|
|
303
|
-
name: external_exports.string().min(1).describe("The Pinecone index name. Index names must be unique within a project.").optional()
|
|
304
|
-
}).describe("The input for describing one Pinecone index.");
|
|
305
|
-
var describeIndexOutput = external_exports.strictObject({
|
|
306
|
-
index: external_exports.looseObject({
|
|
307
|
-
name: external_exports.string().describe("The index name."),
|
|
308
|
-
host: external_exports.string().describe("The index host for data-plane operations.").optional(),
|
|
309
|
-
dimension: external_exports.int().describe("The vector dimension when present.").nullable().optional(),
|
|
310
|
-
metric: external_exports.string().describe("The similarity metric used by the index.").optional(),
|
|
311
|
-
vector_type: external_exports.string().describe("The vector type stored by the index.").optional(),
|
|
312
|
-
deletion_protection: external_exports.string().describe("Whether deletion protection is enabled for the index.").optional(),
|
|
313
|
-
spec: external_exports.looseObject({}).describe("A JSON object accepted or returned by Pinecone.").optional(),
|
|
314
|
-
status: external_exports.looseObject({}).describe("A JSON object accepted or returned by Pinecone.").optional(),
|
|
315
|
-
tags: external_exports.looseObject({}).describe("A JSON object accepted or returned by Pinecone.").optional()
|
|
316
|
-
}).describe("A Pinecone index description.").optional()
|
|
317
|
-
}).describe("The Pinecone index description response.");
|
|
318
|
-
var createIndexInput = external_exports.strictObject({
|
|
319
|
-
name: external_exports.string().min(1).describe("The Pinecone index name. Index names must be unique within a project."),
|
|
320
|
-
dimension: external_exports.int().min(1).max(2e4).describe("The vector dimension for dense indexes.").optional(),
|
|
321
|
-
metric: external_exports.enum(["cosine", "euclidean", "dotproduct"]).describe("The similarity metric for the index.").optional(),
|
|
322
|
-
cloud: external_exports.enum(["aws", "gcp", "azure"]).describe("The public cloud for a serverless index."),
|
|
323
|
-
region: external_exports.string().min(1).describe("The cloud region where the serverless index is created."),
|
|
324
|
-
vectorType: external_exports.enum(["dense", "sparse"]).describe("The index vector type.").optional(),
|
|
325
|
-
deletionProtection: external_exports.enum(["enabled", "disabled"]).describe("Whether deletion protection is enabled.").optional(),
|
|
326
|
-
tags: external_exports.record(external_exports.string(), external_exports.string().describe("One tag value.")).describe("The tags to attach to the index.").optional()
|
|
327
|
-
}).describe("The input for creating a Pinecone serverless index.");
|
|
328
|
-
var createIndexOutput = external_exports.strictObject({
|
|
329
|
-
index: external_exports.looseObject({
|
|
330
|
-
name: external_exports.string().describe("The index name."),
|
|
331
|
-
host: external_exports.string().describe("The index host for data-plane operations.").optional(),
|
|
332
|
-
dimension: external_exports.int().describe("The vector dimension when present.").nullable().optional(),
|
|
333
|
-
metric: external_exports.string().describe("The similarity metric used by the index.").optional(),
|
|
334
|
-
vector_type: external_exports.string().describe("The vector type stored by the index.").optional(),
|
|
335
|
-
deletion_protection: external_exports.string().describe("Whether deletion protection is enabled for the index.").optional(),
|
|
336
|
-
spec: external_exports.looseObject({}).describe("A JSON object accepted or returned by Pinecone.").optional(),
|
|
337
|
-
status: external_exports.looseObject({}).describe("A JSON object accepted or returned by Pinecone.").optional(),
|
|
338
|
-
tags: external_exports.looseObject({}).describe("A JSON object accepted or returned by Pinecone.").optional()
|
|
339
|
-
}).describe("A Pinecone index description.").optional()
|
|
340
|
-
}).describe("The Pinecone create index response.");
|
|
341
|
-
var configureIndexInput = external_exports.strictObject({
|
|
342
|
-
name: external_exports.string().min(1).describe("The Pinecone index name. Index names must be unique within a project."),
|
|
343
|
-
deletionProtection: external_exports.enum(["enabled", "disabled"]).describe("Whether deletion protection is enabled.").optional(),
|
|
344
|
-
tags: external_exports.record(external_exports.string(), external_exports.string().describe("One tag value.")).describe("The replacement tags to set on the index.").optional(),
|
|
345
|
-
readCapacity: external_exports.looseObject({}).describe("A JSON object accepted or returned by Pinecone.").optional()
|
|
346
|
-
}).describe("The input for configuring an existing Pinecone index.");
|
|
347
|
-
var configureIndexOutput = external_exports.strictObject({
|
|
348
|
-
index: external_exports.looseObject({
|
|
349
|
-
name: external_exports.string().describe("The index name."),
|
|
350
|
-
host: external_exports.string().describe("The index host for data-plane operations.").optional(),
|
|
351
|
-
dimension: external_exports.int().describe("The vector dimension when present.").nullable().optional(),
|
|
352
|
-
metric: external_exports.string().describe("The similarity metric used by the index.").optional(),
|
|
353
|
-
vector_type: external_exports.string().describe("The vector type stored by the index.").optional(),
|
|
354
|
-
deletion_protection: external_exports.string().describe("Whether deletion protection is enabled for the index.").optional(),
|
|
355
|
-
spec: external_exports.looseObject({}).describe("A JSON object accepted or returned by Pinecone.").optional(),
|
|
356
|
-
status: external_exports.looseObject({}).describe("A JSON object accepted or returned by Pinecone.").optional(),
|
|
357
|
-
tags: external_exports.looseObject({}).describe("A JSON object accepted or returned by Pinecone.").optional()
|
|
358
|
-
}).describe("A Pinecone index description.").optional()
|
|
359
|
-
}).describe("The Pinecone configure index response.");
|
|
360
|
-
var deleteIndexInput = external_exports.strictObject({
|
|
361
|
-
name: external_exports.string().min(1).describe("The Pinecone index name. Index names must be unique within a project.").optional()
|
|
362
|
-
}).describe("The input for deleting one Pinecone index.");
|
|
363
|
-
var deleteIndexOutput = external_exports.strictObject({
|
|
364
|
-
accepted: external_exports.boolean().describe("Whether Pinecone accepted the delete request.").optional()
|
|
365
|
-
}).describe("The Pinecone delete index response.");
|
|
366
|
-
var getIndexStatsInput = external_exports.strictObject({
|
|
367
|
-
indexHost: external_exports.url().describe("The full Pinecone index host URL used for data-plane operations, such as https://example.svc.us-east-1-aws.pinecone.io."),
|
|
368
|
-
filter: external_exports.looseObject({}).describe("The Pinecone metadata filter expression used to select records.").optional()
|
|
369
|
-
}).describe("The input for retrieving Pinecone index statistics.");
|
|
370
|
-
var getIndexStatsOutput = external_exports.strictObject({
|
|
371
|
-
stats: external_exports.looseObject({}).describe("A JSON object accepted or returned by Pinecone.").optional()
|
|
372
|
-
}).describe("The Pinecone index statistics response.");
|
|
373
|
-
var upsertVectorsInput = external_exports.strictObject({
|
|
374
|
-
indexHost: external_exports.url().describe("The full Pinecone index host URL used for data-plane operations, such as https://example.svc.us-east-1-aws.pinecone.io."),
|
|
375
|
-
vectors: external_exports.array(external_exports.strictObject({
|
|
376
|
-
id: external_exports.string().min(1).describe("The vector identifier."),
|
|
377
|
-
values: external_exports.array(external_exports.number().describe("One dense vector value.")).min(1).max(2e4).describe("The dense vector values.").optional(),
|
|
378
|
-
sparseValues: external_exports.strictObject({
|
|
379
|
-
indices: external_exports.array(external_exports.int().describe("One sparse vector index.")).min(1).max(2048).describe("The sparse vector indices.").optional(),
|
|
380
|
-
values: external_exports.array(external_exports.number().describe("One value.")).min(1).max(2048).describe("The sparse vector values matching the indices array.").optional()
|
|
381
|
-
}).describe("The sparse vector values and indices.").optional(),
|
|
382
|
-
metadata: external_exports.looseObject({}).describe("The metadata object associated with a Pinecone record.").optional()
|
|
383
|
-
}).describe("One vector record to upsert into Pinecone.")).min(1).max(1e3).describe("The vectors to upsert."),
|
|
384
|
-
namespace: external_exports.string().min(1).describe("The Pinecone namespace to read or write.").optional()
|
|
385
|
-
}).describe("The input for upserting vectors into Pinecone.");
|
|
386
|
-
var upsertVectorsOutput = external_exports.strictObject({
|
|
387
|
-
upsertedCount: external_exports.int().min(0).describe("The number of vectors upserted.").optional(),
|
|
388
|
-
raw: external_exports.looseObject({}).describe("A JSON object accepted or returned by Pinecone.").optional()
|
|
389
|
-
}).describe("The Pinecone upsert response.");
|
|
390
|
-
var queryVectorsInput = external_exports.strictObject({
|
|
391
|
-
indexHost: external_exports.url().describe("The full Pinecone index host URL used for data-plane operations, such as https://example.svc.us-east-1-aws.pinecone.io."),
|
|
392
|
-
values: external_exports.array(external_exports.number().describe("One dense vector value.")).min(1).max(2e4).describe("The dense vector values.").optional(),
|
|
393
|
-
sparseValues: external_exports.strictObject({
|
|
394
|
-
indices: external_exports.array(external_exports.int().describe("One sparse vector index.")).min(1).max(2048).describe("The sparse vector indices.").optional(),
|
|
395
|
-
values: external_exports.array(external_exports.number().describe("One value.")).min(1).max(2048).describe("The sparse vector values matching the indices array.").optional()
|
|
396
|
-
}).describe("The sparse vector values and indices.").optional(),
|
|
397
|
-
id: external_exports.string().min(1).describe("The vector ID to use as the query vector.").optional(),
|
|
398
|
-
topK: external_exports.int().min(1).max(1e4).describe("The number of similar vectors to return."),
|
|
399
|
-
namespace: external_exports.string().min(1).describe("The Pinecone namespace to read or write.").optional(),
|
|
400
|
-
filter: external_exports.looseObject({}).describe("The Pinecone metadata filter expression used to select records.").optional(),
|
|
401
|
-
includeValues: external_exports.boolean().describe("Whether to include vector values in the response.").optional(),
|
|
402
|
-
includeMetadata: external_exports.boolean().describe("Whether to include vector metadata in the response.").optional()
|
|
403
|
-
}).describe("The input for querying Pinecone vectors.");
|
|
404
|
-
var queryVectorsOutput = external_exports.strictObject({
|
|
405
|
-
matches: external_exports.array(external_exports.looseObject({}).describe("One match.")).describe("The vector matches returned by Pinecone.").optional(),
|
|
406
|
-
namespace: external_exports.string().describe("The namespace returned by Pinecone.").nullable().optional(),
|
|
407
|
-
usage: external_exports.looseObject({}).describe("The Pinecone usage object returned by the operation.").nullable().optional(),
|
|
408
|
-
raw: external_exports.looseObject({}).describe("A JSON object accepted or returned by Pinecone.").optional()
|
|
409
|
-
}).describe("The Pinecone query response.");
|
|
410
|
-
var fetchVectorsInput = external_exports.strictObject({
|
|
411
|
-
indexHost: external_exports.url().describe("The full Pinecone index host URL used for data-plane operations, such as https://example.svc.us-east-1-aws.pinecone.io."),
|
|
412
|
-
ids: external_exports.array(external_exports.string().min(1).describe("One vector ID.")).min(1).max(1e3).describe("The vector IDs to fetch."),
|
|
413
|
-
namespace: external_exports.string().min(1).describe("The Pinecone namespace to read or write.").optional()
|
|
414
|
-
}).describe("The input for fetching Pinecone vectors.");
|
|
415
|
-
var fetchVectorsOutput = external_exports.strictObject({
|
|
416
|
-
vectors: external_exports.record(external_exports.string(), external_exports.looseObject({
|
|
417
|
-
id: external_exports.string().describe("The vector identifier."),
|
|
418
|
-
values: external_exports.array(external_exports.number().describe("One dense vector value.")).min(1).max(2e4).describe("The dense vector values.").optional(),
|
|
419
|
-
sparseValues: external_exports.strictObject({
|
|
420
|
-
indices: external_exports.array(external_exports.int().describe("One sparse vector index.")).min(1).max(2048).describe("The sparse vector indices.").optional(),
|
|
421
|
-
values: external_exports.array(external_exports.number().describe("One value.")).min(1).max(2048).describe("The sparse vector values matching the indices array.").optional()
|
|
422
|
-
}).describe("The sparse vector values and indices.").optional(),
|
|
423
|
-
metadata: external_exports.looseObject({}).describe("The metadata object associated with a Pinecone record.").optional()
|
|
424
|
-
}).describe("A vector record returned by Pinecone.")).describe("The vectors keyed by ID.").optional(),
|
|
425
|
-
namespace: external_exports.string().describe("The namespace returned by Pinecone.").nullable().optional(),
|
|
426
|
-
usage: external_exports.looseObject({}).describe("The Pinecone usage object returned by the operation.").nullable().optional(),
|
|
427
|
-
raw: external_exports.looseObject({}).describe("A JSON object accepted or returned by Pinecone.").optional()
|
|
428
|
-
}).describe("The Pinecone fetch vectors response.");
|
|
429
|
-
var listVectorIdsInput = external_exports.strictObject({
|
|
430
|
-
indexHost: external_exports.url().describe("The full Pinecone index host URL used for data-plane operations, such as https://example.svc.us-east-1-aws.pinecone.io."),
|
|
431
|
-
namespace: external_exports.string().min(1).describe("The Pinecone namespace to read or write.").optional(),
|
|
432
|
-
prefix: external_exports.string().min(1).describe("The ID prefix used to filter vector IDs.").optional(),
|
|
433
|
-
limit: external_exports.int().min(1).max(1e3).describe("The maximum number of IDs to return.").optional(),
|
|
434
|
-
paginationToken: external_exports.string().min(1).describe("The pagination token returned by a previous Pinecone response.").optional()
|
|
435
|
-
}).describe("The input for listing Pinecone vector IDs.");
|
|
436
|
-
var listVectorIdsOutput = external_exports.strictObject({
|
|
437
|
-
vectors: external_exports.array(external_exports.looseObject({}).describe("One vector ID object.")).describe("The vector ID objects returned by Pinecone.").optional(),
|
|
438
|
-
pagination: external_exports.looseObject({}).describe("A JSON object accepted or returned by Pinecone.").nullable().optional(),
|
|
439
|
-
raw: external_exports.looseObject({}).describe("A JSON object accepted or returned by Pinecone.").optional()
|
|
440
|
-
}).describe("The Pinecone list vector IDs response.");
|
|
441
|
-
var deleteVectorsInput = external_exports.strictObject({
|
|
442
|
-
indexHost: external_exports.url().describe("The full Pinecone index host URL used for data-plane operations, such as https://example.svc.us-east-1-aws.pinecone.io."),
|
|
443
|
-
ids: external_exports.array(external_exports.string().min(1).describe("One vector ID.")).min(1).max(1e3).describe("The vector IDs to delete.").optional(),
|
|
444
|
-
namespace: external_exports.string().min(1).describe("The Pinecone namespace to read or write.").optional(),
|
|
445
|
-
filter: external_exports.looseObject({}).describe("The Pinecone metadata filter expression used to select records.").optional(),
|
|
446
|
-
deleteAll: external_exports.boolean().describe("Whether to delete all records in the namespace.").optional()
|
|
447
|
-
}).describe("The input for deleting Pinecone vectors.");
|
|
448
|
-
var deleteVectorsOutput = external_exports.strictObject({
|
|
449
|
-
raw: external_exports.looseObject({}).describe("A JSON object accepted or returned by Pinecone.").optional()
|
|
450
|
-
}).describe("The Pinecone delete vectors response.");
|
|
451
|
-
var updateVectorInput = external_exports.strictObject({
|
|
452
|
-
indexHost: external_exports.url().describe("The full Pinecone index host URL used for data-plane operations, such as https://example.svc.us-east-1-aws.pinecone.io."),
|
|
453
|
-
id: external_exports.string().min(1).describe("The vector ID to update.").optional(),
|
|
454
|
-
values: external_exports.array(external_exports.number().describe("One dense vector value.")).min(1).max(2e4).describe("The dense vector values.").optional(),
|
|
455
|
-
sparseValues: external_exports.strictObject({
|
|
456
|
-
indices: external_exports.array(external_exports.int().describe("One sparse vector index.")).min(1).max(2048).describe("The sparse vector indices.").optional(),
|
|
457
|
-
values: external_exports.array(external_exports.number().describe("One value.")).min(1).max(2048).describe("The sparse vector values matching the indices array.").optional()
|
|
458
|
-
}).describe("The sparse vector values and indices.").optional(),
|
|
459
|
-
setMetadata: external_exports.looseObject({}).describe("The metadata object associated with a Pinecone record.").optional(),
|
|
460
|
-
namespace: external_exports.string().min(1).describe("The Pinecone namespace to read or write.").optional(),
|
|
461
|
-
filter: external_exports.looseObject({}).describe("The Pinecone metadata filter expression used to select records.").optional(),
|
|
462
|
-
dryRun: external_exports.boolean().describe("Whether to count matching records without applying the update.").optional()
|
|
463
|
-
}).describe("The input for updating Pinecone vectors.");
|
|
464
|
-
var updateVectorOutput = external_exports.strictObject({
|
|
465
|
-
matchedRecords: external_exports.int().min(0).describe("The number of records matched when Pinecone returns a count.").nullable().optional(),
|
|
466
|
-
raw: external_exports.looseObject({}).describe("A JSON object accepted or returned by Pinecone.").optional()
|
|
467
|
-
}).describe("The Pinecone update vector response.");
|
|
468
|
-
var pineconeActions = {
|
|
469
|
-
list_indexes: {
|
|
470
|
-
description: "List Pinecone indexes in the authenticated project.",
|
|
471
|
-
effect: "read",
|
|
472
|
-
inputSchema: listIndexesInput,
|
|
473
|
-
outputSchema: external_exports.toJSONSchema(listIndexesOutput, { io: "output", unrepresentable: "any" })
|
|
474
|
-
},
|
|
475
|
-
describe_index: {
|
|
476
|
-
description: "Describe one Pinecone index by name.",
|
|
477
|
-
effect: "read",
|
|
478
|
-
inputSchema: describeIndexInput,
|
|
479
|
-
outputSchema: external_exports.toJSONSchema(describeIndexOutput, { io: "output", unrepresentable: "any" })
|
|
480
|
-
},
|
|
481
|
-
create_index: {
|
|
482
|
-
description: "Create a Pinecone serverless index.",
|
|
483
|
-
effect: "write",
|
|
484
|
-
inputSchema: createIndexInput,
|
|
485
|
-
outputSchema: external_exports.toJSONSchema(createIndexOutput, { io: "output", unrepresentable: "any" })
|
|
486
|
-
},
|
|
487
|
-
configure_index: {
|
|
488
|
-
description: "Configure an existing Pinecone index.",
|
|
489
|
-
effect: "write",
|
|
490
|
-
inputSchema: configureIndexInput,
|
|
491
|
-
outputSchema: external_exports.toJSONSchema(configureIndexOutput, { io: "output", unrepresentable: "any" })
|
|
492
|
-
},
|
|
493
|
-
delete_index: {
|
|
494
|
-
description: "Delete one Pinecone index by name.",
|
|
495
|
-
effect: "destructive",
|
|
496
|
-
inputSchema: deleteIndexInput,
|
|
497
|
-
outputSchema: external_exports.toJSONSchema(deleteIndexOutput, { io: "output", unrepresentable: "any" })
|
|
498
|
-
},
|
|
499
|
-
get_index_stats: {
|
|
500
|
-
description: "Get statistics for a Pinecone index.",
|
|
501
|
-
effect: "read",
|
|
502
|
-
inputSchema: getIndexStatsInput,
|
|
503
|
-
outputSchema: external_exports.toJSONSchema(getIndexStatsOutput, { io: "output", unrepresentable: "any" })
|
|
504
|
-
},
|
|
505
|
-
upsert_vectors: {
|
|
506
|
-
description: "Upsert dense or sparse vectors into a Pinecone index namespace.",
|
|
507
|
-
effect: "write",
|
|
508
|
-
inputSchema: upsertVectorsInput,
|
|
509
|
-
outputSchema: external_exports.toJSONSchema(upsertVectorsOutput, { io: "output", unrepresentable: "any" })
|
|
510
|
-
},
|
|
511
|
-
query_vectors: {
|
|
512
|
-
description: "Search a Pinecone index namespace with a query vector.",
|
|
513
|
-
effect: "write",
|
|
514
|
-
inputSchema: queryVectorsInput,
|
|
515
|
-
outputSchema: external_exports.toJSONSchema(queryVectorsOutput, { io: "output", unrepresentable: "any" })
|
|
516
|
-
},
|
|
517
|
-
fetch_vectors: {
|
|
518
|
-
description: "Fetch Pinecone vectors by ID from one namespace.",
|
|
519
|
-
effect: "read",
|
|
520
|
-
inputSchema: fetchVectorsInput,
|
|
521
|
-
outputSchema: external_exports.toJSONSchema(fetchVectorsOutput, { io: "output", unrepresentable: "any" })
|
|
522
|
-
},
|
|
523
|
-
list_vector_ids: {
|
|
524
|
-
description: "List vector IDs in a Pinecone serverless index namespace.",
|
|
525
|
-
effect: "read",
|
|
526
|
-
inputSchema: listVectorIdsInput,
|
|
527
|
-
outputSchema: external_exports.toJSONSchema(listVectorIdsOutput, { io: "output", unrepresentable: "any" })
|
|
528
|
-
},
|
|
529
|
-
delete_vectors: {
|
|
530
|
-
description: "Delete vectors from a Pinecone index namespace by IDs, filter, or deleteAll.",
|
|
531
|
-
effect: "destructive",
|
|
532
|
-
inputSchema: deleteVectorsInput,
|
|
533
|
-
outputSchema: external_exports.toJSONSchema(deleteVectorsOutput, { io: "output", unrepresentable: "any" })
|
|
534
|
-
},
|
|
535
|
-
update_vector: {
|
|
536
|
-
description: "Update one Pinecone vector or metadata-matched records in a namespace.",
|
|
537
|
-
effect: "write",
|
|
538
|
-
inputSchema: updateVectorInput,
|
|
539
|
-
outputSchema: external_exports.toJSONSchema(updateVectorOutput, { io: "output", unrepresentable: "any" })
|
|
540
|
-
}
|
|
541
|
-
};
|
|
542
|
-
|
|
543
|
-
// ../plugins/src/pinecone/index.ts
|
|
544
|
-
function createPineconePlugin() {
|
|
545
|
-
return createProviderPlugin({
|
|
546
|
-
description: "Pinecone",
|
|
547
|
-
actions: pineconeActions,
|
|
548
|
-
// 上游 validatePineconeCredential 也打 /indexes —— 只读、无入参,正好当挂载时的凭证探针。
|
|
549
|
-
credentialProbe: "list_indexes",
|
|
550
|
-
handlers: {
|
|
551
|
-
list_indexes: listIndexes,
|
|
552
|
-
describe_index: describeIndex,
|
|
553
|
-
create_index: createIndex,
|
|
554
|
-
configure_index: configureIndex,
|
|
555
|
-
delete_index: deleteIndex,
|
|
556
|
-
get_index_stats: getIndexStats,
|
|
557
|
-
upsert_vectors: upsertVectors,
|
|
558
|
-
query_vectors: queryVectors,
|
|
559
|
-
fetch_vectors: fetchVectors,
|
|
560
|
-
list_vector_ids: listVectorIds,
|
|
561
|
-
delete_vectors: deleteVectors,
|
|
562
|
-
update_vector: updateVector
|
|
563
|
-
}
|
|
564
|
-
});
|
|
565
|
-
}
|
|
566
|
-
var pinecone_default = createPineconePlugin();
|
|
567
|
-
export {
|
|
568
|
-
createPineconePlugin,
|
|
569
|
-
pinecone_default as default
|
|
570
|
-
};
|