diff --git a/index.js b/index.js index 41aef4a..99c4a82 100644 --- a/index.js +++ b/index.js @@ -2,8 +2,7 @@ import fs from 'node:fs' import path from 'node:path' import os from 'node:os' import crypto from 'node:crypto' -import { CommandDefinitionId } from '@deepseek-ai/dsh-commands/brand' - +import { createUserMessage } from '@deepseek-ai/dsh-llm' export const name = 'dsh-queue-steer' export const inject = { commands: { required: true }, webServer: { required: true }, connection: { required: true } } const file = path.join(process.env.DSH_PROFILE_DIR || path.join(process.env.DSH_HOME || path.join(os.homedir(), '.dsh'), 'profiles', 'web'), 'dsh-queue-steer', 'settings.json') @@ -11,7 +10,7 @@ const defaults = { defaultMode: 'queue', defaultQueueList: 'batch', batchHeaderT let settings = { ...defaults } try { settings = { ...defaults, ...JSON.parse(fs.readFileSync(file, 'utf8')) } } catch {} const save = (next) => { settings = { ...settings, ...next }; fs.mkdirSync(path.dirname(file), { recursive: true }); fs.writeFileSync(file, JSON.stringify(settings, null, 2)) } -const message = (value, via) => ({ id: crypto.randomUUID(), role: 'user', content: [{ type: 'text', text: value }], source: { kind: 'user', via } }) +const message = (value, via) => createUserMessage({ content: [{ type: 'text', text: value }], source: { kind: 'queue-steer', via } }) export function apply(ctx) { const add = (name, mode) => ctx.commands.register({