@agent-native/core 0.171.0 → 0.171.3

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 (40) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +4 -5
  3. package/corpus/templates/analytics/server/lib/workspace-feature-flags.ts +84 -20
  4. package/corpus/templates/calendar/actions/create-event.ts +11 -3
  5. package/corpus/templates/calendar/app/components/calendar/AddCalendarDialog.tsx +56 -51
  6. package/corpus/templates/calendar/app/components/calendar/CreateEventDialog.tsx +3 -0
  7. package/corpus/templates/calendar/app/components/calendar/DayView.tsx +1 -1
  8. package/corpus/templates/calendar/app/components/calendar/PeopleSearchDialog.tsx +54 -51
  9. package/corpus/templates/calendar/app/components/calendar/WeekView.tsx +1 -1
  10. package/corpus/templates/calendar/app/components/layout/AppLayout.tsx +4 -1
  11. package/corpus/templates/calendar/app/hooks/use-people.ts +23 -13
  12. package/corpus/templates/calendar/app/lib/event-layout.ts +21 -6
  13. package/corpus/templates/calendar/app/pages/CalendarView.tsx +3 -0
  14. package/corpus/templates/calendar/changelog/2026-08-24-overlapping-events-use-space-better.md +5 -0
  15. package/corpus/templates/calendar/server/lib/google-api.ts +9 -0
  16. package/corpus/templates/calendar/server/lib/google-calendar.ts +59 -2
  17. package/corpus/templates/calendar/server/lib/people-search.ts +43 -28
  18. package/corpus/templates/calendar/shared/api.ts +2 -0
  19. package/corpus/templates/clips/app/components/player/playback-comment-overlay.tsx +3 -3
  20. package/corpus/templates/mail/app/root.tsx +29 -0
  21. package/dist/action.d.ts +4 -1
  22. package/dist/action.js +2 -0
  23. package/dist/client/DefaultSpinner.d.ts +3 -1
  24. package/dist/client/DefaultSpinner.js +2 -2
  25. package/dist/client/chat-first/apps-rail.d.ts +1 -1
  26. package/dist/client/chat-first/apps-rail.js +11 -8
  27. package/dist/client/chat-first/copy.js +1 -0
  28. package/dist/client/chat-first/types.d.ts +1 -0
  29. package/dist/client/use-action.js +8 -0
  30. package/dist/collab/awareness.d.ts +2 -2
  31. package/dist/collab/routes.d.ts +1 -1
  32. package/dist/notifications/routes.d.ts +1 -1
  33. package/dist/observability/routes.d.ts +3 -3
  34. package/dist/progress/routes.d.ts +1 -1
  35. package/dist/resources/handlers.d.ts +3 -3
  36. package/dist/secrets/routes.d.ts +6 -6
  37. package/dist/server/action-routes.js +6 -2
  38. package/dist/server/realtime-token.d.ts +1 -1
  39. package/dist/server/transcribe-voice.d.ts +1 -1
  40. package/package.json +1 -1
@@ -366,6 +366,14 @@ async function performActionFetch(name, method, params, options) {
366
366
  }
367
367
  const error = new Error(`Action ${name} failed: ${message}`);
368
368
  error.status = res.status;
369
+ if (typeof data?.errorCode === "string") {
370
+ error.errorCode = data.errorCode;
371
+ }
372
+ if (data?.details &&
373
+ typeof data.details === "object" &&
374
+ !Array.isArray(data.details)) {
375
+ error.details = data.details;
376
+ }
369
377
  throw error;
370
378
  }
371
379
  // 2xx but the body couldn't even be read (mid-stream abort, decode failure,
@@ -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
  }>>;
@@ -26,8 +26,8 @@ export declare const getCollabState: import("h3").EventHandlerWithFetch<import("
26
26
  * Body: { update: string (base64), requestSource?: string }
27
27
  */
28
28
  export declare const postCollabUpdate: import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
29
- error: string;
30
29
  ok?: undefined;
30
+ error: string;
31
31
  } | {
32
32
  error?: undefined;
33
33
  ok: boolean;
@@ -28,6 +28,6 @@ export declare function createNotificationsHandler(): import("h3").EventHandlerW
28
28
  } | {
29
29
  count?: undefined;
30
30
  updated?: undefined;
31
- ok: boolean;
32
31
  error?: undefined;
32
+ ok: boolean;
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
47
  id?: undefined;
47
- error?: 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
  error: any;
60
60
  ok?: undefined;
61
61
  } | {
62
+ error?: undefined;
62
63
  summary?: undefined;
63
64
  spans?: undefined;
64
65
  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
- ok: boolean;
19
18
  error?: undefined;
19
+ ok: boolean;
20
20
  }>>;
@@ -48,11 +48,11 @@ export declare function handleUpdateResource(event: any): Promise<import("./stor
48
48
  }>;
49
49
  /** DELETE /_agent-native/resources/:id — delete a resource */
50
50
  export declare function handleDeleteResource(event: any): Promise<{
51
- error: string;
52
51
  ok?: undefined;
52
+ error: string;
53
53
  } | {
54
- ok: boolean;
55
54
  error?: undefined;
55
+ ok: boolean;
56
56
  }>;
57
57
  /** POST /_agent-native/resources/upload — upload a file as a resource */
58
58
  export declare function handleUploadResource(event: any): Promise<import("./store.js").Resource | {
@@ -73,10 +73,10 @@ export declare function handleUploadResource(event: any): Promise<import("./stor
73
73
  runId: string | null;
74
74
  expiresAt: number | null;
75
75
  metadata: string | null;
76
+ error?: undefined;
76
77
  url: string;
77
78
  provider: string;
78
79
  storageSetupRequired?: undefined;
79
- error?: undefined;
80
80
  } | {
81
81
  error: string;
82
82
  storageSetupRequired: boolean;
@@ -37,17 +37,17 @@ export declare function createWriteSecretHandler(): import("h3").EventHandlerWit
37
37
  ok?: undefined;
38
38
  status?: undefined;
39
39
  } | {
40
+ error?: undefined;
40
41
  ok: boolean;
41
42
  status: string;
42
- error?: undefined;
43
43
  } | {
44
44
  ok?: undefined;
45
45
  error: string;
46
46
  removed?: undefined;
47
47
  } | {
48
+ error?: undefined;
48
49
  ok: boolean;
49
50
  removed: boolean;
50
- error?: undefined;
51
51
  }>>;
52
52
  /**
53
53
  * POST /_agent-native/secrets/:key/test — validate an optional candidate value
@@ -58,13 +58,13 @@ export declare function createTestSecretHandler(): import("h3").EventHandlerWith
58
58
  error: string;
59
59
  note?: undefined;
60
60
  } | {
61
+ error?: undefined;
61
62
  ok: boolean;
62
63
  note?: undefined;
63
- error?: undefined;
64
64
  } | {
65
+ error?: undefined;
65
66
  ok: boolean;
66
67
  note: string;
67
- error?: undefined;
68
68
  } | {
69
69
  note?: undefined;
70
70
  ok: boolean;
@@ -95,11 +95,11 @@ export interface AdHocSecretPayload {
95
95
  export declare function createAdHocSecretHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<AdHocSecretPayload[] | {
96
96
  error: string;
97
97
  } | {
98
+ error?: undefined;
98
99
  ok: boolean;
99
100
  key: string;
100
- error?: undefined;
101
101
  } | {
102
+ error?: undefined;
102
103
  ok: boolean;
103
104
  removed: boolean;
104
- error?: undefined;
105
105
  }>>;
@@ -543,19 +543,23 @@ export function mountActionRoutes(nitroApp, actions, options) {
543
543
  setResponseStatus(event, status);
544
544
  // Only echo the raw message for known-safe cases:
545
545
  // - validation errors (deterministic, parameter-shape only)
546
+ // - action contract errors (explicitly safe on every transport)
546
547
  // - explicit user-facing errors (AgentActionStopError / fail())
547
548
  // - errors with an explicit statusCode < 500 (client errors)
548
549
  // For uncategorized 500s, return a generic message and keep the
549
550
  // real detail server-side only — it can contain DB/driver/
550
551
  // upstream text we must not leak to HTTP callers.
551
552
  const isUserFacing = isValidationError ||
553
+ isActionContractError(err) ||
552
554
  isAgentActionStopError(err) ||
553
555
  (explicitStatus !== undefined && explicitStatus < 500);
554
556
  if (isUserFacing) {
555
- return isActionContractError(err)
557
+ return isActionContractError(err) || isAgentActionStopError(err)
556
558
  ? {
557
559
  error: msg,
558
- errorCode: err.errorCode,
560
+ ...(typeof err.errorCode === "string"
561
+ ? { errorCode: err.errorCode }
562
+ : {}),
559
563
  ...(err.details === undefined
560
564
  ? {}
561
565
  : { details: err.details }),
@@ -26,8 +26,8 @@ export declare function createRealtimeTokenHandler(): import("h3").EventHandlerW
26
26
  expiresAt?: undefined;
27
27
  ttlSeconds?: undefined;
28
28
  } | {
29
+ error?: undefined;
29
30
  token: string;
30
31
  expiresAt: string;
31
32
  ttlSeconds: number;
32
- error?: undefined;
33
33
  }>>;
@@ -20,6 +20,6 @@ export declare function createTranscribeVoiceHandler(): import("h3").EventHandle
20
20
  error: string;
21
21
  text?: undefined;
22
22
  } | {
23
- text: string;
24
23
  error?: undefined;
24
+ text: string;
25
25
  }>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.171.0",
3
+ "version": "0.171.3",
4
4
  "description": "Framework for agent-native application development — where AI agents and UI share SQL state, actions, and context",
5
5
  "homepage": "https://github.com/BuilderIO/agent-native#readme",
6
6
  "bugs": {