tasks: inline flag (quick tasks stay in the modal) plumbed through parser + endpoints
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,7 @@ export type TaskFrontmatter = {
|
||||
description: string | null;
|
||||
version: number;
|
||||
mode: string;
|
||||
inline: boolean; // quick/interactive tasks run in the modal instead of as a background job
|
||||
language: string | null;
|
||||
args: string[] | null;
|
||||
tags: string[] | null;
|
||||
@@ -37,6 +38,7 @@ export type TaskSummary = {
|
||||
name: string;
|
||||
description: string | null;
|
||||
mode: string;
|
||||
inline: boolean;
|
||||
version: number;
|
||||
trigger: unknown;
|
||||
};
|
||||
@@ -47,6 +49,7 @@ const FM_KEYS = [
|
||||
'description',
|
||||
'version',
|
||||
'mode',
|
||||
'inline',
|
||||
'language',
|
||||
'args',
|
||||
'tags',
|
||||
@@ -105,6 +108,7 @@ function parseTaskMd(raw: string): { fm: TaskFrontmatter; body: string } {
|
||||
description: parsed.description == null ? null : String(parsed.description),
|
||||
version,
|
||||
mode: parsed.mode == null ? 'agentic' : String(parsed.mode),
|
||||
inline: parsed.inline === true,
|
||||
language: parsed.language == null ? null : String(parsed.language),
|
||||
args: asArray(parsed.args),
|
||||
tags: asArray(parsed.tags),
|
||||
@@ -160,6 +164,7 @@ export async function listTasks(): Promise<TaskSummary[]> {
|
||||
name: fm.name || entry.name,
|
||||
description: fm.description,
|
||||
mode: fm.mode,
|
||||
inline: fm.inline,
|
||||
version: fm.version,
|
||||
trigger: fm.trigger ?? [],
|
||||
});
|
||||
@@ -205,6 +210,7 @@ export async function createTask(input: CreateTaskInput): Promise<TaskSummary &
|
||||
name,
|
||||
description: input.description ?? null,
|
||||
mode,
|
||||
inline: false,
|
||||
version: 1,
|
||||
trigger: [],
|
||||
filePath: taskFile(dirName),
|
||||
|
||||
@@ -30,6 +30,7 @@ tasksRouter.get('/:name', async (ctx) => {
|
||||
name: task.name,
|
||||
description: task.description,
|
||||
mode: task.mode,
|
||||
inline: task.inline,
|
||||
language: task.language,
|
||||
body: task.body,
|
||||
implementation: task.implementation,
|
||||
|
||||
Reference in New Issue
Block a user