@things-factory/ai-assistant 10.1.108 → 10.1.109

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/ai-assistant",
3
- "version": "10.1.108",
3
+ "version": "10.1.109",
4
4
  "main": "dist-server/index.js",
5
5
  "things-factory": true,
6
6
  "author": "heartyoh",
@@ -52,5 +52,5 @@
52
52
  "copyfiles": "^2.4.1",
53
53
  "rimraf": "^5.0.0"
54
54
  },
55
- "gitHead": "b9e1747b2796c323ba8b0eebce7b4628be1e3fd0"
55
+ "gitHead": "4d51757c50d8347e83c96aeba73d770bdde55b73"
56
56
  }
@@ -0,0 +1,18 @@
1
+ /*
2
+ * The entry card's way to the workspace review is styled where it stands - its class once borrowed the follow-up
3
+ * chips' rule, which only applies inside `.proposal-choices`, and the button fell back to the browser's own look.
4
+ * The chat's wiring is read as text: importing it pulls the shell.
5
+ */
6
+ import { readFileSync } from 'fs'
7
+ import { join } from 'path'
8
+
9
+ const source = readFileSync(join(__dirname, '../client/components/assistant-chat.ts'), 'utf8')
10
+
11
+ describe('the entry card', () => {
12
+ it('★ the workspace review button has a rule of its own, not one scoped to the follow-up chips', () => {
13
+ const button = source.slice(source.indexOf('offersWorkspaceReview(p)'), source.indexOf('review-in-workspace'))
14
+ const name = /class="([\w-]+)"/.exec(button)?.[1]
15
+ expect(name).toBe('workspace-review')
16
+ expect(source).toMatch(new RegExp(`\\n \\.${name} \\{`))
17
+ })
18
+ })
@@ -136,5 +136,12 @@ describe('a pasted table', () => {
136
136
  expect(paste.indexOf('pastedTableFile(')).toBeLessThan(paste.indexOf("item.kind === 'file'"))
137
137
  expect(paste).toMatch(/e\.preventDefault\(\)[\s\S]*?return\n/)
138
138
  })
139
+
140
+ it('★ the Enter that ends a syllable belongs to the input method - the composer does not send on it', () => {
141
+ const source = readFileSync(join(__dirname, '../client/components/assistant-chat.ts'), 'utf8')
142
+ const keys = source.slice(source.indexOf('private onKeyDown('), source.indexOf('this.send()', source.indexOf('private onKeyDown(')))
143
+ expect(keys).toMatch(/if \(e\.isComposing \|\| e\.keyCode === 229\) return/)
144
+ expect(keys.indexOf('e.isComposing')).toBeLessThan(keys.indexOf("e.key === 'Enter'"))
145
+ })
139
146
  })
140
147