Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c103851
initial
constewart9 Jun 30, 2025
98976fa
external definitions allowed
constewart9 Jun 30, 2025
80df220
added inheritance
constewart9 Jul 1, 2025
b074ae6
feat: inheritance added to relevant definitions
constewart9 Jul 2, 2025
072b272
feat: renamed generated output package, included post processing
constewart9 Jul 2, 2025
8bd5913
feat: generated types integrated in LSR
constewart9 Jul 9, 2025
5395c95
feat: removed unncessary flags, cleaned up package.json
constewart9 Jul 11, 2025
6365bd5
fix: resolve merge conflicts
constewart9 Jul 14, 2025
f2f3544
Merge remote-tracking branch 'origin/main' into conorstw/types
constewart9 Jul 16, 2025
fa612e9
fix: more git issues fixed
constewart9 Jul 16, 2025
25c3487
feat: added java definition codegen
constewart9 Jul 21, 2025
fd46952
feat: java generation config in openapitools and templates changed dirs
constewart9 Jul 21, 2025
9478543
Merge remote-tracking branch 'origin/main' into conorstw/types
constewart9 Jul 22, 2025
42e971d
feat: changed branch for GH Action activation to main
constewart9 Jul 22, 2025
d51161d
fix: fixing java compilation
constewart9 Jul 22, 2025
d320257
fix: typo
constewart9 Jul 22, 2025
2bf5b3c
removing npm ci to just i
constewart9 Jul 22, 2025
510454e
fix: changing to install in root package to fix dependency issue
constewart9 Jul 23, 2025
ce69347
Update types-codegen-pr.yaml
constewart9 Jul 23, 2025
a9e58d8
fix: fix again bruh
constewart9 Jul 23, 2025
394ccca
Merge pull request #5 from constewart9/conorstw/new-test
constewart9 Jul 23, 2025
8115a08
fix: updated package-lock.json
constewart9 Jul 23, 2025
6a3dc81
fix: fix
constewart9 Jul 23, 2025
940e2ca
fix: changing java version in generated pom
constewart9 Jul 23, 2025
4dd29ca
fix: testing gh again
constewart9 Jul 23, 2025
22c1790
fix: installs
constewart9 Jul 23, 2025
0af33eb
fix: test
constewart9 Jul 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/types-codegen-merge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Chat Types Merge Processing

on:
push:
branches:
- feature/flareProtocolCodeGen
paths:
- '**/chatTypes.json'

jobs:
process-merge:
name: Process Merge with chatTypes.json changes
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
51 changes: 51 additions & 0 deletions .github/workflows/types-codegen-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Chat Types PR Validation

on:
pull_request:
branches:
- main
paths:
- 'types/codegen/schema/chatTypes.json'

jobs:
validate-pr:
name: Validate PR with chatTypes.json changes
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
#should we cache: 'npm'

- name: Install root dependencies
run: npm i

- name: Install codegen dependencies
working-directory: types/codegen
run: npm i

- name: Generate types
working-directory: types/codegen
run: npm run generate

- name: Build TypeScript
working-directory: types/codegen/generated/typescript
run: |
npm i
npm run build

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '21'
cache: 'maven'

- name: Build Java with Maven
working-directory: types/codegen/generated/java
run: mvn clean compile -Djava.version=21
3 changes: 2 additions & 1 deletion chat-client-ui-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"author": "Amazon Web Services",
"license": "Apache-2.0",
"dependencies": {
"@aws/language-server-runtimes-types": "^0.1.50"
"@aws/language-server-runtimes-types": "^0.1.50",
"@local/language-server-runtimes-generated-types": "file:/Users/conorstw/Desktop/language-server-runtimes/types/codegen/generated/typescript"
}
}
7 changes: 3 additions & 4 deletions chat-client-ui-types/src/uiContracts.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import { OPEN_TAB_REQUEST_METHOD, GET_SERIALIZED_CHAT_REQUEST_METHOD } from '@aws/language-server-runtimes-types'
import {
InsertToCursorPositionParams,
ChatOptions,
CodeSelectionType,
ReferenceTrackerInformation,
OPEN_TAB_REQUEST_METHOD,
OpenTabResult,
GET_SERIALIZED_CHAT_REQUEST_METHOD,
GetSerializedChatResult,
ChatPrompt,
OpenFileDialogParams,
DropFilesParams,
} from '@aws/language-server-runtimes-types'
export { InsertToCursorPositionParams } from '@aws/language-server-runtimes-types'
} from '@local/language-server-runtimes-generated-types'
export { InsertToCursorPositionParams } from '@local/language-server-runtimes-generated-types'

export type AuthFollowUpType = 'full-auth' | 're-auth' | 'missing_scopes' | 'use-supported-auth'
export function isValidAuthFollowUpType(value: string): value is AuthFollowUpType {
Expand Down
32 changes: 31 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
],
"workspaces": [
"types",
"types/codegen/generated",
"runtimes",
"chat-client-ui-types"
],
Expand All @@ -36,7 +37,8 @@
"test": "npm run test --workspaces --if-present",
"preversion": "npm run test",
"version": "npm run compile && git add -A .",
"watch": "tsc --build --watch"
"watch": "tsc --build --watch",
"gen-comp": "cd ./types/codegen/ && npm run generate && cd ./generated && npm run build && cd ../../../ && npm run compile"
},
"devDependencies": {
"@commitlint/cli": "^19.8.1",
Expand Down
1 change: 1 addition & 0 deletions runtimes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
},
"dependencies": {
"@aws/language-server-runtimes-types": "^0.1.50",
"@local/language-server-runtimes-generated-types": "file:/Users/conorstw/Desktop/language-server-runtimes/types/codegen/generated/typescript",
"@opentelemetry/api": "^1.9.0",
"@opentelemetry/api-logs": "^0.200.0",
"@opentelemetry/core": "^2.0.0",
Expand Down
86 changes: 46 additions & 40 deletions runtimes/protocol/chat.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
import {
ChatParams,
ChatResult,
EndChatParams,
EndChatResult,
FeedbackParams,
FollowUpClickParams,
InfoLinkClickParams,
InsertToCursorPositionParams,
LinkClickParams,
QuickActionParams,
SourceLinkClickParams,
TabAddParams,
TabChangeParams,
TabRemoveParams,
ProtocolNotificationType,
ProtocolRequestType,
CHAT_REQUEST_METHOD,
Expand All @@ -29,65 +15,85 @@ import {
TAB_CHANGE_NOTIFICATION_METHOD,
TAB_REMOVE_NOTIFICATION_METHOD,
AutoParameterStructuresProtocolRequestType,
OPEN_TAB_REQUEST_METHOD,
CHAT_UPDATE_NOTIFICATION_METHOD,
FILE_CLICK_NOTIFICATION_METHOD,
INLINE_CHAT_REQUEST_METHOD,
CONTEXT_COMMAND_NOTIFICATION_METHOD,
CREATE_PROMPT_NOTIFICATION_METHOD,
INLINE_CHAT_RESULT_NOTIFICATION_METHOD,
PINNED_CONTEXT_NOTIFICATION_METHOD,
LIST_CONVERSATIONS_REQUEST_METHOD,
CONVERSATION_CLICK_REQUEST_METHOD,
GET_SERIALIZED_CHAT_REQUEST_METHOD,
TAB_BAR_ACTION_REQUEST_METHOD,
CHAT_OPTIONS_UPDATE_NOTIFICATION_METHOD,
PROMPT_INPUT_OPTION_CHANGE_METHOD,
BUTTON_CLICK_REQUEST_METHOD,
LIST_MCP_SERVERS_REQUEST_METHOD,
MCP_SERVER_CLICK_REQUEST_METHOD,
RULE_CLICK_REQUEST_METHOD,
LIST_RULES_REQUEST_METHOD,
PINNED_CONTEXT_ADD_NOTIFICATION_METHOD,
PINNED_CONTEXT_REMOVE_NOTIFICATION_METHOD,
ACTIVE_EDITOR_CHANGED_NOTIFICATION_METHOD,
OPEN_FILE_DIALOG_METHOD,
} from './lsp'

import {
ChatParams,
ChatResult,
EndChatParams,
EndChatResult,
FeedbackParams,
FollowUpClickParams,
InfoLinkClickParams,
InsertToCursorPositionParams,
LinkClickParams,
QuickActionParams,
SourceLinkClickParams,
TabAddParams,
TabChangeParams,
TabRemoveParams,
EncryptedChatParams,
EncryptedQuickActionParams,
QuickActionResult,
OPEN_TAB_REQUEST_METHOD,
OpenTabParams,
OpenTabResult,
CHAT_UPDATE_NOTIFICATION_METHOD,
FILE_CLICK_NOTIFICATION_METHOD,
ChatUpdateParams,
FileClickParams,
INLINE_CHAT_REQUEST_METHOD,
InlineChatParams,
InlineChatResult,
CONTEXT_COMMAND_NOTIFICATION_METHOD,
ContextCommandParams,
CREATE_PROMPT_NOTIFICATION_METHOD,
CreatePromptParams,
INLINE_CHAT_RESULT_NOTIFICATION_METHOD,
PINNED_CONTEXT_NOTIFICATION_METHOD,
InlineChatResultParams,
ListConversationsParams,
ListConversationsResult,
LIST_CONVERSATIONS_REQUEST_METHOD,
ConversationClickParams,
ConversationClickResult,
CONVERSATION_CLICK_REQUEST_METHOD,
GetSerializedChatParams,
GetSerializedChatResult,
GET_SERIALIZED_CHAT_REQUEST_METHOD,
TabBarActionParams,
TabBarActionResult,
TAB_BAR_ACTION_REQUEST_METHOD,
ChatOptionsUpdateParams,
CHAT_OPTIONS_UPDATE_NOTIFICATION_METHOD,
PromptInputOptionChangeParams,
PROMPT_INPUT_OPTION_CHANGE_METHOD,
ButtonClickParams,
ButtonClickResult,
BUTTON_CLICK_REQUEST_METHOD,
ListMcpServersParams,
ListMcpServersResult,
LIST_MCP_SERVERS_REQUEST_METHOD,
ListRulesResult,
RuleClickResult,
PinnedContextParams,
McpServerClickParams,
McpServerClickResult,
MCP_SERVER_CLICK_REQUEST_METHOD,
ListRulesParams,
RuleClickParams,
RULE_CLICK_REQUEST_METHOD,
LIST_RULES_REQUEST_METHOD,
ListRulesResult,
RuleClickResult,
PinnedContextParams,
PINNED_CONTEXT_ADD_NOTIFICATION_METHOD,
PINNED_CONTEXT_REMOVE_NOTIFICATION_METHOD,
ActiveEditorChangedParams,
ACTIVE_EDITOR_CHANGED_NOTIFICATION_METHOD,
OPEN_FILE_DIALOG_METHOD,
OpenFileDialogParams,
OpenFileDialogResult,
} from '@local/language-server-runtimes-generated-types'

import {
LIST_AVAILABLE_MODELS_REQUEST_METHOD,
ListAvailableModelsResult,
ListAvailableModelsParams,
Expand Down
5 changes: 4 additions & 1 deletion runtimes/protocol/lsp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ import {
RegistrationType,
RequestType,
} from 'vscode-languageserver-protocol'
import { ChatOptions } from '@aws/language-server-runtimes-types'
import { ChatOptions } from '@local/language-server-runtimes-generated-types'
import { LogLevel } from '../runtimes/util/loggingUtil'

//Changed so only METHODS are exported from ./chat
export * from '@aws/language-server-runtimes-types'

export * from '@local/language-server-runtimes-generated-types'
export { TextDocument } from 'vscode-languageserver-textdocument'

// LSP protocol is a core dependency for LSP feature provided by runtimes.
Expand Down
14 changes: 14 additions & 0 deletions types/codegen/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Generated code
generated/

# Template bank
typescript-template-bank/

# OpenAPI generator metadata
.openapi-generator/

# Node.js dependencies
node_modules/

# Build outputs
dist/
2 changes: 2 additions & 0 deletions types/codegen/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export type EndChatResult = boolean
export type FilterValue = string
17 changes: 17 additions & 0 deletions types/codegen/custom-templates/java/model.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{>licenseInfo}}

package {{package}};

// Selective imports for records
import com.fasterxml.jackson.annotation.JsonProperty;
import javax.annotation.Nullable;
import javax.annotation.Nonnull;
{{#imports}}
import {{import}};
{{/imports}}

{{#models}}
{{#model}}
{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{#vendorExtensions.x-is-one-of-interface}}{{>oneof_interface}}{{/vendorExtensions.x-is-one-of-interface}}{{^vendorExtensions.x-is-one-of-interface}}{{>record}}{{/vendorExtensions.x-is-one-of-interface}}{{/isEnum}}
{{/model}}
{{/models}}
Loading
Loading