@spottoai/types-package 1.0.2-beta.18 → 1.0.2-beta.181
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/LICENSE +18 -40
- package/README.md +4 -11
- package/dist/accounts/accounts.d.ts +37 -3
- package/dist/accounts/accounts.d.ts.map +1 -1
- package/dist/accounts/index.d.ts +3 -0
- package/dist/accounts/index.d.ts.map +1 -1
- package/dist/accounts/index.js +3 -0
- package/dist/accounts/index.js.map +1 -1
- package/dist/accounts/readPermissions.d.ts +45 -0
- package/dist/accounts/readPermissions.d.ts.map +1 -0
- package/dist/accounts/readPermissions.js +70 -0
- package/dist/accounts/readPermissions.js.map +1 -0
- package/dist/accounts/validation.d.ts +24 -0
- package/dist/accounts/validation.d.ts.map +1 -0
- package/dist/accounts/validation.js +3 -0
- package/dist/accounts/validation.js.map +1 -0
- package/dist/accounts/writePermissions.d.ts +34 -0
- package/dist/accounts/writePermissions.d.ts.map +1 -0
- package/dist/accounts/writePermissions.js +37 -0
- package/dist/accounts/writePermissions.js.map +1 -0
- package/dist/ai/index.d.ts +944 -9
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +1 -1
- package/dist/ai/index.js.map +1 -1
- package/dist/azure/benefits.d.ts +137 -0
- package/dist/azure/benefits.d.ts.map +1 -0
- package/dist/azure/benefits.js +3 -0
- package/dist/azure/benefits.js.map +1 -0
- package/dist/azure/billingPlots.d.ts +108 -0
- package/dist/azure/billingPlots.d.ts.map +1 -0
- package/dist/azure/billingPlots.js +6 -0
- package/dist/azure/billingPlots.js.map +1 -0
- package/dist/azure/budgets.d.ts +4 -0
- package/dist/azure/budgets.d.ts.map +1 -1
- package/dist/azure/commitmentsPlanning.d.ts +159 -0
- package/dist/azure/commitmentsPlanning.d.ts.map +1 -0
- package/dist/azure/commitmentsPlanning.js +3 -0
- package/dist/azure/commitmentsPlanning.js.map +1 -0
- package/dist/azure/common.d.ts +34 -0
- package/dist/azure/common.d.ts.map +1 -1
- package/dist/azure/configs.d.ts +12 -0
- package/dist/azure/configs.d.ts.map +1 -1
- package/dist/azure/costEstimation.d.ts +78 -0
- package/dist/azure/costEstimation.d.ts.map +1 -0
- package/dist/azure/costEstimation.js +3 -0
- package/dist/azure/costEstimation.js.map +1 -0
- package/dist/azure/metrics.d.ts +40 -0
- package/dist/azure/metrics.d.ts.map +1 -1
- package/dist/azure/payloads.d.ts +10 -1
- package/dist/azure/payloads.d.ts.map +1 -1
- package/dist/azure/prices.d.ts +179 -0
- package/dist/azure/prices.d.ts.map +1 -1
- package/dist/azure/recommendationAudit.d.ts +113 -0
- package/dist/azure/recommendationAudit.d.ts.map +1 -0
- package/dist/azure/recommendationAudit.js +10 -0
- package/dist/azure/recommendationAudit.js.map +1 -0
- package/dist/azure/recommendationState.d.ts +91 -2
- package/dist/azure/recommendationState.d.ts.map +1 -1
- package/dist/azure/recommendations.d.ts +289 -5
- package/dist/azure/recommendations.d.ts.map +1 -1
- package/dist/azure/recommendations.js.map +1 -1
- package/dist/azure/relationships.d.ts +77 -0
- package/dist/azure/relationships.d.ts.map +1 -0
- package/dist/azure/relationships.js +3 -0
- package/dist/azure/relationships.js.map +1 -0
- package/dist/azure/reports.d.ts +248 -0
- package/dist/azure/reports.d.ts.map +1 -1
- package/dist/azure/reports.js +13 -0
- package/dist/azure/reports.js.map +1 -1
- package/dist/azure/resources.d.ts +39 -0
- package/dist/azure/resources.d.ts.map +1 -1
- package/dist/azure/reviewChecklist.d.ts +139 -0
- package/dist/azure/reviewChecklist.d.ts.map +1 -0
- package/dist/azure/reviewChecklist.js +3 -0
- package/dist/azure/reviewChecklist.js.map +1 -0
- package/dist/azure/security.d.ts +15 -1
- package/dist/azure/security.d.ts.map +1 -1
- package/dist/azure/serviceRetirement.d.ts +28 -0
- package/dist/azure/serviceRetirement.d.ts.map +1 -0
- package/dist/azure/serviceRetirement.js +3 -0
- package/dist/azure/serviceRetirement.js.map +1 -0
- package/dist/azure/serviceRetirementState.d.ts +22 -0
- package/dist/azure/serviceRetirementState.d.ts.map +1 -0
- package/dist/azure/serviceRetirementState.js +3 -0
- package/dist/azure/serviceRetirementState.js.map +1 -0
- package/dist/azure/storage-inventory.d.ts +241 -0
- package/dist/azure/storage-inventory.d.ts.map +1 -0
- package/dist/azure/storage-inventory.js +3 -0
- package/dist/azure/storage-inventory.js.map +1 -0
- package/dist/azure/subscriptions.d.ts +34 -13
- package/dist/azure/subscriptions.d.ts.map +1 -1
- package/dist/azure/views.d.ts +147 -2
- package/dist/azure/views.d.ts.map +1 -1
- package/dist/common/index.d.ts +1 -0
- package/dist/common/index.d.ts.map +1 -1
- package/dist/common/index.js +1 -0
- package/dist/common/index.js.map +1 -1
- package/dist/common/pagination.d.ts +3 -0
- package/dist/common/pagination.d.ts.map +1 -1
- package/dist/common/provider.d.ts +9 -0
- package/dist/common/provider.d.ts.map +1 -0
- package/dist/common/provider.js +9 -0
- package/dist/common/provider.js.map +1 -0
- package/dist/company/billingAccount.d.ts +30 -0
- package/dist/company/billingAccount.d.ts.map +1 -0
- package/dist/company/billingAccount.js +3 -0
- package/dist/company/billingAccount.js.map +1 -0
- package/dist/company/company.d.ts +26 -1
- package/dist/company/company.d.ts.map +1 -1
- package/dist/company/index.d.ts +1 -0
- package/dist/company/index.d.ts.map +1 -1
- package/dist/company/index.js +1 -0
- package/dist/company/index.js.map +1 -1
- package/dist/company/notification.d.ts +31 -1
- package/dist/company/notification.d.ts.map +1 -1
- package/dist/company/notification.js +24 -12
- package/dist/company/notification.js.map +1 -1
- package/dist/company/survey.d.ts +3 -0
- package/dist/company/survey.d.ts.map +1 -1
- package/dist/events/alertDefinitionRun.d.ts +23 -0
- package/dist/events/alertDefinitionRun.d.ts.map +1 -0
- package/dist/events/alertDefinitionRun.js +3 -0
- package/dist/events/alertDefinitionRun.js.map +1 -0
- package/dist/events/baseAlert.d.ts +130 -0
- package/dist/events/baseAlert.d.ts.map +1 -0
- package/dist/events/baseAlert.js +3 -0
- package/dist/events/baseAlert.js.map +1 -0
- package/dist/events/cost.d.ts +361 -0
- package/dist/events/cost.d.ts.map +1 -0
- package/dist/events/cost.js +3 -0
- package/dist/events/cost.js.map +1 -0
- package/dist/events/costAnomalies.d.ts +47 -0
- package/dist/events/costAnomalies.d.ts.map +1 -0
- package/dist/events/costAnomalies.js +3 -0
- package/dist/events/costAnomalies.js.map +1 -0
- package/dist/events/costViews.d.ts +23 -0
- package/dist/events/costViews.d.ts.map +1 -0
- package/dist/events/costViews.js +3 -0
- package/dist/events/costViews.js.map +1 -0
- package/dist/events/eventStatus.d.ts +67 -0
- package/dist/events/eventStatus.d.ts.map +1 -0
- package/dist/events/eventStatus.js +3 -0
- package/dist/events/eventStatus.js.map +1 -0
- package/dist/events/index.d.ts +7 -0
- package/dist/events/index.d.ts.map +1 -0
- package/dist/events/index.js +23 -0
- package/dist/events/index.js.map +1 -0
- package/dist/feedbacks/feedback.d.ts +9 -0
- package/dist/feedbacks/feedback.d.ts.map +1 -1
- package/dist/identity/apikey.d.ts +67 -0
- package/dist/identity/apikey.d.ts.map +1 -0
- package/dist/identity/apikey.js +3 -0
- package/dist/identity/apikey.js.map +1 -0
- package/dist/identity/index.d.ts +2 -0
- package/dist/identity/index.d.ts.map +1 -0
- package/dist/identity/index.js +18 -0
- package/dist/identity/index.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -1
- package/dist/index.js.map +1 -1
- package/dist/integrations/halo.d.ts +76 -0
- package/dist/integrations/halo.d.ts.map +1 -0
- package/dist/integrations/halo.js +3 -0
- package/dist/integrations/halo.js.map +1 -0
- package/dist/integrations/index.d.ts +3 -0
- package/dist/integrations/index.d.ts.map +1 -0
- package/dist/integrations/index.js +19 -0
- package/dist/integrations/index.js.map +1 -0
- package/dist/integrations/integrationTickets.d.ts +67 -0
- package/dist/integrations/integrationTickets.d.ts.map +1 -0
- package/dist/integrations/integrationTickets.js +3 -0
- package/dist/integrations/integrationTickets.js.map +1 -0
- package/dist/tags/index.d.ts +2 -0
- package/dist/tags/index.d.ts.map +1 -0
- package/dist/tags/index.js +18 -0
- package/dist/tags/index.js.map +1 -0
- package/dist/tags/tags.d.ts +26 -0
- package/dist/tags/tags.d.ts.map +1 -0
- package/dist/tags/tags.js +10 -0
- package/dist/tags/tags.js.map +1 -0
- package/dist/unknown/services.d.ts +12 -0
- package/dist/unknown/services.d.ts.map +1 -0
- package/dist/unknown/services.js +3 -0
- package/dist/unknown/services.js.map +1 -0
- package/package.json +2 -2
package/dist/ai/index.d.ts
CHANGED
|
@@ -1,31 +1,38 @@
|
|
|
1
|
-
|
|
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' | '
|
|
4
|
+
export type RecommendationType = 'advisor' | 'custom' | 'aiGenerated';
|
|
4
5
|
export interface RecommendationAction {
|
|
5
6
|
action: 'fix';
|
|
6
|
-
|
|
7
|
+
recommendationId: string;
|
|
7
8
|
}
|
|
8
9
|
export interface AIRecommendation {
|
|
9
|
-
|
|
10
|
+
priorityRank: number;
|
|
10
11
|
pillar: RecommendationPillar;
|
|
11
12
|
description: string;
|
|
12
13
|
type: RecommendationType;
|
|
13
|
-
|
|
14
|
+
referenceIds: string[];
|
|
14
15
|
actions: RecommendationAction[];
|
|
15
16
|
}
|
|
16
17
|
export interface StructuredAIResponse {
|
|
17
18
|
status: AIResponseStatus;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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,932 @@ export interface AIMessage {
|
|
|
34
41
|
structuredResponse?: StructuredAIResponse;
|
|
35
42
|
responseId?: string;
|
|
36
43
|
}
|
|
44
|
+
export type AIChatMode = 'page' | 'workspace';
|
|
45
|
+
export type AIChatResponseMode = 'fast' | 'thinking';
|
|
46
|
+
export type AIChatResolvedResponseMode = AIChatResponseMode | 'adaptive';
|
|
47
|
+
type AIWorkspaceScopePolicyOutcome = 'accepted' | 'intersected' | 'rejected';
|
|
48
|
+
interface AIWorkspaceScopeAllAuthorizedRequest {
|
|
49
|
+
mode: 'allAuthorized';
|
|
50
|
+
companyIds?: never;
|
|
51
|
+
subscriptionIds?: never;
|
|
52
|
+
resourceIds?: never;
|
|
53
|
+
includeChildCompanies?: boolean;
|
|
54
|
+
}
|
|
55
|
+
type AIWorkspaceScopeExplicitIdentifiers = {
|
|
56
|
+
companyIds: string[];
|
|
57
|
+
subscriptionIds?: string[];
|
|
58
|
+
resourceIds?: string[];
|
|
59
|
+
} | {
|
|
60
|
+
companyIds?: string[];
|
|
61
|
+
subscriptionIds: string[];
|
|
62
|
+
resourceIds?: string[];
|
|
63
|
+
} | {
|
|
64
|
+
companyIds?: string[];
|
|
65
|
+
subscriptionIds?: string[];
|
|
66
|
+
resourceIds: string[];
|
|
67
|
+
};
|
|
68
|
+
type AIWorkspaceScopeExplicitRequest = {
|
|
69
|
+
mode: 'explicit';
|
|
70
|
+
includeChildCompanies?: boolean;
|
|
71
|
+
} & AIWorkspaceScopeExplicitIdentifiers;
|
|
72
|
+
export type AIWorkspaceScopeRequest = AIWorkspaceScopeAllAuthorizedRequest | AIWorkspaceScopeExplicitRequest;
|
|
73
|
+
export interface AIResolvedWorkspaceScope {
|
|
74
|
+
companyIds: string[];
|
|
75
|
+
subscriptionIds: string[];
|
|
76
|
+
resourceIds: string[];
|
|
77
|
+
policyOutcome: AIWorkspaceScopePolicyOutcome;
|
|
78
|
+
rejectedCompanyIds?: string[];
|
|
79
|
+
rejectedSubscriptionIds?: string[];
|
|
80
|
+
rejectedResourceIds?: string[];
|
|
81
|
+
}
|
|
82
|
+
export type AIChatSkillId = string;
|
|
83
|
+
export type AIChatDomain = 'cost' | 'performance' | 'security' | 'reliability' | 'governance' | 'operations' | 'general';
|
|
84
|
+
export type AIChatIntentLabel = 'askSummary' | 'investigateCost' | 'investigateSecurity' | 'investigateReliability' | 'investigateGovernance' | 'executeAction' | 'explainRecommendation' | 'unknown';
|
|
85
|
+
export type AIChatComplexity = 'simple' | 'standard' | 'complex';
|
|
86
|
+
export interface AIChatClassificationIntent {
|
|
87
|
+
label: AIChatIntentLabel;
|
|
88
|
+
confidence: number;
|
|
89
|
+
}
|
|
90
|
+
export interface AIChatClassificationResult {
|
|
91
|
+
version: string;
|
|
92
|
+
intents: AIChatClassificationIntent[];
|
|
93
|
+
complexity: AIChatComplexity;
|
|
94
|
+
requiresTools: boolean;
|
|
95
|
+
suggestedSkillPackIds: AIChatSkillId[];
|
|
96
|
+
}
|
|
97
|
+
type AIChatRoutingReasonCode = 'AI_SKILL_CLASSIFIER_SELECTED' | 'AI_SKILL_CLASSIFIER_LOW_CONFIDENCE' | 'AI_SKILL_FALLBACK_DEFAULT';
|
|
98
|
+
type AIChatScopeReasonCode = 'AI_SCOPE_EMPTY_REQUEST' | 'AI_SCOPE_EMPTY_EFFECTIVE' | 'AI_SCOPE_REDUCED_UNAUTHORIZED_MEMBERS' | 'AI_SCOPE_INVALID';
|
|
99
|
+
type AIChatApprovalReasonCode = 'AI_MUTATION_CONFIRMATION_REQUIRED' | 'AI_MUTATION_CONFIRMATION_EXPIRED' | 'AI_MUTATION_CONFIRMATION_REJECTED';
|
|
100
|
+
type AIChatDegradedReasonCode = 'AI_MCP_PROVIDER_UNAVAILABLE' | 'AI_MCP_PROVIDER_TIMEOUT' | 'AI_MCP_PARTIAL_FAILURE' | 'AI_TOOL_TIMEOUT' | 'AI_TOOL_PARTIAL_FAILURE' | 'AI_DEGRADED_NO_PATH';
|
|
101
|
+
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';
|
|
102
|
+
export type AIChatReasonCode = AIChatRoutingReasonCode | AIChatScopeReasonCode | AIChatApprovalReasonCode | AIChatDegradedReasonCode | AIChatOrchestrationReasonCode;
|
|
103
|
+
export type AIRouteReasonCode = 'route.low_confidence' | 'route.page_context_sufficient' | 'route.cross_domain_analysis_required' | 'route.retrieval_required' | 'route.missing_required_inputs' | `route.${string}`;
|
|
104
|
+
export type AIToolReasonCode = 'tool.not_authorized' | 'tool.out_of_scope' | 'tool.missing_required_arguments' | 'tool.requires_confirmation' | 'tool.not_applicable_to_page' | `tool.${string}`;
|
|
105
|
+
export type AIFreshnessReasonCode = 'freshness.current' | 'freshness.stale_source' | 'freshness.partial_data' | 'freshness.refresh_in_progress' | `freshness.${string}`;
|
|
106
|
+
export type AISchemaReasonCode = 'schema.parse_failed' | 'schema.validation_failed' | 'schema.missing_required_field' | 'schema.invalid_enum_value' | `schema.${string}`;
|
|
107
|
+
export type AIReasonCode = AIRouteReasonCode | AIToolReasonCode | AIFreshnessReasonCode | AISchemaReasonCode;
|
|
108
|
+
export interface AISchemaIssue {
|
|
109
|
+
reasonCode: AISchemaReasonCode;
|
|
110
|
+
fieldPath?: string;
|
|
111
|
+
detail?: string;
|
|
112
|
+
}
|
|
113
|
+
export interface AIChatSkillClassificationCandidate {
|
|
114
|
+
skillId: AIChatSkillId;
|
|
115
|
+
score: number;
|
|
116
|
+
reasonCodes: AIChatReasonCode[];
|
|
117
|
+
}
|
|
118
|
+
export interface AIChatSkillClassificationResult {
|
|
119
|
+
classifierVersion: string;
|
|
120
|
+
selectedSkillPackId?: AIChatSkillId;
|
|
121
|
+
candidates: AIChatSkillClassificationCandidate[];
|
|
122
|
+
reasonCodes?: AIChatReasonCode[];
|
|
123
|
+
}
|
|
124
|
+
export type AIChatRoutingStrategy = 'singleAgent' | 'fanout';
|
|
125
|
+
export interface AIChatRoutingSubtaskPlan {
|
|
126
|
+
subtaskId: string;
|
|
127
|
+
domain: AIChatDomain;
|
|
128
|
+
title: string;
|
|
129
|
+
skillPackId?: AIChatSkillId;
|
|
130
|
+
}
|
|
131
|
+
export interface AIChatRoutingDecision {
|
|
132
|
+
strategy: AIChatRoutingStrategy;
|
|
133
|
+
selectedMode: AIChatMode;
|
|
134
|
+
selectedSkillPackIds: AIChatSkillId[];
|
|
135
|
+
reasonCodes: AIChatReasonCode[];
|
|
136
|
+
subtasks?: AIChatRoutingSubtaskPlan[];
|
|
137
|
+
}
|
|
138
|
+
export type AIChatSkillRouteSource = 'auto' | 'default';
|
|
139
|
+
export type AIChatSkillRoutePolicyOutcome = 'accepted' | 'fallback' | 'rejected';
|
|
140
|
+
export interface AIChatSkillRouteTarget {
|
|
141
|
+
skillPackId: AIChatSkillId;
|
|
142
|
+
skillPackVersion: string;
|
|
143
|
+
routeSource: AIChatSkillRouteSource;
|
|
144
|
+
policyOutcome: AIChatSkillRoutePolicyOutcome;
|
|
145
|
+
}
|
|
146
|
+
export interface AIChatSkillRoutingFallback {
|
|
147
|
+
fromSkillPackId?: AIChatSkillId;
|
|
148
|
+
toRoute: AIChatSkillRouteTarget;
|
|
149
|
+
reasonCode: AIChatReasonCode;
|
|
150
|
+
}
|
|
151
|
+
export interface AIChatSkillRoutingDecision {
|
|
152
|
+
selectedSkillPackId?: AIChatSkillId;
|
|
153
|
+
route: AIChatSkillRouteTarget;
|
|
154
|
+
reasonCodes: AIChatReasonCode[];
|
|
155
|
+
fallback?: AIChatSkillRoutingFallback;
|
|
156
|
+
}
|
|
157
|
+
export type AIChatClassificationMetadata = AIChatClassificationResult | AIChatSkillClassificationResult;
|
|
158
|
+
export type AIChatRoutingMetadata = AIChatRoutingDecision | AIChatSkillRoutingDecision;
|
|
159
|
+
export type AIEntityType = 'company' | 'subscription' | 'resource' | 'recommendation' | string;
|
|
160
|
+
export interface AIEntityRef {
|
|
161
|
+
id: string;
|
|
162
|
+
label?: string;
|
|
163
|
+
type: AIEntityType;
|
|
164
|
+
}
|
|
165
|
+
export type AIPageIntentHint = 'thisPage' | 'theseRows' | 'thisResource' | 'crossPage';
|
|
166
|
+
export interface AIPageFreshness {
|
|
167
|
+
capturedAt: string;
|
|
168
|
+
dataAsOf?: string;
|
|
169
|
+
isStale?: boolean;
|
|
170
|
+
stalenessReason?: string;
|
|
171
|
+
reasonCode?: AIFreshnessReasonCode;
|
|
172
|
+
}
|
|
173
|
+
export interface AIChatPageSnapshot {
|
|
174
|
+
pageType: string;
|
|
175
|
+
pageId?: string;
|
|
176
|
+
pageUrl?: string;
|
|
177
|
+
companyId?: string;
|
|
178
|
+
title?: string;
|
|
179
|
+
summary?: string;
|
|
180
|
+
routePath?: string;
|
|
181
|
+
tab?: string;
|
|
182
|
+
view?: string;
|
|
183
|
+
selectedEntities: AIEntityRef[];
|
|
184
|
+
scopeLabels: {
|
|
185
|
+
company?: string;
|
|
186
|
+
subscriptions?: string[];
|
|
187
|
+
resources?: string[];
|
|
188
|
+
};
|
|
189
|
+
uiState?: Record<string, unknown>;
|
|
190
|
+
loadedDataHints?: string[];
|
|
191
|
+
intentHints?: AIPageIntentHint[];
|
|
192
|
+
freshness?: AIPageFreshness;
|
|
193
|
+
}
|
|
194
|
+
export type AIChatMutationMode = 'read' | 'writeRequiresApproval' | 'writeBlocked';
|
|
195
|
+
export interface AIChatToolAffordanceEntry {
|
|
196
|
+
toolName: string;
|
|
197
|
+
title?: string;
|
|
198
|
+
reasonCode?: AIReasonCode;
|
|
199
|
+
reason?: string;
|
|
200
|
+
missingArgs?: string[];
|
|
201
|
+
requiresApproval?: boolean;
|
|
202
|
+
}
|
|
203
|
+
export interface AIChatBlockedToolAffordanceEntry extends AIChatToolAffordanceEntry {
|
|
204
|
+
blockReasonCode?: AIReasonCode;
|
|
205
|
+
blockReason?: string;
|
|
206
|
+
}
|
|
207
|
+
export interface AIChatToolAffordanceSnapshot {
|
|
208
|
+
availableTools: AIChatToolAffordanceEntry[];
|
|
209
|
+
applicableTools: AIChatToolAffordanceEntry[];
|
|
210
|
+
deferredTools: AIChatToolAffordanceEntry[];
|
|
211
|
+
writeTools: AIChatToolAffordanceEntry[];
|
|
212
|
+
blockedTools: AIChatBlockedToolAffordanceEntry[];
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Canonical route taxonomy shared by UI, API, and persisted artifacts.
|
|
216
|
+
* These lowerCamelCase values are the only target-state route names.
|
|
217
|
+
*/
|
|
218
|
+
export type AIOrchestrationPath = 'clarify' | 'pageAnswer' | 'genericToolLoop' | 'analysisWithRetrieval';
|
|
219
|
+
export interface AIRouterDomainScore {
|
|
220
|
+
name: 'cost' | 'performance' | 'reliability' | 'security' | 'operations' | string;
|
|
221
|
+
confidence: number;
|
|
222
|
+
}
|
|
223
|
+
export interface AIRouterOutput {
|
|
224
|
+
path: AIOrchestrationPath;
|
|
225
|
+
confidence: number;
|
|
226
|
+
entitiesInFocus: string[];
|
|
227
|
+
domains: AIRouterDomainScore[];
|
|
228
|
+
needsRetrieval: boolean;
|
|
229
|
+
missingInputs: string[];
|
|
230
|
+
reasonCode?: AIRouteReasonCode;
|
|
231
|
+
whyThisPath?: string;
|
|
232
|
+
complexity?: AIChatComplexity;
|
|
233
|
+
}
|
|
234
|
+
export type AIPlannerPriority = 'P1' | 'P2' | 'P3';
|
|
235
|
+
export interface AIPlannerWorkItem {
|
|
236
|
+
workItemId: string;
|
|
237
|
+
domain: string;
|
|
238
|
+
task: string;
|
|
239
|
+
priority: AIPlannerPriority;
|
|
240
|
+
}
|
|
241
|
+
export interface AIPlannerRetrievalStep {
|
|
242
|
+
retrievalId: string;
|
|
243
|
+
toolName: string;
|
|
244
|
+
purpose: string;
|
|
245
|
+
arguments: Record<string, unknown>;
|
|
246
|
+
required: boolean;
|
|
247
|
+
}
|
|
248
|
+
export interface AIPlannerOutput {
|
|
249
|
+
investigationGoal: string;
|
|
250
|
+
decisionToSupport: string;
|
|
251
|
+
workItems: AIPlannerWorkItem[];
|
|
252
|
+
retrievalPlan: AIPlannerRetrievalStep[];
|
|
253
|
+
successCriteria: string[];
|
|
254
|
+
}
|
|
255
|
+
export type AICitationSourceType = 'toolResult' | 'pageData' | 'document' | 'metric' | 'log' | string;
|
|
256
|
+
export interface AIEvidencePayloadMeta {
|
|
257
|
+
payloadShape?: 'summary' | 'compact' | 'full';
|
|
258
|
+
truncated?: boolean;
|
|
259
|
+
truncationReasonCode?: AIReasonCode;
|
|
260
|
+
estimatedItemCount?: number;
|
|
261
|
+
}
|
|
262
|
+
export interface AIChatCitation {
|
|
263
|
+
citationId: string;
|
|
264
|
+
sourceType: AICitationSourceType;
|
|
265
|
+
title: string;
|
|
266
|
+
locator: string;
|
|
267
|
+
snippet?: string;
|
|
268
|
+
toolName?: string;
|
|
269
|
+
retrievedAt: string;
|
|
270
|
+
}
|
|
271
|
+
export interface AIChatAssistantProfileSummary {
|
|
272
|
+
profileId: string;
|
|
273
|
+
title: string;
|
|
274
|
+
description?: string;
|
|
275
|
+
mode?: AIChatMode;
|
|
276
|
+
selectedSkillPackId?: AIChatSkillId;
|
|
277
|
+
capabilityLabels: string[];
|
|
278
|
+
allowsMutations: boolean;
|
|
279
|
+
allowLearnMcp?: boolean;
|
|
280
|
+
}
|
|
281
|
+
export interface AIChatToolPolicySummary {
|
|
282
|
+
mode: 'readOnly' | 'approvalRequired' | 'mixed';
|
|
283
|
+
availableToolCount?: number;
|
|
284
|
+
mutationToolCount?: number;
|
|
285
|
+
approvalRequired: boolean;
|
|
286
|
+
summary: string;
|
|
287
|
+
}
|
|
288
|
+
export type AIChatRetrievalSourceType = 'operational' | 'memory' | 'knowledge' | 'external';
|
|
289
|
+
export interface AIChatSourcePolicySummary {
|
|
290
|
+
sourceTypes: AIChatRetrievalSourceType[];
|
|
291
|
+
externalSourceEnabled: boolean;
|
|
292
|
+
summary: string;
|
|
293
|
+
}
|
|
294
|
+
export type AIChatQueueId = string;
|
|
295
|
+
export interface AIChatQueuedPromptState {
|
|
296
|
+
queueId: AIChatQueueId;
|
|
297
|
+
text: string;
|
|
298
|
+
status: 'queued' | 'sending' | 'cancelled' | 'completed' | 'failed';
|
|
299
|
+
queuedAt: string;
|
|
300
|
+
replacedPromptId?: AIChatQueueId;
|
|
301
|
+
}
|
|
302
|
+
export interface AIChatMemorySourceSummary {
|
|
303
|
+
conversationId: string;
|
|
304
|
+
title?: string;
|
|
305
|
+
matchedAt?: string;
|
|
306
|
+
}
|
|
307
|
+
export interface AIChatMemoryMatch {
|
|
308
|
+
memoryId: string;
|
|
309
|
+
source: AIChatMemorySourceSummary;
|
|
310
|
+
score: number;
|
|
311
|
+
summary: string;
|
|
312
|
+
citationIds?: string[];
|
|
313
|
+
}
|
|
314
|
+
export interface AIChatEvidenceGroup {
|
|
315
|
+
groupId: string;
|
|
316
|
+
title: string;
|
|
317
|
+
sourceType: AIChatRetrievalSourceType;
|
|
318
|
+
citationIds: string[];
|
|
319
|
+
itemCount?: number;
|
|
320
|
+
}
|
|
321
|
+
export type AIChatNoCitationReasonCode = 'citation.not_required' | 'citation.insufficient_evidence' | 'citation.source_unavailable' | `citation.${string}`;
|
|
322
|
+
export interface AIChatCitationCoverage {
|
|
323
|
+
required: boolean;
|
|
324
|
+
satisfied: boolean;
|
|
325
|
+
citationCount: number;
|
|
326
|
+
noCitationReasonCode?: AIChatNoCitationReasonCode;
|
|
327
|
+
}
|
|
328
|
+
export interface AIChatEvidenceCoverage {
|
|
329
|
+
sourceTypes: AIChatRetrievalSourceType[];
|
|
330
|
+
evidenceGroups: AIChatEvidenceGroup[];
|
|
331
|
+
citationCoverage: AIChatCitationCoverage;
|
|
332
|
+
memoryMatches?: AIChatMemoryMatch[];
|
|
333
|
+
}
|
|
334
|
+
export interface AIChatReconnectState {
|
|
335
|
+
status: 'connected' | 'reconnecting' | 'resumed' | 'restarted' | 'degraded';
|
|
336
|
+
message?: string;
|
|
337
|
+
resumedRunId?: string;
|
|
338
|
+
resumedTurnId?: string;
|
|
339
|
+
updatedAt: string;
|
|
340
|
+
}
|
|
341
|
+
export interface AIChatDegradedState {
|
|
342
|
+
degraded: boolean;
|
|
343
|
+
reasonCodes?: AIChatReasonCode[];
|
|
344
|
+
summary?: string;
|
|
345
|
+
}
|
|
346
|
+
export type AIChatCollaborationStatus = 'spawned' | 'running' | 'completed' | 'cancelled' | 'degraded' | 'failed';
|
|
347
|
+
export type AIChatCollaborationRole = 'planner' | 'retrieval' | 'specialist' | 'critic' | 'subAgent' | 'synthesis';
|
|
348
|
+
export interface AIChatCollaborationItem {
|
|
349
|
+
collaborationId: string;
|
|
350
|
+
parentCollaborationId?: string;
|
|
351
|
+
title: string;
|
|
352
|
+
role: AIChatCollaborationRole;
|
|
353
|
+
status: AIChatCollaborationStatus;
|
|
354
|
+
startedAt?: string;
|
|
355
|
+
updatedAt: string;
|
|
356
|
+
endedAt?: string;
|
|
357
|
+
summary?: string;
|
|
358
|
+
citationIds?: string[];
|
|
359
|
+
reasonCode?: AIReasonCode;
|
|
360
|
+
}
|
|
361
|
+
export interface AIChatCollaborationRun {
|
|
362
|
+
runId: string;
|
|
363
|
+
status: AIChatCollaborationStatus;
|
|
364
|
+
items: AIChatCollaborationItem[];
|
|
365
|
+
startedAt: string;
|
|
366
|
+
updatedAt: string;
|
|
367
|
+
endedAt?: string;
|
|
368
|
+
summary?: string;
|
|
369
|
+
}
|
|
370
|
+
export interface AIChatToolExecutionError {
|
|
371
|
+
message: string;
|
|
372
|
+
reasonCode?: AIReasonCode;
|
|
373
|
+
retryable?: boolean;
|
|
374
|
+
details?: unknown;
|
|
375
|
+
}
|
|
376
|
+
export interface AIChatToolExecutionResult {
|
|
377
|
+
ok: boolean;
|
|
378
|
+
data?: unknown;
|
|
379
|
+
error?: AIChatToolExecutionError;
|
|
380
|
+
truncated?: boolean;
|
|
381
|
+
}
|
|
382
|
+
export interface AIToolError extends AIChatToolExecutionError {
|
|
383
|
+
code: string;
|
|
384
|
+
}
|
|
385
|
+
export interface AIToolResult extends AIChatToolExecutionResult {
|
|
386
|
+
toolName: string;
|
|
387
|
+
error?: AIToolError;
|
|
388
|
+
payloadMeta?: AIEvidencePayloadMeta;
|
|
389
|
+
}
|
|
390
|
+
export interface AIToolCall {
|
|
391
|
+
callId: string;
|
|
392
|
+
toolName: string;
|
|
393
|
+
arguments: Record<string, unknown>;
|
|
394
|
+
}
|
|
395
|
+
export interface AIRetrievalExecutionStep {
|
|
396
|
+
retrievalId: string;
|
|
397
|
+
toolName: string;
|
|
398
|
+
argsHash: string;
|
|
399
|
+
startedAt: string;
|
|
400
|
+
endedAt?: string;
|
|
401
|
+
status: 'ok' | 'error' | 'skipped';
|
|
402
|
+
summary?: string;
|
|
403
|
+
callId?: string;
|
|
404
|
+
error?: AIToolError;
|
|
405
|
+
citationIds: string[];
|
|
406
|
+
}
|
|
407
|
+
export interface AIEvidenceEntry {
|
|
408
|
+
evidenceId: string;
|
|
409
|
+
sourceTool: string;
|
|
410
|
+
argsHash: string;
|
|
411
|
+
timestamp: string;
|
|
412
|
+
status: 'ok' | 'error' | 'partial';
|
|
413
|
+
summary: string;
|
|
414
|
+
citationIds: string[];
|
|
415
|
+
domains?: string[];
|
|
416
|
+
payloadMeta?: AIEvidencePayloadMeta;
|
|
417
|
+
}
|
|
418
|
+
export interface AIEvidenceGap {
|
|
419
|
+
gapId: string;
|
|
420
|
+
description: string;
|
|
421
|
+
blocking: boolean;
|
|
422
|
+
suggestedFollowup?: string;
|
|
423
|
+
}
|
|
424
|
+
export interface AIEvidenceLabelMap {
|
|
425
|
+
companies?: Record<string, string>;
|
|
426
|
+
subscriptions?: Record<string, string>;
|
|
427
|
+
resources?: Record<string, string>;
|
|
428
|
+
recommendations?: Record<string, string>;
|
|
429
|
+
}
|
|
430
|
+
export interface AIEvidenceBundle {
|
|
431
|
+
bundleId: string;
|
|
432
|
+
entries: AIEvidenceEntry[];
|
|
433
|
+
citations: AIChatCitation[];
|
|
434
|
+
labelMap: AIEvidenceLabelMap;
|
|
435
|
+
gaps: AIEvidenceGap[];
|
|
436
|
+
createdAt: string;
|
|
437
|
+
}
|
|
438
|
+
export interface AIRetrievalExecution {
|
|
439
|
+
retrievalPlan: AIPlannerRetrievalStep[];
|
|
440
|
+
executionSteps: AIRetrievalExecutionStep[];
|
|
441
|
+
followupPassExecuted: boolean;
|
|
442
|
+
evidenceBundle: AIEvidenceBundle;
|
|
443
|
+
}
|
|
444
|
+
export interface AISpecialistAction {
|
|
445
|
+
title: string;
|
|
446
|
+
risk: 'low' | 'medium' | 'high';
|
|
447
|
+
effort: 'low' | 'medium' | 'high';
|
|
448
|
+
}
|
|
449
|
+
export interface AISpecialistTradeoff {
|
|
450
|
+
withDomain: string;
|
|
451
|
+
summary: string;
|
|
452
|
+
}
|
|
453
|
+
export interface AISpecialistOutput {
|
|
454
|
+
specialistId: string;
|
|
455
|
+
domain: string;
|
|
456
|
+
topFindings: string[];
|
|
457
|
+
evidence: string[];
|
|
458
|
+
actions: AISpecialistAction[];
|
|
459
|
+
tradeoffs: AISpecialistTradeoff[];
|
|
460
|
+
assumptions: string[];
|
|
461
|
+
dataGaps: string[];
|
|
462
|
+
followupRetrieval: AIPlannerRetrievalStep[];
|
|
463
|
+
confidence: number;
|
|
464
|
+
}
|
|
465
|
+
export interface AISynthesisOutput {
|
|
466
|
+
recommendedPlan: string;
|
|
467
|
+
alternatives: string[];
|
|
468
|
+
keyActions: string[];
|
|
469
|
+
risks: string[];
|
|
470
|
+
evidenceTrace: string[];
|
|
471
|
+
unresolvedGaps: string[];
|
|
472
|
+
confidence: number;
|
|
473
|
+
disagreement: boolean;
|
|
474
|
+
}
|
|
475
|
+
export interface AICriticOutput {
|
|
476
|
+
verdict: 'PASS' | 'REVISE';
|
|
477
|
+
confidence: number;
|
|
478
|
+
reason: string;
|
|
479
|
+
issues: string[];
|
|
480
|
+
rerunAgents: string[];
|
|
481
|
+
}
|
|
482
|
+
export type AIHtmlLitePolicy = 'htmlLite';
|
|
483
|
+
export interface AIFormatterOutput {
|
|
484
|
+
policy: AIHtmlLitePolicy;
|
|
485
|
+
answerHtml: string;
|
|
486
|
+
answerText: string;
|
|
487
|
+
citations: AIChatCitation[];
|
|
488
|
+
labelFirstApplied: boolean;
|
|
489
|
+
normalizationHash: string;
|
|
490
|
+
}
|
|
491
|
+
export type AIChatTurnPhase = 'intake' | 'contextResolved' | 'skillResolved' | 'planning' | 'executing' | 'awaitingApproval' | 'formatting' | 'finalizing' | 'completed' | 'errored' | 'cancelled';
|
|
492
|
+
export type AIChatTurnStatus = 'running' | 'waiting' | 'completed' | 'errored' | 'cancelled';
|
|
493
|
+
export type AIChatRunStatus = 'queued' | 'running' | 'paused' | 'resuming' | 'completed' | 'failed' | 'cancelled';
|
|
494
|
+
export type AIChatRunPauseReason = 'approvalRequired' | 'toolInputRequired' | 'stalled' | 'reconnectRequired' | 'policyIntervention' | `pause.${string}`;
|
|
495
|
+
export type AIChatRunResumeReason = 'approvalDecision' | 'reconnect' | 'manual' | 'retry' | `resume.${string}`;
|
|
496
|
+
export interface AIChatRunState {
|
|
497
|
+
runId: string;
|
|
498
|
+
status: AIChatRunStatus;
|
|
499
|
+
updatedAt: string;
|
|
500
|
+
startedAt?: string;
|
|
501
|
+
pausedAt?: string;
|
|
502
|
+
resumedAt?: string;
|
|
503
|
+
completedAt?: string;
|
|
504
|
+
pauseReason?: AIChatRunPauseReason;
|
|
505
|
+
resumeReason?: AIChatRunResumeReason;
|
|
506
|
+
terminalReasonCode?: AIReasonCode;
|
|
507
|
+
terminalMessage?: string;
|
|
508
|
+
}
|
|
509
|
+
export interface AIChatPausedRunInfo {
|
|
510
|
+
runId: string;
|
|
511
|
+
pauseReason: AIChatRunPauseReason;
|
|
512
|
+
pausedAt: string;
|
|
513
|
+
approvalChallengeId?: string;
|
|
514
|
+
pendingApprovals?: AIChatApprovalRecord[];
|
|
515
|
+
}
|
|
516
|
+
export interface AIChatTurnState {
|
|
517
|
+
runId: string;
|
|
518
|
+
turnId: string;
|
|
519
|
+
phase: AIChatTurnPhase;
|
|
520
|
+
status: AIChatTurnStatus;
|
|
521
|
+
updatedAt: string;
|
|
522
|
+
responseMode?: AIChatResolvedResponseMode;
|
|
523
|
+
path?: AIOrchestrationPath;
|
|
524
|
+
analysisConfidence?: number;
|
|
525
|
+
selectedSkillPackId?: AIChatSkillId;
|
|
526
|
+
}
|
|
527
|
+
export type AIChatCommentaryKind = 'preamble' | 'progress' | 'finding' | 'handoff';
|
|
528
|
+
export interface AIChatCommentaryEntry {
|
|
529
|
+
commentaryId: string;
|
|
530
|
+
kind: AIChatCommentaryKind;
|
|
531
|
+
text: string;
|
|
532
|
+
timestamp: string;
|
|
533
|
+
phase?: AIChatTurnPhase;
|
|
534
|
+
progressId?: string;
|
|
535
|
+
}
|
|
536
|
+
export type AIChatPlanStepStatus = 'pending' | 'running' | 'completed' | 'blocked';
|
|
537
|
+
export interface AIChatPlanStep {
|
|
538
|
+
stepId: string;
|
|
539
|
+
label: string;
|
|
540
|
+
status: AIChatPlanStepStatus;
|
|
541
|
+
summary?: string;
|
|
542
|
+
domain?: AIChatDomain;
|
|
543
|
+
}
|
|
544
|
+
export interface AIChatPlanSnapshot {
|
|
545
|
+
planId: string;
|
|
546
|
+
goal?: string;
|
|
547
|
+
updatedAt: string;
|
|
548
|
+
steps: AIChatPlanStep[];
|
|
549
|
+
}
|
|
550
|
+
export type AIChatProgressCategory = 'context' | 'routing' | 'planning' | 'retrieval' | 'toolExecution' | 'subtask' | 'approval' | 'formatting' | 'finalization';
|
|
551
|
+
export type AIChatProgressStatus = 'pending' | 'running' | 'completed' | 'blocked' | 'failed' | 'skipped';
|
|
552
|
+
export interface AIChatProgressEntry {
|
|
553
|
+
progressId: string;
|
|
554
|
+
category: AIChatProgressCategory;
|
|
555
|
+
status: AIChatProgressStatus;
|
|
556
|
+
title: string;
|
|
557
|
+
detail?: string;
|
|
558
|
+
timestamp: string;
|
|
559
|
+
phase?: AIChatTurnPhase;
|
|
560
|
+
stepId?: string;
|
|
561
|
+
callId?: string;
|
|
562
|
+
subtaskId?: string;
|
|
563
|
+
collaborationId?: string;
|
|
564
|
+
reasonCode?: AIReasonCode;
|
|
565
|
+
}
|
|
566
|
+
export type AIChatApprovalState = 'pending' | 'approved' | 'rejected' | 'consumed' | 'expired' | 'completed' | 'failed';
|
|
567
|
+
export interface AIChatApprovalRecord {
|
|
568
|
+
runId: string;
|
|
569
|
+
challengeId: string;
|
|
570
|
+
state: AIChatApprovalState;
|
|
571
|
+
actionSummary: string;
|
|
572
|
+
actionType?: string;
|
|
573
|
+
requiredRole: string;
|
|
574
|
+
riskLevel: 'low' | 'medium' | 'high';
|
|
575
|
+
idempotencyKey: string;
|
|
576
|
+
createdAt: string;
|
|
577
|
+
decidedAt?: string;
|
|
578
|
+
expiresAt?: string;
|
|
579
|
+
updatedAt?: string;
|
|
580
|
+
detail?: string;
|
|
581
|
+
}
|
|
582
|
+
export interface AIChatSkillPackDescriptor {
|
|
583
|
+
skillId: AIChatSkillId;
|
|
584
|
+
version: string;
|
|
585
|
+
title: string;
|
|
586
|
+
description?: string;
|
|
587
|
+
domains: AIChatDomain[];
|
|
588
|
+
supportedModes: AIChatMode[];
|
|
589
|
+
intentSignals: string[];
|
|
590
|
+
toolPolicy: {
|
|
591
|
+
allowedToolNames?: string[];
|
|
592
|
+
blockedToolNames?: string[];
|
|
593
|
+
allowMcpProviders?: boolean;
|
|
594
|
+
allowedMcpCapabilities?: string[];
|
|
595
|
+
blockedMcpCapabilities?: string[];
|
|
596
|
+
allowMutations: boolean;
|
|
597
|
+
};
|
|
598
|
+
approvalPolicy: {
|
|
599
|
+
required: boolean;
|
|
600
|
+
requiredRole?: string;
|
|
601
|
+
defaultRiskLevel?: 'low' | 'medium' | 'high';
|
|
602
|
+
};
|
|
603
|
+
uxHints?: {
|
|
604
|
+
commentaryStyle?: 'compact' | 'standard';
|
|
605
|
+
showPlanByDefault?: boolean;
|
|
606
|
+
preferredProgressCategories?: AIChatProgressCategory[];
|
|
607
|
+
};
|
|
608
|
+
fallbackPath?: AIOrchestrationPath;
|
|
609
|
+
enabled: boolean;
|
|
610
|
+
}
|
|
611
|
+
export interface AIChatToolDescriptor {
|
|
612
|
+
toolName: string;
|
|
613
|
+
source: 'internal' | 'mcp' | `mcp:${string}` | string;
|
|
614
|
+
providerId?: string;
|
|
615
|
+
providerTitle?: string;
|
|
616
|
+
providerCapabilities?: string[];
|
|
617
|
+
title: string;
|
|
618
|
+
description: string;
|
|
619
|
+
domains?: AIChatDomain[];
|
|
620
|
+
mutationMode: AIChatMutationMode;
|
|
621
|
+
approvalRequirement?: {
|
|
622
|
+
required: boolean;
|
|
623
|
+
requiredRole?: string;
|
|
624
|
+
riskLevel?: 'low' | 'medium' | 'high';
|
|
625
|
+
};
|
|
626
|
+
scopeHints?: {
|
|
627
|
+
chatModes?: AIChatMode[];
|
|
628
|
+
requiresWorkspaceScope?: boolean;
|
|
629
|
+
pageTypes?: string[];
|
|
630
|
+
};
|
|
631
|
+
evidenceKinds?: string[];
|
|
632
|
+
resultShape?: string;
|
|
633
|
+
usageHints?: string[];
|
|
634
|
+
avoidWhen?: string[];
|
|
635
|
+
}
|
|
636
|
+
export interface AIChatTurnSnapshot {
|
|
637
|
+
run: AIChatRunState;
|
|
638
|
+
turn: AIChatTurnState;
|
|
639
|
+
selectedSkillPack?: AIChatSkillPackDescriptor;
|
|
640
|
+
assistantProfileSummary?: AIChatAssistantProfileSummary;
|
|
641
|
+
toolPolicySummary?: AIChatToolPolicySummary;
|
|
642
|
+
sourcePolicySummary?: AIChatSourcePolicySummary;
|
|
643
|
+
queuedPrompt?: AIChatQueuedPromptState;
|
|
644
|
+
plan?: AIChatPlanSnapshot;
|
|
645
|
+
commentaryEntries?: AIChatCommentaryEntry[];
|
|
646
|
+
progressEntries?: AIChatProgressEntry[];
|
|
647
|
+
approvalRecords?: AIChatApprovalRecord[];
|
|
648
|
+
toolDescriptors?: AIChatToolDescriptor[];
|
|
649
|
+
evidenceCoverage?: AIChatEvidenceCoverage;
|
|
650
|
+
reconnectState?: AIChatReconnectState;
|
|
651
|
+
degradedState?: AIChatDegradedState;
|
|
652
|
+
collaborationRun?: AIChatCollaborationRun;
|
|
653
|
+
}
|
|
654
|
+
export interface AIChatFinalSnapshot {
|
|
655
|
+
/**
|
|
656
|
+
* Authoritative final turn state. Additional stage outputs are additive sidecars.
|
|
657
|
+
*/
|
|
658
|
+
run: AIChatRunState;
|
|
659
|
+
turnSnapshot: AIChatTurnSnapshot;
|
|
660
|
+
pageSnapshot?: AIChatPageSnapshot;
|
|
661
|
+
toolAffordanceSnapshot?: AIChatToolAffordanceSnapshot;
|
|
662
|
+
router?: AIRouterOutput;
|
|
663
|
+
planner?: AIPlannerOutput;
|
|
664
|
+
retrieval?: AIRetrievalExecution;
|
|
665
|
+
specialistOutputs?: AISpecialistOutput[];
|
|
666
|
+
synthesis?: AISynthesisOutput;
|
|
667
|
+
critic?: AICriticOutput;
|
|
668
|
+
formatter?: AIFormatterOutput;
|
|
669
|
+
assistantProfileSummary?: AIChatAssistantProfileSummary;
|
|
670
|
+
toolPolicySummary?: AIChatToolPolicySummary;
|
|
671
|
+
sourcePolicySummary?: AIChatSourcePolicySummary;
|
|
672
|
+
queuedPrompt?: AIChatQueuedPromptState;
|
|
673
|
+
evidenceCoverage?: AIChatEvidenceCoverage;
|
|
674
|
+
reconnectState?: AIChatReconnectState;
|
|
675
|
+
degradedState?: AIChatDegradedState;
|
|
676
|
+
collaborationRun?: AIChatCollaborationRun;
|
|
677
|
+
}
|
|
678
|
+
export interface AIChatAuditArtifact {
|
|
679
|
+
conversationId: string;
|
|
680
|
+
runId: string;
|
|
681
|
+
turnId: string;
|
|
682
|
+
createdAt: string;
|
|
683
|
+
turnSnapshot: AIChatTurnSnapshot;
|
|
684
|
+
snapshots?: {
|
|
685
|
+
pageSnapshot?: AIChatPageSnapshot;
|
|
686
|
+
toolAffordanceSnapshot?: AIChatToolAffordanceSnapshot;
|
|
687
|
+
};
|
|
688
|
+
router?: AIRouterOutput;
|
|
689
|
+
planner?: AIPlannerOutput;
|
|
690
|
+
retrieval?: AIRetrievalExecution;
|
|
691
|
+
specialists?: AISpecialistOutput[];
|
|
692
|
+
synthesis?: AISynthesisOutput;
|
|
693
|
+
critic?: AICriticOutput;
|
|
694
|
+
formatter?: AIFormatterOutput;
|
|
695
|
+
assistantProfileSummary?: AIChatAssistantProfileSummary;
|
|
696
|
+
toolPolicySummary?: AIChatToolPolicySummary;
|
|
697
|
+
sourcePolicySummary?: AIChatSourcePolicySummary;
|
|
698
|
+
queuedPrompt?: AIChatQueuedPromptState;
|
|
699
|
+
evidenceCoverage?: AIChatEvidenceCoverage;
|
|
700
|
+
reconnectState?: AIChatReconnectState;
|
|
701
|
+
degradedState?: AIChatDegradedState;
|
|
702
|
+
collaborationRun?: AIChatCollaborationRun;
|
|
703
|
+
analysisConfidence?: number;
|
|
704
|
+
}
|
|
705
|
+
export interface AIChatApprovalDecision {
|
|
706
|
+
challengeId: string;
|
|
707
|
+
decision: 'approve' | 'reject';
|
|
708
|
+
idempotencyKey: string;
|
|
709
|
+
submittedAt?: string;
|
|
710
|
+
}
|
|
711
|
+
export interface AIChatRunResumeDirective {
|
|
712
|
+
reason: AIChatRunResumeReason;
|
|
713
|
+
note?: string;
|
|
714
|
+
}
|
|
715
|
+
export interface AIChatApprovalSubmissionRequest {
|
|
716
|
+
conversationId: string;
|
|
717
|
+
runId: string;
|
|
718
|
+
decision: AIChatApprovalDecision;
|
|
719
|
+
resume?: AIChatRunResumeDirective & {
|
|
720
|
+
mode?: 'immediate' | 'manual';
|
|
721
|
+
};
|
|
722
|
+
}
|
|
723
|
+
interface AIChatRequestBase {
|
|
724
|
+
conversationId?: string;
|
|
725
|
+
runId?: string;
|
|
726
|
+
contextHash?: string;
|
|
727
|
+
responseMode?: AIChatResponseMode;
|
|
728
|
+
queuedPrompt?: AIChatQueuedPromptState;
|
|
729
|
+
/**
|
|
730
|
+
* Live chat transport is streaming-only. Non-streaming requests are not part
|
|
731
|
+
* of the target shared contract.
|
|
732
|
+
*/
|
|
733
|
+
stream: true;
|
|
734
|
+
}
|
|
735
|
+
interface AIChatRunStartRequestPage extends AIChatRequestBase {
|
|
736
|
+
action: 'start';
|
|
737
|
+
chatMode: 'page';
|
|
738
|
+
input: string;
|
|
739
|
+
pageContext: PageContext;
|
|
740
|
+
workspaceScope?: never;
|
|
741
|
+
runId?: never;
|
|
742
|
+
}
|
|
743
|
+
interface AIChatRunStartRequestWorkspace extends AIChatRequestBase {
|
|
744
|
+
action: 'start';
|
|
745
|
+
chatMode: 'workspace';
|
|
746
|
+
input: string;
|
|
747
|
+
/**
|
|
748
|
+
* Workspace turns may still include page context when launched from a page,
|
|
749
|
+
* but pure workspace turns rely on workspaceScope alone.
|
|
750
|
+
*/
|
|
751
|
+
pageContext?: PageContext;
|
|
752
|
+
workspaceScope: AIWorkspaceScopeRequest;
|
|
753
|
+
}
|
|
754
|
+
export type AIChatRunStartRequest = AIChatRunStartRequestPage | AIChatRunStartRequestWorkspace;
|
|
755
|
+
export interface AIChatRunResumeRequest extends AIChatRequestBase {
|
|
756
|
+
action: 'resume';
|
|
757
|
+
conversationId: string;
|
|
758
|
+
runId: string;
|
|
759
|
+
chatMode?: AIChatMode;
|
|
760
|
+
pageContext?: PageContext;
|
|
761
|
+
workspaceScope?: AIWorkspaceScopeRequest;
|
|
762
|
+
input?: string;
|
|
763
|
+
approvalDecision?: AIChatApprovalDecision;
|
|
764
|
+
resume: AIChatRunResumeDirective;
|
|
765
|
+
}
|
|
766
|
+
export type AIChatRunRequest = AIChatRunStartRequest | AIChatRunResumeRequest;
|
|
767
|
+
export type AIChatRequest = AIChatRunRequest;
|
|
768
|
+
export interface AIConversationScopeMetadata {
|
|
769
|
+
chatMode?: AIChatMode;
|
|
770
|
+
resolvedWorkspaceScope?: AIResolvedWorkspaceScope;
|
|
771
|
+
selectedSkillPackIds?: AIChatSkillId[];
|
|
772
|
+
}
|
|
773
|
+
export interface AIConversationRoutingMetadata extends AIConversationScopeMetadata {
|
|
774
|
+
classification?: AIChatClassificationMetadata;
|
|
775
|
+
routing?: AIChatRoutingMetadata;
|
|
776
|
+
}
|
|
777
|
+
export interface AIConversationListItem extends AIConversationRoutingMetadata {
|
|
778
|
+
id: string;
|
|
779
|
+
summary?: string;
|
|
780
|
+
messageCount: number;
|
|
781
|
+
lastResponseTime?: Date | string;
|
|
782
|
+
pageUrl?: string;
|
|
783
|
+
pageType?: string;
|
|
784
|
+
}
|
|
785
|
+
export interface AIChatUsage {
|
|
786
|
+
promptTokens: number;
|
|
787
|
+
completionTokens: number;
|
|
788
|
+
totalTokens: number;
|
|
789
|
+
}
|
|
790
|
+
export interface AIChatTerminalSnapshot {
|
|
791
|
+
conversationId: string;
|
|
792
|
+
runId: string;
|
|
793
|
+
run: AIChatRunState;
|
|
794
|
+
turnSnapshot: AIChatTurnSnapshot;
|
|
795
|
+
finalSnapshot?: AIChatFinalSnapshot;
|
|
796
|
+
auditArtifact?: AIChatAuditArtifact;
|
|
797
|
+
resolvedResponseMode?: AIChatResolvedResponseMode;
|
|
798
|
+
chatMode?: AIChatMode;
|
|
799
|
+
resolvedScope?: AIResolvedWorkspaceScope;
|
|
800
|
+
classification?: AIChatClassificationMetadata;
|
|
801
|
+
routing?: AIChatRoutingMetadata;
|
|
802
|
+
structuredResponse?: StructuredAIResponse;
|
|
803
|
+
usage?: AIChatUsage;
|
|
804
|
+
answer?: string;
|
|
805
|
+
completionReason?: string;
|
|
806
|
+
citations?: AIChatCitation[];
|
|
807
|
+
assistantProfileSummary?: AIChatAssistantProfileSummary;
|
|
808
|
+
toolPolicySummary?: AIChatToolPolicySummary;
|
|
809
|
+
sourcePolicySummary?: AIChatSourcePolicySummary;
|
|
810
|
+
queuedPrompt?: AIChatQueuedPromptState;
|
|
811
|
+
evidenceCoverage?: AIChatEvidenceCoverage;
|
|
812
|
+
reconnectState?: AIChatReconnectState;
|
|
813
|
+
degradedState?: AIChatDegradedState;
|
|
814
|
+
collaborationRun?: AIChatCollaborationRun;
|
|
815
|
+
}
|
|
816
|
+
/**
|
|
817
|
+
* Canonical lowerCamelCase SSE event vocabulary for the target chat runtime.
|
|
818
|
+
*/
|
|
819
|
+
export type AIChatStreamEventName = 'runStarted' | 'runStatus' | 'runPaused' | 'runResumed' | 'runCompleted' | 'scopeResolved' | 'pageSnapshotBuilt' | 'toolAffordanceBuilt' | 'routingStarted' | 'routingCompleted' | 'planCreated' | 'planUpdated' | 'commentary' | 'progressUpdate' | 'toolCall' | 'toolResult' | 'toolError' | 'approvalRequired' | 'approvalStateChanged' | 'formatterStarted' | 'formatterCompleted' | 'message' | 'citation'
|
|
820
|
+
/**
|
|
821
|
+
* @deprecated Use `runCompleted`.
|
|
822
|
+
*/
|
|
823
|
+
| 'done' | 'error' | 'ping';
|
|
824
|
+
export interface AIChatStreamEventBase {
|
|
825
|
+
event: AIChatStreamEventName;
|
|
826
|
+
sequence: number;
|
|
827
|
+
conversationId: string;
|
|
828
|
+
runId: string;
|
|
829
|
+
turnId: string;
|
|
830
|
+
timestamp: string;
|
|
831
|
+
}
|
|
832
|
+
export interface AIChatRunStartedEvent extends AIChatStreamEventBase {
|
|
833
|
+
event: 'runStarted';
|
|
834
|
+
run: AIChatRunState;
|
|
835
|
+
chatMode: AIChatMode;
|
|
836
|
+
requestedScope?: AIWorkspaceScopeRequest;
|
|
837
|
+
}
|
|
838
|
+
export interface AIChatRunStatusEvent extends AIChatStreamEventBase {
|
|
839
|
+
event: 'runStatus';
|
|
840
|
+
run: AIChatRunState;
|
|
841
|
+
phase?: AIChatTurnPhase;
|
|
842
|
+
}
|
|
843
|
+
export interface AIChatRunPausedEvent extends AIChatStreamEventBase {
|
|
844
|
+
event: 'runPaused';
|
|
845
|
+
run: AIChatRunState;
|
|
846
|
+
pauseReason: AIChatRunPauseReason;
|
|
847
|
+
approval?: AIChatApprovalRecord;
|
|
848
|
+
pendingApprovals?: AIChatApprovalRecord[];
|
|
849
|
+
reconnectState?: AIChatReconnectState;
|
|
850
|
+
}
|
|
851
|
+
export interface AIChatRunResumedEvent extends AIChatStreamEventBase {
|
|
852
|
+
event: 'runResumed';
|
|
853
|
+
run: AIChatRunState;
|
|
854
|
+
resumeReason: AIChatRunResumeReason;
|
|
855
|
+
}
|
|
856
|
+
export interface AIChatScopeResolvedEvent extends AIChatStreamEventBase {
|
|
857
|
+
event: 'scopeResolved';
|
|
858
|
+
chatMode: AIChatMode;
|
|
859
|
+
requestedScope?: AIWorkspaceScopeRequest;
|
|
860
|
+
resolvedScope: AIResolvedWorkspaceScope;
|
|
861
|
+
}
|
|
862
|
+
export interface AIChatPageSnapshotBuiltEvent extends AIChatStreamEventBase {
|
|
863
|
+
event: 'pageSnapshotBuilt';
|
|
864
|
+
snapshot: AIChatPageSnapshot;
|
|
865
|
+
}
|
|
866
|
+
export interface AIChatToolAffordanceBuiltEvent extends AIChatStreamEventBase {
|
|
867
|
+
event: 'toolAffordanceBuilt';
|
|
868
|
+
toolAffordanceSnapshot: AIChatToolAffordanceSnapshot;
|
|
869
|
+
}
|
|
870
|
+
export interface AIChatRoutingStartedEvent extends AIChatStreamEventBase {
|
|
871
|
+
event: 'routingStarted';
|
|
872
|
+
requestedMode?: AIChatMode;
|
|
873
|
+
}
|
|
874
|
+
export interface AIChatRoutingCompletedEvent extends AIChatStreamEventBase {
|
|
875
|
+
event: 'routingCompleted';
|
|
876
|
+
path: AIOrchestrationPath;
|
|
877
|
+
confidence: number;
|
|
878
|
+
domains?: AIRouterDomainScore[];
|
|
879
|
+
missingInputs: string[];
|
|
880
|
+
reasonCode?: AIReasonCode;
|
|
881
|
+
whyThisPath?: string;
|
|
882
|
+
analysisConfidence?: number;
|
|
883
|
+
needsRetrieval?: boolean;
|
|
884
|
+
selectedSkillPackIds?: AIChatSkillId[];
|
|
885
|
+
complexity?: AIChatComplexity;
|
|
886
|
+
}
|
|
887
|
+
export interface AIChatPlanCreatedEvent extends AIChatStreamEventBase {
|
|
888
|
+
event: 'planCreated';
|
|
889
|
+
plan: AIChatPlanSnapshot;
|
|
890
|
+
}
|
|
891
|
+
export interface AIChatPlanUpdatedEvent extends AIChatStreamEventBase {
|
|
892
|
+
event: 'planUpdated';
|
|
893
|
+
plan: AIChatPlanSnapshot;
|
|
894
|
+
}
|
|
895
|
+
export interface AIChatCommentaryEvent extends AIChatStreamEventBase {
|
|
896
|
+
event: 'commentary';
|
|
897
|
+
entry: AIChatCommentaryEntry;
|
|
898
|
+
}
|
|
899
|
+
export interface AIChatProgressUpdateEvent extends AIChatStreamEventBase {
|
|
900
|
+
event: 'progressUpdate';
|
|
901
|
+
progress: AIChatProgressEntry;
|
|
902
|
+
}
|
|
903
|
+
export interface AIChatToolCallEvent extends AIChatStreamEventBase {
|
|
904
|
+
event: 'toolCall';
|
|
905
|
+
callId: string;
|
|
906
|
+
toolName: string;
|
|
907
|
+
arguments: Record<string, unknown>;
|
|
908
|
+
}
|
|
909
|
+
export interface AIChatToolResultEvent extends AIChatStreamEventBase {
|
|
910
|
+
event: 'toolResult';
|
|
911
|
+
callId: string;
|
|
912
|
+
toolName: string;
|
|
913
|
+
result: AIChatToolExecutionResult;
|
|
914
|
+
}
|
|
915
|
+
export interface AIChatToolErrorEvent extends AIChatStreamEventBase {
|
|
916
|
+
event: 'toolError';
|
|
917
|
+
callId: string;
|
|
918
|
+
toolName: string;
|
|
919
|
+
error: AIChatToolExecutionError;
|
|
920
|
+
}
|
|
921
|
+
export interface AIChatApprovalRequiredEvent extends AIChatStreamEventBase {
|
|
922
|
+
event: 'approvalRequired';
|
|
923
|
+
run: AIChatRunState;
|
|
924
|
+
approval: AIChatApprovalRecord;
|
|
925
|
+
}
|
|
926
|
+
export interface AIChatApprovalStateChangedEvent extends AIChatStreamEventBase {
|
|
927
|
+
event: 'approvalStateChanged';
|
|
928
|
+
run: AIChatRunState;
|
|
929
|
+
approval: AIChatApprovalRecord;
|
|
930
|
+
}
|
|
931
|
+
export interface AIChatFormatterStartedEvent extends AIChatStreamEventBase {
|
|
932
|
+
event: 'formatterStarted';
|
|
933
|
+
policy?: AIHtmlLitePolicy;
|
|
934
|
+
}
|
|
935
|
+
export interface AIChatFormatterCompletedEvent extends AIChatStreamEventBase {
|
|
936
|
+
event: 'formatterCompleted';
|
|
937
|
+
formatter?: AIFormatterOutput;
|
|
938
|
+
}
|
|
939
|
+
export interface AIChatMessageEvent extends AIChatStreamEventBase {
|
|
940
|
+
event: 'message';
|
|
941
|
+
delta: string;
|
|
942
|
+
}
|
|
943
|
+
export interface AIChatCitationEvent extends AIChatStreamEventBase {
|
|
944
|
+
event: 'citation';
|
|
945
|
+
citation: AIChatCitation;
|
|
946
|
+
}
|
|
947
|
+
export interface AIChatRunCompletedEvent extends AIChatStreamEventBase {
|
|
948
|
+
event: 'runCompleted';
|
|
949
|
+
run: AIChatRunState;
|
|
950
|
+
terminalSnapshot: AIChatTerminalSnapshot;
|
|
951
|
+
}
|
|
952
|
+
export interface AIChatDoneEvent extends AIChatStreamEventBase {
|
|
953
|
+
/**
|
|
954
|
+
* @deprecated Use `runCompleted`.
|
|
955
|
+
*/
|
|
956
|
+
event: 'done';
|
|
957
|
+
run: AIChatRunState;
|
|
958
|
+
terminalSnapshot: AIChatTerminalSnapshot;
|
|
959
|
+
}
|
|
960
|
+
export interface AIChatErrorEvent extends AIChatStreamEventBase {
|
|
961
|
+
event: 'error';
|
|
962
|
+
run: AIChatRunState;
|
|
963
|
+
code: string;
|
|
964
|
+
message: string;
|
|
965
|
+
retryable: boolean;
|
|
966
|
+
}
|
|
967
|
+
export interface AIChatPingEvent extends AIChatStreamEventBase {
|
|
968
|
+
event: 'ping';
|
|
969
|
+
}
|
|
970
|
+
export type AIChatStreamEvent = AIChatRunStartedEvent | AIChatRunStatusEvent | AIChatRunPausedEvent | AIChatRunResumedEvent | AIChatRunCompletedEvent | AIChatScopeResolvedEvent | AIChatPageSnapshotBuiltEvent | AIChatToolAffordanceBuiltEvent | AIChatRoutingStartedEvent | AIChatRoutingCompletedEvent | AIChatPlanCreatedEvent | AIChatPlanUpdatedEvent | AIChatCommentaryEvent | AIChatProgressUpdateEvent | AIChatToolCallEvent | AIChatToolResultEvent | AIChatToolErrorEvent | AIChatApprovalRequiredEvent | AIChatApprovalStateChangedEvent | AIChatFormatterStartedEvent | AIChatFormatterCompletedEvent | AIChatMessageEvent | AIChatCitationEvent | AIChatDoneEvent | AIChatErrorEvent | AIChatPingEvent;
|
|
971
|
+
export {};
|
|
37
972
|
//# sourceMappingURL=index.d.ts.map
|