@company-semantics/contracts 0.79.0 → 0.80.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@company-semantics/contracts",
3
- "version": "0.79.0",
3
+ "version": "0.80.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
package/src/index.ts CHANGED
@@ -483,4 +483,10 @@ export type {
483
483
  export type {
484
484
  ExecutionFailureReason,
485
485
  RuntimeExecutionTelemetry,
486
+ // Aggregation response types (PRD-00201)
487
+ ProfileStats,
488
+ OrgExecutionSummary,
489
+ DailyExecutionStats,
490
+ ExecutionByUser,
491
+ ExecutionDetail,
486
492
  } from './usage/execution-types'
@@ -14,6 +14,7 @@ export type ExecutionFailureReason =
14
14
  | 'client_disconnect'
15
15
  | 'unknown'
16
16
 
17
+ // @vocabulary-exempt reason: telemetry row is a single DB-aligned record; splitting risks consumer breakage
17
18
  export interface RuntimeExecutionTelemetry {
18
19
  executionId: string
19
20
  orgId: string
@@ -35,3 +36,56 @@ export interface RuntimeExecutionTelemetry {
35
36
  failureReason?: ExecutionFailureReason
36
37
  createdAt: string // ISO 8601
37
38
  }
39
+
40
+ // --- Aggregation response types (PRD-00201) ---
41
+
42
+ export interface ProfileStats {
43
+ executions: number
44
+ percentOfTotal: number
45
+ avgDurationMs: number
46
+ totalCostUsd: string
47
+ avgCostPerExecution: string
48
+ failureRate: number
49
+ avgStepCount: number
50
+ avgToolCallCount: number
51
+ }
52
+
53
+ export interface OrgExecutionSummary {
54
+ dateRange: { start: string; end: string }
55
+ totals: {
56
+ executions: number
57
+ tokens: number
58
+ costUsd: string
59
+ avgDurationMs: number
60
+ }
61
+ byProfile: Record<ChatRuntimeProfile, ProfileStats>
62
+ }
63
+
64
+ export interface DailyExecutionStats {
65
+ date: string // YYYY-MM-DD
66
+ executions: number
67
+ totalCostUsd: string
68
+ byProfile: Record<ChatRuntimeProfile, number>
69
+ }
70
+
71
+ export interface ExecutionByUser {
72
+ userId: string
73
+ email: string
74
+ executions: number
75
+ totalCostUsd: string
76
+ favoriteProfile: ChatRuntimeProfile
77
+ }
78
+
79
+ export interface ExecutionDetail {
80
+ execution: RuntimeExecutionTelemetry
81
+ llmCalls: Array<{
82
+ callId: string
83
+ model: string
84
+ provider: string
85
+ tokensInput: number
86
+ tokensOutput: number
87
+ costUsd: string
88
+ durationMs: number
89
+ toolCalls: number
90
+ }>
91
+ }