@5ss/ai-tools 2.11.4 → 3.0.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 +4 -0
- package/README.md +1 -1
- package/dist/{aws-service-msttbPrz.js → aws-service-Cn_ozX4X.js} +2 -2
- package/dist/{aws-service-msttbPrz.js.map → aws-service-Cn_ozX4X.js.map} +1 -1
- package/dist/{bedrock-agentcore-browser-o_oqSPMK.js → bedrock-agentcore-browser-DwDSP_YL.js} +2 -2
- package/dist/{bedrock-agentcore-browser-o_oqSPMK.js.map → bedrock-agentcore-browser-DwDSP_YL.js.map} +1 -1
- package/dist/{bedrock-agentcore-code-interpreter-D4ERRFj1.js → bedrock-agentcore-code-interpreter-F0dnrAm4.js} +2 -2
- package/dist/{bedrock-agentcore-code-interpreter-D4ERRFj1.js.map → bedrock-agentcore-code-interpreter-F0dnrAm4.js.map} +1 -1
- package/dist/{cloudflare-browser-nLJdH5nG.js → cloudflare-browser-D-HT43hu.js} +3 -3
- package/dist/{cloudflare-browser-nLJdH5nG.js.map → cloudflare-browser-D-HT43hu.js.map} +1 -1
- package/dist/{cloudflare-email-CSRq8mRd.js → cloudflare-email-BLI3z96V.js} +2 -2
- package/dist/{cloudflare-email-CSRq8mRd.js.map → cloudflare-email-BLI3z96V.js.map} +1 -1
- package/dist/{cloudflare-sandbox-Be7SeS4-.js → cloudflare-sandbox-6nX5lIev.js} +3 -3
- package/dist/{cloudflare-sandbox-Be7SeS4-.js.map → cloudflare-sandbox-6nX5lIev.js.map} +1 -1
- package/dist/{eventbridge-scheduler-BhQaReAz.js → eventbridge-scheduler-CDmO2-Te.js} +2 -2
- package/dist/{eventbridge-scheduler-BhQaReAz.js.map → eventbridge-scheduler-CDmO2-Te.js.map} +1 -1
- package/dist/http/index.d.ts.map +1 -1
- package/dist/http/index.js +2 -2
- package/dist/{http-service-DDNCO1s4.js → http-service-BMBIryAL.js} +2 -5
- package/dist/http-service-BMBIryAL.js.map +1 -0
- package/dist/imessage-Dsms04rC.js +558 -0
- package/dist/imessage-Dsms04rC.js.map +1 -0
- package/dist/modules/artifacts/index.js +1 -1
- package/dist/modules/browser/index.js +2 -2
- package/dist/modules/code-sandbox/index.js +2 -2
- package/dist/modules/document-extract/index.js +1 -1
- package/dist/modules/document-render/index.js +1 -1
- package/dist/modules/email/index.js +2 -2
- package/dist/modules/files/index.js +1 -1
- package/dist/modules/image/index.js +1 -1
- package/dist/modules/messaging/index.d.ts +12 -24
- package/dist/modules/messaging/index.d.ts.map +1 -1
- package/dist/modules/messaging/index.js +27 -42
- package/dist/modules/messaging/index.js.map +1 -1
- package/dist/modules/queue/index.js +1 -1
- package/dist/modules/rag/index.js +2 -2
- package/dist/modules/scheduler/index.js +1 -1
- package/dist/modules/vector-store/index.js +1 -1
- package/dist/modules/web-fetch/index.js +1 -1
- package/dist/{pinecone-CNnCFmix.js → pinecone-BvdXAZMi.js} +2 -2
- package/dist/{pinecone-CNnCFmix.js.map → pinecone-BvdXAZMi.js.map} +1 -1
- package/dist/{qdrant-R_FIcG9d.js → qdrant-D2E2Lxrw.js} +2 -2
- package/dist/{qdrant-R_FIcG9d.js.map → qdrant-D2E2Lxrw.js.map} +1 -1
- package/dist/{resend-Bu0NFO3h.js → resend-A2SnRdQ8.js} +2 -2
- package/dist/{resend-Bu0NFO3h.js.map → resend-A2SnRdQ8.js.map} +1 -1
- package/dist/{s3-Dj7Teh-A.js → s3-CoZQRTfe.js} +2 -2
- package/dist/{s3-Dj7Teh-A.js.map → s3-CoZQRTfe.js.map} +1 -1
- package/dist/{slack-AjJDNnXJ.js → slack-C9UJ0b61.js} +2 -2
- package/dist/{slack-AjJDNnXJ.js.map → slack-C9UJ0b61.js.map} +1 -1
- package/dist/{sqs-CjyXjasF.js → sqs-DxFnfODk.js} +2 -2
- package/dist/{sqs-CjyXjasF.js.map → sqs-DxFnfODk.js.map} +1 -1
- package/dist/{supabase-vector-BNoJZuft.js → supabase-vector-DT3qfnt2.js} +2 -2
- package/dist/{supabase-vector-BNoJZuft.js.map → supabase-vector-DT3qfnt2.js.map} +1 -1
- package/dist/{teams-CvxYLAi5.js → teams-NODh3i6U.js} +2 -2
- package/dist/{teams-CvxYLAi5.js.map → teams-NODh3i6U.js.map} +1 -1
- package/dist/{telegram-B_-Jljk3.js → telegram-CWMHBeKo.js} +2 -2
- package/dist/{telegram-B_-Jljk3.js.map → telegram-CWMHBeKo.js.map} +1 -1
- package/dist/{textract-CAfnGvua.js → textract-2jkPuRiE.js} +3 -3
- package/dist/{textract-CAfnGvua.js.map → textract-2jkPuRiE.js.map} +1 -1
- package/dist/{vector-store-DDiu3XPg.js → vector-store-CDQaQXFV.js} +4 -4
- package/dist/{vector-store-DDiu3XPg.js.map → vector-store-CDQaQXFV.js.map} +1 -1
- package/dist/vendors/amazon-sp-api/index.d.ts +1 -8
- package/dist/vendors/amazon-sp-api/index.d.ts.map +1 -1
- package/dist/vendors/amazon-sp-api/index.js +3 -14
- package/dist/vendors/amazon-sp-api/index.js.map +1 -1
- package/dist/vendors/bedrock-agentcore-browser/index.js +1 -1
- package/dist/vendors/bedrock-agentcore-code-interpreter/index.js +1 -1
- package/dist/vendors/cloudflare-browser/index.js +1 -1
- package/dist/vendors/cloudflare-email/index.js +1 -1
- package/dist/vendors/cloudflare-sandbox/index.js +1 -1
- package/dist/vendors/eventbridge-scheduler/index.js +1 -1
- package/dist/vendors/imessage/index.d.ts +65 -188
- package/dist/vendors/imessage/index.d.ts.map +1 -1
- package/dist/vendors/imessage/index.js +2 -2
- package/dist/vendors/katana/index.d.ts +112 -56
- package/dist/vendors/katana/index.d.ts.map +1 -1
- package/dist/vendors/katana/index.js +42 -16
- package/dist/vendors/katana/index.js.map +1 -1
- package/dist/vendors/pinecone/index.js +1 -1
- package/dist/vendors/qdrant/index.js +1 -1
- package/dist/vendors/resend/index.js +1 -1
- package/dist/vendors/s3/index.js +1 -1
- package/dist/vendors/slack/index.js +1 -1
- package/dist/vendors/sqs/index.js +1 -1
- package/dist/vendors/supabase-vector/index.js +1 -1
- package/dist/vendors/teams/index.js +1 -1
- package/dist/vendors/telegram/index.js +1 -1
- package/dist/vendors/textract/index.js +1 -1
- package/dist/vendors/woocommerce/index.js +1 -1
- package/package.json +2 -18
- package/dist/http-service-DDNCO1s4.js.map +0 -1
- package/dist/imessage-CofjmONG.js +0 -893
- package/dist/imessage-CofjmONG.js.map +0 -1
package/dist/{eventbridge-scheduler-BhQaReAz.js.map → eventbridge-scheduler-CDmO2-Te.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eventbridge-scheduler-BhQaReAz.js","names":["#auth","#aws","#writeResult","#scheduleQuery"],"sources":["../src/vendors/eventbridge-scheduler/contracts.ts","../src/vendors/eventbridge-scheduler/domain.ts","../src/vendors/eventbridge-scheduler/client.ts","../src/vendors/eventbridge-scheduler/module.ts"],"sourcesContent":["/**\n * Amazon EventBridge Scheduler vendor contracts.\n * Host auth holds target ARN / role ARN; tools schedule task_ref only.\n */\n\nimport { z } from 'zod'\n\nexport const MAX_SCHEDULE_NAME = 64\nexport const MAX_TASK_REF = 512\nexport const MAX_PAYLOAD_JSON = 8_000\nexport const MAX_LIST = 100\n\nconst scheduleName = z\n\t.string()\n\t.min(1)\n\t.max(MAX_SCHEDULE_NAME)\n\t.regex(/^[0-9a-zA-Z-_.]+$/, 'Schedule name must match [0-9a-zA-Z-_.]+')\n\nexport const eventBridgeSchedulerAuthSchema = z.object({\n\taccess_key_id: z.string().min(1).describe('AWS access key id'),\n\tsecret_access_key: z.string().min(1).describe('AWS secret access key'),\n\tregion: z.string().min(1).describe('AWS region for EventBridge Scheduler'),\n\tsession_token: z.string().min(1).optional().describe('Optional session token'),\n\ttarget_arn: z.string().min(1).describe('Host-bound target ARN (Lambda, SQS, etc.)'),\n\trole_arn: z.string().min(1).describe('Host-bound IAM role ARN for the scheduler target'),\n\tgroup_name: z.string().min(1).max(64).optional().describe('Schedule group name (default group when omitted)'),\n\tflexible_window_minutes: z\n\t\t.int()\n\t\t.min(1)\n\t\t.max(1440)\n\t\t.optional()\n\t\t.describe('When set, FlexibleTimeWindow Mode=FLEXIBLE with this window; otherwise Mode=OFF'),\n\tdead_letter_arn: z.string().min(1).optional().describe('Optional DLQ ARN'),\n\tmax_retry_attempts: z.int().min(0).max(185).optional().describe('Target retry MaximumRetryAttempts'),\n\tmax_event_age_seconds: z.int().min(60).max(86400).optional().describe('Target retry MaximumEventAgeInSeconds')\n})\n\nexport type EventBridgeSchedulerAuth = z.infer<typeof eventBridgeSchedulerAuthSchema>\n\nexport const scheduleStateSchema = z.enum(['ENABLED', 'DISABLED'])\n\nexport type ScheduleState = z.infer<typeof scheduleStateSchema>\n\nexport const scheduleCreateInputSchema = z.object({\n\tname: scheduleName.describe('Schedule name'),\n\tschedule_expression: z.string().min(1).max(256).describe('When to run: at(...), rate(...), or cron(...) expression'),\n\ttask_ref: z\n\t\t.string()\n\t\t.min(1)\n\t\t.max(MAX_TASK_REF)\n\t\t.describe('Opaque task definition reference. Not an ARN or infrastructure id'),\n\tpayload: z\n\t\t.record(z.string(), z.unknown())\n\t\t.optional()\n\t\t.describe('Optional small JSON payload merged into the target input with task_ref'),\n\ttimezone: z.string().min(1).max(50).optional().describe('Timezone for the schedule expression'),\n\tdescription: z.string().max(512).optional().describe('Human description'),\n\tstate: scheduleStateSchema.optional().describe('ENABLED or DISABLED (default ENABLED)'),\n\tstart_at: z.string().min(1).optional().describe('ISO-8601 start time (UTC) when the schedule may begin'),\n\tend_at: z.string().min(1).optional().describe('ISO-8601 end time (UTC) when the schedule may stop'),\n\taction_after_completion: z\n\t\t.enum(['NONE', 'DELETE'])\n\t\t.optional()\n\t\t.describe('What to do after a one-time schedule completes')\n})\n\nexport const scheduleUpdateInputSchema = scheduleCreateInputSchema\n\nexport const scheduleNameInputSchema = z.object({\n\tname: scheduleName.describe('Schedule name')\n})\n\nexport const scheduleListInputSchema = z.object({\n\tname_prefix: z.string().min(1).max(64).optional().describe('Filter by name prefix'),\n\tstate: scheduleStateSchema.optional().describe('Filter by state'),\n\tmax_results: z.int().min(1).max(MAX_LIST).optional().describe('Page size (default 100)'),\n\tnext_token: z.string().min(1).optional().describe('Pagination token from a prior list call')\n})\n\nexport const scheduleSummarySchema = z.object({\n\tname: z.string().describe('Schedule name'),\n\tgroup_name: z.string().optional().describe('Schedule group'),\n\tstate: scheduleStateSchema.optional().describe('ENABLED or DISABLED'),\n\tschedule_expression: z.string().optional().describe('Schedule expression when known'),\n\tarn: z.string().optional().describe('Schedule ARN when returned by the provider')\n})\n\nexport const scheduleDetailSchema = scheduleSummarySchema.extend({\n\tdescription: z.string().optional(),\n\ttimezone: z.string().optional(),\n\ttask_ref: z.string().optional().describe('task_ref parsed from target input when present'),\n\tcreation_date: z.string().optional(),\n\tlast_modification_date: z.string().optional()\n})\n\nexport const scheduleWriteOutputSchema = z.object({\n\tname: z.string().describe('Schedule name'),\n\tarn: z.string().optional().describe('Schedule ARN when returned')\n})\n\nexport const scheduleGetOutputSchema = z.object({\n\tschedule: scheduleDetailSchema\n})\n\nexport const scheduleListOutputSchema = z.object({\n\tschedules: z.array(scheduleSummarySchema),\n\tnext_token: z.string().optional().describe('Pagination token when more results exist')\n})\n\nexport const scheduleDeleteOutputSchema = z.object({\n\tname: z.string().describe('Deleted schedule name'),\n\tdeleted: z.literal(true)\n})\n\nexport type ScheduleCreateInput = z.infer<typeof scheduleCreateInputSchema>\nexport type ScheduleUpdateInput = z.infer<typeof scheduleUpdateInputSchema>\nexport type ScheduleNameInput = z.infer<typeof scheduleNameInputSchema>\nexport type ScheduleListInput = z.infer<typeof scheduleListInputSchema>\nexport type ScheduleSummary = z.infer<typeof scheduleSummarySchema>\nexport type ScheduleDetail = z.infer<typeof scheduleDetailSchema>\nexport type ScheduleWriteOutput = z.infer<typeof scheduleWriteOutputSchema>\nexport type ScheduleGetOutput = z.infer<typeof scheduleGetOutputSchema>\nexport type ScheduleListOutput = z.infer<typeof scheduleListOutputSchema>\nexport type ScheduleDeleteOutput = z.infer<typeof scheduleDeleteOutputSchema>\n","/**\n * EventBridge Scheduler pure helpers (no HTTP).\n */\n\nimport { isPlainObject, isString } from 'es-toolkit'\n\nimport { ToolError } from '../../core/errors'\nimport type { EventBridgeSchedulerAuth, ScheduleCreateInput, ScheduleDetail, ScheduleSummary } from './contracts'\nimport { MAX_PAYLOAD_JSON } from './contracts'\n\nexport function buildTargetInput(taskRef: string, payload?: Record<string, unknown>): string {\n\tconst body: Record<string, unknown> = { task_ref: taskRef }\n\tif (payload !== undefined) {\n\t\tfor (const [key, value] of Object.entries(payload)) {\n\t\t\tif (key === 'task_ref') continue\n\t\t\tbody[key] = value\n\t\t}\n\t}\n\tconst json = JSON.stringify(body)\n\tif (json.length > MAX_PAYLOAD_JSON) {\n\t\tthrow new ToolError('Schedule target payload is too large', {\n\t\t\tcode: 'too_large',\n\t\t\tdetails: { max_chars: MAX_PAYLOAD_JSON, length: json.length }\n\t\t})\n\t}\n\treturn json\n}\n\nexport function parseTaskRefFromInput(input: unknown): string | undefined {\n\tif (!isString(input) || input.length === 0) return undefined\n\ttry {\n\t\tconst parsed: unknown = JSON.parse(input)\n\t\tif (!isPlainObject(parsed)) return undefined\n\t\tconst ref = parsed['task_ref']\n\t\treturn isString(ref) ? ref : undefined\n\t} catch {\n\t\treturn undefined\n\t}\n}\n\nexport function flexibleTimeWindow(auth: EventBridgeSchedulerAuth): {\n\tMode: 'OFF' | 'FLEXIBLE'\n\tMaximumWindowInMinutes?: number\n} {\n\tif (auth.flexible_window_minutes !== undefined) {\n\t\treturn { Mode: 'FLEXIBLE', MaximumWindowInMinutes: auth.flexible_window_minutes }\n\t}\n\treturn { Mode: 'OFF' }\n}\n\nexport function isoToUnixSeconds(iso: string, field: string): number {\n\tconst ms = Date.parse(iso)\n\tif (!Number.isFinite(ms)) {\n\t\tthrow new ToolError(`Invalid ${field} timestamp`, { code: 'bad_input', details: { field, value: iso } })\n\t}\n\treturn Math.floor(ms / 1000)\n}\n\n/**\n * EventBridge Scheduler rejects empty ClientToken on the raw HTTP API even when\n * docs mark it optional (SDKs / CLI always send one).\n * Pattern: [a-zA-Z0-9-_]+, max 64.\n */\nexport function newClientToken(): string {\n\treturn crypto.randomUUID().replaceAll('-', '')\n}\n\nexport function buildCreateBody(auth: EventBridgeSchedulerAuth, input: ScheduleCreateInput): Record<string, unknown> {\n\tconst target: Record<string, unknown> = {\n\t\tArn: auth.target_arn,\n\t\tRoleArn: auth.role_arn,\n\t\tInput: buildTargetInput(input.task_ref, input.payload)\n\t}\n\tif (auth.dead_letter_arn) {\n\t\ttarget['DeadLetterConfig'] = { Arn: auth.dead_letter_arn }\n\t}\n\tif (auth.max_retry_attempts !== undefined || auth.max_event_age_seconds !== undefined) {\n\t\tconst retry: Record<string, number> = {}\n\t\tif (auth.max_retry_attempts !== undefined) retry['MaximumRetryAttempts'] = auth.max_retry_attempts\n\t\tif (auth.max_event_age_seconds !== undefined) retry['MaximumEventAgeInSeconds'] = auth.max_event_age_seconds\n\t\ttarget['RetryPolicy'] = retry\n\t}\n\n\tconst body: Record<string, unknown> = {\n\t\tClientToken: newClientToken(),\n\t\tScheduleExpression: input.schedule_expression,\n\t\tFlexibleTimeWindow: flexibleTimeWindow(auth),\n\t\tTarget: target,\n\t\tState: input.state ?? 'ENABLED'\n\t}\n\tif (auth.group_name) body['GroupName'] = auth.group_name\n\tif (input.timezone) body['ScheduleExpressionTimezone'] = input.timezone\n\tif (input.description) body['Description'] = input.description\n\tif (input.action_after_completion) body['ActionAfterCompletion'] = input.action_after_completion\n\tif (input.start_at) body['StartDate'] = isoToUnixSeconds(input.start_at, 'start_at')\n\tif (input.end_at) body['EndDate'] = isoToUnixSeconds(input.end_at, 'end_at')\n\treturn body\n}\n\nexport function mapScheduleSummary(raw: Record<string, unknown>): ScheduleSummary {\n\tconst out: ScheduleSummary = {\n\t\tname: isString(raw['Name']) ? raw['Name'] : ''\n\t}\n\tif (isString(raw['GroupName'])) out.group_name = raw['GroupName']\n\tif (raw['State'] === 'ENABLED' || raw['State'] === 'DISABLED') out.state = raw['State']\n\tif (isString(raw['ScheduleExpression'])) out.schedule_expression = raw['ScheduleExpression']\n\tif (isString(raw['Arn'])) out.arn = raw['Arn']\n\treturn out\n}\n\nexport function mapScheduleDetail(raw: Record<string, unknown>): ScheduleDetail {\n\tconst base = mapScheduleSummary(raw)\n\tconst target = isPlainObject(raw['Target']) ? raw['Target'] : undefined\n\tconst taskRef = target ? parseTaskRefFromInput(target['Input']) : undefined\n\tconst out: ScheduleDetail = { ...base }\n\tif (isString(raw['Description'])) out.description = raw['Description']\n\tif (isString(raw['ScheduleExpressionTimezone'])) out.timezone = raw['ScheduleExpressionTimezone']\n\tif (taskRef !== undefined) out.task_ref = taskRef\n\tif (isString(raw['CreationDate'])) out.creation_date = raw['CreationDate']\n\tif (isString(raw['LastModificationDate'])) out.last_modification_date = raw['LastModificationDate']\n\t// AWS may return timestamps as numbers\n\tif (typeof raw['CreationDate'] === 'number') out.creation_date = new Date(raw['CreationDate'] * 1000).toISOString()\n\tif (typeof raw['LastModificationDate'] === 'number') {\n\t\tout.last_modification_date = new Date(raw['LastModificationDate'] * 1000).toISOString()\n\t}\n\treturn out\n}\n","/**\n * Amazon EventBridge Scheduler vendor client (AwsService SigV4).\n * Host: `new EventBridgeSchedulerClient(auth)`. Agent: `fromContext(ctx)`.\n */\n\nimport { isPlainObject, isString } from 'es-toolkit'\nimport { isArray } from 'es-toolkit/compat'\n\nimport { ToolError } from '../../core/errors'\nimport { requireAuth } from '../../core/provider'\nimport type { ToolContext } from '../../core/types'\nimport { AwsService } from '../../transport/aws-service'\nimport type { AwsServiceOptions } from '../../transport/aws-service'\nimport type { HttpServiceOptions } from '../../transport/http-service'\nimport type {\n\tEventBridgeSchedulerAuth,\n\tScheduleCreateInput,\n\tScheduleDeleteOutput,\n\tScheduleGetOutput,\n\tScheduleListInput,\n\tScheduleListOutput,\n\tScheduleNameInput,\n\tScheduleUpdateInput,\n\tScheduleWriteOutput\n} from './contracts'\nimport { eventBridgeSchedulerAuthSchema } from './contracts'\nimport { buildCreateBody, mapScheduleDetail, mapScheduleSummary, newClientToken } from './domain'\n\nexport type EventBridgeSchedulerClientOptions = Pick<HttpServiceOptions, 'fetch' | 'signal'>\n\nexport class EventBridgeSchedulerClient {\n\treadonly #auth: EventBridgeSchedulerAuth\n\treadonly #aws: AwsService\n\n\tconstructor(auth: EventBridgeSchedulerAuth, options: EventBridgeSchedulerClientOptions = {}) {\n\t\tconst parsed = eventBridgeSchedulerAuthSchema.safeParse(auth)\n\t\tif (!parsed.success) {\n\t\t\tthrow new ToolError('Invalid EventBridge Scheduler auth credentials', {\n\t\t\t\tcode: 'bad_auth',\n\t\t\t\tdetails: { issues: parsed.error.issues.map((issue) => issue.message) }\n\t\t\t})\n\t\t}\n\t\tthis.#auth = parsed.data\n\t\tconst awsOptions: AwsServiceOptions = {\n\t\t\taccessKeyId: this.#auth.access_key_id,\n\t\t\tsecretAccessKey: this.#auth.secret_access_key,\n\t\t\tregion: this.#auth.region,\n\t\t\tservice: 'scheduler',\n\t\t\tbaseURL: `https://scheduler.${this.#auth.region}.amazonaws.com`,\n\t\t\tlabel: 'EventBridge Scheduler'\n\t\t}\n\t\tif (options.fetch) awsOptions.fetch = options.fetch\n\t\tif (options.signal) awsOptions.signal = options.signal\n\t\tif (this.#auth.session_token) awsOptions.sessionToken = this.#auth.session_token\n\t\tthis.#aws = new AwsService(awsOptions)\n\t}\n\n\tstatic fromContext(ctx: ToolContext): EventBridgeSchedulerClient {\n\t\tconst auth = requireAuth(ctx, eventBridgeSchedulerAuthSchema)\n\t\tconst options: EventBridgeSchedulerClientOptions = {}\n\t\tif (ctx.fetch) options.fetch = ctx.fetch\n\t\tif (ctx.signal) options.signal = ctx.signal\n\t\treturn new EventBridgeSchedulerClient(auth, options)\n\t}\n\n\tasync create(input: ScheduleCreateInput): Promise<ScheduleWriteOutput> {\n\t\tconst body = buildCreateBody(this.#auth, input)\n\t\tconst { data } = await this.#aws.post(`/schedules/${encodeURIComponent(input.name)}`, body)\n\t\treturn this.#writeResult(input.name, data)\n\t}\n\n\tasync update(input: ScheduleUpdateInput): Promise<ScheduleWriteOutput> {\n\t\tconst body = buildCreateBody(this.#auth, input)\n\t\tconst { data } = await this.#aws.put(`/schedules/${encodeURIComponent(input.name)}`, body)\n\t\treturn this.#writeResult(input.name, data)\n\t}\n\n\tasync get(input: ScheduleNameInput): Promise<ScheduleGetOutput> {\n\t\tconst path = `/schedules/${encodeURIComponent(input.name)}${this.#scheduleQuery()}`\n\t\tconst { data } = await this.#aws.get(path)\n\t\tif (!isPlainObject(data)) {\n\t\t\tthrow new ToolError('Unexpected GetSchedule response', { code: 'upstream' })\n\t\t}\n\t\treturn { schedule: mapScheduleDetail(data) }\n\t}\n\n\tasync list(input: ScheduleListInput = {}): Promise<ScheduleListOutput> {\n\t\tconst params = new URLSearchParams()\n\t\tif (input.name_prefix) params.set('NamePrefix', input.name_prefix)\n\t\tif (input.state) params.set('State', input.state)\n\t\tif (input.max_results !== undefined) params.set('MaxResults', String(input.max_results))\n\t\tif (input.next_token) params.set('NextToken', input.next_token)\n\t\tif (this.#auth.group_name) params.set('ScheduleGroup', this.#auth.group_name)\n\t\tconst qs = params.toString()\n\t\tconst { data } = await this.#aws.get(`/schedules${qs ? `?${qs}` : ''}`)\n\t\tif (!isPlainObject(data)) {\n\t\t\tthrow new ToolError('Unexpected ListSchedules response', { code: 'upstream' })\n\t\t}\n\t\tconst items = data['Schedules']\n\t\tconst schedules = isArray(items) ? items.filter(isPlainObject).map((row) => mapScheduleSummary(row)) : []\n\t\tconst out: ScheduleListOutput = { schedules }\n\t\tif (isString(data['NextToken'])) out.next_token = data['NextToken']\n\t\treturn out\n\t}\n\n\tasync delete(input: ScheduleNameInput): Promise<ScheduleDeleteOutput> {\n\t\t// DeleteSchedule takes clientToken as a query param; empty/missing fails live API.\n\t\tconst path = `/schedules/${encodeURIComponent(input.name)}${this.#scheduleQuery({ clientToken: newClientToken() })}`\n\t\tawait this.#aws.delete(path)\n\t\treturn { name: input.name, deleted: true }\n\t}\n\n\t#scheduleQuery(extra: Record<string, string> = {}): string {\n\t\tconst params = new URLSearchParams(extra)\n\t\tif (this.#auth.group_name) params.set('groupName', this.#auth.group_name)\n\t\tconst qs = params.toString()\n\t\treturn qs ? `?${qs}` : ''\n\t}\n\n\t#writeResult(name: string, raw: unknown): ScheduleWriteOutput {\n\t\tconst out: ScheduleWriteOutput = { name }\n\t\tif (isPlainObject(raw) && isString(raw['ScheduleArn'])) out.arn = raw['ScheduleArn']\n\t\treturn out\n\t}\n}\n","import { defineModule, defineTool } from '../../core/define'\nimport { EventBridgeSchedulerClient } from './client'\nimport {\n\teventBridgeSchedulerAuthSchema,\n\tscheduleCreateInputSchema,\n\tscheduleDeleteOutputSchema,\n\tscheduleGetOutputSchema,\n\tscheduleListInputSchema,\n\tscheduleListOutputSchema,\n\tscheduleNameInputSchema,\n\tscheduleUpdateInputSchema,\n\tscheduleWriteOutputSchema\n} from './contracts'\n\nexport const eventBridgeSchedulerCreateTool = defineTool({\n\tid: 'eventbridge-scheduler-create',\n\tname: 'eventBridgeSchedulerCreate',\n\tdescription:\n\t\t'Create an EventBridge Scheduler schedule for the configured target. Provide schedule name, schedule_expression (at/rate/cron), and task_ref (opaque task definition reference).',\n\tinputSchema: scheduleCreateInputSchema,\n\toutputSchema: scheduleWriteOutputSchema,\n\tsideEffect: 'write',\n\truntime: 'both',\n\texecute: async (input, ctx) => EventBridgeSchedulerClient.fromContext(ctx).create(input)\n})\n\nexport const eventBridgeSchedulerUpdateTool = defineTool({\n\tid: 'eventbridge-scheduler-update',\n\tname: 'eventBridgeSchedulerUpdate',\n\tdescription:\n\t\t'Replace an EventBridge Scheduler schedule (AWS full update). Same fields as create: name, schedule_expression, task_ref, optional timezone/state/description.',\n\tinputSchema: scheduleUpdateInputSchema,\n\toutputSchema: scheduleWriteOutputSchema,\n\tsideEffect: 'write',\n\truntime: 'both',\n\texecute: async (input, ctx) => EventBridgeSchedulerClient.fromContext(ctx).update(input)\n})\n\nexport const eventBridgeSchedulerGetTool = defineTool({\n\tid: 'eventbridge-scheduler-get',\n\tname: 'eventBridgeSchedulerGet',\n\tdescription: 'Get one EventBridge Scheduler schedule by name, including task_ref when present in target input.',\n\tinputSchema: scheduleNameInputSchema,\n\toutputSchema: scheduleGetOutputSchema,\n\tsideEffect: 'read',\n\truntime: 'both',\n\texecute: async (input, ctx) => EventBridgeSchedulerClient.fromContext(ctx).get(input)\n})\n\nexport const eventBridgeSchedulerListTool = defineTool({\n\tid: 'eventbridge-scheduler-list',\n\tname: 'eventBridgeSchedulerList',\n\tdescription: 'List EventBridge Scheduler schedules with optional name prefix, state filter, and pagination token.',\n\tinputSchema: scheduleListInputSchema,\n\toutputSchema: scheduleListOutputSchema,\n\tsideEffect: 'read',\n\truntime: 'both',\n\texecute: async (input, ctx) => EventBridgeSchedulerClient.fromContext(ctx).list(input)\n})\n\nexport const eventBridgeSchedulerDeleteTool = defineTool({\n\tid: 'eventbridge-scheduler-delete',\n\tname: 'eventBridgeSchedulerDelete',\n\tdescription: 'Delete an EventBridge Scheduler schedule by name.',\n\tinputSchema: scheduleNameInputSchema,\n\toutputSchema: scheduleDeleteOutputSchema,\n\tsideEffect: 'write',\n\truntime: 'both',\n\texecute: async (input, ctx) => EventBridgeSchedulerClient.fromContext(ctx).delete(input)\n})\n\nexport const eventBridgeSchedulerModule = defineModule({\n\tid: 'eventbridge-scheduler',\n\ttitle: 'EventBridge Scheduler',\n\tdescription:\n\t\t'Amazon EventBridge Scheduler vendor pack: create, fully update, get, list, and delete schedules for a configured target.',\n\truntime: 'both',\n\tauth: { type: 'custom', schema: eventBridgeSchedulerAuthSchema },\n\tcategories: ['scheduler', 'aws'],\n\tclassification: 'standard',\n\ttags: ['eventbridge'],\n\ttools: [\n\t\teventBridgeSchedulerCreateTool,\n\t\teventBridgeSchedulerUpdateTool,\n\t\teventBridgeSchedulerGetTool,\n\t\teventBridgeS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AA6B,aAAa;CACtD,IAAI;CACJ,OAAO;CACP,aACC;CACD,SAAS;CACT,MAAM;EAAE,MAAM;EAAU,QAAQ;CAA+B;CAC/D,YAAY,CAAC,aAAa,KAAK;CAC/B,gBAAgB;CAChB,MAAM,CAAC,aAAa;CACpB,OAAO;EACN;EACA;EACA;EACA;EACA;CACD;AACD,CAAC"}
|
|
1
|
+
{"version":3,"file":"eventbridge-scheduler-CDmO2-Te.js","names":["#auth","#aws","#writeResult","#scheduleQuery"],"sources":["../src/vendors/eventbridge-scheduler/contracts.ts","../src/vendors/eventbridge-scheduler/domain.ts","../src/vendors/eventbridge-scheduler/client.ts","../src/vendors/eventbridge-scheduler/module.ts"],"sourcesContent":["/**\n * Amazon EventBridge Scheduler vendor contracts.\n * Host auth holds target ARN / role ARN; tools schedule task_ref only.\n */\n\nimport { z } from 'zod'\n\nexport const MAX_SCHEDULE_NAME = 64\nexport const MAX_TASK_REF = 512\nexport const MAX_PAYLOAD_JSON = 8_000\nexport const MAX_LIST = 100\n\nconst scheduleName = z\n\t.string()\n\t.min(1)\n\t.max(MAX_SCHEDULE_NAME)\n\t.regex(/^[0-9a-zA-Z-_.]+$/, 'Schedule name must match [0-9a-zA-Z-_.]+')\n\nexport const eventBridgeSchedulerAuthSchema = z.object({\n\taccess_key_id: z.string().min(1).describe('AWS access key id'),\n\tsecret_access_key: z.string().min(1).describe('AWS secret access key'),\n\tregion: z.string().min(1).describe('AWS region for EventBridge Scheduler'),\n\tsession_token: z.string().min(1).optional().describe('Optional session token'),\n\ttarget_arn: z.string().min(1).describe('Host-bound target ARN (Lambda, SQS, etc.)'),\n\trole_arn: z.string().min(1).describe('Host-bound IAM role ARN for the scheduler target'),\n\tgroup_name: z.string().min(1).max(64).optional().describe('Schedule group name (default group when omitted)'),\n\tflexible_window_minutes: z\n\t\t.int()\n\t\t.min(1)\n\t\t.max(1440)\n\t\t.optional()\n\t\t.describe('When set, FlexibleTimeWindow Mode=FLEXIBLE with this window; otherwise Mode=OFF'),\n\tdead_letter_arn: z.string().min(1).optional().describe('Optional DLQ ARN'),\n\tmax_retry_attempts: z.int().min(0).max(185).optional().describe('Target retry MaximumRetryAttempts'),\n\tmax_event_age_seconds: z.int().min(60).max(86400).optional().describe('Target retry MaximumEventAgeInSeconds')\n})\n\nexport type EventBridgeSchedulerAuth = z.infer<typeof eventBridgeSchedulerAuthSchema>\n\nexport const scheduleStateSchema = z.enum(['ENABLED', 'DISABLED'])\n\nexport type ScheduleState = z.infer<typeof scheduleStateSchema>\n\nexport const scheduleCreateInputSchema = z.object({\n\tname: scheduleName.describe('Schedule name'),\n\tschedule_expression: z.string().min(1).max(256).describe('When to run: at(...), rate(...), or cron(...) expression'),\n\ttask_ref: z\n\t\t.string()\n\t\t.min(1)\n\t\t.max(MAX_TASK_REF)\n\t\t.describe('Opaque task definition reference. Not an ARN or infrastructure id'),\n\tpayload: z\n\t\t.record(z.string(), z.unknown())\n\t\t.optional()\n\t\t.describe('Optional small JSON payload merged into the target input with task_ref'),\n\ttimezone: z.string().min(1).max(50).optional().describe('Timezone for the schedule expression'),\n\tdescription: z.string().max(512).optional().describe('Human description'),\n\tstate: scheduleStateSchema.optional().describe('ENABLED or DISABLED (default ENABLED)'),\n\tstart_at: z.string().min(1).optional().describe('ISO-8601 start time (UTC) when the schedule may begin'),\n\tend_at: z.string().min(1).optional().describe('ISO-8601 end time (UTC) when the schedule may stop'),\n\taction_after_completion: z\n\t\t.enum(['NONE', 'DELETE'])\n\t\t.optional()\n\t\t.describe('What to do after a one-time schedule completes')\n})\n\nexport const scheduleUpdateInputSchema = scheduleCreateInputSchema\n\nexport const scheduleNameInputSchema = z.object({\n\tname: scheduleName.describe('Schedule name')\n})\n\nexport const scheduleListInputSchema = z.object({\n\tname_prefix: z.string().min(1).max(64).optional().describe('Filter by name prefix'),\n\tstate: scheduleStateSchema.optional().describe('Filter by state'),\n\tmax_results: z.int().min(1).max(MAX_LIST).optional().describe('Page size (default 100)'),\n\tnext_token: z.string().min(1).optional().describe('Pagination token from a prior list call')\n})\n\nexport const scheduleSummarySchema = z.object({\n\tname: z.string().describe('Schedule name'),\n\tgroup_name: z.string().optional().describe('Schedule group'),\n\tstate: scheduleStateSchema.optional().describe('ENABLED or DISABLED'),\n\tschedule_expression: z.string().optional().describe('Schedule expression when known'),\n\tarn: z.string().optional().describe('Schedule ARN when returned by the provider')\n})\n\nexport const scheduleDetailSchema = scheduleSummarySchema.extend({\n\tdescription: z.string().optional(),\n\ttimezone: z.string().optional(),\n\ttask_ref: z.string().optional().describe('task_ref parsed from target input when present'),\n\tcreation_date: z.string().optional(),\n\tlast_modification_date: z.string().optional()\n})\n\nexport const scheduleWriteOutputSchema = z.object({\n\tname: z.string().describe('Schedule name'),\n\tarn: z.string().optional().describe('Schedule ARN when returned')\n})\n\nexport const scheduleGetOutputSchema = z.object({\n\tschedule: scheduleDetailSchema\n})\n\nexport const scheduleListOutputSchema = z.object({\n\tschedules: z.array(scheduleSummarySchema),\n\tnext_token: z.string().optional().describe('Pagination token when more results exist')\n})\n\nexport const scheduleDeleteOutputSchema = z.object({\n\tname: z.string().describe('Deleted schedule name'),\n\tdeleted: z.literal(true)\n})\n\nexport type ScheduleCreateInput = z.infer<typeof scheduleCreateInputSchema>\nexport type ScheduleUpdateInput = z.infer<typeof scheduleUpdateInputSchema>\nexport type ScheduleNameInput = z.infer<typeof scheduleNameInputSchema>\nexport type ScheduleListInput = z.infer<typeof scheduleListInputSchema>\nexport type ScheduleSummary = z.infer<typeof scheduleSummarySchema>\nexport type ScheduleDetail = z.infer<typeof scheduleDetailSchema>\nexport type ScheduleWriteOutput = z.infer<typeof scheduleWriteOutputSchema>\nexport type ScheduleGetOutput = z.infer<typeof scheduleGetOutputSchema>\nexport type ScheduleListOutput = z.infer<typeof scheduleListOutputSchema>\nexport type ScheduleDeleteOutput = z.infer<typeof scheduleDeleteOutputSchema>\n","/**\n * EventBridge Scheduler pure helpers (no HTTP).\n */\n\nimport { isPlainObject, isString } from 'es-toolkit'\n\nimport { ToolError } from '../../core/errors'\nimport type { EventBridgeSchedulerAuth, ScheduleCreateInput, ScheduleDetail, ScheduleSummary } from './contracts'\nimport { MAX_PAYLOAD_JSON } from './contracts'\n\nexport function buildTargetInput(taskRef: string, payload?: Record<string, unknown>): string {\n\tconst body: Record<string, unknown> = { task_ref: taskRef }\n\tif (payload !== undefined) {\n\t\tfor (const [key, value] of Object.entries(payload)) {\n\t\t\tif (key === 'task_ref') continue\n\t\t\tbody[key] = value\n\t\t}\n\t}\n\tconst json = JSON.stringify(body)\n\tif (json.length > MAX_PAYLOAD_JSON) {\n\t\tthrow new ToolError('Schedule target payload is too large', {\n\t\t\tcode: 'too_large',\n\t\t\tdetails: { max_chars: MAX_PAYLOAD_JSON, length: json.length }\n\t\t})\n\t}\n\treturn json\n}\n\nexport function parseTaskRefFromInput(input: unknown): string | undefined {\n\tif (!isString(input) || input.length === 0) return undefined\n\ttry {\n\t\tconst parsed: unknown = JSON.parse(input)\n\t\tif (!isPlainObject(parsed)) return undefined\n\t\tconst ref = parsed['task_ref']\n\t\treturn isString(ref) ? ref : undefined\n\t} catch {\n\t\treturn undefined\n\t}\n}\n\nexport function flexibleTimeWindow(auth: EventBridgeSchedulerAuth): {\n\tMode: 'OFF' | 'FLEXIBLE'\n\tMaximumWindowInMinutes?: number\n} {\n\tif (auth.flexible_window_minutes !== undefined) {\n\t\treturn { Mode: 'FLEXIBLE', MaximumWindowInMinutes: auth.flexible_window_minutes }\n\t}\n\treturn { Mode: 'OFF' }\n}\n\nexport function isoToUnixSeconds(iso: string, field: string): number {\n\tconst ms = Date.parse(iso)\n\tif (!Number.isFinite(ms)) {\n\t\tthrow new ToolError(`Invalid ${field} timestamp`, { code: 'bad_input', details: { field, value: iso } })\n\t}\n\treturn Math.floor(ms / 1000)\n}\n\n/**\n * EventBridge Scheduler rejects empty ClientToken on the raw HTTP API even when\n * docs mark it optional (SDKs / CLI always send one).\n * Pattern: [a-zA-Z0-9-_]+, max 64.\n */\nexport function newClientToken(): string {\n\treturn crypto.randomUUID().replaceAll('-', '')\n}\n\nexport function buildCreateBody(auth: EventBridgeSchedulerAuth, input: ScheduleCreateInput): Record<string, unknown> {\n\tconst target: Record<string, unknown> = {\n\t\tArn: auth.target_arn,\n\t\tRoleArn: auth.role_arn,\n\t\tInput: buildTargetInput(input.task_ref, input.payload)\n\t}\n\tif (auth.dead_letter_arn) {\n\t\ttarget['DeadLetterConfig'] = { Arn: auth.dead_letter_arn }\n\t}\n\tif (auth.max_retry_attempts !== undefined || auth.max_event_age_seconds !== undefined) {\n\t\tconst retry: Record<string, number> = {}\n\t\tif (auth.max_retry_attempts !== undefined) retry['MaximumRetryAttempts'] = auth.max_retry_attempts\n\t\tif (auth.max_event_age_seconds !== undefined) retry['MaximumEventAgeInSeconds'] = auth.max_event_age_seconds\n\t\ttarget['RetryPolicy'] = retry\n\t}\n\n\tconst body: Record<string, unknown> = {\n\t\tClientToken: newClientToken(),\n\t\tScheduleExpression: input.schedule_expression,\n\t\tFlexibleTimeWindow: flexibleTimeWindow(auth),\n\t\tTarget: target,\n\t\tState: input.state ?? 'ENABLED'\n\t}\n\tif (auth.group_name) body['GroupName'] = auth.group_name\n\tif (input.timezone) body['ScheduleExpressionTimezone'] = input.timezone\n\tif (input.description) body['Description'] = input.description\n\tif (input.action_after_completion) body['ActionAfterCompletion'] = input.action_after_completion\n\tif (input.start_at) body['StartDate'] = isoToUnixSeconds(input.start_at, 'start_at')\n\tif (input.end_at) body['EndDate'] = isoToUnixSeconds(input.end_at, 'end_at')\n\treturn body\n}\n\nexport function mapScheduleSummary(raw: Record<string, unknown>): ScheduleSummary {\n\tconst out: ScheduleSummary = {\n\t\tname: isString(raw['Name']) ? raw['Name'] : ''\n\t}\n\tif (isString(raw['GroupName'])) out.group_name = raw['GroupName']\n\tif (raw['State'] === 'ENABLED' || raw['State'] === 'DISABLED') out.state = raw['State']\n\tif (isString(raw['ScheduleExpression'])) out.schedule_expression = raw['ScheduleExpression']\n\tif (isString(raw['Arn'])) out.arn = raw['Arn']\n\treturn out\n}\n\nexport function mapScheduleDetail(raw: Record<string, unknown>): ScheduleDetail {\n\tconst base = mapScheduleSummary(raw)\n\tconst target = isPlainObject(raw['Target']) ? raw['Target'] : undefined\n\tconst taskRef = target ? parseTaskRefFromInput(target['Input']) : undefined\n\tconst out: ScheduleDetail = { ...base }\n\tif (isString(raw['Description'])) out.description = raw['Description']\n\tif (isString(raw['ScheduleExpressionTimezone'])) out.timezone = raw['ScheduleExpressionTimezone']\n\tif (taskRef !== undefined) out.task_ref = taskRef\n\tif (isString(raw['CreationDate'])) out.creation_date = raw['CreationDate']\n\tif (isString(raw['LastModificationDate'])) out.last_modification_date = raw['LastModificationDate']\n\t// AWS may return timestamps as numbers\n\tif (typeof raw['CreationDate'] === 'number') out.creation_date = new Date(raw['CreationDate'] * 1000).toISOString()\n\tif (typeof raw['LastModificationDate'] === 'number') {\n\t\tout.last_modification_date = new Date(raw['LastModificationDate'] * 1000).toISOString()\n\t}\n\treturn out\n}\n","/**\n * Amazon EventBridge Scheduler vendor client (AwsService SigV4).\n * Host: `new EventBridgeSchedulerClient(auth)`. Agent: `fromContext(ctx)`.\n */\n\nimport { isPlainObject, isString } from 'es-toolkit'\nimport { isArray } from 'es-toolkit/compat'\n\nimport { ToolError } from '../../core/errors'\nimport { requireAuth } from '../../core/provider'\nimport type { ToolContext } from '../../core/types'\nimport { AwsService } from '../../transport/aws-service'\nimport type { AwsServiceOptions } from '../../transport/aws-service'\nimport type { HttpServiceOptions } from '../../transport/http-service'\nimport type {\n\tEventBridgeSchedulerAuth,\n\tScheduleCreateInput,\n\tScheduleDeleteOutput,\n\tScheduleGetOutput,\n\tScheduleListInput,\n\tScheduleListOutput,\n\tScheduleNameInput,\n\tScheduleUpdateInput,\n\tScheduleWriteOutput\n} from './contracts'\nimport { eventBridgeSchedulerAuthSchema } from './contracts'\nimport { buildCreateBody, mapScheduleDetail, mapScheduleSummary, newClientToken } from './domain'\n\nexport type EventBridgeSchedulerClientOptions = Pick<HttpServiceOptions, 'fetch' | 'signal'>\n\nexport class EventBridgeSchedulerClient {\n\treadonly #auth: EventBridgeSchedulerAuth\n\treadonly #aws: AwsService\n\n\tconstructor(auth: EventBridgeSchedulerAuth, options: EventBridgeSchedulerClientOptions = {}) {\n\t\tconst parsed = eventBridgeSchedulerAuthSchema.safeParse(auth)\n\t\tif (!parsed.success) {\n\t\t\tthrow new ToolError('Invalid EventBridge Scheduler auth credentials', {\n\t\t\t\tcode: 'bad_auth',\n\t\t\t\tdetails: { issues: parsed.error.issues.map((issue) => issue.message) }\n\t\t\t})\n\t\t}\n\t\tthis.#auth = parsed.data\n\t\tconst awsOptions: AwsServiceOptions = {\n\t\t\taccessKeyId: this.#auth.access_key_id,\n\t\t\tsecretAccessKey: this.#auth.secret_access_key,\n\t\t\tregion: this.#auth.region,\n\t\t\tservice: 'scheduler',\n\t\t\tbaseURL: `https://scheduler.${this.#auth.region}.amazonaws.com`,\n\t\t\tlabel: 'EventBridge Scheduler'\n\t\t}\n\t\tif (options.fetch) awsOptions.fetch = options.fetch\n\t\tif (options.signal) awsOptions.signal = options.signal\n\t\tif (this.#auth.session_token) awsOptions.sessionToken = this.#auth.session_token\n\t\tthis.#aws = new AwsService(awsOptions)\n\t}\n\n\tstatic fromContext(ctx: ToolContext): EventBridgeSchedulerClient {\n\t\tconst auth = requireAuth(ctx, eventBridgeSchedulerAuthSchema)\n\t\tconst options: EventBridgeSchedulerClientOptions = {}\n\t\tif (ctx.fetch) options.fetch = ctx.fetch\n\t\tif (ctx.signal) options.signal = ctx.signal\n\t\treturn new EventBridgeSchedulerClient(auth, options)\n\t}\n\n\tasync create(input: ScheduleCreateInput): Promise<ScheduleWriteOutput> {\n\t\tconst body = buildCreateBody(this.#auth, input)\n\t\tconst { data } = await this.#aws.post(`/schedules/${encodeURIComponent(input.name)}`, body)\n\t\treturn this.#writeResult(input.name, data)\n\t}\n\n\tasync update(input: ScheduleUpdateInput): Promise<ScheduleWriteOutput> {\n\t\tconst body = buildCreateBody(this.#auth, input)\n\t\tconst { data } = await this.#aws.put(`/schedules/${encodeURIComponent(input.name)}`, body)\n\t\treturn this.#writeResult(input.name, data)\n\t}\n\n\tasync get(input: ScheduleNameInput): Promise<ScheduleGetOutput> {\n\t\tconst path = `/schedules/${encodeURIComponent(input.name)}${this.#scheduleQuery()}`\n\t\tconst { data } = await this.#aws.get(path)\n\t\tif (!isPlainObject(data)) {\n\t\t\tthrow new ToolError('Unexpected GetSchedule response', { code: 'upstream' })\n\t\t}\n\t\treturn { schedule: mapScheduleDetail(data) }\n\t}\n\n\tasync list(input: ScheduleListInput = {}): Promise<ScheduleListOutput> {\n\t\tconst params = new URLSearchParams()\n\t\tif (input.name_prefix) params.set('NamePrefix', input.name_prefix)\n\t\tif (input.state) params.set('State', input.state)\n\t\tif (input.max_results !== undefined) params.set('MaxResults', String(input.max_results))\n\t\tif (input.next_token) params.set('NextToken', input.next_token)\n\t\tif (this.#auth.group_name) params.set('ScheduleGroup', this.#auth.group_name)\n\t\tconst qs = params.toString()\n\t\tconst { data } = await this.#aws.get(`/schedules${qs ? `?${qs}` : ''}`)\n\t\tif (!isPlainObject(data)) {\n\t\t\tthrow new ToolError('Unexpected ListSchedules response', { code: 'upstream' })\n\t\t}\n\t\tconst items = data['Schedules']\n\t\tconst schedules = isArray(items) ? items.filter(isPlainObject).map((row) => mapScheduleSummary(row)) : []\n\t\tconst out: ScheduleListOutput = { schedules }\n\t\tif (isString(data['NextToken'])) out.next_token = data['NextToken']\n\t\treturn out\n\t}\n\n\tasync delete(input: ScheduleNameInput): Promise<ScheduleDeleteOutput> {\n\t\t// DeleteSchedule takes clientToken as a query param; empty/missing fails live API.\n\t\tconst path = `/schedules/${encodeURIComponent(input.name)}${this.#scheduleQuery({ clientToken: newClientToken() })}`\n\t\tawait this.#aws.delete(path)\n\t\treturn { name: input.name, deleted: true }\n\t}\n\n\t#scheduleQuery(extra: Record<string, string> = {}): string {\n\t\tconst params = new URLSearchParams(extra)\n\t\tif (this.#auth.group_name) params.set('groupName', this.#auth.group_name)\n\t\tconst qs = params.toString()\n\t\treturn qs ? `?${qs}` : ''\n\t}\n\n\t#writeResult(name: string, raw: unknown): ScheduleWriteOutput {\n\t\tconst out: ScheduleWriteOutput = { name }\n\t\tif (isPlainObject(raw) && isString(raw['ScheduleArn'])) out.arn = raw['ScheduleArn']\n\t\treturn out\n\t}\n}\n","import { defineModule, defineTool } from '../../core/define'\nimport { EventBridgeSchedulerClient } from './client'\nimport {\n\teventBridgeSchedulerAuthSchema,\n\tscheduleCreateInputSchema,\n\tscheduleDeleteOutputSchema,\n\tscheduleGetOutputSchema,\n\tscheduleListInputSchema,\n\tscheduleListOutputSchema,\n\tscheduleNameInputSchema,\n\tscheduleUpdateInputSchema,\n\tscheduleWriteOutputSchema\n} from './contracts'\n\nexport const eventBridgeSchedulerCreateTool = defineTool({\n\tid: 'eventbridge-scheduler-create',\n\tname: 'eventBridgeSchedulerCreate',\n\tdescription:\n\t\t'Create an EventBridge Scheduler schedule for the configured target. Provide schedule name, schedule_expression (at/rate/cron), and task_ref (opaque task definition reference).',\n\tinputSchema: scheduleCreateInputSchema,\n\toutputSchema: scheduleWriteOutputSchema,\n\tsideEffect: 'write',\n\truntime: 'both',\n\texecute: async (input, ctx) => EventBridgeSchedulerClient.fromContext(ctx).create(input)\n})\n\nexport const eventBridgeSchedulerUpdateTool = defineTool({\n\tid: 'eventbridge-scheduler-update',\n\tname: 'eventBridgeSchedulerUpdate',\n\tdescription:\n\t\t'Replace an EventBridge Scheduler schedule (AWS full update). Same fields as create: name, schedule_expression, task_ref, optional timezone/state/description.',\n\tinputSchema: scheduleUpdateInputSchema,\n\toutputSchema: scheduleWriteOutputSchema,\n\tsideEffect: 'write',\n\truntime: 'both',\n\texecute: async (input, ctx) => EventBridgeSchedulerClient.fromContext(ctx).update(input)\n})\n\nexport const eventBridgeSchedulerGetTool = defineTool({\n\tid: 'eventbridge-scheduler-get',\n\tname: 'eventBridgeSchedulerGet',\n\tdescription: 'Get one EventBridge Scheduler schedule by name, including task_ref when present in target input.',\n\tinputSchema: scheduleNameInputSchema,\n\toutputSchema: scheduleGetOutputSchema,\n\tsideEffect: 'read',\n\truntime: 'both',\n\texecute: async (input, ctx) => EventBridgeSchedulerClient.fromContext(ctx).get(input)\n})\n\nexport const eventBridgeSchedulerListTool = defineTool({\n\tid: 'eventbridge-scheduler-list',\n\tname: 'eventBridgeSchedulerList',\n\tdescription: 'List EventBridge Scheduler schedules with optional name prefix, state filter, and pagination token.',\n\tinputSchema: scheduleListInputSchema,\n\toutputSchema: scheduleListOutputSchema,\n\tsideEffect: 'read',\n\truntime: 'both',\n\texecute: async (input, ctx) => EventBridgeSchedulerClient.fromContext(ctx).list(input)\n})\n\nexport const eventBridgeSchedulerDeleteTool = defineTool({\n\tid: 'eventbridge-scheduler-delete',\n\tname: 'eventBridgeSchedulerDelete',\n\tdescription: 'Delete an EventBridge Scheduler schedule by name.',\n\tinputSchema: scheduleNameInputSchema,\n\toutputSchema: scheduleDeleteOutputSchema,\n\tsideEffect: 'write',\n\truntime: 'both',\n\texecute: async (input, ctx) => EventBridgeSchedulerClient.fromContext(ctx).delete(input)\n})\n\nexport const eventBridgeSchedulerModule = defineModule({\n\tid: 'eventbridge-scheduler',\n\ttitle: 'EventBridge Scheduler',\n\tdescription:\n\t\t'Amazon EventBridge Scheduler vendor pack: create, fully update, get, list, and delete schedules for a configured target.',\n\truntime: 'both',\n\tauth: { type: 'custom', schema: eventBridgeSchedulerAuthSchema },\n\tcategories: ['scheduler', 'aws'],\n\tclassification: 'standard',\n\ttags: ['eventbridge'],\n\ttools: [\n\t\teventBridgeSchedulerCreateTool,\n\t\teventBridgeSchedulerUpdateTool,\n\t\teventBridgeSchedulerGetTool,\n\t\teventBridgeSchedulerListTool,\n\t\teventBridgeSchedulerDeleteTool\n\t]\n})\n"],"mappings":";;;;;;;;;;;;AAOA,MAAa,oBAAoB;AACjC,MAAa,eAAe;AAC5B,MAAa,mBA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AAK;CAC/B,gBAAgB;CAChB,MAAM,CAAC,aAAa;CACpB,OAAO;EACN;EACA;EACA;EACA;EACA;CACD;AACD,CAAC"}
|
package/dist/http/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/transport/aws-service.ts","../../src/transport/errors.ts"],"mappings":";;;KAWY;EACX;EACA;EACA;;EAEA;EACA;;KAGW,oBAAoB,iBAAiB;;;;;cAapC,mBAAmB;;EAI/B,YAAY,SAAS;;EA4Bf,KACL,aACA;IAAW;IAAiB;MAC1B;IAAU;IAAa;;;;;KC1Df;EACX;;EAEA;;;iBAIe,cAAc,iBAAiB;iBAS/B,gBAAgB,mBAAmB,gBAAgB;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/transport/aws-service.ts","../../src/transport/errors.ts"],"mappings":";;;KAWY;EACX;EACA;EACA;;EAEA;EACA;;KAGW,oBAAoB,iBAAiB;;;;;cAapC,mBAAmB;;EAI/B,YAAY,SAAS;;EA4Bf,KACL,aACA;IAAW;IAAiB;MAC1B;IAAU;IAAa;;;;;KC1Df;EACX;;EAEA;;;iBAIe,cAAc,iBAAiB;iBAS/B,gBAAgB,mBAAmB,gBAAgB;;iBAcnD,uBAAuB;;iBAavB,mBACf,eACA,gBACA,SAAS,SACT,UAAS;;iBA2BM,yBAAyB,gBAAgB"}
|
package/dist/http/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as retryAfterMsFromHeader, i as mapTransportNetworkError, n as assertHttpStatusOk, o as throwHttpStatus, r as httpErrorCode, t as HttpService } from "../http-service-
|
|
2
|
-
import { t as AwsService } from "../aws-service-
|
|
1
|
+
import { a as retryAfterMsFromHeader, i as mapTransportNetworkError, n as assertHttpStatusOk, o as throwHttpStatus, r as httpErrorCode, t as HttpService } from "../http-service-BMBIryAL.js";
|
|
2
|
+
import { t as AwsService } from "../aws-service-Cn_ozX4X.js";
|
|
3
3
|
export { AwsService, HttpService, assertHttpStatusOk, httpErrorCode, mapTransportNetworkError, retryAfterMsFromHeader, throwHttpStatus };
|
|
@@ -21,6 +21,7 @@ function throwHttpStatus(operation, status, retryAfterMs) {
|
|
|
21
21
|
retryable: status >= 500 || status === 429,
|
|
22
22
|
details: {
|
|
23
23
|
status,
|
|
24
|
+
operation,
|
|
24
25
|
...retryAfterMs !== void 0 && { retry_after_ms: retryAfterMs }
|
|
25
26
|
}
|
|
26
27
|
});
|
|
@@ -41,10 +42,6 @@ function assertHttpStatusOk(label, status, headers, options = {}) {
|
|
|
41
42
|
if (options.noThrow === true) return;
|
|
42
43
|
if (status >= 200 && status < 300) return;
|
|
43
44
|
if (options.allowStatuses && options.allowStatuses.includes(status)) return;
|
|
44
|
-
if (status === 404) throw new ToolError("Not found", {
|
|
45
|
-
code: "not_found",
|
|
46
|
-
details: { status }
|
|
47
|
-
});
|
|
48
45
|
throwHttpStatus(label, status, retryAfterMsFromHeader(headers.get("retry-after")));
|
|
49
46
|
}
|
|
50
47
|
/** True if error or any nested `cause` is an AbortError (ofetch wraps abort in FetchError). */
|
|
@@ -251,4 +248,4 @@ function createOfetch(options) {
|
|
|
251
248
|
//#endregion
|
|
252
249
|
export { retryAfterMsFromHeader as a, mapTransportNetworkError as i, assertHttpStatusOk as n, throwHttpStatus as o, httpErrorCode as r, HttpService as t };
|
|
253
250
|
|
|
254
|
-
//# sourceMappingURL=http-service-
|
|
251
|
+
//# sourceMappingURL=http-service-BMBIryAL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-service-BMBIryAL.js","names":["#http","#defaultLabel","#defaultSignal","#raw"],"sources":["../src/transport/errors.ts","../src/transport/http-service.ts"],"sourcesContent":["/**\n * HTTP status / network → ToolError for HttpService and AwsService.\n */\n\nimport { isError, isNumber } from 'es-toolkit'\nimport { FetchError } from 'ofetch'\n\nimport { ToolError } from '../core/errors'\nimport type { ToolErrorCode } from '../core/errors'\n\nexport type StatusThrowOptions = {\n\tallowStatuses?: readonly number[]\n\t/** When true, non-2xx does not throw. */\n\tnoThrow?: boolean\n}\n\n/** Map common HTTP status codes to stable ToolError codes. */\nexport function httpErrorCode(status: number): ToolErrorCode {\n\tif (status === 401) return 'bad_auth'\n\tif (status === 403) return 'forbidden'\n\tif (status === 404) return 'not_found'\n\tif (status === 429) return 'rate_limited'\n\tif (status === 413) return 'too_large'\n\treturn 'upstream'\n}\n\nexport function throwHttpStatus(operation: string, status: number, retryAfterMs?: number): never {\n\tconst code = httpErrorCode(status)\n\tthrow new ToolError(`${operation} failed with HTTP ${status}`, {\n\t\tcode,\n\t\tretryable: status >= 500 || status === 429,\n\t\tdetails: {\n\t\t\tstatus,\n\t\t\toperation,\n\t\t\t...(retryAfterMs !== undefined && { retry_after_ms: retryAfterMs })\n\t\t}\n\t})\n}\n\n/** Parse Retry-After header (seconds or HTTP-date) into milliseconds when possible. */\nexport function retryAfterMsFromHeader(value: string | null): number | undefined {\n\tif (value === null || value.length === 0) return undefined\n\tconst asSeconds = Number.parseInt(value, 10)\n\tif (Number.isFinite(asSeconds) && asSeconds >= 0) return asSeconds * 1000\n\tconst asDate = Date.parse(value)\n\tif (Number.isFinite(asDate)) {\n\t\tconst delta = asDate - Date.now()\n\t\treturn delta > 0 ? delta : 0\n\t}\n\treturn undefined\n}\n\n/** Default: throw ToolError on non-2xx (404 → not_found). */\nexport function assertHttpStatusOk(\n\tlabel: string,\n\tstatus: number,\n\theaders: Headers,\n\toptions: StatusThrowOptions = {}\n): void {\n\tif (options.noThrow === true) return\n\tif (status >= 200 && status < 300) return\n\tif (options.allowStatuses && options.allowStatuses.includes(status)) return\n\tthrowHttpStatus(label, status, retryAfterMsFromHeader(headers.get('retry-after')))\n}\n\n/** True if error or any nested `cause` is an AbortError (ofetch wraps abort in FetchError). */\nexport function isAbortErrorChain(error: unknown): boolean {\n\tlet current: unknown = error\n\tconst seen = new Set<unknown>()\n\twhile (current !== undefined && current !== null && !seen.has(current)) {\n\t\tseen.add(current)\n\t\tif (isError(current) && (current.name === 'AbortError' || current.name === 'TimeoutError')) {\n\t\t\treturn true\n\t\t}\n\t\tif (isError(current) && 'cause' in current) {\n\t\t\tcurrent = current.cause\n\t\t\tcontinue\n\t\t}\n\t\tbreak\n\t}\n\treturn false\n}\n\n/** Map ofetch / AbortError / unknown network failures to ToolError. */\nexport function mapTransportNetworkError(error: unknown, label: string): never {\n\tif (error instanceof ToolError) throw error\n\tif (isAbortErrorChain(error)) {\n\t\tthrow new ToolError(`${label} request was aborted`, {\n\t\t\tcode: 'timeout',\n\t\t\tretryable: true,\n\t\t\tcause: error\n\t\t})\n\t}\n\tif (error instanceof FetchError) {\n\t\tconst status = error.statusCode ?? error.response?.status\n\t\tif (isNumber(status) && Number.isFinite(status)) {\n\t\t\tconst retryAfter = retryAfterMsFromHeader(error.response?.headers.get('retry-after') ?? null)\n\t\t\tthrowHttpStatus(label, status, retryAfter)\n\t\t}\n\t\tthrow new ToolError(error.message || `${label} request failed`, {\n\t\t\tcode: 'upstream',\n\t\t\tretryable: true,\n\t\t\tcause: error\n\t\t})\n\t}\n\tthrow new ToolError(`${label} request failed`, {\n\t\tcode: 'upstream',\n\t\tretryable: true,\n\t\tcause: error\n\t})\n}\n","/**\n * Shared HTTP transport (ofetch under the hood).\n * Product clients construct this and call query/bytes/get/post/….\n */\n\nimport { createFetch } from 'ofetch'\nimport type { CreateFetchOptions, FetchOptions } from 'ofetch'\nimport { trimEnd } from 'es-toolkit'\n\nimport { ToolError } from '../core/errors'\nimport type { FetchLike } from '../core/types'\nimport { assertHttpStatusOk, mapTransportNetworkError } from './errors'\n\nexport type HttpServiceOptions = {\n\t/** Absolute origin or base path. Omit for free-form absolute URLs. */\n\tbaseURL?: string\n\t/** Default headers (Authorization, Content-Type, …). */\n\theaders?: Record<string, string>\n\t/** Default timeout ms. */\n\ttimeout?: number\n\t/**\n\t * Injectable fetch (tests via ToolContext / runTool).\n\t * Passed straight to ofetch — no preconnect wrapper.\n\t */\n\tfetch?: FetchLike\n\t/** Default abort signal. */\n\tsignal?: AbortSignal\n\t/** Prefix for ToolError messages (e.g. \"Resend\"). */\n\tlabel?: string\n}\n\n/**\n * Bodies ofetch accepts. `object` covers plain JSON payloads from tool input\n * (including empty objects); FormData/Blob/string live under BodyInit.\n */\nexport type HttpBody = BodyInit | object | null\n\nexport type HttpQueryValue = string | number | boolean | readonly (string | number | boolean)[] | undefined\n\nexport type HttpCallOptions = {\n\tquery?: Record<string, HttpQueryValue>\n\tbody?: HttpBody\n\theaders?: Record<string, string>\n\t/** Status codes returned without throwing. */\n\tallowStatuses?: readonly number[]\n\t/** When true, non-2xx is returned instead of throwing. Default false. */\n\tnoThrow?: boolean\n\ttimeout?: number\n\tsignal?: AbortSignal\n\t/** Override error label for this call. */\n\tlabel?: string\n}\n\nexport type HttpBytesOptions = HttpCallOptions & {\n\t/** Stop reading and throw `too_large` once the response exceeds this many bytes. */\n\tmaxBytes?: number\n}\n\nexport type HttpQueryResult = {\n\tstatus: number\n\tok: boolean\n\theaders: Headers\n\turl: string\n\t/** Parsed body (JSON/text per ofetch). */\n\tdata: unknown\n}\n\nexport type HttpBytesResult = {\n\tstatus: number\n\tok: boolean\n\theaders: Headers\n\turl: string\n\tbytes: Uint8Array\n}\n\ntype OfetchInstance = ReturnType<typeof createFetch>\n\n/**\n * HTTP client: query (parsed), bytes, get/post/put/patch/delete/head.\n * Non-2xx → ToolError by default.\n */\nexport class HttpService {\n\treadonly #http: OfetchInstance\n\treadonly #defaultLabel: string\n\treadonly #defaultSignal: AbortSignal | undefined\n\n\tconstructor(options: HttpServiceOptions = {}) {\n\t\tthis.#defaultLabel = options.label ?? 'HTTP'\n\t\tthis.#defaultSignal = options.signal\n\t\tthis.#http = createOfetch(options)\n\t}\n\n\t/** Shared ofetch.raw + status assert + error map. */\n\tasync #raw(method: string, path: string, options: HttpCallOptions, extra?: FetchOptions) {\n\t\tconst label = options.label ?? this.#defaultLabel\n\t\ttry {\n\t\t\tconst res = await this.#http.raw(path, {\n\t\t\t\tsignal: this.#defaultSignal ?? null,\n\t\t\t\tmethod,\n\t\t\t\t...options,\n\t\t\t\t...extra\n\t\t\t})\n\t\t\tassertHttpStatusOk(label, res.status, res.headers, options)\n\t\t\treturn { status: res.status, ok: res.ok, headers: res.headers, url: res.url, data: res._data }\n\t\t} catch (error) {\n\t\t\tmapTransportNetworkError(error, label)\n\t\t}\n\t}\n\n\t/** Parsed body (JSON/text). ofetch parses JSON responses by default. */\n\tasync query(method: string, path: string, options: HttpCallOptions = {}): Promise<HttpQueryResult> {\n\t\treturn this.#raw(method, path, options)\n\t}\n\n\t/**\n\t * Binary body. `maxBytes` switches to streaming and cancels before an\n\t * oversized response is materialized.\n\t */\n\tasync bytes(method: string, path: string, options: HttpBytesOptions = {}): Promise<HttpBytesResult> {\n\t\tconst { maxBytes, ...requestOptions } = options\n\t\tif (maxBytes !== undefined && (!Number.isSafeInteger(maxBytes) || maxBytes < 0)) {\n\t\t\tthrow new ToolError('Response byte limit must be a non-negative safe integer', { code: 'bad_input' })\n\t\t}\n\n\t\tconst res = await this.#raw(method, path, requestOptions, {\n\t\t\tresponseType: maxBytes === undefined ? 'arrayBuffer' : 'stream'\n\t\t})\n\t\tif (maxBytes === undefined) {\n\t\t\treturn {\n\t\t\t\t...res,\n\t\t\t\tbytes: new Uint8Array(res.data)\n\t\t\t}\n\t\t}\n\n\t\tconst label = options.label ?? this.#defaultLabel\n\t\ttry {\n\t\t\tconst bytes = await readBoundedBytes(res.data, res.headers, maxBytes, label)\n\t\t\treturn { ...res, bytes }\n\t\t} catch (error) {\n\t\t\tmapTransportNetworkError(error, label)\n\t\t}\n\t}\n\n\tget(path: string, options: HttpCallOptions = {}): Promise<HttpQueryResult> {\n\t\treturn this.query('GET', path, options)\n\t}\n\n\tpost(path: string, body?: HttpBody, options: HttpCallOptions = {}): Promise<HttpQueryResult> {\n\t\treturn this.query('POST', path, body === undefined ? options : { ...options, body })\n\t}\n\n\tput(path: string, body?: HttpBody, options: HttpCallOptions = {}): Promise<HttpQueryResult> {\n\t\treturn this.query('PUT', path, body === undefined ? options : { ...options, body })\n\t}\n\n\tpatch(path: string, body?: HttpBody, options: HttpCallOptions = {}): Promise<HttpQueryResult> {\n\t\treturn this.query('PATCH', path, body === undefined ? options : { ...options, body })\n\t}\n\n\tdelete(path: string, options: HttpCallOptions = {}): Promise<HttpQueryResult> {\n\t\treturn this.query('DELETE', path, options)\n\t}\n\n\thead(path: string, options: HttpCallOptions = {}): Promise<HttpQueryResult> {\n\t\treturn this.query('HEAD', path, options)\n\t}\n}\n\nfunction isReadableByteStream(value: unknown): value is ReadableStream<unknown> {\n\treturn value instanceof ReadableStream\n}\n\nfunction contentLength(headers: Headers): number | undefined {\n\tconst value = headers.get('content-length')\n\tif (value === null || !/^\\d+$/.test(value)) return undefined\n\tconst parsed = Number(value)\n\treturn Number.isSafeInteger(parsed) ? parsed : undefined\n}\n\nfunction responseTooLarge(label: string, maxBytes: number, observedBytes: number): never {\n\tthrow new ToolError(`${label} response exceeds byte limit`, {\n\t\tcode: 'too_large',\n\t\tdetails: { max_bytes: maxBytes, content_length: observedBytes }\n\t})\n}\n\nasync function readBoundedBytes(data: unknown, headers: Headers, maxBytes: number, label: string): Promise<Uint8Array> {\n\tconst declaredLength = contentLength(headers)\n\tif (declaredLength !== undefined && declaredLength > maxBytes) {\n\t\tif (isReadableByteStream(data)) {\n\t\t\ttry {\n\t\t\t\tawait data.cancel()\n\t\t\t} catch {\n\t\t\t\t// Preserve the stable too_large error.\n\t\t\t}\n\t\t}\n\t\tresponseTooLarge(label, maxBytes, declaredLength)\n\t}\n\tif (data === null || data === undefined) return new Uint8Array()\n\tif (!isReadableByteStream(data)) {\n\t\tthrow new ToolError(`${label} returned an invalid byte stream`, { code: 'upstream' })\n\t}\n\n\tconst reader = data.getReader()\n\tconst chunks: Uint8Array[] = []\n\tlet total = 0\n\ttry {\n\t\twhile (true) {\n\t\t\tconst chunk = await reader.read()\n\t\t\tif (chunk.done) break\n\t\t\tif (!(chunk.value instanceof Uint8Array)) {\n\t\t\t\tthrow new ToolError(`${label} returned an invalid byte chunk`, { code: 'upstream' })\n\t\t\t}\n\t\t\ttotal += chunk.value.byteLength\n\t\t\tif (total > maxBytes) {\n\t\t\t\ttry {\n\t\t\t\t\tawait reader.cancel()\n\t\t\t\t} catch {\n\t\t\t\t\t// Preserve the stable too_large error.\n\t\t\t\t}\n\t\t\t\tresponseTooLarge(label, maxBytes, declaredLength ?? total)\n\t\t\t}\n\t\t\tchunks.push(chunk.value)\n\t\t}\n\t} finally {\n\t\treader.releaseLock()\n\t}\n\n\tconst bytes = new Uint8Array(total)\n\tlet offset = 0\n\tfor (const chunk of chunks) {\n\t\tbytes.set(chunk, offset)\n\t\toffset += chunk.byteLength\n\t}\n\treturn bytes\n}\n\nfunction createOfetch(options: HttpServiceOptions): OfetchInstance {\n\tconst defaults: FetchOptions = {\n\t\t...options,\n\t\tretry: false,\n\t\tignoreResponseError: true\n\t}\n\tif (defaults.baseURL) {\n\t\tdefaults.baseURL = trimEnd(defaults.baseURL, '/')\n\t}\n\tconst createOptions: CreateFetchOptions = { defaults }\n\tif (options.fetch) {\n\t\tObject.assign(createOptions, { fetch: options.fetch })\n\t}\n\treturn createFetch(createOptions)\n}\n"],"mappings":";;;;;;;;AAiBA,SAAgB,cAAc,QAA+B;CAC5D,IAAI,WAAW,KAAK,OAAO;CAC3B,IAAI,WAAW,KAAK,OAAO;CAC3B,IAAI,WAAW,KAAK,OAAO;CAC3B,IAAI,WAAW,KAAK,OAAO;CAC3B,IAAI,WAAW,KAAK,OAAO;CAC3B,OAAO;AACR;AAEA,SAAgB,gBAAgB,WAAmB,QAAgB,cAA8B;CAChG,MAAM,OAAO,cAAc,MAAM;CACjC,MAAM,IAAI,UAAU,GAAG,UAAU,oBAAoB,UAAU;EAC9D;EACA,WAAW,UAAU,OAAO,WAAW;EACvC,SAAS;GACR;GACA;GACA,GAAI,iBAAiB,KAAA,KAAa,EAA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