@sideboard-ai/core 0.1.314 → 0.1.316
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/{abletime-T5YSJLNZ.js → abletime-NZ2ABWAL.js} +4 -4
- package/dist/{abletime-SJUVZVRU.js → abletime-TKAFNXCM.js} +4 -4
- package/dist/{abletime-oauth-73TFJME4.js → abletime-oauth-CBFFBINA.js} +3 -3
- package/dist/{abletime-oauth-2TOOZ2FN.js → abletime-oauth-S4AXA4WR.js} +3 -3
- package/dist/{abletime-rest-PNUGH2FS.js → abletime-rest-NSOP72AI.js} +3 -3
- package/dist/{abletime-rest-5TDRIFEV.js → abletime-rest-ORBELZQO.js} +3 -3
- package/dist/{agents-KIC6CNXF.js → agents-5XJ7EHGU.js} +6 -6
- package/dist/{agents-S7VBS5JL.js → agents-Y3M3EKLY.js} +6 -6
- package/dist/{app-settings-CC65VPBL.js → app-settings-CZVFMOI5.js} +3 -1
- package/dist/{app-settings-DZ5AY7N5.js → app-settings-RQAFJZCD.js} +3 -1
- package/dist/{chunk-6EGQPMSR.js → chunk-4ISF5XUA.js} +47 -26
- package/dist/{chunk-EGTCXNQM.js → chunk-53OCOGND.js} +2 -2
- package/dist/{chunk-DLGGLV2M.js → chunk-5CTG5W7S.js} +2 -2
- package/dist/{chunk-YK77HB3W.js → chunk-7BLIY2DD.js} +45 -25
- package/dist/{chunk-CFTOKVQN.js → chunk-7SCVGGF6.js} +5 -5
- package/dist/{chunk-7UP4D5XI.js → chunk-ATSZXRFQ.js} +6 -5
- package/dist/{chunk-BIPXOHZI.js → chunk-BPBDGJ43.js} +2 -2
- package/dist/{chunk-CW4FIIDE.js → chunk-CCUGIVYN.js} +3 -3
- package/dist/{chunk-HG25AYBV.js → chunk-CHUPIJP7.js} +14 -0
- package/dist/{chunk-5QYCCXXQ.js → chunk-DNWO6PQJ.js} +6 -5
- package/dist/{chunk-JWW66PO3.js → chunk-ELBK34TY.js} +5 -5
- package/dist/{chunk-A45QMSVB.js → chunk-FVTR54LY.js} +5 -5
- package/dist/{chunk-PHMFAU35.js → chunk-GCHSJCCX.js} +96 -64
- package/dist/{chunk-ZSVKUOFH.js → chunk-GFM63DTU.js} +8 -5
- package/dist/{chunk-OLSLE3LO.js → chunk-GXSV3X3L.js} +3 -3
- package/dist/{chunk-JARCAPKL.js → chunk-I5CLCWUK.js} +3 -3
- package/dist/{chunk-TO5UL7VN.js → chunk-MBYGWNLQ.js} +1 -1
- package/dist/{chunk-7DBL5AF4.js → chunk-NKVNHBDB.js} +4 -4
- package/dist/{chunk-U4WACWBC.js → chunk-NXNNYY3Q.js} +2 -2
- package/dist/{chunk-NMPQ7GIS.js → chunk-OLYNM52B.js} +2 -2
- package/dist/{chunk-S3KYDK6W.js → chunk-PN32Z4JL.js} +8 -5
- package/dist/{chunk-ZQLZ2A3I.js → chunk-S3U4HR5F.js} +2 -2
- package/dist/{chunk-3UDRWMIM.js → chunk-U35AHE2P.js} +14 -0
- package/dist/{chunk-A2YXQC65.js → chunk-U7PNCYNX.js} +96 -64
- package/dist/{chunk-SZ3XS2WM.js → chunk-VVV7EI6T.js} +3 -2
- package/dist/{chunk-6424BACS.js → chunk-VZAJVX36.js} +3 -2
- package/dist/{conductor-IIDQ2U24.js → conductor-CFLBKVHJ.js} +5 -5
- package/dist/{conductor-G6TKCMIW.js → conductor-NZ4V5CJX.js} +5 -5
- package/dist/{coordinator-prompt-EXJSULAR.js → coordinator-prompt-HUZC4DZ2.js} +4 -4
- package/dist/{coordinator-prompt-5USNNCG6.js → coordinator-prompt-SPOYUZG5.js} +4 -4
- package/dist/{global-workspace-ZGPIGJ6J.js → global-workspace-3NNDDTFD.js} +4 -4
- package/dist/{global-workspace-UDRTONQE.js → global-workspace-SK4JQBPN.js} +4 -4
- package/dist/index.cjs +448 -71
- package/dist/index.d.cts +81 -55
- package/dist/index.d.ts +81 -55
- package/dist/index.js +310 -27
- package/dist/mcp/run-stdio.cjs +152 -63
- package/dist/mcp/run-stdio.js +15 -14
- package/dist/{optional-cli-MLZSE6KW.js → optional-cli-EMSZBYDE.js} +3 -3
- package/dist/{optional-cli-SI4BCPRH.js → optional-cli-LMSRZNH4.js} +4 -4
- package/dist/{orchestrator-AM7VT2BD.js → orchestrator-7342RGRU.js} +9 -9
- package/dist/{orchestrator-V6NLIPLH.js → orchestrator-KXEPWTG5.js} +9 -9
- package/dist/{thread-store-HY22M5A7.js → thread-store-5OF6M6VZ.js} +1 -1
- package/dist/{thread-store-XMUQDO5O.js → thread-store-GOVVXQV2.js} +1 -1
- package/dist/{workspaces-3TTODHKN.js → workspaces-52L6NZ3P.js} +4 -4
- package/dist/{workspaces-TATO466L.js → workspaces-EYNZDL45.js} +4 -4
- package/dist/{worktree-C5VI46RZ.js → worktree-BP5ICYQ2.js} +3 -3
- package/dist/{worktree-FMK57ULT.js → worktree-UCOSAI7J.js} +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -118,6 +118,7 @@ import {
|
|
|
118
118
|
isStaleLastErrorDuringTurn,
|
|
119
119
|
isThisProcessDesktopHost,
|
|
120
120
|
isUnclaimedRunScriptRequest,
|
|
121
|
+
issueBlockedByIds,
|
|
121
122
|
issueMatchesUpdatedSince,
|
|
122
123
|
issueNeedsWorkspacePick,
|
|
123
124
|
issueTicketFromThread,
|
|
@@ -202,7 +203,7 @@ import {
|
|
|
202
203
|
worktreeCleanupSettings,
|
|
203
204
|
writeAgentBlock,
|
|
204
205
|
writeWorktreeFile
|
|
205
|
-
} from "./chunk-
|
|
206
|
+
} from "./chunk-4ISF5XUA.js";
|
|
206
207
|
import {
|
|
207
208
|
LEGACY_PLAN_FILE_REL,
|
|
208
209
|
PLAN_FILE_NAME,
|
|
@@ -292,7 +293,7 @@ import {
|
|
|
292
293
|
userMcpNamesToDisable,
|
|
293
294
|
worktreeMcpToolNames,
|
|
294
295
|
writeInjectedMcpConfig
|
|
295
|
-
} from "./chunk-
|
|
296
|
+
} from "./chunk-NKVNHBDB.js";
|
|
296
297
|
import {
|
|
297
298
|
brightsyMcpServerName,
|
|
298
299
|
connectBrightsyTeam,
|
|
@@ -423,7 +424,7 @@ import {
|
|
|
423
424
|
workspaceAgentChatSummaries,
|
|
424
425
|
worktreeRunPortsPath,
|
|
425
426
|
wrapReviewSkillMarkdown
|
|
426
|
-
} from "./chunk-
|
|
427
|
+
} from "./chunk-ATSZXRFQ.js";
|
|
427
428
|
import {
|
|
428
429
|
STDERR_EVENT_MAX_CHARS,
|
|
429
430
|
STDOUT_EVENT_MAX_CHARS,
|
|
@@ -489,7 +490,7 @@ import {
|
|
|
489
490
|
parseAbleTimeOAuthCallbackUrl,
|
|
490
491
|
resolveAbleTimeOAuthHost,
|
|
491
492
|
startAbleTimeOAuth
|
|
492
|
-
} from "./chunk-
|
|
493
|
+
} from "./chunk-CCUGIVYN.js";
|
|
493
494
|
import {
|
|
494
495
|
ableTimeDependencyTarget,
|
|
495
496
|
commentAbleTimeTask,
|
|
@@ -514,8 +515,10 @@ import {
|
|
|
514
515
|
toAbleTimeIssueInfo,
|
|
515
516
|
updateAbleTimeTask,
|
|
516
517
|
verifyAbleTimeConnection
|
|
517
|
-
} from "./chunk-
|
|
518
|
-
import
|
|
518
|
+
} from "./chunk-GXSV3X3L.js";
|
|
519
|
+
import {
|
|
520
|
+
looksLikeAbleTimeUlid
|
|
521
|
+
} from "./chunk-VVV7EI6T.js";
|
|
519
522
|
import {
|
|
520
523
|
ABLETIME_MCP_PATH,
|
|
521
524
|
ABLETIME_MCP_PM_PATH,
|
|
@@ -536,13 +539,13 @@ import {
|
|
|
536
539
|
normalizeAbleTimeCredential,
|
|
537
540
|
normalizeAbleTimeHost,
|
|
538
541
|
rewriteAbleTimeError
|
|
539
|
-
} from "./chunk-
|
|
542
|
+
} from "./chunk-ELBK34TY.js";
|
|
540
543
|
import {
|
|
541
544
|
clearOptionalCliPresenceCache,
|
|
542
545
|
detectOptionalServiceClis,
|
|
543
546
|
installOptionalServiceCli,
|
|
544
547
|
optionalCliPresence
|
|
545
|
-
} from "./chunk-
|
|
548
|
+
} from "./chunk-S3U4HR5F.js";
|
|
546
549
|
import {
|
|
547
550
|
OPTIONAL_SERVICES,
|
|
548
551
|
OPTIONAL_SERVICE_IDS,
|
|
@@ -558,7 +561,7 @@ import {
|
|
|
558
561
|
optionalServiceConnected,
|
|
559
562
|
optionalServiceSpec,
|
|
560
563
|
verifyOptionalService
|
|
561
|
-
} from "./chunk-
|
|
564
|
+
} from "./chunk-OLYNM52B.js";
|
|
562
565
|
import {
|
|
563
566
|
getAgentSetupInfo,
|
|
564
567
|
installAgent,
|
|
@@ -570,7 +573,7 @@ import {
|
|
|
570
573
|
prepareTerminalCommand,
|
|
571
574
|
resolveLoginCommand,
|
|
572
575
|
whichOnPath
|
|
573
|
-
} from "./chunk-
|
|
576
|
+
} from "./chunk-NXNNYY3Q.js";
|
|
574
577
|
import {
|
|
575
578
|
CLOUD_COORDINATOR_BUSY_REPLY,
|
|
576
579
|
CLOUD_COORDINATOR_CANCELED_REPLY,
|
|
@@ -623,7 +626,7 @@ import {
|
|
|
623
626
|
stageBuffersAsAttachments,
|
|
624
627
|
syncWorkspacesFromThreads,
|
|
625
628
|
takenTeamSlugsForOrchestration
|
|
626
|
-
} from "./chunk-
|
|
629
|
+
} from "./chunk-GFM63DTU.js";
|
|
627
630
|
import {
|
|
628
631
|
GITHUB_PR_BODY_MAX_CHARS,
|
|
629
632
|
GITHUB_PR_BODY_SAFE_CHARS,
|
|
@@ -711,7 +714,7 @@ import {
|
|
|
711
714
|
suggestSlug,
|
|
712
715
|
switchWorktreeBranch,
|
|
713
716
|
warmGithubAgentAuth
|
|
714
|
-
} from "./chunk-
|
|
717
|
+
} from "./chunk-BPBDGJ43.js";
|
|
715
718
|
import {
|
|
716
719
|
FAMOUS_SOCCER_TEAMS,
|
|
717
720
|
allocateTeamName,
|
|
@@ -744,7 +747,7 @@ import {
|
|
|
744
747
|
worktreeNameFromPath,
|
|
745
748
|
worktreeSlugForTicket,
|
|
746
749
|
writeThread
|
|
747
|
-
} from "./chunk-
|
|
750
|
+
} from "./chunk-CHUPIJP7.js";
|
|
748
751
|
import "./chunk-2P4XKWV2.js";
|
|
749
752
|
import {
|
|
750
753
|
BRIGHTSY_OAUTH_CLIENT_ID,
|
|
@@ -921,6 +924,7 @@ import {
|
|
|
921
924
|
getAbleTimeAccessToken,
|
|
922
925
|
getAbleTimeHost,
|
|
923
926
|
getDefaultAgent,
|
|
927
|
+
getDefaultAutonomy,
|
|
924
928
|
getDefaultEffort,
|
|
925
929
|
getDefaultFast,
|
|
926
930
|
getDefaultModel,
|
|
@@ -1008,7 +1012,7 @@ import {
|
|
|
1008
1012
|
withTurnScopedCost,
|
|
1009
1013
|
writeSecureJson,
|
|
1010
1014
|
writeViewerContext
|
|
1011
|
-
} from "./chunk-
|
|
1015
|
+
} from "./chunk-U7PNCYNX.js";
|
|
1012
1016
|
import {
|
|
1013
1017
|
THINKING_EFFORTS,
|
|
1014
1018
|
isThinkingEffort,
|
|
@@ -2142,7 +2146,8 @@ function row(resolved) {
|
|
|
2142
2146
|
agent: resolved.agent,
|
|
2143
2147
|
model: resolved.model,
|
|
2144
2148
|
effort: resolved.effort,
|
|
2145
|
-
fast: resolved.fast
|
|
2149
|
+
fast: resolved.fast,
|
|
2150
|
+
autonomy: resolved.autonomy
|
|
2146
2151
|
};
|
|
2147
2152
|
}
|
|
2148
2153
|
function phoneAccountDefaults() {
|
|
@@ -2700,15 +2705,13 @@ function listPhoneSidebar(viewerLogin = phoneViewerLogin()) {
|
|
|
2700
2705
|
path: path2,
|
|
2701
2706
|
worktrees: groupHomeBoardWorktrees(repoThreads).map((group) => {
|
|
2702
2707
|
const tags = workspaceTagsFromGroup(group);
|
|
2703
|
-
const badge = classifyWorktreeListBadges(
|
|
2704
|
-
|
|
2705
|
-
viewerLogin,
|
|
2706
|
-
resolveProjectReviewLabel(settings, path2)
|
|
2707
|
-
)[0];
|
|
2708
|
+
const badge = classifyWorktreeListBadges(group, viewerLogin, resolveProjectReviewLabel(settings, path2))[0];
|
|
2709
|
+
const blockedBy = issueBlockedByIds(group);
|
|
2708
2710
|
return {
|
|
2709
2711
|
label: worktreeDisplayLabelForGroup(group),
|
|
2710
2712
|
chats: group.map(summarize),
|
|
2711
2713
|
...tags.length > 0 ? { tags } : {},
|
|
2714
|
+
...blockedBy.length > 0 ? { blockedBy } : {},
|
|
2712
2715
|
...badge ? { badge: { id: badge.id, label: badge.label, title: badge.title, ...badge.conflict ? { conflict: true } : {} } } : {}
|
|
2713
2716
|
};
|
|
2714
2717
|
})
|
|
@@ -2804,7 +2807,7 @@ function draftAgentOptions(draft, defaults) {
|
|
|
2804
2807
|
effort: draft?.effort ?? defaults.effort,
|
|
2805
2808
|
fast: draft?.fast ?? defaults.fast,
|
|
2806
2809
|
planMode: Boolean(draft?.planMode),
|
|
2807
|
-
autonomy: draft?.autonomy
|
|
2810
|
+
autonomy: draft?.autonomy ?? defaults.autonomy
|
|
2808
2811
|
};
|
|
2809
2812
|
}
|
|
2810
2813
|
function createPhoneChat(agent) {
|
|
@@ -6074,7 +6077,7 @@ function phoneBoardKey(sidebar) {
|
|
|
6074
6077
|
const orchestration = sidebar.orchestration.map(chatKey).join("\n");
|
|
6075
6078
|
const projects = sidebar.projects.map((project) => {
|
|
6076
6079
|
const trees = project.worktrees.map(
|
|
6077
|
-
(tree) => `${tree.label} ${tree.badge?.id ?? ""} ${(tree.tags ?? []).join(",")} ${tree.chats.map(chatKey).join("\n")}`
|
|
6080
|
+
(tree) => `${tree.label} ${tree.badge?.id ?? ""} ${(tree.tags ?? []).join(",")} ${(tree.blockedBy ?? []).join(",")} ${tree.chats.map(chatKey).join("\n")}`
|
|
6078
6081
|
).join("\n");
|
|
6079
6082
|
return `${project.path} ${project.name}
|
|
6080
6083
|
${trees}`;
|
|
@@ -8727,7 +8730,7 @@ async function startHeadlessHost(opts) {
|
|
|
8727
8730
|
};
|
|
8728
8731
|
const refreshRunning = async () => {
|
|
8729
8732
|
try {
|
|
8730
|
-
const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-
|
|
8733
|
+
const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-KXEPWTG5.js");
|
|
8731
8734
|
agentsRunning = getOrchestrator2().getRuntime().running;
|
|
8732
8735
|
} catch {
|
|
8733
8736
|
agentsRunning = 0;
|
|
@@ -9090,6 +9093,7 @@ async function createOrchChildThread(orch, args, resolveNewThreadOptions2) {
|
|
|
9090
9093
|
model: opts.model,
|
|
9091
9094
|
effort: opts.effort,
|
|
9092
9095
|
fast: opts.fast,
|
|
9096
|
+
autonomy: opts.autonomy,
|
|
9093
9097
|
repoPath: args.repoPath,
|
|
9094
9098
|
title: args.title,
|
|
9095
9099
|
parentThreadId: parentId || null,
|
|
@@ -10659,7 +10663,7 @@ async function handleJobStop(params, _ctx) {
|
|
|
10659
10663
|
return stopDetachedJob(jobCwd(rec), id, reason ? { reason } : void 0);
|
|
10660
10664
|
}
|
|
10661
10665
|
async function defaultTurnWait(ref, timeoutMs) {
|
|
10662
|
-
const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-
|
|
10666
|
+
const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-KXEPWTG5.js");
|
|
10663
10667
|
const orch = getOrchestrator2();
|
|
10664
10668
|
const thread = await orch.waitForTurn(ref, timeoutMs, {
|
|
10665
10669
|
resolveIfStillRunning: true
|
|
@@ -11012,7 +11016,7 @@ async function startMcpServer() {
|
|
|
11012
11016
|
);
|
|
11013
11017
|
}
|
|
11014
11018
|
try {
|
|
11015
|
-
const { maxConcurrentAgents: maxConcurrentAgents2 } = await import("./app-settings-
|
|
11019
|
+
const { maxConcurrentAgents: maxConcurrentAgents2 } = await import("./app-settings-RQAFJZCD.js");
|
|
11016
11020
|
orch.setMaxConcurrent(maxConcurrentAgents2());
|
|
11017
11021
|
} catch {
|
|
11018
11022
|
}
|
|
@@ -11560,7 +11564,7 @@ async function startMcpServer() {
|
|
|
11560
11564
|
if (!worktreeProfile) {
|
|
11561
11565
|
registerConnectedIssueVendorTools(server);
|
|
11562
11566
|
const { getCaffeinateHold: getCaffeinateHold2, setCaffeinateHold: setCaffeinateHold2 } = await import("./caffeinate-hold-ZNUEZGHB.js");
|
|
11563
|
-
const { resolveNewThreadOptions: resolveNewThreadOptions2, resolveThreadDefaults: resolveThreadDefaults2 } = await import("./app-settings-
|
|
11567
|
+
const { resolveNewThreadOptions: resolveNewThreadOptions2, resolveThreadDefaults: resolveThreadDefaults2 } = await import("./app-settings-RQAFJZCD.js");
|
|
11564
11568
|
const accountDefaults = resolveThreadDefaults2();
|
|
11565
11569
|
const accountDefaultsHint = `Account defaults: agent=${accountDefaults.agent}, model=${accountDefaults.model?.trim() || "Auto"}, effort=${accountDefaults.effort}`;
|
|
11566
11570
|
server.tool(
|
|
@@ -12421,6 +12425,283 @@ function getAgentRpcServer() {
|
|
|
12421
12425
|
return running;
|
|
12422
12426
|
}
|
|
12423
12427
|
|
|
12428
|
+
// src/integrations/abletime-blocked.ts
|
|
12429
|
+
function asRecord4(value) {
|
|
12430
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
12431
|
+
}
|
|
12432
|
+
function asString(value) {
|
|
12433
|
+
return typeof value === "string" ? value.trim() : "";
|
|
12434
|
+
}
|
|
12435
|
+
function firstString(record, keys) {
|
|
12436
|
+
if (!record) return "";
|
|
12437
|
+
for (const key of keys) {
|
|
12438
|
+
const value = asString(record[key]);
|
|
12439
|
+
if (value) return value;
|
|
12440
|
+
}
|
|
12441
|
+
return "";
|
|
12442
|
+
}
|
|
12443
|
+
function firstRecord(record, keys) {
|
|
12444
|
+
if (!record) return null;
|
|
12445
|
+
for (const key of keys) {
|
|
12446
|
+
const value = asRecord4(record[key]);
|
|
12447
|
+
if (value) return value;
|
|
12448
|
+
}
|
|
12449
|
+
return null;
|
|
12450
|
+
}
|
|
12451
|
+
function identifierFromUnknown(value) {
|
|
12452
|
+
if (typeof value === "string" || typeof value === "number") {
|
|
12453
|
+
const id2 = String(value).trim();
|
|
12454
|
+
return id2 ? [id2] : [];
|
|
12455
|
+
}
|
|
12456
|
+
if (Array.isArray(value)) return value.flatMap(identifierFromUnknown);
|
|
12457
|
+
const rec = asRecord4(value);
|
|
12458
|
+
if (!rec) return [];
|
|
12459
|
+
for (const key of ["nodes", "data", "tasks", "items"]) {
|
|
12460
|
+
if (Array.isArray(rec[key])) return identifierFromUnknown(rec[key]);
|
|
12461
|
+
}
|
|
12462
|
+
const id = firstString(rec, ["identifier", "reference", "ref", "key", "code", "number", "id"]);
|
|
12463
|
+
return id ? [id] : [];
|
|
12464
|
+
}
|
|
12465
|
+
function ableTimeBlockedByIdentifiers(raw) {
|
|
12466
|
+
const record = asRecord4(raw);
|
|
12467
|
+
const nested = firstRecord(record, ["task", "data"]) ?? record;
|
|
12468
|
+
if (!nested) return [];
|
|
12469
|
+
const value = nested.blocked_by ?? nested.blockedBy ?? nested.depends_on ?? nested.dependsOn ?? nested.dependencyParentTimeflowTaskId ?? nested.wait_on ?? nested.waitOn;
|
|
12470
|
+
const out = [];
|
|
12471
|
+
const seen = /* @__PURE__ */ new Set();
|
|
12472
|
+
for (const id of identifierFromUnknown(value)) {
|
|
12473
|
+
const key = id.toLowerCase();
|
|
12474
|
+
if (seen.has(key)) continue;
|
|
12475
|
+
seen.add(key);
|
|
12476
|
+
out.push(id);
|
|
12477
|
+
}
|
|
12478
|
+
return out;
|
|
12479
|
+
}
|
|
12480
|
+
function taskReference(raw) {
|
|
12481
|
+
const record = asRecord4(raw);
|
|
12482
|
+
const nested = firstRecord(record, ["task", "data"]) ?? record;
|
|
12483
|
+
return firstString(nested, ["taskRef", "reference", "identifier"]);
|
|
12484
|
+
}
|
|
12485
|
+
async function getAbleTimeIssueBlockedBy(id, opts) {
|
|
12486
|
+
const taskId = id.trim();
|
|
12487
|
+
if (!taskId) throw new Error("AbleTime task id is required");
|
|
12488
|
+
const raw = await callAbleTimeTool("get_task", { id: taskId, task_id: taskId }, opts);
|
|
12489
|
+
const out = [];
|
|
12490
|
+
for (const blockerId of ableTimeBlockedByIdentifiers(raw)) {
|
|
12491
|
+
if (!looksLikeAbleTimeUlid(blockerId)) {
|
|
12492
|
+
out.push(blockerId);
|
|
12493
|
+
continue;
|
|
12494
|
+
}
|
|
12495
|
+
const parent = await callAbleTimeTool("get_task", { id: blockerId, task_id: blockerId }, opts);
|
|
12496
|
+
const ref = taskReference(parent);
|
|
12497
|
+
if (!ref || looksLikeAbleTimeUlid(ref)) {
|
|
12498
|
+
throw new Error(`AbleTime blocker has no reference: ${blockerId}`);
|
|
12499
|
+
}
|
|
12500
|
+
out.push(ref);
|
|
12501
|
+
}
|
|
12502
|
+
return out;
|
|
12503
|
+
}
|
|
12504
|
+
|
|
12505
|
+
// src/integrations/github-blocked.ts
|
|
12506
|
+
function githubBlockedByIdentifiers(payload) {
|
|
12507
|
+
const root = payload && typeof payload === "object" && !Array.isArray(payload) ? payload : null;
|
|
12508
|
+
const data = root?.data && typeof root.data === "object" && !Array.isArray(root.data) ? root.data : root;
|
|
12509
|
+
const repository = data?.repository && typeof data.repository === "object" ? data.repository : null;
|
|
12510
|
+
const issue = repository?.issue && typeof repository.issue === "object" ? repository.issue : null;
|
|
12511
|
+
const blocked = issue?.blockedBy && typeof issue.blockedBy === "object" ? issue.blockedBy : null;
|
|
12512
|
+
const nodes = Array.isArray(blocked?.nodes) ? blocked.nodes : Array.isArray(root?.blockedBy) ? root.blockedBy : [];
|
|
12513
|
+
const out = [];
|
|
12514
|
+
const seen = /* @__PURE__ */ new Set();
|
|
12515
|
+
for (const node of nodes) {
|
|
12516
|
+
const rec = node && typeof node === "object" && !Array.isArray(node) ? node : null;
|
|
12517
|
+
const number = Number(rec?.number ?? node);
|
|
12518
|
+
if (!Number.isFinite(number) || number <= 0) continue;
|
|
12519
|
+
const id = `#${number}`;
|
|
12520
|
+
const key = id.toLowerCase();
|
|
12521
|
+
if (seen.has(key)) continue;
|
|
12522
|
+
seen.add(key);
|
|
12523
|
+
out.push(id);
|
|
12524
|
+
}
|
|
12525
|
+
return out;
|
|
12526
|
+
}
|
|
12527
|
+
var GITHUB_BLOCKED_BY_QUERY = `
|
|
12528
|
+
query($owner: String!, $name: String!, $number: Int!) {
|
|
12529
|
+
repository(owner: $owner, name: $name) {
|
|
12530
|
+
issue(number: $number) {
|
|
12531
|
+
blockedBy(first: 25) { nodes { number } }
|
|
12532
|
+
}
|
|
12533
|
+
}
|
|
12534
|
+
}
|
|
12535
|
+
`;
|
|
12536
|
+
async function getGitHubIssueBlockedBy(id, opts) {
|
|
12537
|
+
const number = parseGitHubIssueNumber(id);
|
|
12538
|
+
const { cwd, slug } = await resolveGitHubIssueRepo(opts?.repoPath);
|
|
12539
|
+
const [owner, name] = (slug ?? "").split("/");
|
|
12540
|
+
if (!owner || !name) throw new Error("GitHub repo is not connected");
|
|
12541
|
+
const result = await gh(
|
|
12542
|
+
[
|
|
12543
|
+
"api",
|
|
12544
|
+
"graphql",
|
|
12545
|
+
"-f",
|
|
12546
|
+
`query=${GITHUB_BLOCKED_BY_QUERY}`,
|
|
12547
|
+
"-f",
|
|
12548
|
+
`owner=${owner}`,
|
|
12549
|
+
"-f",
|
|
12550
|
+
`name=${name}`,
|
|
12551
|
+
"-F",
|
|
12552
|
+
`number=${number}`
|
|
12553
|
+
],
|
|
12554
|
+
cwd,
|
|
12555
|
+
{ reject: false }
|
|
12556
|
+
);
|
|
12557
|
+
if (result.exitCode !== 0) {
|
|
12558
|
+
const detail = (result.stderr || result.stdout).trim() || "gh failed";
|
|
12559
|
+
throw new Error(`GitHub issue #${number} blocked-by: ${detail}`);
|
|
12560
|
+
}
|
|
12561
|
+
let parsed;
|
|
12562
|
+
try {
|
|
12563
|
+
parsed = JSON.parse(result.stdout);
|
|
12564
|
+
} catch {
|
|
12565
|
+
throw new Error(`GitHub issue #${number} blocked-by: gh returned non-JSON`);
|
|
12566
|
+
}
|
|
12567
|
+
const errors = parsed && typeof parsed === "object" && Array.isArray(parsed.errors) ? parsed.errors : [];
|
|
12568
|
+
if (errors.length > 0) {
|
|
12569
|
+
throw new Error(
|
|
12570
|
+
`GitHub issue #${number} blocked-by: ${errors.map((e) => e.message ?? "GitHub error").join("; ")}`
|
|
12571
|
+
);
|
|
12572
|
+
}
|
|
12573
|
+
const issue = parsed.data?.repository?.issue;
|
|
12574
|
+
if (!issue) throw new Error(`GitHub issue not found: #${number}`);
|
|
12575
|
+
return githubBlockedByIdentifiers(parsed);
|
|
12576
|
+
}
|
|
12577
|
+
|
|
12578
|
+
// src/integrations/linear-blocked.ts
|
|
12579
|
+
var ISSUE_BLOCKED_BY_QUERY = `
|
|
12580
|
+
query SideboardIssueBlockedBy($id: String!) {
|
|
12581
|
+
issue(id: $id) {
|
|
12582
|
+
identifier
|
|
12583
|
+
relations(first: 25) {
|
|
12584
|
+
nodes { id type relatedIssue { id identifier } }
|
|
12585
|
+
}
|
|
12586
|
+
inverseRelations(first: 25) {
|
|
12587
|
+
nodes { id type issue { id identifier } }
|
|
12588
|
+
}
|
|
12589
|
+
}
|
|
12590
|
+
}
|
|
12591
|
+
`;
|
|
12592
|
+
function linearBlockedByIdentifiers(relations) {
|
|
12593
|
+
const out = [];
|
|
12594
|
+
const seen = /* @__PURE__ */ new Set();
|
|
12595
|
+
for (const rel of relations) {
|
|
12596
|
+
const type = (rel.type ?? "").trim().toLowerCase().replace(/[\s_-]+/g, "");
|
|
12597
|
+
if (type !== "blockedby" && type !== "blocked") continue;
|
|
12598
|
+
const id = (rel.issue?.identifier || rel.issue?.id || "").trim();
|
|
12599
|
+
const key = id.toLowerCase();
|
|
12600
|
+
if (!id || seen.has(key)) continue;
|
|
12601
|
+
seen.add(key);
|
|
12602
|
+
out.push(id);
|
|
12603
|
+
}
|
|
12604
|
+
return out;
|
|
12605
|
+
}
|
|
12606
|
+
function linearBlockedByRelations(issue) {
|
|
12607
|
+
const out = [];
|
|
12608
|
+
for (const rel of issue.relations?.nodes ?? []) {
|
|
12609
|
+
out.push({ type: String(rel.type ?? "related"), issue: rel.relatedIssue });
|
|
12610
|
+
}
|
|
12611
|
+
for (const rel of issue.inverseRelations?.nodes ?? []) {
|
|
12612
|
+
out.push({
|
|
12613
|
+
type: flipLinearRelationType(String(rel.type ?? "related")),
|
|
12614
|
+
issue: rel.issue
|
|
12615
|
+
});
|
|
12616
|
+
}
|
|
12617
|
+
return out;
|
|
12618
|
+
}
|
|
12619
|
+
async function getLinearIssueBlockedBy(id, opts) {
|
|
12620
|
+
const issueId = id.trim();
|
|
12621
|
+
if (!issueId) throw new Error("Linear issue id is required (uuid or ENG-123)");
|
|
12622
|
+
const json = await linearGraphql(
|
|
12623
|
+
ISSUE_BLOCKED_BY_QUERY,
|
|
12624
|
+
{ id: issueId },
|
|
12625
|
+
opts
|
|
12626
|
+
);
|
|
12627
|
+
if (!json.issue) throw new Error(`Linear issue not found: ${issueId}`);
|
|
12628
|
+
return linearBlockedByIdentifiers(linearBlockedByRelations(json.issue));
|
|
12629
|
+
}
|
|
12630
|
+
|
|
12631
|
+
// src/board/issue-blocked-sync.ts
|
|
12632
|
+
function sourceTicketRef(thread) {
|
|
12633
|
+
if (thread.sourceType !== "ticket") return null;
|
|
12634
|
+
const ref = (thread.sourceRef ?? "").trim();
|
|
12635
|
+
return ref || null;
|
|
12636
|
+
}
|
|
12637
|
+
function sameIssueBlockedBy(current, next) {
|
|
12638
|
+
const left = new Set(
|
|
12639
|
+
(current ?? []).map((id) => id.trim().toLowerCase()).filter(Boolean)
|
|
12640
|
+
);
|
|
12641
|
+
const right = [...new Set(next.map((id) => id.trim().toLowerCase()).filter(Boolean))];
|
|
12642
|
+
if (left.size !== right.length) return false;
|
|
12643
|
+
return right.every((id) => left.has(id));
|
|
12644
|
+
}
|
|
12645
|
+
var TRACKER_KEY = /^[A-Za-z][A-Za-z0-9]+-\d+$/;
|
|
12646
|
+
function isGitHubIssueRef(ref) {
|
|
12647
|
+
return /^#?\d+$/.test(ref) || /^gh-\d+$/i.test(ref) || /github\.com\/[^/]+\/[^/]+\/issues\/\d+/i.test(ref);
|
|
12648
|
+
}
|
|
12649
|
+
function trackerForSourceTicket(ref, preferred, connected) {
|
|
12650
|
+
const trimmed = ref.trim();
|
|
12651
|
+
if (!trimmed) return null;
|
|
12652
|
+
if (isGitHubIssueRef(trimmed)) return "github";
|
|
12653
|
+
if (TRACKER_KEY.test(trimmed)) {
|
|
12654
|
+
if (preferred === "abletime" && connected.abletime) return "abletime";
|
|
12655
|
+
if (connected.linear) return "linear";
|
|
12656
|
+
if (connected.abletime) return "abletime";
|
|
12657
|
+
return null;
|
|
12658
|
+
}
|
|
12659
|
+
if (preferred === "linear" && connected.linear) return "linear";
|
|
12660
|
+
if (preferred === "abletime" && connected.abletime) return "abletime";
|
|
12661
|
+
if (preferred === "github") return "github";
|
|
12662
|
+
return null;
|
|
12663
|
+
}
|
|
12664
|
+
function defaultIssueBlockedLookup() {
|
|
12665
|
+
return {
|
|
12666
|
+
preferredSource: () => resolveEffectiveIssueSource(),
|
|
12667
|
+
linearConnected: () => isLinearConnected(),
|
|
12668
|
+
abletimeConnected: () => isAbleTimeConnected(),
|
|
12669
|
+
linear: (id) => getLinearIssueBlockedBy(id),
|
|
12670
|
+
github: (id, repoPath) => getGitHubIssueBlockedBy(id, { repoPath }),
|
|
12671
|
+
abletime: (id) => getAbleTimeIssueBlockedBy(id)
|
|
12672
|
+
};
|
|
12673
|
+
}
|
|
12674
|
+
async function lookupIssueBlockedBy(thread, lookup = defaultIssueBlockedLookup()) {
|
|
12675
|
+
const ref = sourceTicketRef(thread);
|
|
12676
|
+
if (!ref) return null;
|
|
12677
|
+
const tracker = trackerForSourceTicket(ref, lookup.preferredSource(), {
|
|
12678
|
+
linear: lookup.linearConnected(),
|
|
12679
|
+
abletime: lookup.abletimeConnected()
|
|
12680
|
+
});
|
|
12681
|
+
if (!tracker) return null;
|
|
12682
|
+
try {
|
|
12683
|
+
if (tracker === "linear") return await lookup.linear(ref);
|
|
12684
|
+
if (tracker === "abletime") return await lookup.abletime(ref);
|
|
12685
|
+
const repo = (thread.repoPath || thread.worktreePath || "").trim();
|
|
12686
|
+
return await lookup.github(ref, repo);
|
|
12687
|
+
} catch {
|
|
12688
|
+
return null;
|
|
12689
|
+
}
|
|
12690
|
+
}
|
|
12691
|
+
async function refreshWorktreeIssueBlocked(threadRef) {
|
|
12692
|
+
const thread = readThread(threadRef) ?? findThreadByRef(threadRef);
|
|
12693
|
+
if (!thread) throw new Error(`Thread not found: ${threadRef}`);
|
|
12694
|
+
const ids = await lookupIssueBlockedBy(thread);
|
|
12695
|
+
if (ids == null) return null;
|
|
12696
|
+
const siblings = thread.worktreePath ? threadsSharingWorktree(thread.worktreePath) : [];
|
|
12697
|
+
const targets = siblings.length > 0 ? siblings : [thread];
|
|
12698
|
+
for (const t of targets) {
|
|
12699
|
+
if (sameIssueBlockedBy(t.issueBlockedBy, ids)) continue;
|
|
12700
|
+
updateThread(t.id, { issueBlockedBy: ids });
|
|
12701
|
+
}
|
|
12702
|
+
return ids;
|
|
12703
|
+
}
|
|
12704
|
+
|
|
12424
12705
|
// src/brightsy/api.ts
|
|
12425
12706
|
var formatBrightsyFetchError = formatFetchError;
|
|
12426
12707
|
var BrightsySideboardApi = class {
|
|
@@ -14035,7 +14316,7 @@ async function continueSourceThread(threadId, prompt) {
|
|
|
14035
14316
|
await continueOnReply(threadId, prompt);
|
|
14036
14317
|
return;
|
|
14037
14318
|
}
|
|
14038
|
-
const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-
|
|
14319
|
+
const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-KXEPWTG5.js");
|
|
14039
14320
|
await getOrchestrator2().send(threadId, prompt);
|
|
14040
14321
|
} catch {
|
|
14041
14322
|
}
|
|
@@ -14779,6 +15060,7 @@ export {
|
|
|
14779
15060
|
getCaffeinateHold,
|
|
14780
15061
|
getClaudePlanUsage,
|
|
14781
15062
|
getDefaultAgent,
|
|
15063
|
+
getDefaultAutonomy,
|
|
14782
15064
|
getDefaultEffort,
|
|
14783
15065
|
getDefaultFast,
|
|
14784
15066
|
getDefaultModel,
|
|
@@ -15127,6 +15409,7 @@ export {
|
|
|
15127
15409
|
recordSlackOutboundWatch,
|
|
15128
15410
|
refreshBrightsyAccessToken,
|
|
15129
15411
|
refreshGitHubAuth,
|
|
15412
|
+
refreshWorktreeIssueBlocked,
|
|
15130
15413
|
registerBrightsyOAuthClient,
|
|
15131
15414
|
registerPackagedUserMcpClients,
|
|
15132
15415
|
releaseCaffeinateHoldForThread,
|