feat(FN-4074): add priority option to task creation in engine and extension

Adds task priority support to the task creation flow, spanning the engine runtime (`agent-tools.ts`, `triage.ts`), the CLI extension interface (`extension.ts`), and corresponding documentation and tests. The changeset bumps `@runfusion/fusion` as a minor version.

Fusion-Task-Id: FN-4074

Fusion-Task-Lineage: 726c0ae6-90fb-4c13-ace1-215a2becb2a9
This commit is contained in:
Fusion
2026-05-11 23:31:19 -07:00
committed by gsxdsm
parent f0d4709c2e
commit e3904786ac
15 changed files with 126 additions and 5 deletions

View File

@@ -176,6 +176,7 @@ describe.skipIf(!SHOULD_RUN_EXTENSION_INTEGRATION)("built fn pi extension integr
expect(created.details.taskId).toMatch(/^[A-Z]+-\d+$/);
expect(created.details.column).toBe("triage");
expect(created.details.priority).toBe("normal");
const listTool = api.tools.get("fn_task_list")!;
const listed = await listTool.execute("list-1", {}, undefined, undefined, makeCtx(tmpDir));
@@ -186,6 +187,17 @@ describe.skipIf(!SHOULD_RUN_EXTENSION_INTEGRATION)("built fn pi extension integr
await store.init();
const persisted = await store.getTask(created.details.taskId);
expect(persisted?.description).toBe("Ship the packed CLI contract");
const urgent = await createTool.execute(
"create-2",
{ description: "Needs urgency", priority: "high" },
undefined,
undefined,
makeCtx(tmpDir),
);
expect(urgent.details.priority).toBe("high");
const urgentPersisted = await store.getTask(urgent.details.taskId);
expect(urgentPersisted?.priority).toBe("high");
});
it("runs provisioning tools through the built extension", async () => {

View File

@@ -269,6 +269,25 @@ describe.skipIf(!SHOULD_RUN_LEGACY_EXTENSION_INTEGRATION)("fn pi extension (lega
expect(result.content[0].text).toContain("Fix the login button");
expect(result.content[0].text).toContain("triage");
expect(result.details.column).toBe("triage");
expect(result.details.priority).toBe("normal");
});
it("creates a task with explicit priority", async () => {
const tool = api.tools.get("fn_task_create")!;
const result = await tool.execute(
"call-priority",
{ description: "Urgent task", priority: "urgent" },
undefined,
undefined,
makeCtx(tmpDir),
);
expect(result.details.priority).toBe("urgent");
expect(result.content[0].text).toContain("Priority: urgent");
const showTool = api.tools.get("fn_task_show")!;
const show = await showTool.execute("s-priority", { id: result.details.taskId }, undefined, undefined, makeCtx(tmpDir));
expect(show.details.task.priority).toBe("urgent");
});
it("creates a task with dependencies", async () => {