dsh-code-index 0.6.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/README.md +55 -6
- package/README.zh.md +35 -6
- package/dist/client.js +76 -20
- package/dist/client.js.map +1 -1
- package/dist/index.js +802 -107
- package/dist/index.js.map +1 -1
- package/package.json +8 -5
- package/scripts/release-smoke.mjs +67 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-code-index",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.8.0",
|
|
4
|
+
"description": "Project-aware live structural context engine for DSH agents — isolated workspace indexes, task-aware context, and fresh repo maps.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
53
|
-
"@deepseek-ai/dsh-tools": ">=0.1.0-rc.1 <0.2.0-0"
|
|
53
|
+
"@deepseek-ai/dsh-tools": ">=0.0.1-rc.1 <0.1.0 || >=0.1.0-rc.1 <0.2.0-0"
|
|
54
54
|
},
|
|
55
55
|
"peerDependenciesMeta": {
|
|
56
56
|
"@deepseek-ai/cordis": {
|
|
@@ -58,7 +58,8 @@
|
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@deepseek-ai/
|
|
61
|
+
"@deepseek-ai/cordis": "4.0.4",
|
|
62
|
+
"@deepseek-ai/dsh-tools": "0.1.7-alpha.2",
|
|
62
63
|
"@types/node": "^26.2.0",
|
|
63
64
|
"@types/react": "^18.3.31",
|
|
64
65
|
"react": "^18.3.1",
|
|
@@ -79,7 +80,9 @@
|
|
|
79
80
|
"url": "https://github.com/lemonxiny55/dsh-code-index/issues"
|
|
80
81
|
},
|
|
81
82
|
"dependencies": {
|
|
82
|
-
"@deepseek-ai/schemastery": "^3.18.
|
|
83
|
+
"@deepseek-ai/schemastery": "^3.18.4",
|
|
84
|
+
"chokidar": "4.0.3",
|
|
85
|
+
"ignore": "7.0.5",
|
|
83
86
|
"tree-sitter-wasms": "^0.1.13",
|
|
84
87
|
"web-tree-sitter": "^0.25.10"
|
|
85
88
|
}
|
|
@@ -27,7 +27,43 @@ function run(command, args, cwd) {
|
|
|
27
27
|
})
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
function parseJsonArrayOutput(output, command) {
|
|
31
|
+
const text = output.replace(/\u001b\[[0-?]*[ -/]*[@-~]/g, '')
|
|
32
|
+
for (let start = 0; start < text.length; start += 1) {
|
|
33
|
+
if (text[start] !== '[') continue
|
|
34
|
+
let depth = 0
|
|
35
|
+
let inString = false
|
|
36
|
+
let escaped = false
|
|
37
|
+
for (let index = start; index < text.length; index += 1) {
|
|
38
|
+
const char = text[index]
|
|
39
|
+
if (inString) {
|
|
40
|
+
if (escaped) escaped = false
|
|
41
|
+
else if (char === '\\') escaped = true
|
|
42
|
+
else if (char === '"') inString = false
|
|
43
|
+
continue
|
|
44
|
+
}
|
|
45
|
+
if (char === '"') {
|
|
46
|
+
inString = true
|
|
47
|
+
continue
|
|
48
|
+
}
|
|
49
|
+
if (char === '[') depth += 1
|
|
50
|
+
else if (char === ']') {
|
|
51
|
+
depth -= 1
|
|
52
|
+
if (depth === 0) {
|
|
53
|
+
try {
|
|
54
|
+
const parsed = JSON.parse(text.slice(start, index + 1))
|
|
55
|
+
if (Array.isArray(parsed)) return parsed
|
|
56
|
+
} catch {
|
|
57
|
+
break
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
throw new Error(`${command} did not return a JSON array`)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const packed = parseJsonArrayOutput(run(npm, ['pack', '--ignore-scripts', '--json'], root), 'npm pack')
|
|
31
67
|
assert.equal(packed.length, 1, 'npm pack must produce exactly one artifact')
|
|
32
68
|
const tarball = path.resolve(root, packed[0].filename)
|
|
33
69
|
const listed = new Set(packed[0].files.map((file) => file.path))
|
|
@@ -85,6 +121,7 @@ try {
|
|
|
85
121
|
'code_map',
|
|
86
122
|
'code_refs',
|
|
87
123
|
'code_change_context',
|
|
124
|
+
'code_context',
|
|
88
125
|
'code_health',
|
|
89
126
|
])
|
|
90
127
|
|
|
@@ -101,9 +138,38 @@ try {
|
|
|
101
138
|
await invoke('code_change_context', { files: ['src/index.ts'], repoRoot: root }),
|
|
102
139
|
/CHANGED:/,
|
|
103
140
|
)
|
|
141
|
+
assert.match(
|
|
142
|
+
await invoke('code_context', {
|
|
143
|
+
task: 'How does plugin loading work?',
|
|
144
|
+
repoRoot: root,
|
|
145
|
+
budgetChars: 5_000,
|
|
146
|
+
}),
|
|
147
|
+
/Task context|Primary symbols:/,
|
|
148
|
+
)
|
|
104
149
|
assert.match(await invoke('code_health', { repoRoot: root }), /repo health/)
|
|
105
150
|
|
|
106
151
|
for (const dispose of disposers.reverse()) dispose()
|
|
152
|
+
|
|
153
|
+
const compactRegistered = []
|
|
154
|
+
const compactDisposers = []
|
|
155
|
+
plugin.apply(
|
|
156
|
+
{
|
|
157
|
+
effect(effect) {
|
|
158
|
+
const disposer = effect()
|
|
159
|
+
if (typeof disposer === 'function') compactDisposers.push(disposer)
|
|
160
|
+
},
|
|
161
|
+
tools: {
|
|
162
|
+
register(tool) {
|
|
163
|
+
compactRegistered.push(tool.name)
|
|
164
|
+
return () => {}
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
systemPrompt: { section: () => () => {} },
|
|
168
|
+
},
|
|
169
|
+
{ autoInject: false, codeHealth: true, toolSurface: 'compact' },
|
|
170
|
+
)
|
|
171
|
+
assert.deepEqual(compactRegistered, ['code_index', 'code_context', 'code_health'])
|
|
172
|
+
for (const dispose of compactDisposers.reverse()) dispose()
|
|
107
173
|
console.log(`release smoke passed for ${packageJson.name}@${packageJson.version}`)
|
|
108
174
|
} finally {
|
|
109
175
|
rmSync(smokeDir, { recursive: true, force: true })
|