@agent-native/core 0.177.1 → 0.177.2-nightly-20260908193055

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.
@@ -186,8 +186,8 @@ export declare function createAutomationCallbackHandler(runtime: AutomationRunti
186
186
  duplicate?: undefined;
187
187
  eventId?: undefined;
188
188
  } | {
189
- error?: undefined;
190
189
  accepted: boolean;
191
190
  duplicate: boolean;
192
191
  eventId: string;
192
+ error?: undefined;
193
193
  }>;
@@ -62,11 +62,11 @@ export declare const postAwareness: import("h3").EventHandlerWithFetch<import("h
62
62
  error: string;
63
63
  states?: undefined;
64
64
  } | {
65
+ error?: undefined;
65
66
  states: {
66
67
  clientId: number;
67
68
  state: string;
68
69
  }[];
69
- error?: undefined;
70
70
  }>>;
71
71
  /**
72
72
  * GET /_agent-native/collab/:docId/users
@@ -77,9 +77,9 @@ export declare const getActiveUsers: import("h3").EventHandlerWithFetch<import("
77
77
  error: string;
78
78
  users?: undefined;
79
79
  } | {
80
+ error?: undefined;
80
81
  users: {
81
82
  clientId: number;
82
83
  lastSeen: number;
83
84
  }[];
84
- error?: undefined;
85
85
  }>>;
@@ -13,8 +13,8 @@
13
13
  * Body: { json: any, fieldName?: string, type?: "map"|"array", requestSource?: string }
14
14
  */
15
15
  export declare const postCollabJson: import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
16
- ok?: undefined;
17
16
  error: string;
17
+ ok?: undefined;
18
18
  } | {
19
19
  error?: undefined;
20
20
  ok: boolean;
@@ -1,7 +1,10 @@
1
1
  declare const _default: import("../../action.js").ActionDefinition<{
2
2
  templateId?: string;
3
+ excludeTemplateIds?: string;
3
4
  to?: string;
5
+ excludeTo?: string;
4
6
  from?: string;
7
+ excludeFrom?: string;
5
8
  status?: "failed" | "sent";
6
9
  provider?: string;
7
10
  sinceMs?: unknown;
@@ -4,18 +4,36 @@ import { getAppConfig } from "../../app-config/index.js";
4
4
  import { getRequestOrgId } from "../../server/request-context.js";
5
5
  import { authorizeTransactionalEmailRead } from "../authorize.js";
6
6
  import { listEmailLog } from "../log.js";
7
+ const templateIdListSchema = z.string().transform((value) => value
8
+ .split(",")
9
+ .map((id) => id.trim())
10
+ .filter(Boolean));
7
11
  export default defineAction({
8
- description: "List recent transactional email sends from this app, newest first — the audit trail of every attempted send, including the raw request sent to the mail provider and its raw response. Supports filtering by registered email id, recipient/sender substring, status, provider, and a date range. Use this to answer 'did this email go out' or 'why did this email go to the wrong person'.",
12
+ description: "List recent transactional email sends from this app, newest first — the audit trail of every attempted send, including the raw request sent to the mail provider and its raw response. Supports exact registered email inclusion, comma-separated registered email exclusions, recipient/sender inclusion and exclusion substrings, status, provider, and a date range. Use this to answer 'did this email go out' or 'why did this email go to the wrong person'.",
9
13
  schema: z.object({
10
- templateId: z.string().optional(),
14
+ templateId: z
15
+ .string()
16
+ .optional()
17
+ .describe("Include only this exact registered transactional email ID."),
18
+ excludeTemplateIds: templateIdListSchema
19
+ .optional()
20
+ .describe("Exclude these registered transactional email IDs. For GET requests, provide a comma-separated string such as 'core.magic-link,core.organization-invite'."),
11
21
  to: z
12
22
  .string()
13
23
  .optional()
14
24
  .describe("Substring match against the recipient address."),
25
+ excludeTo: z
26
+ .string()
27
+ .optional()
28
+ .describe("Exclude recipient addresses containing this substring."),
15
29
  from: z
16
30
  .string()
17
31
  .optional()
18
32
  .describe("Substring match against the resolved sender address."),
33
+ excludeFrom: z
34
+ .string()
35
+ .optional()
36
+ .describe("Exclude resolved sender addresses containing this substring."),
19
37
  status: z.enum(["sent", "failed"]).optional(),
20
38
  provider: z.string().optional(),
21
39
  sinceMs: z.coerce
@@ -31,13 +49,16 @@ export default defineAction({
31
49
  }),
32
50
  http: { method: "GET" },
33
51
  authorize: ({ templateId }) => authorizeTransactionalEmailRead(templateId ? [templateId] : []),
34
- run: async ({ templateId, to, from, status, provider, sinceMs, untilMs, limit, offset, }) => ({
52
+ run: async ({ templateId, excludeTemplateIds, to, excludeTo, from, excludeFrom, status, provider, sinceMs, untilMs, limit, offset, }) => ({
35
53
  entries: await listEmailLog({
36
54
  orgId: getRequestOrgId() ?? "",
37
55
  app: getAppConfig().app.slug ?? "unknown",
38
56
  templateId,
57
+ excludeTemplateIds,
39
58
  to,
59
+ excludeTo,
40
60
  from,
61
+ excludeFrom,
41
62
  status,
42
63
  provider,
43
64
  sinceMs,
@@ -64,10 +64,15 @@ export interface ListEmailLogFilters {
64
64
  orgId: string;
65
65
  app: string;
66
66
  templateId?: string;
67
+ excludeTemplateIds?: string[];
67
68
  /** Substring match against the recipient address. */
68
69
  to?: string;
70
+ /** Exclude recipient addresses containing this substring. */
71
+ excludeTo?: string;
69
72
  /** Substring match against the resolved sender address. */
70
73
  from?: string;
74
+ /** Exclude resolved sender addresses containing this substring. */
75
+ excludeFrom?: string;
71
76
  status?: "sent" | "failed";
72
77
  provider?: string;
73
78
  /** Only sends at or after this Unix epoch (ms). */
@@ -103,6 +103,12 @@ export async function getEmailSendStats(since, app, orgId) {
103
103
  }
104
104
  const LOG_COLUMNS = "id, template_id, app, recipient, sender, subject, status, error, provider, " +
105
105
  "request_payload, response_status, response_body, created_at";
106
+ // Address filters are documented as literal substrings; escape the
107
+ // characters LIKE treats as wildcards so an address like `no_reply@x.com`
108
+ // or one containing `%` can't match unrelated rows.
109
+ function escapeLikePattern(value) {
110
+ return value.replace(/[\\%_]/g, (match) => `\\${match}`);
111
+ }
106
112
  /**
107
113
  * Most recent sends for one app, newest first, combinably filtered — modeled
108
114
  * on `queryAuditEvents` so this admin-facing query builds the same way every
@@ -118,14 +124,28 @@ export async function listEmailLog(options) {
118
124
  };
119
125
  if (options.templateId)
120
126
  push("template_id = ?", options.templateId);
127
+ if (options.excludeTemplateIds?.length) {
128
+ // `template_id` is nullable; `NOT IN` evaluates to unknown against NULL,
129
+ // so unregistered/legacy sends must be preserved explicitly.
130
+ where.push(`(template_id IS NULL OR template_id NOT IN (${options.excludeTemplateIds.map(() => "?").join(", ")}))`);
131
+ args.push(...options.excludeTemplateIds);
132
+ }
121
133
  if (options.status)
122
134
  push("status = ?", options.status);
123
135
  if (options.provider)
124
136
  push("provider = ?", options.provider);
125
- if (options.to)
126
- push("recipient LIKE ?", `%${options.to}%`);
127
- if (options.from)
128
- push("sender LIKE ?", `%${options.from}%`);
137
+ if (options.to) {
138
+ push("recipient LIKE ? ESCAPE '\\'", `%${escapeLikePattern(options.to)}%`);
139
+ }
140
+ if (options.excludeTo) {
141
+ push("recipient NOT LIKE ? ESCAPE '\\'", `%${escapeLikePattern(options.excludeTo)}%`);
142
+ }
143
+ if (options.from) {
144
+ push("sender LIKE ? ESCAPE '\\'", `%${escapeLikePattern(options.from)}%`);
145
+ }
146
+ if (options.excludeFrom) {
147
+ push("sender NOT LIKE ? ESCAPE '\\'", `%${escapeLikePattern(options.excludeFrom)}%`);
148
+ }
129
149
  if (typeof options.sinceMs === "number") {
130
150
  push("created_at >= ?", Math.floor(options.sinceMs));
131
151
  }
@@ -297,8 +297,17 @@ declare const messages: {
297
297
  sendLogProvider: string;
298
298
  sendLogResponseStatus: string;
299
299
  sendLogError: string;
300
- sendLogToFilter: string;
301
- sendLogFromFilter: string;
300
+ sendLogTo: string;
301
+ sendLogFrom: string;
302
+ sendLogContainsOperator: string;
303
+ sendLogExcludeOperator: string;
304
+ sendLogContainsPlaceholder: string;
305
+ sendLogExcludePlaceholder: string;
306
+ sendLogAddressFilterLabel: string;
307
+ sendLogRemoveAddressFilter: string;
308
+ sendLogAllTemplates: string;
309
+ sendLogSearchTemplates: string;
310
+ sendLogNoTemplatesFound: string;
302
311
  sendLogAllStatuses: string;
303
312
  sendLogSent: string;
304
313
  sendLogFailed: string;
@@ -303,8 +303,17 @@ const messages = {
303
303
  sendLogProvider: "Provider",
304
304
  sendLogResponseStatus: "Response status",
305
305
  sendLogError: "Error",
306
- sendLogToFilter: "To contains…",
307
- sendLogFromFilter: "From contains…",
306
+ sendLogTo: "To",
307
+ sendLogFrom: "From",
308
+ sendLogContainsOperator: "contains",
309
+ sendLogExcludeOperator: "exclude",
310
+ sendLogContainsPlaceholder: "e.g. name@example.com",
311
+ sendLogExcludePlaceholder: "e.g. @builder.io",
312
+ sendLogAddressFilterLabel: "{{dimension}} {{operator}}",
313
+ sendLogRemoveAddressFilter: "Remove {{filter}}",
314
+ sendLogAllTemplates: "All templates",
315
+ sendLogSearchTemplates: "Search templates…",
316
+ sendLogNoTemplatesFound: "No templates found.",
308
317
  sendLogAllStatuses: "All statuses",
309
318
  sendLogSent: "Sent",
310
319
  sendLogFailed: "Failed",
@@ -11,14 +11,14 @@
11
11
  * DELETE /_agent-native/notifications/:id — delete
12
12
  */
13
13
  export declare function createNotificationsHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<"" | import("./types.js").Notification[] | {
14
+ error?: undefined;
14
15
  count: number;
15
16
  updated?: undefined;
16
- error?: undefined;
17
17
  ok?: undefined;
18
18
  } | {
19
+ error?: undefined;
19
20
  count?: undefined;
20
21
  updated: number;
21
- error?: undefined;
22
22
  ok?: undefined;
23
23
  } | {
24
24
  count?: undefined;
@@ -26,8 +26,8 @@ export declare function createNotificationsHandler(): import("h3").EventHandlerW
26
26
  error: string;
27
27
  ok?: undefined;
28
28
  } | {
29
+ error?: undefined;
29
30
  count?: undefined;
30
31
  updated?: undefined;
31
32
  ok: boolean;
32
- error?: undefined;
33
33
  }>>;
@@ -41,16 +41,16 @@ export declare function createObservabilityHandler(): import("h3").EventHandlerW
41
41
  thumbsUpRate: number;
42
42
  avgEvalScore: number;
43
43
  } | {
44
+ error?: undefined;
44
45
  summary: import("./types.js").TraceSummary;
45
46
  spans: import("./types.js").TraceSpan[];
46
- error?: undefined;
47
47
  id?: undefined;
48
48
  ok?: undefined;
49
49
  } | {
50
+ error?: undefined;
50
51
  summary?: undefined;
51
52
  spans?: undefined;
52
53
  id: string;
53
- error?: undefined;
54
54
  ok?: undefined;
55
55
  } | {
56
56
  summary?: undefined;
@@ -59,9 +59,9 @@ export declare function createObservabilityHandler(): import("h3").EventHandlerW
59
59
  id?: undefined;
60
60
  ok?: undefined;
61
61
  } | {
62
+ error?: undefined;
62
63
  summary?: undefined;
63
64
  spans?: undefined;
64
65
  ok: boolean;
65
- error?: undefined;
66
66
  id?: undefined;
67
67
  }>>;
@@ -15,6 +15,6 @@ export declare function createProgressHandler(): import("h3").EventHandlerWithFe
15
15
  error: string;
16
16
  ok?: undefined;
17
17
  } | {
18
- error?: undefined;
19
18
  ok: boolean;
19
+ error?: undefined;
20
20
  }>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.177.1",
3
+ "version": "0.177.2-nightly-20260908193055",
4
4
  "description": "The agentic application framework for building autonomous agents with intuitive UIs",
5
5
  "homepage": "https://github.com/BuilderIO/agent-native#readme",
6
6
  "bugs": {