@huaqiu/dsh-tool-schematic-gen 0.3.2 → 0.3.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/lib/client.js +53 -0
- package/lib/client.js.map +1 -1
- package/package.json +6 -5
- package/src/client/index.ts +3 -1
- package/src/client/theme.ts +22 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@huaqiu/dsh-tool-schematic-gen",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./lib/index.mjs",
|
|
6
6
|
"types": "./lib/index.d.mts",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
31
31
|
"@deepseek-ai/dsh-host-webserver": "^0.1.0-rc.0",
|
|
32
32
|
"@deepseek-ai/dsh-tools": "^0.1.0-rc.0",
|
|
33
|
-
"@huaqiu/dsh-auth": "^0.3.
|
|
34
|
-
"@huaqiu/dsh-artifacts": "^0.3.
|
|
33
|
+
"@huaqiu/dsh-auth": "^0.3.6",
|
|
34
|
+
"@huaqiu/dsh-artifacts": "^0.3.6",
|
|
35
35
|
"react": "^18"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
@@ -39,8 +39,9 @@
|
|
|
39
39
|
"@huaqiu/kicad-sexpr-parser": "^0.1.1",
|
|
40
40
|
"@types/react": "^18.3.31",
|
|
41
41
|
"react": "^18.3.1",
|
|
42
|
-
"@huaqiu/dsh-artifacts": "0.3.
|
|
43
|
-
"@huaqiu/dsh-
|
|
42
|
+
"@huaqiu/dsh-artifacts": "0.3.6",
|
|
43
|
+
"@huaqiu/dsh-tool-uncollapse": "0.3.6",
|
|
44
|
+
"@huaqiu/dsh-auth": "0.3.6"
|
|
44
45
|
},
|
|
45
46
|
"files": [
|
|
46
47
|
"lib",
|
package/src/client/index.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { createElement, useEffect, useState, type ComponentType } from 'react'
|
|
17
17
|
import { GenHit } from './hit-card.jsx'
|
|
18
|
-
import { injectStyles, removeStyles, disposeThemeObserver } from './theme.js'
|
|
18
|
+
import { injectStyles, removeStyles, disposeThemeObserver, installSchematicUncollapser } from './theme.js'
|
|
19
19
|
import type { AuthStateLike, PromptSender } from './hit-card.jsx'
|
|
20
20
|
|
|
21
21
|
export type { AuthStateLike, PromptSender }
|
|
@@ -162,12 +162,14 @@ export function apply(ctx: ClientContext): () => void {
|
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
injectStyles()
|
|
165
|
+
const uncollapseDispose = installSchematicUncollapser()
|
|
165
166
|
|
|
166
167
|
const cleanup = (): void => {
|
|
167
168
|
for (const dispose of disposers) {
|
|
168
169
|
try { dispose() } catch { /* already disposed */ }
|
|
169
170
|
}
|
|
170
171
|
disposers.length = 0
|
|
172
|
+
uncollapseDispose()
|
|
171
173
|
removeStyles()
|
|
172
174
|
disposeThemeObserver()
|
|
173
175
|
}
|
package/src/client/theme.ts
CHANGED
|
@@ -18,9 +18,17 @@
|
|
|
18
18
|
*
|
|
19
19
|
* Stylesheet: uniquely-prefixed classes only, token colors, no !important, no
|
|
20
20
|
* DSH-internal selectors. The style tag is removed on dispose.
|
|
21
|
+
*
|
|
22
|
+
* Compact-transcript un-collapse: DSH's `ui-chat` hides a `tool-call` node's
|
|
23
|
+
* wrapper with `hidden="until-found"` once the turn closes. We cannot opt out
|
|
24
|
+
* from inside the card and must not patch DSH, so `installSchematicUncollapser()`
|
|
25
|
+
* delegates to `@huaqiu/dsh-tool-uncollapse`, which undoes it from this
|
|
26
|
+
* plugin's client half (scoped to our `.hq-sch` cards; no DSH source touched).
|
|
27
|
+
* See that package for the full mechanism.
|
|
21
28
|
*/
|
|
22
29
|
import { useEffect, useState } from 'react'
|
|
23
30
|
import { LOGIN_IFRAME_HEIGHT, type AuthLocale } from './login-url.js'
|
|
31
|
+
import { keepToolCardVisible } from '@huaqiu/dsh-tool-uncollapse'
|
|
24
32
|
|
|
25
33
|
export const PLUGIN_ID = '@huaqiu/dsh-tool-schematic-gen'
|
|
26
34
|
export const STYLE_ID = 'hq-schematic-genhit-styles'
|
|
@@ -226,3 +234,17 @@ export function removeStyles(): void {
|
|
|
226
234
|
const style = document.getElementById(STYLE_ID)
|
|
227
235
|
if (style && style.parentNode) style.parentNode.removeChild(style)
|
|
228
236
|
}
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Keep our schematic/system preview visible in DSH's compact transcript.
|
|
240
|
+
*
|
|
241
|
+
* Delegates to `@huaqiu/dsh-tool-uncollapse` (shared across the
|
|
242
|
+
* `@huaqiu/dsh-tool-*` plugins) — see that package for the mechanism and
|
|
243
|
+
* trade-offs. Scoped to our `.hq-sch` cards; other tools keep collapsing.
|
|
244
|
+
* Returns a disposer.
|
|
245
|
+
*/
|
|
246
|
+
export function installSchematicUncollapser(): () => void {
|
|
247
|
+
// Keep the finished preview open, but let the inline login HIT collapse by
|
|
248
|
+
// default (DSH behaviour) while the user is still authenticating.
|
|
249
|
+
return keepToolCardVisible('.hq-sch', { skipWhenContains: '.hq-sch__login' })
|
|
250
|
+
}
|