feat(FN-4649): complete Step 3 — register hook from CLI and pi-extension entry points
Fusion-Task-Id: FN-4649 Fusion-Task-Lineage: 98ab6ec3-5253-4db6-93f0-de4ab7792002
This commit is contained in:
committed by
gsxdsm
parent
e1410dbba1
commit
1b2302e273
@@ -7,7 +7,7 @@ import type { PlanningQuestion, PlanningSummary } from "@fusion/core";
|
||||
import { createSession, submitResponse, RateLimitError, SessionNotFoundError, InvalidSessionStateError } from "@fusion/dashboard/planning";
|
||||
import { watchFile, unwatchFile, statSync, existsSync, readFileSync } from "node:fs";
|
||||
import { basename, join } from "node:path";
|
||||
import { GitHubClient } from "@fusion/dashboard";
|
||||
import { GitHubClient, registerGithubTrackingHook } from "@fusion/dashboard";
|
||||
import {
|
||||
getGhErrorMessage,
|
||||
getCurrentRepo,
|
||||
@@ -21,6 +21,10 @@ import { findNodeByNameOrId } from "./node.js";
|
||||
const execAsync = promisify(exec);
|
||||
const STEP_STATUSES: StepStatus[] = ["pending", "in-progress", "done", "skipped"];
|
||||
|
||||
// Register GitHub tracking hook so CLI task creation paths (add, duplicate,
|
||||
// refine, import, delegate) trigger tracking issue creation.
|
||||
registerGithubTrackingHook();
|
||||
|
||||
function getGitHubIssueUrl(sourceMetadata: unknown): string | undefined {
|
||||
if (!sourceMetadata || typeof sourceMetadata !== "object") return undefined;
|
||||
const issueUrl = (sourceMetadata as { issueUrl?: unknown }).issueUrl;
|
||||
|
||||
@@ -40,6 +40,7 @@ import {
|
||||
type FinalizePlanOverride,
|
||||
fetchWebContent,
|
||||
} from "@fusion/engine";
|
||||
import { registerGithubTrackingHook } from "@fusion/dashboard";
|
||||
import { resolve, basename, extname, join } from "node:path";
|
||||
import { readFile } from "node:fs/promises";
|
||||
import { existsSync } from "node:fs";
|
||||
@@ -391,6 +392,11 @@ async function fetchGitHubIssueViaGh(
|
||||
// ── Extension entry point ──────────────────────────────────────────
|
||||
|
||||
export default function kbExtension(pi: ExtensionAPI) {
|
||||
// Register GitHub tracking hook once per extension lifecycle so that
|
||||
// fn_task_create, fn_task_import_github*, fn_delegate_task, etc.
|
||||
// trigger tracking issue creation when settings enable it.
|
||||
registerGithubTrackingHook();
|
||||
|
||||
// ── fn_task_create ───────────────────────────────────────────────
|
||||
|
||||
pi.registerTool({
|
||||
|
||||
Reference in New Issue
Block a user