Skip to content

Commit d866dd7

Browse files
committed
fix: split schema into different files
1 parent 9bdc701 commit d866dd7

File tree

5 files changed

+209
-107
lines changed

5 files changed

+209
-107
lines changed

.github/workflows/types-codegen-pr.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@ jobs:
2929

3030
- name: Install codegen dependencies
3131
working-directory: types/codegen
32-
run: npm install
33-
34-
- name: Unit tests
35-
working-directory: types/codegen
36-
run: npm run test:unit
32+
run: npm install
3733

3834
- name: Coalesce schemas
3935
working-directory: types/codegen
@@ -51,6 +47,10 @@ jobs:
5147
working-directory: types/codegen
5248
run: npm run test
5349

50+
- name: Unit tests
51+
working-directory: types/codegen
52+
run: npm run test:unit
53+
5454
- name: Build TypeScript
5555
working-directory: types/codegen/generated/typescript
5656
run: |

runtimes/protocol/lsp.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,10 @@ import {
1212
RegistrationType,
1313
RequestType,
1414
} from 'vscode-languageserver-protocol'
15-
import { ChatOptions } from '@local/language-server-runtimes-generated-types'
15+
import { ChatOptions } from '@aws/language-server-runtimes-types'
1616
import { LogLevel } from '../runtimes/util/loggingUtil'
1717

18-
//Changed so only METHODS are exported from ./chat
1918
export * from '@aws/language-server-runtimes-types'
20-
21-
export * from '@local/language-server-runtimes-generated-types'
2219
export { TextDocument } from 'vscode-languageserver-textdocument'
2320

2421
// LSP protocol is a core dependency for LSP feature provided by runtimes.

types/codegen/schema/chatTypes.json

Lines changed: 108 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,12 @@
277277
"type": "number"
278278
}
279279
}
280+
},
281+
"visibleName": {
282+
"type": "string"
283+
},
284+
"clickable": {
285+
"type": "boolean"
280286
}
281287
}
282288
},
@@ -539,6 +545,64 @@
539545
},
540546
"contextList": {
541547
"$ref": "#/components/schemas/FileList"
548+
},
549+
"editable": {
550+
"type": "boolean"
551+
},
552+
"quickSettings": {
553+
"type": "object",
554+
"required": ["type", "messageId", "tabId", "options"],
555+
"properties": {
556+
"type": {
557+
"type": "string",
558+
"enum": ["select", "checkbox", "radio"]
559+
},
560+
"description": {
561+
"type": "string"
562+
},
563+
"descriptionLink": {
564+
"type": "object",
565+
"required": ["id", "text", "destination"],
566+
"properties": {
567+
"id": {
568+
"type": "string"
569+
},
570+
"text": {
571+
"type": "string"
572+
},
573+
"destination": {
574+
"type": "string"
575+
}
576+
}
577+
},
578+
"messageId": {
579+
"type": "string"
580+
},
581+
"tabId": {
582+
"type": "string"
583+
},
584+
"options": {
585+
"type": "array",
586+
"items": {
587+
"type": "object",
588+
"required": ["id", "label", "value"],
589+
"properties": {
590+
"id": {
591+
"type": "string"
592+
},
593+
"label": {
594+
"type": "string"
595+
},
596+
"value": {
597+
"type": "string"
598+
},
599+
"selected": {
600+
"type": "boolean"
601+
}
602+
}
603+
}
604+
}
605+
}
542606
}
543607
}
544608
},
@@ -646,25 +710,38 @@
646710
"description": "Registration options regarding chat data. Currently contains the available quick actions provided by a server and the default tab data to be shown to the user in the chat UI.",
647711
"properties": {
648712
"quickActions": {
649-
"$ref": "#/components/schemas/QuickActions"
713+
"$ref": "#/components/schemas/QuickActions",
714+
"description": "Chat QuickActions, supported by Server. Chat Client renders and sets up actions handler for registered QuickAction in UI."
650715
},
651716
"mcpServers": {
652717
"type": "boolean"
653718
},
654719
"modelSelection": {
655-
"type": "boolean"
720+
"type": "boolean",
721+
"description": "Server signals to Chat Client support of model selection."
656722
},
657723
"history": {
658-
"type": "boolean"
724+
"type": "boolean",
725+
"description": "Server signals to Chat Client support of conversation history."
659726
},
660727
"export": {
661-
"type": "boolean"
728+
"type": "boolean",
729+
"description": "Server signals to Chat Client support of Chat export feature."
730+
},
731+
"showLogs": {
732+
"type": "boolean",
733+
"description": "Server signals to Chat Client support of show logs feature."
734+
},
735+
"subscriptionDetails": {
736+
"type": "boolean",
737+
"description": "Server signals to Client and Chat Client that it supports subscription tier operations"
662738
},
663739
"chatNotifications": {
664740
"type": "array",
665741
"items": {
666742
"$ref": "#/components/schemas/ChatMessage"
667-
}
743+
},
744+
"description": "Server signals to Chat Client support of Chat notifications. Currently used for sending chat notifications for developer profile updates. Can be extended to support other types of notifications."
668745
}
669746
}
670747
},
@@ -917,6 +994,12 @@
917994
},
918995
"buttonId": {
919996
"type": "string"
997+
},
998+
"metadata": {
999+
"type": "object",
1000+
"additionalProperties": {
1001+
"type": "string"
1002+
}
9201003
}
9211004
}
9221005
},
@@ -1051,7 +1134,8 @@
10511134
}
10521135
}
10531136
}
1054-
]
1137+
],
1138+
"required": []
10551139
},
10561140
"ContextCommandParams": {
10571141
"type": "object",
@@ -1431,6 +1515,15 @@
14311515
}
14321516
}
14331517
},
1518+
"ExecuteShellCommandParams": {
1519+
"type": "object",
1520+
"required": ["id"],
1521+
"properties": {
1522+
"id": {
1523+
"type": "string"
1524+
}
1525+
}
1526+
},
14341527
"ConversationItemGroup": {
14351528
"type": "object",
14361529
"properties": {
@@ -1690,6 +1783,7 @@
16901783
},
16911784
"ListMcpServersResultHeader": {
16921785
"type": "object",
1786+
"required": ["title"],
16931787
"properties": {
16941788
"title": {
16951789
"type": "string"
@@ -1699,6 +1793,12 @@
16991793
},
17001794
"status": {
17011795
"$ref": "#/components/schemas/ListMcpServersResultHeaderStatus"
1796+
},
1797+
"actions": {
1798+
"type": "array",
1799+
"items": {
1800+
"$ref": "#/components/schemas/Action"
1801+
}
17021802
}
17031803
}
17041804
},
@@ -1849,7 +1949,7 @@
18491949
},
18501950
"TabBarAction": {
18511951
"type": "string",
1852-
"enum": ["export"]
1952+
"enum": ["export", "show_logs"]
18531953
},
18541954
"TabBarActionParams": {
18551955
"type": "object",
@@ -1923,97 +2023,7 @@
19232023
}
19242024
}
19252025
},
1926-
"FileParams": {
1927-
"type": "object",
1928-
"required": ["path"],
1929-
"properties": {
1930-
"path": {
1931-
"type": "string"
1932-
}
1933-
}
1934-
},
1935-
"CopyFileParams": {
1936-
"type": "object",
1937-
"required": ["oldPath", "newPath"],
1938-
"properties": {
1939-
"oldPath": {
1940-
"type": "string"
1941-
},
1942-
"newPath": {
1943-
"type": "string"
1944-
}
1945-
}
1946-
},
1947-
"OpenFileDiffParams": {
1948-
"type": "object",
1949-
"required": ["originalFileUri", "isDeleted"],
1950-
"properties": {
1951-
"originalFileUri": {
1952-
"type": "string"
1953-
},
1954-
"originalFileContent": {
1955-
"type": "string"
1956-
},
1957-
"isDeleted": {
1958-
"type": "boolean"
1959-
},
1960-
"fileContent": {
1961-
"type": "string"
1962-
}
1963-
}
1964-
},
1965-
"ShowOpenDialogParams": {
1966-
"type": "object",
1967-
"properties": {
1968-
"canSelectFiles": {
1969-
"type": "boolean"
1970-
},
1971-
"canSelectFolders": {
1972-
"type": "boolean"
1973-
},
1974-
"canSelectMany": {
1975-
"type": "boolean"
1976-
},
1977-
"filters": {
1978-
"type": "object",
1979-
"additionalProperties": {
1980-
"type": "array",
1981-
"items": {
1982-
"type": "string"
1983-
}
1984-
}
1985-
},
1986-
"defaultUri": {
1987-
"type": "string"
1988-
},
1989-
"title": {
1990-
"type": "string"
1991-
}
1992-
}
1993-
},
1994-
"ShowSaveFileDialogParams": {
1995-
"type": "object",
1996-
"properties": {
1997-
"supportedFormats": {
1998-
"type": "array",
1999-
"items": {
2000-
"type": "string"
2001-
}
2002-
},
2003-
"defaultUri": {
2004-
"type": "string"
2005-
}
2006-
}
2007-
},
2008-
"ShowSaveFileDialogResult": {
2009-
"type": "object",
2010-
"required": ["targetUri"],
2011-
"properties": {
2012-
"targetUri": {
2013-
"type": "string"
2014-
}
2015-
}
2016-
},
2026+
20172027
"EndChatParams": {
20182028
"type": "object",
20192029
"required": ["tabId"],

types/codegen/schema/windowTypes.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"ShowOpenDialogParams": {
3+
"type": "object",
4+
"properties": {
5+
"canSelectFiles": {
6+
"type": "boolean"
7+
},
8+
"canSelectFolders": {
9+
"type": "boolean"
10+
},
11+
"canSelectMany": {
12+
"type": "boolean"
13+
},
14+
"filters": {
15+
"type": "object",
16+
"additionalProperties": {
17+
"type": "array",
18+
"items": {
19+
"type": "string"
20+
}
21+
}
22+
},
23+
"defaultUri": {
24+
"type": "string"
25+
},
26+
"title": {
27+
"type": "string"
28+
}
29+
}
30+
},
31+
"ShowSaveFileDialogParams": {
32+
"type": "object",
33+
"properties": {
34+
"supportedFormats": {
35+
"type": "array",
36+
"items": {
37+
"type": "string"
38+
}
39+
},
40+
"defaultUri": {
41+
"type": "string"
42+
}
43+
}
44+
},
45+
"ShowSaveFileDialogResult": {
46+
"type": "object",
47+
"required": ["targetUri"],
48+
"properties": {
49+
"targetUri": {
50+
"type": "string"
51+
}
52+
}
53+
}
54+
}

0 commit comments

Comments
 (0)