@agent-native/core 0.172.9 → 0.173.0-nightly-20260825065619

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 (58) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/templates/analytics/changelog/2026-08-24-chat-draft-preservation.md +1 -0
  3. package/corpus/templates/calendar/actions/view-screen.ts +0 -5
  4. package/corpus/templates/calendar/app/components/calendar/CommandPalette.tsx +1 -1
  5. package/corpus/templates/clips/app/components/player/video-player.tsx +3 -1
  6. package/corpus/templates/clips/changelog/2026-08-24-muted-microphone-start-guidance.md +1 -0
  7. package/corpus/templates/clips/changelog/2026-08-24-shared-clips-now-expose-agent-readable-transcript-and-frame-metadata-from-public-links.md +6 -0
  8. package/corpus/templates/clips/server/routes/[...page].get.ts +172 -3
  9. package/corpus/templates/plan/app/components/layout/Header.tsx +1 -1
  10. package/corpus/templates/plan/app/components/layout/Layout.tsx +19 -3
  11. package/corpus/templates/plan/app/components/layout/Sidebar.tsx +11 -10
  12. package/corpus/templates/plan/app/hooks/use-navigation-state.ts +10 -9
  13. package/corpus/templates/plan/app/pages/PlansPage.tsx +1 -1
  14. package/corpus/templates/plan/app/root.tsx +9 -8
  15. package/corpus/templates/plan/app/routes/_index.tsx +6 -30
  16. package/corpus/templates/plan/app/routes/chat.tsx +34 -0
  17. package/corpus/templates/plan/server/plugins/auth.ts +1 -0
  18. package/corpus/templates/slides/changelog/2026-08-24-deck-previews-and-sharing-live-in-the-overflow-menu.md +1 -0
  19. package/dist/agent/harness/migrations.js +1 -1
  20. package/dist/client/AgentPanel.d.ts +3 -1
  21. package/dist/client/AgentPanel.js +67 -46
  22. package/dist/client/AssistantChat.d.ts +8 -0
  23. package/dist/client/AssistantChat.js +2 -1
  24. package/dist/client/agent-chat/index.d.ts +2 -0
  25. package/dist/client/agent-chat/index.js +2 -0
  26. package/dist/client/chat/index.d.ts +2 -0
  27. package/dist/client/chat/index.js +2 -0
  28. package/dist/client/chat/message-components.d.ts +5 -14
  29. package/dist/client/chat/message-components.js +15 -8
  30. package/dist/client/chat/tool-call-display.js +24 -11
  31. package/dist/client/thinking-display.d.ts +23 -0
  32. package/dist/client/thinking-display.js +86 -0
  33. package/dist/collab/struct-routes.d.ts +1 -1
  34. package/dist/localization/core-messages/ar-SA.js +4 -0
  35. package/dist/localization/core-messages/de-DE.js +4 -0
  36. package/dist/localization/core-messages/en-US.d.ts +4 -0
  37. package/dist/localization/core-messages/en-US.js +4 -0
  38. package/dist/localization/core-messages/es-ES.js +4 -0
  39. package/dist/localization/core-messages/fr-FR.js +4 -0
  40. package/dist/localization/core-messages/hi-IN.js +4 -0
  41. package/dist/localization/core-messages/ja-JP.js +4 -0
  42. package/dist/localization/core-messages/ko-KR.js +4 -0
  43. package/dist/localization/core-messages/pt-BR.js +4 -0
  44. package/dist/localization/core-messages/zh-CN.js +4 -0
  45. package/dist/localization/core-messages/zh-TW.js +4 -0
  46. package/dist/localization/core-messages.d.ts +4 -0
  47. package/dist/observability/posthog-ai.d.ts +6 -0
  48. package/dist/observability/posthog-ai.js +6 -0
  49. package/dist/provider-api/actions/custom-provider-registration.d.ts +4 -4
  50. package/dist/provider-api/actions/provider-api.d.ts +8 -8
  51. package/dist/provider-api/corpus-jobs.d.ts +2 -2
  52. package/dist/secrets/routes.d.ts +6 -6
  53. package/dist/server/realtime-token.d.ts +1 -1
  54. package/dist/shared/thinking-display.d.ts +23 -0
  55. package/dist/shared/thinking-display.js +31 -0
  56. package/dist/tracking/providers.js +22 -1
  57. package/docs/content/template-calendar-developers.mdx +54 -54
  58. package/package.json +1 -1
@@ -535,6 +535,10 @@ const messages = {
535
535
  "tool.repeated": "تكرر {{count}} مرة",
536
536
  "tool.result": "النتيجة",
537
537
  "tool.subAgentTask": "مهمة الوكيل الفرعي",
538
+ "thinking.collapsed": "مطوي",
539
+ "thinking.display": "عرض التفكير",
540
+ "thinking.expanded": "موسّع",
541
+ "thinking.hidden": "مخفي",
538
542
  "tool.thought": "فكرة",
539
543
  "tool.thoughtFor": "فكّر لمدة {{duration}}",
540
544
  "tool.viewOutput": "عرض مخرجات {{tool}}",
@@ -181,6 +181,10 @@ const messages = {
181
181
  "tool.repeated": "{{count}}-mal wiederholt",
182
182
  "tool.result": "Ergebnis",
183
183
  "tool.subAgentTask": "Unteragenten-Aufgabe",
184
+ "thinking.collapsed": "Eingeklappt",
185
+ "thinking.display": "Gedankengang",
186
+ "thinking.expanded": "Ausgeklappt",
187
+ "thinking.hidden": "Ausgeblendet",
184
188
  "tool.thought": "Gedankengang",
185
189
  "tool.thoughtFor": "{{duration}} nachgedacht",
186
190
  "tool.viewOutput": "Ausgabe von {{tool}} anzeigen",
@@ -515,6 +515,10 @@ declare const messages: {
515
515
  readonly "tool.repeated": "Repeated {{count}} times";
516
516
  readonly "tool.result": "Result";
517
517
  readonly "tool.subAgentTask": "Sub-agent task";
518
+ readonly "thinking.collapsed": "Collapsed";
519
+ readonly "thinking.display": "Thinking";
520
+ readonly "thinking.expanded": "Expanded";
521
+ readonly "thinking.hidden": "Hidden";
518
522
  readonly "tool.thought": "Thought";
519
523
  readonly "tool.thoughtFor": "Thought for {{duration}}";
520
524
  readonly "tool.viewOutput": "View {{tool}} output";
@@ -515,6 +515,10 @@ const messages = {
515
515
  "tool.repeated": "Repeated {{count}} times",
516
516
  "tool.result": "Result",
517
517
  "tool.subAgentTask": "Sub-agent task",
518
+ "thinking.collapsed": "Collapsed",
519
+ "thinking.display": "Thinking",
520
+ "thinking.expanded": "Expanded",
521
+ "thinking.hidden": "Hidden",
518
522
  "tool.thought": "Thought",
519
523
  "tool.thoughtFor": "Thought for {{duration}}",
520
524
  "tool.viewOutput": "View {{tool}} output",
@@ -181,6 +181,10 @@ const messages = {
181
181
  "tool.repeated": "Repetido {{count}} veces",
182
182
  "tool.result": "Resultado",
183
183
  "tool.subAgentTask": "Tarea del subagente",
184
+ "thinking.collapsed": "Contraído",
185
+ "thinking.display": "Razonamiento",
186
+ "thinking.expanded": "Expandido",
187
+ "thinking.hidden": "Oculto",
184
188
  "tool.thought": "Razonamiento",
185
189
  "tool.thoughtFor": "Razonó durante {{duration}}",
186
190
  "tool.viewOutput": "Ver la salida de {{tool}}",
@@ -181,6 +181,10 @@ const messages = {
181
181
  "tool.repeated": "Répété {{count}} fois",
182
182
  "tool.result": "Résultat",
183
183
  "tool.subAgentTask": "Tâche du sous-agent",
184
+ "thinking.collapsed": "Replié",
185
+ "thinking.display": "Réflexion",
186
+ "thinking.expanded": "Développé",
187
+ "thinking.hidden": "Masqué",
184
188
  "tool.thought": "Réflexion",
185
189
  "tool.thoughtFor": "Réflexion pendant {{duration}}",
186
190
  "tool.viewOutput": "Afficher la sortie de {{tool}}",
@@ -515,6 +515,10 @@ const messages = {
515
515
  "tool.repeated": "{{count}} बार दोहराया गया",
516
516
  "tool.result": "परिणाम",
517
517
  "tool.subAgentTask": "सब-एजेंट कार्य",
518
+ "thinking.collapsed": "संक्षिप्त",
519
+ "thinking.display": "विचार प्रदर्शन",
520
+ "thinking.expanded": "विस्तृत",
521
+ "thinking.hidden": "छिपा हुआ",
518
522
  "tool.thought": "विचार",
519
523
  "tool.thoughtFor": "{{duration}} तक सोचा",
520
524
  "tool.viewOutput": "{{tool}} का आउटपुट देखें",
@@ -510,6 +510,10 @@ const messages = {
510
510
  "tool.repeated": "{{count}} 回繰り返しました",
511
511
  "tool.result": "結果",
512
512
  "tool.subAgentTask": "サブエージェントのタスク",
513
+ "thinking.collapsed": "折りたたみ",
514
+ "thinking.display": "思考の表示",
515
+ "thinking.expanded": "展開",
516
+ "thinking.hidden": "非表示",
513
517
  "tool.thought": "思考",
514
518
  "tool.thoughtFor": "{{duration}} 思考しました",
515
519
  "tool.viewOutput": "{{tool}} の出力を表示",
@@ -510,6 +510,10 @@ const messages = {
510
510
  "tool.repeated": "{{count}}회 반복",
511
511
  "tool.result": "결과",
512
512
  "tool.subAgentTask": "하위 에이전트 작업",
513
+ "thinking.collapsed": "접음",
514
+ "thinking.display": "생각 표시",
515
+ "thinking.expanded": "펼침",
516
+ "thinking.hidden": "숨김",
513
517
  "tool.thought": "생각",
514
518
  "tool.thoughtFor": "{{duration}} 동안 생각함",
515
519
  "tool.viewOutput": "{{tool}} 출력 보기",
@@ -181,6 +181,10 @@ const messages = {
181
181
  "tool.repeated": "Repetido {{count}} vezes",
182
182
  "tool.result": "Resultado",
183
183
  "tool.subAgentTask": "Tarefa do subagente",
184
+ "thinking.collapsed": "Recolhido",
185
+ "thinking.display": "Raciocínio",
186
+ "thinking.expanded": "Expandido",
187
+ "thinking.hidden": "Oculto",
184
188
  "tool.thought": "Raciocínio",
185
189
  "tool.thoughtFor": "Raciocinou por {{duration}}",
186
190
  "tool.viewOutput": "Ver saída de {{tool}}",
@@ -510,6 +510,10 @@ const messages = {
510
510
  "tool.repeated": "重复了 {{count}} 次",
511
511
  "tool.result": "结果",
512
512
  "tool.subAgentTask": "子智能体任务",
513
+ "thinking.collapsed": "折叠",
514
+ "thinking.display": "思考显示",
515
+ "thinking.expanded": "展开",
516
+ "thinking.hidden": "隐藏",
513
517
  "tool.thought": "思考",
514
518
  "tool.thoughtFor": "思考了 {{duration}}",
515
519
  "tool.viewOutput": "查看 {{tool}} 输出",
@@ -510,6 +510,10 @@ const messages = {
510
510
  "tool.repeated": "重複了 {{count}} 次",
511
511
  "tool.result": "結果",
512
512
  "tool.subAgentTask": "子代理任務",
513
+ "thinking.collapsed": "收合",
514
+ "thinking.display": "思考顯示",
515
+ "thinking.expanded": "展開",
516
+ "thinking.hidden": "隱藏",
513
517
  "tool.thought": "思考",
514
518
  "tool.thoughtFor": "思考了 {{duration}}",
515
519
  "tool.viewOutput": "檢視 {{tool}} 輸出",
@@ -517,6 +517,10 @@ export declare const englishAgentChatMessages: {
517
517
  readonly "tool.repeated": "Repeated {{count}} times";
518
518
  readonly "tool.result": "Result";
519
519
  readonly "tool.subAgentTask": "Sub-agent task";
520
+ readonly "thinking.collapsed": "Collapsed";
521
+ readonly "thinking.display": "Thinking";
522
+ readonly "thinking.expanded": "Expanded";
523
+ readonly "thinking.hidden": "Hidden";
520
524
  readonly "tool.thought": "Thought";
521
525
  readonly "tool.thoughtFor": "Thought for {{duration}}";
522
526
  readonly "tool.viewOutput": "View {{tool}} output";
@@ -12,6 +12,12 @@
12
12
  * PostHog's `$session_id`: the latter is the browser session used for session
13
13
  * replay, and the two are different lifetimes.
14
14
  *
15
+ * Events are stamped when the operation BEGAN, which is what every backend
16
+ * except PostHog reads verbatim. PostHog alone treats an AI event's timestamp
17
+ * as the moment the operation ended and recovers the start by subtracting
18
+ * `$ai_latency`; that shift lives in its provider, not here, so one backend's
19
+ * convention cannot move everyone else's clock.
20
+ *
15
21
  * PostHog DERIVES a trace's latency, tokens and cost from its children — its
16
22
  * trace query sums `$ai_latency` over every event whose `$ai_parent_id` is the
17
23
  * trace or absent, and sums tokens/cost over `$ai_generation` / `$ai_embedding`
@@ -12,6 +12,12 @@
12
12
  * PostHog's `$session_id`: the latter is the browser session used for session
13
13
  * replay, and the two are different lifetimes.
14
14
  *
15
+ * Events are stamped when the operation BEGAN, which is what every backend
16
+ * except PostHog reads verbatim. PostHog alone treats an AI event's timestamp
17
+ * as the moment the operation ended and recovers the start by subtracting
18
+ * `$ai_latency`; that shift lives in its provider, not here, so one backend's
19
+ * convention cannot move everyone else's clock.
20
+ *
15
21
  * PostHog DERIVES a trace's latency, tokens and cost from its children — its
16
22
  * trace query sums `$ai_latency` over every event whose `$ai_parent_id` is the
17
23
  * trace or absent, and sums tokens/cost over `$ai_generation` / `$ai_embedding`
@@ -76,6 +76,7 @@ export declare function createCustomProviderRegistrationAction<TSchema extends Z
76
76
  }>>;
77
77
  }, z.core.$strip>>, {
78
78
  id?: undefined;
79
+ provider?: undefined;
79
80
  deleted?: undefined;
80
81
  providers: {
81
82
  id: string;
@@ -87,7 +88,6 @@ export declare function createCustomProviderRegistrationAction<TSchema extends Z
87
88
  updatedAt: number;
88
89
  }[];
89
90
  count: number;
90
- provider?: undefined;
91
91
  found?: undefined;
92
92
  registered?: undefined;
93
93
  label?: undefined;
@@ -103,19 +103,19 @@ export declare function createCustomProviderRegistrationAction<TSchema extends Z
103
103
  label?: undefined;
104
104
  message?: undefined;
105
105
  } | {
106
+ provider?: undefined;
106
107
  deleted?: undefined;
107
108
  providers?: undefined;
108
109
  count?: undefined;
109
- provider?: undefined;
110
110
  found: boolean;
111
111
  id: string;
112
112
  registered?: undefined;
113
113
  label?: undefined;
114
114
  message?: undefined;
115
115
  } | {
116
+ provider?: undefined;
116
117
  providers?: undefined;
117
118
  count?: undefined;
118
- provider?: undefined;
119
119
  found?: undefined;
120
120
  deleted: boolean;
121
121
  id: string;
@@ -123,10 +123,10 @@ export declare function createCustomProviderRegistrationAction<TSchema extends Z
123
123
  label?: undefined;
124
124
  message?: undefined;
125
125
  } | {
126
+ provider?: undefined;
126
127
  deleted?: undefined;
127
128
  providers?: undefined;
128
129
  count?: undefined;
129
- provider?: undefined;
130
130
  found?: undefined;
131
131
  registered: boolean;
132
132
  id: string;
@@ -312,8 +312,6 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
312
312
  scope?: "org" | "user" | undefined;
313
313
  }, {
314
314
  id?: undefined;
315
- provider?: undefined;
316
- deleted?: undefined;
317
315
  providers: {
318
316
  id: string;
319
317
  label: string;
@@ -324,34 +322,36 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
324
322
  updatedAt: number;
325
323
  }[];
326
324
  count: number;
325
+ provider?: undefined;
327
326
  found?: undefined;
327
+ deleted?: undefined;
328
328
  registered?: undefined;
329
329
  label?: undefined;
330
330
  message?: undefined;
331
331
  } | {
332
332
  id?: undefined;
333
- deleted?: undefined;
334
333
  providers?: undefined;
335
334
  count?: undefined;
336
335
  found: boolean;
337
336
  provider: import("../custom-registry.js").CustomProviderConfig;
337
+ deleted?: undefined;
338
338
  registered?: undefined;
339
339
  label?: undefined;
340
340
  message?: undefined;
341
341
  } | {
342
- provider?: undefined;
343
- deleted?: undefined;
344
342
  providers?: undefined;
345
343
  count?: undefined;
344
+ provider?: undefined;
346
345
  found: boolean;
347
346
  id: string;
347
+ deleted?: undefined;
348
348
  registered?: undefined;
349
349
  label?: undefined;
350
350
  message?: undefined;
351
351
  } | {
352
- provider?: undefined;
353
352
  providers?: undefined;
354
353
  count?: undefined;
354
+ provider?: undefined;
355
355
  found?: undefined;
356
356
  deleted: boolean;
357
357
  id: string;
@@ -359,11 +359,11 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
359
359
  label?: undefined;
360
360
  message?: undefined;
361
361
  } | {
362
- provider?: undefined;
363
- deleted?: undefined;
364
362
  providers?: undefined;
365
363
  count?: undefined;
364
+ provider?: undefined;
366
365
  found?: undefined;
366
+ deleted?: undefined;
367
367
  registered: boolean;
368
368
  id: string;
369
369
  label: string;
@@ -73,6 +73,7 @@ export declare function createProviderCorpusJobAction(options: CreateProviderCor
73
73
  offset?: unknown;
74
74
  limit?: unknown;
75
75
  }, {
76
+ deleted?: undefined;
76
77
  jobs: {
77
78
  id: string;
78
79
  name: string;
@@ -83,7 +84,6 @@ export declare function createProviderCorpusJobAction(options: CreateProviderCor
83
84
  updatedAt: string;
84
85
  }[];
85
86
  total: number;
86
- deleted?: undefined;
87
87
  jobId?: undefined;
88
88
  } | {
89
89
  jobs?: undefined;
@@ -91,9 +91,9 @@ export declare function createProviderCorpusJobAction(options: CreateProviderCor
91
91
  deleted: boolean;
92
92
  jobId: string;
93
93
  } | {
94
+ deleted?: undefined;
94
95
  jobs?: undefined;
95
96
  total?: undefined;
96
- deleted?: undefined;
97
97
  jobId?: undefined;
98
98
  hits: Record<string, unknown>[];
99
99
  offset: number;
@@ -37,17 +37,17 @@ export declare function createWriteSecretHandler(): import("h3").EventHandlerWit
37
37
  ok?: undefined;
38
38
  status?: undefined;
39
39
  } | {
40
- error?: undefined;
41
40
  ok: boolean;
42
41
  status: string;
42
+ error?: undefined;
43
43
  } | {
44
44
  ok?: undefined;
45
45
  error: string;
46
46
  removed?: undefined;
47
47
  } | {
48
- error?: undefined;
49
48
  ok: boolean;
50
49
  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;
62
61
  ok: boolean;
63
62
  note?: undefined;
64
- } | {
65
63
  error?: undefined;
64
+ } | {
66
65
  ok: boolean;
67
66
  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;
99
98
  ok: boolean;
100
99
  key: string;
101
- } | {
102
100
  error?: undefined;
101
+ } | {
103
102
  ok: boolean;
104
103
  removed: boolean;
104
+ error?: undefined;
105
105
  }>>;
@@ -26,8 +26,8 @@ export declare function createRealtimeTokenHandler(): import("h3").EventHandlerW
26
26
  expiresAt?: undefined;
27
27
  ttlSeconds?: undefined;
28
28
  } | {
29
- error?: undefined;
30
29
  token: string;
31
30
  expiresAt: string;
32
31
  ttlSeconds: number;
32
+ error?: undefined;
33
33
  }>>;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * How much of the model's reasoning the chat surface shows.
3
+ *
4
+ * This is presentation only. It never changes what the engine requests or
5
+ * what is persisted — a hidden thought was still thought, and switching back
6
+ * to `expanded` reveals the same text on the same historical turns.
7
+ */
8
+ export declare const THINKING_DISPLAY_MODES: readonly ["expanded", "collapsed", "hidden"];
9
+ export type ThinkingDisplay = (typeof THINKING_DISPLAY_MODES)[number];
10
+ /**
11
+ * Collapsed by default: a live reasoning cell that auto-opens pushes the
12
+ * answer out of the viewport on every turn, which is the noise users report.
13
+ * The label and its "Thought for Xs" timing stay visible, one click from the
14
+ * full text.
15
+ */
16
+ export declare const DEFAULT_THINKING_DISPLAY: ThinkingDisplay;
17
+ export declare function isThinkingDisplay(value: unknown): value is ThinkingDisplay;
18
+ /**
19
+ * Returns null for both "nothing stored" and "stored value is not a mode".
20
+ * Callers substitute the default; the distinction does not survive here
21
+ * because there is no repair a caller could make with it.
22
+ */
23
+ export declare function parseThinkingDisplay(value: unknown): ThinkingDisplay | null;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * How much of the model's reasoning the chat surface shows.
3
+ *
4
+ * This is presentation only. It never changes what the engine requests or
5
+ * what is persisted — a hidden thought was still thought, and switching back
6
+ * to `expanded` reveals the same text on the same historical turns.
7
+ */
8
+ export const THINKING_DISPLAY_MODES = [
9
+ "expanded",
10
+ "collapsed",
11
+ "hidden",
12
+ ];
13
+ /**
14
+ * Collapsed by default: a live reasoning cell that auto-opens pushes the
15
+ * answer out of the viewport on every turn, which is the noise users report.
16
+ * The label and its "Thought for Xs" timing stay visible, one click from the
17
+ * full text.
18
+ */
19
+ export const DEFAULT_THINKING_DISPLAY = "collapsed";
20
+ const modeSet = new Set(THINKING_DISPLAY_MODES);
21
+ export function isThinkingDisplay(value) {
22
+ return typeof value === "string" && modeSet.has(value);
23
+ }
24
+ /**
25
+ * Returns null for both "nothing stored" and "stored value is not a mode".
26
+ * Callers substitute the default; the distinction does not survive here
27
+ * because there is no repair a caller could make with it.
28
+ */
29
+ export function parseThinkingDisplay(value) {
30
+ return isThinkingDisplay(value) ? value : null;
31
+ }
@@ -135,6 +135,27 @@ function isPostHogAiObservabilityEvent(eventName) {
135
135
  * `$exception_list` — the framework's own `captureException()` emits camelCase
136
136
  * fields that PostHog would otherwise render as an empty, ungroupable issue.
137
137
  */
138
+ /**
139
+ * PostHog reads an AI event's timestamp as the moment the operation ENDED and
140
+ * recovers its start by subtracting `$ai_latency` (its `operationStartMs`).
141
+ * The framework stamps events when the operation began — which Mixpanel,
142
+ * Amplitude, webhooks and Agent Native Analytics consume verbatim — so the
143
+ * shift belongs here, in the one backend that reads it that way. Events with no
144
+ * `$ai_latency` (a trace, an exception) are unshifted: there is nothing for
145
+ * PostHog to subtract.
146
+ */
147
+ function postHogAiEndTimestamp(event) {
148
+ const latencySeconds = Number(event.properties?.["$ai_latency"]);
149
+ if (!event.timestamp ||
150
+ !Number.isFinite(latencySeconds) ||
151
+ latencySeconds <= 0) {
152
+ return event.timestamp;
153
+ }
154
+ const startedAt = Date.parse(event.timestamp);
155
+ if (Number.isNaN(startedAt))
156
+ return event.timestamp;
157
+ return new Date(startedAt + Math.round(latencySeconds * 1000)).toISOString();
158
+ }
138
159
  function createPostHogProvider(apiKey, host, errorTracking) {
139
160
  const sendToEventsEndpoint = (event, properties, distinctId) => {
140
161
  enqueue(`${host}/i/v0/e/`, JSON.stringify({
@@ -145,7 +166,7 @@ function createPostHogProvider(apiKey, host, errorTracking) {
145
166
  // custom property, stamping the event with its ingestion time instead.
146
167
  // An agent run emits its whole tree in one burst at the end, so that
147
168
  // collapsed a five-minute waterfall into the 100ms it took to flush.
148
- timestamp: event.timestamp,
169
+ timestamp: postHogAiEndTimestamp(event),
149
170
  properties: {
150
171
  distinct_id: distinctId,
151
172
  ...properties,
@@ -109,97 +109,97 @@ Every operation is a TypeScript file in `templates/calendar/actions/`, auto-moun
109
109
 
110
110
  Event data lives in Google Calendar, never SQL.
111
111
 
112
- | Action | What it does |
113
- | --- | --- |
114
- | `list-events` | List events in a date range |
115
- | `search-events` | Search events by query |
116
- | `get-event` | Read one event by id |
117
- | `create-event` | Create an event, including recurrence (RRULE), working locations, and status types (`outOfOffice`, `focusTime`) |
118
- | `update-event` | Update an event, including recurrence, working locations, and status types |
119
- | `delete-event` | Delete an event |
120
- | `manage-event-draft` | Stage an unsent invite for user review before anything is written or guests are notified |
121
- | `rsvp-event` | Accept, decline, or mark tentative on an invitation |
122
- | `get-attendee-timezones` | Read per-guest timezone overrides |
123
- | `set-attendee-timezone` | Set a per-guest timezone override so their local time keeps showing correctly |
112
+ | Action | What it does |
113
+ | ------------------------ | --------------------------------------------------------------------------------------------------------------- |
114
+ | `list-events` | List events in a date range |
115
+ | `search-events` | Search events by query |
116
+ | `get-event` | Read one event by id |
117
+ | `create-event` | Create an event, including recurrence (RRULE), working locations, and status types (`outOfOffice`, `focusTime`) |
118
+ | `update-event` | Update an event, including recurrence, working locations, and status types |
119
+ | `delete-event` | Delete an event |
120
+ | `manage-event-draft` | Stage an unsent invite for user review before anything is written or guests are notified |
121
+ | `rsvp-event` | Accept, decline, or mark tentative on an invitation |
122
+ | `get-attendee-timezones` | Read per-guest timezone overrides |
123
+ | `set-attendee-timezone` | Set a per-guest timezone override so their local time keeps showing correctly |
124
124
 
125
125
  ### Availability & finding time
126
126
 
127
- | Action | What it does |
128
- | --- | --- |
129
- | `get-availability` | Read the weekly schedule, timezone, buffer, notice, and advance-window settings |
130
- | `update-availability` | Update the weekly schedule, timezone, buffer, notice, and advance-window settings |
131
- | `check-availability` | Find open slots for one date |
132
- | `find-a-time` | Shared free-slot search across an organizer and named attendees, combining Google free/busy with local conflicts |
127
+ | Action | What it does |
128
+ | --------------------- | ---------------------------------------------------------------------------------------------------------------- |
129
+ | `get-availability` | Read the weekly schedule, timezone, buffer, notice, and advance-window settings |
130
+ | `update-availability` | Update the weekly schedule, timezone, buffer, notice, and advance-window settings |
131
+ | `check-availability` | Find open slots for one date |
132
+ | `find-a-time` | Shared free-slot search across an organizer and named attendees, combining Google free/busy with local conflicts |
133
133
 
134
134
  ### Booking links & bookings
135
135
 
136
- | Action | What it does |
137
- | --- | --- |
138
- | `create-booking-link` | Create a booking link |
139
- | `update-booking-link` | Update a booking link |
136
+ | Action | What it does |
137
+ | ------------------------ | ------------------------------------------------------ |
138
+ | `create-booking-link` | Create a booking link |
139
+ | `update-booking-link` | Update a booking link |
140
140
  | `duplicate-booking-link` | Duplicate a booking link, including co-hosts (`hosts`) |
141
- | `list-booking-links` | List accessible booking links |
142
- | `list-bookings` | List confirmed appointments |
141
+ | `list-booking-links` | List accessible booking links |
142
+ | `list-bookings` | List confirmed appointments |
143
143
 
144
144
  ### External calendars
145
145
 
146
146
  Read-only ICS feeds.
147
147
 
148
- | Action | What it does |
149
- | --- | --- |
150
- | `add-external-calendar` | Subscribe to a read-only ICS/webcal feed |
151
- | `list-external-calendars` | List subscribed feeds |
152
- | `remove-external-calendar` | Remove a subscribed feed |
153
- | `update-external-calendars` | Update subscribed feeds |
148
+ | Action | What it does |
149
+ | --------------------------- | ---------------------------------------- |
150
+ | `add-external-calendar` | Subscribe to a read-only ICS/webcal feed |
151
+ | `list-external-calendars` | List subscribed feeds |
152
+ | `remove-external-calendar` | Remove a subscribed feed |
153
+ | `update-external-calendars` | Update subscribed feeds |
154
154
 
155
155
  ### People & overlays
156
156
 
157
- | Action | What it does |
158
- | --- | --- |
159
- | `search-people` | Search Google Contacts and the Workspace directory |
160
- | `get-overlay-people` | Read the other people whose calendars are pinned into your view |
157
+ | Action | What it does |
158
+ | ----------------------- | ----------------------------------------------------------------- |
159
+ | `search-people` | Search Google Contacts and the Workspace directory |
160
+ | `get-overlay-people` | Read the other people whose calendars are pinned into your view |
161
161
  | `update-overlay-people` | Update the other people whose calendars are pinned into your view |
162
162
 
163
163
  ### Zoom
164
164
 
165
- | Action | What it does |
166
- | --- | --- |
165
+ | Action | What it does |
166
+ | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
167
167
  | `get-zoom-status` | Read the current user's Zoom connection status. Connect and disconnect happen through `/_agent-native/zoom/*` routes, not an action, since OAuth needs the signed-in browser session |
168
168
 
169
169
  ### Google Calendar connection & sync
170
170
 
171
- | Action | What it does |
172
- | --- | --- |
171
+ | Action | What it does |
172
+ | ------------------------- | -------------------------------------------------------------- |
173
173
  | `connect-google-calendar` | Return the OAuth connect URL for the signed-in browser session |
174
- | `sync-google-calendar` | Force a resync |
174
+ | `sync-google-calendar` | Force a resync |
175
175
 
176
176
  ### Settings & preferences
177
177
 
178
- | Action | What it does |
179
- | --- | --- |
180
- | `get-settings` | Read user-level settings |
181
- | `update-settings` | Update user-level settings |
178
+ | Action | What it does |
179
+ | ------------------------------------ | ---------------------------------------------------------------------------------------------------- |
180
+ | `get-settings` | Read user-level settings |
181
+ | `update-settings` | Update user-level settings |
182
182
  | `update-calendar-visual-preferences` | Update local-only display preferences (event colors, hidden weekends). Never touches Google Calendar |
183
183
 
184
184
  ### Navigation & UI state
185
185
 
186
- | Action | What it does |
187
- | --- | --- |
188
- | `navigate` | Move the UI to a view, date, or event |
186
+ | Action | What it does |
187
+ | ------------- | ---------------------------------------- |
188
+ | `navigate` | Move the UI to a view, date, or event |
189
189
  | `view-screen` | Read the current view back for the agent |
190
190
 
191
191
  ### Provider API escalation
192
192
 
193
193
  The raw Google Calendar (and connected CRM) API, for when the actions above are too narrow.
194
194
 
195
- | Action | What it does |
196
- | --- | --- |
197
- | `provider-api-catalog` | List the raw provider APIs available to call directly |
198
- | `provider-api-docs` | Read documentation for a raw provider API endpoint |
199
- | `provider-api-request` | Call the raw Google Calendar (or connected CRM) API directly |
200
- | `list-staged-datasets` | List large scans staged for querying instead of returning raw results |
201
- | `query-staged-dataset` | Query a staged dataset |
202
- | `delete-staged-dataset` | Delete a staged dataset |
195
+ | Action | What it does |
196
+ | ----------------------- | --------------------------------------------------------------------- |
197
+ | `provider-api-catalog` | List the raw provider APIs available to call directly |
198
+ | `provider-api-docs` | Read documentation for a raw provider API endpoint |
199
+ | `provider-api-request` | Call the raw Google Calendar (or connected CRM) API directly |
200
+ | `list-staged-datasets` | List large scans staged for querying instead of returning raw results |
201
+ | `query-staged-dataset` | Query a staged dataset |
202
+ | `delete-staged-dataset` | Delete a staged dataset |
203
203
 
204
204
  ## Data model
205
205
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.172.9",
3
+ "version": "0.173.0-nightly-20260825065619",
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": {