@n8n/telemetry 1.1.1 → 1.2.1

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.
@@ -1,101 +1,584 @@
1
1
  import { z } from 'zod/v4';
2
2
  export declare const AGENTS_TELEMETRY: {
3
- readonly AGENT_PUBLISHED: {
4
- readonly name: "Agent published";
5
- readonly description: "An agent version became the active published version, from any surface (editor Publish button, builder publish_agent tool, chat-channel connect auto-publish, or Slack app setup auto-publish). Does not fire for idempotent no-op publishes.";
3
+ readonly AGENT_SETUP_COMPLETED: {
4
+ readonly name: "Agent setup completed";
5
+ readonly description: "The first time an agent reached a complete setup: it passes the same validation the Publish button requires, and has at least one configured capability. Fires at most once per agent, guarded by the persisted `agents.setupCompletedAt`. Emitted from the config-save path, with the publish path as a backstop so a published agent is always marked first.";
6
+ readonly properties: z.ZodObject<{
7
+ agent_id: z.ZodString;
8
+ project_id: z.ZodString;
9
+ user_id: z.ZodOptional<z.ZodString>;
10
+ capability_kinds: z.ZodArray<z.ZodEnum<{
11
+ channel: "channel";
12
+ mcpServer: "mcpServer";
13
+ skill: "skill";
14
+ subAgent: "subAgent";
15
+ task: "task";
16
+ tool: "tool";
17
+ vectorStore: "vectorStore";
18
+ }>>;
19
+ capability_count: z.ZodNumber;
20
+ tool_count: z.ZodNumber;
21
+ skill_count: z.ZodNumber;
22
+ sub_agent_count: z.ZodNumber;
23
+ mcp_server_count: z.ZodNumber;
24
+ vector_store_count: z.ZodNumber;
25
+ task_count: z.ZodNumber;
26
+ trigger_count: z.ZodNumber;
27
+ status: z.ZodEnum<{
28
+ draft: "draft";
29
+ production: "production";
30
+ }>;
31
+ }, z.core.$strip>;
32
+ } & import("../define").TelemetryEventInput & {
33
+ readonly getValidationError: (properties: unknown) => string | null;
34
+ };
35
+ readonly AGENT_EXECUTION_COUNT: {
36
+ readonly name: "Agent execution count";
37
+ readonly description: "Six-hourly pulse of aggregate agent usage, bucketed by agent, run type and optional user. event_version 2 added run_type; version 1 rows are a mix of test and production and must not be read as production. token_count is broader than \"Agent session metrics\".cost_sum: it also covers LLM calls belonging to no single turn (title generation, observational/episodic memory, embeddings).";
38
+ readonly properties: z.ZodObject<{
39
+ event_version: z.ZodLiteral<"2">;
40
+ agent_id: z.ZodString;
41
+ user_id: z.ZodOptional<z.ZodString>;
42
+ run_type: z.ZodEnum<{
43
+ production: "production";
44
+ test: "test";
45
+ }>;
46
+ message_count: z.ZodNumber;
47
+ token_count: z.ZodNumber;
48
+ tool_call_count: z.ZodNumber;
49
+ }, z.core.$strip>;
50
+ } & import("../define").TelemetryEventInput & {
51
+ readonly getValidationError: (properties: unknown) => string | null;
52
+ };
53
+ readonly AGENT_SESSION_METRICS: {
54
+ readonly name: "Agent session metrics";
55
+ readonly description: "Six-hourly pulse of agent session and turn metrics, bucketed by agent, run type, turn status and configuration. Two token numbers exist across the agent events and they measure different things: token_count_sum here covers only the recorded turns, from the same usage as cost_sum so the two reconcile, while token_count on \"Agent execution count\" additionally covers LLM calls belonging to no turn (title generation, observational/episodic memory, embeddings) and so runs higher.";
56
+ readonly properties: z.ZodObject<{
57
+ model: z.ZodNullable<z.ZodString>;
58
+ channels: z.ZodArray<z.ZodString>;
59
+ tool_types: z.ZodArray<z.ZodString>;
60
+ tool_count: z.ZodNumber;
61
+ num_skills: z.ZodNumber;
62
+ memory_type: z.ZodEnum<{
63
+ n8n: "n8n";
64
+ n8n_episodic: "n8n_episodic";
65
+ n8n_observational: "n8n_observational";
66
+ n8n_observational_episodic: "n8n_observational_episodic";
67
+ none: "none";
68
+ }>;
69
+ event_version: z.ZodLiteral<"1">;
70
+ agent_id: z.ZodString;
71
+ agent_type: z.ZodOptional<z.ZodLiteral<"inline">>;
72
+ run_type: z.ZodEnum<{
73
+ production: "production";
74
+ test: "test";
75
+ }>;
76
+ turn_status: z.ZodEnum<{
77
+ failed: "failed";
78
+ succeeded: "succeeded";
79
+ }>;
80
+ session_count: z.ZodNumber;
81
+ turn_count: z.ZodNumber;
82
+ latency_ms_sum: z.ZodNumber;
83
+ cost_sum: z.ZodNumber;
84
+ token_count_sum: z.ZodNumber;
85
+ tool_call_count_sum: z.ZodNumber;
86
+ num_skills_sum: z.ZodNumber;
87
+ }, z.core.$strip>;
88
+ } & import("../define").TelemetryEventInput & {
89
+ readonly getValidationError: (properties: unknown) => string | null;
90
+ };
91
+ readonly BUILDER_CREATED_AGENT: {
92
+ readonly name: "Builder created agent";
93
+ readonly description: "The Instance AI builder was the first surface to configure an agent. One of three same-shaped creation events (\"User created agent\", \"MCP created agent\") — union them for total agent creation, or read one for that surface alone. Emitted from `AgentConfigService.updateConfig` on the agent's first configuring write, so the builder minting an agent row emits nothing and a build that fails before writing config never counts. event_version 2 replaced thread_id with user_id, moved the emit from the frontend-facing delegate wrapper to the config-save path, and added the write profile.";
6
94
  readonly properties: z.ZodObject<{
7
95
  agent_id: z.ZodString;
8
96
  project_id: z.ZodString;
9
97
  user_id: z.ZodString;
10
- source: z.ZodEnum<{
11
- builder: "builder";
98
+ capability_kinds: z.ZodArray<z.ZodEnum<{
99
+ channel: "channel";
100
+ mcpServer: "mcpServer";
101
+ skill: "skill";
102
+ subAgent: "subAgent";
103
+ task: "task";
104
+ tool: "tool";
105
+ vectorStore: "vectorStore";
106
+ }>>;
107
+ capability_count: z.ZodNumber;
108
+ tool_count: z.ZodNumber;
109
+ skill_count: z.ZodNumber;
110
+ sub_agent_count: z.ZodNumber;
111
+ mcp_server_count: z.ZodNumber;
112
+ vector_store_count: z.ZodNumber;
113
+ task_count: z.ZodNumber;
114
+ trigger_count: z.ZodNumber;
115
+ model: z.ZodNullable<z.ZodString>;
116
+ tool_types: z.ZodArray<z.ZodString>;
117
+ changed_parts: z.ZodArray<z.ZodEnum<{
118
+ config: "config";
119
+ credential: "credential";
120
+ instructions: "instructions";
121
+ mcpServers: "mcpServers";
122
+ memory: "memory";
123
+ model: "model";
124
+ name: "name";
125
+ providerTools: "providerTools";
126
+ skills: "skills";
127
+ subAgents: "subAgents";
128
+ tasks: "tasks";
129
+ tools: "tools";
130
+ triggers: "triggers";
131
+ vectorStores: "vectorStores";
132
+ }>>;
133
+ has_published_version: z.ZodBoolean;
134
+ event_version: z.ZodLiteral<"2">;
135
+ }, z.core.$strip>;
136
+ } & import("../define").TelemetryEventInput & {
137
+ readonly getValidationError: (properties: unknown) => string | null;
138
+ };
139
+ readonly USER_CREATED_AGENT: {
140
+ readonly name: "User created agent";
141
+ readonly description: "A user was the first surface to configure an agent, from the editor. One of three same-shaped creation events (\"Builder created agent\", \"MCP created agent\") — union them for total agent creation, or read one for that surface alone. Emitted from `AgentConfigService.updateConfig` on the agent's first configuring write: agents are created lazily and the row alone emits nothing, so this fires when the agent gains a model, instructions or a capability rather than on the click, and an abandoned new-agent flow never counts. A rename or an icon change does not qualify. \"User clicked new agent\" carries the same agent_id, so the two join into a click-to-creation funnel whose gap is abandoned flows. event_version 2 dropped source (editor-only knowledge, still on the click event), added project_id, user_id and the write profile, and moved the emit to the backend.";
142
+ readonly properties: z.ZodObject<{
143
+ agent_id: z.ZodString;
144
+ project_id: z.ZodString;
145
+ user_id: z.ZodString;
146
+ capability_kinds: z.ZodArray<z.ZodEnum<{
147
+ channel: "channel";
148
+ mcpServer: "mcpServer";
149
+ skill: "skill";
150
+ subAgent: "subAgent";
151
+ task: "task";
152
+ tool: "tool";
153
+ vectorStore: "vectorStore";
154
+ }>>;
155
+ capability_count: z.ZodNumber;
156
+ tool_count: z.ZodNumber;
157
+ skill_count: z.ZodNumber;
158
+ sub_agent_count: z.ZodNumber;
159
+ mcp_server_count: z.ZodNumber;
160
+ vector_store_count: z.ZodNumber;
161
+ task_count: z.ZodNumber;
162
+ trigger_count: z.ZodNumber;
163
+ model: z.ZodNullable<z.ZodString>;
164
+ tool_types: z.ZodArray<z.ZodString>;
165
+ changed_parts: z.ZodArray<z.ZodEnum<{
166
+ config: "config";
167
+ credential: "credential";
168
+ instructions: "instructions";
169
+ mcpServers: "mcpServers";
170
+ memory: "memory";
171
+ model: "model";
172
+ name: "name";
173
+ providerTools: "providerTools";
174
+ skills: "skills";
175
+ subAgents: "subAgents";
176
+ tasks: "tasks";
177
+ tools: "tools";
178
+ triggers: "triggers";
179
+ vectorStores: "vectorStores";
180
+ }>>;
181
+ has_published_version: z.ZodBoolean;
182
+ event_version: z.ZodLiteral<"2">;
183
+ }, z.core.$strip>;
184
+ } & import("../define").TelemetryEventInput & {
185
+ readonly getValidationError: (properties: unknown) => string | null;
186
+ };
187
+ readonly MCP_CREATED_AGENT: {
188
+ readonly name: "MCP created agent";
189
+ readonly description: "An MCP client was the first surface to configure an agent, through the `create_agent` or `mutate_agent` tool. One of three same-shaped creation events (\"User created agent\", \"Builder created agent\") — union them for total agent creation, or read one for that surface alone. Emitted from `AgentConfigService.updateConfig` on the agent's first configuring write, so a `create_agent` call carrying no initial config emits nothing until something configures the agent. The coarser \"User called mcp tool\" event also fires for the same call.";
190
+ readonly properties: z.ZodObject<{
191
+ agent_id: z.ZodString;
192
+ project_id: z.ZodString;
193
+ user_id: z.ZodString;
194
+ capability_kinds: z.ZodArray<z.ZodEnum<{
195
+ channel: "channel";
196
+ mcpServer: "mcpServer";
197
+ skill: "skill";
198
+ subAgent: "subAgent";
199
+ task: "task";
200
+ tool: "tool";
201
+ vectorStore: "vectorStore";
202
+ }>>;
203
+ capability_count: z.ZodNumber;
204
+ tool_count: z.ZodNumber;
205
+ skill_count: z.ZodNumber;
206
+ sub_agent_count: z.ZodNumber;
207
+ mcp_server_count: z.ZodNumber;
208
+ vector_store_count: z.ZodNumber;
209
+ task_count: z.ZodNumber;
210
+ trigger_count: z.ZodNumber;
211
+ model: z.ZodNullable<z.ZodString>;
212
+ tool_types: z.ZodArray<z.ZodString>;
213
+ changed_parts: z.ZodArray<z.ZodEnum<{
214
+ config: "config";
215
+ credential: "credential";
216
+ instructions: "instructions";
217
+ mcpServers: "mcpServers";
218
+ memory: "memory";
219
+ model: "model";
220
+ name: "name";
221
+ providerTools: "providerTools";
222
+ skills: "skills";
223
+ subAgents: "subAgents";
224
+ tasks: "tasks";
225
+ tools: "tools";
226
+ triggers: "triggers";
227
+ vectorStores: "vectorStores";
228
+ }>>;
229
+ has_published_version: z.ZodBoolean;
230
+ event_version: z.ZodLiteral<"1">;
231
+ }, z.core.$strip>;
232
+ } & import("../define").TelemetryEventInput & {
233
+ readonly getValidationError: (properties: unknown) => string | null;
234
+ };
235
+ readonly USER_MODIFIED_AGENT: {
236
+ readonly name: "User modified agent";
237
+ readonly description: "A user saved a change to an agent that was already configured, from the editor. One of three same-shaped modification events (\"Builder modified agent\", \"MCP modified agent\") — union them for total agent modification, or read one for that surface alone. Emitted once per save from `AgentConfigService.updateConfig`; a save that changed nothing emits nothing, and the agent's first configuring write emits the matching creation event instead — so a write is never counted as both, and this event is not inflated by every agent's birth. The capability counts mirror \"Agent setup completed\", so a profile at each modification lines up with the profile at setup completion. Replaces the per-part \"User edited agent config\" and the per-item \"User added/removed tools/skills/tasks\" and \"User added/removed agent tool\" events, which fired several times for a single save and never covered the builder or MCP.";
238
+ readonly properties: z.ZodObject<{
239
+ agent_id: z.ZodString;
240
+ project_id: z.ZodString;
241
+ user_id: z.ZodString;
242
+ capability_kinds: z.ZodArray<z.ZodEnum<{
243
+ channel: "channel";
244
+ mcpServer: "mcpServer";
245
+ skill: "skill";
246
+ subAgent: "subAgent";
247
+ task: "task";
248
+ tool: "tool";
249
+ vectorStore: "vectorStore";
250
+ }>>;
251
+ capability_count: z.ZodNumber;
252
+ tool_count: z.ZodNumber;
253
+ skill_count: z.ZodNumber;
254
+ sub_agent_count: z.ZodNumber;
255
+ mcp_server_count: z.ZodNumber;
256
+ vector_store_count: z.ZodNumber;
257
+ task_count: z.ZodNumber;
258
+ trigger_count: z.ZodNumber;
259
+ model: z.ZodNullable<z.ZodString>;
260
+ tool_types: z.ZodArray<z.ZodString>;
261
+ changed_parts: z.ZodArray<z.ZodEnum<{
262
+ config: "config";
263
+ credential: "credential";
264
+ instructions: "instructions";
265
+ mcpServers: "mcpServers";
266
+ memory: "memory";
267
+ model: "model";
268
+ name: "name";
269
+ providerTools: "providerTools";
270
+ skills: "skills";
271
+ subAgents: "subAgents";
272
+ tasks: "tasks";
273
+ tools: "tools";
274
+ triggers: "triggers";
275
+ vectorStores: "vectorStores";
276
+ }>>;
277
+ has_published_version: z.ZodBoolean;
278
+ event_version: z.ZodLiteral<"1">;
279
+ }, z.core.$strip>;
280
+ } & import("../define").TelemetryEventInput & {
281
+ readonly getValidationError: (properties: unknown) => string | null;
282
+ };
283
+ readonly BUILDER_MODIFIED_AGENT: {
284
+ readonly name: "Builder modified agent";
285
+ readonly description: "The Instance AI builder saved a change to an agent that was already configured. One of three same-shaped modification events (\"User modified agent\", \"MCP modified agent\") — union them for total agent modification, or read one for that surface alone. Emitted once per save from `AgentConfigService.updateConfig`; a save that changed nothing emits nothing, and the agent's first configuring write emits \"Builder created agent\" instead. The capability counts mirror \"Agent setup completed\", so a profile at each modification lines up with the profile at setup completion. Replaces the per-item \"Builder added tools/skills to agent\" and \"Builder removed tasks from agent\" events.";
286
+ readonly properties: z.ZodObject<{
287
+ agent_id: z.ZodString;
288
+ project_id: z.ZodString;
289
+ user_id: z.ZodString;
290
+ capability_kinds: z.ZodArray<z.ZodEnum<{
291
+ channel: "channel";
292
+ mcpServer: "mcpServer";
293
+ skill: "skill";
294
+ subAgent: "subAgent";
295
+ task: "task";
296
+ tool: "tool";
297
+ vectorStore: "vectorStore";
298
+ }>>;
299
+ capability_count: z.ZodNumber;
300
+ tool_count: z.ZodNumber;
301
+ skill_count: z.ZodNumber;
302
+ sub_agent_count: z.ZodNumber;
303
+ mcp_server_count: z.ZodNumber;
304
+ vector_store_count: z.ZodNumber;
305
+ task_count: z.ZodNumber;
306
+ trigger_count: z.ZodNumber;
307
+ model: z.ZodNullable<z.ZodString>;
308
+ tool_types: z.ZodArray<z.ZodString>;
309
+ changed_parts: z.ZodArray<z.ZodEnum<{
310
+ config: "config";
311
+ credential: "credential";
312
+ instructions: "instructions";
313
+ mcpServers: "mcpServers";
314
+ memory: "memory";
315
+ model: "model";
316
+ name: "name";
317
+ providerTools: "providerTools";
318
+ skills: "skills";
319
+ subAgents: "subAgents";
320
+ tasks: "tasks";
321
+ tools: "tools";
322
+ triggers: "triggers";
323
+ vectorStores: "vectorStores";
324
+ }>>;
325
+ has_published_version: z.ZodBoolean;
326
+ event_version: z.ZodLiteral<"1">;
327
+ }, z.core.$strip>;
328
+ } & import("../define").TelemetryEventInput & {
329
+ readonly getValidationError: (properties: unknown) => string | null;
330
+ };
331
+ readonly MCP_MODIFIED_AGENT: {
332
+ readonly name: "MCP modified agent";
333
+ readonly description: "An MCP client saved a change to an agent that was already configured, through the `create_agent` or `mutate_agent` tool. One of three same-shaped modification events (\"User modified agent\", \"Builder modified agent\") — union them for total agent modification, or read one for that surface alone. Emitted once per save from `AgentConfigService.updateConfig`; a save that changed nothing emits nothing, and the agent's first configuring write emits \"MCP created agent\" instead. The capability counts mirror \"Agent setup completed\", so a profile at each modification lines up with the profile at setup completion. This surface had no modification telemetry before. The coarser \"User called mcp tool\" event also fires for the same call.";
334
+ readonly properties: z.ZodObject<{
335
+ agent_id: z.ZodString;
336
+ project_id: z.ZodString;
337
+ user_id: z.ZodString;
338
+ capability_kinds: z.ZodArray<z.ZodEnum<{
339
+ channel: "channel";
340
+ mcpServer: "mcpServer";
341
+ skill: "skill";
342
+ subAgent: "subAgent";
343
+ task: "task";
344
+ tool: "tool";
345
+ vectorStore: "vectorStore";
346
+ }>>;
347
+ capability_count: z.ZodNumber;
348
+ tool_count: z.ZodNumber;
349
+ skill_count: z.ZodNumber;
350
+ sub_agent_count: z.ZodNumber;
351
+ mcp_server_count: z.ZodNumber;
352
+ vector_store_count: z.ZodNumber;
353
+ task_count: z.ZodNumber;
354
+ trigger_count: z.ZodNumber;
355
+ model: z.ZodNullable<z.ZodString>;
356
+ tool_types: z.ZodArray<z.ZodString>;
357
+ changed_parts: z.ZodArray<z.ZodEnum<{
358
+ config: "config";
359
+ credential: "credential";
360
+ instructions: "instructions";
361
+ mcpServers: "mcpServers";
362
+ memory: "memory";
363
+ model: "model";
364
+ name: "name";
365
+ providerTools: "providerTools";
366
+ skills: "skills";
367
+ subAgents: "subAgents";
368
+ tasks: "tasks";
369
+ tools: "tools";
370
+ triggers: "triggers";
371
+ vectorStores: "vectorStores";
372
+ }>>;
373
+ has_published_version: z.ZodBoolean;
374
+ event_version: z.ZodLiteral<"1">;
375
+ }, z.core.$strip>;
376
+ } & import("../define").TelemetryEventInput & {
377
+ readonly getValidationError: (properties: unknown) => string | null;
378
+ };
379
+ readonly USER_PUBLISHED_AGENT: {
380
+ readonly name: "User published agent";
381
+ readonly description: "A user explicitly published an agent version, making it the active one. One of three same-shaped publish events (\"Builder published agent\", \"MCP published agent\") — union them for total agent publishing, or read one for that surface alone. Emitted from `AgentPublishService.publishAgent`; an idempotent no-op publish emits nothing. `republish` identifies a rollback to an older snapshot; `channel_connect` and `slack_setup` are retained only as historical trigger values. event_version 2 moved the emit from the frontend to the backend, which replaced the editor-only scope (version-history publishes were missing) with every user surface, dropped config_version, status and session_id, and added project_id, user_id, trigger, version_id and the capability profile.";
382
+ readonly properties: z.ZodObject<{
383
+ agent_id: z.ZodString;
384
+ project_id: z.ZodString;
385
+ user_id: z.ZodString;
386
+ capability_kinds: z.ZodArray<z.ZodEnum<{
387
+ channel: "channel";
388
+ mcpServer: "mcpServer";
389
+ skill: "skill";
390
+ subAgent: "subAgent";
391
+ task: "task";
392
+ tool: "tool";
393
+ vectorStore: "vectorStore";
394
+ }>>;
395
+ capability_count: z.ZodNumber;
396
+ tool_count: z.ZodNumber;
397
+ skill_count: z.ZodNumber;
398
+ sub_agent_count: z.ZodNumber;
399
+ mcp_server_count: z.ZodNumber;
400
+ vector_store_count: z.ZodNumber;
401
+ task_count: z.ZodNumber;
402
+ trigger_count: z.ZodNumber;
403
+ model: z.ZodNullable<z.ZodString>;
404
+ tool_types: z.ZodArray<z.ZodString>;
405
+ trigger: z.ZodEnum<{
12
406
  channel_connect: "channel_connect";
13
- editor: "editor";
407
+ explicit: "explicit";
408
+ republish: "republish";
14
409
  slack_setup: "slack_setup";
15
410
  }>;
16
411
  version_id: z.ZodString;
412
+ event_version: z.ZodLiteral<"2">;
17
413
  }, z.core.$strip>;
18
414
  } & import("../define").TelemetryEventInput & {
19
415
  readonly getValidationError: (properties: unknown) => string | null;
20
416
  };
21
- readonly AGENT_UNPUBLISHED: {
22
- readonly name: "Agent unpublished";
23
- readonly description: "An agent was unpublished, clearing its active version, from either the editor Unpublish button or the builder unpublish_agent tool.";
417
+ readonly BUILDER_PUBLISHED_AGENT: {
418
+ readonly name: "Builder published agent";
419
+ readonly description: "The Instance AI builder published an agent version through its publish_agent tool. One of three same-shaped publish events (\"User published agent\", \"MCP published agent\") — union them for total agent publishing, or read one for that surface alone. Emitted from `AgentPublishService.publishAgent`; an idempotent no-op publish emits nothing.";
24
420
  readonly properties: z.ZodObject<{
25
421
  agent_id: z.ZodString;
26
422
  project_id: z.ZodString;
27
423
  user_id: z.ZodString;
28
- source: z.ZodEnum<{
29
- builder: "builder";
30
- editor: "editor";
424
+ capability_kinds: z.ZodArray<z.ZodEnum<{
425
+ channel: "channel";
426
+ mcpServer: "mcpServer";
427
+ skill: "skill";
428
+ subAgent: "subAgent";
429
+ task: "task";
430
+ tool: "tool";
431
+ vectorStore: "vectorStore";
432
+ }>>;
433
+ capability_count: z.ZodNumber;
434
+ tool_count: z.ZodNumber;
435
+ skill_count: z.ZodNumber;
436
+ sub_agent_count: z.ZodNumber;
437
+ mcp_server_count: z.ZodNumber;
438
+ vector_store_count: z.ZodNumber;
439
+ task_count: z.ZodNumber;
440
+ trigger_count: z.ZodNumber;
441
+ model: z.ZodNullable<z.ZodString>;
442
+ tool_types: z.ZodArray<z.ZodString>;
443
+ trigger: z.ZodEnum<{
444
+ channel_connect: "channel_connect";
445
+ explicit: "explicit";
446
+ republish: "republish";
447
+ slack_setup: "slack_setup";
31
448
  }>;
449
+ version_id: z.ZodString;
450
+ event_version: z.ZodLiteral<"1">;
32
451
  }, z.core.$strip>;
33
452
  } & import("../define").TelemetryEventInput & {
34
453
  readonly getValidationError: (properties: unknown) => string | null;
35
454
  };
36
- readonly BUILDER_ADDED_TOOLS: {
37
- readonly name: "Builder added tools to agent";
38
- readonly description: "The Instance AI builder saved an agent config that added a tool, mirroring the frontend \"User added tools to agent\" event so both sources can be aggregated together.";
455
+ readonly MCP_PUBLISHED_AGENT: {
456
+ readonly name: "MCP published agent";
457
+ readonly description: "An MCP client explicitly published an agent version through the `publish_agent` tool. One of three same-shaped publish events (\"User published agent\", \"Builder published agent\") — union them for total agent publishing, or read one for that surface alone. Emitted from `AgentPublishService.publishAgent`; an idempotent no-op publish emits nothing. Before this event existed these publishes were reported as \"Agent published\" with source \"builder\", so they were indistinguishable from Instance AI builder publishes.";
39
458
  readonly properties: z.ZodObject<{
40
459
  agent_id: z.ZodString;
460
+ project_id: z.ZodString;
41
461
  user_id: z.ZodString;
42
- thread_id: z.ZodOptional<z.ZodString>;
43
- run_id: z.ZodOptional<z.ZodString>;
44
- tool_added: z.ZodString;
45
- tools: z.ZodArray<z.ZodString>;
46
- status: z.ZodEnum<{
47
- draft: "draft";
48
- production: "production";
462
+ capability_kinds: z.ZodArray<z.ZodEnum<{
463
+ channel: "channel";
464
+ mcpServer: "mcpServer";
465
+ skill: "skill";
466
+ subAgent: "subAgent";
467
+ task: "task";
468
+ tool: "tool";
469
+ vectorStore: "vectorStore";
470
+ }>>;
471
+ capability_count: z.ZodNumber;
472
+ tool_count: z.ZodNumber;
473
+ skill_count: z.ZodNumber;
474
+ sub_agent_count: z.ZodNumber;
475
+ mcp_server_count: z.ZodNumber;
476
+ vector_store_count: z.ZodNumber;
477
+ task_count: z.ZodNumber;
478
+ trigger_count: z.ZodNumber;
479
+ model: z.ZodNullable<z.ZodString>;
480
+ tool_types: z.ZodArray<z.ZodString>;
481
+ trigger: z.ZodEnum<{
482
+ channel_connect: "channel_connect";
483
+ explicit: "explicit";
484
+ republish: "republish";
485
+ slack_setup: "slack_setup";
49
486
  }>;
487
+ version_id: z.ZodString;
488
+ event_version: z.ZodLiteral<"1">;
50
489
  }, z.core.$strip>;
51
490
  } & import("../define").TelemetryEventInput & {
52
491
  readonly getValidationError: (properties: unknown) => string | null;
53
492
  };
54
- readonly BUILDER_ADDED_SKILLS: {
55
- readonly name: "Builder added skills to agent";
56
- readonly description: "The Instance AI builder saved an agent config that added a skill, mirroring the frontend \"User added skills to agent\" event.";
493
+ readonly USER_UNPUBLISHED_AGENT: {
494
+ readonly name: "User unpublished agent";
495
+ readonly description: "A user unpublished an agent, clearing its active version. One of three same-shaped unpublish events (\"Builder unpublished agent\", \"MCP unpublished agent\") — union them for total agent unpublishing, or read one for that surface alone. Emitted from `AgentPublishService.unpublishAgent`. Unlike the publish events these carry no trigger (there is one way to unpublish) and no capability profile. event_version 2 moved the emit from the frontend to the backend and replaced status and session_id with project_id and user_id.";
57
496
  readonly properties: z.ZodObject<{
58
497
  agent_id: z.ZodString;
498
+ project_id: z.ZodString;
59
499
  user_id: z.ZodString;
60
- thread_id: z.ZodOptional<z.ZodString>;
61
- run_id: z.ZodOptional<z.ZodString>;
62
- skill_added: z.ZodString;
63
- skills: z.ZodArray<z.ZodString>;
64
- status: z.ZodEnum<{
65
- draft: "draft";
66
- production: "production";
67
- }>;
500
+ event_version: z.ZodLiteral<"2">;
68
501
  }, z.core.$strip>;
69
502
  } & import("../define").TelemetryEventInput & {
70
503
  readonly getValidationError: (properties: unknown) => string | null;
71
504
  };
72
- readonly BUILDER_ADDED_TASKS: {
73
- readonly name: "Builder added tasks to agent";
74
- readonly description: "The Instance AI builder saved an agent config that added a scheduled task, mirroring the frontend \"User added tasks to agent\" event.";
505
+ readonly BUILDER_UNPUBLISHED_AGENT: {
506
+ readonly name: "Builder unpublished agent";
507
+ readonly description: "The Instance AI builder unpublished an agent through its unpublish_agent tool. One of three same-shaped unpublish events (\"User unpublished agent\", \"MCP unpublished agent\") — union them for total agent unpublishing, or read one for that surface alone. Emitted from `AgentPublishService.unpublishAgent`.";
75
508
  readonly properties: z.ZodObject<{
76
509
  agent_id: z.ZodString;
510
+ project_id: z.ZodString;
77
511
  user_id: z.ZodString;
78
- thread_id: z.ZodOptional<z.ZodString>;
79
- run_id: z.ZodOptional<z.ZodString>;
80
- task_added: z.ZodString;
81
- tasks: z.ZodArray<z.ZodString>;
82
- status: z.ZodEnum<{
83
- draft: "draft";
84
- production: "production";
85
- }>;
512
+ event_version: z.ZodLiteral<"1">;
513
+ }, z.core.$strip>;
514
+ } & import("../define").TelemetryEventInput & {
515
+ readonly getValidationError: (properties: unknown) => string | null;
516
+ };
517
+ readonly MCP_UNPUBLISHED_AGENT: {
518
+ readonly name: "MCP unpublished agent";
519
+ readonly description: "An MCP client unpublished an agent through the `unpublish_agent` tool. One of three same-shaped unpublish events (\"User unpublished agent\", \"Builder unpublished agent\") — union them for total agent unpublishing, or read one for that surface alone. Emitted from `AgentPublishService.unpublishAgent`. Before this event existed these unpublishes were reported as \"Agent unpublished\" with source \"builder\", so they were indistinguishable from Instance AI builder unpublishes.";
520
+ readonly properties: z.ZodObject<{
521
+ agent_id: z.ZodString;
522
+ project_id: z.ZodString;
523
+ user_id: z.ZodString;
524
+ event_version: z.ZodLiteral<"1">;
525
+ }, z.core.$strip>;
526
+ } & import("../define").TelemetryEventInput & {
527
+ readonly getValidationError: (properties: unknown) => string | null;
528
+ };
529
+ readonly INSTANCE_AI_OPENED_FROM_AGENT_PREVIEW: {
530
+ readonly name: "Instance AI opened from agent preview";
531
+ readonly description: "The user handed a preview chat session off to Instance AI from the agent builder preview panel.";
532
+ readonly properties: z.ZodObject<{
533
+ agent_id: z.ZodString;
534
+ preview_thread_id: z.ZodString;
535
+ preview_execution_id: z.ZodOptional<z.ZodString>;
536
+ }, z.core.$strip>;
537
+ } & import("../define").TelemetryEventInput & {
538
+ readonly getValidationError: (properties: unknown) => string | null;
539
+ };
540
+ readonly USER_GAVE_MCP_ACCESS_TO_AGENT: {
541
+ readonly name: "User gave MCP access to agent";
542
+ readonly description: "An agent was exposed over MCP. The sibling \"User gave MCP access to workflow\" and \"User toggled MCP access\" events are not registered.";
543
+ readonly properties: z.ZodObject<{
544
+ agent_id: z.ZodString;
86
545
  }, z.core.$strip>;
87
546
  } & import("../define").TelemetryEventInput & {
88
547
  readonly getValidationError: (properties: unknown) => string | null;
89
548
  };
90
- readonly BUILDER_REMOVED_TASKS: {
91
- readonly name: "Builder removed tasks from agent";
92
- readonly description: "The Instance AI builder saved an agent config that removed a scheduled task, mirroring the frontend \"User removed tasks from agent\" event.";
549
+ readonly USER_SELECTED_AGENTS_FOR_MCP: {
550
+ readonly name: "User selected agent from list";
551
+ readonly description: "The user confirmed a bulk agent selection in the MCP connect-agents dialog. Property is camelCase for warehouse continuity with existing rows.";
552
+ readonly properties: z.ZodObject<{
553
+ agentIds: z.ZodArray<z.ZodString>;
554
+ count: z.ZodNumber;
555
+ }, z.core.$strip>;
556
+ } & import("../define").TelemetryEventInput & {
557
+ readonly getValidationError: (properties: unknown) => string | null;
558
+ };
559
+ readonly USER_DISMISSED_MCP_AGENTS_DIALOG: {
560
+ readonly name: "User dismissed mcp agents dialog";
561
+ readonly description: "The user closed the MCP connect-agents dialog without confirming a selection.";
562
+ readonly properties: z.ZodObject<{}, z.core.$strip>;
563
+ } & import("../define").TelemetryEventInput & {
564
+ readonly getValidationError: (properties: unknown) => string | null;
565
+ };
566
+ readonly USER_CLICKED_CONNECT_AGENTS_FROM_MCP_SETTINGS: {
567
+ readonly name: "User clicked connect agents from mcp settings";
568
+ readonly description: "The user opened the MCP connect-agents dialog from the MCP settings page.";
569
+ readonly properties: z.ZodObject<{}, z.core.$strip>;
570
+ } & import("../define").TelemetryEventInput & {
571
+ readonly getValidationError: (properties: unknown) => string | null;
572
+ };
573
+ readonly BUILDER_ADDED_TASKS: {
574
+ readonly name: "Builder added tasks to agent";
575
+ readonly description: "The Instance AI builder created a scheduled task through the `create_tasks` tool. That path persists outside `AgentConfigService.updateConfig`, so it is not covered by \"Builder modified agent\" — this event stays until the task write path is folded in.";
93
576
  readonly properties: z.ZodObject<{
94
577
  agent_id: z.ZodString;
95
578
  user_id: z.ZodString;
96
579
  thread_id: z.ZodOptional<z.ZodString>;
97
580
  run_id: z.ZodOptional<z.ZodString>;
98
- task_removed: z.ZodString;
581
+ task_added: z.ZodString;
99
582
  tasks: z.ZodArray<z.ZodString>;
100
583
  status: z.ZodEnum<{
101
584
  draft: "draft";
@@ -107,7 +590,7 @@ export declare const AGENTS_TELEMETRY: {
107
590
  };
108
591
  readonly BUILDER_ADDED_TRIGGER: {
109
592
  readonly name: "Builder added trigger to agent";
110
- readonly description: "The Instance AI builder connected a chat channel to the target agent via the configure_channel tool, mirroring the frontend \"User added trigger to agent\" event.";
593
+ readonly description: "The Instance AI builder configured and persisted a chat channel for the target agent through the configure_channel tool, mirroring the frontend \"User added trigger to agent\" event.";
111
594
  readonly properties: z.ZodObject<{
112
595
  agent_id: z.ZodString;
113
596
  user_id: z.ZodString;
@@ -183,24 +666,15 @@ export declare const AGENTS_TELEMETRY: {
183
666
  };
184
667
  readonly USER_CLICKED_NEW_AGENT: {
185
668
  readonly name: "User clicked new agent";
186
- readonly description: "The user clicked a new-agent entry point (button, dropdown, or card).";
669
+ readonly description: "The user clicked a new-agent entry point (button, dropdown, or card). No agent exists at this point — `agent_id` is the id minted for the click, which whichever path later persists the agent creates it under, so this joins to the eventual creation event. Clicks with no matching creation are abandoned new-agent flows.";
187
670
  readonly properties: z.ZodObject<{
188
671
  source: z.ZodEnum<{
189
672
  button: "button";
190
673
  card: "card";
191
674
  dropdown: "dropdown";
192
675
  }>;
193
- session_id: z.ZodString;
194
- }, z.core.$strip>;
195
- } & import("../define").TelemetryEventInput & {
196
- readonly getValidationError: (properties: unknown) => string | null;
197
- };
198
- readonly USER_CREATED_AGENT: {
199
- readonly name: "User created agent";
200
- readonly description: "A draft agent was created, from the blank new-agent page or inline from a workflow surface (source carries the entry point).";
201
- readonly properties: z.ZodObject<{
202
676
  agent_id: z.ZodString;
203
- source: z.ZodString;
677
+ session_id: z.ZodString;
204
678
  }, z.core.$strip>;
205
679
  } & import("../define").TelemetryEventInput & {
206
680
  readonly getValidationError: (properties: unknown) => string | null;
@@ -234,36 +708,9 @@ export declare const AGENTS_TELEMETRY: {
234
708
  } & import("../define").TelemetryEventInput & {
235
709
  readonly getValidationError: (properties: unknown) => string | null;
236
710
  };
237
- readonly USER_EDITED_AGENT_CONFIG: {
238
- readonly name: "User edited agent config";
239
- readonly description: "A builder autosave persisted a config edit; one event fires per changed part.";
240
- readonly properties: z.ZodObject<{
241
- agent_id: z.ZodString;
242
- part: z.ZodEnum<{
243
- description: "description";
244
- instructions: "instructions";
245
- memory: "memory";
246
- model: "model";
247
- name: "name";
248
- skills: "skills";
249
- subAgents: "subAgents";
250
- tools: "tools";
251
- triggers: "triggers";
252
- vectorStores: "vectorStores";
253
- }>;
254
- config_version: z.ZodString;
255
- status: z.ZodEnum<{
256
- draft: "draft";
257
- production: "production";
258
- }>;
259
- session_id: z.ZodString;
260
- }, z.core.$strip>;
261
- } & import("../define").TelemetryEventInput & {
262
- readonly getValidationError: (properties: unknown) => string | null;
263
- };
264
711
  readonly USER_ADDED_TRIGGER_TO_AGENT: {
265
712
  readonly name: "User added trigger to agent";
266
- readonly description: "The user connected a chat trigger to an agent from the builder.";
713
+ readonly description: "The user configured and persisted a chat trigger from the agent builder.";
267
714
  readonly properties: z.ZodObject<{
268
715
  agent_id: z.ZodString;
269
716
  trigger_type: z.ZodString;
@@ -278,97 +725,6 @@ export declare const AGENTS_TELEMETRY: {
278
725
  } & import("../define").TelemetryEventInput & {
279
726
  readonly getValidationError: (properties: unknown) => string | null;
280
727
  };
281
- readonly USER_ADDED_TOOLS_TO_AGENT: {
282
- readonly name: "User added tools to agent";
283
- readonly description: "A saved builder config added a tool; one event fires per newly added tool. Twin of the backend \"Builder added tools to agent\" event.";
284
- readonly properties: z.ZodObject<{
285
- agent_id: z.ZodString;
286
- tool_added: z.ZodString;
287
- tools: z.ZodArray<z.ZodString>;
288
- config_version: z.ZodString;
289
- status: z.ZodEnum<{
290
- draft: "draft";
291
- production: "production";
292
- }>;
293
- session_id: z.ZodString;
294
- }, z.core.$strip>;
295
- } & import("../define").TelemetryEventInput & {
296
- readonly getValidationError: (properties: unknown) => string | null;
297
- };
298
- readonly USER_ADDED_SKILLS_TO_AGENT: {
299
- readonly name: "User added skills to agent";
300
- readonly description: "A saved builder config added a skill; one event fires per newly added skill. Twin of the backend \"Builder added skills to agent\" event.";
301
- readonly properties: z.ZodObject<{
302
- agent_id: z.ZodString;
303
- skill_added: z.ZodString;
304
- skills: z.ZodArray<z.ZodString>;
305
- config_version: z.ZodString;
306
- status: z.ZodEnum<{
307
- draft: "draft";
308
- production: "production";
309
- }>;
310
- session_id: z.ZodString;
311
- }, z.core.$strip>;
312
- } & import("../define").TelemetryEventInput & {
313
- readonly getValidationError: (properties: unknown) => string | null;
314
- };
315
- readonly USER_ADDED_TASKS_TO_AGENT: {
316
- readonly name: "User added tasks to agent";
317
- readonly description: "A saved builder config added a scheduled task; one event fires per newly added task. Twin of the backend \"Builder added tasks to agent\" event.";
318
- readonly properties: z.ZodObject<{
319
- agent_id: z.ZodString;
320
- task_added: z.ZodString;
321
- tasks: z.ZodArray<z.ZodString>;
322
- config_version: z.ZodString;
323
- status: z.ZodEnum<{
324
- draft: "draft";
325
- production: "production";
326
- }>;
327
- session_id: z.ZodString;
328
- }, z.core.$strip>;
329
- } & import("../define").TelemetryEventInput & {
330
- readonly getValidationError: (properties: unknown) => string | null;
331
- };
332
- readonly USER_REMOVED_TASKS_FROM_AGENT: {
333
- readonly name: "User removed tasks from agent";
334
- readonly description: "A saved builder config removed a scheduled task; one event fires per removed task. Twin of the backend \"Builder removed tasks from agent\" event.";
335
- readonly properties: z.ZodObject<{
336
- agent_id: z.ZodString;
337
- task_removed: z.ZodString;
338
- tasks: z.ZodArray<z.ZodString>;
339
- config_version: z.ZodString;
340
- status: z.ZodEnum<{
341
- draft: "draft";
342
- production: "production";
343
- }>;
344
- session_id: z.ZodString;
345
- }, z.core.$strip>;
346
- } & import("../define").TelemetryEventInput & {
347
- readonly getValidationError: (properties: unknown) => string | null;
348
- };
349
- readonly USER_PUBLISHED_AGENT: {
350
- readonly name: "User published agent";
351
- readonly description: "The user published an agent from the builder.";
352
- readonly properties: z.ZodObject<{
353
- agent_id: z.ZodString;
354
- config_version: z.ZodString;
355
- status: z.ZodLiteral<"production">;
356
- session_id: z.ZodString;
357
- }, z.core.$strip>;
358
- } & import("../define").TelemetryEventInput & {
359
- readonly getValidationError: (properties: unknown) => string | null;
360
- };
361
- readonly USER_UNPUBLISHED_AGENT: {
362
- readonly name: "User unpublished agent";
363
- readonly description: "The user unpublished an agent from the builder.";
364
- readonly properties: z.ZodObject<{
365
- agent_id: z.ZodString;
366
- status: z.ZodLiteral<"draft">;
367
- session_id: z.ZodString;
368
- }, z.core.$strip>;
369
- } & import("../define").TelemetryEventInput & {
370
- readonly getValidationError: (properties: unknown) => string | null;
371
- };
372
728
  readonly USER_OPENED_AGENT_TOOL: {
373
729
  readonly name: "User opened agent tool";
374
730
  readonly description: "The user opened a tool from the builder capabilities list.";
@@ -436,27 +792,6 @@ export declare const AGENTS_TELEMETRY: {
436
792
  } & import("../define").TelemetryEventInput & {
437
793
  readonly getValidationError: (properties: unknown) => string | null;
438
794
  };
439
- readonly USER_ADDED_AGENT_TOOL: {
440
- readonly name: "User added agent tool";
441
- readonly description: "A new tool ref or MCP server was saved to an agent for the first time from the tools modal.";
442
- readonly properties: z.ZodObject<{
443
- node_type: z.ZodOptional<z.ZodString>;
444
- workflow: z.ZodOptional<z.ZodString>;
445
- custom_id: z.ZodOptional<z.ZodString>;
446
- server_name: z.ZodOptional<z.ZodString>;
447
- tool_type: z.ZodEnum<{
448
- custom: "custom";
449
- mcpServer: "mcpServer";
450
- node: "node";
451
- workflow: "workflow";
452
- }>;
453
- has_approval: z.ZodBoolean;
454
- authentication: z.ZodOptional<z.ZodString>;
455
- agent_id: z.ZodOptional<z.ZodString>;
456
- }, z.core.$strip>;
457
- } & import("../define").TelemetryEventInput & {
458
- readonly getValidationError: (properties: unknown) => string | null;
459
- };
460
795
  readonly USER_EDITED_AGENT_TOOL: {
461
796
  readonly name: "User edited agent tool";
462
797
  readonly description: "An existing agent tool's configuration was saved from the tools modal.";
@@ -475,25 +810,6 @@ export declare const AGENTS_TELEMETRY: {
475
810
  } & import("../define").TelemetryEventInput & {
476
811
  readonly getValidationError: (properties: unknown) => string | null;
477
812
  };
478
- readonly USER_REMOVED_AGENT_TOOL: {
479
- readonly name: "User removed agent tool";
480
- readonly description: "The user confirmed removing a tool or MCP server from an agent (tools modal or sidebar).";
481
- readonly properties: z.ZodObject<{
482
- node_type: z.ZodOptional<z.ZodString>;
483
- workflow: z.ZodOptional<z.ZodString>;
484
- custom_id: z.ZodOptional<z.ZodString>;
485
- server_name: z.ZodOptional<z.ZodString>;
486
- tool_type: z.ZodEnum<{
487
- custom: "custom";
488
- mcpServer: "mcpServer";
489
- node: "node";
490
- workflow: "workflow";
491
- }>;
492
- agent_id: z.ZodOptional<z.ZodString>;
493
- }, z.core.$strip>;
494
- } & import("../define").TelemetryEventInput & {
495
- readonly getValidationError: (properties: unknown) => string | null;
496
- };
497
813
  readonly USER_OPENED_AGENT_PREVIEW: {
498
814
  readonly name: "User opened agent preview";
499
815
  readonly description: "The user opened the agent preview panel in the builder.";