@magpie-community/opencode-workbuddy-auth 0.2.4 → 0.2.5

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 (3) hide show
  1. package/README.md +3 -0
  2. package/index.mjs +7 -3
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -249,6 +249,9 @@ instead of passing it to the agent as an answer. Only text that is still
249
249
  the filter's line is held, so any other reply's words go as they come; the
250
250
  same words ending `stop`, or the filter cutting off a reply after other
251
251
  words, go through as they came.
252
+ copilot.tencent.com sends the line with a newline on each side
253
+ (`"\nSorry, I can't respond to this question.\n"`); since 0.2.5 white
254
+ space around it no longer lets it through.
252
255
 
253
256
  ## Models
254
257
 
package/index.mjs CHANGED
@@ -1605,10 +1605,14 @@ function renamed(res, names) {
1605
1605
  // no output tokens counted (itspig, plugins #540).
1606
1606
  const FILTER_SAYS = ["Sorry, I can't respond to this question."]
1607
1607
 
1608
- // filterSaid tells whether text said so far may still be FILTER_SAYS.
1608
+ // filterSaid tells whether text said so far may still be FILTER_SAYS, with
1609
+ // white space on either side: copilot.tencent.com sends it as
1610
+ // "\nSorry, I can't respond to this question.\n" (itspig, plugins #540).
1611
+ // Text that is only white space so far may still be it; text that goes on
1612
+ // past it is not.
1609
1613
  const filterSaid = (text) => {
1610
- const t = text.replace(/’/g, "'").trimStart()
1611
- return t !== "" && FILTER_SAYS.some((s) => s.startsWith(t))
1614
+ const t = text.replace(/’/g, "'").trim()
1615
+ return FILTER_SAYS.some((s) => s.startsWith(t))
1612
1616
  }
1613
1617
 
1614
1618
  // unsaid is a streamed chat whose reply WorkBuddy's filter refused with its
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magpie-community/opencode-workbuddy-auth",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "OpenCode provider plugins for WorkBuddy's plans: WorkBuddy (CodeBuddy, copilot.tencent.com) and WorkBuddy AI (www.workbuddy.ai)",
5
5
  "type": "module",
6
6
  "main": "./index.mjs",