Skip to content

Commit 78c065d

Browse files
authored
feat(core)!: 删除 Java/Maven/JDT 特判与契约专属死命令,run/start 临时文件支持 base64 (#23)
* feat(core)!: 删除 Java/Maven/JDT 特判与契约专属死命令,run/start 临时文件支持 base64 Core 对 Java 等语言零依赖、零特判,语言和工具专属知识全部由插件注入。 - 删除 execution.planLaunchCommand(JDK @argfile 规划)及 execution/launch_plan.rs - 删除 LSP 内置语言目录:lsp/languages/catalog.rs、resources/lsp/language-providers.json、 FFI lithe_core_lsp_provider_catalog_json 与头文件声明 - 删除 tree-sitter、tree-sitter-java 依赖 - 删除 lithe-ide-host 目录里的 Java/Maven 工具 - 删除只存在于契约、fixture、测试中的 23 个命令名(java.*、lsp.jdt*、maven.*、 mybatis.index、spring.index、runConfig.selectJava、build.languageImport、 agent.attachments.retentionPlan)及其 fixture - 删除 maven-launch-context-v1、maven-portable-configuration-v1、run-configuration-v1 schema - run/start 的 temporaryFiles 增加 {name, base64} 字节文件,宿主原样写入 - 模板 ${field.<id>.major} 取第一个数字分量,不再特判 1.x - 旧版工具链 pin 的条目改为不透明字符串记录,不再点名 javaHome - 契约文档和测试 fixture 去掉 Java/Maven/JDT 专属内容 Refs 1lck/Lithe-IDEA#1856, 1lck/Lithe-IDEA#1857, 1lck/Lithe-IDEA#1858, 1lck/Lithe-IDEA#1853 * docs(plugins): 协议更新记录补上 #23 * test(run): 契约 fixture 覆盖 temporaryFiles base64 的拒绝用例 run-start.json 增加三条拒绝用例:同时给出 contents 和 base64、两者都不给、 base64 不是标准编码。Core 的 fixture 回放测试改为传入临时目录, 让这些用例走到逐项校验,而不是停在缺少临时目录。
1 parent 65cf823 commit 78c065d

124 files changed

Lines changed: 717 additions & 7799 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎rust/Cargo.lock‎

Lines changed: 0 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎rust/contracts/application-boundary.md‎

Lines changed: 17 additions & 355 deletions
Large diffs are not rendered by default.

‎rust/contracts/ide-api/v1.md‎

Lines changed: 14 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -101,47 +101,34 @@ configuration values, never portable workspace identifiers.
101101
| Tool | Arguments | Permission | Result |
102102
| --- | --- | --- | --- |
103103
| `lithe_project_inspect` | none | read | workspace identity, name, permissions and available readiness state |
104-
| `lithe_environment_inspect` | none | read | project-local `settings`, `discovered`, and `effective` toolchains |
105-
| `lithe_environment_configure` | optional `javaHomePath`, `mavenExecutablePath`, `mavenJavaHomePath`, `settingsPath`, `localRepositoryPath` | configure | persisted/effective settings or explicit failure; omitted settings are preserved |
106-
| `lithe_maven_inspect` | none | read | project/modules, profiles, skip-tests and reload/error state |
107-
| `lithe_maven_configure` | optional `profiles`, `skipTests` | configure | saved profiles and reload state |
108-
| `lithe_maven_reload` | none | execute | outcome of existing project/Java synchronization |
109104
| `lithe_build_inspect` | none | read | detected plugin instances, declarations and current model identities |
110105
| `lithe_build_reload` | `instanceID` | execute | model reload requested; inspect until model state is ready |
111106
| `lithe_build_configure` | `instanceID`, `optionID`, `value` (string, boolean, string list or null) | configure | checked persisted option and reload state; null resets the declared option |
112107
| `lithe_build_execute` | `instanceID`, `taskID`, optional `projectID`, `targetID`, `modelTaskID`, `userArguments` | execute | `operationID` for the same Build execution shown by the IDE |
113-
| `lithe_maven_execute` | `goals`, optional `modulePath` | execute | Windows current Maven execution; unavailable on macOS |
114108
| `lithe_run_list` | none | read | project configurations with IDs, names, providers and readiness |
115109
| `lithe_run_start` | `configurationID` | execute | `operationID` after launch; failure if launch was refused |
116110
| `lithe_run_restart` | `operationID` | execute | replacement execution's `operationID` |
117111
| `lithe_operations_list` | none | read | retained Build/Run operations and status, without log bodies |
118112
| `lithe_operation_output` | `operationID`, optional opaque `cursor` | read | state, nullable exitCode, bounded output and cursor |
119113
| `lithe_operation_stop` | `operationID` | execute | stop request for that exact execution |
120114

121-
Empty configuration paths restore automatic selection. macOS does not serve
122-
`lithe_environment_inspect`, `lithe_environment_configure` or any `lithe_maven_*`
123-
tool: toolchains and build tools belong to plugins there, so an agent reads and
124-
sets their options through `lithe_build_inspect` / `lithe_build_configure` on the
125-
plugin's Build instance, and native XML uses its explicit configuration
126-
workflow. Windows still serves the environment tools, including `settingsPath`
127-
and `localRepositoryPath`, which require a loaded Maven project. An open unsaved
128-
settings draft or an in-progress save returns `BUSY`; the Agent cannot reset
129-
that draft or save unrelated edits. Source read failures remain failures and
130-
never become automatic tool selection.
115+
The catalog has no language- or tool-specific capability. Toolchains and build
116+
tools belong to plugins, so an agent reads and sets their options through
117+
`lithe_build_inspect` / `lithe_build_configure` on the plugin's Build instance,
118+
and a tool-native configuration file uses its explicit configuration workflow.
131119
Configuration writes use the existing platform stores;
132120
they are not a transaction across multiple settings documents. An error can follow
133121
a partial save, so inspect settings before retrying. Credentials, full launch
134122
environment values and command arguments are not included in run configuration
135-
listing. Toolchain discovery uses existing installed tools; it does not install
136-
or download a JDK or Maven. Maven execution may download dependencies or execute
137-
plugins, and is therefore an execute capability.
123+
listing. Build execution may download dependencies or execute project code, and
124+
is therefore an execute capability.
138125

139126
On macOS, build execution uses the enabled plugin's detected instance and task
140127
identities. Read them with `lithe_build_inspect`; model project, target and task
141128
selectors require a loaded, current model and are resolved again for each call.
142129
A model task also requires its declaring template and project. Arguments remain
143130
an array of tokens all the way to the Provider; the host does not reinterpret
144-
Maven goals, construct a command string or use the old Maven execution service.
131+
them or construct a command string.
145132
`lithe_build_inspect` also returns each option's ID, kind, effective value, source,
146133
choices and allowCustom, plus native-configuration availability. `lithe_build_configure`
147134
validates one value with the same current instance/model used by the native option
@@ -155,15 +142,12 @@ stale Provider work and invalidate native drafts, models and language import.
155142
The same effective Build options, configured tool resolver and workspace Provider
156143
serve UI and Agent calls. An active Build execution returns `BUSY`.
157144

158-
macOS exposes the four plugin Build tools and removes all four Maven-specific
159-
tools from discovery and admission. Windows connects Build inspect, reload, configure and
160-
execute to its existing workspace-owned Provider controller, alongside the four
161-
Maven tools whose current consumers are still being migrated. Detection reads
145+
Both products expose the four plugin Build tools. Windows connects Build inspect,
146+
reload, configure and execute to its existing workspace-owned Provider controller. Detection reads
162147
only admitted declarations and saved options. Product Build capability admission
163148
remains closed; exposing an implemented API does not admit a plugin requiring
164149
unimplemented capabilities. Windows configure shares the explicit native UI save path, persists machine-local workspace overrides, checks team/local source revisions and re-detects after publication. Null restores team/declaration inheritance; it does not edit a tool-native configuration file.
165-
An unexposed call returns `NOT_SUPPORTED` before native execution. The complete
166-
Maven project, settings and Run migration remains pending outside these Agent paths.
150+
An unexposed call returns `NOT_SUPPORTED` before native execution.
167151

168152
Windows requires a complete, current model before executing a task. Reload uses
169153
the existing model preparation and returns immediately; inspect reports its state.
@@ -178,7 +162,7 @@ prevents new starts; already accepted work remains owned by the product workspac
178162
whose close/plugin lifecycle cancels it and waits for cleanup.
179163

180164
Run operates on saved project configurations, not the currently focused editor
181-
file. Existing Java build decisions are still shown in the IDE; the API never
165+
file. Pending build decisions are still shown in the IDE; the API never
182166
silently answers them. Output is retained only as long as its existing IDE output
183167
slot: replacing a run, removing its tab, or closing the workspace may expire an
184168
operation. Callers receive `OPERATION_EXPIRED`, never another run's output.
@@ -224,9 +208,9 @@ surface; it does not introduce a new plugin marketplace, sandbox or UI extension
224208
- `cargo test --manifest-path rust/Cargo.toml -p lithe-ide-host`
225209
- `cargo build --manifest-path rust/Cargo.toml -p lithe-ide-host --features mcp --bin lithe-mcp`
226210
- `node --test scripts/ide-mcp/test-ide-mcp.mjs`
227-
- Windows: the host-api, Maven, run and project-environment frontend tests, plus a
228-
native packaged run using the generated client configuration.
211+
- Windows: the host-api and run frontend tests, plus a native packaged run using
212+
the generated client configuration.
229213
- macOS: `IdeCapabilitiesTests`, followed by a packaged native run.
230-
- Both platforms: configure JDK/Maven, reload, execute Maven, start a configuration,
214+
- Both platforms: configure a plugin Build option, reload, execute a Build task, start a configuration,
231215
read incremental output, restart, reject the old ID, stop, revoke, and close the
232216
project. Confirm installed resource manifests/hashes remain unchanged.

‎rust/contracts/maven-launch-context-v1.schema.json‎

Lines changed: 0 additions & 21 deletions
This file was deleted.

‎rust/contracts/maven-portable-configuration-v1.schema.json‎

Lines changed: 0 additions & 22 deletions
This file was deleted.

‎rust/contracts/run-configuration-v1.schema.json‎

Lines changed: 0 additions & 48 deletions
This file was deleted.

‎rust/contracts/run-configuration-v2.schema.json‎

Lines changed: 3 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -24,41 +24,11 @@
2424
},
2525
"toolchain": {
2626
"type": "object",
27-
"description": "Machine-local project toolchain defaults. Stored only in the local layer; non-empty per-configuration paths override matching defaults.",
27+
"description": "Machine-local project toolchain state. Stored only in the local layer. Core reads and replaces only `preferences`; other fields belong to whichever host or plugin wrote them and are preserved unchanged.",
2828
"properties": {
29-
"preferences": { "$ref": "toolchain-consumer-preferences-v1.schema.json" },
30-
"java": {
31-
"type": "object",
32-
"properties": {
33-
"homePath": { "type": "string" }
34-
},
35-
"additionalProperties": false
36-
},
37-
"maven": {
38-
"type": "object",
39-
"properties": {
40-
"executablePath": { "type": "string" },
41-
"javaHomePath": { "type": "string" }
42-
},
43-
"additionalProperties": false
44-
},
45-
"pathOverrides": {
46-
"type": "object",
47-
"description": "Machine-local subproject selections, keyed by normalized workspace-relative root. Empty fields inherit project defaults. Hosts preserve the map when saving individual run configurations.",
48-
"maxProperties": 256,
49-
"propertyNames": { "type": "string", "minLength": 1, "maxLength": 1024, "pattern": "^(?!/)(?!.*//)(?!.*/$)(?!.*(?:^|/)(?:\\.|\\.\\.)(?:/|$))[^\\\\:\\x00-\\x1f\\x7f]+$" },
50-
"additionalProperties": {
51-
"type": "object",
52-
"additionalProperties": false,
53-
"properties": {
54-
"javaHomePath": { "type": "string", "maxLength": 4096 },
55-
"mavenExecutablePath": { "type": "string", "maxLength": 4096 },
56-
"mavenJavaHomePath": { "type": "string", "maxLength": 4096 }
57-
}
58-
}
59-
}
29+
"preferences": { "$ref": "toolchain-consumer-preferences-v1.schema.json" }
6030
},
61-
"additionalProperties": false
31+
"additionalProperties": true
6232
},
6333
"configurations": {
6434
"type": "array",
@@ -235,13 +205,6 @@
235205
"extensions": {
236206
"type": "object",
237207
"propertyNames": { "type": "string", "pattern": "^[a-z][a-z0-9-]*$" },
238-
"properties": {
239-
"java": { "type": "object", "properties": {
240-
"build": { "$ref": "#/$defs/buildProjectReference" },
241-
"module": { "type": "string" },
242-
"mainClass": { "type": ["string", "null"] }
243-
} }
244-
},
245208
"additionalProperties": { "type": "object" }
246209
},
247210
"disabled": { "type": "boolean" },

0 commit comments

Comments
 (0)