{"version":3,"file":"tasks.server.mjs","names":[],"sources":["../../../../../../../../src/extensions/workspaces/sessions/(backend)/command/_lib/tasks.server.ts"],"sourcesContent":["import type { WithRoot } from '@agimon-ai/doompi-core/extension-file';\nimport type { DoomHeadlessExecutionContext } from '@agimon-ai/doompi-core/headless';\nimport type { DoomServerPluginContext } from '@agimon-ai/doompi-core/server-facet';\n\nimport { COMMAND_NAME } from '../../../../../../constants/task';\nimport { reducerAction } from '../../../../../../services/taskTool';\nimport type { TaskServerScope } from '../../_lib/root.server';\n\nexport default (context: WithRoot<DoomServerPluginContext, TaskServerScope>) => ({\n  name: COMMAND_NAME,\n  description: 'List or clear the persistent task graph.',\n  async execute(args: string, commandContext: DoomHeadlessExecutionContext) {\n    const action = args.trim() === 'clear' ? 'clear' : 'list';\n    const response = await reducerAction(context.root.store, action, { action }, context.root.maxTasks);\n    const content = response.content[0];\n    await commandContext.client.notify({\n      body: content?.type === 'text' ? content.text : 'No tasks',\n      level: 'info',\n    });\n  },\n});\n"],"mappings":";;;AAQA,IAAA,wBAAgB,aAAiE;CAC/E,MAAM;CACN,aAAa;CACb,MAAM,QAAQ,MAAc,gBAA8C;EACxE,MAAM,SAAS,KAAK,KAAK,MAAM,UAAU,UAAU;EAEnD,MAAM,WAAU,MADO,cAAc,QAAQ,KAAK,OAAO,QAAQ,EAAE,OAAO,GAAG,QAAQ,KAAK,QAAQ,EAAA,CACzE,QAAQ;EACjC,MAAM,eAAe,OAAO,OAAO;GACjC,MAAM,SAAS,SAAS,SAAS,QAAQ,OAAO;GAChD,OAAO;EACT,CAAC;CACH;AACF"}