@askexenow/exe-os 0.8.50 → 0.8.52
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/dist/bin/cli.js +42 -3
- package/dist/bin/exe-boot.js +11 -1
- package/dist/bin/exe-gateway.js +11 -1
- package/dist/bin/exe-heartbeat.js +11 -1
- package/dist/bin/exe-pending-reviews.js +13 -2
- package/dist/bin/exe-session-cleanup.js +11 -1
- package/dist/bin/git-sweep.js +11 -1
- package/dist/bin/scan-tasks.js +11 -1
- package/dist/gateway/index.js +11 -1
- package/dist/hooks/bug-report-worker.js +11 -1
- package/dist/hooks/commit-complete.js +11 -1
- package/dist/hooks/ingest-worker.js +11 -1
- package/dist/hooks/pre-compact.js +11 -1
- package/dist/hooks/prompt-submit.js +11 -1
- package/dist/index.js +11 -1
- package/dist/lib/exe-daemon.js +11 -1
- package/dist/lib/tasks.js +11 -1
- package/dist/lib/tmux-routing.js +11 -1
- package/dist/mcp/server.js +43 -1
- package/dist/mcp/tools/create-task.js +11 -1
- package/dist/mcp/tools/list-tasks.js +11 -1
- package/dist/runtime/index.js +11 -1
- package/dist/tui/App.js +42 -3
- package/package.json +1 -1
package/dist/bin/cli.js
CHANGED
|
@@ -17465,8 +17465,18 @@ async function countNewPendingReviewsSince(sinceIso) {
|
|
|
17465
17465
|
});
|
|
17466
17466
|
return Number(result.rows[0]?.cnt) || 0;
|
|
17467
17467
|
}
|
|
17468
|
-
async function listPendingReviews(limit) {
|
|
17468
|
+
async function listPendingReviews(limit, sessionScope) {
|
|
17469
17469
|
const client = getClient();
|
|
17470
|
+
if (sessionScope) {
|
|
17471
|
+
const result2 = await client.execute({
|
|
17472
|
+
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
17473
|
+
WHERE status = 'needs_review'
|
|
17474
|
+
AND (session_scope = ? OR session_scope IS NULL)
|
|
17475
|
+
ORDER BY priority ASC, created_at DESC LIMIT ?`,
|
|
17476
|
+
args: [sessionScope, limit]
|
|
17477
|
+
});
|
|
17478
|
+
return result2.rows;
|
|
17479
|
+
}
|
|
17470
17480
|
const result = await client.execute({
|
|
17471
17481
|
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
17472
17482
|
WHERE status = 'needs_review'
|
|
@@ -22675,8 +22685,6 @@ function App2() {
|
|
|
22675
22685
|
setSection(SECTIONS[tabIdx].key);
|
|
22676
22686
|
setFocus("sidebar");
|
|
22677
22687
|
}
|
|
22678
|
-
} else {
|
|
22679
|
-
setFocus("content");
|
|
22680
22688
|
}
|
|
22681
22689
|
}, []));
|
|
22682
22690
|
const [focus, setFocus] = useState16("sidebar");
|
|
@@ -22889,6 +22897,37 @@ var init_App2 = __esm({
|
|
|
22889
22897
|
}
|
|
22890
22898
|
}
|
|
22891
22899
|
render_default(/* @__PURE__ */ jsx17(App2, {}));
|
|
22900
|
+
{
|
|
22901
|
+
const CLEANUP_SEQ = "\x1B[?1006l\x1B[?1002l\x1B[?1000l\x1B[?25h\x1B[?1049l";
|
|
22902
|
+
const terminalCleanup = () => {
|
|
22903
|
+
try {
|
|
22904
|
+
process.stdout.write(CLEANUP_SEQ);
|
|
22905
|
+
} catch {
|
|
22906
|
+
}
|
|
22907
|
+
};
|
|
22908
|
+
process.on("exit", terminalCleanup);
|
|
22909
|
+
for (const sig of ["SIGINT", "SIGTERM", "SIGHUP"]) {
|
|
22910
|
+
process.on(sig, () => {
|
|
22911
|
+
terminalCleanup();
|
|
22912
|
+
process.removeAllListeners(sig);
|
|
22913
|
+
process.kill(process.pid, sig);
|
|
22914
|
+
});
|
|
22915
|
+
}
|
|
22916
|
+
process.on("uncaughtException", (err) => {
|
|
22917
|
+
terminalCleanup();
|
|
22918
|
+
process.stderr.write(`
|
|
22919
|
+
${err.stack || err.message}
|
|
22920
|
+
`);
|
|
22921
|
+
process.exit(1);
|
|
22922
|
+
});
|
|
22923
|
+
process.on("unhandledRejection", (reason) => {
|
|
22924
|
+
terminalCleanup();
|
|
22925
|
+
process.stderr.write(`
|
|
22926
|
+
Unhandled rejection: ${reason}
|
|
22927
|
+
`);
|
|
22928
|
+
process.exit(1);
|
|
22929
|
+
});
|
|
22930
|
+
}
|
|
22892
22931
|
}
|
|
22893
22932
|
});
|
|
22894
22933
|
|
package/dist/bin/exe-boot.js
CHANGED
|
@@ -3346,8 +3346,18 @@ async function countNewPendingReviewsSince(sinceIso) {
|
|
|
3346
3346
|
});
|
|
3347
3347
|
return Number(result.rows[0]?.cnt) || 0;
|
|
3348
3348
|
}
|
|
3349
|
-
async function listPendingReviews(limit) {
|
|
3349
|
+
async function listPendingReviews(limit, sessionScope) {
|
|
3350
3350
|
const client = getClient();
|
|
3351
|
+
if (sessionScope) {
|
|
3352
|
+
const result2 = await client.execute({
|
|
3353
|
+
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
3354
|
+
WHERE status = 'needs_review'
|
|
3355
|
+
AND (session_scope = ? OR session_scope IS NULL)
|
|
3356
|
+
ORDER BY priority ASC, created_at DESC LIMIT ?`,
|
|
3357
|
+
args: [sessionScope, limit]
|
|
3358
|
+
});
|
|
3359
|
+
return result2.rows;
|
|
3360
|
+
}
|
|
3351
3361
|
const result = await client.execute({
|
|
3352
3362
|
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
3353
3363
|
WHERE status = 'needs_review'
|
package/dist/bin/exe-gateway.js
CHANGED
|
@@ -5487,8 +5487,18 @@ async function countNewPendingReviewsSince(sinceIso) {
|
|
|
5487
5487
|
});
|
|
5488
5488
|
return Number(result.rows[0]?.cnt) || 0;
|
|
5489
5489
|
}
|
|
5490
|
-
async function listPendingReviews(limit) {
|
|
5490
|
+
async function listPendingReviews(limit, sessionScope) {
|
|
5491
5491
|
const client = getClient();
|
|
5492
|
+
if (sessionScope) {
|
|
5493
|
+
const result2 = await client.execute({
|
|
5494
|
+
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
5495
|
+
WHERE status = 'needs_review'
|
|
5496
|
+
AND (session_scope = ? OR session_scope IS NULL)
|
|
5497
|
+
ORDER BY priority ASC, created_at DESC LIMIT ?`,
|
|
5498
|
+
args: [sessionScope, limit]
|
|
5499
|
+
});
|
|
5500
|
+
return result2.rows;
|
|
5501
|
+
}
|
|
5492
5502
|
const result = await client.execute({
|
|
5493
5503
|
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
5494
5504
|
WHERE status = 'needs_review'
|
|
@@ -1657,8 +1657,18 @@ var init_tmux_routing = __esm({
|
|
|
1657
1657
|
// src/lib/tasks-review.ts
|
|
1658
1658
|
import path12 from "path";
|
|
1659
1659
|
import { existsSync as existsSync10, readdirSync as readdirSync3, unlinkSync as unlinkSync2 } from "fs";
|
|
1660
|
-
async function listPendingReviews(limit) {
|
|
1660
|
+
async function listPendingReviews(limit, sessionScope) {
|
|
1661
1661
|
const client = getClient();
|
|
1662
|
+
if (sessionScope) {
|
|
1663
|
+
const result2 = await client.execute({
|
|
1664
|
+
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
1665
|
+
WHERE status = 'needs_review'
|
|
1666
|
+
AND (session_scope = ? OR session_scope IS NULL)
|
|
1667
|
+
ORDER BY priority ASC, created_at DESC LIMIT ?`,
|
|
1668
|
+
args: [sessionScope, limit]
|
|
1669
|
+
});
|
|
1670
|
+
return result2.rows;
|
|
1671
|
+
}
|
|
1662
1672
|
const result = await client.execute({
|
|
1663
1673
|
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
1664
1674
|
WHERE status = 'needs_review'
|
|
@@ -1638,8 +1638,18 @@ var init_tmux_routing = __esm({
|
|
|
1638
1638
|
// src/lib/tasks-review.ts
|
|
1639
1639
|
import path12 from "path";
|
|
1640
1640
|
import { existsSync as existsSync10, readdirSync as readdirSync3, unlinkSync as unlinkSync2 } from "fs";
|
|
1641
|
-
async function listPendingReviews(limit) {
|
|
1641
|
+
async function listPendingReviews(limit, sessionScope) {
|
|
1642
1642
|
const client = getClient();
|
|
1643
|
+
if (sessionScope) {
|
|
1644
|
+
const result2 = await client.execute({
|
|
1645
|
+
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
1646
|
+
WHERE status = 'needs_review'
|
|
1647
|
+
AND (session_scope = ? OR session_scope IS NULL)
|
|
1648
|
+
ORDER BY priority ASC, created_at DESC LIMIT ?`,
|
|
1649
|
+
args: [sessionScope, limit]
|
|
1650
|
+
});
|
|
1651
|
+
return result2.rows;
|
|
1652
|
+
}
|
|
1643
1653
|
const result = await client.execute({
|
|
1644
1654
|
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
1645
1655
|
WHERE status = 'needs_review'
|
|
@@ -1837,7 +1847,8 @@ var PENDING_REVIEW_LIMIT = 10;
|
|
|
1837
1847
|
async function main() {
|
|
1838
1848
|
await initStore();
|
|
1839
1849
|
await cleanupOrphanedReviews();
|
|
1840
|
-
const
|
|
1850
|
+
const sessionScope = process.env.EXE_SESSION?.replace(/^.*?(exe\d+)$/, "$1") || void 0;
|
|
1851
|
+
const rows = await listPendingReviews(PENDING_REVIEW_LIMIT, sessionScope);
|
|
1841
1852
|
if (rows.length > 0) {
|
|
1842
1853
|
console.log("[REVIEW NOTIFICATIONS]");
|
|
1843
1854
|
for (const row of rows) {
|
|
@@ -4599,8 +4599,18 @@ async function countNewPendingReviewsSince(sinceIso) {
|
|
|
4599
4599
|
});
|
|
4600
4600
|
return Number(result.rows[0]?.cnt) || 0;
|
|
4601
4601
|
}
|
|
4602
|
-
async function listPendingReviews(limit) {
|
|
4602
|
+
async function listPendingReviews(limit, sessionScope) {
|
|
4603
4603
|
const client = getClient();
|
|
4604
|
+
if (sessionScope) {
|
|
4605
|
+
const result2 = await client.execute({
|
|
4606
|
+
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
4607
|
+
WHERE status = 'needs_review'
|
|
4608
|
+
AND (session_scope = ? OR session_scope IS NULL)
|
|
4609
|
+
ORDER BY priority ASC, created_at DESC LIMIT ?`,
|
|
4610
|
+
args: [sessionScope, limit]
|
|
4611
|
+
});
|
|
4612
|
+
return result2.rows;
|
|
4613
|
+
}
|
|
4604
4614
|
const result = await client.execute({
|
|
4605
4615
|
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
4606
4616
|
WHERE status = 'needs_review'
|
package/dist/bin/git-sweep.js
CHANGED
|
@@ -2583,8 +2583,18 @@ async function countNewPendingReviewsSince(sinceIso) {
|
|
|
2583
2583
|
});
|
|
2584
2584
|
return Number(result.rows[0]?.cnt) || 0;
|
|
2585
2585
|
}
|
|
2586
|
-
async function listPendingReviews(limit) {
|
|
2586
|
+
async function listPendingReviews(limit, sessionScope) {
|
|
2587
2587
|
const client = getClient();
|
|
2588
|
+
if (sessionScope) {
|
|
2589
|
+
const result2 = await client.execute({
|
|
2590
|
+
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
2591
|
+
WHERE status = 'needs_review'
|
|
2592
|
+
AND (session_scope = ? OR session_scope IS NULL)
|
|
2593
|
+
ORDER BY priority ASC, created_at DESC LIMIT ?`,
|
|
2594
|
+
args: [sessionScope, limit]
|
|
2595
|
+
});
|
|
2596
|
+
return result2.rows;
|
|
2597
|
+
}
|
|
2588
2598
|
const result = await client.execute({
|
|
2589
2599
|
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
2590
2600
|
WHERE status = 'needs_review'
|
package/dist/bin/scan-tasks.js
CHANGED
|
@@ -3051,8 +3051,18 @@ async function countNewPendingReviewsSince(sinceIso) {
|
|
|
3051
3051
|
});
|
|
3052
3052
|
return Number(result.rows[0]?.cnt) || 0;
|
|
3053
3053
|
}
|
|
3054
|
-
async function listPendingReviews(limit) {
|
|
3054
|
+
async function listPendingReviews(limit, sessionScope) {
|
|
3055
3055
|
const client = getClient();
|
|
3056
|
+
if (sessionScope) {
|
|
3057
|
+
const result2 = await client.execute({
|
|
3058
|
+
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
3059
|
+
WHERE status = 'needs_review'
|
|
3060
|
+
AND (session_scope = ? OR session_scope IS NULL)
|
|
3061
|
+
ORDER BY priority ASC, created_at DESC LIMIT ?`,
|
|
3062
|
+
args: [sessionScope, limit]
|
|
3063
|
+
});
|
|
3064
|
+
return result2.rows;
|
|
3065
|
+
}
|
|
3056
3066
|
const result = await client.execute({
|
|
3057
3067
|
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
3058
3068
|
WHERE status = 'needs_review'
|
package/dist/gateway/index.js
CHANGED
|
@@ -3905,8 +3905,18 @@ async function countNewPendingReviewsSince(sinceIso) {
|
|
|
3905
3905
|
});
|
|
3906
3906
|
return Number(result.rows[0]?.cnt) || 0;
|
|
3907
3907
|
}
|
|
3908
|
-
async function listPendingReviews(limit) {
|
|
3908
|
+
async function listPendingReviews(limit, sessionScope) {
|
|
3909
3909
|
const client = getClient();
|
|
3910
|
+
if (sessionScope) {
|
|
3911
|
+
const result2 = await client.execute({
|
|
3912
|
+
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
3913
|
+
WHERE status = 'needs_review'
|
|
3914
|
+
AND (session_scope = ? OR session_scope IS NULL)
|
|
3915
|
+
ORDER BY priority ASC, created_at DESC LIMIT ?`,
|
|
3916
|
+
args: [sessionScope, limit]
|
|
3917
|
+
});
|
|
3918
|
+
return result2.rows;
|
|
3919
|
+
}
|
|
3910
3920
|
const result = await client.execute({
|
|
3911
3921
|
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
3912
3922
|
WHERE status = 'needs_review'
|
|
@@ -3464,8 +3464,18 @@ async function countNewPendingReviewsSince(sinceIso) {
|
|
|
3464
3464
|
});
|
|
3465
3465
|
return Number(result.rows[0]?.cnt) || 0;
|
|
3466
3466
|
}
|
|
3467
|
-
async function listPendingReviews(limit) {
|
|
3467
|
+
async function listPendingReviews(limit, sessionScope) {
|
|
3468
3468
|
const client = getClient();
|
|
3469
|
+
if (sessionScope) {
|
|
3470
|
+
const result2 = await client.execute({
|
|
3471
|
+
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
3472
|
+
WHERE status = 'needs_review'
|
|
3473
|
+
AND (session_scope = ? OR session_scope IS NULL)
|
|
3474
|
+
ORDER BY priority ASC, created_at DESC LIMIT ?`,
|
|
3475
|
+
args: [sessionScope, limit]
|
|
3476
|
+
});
|
|
3477
|
+
return result2.rows;
|
|
3478
|
+
}
|
|
3469
3479
|
const result = await client.execute({
|
|
3470
3480
|
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
3471
3481
|
WHERE status = 'needs_review'
|
|
@@ -2582,8 +2582,18 @@ async function countNewPendingReviewsSince(sinceIso) {
|
|
|
2582
2582
|
});
|
|
2583
2583
|
return Number(result.rows[0]?.cnt) || 0;
|
|
2584
2584
|
}
|
|
2585
|
-
async function listPendingReviews(limit) {
|
|
2585
|
+
async function listPendingReviews(limit, sessionScope) {
|
|
2586
2586
|
const client = getClient();
|
|
2587
|
+
if (sessionScope) {
|
|
2588
|
+
const result2 = await client.execute({
|
|
2589
|
+
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
2590
|
+
WHERE status = 'needs_review'
|
|
2591
|
+
AND (session_scope = ? OR session_scope IS NULL)
|
|
2592
|
+
ORDER BY priority ASC, created_at DESC LIMIT ?`,
|
|
2593
|
+
args: [sessionScope, limit]
|
|
2594
|
+
});
|
|
2595
|
+
return result2.rows;
|
|
2596
|
+
}
|
|
2587
2597
|
const result = await client.execute({
|
|
2588
2598
|
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
2589
2599
|
WHERE status = 'needs_review'
|
|
@@ -4103,8 +4103,18 @@ async function countNewPendingReviewsSince(sinceIso) {
|
|
|
4103
4103
|
});
|
|
4104
4104
|
return Number(result.rows[0]?.cnt) || 0;
|
|
4105
4105
|
}
|
|
4106
|
-
async function listPendingReviews(limit) {
|
|
4106
|
+
async function listPendingReviews(limit, sessionScope) {
|
|
4107
4107
|
const client = getClient();
|
|
4108
|
+
if (sessionScope) {
|
|
4109
|
+
const result2 = await client.execute({
|
|
4110
|
+
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
4111
|
+
WHERE status = 'needs_review'
|
|
4112
|
+
AND (session_scope = ? OR session_scope IS NULL)
|
|
4113
|
+
ORDER BY priority ASC, created_at DESC LIMIT ?`,
|
|
4114
|
+
args: [sessionScope, limit]
|
|
4115
|
+
});
|
|
4116
|
+
return result2.rows;
|
|
4117
|
+
}
|
|
4108
4118
|
const result = await client.execute({
|
|
4109
4119
|
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
4110
4120
|
WHERE status = 'needs_review'
|
|
@@ -3928,8 +3928,18 @@ async function countNewPendingReviewsSince(sinceIso) {
|
|
|
3928
3928
|
});
|
|
3929
3929
|
return Number(result.rows[0]?.cnt) || 0;
|
|
3930
3930
|
}
|
|
3931
|
-
async function listPendingReviews(limit) {
|
|
3931
|
+
async function listPendingReviews(limit, sessionScope) {
|
|
3932
3932
|
const client = getClient();
|
|
3933
|
+
if (sessionScope) {
|
|
3934
|
+
const result2 = await client.execute({
|
|
3935
|
+
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
3936
|
+
WHERE status = 'needs_review'
|
|
3937
|
+
AND (session_scope = ? OR session_scope IS NULL)
|
|
3938
|
+
ORDER BY priority ASC, created_at DESC LIMIT ?`,
|
|
3939
|
+
args: [sessionScope, limit]
|
|
3940
|
+
});
|
|
3941
|
+
return result2.rows;
|
|
3942
|
+
}
|
|
3933
3943
|
const result = await client.execute({
|
|
3934
3944
|
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
3935
3945
|
WHERE status = 'needs_review'
|
|
@@ -4026,8 +4026,18 @@ async function countNewPendingReviewsSince(sinceIso) {
|
|
|
4026
4026
|
});
|
|
4027
4027
|
return Number(result.rows[0]?.cnt) || 0;
|
|
4028
4028
|
}
|
|
4029
|
-
async function listPendingReviews(limit) {
|
|
4029
|
+
async function listPendingReviews(limit, sessionScope) {
|
|
4030
4030
|
const client = getClient();
|
|
4031
|
+
if (sessionScope) {
|
|
4032
|
+
const result2 = await client.execute({
|
|
4033
|
+
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
4034
|
+
WHERE status = 'needs_review'
|
|
4035
|
+
AND (session_scope = ? OR session_scope IS NULL)
|
|
4036
|
+
ORDER BY priority ASC, created_at DESC LIMIT ?`,
|
|
4037
|
+
args: [sessionScope, limit]
|
|
4038
|
+
});
|
|
4039
|
+
return result2.rows;
|
|
4040
|
+
}
|
|
4031
4041
|
const result = await client.execute({
|
|
4032
4042
|
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
4033
4043
|
WHERE status = 'needs_review'
|
package/dist/index.js
CHANGED
|
@@ -2247,8 +2247,18 @@ async function countNewPendingReviewsSince(sinceIso) {
|
|
|
2247
2247
|
});
|
|
2248
2248
|
return Number(result.rows[0]?.cnt) || 0;
|
|
2249
2249
|
}
|
|
2250
|
-
async function listPendingReviews(limit) {
|
|
2250
|
+
async function listPendingReviews(limit, sessionScope) {
|
|
2251
2251
|
const client = getClient();
|
|
2252
|
+
if (sessionScope) {
|
|
2253
|
+
const result2 = await client.execute({
|
|
2254
|
+
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
2255
|
+
WHERE status = 'needs_review'
|
|
2256
|
+
AND (session_scope = ? OR session_scope IS NULL)
|
|
2257
|
+
ORDER BY priority ASC, created_at DESC LIMIT ?`,
|
|
2258
|
+
args: [sessionScope, limit]
|
|
2259
|
+
});
|
|
2260
|
+
return result2.rows;
|
|
2261
|
+
}
|
|
2252
2262
|
const result = await client.execute({
|
|
2253
2263
|
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
2254
2264
|
WHERE status = 'needs_review'
|
package/dist/lib/exe-daemon.js
CHANGED
|
@@ -3353,8 +3353,18 @@ async function countNewPendingReviewsSince(sinceIso) {
|
|
|
3353
3353
|
});
|
|
3354
3354
|
return Number(result.rows[0]?.cnt) || 0;
|
|
3355
3355
|
}
|
|
3356
|
-
async function listPendingReviews(limit) {
|
|
3356
|
+
async function listPendingReviews(limit, sessionScope) {
|
|
3357
3357
|
const client = getClient();
|
|
3358
|
+
if (sessionScope) {
|
|
3359
|
+
const result2 = await client.execute({
|
|
3360
|
+
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
3361
|
+
WHERE status = 'needs_review'
|
|
3362
|
+
AND (session_scope = ? OR session_scope IS NULL)
|
|
3363
|
+
ORDER BY priority ASC, created_at DESC LIMIT ?`,
|
|
3364
|
+
args: [sessionScope, limit]
|
|
3365
|
+
});
|
|
3366
|
+
return result2.rows;
|
|
3367
|
+
}
|
|
3358
3368
|
const result = await client.execute({
|
|
3359
3369
|
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
3360
3370
|
WHERE status = 'needs_review'
|
package/dist/lib/tasks.js
CHANGED
|
@@ -2170,8 +2170,18 @@ async function countNewPendingReviewsSince(sinceIso) {
|
|
|
2170
2170
|
});
|
|
2171
2171
|
return Number(result.rows[0]?.cnt) || 0;
|
|
2172
2172
|
}
|
|
2173
|
-
async function listPendingReviews(limit) {
|
|
2173
|
+
async function listPendingReviews(limit, sessionScope) {
|
|
2174
2174
|
const client = getClient();
|
|
2175
|
+
if (sessionScope) {
|
|
2176
|
+
const result2 = await client.execute({
|
|
2177
|
+
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
2178
|
+
WHERE status = 'needs_review'
|
|
2179
|
+
AND (session_scope = ? OR session_scope IS NULL)
|
|
2180
|
+
ORDER BY priority ASC, created_at DESC LIMIT ?`,
|
|
2181
|
+
args: [sessionScope, limit]
|
|
2182
|
+
});
|
|
2183
|
+
return result2.rows;
|
|
2184
|
+
}
|
|
2175
2185
|
const result = await client.execute({
|
|
2176
2186
|
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
2177
2187
|
WHERE status = 'needs_review'
|
package/dist/lib/tmux-routing.js
CHANGED
|
@@ -1241,8 +1241,18 @@ async function countNewPendingReviewsSince(sinceIso) {
|
|
|
1241
1241
|
});
|
|
1242
1242
|
return Number(result.rows[0]?.cnt) || 0;
|
|
1243
1243
|
}
|
|
1244
|
-
async function listPendingReviews(limit) {
|
|
1244
|
+
async function listPendingReviews(limit, sessionScope) {
|
|
1245
1245
|
const client = getClient();
|
|
1246
|
+
if (sessionScope) {
|
|
1247
|
+
const result2 = await client.execute({
|
|
1248
|
+
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
1249
|
+
WHERE status = 'needs_review'
|
|
1250
|
+
AND (session_scope = ? OR session_scope IS NULL)
|
|
1251
|
+
ORDER BY priority ASC, created_at DESC LIMIT ?`,
|
|
1252
|
+
args: [sessionScope, limit]
|
|
1253
|
+
});
|
|
1254
|
+
return result2.rows;
|
|
1255
|
+
}
|
|
1246
1256
|
const result = await client.execute({
|
|
1247
1257
|
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
1248
1258
|
WHERE status = 'needs_review'
|
package/dist/mcp/server.js
CHANGED
|
@@ -747,6 +747,17 @@ var init_db_retry = __esm({
|
|
|
747
747
|
});
|
|
748
748
|
|
|
749
749
|
// src/lib/database.ts
|
|
750
|
+
var database_exports = {};
|
|
751
|
+
__export(database_exports, {
|
|
752
|
+
disposeDatabase: () => disposeDatabase,
|
|
753
|
+
disposeTurso: () => disposeTurso,
|
|
754
|
+
ensureSchema: () => ensureSchema,
|
|
755
|
+
getClient: () => getClient,
|
|
756
|
+
getRawClient: () => getRawClient,
|
|
757
|
+
initDatabase: () => initDatabase,
|
|
758
|
+
initTurso: () => initTurso,
|
|
759
|
+
isInitialized: () => isInitialized
|
|
760
|
+
});
|
|
750
761
|
import { createClient } from "@libsql/client";
|
|
751
762
|
async function initDatabase(config2) {
|
|
752
763
|
if (_client) {
|
|
@@ -5490,8 +5501,18 @@ async function countNewPendingReviewsSince(sinceIso) {
|
|
|
5490
5501
|
});
|
|
5491
5502
|
return Number(result.rows[0]?.cnt) || 0;
|
|
5492
5503
|
}
|
|
5493
|
-
async function listPendingReviews(limit) {
|
|
5504
|
+
async function listPendingReviews(limit, sessionScope) {
|
|
5494
5505
|
const client = getClient();
|
|
5506
|
+
if (sessionScope) {
|
|
5507
|
+
const result2 = await client.execute({
|
|
5508
|
+
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
5509
|
+
WHERE status = 'needs_review'
|
|
5510
|
+
AND (session_scope = ? OR session_scope IS NULL)
|
|
5511
|
+
ORDER BY priority ASC, created_at DESC LIMIT ?`,
|
|
5512
|
+
args: [sessionScope, limit]
|
|
5513
|
+
});
|
|
5514
|
+
return result2.rows;
|
|
5515
|
+
}
|
|
5495
5516
|
const result = await client.execute({
|
|
5496
5517
|
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
5497
5518
|
WHERE status = 'needs_review'
|
|
@@ -8283,6 +8304,7 @@ All tasks complete. No more open tasks in your queue.`;
|
|
|
8283
8304
|
// src/mcp/tools/close-task.ts
|
|
8284
8305
|
init_tasks();
|
|
8285
8306
|
init_active_agent();
|
|
8307
|
+
init_tmux_routing();
|
|
8286
8308
|
import { z as z10 } from "zod";
|
|
8287
8309
|
var CLOSE_TASK_ALLOWED_ROLES = /* @__PURE__ */ new Set(["COO", "CTO"]);
|
|
8288
8310
|
function registerCloseTask(server2) {
|
|
@@ -8310,6 +8332,26 @@ function registerCloseTask(server2) {
|
|
|
8310
8332
|
isError: true
|
|
8311
8333
|
};
|
|
8312
8334
|
}
|
|
8335
|
+
try {
|
|
8336
|
+
const { getClient: getClient2 } = await Promise.resolve().then(() => (init_database(), database_exports));
|
|
8337
|
+
const client = getClient2();
|
|
8338
|
+
const taskRow = await client.execute({
|
|
8339
|
+
sql: "SELECT session_scope FROM tasks WHERE id = ? OR task_file LIKE ? OR title LIKE ? LIMIT 1",
|
|
8340
|
+
args: [task_id, `%${task_id}%`, `%${task_id}%`]
|
|
8341
|
+
});
|
|
8342
|
+
const taskScope = taskRow.rows[0]?.session_scope;
|
|
8343
|
+
const mySession = resolveExeSession();
|
|
8344
|
+
if (taskScope && mySession && taskScope !== mySession) {
|
|
8345
|
+
return {
|
|
8346
|
+
content: [{
|
|
8347
|
+
type: "text",
|
|
8348
|
+
text: `\u26A0\uFE0F Session scope mismatch: this task belongs to ${taskScope}, but you are ${mySession}. Reviews should be processed by the exe session that dispatched the task. Switch to ${taskScope} to review this task.`
|
|
8349
|
+
}],
|
|
8350
|
+
isError: true
|
|
8351
|
+
};
|
|
8352
|
+
}
|
|
8353
|
+
} catch {
|
|
8354
|
+
}
|
|
8313
8355
|
const baseDir = process.cwd();
|
|
8314
8356
|
const task = await updateTask({
|
|
8315
8357
|
taskId: task_id,
|
|
@@ -2334,8 +2334,18 @@ async function countNewPendingReviewsSince(sinceIso) {
|
|
|
2334
2334
|
});
|
|
2335
2335
|
return Number(result.rows[0]?.cnt) || 0;
|
|
2336
2336
|
}
|
|
2337
|
-
async function listPendingReviews(limit) {
|
|
2337
|
+
async function listPendingReviews(limit, sessionScope) {
|
|
2338
2338
|
const client = getClient();
|
|
2339
|
+
if (sessionScope) {
|
|
2340
|
+
const result2 = await client.execute({
|
|
2341
|
+
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
2342
|
+
WHERE status = 'needs_review'
|
|
2343
|
+
AND (session_scope = ? OR session_scope IS NULL)
|
|
2344
|
+
ORDER BY priority ASC, created_at DESC LIMIT ?`,
|
|
2345
|
+
args: [sessionScope, limit]
|
|
2346
|
+
});
|
|
2347
|
+
return result2.rows;
|
|
2348
|
+
}
|
|
2339
2349
|
const result = await client.execute({
|
|
2340
2350
|
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
2341
2351
|
WHERE status = 'needs_review'
|
|
@@ -2170,8 +2170,18 @@ async function countNewPendingReviewsSince(sinceIso) {
|
|
|
2170
2170
|
});
|
|
2171
2171
|
return Number(result.rows[0]?.cnt) || 0;
|
|
2172
2172
|
}
|
|
2173
|
-
async function listPendingReviews(limit) {
|
|
2173
|
+
async function listPendingReviews(limit, sessionScope) {
|
|
2174
2174
|
const client = getClient();
|
|
2175
|
+
if (sessionScope) {
|
|
2176
|
+
const result2 = await client.execute({
|
|
2177
|
+
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
2178
|
+
WHERE status = 'needs_review'
|
|
2179
|
+
AND (session_scope = ? OR session_scope IS NULL)
|
|
2180
|
+
ORDER BY priority ASC, created_at DESC LIMIT ?`,
|
|
2181
|
+
args: [sessionScope, limit]
|
|
2182
|
+
});
|
|
2183
|
+
return result2.rows;
|
|
2184
|
+
}
|
|
2175
2185
|
const result = await client.execute({
|
|
2176
2186
|
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
2177
2187
|
WHERE status = 'needs_review'
|
package/dist/runtime/index.js
CHANGED
|
@@ -2188,8 +2188,18 @@ async function countNewPendingReviewsSince(sinceIso) {
|
|
|
2188
2188
|
});
|
|
2189
2189
|
return Number(result.rows[0]?.cnt) || 0;
|
|
2190
2190
|
}
|
|
2191
|
-
async function listPendingReviews(limit) {
|
|
2191
|
+
async function listPendingReviews(limit, sessionScope) {
|
|
2192
2192
|
const client = getClient();
|
|
2193
|
+
if (sessionScope) {
|
|
2194
|
+
const result2 = await client.execute({
|
|
2195
|
+
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
2196
|
+
WHERE status = 'needs_review'
|
|
2197
|
+
AND (session_scope = ? OR session_scope IS NULL)
|
|
2198
|
+
ORDER BY priority ASC, created_at DESC LIMIT ?`,
|
|
2199
|
+
args: [sessionScope, limit]
|
|
2200
|
+
});
|
|
2201
|
+
return result2.rows;
|
|
2202
|
+
}
|
|
2193
2203
|
const result = await client.execute({
|
|
2194
2204
|
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
2195
2205
|
WHERE status = 'needs_review'
|
package/dist/tui/App.js
CHANGED
|
@@ -5206,8 +5206,18 @@ async function countNewPendingReviewsSince(sinceIso) {
|
|
|
5206
5206
|
});
|
|
5207
5207
|
return Number(result.rows[0]?.cnt) || 0;
|
|
5208
5208
|
}
|
|
5209
|
-
async function listPendingReviews(limit) {
|
|
5209
|
+
async function listPendingReviews(limit, sessionScope) {
|
|
5210
5210
|
const client = getClient();
|
|
5211
|
+
if (sessionScope) {
|
|
5212
|
+
const result2 = await client.execute({
|
|
5213
|
+
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
5214
|
+
WHERE status = 'needs_review'
|
|
5215
|
+
AND (session_scope = ? OR session_scope IS NULL)
|
|
5216
|
+
ORDER BY priority ASC, created_at DESC LIMIT ?`,
|
|
5217
|
+
args: [sessionScope, limit]
|
|
5218
|
+
});
|
|
5219
|
+
return result2.rows;
|
|
5220
|
+
}
|
|
5211
5221
|
const result = await client.execute({
|
|
5212
5222
|
sql: `SELECT title, assigned_to, project_name FROM tasks
|
|
5213
5223
|
WHERE status = 'needs_review'
|
|
@@ -18766,8 +18776,6 @@ function App2() {
|
|
|
18766
18776
|
setSection(SECTIONS[tabIdx].key);
|
|
18767
18777
|
setFocus("sidebar");
|
|
18768
18778
|
}
|
|
18769
|
-
} else {
|
|
18770
|
-
setFocus("content");
|
|
18771
18779
|
}
|
|
18772
18780
|
}, []));
|
|
18773
18781
|
const [focus, setFocus] = useState16("sidebar");
|
|
@@ -18870,3 +18878,34 @@ function App2() {
|
|
|
18870
18878
|
}
|
|
18871
18879
|
}
|
|
18872
18880
|
render_default(/* @__PURE__ */ jsx17(App2, {}));
|
|
18881
|
+
{
|
|
18882
|
+
const CLEANUP_SEQ = "\x1B[?1006l\x1B[?1002l\x1B[?1000l\x1B[?25h\x1B[?1049l";
|
|
18883
|
+
const terminalCleanup = () => {
|
|
18884
|
+
try {
|
|
18885
|
+
process.stdout.write(CLEANUP_SEQ);
|
|
18886
|
+
} catch {
|
|
18887
|
+
}
|
|
18888
|
+
};
|
|
18889
|
+
process.on("exit", terminalCleanup);
|
|
18890
|
+
for (const sig of ["SIGINT", "SIGTERM", "SIGHUP"]) {
|
|
18891
|
+
process.on(sig, () => {
|
|
18892
|
+
terminalCleanup();
|
|
18893
|
+
process.removeAllListeners(sig);
|
|
18894
|
+
process.kill(process.pid, sig);
|
|
18895
|
+
});
|
|
18896
|
+
}
|
|
18897
|
+
process.on("uncaughtException", (err) => {
|
|
18898
|
+
terminalCleanup();
|
|
18899
|
+
process.stderr.write(`
|
|
18900
|
+
${err.stack || err.message}
|
|
18901
|
+
`);
|
|
18902
|
+
process.exit(1);
|
|
18903
|
+
});
|
|
18904
|
+
process.on("unhandledRejection", (reason) => {
|
|
18905
|
+
terminalCleanup();
|
|
18906
|
+
process.stderr.write(`
|
|
18907
|
+
Unhandled rejection: ${reason}
|
|
18908
|
+
`);
|
|
18909
|
+
process.exit(1);
|
|
18910
|
+
});
|
|
18911
|
+
}
|
package/package.json
CHANGED