@mattstack/rt-client 0.28.0 → 0.29.0
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/commands.d.ts +59 -1
- package/dist/gate.js +7 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.js +138 -119
- package/dist/settings/identity-codec.js +2 -2
- package/package.json +1 -1
- package/src/commands.ts +59 -3
- package/src/index.ts +2 -0
- package/src/settings/registry-defs.ts +18 -0
package/dist/commands.d.ts
CHANGED
|
@@ -27,6 +27,17 @@ export interface ProjectMRsScope {
|
|
|
27
27
|
daemon or before the first sweep that demanded a section. */
|
|
28
28
|
knownSections?: string[];
|
|
29
29
|
}
|
|
30
|
+
/** Classified cause of a repo's failing project sync (lib/daemon/project-sync-health.ts). */
|
|
31
|
+
export type ProjectSyncErrorKind = "rate-limited" | "auth" | "server-error" | "timeout" | "other";
|
|
32
|
+
/** A repo's current unbroken run of failed project syncs. */
|
|
33
|
+
export interface ProjectSyncError {
|
|
34
|
+
/** First failure of the run; later failures leave it alone. */
|
|
35
|
+
since: number;
|
|
36
|
+
lastAt: number;
|
|
37
|
+
kind: ProjectSyncErrorKind;
|
|
38
|
+
/** Raw error text, capped at 200 chars. */
|
|
39
|
+
message: string;
|
|
40
|
+
}
|
|
30
41
|
export interface ProjectMRsData {
|
|
31
42
|
mrs: Record<string, {
|
|
32
43
|
pr: PullRequest;
|
|
@@ -37,6 +48,8 @@ export interface ProjectMRsData {
|
|
|
37
48
|
source: "poll" | "events" | "mutation";
|
|
38
49
|
syncedAt: number;
|
|
39
50
|
scope?: ProjectMRsScope;
|
|
51
|
+
/** Present while this repo's most recent project sync failed. */
|
|
52
|
+
syncError?: ProjectSyncError;
|
|
40
53
|
}
|
|
41
54
|
export interface DiscussionsData {
|
|
42
55
|
discussions: Discussion[];
|
|
@@ -691,10 +704,14 @@ export interface WorktreeProvisionData {
|
|
|
691
704
|
branchState: "new" | "tracking-remote" | "existing-clean" | "diverged" | "behind";
|
|
692
705
|
readyFailed?: true;
|
|
693
706
|
failedStep?: string;
|
|
707
|
+
/** Set only when the tree was built by hydrating from the repo's golden donor, not the on-deck pool or a cold create. */
|
|
708
|
+
hydratedFrom?: string;
|
|
694
709
|
}
|
|
695
710
|
export interface WorktreeCreateData {
|
|
696
711
|
tree: string;
|
|
697
712
|
path: string;
|
|
713
|
+
/** Set only for `--on-deck`, and only when that tree hydrated from the golden rather than cold-creating. */
|
|
714
|
+
hydratedFrom?: string;
|
|
698
715
|
}
|
|
699
716
|
export interface WorktreeDisposeData {
|
|
700
717
|
disposed: string[];
|
|
@@ -787,6 +804,28 @@ export interface DiscussionsDiffsData {
|
|
|
787
804
|
truncated: boolean;
|
|
788
805
|
}
|
|
789
806
|
export type MRActionName = "merge" | "rebase" | "approve" | "unapprove" | "setAutoMerge" | "cancelAutoMerge" | "retryJob" | "retryPipeline" | "toggleDraft" | "requestReReview";
|
|
807
|
+
/** One worktree's git badge as the daemon sweep computed it. All timestamps ISO 8601. */
|
|
808
|
+
export interface GitWorktreeBadge {
|
|
809
|
+
worktree: string;
|
|
810
|
+
branch: string | null;
|
|
811
|
+
detached: boolean;
|
|
812
|
+
staged: number;
|
|
813
|
+
unstaged: number;
|
|
814
|
+
untracked: number;
|
|
815
|
+
conflicted: number;
|
|
816
|
+
clean: boolean;
|
|
817
|
+
ahead: number | null;
|
|
818
|
+
behind: number | null;
|
|
819
|
+
upstream: string | null;
|
|
820
|
+
lastFetchedAt: string | null;
|
|
821
|
+
updatedAt: string;
|
|
822
|
+
}
|
|
823
|
+
/** repo is the serialized identity (the repo-index key). error is set when the last sweep could not read the repo; stale worktrees may accompany it. */
|
|
824
|
+
export interface RepoStatusRow {
|
|
825
|
+
repo: string;
|
|
826
|
+
worktrees: GitWorktreeBadge[];
|
|
827
|
+
error: string | null;
|
|
828
|
+
}
|
|
790
829
|
export interface Commands {
|
|
791
830
|
"project-mrs:read": {
|
|
792
831
|
payload: {
|
|
@@ -1456,6 +1495,15 @@ export interface Commands {
|
|
|
1456
1495
|
};
|
|
1457
1496
|
data: unknown;
|
|
1458
1497
|
};
|
|
1498
|
+
"repos:status": {
|
|
1499
|
+
payload: {
|
|
1500
|
+
refresh?: boolean;
|
|
1501
|
+
};
|
|
1502
|
+
data: {
|
|
1503
|
+
repos: RepoStatusRow[];
|
|
1504
|
+
sweptAt: string | null;
|
|
1505
|
+
};
|
|
1506
|
+
};
|
|
1459
1507
|
"freshness:reconcile": {
|
|
1460
1508
|
payload: Record<string, never>;
|
|
1461
1509
|
data: unknown;
|
|
@@ -1524,13 +1572,23 @@ export interface Commands {
|
|
|
1524
1572
|
/** `contextOmitted` appears only when the gate context plus every
|
|
1525
1573
|
question's `context` exceeded their shared 8192-byte budget: the
|
|
1526
1574
|
gate still opened, but question contexts were dropped, and the gate
|
|
1527
|
-
context too when it was over the budget on its own.
|
|
1575
|
+
context too when it was over the budget on its own.
|
|
1576
|
+
`formCapExceeded`/`formCapAdvisory` appear only when the pane could
|
|
1577
|
+
have presented an in-pane form and one or more questions exceeded
|
|
1578
|
+
its 4-option cap, which is the one thing that forced this gate to
|
|
1579
|
+
`wait`: the gate still opens, and the advisory names the structural
|
|
1580
|
+
fix so the caller can re-author. */
|
|
1528
1581
|
data: {
|
|
1529
1582
|
id: string;
|
|
1530
1583
|
presentation: "form" | "wait";
|
|
1531
1584
|
subject: string;
|
|
1532
1585
|
supersededId: string | null;
|
|
1533
1586
|
contextOmitted?: true;
|
|
1587
|
+
formCapExceeded?: Array<{
|
|
1588
|
+
question: string;
|
|
1589
|
+
options: number;
|
|
1590
|
+
}>;
|
|
1591
|
+
formCapAdvisory?: string;
|
|
1534
1592
|
};
|
|
1535
1593
|
};
|
|
1536
1594
|
/**
|
package/dist/gate.js
CHANGED
|
@@ -99,12 +99,12 @@ function gatePresentation(args) {
|
|
|
99
99
|
return args.questions.every((q) => q.options.length <= GATE_FORM_OPTION_CAP) ? "form" : "wait";
|
|
100
100
|
}
|
|
101
101
|
export {
|
|
102
|
-
|
|
103
|
-
unwrapGateAnswerValue,
|
|
104
|
-
normalizeGateQuestions,
|
|
105
|
-
normalizeGateOptions,
|
|
106
|
-
gatePresentation,
|
|
107
|
-
gateOptionValue,
|
|
102
|
+
GATE_FORM_OPTION_CAP,
|
|
108
103
|
gateOptionLabel,
|
|
109
|
-
|
|
104
|
+
gateOptionValue,
|
|
105
|
+
gatePresentation,
|
|
106
|
+
normalizeGateOptions,
|
|
107
|
+
normalizeGateQuestions,
|
|
108
|
+
unwrapGateAnswerValue,
|
|
109
|
+
validateGateAnswers
|
|
110
110
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export { normalizeGateOptions, normalizeGateQuestions } from "./gate-options.ts"
|
|
|
8
8
|
export type { GateOptionObject } from "./gate-options.ts";
|
|
9
9
|
export { unwrapGateAnswerValue, validateGateAnswers } from "./gate-answers.ts";
|
|
10
10
|
export type { GateAnswerWire } from "./gate-answers.ts";
|
|
11
|
-
export type { Discussion, DemandDecl, ProjectMRsScope, ProjectMRsData, DiscussionsData, MrByBranchEntry, MrByBranchData, BranchEnrichment, Commands, CommandName, ForgeSlug, ForgeTokenData, Attention, RunSummary, RunStageRow, RunFieldRow, RunDecisionRow, RunDetail, WakeMode, ChatMember, ChatMessage, ChatClaimOutcome, RoomSummary, BuddyStatus, PresenceRow, AgentRecord, AgentSurface, AgentStatus, ExecutorState, ExecutorView, ReconcilerStatus, ChatPane, PaneAccount, PaneDirectory, InviteResult, PaneDelivery, PaneSendResult, PaneFocusResult, GateStatus, GateOption, GateOrigin, GateQuestion, GateAnswer, GateRow, GateSubscription, HerdInfo, HerdListRow, HerdJobInfo, HerdStatusData, } from "./commands.ts";
|
|
11
|
+
export type { Discussion, DemandDecl, ProjectMRsScope, ProjectSyncError, ProjectSyncErrorKind, ProjectMRsData, DiscussionsData, MrByBranchEntry, MrByBranchData, BranchEnrichment, Commands, CommandName, ForgeSlug, ForgeTokenData, Attention, RunSummary, RunStageRow, RunFieldRow, RunDecisionRow, RunDetail, WakeMode, ChatMember, ChatMessage, ChatClaimOutcome, RoomSummary, BuddyStatus, PresenceRow, AgentRecord, AgentSurface, AgentStatus, ExecutorState, ExecutorView, ReconcilerStatus, ChatPane, PaneAccount, PaneDirectory, InviteResult, PaneDelivery, PaneSendResult, PaneFocusResult, GateStatus, GateOption, GateOrigin, GateQuestion, GateAnswer, GateRow, GateSubscription, HerdInfo, HerdListRow, HerdJobInfo, HerdStatusData, } from "./commands.ts";
|
|
12
12
|
export { subscribe, createRelay, DEFAULT_WS_URL } from "./relay.ts";
|
|
13
13
|
export type { RelayEventType } from "./relay.ts";
|
|
14
14
|
export { daemonHealth } from "./health.ts";
|
package/dist/index.js
CHANGED
|
@@ -582,6 +582,7 @@ var COMMAND_NAMES = [
|
|
|
582
582
|
"endpoint:release",
|
|
583
583
|
"endpoint:status",
|
|
584
584
|
"repos:locate",
|
|
585
|
+
"repos:status",
|
|
585
586
|
"freshness:reconcile",
|
|
586
587
|
"reconciler:status",
|
|
587
588
|
"reconciler:clear",
|
|
@@ -1120,6 +1121,16 @@ var REGISTRY = [
|
|
|
1120
1121
|
migrated: true,
|
|
1121
1122
|
description: "Age floor in days for the log janitor pruning every surface's rotated log files under ~/.mattstack/rt/logs (default 14). A fresh key, not an ownership-latch port, so a default is fine here."
|
|
1122
1123
|
},
|
|
1124
|
+
{
|
|
1125
|
+
key: "rt.gitStatus",
|
|
1126
|
+
type: "object",
|
|
1127
|
+
scopes: ALL_SCOPES,
|
|
1128
|
+
default: { sweep: true, sweepIntervalSec: 300, fetchIntervalSec: 900 },
|
|
1129
|
+
merge: "deep",
|
|
1130
|
+
repoScoped: true,
|
|
1131
|
+
migrated: true,
|
|
1132
|
+
description: "Mission-control git badge sweep. sweep gates the daemon sweep and fetchIntervalSec (the background fetch cadence, 0 disables fetching) are both read per repo, so a per-repo override of either takes effect (a repo override of { sweep: false } opts that repo out). sweepIntervalSec, the minimum seconds between sweeps, is read only from the global config by the sweep tick; a per-repo override of sweepIntervalSec has no effect."
|
|
1133
|
+
},
|
|
1123
1134
|
{
|
|
1124
1135
|
key: "rt.logLevel",
|
|
1125
1136
|
type: "string",
|
|
@@ -1682,6 +1693,14 @@ var REGISTRY = [
|
|
|
1682
1693
|
default: false,
|
|
1683
1694
|
merge: "replace",
|
|
1684
1695
|
description: "Whether the watchdog may drive a mid-run folder-trust dialog on a daemon-provisioned tree itself, rather than only parking the job and notifying (RT-196). Off by default: the screen match cannot yet confirm the dialog's folder matches the job's worktree, so a working session showing an unrelated permission prompt with the same shape is a real risk."
|
|
1696
|
+
},
|
|
1697
|
+
{
|
|
1698
|
+
key: "panes.relocationAutoAccept",
|
|
1699
|
+
type: "boolean",
|
|
1700
|
+
scopes: ["machine"],
|
|
1701
|
+
default: true,
|
|
1702
|
+
merge: "replace",
|
|
1703
|
+
description: "Whether the daemon may answer Claude Code's EnterWorktree permission-root relocation prompt on a blocked pane by itself (RT-200). Unlike the trust dialog, the prompt names the worktree path in its own body, and the daemon accepts only when that exact path is in rt's worktree registry, so this is on by default. Read by both the herd watchdog and the executor reconciler."
|
|
1685
1704
|
}
|
|
1686
1705
|
];
|
|
1687
1706
|
|
|
@@ -1856,11 +1875,11 @@ function expandString(input, ctx) {
|
|
|
1856
1875
|
return match;
|
|
1857
1876
|
});
|
|
1858
1877
|
}
|
|
1859
|
-
function teamPath(
|
|
1878
|
+
function teamPath(teamsDir, name) {
|
|
1860
1879
|
if (name.includes("/") || name.includes("\\") || name.includes("..")) {
|
|
1861
1880
|
throw new Error(`rt: cannot expand \${team:${name}} — a team name must be a single directory segment (no "/", "\\" or "..")`);
|
|
1862
1881
|
}
|
|
1863
|
-
return join6(
|
|
1882
|
+
return join6(teamsDir, name);
|
|
1864
1883
|
}
|
|
1865
1884
|
function required(value, name, needs) {
|
|
1866
1885
|
if (value === undefined || value === "") {
|
|
@@ -2525,122 +2544,122 @@ async function resolveNameToIdentity(name, reposJsonPath) {
|
|
|
2525
2544
|
}
|
|
2526
2545
|
}
|
|
2527
2546
|
export {
|
|
2528
|
-
|
|
2529
|
-
validateGateAnswers,
|
|
2530
|
-
unwrapGateAnswerValue,
|
|
2531
|
-
unsetSetting,
|
|
2532
|
-
subscribe,
|
|
2533
|
-
setSettingsWarnSink,
|
|
2534
|
-
setSetting,
|
|
2535
|
-
serializeIdentity,
|
|
2536
|
-
rtCommand,
|
|
2537
|
-
resolveNameToIdentity,
|
|
2538
|
-
resolveForgeToken,
|
|
2539
|
-
repoNameForPath,
|
|
2540
|
-
reconcilerStatus,
|
|
2541
|
-
reconcilerClear,
|
|
2542
|
-
readStore,
|
|
2543
|
-
readProjectMRs,
|
|
2544
|
-
readMrsByBranch,
|
|
2545
|
-
readDiscussions,
|
|
2546
|
-
readBranchCache,
|
|
2547
|
-
parsePaneRef,
|
|
2548
|
-
parseIdentity,
|
|
2549
|
-
paneSpawn,
|
|
2550
|
-
paneSend,
|
|
2551
|
-
panePeek,
|
|
2552
|
-
paneList,
|
|
2553
|
-
paneFocus,
|
|
2554
|
-
paneDirectories,
|
|
2555
|
-
paneAccounts,
|
|
2556
|
-
openSmartPane,
|
|
2557
|
-
normalizeRemote,
|
|
2558
|
-
normalizeGateQuestions,
|
|
2559
|
-
normalizeGateOptions,
|
|
2560
|
-
listTeams,
|
|
2561
|
-
listSettings,
|
|
2562
|
-
listRuns,
|
|
2563
|
-
isMigrated,
|
|
2564
|
-
identityFromRemote,
|
|
2565
|
-
herdWrapUp,
|
|
2566
|
-
herdStopHidden,
|
|
2567
|
-
herdStatus,
|
|
2568
|
-
herdStart,
|
|
2569
|
-
herdSpawn,
|
|
2570
|
-
herdResume,
|
|
2571
|
-
herdReport,
|
|
2572
|
-
herdMilestone,
|
|
2573
|
-
herdList,
|
|
2574
|
-
herdGates,
|
|
2575
|
-
herdClose,
|
|
2576
|
-
herdAttend,
|
|
2577
|
-
herdAsk,
|
|
2578
|
-
herdAnswer,
|
|
2579
|
-
guardTestDaemonEnv,
|
|
2580
|
-
getSetting,
|
|
2581
|
-
getRun,
|
|
2582
|
-
getDef,
|
|
2583
|
-
gateWait,
|
|
2584
|
-
gateUnsubscribe,
|
|
2585
|
-
gateSubscriptions,
|
|
2586
|
-
gateSubscribe,
|
|
2587
|
-
gatePresentation,
|
|
2588
|
-
gatePark,
|
|
2589
|
-
gateOptionValue,
|
|
2590
|
-
gateOptionLabel,
|
|
2591
|
-
gateOpen,
|
|
2592
|
-
gateList,
|
|
2593
|
-
gateClose,
|
|
2594
|
-
gateAsk,
|
|
2595
|
-
gateAnswer,
|
|
2596
|
-
formatPaneRef,
|
|
2597
|
-
explainSetting,
|
|
2598
|
-
expandVariables,
|
|
2599
|
-
eventsWait,
|
|
2600
|
-
eventsList,
|
|
2601
|
-
eventsHead,
|
|
2602
|
-
eventsEmit,
|
|
2603
|
-
deriveRepoIdentity,
|
|
2604
|
-
decidePlacement,
|
|
2605
|
-
daemonHealth,
|
|
2606
|
-
createRelay,
|
|
2607
|
-
clearIdentityMemo,
|
|
2608
|
-
chatWho,
|
|
2609
|
-
chatSignOut,
|
|
2610
|
-
chatSignIn,
|
|
2611
|
-
chatRooms,
|
|
2612
|
-
chatRelease,
|
|
2613
|
-
chatRead,
|
|
2614
|
-
chatPost,
|
|
2615
|
-
chatMessages,
|
|
2616
|
-
chatMark,
|
|
2617
|
-
chatLeave,
|
|
2618
|
-
chatJoin,
|
|
2619
|
-
chatInvite,
|
|
2620
|
-
chatDmOpen,
|
|
2621
|
-
chatDm,
|
|
2622
|
-
chatClaim,
|
|
2623
|
-
chatBuddies,
|
|
2624
|
-
chatBack,
|
|
2625
|
-
chatAway,
|
|
2626
|
-
chatArchive,
|
|
2627
|
-
chatAck,
|
|
2628
|
-
bgStop,
|
|
2629
|
-
bgStatus,
|
|
2630
|
-
bgRelease,
|
|
2631
|
-
bgEnsure,
|
|
2632
|
-
allDefs,
|
|
2633
|
-
agentStart,
|
|
2634
|
-
agentResume,
|
|
2635
|
-
agentList,
|
|
2636
|
-
agentGet,
|
|
2637
|
-
abandonRun,
|
|
2638
|
-
SCOPE_ORDER,
|
|
2639
|
-
REGISTRY,
|
|
2640
|
-
GATE_FORM_OPTION_CAP,
|
|
2641
|
-
GATE_BY_PANE,
|
|
2642
|
-
DEFAULT_WS_URL,
|
|
2643
|
-
DEFAULT_SOCK,
|
|
2547
|
+
BG_PREFIX,
|
|
2644
2548
|
COMMAND_NAMES,
|
|
2645
|
-
|
|
2549
|
+
DEFAULT_SOCK,
|
|
2550
|
+
DEFAULT_WS_URL,
|
|
2551
|
+
GATE_BY_PANE,
|
|
2552
|
+
GATE_FORM_OPTION_CAP,
|
|
2553
|
+
REGISTRY,
|
|
2554
|
+
SCOPE_ORDER,
|
|
2555
|
+
abandonRun,
|
|
2556
|
+
agentGet,
|
|
2557
|
+
agentList,
|
|
2558
|
+
agentResume,
|
|
2559
|
+
agentStart,
|
|
2560
|
+
allDefs,
|
|
2561
|
+
bgEnsure,
|
|
2562
|
+
bgRelease,
|
|
2563
|
+
bgStatus,
|
|
2564
|
+
bgStop,
|
|
2565
|
+
chatAck,
|
|
2566
|
+
chatArchive,
|
|
2567
|
+
chatAway,
|
|
2568
|
+
chatBack,
|
|
2569
|
+
chatBuddies,
|
|
2570
|
+
chatClaim,
|
|
2571
|
+
chatDm,
|
|
2572
|
+
chatDmOpen,
|
|
2573
|
+
chatInvite,
|
|
2574
|
+
chatJoin,
|
|
2575
|
+
chatLeave,
|
|
2576
|
+
chatMark,
|
|
2577
|
+
chatMessages,
|
|
2578
|
+
chatPost,
|
|
2579
|
+
chatRead,
|
|
2580
|
+
chatRelease,
|
|
2581
|
+
chatRooms,
|
|
2582
|
+
chatSignIn,
|
|
2583
|
+
chatSignOut,
|
|
2584
|
+
chatWho,
|
|
2585
|
+
clearIdentityMemo,
|
|
2586
|
+
createRelay,
|
|
2587
|
+
daemonHealth,
|
|
2588
|
+
decidePlacement,
|
|
2589
|
+
deriveRepoIdentity,
|
|
2590
|
+
eventsEmit,
|
|
2591
|
+
eventsHead,
|
|
2592
|
+
eventsList,
|
|
2593
|
+
eventsWait,
|
|
2594
|
+
expandVariables,
|
|
2595
|
+
explainSetting,
|
|
2596
|
+
formatPaneRef,
|
|
2597
|
+
gateAnswer,
|
|
2598
|
+
gateAsk,
|
|
2599
|
+
gateClose,
|
|
2600
|
+
gateList,
|
|
2601
|
+
gateOpen,
|
|
2602
|
+
gateOptionLabel,
|
|
2603
|
+
gateOptionValue,
|
|
2604
|
+
gatePark,
|
|
2605
|
+
gatePresentation,
|
|
2606
|
+
gateSubscribe,
|
|
2607
|
+
gateSubscriptions,
|
|
2608
|
+
gateUnsubscribe,
|
|
2609
|
+
gateWait,
|
|
2610
|
+
getDef,
|
|
2611
|
+
getRun,
|
|
2612
|
+
getSetting,
|
|
2613
|
+
guardTestDaemonEnv,
|
|
2614
|
+
herdAnswer,
|
|
2615
|
+
herdAsk,
|
|
2616
|
+
herdAttend,
|
|
2617
|
+
herdClose,
|
|
2618
|
+
herdGates,
|
|
2619
|
+
herdList,
|
|
2620
|
+
herdMilestone,
|
|
2621
|
+
herdReport,
|
|
2622
|
+
herdResume,
|
|
2623
|
+
herdSpawn,
|
|
2624
|
+
herdStart,
|
|
2625
|
+
herdStatus,
|
|
2626
|
+
herdStopHidden,
|
|
2627
|
+
herdWrapUp,
|
|
2628
|
+
identityFromRemote,
|
|
2629
|
+
isMigrated,
|
|
2630
|
+
listRuns,
|
|
2631
|
+
listSettings,
|
|
2632
|
+
listTeams,
|
|
2633
|
+
normalizeGateOptions,
|
|
2634
|
+
normalizeGateQuestions,
|
|
2635
|
+
normalizeRemote,
|
|
2636
|
+
openSmartPane,
|
|
2637
|
+
paneAccounts,
|
|
2638
|
+
paneDirectories,
|
|
2639
|
+
paneFocus,
|
|
2640
|
+
paneList,
|
|
2641
|
+
panePeek,
|
|
2642
|
+
paneSend,
|
|
2643
|
+
paneSpawn,
|
|
2644
|
+
parseIdentity,
|
|
2645
|
+
parsePaneRef,
|
|
2646
|
+
readBranchCache,
|
|
2647
|
+
readDiscussions,
|
|
2648
|
+
readMrsByBranch,
|
|
2649
|
+
readProjectMRs,
|
|
2650
|
+
readStore,
|
|
2651
|
+
reconcilerClear,
|
|
2652
|
+
reconcilerStatus,
|
|
2653
|
+
repoNameForPath,
|
|
2654
|
+
resolveForgeToken,
|
|
2655
|
+
resolveNameToIdentity,
|
|
2656
|
+
rtCommand,
|
|
2657
|
+
serializeIdentity,
|
|
2658
|
+
setSetting,
|
|
2659
|
+
setSettingsWarnSink,
|
|
2660
|
+
subscribe,
|
|
2661
|
+
unsetSetting,
|
|
2662
|
+
unwrapGateAnswerValue,
|
|
2663
|
+
validateGateAnswers,
|
|
2664
|
+
validateValue
|
|
2646
2665
|
};
|
package/package.json
CHANGED
package/src/commands.ts
CHANGED
|
@@ -31,12 +31,27 @@ export interface ProjectMRsScope {
|
|
|
31
31
|
knownSections?: string[];
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
/** Classified cause of a repo's failing project sync (lib/daemon/project-sync-health.ts). */
|
|
35
|
+
export type ProjectSyncErrorKind = "rate-limited" | "auth" | "server-error" | "timeout" | "other";
|
|
36
|
+
|
|
37
|
+
/** A repo's current unbroken run of failed project syncs. */
|
|
38
|
+
export interface ProjectSyncError {
|
|
39
|
+
/** First failure of the run; later failures leave it alone. */
|
|
40
|
+
since: number;
|
|
41
|
+
lastAt: number;
|
|
42
|
+
kind: ProjectSyncErrorKind;
|
|
43
|
+
/** Raw error text, capped at 200 chars. */
|
|
44
|
+
message: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
34
47
|
export interface ProjectMRsData {
|
|
35
48
|
mrs: Record<string, { pr: PullRequest; fetchedAt: number; codeownerSections?: string[] }>;
|
|
36
49
|
listSyncedAt: number;
|
|
37
50
|
source: "poll" | "events" | "mutation";
|
|
38
51
|
syncedAt: number;
|
|
39
52
|
scope?: ProjectMRsScope;
|
|
53
|
+
/** Present while this repo's most recent project sync failed. */
|
|
54
|
+
syncError?: ProjectSyncError;
|
|
40
55
|
}
|
|
41
56
|
|
|
42
57
|
export interface DiscussionsData {
|
|
@@ -464,8 +479,14 @@ export interface WorktreeProvisionData {
|
|
|
464
479
|
tree: string; path: string; branch: string; wasOnDeck: boolean;
|
|
465
480
|
readyAt: string | null; branchState: "new" | "tracking-remote" | "existing-clean" | "diverged" | "behind";
|
|
466
481
|
readyFailed?: true; failedStep?: string;
|
|
482
|
+
/** Set only when the tree was built by hydrating from the repo's golden donor, not the on-deck pool or a cold create. */
|
|
483
|
+
hydratedFrom?: string;
|
|
484
|
+
}
|
|
485
|
+
export interface WorktreeCreateData {
|
|
486
|
+
tree: string; path: string;
|
|
487
|
+
/** Set only for `--on-deck`, and only when that tree hydrated from the golden rather than cold-creating. */
|
|
488
|
+
hydratedFrom?: string;
|
|
467
489
|
}
|
|
468
|
-
export interface WorktreeCreateData { tree: string; path: string }
|
|
469
490
|
export interface WorktreeDisposeData {
|
|
470
491
|
disposed: string[];
|
|
471
492
|
/** `detail` is set only for a refusal whose bare `reason` code can't name
|
|
@@ -505,6 +526,30 @@ export type MRActionName =
|
|
|
505
526
|
| "retryJob" | "retryPipeline"
|
|
506
527
|
| "toggleDraft" | "requestReReview";
|
|
507
528
|
|
|
529
|
+
/** One worktree's git badge as the daemon sweep computed it. All timestamps ISO 8601. */
|
|
530
|
+
export interface GitWorktreeBadge {
|
|
531
|
+
worktree: string;
|
|
532
|
+
branch: string | null;
|
|
533
|
+
detached: boolean;
|
|
534
|
+
staged: number;
|
|
535
|
+
unstaged: number;
|
|
536
|
+
untracked: number;
|
|
537
|
+
conflicted: number;
|
|
538
|
+
clean: boolean;
|
|
539
|
+
ahead: number | null;
|
|
540
|
+
behind: number | null;
|
|
541
|
+
upstream: string | null;
|
|
542
|
+
lastFetchedAt: string | null;
|
|
543
|
+
updatedAt: string;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
/** repo is the serialized identity (the repo-index key). error is set when the last sweep could not read the repo; stale worktrees may accompany it. */
|
|
547
|
+
export interface RepoStatusRow {
|
|
548
|
+
repo: string;
|
|
549
|
+
worktrees: GitWorktreeBadge[];
|
|
550
|
+
error: string | null;
|
|
551
|
+
}
|
|
552
|
+
|
|
508
553
|
export interface Commands {
|
|
509
554
|
"project-mrs:read": { payload: { repoName: string; maxAgeMs?: number; demand?: DemandDecl }; data: ProjectMRsData };
|
|
510
555
|
"discussions:read": { payload: { repoName: string; iid: number }; data: DiscussionsData };
|
|
@@ -684,6 +729,7 @@ export interface Commands {
|
|
|
684
729
|
"endpoint:status": { payload: { repo?: string }; data: EndpointStatusData };
|
|
685
730
|
|
|
686
731
|
"repos:locate": { payload: { newPath: string; repo?: string; dryRun?: boolean }; data: unknown };
|
|
732
|
+
"repos:status": { payload: { refresh?: boolean }; data: { repos: RepoStatusRow[]; sweptAt: string | null } };
|
|
687
733
|
"freshness:reconcile": { payload: Record<string, never>; data: unknown };
|
|
688
734
|
|
|
689
735
|
// ─── Reconciler (executor state; lib/daemon/reconciler.ts) ───────────────
|
|
@@ -721,8 +767,17 @@ export interface Commands {
|
|
|
721
767
|
/** `contextOmitted` appears only when the gate context plus every
|
|
722
768
|
question's `context` exceeded their shared 8192-byte budget: the
|
|
723
769
|
gate still opened, but question contexts were dropped, and the gate
|
|
724
|
-
context too when it was over the budget on its own.
|
|
725
|
-
|
|
770
|
+
context too when it was over the budget on its own.
|
|
771
|
+
`formCapExceeded`/`formCapAdvisory` appear only when the pane could
|
|
772
|
+
have presented an in-pane form and one or more questions exceeded
|
|
773
|
+
its 4-option cap, which is the one thing that forced this gate to
|
|
774
|
+
`wait`: the gate still opens, and the advisory names the structural
|
|
775
|
+
fix so the caller can re-author. */
|
|
776
|
+
data: {
|
|
777
|
+
id: string; presentation: "form" | "wait"; subject: string; supersededId: string | null; contextOmitted?: true;
|
|
778
|
+
formCapExceeded?: Array<{ question: string; options: number }>;
|
|
779
|
+
formCapAdvisory?: string;
|
|
780
|
+
};
|
|
726
781
|
};
|
|
727
782
|
/**
|
|
728
783
|
* A CAS loss is a DEFINED OUTCOME, not an error: `ok:true` with
|
|
@@ -875,6 +930,7 @@ export const COMMAND_NAMES: readonly CommandName[] = [
|
|
|
875
930
|
"endpoint:release",
|
|
876
931
|
"endpoint:status",
|
|
877
932
|
"repos:locate",
|
|
933
|
+
"repos:status",
|
|
878
934
|
"freshness:reconcile",
|
|
879
935
|
"reconciler:status",
|
|
880
936
|
"reconciler:clear",
|
package/src/index.ts
CHANGED
|
@@ -222,6 +222,16 @@ export const REGISTRY: readonly SettingDef[] = [
|
|
|
222
222
|
migrated: true,
|
|
223
223
|
description: "Age floor in days for the log janitor pruning every surface's rotated log files under ~/.mattstack/rt/logs (default 14). A fresh key, not an ownership-latch port, so a default is fine here.",
|
|
224
224
|
},
|
|
225
|
+
{
|
|
226
|
+
key: "rt.gitStatus",
|
|
227
|
+
type: "object",
|
|
228
|
+
scopes: ALL_SCOPES,
|
|
229
|
+
default: { sweep: true, sweepIntervalSec: 300, fetchIntervalSec: 900 },
|
|
230
|
+
merge: "deep",
|
|
231
|
+
repoScoped: true,
|
|
232
|
+
migrated: true,
|
|
233
|
+
description: "Mission-control git badge sweep. sweep gates the daemon sweep and fetchIntervalSec (the background fetch cadence, 0 disables fetching) are both read per repo, so a per-repo override of either takes effect (a repo override of { sweep: false } opts that repo out). sweepIntervalSec, the minimum seconds between sweeps, is read only from the global config by the sweep tick; a per-repo override of sweepIntervalSec has no effect.",
|
|
234
|
+
},
|
|
225
235
|
{
|
|
226
236
|
key: "rt.logLevel",
|
|
227
237
|
type: "string",
|
|
@@ -825,4 +835,12 @@ export const REGISTRY: readonly SettingDef[] = [
|
|
|
825
835
|
merge: "replace",
|
|
826
836
|
description: "Whether the watchdog may drive a mid-run folder-trust dialog on a daemon-provisioned tree itself, rather than only parking the job and notifying (RT-196). Off by default: the screen match cannot yet confirm the dialog's folder matches the job's worktree, so a working session showing an unrelated permission prompt with the same shape is a real risk.",
|
|
827
837
|
},
|
|
838
|
+
{
|
|
839
|
+
key: "panes.relocationAutoAccept",
|
|
840
|
+
type: "boolean",
|
|
841
|
+
scopes: ["machine"],
|
|
842
|
+
default: true,
|
|
843
|
+
merge: "replace",
|
|
844
|
+
description: "Whether the daemon may answer Claude Code's EnterWorktree permission-root relocation prompt on a blocked pane by itself (RT-200). Unlike the trust dialog, the prompt names the worktree path in its own body, and the daemon accepts only when that exact path is in rt's worktree registry, so this is on by default. Read by both the herd watchdog and the executor reconciler.",
|
|
845
|
+
},
|
|
828
846
|
];
|