dsh-foxy-memory 0.4.8 → 0.4.10

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/LICENSE CHANGED
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
21
+ SOFTWARE.
package/README.md CHANGED
@@ -159,3 +159,8 @@ dsh plugin --profile desktop add "file:D:\path\to\dsh-foxy-memory"
159
159
  ## License
160
160
 
161
161
  MIT
162
+
163
+ ## 遇到问题
164
+
165
+ - 提交 [GitHub Issue](https://github.com/Kun-Fox/dsh-foxy-memory/issues/new/choose)
166
+ - 或直接联系作者 QQ:**2242711967**
package/lib/client.js CHANGED
@@ -7,6 +7,110 @@ window.__ModuleLoader__.load({
7
7
 
8
8
  const API = '/api/dsh-foxy-memory'
9
9
  const PANEL_ID = 'dsh-foxy-memory'
10
+ // ---- 问题反馈(GitHub issue + QQ)------------------------------------
11
+ // 这份实现分布在 dsh-foxy / dsh-foxy-bili / -game / -memory / -oopz / -weibo
12
+ // 六个仓库里,内容一致,只有 FEEDBACK_REPO 不同;改动时请一并同步。
13
+ const FEEDBACK_REPO = 'dsh-foxy-memory'
14
+ const FEEDBACK_QQ = '2242711967'
15
+
16
+ function FeedbackCard() {
17
+ const [copied, setCopied] = React.useState(false)
18
+ const copyQQ = () => {
19
+ const done = () => {
20
+ setCopied(true)
21
+ setTimeout(() => setCopied(false), 1600)
22
+ }
23
+ const fallback = () => {
24
+ try {
25
+ const field = document.createElement('textarea')
26
+ field.value = FEEDBACK_QQ
27
+ document.body.appendChild(field)
28
+ field.select()
29
+ document.execCommand('copy')
30
+ document.body.removeChild(field)
31
+ } catch {
32
+ // 复制失败也把号码显示出来,用户可手动抄写
33
+ }
34
+ done()
35
+ }
36
+ if (navigator.clipboard && navigator.clipboard.writeText) {
37
+ navigator.clipboard.writeText(FEEDBACK_QQ).then(done, fallback)
38
+ } else {
39
+ fallback()
40
+ }
41
+ }
42
+ const issueUrl = 'https://github.com/Kun-Fox/' + FEEDBACK_REPO + '/issues/new/choose'
43
+ const btnStyle = {
44
+ display: 'inline-flex',
45
+ alignItems: 'center',
46
+ gap: '6px',
47
+ padding: '7px 12px',
48
+ border: '1px solid rgba(127,127,127,.34)',
49
+ borderRadius: '7px',
50
+ background: 'transparent',
51
+ color: 'inherit',
52
+ font: 'inherit',
53
+ fontSize: '12px',
54
+ textDecoration: 'none',
55
+ cursor: 'pointer',
56
+ }
57
+ return h(
58
+ 'section',
59
+ {
60
+ style: {
61
+ margin: '12px 0 4px',
62
+ flex: '0 0 auto',
63
+ padding: '16px 18px',
64
+ border: '1px solid rgba(127,127,127,.26)',
65
+ borderRadius: '10px',
66
+ },
67
+ },
68
+ h('div', { style: { fontSize: '13px', fontWeight: 600, marginBottom: '4px' } }, '遇到问题?'),
69
+ h(
70
+ 'div',
71
+ { style: { fontSize: '12px', opacity: 0.75, lineHeight: 1.7 } },
72
+ '反馈时请附上 DSH 版本、插件版本和报错截图,能快很多。',
73
+ ),
74
+ h(
75
+ 'div',
76
+ { style: { display: 'flex', flexWrap: 'wrap', gap: '10px', marginTop: '12px' } },
77
+ h('a', { href: issueUrl, target: '_blank', rel: 'noreferrer noopener', style: btnStyle }, '提交 GitHub Issue'),
78
+ h(
79
+ 'button',
80
+ { type: 'button', onClick: copyQQ, style: btnStyle },
81
+ copied ? '已复制:' + FEEDBACK_QQ : '复制 QQ:' + FEEDBACK_QQ,
82
+ ),
83
+ ),
84
+ )
85
+ }
86
+
87
+ function withFeedback(Component) {
88
+ // 子插件的面板根节点是 height:100% + overflow:auto 的滚动容器,
89
+ // 必须用 flex 列布局给它一个确定高度,否则会失去滚动能力。
90
+ function FoxyPanelWithFeedback() {
91
+ return h(
92
+ 'div',
93
+ {
94
+ style: {
95
+ height: '100%',
96
+ minHeight: 0,
97
+ display: 'flex',
98
+ flexDirection: 'column',
99
+ overflow: 'hidden',
100
+ },
101
+ },
102
+ h(
103
+ 'div',
104
+ { style: { flex: '1 1 auto', minHeight: 0, display: 'flex', flexDirection: 'column' } },
105
+ h(Component),
106
+ ),
107
+ h(FeedbackCard),
108
+ )
109
+ }
110
+ FoxyPanelWithFeedback.displayName = 'FoxyPanelWithFeedback'
111
+ return FoxyPanelWithFeedback
112
+ }
113
+
10
114
  const LABEL = 'Foxy Memory'
11
115
 
12
116
  async function request(path, options = {}) {
@@ -356,7 +460,7 @@ window.__ModuleLoader__.load({
356
460
  const root = window.__FOXY_CONSOLE__ || (window.__FOXY_CONSOLE__ = { pages: [], listeners: new Set() })
357
461
  if (!Array.isArray(root.pages)) root.pages = []
358
462
  if (!(root.listeners instanceof Set)) root.listeners = new Set()
359
- const entry = { id: PANEL_ID, label: '记忆', order: 15, Component: Panel }
463
+ const entry = { id: PANEL_ID, label: '记忆', order: 15, Component: withFeedback(Panel) }
360
464
  const index = root.pages.findIndex((page) => page.id === entry.id)
361
465
  if (index >= 0) root.pages[index] = entry
362
466
  else root.pages.push(entry)
@@ -380,13 +484,13 @@ window.__ModuleLoader__.load({
380
484
  ctx.slots.inject('main', () =>
381
485
  ctx.slots.register(
382
486
  { name: 'main', key: PANEL_ID, inject: () => ({ workbench: true }) },
383
- () => h(Panel),
487
+ () => h(withFeedback(Panel)),
384
488
  ),
385
489
  )
386
490
  ctx.slots.inject('settings.section', () =>
387
491
  ctx.slots.register(
388
492
  { name: 'settings.section', id: 'foxy-memory', order: 33, label: LABEL },
389
- () => h(Panel),
493
+ () => h(withFeedback(Panel)),
390
494
  ),
391
495
  )
392
496
  }
package/package.json CHANGED
@@ -1,48 +1,48 @@
1
- {
2
- "name": "dsh-foxy-memory",
3
- "version": "0.4.8",
4
- "description": "Memory subplugin for dsh-foxy: local JSONL archive plus optional cross-platform Foxy Memory API, recall and search.",
5
- "type": "module",
6
- "main": "lib/index.js",
7
- "exports": {
8
- ".": "./lib/index.js",
9
- "./client": "./lib/client.js"
10
- },
11
- "files": [
12
- "lib",
13
- "cordis.patch.yml",
14
- "README.md"
15
- ],
16
- "engines": {
17
- "node": ">=20"
18
- },
19
- "author": "Kun-Fox",
20
- "repository": {
21
- "type": "git",
22
- "url": "git+https://github.com/Kun-Fox/dsh-foxy-memory.git"
23
- },
24
- "homepage": "https://github.com/Kun-Fox/dsh-foxy-memory#readme",
25
- "bugs": {
26
- "url": "https://github.com/Kun-Fox/dsh-foxy-memory/issues"
27
- },
28
- "dsh": {
29
- "bundle": {
30
- "patch": "./cordis.patch.yml"
31
- },
32
- "client": {
33
- "platform": "web",
34
- "inject": [
35
- "@deepseek-ai/dsh-client-ui-slots"
36
- ]
37
- }
38
- },
39
- "keywords": [
40
- "dsh",
41
- "deepseek-harness",
42
- "foxy",
43
- "memory",
44
- "livingmemory"
45
- ],
46
- "license": "MIT"
47
- }
48
-
1
+ {
2
+ "name": "dsh-foxy-memory",
3
+ "version": "0.4.10",
4
+ "description": "Memory subplugin for dsh-foxy: local JSONL archive plus optional cross-platform Foxy Memory API, recall and search.",
5
+ "type": "module",
6
+ "main": "lib/index.js",
7
+ "exports": {
8
+ ".": "./lib/index.js",
9
+ "./client": "./lib/client.js"
10
+ },
11
+ "files": [
12
+ "lib",
13
+ "cordis.patch.yml",
14
+ "README.md"
15
+ ],
16
+ "engines": {
17
+ "node": ">=20"
18
+ },
19
+ "author": "Kun-Fox",
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/Kun-Fox/dsh-foxy-memory.git"
23
+ },
24
+ "homepage": "https://github.com/Kun-Fox/dsh-foxy-memory#readme",
25
+ "bugs": {
26
+ "url": "https://github.com/Kun-Fox/dsh-foxy-memory/issues"
27
+ },
28
+ "dsh": {
29
+ "bundle": {
30
+ "patch": "./cordis.patch.yml"
31
+ },
32
+ "client": {
33
+ "platform": "web",
34
+ "inject": [
35
+ "@deepseek-ai/dsh-client-ui-slots"
36
+ ]
37
+ }
38
+ },
39
+ "keywords": [
40
+ "dsh",
41
+ "deepseek-harness",
42
+ "foxy",
43
+ "memory",
44
+ "livingmemory"
45
+ ],
46
+ "license": "MIT"
47
+ }
48
+