@narumitw/pi-analytics 0.49.9 → 0.49.10

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/src/types.ts CHANGED
@@ -1,102 +1,89 @@
1
1
  export type TriggerSource = "interactive" | "rpc" | "extension" | "unknown";
2
- export type RunOutcome =
3
- | "success"
4
- | "recovered_success"
5
- | "error"
6
- | "aborted"
7
- | "length"
8
- | "interrupted";
9
- export type GenerationOutcome =
10
- | "pending"
11
- | "stop"
12
- | "tool_use"
13
- | "error"
14
- | "aborted"
15
- | "length"
16
- | "interrupted";
2
+ export type RunOutcome = "success" | "recovered_success" | "error" | "aborted" | "length" | "interrupted";
3
+ export type GenerationOutcome = "pending" | "stop" | "tool_use" | "error" | "aborted" | "length" | "interrupted";
17
4
  export type ProviderErrorCategory =
18
- | "dns"
19
- | "timeout"
20
- | "connection_refused"
21
- | "connection_reset"
22
- | "tls"
23
- | "network_other"
24
- | "provider_other";
5
+ | "dns"
6
+ | "timeout"
7
+ | "connection_refused"
8
+ | "connection_reset"
9
+ | "tls"
10
+ | "network_other"
11
+ | "provider_other";
25
12
 
26
13
  export interface ModelIdentity {
27
- provider: string;
28
- model: string;
29
- thinkingLevel?: string;
14
+ provider: string;
15
+ model: string;
16
+ thinkingLevel?: string;
30
17
  }
31
18
 
32
19
  export interface ProviderResponseRecord {
33
- ordinal: number;
34
- occurredAtMs: number;
35
- status: number;
20
+ ordinal: number;
21
+ occurredAtMs: number;
22
+ status: number;
36
23
  }
37
24
 
38
25
  export interface GenerationRecord {
39
- id: string;
40
- ordinal: number;
41
- provider?: string;
42
- model?: string;
43
- thinkingLevel?: string;
44
- startedAtMs: number;
45
- finishedAtMs?: number;
46
- durationMs?: number;
47
- stopReason?: string;
48
- outcome: GenerationOutcome;
49
- responses: ProviderResponseRecord[];
26
+ id: string;
27
+ ordinal: number;
28
+ provider?: string;
29
+ model?: string;
30
+ thinkingLevel?: string;
31
+ startedAtMs: number;
32
+ finishedAtMs?: number;
33
+ durationMs?: number;
34
+ stopReason?: string;
35
+ outcome: GenerationOutcome;
36
+ responses: ProviderResponseRecord[];
50
37
  }
51
38
 
52
39
  export interface ToolCallRecord {
53
- id: string;
54
- ordinal: number;
55
- name: string;
56
- provider?: string;
57
- model?: string;
58
- startedAtMs: number;
59
- finishedAtMs?: number;
60
- durationMs?: number;
61
- isError: boolean;
62
- completionState: "running" | "finished" | "interrupted";
40
+ id: string;
41
+ ordinal: number;
42
+ name: string;
43
+ provider?: string;
44
+ model?: string;
45
+ startedAtMs: number;
46
+ finishedAtMs?: number;
47
+ durationMs?: number;
48
+ isError: boolean;
49
+ completionState: "running" | "finished" | "interrupted";
63
50
  }
64
51
 
65
52
  export interface SkillActivationRecord {
66
- id: string;
67
- name: string;
68
- initiatedBy: "user" | "model";
69
- occurredAtMs: number;
70
- provider?: string;
71
- model?: string;
53
+ id: string;
54
+ name: string;
55
+ initiatedBy: "user" | "model";
56
+ occurredAtMs: number;
57
+ provider?: string;
58
+ model?: string;
72
59
  }
73
60
 
74
61
  export interface ProviderErrorRecord {
75
- id: string;
76
- generationId?: string;
77
- occurredAtMs: number;
78
- provider?: string;
79
- model?: string;
80
- category: ProviderErrorCategory;
81
- recovered: boolean;
82
- terminal: boolean;
62
+ id: string;
63
+ generationId?: string;
64
+ occurredAtMs: number;
65
+ provider?: string;
66
+ model?: string;
67
+ category: ProviderErrorCategory;
68
+ recovered: boolean;
69
+ terminal: boolean;
83
70
  }
84
71
 
85
72
  export interface SettledRun {
86
- id: string;
87
- startedAtMs: number;
88
- finishedAtMs: number;
89
- durationMs: number;
90
- triggerSource: TriggerSource;
91
- initialProvider?: string;
92
- initialModel?: string;
93
- outcome: RunOutcome;
94
- attemptCount: number;
95
- generations: GenerationRecord[];
96
- tools: ToolCallRecord[];
97
- skills: SkillActivationRecord[];
98
- providerErrors: ProviderErrorRecord[];
99
- toolErrorCount: number;
100
- providerErrorCount: number;
101
- recoveredErrorCount: number;
73
+ id: string;
74
+ startedAtMs: number;
75
+ finishedAtMs: number;
76
+ durationMs: number;
77
+ triggerSource: TriggerSource;
78
+ initialProvider?: string;
79
+ initialModel?: string;
80
+ outcome: RunOutcome;
81
+ attemptCount: number;
82
+ generations: GenerationRecord[];
83
+ tools: ToolCallRecord[];
84
+ skills: SkillActivationRecord[];
85
+ providerErrors: ProviderErrorRecord[];
86
+ toolErrorCount: number;
87
+ providerErrorCount: number;
88
+ recoveredErrorCount: number;
102
89
  }