@ch4acko3/dsh-turn-fold 0.6.5 → 0.6.6
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/package.json +1 -1
- package/patch.cjs +5 -2
package/package.json
CHANGED
package/patch.cjs
CHANGED
|
@@ -154,9 +154,12 @@ function createPatches(version) {
|
|
|
154
154
|
function dsh021Patches(version) {
|
|
155
155
|
return commonPatches(target('@deepseek-ai/dsh-client-ui-chat', '>=0.2.1-alpha.2 <0.3.0-0'), {
|
|
156
156
|
select: 'FunctionExpression[name.name="ChatFlow"]',
|
|
157
|
-
apply({ node, sourceFile, edit, query }) {
|
|
157
|
+
apply({ node, sourceFile, edit, query, ts }) {
|
|
158
158
|
const rows = query('CallExpression[expression.name.name="map"][expression.expression.name="entries"]', node)
|
|
159
|
-
const flow = query('CallExpression').filter(call =>
|
|
159
|
+
const flow = query('CallExpression').filter(call => {
|
|
160
|
+
const slot = call.arguments[0]
|
|
161
|
+
return call.expression.getText(sourceFile) === 'renderSlot' && slot && ts.isStringLiteralLike(slot) && slot.text === 'conversation.chat.flow'
|
|
162
|
+
})
|
|
160
163
|
if (rows.length !== 1 || flow.length !== 1) throw new Error('@ch4acko3/dsh-turn-fold: expected one ChatFlow render loop and slot')
|
|
161
164
|
const parameters = node.parameters[0].name
|
|
162
165
|
edit.prependLeft(parameters.getStart(sourceFile) + 1, 'sessionId, ')
|