@ssamurias/dsh-fish 0.9.7 → 0.9.9

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 (68) hide show
  1. package/AGENTS.md +5 -4
  2. package/CHANGELOG.md +177 -0
  3. package/README.md +7 -2
  4. package/RELEASE-NOTES-0.8.3.md +71 -71
  5. package/RELEASE-NOTES-0.9.8.md +216 -0
  6. package/RELEASE-NOTES-0.9.9.md +163 -0
  7. package/RELEASE.md +3 -1
  8. package/lib/appoint.js +21 -7
  9. package/lib/askinchat.js +6 -1
  10. package/lib/at.js +240 -0
  11. package/lib/backup.js +15 -2
  12. package/lib/bili.js +36 -0
  13. package/lib/browse.js +15 -5
  14. package/lib/capture.js +20 -6
  15. package/lib/cardanswer.js +12 -2
  16. package/lib/channels.js +15 -0
  17. package/lib/client.js +127 -27
  18. package/lib/comment.js +19 -2
  19. package/lib/curiosity.js +3 -3
  20. package/lib/deliver.js +4 -0
  21. package/lib/derive.js +265 -23
  22. package/lib/desk.js +3 -2
  23. package/lib/dream.js +3 -1
  24. package/lib/echo.js +75 -0
  25. package/lib/events.js +96 -2
  26. package/lib/gapwall.js +3 -1
  27. package/lib/generator.js +10 -0
  28. package/lib/grant.js +3 -2
  29. package/lib/guardlog.js +58 -0
  30. package/lib/health.js +102 -0
  31. package/lib/herdiary.js +155 -11
  32. package/lib/home.js +28 -4
  33. package/lib/identity.js +18 -2
  34. package/lib/index.js +63 -16
  35. package/lib/locate.js +40 -1
  36. package/lib/log.js +58 -4
  37. package/lib/material.js +122 -0
  38. package/lib/move.js +147 -14
  39. package/lib/note.js +19 -3
  40. package/lib/observe.js +100 -27
  41. package/lib/pair.js +95 -0
  42. package/lib/persona.js +35 -18
  43. package/lib/pronoun.js +120 -0
  44. package/lib/pronounask.js +201 -0
  45. package/lib/recall.js +3 -2
  46. package/lib/restrict.js +285 -56
  47. package/lib/say.js +5 -0
  48. package/lib/scheduler.js +195 -30
  49. package/lib/schema.js +33 -0
  50. package/lib/scrub.js +366 -0
  51. package/lib/selfcheck.js +2 -2
  52. package/lib/selfdoc.js +51 -10
  53. package/lib/sessionnote.js +67 -37
  54. package/lib/settings.js +77 -6
  55. package/lib/speak.js +6 -1
  56. package/lib/stance.js +32 -3
  57. package/lib/store.js +89 -10
  58. package/lib/talkmem.js +55 -11
  59. package/lib/tenant.js +236 -36
  60. package/lib/tool.js +5 -6
  61. package/lib/transcript.js +125 -0
  62. package/lib/turns.js +147 -18
  63. package/lib/unlock.js +30 -9
  64. package/lib/use.js +22 -48
  65. package/lib/watch.js +4 -0
  66. package/lib/whatseen.js +138 -13
  67. package/lib/wish.js +10 -1
  68. package/package.json +1 -1
package/lib/wish.js CHANGED
@@ -77,6 +77,15 @@ const TOOL_NAME_MIN = 4
77
77
  /** subject 开头可以先有的空白和左引号、左括号(「`her_note`:…」「「her_note」…」也算写在最前面)。 */
78
78
  const HEAD_OPENERS = /^[\s`'"“‘「『《〈【[((<]+/
79
79
 
80
+ /**
81
+ * 剥掉标点之后,开头还可能是「用 / 就」这类前缀(issue #109):
82
+ * 「用 her_note 记长一点的东西」「就是 bili_look 能看整条的」——说的是手上已有的工具。
83
+ *
84
+ * 不放「像」:`像 bash 那样能跑 python 的东西` 是拿手上的工具作比较,要的是另一样东西
85
+ * (#102 的用例),放行会把「还没有的东西」误判成到手。
86
+ */
87
+ const HEAD_PREFIX = /^(?:(?:就是|用|就)\s*)+/
88
+
80
89
  const DAY = 86_400_000
81
90
 
82
91
  /** `askId` → 那条 `answer` 事件。 */
@@ -156,7 +165,7 @@ function toolNamedIn(has, subject) {
156
165
  if (!subject) return ''
157
166
  if (toolInHand(has, subject)) return subject
158
167
  if (!(has instanceof Set) && !Array.isArray(has)) return ''
159
- const head = subject.toLowerCase().replace(HEAD_OPENERS, '')
168
+ const head = subject.toLowerCase().replace(HEAD_OPENERS, '').replace(HEAD_PREFIX, '')
160
169
  let hit = ''
161
170
  for (const raw of has instanceof Set ? [...has] : has) {
162
171
  const name = String(raw ?? '').trim().toLowerCase()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssamurias/dsh-fish",
3
- "version": "0.9.7",
3
+ "version": "0.9.9",
4
4
  "description": "养一条会自己长大的鱼:没有人格设置,通过事件流长大。她可以自己刷 B 站、会写日记给你看,四个阶段完成后才会开始有立场。状态库在 ~/.dsh-fish,不能删除记录。",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",