@agent-native/core 0.192.0 → 0.192.1-nightly-20260926144920

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 (82) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/templates/calendar/actions/cancel-booking.ts +12 -4
  3. package/corpus/templates/calendar/actions/list-bookings.ts +23 -2
  4. package/corpus/templates/calendar/actions/list-events.ts +42 -29
  5. package/corpus/templates/calendar/actions/update-booking-link.ts +27 -1
  6. package/corpus/templates/calendar/app/hooks/use-bookings.ts +9 -2
  7. package/corpus/templates/calendar/app/i18n/en-US.ts +8 -0
  8. package/corpus/templates/calendar/app/lib/booking-sorting.ts +7 -0
  9. package/corpus/templates/calendar/app/lib/event-colors.ts +29 -4
  10. package/corpus/templates/calendar/app/pages/BookingsList.tsx +99 -19
  11. package/corpus/templates/calendar/app/pages/CalendarView.tsx +5 -11
  12. package/corpus/templates/calendar/app/pages/ManageBookingPage.tsx +5 -0
  13. package/corpus/templates/calendar/changelog/2026-09-25-ambiguous-zoom-bookings-need-review.md +6 -0
  14. package/corpus/templates/calendar/changelog/2026-09-25-bookings-list-shows-newest-bookings-first.md +6 -0
  15. package/corpus/templates/calendar/changelog/2026-09-25-canceling-a-booking-now-resolves-its-zoom-meeting-first.md +6 -0
  16. package/corpus/templates/calendar/changelog/2026-09-25-colleague-events-use-sidebar-colors.md +6 -0
  17. package/corpus/templates/calendar/changelog/2026-09-25-public-booking-pages-reject-malformed-meeting-settings-befor.md +6 -0
  18. package/corpus/templates/calendar/changelog/2026-09-25-shared-booking-cancellations-require-editor-access-and-unres.md +6 -0
  19. package/corpus/templates/calendar/server/db/schema.ts +5 -0
  20. package/corpus/templates/calendar/server/handlers/availability.ts +32 -29
  21. package/corpus/templates/calendar/server/handlers/bookings.ts +189 -62
  22. package/corpus/templates/calendar/server/lib/booking-link-utils.ts +46 -1
  23. package/corpus/templates/calendar/server/lib/zoom.ts +66 -1
  24. package/corpus/templates/calendar/server/plugins/db.ts +13 -0
  25. package/corpus/templates/calendar/shared/api.ts +4 -0
  26. package/corpus/templates/clips/app/components/capture-install-options.tsx +9 -6
  27. package/corpus/templates/clips/app/components/clips-command-menu.tsx +4 -0
  28. package/corpus/templates/clips/app/i18n/en-US.ts +5 -4
  29. package/corpus/templates/clips/app/routes/_app.settings._index.tsx +4 -0
  30. package/corpus/templates/clips/app/routes/share.$shareId.tsx +7 -33
  31. package/corpus/templates/clips/changelog/2026-09-26-desktop-platform-icon.md +6 -0
  32. package/corpus/templates/clips/changelog/2026-09-26-the-empty-comments-state-now-explains-how-screen-recordings-.md +6 -0
  33. package/corpus/templates/clips/changelog/2026-09-26-the-empty-comments-view-has-a-clearer-headline-and-a-focused.md +6 -0
  34. package/corpus/templates/design/.generated/bridge/editor-chrome.generated.ts +26 -2
  35. package/corpus/templates/design/app/components/design/DesignCanvas.tsx +74 -40
  36. package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +64 -42
  37. package/corpus/templates/design/app/components/design/design-canvas/creation.ts +1 -0
  38. package/corpus/templates/design/app/components/design/multi-screen/types.ts +5 -2
  39. package/corpus/templates/design/app/pages/design-editor/commands/duplicate-screen.ts +56 -25
  40. package/corpus/templates/design/app/routes/design-systems.tsx +2 -4
  41. package/corpus/templates/design/app/routes/design.$id.tsx +2 -1
  42. package/corpus/templates/design/app/routes/public-design-meta.ts +0 -39
  43. package/corpus/templates/design/app/routes/templates.tsx +2 -4
  44. package/corpus/templates/design/app/routes/visual-edit_.$id.tsx +2 -1
  45. package/corpus/templates/design/changelog/2026-09-25-escape-finishes-open-pen-paths.md +7 -0
  46. package/corpus/templates/design/changelog/2026-09-25-pen-paths-remain-available-after-save-failures-and-retries-k.md +6 -0
  47. package/corpus/templates/design/changelog/2026-09-25-pen-retries-keep-extending-the-selected-vector-after-a-save-.md +6 -0
  48. package/corpus/templates/design/changelog/2026-09-25-pressing-enter-finishes-a-new-pen-path-and-selects-its-vector-on-move.md +6 -0
  49. package/corpus/templates/design/changelog/2026-09-26-cmd-d-places-screen-duplicates-in-the-next-open-slot.md +6 -0
  50. package/corpus/templates/design/changelog/2026-09-26-dropping-a-layer-beside-a-sibling-keeps-that-insertion-point.md +6 -0
  51. package/corpus/templates/design/changelog/2026-09-26-layers-dragged-out-of-frames-now-land-at-the-board-level-and.md +6 -0
  52. package/corpus/templates/design/changelog/2026-09-26-opening-shared-designs-no-longer-fails-during-client-startup.md +6 -0
  53. package/corpus/templates/design/package.json +1 -1
  54. package/corpus/templates/design/scripts/check-client-server-boundary.ts +55 -0
  55. package/corpus/templates/design/server/lib/public-design-meta.server.ts +40 -0
  56. package/corpus/templates/mail/app/components/email/EmailListItem.tsx +11 -9
  57. package/corpus/templates/mail/app/components/email/EmailThread.tsx +9 -1
  58. package/corpus/templates/mail/app/components/layout/AppLayout.tsx +2 -2
  59. package/corpus/templates/mail/app/components/settings/AiFilterSection.tsx +25 -2
  60. package/corpus/templates/mail/app/hooks/use-emails.ts +159 -27
  61. package/corpus/templates/mail/app/i18n/en-US.ts +2 -1
  62. package/corpus/templates/mail/app/lib/label-display.ts +6 -0
  63. package/corpus/templates/mail/app/pages/InboxPage.tsx +5 -0
  64. package/corpus/templates/mail/changelog/2026-09-26-fixed-importance-actions-label-display-and-triage-loading-fe.md +6 -0
  65. package/corpus/templates/mail/changelog/2026-09-26-mail-cancels-stale-thread-read-cooldown-retries-after-a-newe.md +6 -0
  66. package/corpus/templates/mail/server/lib/google-api.ts +12 -7
  67. package/corpus/templates/slides/app/i18n/en-US.ts +0 -1
  68. package/corpus/templates/slides/app/pages/Index.tsx +1 -29
  69. package/corpus/templates/slides/changelog/2026-09-26-create-decks-from-the-prompt-without-a-separate-new-deck-button.md +6 -0
  70. package/corpus/templates/tasks/.agents/skills/agent-watchdog/SKILL.md +7 -2
  71. package/dist/client/settings/UsageSection.js +18 -5
  72. package/dist/client/settings/recent-prompt-groups.d.ts +12 -0
  73. package/dist/client/settings/recent-prompt-groups.js +20 -0
  74. package/dist/client/use-action.js +7 -0
  75. package/dist/observability/routes.d.ts +5 -5
  76. package/dist/progress/routes.d.ts +1 -1
  77. package/dist/provider-api/actions/custom-provider-registration.d.ts +14 -14
  78. package/dist/provider-api/actions/provider-api.d.ts +13 -13
  79. package/dist/secrets/routes.d.ts +3 -3
  80. package/dist/server/action-routes.js +25 -2
  81. package/dist/server/agent-engine-ollama-models-route.d.ts +2 -2
  82. package/package.json +3 -3
@@ -12,6 +12,7 @@ import { withBuilderUtmTrackingParams } from "../../shared/builder-link-tracking
12
12
  import { BuilderReferralInviteRow } from "../BuilderReferralInviteRow.js";
13
13
  import { useT } from "../i18n.js";
14
14
  import { useActionMutation, useActionQuery } from "../use-action.js";
15
+ import { groupRecentPrompts, } from "./recent-prompt-groups.js";
15
16
  const builderAddCreditsUrl = withBuilderUtmTrackingParams("https://builder.io/account/subscription?signupSource=agent-native", { content: "usage_credit_balance" });
16
17
  const LOOKBACKS = [
17
18
  { value: 7, label: "7d" },
@@ -110,21 +111,33 @@ function appLabel(value) {
110
111
  return normalized.replace(/\b\w/g, (letter) => letter.toUpperCase());
111
112
  }
112
113
  function Trend({ daily, billing, }) {
114
+ const t = useT();
113
115
  if (daily.length === 0) {
114
116
  return (_jsx("div", { className: "flex h-32 items-center justify-center rounded-lg border border-dashed border-border/70 text-sm text-muted-foreground", children: "No usage recorded in this lookback." }));
115
117
  }
116
118
  const values = daily.map((day) => usageAmount(day.costCents, billing, day.builderCredits, day.estimatedBuilderCredits));
117
- const max = Math.max(...values, 0.01);
119
+ const max = Math.max(...values, 0);
120
+ const scaleMax = max || 1;
118
121
  const points = values.map((value, index) => {
119
122
  const x = daily.length === 1 ? 50 : (index / (daily.length - 1)) * 100;
120
- const y = 88 - (value / max) * 72;
123
+ const y = 100 - (value / scaleMax) * 100;
121
124
  return `${x.toFixed(2)},${y.toFixed(2)}`;
122
125
  });
123
126
  const line = points
124
127
  .map((point, index) => `${index === 0 ? "M" : "L"} ${point}`)
125
128
  .join(" ");
126
- const area = `${line} L 100,96 L 0,96 Z`;
127
- return (_jsxs("div", { className: "overflow-hidden rounded-lg border border-border/70 bg-muted/20 px-3 pb-2 pt-3", children: [_jsxs("svg", { "aria-label": "Daily usage trend", className: "h-32 w-full text-primary", viewBox: "0 0 100 96", preserveAspectRatio: "none", role: "img", children: [_jsx("path", { d: area, className: "fill-current opacity-10" }), _jsx("path", { d: line, className: "fill-none stroke-current", strokeWidth: "1.5", vectorEffect: "non-scaling-stroke" })] }), _jsxs("div", { className: "flex justify-between text-[11px] text-muted-foreground", children: [_jsx("span", { children: new Date(`${daily[0].date}T00:00:00`).toLocaleDateString(undefined, { month: "short", day: "numeric" }) }), _jsx("span", { children: new Date(`${daily.at(-1).date}T00:00:00`).toLocaleDateString(undefined, { month: "short", day: "numeric" }) })] })] }));
129
+ const area = `${line} L 100,100 L 0,100 Z`;
130
+ const axisLabel = billing.unit === "usd"
131
+ ? "USD"
132
+ : t("agentChat.usage.builderCredits", {
133
+ defaultValue: "Builder credits",
134
+ });
135
+ const axisTicks = [max, max / 2, 0];
136
+ return (_jsx("div", { className: "overflow-hidden rounded-lg border border-border/70 bg-muted/20 px-3 pb-2 pt-3", children: _jsxs("div", { className: "flex gap-2", children: [_jsx("div", { className: "flex h-32 w-3 shrink-0 items-center justify-center", children: _jsx("span", { "aria-hidden": "true", className: "[writing-mode:vertical-rl] rotate-180 whitespace-nowrap text-[10px] text-muted-foreground", children: axisLabel }) }), _jsx("div", { role: "group", "aria-label": axisLabel, className: "flex h-32 w-12 shrink-0 flex-col justify-between text-right text-[10px] tabular-nums text-muted-foreground", children: axisTicks.map((value, index) => (_jsx("span", { children: billing.unit === "usd"
137
+ ? formatUsdCost(value)
138
+ : value.toLocaleString(undefined, {
139
+ maximumFractionDigits: 3,
140
+ }) }, index))) }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("svg", { "aria-label": "Daily usage trend", className: "h-32 w-full text-primary", viewBox: "0 0 100 100", preserveAspectRatio: "none", role: "img", children: [_jsx("path", { d: "M 0 0 H 100 M 0 50 H 100 M 0 100 H 100", className: "fill-none stroke-border/60", strokeWidth: "0.5", vectorEffect: "non-scaling-stroke" }), _jsx("path", { d: area, className: "fill-current opacity-10" }), _jsx("path", { d: line, className: "fill-none stroke-current", strokeWidth: "1.5", vectorEffect: "non-scaling-stroke" })] }), _jsxs("div", { className: "flex justify-between text-[11px] text-muted-foreground", children: [_jsx("span", { children: new Date(`${daily[0].date}T00:00:00`).toLocaleDateString(undefined, { month: "short", day: "numeric" }) }), _jsx("span", { children: new Date(`${daily.at(-1).date}T00:00:00`).toLocaleDateString(undefined, { month: "short", day: "numeric" }) })] })] })] }) }));
128
141
  }
129
142
  function MetricCard({ label, value, detail, accent = false, }) {
130
143
  return (_jsxs("div", { className: "min-w-0 rounded-lg border border-border/70 bg-card px-4 py-4", children: [_jsx("div", { className: "text-xs font-medium text-muted-foreground", children: label }), _jsx("div", { className: `mt-1 truncate text-xl font-semibold tracking-[-0.02em] tabular-nums ${accent ? "text-primary" : "text-foreground"}`, children: value }), _jsx("div", { className: "mt-1 truncate text-xs text-muted-foreground", children: detail })] }));
@@ -339,6 +352,6 @@ export function UsageSection({ appId = null, viewAllHref, }) {
339
352
  costCents: day.otherCostCents ?? 0,
340
353
  calls: day.otherCalls ?? 0,
341
354
  tokens: 0,
342
- })), billing: { unit: "usd", label: "USD" } })] })) : null] }) })] }), _jsxs("details", { className: "group rounded-lg border border-border/70 bg-card", children: [_jsxs("summary", { className: "flex cursor-pointer list-none items-center justify-between gap-3 px-4 py-4 outline-none transition-colors hover:bg-accent/30 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset [&::-webkit-details-marker]:hidden", children: [_jsxs("span", { children: [_jsx("span", { className: "block text-sm font-semibold text-foreground", children: "Top usage drivers" }), _jsx("span", { className: "mt-1 block text-xs text-muted-foreground", children: "Breakdowns stay collapsed until you need them." })] }), _jsx(IconChevronDown, { className: "size-4 text-muted-foreground transition-transform group-open:rotate-180" })] }), _jsxs("div", { className: "grid gap-6 border-t border-border/70 px-4 py-4 md:grid-cols-2", children: [_jsx(DriverList, { title: "By workflow", rows: data.byLabel, billing: billing }), _jsx(DriverList, { title: "By model", rows: data.byModel, billing: billing })] })] }), _jsxs("details", { className: "group rounded-lg border border-border/70 bg-card", children: [_jsxs("summary", { className: "flex cursor-pointer list-none items-center justify-between gap-3 px-4 py-4 outline-none transition-colors hover:bg-accent/30 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset [&::-webkit-details-marker]:hidden", children: [_jsxs("span", { children: [_jsx("span", { className: "block text-sm font-semibold text-foreground", children: "Recent prompts" }), _jsx("span", { className: "mt-1 block text-xs text-muted-foreground", children: "Latest recorded prompts for the selected app and user scope." })] }), _jsxs("span", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [data.recent.length, _jsx(IconChevronDown, { className: "size-4 transition-transform group-open:rotate-180" })] })] }), _jsx("div", { className: "border-t border-border/70", children: data.recent.length === 0 ? (_jsx("p", { className: "px-4 py-5 text-sm text-muted-foreground", children: "No recent prompts recorded." })) : (_jsx("div", { className: "divide-y divide-border/60", children: data.recent.map((entry) => (_jsxs("div", { className: "px-4 py-3", children: [_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2 text-[11px] text-muted-foreground", children: [_jsxs("span", { children: [entry.label, " \u00B7 ", entry.model] }), _jsx("span", { children: entry.ownerEmail })] }), _jsx("p", { className: "mt-1 line-clamp-2 text-sm text-foreground", children: entry.prompt ??
355
+ })), billing: { unit: "usd", label: "USD" } })] })) : null] }) })] }), _jsxs("details", { className: "group rounded-lg border border-border/70 bg-card", children: [_jsxs("summary", { className: "flex cursor-pointer list-none items-center justify-between gap-3 px-4 py-4 outline-none transition-colors hover:bg-accent/30 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset [&::-webkit-details-marker]:hidden", children: [_jsxs("span", { children: [_jsx("span", { className: "block text-sm font-semibold text-foreground", children: "Top usage drivers" }), _jsx("span", { className: "mt-1 block text-xs text-muted-foreground", children: "Breakdowns stay collapsed until you need them." })] }), _jsx(IconChevronDown, { className: "size-4 text-muted-foreground transition-transform group-open:rotate-180" })] }), _jsxs("div", { className: "grid gap-6 border-t border-border/70 px-4 py-4 md:grid-cols-2", children: [_jsx(DriverList, { title: "By workflow", rows: data.byLabel, billing: billing }), _jsx(DriverList, { title: "By model", rows: data.byModel, billing: billing })] })] }), _jsxs("details", { className: "group rounded-lg border border-border/70 bg-card", children: [_jsxs("summary", { className: "flex cursor-pointer list-none items-center justify-between gap-3 px-4 py-4 outline-none transition-colors hover:bg-accent/30 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset [&::-webkit-details-marker]:hidden", children: [_jsxs("span", { children: [_jsx("span", { className: "block text-sm font-semibold text-foreground", children: "Recent prompts" }), _jsx("span", { className: "mt-1 block text-xs text-muted-foreground", children: "Latest recorded prompts for the selected app and user scope." })] }), _jsxs("span", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [data.recent.length, _jsx(IconChevronDown, { className: "size-4 transition-transform group-open:rotate-180" })] })] }), _jsx("div", { className: "border-t border-border/70", children: data.recent.length === 0 ? (_jsx("p", { className: "px-4 py-5 text-sm text-muted-foreground", children: "No recent prompts recorded." })) : (_jsx("div", { className: "divide-y divide-border/60", children: groupRecentPrompts(data.recent).map(({ entry, count }) => (_jsxs("div", { className: "px-4 py-3", children: [_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2 text-[11px] text-muted-foreground", children: [_jsxs("span", { children: [entry.label, " \u00B7 ", entry.model] }), _jsxs("span", { className: "flex items-center gap-2", children: [entry.ownerEmail, count > 1 ? (_jsxs(Badge, { variant: "secondary", children: ["\u00D7", count] })) : null] })] }), _jsx("p", { className: "mt-1 line-clamp-2 text-sm text-foreground", children: entry.prompt ??
343
356
  "Prompt text was not captured for this call." })] }, entry.id))) })) })] }), _jsx(UsageAlertsSection, { appId: appId }), viewAllHref ? (_jsx("div", { className: "flex justify-end", children: _jsx(Button, { asChild: true, variant: "link", size: "sm", className: "gap-1.5", children: _jsxs(Link, { to: viewAllHref, children: ["View all usage", _jsx(IconArrowUpRight, {})] }) }) })) : null] })) : null] }));
344
357
  }
@@ -0,0 +1,12 @@
1
+ export interface RecentPromptEntry {
2
+ id: number;
3
+ ownerEmail: string;
4
+ app: string;
5
+ label: string;
6
+ model: string;
7
+ prompt: string | null;
8
+ }
9
+ export declare function groupRecentPrompts<T extends RecentPromptEntry>(entries: readonly T[]): Array<{
10
+ entry: T;
11
+ count: number;
12
+ }>;
@@ -0,0 +1,20 @@
1
+ export function groupRecentPrompts(entries) {
2
+ const groups = new Map();
3
+ for (const entry of entries) {
4
+ const key = entry.prompt === null
5
+ ? JSON.stringify(["uncaptured", entry.id])
6
+ : JSON.stringify([
7
+ entry.ownerEmail.toLowerCase(),
8
+ entry.app,
9
+ entry.label,
10
+ entry.model,
11
+ entry.prompt,
12
+ ]);
13
+ const group = groups.get(key);
14
+ if (group)
15
+ group.count += 1;
16
+ else
17
+ groups.set(key, { entry, count: 1 });
18
+ }
19
+ return [...groups.values()];
20
+ }
@@ -453,6 +453,13 @@ async function performActionFetch(name, method, params, options) {
453
453
  }
454
454
  const error = new Error(`Action ${name} failed: ${message}`);
455
455
  error.status = res.status;
456
+ const retryAfterHeader = res.headers.get("Retry-After");
457
+ const retryAfterSeconds = retryAfterHeader === null ? NaN : Number(retryAfterHeader);
458
+ if (Number.isInteger(retryAfterSeconds) &&
459
+ retryAfterSeconds > 0 &&
460
+ retryAfterSeconds <= 300) {
461
+ error.retryAfterMs = retryAfterSeconds * 1000;
462
+ }
456
463
  // `message` keeps the "Action <name> failed:" framing, which belongs in a
457
464
  // console but not in a toast. Carry the unframed text separately so a UI
458
465
  // can render it without string-surgery on the prefix.
@@ -41,27 +41,27 @@ export declare function createObservabilityHandler(): import("h3").EventHandlerW
41
41
  thumbsUpRate: number;
42
42
  avgEvalScore: number;
43
43
  } | {
44
- error?: undefined;
45
- ok?: undefined;
46
44
  summary: import("./types.js").TraceSummary;
47
45
  spans: import("./types.js").TraceSpan[];
48
46
  id?: undefined;
49
- } | {
50
47
  error?: undefined;
51
48
  ok?: undefined;
49
+ } | {
52
50
  summary?: undefined;
53
51
  spans?: undefined;
54
52
  id: string;
55
- } | {
53
+ error?: undefined;
56
54
  ok?: undefined;
55
+ } | {
57
56
  summary?: undefined;
58
57
  spans?: undefined;
59
58
  id?: undefined;
60
59
  error: any;
60
+ ok?: undefined;
61
61
  } | {
62
- error?: undefined;
63
62
  summary?: undefined;
64
63
  spans?: undefined;
65
64
  id?: undefined;
65
+ error?: undefined;
66
66
  ok: boolean;
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
  }>>;
@@ -76,8 +76,9 @@ export declare function createCustomProviderRegistrationAction<TSchema extends Z
76
76
  }>>;
77
77
  }, z.core.$strip>>, {
78
78
  id?: undefined;
79
+ message?: undefined;
79
80
  deleted?: undefined;
80
- provider?: undefined;
81
+ found?: undefined;
81
82
  providers: {
82
83
  id: string;
83
84
  label: string;
@@ -88,46 +89,45 @@ export declare function createCustomProviderRegistrationAction<TSchema extends Z
88
89
  updatedAt: number;
89
90
  }[];
90
91
  count: number;
91
- found?: undefined;
92
+ provider?: undefined;
92
93
  registered?: undefined;
93
94
  label?: undefined;
94
- message?: undefined;
95
95
  } | {
96
96
  id?: undefined;
97
- deleted?: undefined;
97
+ message?: undefined;
98
98
  count?: undefined;
99
+ deleted?: undefined;
99
100
  providers?: undefined;
100
101
  found: boolean;
101
102
  provider: import("../custom-registry.js").CustomProviderConfig;
102
103
  registered?: undefined;
103
104
  label?: undefined;
104
- message?: undefined;
105
105
  } | {
106
- deleted?: undefined;
107
- provider?: undefined;
106
+ message?: undefined;
108
107
  count?: undefined;
108
+ deleted?: undefined;
109
109
  providers?: undefined;
110
+ provider?: undefined;
110
111
  found: boolean;
111
112
  id: string;
112
113
  registered?: undefined;
113
114
  label?: undefined;
114
- message?: undefined;
115
115
  } | {
116
- provider?: undefined;
116
+ message?: undefined;
117
117
  count?: undefined;
118
- providers?: undefined;
119
118
  found?: undefined;
119
+ providers?: undefined;
120
+ provider?: undefined;
120
121
  deleted: boolean;
121
122
  id: string;
122
123
  registered?: undefined;
123
124
  label?: undefined;
124
- message?: undefined;
125
125
  } | {
126
- deleted?: undefined;
127
- provider?: undefined;
128
126
  count?: undefined;
129
- providers?: undefined;
127
+ deleted?: undefined;
130
128
  found?: undefined;
129
+ providers?: undefined;
130
+ provider?: undefined;
131
131
  registered: boolean;
132
132
  id: string;
133
133
  label: string;
@@ -311,9 +311,10 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
311
311
  notes?: string | undefined;
312
312
  scope?: "org" | "user" | undefined;
313
313
  }, {
314
- provider?: undefined;
314
+ message?: undefined;
315
315
  id?: undefined;
316
316
  deleted?: undefined;
317
+ found?: undefined;
317
318
  providers: {
318
319
  id: string;
319
320
  label: string;
@@ -324,46 +325,45 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
324
325
  updatedAt: number;
325
326
  }[];
326
327
  count: number;
327
- found?: undefined;
328
+ provider?: undefined;
328
329
  registered?: undefined;
329
330
  label?: undefined;
330
- message?: undefined;
331
331
  } | {
332
+ message?: undefined;
332
333
  id?: undefined;
333
334
  deleted?: undefined;
334
- providers?: undefined;
335
335
  count?: undefined;
336
+ providers?: undefined;
336
337
  found: boolean;
337
338
  provider: import("../custom-registry.js").CustomProviderConfig;
338
339
  registered?: undefined;
339
340
  label?: undefined;
340
- message?: undefined;
341
341
  } | {
342
- provider?: undefined;
342
+ message?: undefined;
343
343
  deleted?: undefined;
344
- providers?: undefined;
345
344
  count?: undefined;
345
+ providers?: undefined;
346
+ provider?: undefined;
346
347
  found: boolean;
347
348
  id: string;
348
349
  registered?: undefined;
349
350
  label?: undefined;
350
- message?: undefined;
351
351
  } | {
352
- provider?: undefined;
353
- providers?: undefined;
352
+ message?: undefined;
354
353
  count?: undefined;
355
354
  found?: undefined;
355
+ providers?: undefined;
356
+ provider?: undefined;
356
357
  deleted: boolean;
357
358
  id: string;
358
359
  registered?: undefined;
359
360
  label?: undefined;
360
- message?: undefined;
361
361
  } | {
362
- provider?: undefined;
363
362
  deleted?: undefined;
364
- providers?: undefined;
365
363
  count?: undefined;
366
364
  found?: undefined;
365
+ providers?: undefined;
366
+ provider?: undefined;
367
367
  registered: boolean;
368
368
  id: string;
369
369
  label: string;
@@ -57,16 +57,16 @@ export declare function createListSecretsHandler(): import("h3").EventHandlerWit
57
57
  /** POST /_agent-native/secrets/:key — write a secret. */
58
58
  export declare function createWriteSecretHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
59
59
  error: string;
60
- status?: undefined;
61
60
  ok?: undefined;
61
+ status?: undefined;
62
62
  } | {
63
63
  ok: boolean;
64
64
  status: string;
65
65
  error?: undefined;
66
66
  } | {
67
+ ok?: undefined;
67
68
  error: string;
68
69
  removed?: undefined;
69
- ok?: undefined;
70
70
  } | {
71
71
  ok: boolean;
72
72
  removed: boolean;
@@ -77,9 +77,9 @@ export declare function createWriteSecretHandler(): import("h3").EventHandlerWit
77
77
  * or the current stored value without changing anything.
78
78
  */
79
79
  export declare function createTestSecretHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
80
+ ok?: undefined;
80
81
  error: string;
81
82
  note?: undefined;
82
- ok?: undefined;
83
83
  } | {
84
84
  ok: boolean;
85
85
  note?: undefined;
@@ -312,7 +312,7 @@ function mountActionRoutesInternal(nitroApp, actions, options) {
312
312
  return handleOptionsRequest(event);
313
313
  }
314
314
  setResponseHeader(event, "Cache-Control", "no-store");
315
- setResponseHeader(event, "Access-Control-Expose-Headers", "X-Agent-Native-Client-Mismatch,X-Agent-Native-Build-Id,X-Agent-Native-Client-Compatibility");
315
+ setResponseHeader(event, "Access-Control-Expose-Headers", "X-Agent-Native-Client-Mismatch,X-Agent-Native-Build-Id,X-Agent-Native-Client-Compatibility,Retry-After");
316
316
  // Browser action calls are RPCs over the framework transport. The
317
317
  // action's HTTP method remains authoritative for direct HTTP callers,
318
318
  // but frontend callers must not have to duplicate it in every hook.
@@ -748,6 +748,18 @@ function mountActionRoutesInternal(nitroApp, actions, options) {
748
748
  // set, otherwise 500.
749
749
  const status = isValidationError ? 400 : (explicitStatus ?? 500);
750
750
  setResponseStatus(event, status);
751
+ const errorDetails = err?.details &&
752
+ typeof err.details === "object" &&
753
+ !Array.isArray(err.details)
754
+ ? err.details
755
+ : undefined;
756
+ const retryAfterSeconds = errorDetails?.retryAfterSeconds;
757
+ if (status === 429 &&
758
+ typeof retryAfterSeconds === "number" &&
759
+ Number.isInteger(retryAfterSeconds) &&
760
+ retryAfterSeconds > 0) {
761
+ setResponseHeader(event, "Retry-After", String(Math.min(retryAfterSeconds, 300)));
762
+ }
751
763
  // Only echo the raw message for known-safe cases:
752
764
  // - validation errors (deterministic, parameter-shape only)
753
765
  // - action contract errors, which `fail()` also raises
@@ -773,7 +785,18 @@ function mountActionRoutesInternal(nitroApp, actions, options) {
773
785
  ? {}
774
786
  : { details: err.details }),
775
787
  }
776
- : { error: msg };
788
+ : {
789
+ error: msg,
790
+ ...(typeof err?.errorCode === "string"
791
+ ? { errorCode: err.errorCode }
792
+ : {}),
793
+ ...(status === 429 &&
794
+ typeof retryAfterSeconds === "number" &&
795
+ Number.isInteger(retryAfterSeconds) &&
796
+ retryAfterSeconds > 0
797
+ ? { details: { retryAfterSeconds } }
798
+ : {}),
799
+ };
777
800
  }
778
801
  const requestId = getHttpRequestTelemetryId(event);
779
802
  const captureId = captureError(err, {
@@ -5,11 +5,11 @@
5
5
  * static suggestion list in `model-config.ts`.
6
6
  */
7
7
  export declare function createAgentEngineOllamaModelsHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
8
- error: string;
9
8
  ok?: undefined;
9
+ error: string;
10
10
  models?: undefined;
11
11
  } | {
12
- error?: undefined;
13
12
  ok: boolean;
14
13
  models: string[];
14
+ error?: undefined;
15
15
  }>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.192.0",
3
+ "version": "0.192.1-nightly-20260926144920",
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": {
@@ -513,8 +513,8 @@
513
513
  "yjs": "^13.6.32",
514
514
  "zod": "^4.3.6",
515
515
  "@agent-native/agentkit": "^0.3.0",
516
- "@agent-native/toolkit": "^0.22.0",
517
- "@agent-native/recap-cli": "0.5.44"
516
+ "@agent-native/recap-cli": "0.5.44",
517
+ "@agent-native/toolkit": "^0.22.0"
518
518
  },
519
519
  "devDependencies": {
520
520
  "@ai-sdk/anthropic": "^3.0.71",