Skip to content

Commit 2ce79e9

Browse files
committed
chore: Document the client ai telemetry types
1 parent 031c5b5 commit 2ce79e9

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

packages/client/src/ai.ts

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,50 +2,86 @@ import { io } from 'socket.io-client';
22
import AIClient, { Callbacks } from './aiClient';
33
import { getConfiguration } from './loadConfiguration';
44

5+
/**
6+
* When a conversation is created, the AppMap service reports the permissions assigned to the user,
7+
* directly or through an organization to which they belong.
8+
*/
59
export type Permissions = {
610
useNavieAIProxy: boolean;
711
};
812

13+
/**
14+
* An activity record for the user, indicating how many conversations were created over a given
15+
* time period.
16+
*/
917
export type ConversationCount = {
1018
daysAgo: number;
1119
count: number;
1220
};
1321

22+
/**
23+
* The usage report for a given user, which is reported back to the user when a conversation is
24+
* created.
25+
*/
1426
export type Usage = {
1527
conversationCounts: ConversationCount[];
1628
};
1729

30+
/**
31+
* Model parameters are reported to the AppMap service when a conversation is created.
32+
*/
1833
export type ModelParameters = {
1934
baseUrl?: string;
2035
model?: string;
2136
aiKeyName?: string;
2237
};
2338

39+
/**
40+
* Project directory information is reported to the AppMap service when a conversation is created.
41+
*/
2442
export type ProjectDirectory = {
2543
hasAppMapConfig: boolean;
2644
language?: string;
2745
};
2846

47+
/**
48+
* The parameters for a project, which are reported to the AppMap service when a conversation is
49+
* created.
50+
*/
2951
export type ProjectParameters = {
3052
directoryCount: number;
3153
codeEditor?: string;
3254
directories: ProjectDirectory[];
3355
};
3456

57+
/**
58+
* A specific product to which the user is subscribed.
59+
*/
3560
export type SubscriptionItem = {
3661
productName: string;
3762
};
3863

64+
/**
65+
* A record of all subscriptions for a given user, along with the date on which they were first
66+
* enrolled.
67+
*/
3968
export type Subscription = {
4069
enrollmentDate: Date;
4170
subscriptions: SubscriptionItem[];
4271
};
4372

73+
/**
74+
* These parameters are passed from Navie Client to the Navie Service when a new conversation is
75+
* created.
76+
*/
4477
export type CreateConversationThread = {
4578
modelParameters: ModelParameters;
4679
projectParameters: ProjectParameters;
4780
};
4881

82+
/**
83+
* This information is reported back to the Navie Client when a conversation is created.
84+
*/
4985
export type ConversationThread = {
5086
id: string;
5187
permissions: Permissions;
@@ -71,6 +107,17 @@ export type CreateUserMessage = {
71107
codeSelectionLength?: number;
72108
};
73109

110+
/**
111+
* When a user message is reported to the AppMap service, the agent name (aka command name) and
112+
* automatically assigned classifications are reported.
113+
*
114+
* The agent name will be one of the published Navie commands, such as @explain, @diagram, @plan,
115+
* @generate, @test, @search, @review, and @help.
116+
*
117+
* Classifications are question categories that are assigned by Navie to help the AI respond
118+
* in the most appropriate way. Classifications are single words like overview, architecture,
119+
* troubleshoot, feature, generate-diagram, generate-code, explain, and help.
120+
*/
74121
export type UpdateUserMessage = {
75122
agentName?: string;
76123
classification?: Classification[];

0 commit comments

Comments
 (0)