@tool-bridge/server 0.1.1 → 0.3.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.
Files changed (107) hide show
  1. package/dist/airtable-V6446SVY.js +792 -0
  2. package/dist/alt_text_generator_ai-HV7JZPDT.js +72 -0
  3. package/dist/amap-TTTVB6WS.js +755 -0
  4. package/dist/anthropic-JH3RA363.js +224 -0
  5. package/dist/apify-ETNN7ITU.js +262 -0
  6. package/dist/brave_search-3DDR2MMB.js +322 -0
  7. package/dist/chunk-CSJEZHQO.js +252 -0
  8. package/dist/chunk-JLTYA2B3.js +20121 -0
  9. package/dist/chunk-K7FVSFUX.js +333 -0
  10. package/dist/{chunk-MQEYFCJB.js → chunk-KGYJEEBI.js} +2770 -21574
  11. package/dist/circleci-MX3TX3HC.js +409 -0
  12. package/dist/clerk-MRPORVF4.js +1036 -0
  13. package/dist/cloudflare_dns-OWP7DD7L.js +605 -0
  14. package/dist/cohere-GPECP66S.js +197 -0
  15. package/dist/confluence-BN7LZ6BC.js +436 -0
  16. package/dist/convertapi-SBEOFOFQ.js +161 -0
  17. package/dist/currencyapi-P2YY7Y7P.js +306 -0
  18. package/dist/deepseek-MWB3NYIN.js +205 -0
  19. package/dist/docker_hub-3JSCIGQ3.js +946 -0
  20. package/dist/dropbox-RFIBDAXO.js +1308 -0
  21. package/dist/dub-YVP57ELQ.js +706 -0
  22. package/dist/e2b-NFSUHTZR.js +305 -0
  23. package/dist/exa-KTDY6IV3.js +360 -0
  24. package/dist/fal_ai-OCUENLNQ.js +405 -0
  25. package/dist/feishu-5CWBQ7E5.js +225 -0
  26. package/dist/feishu_custom_bot-ZJR22OK6.js +240 -0
  27. package/dist/figma-YULGANSA.js +798 -0
  28. package/dist/firehydrant-2V6YSYAP.js +573 -0
  29. package/dist/fixer-LTCDB3CJ.js +171 -0
  30. package/dist/fly-IXPKMAML.js +478 -0
  31. package/dist/front-KRFB4M5X.js +379 -0
  32. package/dist/geocodio-VVURKYHQ.js +236 -0
  33. package/dist/ghost-6J2RIOUB.js +341 -0
  34. package/dist/github-5Z6KQRYH.js +5410 -0
  35. package/dist/gmail-KU4NZ7VA.js +1894 -0
  36. package/dist/googlecalendar-X44DFFXG.js +2539 -0
  37. package/dist/googledocs-WSGLPKSF.js +1322 -0
  38. package/dist/grafana-4PKSSDXY.js +817 -0
  39. package/dist/graphhopper-DF65ZNGK.js +336 -0
  40. package/dist/index.d.ts +181 -2
  41. package/dist/index.js +2 -1
  42. package/dist/ip2proxy-UCAQ5P2J.js +118 -0
  43. package/dist/ipgeolocation_io-UX6FCA2S.js +333 -0
  44. package/dist/ipqualityscore-MKTRXIZJ.js +287 -0
  45. package/dist/jina_ai-MRHPCSV5.js +119 -0
  46. package/dist/jira-EG7ZPOIW.js +627 -0
  47. package/dist/langsmith-FNO3RCOZ.js +597 -0
  48. package/dist/lemlist-SN6BJHSG.js +298 -0
  49. package/dist/linear-H3VU4PSD.js +2163 -0
  50. package/dist/logsnag-OY2JJT2H.js +167 -0
  51. package/dist/main.js +246 -2
  52. package/dist/mattermost-C5SQ7PGD.js +320 -0
  53. package/dist/mem0-LMLE5BFC.js +567 -0
  54. package/dist/memos-UWFAMBZC.js +781 -0
  55. package/dist/metabase-SRYDSDJ6.js +365 -0
  56. package/dist/mistral_ai-YNIJ7VDM.js +1195 -0
  57. package/dist/mother_duck-CPGOFEXE.js +322 -0
  58. package/dist/ngrok-CDJFBSOM.js +375 -0
  59. package/dist/notes-DIVFH3P3.js +109 -0
  60. package/dist/notion-HGDKS4HK.js +945 -0
  61. package/dist/open_exchange_rates-COHHYJDD.js +216 -0
  62. package/dist/openai-4TRT66GW.js +795 -0
  63. package/dist/opengraph_io-YKVW4PXI.js +377 -0
  64. package/dist/openrouter-6CV7B7V5.js +444 -0
  65. package/dist/outline-YWDUK5F7.js +604 -0
  66. package/dist/paddle-MEU7HWDZ.js +464 -0
  67. package/dist/perplexity-MRQUDBIC.js +238 -0
  68. package/dist/pinecone-JI7X2TAF.js +599 -0
  69. package/dist/pipedrive-6JQPAW23.js +453 -0
  70. package/dist/polar-7BF56CMC.js +400 -0
  71. package/dist/posthog-YPU5ADEN.js +3462 -0
  72. package/dist/postmark-BEU5OFKU.js +441 -0
  73. package/dist/prerender-UT5GOOZH.js +180 -0
  74. package/dist/pubmed-3SGOE24Q.js +1052 -0
  75. package/dist/railway-CEK4GLRQ.js +452 -0
  76. package/dist/readwise-DXQUQU67.js +482 -0
  77. package/dist/render-7TGAU5AW.js +473 -0
  78. package/dist/replicate-VICFSQ5A.js +347 -0
  79. package/dist/resend-3E76WK3O.js +100 -0
  80. package/dist/rootly-36GY46BY.js +345 -0
  81. package/dist/scrapfly-VDVUYAHX.js +289 -0
  82. package/dist/scrapingbee-3KTPMAVY.js +247 -0
  83. package/dist/screenshot_fyi-LKG62C3J.js +116 -0
  84. package/dist/semantic_scholar-4WREECYO.js +626 -0
  85. package/dist/sentry-HUQTGXOV.js +1139 -0
  86. package/dist/shodan-SGRKU4KS.js +303 -0
  87. package/dist/shopify-YCZ4L5HT.js +620 -0
  88. package/dist/stripe-OEBKMELB.js +583 -0
  89. package/dist/supabase-I3DBY7L4.js +937 -0
  90. package/dist/tavily-B2YHCNRD.js +349 -0
  91. package/dist/telegram-2VYJELZX.js +1773 -0
  92. package/dist/telnyx-HHXD3CXL.js +237 -0
  93. package/dist/todoist-PHFDEEIS.js +672 -0
  94. package/dist/trello-WUSAK6YN.js +1091 -0
  95. package/dist/turso-FW56U2B3.js +432 -0
  96. package/dist/twilio-M5JI7XHA.js +321 -0
  97. package/dist/umami-HAYODRC4.js +411 -0
  98. package/dist/unsplash-EDPTNEHJ.js +364 -0
  99. package/dist/upstash_redis-GC2CLIWD.js +299 -0
  100. package/dist/uptimerobot-XMSNYLIT.js +481 -0
  101. package/dist/v2ex-KU4ECD65.js +672 -0
  102. package/dist/vercel-THPCEFHW.js +1096 -0
  103. package/dist/wolfram_alpha_api-WHHTH4GU.js +212 -0
  104. package/dist/wordpress-O6TQEQNF.js +822 -0
  105. package/dist/workos-A3VHHWI3.js +681 -0
  106. package/dist/zhihu-BJAI64YJ.js +273 -0
  107. package/package.json +5 -4
@@ -0,0 +1,781 @@
1
+ import {
2
+ assertPublicHttpUrl,
3
+ createProviderPlugin,
4
+ guardedFetch,
5
+ requireApiKey,
6
+ upstreamError
7
+ } from "./chunk-CSJEZHQO.js";
8
+ import "./chunk-K7FVSFUX.js";
9
+ import {
10
+ TBError,
11
+ external_exports
12
+ } from "./chunk-JLTYA2B3.js";
13
+ import "./chunk-MLKGABMK.js";
14
+
15
+ // ../plugins/src/memos/api.ts
16
+ var SERVICE = "memos";
17
+ var API_SUFFIX = "/api/v1";
18
+ var ATTACHMENT_MAX_BYTES = 20 * 1024 * 1024;
19
+ var BASE64_CHUNK = 8192;
20
+ var UPDATE_MASKS = [
21
+ ["content", "content"],
22
+ ["visibility", "visibility"],
23
+ ["pinned", "pinned"],
24
+ ["state", "state"],
25
+ ["createTime", "create_time"],
26
+ ["location", "location"]
27
+ ];
28
+ function record(value) {
29
+ return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
30
+ }
31
+ function text(value) {
32
+ if (typeof value !== "string") return void 0;
33
+ const trimmed = value.trim();
34
+ return trimmed === "" ? void 0 : trimmed;
35
+ }
36
+ function requireText(value, field) {
37
+ const result = text(value);
38
+ if (result === void 0) throw new TBError("invalid_argument", `${field} is required.`);
39
+ return result;
40
+ }
41
+ function compact(input) {
42
+ return Object.fromEntries(
43
+ Object.entries(input).filter(([, value]) => value !== void 0)
44
+ );
45
+ }
46
+ function responseError(message) {
47
+ return new TBError("unavailable", message, { retryable: true });
48
+ }
49
+ function requireResponseObject(value, operation) {
50
+ const object = record(value);
51
+ if (object === void 0) throw responseError(`Memos ${operation} response did not include an object`);
52
+ return object;
53
+ }
54
+ function requireResponseObjects(value, operation) {
55
+ if (!Array.isArray(value)) throw responseError(`Memos ${operation} response did not include an array`);
56
+ return value.map((item) => requireResponseObject(item, operation));
57
+ }
58
+ function configError(message) {
59
+ return new TBError("invalid_argument", `${SERVICE} \u7684 baseUrl ${message}`);
60
+ }
61
+ function resolveBaseUrl(ctx) {
62
+ const configured = ctx.config?.baseUrl;
63
+ if (configured !== void 0 && typeof configured !== "string") throw configError("\u5FC5\u987B\u662F\u5B57\u7B26\u4E32");
64
+ const candidate = text(configured);
65
+ if (candidate === void 0) {
66
+ throw configError(
67
+ "\u662F\u5FC5\u914D\u9879:\u7ED9\u6302\u8F7D\u8282\u70B9\u914D providerConfig.baseUrl \u6307\u5411\u4F60\u7684 Memos \u5B9E\u4F8B(\u5982 https://memos.example.com)\u3002Memos \u53EA\u6709\u81EA\u5EFA\u5B9E\u4F8B,\u6CA1\u6709\u516C\u5171\u7F3A\u7701\u5730\u5740"
68
+ );
69
+ }
70
+ let url;
71
+ try {
72
+ url = assertPublicHttpUrl(candidate);
73
+ } catch (error) {
74
+ const detail = error instanceof Error ? error.message : "\u4E0D\u53EF\u7528";
75
+ throw configError(
76
+ `\u4E0D\u53EF\u7528(${detail})\u3002\u81EA\u5EFA Memos \u5FC5\u987B\u662F**\u516C\u7F51\u53EF\u8FBE**\u7684\u5730\u5740:\u63D2\u4EF6\u4E0E\u7F51\u5173\u540C\u8FDB\u7A0B,\u6307\u5411\u5185\u7F51\u6216\u4FDD\u7559\u5730\u5740\u4F1A\u88AB\u51FA\u7AD9\u6821\u9A8C\u62D2\u7EDD`
77
+ );
78
+ }
79
+ if (url.username !== "" || url.password !== "") throw configError("\u4E0D\u80FD\u5E26\u7528\u6237\u540D/\u5BC6\u7801");
80
+ url.search = "";
81
+ url.hash = "";
82
+ const path = url.pathname.replace(/\/+$/, "");
83
+ const normalized = `${url.origin}${path}`;
84
+ return normalized.endsWith(API_SUFFIX) ? normalized : `${normalized}${API_SUFFIX}`;
85
+ }
86
+ function resolveTarget(ctx) {
87
+ return { apiKey: requireApiKey(ctx, SERVICE), baseUrl: resolveBaseUrl(ctx) };
88
+ }
89
+ function resourcePath(name, collection) {
90
+ const segments = name.split("/");
91
+ const id = segments[1];
92
+ if (segments.length !== 2 || segments[0] !== collection || id === void 0 || id === "" || id === "." || id === "..") {
93
+ throw new TBError("invalid_argument", `name must use the ${collection}/{id} resource format`);
94
+ }
95
+ return `/${collection}/${encodeURIComponent(id)}`;
96
+ }
97
+ function readPayload(response, body) {
98
+ if (body.trim() === "") return null;
99
+ try {
100
+ return JSON.parse(body);
101
+ } catch {
102
+ if (response.ok) throw responseError("Memos returned invalid JSON");
103
+ return body;
104
+ }
105
+ }
106
+ function errorMessage(payload) {
107
+ const direct = text(payload);
108
+ if (direct !== void 0) return direct;
109
+ return text(record(payload)?.message) ?? "Memos request failed";
110
+ }
111
+ async function request(target, input) {
112
+ const url = new URL(`${target.baseUrl}${input.path}`);
113
+ for (const [key, value] of Object.entries(input.query ?? {})) {
114
+ if (value !== void 0) url.searchParams.set(key, String(value));
115
+ }
116
+ let response;
117
+ let payload;
118
+ try {
119
+ response = await guardedFetch(url.toString(), {
120
+ method: input.method ?? "GET",
121
+ headers: {
122
+ accept: "application/json",
123
+ authorization: `Bearer ${target.apiKey}`,
124
+ ...input.body === void 0 ? {} : { "content-type": "application/json" }
125
+ },
126
+ body: input.body === void 0 ? void 0 : JSON.stringify(input.body)
127
+ });
128
+ payload = readPayload(response, await response.text());
129
+ } catch (error) {
130
+ if (error instanceof TBError) throw error;
131
+ const detail = error instanceof Error ? error.message : "unknown network error";
132
+ throw upstreamError(502, `Memos ${input.path} request failed: ${detail}`);
133
+ }
134
+ if (!response.ok) throw upstreamError(response.status, errorMessage(payload));
135
+ return payload;
136
+ }
137
+ async function readBoundedBytes(response) {
138
+ const tooLarge = () => new TBError(
139
+ "invalid_argument",
140
+ `fileUrl \u6307\u5411\u7684\u6587\u4EF6\u8D85\u8FC7 ${ATTACHMENT_MAX_BYTES} \u5B57\u8282\u7684\u4E0A\u9650`
141
+ );
142
+ const declared = Number(response.headers.get("content-length"));
143
+ if (Number.isFinite(declared) && declared > ATTACHMENT_MAX_BYTES) throw tooLarge();
144
+ const body = response.body;
145
+ if (body === null) {
146
+ const bytes2 = new Uint8Array(await response.arrayBuffer());
147
+ if (bytes2.byteLength > ATTACHMENT_MAX_BYTES) throw tooLarge();
148
+ return bytes2;
149
+ }
150
+ const reader = body.getReader();
151
+ const chunks = [];
152
+ let total = 0;
153
+ for (; ; ) {
154
+ const { done, value } = await reader.read();
155
+ if (done) break;
156
+ total += value.byteLength;
157
+ if (total > ATTACHMENT_MAX_BYTES) {
158
+ await reader.cancel();
159
+ throw tooLarge();
160
+ }
161
+ chunks.push(value);
162
+ }
163
+ const bytes = new Uint8Array(total);
164
+ let offset = 0;
165
+ for (const chunk of chunks) {
166
+ bytes.set(chunk, offset);
167
+ offset += chunk.byteLength;
168
+ }
169
+ return bytes;
170
+ }
171
+ function base64(bytes) {
172
+ let binary = "";
173
+ for (let offset = 0; offset < bytes.length; offset += BASE64_CHUNK) {
174
+ binary += String.fromCharCode(...bytes.subarray(offset, offset + BASE64_CHUNK));
175
+ }
176
+ return btoa(binary);
177
+ }
178
+ async function downloadAttachment(fileUrl, declaredType) {
179
+ let response;
180
+ try {
181
+ response = await guardedFetch(fileUrl, { method: "GET" });
182
+ } catch (error) {
183
+ if (error instanceof TBError) throw error;
184
+ const detail = error instanceof Error ? error.message : "unknown network error";
185
+ throw upstreamError(502, `failed to fetch fileUrl: ${detail}`);
186
+ }
187
+ if (!response.ok) throw upstreamError(502, `failed to fetch fileUrl: ${response.status}`);
188
+ const bytes = await readBoundedBytes(response);
189
+ const responseType = text(response.headers.get("content-type")?.split(";", 1)[0]);
190
+ return { bytes, mimeType: declaredType ?? responseType ?? "application/octet-stream" };
191
+ }
192
+ async function createMemo(input, ctx) {
193
+ const payload = await request(resolveTarget(ctx), {
194
+ method: "POST",
195
+ path: "/memos",
196
+ // memoId 是**query** 参数而不是 body 字段(Memos 的 AIP 风格:资源 id 走 query)。
197
+ query: compact({ memoId: text(input.memoId) }),
198
+ body: compact({
199
+ content: input.content,
200
+ visibility: text(input.visibility),
201
+ createTime: text(input.createTime),
202
+ pinned: input.pinned,
203
+ location: input.location
204
+ })
205
+ });
206
+ return { memo: requireResponseObject(payload, "create memo") };
207
+ }
208
+ async function listMemos(input, ctx) {
209
+ const payload = requireResponseObject(await request(resolveTarget(ctx), {
210
+ path: "/memos",
211
+ query: compact({
212
+ pageSize: input.pageSize,
213
+ pageToken: text(input.pageToken),
214
+ state: text(input.state),
215
+ orderBy: text(input.orderBy),
216
+ filter: text(input.filter),
217
+ showDeleted: input.showDeleted
218
+ })
219
+ }), "list memos");
220
+ return {
221
+ // 一页都没有时 Memos 干脆不给 `memos` 键,补成空数组;非数组则是上游坏了。
222
+ memos: requireResponseObjects(payload.memos ?? [], "list memos"),
223
+ nextPageToken: text(payload.nextPageToken) ?? null
224
+ };
225
+ }
226
+ async function getMemo(input, ctx) {
227
+ const path = resourcePath(requireText(input.name, "name"), "memos");
228
+ const payload = await request(resolveTarget(ctx), { path });
229
+ return { memo: requireResponseObject(payload, "get memo") };
230
+ }
231
+ async function updateMemo(input, ctx) {
232
+ const name = requireText(input.name, "name");
233
+ const updateMask = UPDATE_MASKS.filter(([field]) => Object.hasOwn(input, field)).map(([, mask]) => mask);
234
+ if (updateMask.length === 0) {
235
+ throw new TBError("invalid_argument", "Provide at least one memo field to update.");
236
+ }
237
+ const payload = await request(resolveTarget(ctx), {
238
+ method: "PATCH",
239
+ path: resourcePath(name, "memos"),
240
+ query: { updateMask: updateMask.join(",") },
241
+ body: compact({
242
+ name,
243
+ content: input.content,
244
+ visibility: input.visibility,
245
+ pinned: input.pinned,
246
+ state: input.state,
247
+ createTime: input.createTime,
248
+ location: input.location
249
+ })
250
+ });
251
+ return { memo: requireResponseObject(payload, "update memo") };
252
+ }
253
+ async function deleteMemo(input, ctx) {
254
+ const name = requireText(input.name, "name");
255
+ await request(resolveTarget(ctx), {
256
+ method: "DELETE",
257
+ path: resourcePath(name, "memos"),
258
+ query: compact({ force: input.force })
259
+ });
260
+ return { deleted: true, name };
261
+ }
262
+ async function uploadAttachment(input, ctx) {
263
+ const target = resolveTarget(ctx);
264
+ const source = await downloadAttachment(requireText(input.fileUrl, "fileUrl"), text(input.type));
265
+ const payload = await request(target, {
266
+ method: "POST",
267
+ path: "/attachments",
268
+ query: compact({ attachmentId: text(input.attachmentId) }),
269
+ body: compact({
270
+ filename: requireText(input.filename, "filename"),
271
+ content: base64(source.bytes),
272
+ type: source.mimeType,
273
+ memo: text(input.memo)
274
+ })
275
+ });
276
+ return { attachment: requireResponseObject(payload, "upload attachment") };
277
+ }
278
+ async function listAttachments(input, ctx) {
279
+ const payload = requireResponseObject(await request(resolveTarget(ctx), {
280
+ path: "/attachments",
281
+ query: compact({
282
+ pageSize: input.pageSize,
283
+ pageToken: text(input.pageToken),
284
+ filter: text(input.filter),
285
+ orderBy: text(input.orderBy)
286
+ })
287
+ }), "list attachments");
288
+ return {
289
+ attachments: requireResponseObjects(payload.attachments ?? [], "list attachments"),
290
+ nextPageToken: text(payload.nextPageToken) ?? null
291
+ };
292
+ }
293
+ async function getAttachment(input, ctx) {
294
+ const path = resourcePath(requireText(input.name, "name"), "attachments");
295
+ const payload = await request(resolveTarget(ctx), { path });
296
+ return { attachment: requireResponseObject(payload, "get attachment") };
297
+ }
298
+ async function deleteAttachment(input, ctx) {
299
+ const name = requireText(input.name, "name");
300
+ await request(resolveTarget(ctx), { method: "DELETE", path: resourcePath(name, "attachments") });
301
+ return { deleted: true, name };
302
+ }
303
+ async function listMemoAttachments(input, ctx) {
304
+ const name = requireText(input.name, "name");
305
+ const payload = requireResponseObject(await request(resolveTarget(ctx), {
306
+ path: `${resourcePath(name, "memos")}/attachments`,
307
+ query: compact({ pageSize: input.pageSize, pageToken: text(input.pageToken) })
308
+ }), "list memo attachments");
309
+ return {
310
+ attachments: requireResponseObjects(payload.attachments ?? [], "list memo attachments"),
311
+ nextPageToken: text(payload.nextPageToken) ?? null
312
+ };
313
+ }
314
+ async function setMemoAttachments(input, ctx) {
315
+ const name = requireText(input.name, "name");
316
+ const attachmentNames = input.attachmentNames.map((item) => requireText(item, "attachmentNames"));
317
+ for (const attachmentName of attachmentNames) resourcePath(attachmentName, "attachments");
318
+ await request(resolveTarget(ctx), {
319
+ method: "PATCH",
320
+ path: `${resourcePath(name, "memos")}/attachments`,
321
+ body: { name, attachments: attachmentNames.map((attachmentName) => ({ name: attachmentName })) }
322
+ });
323
+ return { updated: true, name, attachmentNames };
324
+ }
325
+ async function getCurrentUser(_input, ctx) {
326
+ const payload = requireResponseObject(await request(resolveTarget(ctx), { path: "/auth/me" }), "get current user");
327
+ return { user: requireResponseObject(payload.user, "get current user") };
328
+ }
329
+ async function listUsers(input, ctx) {
330
+ const payload = requireResponseObject(await request(resolveTarget(ctx), {
331
+ path: "/users",
332
+ query: compact({
333
+ pageSize: input.pageSize,
334
+ pageToken: text(input.pageToken),
335
+ filter: text(input.filter),
336
+ showDeleted: input.showDeleted
337
+ })
338
+ }), "list users");
339
+ return {
340
+ users: requireResponseObjects(payload.users ?? [], "list users"),
341
+ nextPageToken: text(payload.nextPageToken) ?? null
342
+ };
343
+ }
344
+ async function getUser(input, ctx) {
345
+ const path = resourcePath(requireText(input.name, "name"), "users");
346
+ const payload = await request(resolveTarget(ctx), {
347
+ path,
348
+ query: compact({ readMask: text(input.readMask) })
349
+ });
350
+ return { user: requireResponseObject(payload, "get user") };
351
+ }
352
+
353
+ // ../plugins/src/memos/schema.handwritten.ts
354
+ var UPDATABLE = ["content", "visibility", "pinned", "state", "createTime", "location"];
355
+ var updateMemoInput = external_exports.strictObject({
356
+ name: external_exports.string().min(7).describe("The Memos memo resource name in the format memos/{memo}."),
357
+ content: external_exports.string().describe("The replacement memo content. Provide at least one updatable field.").optional(),
358
+ visibility: external_exports.enum(["PRIVATE", "PROTECTED", "PUBLIC"]).describe("The memo visibility. Provide at least one updatable field.").optional(),
359
+ pinned: external_exports.boolean().describe("Whether the memo should be pinned. Provide at least one updatable field.").optional(),
360
+ state: external_exports.enum(["NORMAL", "ARCHIVED"]).describe("The memo state. Provide at least one updatable field.").optional(),
361
+ createTime: external_exports.iso.datetime({ offset: true }).describe("The replacement memo creation time. Provide at least one updatable field.").optional(),
362
+ location: external_exports.strictObject({
363
+ placeholder: external_exports.string().describe("The location label.").optional(),
364
+ latitude: external_exports.number().describe("The latitude in decimal degrees.").optional(),
365
+ longitude: external_exports.number().describe("The longitude in decimal degrees.").optional()
366
+ }).describe("A geographic location to attach to a memo; null clears it. Provide at least one updatable field.").nullable().optional()
367
+ }).refine(
368
+ // 按"键在不在"判,不是"值是不是 undefined":显式给 `location: null` 也算"要改这个字段"。
369
+ (input) => UPDATABLE.some((field) => Object.hasOwn(input, field)),
370
+ {
371
+ message: `at least one of ${UPDATABLE.join(", ")} is required`,
372
+ path: ["content"]
373
+ }
374
+ ).describe("Input parameters for updating selected memo fields.");
375
+ var updateMemoOutput = external_exports.strictObject({
376
+ memo: external_exports.looseObject({
377
+ name: external_exports.string().min(7).describe("The Memos memo resource name in the format memos/{memo}.").optional(),
378
+ state: external_exports.string().describe("The memo state returned by Memos.").optional(),
379
+ creator: external_exports.string().min(7).describe("The Memos user resource name in the format users/{user}.").optional(),
380
+ createTime: external_exports.iso.datetime({ offset: true }).describe("The memo creation time.").optional(),
381
+ updateTime: external_exports.iso.datetime({ offset: true }).describe("The memo update time.").optional(),
382
+ content: external_exports.string().describe("The memo Markdown content.").optional(),
383
+ visibility: external_exports.string().describe("The memo visibility returned by Memos.").optional(),
384
+ tags: external_exports.array(external_exports.string().describe("An extracted memo tag.")).describe("Tags extracted from the memo content.").optional(),
385
+ pinned: external_exports.boolean().describe("Whether the memo is pinned.").optional(),
386
+ attachments: external_exports.array(external_exports.looseObject({
387
+ name: external_exports.string().min(13).describe("The Memos attachment resource name in the format attachments/{attachment}.").optional(),
388
+ createTime: external_exports.iso.datetime({ offset: true }).describe("The attachment creation time.").optional(),
389
+ filename: external_exports.string().describe("The attachment filename.").optional(),
390
+ externalLink: external_exports.string().describe("The external storage URL when returned by Memos.").optional(),
391
+ type: external_exports.string().describe("The attachment MIME type.").optional(),
392
+ size: external_exports.string().describe("The attachment size in bytes, encoded as a string by the Memos API.").optional(),
393
+ memo: external_exports.string().min(7).describe("The Memos memo resource name in the format memos/{memo}.").optional()
394
+ }).describe("Memos attachment metadata.")).describe("Attachments associated with the memo.").optional(),
395
+ parent: external_exports.string().min(7).describe("The Memos memo resource name in the format memos/{memo}.").optional(),
396
+ snippet: external_exports.string().describe("A plain-text preview of the memo content.").optional(),
397
+ location: external_exports.looseObject({
398
+ placeholder: external_exports.string().describe("The location label.").optional(),
399
+ latitude: external_exports.number().describe("The latitude in decimal degrees.").optional(),
400
+ longitude: external_exports.number().describe("The longitude in decimal degrees.").optional()
401
+ }).describe("A geographic location attached to a memo.").optional(),
402
+ property: external_exports.looseObject({}).describe("Computed memo properties.").optional()
403
+ }).describe("A Memos memo resource.")
404
+ }).describe("The updated memo response.");
405
+
406
+ // ../plugins/src/memos/schema.ts
407
+ var createMemoInput = external_exports.strictObject({
408
+ content: external_exports.string().min(1).describe("The memo content in Markdown format."),
409
+ visibility: external_exports.enum(["PRIVATE", "PROTECTED", "PUBLIC"]).describe("The memo visibility.").optional(),
410
+ memoId: external_exports.string().min(1).max(36).describe("An optional caller-selected memo ID.").optional(),
411
+ createTime: external_exports.iso.datetime({ offset: true }).describe("An optional creation time for imported content.").optional(),
412
+ pinned: external_exports.boolean().describe("Whether the new memo should be pinned.").optional(),
413
+ location: external_exports.strictObject({
414
+ placeholder: external_exports.string().describe("The location label.").optional(),
415
+ latitude: external_exports.number().describe("The latitude in decimal degrees.").optional(),
416
+ longitude: external_exports.number().describe("The longitude in decimal degrees.").optional()
417
+ }).describe("A geographic location to attach to a memo.").optional()
418
+ }).describe("Input parameters for creating a memo.");
419
+ var createMemoOutput = external_exports.strictObject({
420
+ memo: external_exports.looseObject({
421
+ name: external_exports.string().min(7).describe("The Memos memo resource name in the format memos/{memo}.").optional(),
422
+ state: external_exports.string().describe("The memo state returned by Memos.").optional(),
423
+ creator: external_exports.string().min(7).describe("The Memos user resource name in the format users/{user}.").optional(),
424
+ createTime: external_exports.iso.datetime({ offset: true }).describe("The memo creation time.").optional(),
425
+ updateTime: external_exports.iso.datetime({ offset: true }).describe("The memo update time.").optional(),
426
+ content: external_exports.string().describe("The memo Markdown content.").optional(),
427
+ visibility: external_exports.string().describe("The memo visibility returned by Memos.").optional(),
428
+ tags: external_exports.array(external_exports.string().describe("An extracted memo tag.")).describe("Tags extracted from the memo content.").optional(),
429
+ pinned: external_exports.boolean().describe("Whether the memo is pinned.").optional(),
430
+ attachments: external_exports.array(external_exports.looseObject({
431
+ name: external_exports.string().min(13).describe("The Memos attachment resource name in the format attachments/{attachment}.").optional(),
432
+ createTime: external_exports.iso.datetime({ offset: true }).describe("The attachment creation time.").optional(),
433
+ filename: external_exports.string().describe("The attachment filename.").optional(),
434
+ externalLink: external_exports.string().describe("The external storage URL when returned by Memos.").optional(),
435
+ type: external_exports.string().describe("The attachment MIME type.").optional(),
436
+ size: external_exports.string().describe("The attachment size in bytes, encoded as a string by the Memos API.").optional(),
437
+ memo: external_exports.string().min(7).describe("The Memos memo resource name in the format memos/{memo}.").optional()
438
+ }).describe("Memos attachment metadata.")).describe("Attachments associated with the memo.").optional(),
439
+ parent: external_exports.string().min(7).describe("The Memos memo resource name in the format memos/{memo}.").optional(),
440
+ snippet: external_exports.string().describe("A plain-text preview of the memo content.").optional(),
441
+ location: external_exports.looseObject({
442
+ placeholder: external_exports.string().describe("The location label.").optional(),
443
+ latitude: external_exports.number().describe("The latitude in decimal degrees.").optional(),
444
+ longitude: external_exports.number().describe("The longitude in decimal degrees.").optional()
445
+ }).describe("A geographic location attached to a memo.").optional(),
446
+ property: external_exports.looseObject({}).describe("Computed memo properties.").optional()
447
+ }).describe("A Memos memo resource.")
448
+ }).describe("The created memo response.");
449
+ var listMemosInput = external_exports.strictObject({
450
+ pageSize: external_exports.int().min(1).max(1e3).describe("The maximum number of resources to return.").optional(),
451
+ pageToken: external_exports.string().min(1).describe("The continuation token returned by a previous list action.").optional(),
452
+ state: external_exports.enum(["NORMAL", "ARCHIVED"]).describe("The memo state.").optional(),
453
+ orderBy: external_exports.string().min(1).describe("The AIP-132 ordering expression, such as pinned desc, create_time desc.").optional(),
454
+ filter: external_exports.string().min(1).describe("The Memos CEL filter expression, including content, creator, visibility, tags, timestamps, and computed properties.").optional(),
455
+ showDeleted: external_exports.boolean().describe("Whether deleted memos should be included.").optional()
456
+ }).describe("Input parameters for listing memos.");
457
+ var listMemosOutput = external_exports.strictObject({
458
+ memos: external_exports.array(external_exports.looseObject({
459
+ name: external_exports.string().min(7).describe("The Memos memo resource name in the format memos/{memo}.").optional(),
460
+ state: external_exports.string().describe("The memo state returned by Memos.").optional(),
461
+ creator: external_exports.string().min(7).describe("The Memos user resource name in the format users/{user}.").optional(),
462
+ createTime: external_exports.iso.datetime({ offset: true }).describe("The memo creation time.").optional(),
463
+ updateTime: external_exports.iso.datetime({ offset: true }).describe("The memo update time.").optional(),
464
+ content: external_exports.string().describe("The memo Markdown content.").optional(),
465
+ visibility: external_exports.string().describe("The memo visibility returned by Memos.").optional(),
466
+ tags: external_exports.array(external_exports.string().describe("An extracted memo tag.")).describe("Tags extracted from the memo content.").optional(),
467
+ pinned: external_exports.boolean().describe("Whether the memo is pinned.").optional(),
468
+ attachments: external_exports.array(external_exports.looseObject({
469
+ name: external_exports.string().min(13).describe("The Memos attachment resource name in the format attachments/{attachment}.").optional(),
470
+ createTime: external_exports.iso.datetime({ offset: true }).describe("The attachment creation time.").optional(),
471
+ filename: external_exports.string().describe("The attachment filename.").optional(),
472
+ externalLink: external_exports.string().describe("The external storage URL when returned by Memos.").optional(),
473
+ type: external_exports.string().describe("The attachment MIME type.").optional(),
474
+ size: external_exports.string().describe("The attachment size in bytes, encoded as a string by the Memos API.").optional(),
475
+ memo: external_exports.string().min(7).describe("The Memos memo resource name in the format memos/{memo}.").optional()
476
+ }).describe("Memos attachment metadata.")).describe("Attachments associated with the memo.").optional(),
477
+ parent: external_exports.string().min(7).describe("The Memos memo resource name in the format memos/{memo}.").optional(),
478
+ snippet: external_exports.string().describe("A plain-text preview of the memo content.").optional(),
479
+ location: external_exports.looseObject({
480
+ placeholder: external_exports.string().describe("The location label.").optional(),
481
+ latitude: external_exports.number().describe("The latitude in decimal degrees.").optional(),
482
+ longitude: external_exports.number().describe("The longitude in decimal degrees.").optional()
483
+ }).describe("A geographic location attached to a memo.").optional(),
484
+ property: external_exports.looseObject({}).describe("Computed memo properties.").optional()
485
+ }).describe("A Memos memo resource.")).describe("The memos returned by the instance."),
486
+ nextPageToken: external_exports.string().describe("The continuation token for the next page, or null when no next page exists.").nullable()
487
+ }).describe("A page of Memos memo resources.");
488
+ var getMemoInput = external_exports.strictObject({
489
+ name: external_exports.string().min(7).describe("The Memos memo resource name in the format memos/{memo}.")
490
+ }).describe("Input parameters for reading a memo.");
491
+ var getMemoOutput = external_exports.strictObject({
492
+ memo: external_exports.looseObject({
493
+ name: external_exports.string().min(7).describe("The Memos memo resource name in the format memos/{memo}.").optional(),
494
+ state: external_exports.string().describe("The memo state returned by Memos.").optional(),
495
+ creator: external_exports.string().min(7).describe("The Memos user resource name in the format users/{user}.").optional(),
496
+ createTime: external_exports.iso.datetime({ offset: true }).describe("The memo creation time.").optional(),
497
+ updateTime: external_exports.iso.datetime({ offset: true }).describe("The memo update time.").optional(),
498
+ content: external_exports.string().describe("The memo Markdown content.").optional(),
499
+ visibility: external_exports.string().describe("The memo visibility returned by Memos.").optional(),
500
+ tags: external_exports.array(external_exports.string().describe("An extracted memo tag.")).describe("Tags extracted from the memo content.").optional(),
501
+ pinned: external_exports.boolean().describe("Whether the memo is pinned.").optional(),
502
+ attachments: external_exports.array(external_exports.looseObject({
503
+ name: external_exports.string().min(13).describe("The Memos attachment resource name in the format attachments/{attachment}.").optional(),
504
+ createTime: external_exports.iso.datetime({ offset: true }).describe("The attachment creation time.").optional(),
505
+ filename: external_exports.string().describe("The attachment filename.").optional(),
506
+ externalLink: external_exports.string().describe("The external storage URL when returned by Memos.").optional(),
507
+ type: external_exports.string().describe("The attachment MIME type.").optional(),
508
+ size: external_exports.string().describe("The attachment size in bytes, encoded as a string by the Memos API.").optional(),
509
+ memo: external_exports.string().min(7).describe("The Memos memo resource name in the format memos/{memo}.").optional()
510
+ }).describe("Memos attachment metadata.")).describe("Attachments associated with the memo.").optional(),
511
+ parent: external_exports.string().min(7).describe("The Memos memo resource name in the format memos/{memo}.").optional(),
512
+ snippet: external_exports.string().describe("A plain-text preview of the memo content.").optional(),
513
+ location: external_exports.looseObject({
514
+ placeholder: external_exports.string().describe("The location label.").optional(),
515
+ latitude: external_exports.number().describe("The latitude in decimal degrees.").optional(),
516
+ longitude: external_exports.number().describe("The longitude in decimal degrees.").optional()
517
+ }).describe("A geographic location attached to a memo.").optional(),
518
+ property: external_exports.looseObject({}).describe("Computed memo properties.").optional()
519
+ }).describe("A Memos memo resource.")
520
+ }).describe("The memo response.");
521
+ var deleteMemoInput = external_exports.strictObject({
522
+ name: external_exports.string().min(7).describe("The Memos memo resource name in the format memos/{memo}."),
523
+ force: external_exports.boolean().describe("Whether to force deletion when the memo has associated data.").optional()
524
+ }).describe("Input parameters for deleting a memo.");
525
+ var deleteMemoOutput = external_exports.strictObject({
526
+ deleted: external_exports.boolean().describe("Whether Memos accepted the deletion."),
527
+ name: external_exports.string().min(7).describe("The Memos memo resource name in the format memos/{memo}.")
528
+ }).describe("The memo deletion result.");
529
+ var uploadAttachmentInput = external_exports.strictObject({
530
+ fileUrl: external_exports.url().describe("The public HTTP or HTTPS URL of the file to upload."),
531
+ filename: external_exports.string().min(1).describe("The filename to store in Memos."),
532
+ type: external_exports.string().min(1).describe("The MIME type; inferred from the download response when omitted.").optional(),
533
+ memo: external_exports.string().min(7).describe("The Memos memo resource name in the format memos/{memo}.").optional(),
534
+ attachmentId: external_exports.string().min(1).max(36).describe("An optional caller-selected attachment ID.").optional()
535
+ }).describe("Input parameters for uploading an attachment from a URL.");
536
+ var uploadAttachmentOutput = external_exports.strictObject({
537
+ attachment: external_exports.looseObject({
538
+ name: external_exports.string().min(13).describe("The Memos attachment resource name in the format attachments/{attachment}.").optional(),
539
+ createTime: external_exports.iso.datetime({ offset: true }).describe("The attachment creation time.").optional(),
540
+ filename: external_exports.string().describe("The attachment filename.").optional(),
541
+ externalLink: external_exports.string().describe("The external storage URL when returned by Memos.").optional(),
542
+ type: external_exports.string().describe("The attachment MIME type.").optional(),
543
+ size: external_exports.string().describe("The attachment size in bytes, encoded as a string by the Memos API.").optional(),
544
+ memo: external_exports.string().min(7).describe("The Memos memo resource name in the format memos/{memo}.").optional()
545
+ }).describe("Memos attachment metadata.")
546
+ }).describe("The uploaded attachment response.");
547
+ var listAttachmentsInput = external_exports.strictObject({
548
+ pageSize: external_exports.int().min(1).max(1e3).describe("The maximum number of resources to return.").optional(),
549
+ pageToken: external_exports.string().min(1).describe("The continuation token returned by a previous list action.").optional(),
550
+ filter: external_exports.string().min(1).describe("The Memos attachment filter expression.").optional(),
551
+ orderBy: external_exports.string().min(1).describe("The attachment ordering expression, such as create_time desc.").optional()
552
+ }).describe("Input parameters for listing attachments.");
553
+ var listAttachmentsOutput = external_exports.strictObject({
554
+ attachments: external_exports.array(external_exports.looseObject({
555
+ name: external_exports.string().min(13).describe("The Memos attachment resource name in the format attachments/{attachment}.").optional(),
556
+ createTime: external_exports.iso.datetime({ offset: true }).describe("The attachment creation time.").optional(),
557
+ filename: external_exports.string().describe("The attachment filename.").optional(),
558
+ externalLink: external_exports.string().describe("The external storage URL when returned by Memos.").optional(),
559
+ type: external_exports.string().describe("The attachment MIME type.").optional(),
560
+ size: external_exports.string().describe("The attachment size in bytes, encoded as a string by the Memos API.").optional(),
561
+ memo: external_exports.string().min(7).describe("The Memos memo resource name in the format memos/{memo}.").optional()
562
+ }).describe("Memos attachment metadata.")).describe("The attachments returned by Memos."),
563
+ nextPageToken: external_exports.string().describe("The continuation token for the next page, or null when no next page exists.").nullable()
564
+ }).describe("A page of Memos attachment metadata.");
565
+ var getAttachmentInput = external_exports.strictObject({
566
+ name: external_exports.string().min(13).describe("The Memos attachment resource name in the format attachments/{attachment}.")
567
+ }).describe("Input parameters for reading an attachment.");
568
+ var getAttachmentOutput = external_exports.strictObject({
569
+ attachment: external_exports.looseObject({
570
+ name: external_exports.string().min(13).describe("The Memos attachment resource name in the format attachments/{attachment}.").optional(),
571
+ createTime: external_exports.iso.datetime({ offset: true }).describe("The attachment creation time.").optional(),
572
+ filename: external_exports.string().describe("The attachment filename.").optional(),
573
+ externalLink: external_exports.string().describe("The external storage URL when returned by Memos.").optional(),
574
+ type: external_exports.string().describe("The attachment MIME type.").optional(),
575
+ size: external_exports.string().describe("The attachment size in bytes, encoded as a string by the Memos API.").optional(),
576
+ memo: external_exports.string().min(7).describe("The Memos memo resource name in the format memos/{memo}.").optional()
577
+ }).describe("Memos attachment metadata.")
578
+ }).describe("The attachment metadata response.");
579
+ var deleteAttachmentInput = external_exports.strictObject({
580
+ name: external_exports.string().min(13).describe("The Memos attachment resource name in the format attachments/{attachment}.")
581
+ }).describe("Input parameters for deleting an attachment.");
582
+ var deleteAttachmentOutput = external_exports.strictObject({
583
+ deleted: external_exports.boolean().describe("Whether Memos accepted the deletion."),
584
+ name: external_exports.string().min(13).describe("The Memos attachment resource name in the format attachments/{attachment}.")
585
+ }).describe("The attachment deletion result.");
586
+ var listMemoAttachmentsInput = external_exports.strictObject({
587
+ name: external_exports.string().min(7).describe("The Memos memo resource name in the format memos/{memo}."),
588
+ pageSize: external_exports.int().min(1).max(1e3).describe("The maximum number of resources to return.").optional(),
589
+ pageToken: external_exports.string().min(1).describe("The continuation token returned by a previous list action.").optional()
590
+ }).describe("Input parameters for listing a memo's attachments.");
591
+ var listMemoAttachmentsOutput = external_exports.strictObject({
592
+ attachments: external_exports.array(external_exports.looseObject({
593
+ name: external_exports.string().min(13).describe("The Memos attachment resource name in the format attachments/{attachment}.").optional(),
594
+ createTime: external_exports.iso.datetime({ offset: true }).describe("The attachment creation time.").optional(),
595
+ filename: external_exports.string().describe("The attachment filename.").optional(),
596
+ externalLink: external_exports.string().describe("The external storage URL when returned by Memos.").optional(),
597
+ type: external_exports.string().describe("The attachment MIME type.").optional(),
598
+ size: external_exports.string().describe("The attachment size in bytes, encoded as a string by the Memos API.").optional(),
599
+ memo: external_exports.string().min(7).describe("The Memos memo resource name in the format memos/{memo}.").optional()
600
+ }).describe("Memos attachment metadata.")).describe("The memo attachments returned by Memos."),
601
+ nextPageToken: external_exports.string().describe("The continuation token for the next page, or null when no next page exists.").nullable()
602
+ }).describe("A page of attachments associated with the memo.");
603
+ var setMemoAttachmentsInput = external_exports.strictObject({
604
+ name: external_exports.string().min(7).describe("The Memos memo resource name in the format memos/{memo}."),
605
+ attachmentNames: external_exports.array(external_exports.string().min(13).describe("The Memos attachment resource name in the format attachments/{attachment}.")).describe("The complete desired list of attachment resource names; use an empty array to clear all attachments.")
606
+ }).describe("Input parameters for replacing a memo's attachment set.");
607
+ var setMemoAttachmentsOutput = external_exports.strictObject({
608
+ updated: external_exports.boolean().describe("Whether Memos accepted the attachment replacement."),
609
+ name: external_exports.string().min(7).describe("The Memos memo resource name in the format memos/{memo}."),
610
+ attachmentNames: external_exports.array(external_exports.string().min(13).describe("The Memos attachment resource name in the format attachments/{attachment}.")).describe("The attachment resource names sent to Memos.")
611
+ }).describe("The memo attachment replacement result.");
612
+ var getCurrentUserInput = external_exports.strictObject({}).describe("The input payload for reading the current Memos user.");
613
+ var getCurrentUserOutput = external_exports.strictObject({
614
+ user: external_exports.looseObject({
615
+ name: external_exports.string().min(7).describe("The Memos user resource name in the format users/{user}.").optional(),
616
+ role: external_exports.string().describe("The user role returned by Memos.").optional(),
617
+ username: external_exports.string().describe("The unique Memos username.").optional(),
618
+ email: external_exports.string().describe("The user's email address.").optional(),
619
+ displayName: external_exports.string().describe("The user's display name.").optional(),
620
+ avatarUrl: external_exports.string().describe("The user's avatar URL.").optional(),
621
+ description: external_exports.string().describe("The user's profile description.").optional(),
622
+ state: external_exports.string().describe("The user state returned by Memos.").optional(),
623
+ createTime: external_exports.iso.datetime({ offset: true }).describe("The user creation time.").optional(),
624
+ updateTime: external_exports.iso.datetime({ offset: true }).describe("The user update time.").optional()
625
+ }).describe("A Memos user resource.")
626
+ }).describe("The current Memos user response.");
627
+ var listUsersInput = external_exports.strictObject({
628
+ pageSize: external_exports.int().min(1).max(1e3).describe("The maximum number of resources to return.").optional(),
629
+ pageToken: external_exports.string().min(1).describe("The continuation token returned by a previous list action.").optional(),
630
+ filter: external_exports.string().min(1).describe("The user filter expression; Memos v0.29 supports username equality.").optional(),
631
+ showDeleted: external_exports.boolean().describe("Whether deleted users should be included.").optional()
632
+ }).describe("Input parameters for listing Memos users.");
633
+ var listUsersOutput = external_exports.strictObject({
634
+ users: external_exports.array(external_exports.looseObject({
635
+ name: external_exports.string().min(7).describe("The Memos user resource name in the format users/{user}.").optional(),
636
+ role: external_exports.string().describe("The user role returned by Memos.").optional(),
637
+ username: external_exports.string().describe("The unique Memos username.").optional(),
638
+ email: external_exports.string().describe("The user's email address.").optional(),
639
+ displayName: external_exports.string().describe("The user's display name.").optional(),
640
+ avatarUrl: external_exports.string().describe("The user's avatar URL.").optional(),
641
+ description: external_exports.string().describe("The user's profile description.").optional(),
642
+ state: external_exports.string().describe("The user state returned by Memos.").optional(),
643
+ createTime: external_exports.iso.datetime({ offset: true }).describe("The user creation time.").optional(),
644
+ updateTime: external_exports.iso.datetime({ offset: true }).describe("The user update time.").optional()
645
+ }).describe("A Memos user resource.")).describe("The users returned by Memos."),
646
+ nextPageToken: external_exports.string().describe("The continuation token for the next page, or null when no next page exists.").nullable()
647
+ }).describe("A page of Memos users.");
648
+ var getUserInput = external_exports.strictObject({
649
+ name: external_exports.string().min(7).describe("The Memos user resource name in the format users/{user}."),
650
+ readMask: external_exports.string().min(1).describe("An optional comma-separated field mask for the user response.").optional()
651
+ }).describe("Input parameters for reading a Memos user.");
652
+ var getUserOutput = external_exports.strictObject({
653
+ user: external_exports.looseObject({
654
+ name: external_exports.string().min(7).describe("The Memos user resource name in the format users/{user}.").optional(),
655
+ role: external_exports.string().describe("The user role returned by Memos.").optional(),
656
+ username: external_exports.string().describe("The unique Memos username.").optional(),
657
+ email: external_exports.string().describe("The user's email address.").optional(),
658
+ displayName: external_exports.string().describe("The user's display name.").optional(),
659
+ avatarUrl: external_exports.string().describe("The user's avatar URL.").optional(),
660
+ description: external_exports.string().describe("The user's profile description.").optional(),
661
+ state: external_exports.string().describe("The user state returned by Memos.").optional(),
662
+ createTime: external_exports.iso.datetime({ offset: true }).describe("The user creation time.").optional(),
663
+ updateTime: external_exports.iso.datetime({ offset: true }).describe("The user update time.").optional()
664
+ }).describe("A Memos user resource.")
665
+ }).describe("The Memos user response.");
666
+ var memosActions = {
667
+ create_memo: {
668
+ description: "Create a Markdown memo on the connected Memos instance.",
669
+ effect: "write",
670
+ inputSchema: createMemoInput,
671
+ outputSchema: external_exports.toJSONSchema(createMemoOutput, { io: "output", unrepresentable: "any" })
672
+ },
673
+ list_memos: {
674
+ description: "List memos with pagination, state selection, ordering, and CEL filtering.",
675
+ effect: "read",
676
+ inputSchema: listMemosInput,
677
+ outputSchema: external_exports.toJSONSchema(listMemosOutput, { io: "output", unrepresentable: "any" })
678
+ },
679
+ get_memo: {
680
+ description: "Retrieve one memo by its Memos resource name.",
681
+ effect: "read",
682
+ inputSchema: getMemoInput,
683
+ outputSchema: external_exports.toJSONSchema(getMemoOutput, { io: "output", unrepresentable: "any" })
684
+ },
685
+ update_memo: {
686
+ description: "Update selected content, visibility, pin, state, time, or location fields on a memo.",
687
+ effect: "write",
688
+ inputSchema: updateMemoInput,
689
+ outputSchema: external_exports.toJSONSchema(updateMemoOutput, { io: "output", unrepresentable: "any" })
690
+ },
691
+ delete_memo: {
692
+ description: "Delete one memo, optionally forcing deletion when associated data exists.",
693
+ effect: "destructive",
694
+ inputSchema: deleteMemoInput,
695
+ outputSchema: external_exports.toJSONSchema(deleteMemoOutput, { io: "output", unrepresentable: "any" })
696
+ },
697
+ upload_attachment: {
698
+ description: "Download a public file URL and upload its bytes to the connected Memos instance.",
699
+ effect: "write",
700
+ inputSchema: uploadAttachmentInput,
701
+ outputSchema: external_exports.toJSONSchema(uploadAttachmentOutput, { io: "output", unrepresentable: "any" })
702
+ },
703
+ list_attachments: {
704
+ description: "List attachment metadata with pagination, filtering, and ordering.",
705
+ effect: "read",
706
+ inputSchema: listAttachmentsInput,
707
+ outputSchema: external_exports.toJSONSchema(listAttachmentsOutput, { io: "output", unrepresentable: "any" })
708
+ },
709
+ get_attachment: {
710
+ description: "Retrieve one attachment's metadata by resource name.",
711
+ effect: "read",
712
+ inputSchema: getAttachmentInput,
713
+ outputSchema: external_exports.toJSONSchema(getAttachmentOutput, { io: "output", unrepresentable: "any" })
714
+ },
715
+ delete_attachment: {
716
+ description: "Delete one attachment by resource name.",
717
+ effect: "destructive",
718
+ inputSchema: deleteAttachmentInput,
719
+ outputSchema: external_exports.toJSONSchema(deleteAttachmentOutput, { io: "output", unrepresentable: "any" })
720
+ },
721
+ list_memo_attachments: {
722
+ description: "List attachments associated with one memo.",
723
+ effect: "read",
724
+ inputSchema: listMemoAttachmentsInput,
725
+ outputSchema: external_exports.toJSONSchema(listMemoAttachmentsOutput, { io: "output", unrepresentable: "any" })
726
+ },
727
+ set_memo_attachments: {
728
+ description: "Replace the complete attachment set associated with one memo.",
729
+ effect: "write",
730
+ inputSchema: setMemoAttachmentsInput,
731
+ outputSchema: external_exports.toJSONSchema(setMemoAttachmentsOutput, { io: "output", unrepresentable: "any" })
732
+ },
733
+ get_current_user: {
734
+ description: "Retrieve the Memos user associated with the connected personal access token.",
735
+ effect: "read",
736
+ inputSchema: getCurrentUserInput,
737
+ outputSchema: external_exports.toJSONSchema(getCurrentUserOutput, { io: "output", unrepresentable: "any" })
738
+ },
739
+ list_users: {
740
+ description: "List users visible to the connected Memos account.",
741
+ effect: "read",
742
+ inputSchema: listUsersInput,
743
+ outputSchema: external_exports.toJSONSchema(listUsersOutput, { io: "output", unrepresentable: "any" })
744
+ },
745
+ get_user: {
746
+ description: "Retrieve one Memos user by resource name.",
747
+ effect: "read",
748
+ inputSchema: getUserInput,
749
+ outputSchema: external_exports.toJSONSchema(getUserOutput, { io: "output", unrepresentable: "any" })
750
+ }
751
+ };
752
+
753
+ // ../plugins/src/memos/index.ts
754
+ function createMemosPlugin() {
755
+ return createProviderPlugin({
756
+ description: "Memos",
757
+ actions: memosActions,
758
+ credentialProbe: "get_current_user",
759
+ handlers: {
760
+ create_memo: createMemo,
761
+ list_memos: listMemos,
762
+ get_memo: getMemo,
763
+ update_memo: updateMemo,
764
+ delete_memo: deleteMemo,
765
+ upload_attachment: uploadAttachment,
766
+ list_attachments: listAttachments,
767
+ get_attachment: getAttachment,
768
+ delete_attachment: deleteAttachment,
769
+ list_memo_attachments: listMemoAttachments,
770
+ set_memo_attachments: setMemoAttachments,
771
+ get_current_user: getCurrentUser,
772
+ list_users: listUsers,
773
+ get_user: getUser
774
+ }
775
+ });
776
+ }
777
+ var memos_default = createMemosPlugin();
778
+ export {
779
+ createMemosPlugin,
780
+ memos_default as default
781
+ };