flightdesk 0.3.3 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/main.js +71 -5
- package/main.js.map +2 -2
- package/package.json +1 -1
package/main.js
CHANGED
|
@@ -3216,6 +3216,7 @@ var FlightDeskAPI = class _FlightDeskAPI {
|
|
|
3216
3216
|
status
|
|
3217
3217
|
branchName
|
|
3218
3218
|
prUrl
|
|
3219
|
+
prNumber
|
|
3219
3220
|
sessionViewUrl
|
|
3220
3221
|
sessionTeleportId
|
|
3221
3222
|
}
|
|
@@ -3296,6 +3297,22 @@ var FlightDeskAPI = class _FlightDeskAPI {
|
|
|
3296
3297
|
const result = await this.graphql(query, { input });
|
|
3297
3298
|
return result.userTasks;
|
|
3298
3299
|
}
|
|
3300
|
+
async syncTaskChecks(taskId) {
|
|
3301
|
+
const query = `
|
|
3302
|
+
mutation SyncTaskChecks($taskId: String!) {
|
|
3303
|
+
userSyncTaskChecks(taskId: $taskId) {
|
|
3304
|
+
synced
|
|
3305
|
+
checks {
|
|
3306
|
+
integration
|
|
3307
|
+
reviewer
|
|
3308
|
+
status
|
|
3309
|
+
}
|
|
3310
|
+
}
|
|
3311
|
+
}
|
|
3312
|
+
`;
|
|
3313
|
+
const result = await this.graphql(query, { taskId });
|
|
3314
|
+
return result.userSyncTaskChecks;
|
|
3315
|
+
}
|
|
3299
3316
|
// ============================================================================
|
|
3300
3317
|
// Project Operations
|
|
3301
3318
|
// ============================================================================
|
|
@@ -3649,7 +3666,8 @@ async function registerCommand(taskId, options) {
|
|
|
3649
3666
|
const task2 = await api.createTask({
|
|
3650
3667
|
projectId,
|
|
3651
3668
|
title: options.title,
|
|
3652
|
-
description: options.description
|
|
3669
|
+
description: options.description,
|
|
3670
|
+
subprojectId: options.subproject
|
|
3653
3671
|
});
|
|
3654
3672
|
actualTaskId = task2.id;
|
|
3655
3673
|
console.log(`\u2705 Created task: ${task2.id}`);
|
|
@@ -3868,6 +3886,9 @@ async function taskCommand(action, options) {
|
|
|
3868
3886
|
case "update":
|
|
3869
3887
|
await handleUpdate(api, options);
|
|
3870
3888
|
break;
|
|
3889
|
+
case "sync":
|
|
3890
|
+
await handleSync(api, options);
|
|
3891
|
+
break;
|
|
3871
3892
|
}
|
|
3872
3893
|
} catch (error) {
|
|
3873
3894
|
console.error(`Error: ${error}`);
|
|
@@ -3879,7 +3900,8 @@ async function handleCreate(api, options) {
|
|
|
3879
3900
|
const task2 = await api.createTask({
|
|
3880
3901
|
projectId: options.project,
|
|
3881
3902
|
title: options.title,
|
|
3882
|
-
description: options.description
|
|
3903
|
+
description: options.description,
|
|
3904
|
+
subprojectId: options.subproject
|
|
3883
3905
|
});
|
|
3884
3906
|
console.log(`
|
|
3885
3907
|
\u2705 Task created`);
|
|
@@ -3929,6 +3951,7 @@ ${task2.description}`);
|
|
|
3929
3951
|
console.log("");
|
|
3930
3952
|
if (task2.branchName) console.log(`Branch: ${task2.branchName}`);
|
|
3931
3953
|
if (task2.prUrl) console.log(`PR: ${task2.prUrl}`);
|
|
3954
|
+
if (task2.prNumber) console.log(`PR #: ${task2.prNumber}`);
|
|
3932
3955
|
if (task2.sessionViewUrl) console.log(`Session: ${task2.sessionViewUrl}`);
|
|
3933
3956
|
if (task2.sessionTeleportId) {
|
|
3934
3957
|
console.log(`Resume: claude --teleport ${task2.sessionTeleportId}`);
|
|
@@ -3981,7 +4004,49 @@ async function handleUpdate(api, options) {
|
|
|
3981
4004
|
console.log(` Status: ${task2.status}`);
|
|
3982
4005
|
if (task2.branchName) console.log(` Branch: ${task2.branchName}`);
|
|
3983
4006
|
if (task2.prUrl) console.log(` PR: ${task2.prUrl}`);
|
|
4007
|
+
if (task2.prNumber) console.log(` PR #: ${task2.prNumber}`);
|
|
3984
4008
|
if (task2.sessionViewUrl) console.log(` Session: ${task2.sessionViewUrl}`);
|
|
4009
|
+
if (options.prUrl) {
|
|
4010
|
+
console.log(`
|
|
4011
|
+
\u{1F504} Syncing PR review state...`);
|
|
4012
|
+
try {
|
|
4013
|
+
const syncResult = await api.syncTaskChecks(options.taskId);
|
|
4014
|
+
printSyncResult(syncResult);
|
|
4015
|
+
} catch (err) {
|
|
4016
|
+
console.log(` \u26A0\uFE0F Sync failed (checks will update when webhooks arrive): ${err}`);
|
|
4017
|
+
}
|
|
4018
|
+
}
|
|
4019
|
+
}
|
|
4020
|
+
async function handleSync(api, options) {
|
|
4021
|
+
console.log(`Syncing PR review state for task ${options.taskId}...`);
|
|
4022
|
+
const syncResult = await api.syncTaskChecks(options.taskId);
|
|
4023
|
+
printSyncResult(syncResult);
|
|
4024
|
+
}
|
|
4025
|
+
function printSyncResult(result) {
|
|
4026
|
+
if (result.synced === 0) {
|
|
4027
|
+
console.log(` No review feedback found on the PR.`);
|
|
4028
|
+
return;
|
|
4029
|
+
}
|
|
4030
|
+
console.log(`
|
|
4031
|
+
Found ${result.synced} review check(s):`);
|
|
4032
|
+
for (const check of result.checks) {
|
|
4033
|
+
const icon = getCheckIcon(check.status);
|
|
4034
|
+
console.log(` ${icon} ${check.integration} (${check.reviewer}): ${check.status}`);
|
|
4035
|
+
}
|
|
4036
|
+
}
|
|
4037
|
+
function getCheckIcon(status) {
|
|
4038
|
+
switch (status) {
|
|
4039
|
+
case "PASSED":
|
|
4040
|
+
return "\u2705";
|
|
4041
|
+
case "FAILED":
|
|
4042
|
+
return "\u274C";
|
|
4043
|
+
case "PENDING":
|
|
4044
|
+
return "\u23F3";
|
|
4045
|
+
case "SKIPPED":
|
|
4046
|
+
return "\u23ED\uFE0F";
|
|
4047
|
+
default:
|
|
4048
|
+
return "\u2753";
|
|
4049
|
+
}
|
|
3985
4050
|
}
|
|
3986
4051
|
function getStatusEmoji2(status) {
|
|
3987
4052
|
switch (status) {
|
|
@@ -4572,7 +4637,7 @@ async function handleTeardown(api, options) {
|
|
|
4572
4637
|
|
|
4573
4638
|
// apps/cli/src/main.ts
|
|
4574
4639
|
var program2 = new Command();
|
|
4575
|
-
program2.name("flightdesk").description("FlightDesk CLI - AI task management for Claude Code sessions").version("0.
|
|
4640
|
+
program2.name("flightdesk").description("FlightDesk CLI - AI task management for Claude Code sessions").version("0.4.1").option("--dev", "Use local development API (localhost:3000)").option("--api <url>", "Use custom API URL");
|
|
4576
4641
|
program2.hook("preAction", () => {
|
|
4577
4642
|
const opts = program2.opts();
|
|
4578
4643
|
if (opts.api) {
|
|
@@ -4585,14 +4650,15 @@ program2.hook("preAction", () => {
|
|
|
4585
4650
|
}
|
|
4586
4651
|
});
|
|
4587
4652
|
program2.command("init").description("Configure FlightDesk CLI with your API credentials").action(initCommand);
|
|
4588
|
-
program2.command("register [task-id]").description("Register a Claude Code session with a FlightDesk task (auto-detects project from git repo)").option("-p, --project <id>", "Project ID (auto-detected from git repo if not provided)").option("--view-url <url>", "Claude Code session view URL").option("--teleport-id <id>", "Claude Code teleport ID").option("--title <title>", "Task title (creates new task if task-id not provided)").option("--description <description>", "Task description").action(registerCommand);
|
|
4653
|
+
program2.command("register [task-id]").description("Register a Claude Code session with a FlightDesk task (auto-detects project from git repo)").option("-p, --project <id>", "Project ID (auto-detected from git repo if not provided)").option("--subproject <id>", "Subproject ID (required if project has subprojects configured)").option("--view-url <url>", "Claude Code session view URL").option("--teleport-id <id>", "Claude Code teleport ID").option("--title <title>", "Task title (creates new task if task-id not provided)").option("--description <description>", "Task description").action(registerCommand);
|
|
4589
4654
|
var project = program2.command("project").description("Project management commands");
|
|
4590
4655
|
project.command("list").description("List projects in the active organization").action(() => projectCommand("list", {}));
|
|
4591
4656
|
var task = program2.command("task").description("Task management commands");
|
|
4592
|
-
task.command("create").description("Create a new task").requiredOption("-p, --project <id>", "Project ID").requiredOption("-t, --title <title>", "Task title").option("-d, --description <description>", "Task description").action((options) => taskCommand("create", options));
|
|
4657
|
+
task.command("create").description("Create a new task").requiredOption("-p, --project <id>", "Project ID").requiredOption("-t, --title <title>", "Task title").option("-d, --description <description>", "Task description").option("--subproject <id>", "Subproject ID (required if project has subprojects configured)").action((options) => taskCommand("create", options));
|
|
4593
4658
|
task.command("list").description("List tasks").option("-p, --project <id>", "Filter by project ID").option("--status <status>", "Filter by status").action((options) => taskCommand("list", options));
|
|
4594
4659
|
task.command("status <task-id>").description("Get task status").action((taskId) => taskCommand("status", { taskId }));
|
|
4595
4660
|
task.command("update <task-id>").description("Update task").option("-s, --status <status>", "New status").option("--branch <branch>", "Branch name").option("--pr-url <url>", "Pull request URL").option("--pr-number <number>", "Pull request number (use if --pr-url is not enough)").option("--session <session>", "Claude Code session (URL or session ID)").action((taskId, options) => taskCommand("update", { taskId, ...options }));
|
|
4661
|
+
task.command("sync <task-id>").description("Sync PR review state (Copilot feedback, Claude reviews, human reviews) from GitHub").action((taskId) => taskCommand("sync", { taskId }));
|
|
4596
4662
|
program2.command("status").description("Show status of all active tasks").option("-p, --project <id>", "Filter by project").action(statusCommand);
|
|
4597
4663
|
program2.command("prompt <task-id>").description("Get a prompt for a task (ready to paste into Claude)").option("--type <type>", "Prompt type: review, test_plan, summary, handoff", "review").action(promptCommand);
|
|
4598
4664
|
var org = program2.command("org").description("Organization management");
|