@aws/lsp-codewhisperer 0.0.86 → 0.0.89
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 +36 -0
- package/node_modules/@amzn/codewhisperer-runtime/README.md +78 -15
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/CodeWhispererRuntimeClient.js +13 -10
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/commands/CreateArtifactUploadUrlCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/commands/CreateSubscriptionTokenCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/commands/CreateTaskAssistConversationCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/commands/CreateUploadUrlCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/commands/CreateUserMemoryEntryCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/commands/CreateWorkspaceCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/commands/DeleteTaskAssistConversationCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/commands/DeleteUserMemoryEntryCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/commands/DeleteWorkspaceCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/commands/GenerateCompletionsCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/commands/GetCodeAnalysisCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/commands/GetCodeFixJobCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/commands/GetProfileCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/commands/GetRetrievalsCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/commands/GetTaskAssistCodeGenerationCommand.js +6 -2
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/commands/GetTestGenerationCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/commands/GetTransformationCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/commands/GetTransformationPlanCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/commands/GetUsageLimitsCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/commands/ListAvailableCustomizationsCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/commands/ListAvailableModelsCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/commands/ListAvailableProfilesCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/commands/ListAvailableSubscriptionsCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/commands/ListCodeAnalysisFindingsCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/commands/ListEventsCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/commands/ListFeatureEvaluationsCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/commands/ListUserMemoryEntriesCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/commands/ListWorkspaceMetadataCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/commands/PushTelemetryEventCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/commands/ResumeTransformationCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/commands/SendTelemetryEventCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/commands/SetUserPreferenceCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/commands/StartCodeAnalysisCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/commands/StartCodeFixJobCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/commands/StartTaskAssistCodeGenerationCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/commands/StartTestGenerationCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/commands/StartTransformationCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/commands/StopTransformationCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/commands/UpdateUsageLimitsCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/endpoint/EndpointParameters.js +15 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/endpoint/endpointResolver.js +19 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/endpoint/ruleset.js +61 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/models/models_0.js +52 -43
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/models/models_1.js +7 -1
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/protocols/Aws_restJson1.js +23 -2
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/runtimeConfig.shared.js +2 -2
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/CodeWhispererRuntimeClient.js +15 -12
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/commands/CreateArtifactUploadUrlCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/commands/CreateSubscriptionTokenCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/commands/CreateTaskAssistConversationCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/commands/CreateUploadUrlCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/commands/CreateUserMemoryEntryCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/commands/CreateWorkspaceCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/commands/DeleteTaskAssistConversationCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/commands/DeleteUserMemoryEntryCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/commands/DeleteWorkspaceCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/commands/GenerateCompletionsCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/commands/GetCodeAnalysisCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/commands/GetCodeFixJobCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/commands/GetProfileCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/commands/GetRetrievalsCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/commands/GetTaskAssistCodeGenerationCommand.js +5 -1
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/commands/GetTestGenerationCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/commands/GetTransformationCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/commands/GetTransformationPlanCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/commands/GetUsageLimitsCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/commands/ListAvailableCustomizationsCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/commands/ListAvailableModelsCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/commands/ListAvailableProfilesCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/commands/ListAvailableSubscriptionsCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/commands/ListCodeAnalysisFindingsCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/commands/ListEventsCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/commands/ListFeatureEvaluationsCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/commands/ListUserMemoryEntriesCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/commands/ListWorkspaceMetadataCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/commands/PushTelemetryEventCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/commands/ResumeTransformationCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/commands/SendTelemetryEventCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/commands/SetUserPreferenceCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/commands/StartCodeAnalysisCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/commands/StartCodeFixJobCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/commands/StartTaskAssistCodeGenerationCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/commands/StartTestGenerationCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/commands/StartTransformationCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/commands/StopTransformationCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/commands/UpdateUsageLimitsCommand.js +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/endpoint/EndpointParameters.js +11 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/endpoint/endpointResolver.js +15 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/endpoint/ruleset.js +58 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/models/models_0.js +47 -37
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/models/models_1.js +5 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/protocols/Aws_restJson1.js +23 -2
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/runtimeConfig.shared.js +2 -2
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/CodeWhispererRuntimeClient.d.ts +6 -9
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/commands/CreateArtifactUploadUrlCommand.d.ts +7 -7
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/commands/CreateSubscriptionTokenCommand.d.ts +8 -6
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/commands/CreateTaskAssistConversationCommand.d.ts +4 -4
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/commands/CreateUploadUrlCommand.d.ts +11 -11
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/commands/CreateUserMemoryEntryCommand.d.ts +10 -10
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/commands/CreateWorkspaceCommand.d.ts +8 -8
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/commands/DeleteTaskAssistConversationCommand.d.ts +5 -4
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/commands/DeleteUserMemoryEntryCommand.d.ts +4 -4
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/commands/DeleteWorkspaceCommand.d.ts +6 -6
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/commands/GenerateCompletionsCommand.d.ts +6 -6
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/commands/GetCodeAnalysisCommand.d.ts +8 -8
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/commands/GetCodeFixJobCommand.d.ts +7 -7
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/commands/GetProfileCommand.d.ts +10 -6
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/commands/GetRetrievalsCommand.d.ts +6 -6
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/commands/GetTaskAssistCodeGenerationCommand.d.ts +6 -6
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/commands/GetTestGenerationCommand.d.ts +4 -4
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/commands/GetTransformationCommand.d.ts +5 -5
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/commands/GetTransformationPlanCommand.d.ts +5 -5
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/commands/GetUsageLimitsCommand.d.ts +6 -6
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/commands/ListAvailableCustomizationsCommand.d.ts +6 -6
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/commands/ListAvailableModelsCommand.d.ts +10 -6
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/commands/ListAvailableProfilesCommand.d.ts +9 -6
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/commands/ListAvailableSubscriptionsCommand.d.ts +3 -3
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/commands/ListCodeAnalysisFindingsCommand.d.ts +6 -6
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/commands/ListEventsCommand.d.ts +6 -6
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/commands/ListFeatureEvaluationsCommand.d.ts +6 -6
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/commands/ListUserMemoryEntriesCommand.d.ts +4 -4
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/commands/ListWorkspaceMetadataCommand.d.ts +6 -6
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/commands/PushTelemetryEventCommand.d.ts +6 -6
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/commands/ResumeTransformationCommand.d.ts +5 -5
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/commands/SendTelemetryEventCommand.d.ts +7 -6
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/commands/SetUserPreferenceCommand.d.ts +6 -6
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/commands/StartCodeAnalysisCommand.d.ts +8 -8
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/commands/StartCodeFixJobCommand.d.ts +7 -7
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/commands/StartTaskAssistCodeGenerationCommand.d.ts +8 -8
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/commands/StartTestGenerationCommand.d.ts +7 -7
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/commands/StartTransformationCommand.d.ts +5 -5
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/commands/StopTransformationCommand.d.ts +5 -5
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/commands/UpdateUsageLimitsCommand.d.ts +8 -8
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/endpoint/EndpointParameters.d.ts +28 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/endpoint/endpointResolver.d.ts +5 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/endpoint/ruleset.d.ts +2 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/index.d.ts +1 -0
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/models/models_0.d.ts +151 -131
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/models/models_1.d.ts +52 -1
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/runtimeConfig.browser.d.ts +5 -2
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/runtimeConfig.d.ts +5 -2
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/runtimeConfig.native.d.ts +5 -2
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/runtimeConfig.shared.d.ts +3 -1
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/LICENSE +201 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/README.md +6 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-cjs/index.js +423 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/aws/partitions.json +229 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-es/aws.js +10 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-es/index.js +5 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/index.js +3 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/isVirtualHostableS3Bucket.js +25 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/parseArn.js +18 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partition.js +41 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partitions.json +229 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-es/lib/isIpAddress.js +1 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-es/resolveEndpoint.js +1 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-es/types/EndpointError.js +1 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-es/types/EndpointRuleObject.js +1 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-es/types/ErrorRuleObject.js +1 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-es/types/RuleSetObject.js +1 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-es/types/TreeRuleObject.js +1 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-es/types/index.js +6 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-es/types/shared.js +1 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-types/aws.d.ts +2 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-types/index.d.ts +5 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-types/lib/aws/index.d.ts +3 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-types/lib/aws/isVirtualHostableS3Bucket.d.ts +5 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-types/lib/aws/parseArn.d.ts +7 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-types/lib/aws/partition.d.ts +38 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-types/lib/isIpAddress.d.ts +1 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-types/resolveEndpoint.d.ts +1 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/aws.d.ts +2 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/index.d.ts +5 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/aws/index.d.ts +3 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/aws/isVirtualHostableS3Bucket.d.ts +4 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/aws/parseArn.d.ts +2 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/aws/partition.d.ts +28 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/isIpAddress.d.ts +1 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/resolveEndpoint.d.ts +1 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/EndpointError.d.ts +1 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/EndpointRuleObject.d.ts +6 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/ErrorRuleObject.d.ts +1 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/RuleSetObject.d.ts +5 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/TreeRuleObject.d.ts +1 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/index.d.ts +6 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/shared.d.ts +12 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-types/types/EndpointError.d.ts +1 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-types/types/EndpointRuleObject.d.ts +1 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-types/types/ErrorRuleObject.d.ts +1 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-types/types/RuleSetObject.d.ts +1 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-types/types/TreeRuleObject.d.ts +1 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-types/types/index.d.ts +6 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/dist-types/types/shared.d.ts +1 -0
- package/node_modules/@amzn/codewhisperer-runtime/node_modules/@aws-sdk/util-endpoints/package.json +58 -0
- package/node_modules/@amzn/codewhisperer-runtime/package.json +3 -0
- package/out/language-server/agenticChat/agenticChatController.d.ts +7 -0
- package/out/language-server/agenticChat/agenticChatController.js +77 -14
- package/out/language-server/agenticChat/agenticChatController.js.map +1 -1
- package/out/language-server/agenticChat/context/contextCommandsProvider.d.ts +6 -0
- package/out/language-server/agenticChat/context/contextCommandsProvider.js +24 -0
- package/out/language-server/agenticChat/context/contextCommandsProvider.js.map +1 -1
- package/out/language-server/agenticChat/tools/mcp/mcpEventHandler.d.ts +7 -0
- package/out/language-server/agenticChat/tools/mcp/mcpEventHandler.js +202 -34
- package/out/language-server/agenticChat/tools/mcp/mcpEventHandler.js.map +1 -1
- package/out/language-server/agenticChat/tools/mcp/mcpManager.d.ts +4 -0
- package/out/language-server/agenticChat/tools/mcp/mcpManager.js +19 -6
- package/out/language-server/agenticChat/tools/mcp/mcpManager.js.map +1 -1
- package/out/language-server/agenticChat/tools/mcp/mcpUtils.js +2 -2
- package/out/language-server/agenticChat/tools/mcp/mcpUtils.js.map +1 -1
- package/out/language-server/agenticChat/tools/mcp/profileStatusMonitor.d.ts +6 -0
- package/out/language-server/agenticChat/tools/mcp/profileStatusMonitor.js +6 -0
- package/out/language-server/agenticChat/tools/mcp/profileStatusMonitor.js.map +1 -1
- package/out/language-server/agenticChat/tools/qCodeAnalysis/codeReview.d.ts +2 -1
- package/out/language-server/agenticChat/tools/qCodeAnalysis/codeReview.js +8 -3
- package/out/language-server/agenticChat/tools/qCodeAnalysis/codeReview.js.map +1 -1
- package/out/language-server/agenticChat/tools/qCodeAnalysis/codeReviewSchemas.d.ts +4 -1
- package/out/language-server/agenticChat/tools/qCodeAnalysis/codeReviewSchemas.js +4 -2
- package/out/language-server/agenticChat/tools/qCodeAnalysis/codeReviewSchemas.js.map +1 -1
- package/out/language-server/agenticChat/tools/qCodeAnalysis/codeReviewTypes.d.ts +1 -0
- package/out/language-server/agenticChat/tools/toolServer.js +1 -1
- package/out/language-server/agenticChat/tools/toolServer.js.map +1 -1
- package/out/language-server/inline-completion/auto-trigger/autoTrigger.js +2 -2
- package/out/language-server/inline-completion/auto-trigger/autoTrigger.js.map +1 -1
- package/out/language-server/inline-completion/auto-trigger/editPredictionAutoTrigger.d.ts +44 -1
- package/out/language-server/inline-completion/auto-trigger/editPredictionAutoTrigger.js +335 -1
- package/out/language-server/inline-completion/auto-trigger/editPredictionAutoTrigger.js.map +1 -1
- package/out/language-server/inline-completion/handler/editCompletionHandler.js +54 -58
- package/out/language-server/inline-completion/handler/editCompletionHandler.js.map +1 -1
- package/out/language-server/inline-completion/handler/inlineCompletionHandler.js +8 -3
- package/out/language-server/inline-completion/handler/inlineCompletionHandler.js.map +1 -1
- package/out/language-server/inline-completion/handler/sessionResultsHandler.js +15 -2
- package/out/language-server/inline-completion/handler/sessionResultsHandler.js.map +1 -1
- package/out/language-server/inline-completion/session/sessionManager.d.ts +5 -0
- package/out/language-server/inline-completion/session/sessionManager.js +16 -0
- package/out/language-server/inline-completion/session/sessionManager.js.map +1 -1
- package/out/language-server/inline-completion/telemetry/telemetry.d.ts +4 -4
- package/out/language-server/inline-completion/telemetry/telemetry.js +6 -6
- package/out/language-server/inline-completion/telemetry/telemetry.js.map +1 -1
- package/out/language-server/inline-completion/utils/triggerUtils.d.ts +11 -3
- package/out/language-server/inline-completion/utils/triggerUtils.js +58 -0
- package/out/language-server/inline-completion/utils/triggerUtils.js.map +1 -1
- package/out/shared/amazonQServiceManager/AmazonQTokenServiceManager.js +5 -1
- package/out/shared/amazonQServiceManager/AmazonQTokenServiceManager.js.map +1 -1
- package/out/shared/codeWhispererService.d.ts +26 -10
- package/out/shared/codeWhispererService.js +114 -25
- package/out/shared/codeWhispererService.js.map +1 -1
- package/out/shared/constants.js +3 -0
- package/out/shared/constants.js.map +1 -1
- package/out/shared/localProjectContextController.d.ts +1 -0
- package/out/shared/localProjectContextController.js +4 -0
- package/out/shared/localProjectContextController.js.map +1 -1
- package/out/shared/supplementalContextUtil/crossFileContextUtil.d.ts +3 -3
- package/out/shared/supplementalContextUtil/crossFileContextUtil.js +9 -9
- package/out/shared/supplementalContextUtil/crossFileContextUtil.js.map +1 -1
- package/out/shared/supplementalContextUtil/supplementalContextUtil.d.ts +1 -1
- package/out/shared/supplementalContextUtil/supplementalContextUtil.js +2 -2
- package/out/shared/supplementalContextUtil/supplementalContextUtil.js.map +1 -1
- package/out/shared/telemetry/telemetryService.d.ts +2 -2
- package/out/shared/telemetry/telemetryService.js +4 -2
- package/out/shared/telemetry/telemetryService.js.map +1 -1
- package/package.json +4 -4
- package/node_modules/@amzn/codewhisperer-runtime/dist-cjs/endpoints.js +0 -211
- package/node_modules/@amzn/codewhisperer-runtime/dist-es/endpoints.js +0 -207
- package/node_modules/@amzn/codewhisperer-runtime/dist-types/endpoints.d.ts +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autoTrigger.js","sourceRoot":"","sources":["../../../../src/language-server/inline-completion/auto-trigger/autoTrigger.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"autoTrigger.js","sourceRoot":"","sources":["../../../../src/language-server/inline-completion/auto-trigger/autoTrigger.ts"],"names":[],"mappings":";;;AAiJA,gDA2BC;AA5KD,yBAAwB;AAGxB,yDAAyD;AAEzD,wDAA2D;AAO3D;;;;GAIG;AACH,MAAM,YAAY,GAAiB,iBAAiC,CAAA;AAEpE,8EAA8E;AAC9E,MAAM,iBAAiB,GAAG,IAAI,CAAA;AAE9B,4EAA4E;AAC5E,MAAM,OAAO,GAAG,CAAC,CAAS,EAAE,EAAE;IAC1B,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AACjC,CAAC,CAAA;AAED,+GAA+G;AAC/G,gHAAgH;AAChH,MAAM,kBAAkB,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,I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GAAG,CAAC,GAAG,iBAAiB,CAAA;IAE3C,OAAO;QACH,aAAa;QACb,gBAAgB,EAAE,CAAC;QACnB,mBAAmB,EAAE,iBAAiB;KACzC,CAAA;AACL,CAAC,CAAA;AAtGY,QAAA,WAAW,eAsGvB"}
|
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
|
-
import { FileContext } from '../../../shared/codeWhispererService';
|
|
5
|
+
import { ClientFileContextClss, FileContext } from '../../../shared/codeWhispererService';
|
|
6
6
|
import { CursorTracker } from '../tracker/cursorTracker';
|
|
7
7
|
import { RecentEditTracker } from '../tracker/codeEditTracker';
|
|
8
|
+
import { CodeWhispererSupplementalContext } from '../../../shared/models/model';
|
|
9
|
+
import { UserTriggerDecision } from '../session/sessionManager';
|
|
10
|
+
import { Logging } from '@aws/language-server-runtimes/server-interface';
|
|
8
11
|
/**
|
|
9
12
|
* Parameters for the edit prediction auto-trigger
|
|
10
13
|
*/
|
|
@@ -26,3 +29,43 @@ export interface EditPredictionAutoTriggerParams {
|
|
|
26
29
|
export declare const editPredictionAutoTrigger: ({ fileContext, lineNum, char, previousDecision, cursorHistory, recentEdits, }: EditPredictionAutoTriggerParams) => {
|
|
27
30
|
shouldTrigger: boolean;
|
|
28
31
|
};
|
|
32
|
+
type EditAutoTriggerInput = {
|
|
33
|
+
fileContext: ClientFileContextClss;
|
|
34
|
+
triggerChar: string;
|
|
35
|
+
recentEdits: CodeWhispererSupplementalContext;
|
|
36
|
+
recentDecisions: UserTriggerDecision[];
|
|
37
|
+
};
|
|
38
|
+
type EditClassifierFeatures = {
|
|
39
|
+
lastCharacter: string;
|
|
40
|
+
lastLineLength: number;
|
|
41
|
+
leftContextLineCount: number;
|
|
42
|
+
rightContextLineCount: number;
|
|
43
|
+
normalizedEditHistory: EditHistoryFeature | undefined;
|
|
44
|
+
language: string;
|
|
45
|
+
keyword: string;
|
|
46
|
+
userAR: number;
|
|
47
|
+
};
|
|
48
|
+
type EditHistoryFeature = {
|
|
49
|
+
changedCharacters: number;
|
|
50
|
+
addedLines: number;
|
|
51
|
+
deletedLines: number;
|
|
52
|
+
};
|
|
53
|
+
export declare class EditClassifier {
|
|
54
|
+
readonly logging: Logging;
|
|
55
|
+
static THRESHOLD: number;
|
|
56
|
+
static INTERCEPT: number;
|
|
57
|
+
private _score;
|
|
58
|
+
private features;
|
|
59
|
+
constructor(params: EditAutoTriggerInput, logging: Logging);
|
|
60
|
+
shouldTriggerEdits(): {
|
|
61
|
+
shouldTrigger: boolean;
|
|
62
|
+
threshold: number;
|
|
63
|
+
score: number;
|
|
64
|
+
};
|
|
65
|
+
score(): number;
|
|
66
|
+
prepareFeatures(params: EditAutoTriggerInput): EditClassifierFeatures;
|
|
67
|
+
static processEditHistory(udiff: string): EditHistoryFeature;
|
|
68
|
+
static normalizedRecentEdit(edit: EditHistoryFeature): EditHistoryFeature;
|
|
69
|
+
static editDistance(s1: string, s2: string): number;
|
|
70
|
+
}
|
|
71
|
+
export {};
|
|
@@ -4,8 +4,13 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.editPredictionAutoTrigger = void 0;
|
|
7
|
+
exports.EditClassifier = exports.editPredictionAutoTrigger = void 0;
|
|
8
8
|
const editPredictionConfig_1 = require("./editPredictionConfig");
|
|
9
|
+
const triggerUtils_1 = require("../utils/triggerUtils");
|
|
10
|
+
// The sigmoid function to clamp the auto-trigger result to the (0, 1) range
|
|
11
|
+
const sigmoid = (x) => {
|
|
12
|
+
return 1 / (1 + Math.exp(-x));
|
|
13
|
+
};
|
|
9
14
|
/**
|
|
10
15
|
* Auto-trigger for edit predictions if users' editor state meets ALL the following conditions
|
|
11
16
|
* (condition 1) there are recent edits
|
|
@@ -31,4 +36,333 @@ const editPredictionAutoTrigger = ({ fileContext, lineNum, char, previousDecisio
|
|
|
31
36
|
return { shouldTrigger };
|
|
32
37
|
};
|
|
33
38
|
exports.editPredictionAutoTrigger = editPredictionAutoTrigger;
|
|
39
|
+
const keyWordCoefficients = {
|
|
40
|
+
get: 1.171,
|
|
41
|
+
const: -0.7697,
|
|
42
|
+
try: 0.7182,
|
|
43
|
+
number: 0.6706,
|
|
44
|
+
this: 0.6271,
|
|
45
|
+
return: -0.3991,
|
|
46
|
+
from: -0.3515,
|
|
47
|
+
None: -0.3409,
|
|
48
|
+
True: -0.3653,
|
|
49
|
+
true: -0.2502,
|
|
50
|
+
async: -0.3212,
|
|
51
|
+
false: 0.3478,
|
|
52
|
+
else: 0.3154,
|
|
53
|
+
type: -0.2662,
|
|
54
|
+
null: -0.1576,
|
|
55
|
+
if: -0.1276,
|
|
56
|
+
in: -0.0905,
|
|
57
|
+
void: 0.1712,
|
|
58
|
+
any: 0.1663,
|
|
59
|
+
as: 0.139,
|
|
60
|
+
import: 0.1424,
|
|
61
|
+
for: 0.0252,
|
|
62
|
+
is: 0.1023,
|
|
63
|
+
string: 0.0691,
|
|
64
|
+
};
|
|
65
|
+
const lastCharCoefficients = {
|
|
66
|
+
// alphabet
|
|
67
|
+
a: 0.0773,
|
|
68
|
+
c: 0.1191,
|
|
69
|
+
d: -0.0938,
|
|
70
|
+
e: -0.1517,
|
|
71
|
+
f: 0.4246,
|
|
72
|
+
i: 0.154,
|
|
73
|
+
l: 0.2188,
|
|
74
|
+
m: -0.3026,
|
|
75
|
+
n: -0.0324,
|
|
76
|
+
o: 0.196,
|
|
77
|
+
p: -0.2283,
|
|
78
|
+
Q: -0.0205,
|
|
79
|
+
r: 0.1418,
|
|
80
|
+
s: 0.0387,
|
|
81
|
+
S: 0.3369,
|
|
82
|
+
t: 0.1863,
|
|
83
|
+
u: 0.3599,
|
|
84
|
+
y: 0.0456,
|
|
85
|
+
// numbers
|
|
86
|
+
'0': 0.0415,
|
|
87
|
+
'1': -0.1826,
|
|
88
|
+
'2': -0.1085,
|
|
89
|
+
// special chars
|
|
90
|
+
'(': 0.0539,
|
|
91
|
+
')': 0.0996,
|
|
92
|
+
'{': 0.2644,
|
|
93
|
+
'}': 0.1122,
|
|
94
|
+
';': 0.2225,
|
|
95
|
+
'/': -0.0745,
|
|
96
|
+
'>': -0.0378,
|
|
97
|
+
'.': 0.0244,
|
|
98
|
+
',': -0.0274,
|
|
99
|
+
'\n': 0.1023,
|
|
100
|
+
' ': -0.066,
|
|
101
|
+
_: 0.0781,
|
|
102
|
+
"'": -0.036,
|
|
103
|
+
'"': 0.0629,
|
|
104
|
+
};
|
|
105
|
+
const languageCoefficients = {
|
|
106
|
+
c: 0.1013,
|
|
107
|
+
cpp: -0.1371,
|
|
108
|
+
sql: -0.1509,
|
|
109
|
+
java: 0.0564,
|
|
110
|
+
javascript: 0.1183,
|
|
111
|
+
json: 0.0811,
|
|
112
|
+
kotlin: -0.3022,
|
|
113
|
+
python: 0.0914,
|
|
114
|
+
rust: -0.1024,
|
|
115
|
+
scala: 0.1648,
|
|
116
|
+
shell: 0.1292,
|
|
117
|
+
tf: -0.3823,
|
|
118
|
+
typescript: 0.0928,
|
|
119
|
+
yaml: -0.2578,
|
|
120
|
+
};
|
|
121
|
+
const leftContextLineCountCoeffecients = {
|
|
122
|
+
lte25: -0.0417,
|
|
123
|
+
};
|
|
124
|
+
// No rightContextLineCountCoefficients, leave it 0 for now
|
|
125
|
+
const rightContextLineCountCoefficients = {
|
|
126
|
+
lte3: 0,
|
|
127
|
+
gte_4_lte6: 0,
|
|
128
|
+
gte7: 0,
|
|
129
|
+
};
|
|
130
|
+
const editHistoryCoefficients = {
|
|
131
|
+
changedCharsNorm: 0.0194,
|
|
132
|
+
linesDeletedNorm: -0.084,
|
|
133
|
+
linesAddedNorm: 0.0594,
|
|
134
|
+
};
|
|
135
|
+
const lastLineLengthCoefficients = {
|
|
136
|
+
lte4: 0.0293,
|
|
137
|
+
gte_5_lte12: -0.0012,
|
|
138
|
+
};
|
|
139
|
+
const arCoefficients = {
|
|
140
|
+
previous5: 0.4723,
|
|
141
|
+
};
|
|
142
|
+
class EditClassifier {
|
|
143
|
+
logging;
|
|
144
|
+
static THRESHOLD = 0.53;
|
|
145
|
+
static INTERCEPT = -0.2782;
|
|
146
|
+
_score;
|
|
147
|
+
features;
|
|
148
|
+
constructor(params, logging) {
|
|
149
|
+
this.logging = logging;
|
|
150
|
+
this.features = this.prepareFeatures(params);
|
|
151
|
+
}
|
|
152
|
+
shouldTriggerEdits() {
|
|
153
|
+
const s = this.score();
|
|
154
|
+
return {
|
|
155
|
+
score: s,
|
|
156
|
+
threshold: EditClassifier.THRESHOLD,
|
|
157
|
+
shouldTrigger: s > EditClassifier.THRESHOLD,
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
score() {
|
|
161
|
+
if (this._score !== undefined) {
|
|
162
|
+
return this._score;
|
|
163
|
+
}
|
|
164
|
+
// 1. Last Character
|
|
165
|
+
const lastChar = this.features.lastCharacter;
|
|
166
|
+
const myLastCharCoef = lastCharCoefficients[lastChar] ?? 0;
|
|
167
|
+
// 2. Last Line Length
|
|
168
|
+
const lastLineLength = this.features.lastLineLength;
|
|
169
|
+
let myLastLineLengthCoef = 0;
|
|
170
|
+
if (lastLineLength <= 4) {
|
|
171
|
+
myLastLineLengthCoef = lastLineLengthCoefficients.lte4;
|
|
172
|
+
}
|
|
173
|
+
else if (lastLineLength >= 5 && lastLineLength <= 12) {
|
|
174
|
+
myLastLineLengthCoef = lastLineLengthCoefficients.gte_5_lte12;
|
|
175
|
+
}
|
|
176
|
+
// 3. Left Context Line Count
|
|
177
|
+
const leftContextLineCount = this.features.leftContextLineCount;
|
|
178
|
+
const myLeftContextLineCountCoef = leftContextLineCount <= 25 ? leftContextLineCountCoeffecients.lte25 : 0;
|
|
179
|
+
// 4. Right Context Line Count
|
|
180
|
+
const rightContextLineCount = this.features.rightContextLineCount;
|
|
181
|
+
let myRightContextLineCountCoef = 0;
|
|
182
|
+
if (rightContextLineCount <= 3) {
|
|
183
|
+
myRightContextLineCountCoef = rightContextLineCountCoefficients.lte3;
|
|
184
|
+
}
|
|
185
|
+
else if (rightContextLineCount >= 4 && rightContextLineCount <= 6) {
|
|
186
|
+
myRightContextLineCountCoef = rightContextLineCountCoefficients.gte_4_lte6;
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
myRightContextLineCountCoef = rightContextLineCountCoefficients.gte7;
|
|
190
|
+
}
|
|
191
|
+
// 5. Edit History (only using oldest)
|
|
192
|
+
const editH = this.features.normalizedEditHistory;
|
|
193
|
+
const myAdded = (editH?.addedLines ?? 0) * editHistoryCoefficients.linesAddedNorm;
|
|
194
|
+
const myDeleted = (editH?.deletedLines ?? 0) * editHistoryCoefficients.linesDeletedNorm;
|
|
195
|
+
const myChanged = (editH?.changedCharacters ?? 0) * editHistoryCoefficients.changedCharsNorm;
|
|
196
|
+
// 6. Language
|
|
197
|
+
const lang = this.features.language;
|
|
198
|
+
const myLangCoef = languageCoefficients[lang] ?? 0;
|
|
199
|
+
// 7. Keyword
|
|
200
|
+
const kw = this.features.keyword;
|
|
201
|
+
const myKeywordCoef = keyWordCoefficients[kw] ?? 0;
|
|
202
|
+
// 8. AR
|
|
203
|
+
const myArCoef = arCoefficients.previous5 * this.features.userAR;
|
|
204
|
+
// Linear combination result
|
|
205
|
+
const logit = myLastCharCoef +
|
|
206
|
+
myLastLineLengthCoef +
|
|
207
|
+
myLeftContextLineCountCoef +
|
|
208
|
+
myRightContextLineCountCoef +
|
|
209
|
+
myAdded +
|
|
210
|
+
myDeleted +
|
|
211
|
+
myChanged +
|
|
212
|
+
myLangCoef +
|
|
213
|
+
myKeywordCoef +
|
|
214
|
+
myArCoef +
|
|
215
|
+
EditClassifier.INTERCEPT;
|
|
216
|
+
const probability = sigmoid(logit);
|
|
217
|
+
this.logging.log(`classifier:
|
|
218
|
+
"logit": ${logit},
|
|
219
|
+
"probability": ${probability},
|
|
220
|
+
"threshold": ${EditClassifier.THRESHOLD},
|
|
221
|
+
@@features@@
|
|
222
|
+
${JSON.stringify(this.features, undefined, 2)}
|
|
223
|
+
@@linear combination of features@@
|
|
224
|
+
${JSON.stringify({
|
|
225
|
+
lastChar: myLastCharCoef,
|
|
226
|
+
lastLineLength: myLastLineLengthCoef,
|
|
227
|
+
leftContextLineCount: myLeftContextLineCountCoef,
|
|
228
|
+
rightContextLineCount: myRightContextLineCountCoef,
|
|
229
|
+
addedLines: myAdded,
|
|
230
|
+
deletedLines: myDeleted,
|
|
231
|
+
changedChars: myChanged,
|
|
232
|
+
language: myLangCoef,
|
|
233
|
+
keyword: myKeywordCoef,
|
|
234
|
+
ar: myArCoef,
|
|
235
|
+
intercept: EditClassifier.INTERCEPT,
|
|
236
|
+
}, undefined, 2)}`);
|
|
237
|
+
return probability;
|
|
238
|
+
}
|
|
239
|
+
prepareFeatures(params) {
|
|
240
|
+
// 1. Last Character
|
|
241
|
+
const lastCharacter = params.triggerChar;
|
|
242
|
+
// 2. Last Line Length
|
|
243
|
+
const lastLineLength = params.fileContext.leftContextAtCurLine.length;
|
|
244
|
+
// 3. Left Context Line Count
|
|
245
|
+
const leftContextLineCount = params.fileContext.leftFileContent.split('\n').length;
|
|
246
|
+
// 4. Right Context Line Count
|
|
247
|
+
const rightContextLineCount = params.fileContext.rightFileContent.split('\n').length;
|
|
248
|
+
// 5. Edit History (only using olderst)
|
|
249
|
+
const oldest = params.recentEdits.supplementalContextItems[params.recentEdits.supplementalContextItems.length - 1]; // nullable
|
|
250
|
+
const editHistory = oldest ? EditClassifier.processEditHistory(oldest.content) : undefined;
|
|
251
|
+
const normalizedEditHistory = editHistory ? EditClassifier.normalizedRecentEdit(editHistory) : undefined;
|
|
252
|
+
this.logging.log(`lastLineFileContext:
|
|
253
|
+
${params.fileContext.leftContextAtCurLine}
|
|
254
|
+
recent decisions:
|
|
255
|
+
${JSON.stringify(params.recentDecisions)}
|
|
256
|
+
recent edits:
|
|
257
|
+
@@raw oldest edit@@
|
|
258
|
+
${oldest.content}
|
|
259
|
+
@@raw numbers@@
|
|
260
|
+
${JSON.stringify(editHistory, undefined, 2)}
|
|
261
|
+
@@normalized numbers@@
|
|
262
|
+
${JSON.stringify(normalizedEditHistory, undefined, 2)}
|
|
263
|
+
@@edits array@@
|
|
264
|
+
${params.recentEdits.supplementalContextItems.map(it => it.content)}`);
|
|
265
|
+
// 6. Language
|
|
266
|
+
const lang = params.fileContext.programmingLanguage;
|
|
267
|
+
// 7. Keywords
|
|
268
|
+
const lastToken = (0, triggerUtils_1.lastTokenFromString)(params.fileContext.leftFileContent);
|
|
269
|
+
// 8. User AR for last 5
|
|
270
|
+
// Cold start we assume 0.3 for AR
|
|
271
|
+
const ar = params.recentDecisions.length === 0
|
|
272
|
+
? 0.3
|
|
273
|
+
: params.recentDecisions.reduce((acc, cur) => {
|
|
274
|
+
if (cur === 'Accept') {
|
|
275
|
+
return acc + 1;
|
|
276
|
+
}
|
|
277
|
+
else {
|
|
278
|
+
return acc;
|
|
279
|
+
}
|
|
280
|
+
}, 0) / params.recentDecisions.length;
|
|
281
|
+
return {
|
|
282
|
+
lastCharacter: lastCharacter,
|
|
283
|
+
lastLineLength: lastLineLength,
|
|
284
|
+
leftContextLineCount: leftContextLineCount,
|
|
285
|
+
rightContextLineCount: rightContextLineCount,
|
|
286
|
+
normalizedEditHistory: normalizedEditHistory,
|
|
287
|
+
language: lang.languageName,
|
|
288
|
+
userAR: ar,
|
|
289
|
+
keyword: lastToken,
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
static processEditHistory(udiff) {
|
|
293
|
+
const lines = udiff.split('\n');
|
|
294
|
+
const addedLines = lines
|
|
295
|
+
.filter(line => line.startsWith('+') && !line.startsWith('+++'))
|
|
296
|
+
.map(line => line.substring(1));
|
|
297
|
+
const deletedLines = lines
|
|
298
|
+
.filter(line => line.startsWith('-') && !line.startsWith('---'))
|
|
299
|
+
.map(line => line.substring(1));
|
|
300
|
+
const deletedText = deletedLines.join('\n');
|
|
301
|
+
const addedText = addedLines.join('\n');
|
|
302
|
+
const historyChangedChars = EditClassifier.editDistance(deletedText, addedText);
|
|
303
|
+
const historyLineAdded = addedLines.length;
|
|
304
|
+
const historyLineDeleted = deletedLines.length;
|
|
305
|
+
return {
|
|
306
|
+
changedCharacters: historyChangedChars,
|
|
307
|
+
addedLines: historyLineAdded,
|
|
308
|
+
deletedLines: historyLineDeleted,
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
static normalizedRecentEdit(edit) {
|
|
312
|
+
// Apply min-max normalization using training data min/max values
|
|
313
|
+
const { changedCharacters, addedLines, deletedLines } = edit;
|
|
314
|
+
const trainingCharsChangedMin = 0;
|
|
315
|
+
const trainingCharsChangedMax = 261;
|
|
316
|
+
const normalizedChangedCharacters = (changedCharacters - trainingCharsChangedMin) / (trainingCharsChangedMax - trainingCharsChangedMin);
|
|
317
|
+
const trainingLineAddedMin = 0;
|
|
318
|
+
const trainingLineAddedMax = 7;
|
|
319
|
+
const normalizedAddedLines = (addedLines - trainingLineAddedMin) / (trainingLineAddedMax - trainingLineAddedMin);
|
|
320
|
+
const trainingLineDeletedMin = 0;
|
|
321
|
+
const trainingLineDeletedMax = 6;
|
|
322
|
+
const normalizedDeletedLines = (deletedLines - trainingLineDeletedMin) / (trainingLineDeletedMax - trainingLineDeletedMin);
|
|
323
|
+
return {
|
|
324
|
+
changedCharacters: normalizedChangedCharacters,
|
|
325
|
+
addedLines: normalizedAddedLines,
|
|
326
|
+
deletedLines: normalizedDeletedLines,
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
// TODO: Maybe consider reusing same logic across the entire repo or 3rd party edit distance function, we have too many different variants of such
|
|
330
|
+
static editDistance(s1, s2) {
|
|
331
|
+
if (s1.length === 0)
|
|
332
|
+
return s2.length;
|
|
333
|
+
if (s2.length === 0)
|
|
334
|
+
return s1.length;
|
|
335
|
+
// Create matrix
|
|
336
|
+
const rows = s1.length + 1;
|
|
337
|
+
const cols = s2.length + 1;
|
|
338
|
+
const dp = Array(rows)
|
|
339
|
+
.fill(0)
|
|
340
|
+
.map(() => Array(cols).fill(0));
|
|
341
|
+
// Initialize first row and column
|
|
342
|
+
for (let i = 0; i < rows; i++) {
|
|
343
|
+
dp[i][0] = i;
|
|
344
|
+
}
|
|
345
|
+
for (let j = 0; j < cols; j++) {
|
|
346
|
+
dp[0][j] = j;
|
|
347
|
+
}
|
|
348
|
+
// Fill the matrix
|
|
349
|
+
for (let i = 1; i < rows; i++) {
|
|
350
|
+
for (let j = 1; j < cols; j++) {
|
|
351
|
+
if (s1[i - 1] === s2[j - 1]) {
|
|
352
|
+
dp[i][j] = dp[i - 1][j - 1];
|
|
353
|
+
}
|
|
354
|
+
else {
|
|
355
|
+
dp[i][j] =
|
|
356
|
+
1 +
|
|
357
|
+
Math.min(dp[i - 1][j], // deletion
|
|
358
|
+
dp[i][j - 1], // insertion
|
|
359
|
+
dp[i - 1][j - 1] // substitution
|
|
360
|
+
);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
return dp[rows - 1][cols - 1];
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
exports.EditClassifier = EditClassifier;
|
|
34
368
|
//# sourceMappingURL=editPredictionAutoTrigger.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editPredictionAutoTrigger.js","sourceRoot":"","sources":["../../../../src/language-server/inline-completion/auto-trigger/editPredictionAutoTrigger.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAOH,iEAAoE;AAcpE;;;;;;GAMG;AACI,MAAM,yBAAyB,GAAG,CAAC,EACtC,WAAW,EACX,OAAO,EACP,IAAI,EACJ,gBAAgB,EAChB,aAAa,EACb,WAAW,GACmB,EAEhC,EAAE;IACA,oBAAoB;IACpB,MAAM,MAAM,GAAG,kDAA2B,CAAC,WAAW,EAAE,CAAC,SAAS,EAAE,CAAA;IAEpE,4BAA4B;IAC5B,MAAM,iBAAiB,GAAG,WAAW,CAAC,gBAAgB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IAErE,sCAAsC;IACtC,MAAM,aAAa,GAAG,WAAW,EAAE,mBAAmB,CAClD,WAAW,CAAC,OAAO,EACnB,OAAO,EACP,MAAM,CAAC,qBAAqB,EAC5B,MAAM,CAAC,qBAAqB,CAC/B,CAAA;IAED,iFAAiF;IACjF,IAAI,iBAAiB,GAAG,KAAK,CAAA;IAC7B,MAAM,wBAAwB,GAAG,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,wBAAwB,GAAG,CAAC,CAAC,CAAA;IACxG,IAAI,wBAAwB,GAAG,CAAC,EAAE,CAAC;QAC/B,MAAM,qBAAqB,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC,EAAE,wBAAwB,CAAC,CAAA;QAClF,iBAAiB,GAAG,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;IAClF,CAAC;IAED,MAAM,aAAa,GAAG,aAAa,IAAI,iBAAiB,CAAA;IAExD,OAAO,EAAE,aAAa,EAAE,CAAA;AAC5B,CAAC,CAAA;AAnCY,QAAA,yBAAyB,6BAmCrC"}
|
|
1
|
+
{"version":3,"file":"editPredictionAutoTrigger.js","sourceRoot":"","sources":["../../../../src/language-server/inline-completion/auto-trigger/editPredictionAutoTrigger.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH,iEAAoE;AAIpE,wDAA2D;AAE3D,4EAA4E;AAC5E,MAAM,OAAO,GAAG,CAAC,CAAS,EAAE,EAAE;IAC1B,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AACjC,CAAC,CAAA;AAcD;;;;;;GAMG;AACI,MAAM,yBAAyB,GAAG,CAAC,EACtC,WAAW,EACX,OA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C,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,YAAY;4BAC1B,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,eAAe;6BACnC,CAAA;gBACT,CAAC;YACL,CAAC;QACL,CAAC;QAED,OAAO,EAAE,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAA;IACjC,CAAC;;AA1QL,wCA2QC"}
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.EditCompletionHandler = void 0;
|
|
4
4
|
const protocol_1 = require("@aws/language-server-runtimes/protocol");
|
|
5
5
|
const codeWhispererService_1 = require("../../../shared/codeWhispererService");
|
|
6
|
-
const sessionManager_1 = require("../session/sessionManager");
|
|
7
6
|
const languageDetection_1 = require("../../../shared/languageDetection");
|
|
8
7
|
const workspaceFolderManager_1 = require("../../workspaceContext/workspaceFolderManager");
|
|
9
8
|
const triggerUtils_1 = require("../utils/triggerUtils");
|
|
@@ -14,6 +13,7 @@ const errors_1 = require("../../../shared/amazonQServiceManager/errors");
|
|
|
14
13
|
const constants_1 = require("../contants/constants");
|
|
15
14
|
const streakTracker_1 = require("../tracker/streakTracker");
|
|
16
15
|
const diffUtils_1 = require("../utils/diffUtils");
|
|
16
|
+
const editPredictionAutoTrigger_1 = require("../auto-trigger/editPredictionAutoTrigger");
|
|
17
17
|
class EditCompletionHandler {
|
|
18
18
|
logging;
|
|
19
19
|
clientMetadata;
|
|
@@ -60,15 +60,15 @@ class EditCompletionHandler {
|
|
|
60
60
|
* Also as a followup, ideally it should be a message/event publish/subscribe pattern instead of manual invocation like this
|
|
61
61
|
*/
|
|
62
62
|
documentChanged() {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
63
|
+
// TODO: Remove this entirely once we are sure we dont need debounce
|
|
64
|
+
// if (this.debounceTimeout) {
|
|
65
|
+
// if (this.isWaiting) {
|
|
66
|
+
// this.hasDocumentChangedSinceInvocation = true
|
|
67
|
+
// } else {
|
|
68
|
+
// this.logging.info(`refresh and debounce edits suggestion for another ${EDIT_DEBOUNCE_INTERVAL_MS}`)
|
|
69
|
+
// this.debounceTimeout.refresh()
|
|
70
|
+
// }
|
|
71
|
+
// }
|
|
72
72
|
}
|
|
73
73
|
async onEditCompletion(params, token) {
|
|
74
74
|
if (this.isInProgress) {
|
|
@@ -136,73 +136,63 @@ class EditCompletionHandler {
|
|
|
136
136
|
this.isInProgress = false;
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
|
-
|
|
140
|
-
this.
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
const result = await this._invoke(params, startPreprocessTimestamp, token, textDocument, inferredLanguageId, currentSession).finally(() => {
|
|
144
|
-
this.isWaiting = false;
|
|
145
|
-
});
|
|
146
|
-
if (this.hasDocumentChangedSinceInvocation) {
|
|
147
|
-
this.logging.info('EditCompletionHandler - Document changed during execution, resolving empty result');
|
|
148
|
-
resolve({
|
|
149
|
-
sessionId: sessionManager_1.SessionManager.getInstance('EDITS').getActiveSession()?.id ?? '',
|
|
150
|
-
items: [],
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
else {
|
|
154
|
-
this.logging.info('EditCompletionHandler - No document changes, resolving result');
|
|
155
|
-
resolve(result);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
finally {
|
|
159
|
-
this.debounceTimeout = undefined;
|
|
160
|
-
this.hasDocumentChangedSinceInvocation = false;
|
|
161
|
-
}
|
|
162
|
-
}, constants_1.EDIT_DEBOUNCE_INTERVAL_MS);
|
|
163
|
-
}).finally(() => {
|
|
139
|
+
try {
|
|
140
|
+
return await this._invoke(params, startPreprocessTimestamp, token, textDocument, inferredLanguageId, currentSession);
|
|
141
|
+
}
|
|
142
|
+
finally {
|
|
164
143
|
this.isInProgress = false;
|
|
165
|
-
}
|
|
144
|
+
}
|
|
166
145
|
}
|
|
167
146
|
async _invoke(params, startPreprocessTimestamp, token, textDocument, inferredLanguageId, currentSession) {
|
|
168
147
|
// Build request context
|
|
169
148
|
const isAutomaticLspTriggerKind = params.context.triggerKind == protocol_1.InlineCompletionTriggerKind.Automatic;
|
|
170
149
|
const maxResults = isAutomaticLspTriggerKind ? 1 : 5;
|
|
171
|
-
const
|
|
150
|
+
const fileContextClss = (0, codeWhispererService_1.getFileContext)({
|
|
172
151
|
textDocument,
|
|
173
152
|
inferredLanguageId,
|
|
174
153
|
position: params.position,
|
|
175
154
|
workspaceFolder: this.workspace.getWorkspaceFolder(textDocument.uri),
|
|
176
155
|
});
|
|
156
|
+
// TODO: Parametrize these to a util function, duplicate code as inineCompletionHandler
|
|
157
|
+
const triggerCharacters = (0, triggerUtils_1.inferTriggerChar)(fileContextClss, params.documentChangeParams);
|
|
177
158
|
const workspaceState = workspaceFolderManager_1.WorkspaceFolderManager.getInstance()?.getWorkspaceState();
|
|
178
159
|
const workspaceId = workspaceState?.webSocketClient?.isConnected() ? workspaceState.workspaceId : undefined;
|
|
179
|
-
const
|
|
180
|
-
|
|
160
|
+
const recentEdits = await this.recentEditsTracker.generateEditBasedContext(textDocument);
|
|
161
|
+
// TODO: Refactor and merge these 2 shouldTrigger into single one
|
|
162
|
+
const classifier = new editPredictionAutoTrigger_1.EditClassifier({
|
|
163
|
+
fileContext: fileContextClss,
|
|
164
|
+
triggerChar: triggerCharacters,
|
|
165
|
+
recentEdits: recentEdits,
|
|
166
|
+
recentDecisions: this.sessionManager.userDecisionLog.map(it => it.decision),
|
|
167
|
+
}, this.logging);
|
|
168
|
+
const classifierBasedTrigger = classifier.shouldTriggerEdits();
|
|
169
|
+
const ruleBasedTrigger = (0, triggerUtils_1.shouldTriggerEdits)(this.codeWhispererService, fileContextClss.toServiceModel(), params, this.cursorTracker, this.recentEditsTracker, this.sessionManager, true);
|
|
170
|
+
// Both classifier and rule based conditions need to evaluate to true otherwise we wont fire Edits requests
|
|
171
|
+
const shouldFire = classifierBasedTrigger.shouldTrigger && ruleBasedTrigger !== undefined;
|
|
172
|
+
if (!shouldFire) {
|
|
181
173
|
return constants_1.EMPTY_RESULT;
|
|
182
174
|
}
|
|
183
175
|
const generateCompletionReq = {
|
|
184
|
-
fileContext:
|
|
176
|
+
fileContext: fileContextClss.toServiceModel(),
|
|
185
177
|
maxResults: maxResults,
|
|
186
178
|
predictionTypes: ['EDITS'],
|
|
187
179
|
workspaceId: workspaceId,
|
|
188
180
|
};
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
languageName: generateCompletionReq.fileContext?.programmingLanguage?.languageName,
|
|
195
|
-
},
|
|
196
|
-
text: textDocument.getText(),
|
|
181
|
+
generateCompletionReq.editorState = {
|
|
182
|
+
document: {
|
|
183
|
+
relativeFilePath: textDocument.uri,
|
|
184
|
+
programmingLanguage: {
|
|
185
|
+
languageName: generateCompletionReq.fileContext?.programmingLanguage?.languageName,
|
|
197
186
|
},
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
187
|
+
text: textDocument.getText(),
|
|
188
|
+
},
|
|
189
|
+
cursorState: {
|
|
190
|
+
position: {
|
|
191
|
+
line: params.position.line,
|
|
192
|
+
character: params.position.character,
|
|
203
193
|
},
|
|
204
|
-
}
|
|
205
|
-
}
|
|
194
|
+
},
|
|
195
|
+
};
|
|
206
196
|
const supplementalContext = await this.codeWhispererService.constructSupplementalContext(textDocument, params.position, this.workspace, this.recentEditsTracker, this.logging, token, params.openTabFilepaths, {
|
|
207
197
|
includeRecentEdits: true,
|
|
208
198
|
});
|
|
@@ -212,16 +202,19 @@ class EditCompletionHandler {
|
|
|
212
202
|
// Close ACTIVE session and record Discard trigger decision immediately
|
|
213
203
|
if (currentSession && currentSession.state === 'ACTIVE') {
|
|
214
204
|
// Emit user trigger decision at session close time for active session
|
|
205
|
+
// This is a discard, no userDecisionReason needed
|
|
215
206
|
this.sessionManager.discardSession(currentSession);
|
|
216
207
|
const streakLength = this.editsEnabled ? this.streakTracker.getAndUpdateStreakLength(false) : 0;
|
|
217
|
-
await (0, telemetry_1.emitUserTriggerDecisionTelemetry)(this.telemetry, this.telemetryService, currentSession, this.documentChangedListener.timeSinceLastUserModification, 0, 0, [], [], streakLength
|
|
208
|
+
await (0, telemetry_1.emitUserTriggerDecisionTelemetry)(this.telemetry, this.telemetryService, currentSession, this.documentChangedListener.timeSinceLastUserModification, 0, 0, [], [], streakLength
|
|
209
|
+
// No itemId, no userDecisionReason
|
|
210
|
+
);
|
|
218
211
|
}
|
|
219
212
|
const newSession = this.sessionManager.createSession({
|
|
220
213
|
document: textDocument,
|
|
221
214
|
startPreprocessTimestamp: startPreprocessTimestamp,
|
|
222
215
|
startPosition: params.position,
|
|
223
216
|
triggerType: isAutomaticLspTriggerKind ? 'AutoTrigger' : 'OnDemand',
|
|
224
|
-
language:
|
|
217
|
+
language: fileContextClss.programmingLanguage.languageName,
|
|
225
218
|
requestContext: generateCompletionReq,
|
|
226
219
|
autoTriggerType: undefined,
|
|
227
220
|
triggerCharacter: '',
|
|
@@ -261,7 +254,10 @@ class EditCompletionHandler {
|
|
|
261
254
|
session.discardInflightSessionOnNewInvocation = false;
|
|
262
255
|
this.sessionManager.discardSession(session);
|
|
263
256
|
const streakLength = this.editsEnabled ? this.streakTracker.getAndUpdateStreakLength(false) : 0;
|
|
264
|
-
|
|
257
|
+
// This is a discard, no userDecisionReason needed
|
|
258
|
+
await (0, telemetry_1.emitUserTriggerDecisionTelemetry)(this.telemetry, this.telemetryService, session, this.documentChangedListener.timeSinceLastUserModification, 0, 0, [], [], streakLength
|
|
259
|
+
// No itemId, no userDecisionReason
|
|
260
|
+
);
|
|
265
261
|
}
|
|
266
262
|
// API response was recieved, we can activate session now
|
|
267
263
|
this.sessionManager.activateSession(session);
|