Skip to content

A team of long-lived bots for DeepSeek Harness, with main bots, bot-to-bot messages and group chats.

Merge remote-tracking branch 'origin/dev' into fix/521-scope-bot-tools

Fei2411a84e37fa1d22
diff --cc ds-bot/test/bot-messages.test.js
index 693bbc84,5bacc2d7..a01c5b1c
--- a/ds-bot/test/bot-messages.test.js
+++ b/ds-bot/test/bot-messages.test.js
@@@ -4,14 -4,16 +4,18 @@@ import { tmpdir } from 'node:os
import { join } from 'node:path'
import { setTimeout as delay } from 'node:timers/promises'
import { test } from 'node:test'
+ import { Context } from '@deepseek-ai/cordis'
+ import { Session } from '@deepseek-ai/dsh-session'
+ import TokenMeter from '@deepseek-ai/dsh-token-meter'
-import { apply } from '../index.js'
+import { createRuntime } from '../index.js'
import { fakeAttachments, fakeContext } from './fake-ctx.js'
import { install as installTurns } from '../src/host/turns.js'
import { install as installParts } from '../src/host/parts.js'
- import { SOURCE_KIND } from '../src/host/constants.js'
+ import { HANDOFF_ACK, SOURCE_KIND } from '../src/host/constants.js'
+ import { estimateTokens } from '../src/host/text.js'
+let rt
+
// A two-Bot team, optionally with b in a group Session 'gb' of room 'Ops'.
function team({ group = false } = {}) {
return {
@@@ -90,9 -93,11 +95,11 @@@ async function start(seed)
route = options
return register(options)
}
- apply(ctx, { home })
+ rt = createRuntime(ctx, { home })
let seq = 0
const emit = (id, type, data, extra) => {
+ if (type === 'user/message') agentOf(id).session.deriveMessages().push({ role: 'user', content: data.content, source: data.source })
+ if (type === 'assistant/message') agentOf(id).session.deriveMessages().push({ ...data.message, role: 'assistant' })
for (const listener of ctx.listeners.get('session/event') ?? []) {
if (listener.length >= 2) listener({ id }, { type, seq: ++seq, data, ...extra })
}
diff --cc ds-bot/test/work-dir.test.js
index 27c05542,d0f32db7..676dca75
--- a/ds-bot/test/work-dir.test.js
+++ b/ds-bot/test/work-dir.test.js
@@@ -3,13 -3,11 +3,13 @@@ import { existsSync, mkdirSync, mkdtemp
import { homedir, hostname, tmpdir } from 'node:os'
import { join, resolve } from 'node:path'
import { test } from 'node:test'
-import { apply } from '../index.js'
+import { createRuntime } from '../index.js'
import { dshHomeOf } from '../src/host/folders.js'
import { escapeRegExp } from '../src/host/text.js'
- import { fakeContext } from './fake-ctx.js'
+ import { fakeApproval, fakeContext } from './fake-ctx.js'
+let rt
+
// A Main Bot and a Bot, with the Bot in the group Ops through its group Session 'gb'.
const TEAM = {
version: 1,