@aws/lsp-codewhisperer 0.0.4 → 0.0.6
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/CHANGELOG.md +11 -0
- package/out/client/sigv4/service.json +1 -1
- package/out/client/token/bearer-token-service.json +1 -1
- package/out/index.d.ts +1 -0
- package/out/index.js +1 -0
- package/out/index.js.map +1 -1
- package/out/language-server/chat/chatController.d.ts +25 -0
- package/out/language-server/chat/chatController.js +117 -0
- package/out/language-server/chat/chatController.js.map +1 -0
- package/out/language-server/chat/chatController.test.d.ts +1 -0
- package/out/language-server/chat/chatController.test.js +240 -0
- package/out/language-server/chat/chatController.test.js.map +1 -0
- package/out/language-server/chat/chatEventParser.d.ts +24 -0
- package/out/language-server/chat/chatEventParser.js +84 -0
- package/out/language-server/chat/chatEventParser.js.map +1 -0
- package/out/language-server/chat/chatEventParser.test.d.ts +1 -0
- package/out/language-server/chat/chatEventParser.test.js +189 -0
- package/out/language-server/chat/chatEventParser.test.js.map +1 -0
- package/out/language-server/chat/chatSessionManagementService.d.ts +16 -0
- package/out/language-server/chat/chatSessionManagementService.js +92 -0
- package/out/language-server/chat/chatSessionManagementService.js.map +1 -0
- package/out/language-server/chat/chatSessionManagementService.test.d.ts +1 -0
- package/out/language-server/chat/chatSessionManagementService.test.js +73 -0
- package/out/language-server/chat/chatSessionManagementService.test.js.map +1 -0
- package/out/language-server/chat/chatSessionService.d.ts +13 -0
- package/out/language-server/chat/chatSessionService.js +62 -0
- package/out/language-server/chat/chatSessionService.js.map +1 -0
- package/out/language-server/chat/chatSessionService.test.d.ts +1 -0
- package/out/language-server/chat/chatSessionService.test.js +79 -0
- package/out/language-server/chat/chatSessionService.test.js.map +1 -0
- package/out/language-server/chat/contexts/documentContext.d.ts +17 -0
- package/out/language-server/chat/contexts/documentContext.js +59 -0
- package/out/language-server/chat/contexts/documentContext.js.map +1 -0
- package/out/language-server/chat/contexts/documentContext.test.d.ts +1 -0
- package/out/language-server/chat/contexts/documentContext.test.js +147 -0
- package/out/language-server/chat/contexts/documentContext.test.js.map +1 -0
- package/out/language-server/chat/contexts/utils.d.ts +10 -0
- package/out/language-server/chat/contexts/utils.js +71 -0
- package/out/language-server/chat/contexts/utils.js.map +1 -0
- package/out/language-server/chat/contexts/utils.test.d.ts +1 -0
- package/out/language-server/chat/contexts/utils.test.js +72 -0
- package/out/language-server/chat/contexts/utils.test.js.map +1 -0
- package/out/language-server/chat/utils.d.ts +4 -0
- package/out/language-server/chat/utils.js +34 -0
- package/out/language-server/chat/utils.js.map +1 -0
- package/out/language-server/codeWhispererSecurityScanServer.d.ts +1 -1
- package/out/language-server/codeWhispererSecurityScanServer.js +41 -26
- package/out/language-server/codeWhispererSecurityScanServer.js.map +1 -1
- package/out/language-server/codeWhispererServer.d.ts +1 -1
- package/out/language-server/codeWhispererServer.js +4 -4
- package/out/language-server/codeWhispererServer.js.map +1 -1
- package/out/language-server/languageDetection.d.ts +9 -2
- package/out/language-server/languageDetection.js +84 -20
- package/out/language-server/languageDetection.js.map +1 -1
- package/out/language-server/languageDetection.test.d.ts +1 -0
- package/out/language-server/languageDetection.test.js +31 -0
- package/out/language-server/languageDetection.test.js.map +1 -0
- package/out/language-server/proxy-server.d.ts +1 -0
- package/out/language-server/proxy-server.js +35 -1
- package/out/language-server/proxy-server.js.map +1 -1
- package/out/language-server/qChatServer.d.ts +3 -0
- package/out/language-server/qChatServer.js +31 -0
- package/out/language-server/qChatServer.js.map +1 -0
- package/out/language-server/qChatServer.test.d.ts +1 -0
- package/out/language-server/qChatServer.test.js +51 -0
- package/out/language-server/qChatServer.test.js.map +1 -0
- package/out/language-server/securityScan/securityScanDiagnosticsProvider.d.ts +2 -3
- package/out/language-server/securityScan/securityScanDiagnosticsProvider.js +5 -23
- package/out/language-server/securityScan/securityScanDiagnosticsProvider.js.map +1 -1
- package/out/language-server/securityScan/types.d.ts +8 -6
- package/out/language-server/testUtils.d.ts +1 -0
- package/out/language-server/testUtils.js +17 -1
- package/out/language-server/testUtils.js.map +1 -1
- package/out/language-server/types.d.ts +13 -0
- package/out/language-server/types.js +3 -0
- package/out/language-server/types.js.map +1 -0
- package/out/language-server/utils.d.ts +3 -0
- package/out/language-server/utils.js +19 -1
- package/out/language-server/utils.js.map +1 -1
- package/out/language-server/utils.test.d.ts +1 -0
- package/out/language-server/utils.test.js +33 -0
- package/out/language-server/utils.test.js.map +1 -0
- package/package.json +13 -4
- package/src.gen/@amzn/codewhisperer-streaming/LICENSE +201 -0
- package/src.gen/@amzn/codewhisperer-streaming/README.md +464 -0
- package/src.gen/@amzn/codewhisperer-streaming/api-extractor.json +4 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-cjs/CodeWhispererStreaming.js +17 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-cjs/CodeWhispererStreamingClient.js +42 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-cjs/commands/ExportResultArchiveCommand.js +42 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-cjs/commands/GenerateAssistantResponseCommand.js +42 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-cjs/commands/GenerateTaskAssistPlanCommand.js +42 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-cjs/commands/index.js +6 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-cjs/endpoints.js +165 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-cjs/extensionConfiguration.js +2 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-cjs/index.js +10 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-cjs/models/CodeWhispererStreamingServiceException.js +12 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-cjs/models/index.js +4 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-cjs/models/models_0.js +361 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-cjs/protocols/Aws_restJson1.js +458 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-cjs/runtimeConfig.browser.js +38 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-cjs/runtimeConfig.js +46 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-cjs/runtimeConfig.native.js +15 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-cjs/runtimeConfig.shared.js +22 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-cjs/runtimeExtensions.js +22 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-es/CodeWhispererStreaming.js +13 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-es/CodeWhispererStreamingClient.js +38 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-es/commands/ExportResultArchiveCommand.js +38 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-es/commands/GenerateAssistantResponseCommand.js +38 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-es/commands/GenerateTaskAssistPlanCommand.js +38 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-es/commands/index.js +3 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-es/endpoints.js +161 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-es/extensionConfiguration.js +1 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-es/index.js +5 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-es/models/CodeWhispererStreamingServiceException.js +8 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-es/models/index.js +1 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-es/models/models_0.js +328 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-es/protocols/Aws_restJson1.js +449 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-es/runtimeConfig.browser.js +33 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-es/runtimeConfig.js +41 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-es/runtimeConfig.native.js +11 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-es/runtimeConfig.shared.js +18 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-es/runtimeExtensions.js +18 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-types/CodeWhispererStreaming.d.ts +30 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-types/CodeWhispererStreamingClient.d.ts +169 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-types/commands/ExportResultArchiveCommand.d.ts +103 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-types/commands/GenerateAssistantResponseCommand.d.ts +294 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-types/commands/GenerateTaskAssistPlanCommand.d.ts +304 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-types/commands/index.d.ts +3 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-types/endpoints.d.ts +2 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-types/extensionConfiguration.d.ts +8 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-types/index.d.ts +5 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-types/models/CodeWhispererStreamingServiceException.d.ts +13 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-types/models/index.d.ts +1 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-types/models/models_0.d.ts +1173 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-types/protocols/Aws_restJson1.d.ts +29 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-types/runtimeConfig.browser.d.ts +39 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-types/runtimeConfig.d.ts +39 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-types/runtimeConfig.native.d.ts +38 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-types/runtimeConfig.shared.d.ts +17 -0
- package/src.gen/@amzn/codewhisperer-streaming/dist-types/runtimeExtensions.d.ts +17 -0
- package/src.gen/@amzn/codewhisperer-streaming/package.json +87 -0
- package/src.gen/@amzn/codewhisperer-streaming/src/CodeWhispererStreaming.ts +84 -0
- package/src.gen/@amzn/codewhisperer-streaming/src/CodeWhispererStreamingClient.ts +304 -0
- package/src.gen/@amzn/codewhisperer-streaming/src/commands/ExportResultArchiveCommand.ts +177 -0
- package/src.gen/@amzn/codewhisperer-streaming/src/commands/GenerateAssistantResponseCommand.ts +369 -0
- package/src.gen/@amzn/codewhisperer-streaming/src/commands/GenerateTaskAssistPlanCommand.ts +379 -0
- package/src.gen/@amzn/codewhisperer-streaming/src/commands/index.ts +4 -0
- package/src.gen/@amzn/codewhisperer-streaming/src/endpoints.ts +170 -0
- package/src.gen/@amzn/codewhisperer-streaming/src/extensionConfiguration.ts +12 -0
- package/src.gen/@amzn/codewhisperer-streaming/src/index.ts +8 -0
- package/src.gen/@amzn/codewhisperer-streaming/src/models/CodeWhispererStreamingServiceException.ts +22 -0
- package/src.gen/@amzn/codewhisperer-streaming/src/models/index.ts +2 -0
- package/src.gen/@amzn/codewhisperer-streaming/src/models/models_0.ts +1518 -0
- package/src.gen/@amzn/codewhisperer-streaming/src/protocols/Aws_restJson1.ts +740 -0
- package/src.gen/@amzn/codewhisperer-streaming/src/runtimeConfig.browser.ts +42 -0
- package/src.gen/@amzn/codewhisperer-streaming/src/runtimeConfig.native.ts +17 -0
- package/src.gen/@amzn/codewhisperer-streaming/src/runtimeConfig.shared.ts +24 -0
- package/src.gen/@amzn/codewhisperer-streaming/src/runtimeConfig.ts +55 -0
- package/src.gen/@amzn/codewhisperer-streaming/src/runtimeExtensions.ts +44 -0
- package/src.gen/@amzn/codewhisperer-streaming/typedoc.json +5 -0
|
@@ -0,0 +1,1518 @@
|
|
|
1
|
+
// smithy-typescript generated code
|
|
2
|
+
import { CodeWhispererStreamingServiceException as __BaseException } from './CodeWhispererStreamingServiceException'
|
|
3
|
+
import { SENSITIVE_STRING, ExceptionOptionType as __ExceptionOptionType } from '@smithy/smithy-client'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @public
|
|
7
|
+
* @enum
|
|
8
|
+
*/
|
|
9
|
+
export const AccessDeniedExceptionReason = {
|
|
10
|
+
UNAUTHORIZED_CUSTOMIZATION_RESOURCE_ACCESS: 'UNAUTHORIZED_CUSTOMIZATION_RESOURCE_ACCESS',
|
|
11
|
+
} as const
|
|
12
|
+
/**
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
export type AccessDeniedExceptionReason = (typeof AccessDeniedExceptionReason)[keyof typeof AccessDeniedExceptionReason]
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @public
|
|
19
|
+
* This exception is thrown when the user does not have sufficient access to perform this action.
|
|
20
|
+
*/
|
|
21
|
+
export class AccessDeniedException extends __BaseException {
|
|
22
|
+
readonly name: 'AccessDeniedException' = 'AccessDeniedException'
|
|
23
|
+
readonly $fault: 'client' = 'client'
|
|
24
|
+
/**
|
|
25
|
+
* @public
|
|
26
|
+
* Reason for AccessDeniedException
|
|
27
|
+
*/
|
|
28
|
+
reason?: AccessDeniedExceptionReason | string
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
constructor(opts: __ExceptionOptionType<AccessDeniedException, __BaseException>) {
|
|
34
|
+
super({
|
|
35
|
+
name: 'AccessDeniedException',
|
|
36
|
+
$fault: 'client',
|
|
37
|
+
...opts,
|
|
38
|
+
})
|
|
39
|
+
Object.setPrototypeOf(this, AccessDeniedException.prototype)
|
|
40
|
+
this.reason = opts.reason
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @public
|
|
46
|
+
* This exception is thrown when an unexpected error occurred during the processing of a request.
|
|
47
|
+
*/
|
|
48
|
+
export class InternalServerException extends __BaseException {
|
|
49
|
+
readonly name: 'InternalServerException' = 'InternalServerException'
|
|
50
|
+
readonly $fault: 'server' = 'server'
|
|
51
|
+
$retryable = {}
|
|
52
|
+
/**
|
|
53
|
+
* @internal
|
|
54
|
+
*/
|
|
55
|
+
constructor(opts: __ExceptionOptionType<InternalServerException, __BaseException>) {
|
|
56
|
+
super({
|
|
57
|
+
name: 'InternalServerException',
|
|
58
|
+
$fault: 'server',
|
|
59
|
+
...opts,
|
|
60
|
+
})
|
|
61
|
+
Object.setPrototypeOf(this, InternalServerException.prototype)
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* @public
|
|
67
|
+
* This exception is thrown when describing a resource that does not exist.
|
|
68
|
+
*/
|
|
69
|
+
export class ResourceNotFoundException extends __BaseException {
|
|
70
|
+
readonly name: 'ResourceNotFoundException' = 'ResourceNotFoundException'
|
|
71
|
+
readonly $fault: 'client' = 'client'
|
|
72
|
+
/**
|
|
73
|
+
* @internal
|
|
74
|
+
*/
|
|
75
|
+
constructor(opts: __ExceptionOptionType<ResourceNotFoundException, __BaseException>) {
|
|
76
|
+
super({
|
|
77
|
+
name: 'ResourceNotFoundException',
|
|
78
|
+
$fault: 'client',
|
|
79
|
+
...opts,
|
|
80
|
+
})
|
|
81
|
+
Object.setPrototypeOf(this, ResourceNotFoundException.prototype)
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* @public
|
|
87
|
+
* This exception is thrown when request was denied due to request throttling.
|
|
88
|
+
*/
|
|
89
|
+
export class ThrottlingException extends __BaseException {
|
|
90
|
+
readonly name: 'ThrottlingException' = 'ThrottlingException'
|
|
91
|
+
readonly $fault: 'client' = 'client'
|
|
92
|
+
$retryable = {
|
|
93
|
+
throttling: true,
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* @internal
|
|
97
|
+
*/
|
|
98
|
+
constructor(opts: __ExceptionOptionType<ThrottlingException, __BaseException>) {
|
|
99
|
+
super({
|
|
100
|
+
name: 'ThrottlingException',
|
|
101
|
+
$fault: 'client',
|
|
102
|
+
...opts,
|
|
103
|
+
})
|
|
104
|
+
Object.setPrototypeOf(this, ThrottlingException.prototype)
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* @public
|
|
110
|
+
* @enum
|
|
111
|
+
*/
|
|
112
|
+
export const ValidationExceptionReason = {
|
|
113
|
+
INVALID_CONVERSATION_ID: 'INVALID_CONVERSATION_ID',
|
|
114
|
+
} as const
|
|
115
|
+
/**
|
|
116
|
+
* @public
|
|
117
|
+
*/
|
|
118
|
+
export type ValidationExceptionReason = (typeof ValidationExceptionReason)[keyof typeof ValidationExceptionReason]
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* @public
|
|
122
|
+
* This exception is thrown when the input fails to satisfy the constraints specified by the service.
|
|
123
|
+
*/
|
|
124
|
+
export class ValidationException extends __BaseException {
|
|
125
|
+
readonly name: 'ValidationException' = 'ValidationException'
|
|
126
|
+
readonly $fault: 'client' = 'client'
|
|
127
|
+
/**
|
|
128
|
+
* @public
|
|
129
|
+
* Reason for ValidationException
|
|
130
|
+
*/
|
|
131
|
+
reason?: ValidationExceptionReason | string
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* @internal
|
|
135
|
+
*/
|
|
136
|
+
constructor(opts: __ExceptionOptionType<ValidationException, __BaseException>) {
|
|
137
|
+
super({
|
|
138
|
+
name: 'ValidationException',
|
|
139
|
+
$fault: 'client',
|
|
140
|
+
...opts,
|
|
141
|
+
})
|
|
142
|
+
Object.setPrototypeOf(this, ValidationException.prototype)
|
|
143
|
+
this.reason = opts.reason
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* @public
|
|
149
|
+
* Streaming Response Event for Assistant Markdown text message.
|
|
150
|
+
*/
|
|
151
|
+
export interface AssistantResponseEvent {
|
|
152
|
+
/**
|
|
153
|
+
* @public
|
|
154
|
+
* The content of the text message in markdown format.
|
|
155
|
+
*/
|
|
156
|
+
content: string | undefined
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* @internal
|
|
161
|
+
*/
|
|
162
|
+
export const AssistantResponseEventFilterSensitiveLog = (obj: AssistantResponseEvent): any => ({
|
|
163
|
+
...obj,
|
|
164
|
+
...(obj.content && { content: SENSITIVE_STRING }),
|
|
165
|
+
})
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* @public
|
|
169
|
+
* @enum
|
|
170
|
+
*/
|
|
171
|
+
export const UserIntent = {
|
|
172
|
+
/**
|
|
173
|
+
* Apply Common Best Practices
|
|
174
|
+
*/
|
|
175
|
+
APPLY_COMMON_BEST_PRACTICES: 'APPLY_COMMON_BEST_PRACTICES',
|
|
176
|
+
/**
|
|
177
|
+
* Cite Sources
|
|
178
|
+
*/
|
|
179
|
+
CITE_SOURCES: 'CITE_SOURCES',
|
|
180
|
+
/**
|
|
181
|
+
* Explain Code Selection
|
|
182
|
+
*/
|
|
183
|
+
EXPLAIN_CODE_SELECTION: 'EXPLAIN_CODE_SELECTION',
|
|
184
|
+
/**
|
|
185
|
+
* Explain Code Line By Line
|
|
186
|
+
*/
|
|
187
|
+
EXPLAIN_LINE_BY_LINE: 'EXPLAIN_LINE_BY_LINE',
|
|
188
|
+
/**
|
|
189
|
+
* Improve Code
|
|
190
|
+
*/
|
|
191
|
+
IMPROVE_CODE: 'IMPROVE_CODE',
|
|
192
|
+
/**
|
|
193
|
+
* Show More Examples
|
|
194
|
+
*/
|
|
195
|
+
SHOW_EXAMPLES: 'SHOW_EXAMPLES',
|
|
196
|
+
/**
|
|
197
|
+
* Suggest Alternative Implementation
|
|
198
|
+
*/
|
|
199
|
+
SUGGEST_ALTERNATE_IMPLEMENTATION: 'SUGGEST_ALTERNATE_IMPLEMENTATION',
|
|
200
|
+
} as const
|
|
201
|
+
/**
|
|
202
|
+
* @public
|
|
203
|
+
*/
|
|
204
|
+
export type UserIntent = (typeof UserIntent)[keyof typeof UserIntent]
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* @public
|
|
208
|
+
* Followup Prompt for the Assistant Response
|
|
209
|
+
*/
|
|
210
|
+
export interface FollowupPrompt {
|
|
211
|
+
/**
|
|
212
|
+
* @public
|
|
213
|
+
* The content of the text message in markdown format.
|
|
214
|
+
*/
|
|
215
|
+
content: string | undefined
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* @public
|
|
219
|
+
* User Intent
|
|
220
|
+
*/
|
|
221
|
+
userIntent?: UserIntent | string
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* @internal
|
|
226
|
+
*/
|
|
227
|
+
export const FollowupPromptFilterSensitiveLog = (obj: FollowupPrompt): any => ({
|
|
228
|
+
...obj,
|
|
229
|
+
...(obj.content && { content: SENSITIVE_STRING }),
|
|
230
|
+
})
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* @public
|
|
234
|
+
* Represents span in a text
|
|
235
|
+
*/
|
|
236
|
+
export interface Span {
|
|
237
|
+
start?: number
|
|
238
|
+
end?: number
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* @public
|
|
243
|
+
* Code Reference / Repository details
|
|
244
|
+
*/
|
|
245
|
+
export interface Reference {
|
|
246
|
+
/**
|
|
247
|
+
* @public
|
|
248
|
+
* License name
|
|
249
|
+
*/
|
|
250
|
+
licenseName?: string
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* @public
|
|
254
|
+
* Code Repsitory for the associated reference
|
|
255
|
+
*/
|
|
256
|
+
repository?: string
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* @public
|
|
260
|
+
* Respository URL
|
|
261
|
+
*/
|
|
262
|
+
url?: string
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* @public
|
|
266
|
+
* Span / Range for the Reference
|
|
267
|
+
*/
|
|
268
|
+
recommendationContentSpan?: Span
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* @public
|
|
273
|
+
* Represents an additional reference link retured with the Chat message
|
|
274
|
+
*/
|
|
275
|
+
export interface SupplementaryWebLink {
|
|
276
|
+
/**
|
|
277
|
+
* @public
|
|
278
|
+
* URL of the web reference link
|
|
279
|
+
*/
|
|
280
|
+
url: string | undefined
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* @public
|
|
284
|
+
* Title of the web reference link
|
|
285
|
+
*/
|
|
286
|
+
title: string | undefined
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* @public
|
|
290
|
+
* Relevant text snippet from the link
|
|
291
|
+
*/
|
|
292
|
+
snippet?: string
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* @internal
|
|
297
|
+
*/
|
|
298
|
+
export const SupplementaryWebLinkFilterSensitiveLog = (obj: SupplementaryWebLink): any => ({
|
|
299
|
+
...obj,
|
|
300
|
+
...(obj.url && { url: SENSITIVE_STRING }),
|
|
301
|
+
...(obj.title && { title: SENSITIVE_STRING }),
|
|
302
|
+
...(obj.snippet && { snippet: SENSITIVE_STRING }),
|
|
303
|
+
})
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* @public
|
|
307
|
+
* Markdown text message.
|
|
308
|
+
*/
|
|
309
|
+
export interface AssistantResponseMessage {
|
|
310
|
+
/**
|
|
311
|
+
* @public
|
|
312
|
+
* Unique identifier for the chat message
|
|
313
|
+
*/
|
|
314
|
+
messageId?: string
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* @public
|
|
318
|
+
* The content of the text message in markdown format.
|
|
319
|
+
*/
|
|
320
|
+
content: string | undefined
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* @public
|
|
324
|
+
* Web References
|
|
325
|
+
*/
|
|
326
|
+
supplementaryWebLinks?: SupplementaryWebLink[]
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* @public
|
|
330
|
+
* Code References
|
|
331
|
+
*/
|
|
332
|
+
references?: Reference[]
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* @public
|
|
336
|
+
* Followup Prompt
|
|
337
|
+
*/
|
|
338
|
+
followupPrompt?: FollowupPrompt
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* @internal
|
|
343
|
+
*/
|
|
344
|
+
export const AssistantResponseMessageFilterSensitiveLog = (obj: AssistantResponseMessage): any => ({
|
|
345
|
+
...obj,
|
|
346
|
+
...(obj.content && { content: SENSITIVE_STRING }),
|
|
347
|
+
...(obj.supplementaryWebLinks && {
|
|
348
|
+
supplementaryWebLinks: obj.supplementaryWebLinks.map(item => SupplementaryWebLinkFilterSensitiveLog(item)),
|
|
349
|
+
}),
|
|
350
|
+
...(obj.followupPrompt && { followupPrompt: FollowupPromptFilterSensitiveLog(obj.followupPrompt) }),
|
|
351
|
+
})
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* @public
|
|
355
|
+
* This exception is thrown when the action to perform could not be completed because the resource is in a conflicting state.
|
|
356
|
+
*/
|
|
357
|
+
export class ConflictException extends __BaseException {
|
|
358
|
+
readonly name: 'ConflictException' = 'ConflictException'
|
|
359
|
+
readonly $fault: 'client' = 'client'
|
|
360
|
+
/**
|
|
361
|
+
* @internal
|
|
362
|
+
*/
|
|
363
|
+
constructor(opts: __ExceptionOptionType<ConflictException, __BaseException>) {
|
|
364
|
+
super({
|
|
365
|
+
name: 'ConflictException',
|
|
366
|
+
$fault: 'client',
|
|
367
|
+
...opts,
|
|
368
|
+
})
|
|
369
|
+
Object.setPrototypeOf(this, ConflictException.prototype)
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* @public
|
|
375
|
+
* Programming Languages supported by CodeWhisperer
|
|
376
|
+
*/
|
|
377
|
+
export interface ProgrammingLanguage {
|
|
378
|
+
languageName: string | undefined
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* @public
|
|
383
|
+
* @enum
|
|
384
|
+
*/
|
|
385
|
+
export const ContentChecksumType = {
|
|
386
|
+
SHA_256: 'SHA_256',
|
|
387
|
+
} as const
|
|
388
|
+
/**
|
|
389
|
+
* @public
|
|
390
|
+
*/
|
|
391
|
+
export type ContentChecksumType = (typeof ContentChecksumType)[keyof typeof ContentChecksumType]
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* @public
|
|
395
|
+
* Payload Part
|
|
396
|
+
*/
|
|
397
|
+
export interface BinaryMetadataEvent {
|
|
398
|
+
/**
|
|
399
|
+
* @public
|
|
400
|
+
* Content length of the binary payload
|
|
401
|
+
*/
|
|
402
|
+
size?: number
|
|
403
|
+
|
|
404
|
+
/**
|
|
405
|
+
* @public
|
|
406
|
+
* Content type of the response
|
|
407
|
+
*/
|
|
408
|
+
mimeType?: string
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* @public
|
|
412
|
+
* Content checksum of the binary payload
|
|
413
|
+
*/
|
|
414
|
+
contentChecksum?: string
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* @public
|
|
418
|
+
* Content checksum type of the binary payload
|
|
419
|
+
*/
|
|
420
|
+
contentChecksumType?: ContentChecksumType | string
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* @internal
|
|
425
|
+
*/
|
|
426
|
+
export const BinaryMetadataEventFilterSensitiveLog = (obj: BinaryMetadataEvent): any => ({
|
|
427
|
+
...obj,
|
|
428
|
+
})
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* @public
|
|
432
|
+
* Payload Part
|
|
433
|
+
*/
|
|
434
|
+
export interface BinaryPayloadEvent {
|
|
435
|
+
/**
|
|
436
|
+
* @public
|
|
437
|
+
* Payload Part's body
|
|
438
|
+
*/
|
|
439
|
+
bytes?: Uint8Array
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* @internal
|
|
444
|
+
*/
|
|
445
|
+
export const BinaryPayloadEventFilterSensitiveLog = (obj: BinaryPayloadEvent): any => ({
|
|
446
|
+
...obj,
|
|
447
|
+
...(obj.bytes && { bytes: SENSITIVE_STRING }),
|
|
448
|
+
})
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* @public
|
|
452
|
+
* @enum
|
|
453
|
+
*/
|
|
454
|
+
export const DiagnosticSeverity = {
|
|
455
|
+
ERROR: 'ERROR',
|
|
456
|
+
HINT: 'HINT',
|
|
457
|
+
INFORMATION: 'INFORMATION',
|
|
458
|
+
WARNING: 'WARNING',
|
|
459
|
+
} as const
|
|
460
|
+
/**
|
|
461
|
+
* @public
|
|
462
|
+
*/
|
|
463
|
+
export type DiagnosticSeverity = (typeof DiagnosticSeverity)[keyof typeof DiagnosticSeverity]
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* @public
|
|
467
|
+
* Structure to represent metadata about a Runtime Diagnostics
|
|
468
|
+
*/
|
|
469
|
+
export interface RuntimeDiagnostic {
|
|
470
|
+
/**
|
|
471
|
+
* @public
|
|
472
|
+
* A human-readable string describing the source of the diagnostic
|
|
473
|
+
*/
|
|
474
|
+
source: string | undefined
|
|
475
|
+
|
|
476
|
+
/**
|
|
477
|
+
* @public
|
|
478
|
+
* Diagnostic Error type
|
|
479
|
+
*/
|
|
480
|
+
severity: DiagnosticSeverity | string | undefined
|
|
481
|
+
|
|
482
|
+
/**
|
|
483
|
+
* @public
|
|
484
|
+
* The diagnostic's message.
|
|
485
|
+
*/
|
|
486
|
+
message: string | undefined
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
/**
|
|
490
|
+
* @internal
|
|
491
|
+
*/
|
|
492
|
+
export const RuntimeDiagnosticFilterSensitiveLog = (obj: RuntimeDiagnostic): any => ({
|
|
493
|
+
...obj,
|
|
494
|
+
...(obj.source && { source: SENSITIVE_STRING }),
|
|
495
|
+
...(obj.message && { message: SENSITIVE_STRING }),
|
|
496
|
+
})
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* @public
|
|
500
|
+
* @enum
|
|
501
|
+
*/
|
|
502
|
+
export const SymbolType = {
|
|
503
|
+
DECLARATION: 'DECLARATION',
|
|
504
|
+
USAGE: 'USAGE',
|
|
505
|
+
} as const
|
|
506
|
+
/**
|
|
507
|
+
* @public
|
|
508
|
+
*/
|
|
509
|
+
export type SymbolType = (typeof SymbolType)[keyof typeof SymbolType]
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* @public
|
|
513
|
+
*/
|
|
514
|
+
export interface DocumentSymbol {
|
|
515
|
+
/**
|
|
516
|
+
* @public
|
|
517
|
+
* Name of the Document Symbol
|
|
518
|
+
*/
|
|
519
|
+
name: string | undefined
|
|
520
|
+
|
|
521
|
+
/**
|
|
522
|
+
* @public
|
|
523
|
+
* Symbol type - DECLARATION / USAGE
|
|
524
|
+
*/
|
|
525
|
+
type: SymbolType | string | undefined
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* @public
|
|
529
|
+
* Symbol package / source for FullyQualified names
|
|
530
|
+
*/
|
|
531
|
+
source?: string
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* @public
|
|
536
|
+
* Represents a Text Document / File
|
|
537
|
+
*/
|
|
538
|
+
export interface TextDocument {
|
|
539
|
+
/**
|
|
540
|
+
* @public
|
|
541
|
+
* Filepath relative to the root of the workspace
|
|
542
|
+
*/
|
|
543
|
+
relativeFilePath: string | undefined
|
|
544
|
+
|
|
545
|
+
/**
|
|
546
|
+
* @public
|
|
547
|
+
* The text document's language identifier.
|
|
548
|
+
*/
|
|
549
|
+
programmingLanguage?: ProgrammingLanguage
|
|
550
|
+
|
|
551
|
+
/**
|
|
552
|
+
* @public
|
|
553
|
+
* Content of the text document
|
|
554
|
+
*/
|
|
555
|
+
text?: string
|
|
556
|
+
|
|
557
|
+
/**
|
|
558
|
+
* @public
|
|
559
|
+
* DocumentSymbols parsed from a text document
|
|
560
|
+
*/
|
|
561
|
+
documentSymbols?: DocumentSymbol[]
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
/**
|
|
565
|
+
* @internal
|
|
566
|
+
*/
|
|
567
|
+
export const TextDocumentFilterSensitiveLog = (obj: TextDocument): any => ({
|
|
568
|
+
...obj,
|
|
569
|
+
...(obj.relativeFilePath && { relativeFilePath: SENSITIVE_STRING }),
|
|
570
|
+
...(obj.text && { text: SENSITIVE_STRING }),
|
|
571
|
+
})
|
|
572
|
+
|
|
573
|
+
/**
|
|
574
|
+
* @public
|
|
575
|
+
* Indicates Cursor postion in a Text Document
|
|
576
|
+
*/
|
|
577
|
+
export interface Position {
|
|
578
|
+
/**
|
|
579
|
+
* @public
|
|
580
|
+
* Line position in a document.
|
|
581
|
+
*/
|
|
582
|
+
line: number | undefined
|
|
583
|
+
|
|
584
|
+
/**
|
|
585
|
+
* @public
|
|
586
|
+
* Character offset on a line in a document (zero-based)
|
|
587
|
+
*/
|
|
588
|
+
character: number | undefined
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
/**
|
|
592
|
+
* @public
|
|
593
|
+
* Indicates Range / Span in a Text Document
|
|
594
|
+
*/
|
|
595
|
+
export interface Range {
|
|
596
|
+
/**
|
|
597
|
+
* @public
|
|
598
|
+
* The range's start position.
|
|
599
|
+
*/
|
|
600
|
+
start: Position | undefined
|
|
601
|
+
|
|
602
|
+
/**
|
|
603
|
+
* @public
|
|
604
|
+
* The range's end position.
|
|
605
|
+
*/
|
|
606
|
+
end: Position | undefined
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
/**
|
|
610
|
+
* @public
|
|
611
|
+
* Structure to represent metadata about a TextDocument Diagnostic
|
|
612
|
+
*/
|
|
613
|
+
export interface TextDocumentDiagnostic {
|
|
614
|
+
/**
|
|
615
|
+
* @public
|
|
616
|
+
* Represents a Text Document associated with Diagnostic
|
|
617
|
+
*/
|
|
618
|
+
document: TextDocument | undefined
|
|
619
|
+
|
|
620
|
+
/**
|
|
621
|
+
* @public
|
|
622
|
+
* The range at which the message applies.
|
|
623
|
+
*/
|
|
624
|
+
range: Range | undefined
|
|
625
|
+
|
|
626
|
+
/**
|
|
627
|
+
* @public
|
|
628
|
+
* A human-readable string describing the source of the diagnostic
|
|
629
|
+
*/
|
|
630
|
+
source: string | undefined
|
|
631
|
+
|
|
632
|
+
/**
|
|
633
|
+
* @public
|
|
634
|
+
* Diagnostic Error type
|
|
635
|
+
*/
|
|
636
|
+
severity: DiagnosticSeverity | string | undefined
|
|
637
|
+
|
|
638
|
+
/**
|
|
639
|
+
* @public
|
|
640
|
+
* The diagnostic's message.
|
|
641
|
+
*/
|
|
642
|
+
message: string | undefined
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
/**
|
|
646
|
+
* @internal
|
|
647
|
+
*/
|
|
648
|
+
export const TextDocumentDiagnosticFilterSensitiveLog = (obj: TextDocumentDiagnostic): any => ({
|
|
649
|
+
...obj,
|
|
650
|
+
...(obj.document && { document: TextDocumentFilterSensitiveLog(obj.document) }),
|
|
651
|
+
...(obj.source && { source: SENSITIVE_STRING }),
|
|
652
|
+
...(obj.message && { message: SENSITIVE_STRING }),
|
|
653
|
+
})
|
|
654
|
+
|
|
655
|
+
/**
|
|
656
|
+
* @public
|
|
657
|
+
* Represents a Diagnostic message
|
|
658
|
+
*/
|
|
659
|
+
export type Diagnostic =
|
|
660
|
+
| Diagnostic.RuntimeDiagnosticMember
|
|
661
|
+
| Diagnostic.TextDocumentDiagnosticMember
|
|
662
|
+
| Diagnostic.$UnknownMember
|
|
663
|
+
|
|
664
|
+
/**
|
|
665
|
+
* @public
|
|
666
|
+
*/
|
|
667
|
+
export namespace Diagnostic {
|
|
668
|
+
/**
|
|
669
|
+
* @public
|
|
670
|
+
* Diagnostics originating from a TextDocument
|
|
671
|
+
*/
|
|
672
|
+
export interface TextDocumentDiagnosticMember {
|
|
673
|
+
textDocumentDiagnostic: TextDocumentDiagnostic
|
|
674
|
+
runtimeDiagnostic?: never
|
|
675
|
+
$unknown?: never
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
/**
|
|
679
|
+
* @public
|
|
680
|
+
* Diagnostics originating from a Runtime
|
|
681
|
+
*/
|
|
682
|
+
export interface RuntimeDiagnosticMember {
|
|
683
|
+
textDocumentDiagnostic?: never
|
|
684
|
+
runtimeDiagnostic: RuntimeDiagnostic
|
|
685
|
+
$unknown?: never
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
/**
|
|
689
|
+
* @public
|
|
690
|
+
*/
|
|
691
|
+
export interface $UnknownMember {
|
|
692
|
+
textDocumentDiagnostic?: never
|
|
693
|
+
runtimeDiagnostic?: never
|
|
694
|
+
$unknown: [string, any]
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
export interface Visitor<T> {
|
|
698
|
+
textDocumentDiagnostic: (value: TextDocumentDiagnostic) => T
|
|
699
|
+
runtimeDiagnostic: (value: RuntimeDiagnostic) => T
|
|
700
|
+
_: (name: string, value: any) => T
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
export const visit = <T>(value: Diagnostic, visitor: Visitor<T>): T => {
|
|
704
|
+
if (value.textDocumentDiagnostic !== undefined)
|
|
705
|
+
return visitor.textDocumentDiagnostic(value.textDocumentDiagnostic)
|
|
706
|
+
if (value.runtimeDiagnostic !== undefined) return visitor.runtimeDiagnostic(value.runtimeDiagnostic)
|
|
707
|
+
return visitor._(value.$unknown[0], value.$unknown[1])
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
/**
|
|
711
|
+
* @internal
|
|
712
|
+
*/
|
|
713
|
+
export const DiagnosticFilterSensitiveLog = (obj: Diagnostic): any => {
|
|
714
|
+
if (obj.textDocumentDiagnostic !== undefined)
|
|
715
|
+
return { textDocumentDiagnostic: TextDocumentDiagnosticFilterSensitiveLog(obj.textDocumentDiagnostic) }
|
|
716
|
+
if (obj.runtimeDiagnostic !== undefined)
|
|
717
|
+
return { runtimeDiagnostic: RuntimeDiagnosticFilterSensitiveLog(obj.runtimeDiagnostic) }
|
|
718
|
+
if (obj.$unknown !== undefined) return { [obj.$unknown[0]]: 'UNKNOWN' }
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
/**
|
|
722
|
+
* @public
|
|
723
|
+
* Represents the state of the Cursor in an Editor
|
|
724
|
+
*/
|
|
725
|
+
export type CursorState = CursorState.PositionMember | CursorState.RangeMember | CursorState.$UnknownMember
|
|
726
|
+
|
|
727
|
+
/**
|
|
728
|
+
* @public
|
|
729
|
+
*/
|
|
730
|
+
export namespace CursorState {
|
|
731
|
+
/**
|
|
732
|
+
* @public
|
|
733
|
+
* Represents a cursor position in a Text Document
|
|
734
|
+
*/
|
|
735
|
+
export interface PositionMember {
|
|
736
|
+
position: Position
|
|
737
|
+
range?: never
|
|
738
|
+
$unknown?: never
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
/**
|
|
742
|
+
* @public
|
|
743
|
+
* Represents a text selection in a Text Document
|
|
744
|
+
*/
|
|
745
|
+
export interface RangeMember {
|
|
746
|
+
position?: never
|
|
747
|
+
range: Range
|
|
748
|
+
$unknown?: never
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
/**
|
|
752
|
+
* @public
|
|
753
|
+
*/
|
|
754
|
+
export interface $UnknownMember {
|
|
755
|
+
position?: never
|
|
756
|
+
range?: never
|
|
757
|
+
$unknown: [string, any]
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
export interface Visitor<T> {
|
|
761
|
+
position: (value: Position) => T
|
|
762
|
+
range: (value: Range) => T
|
|
763
|
+
_: (name: string, value: any) => T
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
export const visit = <T>(value: CursorState, visitor: Visitor<T>): T => {
|
|
767
|
+
if (value.position !== undefined) return visitor.position(value.position)
|
|
768
|
+
if (value.range !== undefined) return visitor.range(value.range)
|
|
769
|
+
return visitor._(value.$unknown[0], value.$unknown[1])
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
/**
|
|
774
|
+
* @public
|
|
775
|
+
* Represents the state of an Editor
|
|
776
|
+
*/
|
|
777
|
+
export interface EditorState {
|
|
778
|
+
/**
|
|
779
|
+
* @public
|
|
780
|
+
* Represents currently edited file
|
|
781
|
+
*/
|
|
782
|
+
document?: TextDocument
|
|
783
|
+
|
|
784
|
+
/**
|
|
785
|
+
* @public
|
|
786
|
+
* Position of the cursor
|
|
787
|
+
*/
|
|
788
|
+
cursorState?: CursorState
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
/**
|
|
792
|
+
* @internal
|
|
793
|
+
*/
|
|
794
|
+
export const EditorStateFilterSensitiveLog = (obj: EditorState): any => ({
|
|
795
|
+
...obj,
|
|
796
|
+
...(obj.document && { document: TextDocumentFilterSensitiveLog(obj.document) }),
|
|
797
|
+
...(obj.cursorState && { cursorState: obj.cursorState }),
|
|
798
|
+
})
|
|
799
|
+
|
|
800
|
+
/**
|
|
801
|
+
* @public
|
|
802
|
+
* Additional Chat message context associated with the Chat Message
|
|
803
|
+
*/
|
|
804
|
+
export interface UserInputMessageContext {
|
|
805
|
+
/**
|
|
806
|
+
* @public
|
|
807
|
+
* Editor state chat message context.
|
|
808
|
+
*/
|
|
809
|
+
editorState?: EditorState
|
|
810
|
+
|
|
811
|
+
/**
|
|
812
|
+
* @public
|
|
813
|
+
* Diagnostic chat message context.
|
|
814
|
+
*/
|
|
815
|
+
diagnostic?: Diagnostic
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
/**
|
|
819
|
+
* @internal
|
|
820
|
+
*/
|
|
821
|
+
export const UserInputMessageContextFilterSensitiveLog = (obj: UserInputMessageContext): any => ({
|
|
822
|
+
...obj,
|
|
823
|
+
...(obj.editorState && { editorState: EditorStateFilterSensitiveLog(obj.editorState) }),
|
|
824
|
+
...(obj.diagnostic && { diagnostic: DiagnosticFilterSensitiveLog(obj.diagnostic) }),
|
|
825
|
+
})
|
|
826
|
+
|
|
827
|
+
/**
|
|
828
|
+
* @public
|
|
829
|
+
* Structure to represent a chat input message from User
|
|
830
|
+
*/
|
|
831
|
+
export interface UserInputMessage {
|
|
832
|
+
/**
|
|
833
|
+
* @public
|
|
834
|
+
* The content of the chat message.
|
|
835
|
+
*/
|
|
836
|
+
content: string | undefined
|
|
837
|
+
|
|
838
|
+
/**
|
|
839
|
+
* @public
|
|
840
|
+
* Chat message context associated with the Chat Message
|
|
841
|
+
*/
|
|
842
|
+
userInputMessageContext?: UserInputMessageContext
|
|
843
|
+
|
|
844
|
+
/**
|
|
845
|
+
* @public
|
|
846
|
+
* User Intent
|
|
847
|
+
*/
|
|
848
|
+
userIntent?: UserIntent | string
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
/**
|
|
852
|
+
* @internal
|
|
853
|
+
*/
|
|
854
|
+
export const UserInputMessageFilterSensitiveLog = (obj: UserInputMessage): any => ({
|
|
855
|
+
...obj,
|
|
856
|
+
...(obj.content && { content: SENSITIVE_STRING }),
|
|
857
|
+
...(obj.userInputMessageContext && {
|
|
858
|
+
userInputMessageContext: UserInputMessageContextFilterSensitiveLog(obj.userInputMessageContext),
|
|
859
|
+
}),
|
|
860
|
+
})
|
|
861
|
+
|
|
862
|
+
/**
|
|
863
|
+
* @public
|
|
864
|
+
*/
|
|
865
|
+
export type ChatMessage =
|
|
866
|
+
| ChatMessage.AssistantResponseMessageMember
|
|
867
|
+
| ChatMessage.UserInputMessageMember
|
|
868
|
+
| ChatMessage.$UnknownMember
|
|
869
|
+
|
|
870
|
+
/**
|
|
871
|
+
* @public
|
|
872
|
+
*/
|
|
873
|
+
export namespace ChatMessage {
|
|
874
|
+
/**
|
|
875
|
+
* @public
|
|
876
|
+
* Structure to represent a chat input message from User
|
|
877
|
+
*/
|
|
878
|
+
export interface UserInputMessageMember {
|
|
879
|
+
userInputMessage: UserInputMessage
|
|
880
|
+
assistantResponseMessage?: never
|
|
881
|
+
$unknown?: never
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
/**
|
|
885
|
+
* @public
|
|
886
|
+
* Markdown text message.
|
|
887
|
+
*/
|
|
888
|
+
export interface AssistantResponseMessageMember {
|
|
889
|
+
userInputMessage?: never
|
|
890
|
+
assistantResponseMessage: AssistantResponseMessage
|
|
891
|
+
$unknown?: never
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
/**
|
|
895
|
+
* @public
|
|
896
|
+
*/
|
|
897
|
+
export interface $UnknownMember {
|
|
898
|
+
userInputMessage?: never
|
|
899
|
+
assistantResponseMessage?: never
|
|
900
|
+
$unknown: [string, any]
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
export interface Visitor<T> {
|
|
904
|
+
userInputMessage: (value: UserInputMessage) => T
|
|
905
|
+
assistantResponseMessage: (value: AssistantResponseMessage) => T
|
|
906
|
+
_: (name: string, value: any) => T
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
export const visit = <T>(value: ChatMessage, visitor: Visitor<T>): T => {
|
|
910
|
+
if (value.userInputMessage !== undefined) return visitor.userInputMessage(value.userInputMessage)
|
|
911
|
+
if (value.assistantResponseMessage !== undefined)
|
|
912
|
+
return visitor.assistantResponseMessage(value.assistantResponseMessage)
|
|
913
|
+
return visitor._(value.$unknown[0], value.$unknown[1])
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
/**
|
|
917
|
+
* @internal
|
|
918
|
+
*/
|
|
919
|
+
export const ChatMessageFilterSensitiveLog = (obj: ChatMessage): any => {
|
|
920
|
+
if (obj.userInputMessage !== undefined)
|
|
921
|
+
return { userInputMessage: UserInputMessageFilterSensitiveLog(obj.userInputMessage) }
|
|
922
|
+
if (obj.assistantResponseMessage !== undefined)
|
|
923
|
+
return { assistantResponseMessage: AssistantResponseMessageFilterSensitiveLog(obj.assistantResponseMessage) }
|
|
924
|
+
if (obj.$unknown !== undefined) return { [obj.$unknown[0]]: 'UNKNOWN' }
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
/**
|
|
928
|
+
* @public
|
|
929
|
+
* Streaming Response Event for CodeReferences
|
|
930
|
+
*/
|
|
931
|
+
export interface CodeReferenceEvent {
|
|
932
|
+
/**
|
|
933
|
+
* @public
|
|
934
|
+
* Code References for Assistant Response Message
|
|
935
|
+
*/
|
|
936
|
+
references?: Reference[]
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
/**
|
|
940
|
+
* @public
|
|
941
|
+
* Streaming Response Event for Followup Prompt.
|
|
942
|
+
*/
|
|
943
|
+
export interface FollowupPromptEvent {
|
|
944
|
+
/**
|
|
945
|
+
* @public
|
|
946
|
+
* Followup Prompt for the Assistant Response
|
|
947
|
+
*/
|
|
948
|
+
followupPrompt?: FollowupPrompt
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
/**
|
|
952
|
+
* @internal
|
|
953
|
+
*/
|
|
954
|
+
export const FollowupPromptEventFilterSensitiveLog = (obj: FollowupPromptEvent): any => ({
|
|
955
|
+
...obj,
|
|
956
|
+
...(obj.followupPrompt && { followupPrompt: FollowupPromptFilterSensitiveLog(obj.followupPrompt) }),
|
|
957
|
+
})
|
|
958
|
+
|
|
959
|
+
/**
|
|
960
|
+
* @public
|
|
961
|
+
* @enum
|
|
962
|
+
*/
|
|
963
|
+
export const InvalidStateReason = {
|
|
964
|
+
INVALID_TASK_ASSIST_PLAN: 'INVALID_TASK_ASSIST_PLAN',
|
|
965
|
+
} as const
|
|
966
|
+
/**
|
|
967
|
+
* @public
|
|
968
|
+
*/
|
|
969
|
+
export type InvalidStateReason = (typeof InvalidStateReason)[keyof typeof InvalidStateReason]
|
|
970
|
+
|
|
971
|
+
/**
|
|
972
|
+
* @public
|
|
973
|
+
* Streaming Response Event when an Invalid State is reached
|
|
974
|
+
*/
|
|
975
|
+
export interface InvalidStateEvent {
|
|
976
|
+
/**
|
|
977
|
+
* @public
|
|
978
|
+
* Reasons for Invalid State Event
|
|
979
|
+
*/
|
|
980
|
+
reason: InvalidStateReason | string | undefined
|
|
981
|
+
|
|
982
|
+
message: string | undefined
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
/**
|
|
986
|
+
* @public
|
|
987
|
+
* Streaming Response Event for AssistantResponse Metadata
|
|
988
|
+
*/
|
|
989
|
+
export interface MessageMetadataEvent {
|
|
990
|
+
/**
|
|
991
|
+
* @public
|
|
992
|
+
* Unique identifier for the conversation
|
|
993
|
+
*/
|
|
994
|
+
conversationId?: string
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
/**
|
|
998
|
+
* @public
|
|
999
|
+
* Streaming Response Event for SupplementaryWebLinks
|
|
1000
|
+
*/
|
|
1001
|
+
export interface SupplementaryWebLinksEvent {
|
|
1002
|
+
/**
|
|
1003
|
+
* @public
|
|
1004
|
+
* Web References for Assistant Response Message
|
|
1005
|
+
*/
|
|
1006
|
+
supplementaryWebLinks?: SupplementaryWebLink[]
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
/**
|
|
1010
|
+
* @internal
|
|
1011
|
+
*/
|
|
1012
|
+
export const SupplementaryWebLinksEventFilterSensitiveLog = (obj: SupplementaryWebLinksEvent): any => ({
|
|
1013
|
+
...obj,
|
|
1014
|
+
...(obj.supplementaryWebLinks && {
|
|
1015
|
+
supplementaryWebLinks: obj.supplementaryWebLinks.map(item => SupplementaryWebLinkFilterSensitiveLog(item)),
|
|
1016
|
+
}),
|
|
1017
|
+
})
|
|
1018
|
+
|
|
1019
|
+
/**
|
|
1020
|
+
* @public
|
|
1021
|
+
* Streaming events from UniDirectional Streaming Conversational APIs.
|
|
1022
|
+
*/
|
|
1023
|
+
export type ChatResponseStream =
|
|
1024
|
+
| ChatResponseStream.AssistantResponseEventMember
|
|
1025
|
+
| ChatResponseStream.CodeReferenceEventMember
|
|
1026
|
+
| ChatResponseStream.ErrorMember
|
|
1027
|
+
| ChatResponseStream.FollowupPromptEventMember
|
|
1028
|
+
| ChatResponseStream.InvalidStateEventMember
|
|
1029
|
+
| ChatResponseStream.MessageMetadataEventMember
|
|
1030
|
+
| ChatResponseStream.SupplementaryWebLinksEventMember
|
|
1031
|
+
| ChatResponseStream.$UnknownMember
|
|
1032
|
+
|
|
1033
|
+
/**
|
|
1034
|
+
* @public
|
|
1035
|
+
*/
|
|
1036
|
+
export namespace ChatResponseStream {
|
|
1037
|
+
/**
|
|
1038
|
+
* @public
|
|
1039
|
+
* Message Metadata event
|
|
1040
|
+
*/
|
|
1041
|
+
export interface MessageMetadataEventMember {
|
|
1042
|
+
messageMetadataEvent: MessageMetadataEvent
|
|
1043
|
+
assistantResponseEvent?: never
|
|
1044
|
+
codeReferenceEvent?: never
|
|
1045
|
+
supplementaryWebLinksEvent?: never
|
|
1046
|
+
followupPromptEvent?: never
|
|
1047
|
+
invalidStateEvent?: never
|
|
1048
|
+
error?: never
|
|
1049
|
+
$unknown?: never
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
/**
|
|
1053
|
+
* @public
|
|
1054
|
+
* Assistant response event - Text / Code snippet
|
|
1055
|
+
*/
|
|
1056
|
+
export interface AssistantResponseEventMember {
|
|
1057
|
+
messageMetadataEvent?: never
|
|
1058
|
+
assistantResponseEvent: AssistantResponseEvent
|
|
1059
|
+
codeReferenceEvent?: never
|
|
1060
|
+
supplementaryWebLinksEvent?: never
|
|
1061
|
+
followupPromptEvent?: never
|
|
1062
|
+
invalidStateEvent?: never
|
|
1063
|
+
error?: never
|
|
1064
|
+
$unknown?: never
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
/**
|
|
1068
|
+
* @public
|
|
1069
|
+
* Code References event
|
|
1070
|
+
*/
|
|
1071
|
+
export interface CodeReferenceEventMember {
|
|
1072
|
+
messageMetadataEvent?: never
|
|
1073
|
+
assistantResponseEvent?: never
|
|
1074
|
+
codeReferenceEvent: CodeReferenceEvent
|
|
1075
|
+
supplementaryWebLinksEvent?: never
|
|
1076
|
+
followupPromptEvent?: never
|
|
1077
|
+
invalidStateEvent?: never
|
|
1078
|
+
error?: never
|
|
1079
|
+
$unknown?: never
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
/**
|
|
1083
|
+
* @public
|
|
1084
|
+
* Web Reference links event
|
|
1085
|
+
*/
|
|
1086
|
+
export interface SupplementaryWebLinksEventMember {
|
|
1087
|
+
messageMetadataEvent?: never
|
|
1088
|
+
assistantResponseEvent?: never
|
|
1089
|
+
codeReferenceEvent?: never
|
|
1090
|
+
supplementaryWebLinksEvent: SupplementaryWebLinksEvent
|
|
1091
|
+
followupPromptEvent?: never
|
|
1092
|
+
invalidStateEvent?: never
|
|
1093
|
+
error?: never
|
|
1094
|
+
$unknown?: never
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
/**
|
|
1098
|
+
* @public
|
|
1099
|
+
* Followup prompt event
|
|
1100
|
+
*/
|
|
1101
|
+
export interface FollowupPromptEventMember {
|
|
1102
|
+
messageMetadataEvent?: never
|
|
1103
|
+
assistantResponseEvent?: never
|
|
1104
|
+
codeReferenceEvent?: never
|
|
1105
|
+
supplementaryWebLinksEvent?: never
|
|
1106
|
+
followupPromptEvent: FollowupPromptEvent
|
|
1107
|
+
invalidStateEvent?: never
|
|
1108
|
+
error?: never
|
|
1109
|
+
$unknown?: never
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
/**
|
|
1113
|
+
* @public
|
|
1114
|
+
* Invalid State event
|
|
1115
|
+
*/
|
|
1116
|
+
export interface InvalidStateEventMember {
|
|
1117
|
+
messageMetadataEvent?: never
|
|
1118
|
+
assistantResponseEvent?: never
|
|
1119
|
+
codeReferenceEvent?: never
|
|
1120
|
+
supplementaryWebLinksEvent?: never
|
|
1121
|
+
followupPromptEvent?: never
|
|
1122
|
+
invalidStateEvent: InvalidStateEvent
|
|
1123
|
+
error?: never
|
|
1124
|
+
$unknown?: never
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1127
|
+
/**
|
|
1128
|
+
* @public
|
|
1129
|
+
* Internal Server Exception
|
|
1130
|
+
*/
|
|
1131
|
+
export interface ErrorMember {
|
|
1132
|
+
messageMetadataEvent?: never
|
|
1133
|
+
assistantResponseEvent?: never
|
|
1134
|
+
codeReferenceEvent?: never
|
|
1135
|
+
supplementaryWebLinksEvent?: never
|
|
1136
|
+
followupPromptEvent?: never
|
|
1137
|
+
invalidStateEvent?: never
|
|
1138
|
+
error: InternalServerException
|
|
1139
|
+
$unknown?: never
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
/**
|
|
1143
|
+
* @public
|
|
1144
|
+
*/
|
|
1145
|
+
export interface $UnknownMember {
|
|
1146
|
+
messageMetadataEvent?: never
|
|
1147
|
+
assistantResponseEvent?: never
|
|
1148
|
+
codeReferenceEvent?: never
|
|
1149
|
+
supplementaryWebLinksEvent?: never
|
|
1150
|
+
followupPromptEvent?: never
|
|
1151
|
+
invalidStateEvent?: never
|
|
1152
|
+
error?: never
|
|
1153
|
+
$unknown: [string, any]
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
export interface Visitor<T> {
|
|
1157
|
+
messageMetadataEvent: (value: MessageMetadataEvent) => T
|
|
1158
|
+
assistantResponseEvent: (value: AssistantResponseEvent) => T
|
|
1159
|
+
codeReferenceEvent: (value: CodeReferenceEvent) => T
|
|
1160
|
+
supplementaryWebLinksEvent: (value: SupplementaryWebLinksEvent) => T
|
|
1161
|
+
followupPromptEvent: (value: FollowupPromptEvent) => T
|
|
1162
|
+
invalidStateEvent: (value: InvalidStateEvent) => T
|
|
1163
|
+
error: (value: InternalServerException) => T
|
|
1164
|
+
_: (name: string, value: any) => T
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
export const visit = <T>(value: ChatResponseStream, visitor: Visitor<T>): T => {
|
|
1168
|
+
if (value.messageMetadataEvent !== undefined) return visitor.messageMetadataEvent(value.messageMetadataEvent)
|
|
1169
|
+
if (value.assistantResponseEvent !== undefined)
|
|
1170
|
+
return visitor.assistantResponseEvent(value.assistantResponseEvent)
|
|
1171
|
+
if (value.codeReferenceEvent !== undefined) return visitor.codeReferenceEvent(value.codeReferenceEvent)
|
|
1172
|
+
if (value.supplementaryWebLinksEvent !== undefined)
|
|
1173
|
+
return visitor.supplementaryWebLinksEvent(value.supplementaryWebLinksEvent)
|
|
1174
|
+
if (value.followupPromptEvent !== undefined) return visitor.followupPromptEvent(value.followupPromptEvent)
|
|
1175
|
+
if (value.invalidStateEvent !== undefined) return visitor.invalidStateEvent(value.invalidStateEvent)
|
|
1176
|
+
if (value.error !== undefined) return visitor.error(value.error)
|
|
1177
|
+
return visitor._(value.$unknown[0], value.$unknown[1])
|
|
1178
|
+
}
|
|
1179
|
+
}
|
|
1180
|
+
/**
|
|
1181
|
+
* @internal
|
|
1182
|
+
*/
|
|
1183
|
+
export const ChatResponseStreamFilterSensitiveLog = (obj: ChatResponseStream): any => {
|
|
1184
|
+
if (obj.messageMetadataEvent !== undefined) return { messageMetadataEvent: obj.messageMetadataEvent }
|
|
1185
|
+
if (obj.assistantResponseEvent !== undefined)
|
|
1186
|
+
return { assistantResponseEvent: AssistantResponseEventFilterSensitiveLog(obj.assistantResponseEvent) }
|
|
1187
|
+
if (obj.codeReferenceEvent !== undefined) return { codeReferenceEvent: obj.codeReferenceEvent }
|
|
1188
|
+
if (obj.supplementaryWebLinksEvent !== undefined)
|
|
1189
|
+
return {
|
|
1190
|
+
supplementaryWebLinksEvent: SupplementaryWebLinksEventFilterSensitiveLog(obj.supplementaryWebLinksEvent),
|
|
1191
|
+
}
|
|
1192
|
+
if (obj.followupPromptEvent !== undefined)
|
|
1193
|
+
return { followupPromptEvent: FollowupPromptEventFilterSensitiveLog(obj.followupPromptEvent) }
|
|
1194
|
+
if (obj.invalidStateEvent !== undefined) return { invalidStateEvent: obj.invalidStateEvent }
|
|
1195
|
+
if (obj.error !== undefined) return { error: obj.error }
|
|
1196
|
+
if (obj.$unknown !== undefined) return { [obj.$unknown[0]]: 'UNKNOWN' }
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
/**
|
|
1200
|
+
* @public
|
|
1201
|
+
* @enum
|
|
1202
|
+
*/
|
|
1203
|
+
export const ChatTriggerType = {
|
|
1204
|
+
/**
|
|
1205
|
+
* Indicates the Chat was triggered in response to a IDE diagnostic
|
|
1206
|
+
*/
|
|
1207
|
+
DIAGNOSTIC: 'DIAGNOSTIC',
|
|
1208
|
+
/**
|
|
1209
|
+
* Indicates the Chat was triggered due to an explicit chat request by an end-user
|
|
1210
|
+
*/
|
|
1211
|
+
MANUAL: 'MANUAL',
|
|
1212
|
+
} as const
|
|
1213
|
+
/**
|
|
1214
|
+
* @public
|
|
1215
|
+
*/
|
|
1216
|
+
export type ChatTriggerType = (typeof ChatTriggerType)[keyof typeof ChatTriggerType]
|
|
1217
|
+
|
|
1218
|
+
/**
|
|
1219
|
+
* @public
|
|
1220
|
+
* @enum
|
|
1221
|
+
*/
|
|
1222
|
+
export const ContextTruncationScheme = {
|
|
1223
|
+
ANALYSIS: 'ANALYSIS',
|
|
1224
|
+
GUMBY: 'GUMBY',
|
|
1225
|
+
} as const
|
|
1226
|
+
/**
|
|
1227
|
+
* @public
|
|
1228
|
+
*/
|
|
1229
|
+
export type ContextTruncationScheme = (typeof ContextTruncationScheme)[keyof typeof ContextTruncationScheme]
|
|
1230
|
+
|
|
1231
|
+
/**
|
|
1232
|
+
* @public
|
|
1233
|
+
* Structure to represent the current state of a chat conversation.
|
|
1234
|
+
*/
|
|
1235
|
+
export interface ConversationState {
|
|
1236
|
+
/**
|
|
1237
|
+
* @public
|
|
1238
|
+
* Unique identifier for the chat conversation stream
|
|
1239
|
+
*/
|
|
1240
|
+
conversationId?: string
|
|
1241
|
+
|
|
1242
|
+
/**
|
|
1243
|
+
* @public
|
|
1244
|
+
* Holds the history of chat messages.
|
|
1245
|
+
*/
|
|
1246
|
+
history?: ChatMessage[]
|
|
1247
|
+
|
|
1248
|
+
/**
|
|
1249
|
+
* @public
|
|
1250
|
+
* Holds the current message being processed or displayed.
|
|
1251
|
+
*/
|
|
1252
|
+
currentMessage: ChatMessage | undefined
|
|
1253
|
+
|
|
1254
|
+
/**
|
|
1255
|
+
* @public
|
|
1256
|
+
* Trigger Reason for Chat
|
|
1257
|
+
*/
|
|
1258
|
+
chatTriggerType: ChatTriggerType | string | undefined
|
|
1259
|
+
}
|
|
1260
|
+
|
|
1261
|
+
/**
|
|
1262
|
+
* @internal
|
|
1263
|
+
*/
|
|
1264
|
+
export const ConversationStateFilterSensitiveLog = (obj: ConversationState): any => ({
|
|
1265
|
+
...obj,
|
|
1266
|
+
...(obj.history && { history: obj.history.map(item => ChatMessageFilterSensitiveLog(item)) }),
|
|
1267
|
+
...(obj.currentMessage && { currentMessage: ChatMessageFilterSensitiveLog(obj.currentMessage) }),
|
|
1268
|
+
})
|
|
1269
|
+
|
|
1270
|
+
/**
|
|
1271
|
+
* @public
|
|
1272
|
+
* @enum
|
|
1273
|
+
*/
|
|
1274
|
+
export const ExportIntent = {
|
|
1275
|
+
/**
|
|
1276
|
+
* Code Task Assist
|
|
1277
|
+
*/
|
|
1278
|
+
TASK_ASSIST: 'TASK_ASSIST',
|
|
1279
|
+
/**
|
|
1280
|
+
* Code Transformation
|
|
1281
|
+
*/
|
|
1282
|
+
TRANSFORMATION: 'TRANSFORMATION',
|
|
1283
|
+
} as const
|
|
1284
|
+
/**
|
|
1285
|
+
* @public
|
|
1286
|
+
*/
|
|
1287
|
+
export type ExportIntent = (typeof ExportIntent)[keyof typeof ExportIntent]
|
|
1288
|
+
|
|
1289
|
+
/**
|
|
1290
|
+
* @public
|
|
1291
|
+
* Response Stream
|
|
1292
|
+
*/
|
|
1293
|
+
export type ResultArchiveStream =
|
|
1294
|
+
| ResultArchiveStream.BinaryMetadataEventMember
|
|
1295
|
+
| ResultArchiveStream.BinaryPayloadEventMember
|
|
1296
|
+
| ResultArchiveStream.InternalServerExceptionMember
|
|
1297
|
+
| ResultArchiveStream.$UnknownMember
|
|
1298
|
+
|
|
1299
|
+
/**
|
|
1300
|
+
* @public
|
|
1301
|
+
*/
|
|
1302
|
+
export namespace ResultArchiveStream {
|
|
1303
|
+
/**
|
|
1304
|
+
* @public
|
|
1305
|
+
* Payload Part
|
|
1306
|
+
*/
|
|
1307
|
+
export interface BinaryMetadataEventMember {
|
|
1308
|
+
binaryMetadataEvent: BinaryMetadataEvent
|
|
1309
|
+
binaryPayloadEvent?: never
|
|
1310
|
+
internalServerException?: never
|
|
1311
|
+
$unknown?: never
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1314
|
+
/**
|
|
1315
|
+
* @public
|
|
1316
|
+
* Payload Part
|
|
1317
|
+
*/
|
|
1318
|
+
export interface BinaryPayloadEventMember {
|
|
1319
|
+
binaryMetadataEvent?: never
|
|
1320
|
+
binaryPayloadEvent: BinaryPayloadEvent
|
|
1321
|
+
internalServerException?: never
|
|
1322
|
+
$unknown?: never
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
/**
|
|
1326
|
+
* @public
|
|
1327
|
+
* This exception is thrown when an unexpected error occurred during the processing of a request.
|
|
1328
|
+
*/
|
|
1329
|
+
export interface InternalServerExceptionMember {
|
|
1330
|
+
binaryMetadataEvent?: never
|
|
1331
|
+
binaryPayloadEvent?: never
|
|
1332
|
+
internalServerException: InternalServerException
|
|
1333
|
+
$unknown?: never
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
/**
|
|
1337
|
+
* @public
|
|
1338
|
+
*/
|
|
1339
|
+
export interface $UnknownMember {
|
|
1340
|
+
binaryMetadataEvent?: never
|
|
1341
|
+
binaryPayloadEvent?: never
|
|
1342
|
+
internalServerException?: never
|
|
1343
|
+
$unknown: [string, any]
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
export interface Visitor<T> {
|
|
1347
|
+
binaryMetadataEvent: (value: BinaryMetadataEvent) => T
|
|
1348
|
+
binaryPayloadEvent: (value: BinaryPayloadEvent) => T
|
|
1349
|
+
internalServerException: (value: InternalServerException) => T
|
|
1350
|
+
_: (name: string, value: any) => T
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
export const visit = <T>(value: ResultArchiveStream, visitor: Visitor<T>): T => {
|
|
1354
|
+
if (value.binaryMetadataEvent !== undefined) return visitor.binaryMetadataEvent(value.binaryMetadataEvent)
|
|
1355
|
+
if (value.binaryPayloadEvent !== undefined) return visitor.binaryPayloadEvent(value.binaryPayloadEvent)
|
|
1356
|
+
if (value.internalServerException !== undefined)
|
|
1357
|
+
return visitor.internalServerException(value.internalServerException)
|
|
1358
|
+
return visitor._(value.$unknown[0], value.$unknown[1])
|
|
1359
|
+
}
|
|
1360
|
+
}
|
|
1361
|
+
/**
|
|
1362
|
+
* @internal
|
|
1363
|
+
*/
|
|
1364
|
+
export const ResultArchiveStreamFilterSensitiveLog = (obj: ResultArchiveStream): any => {
|
|
1365
|
+
if (obj.binaryMetadataEvent !== undefined) return { binaryMetadataEvent: SENSITIVE_STRING }
|
|
1366
|
+
if (obj.binaryPayloadEvent !== undefined) return { binaryPayloadEvent: SENSITIVE_STRING }
|
|
1367
|
+
if (obj.internalServerException !== undefined) return { internalServerException: obj.internalServerException }
|
|
1368
|
+
if (obj.$unknown !== undefined) return { [obj.$unknown[0]]: 'UNKNOWN' }
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
/**
|
|
1372
|
+
* @public
|
|
1373
|
+
* Represents a Workspace state uploaded to S3 for Async Code Actions
|
|
1374
|
+
*/
|
|
1375
|
+
export interface WorkspaceState {
|
|
1376
|
+
/**
|
|
1377
|
+
* @public
|
|
1378
|
+
* Upload ID representing an Upload using a PreSigned URL
|
|
1379
|
+
*/
|
|
1380
|
+
uploadId: string | undefined
|
|
1381
|
+
|
|
1382
|
+
/**
|
|
1383
|
+
* @public
|
|
1384
|
+
* Primary programming language of the Workspace
|
|
1385
|
+
*/
|
|
1386
|
+
programmingLanguage: ProgrammingLanguage | undefined
|
|
1387
|
+
|
|
1388
|
+
/**
|
|
1389
|
+
* @public
|
|
1390
|
+
* Workspace context truncation schemes based on usecase
|
|
1391
|
+
*/
|
|
1392
|
+
contextTruncationScheme?: ContextTruncationScheme | string
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1395
|
+
/**
|
|
1396
|
+
* @public
|
|
1397
|
+
* Structure to represent a new generate assistant response request.
|
|
1398
|
+
*/
|
|
1399
|
+
export interface GenerateAssistantResponseRequest {
|
|
1400
|
+
/**
|
|
1401
|
+
* @public
|
|
1402
|
+
* Structure to represent the current state of a chat conversation.
|
|
1403
|
+
*/
|
|
1404
|
+
conversationState: ConversationState | undefined
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
/**
|
|
1408
|
+
* @internal
|
|
1409
|
+
*/
|
|
1410
|
+
export const GenerateAssistantResponseRequestFilterSensitiveLog = (obj: GenerateAssistantResponseRequest): any => ({
|
|
1411
|
+
...obj,
|
|
1412
|
+
...(obj.conversationState && { conversationState: ConversationStateFilterSensitiveLog(obj.conversationState) }),
|
|
1413
|
+
})
|
|
1414
|
+
|
|
1415
|
+
/**
|
|
1416
|
+
* @public
|
|
1417
|
+
* Structure to represent generate assistant response response.
|
|
1418
|
+
*/
|
|
1419
|
+
export interface GenerateAssistantResponseResponse {
|
|
1420
|
+
/**
|
|
1421
|
+
* @public
|
|
1422
|
+
* ID which represents a multi-turn conversation
|
|
1423
|
+
*/
|
|
1424
|
+
conversationId: string | undefined
|
|
1425
|
+
|
|
1426
|
+
/**
|
|
1427
|
+
* @public
|
|
1428
|
+
* Streaming events from UniDirectional Streaming Conversational APIs.
|
|
1429
|
+
*/
|
|
1430
|
+
generateAssistantResponseResponse: AsyncIterable<ChatResponseStream> | undefined
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
/**
|
|
1434
|
+
* @internal
|
|
1435
|
+
*/
|
|
1436
|
+
export const GenerateAssistantResponseResponseFilterSensitiveLog = (obj: GenerateAssistantResponseResponse): any => ({
|
|
1437
|
+
...obj,
|
|
1438
|
+
...(obj.generateAssistantResponseResponse && { generateAssistantResponseResponse: 'STREAMING_CONTENT' }),
|
|
1439
|
+
})
|
|
1440
|
+
|
|
1441
|
+
/**
|
|
1442
|
+
* @public
|
|
1443
|
+
* Structure to represent a new ExportResultArchive request.
|
|
1444
|
+
*/
|
|
1445
|
+
export interface ExportResultArchiveRequest {
|
|
1446
|
+
exportId: string | undefined
|
|
1447
|
+
/**
|
|
1448
|
+
* @public
|
|
1449
|
+
* Export Intent
|
|
1450
|
+
*/
|
|
1451
|
+
exportIntent: ExportIntent | string | undefined
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1454
|
+
/**
|
|
1455
|
+
* @public
|
|
1456
|
+
* Structure to represent ExportResultArchive response.
|
|
1457
|
+
*/
|
|
1458
|
+
export interface ExportResultArchiveResponse {
|
|
1459
|
+
/**
|
|
1460
|
+
* @public
|
|
1461
|
+
* Response Stream
|
|
1462
|
+
*/
|
|
1463
|
+
body: AsyncIterable<ResultArchiveStream> | undefined
|
|
1464
|
+
}
|
|
1465
|
+
|
|
1466
|
+
/**
|
|
1467
|
+
* @internal
|
|
1468
|
+
*/
|
|
1469
|
+
export const ExportResultArchiveResponseFilterSensitiveLog = (obj: ExportResultArchiveResponse): any => ({
|
|
1470
|
+
...obj,
|
|
1471
|
+
...(obj.body && { body: 'STREAMING_CONTENT' }),
|
|
1472
|
+
})
|
|
1473
|
+
|
|
1474
|
+
/**
|
|
1475
|
+
* @public
|
|
1476
|
+
* Structure to represent execute planning interaction request.
|
|
1477
|
+
*/
|
|
1478
|
+
export interface GenerateTaskAssistPlanRequest {
|
|
1479
|
+
/**
|
|
1480
|
+
* @public
|
|
1481
|
+
* Structure to represent the current state of a chat conversation.
|
|
1482
|
+
*/
|
|
1483
|
+
conversationState: ConversationState | undefined
|
|
1484
|
+
|
|
1485
|
+
/**
|
|
1486
|
+
* @public
|
|
1487
|
+
* Represents a Workspace state uploaded to S3 for Async Code Actions
|
|
1488
|
+
*/
|
|
1489
|
+
workspaceState: WorkspaceState | undefined
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
/**
|
|
1493
|
+
* @internal
|
|
1494
|
+
*/
|
|
1495
|
+
export const GenerateTaskAssistPlanRequestFilterSensitiveLog = (obj: GenerateTaskAssistPlanRequest): any => ({
|
|
1496
|
+
...obj,
|
|
1497
|
+
...(obj.conversationState && { conversationState: ConversationStateFilterSensitiveLog(obj.conversationState) }),
|
|
1498
|
+
})
|
|
1499
|
+
|
|
1500
|
+
/**
|
|
1501
|
+
* @public
|
|
1502
|
+
* Structure to represent execute planning interaction response.
|
|
1503
|
+
*/
|
|
1504
|
+
export interface GenerateTaskAssistPlanResponse {
|
|
1505
|
+
/**
|
|
1506
|
+
* @public
|
|
1507
|
+
* Streaming events from UniDirectional Streaming Conversational APIs.
|
|
1508
|
+
*/
|
|
1509
|
+
planningResponseStream?: AsyncIterable<ChatResponseStream>
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
/**
|
|
1513
|
+
* @internal
|
|
1514
|
+
*/
|
|
1515
|
+
export const GenerateTaskAssistPlanResponseFilterSensitiveLog = (obj: GenerateTaskAssistPlanResponse): any => ({
|
|
1516
|
+
...obj,
|
|
1517
|
+
...(obj.planningResponseStream && { planningResponseStream: 'STREAMING_CONTENT' }),
|
|
1518
|
+
})
|