Inherit agent presets and auto-bind IM delivery targets (0.1.7).

Cron jobs created from WhatsApp can omit bot/target ids and reuse chat overrides; sidebar/agent preset pins persist on fire.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-09-06 02:31:43 +08:00
parent 2f08136adf
commit 2e690c30c8
15 changed files with 830 additions and 82 deletions

View file

@ -2,7 +2,7 @@
* dsh-ops-cron, node half.
*
* Durable scheduled jobs: create a fresh root Session on fire, hide that
* session from the workspace list, and keep history under 运维定时.
* session from the workspace list, and keep history under 定时任务.
* Jobs may deliver summaries to IM via soft-injected ctx.dshIm.
*
* Do not list @deepseek-ai/* in package.json — resolve schemastery from the
@ -131,6 +131,7 @@ function registerWebRoute(ctx, handler) {
export function apply(ctx, config = {}) {
const entry = resolveConfig(config)
const getDshIm = () => tryGet(ctx, 'dshIm')
const getAgentPresets = () => tryGet(ctx, 'agentPresets')
const service = createHostService({
sessionPort: makeLiveSessionPort(ctx),
getDshIm,
@ -143,7 +144,7 @@ export function apply(ctx, config = {}) {
})
ctx.inject(['tools'], (tctx) => {
registerCronTools(tctx, service, { getDshIm })
registerCronTools(tctx, service, { getDshIm, getAgentPresets })
tctx.logger?.info?.('[dsh-ops-cron] tools cron_create/list/pause/resume/delete registered')
})