@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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/patch.cjs +5 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ch4acko3/dsh-turn-fold",
3
- "version": "0.6.5",
3
+ "version": "0.6.6",
4
4
  "description": "Codex-style turn folding for the DSH WebUI conversation, implemented as a dsh-harmony provider.",
5
5
  "main": "./index.mjs",
6
6
  "engines": {
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 => call.expression.getText(sourceFile) === 'renderSlot' && call.arguments[0]?.getText(sourceFile) === '"conversation.chat.flow"')
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, ')