@5ss/ai-tools 2.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +112 -0
- package/LICENSE +21 -0
- package/README.md +221 -0
- package/dist/ai-sdk/index.d.ts +15 -0
- package/dist/ai-sdk/index.d.ts.map +1 -0
- package/dist/ai-sdk/index.js +24 -0
- package/dist/ai-sdk/index.js.map +1 -0
- package/dist/artifact-D064mHfK.js +44 -0
- package/dist/artifact-D064mHfK.js.map +1 -0
- package/dist/artifacts-O8g-40Pw.js +404 -0
- package/dist/artifacts-O8g-40Pw.js.map +1 -0
- package/dist/aws-json-CecFqzqX.js +23 -0
- package/dist/aws-json-CecFqzqX.js.map +1 -0
- package/dist/aws-service-msttbPrz.js +58 -0
- package/dist/aws-service-msttbPrz.js.map +1 -0
- package/dist/batch-BMM5dXqL.d.ts +22 -0
- package/dist/batch-BMM5dXqL.d.ts.map +1 -0
- package/dist/batch-Co1ujeAW.js +67 -0
- package/dist/batch-Co1ujeAW.js.map +1 -0
- package/dist/bedrock-agentcore-browser-a_qOs-NR.js +182 -0
- package/dist/bedrock-agentcore-browser-a_qOs-NR.js.map +1 -0
- package/dist/bedrock-agentcore-code-interpreter-MWK-8RhA.js +357 -0
- package/dist/bedrock-agentcore-code-interpreter-MWK-8RhA.js.map +1 -0
- package/dist/bytes-BxpimpQx.js +45 -0
- package/dist/bytes-BxpimpQx.js.map +1 -0
- package/dist/client-CCKGsTeI.js +743 -0
- package/dist/client-CCKGsTeI.js.map +1 -0
- package/dist/cloudflare/index.d.ts +37 -0
- package/dist/cloudflare/index.d.ts.map +1 -0
- package/dist/cloudflare/index.js +41 -0
- package/dist/cloudflare/index.js.map +1 -0
- package/dist/cloudflare-browser-B6Yolpin.js +428 -0
- package/dist/cloudflare-browser-B6Yolpin.js.map +1 -0
- package/dist/cloudflare-email-Dy0KHeDf.js +197 -0
- package/dist/cloudflare-email-Dy0KHeDf.js.map +1 -0
- package/dist/cloudflare-sandbox-Dp_uNaqW.js +982 -0
- package/dist/cloudflare-sandbox-Dp_uNaqW.js.map +1 -0
- package/dist/content-type-CORxaxcv.js +49 -0
- package/dist/content-type-CORxaxcv.js.map +1 -0
- package/dist/core/index.d.ts +4 -0
- package/dist/core/index.js +204 -0
- package/dist/core/index.js.map +1 -0
- package/dist/define-CvpJ_pNP.js +115 -0
- package/dist/define-CvpJ_pNP.js.map +1 -0
- package/dist/errors-DoSpNHvs.js +20 -0
- package/dist/errors-DoSpNHvs.js.map +1 -0
- package/dist/errors-aKhko9T1.d.ts +18 -0
- package/dist/errors-aKhko9T1.d.ts.map +1 -0
- package/dist/eventbridge-scheduler-Bh6GqZY2.js +349 -0
- package/dist/eventbridge-scheduler-Bh6GqZY2.js.map +1 -0
- package/dist/framework-context-DVIIY8ZO.js +24 -0
- package/dist/framework-context-DVIIY8ZO.js.map +1 -0
- package/dist/gotenberg-NuJjxyln.js +291 -0
- package/dist/gotenberg-NuJjxyln.js.map +1 -0
- package/dist/http/index.d.ts +47 -0
- package/dist/http/index.d.ts.map +1 -0
- package/dist/http/index.js +3 -0
- package/dist/http-service-DDNCO1s4.js +254 -0
- package/dist/http-service-DDNCO1s4.js.map +1 -0
- package/dist/http-service-T7E5UjP8.d.ts +80 -0
- package/dist/http-service-T7E5UjP8.d.ts.map +1 -0
- package/dist/imessage-BSAFOI8Z.js +154 -0
- package/dist/imessage-BSAFOI8Z.js.map +1 -0
- package/dist/index-BU4gmYO8.d.ts +254 -0
- package/dist/index-BU4gmYO8.d.ts.map +1 -0
- package/dist/index-CCivzmxO.d.ts +188 -0
- package/dist/index-CCivzmxO.d.ts.map +1 -0
- package/dist/index-CLmTrcu5.d.ts +22 -0
- package/dist/index-CLmTrcu5.d.ts.map +1 -0
- package/dist/index-CZX5OeOF.d.ts +235 -0
- package/dist/index-CZX5OeOF.d.ts.map +1 -0
- package/dist/index-CdFmEfZO.d.ts +359 -0
- package/dist/index-CdFmEfZO.d.ts.map +1 -0
- package/dist/index-Cuh6eMWc.d.ts +285 -0
- package/dist/index-Cuh6eMWc.d.ts.map +1 -0
- package/dist/index-DuOGj7vc.d.ts +107 -0
- package/dist/index-DuOGj7vc.d.ts.map +1 -0
- package/dist/index-ccZ1XOHw.d.ts +69 -0
- package/dist/index-ccZ1XOHw.d.ts.map +1 -0
- package/dist/index-n8JTpNf1.d.ts +247 -0
- package/dist/index-n8JTpNf1.d.ts.map +1 -0
- package/dist/index-pwW1OsOx.d.ts +134 -0
- package/dist/index-pwW1OsOx.d.ts.map +1 -0
- package/dist/index-zK1ZwS4m.d.ts +347 -0
- package/dist/index-zK1ZwS4m.d.ts.map +1 -0
- package/dist/limits-hjrO8zUG.js +80 -0
- package/dist/limits-hjrO8zUG.js.map +1 -0
- package/dist/mastra/index.d.ts +14 -0
- package/dist/mastra/index.d.ts.map +1 -0
- package/dist/mastra/index.js +26 -0
- package/dist/mastra/index.js.map +1 -0
- package/dist/mastra-vector-Dhc6XZ8l.js +234 -0
- package/dist/mastra-vector-Dhc6XZ8l.js.map +1 -0
- package/dist/mcp/index.d.ts +80 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +97 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/modules/artifacts/index.d.ts +337 -0
- package/dist/modules/artifacts/index.d.ts.map +1 -0
- package/dist/modules/artifacts/index.js +348 -0
- package/dist/modules/artifacts/index.js.map +1 -0
- package/dist/modules/browser/index.d.ts +516 -0
- package/dist/modules/browser/index.d.ts.map +1 -0
- package/dist/modules/browser/index.js +475 -0
- package/dist/modules/browser/index.js.map +1 -0
- package/dist/modules/calendar/index.d.ts +93 -0
- package/dist/modules/calendar/index.d.ts.map +1 -0
- package/dist/modules/calendar/index.js +131 -0
- package/dist/modules/calendar/index.js.map +1 -0
- package/dist/modules/code-sandbox/index.d.ts +317 -0
- package/dist/modules/code-sandbox/index.d.ts.map +1 -0
- package/dist/modules/code-sandbox/index.js +537 -0
- package/dist/modules/code-sandbox/index.js.map +1 -0
- package/dist/modules/content-type/index.d.ts +22 -0
- package/dist/modules/content-type/index.d.ts.map +1 -0
- package/dist/modules/content-type/index.js +66 -0
- package/dist/modules/content-type/index.js.map +1 -0
- package/dist/modules/crypto/index.d.ts +115 -0
- package/dist/modules/crypto/index.d.ts.map +1 -0
- package/dist/modules/crypto/index.js +139 -0
- package/dist/modules/crypto/index.js.map +1 -0
- package/dist/modules/document/index.d.ts +575 -0
- package/dist/modules/document/index.d.ts.map +1 -0
- package/dist/modules/document/index.js +444 -0
- package/dist/modules/document/index.js.map +1 -0
- package/dist/modules/document-extract/index.d.ts +438 -0
- package/dist/modules/document-extract/index.d.ts.map +1 -0
- package/dist/modules/document-extract/index.js +127 -0
- package/dist/modules/document-extract/index.js.map +1 -0
- package/dist/modules/document-render/index.d.ts +336 -0
- package/dist/modules/document-render/index.d.ts.map +1 -0
- package/dist/modules/document-render/index.js +155 -0
- package/dist/modules/document-render/index.js.map +1 -0
- package/dist/modules/email/index.d.ts +311 -0
- package/dist/modules/email/index.d.ts.map +1 -0
- package/dist/modules/email/index.js +167 -0
- package/dist/modules/email/index.js.map +1 -0
- package/dist/modules/email-message/index.d.ts +95 -0
- package/dist/modules/email-message/index.d.ts.map +1 -0
- package/dist/modules/email-message/index.js +264 -0
- package/dist/modules/email-message/index.js.map +1 -0
- package/dist/modules/file-convert/index.d.ts +273 -0
- package/dist/modules/file-convert/index.d.ts.map +1 -0
- package/dist/modules/file-convert/index.js +103 -0
- package/dist/modules/file-convert/index.js.map +1 -0
- package/dist/modules/files/index.d.ts +452 -0
- package/dist/modules/files/index.d.ts.map +1 -0
- package/dist/modules/files/index.js +733 -0
- package/dist/modules/files/index.js.map +1 -0
- package/dist/modules/image/index.d.ts +342 -0
- package/dist/modules/image/index.d.ts.map +1 -0
- package/dist/modules/image/index.js +281 -0
- package/dist/modules/image/index.js.map +1 -0
- package/dist/modules/messaging/index.d.ts +608 -0
- package/dist/modules/messaging/index.d.ts.map +1 -0
- package/dist/modules/messaging/index.js +1067 -0
- package/dist/modules/messaging/index.js.map +1 -0
- package/dist/modules/pdf/index.d.ts +287 -0
- package/dist/modules/pdf/index.d.ts.map +1 -0
- package/dist/modules/pdf/index.js +259 -0
- package/dist/modules/pdf/index.js.map +1 -0
- package/dist/modules/presentation/index.d.ts +247 -0
- package/dist/modules/presentation/index.d.ts.map +1 -0
- package/dist/modules/presentation/index.js +12657 -0
- package/dist/modules/presentation/index.js.map +1 -0
- package/dist/modules/queue/index.d.ts +129 -0
- package/dist/modules/queue/index.d.ts.map +1 -0
- package/dist/modules/queue/index.js +131 -0
- package/dist/modules/queue/index.js.map +1 -0
- package/dist/modules/rag/index.d.ts +250 -0
- package/dist/modules/rag/index.d.ts.map +1 -0
- package/dist/modules/rag/index.js +366 -0
- package/dist/modules/rag/index.js.map +1 -0
- package/dist/modules/scheduler/index.d.ts +216 -0
- package/dist/modules/scheduler/index.d.ts.map +1 -0
- package/dist/modules/scheduler/index.js +153 -0
- package/dist/modules/scheduler/index.js.map +1 -0
- package/dist/modules/skills/index.d.ts +205 -0
- package/dist/modules/skills/index.d.ts.map +1 -0
- package/dist/modules/skills/index.js +203 -0
- package/dist/modules/skills/index.js.map +1 -0
- package/dist/modules/tasks/index.d.ts +287 -0
- package/dist/modules/tasks/index.d.ts.map +1 -0
- package/dist/modules/tasks/index.js +207 -0
- package/dist/modules/tasks/index.js.map +1 -0
- package/dist/modules/vector-store/index.d.ts +3 -0
- package/dist/modules/vector-store/index.js +3 -0
- package/dist/modules/web-fetch/index.d.ts +99 -0
- package/dist/modules/web-fetch/index.d.ts.map +1 -0
- package/dist/modules/web-fetch/index.js +242 -0
- package/dist/modules/web-fetch/index.js.map +1 -0
- package/dist/object-artifact-store-CMTzCm_G.d.ts +7 -0
- package/dist/object-artifact-store-CMTzCm_G.d.ts.map +1 -0
- package/dist/object-artifact-store-wZ2j9cto.js +28 -0
- package/dist/object-artifact-store-wZ2j9cto.js.map +1 -0
- package/dist/pinecone-umY4t6OF.js +190 -0
- package/dist/pinecone-umY4t6OF.js.map +1 -0
- package/dist/provider-CgDAlg6K.js +34 -0
- package/dist/provider-CgDAlg6K.js.map +1 -0
- package/dist/qdrant-DMp4NhKR.js +253 -0
- package/dist/qdrant-DMp4NhKR.js.map +1 -0
- package/dist/resend-BAC38_dA.js +155 -0
- package/dist/resend-BAC38_dA.js.map +1 -0
- package/dist/s3-CsOaPWMP.js +955 -0
- package/dist/s3-CsOaPWMP.js.map +1 -0
- package/dist/schemas-ChOAhdo9.js +192 -0
- package/dist/schemas-ChOAhdo9.js.map +1 -0
- package/dist/slack-Di5BBNpt.js +1455 -0
- package/dist/slack-Di5BBNpt.js.map +1 -0
- package/dist/sqs-DCwS1i2N.js +225 -0
- package/dist/sqs-DCwS1i2N.js.map +1 -0
- package/dist/supabase-vector-Dpp9mmJR.js +218 -0
- package/dist/supabase-vector-Dpp9mmJR.js.map +1 -0
- package/dist/tanstack/index.d.ts +15 -0
- package/dist/tanstack/index.d.ts.map +1 -0
- package/dist/tanstack/index.js +28 -0
- package/dist/tanstack/index.js.map +1 -0
- package/dist/teams-DYAHNb39.js +835 -0
- package/dist/teams-DYAHNb39.js.map +1 -0
- package/dist/telegram-DDXWzkfL.js +734 -0
- package/dist/telegram-DDXWzkfL.js.map +1 -0
- package/dist/textract-CPLiB22H.js +554 -0
- package/dist/textract-CPLiB22H.js.map +1 -0
- package/dist/transport-B4vn-XiQ.js +157 -0
- package/dist/transport-B4vn-XiQ.js.map +1 -0
- package/dist/transport-i96ACAI_.d.ts +46 -0
- package/dist/transport-i96ACAI_.d.ts.map +1 -0
- package/dist/types-Ccb0DXY9.d.ts +150 -0
- package/dist/types-Ccb0DXY9.d.ts.map +1 -0
- package/dist/unique-EwBH1JPB.js +19 -0
- package/dist/unique-EwBH1JPB.js.map +1 -0
- package/dist/vector-store-C3nEO80e.js +193 -0
- package/dist/vector-store-C3nEO80e.js.map +1 -0
- package/dist/vendors/amazon-sp-api/index.d.ts +526 -0
- package/dist/vendors/amazon-sp-api/index.d.ts.map +1 -0
- package/dist/vendors/amazon-sp-api/index.js +975 -0
- package/dist/vendors/amazon-sp-api/index.js.map +1 -0
- package/dist/vendors/bedrock-agentcore-browser/index.d.ts +2 -0
- package/dist/vendors/bedrock-agentcore-browser/index.js +2 -0
- package/dist/vendors/bedrock-agentcore-code-interpreter/index.d.ts +228 -0
- package/dist/vendors/bedrock-agentcore-code-interpreter/index.d.ts.map +1 -0
- package/dist/vendors/bedrock-agentcore-code-interpreter/index.js +2 -0
- package/dist/vendors/cloudflare-browser/index.d.ts +2 -0
- package/dist/vendors/cloudflare-browser/index.js +2 -0
- package/dist/vendors/cloudflare-email/index.d.ts +260 -0
- package/dist/vendors/cloudflare-email/index.d.ts.map +1 -0
- package/dist/vendors/cloudflare-email/index.js +3 -0
- package/dist/vendors/cloudflare-sandbox/index.d.ts +565 -0
- package/dist/vendors/cloudflare-sandbox/index.d.ts.map +1 -0
- package/dist/vendors/cloudflare-sandbox/index.js +2 -0
- package/dist/vendors/eventbridge-scheduler/index.d.ts +2 -0
- package/dist/vendors/eventbridge-scheduler/index.js +2 -0
- package/dist/vendors/gotenberg/index.d.ts +306 -0
- package/dist/vendors/gotenberg/index.d.ts.map +1 -0
- package/dist/vendors/gotenberg/index.js +2 -0
- package/dist/vendors/imessage/index.d.ts +420 -0
- package/dist/vendors/imessage/index.d.ts.map +1 -0
- package/dist/vendors/imessage/index.js +4 -0
- package/dist/vendors/katana/index.d.ts +1570 -0
- package/dist/vendors/katana/index.d.ts.map +1 -0
- package/dist/vendors/katana/index.js +1639 -0
- package/dist/vendors/katana/index.js.map +1 -0
- package/dist/vendors/mastra-vector/index.d.ts +120 -0
- package/dist/vendors/mastra-vector/index.d.ts.map +1 -0
- package/dist/vendors/mastra-vector/index.js +3 -0
- package/dist/vendors/pinecone/index.d.ts +75 -0
- package/dist/vendors/pinecone/index.d.ts.map +1 -0
- package/dist/vendors/pinecone/index.js +3 -0
- package/dist/vendors/qdrant/index.d.ts +75 -0
- package/dist/vendors/qdrant/index.d.ts.map +1 -0
- package/dist/vendors/qdrant/index.js +3 -0
- package/dist/vendors/resend/index.d.ts +3 -0
- package/dist/vendors/resend/index.js +3 -0
- package/dist/vendors/s3/index.d.ts +2 -0
- package/dist/vendors/s3/index.js +2 -0
- package/dist/vendors/slack/index.d.ts +576 -0
- package/dist/vendors/slack/index.d.ts.map +1 -0
- package/dist/vendors/slack/index.js +3 -0
- package/dist/vendors/sqs/index.d.ts +2 -0
- package/dist/vendors/sqs/index.js +2 -0
- package/dist/vendors/supabase-vector/index.d.ts +89 -0
- package/dist/vendors/supabase-vector/index.d.ts.map +1 -0
- package/dist/vendors/supabase-vector/index.js +3 -0
- package/dist/vendors/teams/index.d.ts +303 -0
- package/dist/vendors/teams/index.d.ts.map +1 -0
- package/dist/vendors/teams/index.js +3 -0
- package/dist/vendors/telegram/index.d.ts +319 -0
- package/dist/vendors/telegram/index.d.ts.map +1 -0
- package/dist/vendors/telegram/index.js +3 -0
- package/dist/vendors/textract/index.d.ts +2 -0
- package/dist/vendors/textract/index.js +2 -0
- package/dist/vendors/woocommerce/index.d.ts +1700 -0
- package/dist/vendors/woocommerce/index.d.ts.map +1 -0
- package/dist/vendors/woocommerce/index.js +1427 -0
- package/dist/vendors/woocommerce/index.js.map +1 -0
- package/dist/with-auth-CpKqTrGK.js +240 -0
- package/dist/with-auth-CpKqTrGK.js.map +1 -0
- package/logos/LUCIDE-ATTRIBUTION.txt +4 -0
- package/logos/README.md +89 -0
- package/logos/amazon.svg +6 -0
- package/logos/artifacts.svg +9 -0
- package/logos/browser.svg +9 -0
- package/logos/calendar.svg +15 -0
- package/logos/cloudflare-browser.svg +5 -0
- package/logos/cloudflare-email.svg +5 -0
- package/logos/cloudflare.svg +4 -0
- package/logos/code-sandbox.svg +8 -0
- package/logos/content-type.svg +10 -0
- package/logos/crypto.svg +7 -0
- package/logos/document-extract.svg +12 -0
- package/logos/document-render.svg +8 -0
- package/logos/document.svg +10 -0
- package/logos/email-message.svg +8 -0
- package/logos/email.svg +7 -0
- package/logos/file-convert.svg +9 -0
- package/logos/files.svg +6 -0
- package/logos/gotenberg.svg +340 -0
- package/logos/image.svg +8 -0
- package/logos/imessage.svg +7 -0
- package/logos/katana.svg +13 -0
- package/logos/mastra.svg +7 -0
- package/logos/messaging.svg +7 -0
- package/logos/pack-logos.json +48 -0
- package/logos/pdf.svg +10 -0
- package/logos/pinecone.svg +25 -0
- package/logos/presentation.svg +8 -0
- package/logos/qdrant.svg +4 -0
- package/logos/queue.svg +11 -0
- package/logos/rag.svg +18 -0
- package/logos/resend.svg +5 -0
- package/logos/scheduler.svg +7 -0
- package/logos/skills.svg +10 -0
- package/logos/slack.svg +14 -0
- package/logos/supabase.svg +4 -0
- package/logos/tasks.svg +10 -0
- package/logos/teams.svg +6 -0
- package/logos/telegram.svg +10 -0
- package/logos/textract.svg +5 -0
- package/logos/vector-store.svg +8 -0
- package/logos/web-fetch.svg +8 -0
- package/logos/woocommerce.svg +4 -0
- package/package.json +373 -0
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
import { t as ToolError } from "../../errors-DoSpNHvs.js";
|
|
2
|
+
import { n as defineModule, r as defineTool } from "../../define-CvpJ_pNP.js";
|
|
3
|
+
import { n as requireAuth } from "../../provider-CgDAlg6K.js";
|
|
4
|
+
import { t as HttpService } from "../../http-service-DDNCO1s4.js";
|
|
5
|
+
import { f as vectorMetadataSchema } from "../../schemas-ChOAhdo9.js";
|
|
6
|
+
import { a as VectorStoreClient, c as qdrantVectorAuthSchema, l as supabaseVectorSeamAuthSchema, o as mastraVectorSeamAuthSchema, s as pineconeVectorAuthSchema } from "../../vector-store-C3nEO80e.js";
|
|
7
|
+
import { isPlainObject } from "es-toolkit";
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
//#region src/modules/rag/contracts.ts
|
|
10
|
+
/**
|
|
11
|
+
* RAG seam contracts — ingest + retrieve over host-bound embed + vector-store.
|
|
12
|
+
*/
|
|
13
|
+
const DEFAULT_CHUNK_MAX_CHARS = 1200;
|
|
14
|
+
const DEFAULT_CHUNK_OVERLAP = 200;
|
|
15
|
+
const MAX_CHUNK_MAX_CHARS = 8e3;
|
|
16
|
+
const MAX_INGEST_CHARS = 5e5;
|
|
17
|
+
const MAX_EMBED_BATCH = 32;
|
|
18
|
+
const embedAuthSchema = z.object({
|
|
19
|
+
base_url: z.string().url().describe("OpenAI-compatible embeddings origin, for example https://api.openai.com/v1 or https://openrouter.ai/api/v1"),
|
|
20
|
+
api_key: z.string().min(1).optional().describe("Optional Bearer token for the embed route"),
|
|
21
|
+
model: z.string().min(1).describe("Embedding model id"),
|
|
22
|
+
path: z.string().min(1).optional().describe("Embeddings path relative to base_url (default /embeddings)"),
|
|
23
|
+
dimensions: z.number().int().positive().optional().describe("Optional dimensions when the embed API supports it")
|
|
24
|
+
});
|
|
25
|
+
const ragChunkOptionsSchema = z.object({
|
|
26
|
+
max_chars: z.number().int().min(200).max(MAX_CHUNK_MAX_CHARS).optional().describe(`Chunk size in characters (default ${DEFAULT_CHUNK_MAX_CHARS})`),
|
|
27
|
+
overlap: z.number().int().min(0).max(2e3).optional().describe(`Overlap in characters between chunks (default 200)`)
|
|
28
|
+
});
|
|
29
|
+
const ragAuthSchema = z.object({
|
|
30
|
+
vector_store: z.discriminatedUnion("provider", [
|
|
31
|
+
qdrantVectorAuthSchema,
|
|
32
|
+
pineconeVectorAuthSchema,
|
|
33
|
+
supabaseVectorSeamAuthSchema,
|
|
34
|
+
mastraVectorSeamAuthSchema
|
|
35
|
+
]),
|
|
36
|
+
embed: embedAuthSchema,
|
|
37
|
+
default_collection: z.string().min(1).optional().describe("Default collection / index when tool input omits collection"),
|
|
38
|
+
chunk: ragChunkOptionsSchema.optional().describe("Default chunking options for ingest")
|
|
39
|
+
});
|
|
40
|
+
const ragIngestInputSchema = z.object({
|
|
41
|
+
document_id: z.string().min(1).describe("Stable document id used as the chunk id prefix"),
|
|
42
|
+
text: z.string().min(1).max(MAX_INGEST_CHARS).describe(`Document text to chunk, embed, and store (max ${MAX_INGEST_CHARS} characters)`),
|
|
43
|
+
metadata: vectorMetadataSchema.optional().describe("Metadata copied onto every chunk"),
|
|
44
|
+
collection: z.string().min(1).optional().describe("Collection / index override"),
|
|
45
|
+
namespace: z.string().min(1).optional().describe("Optional vector namespace when the bound store supports it"),
|
|
46
|
+
chunk: ragChunkOptionsSchema.optional().describe("Per-call chunking override")
|
|
47
|
+
});
|
|
48
|
+
const ragIngestOutputSchema = z.object({
|
|
49
|
+
document_id: z.string(),
|
|
50
|
+
chunk_count: z.number().int().nonnegative(),
|
|
51
|
+
chunk_ids: z.array(z.string()).describe("Vector ids written for this document"),
|
|
52
|
+
collection: z.string().optional()
|
|
53
|
+
});
|
|
54
|
+
const ragRetrieveInputSchema = z.object({
|
|
55
|
+
query: z.string().min(1).describe("Natural-language query to embed and search"),
|
|
56
|
+
top_k: z.number().int().min(1).max(100).optional().describe("Number of chunks to return (default 8)"),
|
|
57
|
+
collection: z.string().min(1).optional().describe("Collection / index override"),
|
|
58
|
+
namespace: z.string().min(1).optional().describe("Optional vector namespace when the bound store supports it"),
|
|
59
|
+
filter: z.record(z.string(), z.unknown()).optional().describe("Optional store-native metadata filter")
|
|
60
|
+
});
|
|
61
|
+
const ragRetrievedChunkSchema = z.object({
|
|
62
|
+
id: z.string(),
|
|
63
|
+
score: z.number(),
|
|
64
|
+
text: z.string().optional().describe("Chunk text when stored in metadata"),
|
|
65
|
+
document_id: z.string().optional(),
|
|
66
|
+
chunk_index: z.number().int().optional(),
|
|
67
|
+
metadata: vectorMetadataSchema.optional()
|
|
68
|
+
});
|
|
69
|
+
const ragRetrieveOutputSchema = z.object({
|
|
70
|
+
matches: z.array(ragRetrievedChunkSchema),
|
|
71
|
+
collection: z.string().optional()
|
|
72
|
+
});
|
|
73
|
+
const ragDeleteInputSchema = z.object({
|
|
74
|
+
chunk_ids: z.array(z.string().min(1)).min(1).max(100).describe("Chunk / vector ids to delete (from a prior rag-ingest)"),
|
|
75
|
+
collection: z.string().min(1).optional().describe("Collection / index override"),
|
|
76
|
+
namespace: z.string().min(1).optional().describe("Optional vector namespace when the bound store supports it")
|
|
77
|
+
});
|
|
78
|
+
const ragDeleteOutputSchema = z.object({
|
|
79
|
+
deleted: z.number().int().nonnegative(),
|
|
80
|
+
collection: z.string().optional()
|
|
81
|
+
});
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region src/modules/rag/domain.ts
|
|
84
|
+
/**
|
|
85
|
+
* Pure RAG helpers: text chunking (no HTTP).
|
|
86
|
+
*/
|
|
87
|
+
/**
|
|
88
|
+
* Split text into overlapping character windows.
|
|
89
|
+
* Prefers paragraph then newline boundaries when a soft break exists near the end of a window.
|
|
90
|
+
*/
|
|
91
|
+
function chunkText(text, options = {}) {
|
|
92
|
+
const maxChars = options.max_chars ?? 1200;
|
|
93
|
+
const overlap = Math.min(options.overlap ?? 200, Math.max(0, maxChars - 1));
|
|
94
|
+
const normalized = text.replace(/\r\n/g, "\n").trim();
|
|
95
|
+
if (normalized.length === 0) return [];
|
|
96
|
+
if (normalized.length <= maxChars) return [normalized];
|
|
97
|
+
const chunks = [];
|
|
98
|
+
let start = 0;
|
|
99
|
+
while (start < normalized.length) {
|
|
100
|
+
let end = Math.min(start + maxChars, normalized.length);
|
|
101
|
+
if (end < normalized.length) {
|
|
102
|
+
const window = normalized.slice(start, end);
|
|
103
|
+
const para = window.lastIndexOf("\n\n");
|
|
104
|
+
const line = window.lastIndexOf("\n");
|
|
105
|
+
const soft = para >= maxChars * .5 ? para : line >= maxChars * .5 ? line : -1;
|
|
106
|
+
if (soft > 0) end = start + soft;
|
|
107
|
+
}
|
|
108
|
+
const piece = normalized.slice(start, end).trim();
|
|
109
|
+
if (piece.length > 0) chunks.push(piece);
|
|
110
|
+
if (end >= normalized.length) break;
|
|
111
|
+
const next = end - overlap;
|
|
112
|
+
start = next <= start ? end : next;
|
|
113
|
+
}
|
|
114
|
+
return chunks;
|
|
115
|
+
}
|
|
116
|
+
function chunkId(documentId, index) {
|
|
117
|
+
return `${documentId}#${index}`;
|
|
118
|
+
}
|
|
119
|
+
//#endregion
|
|
120
|
+
//#region src/modules/rag/client.ts
|
|
121
|
+
/**
|
|
122
|
+
* RAG client — host-bound OpenAI-compatible embeddings + nested vector-store.
|
|
123
|
+
*/
|
|
124
|
+
var RagClient = class RagClient {
|
|
125
|
+
#vectors;
|
|
126
|
+
#embedHttp;
|
|
127
|
+
#embed;
|
|
128
|
+
#defaultCollection;
|
|
129
|
+
#defaultChunk;
|
|
130
|
+
constructor(auth, options = {}) {
|
|
131
|
+
const vectorCtx = {};
|
|
132
|
+
if (options.fetch) vectorCtx.fetch = options.fetch;
|
|
133
|
+
if (options.signal) vectorCtx.signal = options.signal;
|
|
134
|
+
this.#vectors = VectorStoreClient.fromAuth(auth.vector_store, vectorCtx);
|
|
135
|
+
this.#embed = auth.embed;
|
|
136
|
+
this.#defaultCollection = auth.default_collection;
|
|
137
|
+
this.#defaultChunk = auth.chunk;
|
|
138
|
+
const headers = { "Content-Type": "application/json" };
|
|
139
|
+
if (auth.embed.api_key) headers["Authorization"] = `Bearer ${auth.embed.api_key}`;
|
|
140
|
+
const httpOptions = {
|
|
141
|
+
baseURL: auth.embed.base_url,
|
|
142
|
+
headers,
|
|
143
|
+
label: "RAG embed"
|
|
144
|
+
};
|
|
145
|
+
if (options.fetch) httpOptions.fetch = options.fetch;
|
|
146
|
+
if (options.signal) httpOptions.signal = options.signal;
|
|
147
|
+
this.#embedHttp = new HttpService(httpOptions);
|
|
148
|
+
}
|
|
149
|
+
static fromContext(ctx) {
|
|
150
|
+
const auth = requireAuth(ctx, ragAuthSchema);
|
|
151
|
+
const options = {};
|
|
152
|
+
if (ctx.fetch) options.fetch = ctx.fetch;
|
|
153
|
+
if (ctx.signal) options.signal = ctx.signal;
|
|
154
|
+
return new RagClient(auth, options);
|
|
155
|
+
}
|
|
156
|
+
static fromAuth(auth, options = {}) {
|
|
157
|
+
return new RagClient(auth, options);
|
|
158
|
+
}
|
|
159
|
+
async ingest(input) {
|
|
160
|
+
const chunkOpts = {};
|
|
161
|
+
const maxChars = input.chunk?.max_chars ?? this.#defaultChunk?.max_chars;
|
|
162
|
+
const overlap = input.chunk?.overlap ?? this.#defaultChunk?.overlap;
|
|
163
|
+
if (maxChars !== void 0) chunkOpts.max_chars = maxChars;
|
|
164
|
+
if (overlap !== void 0) chunkOpts.overlap = overlap;
|
|
165
|
+
const chunks = chunkText(input.text, chunkOpts);
|
|
166
|
+
if (chunks.length === 0) throw new ToolError("RAG ingest produced no chunks", { code: "bad_input" });
|
|
167
|
+
const embeddings = await this.#embedTexts(chunks);
|
|
168
|
+
if (embeddings.length !== chunks.length) throw new ToolError("Embed route returned a different number of vectors than chunks", { code: "upstream" });
|
|
169
|
+
const chunkIds = chunks.map((_, index) => chunkId(input.document_id, index));
|
|
170
|
+
const vectors = chunks.map((text, index) => {
|
|
171
|
+
const values = embeddings[index];
|
|
172
|
+
if (!values) throw new ToolError("Missing embedding for chunk", {
|
|
173
|
+
code: "upstream",
|
|
174
|
+
details: { index }
|
|
175
|
+
});
|
|
176
|
+
const metadata = {
|
|
177
|
+
document_id: input.document_id,
|
|
178
|
+
chunk_index: index,
|
|
179
|
+
text
|
|
180
|
+
};
|
|
181
|
+
if (input.metadata) for (const [key, value] of Object.entries(input.metadata)) {
|
|
182
|
+
if (key === "document_id" || key === "chunk_index" || key === "text") continue;
|
|
183
|
+
metadata[key] = value;
|
|
184
|
+
}
|
|
185
|
+
return {
|
|
186
|
+
id: chunkIds[index] ?? chunkId(input.document_id, index),
|
|
187
|
+
values,
|
|
188
|
+
metadata
|
|
189
|
+
};
|
|
190
|
+
});
|
|
191
|
+
const collection = input.collection ?? this.#defaultCollection;
|
|
192
|
+
const upsertInput = { vectors };
|
|
193
|
+
if (collection) upsertInput.collection = collection;
|
|
194
|
+
if (input.namespace) upsertInput.namespace = input.namespace;
|
|
195
|
+
const result = await this.#vectors.upsert(upsertInput);
|
|
196
|
+
const out = {
|
|
197
|
+
document_id: input.document_id,
|
|
198
|
+
chunk_count: chunks.length,
|
|
199
|
+
chunk_ids: chunkIds
|
|
200
|
+
};
|
|
201
|
+
const resolvedCollection = result.collection ?? collection;
|
|
202
|
+
if (resolvedCollection) out.collection = resolvedCollection;
|
|
203
|
+
return out;
|
|
204
|
+
}
|
|
205
|
+
async retrieve(input) {
|
|
206
|
+
const [queryVector] = await this.#embedTexts([input.query]);
|
|
207
|
+
if (!queryVector) throw new ToolError("Embed route returned no vector for the query", { code: "upstream" });
|
|
208
|
+
const collection = input.collection ?? this.#defaultCollection;
|
|
209
|
+
const queryInput = {
|
|
210
|
+
vector: queryVector,
|
|
211
|
+
top_k: input.top_k ?? 8,
|
|
212
|
+
include_metadata: true
|
|
213
|
+
};
|
|
214
|
+
if (collection) queryInput.collection = collection;
|
|
215
|
+
if (input.namespace) queryInput.namespace = input.namespace;
|
|
216
|
+
if (input.filter) queryInput.filter = input.filter;
|
|
217
|
+
const result = await this.#vectors.query(queryInput);
|
|
218
|
+
const out = { matches: result.matches.map((match) => {
|
|
219
|
+
const meta = match.metadata;
|
|
220
|
+
const text = meta && typeof meta["text"] === "string" ? meta["text"] : meta && typeof meta["content"] === "string" ? meta["content"] : void 0;
|
|
221
|
+
const documentId = meta && typeof meta["document_id"] === "string" ? meta["document_id"] : void 0;
|
|
222
|
+
const chunkIndex = meta && typeof meta["chunk_index"] === "number" ? meta["chunk_index"] : void 0;
|
|
223
|
+
const row = {
|
|
224
|
+
id: match.id,
|
|
225
|
+
score: match.score
|
|
226
|
+
};
|
|
227
|
+
if (text !== void 0) row.text = text;
|
|
228
|
+
if (documentId !== void 0) row.document_id = documentId;
|
|
229
|
+
if (chunkIndex !== void 0) row.chunk_index = chunkIndex;
|
|
230
|
+
if (meta !== void 0) row.metadata = meta;
|
|
231
|
+
return row;
|
|
232
|
+
}) };
|
|
233
|
+
const resolvedCollection = result.collection ?? collection;
|
|
234
|
+
if (resolvedCollection) out.collection = resolvedCollection;
|
|
235
|
+
return out;
|
|
236
|
+
}
|
|
237
|
+
async delete(input) {
|
|
238
|
+
const collection = input.collection ?? this.#defaultCollection;
|
|
239
|
+
const deleteInput = { ids: input.chunk_ids };
|
|
240
|
+
if (collection) deleteInput.collection = collection;
|
|
241
|
+
if (input.namespace) deleteInput.namespace = input.namespace;
|
|
242
|
+
const result = await this.#vectors.delete(deleteInput);
|
|
243
|
+
const out = { deleted: result.deleted };
|
|
244
|
+
const resolvedCollection = result.collection ?? collection;
|
|
245
|
+
if (resolvedCollection) out.collection = resolvedCollection;
|
|
246
|
+
return out;
|
|
247
|
+
}
|
|
248
|
+
async #embedTexts(texts) {
|
|
249
|
+
const path = this.#embed.path ?? "/embeddings";
|
|
250
|
+
const out = [];
|
|
251
|
+
for (let offset = 0; offset < texts.length; offset += 32) {
|
|
252
|
+
const batch = texts.slice(offset, offset + 32);
|
|
253
|
+
const body = {
|
|
254
|
+
model: this.#embed.model,
|
|
255
|
+
input: batch
|
|
256
|
+
};
|
|
257
|
+
if (this.#embed.dimensions !== void 0) body["dimensions"] = this.#embed.dimensions;
|
|
258
|
+
const res = await this.#embedHttp.post(path, body, {
|
|
259
|
+
label: "RAG embeddings",
|
|
260
|
+
noThrow: true
|
|
261
|
+
});
|
|
262
|
+
if (!res.ok) throw new ToolError(embedErrorMessage(res.data, res.status), {
|
|
263
|
+
code: mapEmbedStatus(res.status),
|
|
264
|
+
details: { status: res.status }
|
|
265
|
+
});
|
|
266
|
+
const data = isPlainObject(res.data) ? res.data["data"] : void 0;
|
|
267
|
+
if (!Array.isArray(data)) throw new ToolError("Embed route returned an invalid data array", { code: "upstream" });
|
|
268
|
+
const byIndex = /* @__PURE__ */ new Map();
|
|
269
|
+
for (const row of data) {
|
|
270
|
+
if (!isPlainObject(row)) continue;
|
|
271
|
+
const index = typeof row["index"] === "number" ? row["index"] : byIndex.size;
|
|
272
|
+
const embedding = row["embedding"];
|
|
273
|
+
if (!Array.isArray(embedding)) continue;
|
|
274
|
+
const values = [];
|
|
275
|
+
for (const n of embedding) {
|
|
276
|
+
if (typeof n !== "number" || !Number.isFinite(n)) throw new ToolError("Embed route returned a non-numeric embedding", { code: "upstream" });
|
|
277
|
+
values.push(n);
|
|
278
|
+
}
|
|
279
|
+
byIndex.set(index, values);
|
|
280
|
+
}
|
|
281
|
+
for (let i = 0; i < batch.length; i += 1) {
|
|
282
|
+
const values = byIndex.get(i);
|
|
283
|
+
if (!values) throw new ToolError("Embed route missing embedding for batch item", {
|
|
284
|
+
code: "upstream",
|
|
285
|
+
details: { index: offset + i }
|
|
286
|
+
});
|
|
287
|
+
out.push(values);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
return out;
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
function embedErrorMessage(data, status) {
|
|
294
|
+
if (isPlainObject(data)) {
|
|
295
|
+
const err = data["error"];
|
|
296
|
+
if (typeof err === "string" && err.length > 0) return err;
|
|
297
|
+
if (isPlainObject(err) && typeof err["message"] === "string") return err["message"];
|
|
298
|
+
if (typeof data["message"] === "string" && data["message"].length > 0) return data["message"];
|
|
299
|
+
}
|
|
300
|
+
return `RAG embeddings failed with HTTP ${status}`;
|
|
301
|
+
}
|
|
302
|
+
function mapEmbedStatus(status) {
|
|
303
|
+
if (status === 401 || status === 403) return "bad_auth";
|
|
304
|
+
if (status === 404) return "not_found";
|
|
305
|
+
if (status === 400 || status === 422) return "bad_input";
|
|
306
|
+
if (status === 429) return "rate_limited";
|
|
307
|
+
return "upstream";
|
|
308
|
+
}
|
|
309
|
+
//#endregion
|
|
310
|
+
//#region src/modules/rag/module.ts
|
|
311
|
+
const ragIngestTool = defineTool({
|
|
312
|
+
id: "rag-ingest",
|
|
313
|
+
name: "ragIngest",
|
|
314
|
+
description: "Chunk text with the requested overlap, create embeddings, and store the vectors for later semantic retrieval. Returns chunk ids for deletion and preserves chunk text in metadata.",
|
|
315
|
+
inputSchema: ragIngestInputSchema,
|
|
316
|
+
outputSchema: ragIngestOutputSchema,
|
|
317
|
+
sideEffect: "write",
|
|
318
|
+
runtime: "node",
|
|
319
|
+
execute: async (input, ctx) => RagClient.fromContext(ctx).ingest(input)
|
|
320
|
+
});
|
|
321
|
+
const ragRetrieveTool = defineTool({
|
|
322
|
+
id: "rag-retrieve",
|
|
323
|
+
name: "ragRetrieve",
|
|
324
|
+
description: "Embed a natural-language query and retrieve nearest chunks from the bound vector store. Returns text when stored in metadata.",
|
|
325
|
+
inputSchema: ragRetrieveInputSchema,
|
|
326
|
+
outputSchema: ragRetrieveOutputSchema,
|
|
327
|
+
sideEffect: "read",
|
|
328
|
+
runtime: "node",
|
|
329
|
+
execute: async (input, ctx) => RagClient.fromContext(ctx).retrieve(input)
|
|
330
|
+
});
|
|
331
|
+
const ragDeleteTool = defineTool({
|
|
332
|
+
id: "rag-delete",
|
|
333
|
+
name: "ragDelete",
|
|
334
|
+
description: "Delete previously ingested chunk vectors by id (from rag-ingest chunk_ids).",
|
|
335
|
+
inputSchema: ragDeleteInputSchema,
|
|
336
|
+
outputSchema: ragDeleteOutputSchema,
|
|
337
|
+
sideEffect: "delete",
|
|
338
|
+
runtime: "node",
|
|
339
|
+
execute: async (input, ctx) => RagClient.fromContext(ctx).delete(input)
|
|
340
|
+
});
|
|
341
|
+
const ragModule = defineModule({
|
|
342
|
+
id: "rag",
|
|
343
|
+
title: "RAG",
|
|
344
|
+
description: "Ingest text by chunking, embedding, and storing it; retrieve related chunks for a natural-language query; or delete previously ingested chunks. Use for semantic retrieval, not ordinary file reading.",
|
|
345
|
+
runtime: "node",
|
|
346
|
+
auth: {
|
|
347
|
+
type: "custom",
|
|
348
|
+
schema: ragAuthSchema
|
|
349
|
+
},
|
|
350
|
+
categories: [
|
|
351
|
+
"ai",
|
|
352
|
+
"rag",
|
|
353
|
+
"vector"
|
|
354
|
+
],
|
|
355
|
+
classification: "pii",
|
|
356
|
+
tags: ["ingest", "retrieve"],
|
|
357
|
+
tools: [
|
|
358
|
+
ragIngestTool,
|
|
359
|
+
ragRetrieveTool,
|
|
360
|
+
ragDeleteTool
|
|
361
|
+
]
|
|
362
|
+
});
|
|
363
|
+
//#endregion
|
|
364
|
+
export { DEFAULT_CHUNK_MAX_CHARS, DEFAULT_CHUNK_OVERLAP, MAX_CHUNK_MAX_CHARS, MAX_EMBED_BATCH, MAX_INGEST_CHARS, RagClient, chunkId, chunkText, embedAuthSchema, ragAuthSchema, ragDeleteInputSchema, ragDeleteOutputSchema, ragDeleteTool, ragIngestInputSchema, ragIngestOutputSchema, ragIngestTool, ragModule, ragRetrieveInputSchema, ragRetrieveOutputSchema, ragRetrieveTool, ragRetrievedChunkSchema };
|
|
365
|
+
|
|
366
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["#vectors","#embedHttp","#embed","#defaultCollection","#defaultChunk","#embedTexts"],"sources":["../../../src/modules/rag/contracts.ts","../../../src/modules/rag/domain.ts","../../../src/modules/rag/client.ts","../../../src/modules/rag/module.ts"],"sourcesContent":["/**\n * RAG seam contracts — ingest + retrieve over host-bound embed + vector-store.\n */\n\nimport { z } from 'zod'\n\nimport { vectorMetadataSchema } from '../../vendors/_vector'\nimport {\n\tmastraVectorSeamAuthSchema,\n\tpineconeVectorAuthSchema,\n\tqdrantVectorAuthSchema,\n\tsupabaseVectorSeamAuthSchema\n} from '../vector-store/contracts'\n\nexport const DEFAULT_CHUNK_MAX_CHARS = 1200\nexport const DEFAULT_CHUNK_OVERLAP = 200\nexport const MAX_CHUNK_MAX_CHARS = 8000\nexport const MAX_INGEST_CHARS = 500_000\nexport const MAX_EMBED_BATCH = 32\n\nexport const embedAuthSchema = z.object({\n\tbase_url: z\n\t\t.string()\n\t\t.url()\n\t\t.describe(\n\t\t\t'OpenAI-compatible embeddings origin, for example https://api.openai.com/v1 or https://openrouter.ai/api/v1'\n\t\t),\n\tapi_key: z.string().min(1).optional().describe('Optional Bearer token for the embed route'),\n\tmodel: z.string().min(1).describe('Embedding model id'),\n\tpath: z.string().min(1).optional().describe('Embeddings path relative to base_url (default /embeddings)'),\n\tdimensions: z.number().int().positive().optional().describe('Optional dimensions when the embed API supports it')\n})\n\nexport const ragChunkOptionsSchema = z.object({\n\tmax_chars: z\n\t\t.number()\n\t\t.int()\n\t\t.min(200)\n\t\t.max(MAX_CHUNK_MAX_CHARS)\n\t\t.optional()\n\t\t.describe(`Chunk size in characters (default ${DEFAULT_CHUNK_MAX_CHARS})`),\n\toverlap: z\n\t\t.number()\n\t\t.int()\n\t\t.min(0)\n\t\t.max(2000)\n\t\t.optional()\n\t\t.describe(`Overlap in characters between chunks (default ${DEFAULT_CHUNK_OVERLAP})`)\n})\n\nexport const ragAuthSchema = z.object({\n\tvector_store: z.discriminatedUnion('provider', [\n\t\tqdrantVectorAuthSchema,\n\t\tpineconeVectorAuthSchema,\n\t\tsupabaseVectorSeamAuthSchema,\n\t\tmastraVectorSeamAuthSchema\n\t]),\n\tembed: embedAuthSchema,\n\tdefault_collection: z\n\t\t.string()\n\t\t.min(1)\n\t\t.optional()\n\t\t.describe('Default collection / index when tool input omits collection'),\n\tchunk: ragChunkOptionsSchema.optional().describe('Default chunking options for ingest')\n})\n\nexport const ragIngestInputSchema = z.object({\n\tdocument_id: z.string().min(1).describe('Stable document id used as the chunk id prefix'),\n\ttext: z\n\t\t.string()\n\t\t.min(1)\n\t\t.max(MAX_INGEST_CHARS)\n\t\t.describe(`Document text to chunk, embed, and store (max ${MAX_INGEST_CHARS} characters)`),\n\tmetadata: vectorMetadataSchema.optional().describe('Metadata copied onto every chunk'),\n\tcollection: z.string().min(1).optional().describe('Collection / index override'),\n\tnamespace: z.string().min(1).optional().describe('Optional vector namespace when the bound store supports it'),\n\tchunk: ragChunkOptionsSchema.optional().describe('Per-call chunking override')\n})\n\nexport const ragIngestOutputSchema = z.object({\n\tdocument_id: z.string(),\n\tchunk_count: z.number().int().nonnegative(),\n\tchunk_ids: z.array(z.string()).describe('Vector ids written for this document'),\n\tcollection: z.string().optional()\n})\n\nexport const ragRetrieveInputSchema = z.object({\n\tquery: z.string().min(1).describe('Natural-language query to embed and search'),\n\ttop_k: z.number().int().min(1).max(100).optional().describe('Number of chunks to return (default 8)'),\n\tcollection: z.string().min(1).optional().describe('Collection / index override'),\n\tnamespace: z.string().min(1).optional().describe('Optional vector namespace when the bound store supports it'),\n\tfilter: z.record(z.string(), z.unknown()).optional().describe('Optional store-native metadata filter')\n})\n\nexport const ragRetrievedChunkSchema = z.object({\n\tid: z.string(),\n\tscore: z.number(),\n\ttext: z.string().optional().describe('Chunk text when stored in metadata'),\n\tdocument_id: z.string().optional(),\n\tchunk_index: z.number().int().optional(),\n\tmetadata: vectorMetadataSchema.optional()\n})\n\nexport const ragRetrieveOutputSchema = z.object({\n\tmatches: z.array(ragRetrievedChunkSchema),\n\tcollection: z.string().optional()\n})\n\nexport const ragDeleteInputSchema = z.object({\n\tchunk_ids: z\n\t\t.array(z.string().min(1))\n\t\t.min(1)\n\t\t.max(100)\n\t\t.describe('Chunk / vector ids to delete (from a prior rag-ingest)'),\n\tcollection: z.string().min(1).optional().describe('Collection / index override'),\n\tnamespace: z.string().min(1).optional().describe('Optional vector namespace when the bound store supports it')\n})\n\nexport const ragDeleteOutputSchema = z.object({\n\tdeleted: z.number().int().nonnegative(),\n\tcollection: z.string().optional()\n})\n\nexport type EmbedAuth = z.infer<typeof embedAuthSchema>\nexport type RagAuth = z.infer<typeof ragAuthSchema>\nexport type RagIngestInput = z.infer<typeof ragIngestInputSchema>\nexport type RagIngestOutput = z.infer<typeof ragIngestOutputSchema>\nexport type RagRetrieveInput = z.infer<typeof ragRetrieveInputSchema>\nexport type RagRetrieveOutput = z.infer<typeof ragRetrieveOutputSchema>\nexport type RagDeleteInput = z.infer<typeof ragDeleteInputSchema>\nexport type RagDeleteOutput = z.infer<typeof ragDeleteOutputSchema>\n","/**\n * Pure RAG helpers: text chunking (no HTTP).\n */\n\nimport { DEFAULT_CHUNK_MAX_CHARS, DEFAULT_CHUNK_OVERLAP } from './contracts'\n\nexport type ChunkOptions = {\n\tmax_chars?: number | undefined\n\toverlap?: number | undefined\n}\n\n/**\n * Split text into overlapping character windows.\n * Prefers paragraph then newline boundaries when a soft break exists near the end of a window.\n */\nexport function chunkText(text: string, options: ChunkOptions = {}): string[] {\n\tconst maxChars = options.max_chars ?? DEFAULT_CHUNK_MAX_CHARS\n\tconst overlap = Math.min(options.overlap ?? DEFAULT_CHUNK_OVERLAP, Math.max(0, maxChars - 1))\n\tconst normalized = text.replace(/\\r\\n/g, '\\n').trim()\n\tif (normalized.length === 0) return []\n\tif (normalized.length <= maxChars) return [normalized]\n\n\tconst chunks: string[] = []\n\tlet start = 0\n\twhile (start < normalized.length) {\n\t\tlet end = Math.min(start + maxChars, normalized.length)\n\t\tif (end < normalized.length) {\n\t\t\tconst window = normalized.slice(start, end)\n\t\t\tconst para = window.lastIndexOf('\\n\\n')\n\t\t\tconst line = window.lastIndexOf('\\n')\n\t\t\tconst soft = para >= maxChars * 0.5 ? para : line >= maxChars * 0.5 ? line : -1\n\t\t\tif (soft > 0) {\n\t\t\t\tend = start + soft\n\t\t\t}\n\t\t}\n\t\tconst piece = normalized.slice(start, end).trim()\n\t\tif (piece.length > 0) chunks.push(piece)\n\t\tif (end >= normalized.length) break\n\t\tconst next = end - overlap\n\t\tstart = next <= start ? end : next\n\t}\n\treturn chunks\n}\n\nexport function chunkId(documentId: string, index: number): string {\n\treturn `${documentId}#${index}`\n}\n","/**\n * RAG client — host-bound OpenAI-compatible embeddings + nested vector-store.\n */\n\nimport { isPlainObject } from 'es-toolkit'\n\nimport { ToolError } from '../../core/errors'\nimport { requireAuth } from '../../core/provider'\nimport type { ToolContext } from '../../core/types'\nimport { HttpService } from '../../transport/http-service'\nimport type { HttpServiceOptions } from '../../transport/http-service'\nimport { VectorStoreClient } from '../vector-store'\nimport type { VectorStoreAuth } from '../vector-store'\nimport { MAX_EMBED_BATCH, ragAuthSchema } from './contracts'\nimport type {\n\tEmbedAuth,\n\tRagAuth,\n\tRagDeleteInput,\n\tRagDeleteOutput,\n\tRagIngestInput,\n\tRagIngestOutput,\n\tRagRetrieveInput,\n\tRagRetrieveOutput\n} from './contracts'\nimport { chunkId, chunkText } from './domain'\n\nexport type RagClientOptions = {\n\tfetch?: HttpServiceOptions['fetch'] | undefined\n\tsignal?: HttpServiceOptions['signal'] | undefined\n}\n\nexport class RagClient {\n\treadonly #vectors: VectorStoreClient\n\treadonly #embedHttp: HttpService\n\treadonly #embed: EmbedAuth\n\treadonly #defaultCollection: string | undefined\n\treadonly #defaultChunk: RagAuth['chunk']\n\n\tconstructor(auth: RagAuth, options: RagClientOptions = {}) {\n\t\tconst vectorCtx: ToolContext = {}\n\t\tif (options.fetch) vectorCtx.fetch = options.fetch\n\t\tif (options.signal) vectorCtx.signal = options.signal\n\t\tthis.#vectors = VectorStoreClient.fromAuth(auth.vector_store, vectorCtx)\n\t\tthis.#embed = auth.embed\n\t\tthis.#defaultCollection = auth.default_collection\n\t\tthis.#defaultChunk = auth.chunk\n\n\t\tconst headers: Record<string, string> = {\n\t\t\t'Content-Type': 'application/json'\n\t\t}\n\t\tif (auth.embed.api_key) {\n\t\t\theaders['Authorization'] = `Bearer ${auth.embed.api_key}`\n\t\t}\n\t\tconst httpOptions: HttpServiceOptions = {\n\t\t\tbaseURL: auth.embed.base_url,\n\t\t\theaders,\n\t\t\tlabel: 'RAG embed'\n\t\t}\n\t\tif (options.fetch) httpOptions.fetch = options.fetch\n\t\tif (options.signal) httpOptions.signal = options.signal\n\t\tthis.#embedHttp = new HttpService(httpOptions)\n\t}\n\n\tstatic fromContext(ctx: ToolContext): RagClient {\n\t\tconst auth = requireAuth(ctx, ragAuthSchema)\n\t\tconst options: RagClientOptions = {}\n\t\tif (ctx.fetch) options.fetch = ctx.fetch\n\t\tif (ctx.signal) options.signal = ctx.signal\n\t\treturn new RagClient(auth, options)\n\t}\n\n\tstatic fromAuth(auth: RagAuth, options: RagClientOptions = {}): RagClient {\n\t\treturn new RagClient(auth, options)\n\t}\n\n\tasync ingest(input: RagIngestInput): Promise<RagIngestOutput> {\n\t\tconst chunkOpts: { max_chars?: number; overlap?: number } = {}\n\t\tconst maxChars = input.chunk?.max_chars ?? this.#defaultChunk?.max_chars\n\t\tconst overlap = input.chunk?.overlap ?? this.#defaultChunk?.overlap\n\t\tif (maxChars !== undefined) chunkOpts.max_chars = maxChars\n\t\tif (overlap !== undefined) chunkOpts.overlap = overlap\n\t\tconst chunks = chunkText(input.text, chunkOpts)\n\t\tif (chunks.length === 0) {\n\t\t\tthrow new ToolError('RAG ingest produced no chunks', { code: 'bad_input' })\n\t\t}\n\n\t\tconst embeddings = await this.#embedTexts(chunks)\n\t\tif (embeddings.length !== chunks.length) {\n\t\t\tthrow new ToolError('Embed route returned a different number of vectors than chunks', {\n\t\t\t\tcode: 'upstream'\n\t\t\t})\n\t\t}\n\n\t\tconst chunkIds = chunks.map((_, index) => chunkId(input.document_id, index))\n\t\tconst vectors = chunks.map((text, index) => {\n\t\t\tconst values = embeddings[index]\n\t\t\tif (!values) {\n\t\t\t\tthrow new ToolError('Missing embedding for chunk', { code: 'upstream', details: { index } })\n\t\t\t}\n\t\t\tconst metadata: Record<string, string | number | boolean | null> = {\n\t\t\t\tdocument_id: input.document_id,\n\t\t\t\tchunk_index: index,\n\t\t\t\ttext\n\t\t\t}\n\t\t\tif (input.metadata) {\n\t\t\t\tfor (const [key, value] of Object.entries(input.metadata)) {\n\t\t\t\t\tif (key === 'document_id' || key === 'chunk_index' || key === 'text') continue\n\t\t\t\t\tmetadata[key] = value\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tid: chunkIds[index] ?? chunkId(input.document_id, index),\n\t\t\t\tvalues,\n\t\t\t\tmetadata\n\t\t\t}\n\t\t})\n\n\t\tconst collection = input.collection ?? this.#defaultCollection\n\t\tconst upsertInput: Parameters<VectorStoreClient['upsert']>[0] = { vectors }\n\t\tif (collection) upsertInput.collection = collection\n\t\tif (input.namespace) upsertInput.namespace = input.namespace\n\t\tconst result = await this.#vectors.upsert(upsertInput)\n\n\t\tconst out: RagIngestOutput = {\n\t\t\tdocument_id: input.document_id,\n\t\t\tchunk_count: chunks.length,\n\t\t\tchunk_ids: chunkIds\n\t\t}\n\t\tconst resolvedCollection = result.collection ?? collection\n\t\tif (resolvedCollection) out.collection = resolvedCollection\n\t\treturn out\n\t}\n\n\tasync retrieve(input: RagRetrieveInput): Promise<RagRetrieveOutput> {\n\t\tconst [queryVector] = await this.#embedTexts([input.query])\n\t\tif (!queryVector) {\n\t\t\tthrow new ToolError('Embed route returned no vector for the query', { code: 'upstream' })\n\t\t}\n\n\t\tconst collection = input.collection ?? this.#defaultCollection\n\t\tconst queryInput: Parameters<VectorStoreClient['query']>[0] = {\n\t\t\tvector: queryVector,\n\t\t\ttop_k: input.top_k ?? 8,\n\t\t\tinclude_metadata: true\n\t\t}\n\t\tif (collection) queryInput.collection = collection\n\t\tif (input.namespace) queryInput.namespace = input.namespace\n\t\tif (input.filter) queryInput.filter = input.filter\n\t\tconst result = await this.#vectors.query(queryInput)\n\n\t\tconst matches = result.matches.map((match) => {\n\t\t\tconst meta = match.metadata\n\t\t\tconst text =\n\t\t\t\tmeta && typeof meta['text'] === 'string'\n\t\t\t\t\t? meta['text']\n\t\t\t\t\t: meta && typeof meta['content'] === 'string'\n\t\t\t\t\t\t? meta['content']\n\t\t\t\t\t\t: undefined\n\t\t\tconst documentId = meta && typeof meta['document_id'] === 'string' ? meta['document_id'] : undefined\n\t\t\tconst chunkIndex = meta && typeof meta['chunk_index'] === 'number' ? meta['chunk_index'] : undefined\n\t\t\tconst row: RagRetrieveOutput['matches'][number] = {\n\t\t\t\tid: match.id,\n\t\t\t\tscore: match.score\n\t\t\t}\n\t\t\tif (text !== undefined) row.text = text\n\t\t\tif (documentId !== undefined) row.document_id = documentId\n\t\t\tif (chunkIndex !== undefined) row.chunk_index = chunkIndex\n\t\t\tif (meta !== undefined) row.metadata = meta\n\t\t\treturn row\n\t\t})\n\n\t\tconst out: RagRetrieveOutput = { matches }\n\t\tconst resolvedCollection = result.collection ?? collection\n\t\tif (resolvedCollection) out.collection = resolvedCollection\n\t\treturn out\n\t}\n\n\tasync delete(input: RagDeleteInput): Promise<RagDeleteOutput> {\n\t\tconst collection = input.collection ?? this.#defaultCollection\n\t\tconst deleteInput: Parameters<VectorStoreClient['delete']>[0] = { ids: input.chunk_ids }\n\t\tif (collection) deleteInput.collection = collection\n\t\tif (input.namespace) deleteInput.namespace = input.namespace\n\t\tconst result = await this.#vectors.delete(deleteInput)\n\t\tconst out: RagDeleteOutput = { deleted: result.deleted }\n\t\tconst resolvedCollection = result.collection ?? collection\n\t\tif (resolvedCollection) out.collection = resolvedCollection\n\t\treturn out\n\t}\n\n\tasync #embedTexts(texts: string[]): Promise<number[][]> {\n\t\tconst path = this.#embed.path ?? '/embeddings'\n\t\tconst out: number[][] = []\n\n\t\tfor (let offset = 0; offset < texts.length; offset += MAX_EMBED_BATCH) {\n\t\t\tconst batch = texts.slice(offset, offset + MAX_EMBED_BATCH)\n\t\t\tconst body: Record<string, unknown> = {\n\t\t\t\tmodel: this.#embed.model,\n\t\t\t\tinput: batch\n\t\t\t}\n\t\t\tif (this.#embed.dimensions !== undefined) {\n\t\t\t\tbody['dimensions'] = this.#embed.dimensions\n\t\t\t}\n\n\t\t\tconst res = await this.#embedHttp.post(path, body, {\n\t\t\t\tlabel: 'RAG embeddings',\n\t\t\t\tnoThrow: true\n\t\t\t})\n\t\t\tif (!res.ok) {\n\t\t\t\tthrow new ToolError(embedErrorMessage(res.data, res.status), {\n\t\t\t\t\tcode: mapEmbedStatus(res.status),\n\t\t\t\t\tdetails: { status: res.status }\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tconst data = isPlainObject(res.data) ? res.data['data'] : undefined\n\t\t\tif (!Array.isArray(data)) {\n\t\t\t\tthrow new ToolError('Embed route returned an invalid data array', { code: 'upstream' })\n\t\t\t}\n\n\t\t\tconst byIndex = new Map<number, number[]>()\n\t\t\tfor (const row of data) {\n\t\t\t\tif (!isPlainObject(row)) continue\n\t\t\t\tconst index = typeof row['index'] === 'number' ? row['index'] : byIndex.size\n\t\t\t\tconst embedding = row['embedding']\n\t\t\t\tif (!Array.isArray(embedding)) continue\n\t\t\t\tconst values: number[] = []\n\t\t\t\tfor (const n of embedding) {\n\t\t\t\t\tif (typeof n !== 'number' || !Number.isFinite(n)) {\n\t\t\t\t\t\tthrow new ToolError('Embed route returned a non-numeric embedding', { code: 'upstream' })\n\t\t\t\t\t}\n\t\t\t\t\tvalues.push(n)\n\t\t\t\t}\n\t\t\t\tbyIndex.set(index, values)\n\t\t\t}\n\n\t\t\tfor (let i = 0; i < batch.length; i += 1) {\n\t\t\t\tconst values = byIndex.get(i)\n\t\t\t\tif (!values) {\n\t\t\t\t\tthrow new ToolError('Embed route missing embedding for batch item', {\n\t\t\t\t\t\tcode: 'upstream',\n\t\t\t\t\t\tdetails: { index: offset + i }\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t\tout.push(values)\n\t\t\t}\n\t\t}\n\n\t\treturn out\n\t}\n}\n\nfunction embedErrorMessage(data: unknown, status: number): string {\n\tif (isPlainObject(data)) {\n\t\tconst err = data['error']\n\t\tif (typeof err === 'string' && err.length > 0) return err\n\t\tif (isPlainObject(err) && typeof err['message'] === 'string') return err['message']\n\t\tif (typeof data['message'] === 'string' && data['message'].length > 0) return data['message']\n\t}\n\treturn `RAG embeddings failed with HTTP ${status}`\n}\n\nfunction mapEmbedStatus(status: number): ToolError['code'] {\n\tif (status === 401 || status === 403) return 'bad_auth'\n\tif (status === 404) return 'not_found'\n\tif (status === 400 || status === 422) return 'bad_input'\n\tif (status === 429) return 'rate_limited'\n\treturn 'upstream'\n}\n\n/** Re-export nested auth type for hosts. */\nexport type { VectorStoreAuth }\n","import { defineModule, defineTool } from '../../core/define'\nimport { RagClient } from './client'\nimport {\n\tragAuthSchema,\n\tragDeleteInputSchema,\n\tragDeleteOutputSchema,\n\tragIngestInputSchema,\n\tragIngestOutputSchema,\n\tragRetrieveInputSchema,\n\tragRetrieveOutputSchema\n} from './contracts'\n\nexport type { RagAuth } from './contracts'\nexport { ragAuthSchema }\n\nexport const ragIngestTool = defineTool({\n\tid: 'rag-ingest',\n\tname: 'ragIngest',\n\tdescription:\n\t\t'Chunk text with the requested overlap, create embeddings, and store the vectors for later semantic retrieval. Returns chunk ids for deletion and preserves chunk text in metadata.',\n\tinputSchema: ragIngestInputSchema,\n\toutputSchema: ragIngestOutputSchema,\n\tsideEffect: 'write',\n\truntime: 'node',\n\texecute: async (input, ctx) => RagClient.fromContext(ctx).ingest(input)\n})\n\nexport const ragRetrieveTool = defineTool({\n\tid: 'rag-retrieve',\n\tname: 'ragRetrieve',\n\tdescription:\n\t\t'Embed a natural-language query and retrieve nearest chunks from the bound vector store. Returns text when stored in metadata.',\n\tinputSchema: ragRetrieveInputSchema,\n\toutputSchema: ragRetrieveOutputSchema,\n\tsideEffect: 'read',\n\truntime: 'node',\n\texecute: async (input, ctx) => RagClient.fromContext(ctx).retrieve(input)\n})\n\nexport const ragDeleteTool = defineTool({\n\tid: 'rag-delete',\n\tname: 'ragDelete',\n\tdescription: 'Delete previously ingested chunk vectors by id (from rag-ingest chunk_ids).',\n\tinputSchema: ragDeleteInputSchema,\n\toutputSchema: ragDeleteOutputSchema,\n\tsideEffect: 'delete',\n\truntime: 'node',\n\texecute: async (input, ctx) => RagClient.fromContext(ctx).delete(input)\n})\n\nexport const ragModule = defineModule({\n\tid: 'rag',\n\ttitle: 'RAG',\n\tdescription:\n\t\t'Ingest text by chunking, embedding, and storing it; retrieve related chunks for a natural-language query; or delete previously ingested chunks. Use for semantic retrieval, not ordinary file reading.',\n\truntime: 'node',\n\tauth: { type: 'custom', schema: ragAuthSchema },\n\tcategories: ['ai', 'rag', 'vector'],\n\tclassification: 'pii',\n\ttags: ['ingest', 'retrieve'],\n\ttools: [ragIngestTool, ragRetrieveTool, ragDeleteTool]\n})\n"],"mappings":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C"}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { a as ModuleDefinition, o as ToolContext, s as ToolDefinition } from "../../types-Ccb0DXY9.js";
|
|
2
|
+
import "../../index-CZX5OeOF.js";
|
|
3
|
+
import { s as HttpServiceOptions } from "../../http-service-T7E5UjP8.js";
|
|
4
|
+
import { A as scheduleListInputSchema, C as ScheduleUpdateInput, D as scheduleDeleteOutputSchema, E as scheduleCreateInputSchema, F as scheduleUpdateInputSchema, I as scheduleWriteOutputSchema, M as scheduleNameInputSchema, N as scheduleStateSchema, O as scheduleDetailSchema, P as scheduleSummarySchema, S as ScheduleSummary, _ as ScheduleGetOutput, b as ScheduleNameInput, g as ScheduleDetail, h as ScheduleDeleteOutput, j as scheduleListOutputSchema, k as scheduleGetOutputSchema, m as ScheduleCreateInput, v as ScheduleListInput, w as ScheduleWriteOutput, x as ScheduleState, y as ScheduleListOutput } from "../../index-n8JTpNf1.js";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
//#region src/modules/scheduler/contracts.d.ts
|
|
7
|
+
declare const eventBridgeSchedulerSeamAuthSchema: z.ZodObject<{
|
|
8
|
+
access_key_id: z.ZodString;
|
|
9
|
+
secret_access_key: z.ZodString;
|
|
10
|
+
region: z.ZodString;
|
|
11
|
+
session_token: z.ZodOptional<z.ZodString>;
|
|
12
|
+
target_arn: z.ZodString;
|
|
13
|
+
role_arn: z.ZodString;
|
|
14
|
+
group_name: z.ZodOptional<z.ZodString>;
|
|
15
|
+
flexible_window_minutes: z.ZodOptional<z.ZodInt>;
|
|
16
|
+
dead_letter_arn: z.ZodOptional<z.ZodString>;
|
|
17
|
+
max_retry_attempts: z.ZodOptional<z.ZodInt>;
|
|
18
|
+
max_event_age_seconds: z.ZodOptional<z.ZodInt>;
|
|
19
|
+
provider: z.ZodLiteral<"eventbridge">;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
declare const schedulerAuthSchema: z.ZodObject<{
|
|
22
|
+
access_key_id: z.ZodString;
|
|
23
|
+
secret_access_key: z.ZodString;
|
|
24
|
+
region: z.ZodString;
|
|
25
|
+
session_token: z.ZodOptional<z.ZodString>;
|
|
26
|
+
target_arn: z.ZodString;
|
|
27
|
+
role_arn: z.ZodString;
|
|
28
|
+
group_name: z.ZodOptional<z.ZodString>;
|
|
29
|
+
flexible_window_minutes: z.ZodOptional<z.ZodInt>;
|
|
30
|
+
dead_letter_arn: z.ZodOptional<z.ZodString>;
|
|
31
|
+
max_retry_attempts: z.ZodOptional<z.ZodInt>;
|
|
32
|
+
max_event_age_seconds: z.ZodOptional<z.ZodInt>;
|
|
33
|
+
provider: z.ZodLiteral<"eventbridge">;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
type EventBridgeSchedulerSeamAuth = z.infer<typeof eventBridgeSchedulerSeamAuthSchema>;
|
|
36
|
+
type SchedulerAuth = z.infer<typeof schedulerAuthSchema>;
|
|
37
|
+
type SchedulerOps = {
|
|
38
|
+
create(input: ScheduleCreateInput): Promise<ScheduleWriteOutput>;
|
|
39
|
+
update(input: ScheduleUpdateInput): Promise<ScheduleWriteOutput>;
|
|
40
|
+
get(input: ScheduleNameInput): Promise<ScheduleGetOutput>;
|
|
41
|
+
list(input?: ScheduleListInput): Promise<ScheduleListOutput>;
|
|
42
|
+
delete(input: ScheduleNameInput): Promise<ScheduleDeleteOutput>;
|
|
43
|
+
};
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/modules/scheduler/client.d.ts
|
|
46
|
+
declare class SchedulerClient implements SchedulerOps {
|
|
47
|
+
#private;
|
|
48
|
+
constructor(ops: SchedulerOps);
|
|
49
|
+
static fromContext(ctx: ToolContext): SchedulerClient;
|
|
50
|
+
static fromAuth(auth: SchedulerAuth, ctx?: ToolContext): SchedulerClient;
|
|
51
|
+
create(input: ScheduleCreateInput): Promise<{
|
|
52
|
+
name: string;
|
|
53
|
+
arn?: string | undefined;
|
|
54
|
+
}>;
|
|
55
|
+
update(input: ScheduleUpdateInput): Promise<{
|
|
56
|
+
name: string;
|
|
57
|
+
arn?: string | undefined;
|
|
58
|
+
}>;
|
|
59
|
+
get(input: ScheduleNameInput): Promise<{
|
|
60
|
+
schedule: {
|
|
61
|
+
name: string;
|
|
62
|
+
group_name?: string | undefined;
|
|
63
|
+
state?: "DISABLED" | "ENABLED" | undefined;
|
|
64
|
+
schedule_expression?: string | undefined;
|
|
65
|
+
arn?: string | undefined;
|
|
66
|
+
description?: string | undefined;
|
|
67
|
+
timezone?: string | undefined;
|
|
68
|
+
task_ref?: string | undefined;
|
|
69
|
+
creation_date?: string | undefined;
|
|
70
|
+
last_modification_date?: string | undefined;
|
|
71
|
+
};
|
|
72
|
+
}>;
|
|
73
|
+
list(input?: ScheduleListInput): Promise<{
|
|
74
|
+
schedules: {
|
|
75
|
+
name: string;
|
|
76
|
+
group_name?: string | undefined;
|
|
77
|
+
state?: "DISABLED" | "ENABLED" | undefined;
|
|
78
|
+
schedule_expression?: string | undefined;
|
|
79
|
+
arn?: string | undefined;
|
|
80
|
+
}[];
|
|
81
|
+
next_token?: string | undefined;
|
|
82
|
+
}>;
|
|
83
|
+
delete(input: ScheduleNameInput): Promise<{
|
|
84
|
+
name: string;
|
|
85
|
+
deleted: true;
|
|
86
|
+
}>;
|
|
87
|
+
}
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/modules/scheduler/module.d.ts
|
|
90
|
+
declare const schedulerCreateTool: ToolDefinition<{
|
|
91
|
+
name: string;
|
|
92
|
+
schedule_expression: string;
|
|
93
|
+
task_ref: string;
|
|
94
|
+
payload?: Record<string, unknown> | undefined;
|
|
95
|
+
timezone?: string | undefined;
|
|
96
|
+
description?: string | undefined;
|
|
97
|
+
state?: "DISABLED" | "ENABLED" | undefined;
|
|
98
|
+
start_at?: string | undefined;
|
|
99
|
+
end_at?: string | undefined;
|
|
100
|
+
action_after_completion?: "DELETE" | "NONE" | undefined;
|
|
101
|
+
}, {
|
|
102
|
+
name: string;
|
|
103
|
+
arn?: string | undefined;
|
|
104
|
+
}>;
|
|
105
|
+
declare const schedulerUpdateTool: ToolDefinition<{
|
|
106
|
+
name: string;
|
|
107
|
+
schedule_expression: string;
|
|
108
|
+
task_ref: string;
|
|
109
|
+
payload?: Record<string, unknown> | undefined;
|
|
110
|
+
timezone?: string | undefined;
|
|
111
|
+
description?: string | undefined;
|
|
112
|
+
state?: "DISABLED" | "ENABLED" | undefined;
|
|
113
|
+
start_at?: string | undefined;
|
|
114
|
+
end_at?: string | undefined;
|
|
115
|
+
action_after_completion?: "DELETE" | "NONE" | undefined;
|
|
116
|
+
}, {
|
|
117
|
+
name: string;
|
|
118
|
+
arn?: string | undefined;
|
|
119
|
+
}>;
|
|
120
|
+
declare const schedulerGetTool: ToolDefinition<{
|
|
121
|
+
name: string;
|
|
122
|
+
}, {
|
|
123
|
+
schedule: {
|
|
124
|
+
name: string;
|
|
125
|
+
group_name?: string | undefined;
|
|
126
|
+
state?: "DISABLED" | "ENABLED" | undefined;
|
|
127
|
+
schedule_expression?: string | undefined;
|
|
128
|
+
arn?: string | undefined;
|
|
129
|
+
description?: string | undefined;
|
|
130
|
+
timezone?: string | undefined;
|
|
131
|
+
task_ref?: string | undefined;
|
|
132
|
+
creation_date?: string | undefined;
|
|
133
|
+
last_modification_date?: string | undefined;
|
|
134
|
+
};
|
|
135
|
+
}>;
|
|
136
|
+
declare const schedulerListTool: ToolDefinition<{
|
|
137
|
+
name_prefix?: string | undefined;
|
|
138
|
+
state?: "DISABLED" | "ENABLED" | undefined;
|
|
139
|
+
max_results?: number | undefined;
|
|
140
|
+
next_token?: string | undefined;
|
|
141
|
+
}, {
|
|
142
|
+
schedules: {
|
|
143
|
+
name: string;
|
|
144
|
+
group_name?: string | undefined;
|
|
145
|
+
state?: "DISABLED" | "ENABLED" | undefined;
|
|
146
|
+
schedule_expression?: string | undefined;
|
|
147
|
+
arn?: string | undefined;
|
|
148
|
+
}[];
|
|
149
|
+
next_token?: string | undefined;
|
|
150
|
+
}>;
|
|
151
|
+
declare const schedulerDeleteTool: ToolDefinition<{
|
|
152
|
+
name: string;
|
|
153
|
+
}, {
|
|
154
|
+
name: string;
|
|
155
|
+
deleted: true;
|
|
156
|
+
}>;
|
|
157
|
+
declare const schedulerModule: ModuleDefinition<{
|
|
158
|
+
access_key_id: string;
|
|
159
|
+
secret_access_key: string;
|
|
160
|
+
region: string;
|
|
161
|
+
session_token?: string | undefined;
|
|
162
|
+
target_arn: string;
|
|
163
|
+
role_arn: string;
|
|
164
|
+
group_name?: string | undefined;
|
|
165
|
+
flexible_window_minutes?: number | undefined;
|
|
166
|
+
dead_letter_arn?: string | undefined;
|
|
167
|
+
max_retry_attempts?: number | undefined;
|
|
168
|
+
max_event_age_seconds?: number | undefined;
|
|
169
|
+
provider: "eventbridge";
|
|
170
|
+
}>;
|
|
171
|
+
//#endregion
|
|
172
|
+
//#region src/modules/scheduler/providers/eventbridge.d.ts
|
|
173
|
+
type EventBridgeSchedulerProviderOptions = Pick<HttpServiceOptions, 'fetch' | 'signal'>;
|
|
174
|
+
declare class EventBridgeSchedulerProvider implements SchedulerOps {
|
|
175
|
+
#private;
|
|
176
|
+
constructor(auth: EventBridgeSchedulerSeamAuth, options?: EventBridgeSchedulerProviderOptions);
|
|
177
|
+
create(input: ScheduleCreateInput): Promise<{
|
|
178
|
+
name: string;
|
|
179
|
+
arn?: string | undefined;
|
|
180
|
+
}>;
|
|
181
|
+
update(input: ScheduleUpdateInput): Promise<{
|
|
182
|
+
name: string;
|
|
183
|
+
arn?: string | undefined;
|
|
184
|
+
}>;
|
|
185
|
+
get(input: ScheduleNameInput): Promise<{
|
|
186
|
+
schedule: {
|
|
187
|
+
name: string;
|
|
188
|
+
group_name?: string | undefined;
|
|
189
|
+
state?: "DISABLED" | "ENABLED" | undefined;
|
|
190
|
+
schedule_expression?: string | undefined;
|
|
191
|
+
arn?: string | undefined;
|
|
192
|
+
description?: string | undefined;
|
|
193
|
+
timezone?: string | undefined;
|
|
194
|
+
task_ref?: string | undefined;
|
|
195
|
+
creation_date?: string | undefined;
|
|
196
|
+
last_modification_date?: string | undefined;
|
|
197
|
+
};
|
|
198
|
+
}>;
|
|
199
|
+
list(input?: ScheduleListInput): Promise<{
|
|
200
|
+
schedules: {
|
|
201
|
+
name: string;
|
|
202
|
+
group_name?: string | undefined;
|
|
203
|
+
state?: "DISABLED" | "ENABLED" | undefined;
|
|
204
|
+
schedule_expression?: string | undefined;
|
|
205
|
+
arn?: string | undefined;
|
|
206
|
+
}[];
|
|
207
|
+
next_token?: string | undefined;
|
|
208
|
+
}>;
|
|
209
|
+
delete(input: ScheduleNameInput): Promise<{
|
|
210
|
+
name: string;
|
|
211
|
+
deleted: true;
|
|
212
|
+
}>;
|
|
213
|
+
}
|
|
214
|
+
//#endregion
|
|
215
|
+
export { EventBridgeSchedulerProvider, type EventBridgeSchedulerProviderOptions, type EventBridgeSchedulerSeamAuth, type ScheduleCreateInput, type ScheduleDeleteOutput, type ScheduleDetail, type ScheduleGetOutput, type ScheduleListInput, type ScheduleListOutput, type ScheduleNameInput, type ScheduleState, type ScheduleSummary, type ScheduleUpdateInput, type ScheduleWriteOutput, type SchedulerAuth, SchedulerClient, type SchedulerOps, eventBridgeSchedulerSeamAuthSchema, scheduleCreateInputSchema, scheduleDeleteOutputSchema, scheduleDetailSchema, scheduleGetOutputSchema, scheduleListInputSchema, scheduleListOutputSchema, scheduleNameInputSchema, scheduleStateSchema, scheduleSummarySchema, scheduleUpdateInputSchema, scheduleWriteOutputSchema, schedulerAuthSchema, schedulerCreateTool, schedulerDeleteTool, schedulerGetTool, schedulerListTool, schedulerModule, schedulerUpdateTool };
|
|
216
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/modules/scheduler/contracts.ts","../../../src/modules/scheduler/client.ts","../../../src/modules/scheduler/module.ts","../../../src/modules/scheduler/providers/eventbridge.ts"],"mappings":";;;;;;cA4Da,oCAAkC,EAAA;;;;;;;;;;;;;GAE7C,EAAA,KAAA;cAEW,qBAAmB,EAAA;;;;;;;;;;;;;GAAqC,EAAA,KAAA;KAEzD,+BAA+B,EAAE,aAAa;KAC9C,gBAAgB,EAAE,aAAa;KAE/B;EACX,OAAO,OAAO,sBAAsB,QAAQ;EAC5C,OAAO,OAAO,sBAAsB,QAAQ;EAC5C,IAAI,OAAO,oBAAoB,QAAQ;EACvC,KAAK,QAAQ,oBAAoB,QAAQ;EACzC,OAAO,OAAO,oBAAoB,QAAQ;;;;cC/C9B,2BAA2B;;EAGvC,YAAY,KAAK;SAIV,YAAY,KAAK,cAAc;SAK/B,SAAS,MAAM,eAAe,MAAK,cAAmB;EAI7D,OAAO,OAAO,sBAAmB;;;;EAIjC,OAAO,OAAO,sBAAmB;;;;EAIjC,IAAI,OAAO,oBAAiB;;;;;;;;;;;;;;EAI5B,KAAK,QAAO,oBAAsB;;;;;;;;;;EAIlC,OAAO,OAAO,oBAAiB;;;;;;;cC7CnB,qBAAA;;;;YAAA;;;;;;;;;;;cAYA,qBAAA;;;;YAAA;;;;;;;;;;;cAYA,kBAAA;;;;;;;;;;;;;;;;cAWA,mBAAA;;;;;;;;;;;;;;;cAWA,qBAAA;;;;;;cAWA,iBAAA;;;;;;;;;;;;;;;;KC5DD,sCAAsC,KAAK;cAE1C,wCAAwC;;EAGpD,YAAY,MAAM,8BAA8B,UAAS;EAKzD,OAAO,OAAO,sBAAmB;;;;EAIjC,OAAO,OAAO,sBAAmB;;;;EAIjC,IAAI,OAAO,oBAAiB;;;;;;;;;;;;;;EAI5B,KAAK,QAAO,oBAAsB;;;;;;;;;;EAIlC,OAAO,OAAO,oBAAiB"}
|