@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.
- package/corpus/README.md +1 -1
- package/corpus/templates/calendar/actions/get-settings.ts +2 -5
- package/corpus/templates/calendar/actions/list-events.ts +21 -80
- package/corpus/templates/calendar/actions/update-settings.ts +11 -16
- package/corpus/templates/calendar/actions/view-screen.ts +25 -10
- package/corpus/templates/calendar/app/components/calendar/CommandPalette.tsx +7 -1
- package/corpus/templates/calendar/app/components/calendar/EventCard.tsx +5 -2
- package/corpus/templates/calendar/app/lib/calendar-timezone.ts +3 -18
- package/corpus/templates/calendar/app/lib/event-form-utils.ts +3 -62
- package/corpus/templates/calendar/changelog/2026-07-22-calendar-grid-local-time.md +6 -0
- package/corpus/templates/calendar/changelog/2026-08-19-the-calendar-loads-again-for-accounts-whose-saved-timezone-w.md +6 -0
- package/corpus/templates/calendar/server/handlers/settings.ts +8 -24
- package/corpus/templates/calendar/server/lib/calendar-settings.ts +58 -0
- package/corpus/templates/calendar/server/lib/find-time.ts +15 -93
- package/corpus/templates/calendar/shared/settings.ts +15 -9
- package/corpus/templates/calendar/shared/timezone.ts +127 -0
- package/corpus/templates/slides/actions/list-decks.ts +79 -5
- package/corpus/templates/slides/app/components/deck/DeckCard.tsx +21 -1
- package/corpus/templates/slides/app/components/editor/ShareDialog.tsx +49 -21
- package/corpus/templates/slides/app/context/DeckContext.tsx +49 -21
- package/corpus/templates/slides/app/pages/DeckEditor.tsx +2 -2
- package/corpus/templates/slides/app/pages/Index.tsx +11 -13
- package/corpus/templates/slides/changelog/2026-08-24-deck-previews-and-sharing-live-in-the-overflow-menu.md +5 -0
- package/dist/agent/production-agent.js +5 -1
- package/dist/agent/types.d.ts +5 -0
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/file-upload/actions/upload-image.d.ts +1 -1
- package/dist/observability/posthog-ai.d.ts +36 -11
- package/dist/observability/posthog-ai.js +99 -30
- package/dist/observability/routes.d.ts +3 -3
- package/dist/observability/routes.js +9 -2
- package/dist/observability/traces.js +330 -142
- package/dist/progress/routes.d.ts +1 -1
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/server/realtime-token.d.ts +1 -1
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/dist/tracking/providers.js +9 -3
- package/docs/content/observability.mdx +27 -10
- package/package.json +3 -3
|
@@ -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
|
}>>;
|
|
@@ -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
|
-
|
|
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
|
|
301
|
-
| ---------------- |
|
|
302
|
-
| `$ai_trace` | agent run
|
|
303
|
-
| `$ai_generation` | model
|
|
304
|
-
| `$ai_span` | tool call
|
|
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`
|
|
341
|
-
|
|
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
|
+
"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/
|
|
433
|
-
"@agent-native/
|
|
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",
|