@spottoai/types-package 1.0.2-beta.16 → 1.0.2-beta.160

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 (166) hide show
  1. package/LICENSE +18 -40
  2. package/README.md +4 -12
  3. package/dist/accounts/accounts.d.ts +32 -3
  4. package/dist/accounts/accounts.d.ts.map +1 -1
  5. package/dist/accounts/index.d.ts +1 -0
  6. package/dist/accounts/index.d.ts.map +1 -1
  7. package/dist/accounts/index.js +1 -0
  8. package/dist/accounts/index.js.map +1 -1
  9. package/dist/accounts/writePermissions.d.ts +34 -0
  10. package/dist/accounts/writePermissions.d.ts.map +1 -0
  11. package/dist/accounts/writePermissions.js +37 -0
  12. package/dist/accounts/writePermissions.js.map +1 -0
  13. package/dist/ai/index.d.ts +686 -9
  14. package/dist/ai/index.d.ts.map +1 -1
  15. package/dist/ai/index.js +1 -1
  16. package/dist/ai/index.js.map +1 -1
  17. package/dist/azure/benefits.d.ts +119 -0
  18. package/dist/azure/benefits.d.ts.map +1 -0
  19. package/dist/azure/benefits.js +3 -0
  20. package/dist/azure/benefits.js.map +1 -0
  21. package/dist/azure/billingPlots.d.ts +108 -0
  22. package/dist/azure/billingPlots.d.ts.map +1 -0
  23. package/dist/azure/billingPlots.js +6 -0
  24. package/dist/azure/billingPlots.js.map +1 -0
  25. package/dist/azure/budgets.d.ts +4 -0
  26. package/dist/azure/budgets.d.ts.map +1 -1
  27. package/dist/azure/commitmentsPlanning.d.ts +108 -0
  28. package/dist/azure/commitmentsPlanning.d.ts.map +1 -0
  29. package/dist/azure/commitmentsPlanning.js +3 -0
  30. package/dist/azure/commitmentsPlanning.js.map +1 -0
  31. package/dist/azure/common.d.ts +34 -0
  32. package/dist/azure/common.d.ts.map +1 -1
  33. package/dist/azure/configs.d.ts +12 -0
  34. package/dist/azure/configs.d.ts.map +1 -1
  35. package/dist/azure/costEstimation.d.ts +78 -0
  36. package/dist/azure/costEstimation.d.ts.map +1 -0
  37. package/dist/azure/costEstimation.js +3 -0
  38. package/dist/azure/costEstimation.js.map +1 -0
  39. package/dist/azure/metrics.d.ts +40 -0
  40. package/dist/azure/metrics.d.ts.map +1 -1
  41. package/dist/azure/payloads.d.ts +9 -0
  42. package/dist/azure/payloads.d.ts.map +1 -1
  43. package/dist/azure/prices.d.ts +140 -0
  44. package/dist/azure/prices.d.ts.map +1 -1
  45. package/dist/azure/recommendationState.d.ts +16 -0
  46. package/dist/azure/recommendationState.d.ts.map +1 -1
  47. package/dist/azure/recommendations.d.ts +246 -4
  48. package/dist/azure/recommendations.d.ts.map +1 -1
  49. package/dist/azure/recommendations.js.map +1 -1
  50. package/dist/azure/relationships.d.ts +77 -0
  51. package/dist/azure/relationships.d.ts.map +1 -0
  52. package/dist/azure/relationships.js +3 -0
  53. package/dist/azure/relationships.js.map +1 -0
  54. package/dist/azure/reports.d.ts +218 -0
  55. package/dist/azure/reports.d.ts.map +1 -1
  56. package/dist/azure/reports.js +13 -0
  57. package/dist/azure/reports.js.map +1 -1
  58. package/dist/azure/resources.d.ts +14 -0
  59. package/dist/azure/resources.d.ts.map +1 -1
  60. package/dist/azure/reviewChecklist.d.ts +139 -0
  61. package/dist/azure/reviewChecklist.d.ts.map +1 -0
  62. package/dist/azure/reviewChecklist.js +3 -0
  63. package/dist/azure/reviewChecklist.js.map +1 -0
  64. package/dist/azure/security.d.ts +16 -2
  65. package/dist/azure/security.d.ts.map +1 -1
  66. package/dist/azure/serviceRetirement.d.ts +28 -0
  67. package/dist/azure/serviceRetirement.d.ts.map +1 -0
  68. package/dist/azure/serviceRetirement.js +3 -0
  69. package/dist/azure/serviceRetirement.js.map +1 -0
  70. package/dist/azure/serviceRetirementState.d.ts +22 -0
  71. package/dist/azure/serviceRetirementState.d.ts.map +1 -0
  72. package/dist/azure/serviceRetirementState.js +3 -0
  73. package/dist/azure/serviceRetirementState.js.map +1 -0
  74. package/dist/azure/storage-inventory.d.ts +194 -0
  75. package/dist/azure/storage-inventory.d.ts.map +1 -0
  76. package/dist/azure/storage-inventory.js +3 -0
  77. package/dist/azure/storage-inventory.js.map +1 -0
  78. package/dist/azure/subscriptions.d.ts +9 -13
  79. package/dist/azure/subscriptions.d.ts.map +1 -1
  80. package/dist/azure/views.d.ts +97 -1
  81. package/dist/azure/views.d.ts.map +1 -1
  82. package/dist/common/pagination.d.ts +3 -0
  83. package/dist/common/pagination.d.ts.map +1 -1
  84. package/dist/company/billingAccount.d.ts +30 -0
  85. package/dist/company/billingAccount.d.ts.map +1 -0
  86. package/dist/company/billingAccount.js +3 -0
  87. package/dist/company/billingAccount.js.map +1 -0
  88. package/dist/company/company.d.ts +26 -1
  89. package/dist/company/company.d.ts.map +1 -1
  90. package/dist/company/index.d.ts +1 -0
  91. package/dist/company/index.d.ts.map +1 -1
  92. package/dist/company/index.js +1 -0
  93. package/dist/company/index.js.map +1 -1
  94. package/dist/company/notification.d.ts +31 -1
  95. package/dist/company/notification.d.ts.map +1 -1
  96. package/dist/company/notification.js +24 -12
  97. package/dist/company/notification.js.map +1 -1
  98. package/dist/company/survey.d.ts +3 -0
  99. package/dist/company/survey.d.ts.map +1 -1
  100. package/dist/events/alertDefinitionRun.d.ts +23 -0
  101. package/dist/events/alertDefinitionRun.d.ts.map +1 -0
  102. package/dist/events/alertDefinitionRun.js +3 -0
  103. package/dist/events/alertDefinitionRun.js.map +1 -0
  104. package/dist/events/baseAlert.d.ts +130 -0
  105. package/dist/events/baseAlert.d.ts.map +1 -0
  106. package/dist/events/baseAlert.js +3 -0
  107. package/dist/events/baseAlert.js.map +1 -0
  108. package/dist/events/cost.d.ts +361 -0
  109. package/dist/events/cost.d.ts.map +1 -0
  110. package/dist/events/cost.js +3 -0
  111. package/dist/events/cost.js.map +1 -0
  112. package/dist/events/costAnomalies.d.ts +47 -0
  113. package/dist/events/costAnomalies.d.ts.map +1 -0
  114. package/dist/events/costAnomalies.js +3 -0
  115. package/dist/events/costAnomalies.js.map +1 -0
  116. package/dist/events/costViews.d.ts +23 -0
  117. package/dist/events/costViews.d.ts.map +1 -0
  118. package/dist/events/costViews.js +3 -0
  119. package/dist/events/costViews.js.map +1 -0
  120. package/dist/events/eventStatus.d.ts +67 -0
  121. package/dist/events/eventStatus.d.ts.map +1 -0
  122. package/dist/events/eventStatus.js +3 -0
  123. package/dist/events/eventStatus.js.map +1 -0
  124. package/dist/events/index.d.ts +7 -0
  125. package/dist/events/index.d.ts.map +1 -0
  126. package/dist/events/index.js +23 -0
  127. package/dist/events/index.js.map +1 -0
  128. package/dist/feedbacks/feedback.d.ts +9 -0
  129. package/dist/feedbacks/feedback.d.ts.map +1 -1
  130. package/dist/identity/apikey.d.ts +67 -0
  131. package/dist/identity/apikey.d.ts.map +1 -0
  132. package/dist/identity/apikey.js +3 -0
  133. package/dist/identity/apikey.js.map +1 -0
  134. package/dist/identity/index.d.ts +2 -0
  135. package/dist/identity/index.d.ts.map +1 -0
  136. package/dist/identity/index.js +18 -0
  137. package/dist/identity/index.js.map +1 -0
  138. package/dist/index.d.ts +15 -0
  139. package/dist/index.d.ts.map +1 -1
  140. package/dist/index.js +15 -1
  141. package/dist/index.js.map +1 -1
  142. package/dist/integrations/halo.d.ts +76 -0
  143. package/dist/integrations/halo.d.ts.map +1 -0
  144. package/dist/integrations/halo.js +3 -0
  145. package/dist/integrations/halo.js.map +1 -0
  146. package/dist/integrations/index.d.ts +3 -0
  147. package/dist/integrations/index.d.ts.map +1 -0
  148. package/dist/integrations/index.js +19 -0
  149. package/dist/integrations/index.js.map +1 -0
  150. package/dist/integrations/integrationTickets.d.ts +67 -0
  151. package/dist/integrations/integrationTickets.d.ts.map +1 -0
  152. package/dist/integrations/integrationTickets.js +3 -0
  153. package/dist/integrations/integrationTickets.js.map +1 -0
  154. package/dist/tags/index.d.ts +2 -0
  155. package/dist/tags/index.d.ts.map +1 -0
  156. package/dist/tags/index.js +18 -0
  157. package/dist/tags/index.js.map +1 -0
  158. package/dist/tags/tags.d.ts +26 -0
  159. package/dist/tags/tags.d.ts.map +1 -0
  160. package/dist/tags/tags.js +10 -0
  161. package/dist/tags/tags.js.map +1 -0
  162. package/dist/unknown/services.d.ts +12 -0
  163. package/dist/unknown/services.d.ts.map +1 -0
  164. package/dist/unknown/services.js +3 -0
  165. package/dist/unknown/services.js.map +1 -0
  166. package/package.json +2 -2
@@ -1,31 +1,38 @@
1
- export type AIResponseStatus = 'complete' | 'needs_clarification' | 'needs_more_metrics';
1
+ /** Common AI interfaces shared between frontend and backend */
2
+ export type AIResponseStatus = 'complete' | 'needsClarification' | 'needsMoreMetrics';
2
3
  export type RecommendationPillar = 'Cost Optimization' | 'Performance Efficiency' | 'Security' | 'Reliability' | 'Operational Excellence';
3
- export type RecommendationType = 'advisor' | 'custom' | 'ai_generated';
4
+ export type RecommendationType = 'advisor' | 'custom' | 'aiGenerated';
4
5
  export interface RecommendationAction {
5
6
  action: 'fix';
6
- recommendation_id: string;
7
+ recommendationId: string;
7
8
  }
8
9
  export interface AIRecommendation {
9
- priority_rank: number;
10
+ priorityRank: number;
10
11
  pillar: RecommendationPillar;
11
12
  description: string;
12
13
  type: RecommendationType;
13
- reference_ids: string[];
14
+ referenceIds: string[];
14
15
  actions: RecommendationAction[];
15
16
  }
16
17
  export interface StructuredAIResponse {
17
18
  status: AIResponseStatus;
18
- clarification_request: string | null;
19
- metrics_request: string[];
20
- friendly_message: string;
19
+ clarificationRequest: string | null;
20
+ metricsRequest: string[];
21
+ friendlyMessage: string;
21
22
  recommendations: AIRecommendation[];
22
23
  }
23
24
  export interface PageContext {
24
25
  pageType: 'resource-detail' | 'recommendation-detail' | 'dashboard' | string;
26
+ pageId?: string;
27
+ tabName?: string;
28
+ companyId: string;
29
+ subscriptionIds?: string[];
30
+ cloudAccountId?: string;
25
31
  resourceId?: string;
26
32
  recommendationId?: string;
27
- subscriptionId?: string;
28
33
  pageUrl?: string;
34
+ uiState?: Record<string, unknown>;
35
+ contextHash?: string;
29
36
  }
30
37
  export interface AIMessage {
31
38
  role: 'user' | 'assistant';
@@ -34,4 +41,674 @@ export interface AIMessage {
34
41
  structuredResponse?: StructuredAIResponse;
35
42
  responseId?: string;
36
43
  }
44
+ export type AIChatMode = 'page' | 'workspace';
45
+ type AIWorkspaceScopePolicyOutcome = 'accepted' | 'intersected' | 'rejected';
46
+ interface AIWorkspaceScopeAllAuthorizedRequest {
47
+ mode: 'allAuthorized';
48
+ companyIds?: never;
49
+ subscriptionIds?: never;
50
+ resourceIds?: never;
51
+ includeChildCompanies?: boolean;
52
+ }
53
+ type AIWorkspaceScopeExplicitIdentifiers = {
54
+ companyIds: string[];
55
+ subscriptionIds?: string[];
56
+ resourceIds?: string[];
57
+ } | {
58
+ companyIds?: string[];
59
+ subscriptionIds: string[];
60
+ resourceIds?: string[];
61
+ } | {
62
+ companyIds?: string[];
63
+ subscriptionIds?: string[];
64
+ resourceIds: string[];
65
+ };
66
+ type AIWorkspaceScopeExplicitRequest = {
67
+ mode: 'explicit';
68
+ includeChildCompanies?: boolean;
69
+ } & AIWorkspaceScopeExplicitIdentifiers;
70
+ export type AIWorkspaceScopeRequest = AIWorkspaceScopeAllAuthorizedRequest | AIWorkspaceScopeExplicitRequest;
71
+ export interface AIResolvedWorkspaceScope {
72
+ companyIds: string[];
73
+ subscriptionIds: string[];
74
+ resourceIds: string[];
75
+ policyOutcome: AIWorkspaceScopePolicyOutcome;
76
+ rejectedCompanyIds?: string[];
77
+ rejectedSubscriptionIds?: string[];
78
+ rejectedResourceIds?: string[];
79
+ }
80
+ export type AIChatSkillId = string;
81
+ export type AIChatDomain = 'cost' | 'performance' | 'security' | 'reliability' | 'governance' | 'operations' | 'general';
82
+ export type AIChatIntentLabel = 'askSummary' | 'investigateCost' | 'investigateSecurity' | 'investigateReliability' | 'investigateGovernance' | 'executeAction' | 'explainRecommendation' | 'unknown';
83
+ export type AIChatComplexity = 'simple' | 'standard' | 'complex';
84
+ export interface AIChatClassificationIntent {
85
+ label: AIChatIntentLabel;
86
+ confidence: number;
87
+ }
88
+ export interface AIChatClassificationResult {
89
+ version: string;
90
+ intents: AIChatClassificationIntent[];
91
+ complexity: AIChatComplexity;
92
+ requiresTools: boolean;
93
+ suggestedSkillPackIds: AIChatSkillId[];
94
+ }
95
+ type AIChatRoutingReasonCode = 'AI_SKILL_CLASSIFIER_SELECTED' | 'AI_SKILL_CLASSIFIER_LOW_CONFIDENCE' | 'AI_SKILL_FALLBACK_DEFAULT';
96
+ type AIChatScopeReasonCode = 'AI_SCOPE_EMPTY_REQUEST' | 'AI_SCOPE_EMPTY_EFFECTIVE' | 'AI_SCOPE_REDUCED_UNAUTHORIZED_MEMBERS' | 'AI_SCOPE_INVALID';
97
+ type AIChatApprovalReasonCode = 'AI_MUTATION_CONFIRMATION_REQUIRED' | 'AI_MUTATION_CONFIRMATION_EXPIRED' | 'AI_MUTATION_CONFIRMATION_REJECTED';
98
+ type AIChatDegradedReasonCode = 'AI_LEARN_MCP_UNAVAILABLE' | 'AI_LEARN_MCP_TIMEOUT' | 'AI_TOOL_TIMEOUT' | 'AI_TOOL_PARTIAL_FAILURE' | 'AI_DEGRADED_NO_PATH';
99
+ type AIChatOrchestrationReasonCode = 'AI_ROUTE_GENERIC' | 'AI_ROUTE_ANALYSIS' | 'AI_ROUTE_GENERIC_FALLBACK_MEDIUM_CONFIDENCE' | 'AI_ROUTE_CLARIFY_LOW_CONFIDENCE' | 'AI_PLAN_CREATED' | 'AI_PLAN_NO_ELIGIBLE_SPECIALISTS' | 'AI_SPECIALIST_STARTED' | 'AI_SPECIALIST_COMPLETED' | 'AI_SPECIALIST_FAILED' | 'AI_SYNTHESIS_COMPLETED' | 'AI_SYNTHESIS_CONFLICT_DETECTED' | 'AI_CRITIC_SKIPPED' | 'AI_CRITIC_PASS' | 'AI_CRITIC_REVISE' | 'AI_REVISION_LOOP_LIMIT_REACHED';
100
+ export type AIChatReasonCode = AIChatRoutingReasonCode | AIChatScopeReasonCode | AIChatApprovalReasonCode | AIChatDegradedReasonCode | AIChatOrchestrationReasonCode;
101
+ export type AIRouteReasonCode = 'route.low_confidence' | 'route.page_context_sufficient' | 'route.cross_domain_analysis_required' | 'route.retrieval_required' | 'route.missing_required_inputs' | `route.${string}`;
102
+ export type AIToolReasonCode = 'tool.not_authorized' | 'tool.out_of_scope' | 'tool.missing_required_arguments' | 'tool.requires_confirmation' | 'tool.not_applicable_to_page' | `tool.${string}`;
103
+ export type AIFreshnessReasonCode = 'freshness.current' | 'freshness.stale_source' | 'freshness.partial_data' | 'freshness.refresh_in_progress' | `freshness.${string}`;
104
+ export type AISchemaReasonCode = 'schema.parse_failed' | 'schema.validation_failed' | 'schema.missing_required_field' | 'schema.invalid_enum_value' | `schema.${string}`;
105
+ export type AIReasonCode = AIRouteReasonCode | AIToolReasonCode | AIFreshnessReasonCode | AISchemaReasonCode;
106
+ export interface AISchemaIssue {
107
+ reasonCode: AISchemaReasonCode;
108
+ fieldPath?: string;
109
+ detail?: string;
110
+ }
111
+ export interface AIChatSkillClassificationCandidate {
112
+ skillId: AIChatSkillId;
113
+ score: number;
114
+ reasonCodes: AIChatReasonCode[];
115
+ }
116
+ export interface AIChatSkillClassificationResult {
117
+ classifierVersion: string;
118
+ selectedSkillPackId?: AIChatSkillId;
119
+ candidates: AIChatSkillClassificationCandidate[];
120
+ reasonCodes?: AIChatReasonCode[];
121
+ }
122
+ export type AIChatRoutingStrategy = 'singleAgent' | 'fanout';
123
+ export interface AIChatRoutingSubtaskPlan {
124
+ subtaskId: string;
125
+ domain: AIChatDomain;
126
+ title: string;
127
+ skillPackId?: AIChatSkillId;
128
+ }
129
+ export interface AIChatRoutingDecision {
130
+ strategy: AIChatRoutingStrategy;
131
+ selectedMode: AIChatMode;
132
+ selectedSkillPackIds: AIChatSkillId[];
133
+ reasonCodes: AIChatReasonCode[];
134
+ subtasks?: AIChatRoutingSubtaskPlan[];
135
+ }
136
+ export type AIChatSkillRouteSource = 'auto' | 'default';
137
+ export type AIChatSkillRoutePolicyOutcome = 'accepted' | 'fallback' | 'rejected';
138
+ export interface AIChatSkillRouteTarget {
139
+ skillPackId: AIChatSkillId;
140
+ skillPackVersion: string;
141
+ routeSource: AIChatSkillRouteSource;
142
+ policyOutcome: AIChatSkillRoutePolicyOutcome;
143
+ }
144
+ export interface AIChatSkillRoutingFallback {
145
+ fromSkillPackId?: AIChatSkillId;
146
+ toRoute: AIChatSkillRouteTarget;
147
+ reasonCode: AIChatReasonCode;
148
+ }
149
+ export interface AIChatSkillRoutingDecision {
150
+ selectedSkillPackId?: AIChatSkillId;
151
+ route: AIChatSkillRouteTarget;
152
+ reasonCodes: AIChatReasonCode[];
153
+ fallback?: AIChatSkillRoutingFallback;
154
+ }
155
+ export type AIChatClassificationMetadata = AIChatClassificationResult | AIChatSkillClassificationResult;
156
+ export type AIChatRoutingMetadata = AIChatRoutingDecision | AIChatSkillRoutingDecision;
157
+ export type AIEntityType = 'company' | 'subscription' | 'resource' | 'recommendation' | string;
158
+ export interface AIEntityRef {
159
+ id: string;
160
+ label?: string;
161
+ type: AIEntityType;
162
+ }
163
+ export type AIPageIntentHint = 'thisPage' | 'theseRows' | 'thisResource' | 'crossPage';
164
+ export interface AIPageFreshness {
165
+ capturedAt: string;
166
+ dataAsOf?: string;
167
+ isStale?: boolean;
168
+ stalenessReason?: string;
169
+ reasonCode?: AIFreshnessReasonCode;
170
+ }
171
+ export interface AIChatPageSnapshot {
172
+ pageType: string;
173
+ pageId?: string;
174
+ pageUrl?: string;
175
+ companyId?: string;
176
+ title?: string;
177
+ summary?: string;
178
+ routePath?: string;
179
+ tab?: string;
180
+ view?: string;
181
+ selectedEntities: AIEntityRef[];
182
+ scopeLabels: {
183
+ company?: string;
184
+ subscriptions?: string[];
185
+ resources?: string[];
186
+ };
187
+ uiState?: Record<string, unknown>;
188
+ loadedDataHints?: string[];
189
+ intentHints?: AIPageIntentHint[];
190
+ freshness?: AIPageFreshness;
191
+ }
192
+ export type AIChatMutationMode = 'read' | 'writeRequiresApproval' | 'writeBlocked';
193
+ export interface AIChatToolAffordanceEntry {
194
+ toolName: string;
195
+ title?: string;
196
+ reasonCode?: AIReasonCode;
197
+ reason?: string;
198
+ missingArgs?: string[];
199
+ requiresApproval?: boolean;
200
+ }
201
+ export interface AIChatBlockedToolAffordanceEntry extends AIChatToolAffordanceEntry {
202
+ blockReasonCode?: AIReasonCode;
203
+ blockReason?: string;
204
+ }
205
+ export interface AIChatToolAffordanceSnapshot {
206
+ availableTools: AIChatToolAffordanceEntry[];
207
+ applicableTools: AIChatToolAffordanceEntry[];
208
+ deferredTools: AIChatToolAffordanceEntry[];
209
+ writeTools: AIChatToolAffordanceEntry[];
210
+ blockedTools: AIChatBlockedToolAffordanceEntry[];
211
+ }
212
+ export type AIOrchestrationPath = 'clarify' | 'pageAnswer' | 'genericToolLoop' | 'analysisWithRetrieval';
213
+ export interface AIRouterDomainScore {
214
+ name: 'cost' | 'performance' | 'reliability' | 'security' | 'operations' | string;
215
+ confidence: number;
216
+ }
217
+ export interface AIRouterOutput {
218
+ path: AIOrchestrationPath;
219
+ confidence: number;
220
+ entitiesInFocus: string[];
221
+ domains: AIRouterDomainScore[];
222
+ needsRetrieval: boolean;
223
+ missingInputs: string[];
224
+ reasonCode?: AIRouteReasonCode;
225
+ whyThisPath?: string;
226
+ complexity?: AIChatComplexity;
227
+ }
228
+ export type AIPlannerPriority = 'P1' | 'P2' | 'P3';
229
+ export interface AIPlannerWorkItem {
230
+ workItemId: string;
231
+ domain: string;
232
+ task: string;
233
+ priority: AIPlannerPriority;
234
+ }
235
+ export interface AIPlannerRetrievalStep {
236
+ retrievalId: string;
237
+ toolName: string;
238
+ purpose: string;
239
+ arguments: Record<string, unknown>;
240
+ required: boolean;
241
+ }
242
+ export interface AIPlannerOutput {
243
+ investigationGoal: string;
244
+ decisionToSupport: string;
245
+ workItems: AIPlannerWorkItem[];
246
+ retrievalPlan: AIPlannerRetrievalStep[];
247
+ successCriteria: string[];
248
+ }
249
+ export type AICitationSourceType = 'toolResult' | 'pageData' | 'document' | 'metric' | 'log' | string;
250
+ export interface AIEvidencePayloadMeta {
251
+ payloadShape?: 'summary' | 'compact' | 'full';
252
+ truncated?: boolean;
253
+ truncationReasonCode?: AIReasonCode;
254
+ estimatedItemCount?: number;
255
+ }
256
+ export interface AIChatCitation {
257
+ citationId: string;
258
+ sourceType: AICitationSourceType;
259
+ title: string;
260
+ locator: string;
261
+ snippet?: string;
262
+ toolName?: string;
263
+ retrievedAt: string;
264
+ }
265
+ export interface AIChatToolExecutionError {
266
+ message: string;
267
+ reasonCode?: AIReasonCode;
268
+ retryable?: boolean;
269
+ details?: unknown;
270
+ }
271
+ export interface AIChatToolExecutionResult {
272
+ ok: boolean;
273
+ data?: unknown;
274
+ error?: AIChatToolExecutionError;
275
+ truncated?: boolean;
276
+ }
277
+ export interface AIToolError extends AIChatToolExecutionError {
278
+ code: string;
279
+ }
280
+ export interface AIToolResult extends AIChatToolExecutionResult {
281
+ toolName: string;
282
+ error?: AIToolError;
283
+ payloadMeta?: AIEvidencePayloadMeta;
284
+ }
285
+ export interface AIToolCall {
286
+ callId: string;
287
+ toolName: string;
288
+ arguments: Record<string, unknown>;
289
+ }
290
+ export interface AIRetrievalExecutionStep {
291
+ retrievalId: string;
292
+ toolName: string;
293
+ argsHash: string;
294
+ startedAt: string;
295
+ endedAt?: string;
296
+ status: 'ok' | 'error' | 'skipped';
297
+ summary?: string;
298
+ callId?: string;
299
+ error?: AIToolError;
300
+ citationIds: string[];
301
+ rawHandle?: string;
302
+ }
303
+ export interface AIEvidenceEntry {
304
+ evidenceId: string;
305
+ sourceTool: string;
306
+ argsHash: string;
307
+ timestamp: string;
308
+ status: 'ok' | 'error' | 'partial';
309
+ summary: string;
310
+ rawHandle?: string;
311
+ citationIds: string[];
312
+ domains?: string[];
313
+ payloadMeta?: AIEvidencePayloadMeta;
314
+ }
315
+ export interface AIEvidenceGap {
316
+ gapId: string;
317
+ description: string;
318
+ blocking: boolean;
319
+ suggestedFollowup?: string;
320
+ }
321
+ export interface AIEvidenceLabelMap {
322
+ companies?: Record<string, string>;
323
+ subscriptions?: Record<string, string>;
324
+ resources?: Record<string, string>;
325
+ recommendations?: Record<string, string>;
326
+ }
327
+ export interface AIEvidenceBundle {
328
+ bundleId: string;
329
+ entries: AIEvidenceEntry[];
330
+ citations: AIChatCitation[];
331
+ labelMap: AIEvidenceLabelMap;
332
+ gaps: AIEvidenceGap[];
333
+ createdAt: string;
334
+ }
335
+ export interface AIRetrievalExecution {
336
+ retrievalPlan: AIPlannerRetrievalStep[];
337
+ executionSteps: AIRetrievalExecutionStep[];
338
+ followupPassExecuted: boolean;
339
+ evidenceBundle: AIEvidenceBundle;
340
+ }
341
+ export interface AISpecialistAction {
342
+ title: string;
343
+ risk: 'low' | 'medium' | 'high';
344
+ effort: 'low' | 'medium' | 'high';
345
+ }
346
+ export interface AISpecialistTradeoff {
347
+ withDomain: string;
348
+ summary: string;
349
+ }
350
+ export interface AISpecialistOutput {
351
+ specialistId: string;
352
+ domain: string;
353
+ topFindings: string[];
354
+ evidence: string[];
355
+ actions: AISpecialistAction[];
356
+ tradeoffs: AISpecialistTradeoff[];
357
+ assumptions: string[];
358
+ dataGaps: string[];
359
+ followupRetrieval: AIPlannerRetrievalStep[];
360
+ confidence: number;
361
+ }
362
+ export interface AISynthesisOutput {
363
+ recommendedPlan: string;
364
+ alternatives: string[];
365
+ keyActions: string[];
366
+ risks: string[];
367
+ evidenceTrace: string[];
368
+ unresolvedGaps: string[];
369
+ confidence: number;
370
+ disagreement: boolean;
371
+ }
372
+ export interface AICriticOutput {
373
+ verdict: 'PASS' | 'REVISE';
374
+ confidence: number;
375
+ reason: string;
376
+ issues: string[];
377
+ rerunAgents: string[];
378
+ }
379
+ export type AIHtmlLitePolicy = 'htmlLite';
380
+ export interface AIFormatterOutput {
381
+ policy: AIHtmlLitePolicy;
382
+ answerHtml: string;
383
+ answerText: string;
384
+ citations: AIChatCitation[];
385
+ labelFirstApplied: boolean;
386
+ normalizationHash: string;
387
+ }
388
+ export type AIChatTurnPhase = 'intake' | 'contextResolved' | 'skillResolved' | 'planning' | 'executing' | 'awaitingApproval' | 'formatting' | 'finalizing' | 'completed' | 'errored' | 'cancelled';
389
+ export type AIChatTurnStatus = 'running' | 'waiting' | 'completed' | 'errored' | 'cancelled';
390
+ export interface AIChatTurnState {
391
+ turnId: string;
392
+ phase: AIChatTurnPhase;
393
+ status: AIChatTurnStatus;
394
+ updatedAt: string;
395
+ path?: AIOrchestrationPath;
396
+ analysisConfidence?: number;
397
+ selectedSkillPackId?: AIChatSkillId;
398
+ }
399
+ export type AIChatCommentaryKind = 'preamble' | 'progress' | 'finding' | 'handoff';
400
+ export interface AIChatCommentaryEntry {
401
+ commentaryId: string;
402
+ kind: AIChatCommentaryKind;
403
+ text: string;
404
+ timestamp: string;
405
+ phase?: AIChatTurnPhase;
406
+ progressId?: string;
407
+ }
408
+ export type AIChatPlanStepStatus = 'pending' | 'running' | 'completed' | 'blocked';
409
+ export interface AIChatPlanStep {
410
+ stepId: string;
411
+ label: string;
412
+ status: AIChatPlanStepStatus;
413
+ summary?: string;
414
+ domain?: AIChatDomain;
415
+ }
416
+ export interface AIChatPlanSnapshot {
417
+ planId: string;
418
+ goal?: string;
419
+ updatedAt: string;
420
+ steps: AIChatPlanStep[];
421
+ }
422
+ export type AIChatProgressCategory = 'context' | 'routing' | 'planning' | 'retrieval' | 'toolExecution' | 'subtask' | 'approval' | 'formatting' | 'finalization';
423
+ export type AIChatProgressStatus = 'pending' | 'running' | 'completed' | 'blocked' | 'failed' | 'skipped';
424
+ export interface AIChatProgressEntry {
425
+ progressId: string;
426
+ category: AIChatProgressCategory;
427
+ status: AIChatProgressStatus;
428
+ title: string;
429
+ detail?: string;
430
+ timestamp: string;
431
+ phase?: AIChatTurnPhase;
432
+ stepId?: string;
433
+ callId?: string;
434
+ subtaskId?: string;
435
+ reasonCode?: AIReasonCode;
436
+ }
437
+ export type AIChatApprovalState = 'pending' | 'approved' | 'rejected' | 'consumed' | 'expired' | 'completed' | 'failed';
438
+ export interface AIChatApprovalRecord {
439
+ challengeId: string;
440
+ state: AIChatApprovalState;
441
+ actionSummary: string;
442
+ actionType?: string;
443
+ requiredRole: string;
444
+ riskLevel: 'low' | 'medium' | 'high';
445
+ idempotencyKey: string;
446
+ createdAt: string;
447
+ decidedAt?: string;
448
+ expiresAt?: string;
449
+ updatedAt?: string;
450
+ detail?: string;
451
+ }
452
+ export interface AIChatSkillPackDescriptor {
453
+ skillId: AIChatSkillId;
454
+ version: string;
455
+ title: string;
456
+ description?: string;
457
+ domains: AIChatDomain[];
458
+ supportedModes: AIChatMode[];
459
+ intentSignals: string[];
460
+ toolPolicy: {
461
+ allowedToolNames?: string[];
462
+ blockedToolNames?: string[];
463
+ allowLearnMcp?: boolean;
464
+ allowMutations: boolean;
465
+ };
466
+ approvalPolicy: {
467
+ required: boolean;
468
+ requiredRole?: string;
469
+ defaultRiskLevel?: 'low' | 'medium' | 'high';
470
+ };
471
+ uxHints?: {
472
+ commentaryStyle?: 'compact' | 'standard';
473
+ showPlanByDefault?: boolean;
474
+ preferredProgressCategories?: AIChatProgressCategory[];
475
+ };
476
+ fallbackPath?: AIOrchestrationPath;
477
+ enabled: boolean;
478
+ }
479
+ export interface AIChatToolDescriptor {
480
+ toolName: string;
481
+ source: 'internal' | 'learnMcp' | string;
482
+ title: string;
483
+ description: string;
484
+ domains?: AIChatDomain[];
485
+ mutationMode: AIChatMutationMode;
486
+ approvalRequirement?: {
487
+ required: boolean;
488
+ requiredRole?: string;
489
+ riskLevel?: 'low' | 'medium' | 'high';
490
+ };
491
+ scopeHints?: {
492
+ chatModes?: AIChatMode[];
493
+ requiresWorkspaceScope?: boolean;
494
+ pageTypes?: string[];
495
+ };
496
+ evidenceKinds?: string[];
497
+ resultShape?: string;
498
+ usageHints?: string[];
499
+ avoidWhen?: string[];
500
+ }
501
+ export interface AIChatTurnSnapshot {
502
+ turn: AIChatTurnState;
503
+ selectedSkillPack?: AIChatSkillPackDescriptor;
504
+ plan?: AIChatPlanSnapshot;
505
+ commentaryEntries?: AIChatCommentaryEntry[];
506
+ progressEntries?: AIChatProgressEntry[];
507
+ approvalRecords?: AIChatApprovalRecord[];
508
+ toolDescriptors?: AIChatToolDescriptor[];
509
+ }
510
+ export interface AIChatFinalSnapshot {
511
+ turnSnapshot: AIChatTurnSnapshot;
512
+ pageSnapshot?: AIChatPageSnapshot;
513
+ toolAffordanceSnapshot?: AIChatToolAffordanceSnapshot;
514
+ router?: AIRouterOutput;
515
+ planner?: AIPlannerOutput;
516
+ retrieval?: AIRetrievalExecution;
517
+ specialistOutputs?: AISpecialistOutput[];
518
+ synthesis?: AISynthesisOutput;
519
+ critic?: AICriticOutput;
520
+ formatter?: AIFormatterOutput;
521
+ }
522
+ export interface AIChatAuditArtifact {
523
+ conversationId: string;
524
+ turnId: string;
525
+ createdAt: string;
526
+ turnSnapshot: AIChatTurnSnapshot;
527
+ snapshots?: {
528
+ pageSnapshot?: AIChatPageSnapshot;
529
+ toolAffordanceSnapshot?: AIChatToolAffordanceSnapshot;
530
+ };
531
+ router?: AIRouterOutput;
532
+ planner?: AIPlannerOutput;
533
+ retrieval?: AIRetrievalExecution;
534
+ specialists?: AISpecialistOutput[];
535
+ synthesis?: AISynthesisOutput;
536
+ critic?: AICriticOutput;
537
+ formatter?: AIFormatterOutput;
538
+ analysisConfidence?: number;
539
+ }
540
+ export interface AIChatConfirmationResponse {
541
+ challengeId: string;
542
+ decision: 'approve' | 'reject';
543
+ idempotencyKey: string;
544
+ }
545
+ interface AIChatRequestBase {
546
+ conversationId?: string;
547
+ previousResponseId?: string;
548
+ contextHash?: string;
549
+ confirmationResponse?: AIChatConfirmationResponse;
550
+ stream?: true;
551
+ }
552
+ interface AIChatRequestPage extends AIChatRequestBase {
553
+ chatMode: 'page';
554
+ pageContext: PageContext;
555
+ workspaceScope?: never;
556
+ }
557
+ interface AIChatRequestWorkspace extends AIChatRequestBase {
558
+ chatMode: 'workspace';
559
+ pageContext?: PageContext;
560
+ workspaceScope: AIWorkspaceScopeRequest;
561
+ }
562
+ export type AIChatRequest = (AIChatRequestPage & {
563
+ input: string;
564
+ }) | (AIChatRequestWorkspace & {
565
+ input: string;
566
+ });
567
+ export interface AIConversationScopeMetadata {
568
+ chatMode?: AIChatMode;
569
+ resolvedWorkspaceScope?: AIResolvedWorkspaceScope;
570
+ selectedSkillPackIds?: AIChatSkillId[];
571
+ }
572
+ export interface AIConversationRoutingMetadata extends AIConversationScopeMetadata {
573
+ classification?: AIChatClassificationMetadata;
574
+ routing?: AIChatRoutingMetadata;
575
+ }
576
+ export interface AIConversationListItem extends AIConversationRoutingMetadata {
577
+ id: string;
578
+ summary?: string;
579
+ messageCount: number;
580
+ lastResponseTime?: Date | string;
581
+ pageUrl?: string;
582
+ pageType?: string;
583
+ }
584
+ export interface AIChatUsage {
585
+ promptTokens: number;
586
+ completionTokens: number;
587
+ totalTokens: number;
588
+ }
589
+ export type AIChatStreamEventName = 'scopeResolved' | 'pageSnapshotBuilt' | 'toolAffordanceBuilt' | 'routingStarted' | 'routingCompleted' | 'planCreated' | 'planUpdated' | 'commentary' | 'progressUpdate' | 'toolCall' | 'toolResult' | 'toolError' | 'approvalRequired' | 'approvalStateChanged' | 'formatterStarted' | 'formatterCompleted' | 'message' | 'citation' | 'done' | 'error' | 'ping';
590
+ export interface AIChatStreamEventBase {
591
+ event: AIChatStreamEventName;
592
+ sequence: number;
593
+ conversationId: string;
594
+ turnId: string;
595
+ timestamp: string;
596
+ }
597
+ export interface AIChatScopeResolvedEvent extends AIChatStreamEventBase {
598
+ event: 'scopeResolved';
599
+ chatMode: AIChatMode;
600
+ requestedScope?: AIWorkspaceScopeRequest;
601
+ resolvedScope: AIResolvedWorkspaceScope;
602
+ }
603
+ export interface AIChatPageSnapshotBuiltEvent extends AIChatStreamEventBase {
604
+ event: 'pageSnapshotBuilt';
605
+ snapshot: AIChatPageSnapshot;
606
+ }
607
+ export interface AIChatToolAffordanceBuiltEvent extends AIChatStreamEventBase {
608
+ event: 'toolAffordanceBuilt';
609
+ toolAffordanceSnapshot: AIChatToolAffordanceSnapshot;
610
+ }
611
+ export interface AIChatRoutingStartedEvent extends AIChatStreamEventBase {
612
+ event: 'routingStarted';
613
+ requestedMode?: AIChatMode;
614
+ }
615
+ export interface AIChatRoutingCompletedEvent extends AIChatStreamEventBase {
616
+ event: 'routingCompleted';
617
+ path: AIOrchestrationPath;
618
+ confidence: number;
619
+ domains?: AIRouterDomainScore[];
620
+ missingInputs: string[];
621
+ reasonCode?: AIReasonCode;
622
+ whyThisPath?: string;
623
+ analysisConfidence?: number;
624
+ needsRetrieval?: boolean;
625
+ selectedSkillPackIds?: AIChatSkillId[];
626
+ complexity?: AIChatComplexity;
627
+ }
628
+ export interface AIChatPlanCreatedEvent extends AIChatStreamEventBase {
629
+ event: 'planCreated';
630
+ plan: AIChatPlanSnapshot;
631
+ }
632
+ export interface AIChatPlanUpdatedEvent extends AIChatStreamEventBase {
633
+ event: 'planUpdated';
634
+ plan: AIChatPlanSnapshot;
635
+ }
636
+ export interface AIChatCommentaryEvent extends AIChatStreamEventBase {
637
+ event: 'commentary';
638
+ entry: AIChatCommentaryEntry;
639
+ }
640
+ export interface AIChatProgressUpdateEvent extends AIChatStreamEventBase {
641
+ event: 'progressUpdate';
642
+ progress: AIChatProgressEntry;
643
+ }
644
+ export interface AIChatToolCallEvent extends AIChatStreamEventBase {
645
+ event: 'toolCall';
646
+ callId: string;
647
+ toolName: string;
648
+ arguments: Record<string, unknown>;
649
+ }
650
+ export interface AIChatToolResultEvent extends AIChatStreamEventBase {
651
+ event: 'toolResult';
652
+ callId: string;
653
+ toolName: string;
654
+ result: AIChatToolExecutionResult;
655
+ }
656
+ export interface AIChatToolErrorEvent extends AIChatStreamEventBase {
657
+ event: 'toolError';
658
+ callId: string;
659
+ toolName: string;
660
+ error: AIChatToolExecutionError;
661
+ }
662
+ export interface AIChatApprovalRequiredEvent extends AIChatStreamEventBase {
663
+ event: 'approvalRequired';
664
+ approval: AIChatApprovalRecord;
665
+ }
666
+ export interface AIChatApprovalStateChangedEvent extends AIChatStreamEventBase {
667
+ event: 'approvalStateChanged';
668
+ approval: AIChatApprovalRecord;
669
+ }
670
+ export interface AIChatFormatterStartedEvent extends AIChatStreamEventBase {
671
+ event: 'formatterStarted';
672
+ policy?: AIHtmlLitePolicy;
673
+ }
674
+ export interface AIChatFormatterCompletedEvent extends AIChatStreamEventBase {
675
+ event: 'formatterCompleted';
676
+ formatter?: AIFormatterOutput;
677
+ }
678
+ export interface AIChatMessageEvent extends AIChatStreamEventBase {
679
+ event: 'message';
680
+ delta: string;
681
+ }
682
+ export interface AIChatCitationEvent extends AIChatStreamEventBase {
683
+ event: 'citation';
684
+ citation: AIChatCitation;
685
+ }
686
+ export interface AIChatDoneEvent extends AIChatStreamEventBase {
687
+ event: 'done';
688
+ responseId?: string;
689
+ previousResponseId?: string;
690
+ chatMode?: AIChatMode;
691
+ resolvedScope?: AIResolvedWorkspaceScope;
692
+ classification?: AIChatClassificationMetadata;
693
+ routing?: AIChatRoutingMetadata;
694
+ structuredResponse?: StructuredAIResponse;
695
+ usage?: AIChatUsage;
696
+ answer?: string;
697
+ completionReason?: string;
698
+ citations?: AIChatCitation[];
699
+ turnSnapshot: AIChatTurnSnapshot;
700
+ finalSnapshot?: AIChatFinalSnapshot;
701
+ auditArtifact?: AIChatAuditArtifact;
702
+ }
703
+ export interface AIChatErrorEvent extends AIChatStreamEventBase {
704
+ event: 'error';
705
+ code: string;
706
+ message: string;
707
+ retryable: boolean;
708
+ }
709
+ export interface AIChatPingEvent extends AIChatStreamEventBase {
710
+ event: 'ping';
711
+ }
712
+ export type AIChatStreamEvent = AIChatScopeResolvedEvent | AIChatPageSnapshotBuiltEvent | AIChatToolAffordanceBuiltEvent | AIChatRoutingStartedEvent | AIChatRoutingCompletedEvent | AIChatPlanCreatedEvent | AIChatPlanUpdatedEvent | AIChatCommentaryEvent | AIChatProgressUpdateEvent | AIChatToolCallEvent | AIChatToolResultEvent | AIChatToolErrorEvent | AIChatApprovalRequiredEvent | AIChatApprovalStateChangedEvent | AIChatFormatterStartedEvent | AIChatFormatterCompletedEvent | AIChatMessageEvent | AIChatCitationEvent | AIChatDoneEvent | AIChatErrorEvent | AIChatPingEvent;
713
+ export {};
37
714
  //# sourceMappingURL=index.d.ts.map