terse-types 0.0.76 → 0.0.77
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/dist/ApiRouteBuilder.d.ts +4 -0
- package/dist/ApiRoutes.json +4 -0
- package/dist/AttioRecordFlatten.d.ts +19 -0
- package/dist/AttioRecordFlatten.js +71 -0
- package/dist/Configs.d.ts +31 -1
- package/dist/Configs.js +35 -4
- package/dist/Integrations.d.ts +37 -0
- package/dist/Integrations.js +25 -2
- package/dist/InvalidationKeys.d.ts +1 -0
- package/dist/InvalidationKeys.js +1 -0
- package/dist/OrganizationMetadata.d.ts +6 -0
- package/dist/OrganizationMetadata.js +10 -0
- package/dist/Tools.d.ts +128 -0
- package/dist/Tools.js +26 -1
- package/dist/json-schema/terse-types.schema.json +15994 -0
- package/dist/types.d.ts +64 -0
- package/package.json +1 -1
- package/dist/Events.d.ts +0 -112
- package/dist/Events.js +0 -32
- package/dist/TriggerProjections.d.ts +0 -18
- package/dist/TriggerProjections.js +0 -167
package/dist/ApiRoutes.json
CHANGED
|
@@ -94,6 +94,10 @@
|
|
|
94
94
|
"INTEGRATIONS": "/heyreach/integrations",
|
|
95
95
|
"CAMPAIGNS": "/heyreach/campaigns"
|
|
96
96
|
},
|
|
97
|
+
"RESEND": {
|
|
98
|
+
"INTEGRATIONS": "/resend/integrations",
|
|
99
|
+
"TEMPLATES": "/resend/templates"
|
|
100
|
+
},
|
|
97
101
|
"AGENTS": {
|
|
98
102
|
"LIST": "/agents",
|
|
99
103
|
"RECENT": "/agents/recent",
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Collapses a single Attio value entry (or nested structure) toward primitives /
|
|
3
|
+
* simple objects, matching the shape produced for generated Attio tool outputs.
|
|
4
|
+
*/
|
|
5
|
+
export declare function flattenAttioLeafValue(value: unknown): unknown;
|
|
6
|
+
/**
|
|
7
|
+
* Flattens one attribute’s raw value (often an array of interaction rows from the REST API).
|
|
8
|
+
* @param preferArray When true, keep all entries as an array; when false, use the first entry only.
|
|
9
|
+
*/
|
|
10
|
+
export declare function flattenAttioAttributeValue(rawValue: unknown, preferArray: boolean): unknown;
|
|
11
|
+
/**
|
|
12
|
+
* Flattens `record.values` from Attio’s GET record / webhook enrichment payload.
|
|
13
|
+
*/
|
|
14
|
+
export declare function flattenAttioRecordValues(values: Record<string, unknown>, isMultiValueAttribute: (attributeSlug: string) => boolean): Record<string, unknown>;
|
|
15
|
+
/**
|
|
16
|
+
* Slug-only heuristic when object attribute metadata is unavailable (e.g. Attio webhook triggers).
|
|
17
|
+
* Prefer {@link flattenAttioRecordValues} with object-aware multi-value info from codegen when possible.
|
|
18
|
+
*/
|
|
19
|
+
export declare function isProbablyAttioMultiValueAttributeSlug(attributeSlug: string): boolean;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/** Keys Attio nests on attribute timeline entries (not the semantic payload). */
|
|
2
|
+
const ATTIO_VALUE_METADATA_KEYS = new Set([
|
|
3
|
+
"active_from",
|
|
4
|
+
"active_until",
|
|
5
|
+
"attribute_type",
|
|
6
|
+
"created_by_actor"
|
|
7
|
+
]);
|
|
8
|
+
/**
|
|
9
|
+
* Collapses a single Attio value entry (or nested structure) toward primitives /
|
|
10
|
+
* simple objects, matching the shape produced for generated Attio tool outputs.
|
|
11
|
+
*/
|
|
12
|
+
export function flattenAttioLeafValue(value) {
|
|
13
|
+
if (value === null || value === undefined)
|
|
14
|
+
return value;
|
|
15
|
+
if (Array.isArray(value))
|
|
16
|
+
return value.map(entry => flattenAttioLeafValue(entry));
|
|
17
|
+
if (typeof value !== "object")
|
|
18
|
+
return value;
|
|
19
|
+
const rawObject = value;
|
|
20
|
+
if (typeof rawObject.full_name === "string")
|
|
21
|
+
return rawObject.full_name;
|
|
22
|
+
if (typeof rawObject.email_address === "string")
|
|
23
|
+
return rawObject.email_address;
|
|
24
|
+
if (typeof rawObject.domain === "string")
|
|
25
|
+
return rawObject.domain;
|
|
26
|
+
if (typeof rawObject.phone_number === "string")
|
|
27
|
+
return rawObject.phone_number;
|
|
28
|
+
if ("value" in rawObject)
|
|
29
|
+
return flattenAttioLeafValue(rawObject.value);
|
|
30
|
+
const dataEntries = Object.entries(rawObject).filter(([key]) => !ATTIO_VALUE_METADATA_KEYS.has(key));
|
|
31
|
+
if (dataEntries.length === 0)
|
|
32
|
+
return rawObject;
|
|
33
|
+
if (dataEntries.length === 1)
|
|
34
|
+
return flattenAttioLeafValue(dataEntries[0][1]);
|
|
35
|
+
return Object.fromEntries(dataEntries.map(([key, entryValue]) => [key, flattenAttioLeafValue(entryValue)]));
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Flattens one attribute’s raw value (often an array of interaction rows from the REST API).
|
|
39
|
+
* @param preferArray When true, keep all entries as an array; when false, use the first entry only.
|
|
40
|
+
*/
|
|
41
|
+
export function flattenAttioAttributeValue(rawValue, preferArray) {
|
|
42
|
+
if (!Array.isArray(rawValue))
|
|
43
|
+
return flattenAttioLeafValue(rawValue);
|
|
44
|
+
const flattened = rawValue.map(entry => flattenAttioLeafValue(entry)).filter(entry => entry !== undefined);
|
|
45
|
+
return preferArray ? flattened : flattened[0];
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Flattens `record.values` from Attio’s GET record / webhook enrichment payload.
|
|
49
|
+
*/
|
|
50
|
+
export function flattenAttioRecordValues(values, isMultiValueAttribute) {
|
|
51
|
+
const flattenedValues = {};
|
|
52
|
+
for (const [attributeSlug, rawValue] of Object.entries(values)) {
|
|
53
|
+
flattenedValues[attributeSlug] = flattenAttioAttributeValue(rawValue, isMultiValueAttribute(attributeSlug));
|
|
54
|
+
}
|
|
55
|
+
return flattenedValues;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Slug-only heuristic when object attribute metadata is unavailable (e.g. Attio webhook triggers).
|
|
59
|
+
* Prefer {@link flattenAttioRecordValues} with object-aware multi-value info from codegen when possible.
|
|
60
|
+
*/
|
|
61
|
+
export function isProbablyAttioMultiValueAttributeSlug(attributeSlug) {
|
|
62
|
+
const slug = attributeSlug.toLowerCase();
|
|
63
|
+
return (slug === "email_addresses" ||
|
|
64
|
+
slug === "domains" ||
|
|
65
|
+
slug === "phone_numbers" ||
|
|
66
|
+
slug === "social_profiles" ||
|
|
67
|
+
slug === "links" ||
|
|
68
|
+
slug === "tags" ||
|
|
69
|
+
slug.endsWith("_addresses") ||
|
|
70
|
+
slug.endsWith("_ids"));
|
|
71
|
+
}
|
package/dist/Configs.d.ts
CHANGED
|
@@ -24,7 +24,8 @@ export declare enum ConfigType {
|
|
|
24
24
|
SNOWFLAKE_OUTPUT = "snowflake_output",
|
|
25
25
|
WEBHOOK_INPUT = "webhook_input",
|
|
26
26
|
WEBMONITOR = "webmonitor",
|
|
27
|
-
HEY_REACH_INPUT = "hey_reach_input"
|
|
27
|
+
HEY_REACH_INPUT = "hey_reach_input",
|
|
28
|
+
RESEND_OUTPUT = "resend_output"
|
|
28
29
|
}
|
|
29
30
|
export declare const configTypeEnum: z.ZodEnum<typeof ConfigType>;
|
|
30
31
|
export declare const frequencyUnitSchema: z.ZodEnum<{
|
|
@@ -233,6 +234,14 @@ export declare const HeyReachInputConfigMetadata: {
|
|
|
233
234
|
readonly isInput: true;
|
|
234
235
|
readonly isOutput: false;
|
|
235
236
|
};
|
|
237
|
+
export declare const ResendOutputConfigMetadata: {
|
|
238
|
+
readonly configType: ConfigType.RESEND_OUTPUT;
|
|
239
|
+
readonly name: "Resend";
|
|
240
|
+
readonly description: "Send transactional email using published Resend templates";
|
|
241
|
+
readonly integrationType: IntegrationType.RESEND;
|
|
242
|
+
readonly isInput: false;
|
|
243
|
+
readonly isOutput: true;
|
|
244
|
+
};
|
|
236
245
|
export type ConfigDetailsMap = Record<ConfigType, ConfigDetails>;
|
|
237
246
|
export declare const CONFIG_DETAILS: ConfigDetailsMap;
|
|
238
247
|
export declare const SlackEventType: {
|
|
@@ -939,6 +948,18 @@ export declare class SnowflakeOutputConfig extends BaseConfigInstance<Integratio
|
|
|
939
948
|
isComplete(): boolean;
|
|
940
949
|
formatForAgent(): string;
|
|
941
950
|
}
|
|
951
|
+
export declare const ResendOutputConfigSchema: z.ZodObject<{
|
|
952
|
+
integrationId: z.ZodString;
|
|
953
|
+
integrationType: z.ZodLiteral<IntegrationType.RESEND>;
|
|
954
|
+
configType: z.ZodLiteral<ConfigType.RESEND_OUTPUT>;
|
|
955
|
+
}, z.core.$strip>;
|
|
956
|
+
export type ResendOutputConfigData = z.infer<typeof ResendOutputConfigSchema>;
|
|
957
|
+
export type ResendOutputConfigInstance = ResendOutputConfigData & ConfigBehavior;
|
|
958
|
+
export declare class ResendOutputConfig extends BaseConfigInstance<IntegrationType.RESEND, ConfigType.RESEND_OUTPUT> implements ResendOutputConfigInstance {
|
|
959
|
+
constructor(integrationId: string);
|
|
960
|
+
isComplete(): boolean;
|
|
961
|
+
formatForAgent(): string;
|
|
962
|
+
}
|
|
942
963
|
export declare const WebhookInputConfigSchema: z.ZodObject<{
|
|
943
964
|
integrationId: z.ZodLiteral<"system">;
|
|
944
965
|
integrationType: z.ZodLiteral<IntegrationType.WEBHOOK>;
|
|
@@ -1237,6 +1258,10 @@ export declare const configDataSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
1237
1258
|
readonly LEAD_TAG_UPDATED: "LEAD_TAG_UPDATED";
|
|
1238
1259
|
}>;
|
|
1239
1260
|
campaignIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
1261
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1262
|
+
integrationId: z.ZodString;
|
|
1263
|
+
integrationType: z.ZodLiteral<IntegrationType.RESEND>;
|
|
1264
|
+
configType: z.ZodLiteral<ConfigType.RESEND_OUTPUT>;
|
|
1240
1265
|
}, z.core.$strip>]>;
|
|
1241
1266
|
export type ConfigData = z.infer<typeof configDataSchema>;
|
|
1242
1267
|
/** Configs that can serve as triggers (event sources). */
|
|
@@ -1485,6 +1510,10 @@ export declare const skillConfigDataSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
1485
1510
|
integrationId: z.ZodString;
|
|
1486
1511
|
integrationType: z.ZodLiteral<IntegrationType.SNOWFLAKE>;
|
|
1487
1512
|
configType: z.ZodLiteral<ConfigType.SNOWFLAKE_OUTPUT>;
|
|
1513
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1514
|
+
integrationId: z.ZodString;
|
|
1515
|
+
integrationType: z.ZodLiteral<IntegrationType.RESEND>;
|
|
1516
|
+
configType: z.ZodLiteral<ConfigType.RESEND_OUTPUT>;
|
|
1488
1517
|
}, z.core.$strip>]>;
|
|
1489
1518
|
export type SkillConfigData = z.infer<typeof skillConfigDataSchema>;
|
|
1490
1519
|
export declare function isConfigComplete(config: ConfigData | undefined): boolean;
|
|
@@ -1515,6 +1544,7 @@ export type ConfigMetadataMap = EnsureExhaustiveMetadata<{
|
|
|
1515
1544
|
[ConfigType.WEBHOOK_INPUT]: typeof WebhookInputConfig;
|
|
1516
1545
|
[ConfigType.WEBMONITOR]: typeof WebMonitorConfig;
|
|
1517
1546
|
[ConfigType.HEY_REACH_INPUT]: typeof HeyReachInputConfig;
|
|
1547
|
+
[ConfigType.RESEND_OUTPUT]: typeof ResendOutputConfig;
|
|
1518
1548
|
}>;
|
|
1519
1549
|
export declare const CONFIG_METADATA: ConfigMetadataMap;
|
|
1520
1550
|
export {};
|
package/dist/Configs.js
CHANGED
|
@@ -26,6 +26,7 @@ export var ConfigType;
|
|
|
26
26
|
ConfigType["WEBHOOK_INPUT"] = "webhook_input";
|
|
27
27
|
ConfigType["WEBMONITOR"] = "webmonitor";
|
|
28
28
|
ConfigType["HEY_REACH_INPUT"] = "hey_reach_input";
|
|
29
|
+
ConfigType["RESEND_OUTPUT"] = "resend_output";
|
|
29
30
|
})(ConfigType || (ConfigType = {}));
|
|
30
31
|
export const configTypeEnum = z.enum(ConfigType);
|
|
31
32
|
export const frequencyUnitSchema = z.enum(["hour", "day", "week"]);
|
|
@@ -222,6 +223,14 @@ export const HeyReachInputConfigMetadata = {
|
|
|
222
223
|
isInput: true,
|
|
223
224
|
isOutput: false
|
|
224
225
|
};
|
|
226
|
+
export const ResendOutputConfigMetadata = {
|
|
227
|
+
configType: ConfigType.RESEND_OUTPUT,
|
|
228
|
+
name: "Resend",
|
|
229
|
+
description: "Send transactional email using published Resend templates",
|
|
230
|
+
integrationType: IntegrationType.RESEND,
|
|
231
|
+
isInput: false,
|
|
232
|
+
isOutput: true
|
|
233
|
+
};
|
|
225
234
|
export const CONFIG_DETAILS = {
|
|
226
235
|
[ConfigType.GMAIL]: GmailConfigMetadata,
|
|
227
236
|
[ConfigType.GMAIL_OUTPUT]: GmailOutputConfigMetadata,
|
|
@@ -246,7 +255,8 @@ export const CONFIG_DETAILS = {
|
|
|
246
255
|
[ConfigType.SNOWFLAKE_OUTPUT]: SnowflakeOutputConfigMetadata,
|
|
247
256
|
[ConfigType.WEBHOOK_INPUT]: WebhookInputConfigMetadata,
|
|
248
257
|
[ConfigType.WEBMONITOR]: WebMonitorConfigMetadata,
|
|
249
|
-
[ConfigType.HEY_REACH_INPUT]: HeyReachInputConfigMetadata
|
|
258
|
+
[ConfigType.HEY_REACH_INPUT]: HeyReachInputConfigMetadata,
|
|
259
|
+
[ConfigType.RESEND_OUTPUT]: ResendOutputConfigMetadata
|
|
250
260
|
};
|
|
251
261
|
// MARK: Event Types — specific events within each integration trigger
|
|
252
262
|
export const SlackEventType = {
|
|
@@ -917,6 +927,21 @@ export class SnowflakeOutputConfig extends BaseConfigInstance {
|
|
|
917
927
|
return parts.join("\n");
|
|
918
928
|
}
|
|
919
929
|
}
|
|
930
|
+
export const ResendOutputConfigSchema = ConfigInstanceSchema.extend({
|
|
931
|
+
integrationType: z.literal(IntegrationType.RESEND),
|
|
932
|
+
configType: z.literal(ConfigType.RESEND_OUTPUT)
|
|
933
|
+
});
|
|
934
|
+
export class ResendOutputConfig extends BaseConfigInstance {
|
|
935
|
+
constructor(integrationId) {
|
|
936
|
+
super(integrationId, IntegrationType.RESEND, ConfigType.RESEND_OUTPUT);
|
|
937
|
+
}
|
|
938
|
+
isComplete() {
|
|
939
|
+
return !!this.integrationId;
|
|
940
|
+
}
|
|
941
|
+
formatForAgent() {
|
|
942
|
+
return `Type: Resend Output\nIntegration ID: ${this.integrationId}`;
|
|
943
|
+
}
|
|
944
|
+
}
|
|
920
945
|
export const WebhookInputConfigSchema = ConfigInstanceSchema.extend({
|
|
921
946
|
integrationId: z.literal("system"),
|
|
922
947
|
integrationType: z.literal(IntegrationType.WEBHOOK),
|
|
@@ -1032,7 +1057,8 @@ export const configDataSchema = z.union([
|
|
|
1032
1057
|
SnowflakeOutputConfigSchema,
|
|
1033
1058
|
WebhookInputConfigSchema,
|
|
1034
1059
|
WebMonitorConfigSchema,
|
|
1035
|
-
HeyReachInputConfigSchema
|
|
1060
|
+
HeyReachInputConfigSchema,
|
|
1061
|
+
ResendOutputConfigSchema
|
|
1036
1062
|
]);
|
|
1037
1063
|
/** Configs that can serve as triggers (event sources). */
|
|
1038
1064
|
export const triggerConfigDataSchema = z.union([
|
|
@@ -1063,7 +1089,8 @@ export const skillConfigDataSchema = z.union([
|
|
|
1063
1089
|
MemoryConfigSchema,
|
|
1064
1090
|
WorkOSOutputConfigSchema,
|
|
1065
1091
|
AttioOutputConfigSchema,
|
|
1066
|
-
SnowflakeOutputConfigSchema
|
|
1092
|
+
SnowflakeOutputConfigSchema,
|
|
1093
|
+
ResendOutputConfigSchema
|
|
1067
1094
|
]);
|
|
1068
1095
|
export function isConfigComplete(config) {
|
|
1069
1096
|
if (!config) {
|
|
@@ -1090,6 +1117,7 @@ export function isConfigComplete(config) {
|
|
|
1090
1117
|
case ConfigType.DATADOG:
|
|
1091
1118
|
case ConfigType.WORKOS_OUTPUT:
|
|
1092
1119
|
case ConfigType.SNOWFLAKE_OUTPUT:
|
|
1120
|
+
case ConfigType.RESEND_OUTPUT:
|
|
1093
1121
|
return !!config.integrationId;
|
|
1094
1122
|
case ConfigType.GITHUB:
|
|
1095
1123
|
return (config.repositoryIds?.length ?? 0) > 0;
|
|
@@ -1253,6 +1281,8 @@ export function formatConfigForAgent(config) {
|
|
|
1253
1281
|
}
|
|
1254
1282
|
case ConfigType.SNOWFLAKE_OUTPUT:
|
|
1255
1283
|
return `Type: Snowflake Output\nIntegration ID: ${config.integrationId}`;
|
|
1284
|
+
case ConfigType.RESEND_OUTPUT:
|
|
1285
|
+
return `Type: Resend Output\nIntegration ID: ${config.integrationId}`;
|
|
1256
1286
|
case ConfigType.WEBHOOK_INPUT:
|
|
1257
1287
|
return "Type: Webhook Trigger";
|
|
1258
1288
|
case ConfigType.WEBMONITOR: {
|
|
@@ -1293,5 +1323,6 @@ export const CONFIG_METADATA = {
|
|
|
1293
1323
|
[ConfigType.SNOWFLAKE_OUTPUT]: SnowflakeOutputConfig,
|
|
1294
1324
|
[ConfigType.WEBHOOK_INPUT]: WebhookInputConfig,
|
|
1295
1325
|
[ConfigType.WEBMONITOR]: WebMonitorConfig,
|
|
1296
|
-
[ConfigType.HEY_REACH_INPUT]: HeyReachInputConfig
|
|
1326
|
+
[ConfigType.HEY_REACH_INPUT]: HeyReachInputConfig,
|
|
1327
|
+
[ConfigType.RESEND_OUTPUT]: ResendOutputConfig
|
|
1297
1328
|
};
|
package/dist/Integrations.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import * as z from "zod";
|
|
|
2
2
|
export declare enum IntegrationType {
|
|
3
3
|
GITHUB = "github",
|
|
4
4
|
HEY_REACH = "hey_reach",
|
|
5
|
+
RESEND = "resend",
|
|
5
6
|
GMAIL = "gmail",
|
|
6
7
|
LINEAR = "linear",
|
|
7
8
|
SLACK = "slack",
|
|
@@ -137,6 +138,13 @@ export declare const HeyReachIntegrationMetadata: {
|
|
|
137
138
|
readonly isInput: true;
|
|
138
139
|
readonly isOutput: false;
|
|
139
140
|
};
|
|
141
|
+
export declare const ResendIntegrationMetadata: {
|
|
142
|
+
readonly type: IntegrationType.RESEND;
|
|
143
|
+
readonly name: "Resend";
|
|
144
|
+
readonly description: "Send transactional email using published Resend templates";
|
|
145
|
+
readonly isInput: false;
|
|
146
|
+
readonly isOutput: true;
|
|
147
|
+
};
|
|
140
148
|
export type IntegrationMetadataMap = Record<IntegrationType, IntegrationDetails>;
|
|
141
149
|
export declare const INTEGRATION_METADATA: IntegrationMetadataMap;
|
|
142
150
|
export declare const IntegrationInstanceSchema: z.ZodObject<{
|
|
@@ -169,6 +177,7 @@ export declare const InstallationOptionsSchemas: {
|
|
|
169
177
|
readonly webhook: z.ZodObject<{}, z.core.$strict>;
|
|
170
178
|
readonly webmonitor: z.ZodObject<{}, z.core.$strict>;
|
|
171
179
|
readonly hey_reach: z.ZodObject<{}, z.core.$strict>;
|
|
180
|
+
readonly resend: z.ZodObject<{}, z.core.$strict>;
|
|
172
181
|
};
|
|
173
182
|
export type InstallationOptionsFor<T extends IntegrationType> = z.infer<(typeof InstallationOptionsSchemas)[T]>;
|
|
174
183
|
export declare const SlackIntegrationSchema: z.ZodObject<{
|
|
@@ -212,6 +221,34 @@ export declare const HeyReachIntegrationSchema: z.ZodObject<{
|
|
|
212
221
|
id: z.ZodString;
|
|
213
222
|
}, z.core.$strip>;
|
|
214
223
|
export type HeyReachIntegration = z.infer<typeof HeyReachIntegrationSchema>;
|
|
224
|
+
export declare const ResendIntegrationSchema: z.ZodObject<{
|
|
225
|
+
id: z.ZodString;
|
|
226
|
+
}, z.core.$strip>;
|
|
227
|
+
export type ResendIntegration = z.infer<typeof ResendIntegrationSchema>;
|
|
228
|
+
export declare const ResendTemplateVariableSchema: z.ZodObject<{
|
|
229
|
+
key: z.ZodString;
|
|
230
|
+
type: z.ZodEnum<{
|
|
231
|
+
string: "string";
|
|
232
|
+
number: "number";
|
|
233
|
+
}>;
|
|
234
|
+
fallbackValue: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
235
|
+
}, z.core.$strip>;
|
|
236
|
+
export type ResendTemplateVariable = z.infer<typeof ResendTemplateVariableSchema>;
|
|
237
|
+
export declare const ResendTemplateSchema: z.ZodObject<{
|
|
238
|
+
id: z.ZodString;
|
|
239
|
+
alias: z.ZodNullable<z.ZodString>;
|
|
240
|
+
name: z.ZodString;
|
|
241
|
+
status: z.ZodString;
|
|
242
|
+
variables: z.ZodArray<z.ZodObject<{
|
|
243
|
+
key: z.ZodString;
|
|
244
|
+
type: z.ZodEnum<{
|
|
245
|
+
string: "string";
|
|
246
|
+
number: "number";
|
|
247
|
+
}>;
|
|
248
|
+
fallbackValue: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
249
|
+
}, z.core.$strip>>;
|
|
250
|
+
}, z.core.$strip>;
|
|
251
|
+
export type ResendTemplate = z.infer<typeof ResendTemplateSchema>;
|
|
215
252
|
export declare const LaunchDarklyIntegrationSchema: z.ZodObject<{
|
|
216
253
|
id: z.ZodString;
|
|
217
254
|
email: z.ZodOptional<z.ZodEmail>;
|
package/dist/Integrations.js
CHANGED
|
@@ -4,6 +4,7 @@ export var IntegrationType;
|
|
|
4
4
|
(function (IntegrationType) {
|
|
5
5
|
IntegrationType["GITHUB"] = "github";
|
|
6
6
|
IntegrationType["HEY_REACH"] = "hey_reach";
|
|
7
|
+
IntegrationType["RESEND"] = "resend";
|
|
7
8
|
IntegrationType["GMAIL"] = "gmail";
|
|
8
9
|
IntegrationType["LINEAR"] = "linear";
|
|
9
10
|
IntegrationType["SLACK"] = "slack";
|
|
@@ -133,6 +134,13 @@ export const HeyReachIntegrationMetadata = {
|
|
|
133
134
|
isInput: true,
|
|
134
135
|
isOutput: false
|
|
135
136
|
};
|
|
137
|
+
export const ResendIntegrationMetadata = {
|
|
138
|
+
type: IntegrationType.RESEND,
|
|
139
|
+
name: "Resend",
|
|
140
|
+
description: "Send transactional email using published Resend templates",
|
|
141
|
+
isInput: false,
|
|
142
|
+
isOutput: true
|
|
143
|
+
};
|
|
136
144
|
export const INTEGRATION_METADATA = {
|
|
137
145
|
[IntegrationType.GMAIL]: GmailIntegrationMetadata,
|
|
138
146
|
[IntegrationType.NOTION]: NotionIntegrationMetadata,
|
|
@@ -149,7 +157,8 @@ export const INTEGRATION_METADATA = {
|
|
|
149
157
|
[IntegrationType.SNOWFLAKE]: SnowflakeIntegrationMetadata,
|
|
150
158
|
[IntegrationType.WEBHOOK]: WebhookIntegrationMetadata,
|
|
151
159
|
[IntegrationType.WEBMONITOR]: WebMonitorIntegrationMetadata,
|
|
152
|
-
[IntegrationType.HEY_REACH]: HeyReachIntegrationMetadata
|
|
160
|
+
[IntegrationType.HEY_REACH]: HeyReachIntegrationMetadata,
|
|
161
|
+
[IntegrationType.RESEND]: ResendIntegrationMetadata
|
|
153
162
|
};
|
|
154
163
|
// MARK: Integration Details
|
|
155
164
|
export const IntegrationInstanceSchema = z.object({
|
|
@@ -179,7 +188,8 @@ export const InstallationOptionsSchemas = {
|
|
|
179
188
|
[IntegrationType.SNOWFLAKE]: NoInstallationOptionsSchema,
|
|
180
189
|
[IntegrationType.WEBHOOK]: NoInstallationOptionsSchema,
|
|
181
190
|
[IntegrationType.WEBMONITOR]: NoInstallationOptionsSchema,
|
|
182
|
-
[IntegrationType.HEY_REACH]: NoInstallationOptionsSchema
|
|
191
|
+
[IntegrationType.HEY_REACH]: NoInstallationOptionsSchema,
|
|
192
|
+
[IntegrationType.RESEND]: NoInstallationOptionsSchema
|
|
183
193
|
};
|
|
184
194
|
export const SlackIntegrationSchema = IntegrationInstanceSchema.extend({
|
|
185
195
|
teamId: z.string().optional(),
|
|
@@ -207,6 +217,19 @@ export const PosthogIntegrationSchema = IntegrationInstanceSchema.extend({
|
|
|
207
217
|
orgName: z.string().optional()
|
|
208
218
|
});
|
|
209
219
|
export const HeyReachIntegrationSchema = IntegrationInstanceSchema;
|
|
220
|
+
export const ResendIntegrationSchema = IntegrationInstanceSchema;
|
|
221
|
+
export const ResendTemplateVariableSchema = z.object({
|
|
222
|
+
key: z.string(),
|
|
223
|
+
type: z.enum(["string", "number"]),
|
|
224
|
+
fallbackValue: z.union([z.string(), z.number()]).nullable()
|
|
225
|
+
});
|
|
226
|
+
export const ResendTemplateSchema = z.object({
|
|
227
|
+
id: z.string(),
|
|
228
|
+
alias: z.string().nullable(),
|
|
229
|
+
name: z.string(),
|
|
230
|
+
status: z.string(),
|
|
231
|
+
variables: z.array(ResendTemplateVariableSchema)
|
|
232
|
+
});
|
|
210
233
|
export const LaunchDarklyIntegrationSchema = IntegrationInstanceSchema.extend({
|
|
211
234
|
email: z.email().optional(),
|
|
212
235
|
tokenName: z.string().optional()
|
|
@@ -27,6 +27,7 @@ export declare const workosIntegrationsKey: () => readonly [string];
|
|
|
27
27
|
export declare const attioIntegrationsKey: () => readonly [string];
|
|
28
28
|
export declare const snowflakeIntegrationsKey: () => readonly [string];
|
|
29
29
|
export declare const heyReachIntegrationsKey: () => readonly [string];
|
|
30
|
+
export declare const resendIntegrationsKey: () => readonly [string];
|
|
30
31
|
export declare const attioObjectsKey: (integrationId: string | null | undefined) => readonly [string, string] | null;
|
|
31
32
|
export declare const allRunHistoryKey: (params?: GetRunHistoryParams) => readonly [string, string] | readonly [string];
|
|
32
33
|
export declare const runHistoryKey: (agentId: string, params?: GetRunHistoryParams) => readonly [string, string, string] | readonly [string, string];
|
package/dist/InvalidationKeys.js
CHANGED
|
@@ -73,6 +73,7 @@ export const snowflakeIntegrationsKey = () => {
|
|
|
73
73
|
export const heyReachIntegrationsKey = () => {
|
|
74
74
|
return ["heyReachIntegrations"];
|
|
75
75
|
};
|
|
76
|
+
export const resendIntegrationsKey = () => ["resendIntegrations"];
|
|
76
77
|
export const attioObjectsKey = (integrationId) => {
|
|
77
78
|
if (!integrationId) {
|
|
78
79
|
return null;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const organizationMetadataSchema: z.ZodObject<{
|
|
3
|
+
stripeCustomerId: z.ZodString;
|
|
4
|
+
runExecutionBlocked: z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>, z.ZodTransform<boolean, string | boolean | undefined>>;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
export type OrganizationMetadata = z.infer<typeof organizationMetadataSchema>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// Can be serialized a string, supports deserialization
|
|
3
|
+
const booleanMetadataSchema = z
|
|
4
|
+
.union([z.boolean(), z.string()])
|
|
5
|
+
.optional()
|
|
6
|
+
.transform(value => value === true || value === "true");
|
|
7
|
+
export const organizationMetadataSchema = z.object({
|
|
8
|
+
stripeCustomerId: z.string(),
|
|
9
|
+
runExecutionBlocked: booleanMetadataSchema
|
|
10
|
+
});
|
package/dist/Tools.d.ts
CHANGED
|
@@ -8863,6 +8863,90 @@ export declare const memoryTool: {
|
|
|
8863
8863
|
result: z.ZodString;
|
|
8864
8864
|
}, z.core.$strip>;
|
|
8865
8865
|
};
|
|
8866
|
+
export declare const resendSendTemplateInputSchema: z.ZodObject<{
|
|
8867
|
+
integrationId: z.ZodString;
|
|
8868
|
+
templateId: z.ZodString;
|
|
8869
|
+
to: z.ZodArray<z.ZodEmail>;
|
|
8870
|
+
variables: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
8871
|
+
from: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
8872
|
+
subject: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
8873
|
+
replyTo: z.ZodOptional<z.ZodNullable<z.ZodEmail>>;
|
|
8874
|
+
cc: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEmail>>>;
|
|
8875
|
+
bcc: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEmail>>>;
|
|
8876
|
+
idempotencyKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
8877
|
+
}, z.core.$strip>;
|
|
8878
|
+
export declare const resendSendTemplateOutputSchema: z.ZodObject<{
|
|
8879
|
+
success: z.ZodBoolean;
|
|
8880
|
+
actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
8881
|
+
action: z.ZodString;
|
|
8882
|
+
integration: z.ZodEnum<typeof import("./Integrations.js").IntegrationType>;
|
|
8883
|
+
target: z.ZodString;
|
|
8884
|
+
details: z.ZodString;
|
|
8885
|
+
url: z.ZodOptional<z.ZodString>;
|
|
8886
|
+
step_id: z.ZodOptional<z.ZodString>;
|
|
8887
|
+
type: z.ZodEnum<{
|
|
8888
|
+
error: "error";
|
|
8889
|
+
approve: "approve";
|
|
8890
|
+
create: "create";
|
|
8891
|
+
update: "update";
|
|
8892
|
+
delete: "delete";
|
|
8893
|
+
read: "read";
|
|
8894
|
+
}>;
|
|
8895
|
+
isReadOnly: z.ZodOptional<z.ZodBoolean>;
|
|
8896
|
+
output_items: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
8897
|
+
output_item_id: z.ZodString;
|
|
8898
|
+
output_item_type: z.ZodEnum<typeof import("./Configs.js").ConfigType>;
|
|
8899
|
+
}, z.core.$strip>>>;
|
|
8900
|
+
}, z.core.$strip>>>;
|
|
8901
|
+
emailId: z.ZodString;
|
|
8902
|
+
templateId: z.ZodString;
|
|
8903
|
+
to: z.ZodArray<z.ZodString>;
|
|
8904
|
+
summary: z.ZodString;
|
|
8905
|
+
}, z.core.$strip>;
|
|
8906
|
+
export declare const resendSendTemplateTool: {
|
|
8907
|
+
name: "resend_send_template";
|
|
8908
|
+
description: string;
|
|
8909
|
+
inputSchema: z.ZodObject<{
|
|
8910
|
+
integrationId: z.ZodString;
|
|
8911
|
+
templateId: z.ZodString;
|
|
8912
|
+
to: z.ZodArray<z.ZodEmail>;
|
|
8913
|
+
variables: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
8914
|
+
from: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
8915
|
+
subject: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
8916
|
+
replyTo: z.ZodOptional<z.ZodNullable<z.ZodEmail>>;
|
|
8917
|
+
cc: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEmail>>>;
|
|
8918
|
+
bcc: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEmail>>>;
|
|
8919
|
+
idempotencyKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
8920
|
+
}, z.core.$strip>;
|
|
8921
|
+
outputSchema: z.ZodObject<{
|
|
8922
|
+
success: z.ZodBoolean;
|
|
8923
|
+
actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
8924
|
+
action: z.ZodString;
|
|
8925
|
+
integration: z.ZodEnum<typeof import("./Integrations.js").IntegrationType>;
|
|
8926
|
+
target: z.ZodString;
|
|
8927
|
+
details: z.ZodString;
|
|
8928
|
+
url: z.ZodOptional<z.ZodString>;
|
|
8929
|
+
step_id: z.ZodOptional<z.ZodString>;
|
|
8930
|
+
type: z.ZodEnum<{
|
|
8931
|
+
error: "error";
|
|
8932
|
+
approve: "approve";
|
|
8933
|
+
create: "create";
|
|
8934
|
+
update: "update";
|
|
8935
|
+
delete: "delete";
|
|
8936
|
+
read: "read";
|
|
8937
|
+
}>;
|
|
8938
|
+
isReadOnly: z.ZodOptional<z.ZodBoolean>;
|
|
8939
|
+
output_items: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
8940
|
+
output_item_id: z.ZodString;
|
|
8941
|
+
output_item_type: z.ZodEnum<typeof import("./Configs.js").ConfigType>;
|
|
8942
|
+
}, z.core.$strip>>>;
|
|
8943
|
+
}, z.core.$strip>>>;
|
|
8944
|
+
emailId: z.ZodString;
|
|
8945
|
+
templateId: z.ZodString;
|
|
8946
|
+
to: z.ZodArray<z.ZodString>;
|
|
8947
|
+
summary: z.ZodString;
|
|
8948
|
+
}, z.core.$strip>;
|
|
8949
|
+
};
|
|
8866
8950
|
export declare const ToolDefinitions: {
|
|
8867
8951
|
readonly linear_create_ticket: {
|
|
8868
8952
|
name: "linear_create_ticket";
|
|
@@ -14387,6 +14471,50 @@ export declare const ToolDefinitions: {
|
|
|
14387
14471
|
result: z.ZodString;
|
|
14388
14472
|
}, z.core.$strip>;
|
|
14389
14473
|
};
|
|
14474
|
+
readonly resend_send_template: {
|
|
14475
|
+
name: "resend_send_template";
|
|
14476
|
+
description: string;
|
|
14477
|
+
inputSchema: z.ZodObject<{
|
|
14478
|
+
integrationId: z.ZodString;
|
|
14479
|
+
templateId: z.ZodString;
|
|
14480
|
+
to: z.ZodArray<z.ZodEmail>;
|
|
14481
|
+
variables: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
14482
|
+
from: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
14483
|
+
subject: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
14484
|
+
replyTo: z.ZodOptional<z.ZodNullable<z.ZodEmail>>;
|
|
14485
|
+
cc: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEmail>>>;
|
|
14486
|
+
bcc: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEmail>>>;
|
|
14487
|
+
idempotencyKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
14488
|
+
}, z.core.$strip>;
|
|
14489
|
+
outputSchema: z.ZodObject<{
|
|
14490
|
+
success: z.ZodBoolean;
|
|
14491
|
+
actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
14492
|
+
action: z.ZodString;
|
|
14493
|
+
integration: z.ZodEnum<typeof import("./Integrations.js").IntegrationType>;
|
|
14494
|
+
target: z.ZodString;
|
|
14495
|
+
details: z.ZodString;
|
|
14496
|
+
url: z.ZodOptional<z.ZodString>;
|
|
14497
|
+
step_id: z.ZodOptional<z.ZodString>;
|
|
14498
|
+
type: z.ZodEnum<{
|
|
14499
|
+
error: "error";
|
|
14500
|
+
approve: "approve";
|
|
14501
|
+
create: "create";
|
|
14502
|
+
update: "update";
|
|
14503
|
+
delete: "delete";
|
|
14504
|
+
read: "read";
|
|
14505
|
+
}>;
|
|
14506
|
+
isReadOnly: z.ZodOptional<z.ZodBoolean>;
|
|
14507
|
+
output_items: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
14508
|
+
output_item_id: z.ZodString;
|
|
14509
|
+
output_item_type: z.ZodEnum<typeof import("./Configs.js").ConfigType>;
|
|
14510
|
+
}, z.core.$strip>>>;
|
|
14511
|
+
}, z.core.$strip>>>;
|
|
14512
|
+
emailId: z.ZodString;
|
|
14513
|
+
templateId: z.ZodString;
|
|
14514
|
+
to: z.ZodArray<z.ZodString>;
|
|
14515
|
+
summary: z.ZodString;
|
|
14516
|
+
}, z.core.$strip>;
|
|
14517
|
+
};
|
|
14390
14518
|
};
|
|
14391
14519
|
export type ToolName = keyof typeof ToolDefinitions;
|
|
14392
14520
|
export type ToolDefinitionByName<TName extends ToolName> = (typeof ToolDefinitions)[TName];
|
package/dist/Tools.js
CHANGED
|
@@ -2792,6 +2792,30 @@ export const memoryTool = defineTool({
|
|
|
2792
2792
|
inputSchema: memoryInputSchema,
|
|
2793
2793
|
outputSchema: memoryOutputSchema
|
|
2794
2794
|
});
|
|
2795
|
+
export const resendSendTemplateInputSchema = z.object({
|
|
2796
|
+
integrationId: z.string().describe("Connected Resend integration ID"),
|
|
2797
|
+
templateId: z.string().describe("Published template ID or alias"),
|
|
2798
|
+
to: z.array(z.email()).min(1).max(50).describe("Recipient email addresses"),
|
|
2799
|
+
variables: z.record(z.string(), z.union([z.string(), z.number()])).describe("Template variables keyed exactly as defined by the template"),
|
|
2800
|
+
from: z.string().nullable().optional().describe("Optional sender override; omit when the template defines one"),
|
|
2801
|
+
subject: z.string().nullable().optional().describe("Optional subject override; omit when the template defines one"),
|
|
2802
|
+
replyTo: z.email().nullable().optional().describe("Optional reply-to override"),
|
|
2803
|
+
cc: z.array(z.email()).nullable().optional().describe("Optional CC recipients"),
|
|
2804
|
+
bcc: z.array(z.email()).nullable().optional().describe("Optional BCC recipients"),
|
|
2805
|
+
idempotencyKey: z.string().max(256).nullable().optional().describe("Optional idempotency key, retained by Resend for 24 hours")
|
|
2806
|
+
});
|
|
2807
|
+
export const resendSendTemplateOutputSchema = toolOutputBaseSchema.extend({
|
|
2808
|
+
emailId: z.string(),
|
|
2809
|
+
templateId: z.string(),
|
|
2810
|
+
to: z.array(z.string()),
|
|
2811
|
+
summary: z.string()
|
|
2812
|
+
});
|
|
2813
|
+
export const resendSendTemplateTool = defineTool({
|
|
2814
|
+
name: "resend_send_template",
|
|
2815
|
+
description: "Send a published Resend email template. Supply every required template variable without a fallback value.",
|
|
2816
|
+
inputSchema: resendSendTemplateInputSchema,
|
|
2817
|
+
outputSchema: resendSendTemplateOutputSchema
|
|
2818
|
+
});
|
|
2795
2819
|
export const ToolDefinitions = {
|
|
2796
2820
|
[linearCreateTicketTool.name]: linearCreateTicketTool,
|
|
2797
2821
|
[linearUpdateTicketTool.name]: linearUpdateTicketTool,
|
|
@@ -2873,7 +2897,8 @@ export const ToolDefinitions = {
|
|
|
2873
2897
|
[webExtractTool.name]: webExtractTool,
|
|
2874
2898
|
[webResearchTool.name]: webResearchTool,
|
|
2875
2899
|
[imageEditTool.name]: imageEditTool,
|
|
2876
|
-
[memoryTool.name]: memoryTool
|
|
2900
|
+
[memoryTool.name]: memoryTool,
|
|
2901
|
+
[resendSendTemplateTool.name]: resendSendTemplateTool
|
|
2877
2902
|
};
|
|
2878
2903
|
export const toolsWithIntegrationId = new Set(Object.entries(ToolDefinitions)
|
|
2879
2904
|
.filter(([, def]) => {
|