Skip to content

Sync lmstudio.js schema (2025-07-08) #118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 18 additions & 0 deletions misc/update-sdk-schema.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

# See http://redsymbol.net/articles/unofficial-bash-strict-mode/ for benefit of these options
set -euo pipefail
IFS=$'\n\t'

# Note: `readlink -f` (long available in GNU coreutils) is available on macOS 12.3 and later
script_dir="$(cd -- "$(dirname -- "$(readlink -f "${BASH_SOURCE[0]}")")" &> /dev/null && pwd)"

# Update submodule to tip of the lmstudio-js main branch and regenerate the exported schema
# (to incorporate Python data model template changes, just run `tox -e sync-sdk-schema`)

pushd "$script_dir/../sdk-schema/lmstudio-js" || exit 1
git switch main
git pull
git submodule update --init --recursive
popd || exit 1
tox -e sync-sdk-schema -- --regen-schema
119 changes: 67 additions & 52 deletions sdk-schema/lms-with-inferred-unions.json
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,21 @@
"propertyName": "type"
}
},
"toolCallResult": {
"type": "object",
"properties": {
"content": {
"type": "string"
},
"toolCallId": {
"type": "string"
}
},
"required": [
"content"
],
"additionalProperties": false
},
"citationSource": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -1992,35 +2007,6 @@
"propertyName": "type"
}
},
"preprocessorUpdate": {
"anyOf": [
{
"$ref": "#/definitions/processingUpdateStatusCreate"
},
{
"$ref": "#/definitions/processingUpdateStatusUpdate"
},
{
"$ref": "#/definitions/processingUpdateStatusRemove"
},
{
"$ref": "#/definitions/processingUpdateCitationBlockCreate"
},
{
"$ref": "#/definitions/processingUpdateDebugInfoBlockCreate"
}
],
"discriminator": {
"mapping": {
"status.create": "#/definitions/processingUpdateStatusCreate",
"status.update": "#/definitions/processingUpdateStatusUpdate",
"status.remove": "#/definitions/processingUpdateStatusRemove",
"citationBlock.create": "#/definitions/processingUpdateCitationBlockCreate",
"debugInfoBlock.create": "#/definitions/processingUpdateDebugInfoBlockCreate"
},
"propertyName": "type"
}
},
"processingRequestConfirmToolCall": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -2895,6 +2881,35 @@
},
"additionalProperties": false
},
"promptPreprocessorUpdate": {
"anyOf": [
{
"$ref": "#/definitions/processingUpdateStatusCreate"
},
{
"$ref": "#/definitions/processingUpdateStatusUpdate"
},
{
"$ref": "#/definitions/processingUpdateStatusRemove"
},
{
"$ref": "#/definitions/processingUpdateCitationBlockCreate"
},
{
"$ref": "#/definitions/processingUpdateDebugInfoBlockCreate"
}
],
"discriminator": {
"mapping": {
"status.create": "#/definitions/processingUpdateStatusCreate",
"status.update": "#/definitions/processingUpdateStatusUpdate",
"status.remove": "#/definitions/processingUpdateStatusRemove",
"citationBlock.create": "#/definitions/processingUpdateCitationBlockCreate",
"debugInfoBlock.create": "#/definitions/processingUpdateDebugInfoBlockCreate"
},
"propertyName": "type"
}
},
"modelCompatibilityType": {
"type": "string",
"enum": [
Expand Down Expand Up @@ -6064,52 +6079,52 @@
],
"additionalProperties": false
},
"plugins/channel/setPreprocessor/toClientPacket": {
"plugins/channel/setPromptPreprocessor/toClientPacket": {
"anyOf": [
{
"$ref": "#/definitions/plugins/channel/setPreprocessor/toClientPacketPreprocess"
"$ref": "#/definitions/plugins/channel/setPromptPreprocessor/toClientPacketPreprocess"
},
{
"$ref": "#/definitions/plugins/channel/setPreprocessor/toClientPacketAbort"
"$ref": "#/definitions/plugins/channel/setPromptPreprocessor/toClientPacketAbort"
}
],
"discriminator": {
"mapping": {
"preprocess": "#/definitions/plugins/channel/setPreprocessor/toClientPacketPreprocess",
"abort": "#/definitions/plugins/channel/setPreprocessor/toClientPacketAbort"
"preprocess": "#/definitions/plugins/channel/setPromptPreprocessor/toClientPacketPreprocess",
"abort": "#/definitions/plugins/channel/setPromptPreprocessor/toClientPacketAbort"
},
"propertyName": "type"
}
},
"plugins/channel/setPreprocessor/toServerPacket": {
"plugins/channel/setPromptPreprocessor/toServerPacket": {
"anyOf": [
{
"$ref": "#/definitions/plugins/channel/setPreprocessor/toServerPacketComplete"
"$ref": "#/definitions/plugins/channel/setPromptPreprocessor/toServerPacketComplete"
},
{
"$ref": "#/definitions/plugins/channel/setPreprocessor/toServerPacketAborted"
"$ref": "#/definitions/plugins/channel/setPromptPreprocessor/toServerPacketAborted"
},
{
"$ref": "#/definitions/plugins/channel/setPreprocessor/toServerPacketError"
"$ref": "#/definitions/plugins/channel/setPromptPreprocessor/toServerPacketError"
}
],
"discriminator": {
"mapping": {
"complete": "#/definitions/plugins/channel/setPreprocessor/toServerPacketComplete",
"aborted": "#/definitions/plugins/channel/setPreprocessor/toServerPacketAborted",
"error": "#/definitions/plugins/channel/setPreprocessor/toServerPacketError"
"complete": "#/definitions/plugins/channel/setPromptPreprocessor/toServerPacketComplete",
"aborted": "#/definitions/plugins/channel/setPromptPreprocessor/toServerPacketAborted",
"error": "#/definitions/plugins/channel/setPromptPreprocessor/toServerPacketError"
},
"propertyName": "type"
}
},
"pseudo/plugins/channel/setPreprocessor": {
"pseudo/plugins/channel/setPromptPreprocessor": {
"type": "object",
"properties": {
"toClientPacket": {
"$ref": "#/definitions/plugins/channel/setPreprocessor/toClientPacket"
"$ref": "#/definitions/plugins/channel/setPromptPreprocessor/toClientPacket"
},
"toServerPacket": {
"$ref": "#/definitions/plugins/channel/setPreprocessor/toServerPacket"
"$ref": "#/definitions/plugins/channel/setPromptPreprocessor/toServerPacket"
}
},
"required": [
Expand Down Expand Up @@ -6366,8 +6381,8 @@
"channelRegisterDevelopmentPlugin": {
"$ref": "#/definitions/pseudo/plugins/channel/registerDevelopmentPlugin"
},
"channelSetPreprocessor": {
"$ref": "#/definitions/pseudo/plugins/channel/setPreprocessor"
"channelSetPromptPreprocessor": {
"$ref": "#/definitions/pseudo/plugins/channel/setPromptPreprocessor"
},
"channelSetPredictionLoopHandler": {
"$ref": "#/definitions/pseudo/plugins/channel/setPredictionLoopHandler"
Expand All @@ -6393,7 +6408,7 @@
"rpcSetGlobalConfigSchematics",
"rpcPluginInitCompleted",
"channelRegisterDevelopmentPlugin",
"channelSetPreprocessor",
"channelSetPromptPreprocessor",
"channelSetPredictionLoopHandler",
"channelSetToolsProvider",
"channelSetGenerator"
Expand Down Expand Up @@ -9299,7 +9314,7 @@
],
"additionalProperties": false
},
"plugins/channel/setPreprocessor/toClientPacketPreprocess": {
"plugins/channel/setPromptPreprocessor/toClientPacketPreprocess": {
"type": "object",
"properties": {
"type": {
Expand Down Expand Up @@ -9349,7 +9364,7 @@
],
"additionalProperties": false
},
"plugins/channel/setPreprocessor/toClientPacketAbort": {
"plugins/channel/setPromptPreprocessor/toClientPacketAbort": {
"type": "object",
"properties": {
"type": {
Expand All @@ -9368,7 +9383,7 @@
],
"additionalProperties": false
},
"plugins/channel/setPreprocessor/toServerPacketComplete": {
"plugins/channel/setPromptPreprocessor/toServerPacketComplete": {
"type": "object",
"properties": {
"type": {
Expand All @@ -9391,7 +9406,7 @@
],
"additionalProperties": false
},
"plugins/channel/setPreprocessor/toServerPacketAborted": {
"plugins/channel/setPromptPreprocessor/toServerPacketAborted": {
"type": "object",
"properties": {
"type": {
Expand All @@ -9410,7 +9425,7 @@
],
"additionalProperties": false
},
"plugins/channel/setPreprocessor/toServerPacketError": {
"plugins/channel/setPromptPreprocessor/toServerPacketError": {
"type": "object",
"properties": {
"type": {
Expand Down
69 changes: 42 additions & 27 deletions sdk-schema/lms.json
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,21 @@
}
]
},
"toolCallResult": {
"type": "object",
"properties": {
"content": {
"type": "string"
},
"toolCallId": {
"type": "string"
}
},
"required": [
"content"
],
"additionalProperties": false
},
"citationSource": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -2421,25 +2436,6 @@
}
]
},
"preprocessorUpdate": {
"anyOf": [
{
"$ref": "#/definitions/processingUpdateStatusCreate"
},
{
"$ref": "#/definitions/processingUpdateStatusUpdate"
},
{
"$ref": "#/definitions/processingUpdateStatusRemove"
},
{
"$ref": "#/definitions/processingUpdateCitationBlockCreate"
},
{
"$ref": "#/definitions/processingUpdateDebugInfoBlockCreate"
}
]
},
"processingRequestConfirmToolCall": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -3379,6 +3375,25 @@
},
"additionalProperties": false
},
"promptPreprocessorUpdate": {
"anyOf": [
{
"$ref": "#/definitions/processingUpdateStatusCreate"
},
{
"$ref": "#/definitions/processingUpdateStatusUpdate"
},
{
"$ref": "#/definitions/processingUpdateStatusRemove"
},
{
"$ref": "#/definitions/processingUpdateCitationBlockCreate"
},
{
"$ref": "#/definitions/processingUpdateDebugInfoBlockCreate"
}
]
},
"modelCompatibilityType": {
"type": "string",
"enum": [
Expand Down Expand Up @@ -7268,7 +7283,7 @@
],
"additionalProperties": false
},
"plugins/channel/setPreprocessor/toClientPacket": {
"plugins/channel/setPromptPreprocessor/toClientPacket": {
"anyOf": [
{
"type": "object",
Expand Down Expand Up @@ -7337,7 +7352,7 @@
}
]
},
"plugins/channel/setPreprocessor/toServerPacket": {
"plugins/channel/setPromptPreprocessor/toServerPacket": {
"anyOf": [
{
"type": "object",
Expand Down Expand Up @@ -7400,14 +7415,14 @@
}
]
},
"pseudo/plugins/channel/setPreprocessor": {
"pseudo/plugins/channel/setPromptPreprocessor": {
"type": "object",
"properties": {
"toClientPacket": {
"$ref": "#/definitions/plugins/channel/setPreprocessor/toClientPacket"
"$ref": "#/definitions/plugins/channel/setPromptPreprocessor/toClientPacket"
},
"toServerPacket": {
"$ref": "#/definitions/plugins/channel/setPreprocessor/toServerPacket"
"$ref": "#/definitions/plugins/channel/setPromptPreprocessor/toServerPacket"
}
},
"required": [
Expand Down Expand Up @@ -8131,8 +8146,8 @@
"channelRegisterDevelopmentPlugin": {
"$ref": "#/definitions/pseudo/plugins/channel/registerDevelopmentPlugin"
},
"channelSetPreprocessor": {
"$ref": "#/definitions/pseudo/plugins/channel/setPreprocessor"
"channelSetPromptPreprocessor": {
"$ref": "#/definitions/pseudo/plugins/channel/setPromptPreprocessor"
},
"channelSetPredictionLoopHandler": {
"$ref": "#/definitions/pseudo/plugins/channel/setPredictionLoopHandler"
Expand All @@ -8158,7 +8173,7 @@
"rpcSetGlobalConfigSchematics",
"rpcPluginInitCompleted",
"channelRegisterDevelopmentPlugin",
"channelSetPreprocessor",
"channelSetPromptPreprocessor",
"channelSetPredictionLoopHandler",
"channelSetToolsProvider",
"channelSetGenerator"
Expand Down
2 changes: 1 addition & 1 deletion sdk-schema/lmstudio-js
Submodule lmstudio-js updated 83 files
+1 −0 .gitignore
+1 −0 .nvmrc
+271 −93 package-lock.json
+20 −21 package.json
+1 −1 packages/lms-cli
+9 −8 packages/lms-client/package.json
+17 −14 packages/lms-client/src/Chat.ts
+24 −6 packages/lms-client/src/LMStudioClient.ts
+3 −3 packages/lms-client/src/PluginContext.ts
+5 −5 packages/lms-client/src/customConfig.ts
+10 −7 packages/lms-client/src/files/FilesNamespace.ts
+2 −1 packages/lms-client/src/files/ParseDocumentOpts.ts
+2 −1 packages/lms-client/src/files/ParseDocumentResult.ts
+4 −3 packages/lms-client/src/index.ts
+2 −1 packages/lms-client/src/llm/GeneratorPredictionResult.ts
+157 −8 packages/lms-client/src/llm/LLMDynamicHandle.ts
+6 −3 packages/lms-client/src/llm/LLMGeneratorHandle.ts
+2 −1 packages/lms-client/src/llm/LLMNamespace.ts
+2 −1 packages/lms-client/src/llm/OngoingGeneratorPrediction.ts
+4 −10 packages/lms-client/src/llm/PredictionResult.ts
+27 −0 packages/lms-client/src/llm/ToolCallRequestError.ts
+14 −32 packages/lms-client/src/llm/act.ts
+4 −4 packages/lms-client/src/llm/tool.ts
+798 −0 packages/lms-client/src/plugins/PluginSelfRegistrationHost.ts
+13 −770 packages/lms-client/src/plugins/PluginsNamespace.ts
+2 −1 packages/lms-client/src/plugins/processing/BaseController.ts
+2 −1 packages/lms-client/src/plugins/processing/GeneratorController.ts
+0 −14 packages/lms-client/src/plugins/processing/Preprocessor.ts
+6 −4 packages/lms-client/src/plugins/processing/ProcessingController.ts
+14 −0 packages/lms-client/src/plugins/processing/PromptPreprocessor.ts
+2 −1 packages/lms-client/src/plugins/processing/ToolsProviderController.ts
+4 −2 packages/lms-client/src/repository/ArtifactDownloadPlanner.ts
+12 −6 packages/lms-client/src/repository/RepositoryNamespace.ts
+5 −4 packages/lms-common-server/package.json
+6 −5 packages/lms-common/package.json
+6 −2 packages/lms-common/src/text.ts
+7 −6 packages/lms-communication-client/package.json
+9 −0 packages/lms-communication-client/src/ClientPort.ts
+33 −11 packages/lms-communication-client/src/WsClientTransport.ts
+7 −6 packages/lms-communication-mock/package.json
+6 −5 packages/lms-communication-server/package.json
+4 −0 packages/lms-communication-server/src/ServerPort.ts
+5 −4 packages/lms-communication/package.json
+12 −0 packages/lms-communication/src/Transport.ts
+6 −5 packages/lms-es-plugin-runner/package.json
+14 −12 packages/lms-es-plugin-runner/src/generateEntryFile.ts
+8 −7 packages/lms-external-backend-interfaces/package.json
+1 −1 packages/lms-external-backend-interfaces/src/pluginsBackendInterface.ts
+4 −3 packages/lms-isomorphic/package.json
+7 −6 packages/lms-json-schema/package.json
+5 −4 packages/lms-kv-config/package.json
+1 −1 packages/lms-kv-config/src/KVConfig.ts
+5 −2 packages/lms-kv-config/src/index.ts
+88 −55 packages/lms-kv-config/src/valueTypes.ts
+6 −5 packages/lms-lmstudio/package.json
+4 −3 packages/lms-shared-types/package.json
+14 −8 packages/lms-shared-types/src/ChatHistoryData.ts
+4 −2 packages/lms-shared-types/src/files/DocumentParsingOpts.ts
+6 −4 packages/lms-shared-types/src/index.ts
+0 −2 packages/lms-shared-types/src/llm/LLMApplyPromptTemplateOpts.ts
+4 −2 packages/lms-shared-types/src/llm/processing/ProcessingRequest.ts
+3 −3 packages/lms-shared-types/src/llm/processing/PromptPreprocessorUpdate.ts
+8 −4 packages/lms-shared-types/src/repository/ArtifactDownloadPlan.ts
+5 −3 packages/template/package.json
+5 −4 publish/cli/package.json
+3 −3 publish/lms/package.json
+5 −5 publish/lmstudio/package.json
+10 −6 publish/sdk/package.json
+4 −3 publish/sdk/src/exportedTypes.ts
+1 −0 publish/sdk/src/index.ts
+3 −3 scaffolds/node-javascript-empty/package.json
+3 −3 scaffolds/node-javascript/package.json
+3 −3 scaffolds/node-typescript-empty/package.json
+0 −2 scaffolds/node-typescript-preprocessor/.gitignore
+0 −36 scaffolds/node-typescript-preprocessor/README.md
+0 −2 scaffolds/node-typescript-preprocessor/gitignore_template
+0 −26 scaffolds/node-typescript-preprocessor/lms-scaffold.json
+0 −21 scaffolds/node-typescript-preprocessor/package.json
+0 −19 scaffolds/node-typescript-preprocessor/src/index.ts
+0 −15 scaffolds/node-typescript-preprocessor/tsconfig.json
+3 −3 scaffolds/node-typescript/package.json
+0 −47 scripts/starter.mjs
+22 −0 turbo.json
Loading