@mattstack/rt-client 0.10.1 → 0.11.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/dist/client.d.ts +21 -1
- package/dist/commands.d.ts +574 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.js +203 -16
- package/dist/settings/exec.d.ts +2 -0
- package/dist/settings/resolve.d.ts +5 -0
- package/dist/smart-pane.d.ts +48 -0
- package/dist/transport.d.ts +7 -0
- package/package.json +4 -1
- package/src/client.ts +24 -3
- package/src/commands.ts +246 -2
- package/src/index.ts +8 -1
- package/src/settings/exec.ts +47 -13
- package/src/settings/registry-defs.ts +43 -0
- package/src/settings/resolve.ts +24 -3
- package/src/smart-pane.ts +94 -0
- package/src/transport.ts +5 -1
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RtResponse, RtClientOptions } from "./transport.ts";
|
|
2
|
-
import type { DemandDecl, ProjectMRsData, DiscussionsData, MrByBranchData, BranchEnrichment, ForgeSlug, ForgeTokenData, RunSummary, RunDetail, WakeMode, ChatMember, ChatMessage, RoomSummary, BuddyStatus, PresenceRow, AgentRecord, Commands } from "./commands.ts";
|
|
2
|
+
import type { DemandDecl, ProjectMRsData, DiscussionsData, MrByBranchData, BranchEnrichment, ForgeSlug, ForgeTokenData, RunSummary, RunDetail, WakeMode, ChatMember, ChatMessage, ChatClaimOutcome, RoomSummary, BuddyStatus, PresenceRow, AgentRecord, Commands } from "./commands.ts";
|
|
3
3
|
/**
|
|
4
4
|
* One repo's project open-MR store. A cold repo forces a full paginated sync
|
|
5
5
|
* on the daemon side when maxAgeMs demands it, which can run tens of seconds
|
|
@@ -59,9 +59,29 @@ export declare function chatPost(a: {
|
|
|
59
59
|
handle: string;
|
|
60
60
|
body: string;
|
|
61
61
|
mentions?: string[];
|
|
62
|
+
quiet?: boolean;
|
|
62
63
|
}, o?: RtClientOptions): Promise<RtResponse<{
|
|
63
64
|
id: number;
|
|
64
65
|
recipients: string[];
|
|
66
|
+
others: number;
|
|
67
|
+
}>>;
|
|
68
|
+
export declare function chatAck(a: {
|
|
69
|
+
id: number;
|
|
70
|
+
handle: string;
|
|
71
|
+
}, o?: RtClientOptions): Promise<RtResponse<{
|
|
72
|
+
author: string;
|
|
73
|
+
room: string;
|
|
74
|
+
already: boolean;
|
|
75
|
+
}>>;
|
|
76
|
+
export declare function chatClaim(a: {
|
|
77
|
+
id: number;
|
|
78
|
+
handle: string;
|
|
79
|
+
}, o?: RtClientOptions): Promise<RtResponse<ChatClaimOutcome>>;
|
|
80
|
+
export declare function chatRelease(a: {
|
|
81
|
+
id: number;
|
|
82
|
+
handle: string;
|
|
83
|
+
}, o?: RtClientOptions): Promise<RtResponse<{
|
|
84
|
+
holder: string;
|
|
65
85
|
}>>;
|
|
66
86
|
export declare function chatRead(a: {
|
|
67
87
|
handle: string;
|
package/dist/commands.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* its functions against this map so a new command only needs an entry here
|
|
5
5
|
* plus one function, never a change to the transport itself.
|
|
6
6
|
*/
|
|
7
|
-
import type { PullRequest, MRDetail } from "@mattstack/glance";
|
|
7
|
+
import type { PullRequest, MRDetail, Pipeline } from "@mattstack/glance";
|
|
8
8
|
export type Discussion = MRDetail["discussions"][number];
|
|
9
9
|
/** What a caller declares it needs, so the daemon can size the sync to cover it. */
|
|
10
10
|
export interface DemandDecl {
|
|
@@ -22,6 +22,10 @@ export interface ProjectMRsScope {
|
|
|
22
22
|
sections?: string[];
|
|
23
23
|
/** Demanded sections not yet swept for this client. */
|
|
24
24
|
uncoveredSections?: string[];
|
|
25
|
+
/** Section headers in the default-branch CODEOWNERS at the last deep or
|
|
26
|
+
backfill. `[]` when the project has none. Absent from a pre-knownSections
|
|
27
|
+
daemon or before the first sweep that demanded a section. */
|
|
28
|
+
knownSections?: string[];
|
|
25
29
|
}
|
|
26
30
|
export interface ProjectMRsData {
|
|
27
31
|
mrs: Record<string, {
|
|
@@ -113,6 +117,22 @@ export interface ChatMessage {
|
|
|
113
117
|
replyTo?: number;
|
|
114
118
|
postedAt: number;
|
|
115
119
|
}
|
|
120
|
+
/** `claimed` is the only outcome that woke anyone; `previousHolder` marks a takeover of an expired claim. */
|
|
121
|
+
export type ChatClaimOutcome = {
|
|
122
|
+
outcome: "claimed";
|
|
123
|
+
author: string;
|
|
124
|
+
room: string;
|
|
125
|
+
previousHolder?: string;
|
|
126
|
+
} | {
|
|
127
|
+
outcome: "held";
|
|
128
|
+
author: string;
|
|
129
|
+
room: string;
|
|
130
|
+
} | {
|
|
131
|
+
outcome: "lost";
|
|
132
|
+
holder: string;
|
|
133
|
+
claimedAt: number;
|
|
134
|
+
expiresAt: number;
|
|
135
|
+
};
|
|
116
136
|
export interface RoomSummary {
|
|
117
137
|
room: string;
|
|
118
138
|
memberCount: number;
|
|
@@ -289,6 +309,265 @@ export interface AgentRecord {
|
|
|
289
309
|
lastResumedAt?: number;
|
|
290
310
|
finishedAt?: number;
|
|
291
311
|
}
|
|
312
|
+
/** Duplicated shape on purpose (see EventsBusEvent above): mirrors lib/daemon/health.ts's HealthSnapshot. */
|
|
313
|
+
export type HealthLevel = "ok" | "degraded" | "unhealthy";
|
|
314
|
+
export interface HealthMetrics {
|
|
315
|
+
rss: number;
|
|
316
|
+
heapUsed: number;
|
|
317
|
+
external: number;
|
|
318
|
+
uptimeMs: number;
|
|
319
|
+
wsClients: number;
|
|
320
|
+
watchers: number;
|
|
321
|
+
}
|
|
322
|
+
export interface HealthEventLoop {
|
|
323
|
+
maxLagMs: number;
|
|
324
|
+
lastStallAt: number | null;
|
|
325
|
+
lastStallCmd: string | null;
|
|
326
|
+
stalls: number;
|
|
327
|
+
}
|
|
328
|
+
export interface DaemonIdentity {
|
|
329
|
+
flavor: "dev" | "prod";
|
|
330
|
+
version: string;
|
|
331
|
+
sourceRev: string | null;
|
|
332
|
+
startedAt: number;
|
|
333
|
+
}
|
|
334
|
+
export interface PingData extends DaemonIdentity {
|
|
335
|
+
uptime: number;
|
|
336
|
+
pid: number;
|
|
337
|
+
health: HealthLevel;
|
|
338
|
+
eventLoop: HealthEventLoop;
|
|
339
|
+
heartbeatSeq: number;
|
|
340
|
+
supervision: {
|
|
341
|
+
bootAttempts: number;
|
|
342
|
+
lastReadyAt: number | null;
|
|
343
|
+
recentFailures: unknown[];
|
|
344
|
+
lastExit: unknown;
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
export interface StatusData {
|
|
348
|
+
pid: number;
|
|
349
|
+
uptime: number;
|
|
350
|
+
watchedRepos: number;
|
|
351
|
+
cacheEntries: number;
|
|
352
|
+
portsCached: number;
|
|
353
|
+
portCacheAge: number | null;
|
|
354
|
+
freshness: unknown;
|
|
355
|
+
identity: DaemonIdentity;
|
|
356
|
+
health: {
|
|
357
|
+
level: HealthLevel;
|
|
358
|
+
reasons: string[];
|
|
359
|
+
};
|
|
360
|
+
metrics: HealthMetrics;
|
|
361
|
+
eventLoop: HealthEventLoop;
|
|
362
|
+
worktreePool: {
|
|
363
|
+
dormant: true;
|
|
364
|
+
repos: string[];
|
|
365
|
+
message: string;
|
|
366
|
+
} | {
|
|
367
|
+
dormant: false;
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
/** Duplicated shape on purpose: mirrors lib/worktree/ready-held.ts's ReadyHeldRepo. */
|
|
371
|
+
export interface ReadyHeldRepo {
|
|
372
|
+
/** Serialized repo identity. A key, never displayed. */
|
|
373
|
+
repo: string;
|
|
374
|
+
/** Decoded display name. Never sent back as a key. */
|
|
375
|
+
label: string;
|
|
376
|
+
hash: string;
|
|
377
|
+
approveCommand: string;
|
|
378
|
+
}
|
|
379
|
+
export interface TrayStatusData {
|
|
380
|
+
pid: number;
|
|
381
|
+
uptime: number;
|
|
382
|
+
memoryUsage: number;
|
|
383
|
+
watchedRepos: number;
|
|
384
|
+
cacheEntries: number;
|
|
385
|
+
portsCached: number;
|
|
386
|
+
portCacheAge: number | null;
|
|
387
|
+
lastRefresh: number | null;
|
|
388
|
+
portsByRepo: Record<string, number>;
|
|
389
|
+
pendingNotifications: number;
|
|
390
|
+
health: {
|
|
391
|
+
level: HealthLevel;
|
|
392
|
+
reasons: string[];
|
|
393
|
+
};
|
|
394
|
+
metrics: HealthMetrics;
|
|
395
|
+
eventLoop: HealthEventLoop;
|
|
396
|
+
/** Optional because a daemon older than RT-98 does not send it. */
|
|
397
|
+
worktreeReadyHeld?: ReadyHeldRepo[];
|
|
398
|
+
}
|
|
399
|
+
/** Duplicated shape on purpose: mirrors lib/port-scanner.ts's PortEntry. */
|
|
400
|
+
export interface PortEntry {
|
|
401
|
+
port: number;
|
|
402
|
+
pid: number;
|
|
403
|
+
command: string;
|
|
404
|
+
cwd: string;
|
|
405
|
+
repo: string | null;
|
|
406
|
+
worktree: string | null;
|
|
407
|
+
branch: string | null;
|
|
408
|
+
relativeDir: string;
|
|
409
|
+
uptime: string;
|
|
410
|
+
}
|
|
411
|
+
export interface PortsData {
|
|
412
|
+
ports: PortEntry[];
|
|
413
|
+
grouped: Record<string, Record<string, PortEntry[]>>;
|
|
414
|
+
updatedAt: number;
|
|
415
|
+
age: number | null;
|
|
416
|
+
}
|
|
417
|
+
/** Duplicated shape on purpose: mirrors lib/state/notifier-store.ts's NotificationEvent. */
|
|
418
|
+
export interface RtNotificationEvent {
|
|
419
|
+
id: string;
|
|
420
|
+
title: string;
|
|
421
|
+
message: string;
|
|
422
|
+
url?: string;
|
|
423
|
+
category: string;
|
|
424
|
+
timestamp: number;
|
|
425
|
+
pids?: number[];
|
|
426
|
+
}
|
|
427
|
+
export interface ReposData {
|
|
428
|
+
repos: Record<string, {
|
|
429
|
+
path: string;
|
|
430
|
+
worktrees: Array<{
|
|
431
|
+
path: string;
|
|
432
|
+
branch: string;
|
|
433
|
+
}>;
|
|
434
|
+
}>;
|
|
435
|
+
watched: string[];
|
|
436
|
+
}
|
|
437
|
+
export interface TccCheckData {
|
|
438
|
+
blocked: Array<{
|
|
439
|
+
name: string;
|
|
440
|
+
path: string;
|
|
441
|
+
error: string;
|
|
442
|
+
}>;
|
|
443
|
+
accessible: string[];
|
|
444
|
+
totalRepos: number;
|
|
445
|
+
daemonPid: number;
|
|
446
|
+
}
|
|
447
|
+
export interface WorktreeTreeRow {
|
|
448
|
+
name: string;
|
|
449
|
+
kind: string;
|
|
450
|
+
state: string;
|
|
451
|
+
path: string;
|
|
452
|
+
branch: string | null;
|
|
453
|
+
repoName: string;
|
|
454
|
+
mr: {
|
|
455
|
+
iid: number;
|
|
456
|
+
state: string;
|
|
457
|
+
title: string;
|
|
458
|
+
} | null;
|
|
459
|
+
duplicateBranch?: true;
|
|
460
|
+
[extra: string]: unknown;
|
|
461
|
+
}
|
|
462
|
+
export interface WorktreeListData {
|
|
463
|
+
trees: WorktreeTreeRow[];
|
|
464
|
+
dormant?: true;
|
|
465
|
+
dormantRepos?: string[];
|
|
466
|
+
message?: string;
|
|
467
|
+
readyHeld?: true;
|
|
468
|
+
readyHeldRepos?: string[];
|
|
469
|
+
}
|
|
470
|
+
export interface WorktreeProvisionData {
|
|
471
|
+
tree: string;
|
|
472
|
+
path: string;
|
|
473
|
+
branch: string;
|
|
474
|
+
wasOnDeck: boolean;
|
|
475
|
+
readyAt: string | null;
|
|
476
|
+
branchState: "new" | "tracking-remote" | "existing-clean" | "diverged" | "behind";
|
|
477
|
+
readyFailed?: true;
|
|
478
|
+
failedStep?: string;
|
|
479
|
+
}
|
|
480
|
+
export interface WorktreeCreateData {
|
|
481
|
+
tree: string;
|
|
482
|
+
path: string;
|
|
483
|
+
}
|
|
484
|
+
export interface WorktreeDisposeData {
|
|
485
|
+
disposed: string[];
|
|
486
|
+
refused: Array<{
|
|
487
|
+
tree: string;
|
|
488
|
+
reason: string;
|
|
489
|
+
}>;
|
|
490
|
+
recoverable: Array<{
|
|
491
|
+
tree: string;
|
|
492
|
+
path: string;
|
|
493
|
+
until: string;
|
|
494
|
+
}>;
|
|
495
|
+
}
|
|
496
|
+
export interface WorktreeRestoreData {
|
|
497
|
+
restored: true;
|
|
498
|
+
path: string;
|
|
499
|
+
tree: string;
|
|
500
|
+
readyFailed?: true;
|
|
501
|
+
failedStep?: string;
|
|
502
|
+
}
|
|
503
|
+
export interface WorktreeFreshenData {
|
|
504
|
+
ran: string[];
|
|
505
|
+
}
|
|
506
|
+
export interface WorktreeAdoptData {
|
|
507
|
+
main: string;
|
|
508
|
+
claimed: string[];
|
|
509
|
+
unmanaged: string[];
|
|
510
|
+
disposed: string[];
|
|
511
|
+
refused: Array<{
|
|
512
|
+
tree: string;
|
|
513
|
+
reason: string;
|
|
514
|
+
}>;
|
|
515
|
+
}
|
|
516
|
+
/** Duplicated shape on purpose: mirrors lib/endpoint/store.ts's EndpointClaim. */
|
|
517
|
+
export interface EndpointClaim {
|
|
518
|
+
worktree: string;
|
|
519
|
+
role: string;
|
|
520
|
+
port: number;
|
|
521
|
+
ts: number;
|
|
522
|
+
}
|
|
523
|
+
export interface EndpointRoleRef {
|
|
524
|
+
port: number;
|
|
525
|
+
url: string;
|
|
526
|
+
running: boolean;
|
|
527
|
+
}
|
|
528
|
+
export interface EndpointClaimData {
|
|
529
|
+
role: string;
|
|
530
|
+
port: number;
|
|
531
|
+
url: string;
|
|
532
|
+
refs: Record<string, EndpointRoleRef>;
|
|
533
|
+
}
|
|
534
|
+
export interface EndpointLookupData {
|
|
535
|
+
claimed: boolean;
|
|
536
|
+
port: number | null;
|
|
537
|
+
url: string | null;
|
|
538
|
+
running: boolean;
|
|
539
|
+
}
|
|
540
|
+
export interface EndpointReleaseData {
|
|
541
|
+
released: number;
|
|
542
|
+
}
|
|
543
|
+
export interface EndpointStatusData {
|
|
544
|
+
repos: Record<string, Array<EndpointClaim & {
|
|
545
|
+
running: boolean;
|
|
546
|
+
}>>;
|
|
547
|
+
}
|
|
548
|
+
/**
|
|
549
|
+
* Duplicated shape on purpose: mirrors @mattstack/glance's `JobDetail`
|
|
550
|
+
* (types.ts), which the package does not re-export from its index.
|
|
551
|
+
*/
|
|
552
|
+
export type MrJobDetail = {
|
|
553
|
+
type: "trace";
|
|
554
|
+
content: string;
|
|
555
|
+
} | {
|
|
556
|
+
type: "bridge";
|
|
557
|
+
downstreamPipeline: Pipeline;
|
|
558
|
+
};
|
|
559
|
+
export interface DiscussionsWriteData {
|
|
560
|
+
discussions: Discussion[];
|
|
561
|
+
fetchedAt: number;
|
|
562
|
+
}
|
|
563
|
+
export interface DiscussionsDiffsData {
|
|
564
|
+
diffs: Array<{
|
|
565
|
+
newPath: string;
|
|
566
|
+
diff: string;
|
|
567
|
+
}>;
|
|
568
|
+
truncated: boolean;
|
|
569
|
+
}
|
|
570
|
+
export type MRActionName = "merge" | "rebase" | "approve" | "unapprove" | "setAutoMerge" | "cancelAutoMerge" | "retryJob" | "retryPipeline" | "toggleDraft" | "requestReReview";
|
|
292
571
|
export interface Commands {
|
|
293
572
|
"project-mrs:read": {
|
|
294
573
|
payload: {
|
|
@@ -452,16 +731,46 @@ export interface Commands {
|
|
|
452
731
|
};
|
|
453
732
|
data: Record<string, never>;
|
|
454
733
|
};
|
|
734
|
+
/** `others` counts the room's members besides the author, so a caller can tell "woke nobody of 7" from "nobody else is here". */
|
|
455
735
|
"chat:post": {
|
|
456
736
|
payload: {
|
|
457
737
|
room: string;
|
|
458
738
|
handle: string;
|
|
459
739
|
body: string;
|
|
460
740
|
mentions?: string[];
|
|
741
|
+
quiet?: boolean;
|
|
461
742
|
};
|
|
462
743
|
data: {
|
|
463
744
|
id: number;
|
|
464
745
|
recipients: string[];
|
|
746
|
+
others: number;
|
|
747
|
+
};
|
|
748
|
+
};
|
|
749
|
+
"chat:ack": {
|
|
750
|
+
payload: {
|
|
751
|
+
id: number;
|
|
752
|
+
handle: string;
|
|
753
|
+
};
|
|
754
|
+
data: {
|
|
755
|
+
author: string;
|
|
756
|
+
room: string;
|
|
757
|
+
already: boolean;
|
|
758
|
+
};
|
|
759
|
+
};
|
|
760
|
+
"chat:claim": {
|
|
761
|
+
payload: {
|
|
762
|
+
id: number;
|
|
763
|
+
handle: string;
|
|
764
|
+
};
|
|
765
|
+
data: ChatClaimOutcome;
|
|
766
|
+
};
|
|
767
|
+
"chat:release": {
|
|
768
|
+
payload: {
|
|
769
|
+
id: number;
|
|
770
|
+
handle: string;
|
|
771
|
+
};
|
|
772
|
+
data: {
|
|
773
|
+
holder: string;
|
|
465
774
|
};
|
|
466
775
|
};
|
|
467
776
|
"chat:read": {
|
|
@@ -728,6 +1037,270 @@ export interface Commands {
|
|
|
728
1037
|
};
|
|
729
1038
|
data: PaneFocusResult;
|
|
730
1039
|
};
|
|
1040
|
+
"cache:read": {
|
|
1041
|
+
payload: {
|
|
1042
|
+
branches?: string[];
|
|
1043
|
+
maxAgeMs?: number;
|
|
1044
|
+
repoIdentity?: string;
|
|
1045
|
+
};
|
|
1046
|
+
data: Record<string, BranchEnrichment>;
|
|
1047
|
+
};
|
|
1048
|
+
/** `source` ("cache"|"fresh"|"empty") rides alongside `data` on the wire, not nested under it. */
|
|
1049
|
+
"branch:enrich": {
|
|
1050
|
+
payload: {
|
|
1051
|
+
branch: string;
|
|
1052
|
+
repoPath?: string;
|
|
1053
|
+
remoteUrl?: string;
|
|
1054
|
+
repoIdentity?: string;
|
|
1055
|
+
};
|
|
1056
|
+
data: BranchEnrichment | null;
|
|
1057
|
+
};
|
|
1058
|
+
/** Fire-and-forget kickoff; wire reply is `{ok, message}`, not `{ok,data}`. */
|
|
1059
|
+
"cache:refresh": {
|
|
1060
|
+
payload: Record<string, never>;
|
|
1061
|
+
data: {
|
|
1062
|
+
message: string;
|
|
1063
|
+
};
|
|
1064
|
+
};
|
|
1065
|
+
"daemon:log-level": {
|
|
1066
|
+
payload: {
|
|
1067
|
+
level?: "trace" | "debug" | "info" | "warn" | "error";
|
|
1068
|
+
};
|
|
1069
|
+
data: {
|
|
1070
|
+
level: string;
|
|
1071
|
+
};
|
|
1072
|
+
};
|
|
1073
|
+
"ping": {
|
|
1074
|
+
payload: Record<string, never>;
|
|
1075
|
+
data: PingData;
|
|
1076
|
+
};
|
|
1077
|
+
"status": {
|
|
1078
|
+
payload: Record<string, never>;
|
|
1079
|
+
data: StatusData;
|
|
1080
|
+
};
|
|
1081
|
+
"tray:status": {
|
|
1082
|
+
payload: Record<string, never>;
|
|
1083
|
+
data: TrayStatusData;
|
|
1084
|
+
};
|
|
1085
|
+
"tcc:check": {
|
|
1086
|
+
payload: Record<string, never>;
|
|
1087
|
+
data: TccCheckData;
|
|
1088
|
+
};
|
|
1089
|
+
"repos": {
|
|
1090
|
+
payload: Record<string, never>;
|
|
1091
|
+
data: ReposData;
|
|
1092
|
+
};
|
|
1093
|
+
"ports": {
|
|
1094
|
+
payload: {
|
|
1095
|
+
repo?: string;
|
|
1096
|
+
refresh?: boolean;
|
|
1097
|
+
};
|
|
1098
|
+
data: PortsData;
|
|
1099
|
+
};
|
|
1100
|
+
"notifications": {
|
|
1101
|
+
payload: Record<string, never>;
|
|
1102
|
+
data: RtNotificationEvent[];
|
|
1103
|
+
};
|
|
1104
|
+
"discussions:refresh": {
|
|
1105
|
+
payload: {
|
|
1106
|
+
repoName: string;
|
|
1107
|
+
iid: number;
|
|
1108
|
+
};
|
|
1109
|
+
data: DiscussionsWriteData;
|
|
1110
|
+
};
|
|
1111
|
+
"discussions:resolve": {
|
|
1112
|
+
payload: {
|
|
1113
|
+
repoName: string;
|
|
1114
|
+
iid: number;
|
|
1115
|
+
discussionId: string;
|
|
1116
|
+
resolved?: boolean;
|
|
1117
|
+
};
|
|
1118
|
+
data: DiscussionsWriteData;
|
|
1119
|
+
};
|
|
1120
|
+
"discussions:reply": {
|
|
1121
|
+
payload: {
|
|
1122
|
+
repoName: string;
|
|
1123
|
+
iid: number;
|
|
1124
|
+
discussionId: string;
|
|
1125
|
+
body: string;
|
|
1126
|
+
};
|
|
1127
|
+
data: DiscussionsWriteData;
|
|
1128
|
+
};
|
|
1129
|
+
"discussions:diffs": {
|
|
1130
|
+
payload: {
|
|
1131
|
+
repoName: string;
|
|
1132
|
+
iid: number;
|
|
1133
|
+
};
|
|
1134
|
+
data: DiscussionsDiffsData;
|
|
1135
|
+
};
|
|
1136
|
+
/** Wire reply is `{ok:true}` on success (no `data`); a failure is `{ok:false,error}`. */
|
|
1137
|
+
"mr:action": {
|
|
1138
|
+
payload: {
|
|
1139
|
+
repoName: string;
|
|
1140
|
+
iid: number;
|
|
1141
|
+
action: MRActionName;
|
|
1142
|
+
args?: unknown[];
|
|
1143
|
+
};
|
|
1144
|
+
data: Record<string, never>;
|
|
1145
|
+
};
|
|
1146
|
+
"mr:fetch-job-detail": {
|
|
1147
|
+
payload: {
|
|
1148
|
+
repoName: string;
|
|
1149
|
+
iid: number;
|
|
1150
|
+
jobId: number;
|
|
1151
|
+
pipelineId?: number;
|
|
1152
|
+
};
|
|
1153
|
+
data: MrJobDetail;
|
|
1154
|
+
};
|
|
1155
|
+
"mr:fetch-job-trace": {
|
|
1156
|
+
payload: {
|
|
1157
|
+
repoName: string;
|
|
1158
|
+
iid: number;
|
|
1159
|
+
jobId: number;
|
|
1160
|
+
};
|
|
1161
|
+
data: string;
|
|
1162
|
+
};
|
|
1163
|
+
"endpoint:claim": {
|
|
1164
|
+
payload: {
|
|
1165
|
+
repo: string;
|
|
1166
|
+
worktree: string;
|
|
1167
|
+
role: string;
|
|
1168
|
+
pid?: number;
|
|
1169
|
+
};
|
|
1170
|
+
data: EndpointClaimData;
|
|
1171
|
+
};
|
|
1172
|
+
"endpoint:lookup": {
|
|
1173
|
+
payload: {
|
|
1174
|
+
repo: string;
|
|
1175
|
+
worktree: string;
|
|
1176
|
+
role: string;
|
|
1177
|
+
};
|
|
1178
|
+
data: EndpointLookupData;
|
|
1179
|
+
};
|
|
1180
|
+
"endpoint:release": {
|
|
1181
|
+
payload: {
|
|
1182
|
+
repo: string;
|
|
1183
|
+
worktree: string;
|
|
1184
|
+
role?: string;
|
|
1185
|
+
};
|
|
1186
|
+
data: EndpointReleaseData;
|
|
1187
|
+
};
|
|
1188
|
+
"endpoint:status": {
|
|
1189
|
+
payload: {
|
|
1190
|
+
repo?: string;
|
|
1191
|
+
};
|
|
1192
|
+
data: EndpointStatusData;
|
|
1193
|
+
};
|
|
1194
|
+
"repos:locate": {
|
|
1195
|
+
payload: {
|
|
1196
|
+
newPath: string;
|
|
1197
|
+
repo?: string;
|
|
1198
|
+
dryRun?: boolean;
|
|
1199
|
+
};
|
|
1200
|
+
data: unknown;
|
|
1201
|
+
};
|
|
1202
|
+
"freshness:reconcile": {
|
|
1203
|
+
payload: Record<string, never>;
|
|
1204
|
+
data: unknown;
|
|
1205
|
+
};
|
|
1206
|
+
/** Wire reply on success is always `{ok:true, repaired}` (no `data`
|
|
1207
|
+
* wrapper) — `data` here documents the extra field the same way PingData
|
|
1208
|
+
* does for `ping`, not the literal wire nesting (R3). */
|
|
1209
|
+
"hooks:repair": {
|
|
1210
|
+
payload: {
|
|
1211
|
+
repo: string;
|
|
1212
|
+
};
|
|
1213
|
+
data: {
|
|
1214
|
+
repaired: boolean;
|
|
1215
|
+
};
|
|
1216
|
+
};
|
|
1217
|
+
"hooks:watch": {
|
|
1218
|
+
payload: {
|
|
1219
|
+
repo: string;
|
|
1220
|
+
};
|
|
1221
|
+
data: Record<string, never>;
|
|
1222
|
+
};
|
|
1223
|
+
"sdm:catalog": {
|
|
1224
|
+
payload: {
|
|
1225
|
+
refresh?: boolean;
|
|
1226
|
+
};
|
|
1227
|
+
data: unknown;
|
|
1228
|
+
};
|
|
1229
|
+
"sdm:snapshot": {
|
|
1230
|
+
payload: {
|
|
1231
|
+
force?: boolean;
|
|
1232
|
+
};
|
|
1233
|
+
data: unknown;
|
|
1234
|
+
};
|
|
1235
|
+
"sdm:recents": {
|
|
1236
|
+
payload: Record<string, never>;
|
|
1237
|
+
data: unknown;
|
|
1238
|
+
};
|
|
1239
|
+
"sdm:reconnect": {
|
|
1240
|
+
payload: {
|
|
1241
|
+
key: string;
|
|
1242
|
+
};
|
|
1243
|
+
data: unknown;
|
|
1244
|
+
};
|
|
1245
|
+
"system-processes": {
|
|
1246
|
+
payload: Record<string, never>;
|
|
1247
|
+
data: unknown;
|
|
1248
|
+
};
|
|
1249
|
+
"worktree:provision": {
|
|
1250
|
+
payload: {
|
|
1251
|
+
repoName: string;
|
|
1252
|
+
branch?: string;
|
|
1253
|
+
ticket?: string;
|
|
1254
|
+
ticketTitle?: string;
|
|
1255
|
+
disposal?: "job" | "merge";
|
|
1256
|
+
owner?: string;
|
|
1257
|
+
};
|
|
1258
|
+
data: WorktreeProvisionData;
|
|
1259
|
+
};
|
|
1260
|
+
"worktree:create": {
|
|
1261
|
+
payload: {
|
|
1262
|
+
repoName: string;
|
|
1263
|
+
onDeck?: boolean;
|
|
1264
|
+
};
|
|
1265
|
+
data: WorktreeCreateData;
|
|
1266
|
+
};
|
|
1267
|
+
"worktree:dispose": {
|
|
1268
|
+
payload: {
|
|
1269
|
+
repoName?: string;
|
|
1270
|
+
owner?: string;
|
|
1271
|
+
tree?: string;
|
|
1272
|
+
force?: boolean;
|
|
1273
|
+
callerPid?: number;
|
|
1274
|
+
};
|
|
1275
|
+
data: WorktreeDisposeData;
|
|
1276
|
+
};
|
|
1277
|
+
"worktree:list": {
|
|
1278
|
+
payload: {
|
|
1279
|
+
repoName?: string;
|
|
1280
|
+
};
|
|
1281
|
+
data: WorktreeListData;
|
|
1282
|
+
};
|
|
1283
|
+
"worktree:restore": {
|
|
1284
|
+
payload: {
|
|
1285
|
+
repoName: string;
|
|
1286
|
+
tree: string;
|
|
1287
|
+
};
|
|
1288
|
+
data: WorktreeRestoreData;
|
|
1289
|
+
};
|
|
1290
|
+
"worktree:freshen": {
|
|
1291
|
+
payload: {
|
|
1292
|
+
repoName?: string;
|
|
1293
|
+
tree?: string;
|
|
1294
|
+
};
|
|
1295
|
+
data: WorktreeFreshenData;
|
|
1296
|
+
};
|
|
1297
|
+
"worktree:adopt": {
|
|
1298
|
+
payload: {
|
|
1299
|
+
repoName: string;
|
|
1300
|
+
claim?: boolean;
|
|
1301
|
+
};
|
|
1302
|
+
data: WorktreeAdoptData;
|
|
1303
|
+
};
|
|
731
1304
|
}
|
|
732
1305
|
export type CommandName = keyof Commands;
|
|
733
1306
|
export declare const COMMAND_NAMES: readonly CommandName[];
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
export { rtCommand, DEFAULT_SOCK } from "./transport.ts";
|
|
2
2
|
export type { RtResponse, RtClientOptions } from "./transport.ts";
|
|
3
|
-
export { readProjectMRs, readDiscussions, readMrsByBranch, readBranchCache, resolveForgeToken, listRuns, getRun, abandonRun, chatJoin, chatLeave, chatPost, chatRead, chatRooms, chatWho, chatMark, chatMessages, chatSignIn, chatSignOut, chatAway, chatBack, chatBuddies, chatDm, chatArchive, chatDmOpen, eventsHead, agentStart, agentResume, agentGet, agentList, paneList, panePeek, paneSpawn, paneAccounts, paneDirectories, chatInvite, paneSend, paneFocus, } from "./client.ts";
|
|
3
|
+
export { readProjectMRs, readDiscussions, readMrsByBranch, readBranchCache, resolveForgeToken, listRuns, getRun, abandonRun, chatJoin, chatLeave, chatAck, chatClaim, chatRelease, chatPost, chatRead, chatRooms, chatWho, chatMark, chatMessages, chatSignIn, chatSignOut, chatAway, chatBack, chatBuddies, chatDm, chatArchive, chatDmOpen, eventsHead, agentStart, agentResume, agentGet, agentList, paneList, panePeek, paneSpawn, paneAccounts, paneDirectories, chatInvite, paneSend, paneFocus, } from "./client.ts";
|
|
4
4
|
export { COMMAND_NAMES } from "./commands.ts";
|
|
5
|
-
export type { Discussion, DemandDecl, ProjectMRsScope, ProjectMRsData, DiscussionsData, MrByBranchEntry, MrByBranchData, BranchEnrichment, Commands, CommandName, ForgeSlug, ForgeTokenData, Attention, RunSummary, RunStageRow, RunFieldRow, RunDecisionRow, RunDetail, WakeMode, ChatMember, ChatMessage, RoomSummary, BuddyStatus, PresenceRow, AgentRecord, AgentSurface, AgentStatus, ChatPane, PaneAccount, PaneDirectory, InviteResult, PaneDelivery, PaneSendResult, PaneFocusResult, } from "./commands.ts";
|
|
5
|
+
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, ChatPane, PaneAccount, PaneDirectory, InviteResult, PaneDelivery, PaneSendResult, PaneFocusResult, } from "./commands.ts";
|
|
6
6
|
export { subscribe, createRelay, DEFAULT_WS_URL } from "./relay.ts";
|
|
7
7
|
export type { RelayEventType } from "./relay.ts";
|
|
8
8
|
export { daemonHealth } from "./health.ts";
|
|
9
9
|
export { repoNameForPath } from "./repos.ts";
|
|
10
|
-
export {
|
|
10
|
+
export { decidePlacement, openSmartPane } from "./smart-pane.ts";
|
|
11
|
+
export type { Placement, PlacementOpts, HerdrCall } from "./smart-pane.ts";
|
|
12
|
+
export { getSetting, listSettings, explainSetting, expandVariables, SCOPE_ORDER, setSettingsWarnSink } from "./settings/resolve.ts";
|
|
11
13
|
export type { Scope, Provenance, ResolveOpts, Resolved, InvalidScope, ListedSetting, ExplainRow, ExpandCtx, } from "./settings/resolve.ts";
|
|
12
14
|
export { setSetting, unsetSetting } from "./settings/write.ts";
|
|
13
15
|
export type { SetSettingOpts } from "./settings/write.ts";
|