@agent-native/core 0.172.3 → 0.172.4

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 (39) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/templates/calendar/actions/get-settings.ts +2 -5
  3. package/corpus/templates/calendar/actions/list-events.ts +21 -80
  4. package/corpus/templates/calendar/actions/update-settings.ts +11 -16
  5. package/corpus/templates/calendar/actions/view-screen.ts +25 -10
  6. package/corpus/templates/calendar/app/components/calendar/CommandPalette.tsx +7 -1
  7. package/corpus/templates/calendar/app/components/calendar/EventCard.tsx +5 -2
  8. package/corpus/templates/calendar/app/lib/calendar-timezone.ts +3 -18
  9. package/corpus/templates/calendar/app/lib/event-form-utils.ts +3 -62
  10. package/corpus/templates/calendar/changelog/2026-07-22-calendar-grid-local-time.md +6 -0
  11. package/corpus/templates/calendar/changelog/2026-08-19-the-calendar-loads-again-for-accounts-whose-saved-timezone-w.md +6 -0
  12. package/corpus/templates/calendar/server/handlers/settings.ts +8 -24
  13. package/corpus/templates/calendar/server/lib/calendar-settings.ts +58 -0
  14. package/corpus/templates/calendar/server/lib/find-time.ts +15 -93
  15. package/corpus/templates/calendar/shared/settings.ts +15 -9
  16. package/corpus/templates/calendar/shared/timezone.ts +127 -0
  17. package/corpus/templates/slides/actions/list-decks.ts +79 -5
  18. package/corpus/templates/slides/app/components/deck/DeckCard.tsx +21 -1
  19. package/corpus/templates/slides/app/components/editor/ShareDialog.tsx +49 -21
  20. package/corpus/templates/slides/app/context/DeckContext.tsx +49 -21
  21. package/corpus/templates/slides/app/pages/DeckEditor.tsx +2 -2
  22. package/corpus/templates/slides/app/pages/Index.tsx +11 -13
  23. package/corpus/templates/slides/changelog/2026-08-24-deck-previews-and-sharing-live-in-the-overflow-menu.md +5 -0
  24. package/dist/agent/production-agent.js +5 -1
  25. package/dist/agent/types.d.ts +5 -0
  26. package/dist/collab/awareness.d.ts +2 -2
  27. package/dist/file-upload/actions/upload-image.d.ts +1 -1
  28. package/dist/observability/posthog-ai.d.ts +36 -11
  29. package/dist/observability/posthog-ai.js +99 -30
  30. package/dist/observability/routes.d.ts +3 -3
  31. package/dist/observability/routes.js +9 -2
  32. package/dist/observability/traces.js +330 -142
  33. package/dist/progress/routes.d.ts +1 -1
  34. package/dist/resources/handlers.d.ts +1 -1
  35. package/dist/server/realtime-token.d.ts +1 -1
  36. package/dist/server/transcribe-voice.d.ts +1 -1
  37. package/dist/tracking/providers.js +9 -3
  38. package/docs/content/observability.mdx +27 -10
  39. package/package.json +3 -3
@@ -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,8 +48,8 @@ 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
54
  error?: undefined;
55
55
  ok: boolean;
@@ -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
  }>>;
@@ -140,11 +140,16 @@ function createPostHogProvider(apiKey, host, errorTracking) {
140
140
  enqueue(`${host}/i/v0/e/`, JSON.stringify({
141
141
  api_key: apiKey,
142
142
  event: event.name,
143
+ // Top level, NOT inside `properties`: PostHog reads the event time from
144
+ // the payload root and treats a `properties.timestamp` as an ordinary
145
+ // custom property, stamping the event with its ingestion time instead.
146
+ // An agent run emits its whole tree in one burst at the end, so that
147
+ // collapsed a five-minute waterfall into the 100ms it took to flush.
148
+ timestamp: event.timestamp,
143
149
  properties: {
144
150
  distinct_id: distinctId,
145
151
  ...properties,
146
152
  ...(event.sessionId ? { $session_id: event.sessionId } : {}),
147
- timestamp: event.timestamp,
148
153
  },
149
154
  }));
150
155
  };
@@ -176,10 +181,10 @@ function createPostHogProvider(apiKey, host, errorTracking) {
176
181
  api_key: apiKey,
177
182
  event: event.name,
178
183
  distinct_id: distinctId,
184
+ timestamp: event.timestamp,
179
185
  properties: {
180
186
  ...event.properties,
181
187
  ...(event.sessionId ? { $session_id: event.sessionId } : {}),
182
- timestamp: event.timestamp,
183
188
  },
184
189
  }));
185
190
  },
@@ -218,7 +223,8 @@ export function sendPostHogEvent(name, properties, distinctId) {
218
223
  api_key: apiKey,
219
224
  event: name,
220
225
  distinct_id: distinctId,
221
- properties: { ...properties, timestamp: new Date().toISOString() },
226
+ timestamp: new Date().toISOString(),
227
+ properties,
222
228
  }));
223
229
  return true;
224
230
  }
@@ -297,13 +297,24 @@ All endpoints support `?since=N` (ms timestamp) and `?limit=N` query params.
297
297
  When `POSTHOG_API_KEY` is set, every instrumented run is mirrored to PostHog's
298
298
  LLM analytics as a full trace tree:
299
299
 
300
- | Event | Emitted per | Carries |
301
- | ---------------- | ----------- | ------------------------------------------------------- |
302
- | `$ai_trace` | agent run | Latency, error state, token totals, cost |
303
- | `$ai_generation` | model call | Model, provider, tokens, cost, tool definitions offered |
304
- | `$ai_span` | tool call | Tool name, duration, error state |
305
-
306
- Nodes share the run id as `$ai_trace_id`, so PostHog renders one tree per run.
300
+ | Event | Emitted per | Carries |
301
+ | ---------------- | ---------------- | --------------------------------------------------------- |
302
+ | `$ai_trace` | agent run | Run name, totals, terminal state, run-level failure |
303
+ | `$ai_generation` | model round-trip | Prompt, answer, model, tokens, cost, latency, stop reason |
304
+ | `$ai_span` | tool call | Tool name, duration, failure class |
305
+
306
+ Nodes share the run id as `$ai_trace_id`, so PostHog renders one tree per run,
307
+ with each tool span under the generation that requested it. A run's tool
308
+ definitions are never sent: they are the same catalogue on every call, and a
309
+ call is identified by its name in `$ai_output_choices` and by its own span.
310
+
311
+ `$ai_is_error` means a different thing at each level, and never travels without
312
+ `$ai_error` and `$ai_error_type`. On a generation it is the model call itself
313
+ failing — a provider error, a dropped stream. On a span it is a tool that
314
+ crashed or returned an error. On the trace it is the run: a step budget, a
315
+ timeout, a no-progress cut-off, or a tool that stopped the run. A run that
316
+ failed after the model answered leaves its generations green, because they did
317
+ not fail.
307
318
  `$ai_session_id` is the conversation thread; the browser session is sent
308
319
  separately as `$session_id` so a trace links to its session replay.
309
320
 
@@ -337,9 +348,15 @@ to each other.
337
348
 
338
349
  Thumbs, category, and free-text feedback all emit `$ai_feedback`. PostHog's LLM
339
350
  analytics feedback view reads a `survey sent` event instead, so set
340
- `POSTHOG_AI_FEEDBACK_SURVEY_ID` (and `POSTHOG_AI_FEEDBACK_SURVEY_QUESTION_ID`
341
- for multi-question surveys) to populate it. Without a survey id no survey event
342
- is sent.
351
+ `POSTHOG_AI_FEEDBACK_SURVEY_ID` to the survey PostHog creates from a trace's
352
+ **Feedback** tab. That one id is the whole configuration; without it no survey
353
+ event is sent.
354
+
355
+ A thumbs vote answers the survey's first question as PostHog's choice index
356
+ (`1` up, `2` down) and the free text after a thumbs-down answers the follow-up
357
+ question, so the text never lands where the rating belongs. Both carry one
358
+ submission id per rated message, which is how PostHog joins them into a single
359
+ response, and a thumbs-down stays marked incomplete until its follow-up arrives.
343
360
 
344
361
  ## Export to external platforms {#export}
345
362
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.172.3",
3
+ "version": "0.172.4",
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": {
@@ -429,8 +429,8 @@
429
429
  "y-protocols": "^1.0.7",
430
430
  "yjs": "^13.6.32",
431
431
  "zod": "^4.3.6",
432
- "@agent-native/recap-cli": "0.5.8",
433
- "@agent-native/toolkit": "^0.16.11"
432
+ "@agent-native/toolkit": "^0.16.11",
433
+ "@agent-native/recap-cli": "0.5.8"
434
434
  },
435
435
  "devDependencies": {
436
436
  "@ai-sdk/anthropic": "^3.0.71",