@5ss/ai-tools 2.11.4 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +1 -1
  3. package/dist/{aws-service-msttbPrz.js → aws-service-Cn_ozX4X.js} +2 -2
  4. package/dist/{aws-service-msttbPrz.js.map → aws-service-Cn_ozX4X.js.map} +1 -1
  5. package/dist/{bedrock-agentcore-browser-o_oqSPMK.js → bedrock-agentcore-browser-DwDSP_YL.js} +2 -2
  6. package/dist/{bedrock-agentcore-browser-o_oqSPMK.js.map → bedrock-agentcore-browser-DwDSP_YL.js.map} +1 -1
  7. package/dist/{bedrock-agentcore-code-interpreter-D4ERRFj1.js → bedrock-agentcore-code-interpreter-F0dnrAm4.js} +2 -2
  8. package/dist/{bedrock-agentcore-code-interpreter-D4ERRFj1.js.map → bedrock-agentcore-code-interpreter-F0dnrAm4.js.map} +1 -1
  9. package/dist/{cloudflare-browser-nLJdH5nG.js → cloudflare-browser-D-HT43hu.js} +3 -3
  10. package/dist/{cloudflare-browser-nLJdH5nG.js.map → cloudflare-browser-D-HT43hu.js.map} +1 -1
  11. package/dist/{cloudflare-email-CSRq8mRd.js → cloudflare-email-BLI3z96V.js} +2 -2
  12. package/dist/{cloudflare-email-CSRq8mRd.js.map → cloudflare-email-BLI3z96V.js.map} +1 -1
  13. package/dist/{cloudflare-sandbox-Be7SeS4-.js → cloudflare-sandbox-6nX5lIev.js} +3 -3
  14. package/dist/{cloudflare-sandbox-Be7SeS4-.js.map → cloudflare-sandbox-6nX5lIev.js.map} +1 -1
  15. package/dist/{eventbridge-scheduler-BhQaReAz.js → eventbridge-scheduler-CDmO2-Te.js} +2 -2
  16. package/dist/{eventbridge-scheduler-BhQaReAz.js.map → eventbridge-scheduler-CDmO2-Te.js.map} +1 -1
  17. package/dist/http/index.d.ts.map +1 -1
  18. package/dist/http/index.js +2 -2
  19. package/dist/{http-service-DDNCO1s4.js → http-service-BMBIryAL.js} +2 -5
  20. package/dist/http-service-BMBIryAL.js.map +1 -0
  21. package/dist/imessage-Dsms04rC.js +558 -0
  22. package/dist/imessage-Dsms04rC.js.map +1 -0
  23. package/dist/modules/artifacts/index.js +1 -1
  24. package/dist/modules/browser/index.js +2 -2
  25. package/dist/modules/code-sandbox/index.js +2 -2
  26. package/dist/modules/document-extract/index.js +1 -1
  27. package/dist/modules/document-render/index.js +1 -1
  28. package/dist/modules/email/index.js +2 -2
  29. package/dist/modules/files/index.js +1 -1
  30. package/dist/modules/image/index.js +1 -1
  31. package/dist/modules/messaging/index.d.ts +12 -24
  32. package/dist/modules/messaging/index.d.ts.map +1 -1
  33. package/dist/modules/messaging/index.js +27 -42
  34. package/dist/modules/messaging/index.js.map +1 -1
  35. package/dist/modules/queue/index.js +1 -1
  36. package/dist/modules/rag/index.js +2 -2
  37. package/dist/modules/scheduler/index.js +1 -1
  38. package/dist/modules/vector-store/index.js +1 -1
  39. package/dist/modules/web-fetch/index.js +1 -1
  40. package/dist/{pinecone-CNnCFmix.js → pinecone-BvdXAZMi.js} +2 -2
  41. package/dist/{pinecone-CNnCFmix.js.map → pinecone-BvdXAZMi.js.map} +1 -1
  42. package/dist/{qdrant-R_FIcG9d.js → qdrant-D2E2Lxrw.js} +2 -2
  43. package/dist/{qdrant-R_FIcG9d.js.map → qdrant-D2E2Lxrw.js.map} +1 -1
  44. package/dist/{resend-Bu0NFO3h.js → resend-A2SnRdQ8.js} +2 -2
  45. package/dist/{resend-Bu0NFO3h.js.map → resend-A2SnRdQ8.js.map} +1 -1
  46. package/dist/{s3-Dj7Teh-A.js → s3-CoZQRTfe.js} +2 -2
  47. package/dist/{s3-Dj7Teh-A.js.map → s3-CoZQRTfe.js.map} +1 -1
  48. package/dist/{slack-AjJDNnXJ.js → slack-C9UJ0b61.js} +2 -2
  49. package/dist/{slack-AjJDNnXJ.js.map → slack-C9UJ0b61.js.map} +1 -1
  50. package/dist/{sqs-CjyXjasF.js → sqs-DxFnfODk.js} +2 -2
  51. package/dist/{sqs-CjyXjasF.js.map → sqs-DxFnfODk.js.map} +1 -1
  52. package/dist/{supabase-vector-BNoJZuft.js → supabase-vector-DT3qfnt2.js} +2 -2
  53. package/dist/{supabase-vector-BNoJZuft.js.map → supabase-vector-DT3qfnt2.js.map} +1 -1
  54. package/dist/{teams-CvxYLAi5.js → teams-NODh3i6U.js} +2 -2
  55. package/dist/{teams-CvxYLAi5.js.map → teams-NODh3i6U.js.map} +1 -1
  56. package/dist/{telegram-B_-Jljk3.js → telegram-CWMHBeKo.js} +2 -2
  57. package/dist/{telegram-B_-Jljk3.js.map → telegram-CWMHBeKo.js.map} +1 -1
  58. package/dist/{textract-CAfnGvua.js → textract-2jkPuRiE.js} +3 -3
  59. package/dist/{textract-CAfnGvua.js.map → textract-2jkPuRiE.js.map} +1 -1
  60. package/dist/{vector-store-DDiu3XPg.js → vector-store-CDQaQXFV.js} +4 -4
  61. package/dist/{vector-store-DDiu3XPg.js.map → vector-store-CDQaQXFV.js.map} +1 -1
  62. package/dist/vendors/amazon-sp-api/index.d.ts +1 -8
  63. package/dist/vendors/amazon-sp-api/index.d.ts.map +1 -1
  64. package/dist/vendors/amazon-sp-api/index.js +3 -14
  65. package/dist/vendors/amazon-sp-api/index.js.map +1 -1
  66. package/dist/vendors/bedrock-agentcore-browser/index.js +1 -1
  67. package/dist/vendors/bedrock-agentcore-code-interpreter/index.js +1 -1
  68. package/dist/vendors/cloudflare-browser/index.js +1 -1
  69. package/dist/vendors/cloudflare-email/index.js +1 -1
  70. package/dist/vendors/cloudflare-sandbox/index.js +1 -1
  71. package/dist/vendors/eventbridge-scheduler/index.js +1 -1
  72. package/dist/vendors/imessage/index.d.ts +65 -188
  73. package/dist/vendors/imessage/index.d.ts.map +1 -1
  74. package/dist/vendors/imessage/index.js +2 -2
  75. package/dist/vendors/katana/index.d.ts +112 -56
  76. package/dist/vendors/katana/index.d.ts.map +1 -1
  77. package/dist/vendors/katana/index.js +42 -16
  78. package/dist/vendors/katana/index.js.map +1 -1
  79. package/dist/vendors/pinecone/index.js +1 -1
  80. package/dist/vendors/qdrant/index.js +1 -1
  81. package/dist/vendors/resend/index.js +1 -1
  82. package/dist/vendors/s3/index.js +1 -1
  83. package/dist/vendors/slack/index.js +1 -1
  84. package/dist/vendors/sqs/index.js +1 -1
  85. package/dist/vendors/supabase-vector/index.js +1 -1
  86. package/dist/vendors/teams/index.js +1 -1
  87. package/dist/vendors/telegram/index.js +1 -1
  88. package/dist/vendors/textract/index.js +1 -1
  89. package/dist/vendors/woocommerce/index.js +1 -1
  90. package/package.json +2 -18
  91. package/dist/http-service-DDNCO1s4.js.map +0 -1
  92. package/dist/imessage-CofjmONG.js +0 -893
  93. package/dist/imessage-CofjmONG.js.map +0 -1
@@ -0,0 +1,558 @@
1
+ import { t as ToolError } from "./errors-DoSpNHvs.js";
2
+ import { n as defineModule, r as defineTool } from "./define-ieoksEQ0.js";
3
+ import { n as requireAuth } from "./provider-CgDAlg6K.js";
4
+ import { t as HttpService } from "./http-service-BMBIryAL.js";
5
+ import { t as base64ToBytes } from "./bytes-BxpimpQx.js";
6
+ import { isPlainObject, isString } from "es-toolkit";
7
+ import { z } from "zod";
8
+ //#region src/vendors/imessage/contracts.ts
9
+ /**
10
+ * Host auth for the hosted photon-rest-proxy (REST → Spectrum gRPC).
11
+ * Credentials are forwarded per request; the proxy stores nothing.
12
+ *
13
+ * Proxy route map (package client → HTTP):
14
+ * - sendText → POST /v1/send
15
+ * - editText → POST /v1/edit
16
+ * - sendChatAction / stopTyping → POST /v1/typing
17
+ * - setReaction → POST /v1/react
18
+ * - clearReaction → POST /v1/clear-reaction (target message_id + emoji; proxy gap if not yet supported)
19
+ * - unsend → POST /v1/unsend
20
+ * - read → POST /v1/read
21
+ * - sendMedia → POST /v1/media
22
+ * - downloadFile → POST /v1/download (chat_id optional; proxy gap if still required)
23
+ * - ensureChat → POST /v1/ensure-chat (host-only; proxy gap until implemented)
24
+ */
25
+ const imessageAuthSchema = z.object({
26
+ base_url: z.url().describe("Origin of the hosted photon-rest-proxy, for example https://photon-proxy.example.com"),
27
+ project_id: z.string().min(1).describe("Spectrum project id (sent as x-spectrum-project-id)"),
28
+ project_secret: z.string().min(1).describe("Spectrum project secret (sent as x-spectrum-project-secret)"),
29
+ phone: z.string().min(1).optional().describe("Optional default iMessage line phone when the project has multiple lines")
30
+ });
31
+ const imessageChatActionSchema = z.enum([
32
+ "typing",
33
+ "upload_photo",
34
+ "record_video",
35
+ "upload_video",
36
+ "record_voice",
37
+ "upload_voice",
38
+ "upload_document",
39
+ "choose_sticker",
40
+ "find_location",
41
+ "record_video_note",
42
+ "upload_video_note"
43
+ ]);
44
+ const imessageSendTextInputSchema = z.object({
45
+ chat_id: z.string().min(1).describe("iMessage chat guid (e.g. any;-;alice@example.com)"),
46
+ text: z.string().min(1).describe("Message text"),
47
+ phone: z.string().min(1).optional().describe("Optional line phone override for multi-line projects")
48
+ });
49
+ const imessageMessageOutputSchema = z.object({
50
+ message_id: z.string().min(1).describe("Message guid (provider id for journaling)"),
51
+ space_id: z.string().describe("Chat guid (same as chat_id)")
52
+ });
53
+ const imessageEditTextInputSchema = z.object({
54
+ chat_id: z.string().min(1).describe("iMessage chat guid"),
55
+ message_id: z.string().min(1).describe("Message guid to edit"),
56
+ text: z.string().min(1).describe("Replacement text"),
57
+ phone: z.string().min(1).optional().describe("Optional line phone override")
58
+ });
59
+ const imessageSendChatActionInputSchema = z.object({
60
+ chat_id: z.string().min(1).describe("iMessage chat guid"),
61
+ action: imessageChatActionSchema.describe("Chat action; non-typing values map to typing start"),
62
+ phone: z.string().min(1).optional().describe("Optional line phone override")
63
+ });
64
+ const imessageSetReactionInputSchema = z.object({
65
+ chat_id: z.string().min(1).describe("iMessage chat guid"),
66
+ message_id: z.string().min(1).describe("Message guid to react to"),
67
+ emoji: z.string().min(1).max(64).describe("Tapback name (love, like, dislike, laugh, emphasize, question) or an emoji character the channel accepts"),
68
+ phone: z.string().min(1).optional().describe("Optional line phone override")
69
+ });
70
+ const imessageUnsendInputSchema = z.object({
71
+ chat_id: z.string().min(1).describe("iMessage chat guid"),
72
+ message_id: z.string().min(1).describe("Message guid to unsend"),
73
+ phone: z.string().min(1).optional().describe("Optional line phone override")
74
+ });
75
+ const imessageReadInputSchema = z.object({
76
+ chat_id: z.string().min(1).describe("iMessage chat guid"),
77
+ message_id: z.string().min(1).optional().describe("Optional; mark-read may apply to the whole chat (field kept for seam parity)"),
78
+ phone: z.string().min(1).optional().describe("Optional line phone override")
79
+ });
80
+ const imessageOkOutputSchema = z.object({
81
+ ok: z.boolean(),
82
+ space_id: z.string().optional()
83
+ });
84
+ const MAX_MEDIA_BYTES = 20 * 1024 * 1024;
85
+ /**
86
+ * Clear a reaction. `message_id` is the **target** message that was reacted to;
87
+ * `emoji` must match set-reaction. Proxy should clear by target+emoji (not reaction message id).
88
+ */
89
+ const imessageClearReactionInputSchema = z.object({
90
+ chat_id: z.string().min(1).describe("iMessage chat guid"),
91
+ message_id: z.string().min(1).describe("Target message guid that was reacted to"),
92
+ emoji: z.string().min(1).max(64).describe("Same tapback name or emoji used when setting the reaction"),
93
+ phone: z.string().min(1).optional().describe("Optional line phone override")
94
+ });
95
+ const imessageSendMediaInputSchema = z.object({
96
+ chat_id: z.string().min(1).describe("iMessage chat guid"),
97
+ kind: z.enum(["photo", "document"]).describe("Media kind (presentation)"),
98
+ body_base64: z.string().min(1).describe("File body as base64"),
99
+ file_name: z.string().min(1).describe("File name including extension"),
100
+ caption: z.string().optional().describe("Optional caption sent as a follow-up text message"),
101
+ content_type: z.string().optional().describe("Optional MIME type; inferred from file_name when omitted"),
102
+ phone: z.string().min(1).optional().describe("Optional line phone override")
103
+ });
104
+ const imessageDownloadFileInputSchema = z.object({
105
+ file_id: z.string().min(1).describe("Attachment guid (from inbound payload or upload)"),
106
+ file_name: z.string().min(1).optional().describe("Preferred file name for the download result"),
107
+ chat_id: z.string().min(1).optional().describe("Chat guid (optional when proxy can resolve by file_id alone)"),
108
+ phone: z.string().min(1).optional().describe("Optional line phone override")
109
+ });
110
+ const imessageDownloadFileOutputSchema = z.object({
111
+ file_name: z.string(),
112
+ file_size: z.number().optional(),
113
+ body_base64: z.string().describe("Downloaded file body as base64")
114
+ });
115
+ /**
116
+ * Create (or resolve) a chat via proxy POST /v1/ensure-chat (host-only).
117
+ * One address = 1:1; two or more = group.
118
+ */
119
+ const imessageEnsureChatInputSchema = z.object({
120
+ addresses: z.array(z.string().min(1)).min(1).describe("Peer phone number(s) or email(s). One address creates a 1:1 chat; two or more create a group"),
121
+ message: z.string().min(1).optional().describe("Optional opening text sent in the same create call"),
122
+ client_message_id: z.string().min(1).optional().describe("Optional idempotency key for chat creation and the optional opening send"),
123
+ phone: z.string().min(1).optional().describe("Optional line phone override")
124
+ });
125
+ const imessageEnsureChatOutputSchema = z.object({
126
+ chat_id: z.string().min(1).describe("Chat guid for later send, edit, react, or unsend"),
127
+ message_id: z.string().min(1).optional().describe("Guid of the opening message when message was provided and the server returned one")
128
+ });
129
+ //#endregion
130
+ //#region src/vendors/imessage/domain.ts
131
+ /**
132
+ * photon-rest-proxy response parse + failure helpers (no HTTP).
133
+ */
134
+ var ImessageClientError = class extends ToolError {
135
+ failureKind;
136
+ constructor(input) {
137
+ super(input.message, {
138
+ code: mapStatusToToolCode(input.status, input.code),
139
+ retryable: input.failureKind === "outcome_unknown",
140
+ cause: input.cause,
141
+ details: {
142
+ failure_kind: input.failureKind,
143
+ status: input.status,
144
+ proxy_error: input.code
145
+ }
146
+ });
147
+ this.name = "ImessageClientError";
148
+ this.failureKind = input.failureKind;
149
+ }
150
+ };
151
+ function isImessageDefiniteRejection(error) {
152
+ return error instanceof ImessageClientError && error.failureKind === "definite_rejection";
153
+ }
154
+ function isImessageOutcomeUnknown(error) {
155
+ return error instanceof ImessageClientError && error.failureKind === "outcome_unknown";
156
+ }
157
+ function mapStatusToToolCode(status, proxyCode) {
158
+ if (status === 401) return "bad_auth";
159
+ if (status === 403) return "forbidden";
160
+ if (status === 404) return "not_found";
161
+ if (status === 400) return "bad_input";
162
+ if (status === 429) return "rate_limited";
163
+ if (proxyCode === "unauthorized") return "bad_auth";
164
+ if (proxyCode === "message_not_found" || proxyCode === "not_found") return "not_found";
165
+ if (proxyCode === "unsupported" || proxyCode === "not_implemented") return "unsupported";
166
+ return "upstream";
167
+ }
168
+ function isDefiniteStatus(status) {
169
+ return status === 400 || status === 401 || status === 403 || status === 404;
170
+ }
171
+ /** Parse photon-rest-proxy JSON error body or throw on non-2xx. */
172
+ function assertProxyOk(label, status, data) {
173
+ if (status >= 200 && status < 300) return;
174
+ let message = `${label} failed with HTTP ${status}`;
175
+ let code;
176
+ if (isPlainObject(data)) {
177
+ const err = data["error"];
178
+ const detail = data["detail"];
179
+ if (isString(err) && err.length > 0) {
180
+ code = err;
181
+ message = isString(detail) && detail.length > 0 ? `${err}: ${detail}` : err;
182
+ } else if (isString(detail) && detail.length > 0) message = detail;
183
+ }
184
+ throw new ImessageClientError({
185
+ message,
186
+ failureKind: isDefiniteStatus(status) ? "definite_rejection" : "outcome_unknown",
187
+ status,
188
+ ...code && { code }
189
+ });
190
+ }
191
+ function requireString(data, key, label) {
192
+ const value = data[key];
193
+ if (!isString(value) || value.length === 0) throw new ToolError(`iMessage proxy ${label} missing ${key}`, { code: "upstream" });
194
+ return value;
195
+ }
196
+ /** Prefer space_id; accept chat_id alias from newer proxy shapes. */
197
+ function spaceOrChatId(data, label) {
198
+ const spaceId = data["space_id"];
199
+ if (isString(spaceId) && spaceId.length > 0) return spaceId;
200
+ const chatId = data["chat_id"];
201
+ if (isString(chatId) && chatId.length > 0) return chatId;
202
+ throw new ToolError(`iMessage proxy ${label} missing space_id`, { code: "upstream" });
203
+ }
204
+ function parseMessageResult(data, label = "send") {
205
+ if (!isPlainObject(data) || data["ok"] !== true) throw new ToolError(`iMessage proxy returned an unexpected ${label} payload`, { code: "upstream" });
206
+ return {
207
+ space_id: spaceOrChatId(data, label),
208
+ message_id: requireString(data, "message_id", label)
209
+ };
210
+ }
211
+ function parseOkResult(data) {
212
+ if (!isPlainObject(data) || data["ok"] !== true) throw new ToolError("iMessage proxy returned an unexpected ok payload", { code: "upstream" });
213
+ const spaceId = data["space_id"];
214
+ const chatId = data["chat_id"];
215
+ const id = isString(spaceId) && spaceId.length > 0 ? spaceId : isString(chatId) && chatId.length > 0 ? chatId : void 0;
216
+ return {
217
+ ok: true,
218
+ ...id && { space_id: id }
219
+ };
220
+ }
221
+ function parseEnsureChatResult(data) {
222
+ if (!isPlainObject(data) || data["ok"] !== true) throw new ToolError("iMessage proxy returned an unexpected ensure-chat payload", { code: "upstream" });
223
+ const chatId = spaceOrChatId(data, "ensure-chat");
224
+ const messageId = data["message_id"];
225
+ return {
226
+ chat_id: chatId,
227
+ ...isString(messageId) && messageId.length > 0 && { message_id: messageId }
228
+ };
229
+ }
230
+ /** Map messaging-style chat_id to proxy space_id body fields. */
231
+ function spaceBody(chatId, phone, extra = {}) {
232
+ return {
233
+ platform: "imessage",
234
+ ...extra,
235
+ ...chatId && { space_id: chatId },
236
+ ...phone && { phone }
237
+ };
238
+ }
239
+ /** Decode and size-check media base64 for sendMedia. */
240
+ function decodeMediaBody(bodyBase64) {
241
+ let bytes;
242
+ try {
243
+ bytes = base64ToBytes(bodyBase64);
244
+ } catch (error) {
245
+ throw new ToolError("Invalid base64 body", {
246
+ code: "bad_input",
247
+ cause: error
248
+ });
249
+ }
250
+ if (bytes.byteLength === 0) throw new ToolError("Media body must not be empty", { code: "bad_input" });
251
+ if (bytes.byteLength > 20971520) throw new ToolError("Media exceeds 20 MiB limit", {
252
+ code: "too_large",
253
+ details: {
254
+ max_bytes: MAX_MEDIA_BYTES,
255
+ content_length: bytes.byteLength
256
+ }
257
+ });
258
+ }
259
+ /** Build POST /v1/media JSON body (base64 already validated). */
260
+ function mediaBody(input, phone) {
261
+ decodeMediaBody(input.body_base64);
262
+ return spaceBody(input.chat_id, phone, {
263
+ body_base64: input.body_base64,
264
+ file_name: input.file_name,
265
+ ...input.content_type && { mime_type: input.content_type },
266
+ ...input.caption && { caption: input.caption }
267
+ });
268
+ }
269
+ function parseDownloadResult(input, data) {
270
+ if (!isPlainObject(data) || data["ok"] !== true) throw new ToolError("iMessage proxy returned an unexpected download payload", { code: "upstream" });
271
+ const bodyBase64 = data["body_base64"];
272
+ if (!isString(bodyBase64) || bodyBase64.length === 0) throw new ToolError("iMessage proxy download missing body_base64", { code: "upstream" });
273
+ const name = data["file_name"];
274
+ const size = data["file_size"];
275
+ return {
276
+ file_name: input.file_name ?? (isString(name) && name.length > 0 ? name : input.file_id),
277
+ ...typeof size === "number" && Number.isFinite(size) && { file_size: size },
278
+ body_base64: bodyBase64
279
+ };
280
+ }
281
+ //#endregion
282
+ //#region src/vendors/imessage/client.ts
283
+ /**
284
+ * iMessage vendor client via hosted photon-rest-proxy (REST → Spectrum gRPC).
285
+ * Host: `new ImessageClient(auth)`. Agent tools: `fromContext(ctx)`.
286
+ *
287
+ * Workers-safe: only HTTP to the proxy. No Photon SDK / gRPC in this package.
288
+ */
289
+ var ImessageClient = class ImessageClient {
290
+ #http;
291
+ #defaultPhone;
292
+ constructor(auth, options = {}) {
293
+ const parsed = imessageAuthSchema.safeParse(auth);
294
+ if (!parsed.success) throw new ToolError("Invalid iMessage auth credentials", {
295
+ code: "bad_auth",
296
+ details: { issues: parsed.error.issues.map((issue) => issue.message) }
297
+ });
298
+ const { base_url, project_id, project_secret, phone } = parsed.data;
299
+ this.#defaultPhone = phone;
300
+ this.#http = new HttpService({
301
+ ...options,
302
+ baseURL: base_url,
303
+ headers: {
304
+ "Content-Type": "application/json",
305
+ "x-spectrum-project-id": project_id,
306
+ "x-spectrum-project-secret": project_secret
307
+ },
308
+ label: "iMessage"
309
+ });
310
+ }
311
+ static fromContext(ctx) {
312
+ const auth = requireAuth(ctx, imessageAuthSchema);
313
+ return new ImessageClient(auth, {
314
+ ...ctx.fetch && { fetch: ctx.fetch },
315
+ ...ctx.signal && { signal: ctx.signal }
316
+ });
317
+ }
318
+ #phone(override) {
319
+ return override ?? this.#defaultPhone;
320
+ }
321
+ async #post(path, body, label) {
322
+ const res = await this.#http.post(path, body, {
323
+ label,
324
+ noThrow: true
325
+ });
326
+ assertProxyOk(label, res.status, res.data);
327
+ return res.data;
328
+ }
329
+ /**
330
+ * Create a chat (1:1 or group). Host-only; not an agent tool.
331
+ * Proxy: POST /v1/ensure-chat (fill on proxy if not yet shipped).
332
+ */
333
+ async ensureChat(input) {
334
+ return parseEnsureChatResult(await this.#post("/v1/ensure-chat", spaceBody(void 0, this.#phone(input.phone), {
335
+ addresses: input.addresses,
336
+ ...input.message && { message: input.message },
337
+ ...input.client_message_id && { client_message_id: input.client_message_id }
338
+ }), "iMessage ensureChat"));
339
+ }
340
+ /** POST /v1/send */
341
+ async sendText(input) {
342
+ return parseMessageResult(await this.#post("/v1/send", spaceBody(input.chat_id, this.#phone(input.phone), { text: input.text }), "iMessage send"), "send");
343
+ }
344
+ /** POST /v1/edit */
345
+ async editText(input) {
346
+ const data = await this.#post("/v1/edit", spaceBody(input.chat_id, this.#phone(input.phone), {
347
+ message_id: input.message_id,
348
+ text: input.text
349
+ }), "iMessage edit");
350
+ if (isPlainObject(data) && data["ok"] === true && isString(data["message_id"]) && data["message_id"].length > 0) return parseMessageResult(data, "edit");
351
+ return {
352
+ space_id: parseOkResult(data).space_id ?? input.chat_id,
353
+ message_id: input.message_id
354
+ };
355
+ }
356
+ /**
357
+ * POST /v1/typing.
358
+ * Non-typing chat actions map to typing start (presentation parity with other channels).
359
+ */
360
+ async sendChatAction(input) {
361
+ await this.#post("/v1/typing", spaceBody(input.chat_id, this.#phone(input.phone), { action: "start" }), "iMessage typing");
362
+ }
363
+ /** Stop typing indicator. */
364
+ async stopTyping(input) {
365
+ await this.#post("/v1/typing", spaceBody(input.chat_id, this.#phone(input.phone), { action: "stop" }), "iMessage typing stop");
366
+ }
367
+ /** POST /v1/react — returns reaction/message guid for journaling. */
368
+ async setReaction(input) {
369
+ return parseMessageResult(await this.#post("/v1/react", spaceBody(input.chat_id, this.#phone(input.phone), {
370
+ message_id: input.message_id,
371
+ emoji: input.emoji
372
+ }), "iMessage react"), "react");
373
+ }
374
+ /**
375
+ * POST /v1/clear-reaction.
376
+ * Package contract: target message_id + emoji (same as setReaction).
377
+ * Proxy should clear by target+emoji; older proxies that only accept reaction message ids need a gap fill.
378
+ */
379
+ async clearReaction(input) {
380
+ await this.#post("/v1/clear-reaction", spaceBody(input.chat_id, this.#phone(input.phone), {
381
+ message_id: input.message_id,
382
+ emoji: input.emoji
383
+ }), "iMessage clearReaction");
384
+ }
385
+ /** POST /v1/unsend */
386
+ async unsend(input) {
387
+ await this.#post("/v1/unsend", spaceBody(input.chat_id, this.#phone(input.phone), { message_id: input.message_id }), "iMessage unsend");
388
+ }
389
+ /** POST /v1/read */
390
+ async read(input) {
391
+ await this.#post("/v1/read", spaceBody(input.chat_id, this.#phone(input.phone), { ...input.message_id && { message_id: input.message_id } }), "iMessage read");
392
+ }
393
+ /** POST /v1/media */
394
+ async sendMedia(input) {
395
+ return parseMessageResult(await this.#post("/v1/media", mediaBody(input, this.#phone(input.phone)), "iMessage sendMedia"), "media");
396
+ }
397
+ /**
398
+ * POST /v1/download.
399
+ * Prefer attachment guid alone; pass chat_id when the proxy still requires a space.
400
+ */
401
+ async downloadFile(input) {
402
+ return parseDownloadResult(input, await this.#post("/v1/download", spaceBody(input.chat_id, this.#phone(input.phone), { file_id: input.file_id }), "iMessage downloadFile"));
403
+ }
404
+ async answerCallback(_input) {}
405
+ };
406
+ //#endregion
407
+ //#region src/vendors/imessage/module.ts
408
+ const imessageSendTextTool = defineTool({
409
+ id: "imessage-send-text",
410
+ name: "imessageSendText",
411
+ description: "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.",
412
+ inputSchema: imessageSendTextInputSchema,
413
+ outputSchema: imessageMessageOutputSchema,
414
+ sideEffect: "send",
415
+ runtime: "both",
416
+ network: true,
417
+ execute: async (input, ctx) => ImessageClient.fromContext(ctx).sendText(input)
418
+ });
419
+ const imessageEditTextTool = defineTool({
420
+ id: "imessage-edit-text",
421
+ name: "imessageEditText",
422
+ description: "Edit the text of a previously sent iMessage. Requires chat guid and message guid.",
423
+ inputSchema: imessageEditTextInputSchema,
424
+ outputSchema: imessageMessageOutputSchema,
425
+ sideEffect: "write",
426
+ runtime: "both",
427
+ network: true,
428
+ execute: async (input, ctx) => ImessageClient.fromContext(ctx).editText(input)
429
+ });
430
+ const imessageSendChatActionTool = defineTool({
431
+ id: "imessage-send-chat-action",
432
+ name: "imessageSendChatAction",
433
+ description: "Show a typing indicator in an iMessage chat while a response is being prepared.",
434
+ inputSchema: imessageSendChatActionInputSchema,
435
+ outputSchema: imessageOkOutputSchema,
436
+ sideEffect: "none",
437
+ runtime: "both",
438
+ network: true,
439
+ execute: async (input, ctx) => {
440
+ await ImessageClient.fromContext(ctx).sendChatAction(input);
441
+ return {
442
+ ok: true,
443
+ space_id: input.chat_id
444
+ };
445
+ }
446
+ });
447
+ const imessageSetReactionTool = defineTool({
448
+ id: "imessage-set-reaction",
449
+ name: "imessageSetReaction",
450
+ description: "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.",
451
+ inputSchema: imessageSetReactionInputSchema,
452
+ outputSchema: imessageMessageOutputSchema,
453
+ sideEffect: "write",
454
+ runtime: "both",
455
+ network: true,
456
+ execute: async (input, ctx) => ImessageClient.fromContext(ctx).setReaction(input)
457
+ });
458
+ const imessageClearReactionTool = defineTool({
459
+ id: "imessage-clear-reaction",
460
+ name: "imessageClearReaction",
461
+ description: "Clear an iMessage reaction. message_id is the target message that was reacted to; emoji must match set-reaction (tapback name or emoji character).",
462
+ inputSchema: imessageClearReactionInputSchema,
463
+ outputSchema: imessageOkOutputSchema,
464
+ sideEffect: "delete",
465
+ runtime: "both",
466
+ network: true,
467
+ execute: async (input, ctx) => {
468
+ await ImessageClient.fromContext(ctx).clearReaction(input);
469
+ return {
470
+ ok: true,
471
+ space_id: input.chat_id
472
+ };
473
+ }
474
+ });
475
+ const imessageUnsendTool = defineTool({
476
+ id: "imessage-unsend",
477
+ name: "imessageUnsend",
478
+ description: "Unsend a previously sent iMessage using its chat guid and message guid.",
479
+ inputSchema: imessageUnsendInputSchema,
480
+ outputSchema: imessageOkOutputSchema,
481
+ sideEffect: "delete",
482
+ runtime: "both",
483
+ network: true,
484
+ execute: async (input, ctx) => {
485
+ await ImessageClient.fromContext(ctx).unsend(input);
486
+ return {
487
+ ok: true,
488
+ space_id: input.chat_id
489
+ };
490
+ }
491
+ });
492
+ const imessageReadTool = defineTool({
493
+ id: "imessage-read",
494
+ name: "imessageRead",
495
+ description: "Mark an iMessage conversation as read (whole chat).",
496
+ inputSchema: imessageReadInputSchema,
497
+ outputSchema: imessageOkOutputSchema,
498
+ sideEffect: "write",
499
+ runtime: "both",
500
+ network: true,
501
+ execute: async (input, ctx) => {
502
+ await ImessageClient.fromContext(ctx).read(input);
503
+ return {
504
+ ok: true,
505
+ space_id: input.chat_id
506
+ };
507
+ }
508
+ });
509
+ const imessageSendMediaTool = defineTool({
510
+ id: "imessage-send-media",
511
+ name: "imessageSendMedia",
512
+ description: "Upload and send one photo or document to an iMessage chat from base64 bytes. Optional caption is sent as a follow-up text message.",
513
+ inputSchema: imessageSendMediaInputSchema,
514
+ outputSchema: imessageMessageOutputSchema,
515
+ sideEffect: "send",
516
+ runtime: "both",
517
+ network: true,
518
+ execute: async (input, ctx) => ImessageClient.fromContext(ctx).sendMedia(input)
519
+ });
520
+ const imessageDownloadFileTool = defineTool({
521
+ id: "imessage-download-file",
522
+ name: "imessageDownloadFile",
523
+ description: "Download attachment bytes by attachment guid (file_id from inbound or upload).",
524
+ inputSchema: imessageDownloadFileInputSchema,
525
+ outputSchema: imessageDownloadFileOutputSchema,
526
+ sideEffect: "none",
527
+ runtime: "both",
528
+ network: true,
529
+ execute: async (input, ctx) => ImessageClient.fromContext(ctx).downloadFile(input)
530
+ });
531
+ const imessageModule = defineModule({
532
+ id: "imessage",
533
+ title: "iMessage",
534
+ description: "iMessage tools for sending and editing text or media, typing indicators, reactions, unsend, read state, and attachment download via a bound photon-rest-proxy.",
535
+ runtime: "both",
536
+ auth: {
537
+ type: "custom",
538
+ schema: imessageAuthSchema
539
+ },
540
+ categories: ["messaging", "chat"],
541
+ classification: "pii",
542
+ tags: ["imessage", "photon"],
543
+ tools: [
544
+ imessageSendTextTool,
545
+ imessageEditTextTool,
546
+ imessageSendChatActionTool,
547
+ imessageSetReactionTool,
548
+ imessageClearReactionTool,
549
+ imessageUnsendTool,
550
+ imessageReadTool,
551
+ imessageSendMediaTool,
552
+ imessageDownloadFileTool
553
+ ]
554
+ });
555
+ //#endregion
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
+
558
+ //# sourceMappingURL=imessage-Dsms04rC.js.map
@@ -0,0 +1 @@
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,0EAA0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,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"}
@@ -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-Dj7Teh-A.js";
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";