@5ss/ai-tools 3.0.0 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/{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-CH49-sFn.js → imessage-Dsms04rC.js} +2 -2
- package/dist/{imessage-CH49-sFn.js.map → imessage-Dsms04rC.js.map} +1 -1
- 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.js +5 -5
- 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 +11 -22
- 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.js +1 -1
- 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 +12 -11
- package/dist/http-service-DDNCO1s4.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\teventBridgeSchedulerListTool,\n\t\teventBridgeSchedulerDeleteTool\n\t]\n})\n"],"mappings":";;;;;;;;;;;;AAOA,MAAa,oBAAoB;AACjC,MAAa,eAAe;AAC5B,MAAa,mBAAmB;AAChC,MAAa,WAAW;AAExB,MAAM,eAAe,EACnB,OAAO,CAAC,CACR,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A;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,mBAAmB;AAChC,MAAa,WAAW;AAExB,MAAM,eAAe,EACnB,OAAO,CAAC,CACR,IAAI,CAAC,CAAC,CACN,IAAA,EAAqB,CAAC,CACtB,MAAM,qBAAqB,0CAA0C;AAEvE,MAAa,iCAAiC,EAAE,OAAO;CACtD,eAAe,EAAE,OAA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../../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,EAAE,gBAAgB,aAAa;EAClE;CACD,CAAC;AACF;;AAGA,SAAgB,uBAAuB,OAA0C;CAChF,IAAI,UAAU,QAAQ,MAAM,WAAW,GAAG,OAAO,KAAA;CACjD,MAAM,YAAY,OAAO,SAAS,OAAO,EAAE;CAC3C,IAAI,OAAO,SAAS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,MAAM;CACjB;CACA,OAAO;AACR;AAEA,SAAS,aAAa,SAA6C;CAClE,MAAM,WAAyB;EAC9B,GAAG;EACH,OAAO;EACP,qBAAqB;CACtB;CACA,IAAI,SAAS,SACZ,SAAS,UAAU,QAAQ,SAAS,SAAS,GAAG;CAEjD,MAAM,gBAAoC,EAAE,SAAS;CACrD,IAAI,QAAQ,OACX,OAAO,OAAO,eAAe,EAAE,OAAO,QAAQ,MAAM,CAAC;CAEtD,OAAO,YAAY,aAAa;AACjC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as ToolError } from "./errors-DoSpNHvs.js";
|
|
2
2
|
import { n as defineModule, r as defineTool } from "./define-ieoksEQ0.js";
|
|
3
3
|
import { n as requireAuth } from "./provider-CgDAlg6K.js";
|
|
4
|
-
import { t as HttpService } from "./http-service-
|
|
4
|
+
import { t as HttpService } from "./http-service-BMBIryAL.js";
|
|
5
5
|
import { t as base64ToBytes } from "./bytes-BxpimpQx.js";
|
|
6
6
|
import { isPlainObject, isString } from "es-toolkit";
|
|
7
7
|
import { z } from "zod";
|
|
@@ -555,4 +555,4 @@ const imessageModule = defineModule({
|
|
|
555
555
|
//#endregion
|
|
556
556
|
export { imessageUnsendInputSchema as A, imessageMessageOutputSchema as C, imessageSendMediaInputSchema as D, imessageSendChatActionInputSchema as E, imessageSendTextInputSchema as O, imessageEnsureChatOutputSchema as S, imessageReadInputSchema as T, imessageClearReactionInputSchema as _, imessageReadTool as a, imessageEditTextInputSchema as b, imessageSendTextTool as c, ImessageClient as d, ImessageClientError as f, imessageAuthSchema as g, MAX_MEDIA_BYTES as h, imessageModule as i, imessageSetReactionInputSchema as k, imessageSetReactionTool as l, isImessageOutcomeUnknown as m, imessageDownloadFileTool as n, imessageSendChatActionTool as o, isImessageDefiniteRejection as p, imessageEditTextTool as r, imessageSendMediaTool as s, imessageClearReactionTool as t, imessageUnsendTool as u, imessageDownloadFileInputSchema as v, imessageOkOutputSchema as w, imessageEnsureChatInputSchema as x, imessageDownloadFileOutputSchema as y };
|
|
557
557
|
|
|
558
|
-
//# sourceMappingURL=imessage-
|
|
558
|
+
//# sourceMappingURL=imessage-Dsms04rC.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imessage-CH49-sFn.js","names":["#http","#defaultPhone","#post","#phone"],"sources":["../src/vendors/imessage/contracts.ts","../src/vendors/imessage/domain.ts","../src/vendors/imessage/client.ts","../src/vendors/imessage/module.ts"],"sourcesContent":["import { z } from 'zod'\n\n/**\n * Host auth for the hosted photon-rest-proxy (REST → Spectrum gRPC).\n * Credentials are forwarded per request; the proxy stores nothing.\n *\n * Proxy route map (package client → HTTP):\n * - sendText → POST /v1/send\n * - editText → POST /v1/edit\n * - sendChatAction / stopTyping → POST /v1/typing\n * - setReaction → POST /v1/react\n * - clearReaction → POST /v1/clear-reaction (target message_id + emoji; proxy gap if not yet supported)\n * - unsend → POST /v1/unsend\n * - read → POST /v1/read\n * - sendMedia → POST /v1/media\n * - downloadFile → POST /v1/download (chat_id optional; proxy gap if still required)\n * - ensureChat → POST /v1/ensure-chat (host-only; proxy gap until implemented)\n */\nexport const imessageAuthSchema = z.object({\n\tbase_url: z.url().describe('Origin of the hosted photon-rest-proxy, for example https://photon-proxy.example.com'),\n\tproject_id: z.string().min(1).describe('Spectrum project id (sent as x-spectrum-project-id)'),\n\tproject_secret: z.string().min(1).describe('Spectrum project secret (sent as x-spectrum-project-secret)'),\n\tphone: z\n\t\t.string()\n\t\t.min(1)\n\t\t.optional()\n\t\t.describe('Optional default iMessage line phone when the project has multiple lines')\n})\n\nexport type ImessageAuth = z.infer<typeof imessageAuthSchema>\n\nexport const imessageChatActionSchema = z.enum([\n\t'typing',\n\t'upload_photo',\n\t'record_video',\n\t'upload_video',\n\t'record_voice',\n\t'upload_voice',\n\t'upload_document',\n\t'choose_sticker',\n\t'find_location',\n\t'record_video_note',\n\t'upload_video_note'\n])\n\nexport const imessageSendTextInputSchema = z.object({\n\tchat_id: z.string().min(1).describe('iMessage chat guid (e.g. any;-;alice@example.com)'),\n\ttext: z.string().min(1).describe('Message text'),\n\tphone: z.string().min(1).optional().describe('Optional line phone override for multi-line projects')\n})\n\nexport const imessageMessageOutputSchema = z.object({\n\tmessage_id: z.string().min(1).describe('Message guid (provider id for journaling)'),\n\tspace_id: z.string().describe('Chat guid (same as chat_id)')\n})\n\nexport const imessageEditTextInputSchema = z.object({\n\tchat_id: z.string().min(1).describe('iMessage chat guid'),\n\tmessage_id: z.string().min(1).describe('Message guid to edit'),\n\ttext: z.string().min(1).describe('Replacement text'),\n\tphone: z.string().min(1).optional().describe('Optional line phone override')\n})\n\nexport const imessageSendChatActionInputSchema = z.object({\n\tchat_id: z.string().min(1).describe('iMessage chat guid'),\n\taction: imessageChatActionSchema.describe('Chat action; non-typing values map to typing start'),\n\tphone: z.string().min(1).optional().describe('Optional line phone override')\n})\n\nexport const imessageSetReactionInputSchema = z.object({\n\tchat_id: z.string().min(1).describe('iMessage chat guid'),\n\tmessage_id: z.string().min(1).describe('Message guid to react to'),\n\temoji: z\n\t\t.string()\n\t\t.min(1)\n\t\t.max(64)\n\t\t.describe(\n\t\t\t'Tapback name (love, like, dislike, laugh, emphasize, question) or an emoji character the channel accepts'\n\t\t),\n\tphone: z.string().min(1).optional().describe('Optional line phone override')\n})\n\nexport const imessageUnsendInputSchema = z.object({\n\tchat_id: z.string().min(1).describe('iMessage chat guid'),\n\tmessage_id: z.string().min(1).describe('Message guid to unsend'),\n\tphone: z.string().min(1).optional().describe('Optional line phone override')\n})\n\nexport const imessageReadInputSchema = z.object({\n\tchat_id: z.string().min(1).describe('iMessage chat guid'),\n\tmessage_id: z\n\t\t.string()\n\t\t.min(1)\n\t\t.optional()\n\t\t.describe('Optional; mark-read may apply to the whole chat (field kept for seam parity)'),\n\tphone: z.string().min(1).optional().describe('Optional line phone override')\n})\n\nexport const imessageOkOutputSchema = z.object({\n\tok: z.boolean(),\n\tspace_id: z.string().optional()\n})\n\nexport const MAX_MEDIA_BYTES = 20 * 1024 * 1024\n\n/**\n * Clear a reaction. `message_id` is the **target** message that was reacted to;\n * `emoji` must match set-reaction. Proxy should clear by target+emoji (not reaction message id).\n */\nexport const imessageClearReactionInputSchema = z.object({\n\tchat_id: z.string().min(1).describe('iMessage chat guid'),\n\tmessage_id: z.string().min(1).describe('Target message guid that was reacted to'),\n\temoji: z.string().min(1).max(64).describe('Same tapback name or emoji used when setting the reaction'),\n\tphone: z.string().min(1).optional().describe('Optional line phone override')\n})\n\nexport const imessageSendMediaInputSchema = z.object({\n\tchat_id: z.string().min(1).describe('iMessage chat guid'),\n\tkind: z.enum(['photo', 'document']).describe('Media kind (presentation)'),\n\tbody_base64: z.string().min(1).describe('File body as base64'),\n\tfile_name: z.string().min(1).describe('File name including extension'),\n\tcaption: z.string().optional().describe('Optional caption sent as a follow-up text message'),\n\tcontent_type: z.string().optional().describe('Optional MIME type; inferred from file_name when omitted'),\n\tphone: z.string().min(1).optional().describe('Optional line phone override')\n})\n\nexport const imessageDownloadFileInputSchema = z.object({\n\tfile_id: z.string().min(1).describe('Attachment guid (from inbound payload or upload)'),\n\tfile_name: z.string().min(1).optional().describe('Preferred file name for the download result'),\n\tchat_id: z.string().min(1).optional().describe('Chat guid (optional when proxy can resolve by file_id alone)'),\n\tphone: z.string().min(1).optional().describe('Optional line phone override')\n})\n\nexport const imessageDownloadFileOutputSchema = z.object({\n\tfile_name: z.string(),\n\tfile_size: z.number().optional(),\n\tbody_base64: z.string().describe('Downloaded file body as base64')\n})\n\n/**\n * Create (or resolve) a chat via proxy POST /v1/ensure-chat (host-only).\n * One address = 1:1; two or more = group.\n */\nexport const imessageEnsureChatInputSchema = z.object({\n\taddresses: z\n\t\t.array(z.string().min(1))\n\t\t.min(1)\n\t\t.describe('Peer phone number(s) or email(s). One address creates a 1:1 chat; two or more create a group'),\n\tmessage: z.string().min(1).optional().describe('Optional opening text sent in the same create call'),\n\tclient_message_id: z\n\t\t.string()\n\t\t.min(1)\n\t\t.optional()\n\t\t.describe('Optional idempotency key for chat creation and the optional opening send'),\n\tphone: z.string().min(1).optional().describe('Optional line phone override')\n})\n\nexport const imessageEnsureChatOutputSchema = z.object({\n\tchat_id: z.string().min(1).describe('Chat guid for later send, edit, react, or unsend'),\n\tmessage_id: z\n\t\t.string()\n\t\t.min(1)\n\t\t.optional()\n\t\t.describe('Guid of the opening message when message was provided and the server returned one')\n})\n\nexport type ImessageSendTextInput = z.infer<typeof imessageSendTextInputSchema>\nexport type ImessageMessageOutput = z.infer<typeof imessageMessageOutputSchema>\nexport type ImessageEditTextInput = z.infer<typeof imessageEditTextInputSchema>\nexport type ImessageSendChatActionInput = z.infer<typeof imessageSendChatActionInputSchema>\nexport type ImessageSetReactionInput = z.infer<typeof imessageSetReactionInputSchema>\nexport type ImessageUnsendInput = z.infer<typeof imessageUnsendInputSchema>\nexport type ImessageReadInput = z.infer<typeof imessageReadInputSchema>\nexport type ImessageClearReactionInput = z.infer<typeof imessageClearReactionInputSchema>\nexport type ImessageSendMediaInput = z.infer<typeof imessageSendMediaInputSchema>\nexport type ImessageDownloadFileInput = z.infer<typeof imessageDownloadFileInputSchema>\nexport type ImessageDownloadFileOutput = z.infer<typeof imessageDownloadFileOutputSchema>\nexport type ImessageEnsureChatInput = z.infer<typeof imessageEnsureChatInputSchema>\nexport type ImessageEnsureChatOutput = z.infer<typeof imessageEnsureChatOutputSchema>\n","/**\n * photon-rest-proxy response parse + failure helpers (no HTTP).\n */\n\nimport { isPlainObject, isString } from 'es-toolkit'\n\nimport { ToolError } from '../../core/errors'\nimport { base64ToBytes } from '../../shared/bytes'\nimport type {\n\tImessageDownloadFileInput,\n\tImessageDownloadFileOutput,\n\tImessageEnsureChatOutput,\n\tImessageMessageOutput,\n\tImessageSendMediaInput\n} from './contracts'\nimport { MAX_MEDIA_BYTES } from './contracts'\n\nexport type ImessageFailureKind = 'definite_rejection' | 'outcome_unknown'\n\nexport class ImessageClientError extends ToolError {\n\treadonly failureKind: ImessageFailureKind\n\n\tconstructor(input: {\n\t\tmessage: string\n\t\tfailureKind: ImessageFailureKind\n\t\tstatus?: number\n\t\tcode?: string\n\t\tcause?: unknown\n\t}) {\n\t\tsuper(input.message, {\n\t\t\tcode: mapStatusToToolCode(input.status, input.code),\n\t\t\tretryable: input.failureKind === 'outcome_unknown',\n\t\t\tcause: input.cause,\n\t\t\tdetails: {\n\t\t\t\tfailure_kind: input.failureKind,\n\t\t\t\tstatus: input.status,\n\t\t\t\tproxy_error: input.code\n\t\t\t}\n\t\t})\n\t\tthis.name = 'ImessageClientError'\n\t\tthis.failureKind = input.failureKind\n\t}\n}\n\nexport function isImessageDefiniteRejection(error: unknown): boolean {\n\treturn error instanceof ImessageClientError && error.failureKind === 'definite_rejection'\n}\n\nexport function isImessageOutcomeUnknown(error: unknown): boolean {\n\treturn error instanceof ImessageClientError && error.failureKind === 'outcome_unknown'\n}\n\nfunction mapStatusToToolCode(status: number | undefined, proxyCode: string | undefined): ToolError['code'] {\n\tif (status === 401) return 'bad_auth'\n\tif (status === 403) return 'forbidden'\n\tif (status === 404) return 'not_found'\n\tif (status === 400) return 'bad_input'\n\tif (status === 429) return 'rate_limited'\n\tif (proxyCode === 'unauthorized') return 'bad_auth'\n\tif (proxyCode === 'message_not_found' || proxyCode === 'not_found') return 'not_found'\n\tif (proxyCode === 'unsupported' || proxyCode === 'not_implemented') return 'unsupported'\n\treturn 'upstream'\n}\n\nfunction isDefiniteStatus(status: number): boolean {\n\treturn status === 400 || status === 401 || status === 403 || status === 404\n}\n\n/** Parse photon-rest-proxy JSON error body or throw on non-2xx. */\nexport function assertProxyOk(label: string, status: number, data: unknown): void {\n\tif (status >= 200 && status < 300) return\n\n\tlet message = `${label} failed with HTTP ${status}`\n\tlet code: string | undefined\n\tif (isPlainObject(data)) {\n\t\tconst err = data['error']\n\t\tconst detail = data['detail']\n\t\tif (isString(err) && err.length > 0) {\n\t\t\tcode = err\n\t\t\tmessage = isString(detail) && detail.length > 0 ? `${err}: ${detail}` : err\n\t\t} else if (isString(detail) && detail.length > 0) {\n\t\t\tmessage = detail\n\t\t}\n\t}\n\n\tthrow new ImessageClientError({\n\t\tmessage,\n\t\tfailureKind: isDefiniteStatus(status) ? 'definite_rejection' : 'outcome_unknown',\n\t\tstatus,\n\t\t...(code && { code })\n\t})\n}\n\nfunction requireString(data: Record<string, unknown>, key: string, label: string): string {\n\tconst value = data[key]\n\tif (!isString(value) || value.length === 0) {\n\t\tthrow new ToolError(`iMessage proxy ${label} missing ${key}`, { code: 'upstream' })\n\t}\n\treturn value\n}\n\n/** Prefer space_id; accept chat_id alias from newer proxy shapes. */\nfunction spaceOrChatId(data: Record<string, unknown>, label: string): string {\n\tconst spaceId = data['space_id']\n\tif (isString(spaceId) && spaceId.length > 0) return spaceId\n\tconst chatId = data['chat_id']\n\tif (isString(chatId) && chatId.length > 0) return chatId\n\tthrow new ToolError(`iMessage proxy ${label} missing space_id`, { code: 'upstream' })\n}\n\nexport function parseMessageResult(data: unknown, label = 'send'): ImessageMessageOutput {\n\tif (!isPlainObject(data) || data['ok'] !== true) {\n\t\tthrow new ToolError(`iMessage proxy returned an unexpected ${label} payload`, { code: 'upstream' })\n\t}\n\treturn {\n\t\tspace_id: spaceOrChatId(data, label),\n\t\tmessage_id: requireString(data, 'message_id', label)\n\t}\n}\n\nexport function parseOkResult(data: unknown): { ok: true; space_id?: string } {\n\tif (!isPlainObject(data) || data['ok'] !== true) {\n\t\tthrow new ToolError('iMessage proxy returned an unexpected ok payload', { code: 'upstream' })\n\t}\n\tconst spaceId = data['space_id']\n\tconst chatId = data['chat_id']\n\tconst id =\n\t\tisString(spaceId) && spaceId.length > 0 ? spaceId : isString(chatId) && chatId.length > 0 ? chatId : undefined\n\treturn {\n\t\tok: true,\n\t\t...(id && { space_id: id })\n\t}\n}\n\nexport function parseEnsureChatResult(data: unknown): ImessageEnsureChatOutput {\n\tif (!isPlainObject(data) || data['ok'] !== true) {\n\t\tthrow new ToolError('iMessage proxy returned an unexpected ensure-chat payload', { code: 'upstream' })\n\t}\n\tconst chatId = spaceOrChatId(data, 'ensure-chat')\n\tconst messageId = data['message_id']\n\treturn {\n\t\tchat_id: chatId,\n\t\t...(isString(messageId) && messageId.length > 0 && { message_id: messageId })\n\t}\n}\n\n/** Map messaging-style chat_id to proxy space_id body fields. */\nexport function spaceBody(\n\tchatId: string | undefined,\n\tphone: string | undefined,\n\textra: Record<string, unknown> = {}\n): Record<string, unknown> {\n\treturn {\n\t\tplatform: 'imessage',\n\t\t...extra,\n\t\t...(chatId && { space_id: chatId }),\n\t\t...(phone && { phone })\n\t}\n}\n\n/** Decode and size-check media base64 for sendMedia. */\nexport function decodeMediaBody(bodyBase64: string): void {\n\tlet bytes: Uint8Array\n\ttry {\n\t\tbytes = base64ToBytes(bodyBase64)\n\t} catch (error) {\n\t\tthrow new ToolError('Invalid base64 body', { code: 'bad_input', cause: error })\n\t}\n\tif (bytes.byteLength === 0) {\n\t\tthrow new ToolError('Media body must not be empty', { code: 'bad_input' })\n\t}\n\tif (bytes.byteLength > MAX_MEDIA_BYTES) {\n\t\tthrow new ToolError('Media exceeds 20 MiB limit', {\n\t\t\tcode: 'too_large',\n\t\t\tdetails: { max_bytes: MAX_MEDIA_BYTES, content_length: bytes.byteLength }\n\t\t})\n\t}\n}\n\n/** Build POST /v1/media JSON body (base64 already validated). */\nexport function mediaBody(input: ImessageSendMediaInput, phone: string | undefined): Record<string, unknown> {\n\tdecodeMediaBody(input.body_base64)\n\treturn spaceBody(input.chat_id, phone, {\n\t\tbody_base64: input.body_base64,\n\t\tfile_name: input.file_name,\n\t\t...(input.content_type && { mime_type: input.content_type }),\n\t\t...(input.caption && { caption: input.caption })\n\t})\n}\n\nexport function parseDownloadResult(input: ImessageDownloadFileInput, data: unknown): ImessageDownloadFileOutput {\n\tif (!isPlainObject(data) || data['ok'] !== true) {\n\t\tthrow new ToolError('iMessage proxy returned an unexpected download payload', { code: 'upstream' })\n\t}\n\tconst bodyBase64 = data['body_base64']\n\tif (!isString(bodyBase64) || bodyBase64.length === 0) {\n\t\tthrow new ToolError('iMessage proxy download missing body_base64', { code: 'upstream' })\n\t}\n\tconst name = data['file_name']\n\tconst size = data['file_size']\n\treturn {\n\t\tfile_name: input.file_name ?? (isString(name) && name.length > 0 ? name : input.file_id),\n\t\t...(typeof size === 'number' && Number.isFinite(size) && { file_size: size }),\n\t\tbody_base64: bodyBase64\n\t}\n}\n","/**\n * iMessage vendor client via hosted photon-rest-proxy (REST → Spectrum gRPC).\n * Host: `new ImessageClient(auth)`. Agent tools: `fromContext(ctx)`.\n *\n * Workers-safe: only HTTP to the proxy. No Photon SDK / gRPC in this package.\n */\n\nimport { isPlainObject, isString } 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 type {\n\tImessageAuth,\n\tImessageClearReactionInput,\n\tImessageDownloadFileInput,\n\tImessageDownloadFileOutput,\n\tImessageEditTextInput,\n\tImessageEnsureChatInput,\n\tImessageEnsureChatOutput,\n\tImessageMessageOutput,\n\tImessageReadInput,\n\tImessageSendChatActionInput,\n\tImessageSendMediaInput,\n\tImessageSendTextInput,\n\tImessageSetReactionInput,\n\tImessageUnsendInput\n} from './contracts'\nimport { imessageAuthSchema } from './contracts'\nimport {\n\tassertProxyOk,\n\tisImessageDefiniteRejection,\n\tisImessageOutcomeUnknown,\n\tImessageClientError,\n\tmediaBody,\n\tparseDownloadResult,\n\tparseEnsureChatResult,\n\tparseMessageResult,\n\tparseOkResult,\n\tspaceBody\n} from './domain'\n\nexport type ImessageClientOptions = Pick<HttpServiceOptions, 'fetch' | 'signal'>\n\nexport class ImessageClient {\n\treadonly #http: HttpService\n\treadonly #defaultPhone: string | undefined\n\n\tconstructor(auth: ImessageAuth, options: ImessageClientOptions = {}) {\n\t\tconst parsed = imessageAuthSchema.safeParse(auth)\n\t\tif (!parsed.success) {\n\t\t\tthrow new ToolError('Invalid iMessage auth credentials', {\n\t\t\t\tcode: 'bad_auth',\n\t\t\t\tdetails: { issues: parsed.error.issues.map((issue) => issue.message) }\n\t\t\t})\n\t\t}\n\t\tconst { base_url, project_id, project_secret, phone } = parsed.data\n\t\tthis.#defaultPhone = phone\n\t\tthis.#http = new HttpService({\n\t\t\t...options,\n\t\t\tbaseURL: base_url,\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t'x-spectrum-project-id': project_id,\n\t\t\t\t'x-spectrum-project-secret': project_secret\n\t\t\t},\n\t\t\tlabel: 'iMessage'\n\t\t})\n\t}\n\n\tstatic fromContext(ctx: ToolContext): ImessageClient {\n\t\tconst auth = requireAuth(ctx, imessageAuthSchema)\n\t\treturn new ImessageClient(auth, {\n\t\t\t...(ctx.fetch && { fetch: ctx.fetch }),\n\t\t\t...(ctx.signal && { signal: ctx.signal })\n\t\t})\n\t}\n\n\t#phone(override: string | undefined): string | undefined {\n\t\treturn override ?? this.#defaultPhone\n\t}\n\n\tasync #post(path: string, body: Record<string, unknown>, label: string): Promise<unknown> {\n\t\tconst res = await this.#http.post(path, body, { label, noThrow: true })\n\t\tassertProxyOk(label, res.status, res.data)\n\t\treturn res.data\n\t}\n\n\t/**\n\t * Create a chat (1:1 or group). Host-only; not an agent tool.\n\t * Proxy: POST /v1/ensure-chat (fill on proxy if not yet shipped).\n\t */\n\tasync ensureChat(input: ImessageEnsureChatInput): Promise<ImessageEnsureChatOutput> {\n\t\tconst data = await this.#post(\n\t\t\t'/v1/ensure-chat',\n\t\t\tspaceBody(undefined, this.#phone(input.phone), {\n\t\t\t\taddresses: input.addresses,\n\t\t\t\t...(input.message && { message: input.message }),\n\t\t\t\t...(input.client_message_id && { client_message_id: input.client_message_id })\n\t\t\t}),\n\t\t\t'iMessage ensureChat'\n\t\t)\n\t\treturn parseEnsureChatResult(data)\n\t}\n\n\t/** POST /v1/send */\n\tasync sendText(input: ImessageSendTextInput): Promise<ImessageMessageOutput> {\n\t\tconst data = await this.#post(\n\t\t\t'/v1/send',\n\t\t\tspaceBody(input.chat_id, this.#phone(input.phone), { text: input.text }),\n\t\t\t'iMessage send'\n\t\t)\n\t\treturn parseMessageResult(data, 'send')\n\t}\n\n\t/** POST /v1/edit */\n\tasync editText(input: ImessageEditTextInput): Promise<ImessageMessageOutput> {\n\t\tconst data = await this.#post(\n\t\t\t'/v1/edit',\n\t\t\tspaceBody(input.chat_id, this.#phone(input.phone), {\n\t\t\t\tmessage_id: input.message_id,\n\t\t\t\ttext: input.text\n\t\t\t}),\n\t\t\t'iMessage edit'\n\t\t)\n\t\t// Prefer full message payload; fall back to ok + input message_id when proxy only returns ok.\n\t\tif (isPlainObject(data) && data['ok'] === true && isString(data['message_id']) && data['message_id'].length > 0) {\n\t\t\treturn parseMessageResult(data, 'edit')\n\t\t}\n\t\tconst ok = parseOkResult(data)\n\t\treturn {\n\t\t\tspace_id: ok.space_id ?? input.chat_id,\n\t\t\tmessage_id: input.message_id\n\t\t}\n\t}\n\n\t/**\n\t * POST /v1/typing.\n\t * Non-typing chat actions map to typing start (presentation parity with other channels).\n\t */\n\tasync sendChatAction(input: ImessageSendChatActionInput): Promise<void> {\n\t\tawait this.#post(\n\t\t\t'/v1/typing',\n\t\t\tspaceBody(input.chat_id, this.#phone(input.phone), { action: 'start' }),\n\t\t\t'iMessage typing'\n\t\t)\n\t}\n\n\t/** Stop typing indicator. */\n\tasync stopTyping(input: { chat_id: string; phone?: string }): Promise<void> {\n\t\tawait this.#post(\n\t\t\t'/v1/typing',\n\t\t\tspaceBody(input.chat_id, this.#phone(input.phone), { action: 'stop' }),\n\t\t\t'iMessage typing stop'\n\t\t)\n\t}\n\n\t/** POST /v1/react — returns reaction/message guid for journaling. */\n\tasync setReaction(input: ImessageSetReactionInput): Promise<ImessageMessageOutput> {\n\t\tconst data = await this.#post(\n\t\t\t'/v1/react',\n\t\t\tspaceBody(input.chat_id, this.#phone(input.phone), {\n\t\t\t\tmessage_id: input.message_id,\n\t\t\t\temoji: input.emoji\n\t\t\t}),\n\t\t\t'iMessage react'\n\t\t)\n\t\treturn parseMessageResult(data, 'react')\n\t}\n\n\t/**\n\t * POST /v1/clear-reaction.\n\t * Package contract: target message_id + emoji (same as setReaction).\n\t * Proxy should clear by target+emoji; older proxies that only accept reaction message ids need a gap fill.\n\t */\n\tasync clearReaction(input: ImessageClearReactionInput): Promise<void> {\n\t\tawait this.#post(\n\t\t\t'/v1/clear-reaction',\n\t\t\tspaceBody(input.chat_id, this.#phone(input.phone), {\n\t\t\t\tmessage_id: input.message_id,\n\t\t\t\temoji: input.emoji\n\t\t\t}),\n\t\t\t'iMessage clearReaction'\n\t\t)\n\t}\n\n\t/** POST /v1/unsend */\n\tasync unsend(input: ImessageUnsendInput): Promise<void> {\n\t\tawait this.#post(\n\t\t\t'/v1/unsend',\n\t\t\tspaceBody(input.chat_id, this.#phone(input.phone), { message_id: input.message_id }),\n\t\t\t'iMessage unsend'\n\t\t)\n\t}\n\n\t/** POST /v1/read */\n\tasync read(input: ImessageReadInput): Promise<void> {\n\t\tawait this.#post(\n\t\t\t'/v1/read',\n\t\t\tspaceBody(input.chat_id, this.#phone(input.phone), {\n\t\t\t\t...(input.message_id && { message_id: input.message_id })\n\t\t\t}),\n\t\t\t'iMessage read'\n\t\t)\n\t}\n\n\t/** POST /v1/media */\n\tasync sendMedia(input: ImessageSendMediaInput): Promise<ImessageMessageOutput> {\n\t\tconst data = await this.#post('/v1/media', mediaBody(input, this.#phone(input.phone)), 'iMessage sendMedia')\n\t\treturn parseMessageResult(data, 'media')\n\t}\n\n\t/**\n\t * POST /v1/download.\n\t * Prefer attachment guid alone; pass chat_id when the proxy still requires a space.\n\t */\n\tasync downloadFile(input: ImessageDownloadFileInput): Promise<ImessageDownloadFileOutput> {\n\t\tconst data = await this.#post(\n\t\t\t'/v1/download',\n\t\t\tspaceBody(input.chat_id, this.#phone(input.phone), { file_id: input.file_id }),\n\t\t\t'iMessage downloadFile'\n\t\t)\n\t\treturn parseDownloadResult(input, data)\n\t}\n\n\tasync answerCallback(_input: unknown): Promise<void> {\n\t\t// No interactive callbacks on iMessage.\n\t}\n}\n\nexport { isImessageDefiniteRejection, isImessageOutcomeUnknown, ImessageClientError }\n","import { defineModule, defineTool } from '../../core/define'\nimport { ImessageClient } from './client'\nimport {\n\timessageAuthSchema,\n\timessageClearReactionInputSchema,\n\timessageDownloadFileInputSchema,\n\timessageDownloadFileOutputSchema,\n\timessageEditTextInputSchema,\n\timessageMessageOutputSchema,\n\timessageOkOutputSchema,\n\timessageReadInputSchema,\n\timessageSendChatActionInputSchema,\n\timessageSendMediaInputSchema,\n\timessageSendTextInputSchema,\n\timessageSetReactionInputSchema,\n\timessageUnsendInputSchema\n} from './contracts'\n\nexport const imessageSendTextTool = defineTool({\n\tid: 'imessage-send-text',\n\tname: 'imessageSendText',\n\tdescription:\n\t\t'Send a text message to an iMessage chat. chat_id is the chat guid (e.g. any;-;+1555…). Returns message_id (guid) for later edits, reactions, or unsend.',\n\tinputSchema: imessageSendTextInputSchema,\n\toutputSchema: imessageMessageOutputSchema,\n\tsideEffect: 'send',\n\truntime: 'both',\n\tnetwork: true,\n\texecute: async (input, ctx) => ImessageClient.fromContext(ctx).sendText(input)\n})\n\nexport const imessageEditTextTool = defineTool({\n\tid: 'imessage-edit-text',\n\tname: 'imessageEditText',\n\tdescription: 'Edit the text of a previously sent iMessage. Requires chat guid and message guid.',\n\tinputSchema: imessageEditTextInputSchema,\n\toutputSchema: imessageMessageOutputSchema,\n\tsideEffect: 'write',\n\truntime: 'both',\n\tnetwork: true,\n\texecute: async (input, ctx) => ImessageClient.fromContext(ctx).editText(input)\n})\n\nexport const imessageSendChatActionTool = defineTool({\n\tid: 'imessage-send-chat-action',\n\tname: 'imessageSendChatAction',\n\tdescription: 'Show a typing indicator in an iMessage chat while a response is being prepared.',\n\tinputSchema: imessageSendChatActionInputSchema,\n\toutputSchema: imessageOkOutputSchema,\n\tsideEffect: 'none',\n\truntime: 'both',\n\tnetwork: true,\n\texecute: async (input, ctx) => {\n\t\tawait ImessageClient.fromContext(ctx).sendChatAction(input)\n\t\treturn { ok: true, space_id: input.chat_id }\n\t}\n})\n\nexport const imessageSetReactionTool = defineTool({\n\tid: 'imessage-set-reaction',\n\tname: 'imessageSetReaction',\n\tdescription:\n\t\t'React to an iMessage with a tapback (love, like, dislike, laugh, emphasize, question) or free emoji. Returns a message guid for journaling. To clear, call clear-reaction with the same target message_id and emoji.',\n\tinputSchema: imessageSetReactionInputSchema,\n\toutputSchema: imessageMessageOutputSchema,\n\tsideEffect: 'write',\n\truntime: 'both',\n\tnetwork: true,\n\texecute: async (input, ctx) => ImessageClient.fromContext(ctx).setReaction(input)\n})\n\nexport const imessageClearReactionTool = defineTool({\n\tid: 'imessage-clear-reaction',\n\tname: 'imessageClearReaction',\n\tdescription:\n\t\t'Clear an iMessage reaction. message_id is the target message that was reacted to; emoji must match set-reaction (tapback name or emoji character).',\n\tinputSchema: imessageClearReactionInputSchema,\n\toutputSchema: imessageOkOutputSchema,\n\tsideEffect: 'delete',\n\truntime: 'both',\n\tnetwork: true,\n\texecute: async (input, ctx) => {\n\t\tawait ImessageClient.fromContext(ctx).clearReaction(input)\n\t\treturn { ok: true, space_id: input.chat_id }\n\t}\n})\n\nexport const imessageUnsendTool = defineTool({\n\tid: 'imessage-unsend',\n\tname: 'imessageUnsend',\n\tdescription: 'Unsend a previously sent iMessage using its chat guid and message guid.',\n\tinputSchema: imessageUnsendInputSchema,\n\toutputSchema: imessageOkOutputSchema,\n\tsideEffect: 'delete',\n\truntime: 'both',\n\tnetwork: true,\n\texecute: async (input, ctx) => {\n\t\tawait ImessageClient.fromContext(ctx).unsend(input)\n\t\treturn { ok: true, space_id: input.chat_id }\n\t}\n})\n\nexport const imessageReadTool = defineTool({\n\tid: 'imessage-read',\n\tname: 'imessageRead',\n\tdescription: 'Mark an iMessage conversation as read (whole chat).',\n\tinputSchema: imessageReadInputSchema,\n\toutputSchema: imessageOkOutputSchema,\n\tsideEffect: 'write',\n\truntime: 'both',\n\tnetwork: true,\n\texecute: async (input, ctx) => {\n\t\tawait ImessageClient.fromContext(ctx).read(input)\n\t\treturn { ok: true, space_id: input.chat_id }\n\t}\n})\n\nexport const imessageSendMediaTool = defineTool({\n\tid: 'imessage-send-media',\n\tname: 'imessageSendMedia',\n\tdescription:\n\t\t'Upload and send one photo or document to an iMessage chat from base64 bytes. Optional caption is sent as a follow-up text message.',\n\tinputSchema: imessageSendMediaInputSchema,\n\toutputSchema: imessageMessageOutputSchema,\n\tsideEffect: 'send',\n\truntime: 'both',\n\tnetwork: true,\n\texecute: async (input, ctx) => ImessageClient.fromContext(ctx).sendMedia(input)\n})\n\nexport const imessageDownloadFileTool = defineTool({\n\tid: 'imessage-download-file',\n\tname: 'imessageDownloadFile',\n\tdescription: 'Download attachment bytes by attachment guid (file_id from inbound or upload).',\n\tinputSchema: imessageDownloadFileInputSchema,\n\toutputSchema: imessageDownloadFileOutputSchema,\n\tsideEffect: 'none',\n\truntime: 'both',\n\tnetwork: true,\n\texecute: async (input, ctx) => ImessageClient.fromContext(ctx).downloadFile(input)\n})\n\nexport const imessageModule = defineModule({\n\tid: 'imessage',\n\ttitle: 'iMessage',\n\tdescription:\n\t\t'iMessage tools for sending and editing text or media, typing indicators, reactions, unsend, read state, and attachment download via a bound photon-rest-proxy.',\n\truntime: 'both',\n\tauth: { type: 'custom', schema: imessageAuthSchema },\n\tcategories: ['messaging', 'chat'],\n\tclassification: 'pii',\n\ttags: ['imessage', 'photon'],\n\ttools: [\n\t\timessageSendTextTool,\n\t\timessageEditTextTool,\n\t\timessageSendChatActionTool,\n\t\timessageSetReactionTool,\n\t\timessageClearReactionTool,\n\t\timessageUnsendTool,\n\t\timessageReadTool,\n\t\timessageSendMediaTool,\n\t\timessageDownloadFileTool\n\t]\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAa,qBAAqB,EAAE,OAAO;CAC1C,UAAU,EA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S;CACT,SAAS,OAAO,OAAO,QAAQ;EAC9B,MAAM,eAAe,YAAY,GAAG,CAAC,CAAC,KAAK,KAAK;EAChD,OAAO;GAAE,IAAI;GAAM,UAAU,MAAM;EAAQ;CAC5C;AACD,CAAC;AAED,MAAa,wBAAwB,WAAW;CAC/C,IAAI;CACJ,MAAM;CACN,aACC;CACD,aAAa;CACb,cAAc;CACd,YAAY;CACZ,SAAS;CACT,SAAS;CACT,SAAS,OAAO,OAAO,QAAQ,eAAe,YAAY,GAAG,CAAC,CAAC,UAAU,KAAK;AAC/E,CAAC;AAED,MAAa,2BAA2B,WAAW;CAClD,IAAI;CACJ,MAAM;CACN,aAAa;CACb,aAAa;CACb,cAAc;CACd,YAAY;CACZ,SAAS;CACT,SAAS;CACT,SAAS,OAAO,OAAO,QAAQ,eAAe,YAAY,GAAG,CAAC,CAAC,aAAa,KAAK;AAClF,CAAC;AAED,MAAa,iBAAiB,aAAa;CAC1C,IAAI;CACJ,OAAO;CACP,aACC;CACD,SAAS;CACT,MAAM;EAAE,MAAM;EAAU,QAAQ;CAAmB;CACnD,YAAY,CAAC,aAAa,MAAM;CAChC,gBAAgB;CAChB,MAAM,CAAC,YAAY,QAAQ;CAC3B,OAAO;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD;AACD,CAAC"}
|
|
1
|
+
{"version":3,"file":"imessage-Dsms04rC.js","names":["#http","#defaultPhone","#post","#phone"],"sources":["../src/vendors/imessage/contracts.ts","../src/vendors/imessage/domain.ts","../src/vendors/imessage/client.ts","../src/vendors/imessage/module.ts"],"sourcesContent":["import { z } from 'zod'\n\n/**\n * Host auth for the hosted photon-rest-proxy (REST → Spectrum gRPC).\n * Credentials are forwarded per request; the proxy stores nothing.\n *\n * Proxy route map (package client → HTTP):\n * - sendText → POST /v1/send\n * - editText → POST /v1/edit\n * - sendChatAction / stopTyping → POST /v1/typing\n * - setReaction → POST /v1/react\n * - clearReaction → POST /v1/clear-reaction (target message_id + emoji; proxy gap if not yet supported)\n * - unsend → POST /v1/unsend\n * - read → POST /v1/read\n * - sendMedia → POST /v1/media\n * - downloadFile → POST /v1/download (chat_id optional; proxy gap if still required)\n * - ensureChat → POST /v1/ensure-chat (host-only; proxy gap until implemented)\n */\nexport const imessageAuthSchema = z.object({\n\tbase_url: z.url().describe('Origin of the hosted photon-rest-proxy, for example https://photon-proxy.example.com'),\n\tproject_id: z.string().min(1).describe('Spectrum project id (sent as x-spectrum-project-id)'),\n\tproject_secret: z.string().min(1).describe('Spectrum project secret (sent as x-spectrum-project-secret)'),\n\tphone: z\n\t\t.string()\n\t\t.min(1)\n\t\t.optional()\n\t\t.describe('Optional default iMessage line phone when the project has multiple lines')\n})\n\nexport type ImessageAuth = z.infer<typeof imessageAuthSchema>\n\nexport const imessageChatActionSchema = z.enum([\n\t'typing',\n\t'upload_photo',\n\t'record_video',\n\t'upload_video',\n\t'record_voice',\n\t'upload_voice',\n\t'upload_document',\n\t'choose_sticker',\n\t'find_location',\n\t'record_video_note',\n\t'upload_video_note'\n])\n\nexport const imessageSendTextInputSchema = z.object({\n\tchat_id: z.string().min(1).describe('iMessage chat guid (e.g. any;-;alice@example.com)'),\n\ttext: z.string().min(1).describe('Message text'),\n\tphone: z.string().min(1).optional().describe('Optional line phone override for multi-line projects')\n})\n\nexport const imessageMessageOutputSchema = z.object({\n\tmessage_id: z.string().min(1).describe('Message guid (provider id for journaling)'),\n\tspace_id: z.string().describe('Chat guid (same as chat_id)')\n})\n\nexport const imessageEditTextInputSchema = z.object({\n\tchat_id: z.string().min(1).describe('iMessage chat guid'),\n\tmessage_id: z.string().min(1).describe('Message guid to edit'),\n\ttext: z.string().min(1).describe('Replacement text'),\n\tphone: z.string().min(1).optional().describe('Optional line phone override')\n})\n\nexport const imessageSendChatActionInputSchema = z.object({\n\tchat_id: z.string().min(1).describe('iMessage chat guid'),\n\taction: imessageChatActionSchema.describe('Chat action; non-typing values map to typing start'),\n\tphone: z.string().min(1).optional().describe('Optional line phone override')\n})\n\nexport const imessageSetReactionInputSchema = z.object({\n\tchat_id: z.string().min(1).describe('iMessage chat guid'),\n\tmessage_id: z.string().min(1).describe('Message guid to react to'),\n\temoji: z\n\t\t.string()\n\t\t.min(1)\n\t\t.max(64)\n\t\t.describe(\n\t\t\t'Tapback name (love, like, dislike, laugh, emphasize, question) or an emoji character the channel accepts'\n\t\t),\n\tphone: z.string().min(1).optional().describe('Optional line phone override')\n})\n\nexport const imessageUnsendInputSchema = z.object({\n\tchat_id: z.string().min(1).describe('iMessage chat guid'),\n\tmessage_id: z.string().min(1).describe('Message guid to unsend'),\n\tphone: z.string().min(1).optional().describe('Optional line phone override')\n})\n\nexport const imessageReadInputSchema = z.object({\n\tchat_id: z.string().min(1).describe('iMessage chat guid'),\n\tmessage_id: z\n\t\t.string()\n\t\t.min(1)\n\t\t.optional()\n\t\t.describe('Optional; mark-read may apply to the whole chat (field kept for seam parity)'),\n\tphone: z.string().min(1).optional().describe('Optional line phone override')\n})\n\nexport const imessageOkOutputSchema = z.object({\n\tok: z.boolean(),\n\tspace_id: z.string().optional()\n})\n\nexport const MAX_MEDIA_BYTES = 20 * 1024 * 1024\n\n/**\n * Clear a reaction. `message_id` is the **target** message that was reacted to;\n * `emoji` must match set-reaction. Proxy should clear by target+emoji (not reaction message id).\n */\nexport const imessageClearReactionInputSchema = z.object({\n\tchat_id: z.string().min(1).describe('iMessage chat guid'),\n\tmessage_id: z.string().min(1).describe('Target message guid that was reacted to'),\n\temoji: z.string().min(1).max(64).describe('Same tapback name or emoji used when setting the reaction'),\n\tphone: z.string().min(1).optional().describe('Optional line phone override')\n})\n\nexport const imessageSendMediaInputSchema = z.object({\n\tchat_id: z.string().min(1).describe('iMessage chat guid'),\n\tkind: z.enum(['photo', 'document']).describe('Media kind (presentation)'),\n\tbody_base64: z.string().min(1).describe('File body as base64'),\n\tfile_name: z.string().min(1).describe('File name including extension'),\n\tcaption: z.string().optional().describe('Optional caption sent as a follow-up text message'),\n\tcontent_type: z.string().optional().describe('Optional MIME type; inferred from file_name when omitted'),\n\tphone: z.string().min(1).optional().describe('Optional line phone override')\n})\n\nexport const imessageDownloadFileInputSchema = z.object({\n\tfile_id: z.string().min(1).describe('Attachment guid (from inbound payload or upload)'),\n\tfile_name: z.string().min(1).optional().describe('Preferred file name for the download result'),\n\tchat_id: z.string().min(1).optional().describe('Chat guid (optional when proxy can resolve by file_id alone)'),\n\tphone: z.string().min(1).optional().describe('Optional line phone override')\n})\n\nexport const imessageDownloadFileOutputSchema = z.object({\n\tfile_name: z.string(),\n\tfile_size: z.number().optional(),\n\tbody_base64: z.string().describe('Downloaded file body as base64')\n})\n\n/**\n * Create (or resolve) a chat via proxy POST /v1/ensure-chat (host-only).\n * One address = 1:1; two or more = group.\n */\nexport const imessageEnsureChatInputSchema = z.object({\n\taddresses: z\n\t\t.array(z.string().min(1))\n\t\t.min(1)\n\t\t.describe('Peer phone number(s) or email(s). One address creates a 1:1 chat; two or more create a group'),\n\tmessage: z.string().min(1).optional().describe('Optional opening text sent in the same create call'),\n\tclient_message_id: z\n\t\t.string()\n\t\t.min(1)\n\t\t.optional()\n\t\t.describe('Optional idempotency key for chat creation and the optional opening send'),\n\tphone: z.string().min(1).optional().describe('Optional line phone override')\n})\n\nexport const imessageEnsureChatOutputSchema = z.object({\n\tchat_id: z.string().min(1).describe('Chat guid for later send, edit, react, or unsend'),\n\tmessage_id: z\n\t\t.string()\n\t\t.min(1)\n\t\t.optional()\n\t\t.describe('Guid of the opening message when message was provided and the server returned one')\n})\n\nexport type ImessageSendTextInput = z.infer<typeof imessageSendTextInputSchema>\nexport type ImessageMessageOutput = z.infer<typeof imessageMessageOutputSchema>\nexport type ImessageEditTextInput = z.infer<typeof imessageEditTextInputSchema>\nexport type ImessageSendChatActionInput = z.infer<typeof imessageSendChatActionInputSchema>\nexport type ImessageSetReactionInput = z.infer<typeof imessageSetReactionInputSchema>\nexport type ImessageUnsendInput = z.infer<typeof imessageUnsendInputSchema>\nexport type ImessageReadInput = z.infer<typeof imessageReadInputSchema>\nexport type ImessageClearReactionInput = z.infer<typeof imessageClearReactionInputSchema>\nexport type ImessageSendMediaInput = z.infer<typeof imessageSendMediaInputSchema>\nexport type ImessageDownloadFileInput = z.infer<typeof imessageDownloadFileInputSchema>\nexport type ImessageDownloadFileOutput = z.infer<typeof imessageDownloadFileOutputSchema>\nexport type ImessageEnsureChatInput = z.infer<typeof imessageEnsureChatInputSchema>\nexport type ImessageEnsureChatOutput = z.infer<typeof imessageEnsureChatOutputSchema>\n","/**\n * photon-rest-proxy response parse + failure helpers (no HTTP).\n */\n\nimport { isPlainObject, isString } from 'es-toolkit'\n\nimport { ToolError } from '../../core/errors'\nimport { base64ToBytes } from '../../shared/bytes'\nimport type {\n\tImessageDownloadFileInput,\n\tImessageDownloadFileOutput,\n\tImessageEnsureChatOutput,\n\tImessageMessageOutput,\n\tImessageSendMediaInput\n} from './contracts'\nimport { MAX_MEDIA_BYTES } from './contracts'\n\nexport type ImessageFailureKind = 'definite_rejection' | 'outcome_unknown'\n\nexport class ImessageClientError extends ToolError {\n\treadonly failureKind: ImessageFailureKind\n\n\tconstructor(input: {\n\t\tmessage: string\n\t\tfailureKind: ImessageFailureKind\n\t\tstatus?: number\n\t\tcode?: string\n\t\tcause?: unknown\n\t}) {\n\t\tsuper(input.message, {\n\t\t\tcode: mapStatusToToolCode(input.status, input.code),\n\t\t\tretryable: input.failureKind === 'outcome_unknown',\n\t\t\tcause: input.cause,\n\t\t\tdetails: {\n\t\t\t\tfailure_kind: input.failureKind,\n\t\t\t\tstatus: input.status,\n\t\t\t\tproxy_error: input.code\n\t\t\t}\n\t\t})\n\t\tthis.name = 'ImessageClientError'\n\t\tthis.failureKind = input.failureKind\n\t}\n}\n\nexport function isImessageDefiniteRejection(error: unknown): boolean {\n\treturn error instanceof ImessageClientError && error.failureKind === 'definite_rejection'\n}\n\nexport function isImessageOutcomeUnknown(error: unknown): boolean {\n\treturn error instanceof ImessageClientError && error.failureKind === 'outcome_unknown'\n}\n\nfunction mapStatusToToolCode(status: number | undefined, proxyCode: string | undefined): ToolError['code'] {\n\tif (status === 401) return 'bad_auth'\n\tif (status === 403) return 'forbidden'\n\tif (status === 404) return 'not_found'\n\tif (status === 400) return 'bad_input'\n\tif (status === 429) return 'rate_limited'\n\tif (proxyCode === 'unauthorized') return 'bad_auth'\n\tif (proxyCode === 'message_not_found' || proxyCode === 'not_found') return 'not_found'\n\tif (proxyCode === 'unsupported' || proxyCode === 'not_implemented') return 'unsupported'\n\treturn 'upstream'\n}\n\nfunction isDefiniteStatus(status: number): boolean {\n\treturn status === 400 || status === 401 || status === 403 || status === 404\n}\n\n/** Parse photon-rest-proxy JSON error body or throw on non-2xx. */\nexport function assertProxyOk(label: string, status: number, data: unknown): void {\n\tif (status >= 200 && status < 300) return\n\n\tlet message = `${label} failed with HTTP ${status}`\n\tlet code: string | undefined\n\tif (isPlainObject(data)) {\n\t\tconst err = data['error']\n\t\tconst detail = data['detail']\n\t\tif (isString(err) && err.length > 0) {\n\t\t\tcode = err\n\t\t\tmessage = isString(detail) && detail.length > 0 ? `${err}: ${detail}` : err\n\t\t} else if (isString(detail) && detail.length > 0) {\n\t\t\tmessage = detail\n\t\t}\n\t}\n\n\tthrow new ImessageClientError({\n\t\tmessage,\n\t\tfailureKind: isDefiniteStatus(status) ? 'definite_rejection' : 'outcome_unknown',\n\t\tstatus,\n\t\t...(code && { code })\n\t})\n}\n\nfunction requireString(data: Record<string, unknown>, key: string, label: string): string {\n\tconst value = data[key]\n\tif (!isString(value) || value.length === 0) {\n\t\tthrow new ToolError(`iMessage proxy ${label} missing ${key}`, { code: 'upstream' })\n\t}\n\treturn value\n}\n\n/** Prefer space_id; accept chat_id alias from newer proxy shapes. */\nfunction spaceOrChatId(data: Record<string, unknown>, label: string): string {\n\tconst spaceId = data['space_id']\n\tif (isString(spaceId) && spaceId.length > 0) return spaceId\n\tconst chatId = data['chat_id']\n\tif (isString(chatId) && chatId.length > 0) return chatId\n\tthrow new ToolError(`iMessage proxy ${label} missing space_id`, { code: 'upstream' })\n}\n\nexport function parseMessageResult(data: unknown, label = 'send'): ImessageMessageOutput {\n\tif (!isPlainObject(data) || data['ok'] !== true) {\n\t\tthrow new ToolError(`iMessage proxy returned an unexpected ${label} payload`, { code: 'upstream' })\n\t}\n\treturn {\n\t\tspace_id: spaceOrChatId(data, label),\n\t\tmessage_id: requireString(data, 'message_id', label)\n\t}\n}\n\nexport function parseOkResult(data: unknown): { ok: true; space_id?: string } {\n\tif (!isPlainObject(data) || data['ok'] !== true) {\n\t\tthrow new ToolError('iMessage proxy returned an unexpected ok payload', { code: 'upstream' })\n\t}\n\tconst spaceId = data['space_id']\n\tconst chatId = data['chat_id']\n\tconst id =\n\t\tisString(spaceId) && spaceId.length > 0 ? spaceId : isString(chatId) && chatId.length > 0 ? chatId : undefined\n\treturn {\n\t\tok: true,\n\t\t...(id && { space_id: id })\n\t}\n}\n\nexport function parseEnsureChatResult(data: unknown): ImessageEnsureChatOutput {\n\tif (!isPlainObject(data) || data['ok'] !== true) {\n\t\tthrow new ToolError('iMessage proxy returned an unexpected ensure-chat payload', { code: 'upstream' })\n\t}\n\tconst chatId = spaceOrChatId(data, 'ensure-chat')\n\tconst messageId = data['message_id']\n\treturn {\n\t\tchat_id: chatId,\n\t\t...(isString(messageId) && messageId.length > 0 && { message_id: messageId })\n\t}\n}\n\n/** Map messaging-style chat_id to proxy space_id body fields. */\nexport function spaceBody(\n\tchatId: string | undefined,\n\tphone: string | undefined,\n\textra: Record<string, unknown> = {}\n): Record<string, unknown> {\n\treturn {\n\t\tplatform: 'imessage',\n\t\t...extra,\n\t\t...(chatId && { space_id: chatId }),\n\t\t...(phone && { phone })\n\t}\n}\n\n/** Decode and size-check media base64 for sendMedia. */\nexport function decodeMediaBody(bodyBase64: string): void {\n\tlet bytes: Uint8Array\n\ttry {\n\t\tbytes = base64ToBytes(bodyBase64)\n\t} catch (error) {\n\t\tthrow new ToolError('Invalid base64 body', { code: 'bad_input', cause: error })\n\t}\n\tif (bytes.byteLength === 0) {\n\t\tthrow new ToolError('Media body must not be empty', { code: 'bad_input' })\n\t}\n\tif (bytes.byteLength > MAX_MEDIA_BYTES) {\n\t\tthrow new ToolError('Media exceeds 20 MiB limit', {\n\t\t\tcode: 'too_large',\n\t\t\tdetails: { max_bytes: MAX_MEDIA_BYTES, content_length: bytes.byteLength }\n\t\t})\n\t}\n}\n\n/** Build POST /v1/media JSON body (base64 already validated). */\nexport function mediaBody(input: ImessageSendMediaInput, phone: string | undefined): Record<string, unknown> {\n\tdecodeMediaBody(input.body_base64)\n\treturn spaceBody(input.chat_id, phone, {\n\t\tbody_base64: input.body_base64,\n\t\tfile_name: input.file_name,\n\t\t...(input.content_type && { mime_type: input.content_type }),\n\t\t...(input.caption && { caption: input.caption })\n\t})\n}\n\nexport function parseDownloadResult(input: ImessageDownloadFileInput, data: unknown): ImessageDownloadFileOutput {\n\tif (!isPlainObject(data) || data['ok'] !== true) {\n\t\tthrow new ToolError('iMessage proxy returned an unexpected download payload', { code: 'upstream' })\n\t}\n\tconst bodyBase64 = data['body_base64']\n\tif (!isString(bodyBase64) || bodyBase64.length === 0) {\n\t\tthrow new ToolError('iMessage proxy download missing body_base64', { code: 'upstream' })\n\t}\n\tconst name = data['file_name']\n\tconst size = data['file_size']\n\treturn {\n\t\tfile_name: input.file_name ?? (isString(name) && name.length > 0 ? name : input.file_id),\n\t\t...(typeof size === 'number' && Number.isFinite(size) && { file_size: size }),\n\t\tbody_base64: bodyBase64\n\t}\n}\n","/**\n * iMessage vendor client via hosted photon-rest-proxy (REST → Spectrum gRPC).\n * Host: `new ImessageClient(auth)`. Agent tools: `fromContext(ctx)`.\n *\n * Workers-safe: only HTTP to the proxy. No Photon SDK / gRPC in this package.\n */\n\nimport { isPlainObject, isString } 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 type {\n\tImessageAuth,\n\tImessageClearReactionInput,\n\tImessageDownloadFileInput,\n\tImessageDownloadFileOutput,\n\tImessageEditTextInput,\n\tImessageEnsureChatInput,\n\tImessageEnsureChatOutput,\n\tImessageMessageOutput,\n\tImessageReadInput,\n\tImessageSendChatActionInput,\n\tImessageSendMediaInput,\n\tImessageSendTextInput,\n\tImessageSetReactionInput,\n\tImessageUnsendInput\n} from './contracts'\nimport { imessageAuthSchema } from './contracts'\nimport {\n\tassertProxyOk,\n\tisImessageDefiniteRejection,\n\tisImessageOutcomeUnknown,\n\tImessageClientError,\n\tmediaBody,\n\tparseDownloadResult,\n\tparseEnsureChatResult,\n\tparseMessageResult,\n\tparseOkResult,\n\tspaceBody\n} from './domain'\n\nexport type ImessageClientOptions = Pick<HttpServiceOptions, 'fetch' | 'signal'>\n\nexport class ImessageClient {\n\treadonly #http: HttpService\n\treadonly #defaultPhone: string | undefined\n\n\tconstructor(auth: ImessageAuth, options: ImessageClientOptions = {}) {\n\t\tconst parsed = imessageAuthSchema.safeParse(auth)\n\t\tif (!parsed.success) {\n\t\t\tthrow new ToolError('Invalid iMessage auth credentials', {\n\t\t\t\tcode: 'bad_auth',\n\t\t\t\tdetails: { issues: parsed.error.issues.map((issue) => issue.message) }\n\t\t\t})\n\t\t}\n\t\tconst { base_url, project_id, project_secret, phone } = parsed.data\n\t\tthis.#defaultPhone = phone\n\t\tthis.#http = new HttpService({\n\t\t\t...options,\n\t\t\tbaseURL: base_url,\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t'x-spectrum-project-id': project_id,\n\t\t\t\t'x-spectrum-project-secret': project_secret\n\t\t\t},\n\t\t\tlabel: 'iMessage'\n\t\t})\n\t}\n\n\tstatic fromContext(ctx: ToolContext): ImessageClient {\n\t\tconst auth = requireAuth(ctx, imessageAuthSchema)\n\t\treturn new ImessageClient(auth, {\n\t\t\t...(ctx.fetch && { fetch: ctx.fetch }),\n\t\t\t...(ctx.signal && { signal: ctx.signal })\n\t\t})\n\t}\n\n\t#phone(override: string | undefined): string | undefined {\n\t\treturn override ?? this.#defaultPhone\n\t}\n\n\tasync #post(path: string, body: Record<string, unknown>, label: string): Promise<unknown> {\n\t\tconst res = await this.#http.post(path, body, { label, noThrow: true })\n\t\tassertProxyOk(label, res.status, res.data)\n\t\treturn res.data\n\t}\n\n\t/**\n\t * Create a chat (1:1 or group). Host-only; not an agent tool.\n\t * Proxy: POST /v1/ensure-chat (fill on proxy if not yet shipped).\n\t */\n\tasync ensureChat(input: ImessageEnsureChatInput): Promise<ImessageEnsureChatOutput> {\n\t\tconst data = await this.#post(\n\t\t\t'/v1/ensure-chat',\n\t\t\tspaceBody(undefined, this.#phone(input.phone), {\n\t\t\t\taddresses: input.addresses,\n\t\t\t\t...(input.message && { message: input.message }),\n\t\t\t\t...(input.client_message_id && { client_message_id: input.client_message_id })\n\t\t\t}),\n\t\t\t'iMessage ensureChat'\n\t\t)\n\t\treturn parseEnsureChatResult(data)\n\t}\n\n\t/** POST /v1/send */\n\tasync sendText(input: ImessageSendTextInput): Promise<ImessageMessageOutput> {\n\t\tconst data = await this.#post(\n\t\t\t'/v1/send',\n\t\t\tspaceBody(input.chat_id, this.#phone(input.phone), { text: input.text }),\n\t\t\t'iMessage send'\n\t\t)\n\t\treturn parseMessageResult(data, 'send')\n\t}\n\n\t/** POST /v1/edit */\n\tasync editText(input: ImessageEditTextInput): Promise<ImessageMessageOutput> {\n\t\tconst data = await this.#post(\n\t\t\t'/v1/edit',\n\t\t\tspaceBody(input.chat_id, this.#phone(input.phone), {\n\t\t\t\tmessage_id: input.message_id,\n\t\t\t\ttext: input.text\n\t\t\t}),\n\t\t\t'iMessage edit'\n\t\t)\n\t\t// Prefer full message payload; fall back to ok + input message_id when proxy only returns ok.\n\t\tif (isPlainObject(data) && data['ok'] === true && isString(data['message_id']) && data['message_id'].length > 0) {\n\t\t\treturn parseMessageResult(data, 'edit')\n\t\t}\n\t\tconst ok = parseOkResult(data)\n\t\treturn {\n\t\t\tspace_id: ok.space_id ?? input.chat_id,\n\t\t\tmessage_id: input.message_id\n\t\t}\n\t}\n\n\t/**\n\t * POST /v1/typing.\n\t * Non-typing chat actions map to typing start (presentation parity with other channels).\n\t */\n\tasync sendChatAction(input: ImessageSendChatActionInput): Promise<void> {\n\t\tawait this.#post(\n\t\t\t'/v1/typing',\n\t\t\tspaceBody(input.chat_id, this.#phone(input.phone), { action: 'start' }),\n\t\t\t'iMessage typing'\n\t\t)\n\t}\n\n\t/** Stop typing indicator. */\n\tasync stopTyping(input: { chat_id: string; phone?: string }): Promise<void> {\n\t\tawait this.#post(\n\t\t\t'/v1/typing',\n\t\t\tspaceBody(input.chat_id, this.#phone(input.phone), { action: 'stop' }),\n\t\t\t'iMessage typing stop'\n\t\t)\n\t}\n\n\t/** POST /v1/react — returns reaction/message guid for journaling. */\n\tasync setReaction(input: ImessageSetReactionInput): Promise<ImessageMessageOutput> {\n\t\tconst data = await this.#post(\n\t\t\t'/v1/react',\n\t\t\tspaceBody(input.chat_id, this.#phone(input.phone), {\n\t\t\t\tmessage_id: input.message_id,\n\t\t\t\temoji: input.emoji\n\t\t\t}),\n\t\t\t'iMessage react'\n\t\t)\n\t\treturn parseMessageResult(data, 'react')\n\t}\n\n\t/**\n\t * POST /v1/clear-reaction.\n\t * Package contract: target message_id + emoji (same as setReaction).\n\t * Proxy should clear by target+emoji; older proxies that only accept reaction message ids need a gap fill.\n\t */\n\tasync clearReaction(input: ImessageClearReactionInput): Promise<void> {\n\t\tawait this.#post(\n\t\t\t'/v1/clear-reaction',\n\t\t\tspaceBody(input.chat_id, this.#phone(input.phone), {\n\t\t\t\tmessage_id: input.message_id,\n\t\t\t\temoji: input.emoji\n\t\t\t}),\n\t\t\t'iMessage clearReaction'\n\t\t)\n\t}\n\n\t/** POST /v1/unsend */\n\tasync unsend(input: ImessageUnsendInput): Promise<void> {\n\t\tawait this.#post(\n\t\t\t'/v1/unsend',\n\t\t\tspaceBody(input.chat_id, this.#phone(input.phone), { message_id: input.message_id }),\n\t\t\t'iMessage unsend'\n\t\t)\n\t}\n\n\t/** POST /v1/read */\n\tasync read(input: ImessageReadInput): Promise<void> {\n\t\tawait this.#post(\n\t\t\t'/v1/read',\n\t\t\tspaceBody(input.chat_id, this.#phone(input.phone), {\n\t\t\t\t...(input.message_id && { message_id: input.message_id })\n\t\t\t}),\n\t\t\t'iMessage read'\n\t\t)\n\t}\n\n\t/** POST /v1/media */\n\tasync sendMedia(input: ImessageSendMediaInput): Promise<ImessageMessageOutput> {\n\t\tconst data = await this.#post('/v1/media', mediaBody(input, this.#phone(input.phone)), 'iMessage sendMedia')\n\t\treturn parseMessageResult(data, 'media')\n\t}\n\n\t/**\n\t * POST /v1/download.\n\t * Prefer attachment guid alone; pass chat_id when the proxy still requires a space.\n\t */\n\tasync downloadFile(input: ImessageDownloadFileInput): Promise<ImessageDownloadFileOutput> {\n\t\tconst data = await this.#post(\n\t\t\t'/v1/download',\n\t\t\tspaceBody(input.chat_id, this.#phone(input.phone), { file_id: input.file_id }),\n\t\t\t'iMessage downloadFile'\n\t\t)\n\t\treturn parseDownloadResult(input, data)\n\t}\n\n\tasync answerCallback(_input: unknown): Promise<void> {\n\t\t// No interactive callbacks on iMessage.\n\t}\n}\n\nexport { isImessageDefiniteRejection, isImessageOutcomeUnknown, ImessageClientError }\n","import { defineModule, defineTool } from '../../core/define'\nimport { ImessageClient } from './client'\nimport {\n\timessageAuthSchema,\n\timessageClearReactionInputSchema,\n\timessageDownloadFileInputSchema,\n\timessageDownloadFileOutputSchema,\n\timessageEditTextInputSchema,\n\timessageMessageOutputSchema,\n\timessageOkOutputSchema,\n\timessageReadInputSchema,\n\timessageSendChatActionInputSchema,\n\timessageSendMediaInputSchema,\n\timessageSendTextInputSchema,\n\timessageSetReactionInputSchema,\n\timessageUnsendInputSchema\n} from './contracts'\n\nexport const imessageSendTextTool = defineTool({\n\tid: 'imessage-send-text',\n\tname: 'imessageSendText',\n\tdescription:\n\t\t'Send a text message to an iMessage chat. chat_id is the chat guid (e.g. any;-;+1555…). Returns message_id (guid) for later edits, reactions, or unsend.',\n\tinputSchema: imessageSendTextInputSchema,\n\toutputSchema: imessageMessageOutputSchema,\n\tsideEffect: 'send',\n\truntime: 'both',\n\tnetwork: true,\n\texecute: async (input, ctx) => ImessageClient.fromContext(ctx).sendText(input)\n})\n\nexport const imessageEditTextTool = defineTool({\n\tid: 'imessage-edit-text',\n\tname: 'imessageEditText',\n\tdescription: 'Edit the text of a previously sent iMessage. Requires chat guid and message guid.',\n\tinputSchema: imessageEditTextInputSchema,\n\toutputSchema: imessageMessageOutputSchema,\n\tsideEffect: 'write',\n\truntime: 'both',\n\tnetwork: true,\n\texecute: async (input, ctx) => ImessageClient.fromContext(ctx).editText(input)\n})\n\nexport const imessageSendChatActionTool = defineTool({\n\tid: 'imessage-send-chat-action',\n\tname: 'imessageSendChatAction',\n\tdescription: 'Show a typing indicator in an iMessage chat while a response is being prepared.',\n\tinputSchema: imessageSendChatActionInputSchema,\n\toutputSchema: imessageOkOutputSchema,\n\tsideEffect: 'none',\n\truntime: 'both',\n\tnetwork: true,\n\texecute: async (input, ctx) => {\n\t\tawait ImessageClient.fromContext(ctx).sendChatAction(input)\n\t\treturn { ok: true, space_id: input.chat_id }\n\t}\n})\n\nexport const imessageSetReactionTool = defineTool({\n\tid: 'imessage-set-reaction',\n\tname: 'imessageSetReaction',\n\tdescription:\n\t\t'React to an iMessage with a tapback (love, like, dislike, laugh, emphasize, question) or free emoji. Returns a message guid for journaling. To clear, call clear-reaction with the same target message_id and emoji.',\n\tinputSchema: imessageSetReactionInputSchema,\n\toutputSchema: imessageMessageOutputSchema,\n\tsideEffect: 'write',\n\truntime: 'both',\n\tnetwork: true,\n\texecute: async (input, ctx) => ImessageClient.fromContext(ctx).setReaction(input)\n})\n\nexport const imessageClearReactionTool = defineTool({\n\tid: 'imessage-clear-reaction',\n\tname: 'imessageClearReaction',\n\tdescription:\n\t\t'Clear an iMessage reaction. message_id is the target message that was reacted to; emoji must match set-reaction (tapback name or emoji character).',\n\tinputSchema: imessageClearReactionInputSchema,\n\toutputSchema: imessageOkOutputSchema,\n\tsideEffect: 'delete',\n\truntime: 'both',\n\tnetwork: true,\n\texecute: async (input, ctx) => {\n\t\tawait ImessageClient.fromContext(ctx).clearReaction(input)\n\t\treturn { ok: true, space_id: input.chat_id }\n\t}\n})\n\nexport const imessageUnsendTool = defineTool({\n\tid: 'imessage-unsend',\n\tname: 'imessageUnsend',\n\tdescription: 'Unsend a previously sent iMessage using its chat guid and message guid.',\n\tinputSchema: imessageUnsendInputSchema,\n\toutputSchema: imessageOkOutputSchema,\n\tsideEffect: 'delete',\n\truntime: 'both',\n\tnetwork: true,\n\texecute: async (input, ctx) => {\n\t\tawait ImessageClient.fromContext(ctx).unsend(input)\n\t\treturn { ok: true, space_id: input.chat_id }\n\t}\n})\n\nexport const imessageReadTool = defineTool({\n\tid: 'imessage-read',\n\tname: 'imessageRead',\n\tdescription: 'Mark an iMessage conversation as read (whole chat).',\n\tinputSchema: imessageReadInputSchema,\n\toutputSchema: imessageOkOutputSchema,\n\tsideEffect: 'write',\n\truntime: 'both',\n\tnetwork: true,\n\texecute: async (input, ctx) => {\n\t\tawait ImessageClient.fromContext(ctx).read(input)\n\t\treturn { ok: true, space_id: input.chat_id }\n\t}\n})\n\nexport const imessageSendMediaTool = defineTool({\n\tid: 'imessage-send-media',\n\tname: 'imessageSendMedia',\n\tdescription:\n\t\t'Upload and send one photo or document to an iMessage chat from base64 bytes. Optional caption is sent as a follow-up text message.',\n\tinputSchema: imessageSendMediaInputSchema,\n\toutputSchema: imessageMessageOutputSchema,\n\tsideEffect: 'send',\n\truntime: 'both',\n\tnetwork: true,\n\texecute: async (input, ctx) => ImessageClient.fromContext(ctx).sendMedia(input)\n})\n\nexport const imessageDownloadFileTool = defineTool({\n\tid: 'imessage-download-file',\n\tname: 'imessageDownloadFile',\n\tdescription: 'Download attachment bytes by attachment guid (file_id from inbound or upload).',\n\tinputSchema: imessageDownloadFileInputSchema,\n\toutputSchema: imessageDownloadFileOutputSchema,\n\tsideEffect: 'none',\n\truntime: 'both',\n\tnetwork: true,\n\texecute: async (input, ctx) => ImessageClient.fromContext(ctx).downloadFile(input)\n})\n\nexport const imessageModule = defineModule({\n\tid: 'imessage',\n\ttitle: 'iMessage',\n\tdescription:\n\t\t'iMessage tools for sending and editing text or media, typing indicators, reactions, unsend, read state, and attachment download via a bound photon-rest-proxy.',\n\truntime: 'both',\n\tauth: { type: 'custom', schema: imessageAuthSchema },\n\tcategories: ['messaging', 'chat'],\n\tclassification: 'pii',\n\ttags: ['imessage', 'photon'],\n\ttools: [\n\t\timessageSendTextTool,\n\t\timessageEditTextTool,\n\t\timessageSendChatActionTool,\n\t\timessageSetReactionTool,\n\t\timessageClearReactionTool,\n\t\timessageUnsendTool,\n\t\timessageReadTool,\n\t\timessageSendMediaTool,\n\t\timessageDownloadFileTool\n\t]\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAa,qBAAqB,EAAE,OAAO;CAC1C,UAAU,EAAE,IAAI,CAAC,CAAC,SAAS,sFAAsF;CACjH,YAAY,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,qDAAqD;CAC5F,gBAAgB,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,6DAA6D;CACxG,OAAO,EACL,OAAO,CAAC,CACR,IAAI,CAAC,CAAC,CACN,SAAS,CAAC,CACV,SAAS,0EAA0E;AACtF,CAAC;AAID,MAAa,2BAA2B,EAAE,KAAK;CAC9C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAC;AAED,MAAa,8BAA8B,EAAE,OAAO;CACnD,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,mDAAmD;CACvF,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,C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F,CAAC;AAED,MAAa,iBAAiB,aAAa;CAC1C,IAAI;CACJ,OAAO;CACP,aACC;CACD,SAAS;CACT,MAAM;EAAE,MAAM;EAAU,QAAQ;CAAmB;CACnD,YAAY,CAAC,aAAa,MAAM;CAChC,gBAAgB;CAChB,MAAM,CAAC,YAAY,QAAQ;CAC3B,OAAO;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD;AACD,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { n as defineModule, r as defineTool } from "../../define-ieoksEQ0.js";
|
|
|
3
3
|
import { n as requireAuth } from "../../provider-CgDAlg6K.js";
|
|
4
4
|
import { n as findArtifactRefs, t as artifactRefSchema } from "../../artifact-D064mHfK.js";
|
|
5
5
|
import { n as bytesToBase64, o as utf8ToBytes, r as bytesToUtf8, t as base64ToBytes } from "../../bytes-BxpimpQx.js";
|
|
6
|
-
import { _ as MAX_OBJECT_BYTES, m as s3AuthSchema, p as S3Client } from "../../s3-
|
|
6
|
+
import { _ as MAX_OBJECT_BYTES, m as s3AuthSchema, p as S3Client } from "../../s3-CoZQRTfe.js";
|
|
7
7
|
import { r as mediaTypeFromPath } from "../../content-type-E4_Qdoa0.js";
|
|
8
8
|
import { isFunction } from "es-toolkit";
|
|
9
9
|
import { z } from "zod";
|
|
@@ -2,8 +2,8 @@ import { t as ToolError } from "../../errors-DoSpNHvs.js";
|
|
|
2
2
|
import { n as defineModule, r as defineTool } from "../../define-ieoksEQ0.js";
|
|
3
3
|
import { n as requireAuth } from "../../provider-CgDAlg6K.js";
|
|
4
4
|
import { t as artifactRefSchema } from "../../artifact-D064mHfK.js";
|
|
5
|
-
import { a as BedrockAgentCoreBrowserClient, c as browserSessionIdInputSchema, d as browserStreamSchema, l as browserSessionOutputSchema, s as bedrockAgentCoreBrowserAuthSchema, u as browserStartSessionInputSchema } from "../../bedrock-agentcore-browser-
|
|
6
|
-
import { c as CloudflareBrowserClient, l as plainTextFromHtml, p as cloudflareBrowserClientAuthSchema } from "../../cloudflare-browser-
|
|
5
|
+
import { a as BedrockAgentCoreBrowserClient, c as browserSessionIdInputSchema, d as browserStreamSchema, l as browserSessionOutputSchema, s as bedrockAgentCoreBrowserAuthSchema, u as browserStartSessionInputSchema } from "../../bedrock-agentcore-browser-DwDSP_YL.js";
|
|
6
|
+
import { c as CloudflareBrowserClient, l as plainTextFromHtml, p as cloudflareBrowserClientAuthSchema } from "../../cloudflare-browser-D-HT43hu.js";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
//#region src/modules/browser/contracts.ts
|
|
9
9
|
const agentCoreBrowserSeamAuthSchema = bedrockAgentCoreBrowserAuthSchema.extend({ provider: z.literal("bedrock-agentcore") });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as defineModule, r as defineTool } from "../../define-ieoksEQ0.js";
|
|
2
2
|
import { n as requireAuth } from "../../provider-CgDAlg6K.js";
|
|
3
|
-
import { _ as MAX_COMMAND_CHARS, g as MAX_CODE_CHARS, m as BedrockAgentCoreCodeInterpreterClient, x as bedrockAgentCoreCodeInterpreterAuthSchema, y as MAX_FILE_TEXT } from "../../bedrock-agentcore-code-interpreter-
|
|
4
|
-
import { F as cloudflareSandboxAuthSchema, v as CloudflareSandboxClient } from "../../cloudflare-sandbox-
|
|
3
|
+
import { _ as MAX_COMMAND_CHARS, g as MAX_CODE_CHARS, m as BedrockAgentCoreCodeInterpreterClient, x as bedrockAgentCoreCodeInterpreterAuthSchema, y as MAX_FILE_TEXT } from "../../bedrock-agentcore-code-interpreter-F0dnrAm4.js";
|
|
4
|
+
import { F as cloudflareSandboxAuthSchema, v as CloudflareSandboxClient } from "../../cloudflare-sandbox-6nX5lIev.js";
|
|
5
5
|
import { isPlainObject, isString } from "es-toolkit";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
//#region src/modules/code-sandbox/contracts.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as defineModule, r as defineTool } from "../../define-ieoksEQ0.js";
|
|
2
2
|
import { n as requireAuth } from "../../provider-CgDAlg6K.js";
|
|
3
|
-
import { S as textractStatusInputSchema, _ as textractExtractResultSchema, a as TextractClient, b as textractExtractTextInputSchema, f as MAX_INLINE_EXTRACT_CHARS, h as textractAuthSchema, u as MAX_BATCH_EXTRACT, v as textractExtractTextBatchInputSchema, x as textractOutputModeSchema, y as textractExtractTextBatchOutputSchema } from "../../textract-
|
|
3
|
+
import { S as textractStatusInputSchema, _ as textractExtractResultSchema, a as TextractClient, b as textractExtractTextInputSchema, f as MAX_INLINE_EXTRACT_CHARS, h as textractAuthSchema, u as MAX_BATCH_EXTRACT, v as textractExtractTextBatchInputSchema, x as textractOutputModeSchema, y as textractExtractTextBatchOutputSchema } from "../../textract-2jkPuRiE.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region src/modules/document-extract/contracts.ts
|
|
6
6
|
/** Host auth: vendor credentials + provider discriminator. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as defineModule, r as defineTool } from "../../define-ieoksEQ0.js";
|
|
2
2
|
import { n as requireAuth } from "../../provider-CgDAlg6K.js";
|
|
3
3
|
import { n as runBatchItems, t as batchResultSchema } from "../../batch-Co1ujeAW.js";
|
|
4
|
-
import { _ as cloudflareBrowserRenderScreenshotInputSchema, c as CloudflareBrowserClient, f as cloudflareBrowserAuthSchema, g as cloudflareBrowserRenderPdfInputSchema, h as cloudflareBrowserRenderOutputSchema } from "../../cloudflare-browser-
|
|
4
|
+
import { _ as cloudflareBrowserRenderScreenshotInputSchema, c as CloudflareBrowserClient, f as cloudflareBrowserAuthSchema, g as cloudflareBrowserRenderPdfInputSchema, h as cloudflareBrowserRenderOutputSchema } from "../../cloudflare-browser-D-HT43hu.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
/** Host auth: vendor credentials + provider discriminator. */
|
|
7
7
|
const cloudflareBrowserDocumentRenderAuthSchema = cloudflareBrowserAuthSchema.extend({ provider: z.literal("cloudflare-browser") });
|
|
@@ -3,8 +3,8 @@ import { n as defineModule, r as defineTool } from "../../define-ieoksEQ0.js";
|
|
|
3
3
|
import { n as requireAuth } from "../../provider-CgDAlg6K.js";
|
|
4
4
|
import { n as runBatchItems, t as batchResultSchema } from "../../batch-Co1ujeAW.js";
|
|
5
5
|
import { a as attachmentSchema, i as MAX_EMAIL_BYTES, o as namedAddressSchema, r as MAX_BATCH_EMAILS } from "../../limits-hjrO8zUG.js";
|
|
6
|
-
import { a as cloudflareEmailAuthSchema, i as CloudflareEmailClient } from "../../cloudflare-email-
|
|
7
|
-
import { a as resendAuthSchema, c as resendSendInputSchema, i as ResendClient } from "../../resend-
|
|
6
|
+
import { a as cloudflareEmailAuthSchema, i as CloudflareEmailClient } from "../../cloudflare-email-BLI3z96V.js";
|
|
7
|
+
import { a as resendAuthSchema, c as resendSendInputSchema, i as ResendClient } from "../../resend-A2SnRdQ8.js";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
//#region src/modules/email/contracts.ts
|
|
10
10
|
/**
|
|
@@ -3,7 +3,7 @@ import { n as defineModule, r as defineTool } from "../../define-ieoksEQ0.js";
|
|
|
3
3
|
import { n as requireAuth } from "../../provider-CgDAlg6K.js";
|
|
4
4
|
import { t as artifactRefSchema } from "../../artifact-D064mHfK.js";
|
|
5
5
|
import { n as bytesToBase64, r as bytesToUtf8 } from "../../bytes-BxpimpQx.js";
|
|
6
|
-
import { m as s3AuthSchema, p as S3Client } from "../../s3-
|
|
6
|
+
import { m as s3AuthSchema, p as S3Client } from "../../s3-CoZQRTfe.js";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
//#region src/modules/files/contracts.ts
|
|
9
9
|
/** Max bytes for a single range read through files tools. */
|
|
@@ -2,7 +2,7 @@ import { t as ToolError } from "../../errors-DoSpNHvs.js";
|
|
|
2
2
|
import { n as defineModule, r as defineTool } from "../../define-ieoksEQ0.js";
|
|
3
3
|
import { n as requireAuth } from "../../provider-CgDAlg6K.js";
|
|
4
4
|
import { t as artifactRefSchema } from "../../artifact-D064mHfK.js";
|
|
5
|
-
import { m as s3AuthSchema, p as S3Client } from "../../s3-
|
|
5
|
+
import { m as s3AuthSchema, p as S3Client } from "../../s3-CoZQRTfe.js";
|
|
6
6
|
import { n as extensionFromMediaType, r as mediaTypeFromPath } from "../../content-type-E4_Qdoa0.js";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
import sharp from "sharp";
|
|
@@ -2,13 +2,13 @@ import { t as ToolError } from "../../errors-DoSpNHvs.js";
|
|
|
2
2
|
import { n as defineModule, r as defineTool } from "../../define-ieoksEQ0.js";
|
|
3
3
|
import { n as requireAuth } from "../../provider-CgDAlg6K.js";
|
|
4
4
|
import { n as bytesToBase64, t as base64ToBytes } from "../../bytes-BxpimpQx.js";
|
|
5
|
-
import { m as s3AuthSchema, p as S3Client } from "../../s3-
|
|
5
|
+
import { m as s3AuthSchema, p as S3Client } from "../../s3-CoZQRTfe.js";
|
|
6
6
|
import { n as runBatchItems, t as batchResultSchema } from "../../batch-Co1ujeAW.js";
|
|
7
|
-
import { d as ImessageClient, g as imessageAuthSchema, h as MAX_MEDIA_BYTES, m as isImessageOutcomeUnknown, p as isImessageDefiniteRejection } from "../../imessage-
|
|
7
|
+
import { d as ImessageClient, g as imessageAuthSchema, h as MAX_MEDIA_BYTES, m as isImessageOutcomeUnknown, p as isImessageDefiniteRejection } from "../../imessage-Dsms04rC.js";
|
|
8
8
|
import { n as createTypingPulse, t as createLiveMessage } from "../../transport-B4vn-XiQ.js";
|
|
9
|
-
import { A as slackAuthSchema, C as isSlackOutcomeUnknown, S as isSlackDefiniteRejection, b as SlackClient, w as MAX_MEDIA_BYTES$1 } from "../../slack-
|
|
10
|
-
import { _ as isTeamsOutcomeUnknown, b as teamsAuthSchema, g as isTeamsDefiniteRejection, m as TeamsClient, v as MAX_MEDIA_BYTES$2 } from "../../teams-
|
|
11
|
-
import { _ as isTelegramOutcomeUnknown, b as telegramAuthSchema, g as isTelegramDefiniteRejection, m as TelegramClient, v as MAX_MEDIA_BYTES$3 } from "../../telegram-
|
|
9
|
+
import { A as slackAuthSchema, C as isSlackOutcomeUnknown, S as isSlackDefiniteRejection, b as SlackClient, w as MAX_MEDIA_BYTES$1 } from "../../slack-C9UJ0b61.js";
|
|
10
|
+
import { _ as isTeamsOutcomeUnknown, b as teamsAuthSchema, g as isTeamsDefiniteRejection, m as TeamsClient, v as MAX_MEDIA_BYTES$2 } from "../../teams-NODh3i6U.js";
|
|
11
|
+
import { _ as isTelegramOutcomeUnknown, b as telegramAuthSchema, g as isTelegramDefiniteRejection, m as TelegramClient, v as MAX_MEDIA_BYTES$3 } from "../../telegram-CWMHBeKo.js";
|
|
12
12
|
import { isError } from "es-toolkit";
|
|
13
13
|
import { z } from "zod";
|
|
14
14
|
//#region src/modules/messaging/contracts.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as defineModule, r as defineTool } from "../../define-ieoksEQ0.js";
|
|
2
2
|
import { n as requireAuth } from "../../provider-CgDAlg6K.js";
|
|
3
|
-
import { _ as sqsAuthSchema, c as queueAcknowledgeOutputSchema, d as queueExtendVisibilityInputSchema, f as queueExtendVisibilityOutputSchema, g as queueReceiveOutputSchema, h as queueReceiveInputSchema, l as queueEnqueueInputSchema, m as queueReceiptInputSchema, o as SqsClient, p as queueMessageSchema, u as queueEnqueueOutputSchema } from "../../sqs-
|
|
3
|
+
import { _ as sqsAuthSchema, c as queueAcknowledgeOutputSchema, d as queueExtendVisibilityInputSchema, f as queueExtendVisibilityOutputSchema, g as queueReceiveOutputSchema, h as queueReceiveInputSchema, l as queueEnqueueInputSchema, m as queueReceiptInputSchema, o as SqsClient, p as queueMessageSchema, u as queueEnqueueOutputSchema } from "../../sqs-DxFnfODk.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region src/modules/queue/contracts.ts
|
|
6
6
|
const sqsQueueAuthSchema = sqsAuthSchema.extend({ provider: z.literal("sqs") });
|