fix: use llm message factory for command messages
This commit is contained in:
1 parent
76482acfc6
commit
e469c84e4f
1 file changed
+2
-3
@@ -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({
|
||||
|
||||
Reference in new issue
Block a user