dsh-foxy-memory 0.2.9 → 0.3.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.
Files changed (3) hide show
  1. package/LICENSE +1 -1
  2. package/lib/index.js +16 -1
  3. package/package.json +9 -8
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/lib/index.js CHANGED
@@ -262,9 +262,16 @@ export function apply(ctx, config = {}) {
262
262
  const messages = pendingBySession.get(key)
263
263
  if (!messages?.length) return { created: 0 }
264
264
  try {
265
+ const first = messages[0] || {}
265
266
  const result = await bridgePost('/ingest', {
266
267
  presetId: bridgePresetId,
267
268
  sessionId: key,
269
+ scene: first.scene || 'dsh',
270
+ platform: first.platform || 'dsh',
271
+ channelType: first.channelType || 'private',
272
+ channelId: first.channelId || key,
273
+ eventType: first.eventType || 'conversation',
274
+ sourceLabel: first.sourceLabel || 'DSH',
268
275
  messages,
269
276
  })
270
277
  pendingBySession.delete(key)
@@ -316,6 +323,14 @@ export function apply(ctx, config = {}) {
316
323
  role: input.role,
317
324
  text: input.text,
318
325
  at: input.at || Date.now(),
326
+ scene: input.scene || 'dsh',
327
+ platform: input.platform || 'dsh',
328
+ sourceLabel: input.sourceLabel || 'DSH',
329
+ eventType: input.eventType || 'conversation',
330
+ channelType: input.channelType || 'private',
331
+ channelId: input.channelId || sessionId,
332
+ title: input.title || '',
333
+ url: input.url || '',
319
334
  })
320
335
  if (messages.length >= batchSize) await flushSession(sessionId)
321
336
  return {
@@ -377,4 +392,4 @@ export function apply(ctx, config = {}) {
377
392
  reload: async () => { entries.clear(); await init() },
378
393
  }
379
394
  }
380
-
395
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-foxy-memory",
3
- "version": "0.2.9",
3
+ "version": "0.3.0",
4
4
  "description": "Memory subplugin for dsh-foxy: local JSONL archive plus optional ChatLuna LivingMemory bridge, recall and search.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -35,10 +35,11 @@
35
35
  ],
36
36
  "license": "MIT"
37
37
  }
38
-
39
-
40
-
41
-
42
-
43
-
44
-
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+