feat: DSML tool-call recovery plugin for OpenCode V2

Recovers DeepSeek DSML tool calls that leak as assistant text: streaming
middleware (AI-SDK path), SSE rewrite (native path), history sanitization,
preventive directive, conditional system nudge, and a capped idle watchdog.
116 tests, synthetic golden fixtures.
This commit is contained in:
bendtherules
2026-10-05 11:47:57 +05:30
commit 52b7776d5a
26 changed files with 4600 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
{
"$schema": "https://json.schemastore.org/package.json",
"name": "opencode-plugin-dsml-fix",
"version": "0.1.0",
"type": "module",
"license": "MIT",
"description": "OpenCode V2 plugin that recovers DeepSeek DSML tool calls leaked as assistant text",
"exports": {
".": "./src/index.ts"
},
"files": [
"src"
],
"scripts": {
"test": "bun test",
"typecheck": "tsgo --noEmit",
"check": "bun run typecheck && bun test"
},
"dependencies": {
"@ai-sdk/provider": "^3.0.8"
},
"devDependencies": {
"@opencode/plugin": "2.0.22",
"bun-types": "latest",
"typescript": "^5.6.0"
}
}