dsh-feiyu-memgate 0.3.2 → 0.4.0
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/CHANGELOG.md +73 -12
- package/README.md +68 -11
- package/README.zh.md +93 -36
- package/client/README.md +267 -0
- package/client/art/mascot-asleep.webp +0 -0
- package/client/art/mascot-busy.webp +0 -0
- package/client/art/mascot-nag.webp +0 -0
- package/client/art/mascot-ready.webp +0 -0
- package/client/art/mascot-trouble.webp +0 -0
- package/client/client.js +4226 -1269
- package/client/src/clipboard.cjs +52 -0
- package/client/src/constants.cjs +43 -0
- package/client/src/fields.cjs +960 -0
- package/client/src/hooks.cjs +220 -0
- package/client/src/i18n.cjs +444 -0
- package/client/src/index.cjs +69 -0
- package/client/src/kit/controls.cjs +189 -0
- package/client/src/kit/icons.cjs +40 -0
- package/client/src/kit/layout.cjs +124 -0
- package/client/src/layout.cjs +143 -0
- package/client/src/model/changelog.cjs +29 -0
- package/client/src/model/feedback.cjs +168 -0
- package/client/src/model/form.cjs +83 -0
- package/client/src/model/models.cjs +87 -0
- package/client/src/model/overview.cjs +111 -0
- package/client/src/model/page.cjs +104 -0
- package/client/src/model/status.cjs +57 -0
- package/client/src/model/trial.cjs +111 -0
- package/client/src/net.cjs +101 -0
- package/client/src/react.cjs +11 -0
- package/client/src/theme/page.css +1284 -0
- package/client/src/theme/styles.cjs +43 -0
- package/client/src/view/feedback.cjs +180 -0
- package/client/src/view/field-row.cjs +98 -0
- package/client/src/view/hero.cjs +54 -0
- package/client/src/view/markdown.cjs +96 -0
- package/client/src/view/models.cjs +154 -0
- package/client/src/view/page.cjs +199 -0
- package/client/src/view/settings-tab.cjs +78 -0
- package/client/src/view/tabs.cjs +71 -0
- package/client/src/view/trial.cjs +84 -0
- package/docs/DETAIL.en.md +55 -6
- package/docs/DETAIL.md +63 -14
- package/locale/zh.json +1 -1
- package/package.json +2 -1
- package/python/GATEWAY_VERSION.json +37 -31
- package/python/feiyu_memgate/backends/_sqlfile.py +293 -0
- package/python/feiyu_memgate/backends/base.py +121 -6
- package/python/feiyu_memgate/backends/embedding.py +265 -178
- package/python/feiyu_memgate/backends/hybrid.py +330 -83
- package/python/feiyu_memgate/backends/inmemory.py +115 -24
- package/python/feiyu_memgate/backends/openviking.py +7 -10
- package/python/feiyu_memgate/backends/sqlite.py +129 -145
- package/python/feiyu_memgate/builtins.py +1 -0
- package/python/feiyu_memgate/cli.py +124 -20
- package/python/feiyu_memgate/client/block.py +4 -2
- package/python/feiyu_memgate/client/http.py +106 -19
- package/python/feiyu_memgate/client/local.py +4 -3
- package/python/feiyu_memgate/config.py +118 -24
- package/python/feiyu_memgate/core/limits.py +2 -1
- package/python/feiyu_memgate/core/pool.py +29 -2
- package/python/feiyu_memgate/core/recall.py +179 -10
- package/python/feiyu_memgate/core/redact.py +4 -2
- package/python/feiyu_memgate/core/stages.py +52 -9
- package/python/feiyu_memgate/core/tidy.py +2 -1
- package/python/feiyu_memgate/core/watch.py +3 -2
- package/python/feiyu_memgate/core/write.py +9 -3
- package/python/feiyu_memgate/forgetting/archive.py +38 -10
- package/python/feiyu_memgate/forgetting/engine.py +46 -10
- package/python/feiyu_memgate/forgetting/stage.py +4 -2
- package/python/feiyu_memgate/gateway/app.py +168 -272
- package/python/feiyu_memgate/gateway/fields.py +121 -0
- package/python/feiyu_memgate/gateway/policies.py +162 -0
- package/python/feiyu_memgate/gateway/server.py +12 -4
- package/python/feiyu_memgate/gateway/tokens.py +137 -0
- package/python/feiyu_memgate/gateway/validate.py +120 -0
- package/python/feiyu_memgate/identity.py +152 -0
- package/python/feiyu_memgate/model.py +170 -2
- package/python/feiyu_memgate/registry.py +6 -3
- package/python/feiyu_memgate/tools/crypto.py +5 -4
- package/python/feiyu_memgate/tools/evaluate.py +2 -1
- package/python/feiyu_memgate/tools/tenants.py +2 -0
- package/src/block.js +9 -3
- package/src/capture.js +98 -0
- package/src/catalogue.js +4 -4
- package/src/changelog.js +72 -0
- package/src/client.js +145 -10
- package/src/commands.js +112 -62
- package/src/config.js +139 -62
- package/src/followup.js +139 -0
- package/src/gateway.js +79 -4
- package/src/migrate.py +54 -9
- package/src/mirror.py +44 -7
- package/src/plugin.js +416 -412
- package/src/pool.js +298 -0
- package/src/recent.js +68 -0
- package/src/relevance.js +80 -0
- package/src/routes.js +320 -0
- package/src/setup.js +36 -36
- package/src/shared.js +77 -0
- package/src/tiers.js +4 -4
- package/src/time.js +27 -0
- package/src/tools.js +164 -0
|
@@ -0,0 +1,444 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
// The words of the page, in English and Chinese. UI holds the static texts; dictionaries() adds the
|
|
4
|
+
// group, field and option texts taken from the field table. Keys here are used as t(key) by the view.
|
|
5
|
+
// Must not change a text without changing the other language, and must not touch React or the DOM.
|
|
6
|
+
|
|
7
|
+
const { FIELDS } = require('./fields.cjs')
|
|
8
|
+
|
|
9
|
+
const UI = {
|
|
10
|
+
en: {
|
|
11
|
+
summary: 'Long-term memory through the feiyu-memgate gateway: automatic recall, memory tools and retrieval tiers.',
|
|
12
|
+
changelogTitle: 'Changelog',
|
|
13
|
+
changelogChinese: 'The entries are written in Chinese.',
|
|
14
|
+
changelogLoading: 'Reading the changelog…',
|
|
15
|
+
changelogFailed: 'The changelog could not be shown.',
|
|
16
|
+
refresh: 'Refresh',
|
|
17
|
+
statusLoading: 'Reading the status…',
|
|
18
|
+
statusFailed: 'Status unavailable ({code}).',
|
|
19
|
+
gateway: 'Gateway', python: 'Python', retrieval: 'Retrieval', store: 'Store', embed: 'Embedding add-on',
|
|
20
|
+
migration: 'Copy from the keyword store',
|
|
21
|
+
managed: 'managed', external: 'external',
|
|
22
|
+
'state.idle': 'not started', 'state.starting': 'starting', 'state.running': 'running', 'state.restarting': 'restarting',
|
|
23
|
+
'state.off': 'off', 'state.failed': 'stopped after repeated failures', 'state.stopped': 'stopped',
|
|
24
|
+
'state.unused': 'not running (no memory feature is on)', 'state.configured': 'configured',
|
|
25
|
+
'state.incomplete': 'needs a URL and a token', 'state.ready': 'ready', 'state.loading': 'loading',
|
|
26
|
+
'state.no-model': 'no model installed', 'state.error': 'error', 'state.done': 'done', 'state.partial': 'in progress',
|
|
27
|
+
'state.running-copy': 'copying',
|
|
28
|
+
pythonNone: 'not found (3.11 or newer needed)',
|
|
29
|
+
pythonUnknown: 'not checked',
|
|
30
|
+
retrievalExternal: 'decided by the external gateway',
|
|
31
|
+
hybridWord: 'keyword (hybrid)',
|
|
32
|
+
notInstalled: 'not installed',
|
|
33
|
+
memories: '{count} memories',
|
|
34
|
+
countUnknown: 'count unavailable',
|
|
35
|
+
progress: '{copied} of {total} copied',
|
|
36
|
+
refusedCount: '{count} refused by the embedding model',
|
|
37
|
+
relevance: 'Relevance check',
|
|
38
|
+
relevanceRow: '{calls} calls · {kept} kept · {rejected} left out',
|
|
39
|
+
relevanceSkipped: '{count} skipped ({kinds})',
|
|
40
|
+
approximate: 'scores not calibrated',
|
|
41
|
+
saving: 'Saving…', saved: 'Saved.',
|
|
42
|
+
saveFailed: 'The host did not accept the change; nothing was saved.',
|
|
43
|
+
readOnly: 'Settings are read-only in this deployment.',
|
|
44
|
+
unavailable: 'The host is not offering the settings form of this plugin right now. Every setting can still be changed in a chat with /memgate set.',
|
|
45
|
+
loading: 'Loading the settings…',
|
|
46
|
+
overridden: 'Changed', reset: 'Reset',
|
|
47
|
+
invalidInteger: 'A whole number from {min} to {max}.',
|
|
48
|
+
invalidUrl: 'An http:// or https:// address.',
|
|
49
|
+
secretSet: 'Set', secretUnset: 'Not set', secretHint: 'Leave empty to keep the stored value.',
|
|
50
|
+
secretClear: 'Clear', secretClearing: 'Cleared when you save.',
|
|
51
|
+
lang: 'en',
|
|
52
|
+
// the page: tabs, the summary at the top, rows, the save bar, the footer, the feedback tab
|
|
53
|
+
'tab.overview': 'Overview',
|
|
54
|
+
'tab.changelog': 'Changelog',
|
|
55
|
+
tabsLabel: 'Sections of the settings',
|
|
56
|
+
tabEdited: 'has unsaved changes',
|
|
57
|
+
'overview.head.ready': 'Memory is running',
|
|
58
|
+
'overview.head.busy': 'Starting',
|
|
59
|
+
'overview.head.asleep': 'Memory is not running',
|
|
60
|
+
'overview.head.trouble': 'Needs attention',
|
|
61
|
+
'overview.head.loading': 'Reading the status',
|
|
62
|
+
'overview.head.unknown': 'Status unavailable',
|
|
63
|
+
'overview.line.loading': 'Please wait.',
|
|
64
|
+
'overview.line.unknown': 'The plugin did not respond ({code}). It may still be starting; the page retries automatically.',
|
|
65
|
+
'overview.ready.keyword': 'The bundled gateway is running, using keyword retrieval.',
|
|
66
|
+
'overview.ready.local': 'The bundled gateway is running, using {model} on this computer for semantic retrieval.',
|
|
67
|
+
'overview.ready.local.hybrid': 'The bundled gateway is running, using {model} on this computer for hybrid retrieval (semantic plus keyword).',
|
|
68
|
+
'overview.ready.endpoint': 'The bundled gateway is running, using your embeddings endpoint for semantic retrieval.',
|
|
69
|
+
'overview.ready.endpoint.hybrid': 'The bundled gateway is running, using your embeddings endpoint for hybrid retrieval (semantic plus keyword).',
|
|
70
|
+
'overview.ready.external': 'Connected to the external gateway you run yourself.',
|
|
71
|
+
'overview.busy.gateway': 'The bundled gateway is starting. Memories are available from the next turn.',
|
|
72
|
+
'overview.busy.model': 'Loading the embedding model {model}.',
|
|
73
|
+
'overview.busy.copy': 'Copying memories into the vector store: {copied} of {total}. Recall already works.',
|
|
74
|
+
'overview.asleep.off': 'The bundled gateway is switched off.',
|
|
75
|
+
'overview.asleep.stopped': 'The bundled gateway is stopped.',
|
|
76
|
+
'overview.asleep.unused': 'No feature that needs memory is turned on, so the gateway is not running. Turn one on under Features.',
|
|
77
|
+
'overview.trouble.python': 'No Python 3.11 or newer was found, and the bundled gateway needs one. Install Python, or specify a path under Advanced › Gateway.',
|
|
78
|
+
'overview.trouble.failed': 'The bundled gateway stopped after failing several times. Its log is in the data folder; saving any setting starts it again.',
|
|
79
|
+
'overview.trouble.incomplete': 'The external gateway needs an address and a client token. Set them under Advanced › Gateway.',
|
|
80
|
+
'overview.fact.count': '{count} memories',
|
|
81
|
+
'overview.fact.tier.keyword': 'Keyword retrieval',
|
|
82
|
+
'overview.fact.tier.local': 'Semantic retrieval, local model',
|
|
83
|
+
'overview.fact.tier.local.hybrid': 'Hybrid retrieval, local model',
|
|
84
|
+
'overview.fact.tier.endpoint': 'Semantic retrieval, endpoint',
|
|
85
|
+
'overview.fact.tier.endpoint.hybrid': 'Hybrid retrieval, endpoint',
|
|
86
|
+
'overview.fact.managed': 'Bundled gateway',
|
|
87
|
+
'overview.fact.external': 'External gateway',
|
|
88
|
+
'overview.fact.embedError': 'Embedding add-on reports an error',
|
|
89
|
+
'overview.fact.refused': '{count} memories refused by the embedding model',
|
|
90
|
+
'mascot.ready': 'The mascot holds up a glowing puzzle piece.',
|
|
91
|
+
'mascot.busy': 'The mascot carries a stack of puzzle pieces.',
|
|
92
|
+
'mascot.asleep': 'The mascot is asleep.',
|
|
93
|
+
'mascot.trouble': 'The mascot holds a cracked puzzle piece and looks worried.',
|
|
94
|
+
'mascot.nag': 'The mascot points at a little black cat asleep on the floor and tells it to hurry up with the update.',
|
|
95
|
+
'feedback.nag': 'Update now!',
|
|
96
|
+
detailsTitle: 'Details',
|
|
97
|
+
detailsHint: 'Runtime information of the plugin. It contains no keys, add-on address or memory content.',
|
|
98
|
+
experimental: 'Experimental',
|
|
99
|
+
stepDown: 'Less',
|
|
100
|
+
stepUp: 'More',
|
|
101
|
+
unsaved: '{count} unsaved changes',
|
|
102
|
+
unsavedOne: '1 unsaved change',
|
|
103
|
+
fixFirst: 'A setting marked in red has an invalid format and cannot be saved.',
|
|
104
|
+
discard: 'Discard',
|
|
105
|
+
saveChanges: 'Save changes',
|
|
106
|
+
changelogIntro: 'What changed in each version, newest first.',
|
|
107
|
+
changelogInstalled: 'Installed',
|
|
108
|
+
footDocs: 'Documentation',
|
|
109
|
+
footSource: 'Source',
|
|
110
|
+
footFeedback: 'Feedback',
|
|
111
|
+
'tab.feedback': 'Feedback',
|
|
112
|
+
'feedback.title': 'Tell me what you think',
|
|
113
|
+
'feedback.intro': 'Suggest a feature or report a problem.',
|
|
114
|
+
'feedback.kind': 'Type',
|
|
115
|
+
'feedback.kind.idea': 'Feature request',
|
|
116
|
+
'feedback.kind.idea.note': 'A feature to add or improve',
|
|
117
|
+
'feedback.kind.problem': 'Problem',
|
|
118
|
+
'feedback.kind.problem.note': 'An error or unexpected behaviour',
|
|
119
|
+
'feedback.kind.other': 'Other',
|
|
120
|
+
'feedback.kind.other.note': 'A question or any other comment',
|
|
121
|
+
'feedback.text': 'Feedback',
|
|
122
|
+
'feedback.placeholder': 'Write your feedback here',
|
|
123
|
+
'feedback.count': '{count} of {max} characters',
|
|
124
|
+
'feedback.env': 'Include environment details',
|
|
125
|
+
'feedback.env.help': 'Only the version numbers and states listed below, to help find the cause. No memory, path, address or key.',
|
|
126
|
+
'feedback.env.none': 'The status cannot be read right now, so there is nothing to include.',
|
|
127
|
+
'feedback.how': 'The button opens GitHub’s new-issue page in your browser with the title and the text filled in. Nothing is sent until you submit it there, and you can change all of it first. The plugin itself sends nothing anywhere.',
|
|
128
|
+
'feedback.public': 'Issues are public, and you need a GitHub account. Leave out keys, tokens and anything private.',
|
|
129
|
+
'feedback.submit': 'Continue on GitHub',
|
|
130
|
+
'feedback.copy': 'Copy the text',
|
|
131
|
+
'feedback.copied': 'Copied.',
|
|
132
|
+
'feedback.copyFailed': 'Could not copy. Select the text and copy it by hand.',
|
|
133
|
+
'feedback.clipped': 'This is too long for a link, so the link carries only the beginning. Pressing the button also copies the whole text: paste it into the issue on GitHub.',
|
|
134
|
+
'feedback.cutNote': '(Cut here: the text was too long for a link. The whole text is on your clipboard; paste it over this.)',
|
|
135
|
+
'feedback.others': 'View existing feedback',
|
|
136
|
+
'feedback.send': 'Send',
|
|
137
|
+
'feedback.sending': 'Sending…',
|
|
138
|
+
'feedback.sent': 'Sent. Thank you for your feedback.',
|
|
139
|
+
'feedback.failed': 'Could not send ({code}). What you wrote is kept. Try again, or use one of these:',
|
|
140
|
+
'feedback.failedBusy': 'Too many submissions. Try again in a minute, or use one of these:',
|
|
141
|
+
'feedback.howDirect': 'Send posts your feedback and the environment details listed above to the project’s feedback service. Only the maintainers can read it; it is not published. Leave out keys and tokens.',
|
|
142
|
+
changedCount: '{count} changed',
|
|
143
|
+
modelsTitle: 'Local embedding models',
|
|
144
|
+
modelsIntro: 'Optional. With a local model, memories are retrieved by meaning rather than by keywords, entirely on this computer. Nothing is downloaded or installed until you click a button.',
|
|
145
|
+
modelsLink: 'Measured retrieval quality of each tier',
|
|
146
|
+
modelsLoading: 'Reading the model list…',
|
|
147
|
+
modelsFailed: 'The model list is unavailable ({code}).',
|
|
148
|
+
colSize: 'Download', colMemory: 'Memory while running', colLanguages: 'Languages', colLicence: 'Licence',
|
|
149
|
+
memoryAbout: 'about {mb} MB', memoryUnknown: 'not measured',
|
|
150
|
+
'language.zh': 'Chinese', 'language.en': 'English', 'language.multilingual': 'Many languages',
|
|
151
|
+
unverified: 'Not yet tested',
|
|
152
|
+
actInstall: 'Download and enable', actDownloading: 'Downloading {percent}%', actDownloadingPlain: 'Downloading…',
|
|
153
|
+
actCancel: 'Cancel', actUse: 'Enable', actActive: 'In use', actLoading: 'Loading…', actRemove: 'Delete',
|
|
154
|
+
acceptLabel: 'I have read and accept the {name}',
|
|
155
|
+
confirmAddon: 'This installs the plugin dsh-feiyu-memgate-embed from npm through the DSH plugin manager (it checks that the plugin supports this DSH first), then downloads {model} ({size}) and enables it. The plugin adds a dependency with a native binary (node-llama-cpp): about 90 MB on disk for the CPU build, up to about 740 MB on Windows and Linux x64, where pnpm also fetches the GPU builds. The model runs on the CPU only. On Windows the engine needs the Microsoft Visual C++ 2015-2022 runtime (x64), which most Windows installations already have.',
|
|
156
|
+
confirmYes: 'Install', confirmNo: 'Cancel',
|
|
157
|
+
declined: 'Nothing was installed. Click the button again when needed.',
|
|
158
|
+
todo: 'What to do:',
|
|
159
|
+
'phase.addon': 'Installing the embedding add-on…',
|
|
160
|
+
'phase.addon-starting': 'The embedding add-on is installed; waiting for it to start…',
|
|
161
|
+
'phase.model': 'Downloading {model}…',
|
|
162
|
+
'phase.modelPercent': 'Downloading {model}: {percent}%',
|
|
163
|
+
'phase.activating': 'Enabling {model}…',
|
|
164
|
+
'phase.done': '{model} is enabled; the retrieval tier follows it (see the status above).',
|
|
165
|
+
'installState.installing': 'The host is installing it',
|
|
166
|
+
'installState.applying': 'The host is starting it',
|
|
167
|
+
'installState.cancelling': 'Cancelling',
|
|
168
|
+
actResume: 'Resume download',
|
|
169
|
+
'phase.paused': 'The download of {model} was interrupted (DSH restarted); the part already downloaded is kept.',
|
|
170
|
+
'phase.builds': 'The installation waits for your decision:',
|
|
171
|
+
buildsAllow: 'Allow the script and continue', buildsDeny: 'Do not allow',
|
|
172
|
+
pinned: 'Pinned in the add-on’s settings',
|
|
173
|
+
'trial.intro': 'Type a sentence to see which memories the gateway would recall, their scores, and the step that removed the ones left out. Nothing is changed, and it does not count as a use.',
|
|
174
|
+
'trial.placeholder': 'For example: what tea do I like in the morning',
|
|
175
|
+
'trial.inputLabel': 'Sentence to try',
|
|
176
|
+
'trial.run': 'Try',
|
|
177
|
+
'trial.busy': 'Looking…',
|
|
178
|
+
'trial.summary': '{found} candidates found, {given} delivered.',
|
|
179
|
+
'trial.none': 'No related memory was found.',
|
|
180
|
+
'trial.note': 'This is the gateway’s result. In a conversation the plugin also skips memories it has already given, as set.',
|
|
181
|
+
'trial.partial': 'A store could not be searched; the result may be incomplete.',
|
|
182
|
+
'trial.delivered': 'Delivered',
|
|
183
|
+
'trial.leftOut': 'Left out',
|
|
184
|
+
'trial.linked': 'Linked',
|
|
185
|
+
'trial.field.speaker': 'Said by {who}',
|
|
186
|
+
'trial.field.about': 'About {who}',
|
|
187
|
+
'trial.field.channel': 'Channel {channel}',
|
|
188
|
+
'trial.field.eventDate': 'Happened {date}',
|
|
189
|
+
'trial.origin.said': 'Captured',
|
|
190
|
+
'trial.origin.tool': 'By the tool',
|
|
191
|
+
'trial.origin.curated': 'Written by the owner',
|
|
192
|
+
'trial.origin.derived': 'Derived',
|
|
193
|
+
'trial.kind.identity': 'Identity',
|
|
194
|
+
'trial.kind.preference': 'Preference',
|
|
195
|
+
'trial.kind.event': 'Event',
|
|
196
|
+
'trial.kind.plan': 'Plan',
|
|
197
|
+
'trial.kind.entity': 'Entity',
|
|
198
|
+
'trial.noText': '(no text came back for this one)',
|
|
199
|
+
'trial.reason.min_score': 'Below the score line',
|
|
200
|
+
'trial.reason.relative_score': 'Too far below the best match',
|
|
201
|
+
'trial.reason.fill_text': 'Its text could not be read',
|
|
202
|
+
'trial.reason.drop_oversize': 'Too long',
|
|
203
|
+
'trial.reason.redact': 'Nothing left after redaction',
|
|
204
|
+
'trial.reason.dedupe': 'Duplicate of one above',
|
|
205
|
+
'trial.reason.budget': 'Over the length budget',
|
|
206
|
+
'trial.reason.drop_marker': 'Carries the exclusion marker',
|
|
207
|
+
'trial.reason.over_limit': 'Past the limit of {limit}',
|
|
208
|
+
'trial.reason.not_reached': 'Out of time before its turn',
|
|
209
|
+
'trial.reason.other': 'Removed by the {stage} step',
|
|
210
|
+
'trial.error.unavailable': 'The gateway is not ready yet. Try again in a moment.',
|
|
211
|
+
'trial.error.unsupported': 'This gateway does not support trial recalls: it needs a newer gateway with explain turned on for this client.',
|
|
212
|
+
'trial.error.no-recall': 'This sentence is too short or is only an acknowledgement; no recall is made for it in a conversation.',
|
|
213
|
+
'trial.error.failed': 'The lookup failed. Try again later.',
|
|
214
|
+
'trial.error.network': 'The lookup failed. Try again later.',
|
|
215
|
+
},
|
|
216
|
+
zh: {
|
|
217
|
+
summary: '通过 feiyu-memgate 网关使用长期记忆:自动召回、记忆工具和多种检索方式。',
|
|
218
|
+
changelogTitle: '更新日志',
|
|
219
|
+
changelogChinese: '条目以中文撰写。',
|
|
220
|
+
changelogLoading: '正在读取更新日志…',
|
|
221
|
+
changelogFailed: '无法显示更新日志。',
|
|
222
|
+
refresh: '刷新',
|
|
223
|
+
statusLoading: '正在读取状态…',
|
|
224
|
+
statusFailed: '状态不可用({code})。',
|
|
225
|
+
gateway: '网关', python: 'Python', retrieval: '检索', store: '存储', embed: '向量插件',
|
|
226
|
+
migration: '从关键词存储复制',
|
|
227
|
+
managed: '内置', external: '外部',
|
|
228
|
+
'state.idle': '未启动', 'state.starting': '启动中', 'state.running': '运行中', 'state.restarting': '重启中',
|
|
229
|
+
'state.off': '关闭', 'state.failed': '多次失败后已停止', 'state.stopped': '已停止',
|
|
230
|
+
'state.unused': '未运行(未开启需要记忆的功能)', 'state.configured': '已配置',
|
|
231
|
+
'state.incomplete': '需要地址和令牌', 'state.ready': '就绪', 'state.loading': '加载中',
|
|
232
|
+
'state.no-model': '未安装模型', 'state.error': '出错', 'state.done': '完成', 'state.partial': '进行中',
|
|
233
|
+
'state.running-copy': '复制中',
|
|
234
|
+
pythonNone: '未找到(需要 3.11 或更高版本)',
|
|
235
|
+
pythonUnknown: '未检查',
|
|
236
|
+
retrievalExternal: '由外部网关决定',
|
|
237
|
+
hybridWord: '关键词(混合)',
|
|
238
|
+
notInstalled: '未安装',
|
|
239
|
+
memories: '{count} 条记忆',
|
|
240
|
+
countUnknown: '条数未知',
|
|
241
|
+
progress: '已复制 {copied} / {total}',
|
|
242
|
+
refusedCount: '向量模型拒绝 {count} 条',
|
|
243
|
+
relevance: '相关性检查',
|
|
244
|
+
relevanceRow: '调用 {calls} 次 · 保留 {kept} 条 · 排除 {rejected} 条',
|
|
245
|
+
relevanceSkipped: '跳过 {count} 次({kinds})',
|
|
246
|
+
approximate: '分数未校准',
|
|
247
|
+
saving: '正在保存…', saved: '已保存。',
|
|
248
|
+
saveFailed: '宿主未接受此次修改,未保存任何内容。',
|
|
249
|
+
readOnly: '当前部署的设置为只读。',
|
|
250
|
+
unavailable: '宿主暂未提供此插件的设置表单。仍可在对话中使用 /memgate set 修改所有设置项。',
|
|
251
|
+
loading: '正在加载设置…',
|
|
252
|
+
overridden: '已修改', reset: '恢复',
|
|
253
|
+
invalidInteger: '{min} 到 {max} 之间的整数。',
|
|
254
|
+
invalidUrl: 'http:// 或 https:// 开头的地址。',
|
|
255
|
+
secretSet: '已设置', secretUnset: '未设置', secretHint: '留空则保留已保存的值。',
|
|
256
|
+
secretClear: '清空', secretClearing: '保存时清空。',
|
|
257
|
+
lang: 'zh',
|
|
258
|
+
// the page: tabs, the summary at the top, rows, the save bar, the footer, the feedback tab
|
|
259
|
+
'tab.overview': '概览',
|
|
260
|
+
'tab.changelog': '更新日志',
|
|
261
|
+
tabsLabel: '设置分区',
|
|
262
|
+
tabEdited: '有未保存的修改',
|
|
263
|
+
'overview.head.ready': '记忆运行正常',
|
|
264
|
+
'overview.head.busy': '正在启动',
|
|
265
|
+
'overview.head.asleep': '记忆未运行',
|
|
266
|
+
'overview.head.trouble': '需要处理',
|
|
267
|
+
'overview.head.loading': '正在读取状态',
|
|
268
|
+
'overview.head.unknown': '无法读取状态',
|
|
269
|
+
'overview.line.loading': '请稍候。',
|
|
270
|
+
'overview.line.unknown': '插件未响应({code})。可能仍在启动,页面会自动重试。',
|
|
271
|
+
'overview.ready.keyword': '内置网关运行中,使用关键词检索。',
|
|
272
|
+
'overview.ready.local': '内置网关运行中,使用本机的 {model} 进行语义检索。',
|
|
273
|
+
'overview.ready.local.hybrid': '内置网关运行中,使用本机的 {model} 进行混合检索(语义加关键词)。',
|
|
274
|
+
'overview.ready.endpoint': '内置网关运行中,通过你的向量接口进行语义检索。',
|
|
275
|
+
'overview.ready.endpoint.hybrid': '内置网关运行中,通过你的向量接口进行混合检索(语义加关键词)。',
|
|
276
|
+
'overview.ready.external': '已连接到你自行运行的外部网关。',
|
|
277
|
+
'overview.busy.gateway': '内置网关正在启动,下一轮对话起可使用记忆。',
|
|
278
|
+
'overview.busy.model': '正在加载向量模型 {model}。',
|
|
279
|
+
'overview.busy.copy': '正在把记忆复制到向量存储:{copied} / {total}。复制期间仍可召回。',
|
|
280
|
+
'overview.asleep.off': '内置网关已关闭。',
|
|
281
|
+
'overview.asleep.stopped': '内置网关已停止。',
|
|
282
|
+
'overview.asleep.unused': '未开启任何需要记忆的功能,网关未运行。可在“功能”中开启。',
|
|
283
|
+
'overview.trouble.python': '未找到 Python 3.11 或更高版本,内置网关无法运行。请安装 Python,或在“高级 › 网关”中指定路径。',
|
|
284
|
+
'overview.trouble.failed': '内置网关连续失败多次后已停止。日志位于数据文件夹;保存任意设置项会重新启动网关。',
|
|
285
|
+
'overview.trouble.incomplete': '外部网关缺少地址和客户端令牌。请在“高级 › 网关”中填写。',
|
|
286
|
+
'overview.fact.count': '{count} 条记忆',
|
|
287
|
+
'overview.fact.tier.keyword': '关键词检索',
|
|
288
|
+
'overview.fact.tier.local': '语义检索 · 本地模型',
|
|
289
|
+
'overview.fact.tier.local.hybrid': '混合检索 · 本地模型',
|
|
290
|
+
'overview.fact.tier.endpoint': '语义检索 · 向量接口',
|
|
291
|
+
'overview.fact.tier.endpoint.hybrid': '混合检索 · 向量接口',
|
|
292
|
+
'overview.fact.managed': '内置网关',
|
|
293
|
+
'overview.fact.external': '外部网关',
|
|
294
|
+
'overview.fact.embedError': '向量插件报告错误',
|
|
295
|
+
'overview.fact.refused': '向量模型拒绝了 {count} 条记忆',
|
|
296
|
+
'mascot.ready': '吉祥物举着一块发光的拼图。',
|
|
297
|
+
'mascot.busy': '吉祥物抱着一摞拼图。',
|
|
298
|
+
'mascot.asleep': '吉祥物睡着了。',
|
|
299
|
+
'mascot.trouble': '吉祥物拿着一块裂开的拼图,有点着急。',
|
|
300
|
+
'mascot.nag': '吉祥物指着在地上睡觉的小黑猫,催它快点更新。',
|
|
301
|
+
'feedback.nag': '快更新!',
|
|
302
|
+
detailsTitle: '详细信息',
|
|
303
|
+
detailsHint: '插件的运行信息。不包含密钥、向量插件地址和记忆内容。',
|
|
304
|
+
experimental: '实验性',
|
|
305
|
+
stepDown: '减少',
|
|
306
|
+
stepUp: '增加',
|
|
307
|
+
unsaved: '{count} 项修改未保存',
|
|
308
|
+
unsavedOne: '1 项修改未保存',
|
|
309
|
+
fixFirst: '标红的设置项格式有误,无法保存。',
|
|
310
|
+
discard: '放弃修改',
|
|
311
|
+
saveChanges: '保存修改',
|
|
312
|
+
changelogIntro: '各版本的更新内容,按时间倒序排列。',
|
|
313
|
+
changelogInstalled: '当前安装',
|
|
314
|
+
footDocs: '文档',
|
|
315
|
+
footSource: '源代码',
|
|
316
|
+
footFeedback: '意见反馈',
|
|
317
|
+
'tab.feedback': '反馈',
|
|
318
|
+
'feedback.title': '说说你的想法',
|
|
319
|
+
'feedback.intro': '欢迎提交功能建议或问题反馈。',
|
|
320
|
+
'feedback.kind': '反馈类型',
|
|
321
|
+
'feedback.kind.idea': '功能建议',
|
|
322
|
+
'feedback.kind.idea.note': '希望新增或改进的功能',
|
|
323
|
+
'feedback.kind.problem': '问题反馈',
|
|
324
|
+
'feedback.kind.problem.note': '使用中遇到的错误或异常',
|
|
325
|
+
'feedback.kind.other': '其他',
|
|
326
|
+
'feedback.kind.other.note': '使用疑问或其他意见',
|
|
327
|
+
'feedback.text': '反馈内容',
|
|
328
|
+
'feedback.placeholder': '在这里进行反馈',
|
|
329
|
+
'feedback.count': '{count} / {max} 字',
|
|
330
|
+
'feedback.env': '附带运行环境信息',
|
|
331
|
+
'feedback.env.help': '仅包含下方列出的版本号和运行状态,用于排查问题;不包含记忆内容、文件路径、地址和密钥。',
|
|
332
|
+
'feedback.env.none': '暂时无法读取运行状态,无可附带的信息。',
|
|
333
|
+
'feedback.how': '点击按钮将在浏览器中打开 GitHub 的新建 Issue 页面,并自动填入标题和正文。内容在你确认提交后才会发出,提交前可以修改。插件本身不会发送任何内容。',
|
|
334
|
+
'feedback.public': 'Issue 公开可见,需要 GitHub 账号。请勿填写密钥、令牌等敏感信息。',
|
|
335
|
+
'feedback.submit': '前往 GitHub 提交',
|
|
336
|
+
'feedback.copy': '复制内容',
|
|
337
|
+
'feedback.copied': '已复制',
|
|
338
|
+
'feedback.copyFailed': '复制失败,请手动复制。',
|
|
339
|
+
'feedback.clipped': '内容较长,链接中仅包含开头部分。点击按钮时会同时复制完整内容,请在 GitHub 页面中粘贴。',
|
|
340
|
+
'feedback.cutNote': '(内容过长,此处已截断。完整内容已复制到剪贴板,请粘贴替换。)',
|
|
341
|
+
'feedback.others': '查看已有反馈',
|
|
342
|
+
'feedback.send': '提交',
|
|
343
|
+
'feedback.sending': '正在提交…',
|
|
344
|
+
'feedback.sent': '提交成功,感谢你的反馈。',
|
|
345
|
+
'feedback.failed': '提交失败({code}),已填写的内容仍保留。请重试,或使用以下方式:',
|
|
346
|
+
'feedback.failedBusy': '提交过于频繁,请一分钟后重试,或使用以下方式:',
|
|
347
|
+
'feedback.howDirect': '提交后,反馈内容和上方列出的运行环境信息将发送至项目的反馈服务,仅维护者可见,不会公开。请勿填写密钥、令牌等敏感信息。',
|
|
348
|
+
changedCount: '已修改 {count} 项',
|
|
349
|
+
modelsTitle: '本地向量模型',
|
|
350
|
+
modelsIntro: '可选。使用本地模型后,将按语义而非关键词检索记忆,全部在本机完成。点击按钮前不会下载或安装任何内容。',
|
|
351
|
+
modelsLink: '各检索方式的实测效果',
|
|
352
|
+
modelsLoading: '正在读取模型列表…',
|
|
353
|
+
modelsFailed: '模型列表不可用({code})。',
|
|
354
|
+
colSize: '下载', colMemory: '运行内存', colLanguages: '语言', colLicence: '许可证',
|
|
355
|
+
memoryAbout: '约 {mb} MB', memoryUnknown: '未测量',
|
|
356
|
+
'language.zh': '中文', 'language.en': '英文', 'language.multilingual': '多语言',
|
|
357
|
+
unverified: '尚未测试',
|
|
358
|
+
actInstall: '下载并启用', actDownloading: '下载中 {percent}%', actDownloadingPlain: '下载中…',
|
|
359
|
+
actCancel: '取消', actUse: '启用', actActive: '使用中', actLoading: '加载中…', actRemove: '删除',
|
|
360
|
+
acceptLabel: '我已阅读并同意 {name}',
|
|
361
|
+
confirmAddon: '将通过 DSH 的插件管理器从 npm 安装插件 dsh-feiyu-memgate-embed(先检查其是否支持当前 DSH),然后下载 {model}({size})并启用。该插件依赖含原生二进制文件的 node-llama-cpp:CPU 版本约占用 90 MB 磁盘;在 Windows 和 Linux x64 上,pnpm 还会获取 GPU 版本,最多约 740 MB。模型仅使用 CPU 运行。在 Windows 上,引擎需要 Microsoft Visual C++ 2015-2022 运行库(x64),大多数 Windows 系统已自带。',
|
|
362
|
+
confirmYes: '安装', confirmNo: '取消',
|
|
363
|
+
declined: '未安装任何内容。需要时可再次点击按钮。',
|
|
364
|
+
todo: '处理方法:',
|
|
365
|
+
'phase.addon': '正在安装向量插件…',
|
|
366
|
+
'phase.addon-starting': '向量插件已安装,等待其启动…',
|
|
367
|
+
'phase.model': '正在下载 {model}…',
|
|
368
|
+
'phase.modelPercent': '正在下载 {model}:{percent}%',
|
|
369
|
+
'phase.activating': '正在启用 {model}…',
|
|
370
|
+
'phase.done': '{model} 已启用,检索方式随之切换(见上方状态)。',
|
|
371
|
+
'installState.installing': '宿主正在安装',
|
|
372
|
+
'installState.applying': '宿主正在启动',
|
|
373
|
+
'installState.cancelling': '正在取消',
|
|
374
|
+
actResume: '继续下载',
|
|
375
|
+
'phase.paused': '{model} 的下载已中断(DSH 已重启),已下载的部分会保留。',
|
|
376
|
+
'phase.builds': '安装等待你的决定:',
|
|
377
|
+
buildsAllow: '允许脚本并继续', buildsDeny: '不允许',
|
|
378
|
+
pinned: '已在向量插件的设置中指定',
|
|
379
|
+
'trial.intro': '输入一句话,看网关会想起哪几条记忆、各多少分,没给出的是在哪一步去掉的。这里不会改动任何记忆,也不算作一次使用。',
|
|
380
|
+
'trial.placeholder': '例如:我早上喜欢喝什么茶',
|
|
381
|
+
'trial.inputLabel': '要试的话',
|
|
382
|
+
'trial.run': '试一下',
|
|
383
|
+
'trial.busy': '正在查…',
|
|
384
|
+
'trial.summary': '找到 {found} 条候选,给出 {given} 条。',
|
|
385
|
+
'trial.none': '没有找到相关的记忆。',
|
|
386
|
+
'trial.note': '这里显示的是网关的结果。对话里,插件还会按设置跳过已经给过的记忆。',
|
|
387
|
+
'trial.partial': '有存储没有查到,结果可能不全。',
|
|
388
|
+
'trial.delivered': '会给出',
|
|
389
|
+
'trial.leftOut': '没给出',
|
|
390
|
+
'trial.linked': '关联带出',
|
|
391
|
+
'trial.field.speaker': '{who} 说的',
|
|
392
|
+
'trial.field.about': '关于 {who}',
|
|
393
|
+
'trial.field.channel': '渠道 {channel}',
|
|
394
|
+
'trial.field.eventDate': '发生在 {date}',
|
|
395
|
+
'trial.origin.said': '自动记录',
|
|
396
|
+
'trial.origin.tool': '工具记下',
|
|
397
|
+
'trial.origin.curated': '所有者写的',
|
|
398
|
+
'trial.origin.derived': '整理得出',
|
|
399
|
+
'trial.kind.identity': '身份',
|
|
400
|
+
'trial.kind.preference': '偏好',
|
|
401
|
+
'trial.kind.event': '事件',
|
|
402
|
+
'trial.kind.plan': '计划',
|
|
403
|
+
'trial.kind.entity': '实体',
|
|
404
|
+
'trial.noText': '(这条没有带回原文)',
|
|
405
|
+
'trial.reason.min_score': '相似度低于分数线',
|
|
406
|
+
'trial.reason.relative_score': '和最相关的一条差得太多',
|
|
407
|
+
'trial.reason.fill_text': '没有读到原文',
|
|
408
|
+
'trial.reason.drop_oversize': '太长',
|
|
409
|
+
'trial.reason.redact': '脱敏后没有内容',
|
|
410
|
+
'trial.reason.dedupe': '和前面一条重复',
|
|
411
|
+
'trial.reason.budget': '超出字数预算',
|
|
412
|
+
'trial.reason.drop_marker': '带有排除标记',
|
|
413
|
+
'trial.reason.over_limit': '超过每次最多 {limit} 条',
|
|
414
|
+
'trial.reason.not_reached': '时间不够,没有轮到',
|
|
415
|
+
'trial.reason.other': '在 {stage} 这一步去掉',
|
|
416
|
+
'trial.error.unavailable': '网关还没有准备好,稍后再试。',
|
|
417
|
+
'trial.error.unsupported': '这个网关不支持试召回:需要较新的网关,并在它的配置里给这个客户端打开 explain。',
|
|
418
|
+
'trial.error.no-recall': '这句话太短,或者只是一句应答,对话里不会为它召回。',
|
|
419
|
+
'trial.error.failed': '没有查成,稍后再试。',
|
|
420
|
+
'trial.error.network': '没有查成,稍后再试。',
|
|
421
|
+
},
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
/** The page's dictionaries: the static copy plus every group, field and option of FIELDS, per language. */
|
|
425
|
+
function dictionaries() {
|
|
426
|
+
const out = {}
|
|
427
|
+
for (const lang of ['en', 'zh']) {
|
|
428
|
+
const dict = Object.assign({}, UI[lang])
|
|
429
|
+
for (const group of FIELDS) {
|
|
430
|
+
dict['g.' + group.group] = group.label[lang]
|
|
431
|
+
dict['gh.' + group.group] = group.help[lang]
|
|
432
|
+
for (const field of group.fields) {
|
|
433
|
+
const k = group.group + '.' + field.key
|
|
434
|
+
dict['f.' + k] = field.label[lang]
|
|
435
|
+
dict['h.' + k] = field.help[lang]
|
|
436
|
+
for (const option of field.options || []) dict['o.' + k + '.' + option.value] = option.label[lang]
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
out[lang] = dict
|
|
440
|
+
}
|
|
441
|
+
return out
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
module.exports = { UI, dictionaries }
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
// Entry point: the module the host loads. It registers the page's dictionaries, its stylesheet and
|
|
4
|
+
// the settings page in the Plugins page's row slot, and exposes `internals` for tests. Wiring only;
|
|
5
|
+
// no page logic here.
|
|
6
|
+
|
|
7
|
+
const { NS, ROW_KEY, STATUS_ROUTE, MODELS_ROUTE, CHANGELOG_ROUTE, TRY_ROUTE, TRIAL_MAX_CHARS, ART_ROUTE } = require('./constants.cjs')
|
|
8
|
+
const { FIELDS, INDEX } = require('./fields.cjs')
|
|
9
|
+
const { dictionaries } = require('./i18n.cjs')
|
|
10
|
+
const { TABS, placedKeys } = require('./layout.cjs')
|
|
11
|
+
const { fetchChangelog, fetchStatus, fetchModels, postModels, tryRecall, sendFeedback } = require('./net.cjs')
|
|
12
|
+
const { copyText } = require('./clipboard.cjs')
|
|
13
|
+
const { entryDate, releases } = require('./model/changelog.cjs')
|
|
14
|
+
const feedback = require('./model/feedback.cjs')
|
|
15
|
+
const trial = require('./model/trial.cjs')
|
|
16
|
+
const { fieldView, buildOps, saveDraft, checkText } = require('./model/form.cjs')
|
|
17
|
+
const { pickText, formatSize, memoryText, modelActions, chainLine, sameProblem } = require('./model/models.cjs')
|
|
18
|
+
const { formatCount, summarise } = require('./model/overview.cjs')
|
|
19
|
+
const { splitOption, isMet, sectionView, pageView, savable } = require('./model/page.cjs')
|
|
20
|
+
const { statusRows } = require('./model/status.cjs')
|
|
21
|
+
const { STYLE_ID, installStyles } = require('./theme/styles.cjs')
|
|
22
|
+
const { stepText } = require('./kit/controls.cjs')
|
|
23
|
+
const { emptyFeedback, FeedbackTab, Nag } = require('./view/feedback.cjs')
|
|
24
|
+
const { FieldRow, fieldId } = require('./view/field-row.cjs')
|
|
25
|
+
const { Hero, artUrl } = require('./view/hero.cjs')
|
|
26
|
+
const { inlineMarkdown, renderMarkdown } = require('./view/markdown.cjs')
|
|
27
|
+
const { ModelRow, ModelsPanel } = require('./view/models.cjs')
|
|
28
|
+
const { Footer, SaveBar, SettingsBody, SettingsPage } = require('./view/page.cjs')
|
|
29
|
+
const { SettingsTab } = require('./view/settings-tab.cjs')
|
|
30
|
+
const { TrialPanel, TrialRow } = require('./view/trial.cjs')
|
|
31
|
+
const { ChangelogTab, OverviewTab } = require('./view/tabs.cjs')
|
|
32
|
+
|
|
33
|
+
const name = 'dsh-feiyu-memgate'
|
|
34
|
+
const inject = ['slots', 'locale']
|
|
35
|
+
|
|
36
|
+
function apply(ctx) {
|
|
37
|
+
ctx.effect(() => ctx.locale.register(NS, dictionaries()), 'dsh-feiyu-memgate: dictionaries')
|
|
38
|
+
// The stylesheet lives as long as the plugin is loaded: the effect's return value removes it.
|
|
39
|
+
ctx.effect(() => installStyles(typeof document === 'undefined' ? undefined : document), 'dsh-feiyu-memgate: stylesheet')
|
|
40
|
+
const t = ctx.locale.bind(NS)
|
|
41
|
+
ctx.slots.inject('plugins.row.config', () => ctx.slots.register({
|
|
42
|
+
name: 'plugins.row.config',
|
|
43
|
+
key: ROW_KEY,
|
|
44
|
+
locale: NS,
|
|
45
|
+
inject: () => ({ translate: t }),
|
|
46
|
+
}, SettingsPage))
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
module.exports = {
|
|
50
|
+
name,
|
|
51
|
+
inject,
|
|
52
|
+
apply,
|
|
53
|
+
// For tests and the preview (scripts/preview-client.mjs): the page's pure parts and its components.
|
|
54
|
+
internals: {
|
|
55
|
+
// tables and names
|
|
56
|
+
FIELDS, INDEX, TABS, NS, ROW_KEY, STATUS_ROUTE, MODELS_ROUTE, CHANGELOG_ROUTE, TRY_ROUTE, TRIAL_MAX_CHARS, ART_ROUTE, STYLE_ID,
|
|
57
|
+
dictionaries, placedKeys,
|
|
58
|
+
// calls to the host half
|
|
59
|
+
fetchStatus, fetchChangelog, fetchModels, postModels, tryRecall, sendFeedback,
|
|
60
|
+
// logic
|
|
61
|
+
fieldView, buildOps, saveDraft, checkText, splitOption, isMet, sectionView, pageView, savable,
|
|
62
|
+
statusRows, summarise, formatCount, entryDate, releases,
|
|
63
|
+
pickText, formatSize, memoryText, modelActions, chainLine, sameProblem, stepText, fieldId, artUrl,
|
|
64
|
+
feedback, trial, emptyFeedback, copyText,
|
|
65
|
+
// view
|
|
66
|
+
installStyles, inlineMarkdown, renderMarkdown,
|
|
67
|
+
Hero, FieldRow, SettingsTab, OverviewTab, ChangelogTab, FeedbackTab, Nag, ModelRow, ModelsPanel, TrialPanel, TrialRow, SaveBar, Footer, SettingsBody, SettingsPage,
|
|
68
|
+
},
|
|
69
|
+
}
|