@rallycry/conveyor-agent 8.12.0 → 9.0.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/{chunk-FSUVTOFP.js → chunk-JH7GUOGW.js} +6673 -8717
- package/dist/chunk-JH7GUOGW.js.map +1 -0
- package/dist/cli.js +148 -208
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +8 -500
- package/dist/index.js +51 -1473
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-FDWECEDJ.js +0 -33
- package/dist/chunk-FDWECEDJ.js.map +0 -1
- package/dist/chunk-FSUVTOFP.js.map +0 -1
- package/dist/chunk-TN2YYT2V.js +0 -1444
- package/dist/chunk-TN2YYT2V.js.map +0 -1
- package/dist/tag-audit-handler-X3LEX63H.js +0 -222
- package/dist/tag-audit-handler-X3LEX63H.js.map +0 -1
- package/dist/task-audit-handler-BRCXB5V6.js +0 -801
- package/dist/task-audit-handler-BRCXB5V6.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _project_shared from '@project/shared';
|
|
2
|
-
import { AgentSessionServiceMethods, AgentMode, AgentQuestion, AgentRunnerStatus
|
|
2
|
+
import { AgentSessionServiceMethods, AgentMode, AgentQuestion, AgentRunnerStatus } from '@project/shared';
|
|
3
3
|
export * from '@project/shared';
|
|
4
4
|
import { ChildProcess } from 'node:child_process';
|
|
5
5
|
|
|
@@ -71,7 +71,13 @@ declare class AgentConnection {
|
|
|
71
71
|
constructor(config: AgentConnectionConfig);
|
|
72
72
|
get sessionId(): string;
|
|
73
73
|
get connected(): boolean;
|
|
74
|
+
private static readonly CALL_CONNECT_WAIT_MS;
|
|
75
|
+
private static readonly CALL_ACK_TIMEOUT_MS;
|
|
74
76
|
call<M extends keyof AgentSessionServiceMethods>(method: M, payload: AgentSessionServiceMethods[M]["payload"]): Promise<AgentSessionServiceMethods[M]["response"]>;
|
|
77
|
+
/** Resolve once `socket` reports connected, or reject after `timeoutMs`. */
|
|
78
|
+
private waitForConnected;
|
|
79
|
+
/** Emit an RPC and resolve on ack, rejecting if no ack arrives in time. */
|
|
80
|
+
private emitWithAck;
|
|
75
81
|
connect(): Promise<void>;
|
|
76
82
|
disconnect(): void;
|
|
77
83
|
private static readonly RECONNECT_BASE_DELAY_MS;
|
|
@@ -249,8 +255,6 @@ interface LifecycleCallbacks {
|
|
|
249
255
|
onTokenRefresh: () => void;
|
|
250
256
|
onGitFlush: () => void;
|
|
251
257
|
}
|
|
252
|
-
/** 30 min idle, 60 min dormant, 30s heartbeat, 45 min token refresh, 2 min git flush */
|
|
253
|
-
declare const DEFAULT_LIFECYCLE_CONFIG: LifecycleConfig;
|
|
254
258
|
declare class Lifecycle {
|
|
255
259
|
readonly config: LifecycleConfig;
|
|
256
260
|
private readonly callbacks;
|
|
@@ -468,136 +472,6 @@ interface AgentRunnerCallbacks {
|
|
|
468
472
|
onStatusChange: (status: string) => void | Promise<void>;
|
|
469
473
|
}
|
|
470
474
|
|
|
471
|
-
interface ProjectConnectionConfig {
|
|
472
|
-
apiUrl: string;
|
|
473
|
-
projectToken: string;
|
|
474
|
-
projectId: string;
|
|
475
|
-
}
|
|
476
|
-
interface TaskAssignment {
|
|
477
|
-
taskId: string;
|
|
478
|
-
taskToken: string;
|
|
479
|
-
sessionId?: string;
|
|
480
|
-
apiUrl: string;
|
|
481
|
-
mode: string;
|
|
482
|
-
branch: string;
|
|
483
|
-
devBranch: string;
|
|
484
|
-
useWorktree?: boolean;
|
|
485
|
-
isAuto?: boolean;
|
|
486
|
-
useSandbox?: boolean;
|
|
487
|
-
agentMode?: string;
|
|
488
|
-
pty?: boolean;
|
|
489
|
-
/**
|
|
490
|
-
* Decrypted Claude Code subscription token (`CLAUDE_CODE_OAUTH_TOKEN`) for the
|
|
491
|
-
* assigning user, resolved server-side. Forwarded into the forked child's env
|
|
492
|
-
* so the `claude` CLI is authenticated without a login prompt. Absent when the
|
|
493
|
-
* user has no key configured — the child then falls back to the runner
|
|
494
|
-
* machine's own `~/.claude` login.
|
|
495
|
-
*/
|
|
496
|
-
claudeCodeOauthToken?: string;
|
|
497
|
-
}
|
|
498
|
-
interface IncomingChatMessage {
|
|
499
|
-
content: string;
|
|
500
|
-
userId: string;
|
|
501
|
-
chatId?: string;
|
|
502
|
-
projectId: string;
|
|
503
|
-
/** When set, only the runner whose session matches should react. Other
|
|
504
|
-
* runners on the same project room must ignore the message. */
|
|
505
|
-
targetSessionId?: string | null;
|
|
506
|
-
timestamp: string;
|
|
507
|
-
}
|
|
508
|
-
interface SwitchBranchRequest {
|
|
509
|
-
branch: string;
|
|
510
|
-
syncAfter?: boolean;
|
|
511
|
-
}
|
|
512
|
-
declare class ProjectConnection {
|
|
513
|
-
private socket;
|
|
514
|
-
private readonly config;
|
|
515
|
-
private eventBuffer;
|
|
516
|
-
private flushTimer;
|
|
517
|
-
private reconnectCallbacks;
|
|
518
|
-
constructor(config: ProjectConnectionConfig);
|
|
519
|
-
get projectId(): string;
|
|
520
|
-
get connected(): boolean;
|
|
521
|
-
call<M extends keyof AgentSessionServiceMethods>(method: M, payload: AgentSessionServiceMethods[M]["payload"], opts?: {
|
|
522
|
-
timeoutMs?: number;
|
|
523
|
-
}): Promise<AgentSessionServiceMethods[M]["response"]>;
|
|
524
|
-
connect(): Promise<void>;
|
|
525
|
-
disconnect(): void;
|
|
526
|
-
onReconnect(callback: () => void): void;
|
|
527
|
-
onTaskAssignment(callback: (assignment: TaskAssignment) => void): void;
|
|
528
|
-
onStopTask(callback: (data: {
|
|
529
|
-
taskId: string;
|
|
530
|
-
}) => void): void;
|
|
531
|
-
onShutdown(callback: () => void): void;
|
|
532
|
-
onDisconnect(callback: () => void): void;
|
|
533
|
-
onChatMessage(callback: (msg: IncomingChatMessage) => void): void;
|
|
534
|
-
onSwitchBranch(callback: (data: SwitchBranchRequest, cb: (res: {
|
|
535
|
-
ok: boolean;
|
|
536
|
-
error?: string;
|
|
537
|
-
}) => void) => void): void;
|
|
538
|
-
onSyncEnvironment(callback: (cb: (res: {
|
|
539
|
-
ok: boolean;
|
|
540
|
-
error?: string;
|
|
541
|
-
}) => void) => void): void;
|
|
542
|
-
onRestartStartCommand(callback: (cb: (res: {
|
|
543
|
-
ok: boolean;
|
|
544
|
-
error?: string;
|
|
545
|
-
}) => void) => void): void;
|
|
546
|
-
onAuditTags(callback: (request: TagAuditRunnerRequest) => void): void;
|
|
547
|
-
onAuditTasks(callback: (request: TaskAuditRunnerRequest) => void): void;
|
|
548
|
-
sendHeartbeat(): void;
|
|
549
|
-
sendEvent(event: Record<string, unknown>): void;
|
|
550
|
-
emitStatus(status: "busy" | "idle"): void;
|
|
551
|
-
emitTaskStarted(taskId: string): void;
|
|
552
|
-
emitTaskStopped(taskId: string, reason: string): void;
|
|
553
|
-
private flushEvents;
|
|
554
|
-
private requireSocket;
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
interface ProjectRunnerConfig {
|
|
558
|
-
conveyorApiUrl: string;
|
|
559
|
-
projectToken: string;
|
|
560
|
-
projectId: string;
|
|
561
|
-
projectDir: string;
|
|
562
|
-
}
|
|
563
|
-
declare class ProjectRunner {
|
|
564
|
-
private connection;
|
|
565
|
-
private projectDir;
|
|
566
|
-
private activeAgents;
|
|
567
|
-
private heartbeatTimer;
|
|
568
|
-
private stopping;
|
|
569
|
-
private resolveLifecycle;
|
|
570
|
-
private chatSessionIds;
|
|
571
|
-
/** ProjectCodespaceSession id assigned at register time. Used to filter
|
|
572
|
-
* targeted incoming chat messages so we only react to ones addressed
|
|
573
|
-
* to this specific runner. */
|
|
574
|
-
private projectSessionId;
|
|
575
|
-
private startCmd;
|
|
576
|
-
private setupComplete;
|
|
577
|
-
private branchSwitchCommand;
|
|
578
|
-
private commitWatcher;
|
|
579
|
-
constructor(config: ProjectRunnerConfig);
|
|
580
|
-
start(): Promise<void>;
|
|
581
|
-
/** Best-effort WIP commit + push of every tracked working tree on shutdown.
|
|
582
|
-
* Iterates the main project dir plus any active agent worktrees so nothing
|
|
583
|
-
* pending is lost when the pod is killed. Never throws.
|
|
584
|
-
*
|
|
585
|
-
* Callers that kill child agents first must snapshot the worktree dirs
|
|
586
|
-
* BEFORE the kill — the child exit handler removes entries from
|
|
587
|
-
* `activeAgents`, so reading it after the kill misses the worktrees. */
|
|
588
|
-
flushGitOnShutdown(dirs?: Set<string>): Promise<void>;
|
|
589
|
-
stop(): Promise<void>;
|
|
590
|
-
/** Idempotent final step: tear down the socket and resolve the lifecycle
|
|
591
|
-
* promise so start() returns. Called from stop()'s finally and from the
|
|
592
|
-
* shutdown watchdog. */
|
|
593
|
-
private finishShutdown;
|
|
594
|
-
private wireEventHandlers;
|
|
595
|
-
private handleReconnect;
|
|
596
|
-
private handleAuditTags;
|
|
597
|
-
private handleAuditTasks;
|
|
598
|
-
private getCurrentBranch;
|
|
599
|
-
}
|
|
600
|
-
|
|
601
475
|
declare class PlanSync {
|
|
602
476
|
private planFileSnapshot;
|
|
603
477
|
private lockedPlanFile;
|
|
@@ -611,62 +485,6 @@ declare class PlanSync {
|
|
|
611
485
|
syncPlanFile(): Promise<void>;
|
|
612
486
|
}
|
|
613
487
|
|
|
614
|
-
interface CacheEntry {
|
|
615
|
-
content: Buffer;
|
|
616
|
-
mimeType: string;
|
|
617
|
-
fileName: string;
|
|
618
|
-
createdAt: number;
|
|
619
|
-
size: number;
|
|
620
|
-
}
|
|
621
|
-
declare class FileCache {
|
|
622
|
-
private cache;
|
|
623
|
-
private currentSize;
|
|
624
|
-
private readonly maxSizeBytes;
|
|
625
|
-
private readonly ttlMs;
|
|
626
|
-
constructor(maxSizeBytes?: number, ttlMs?: number);
|
|
627
|
-
get(fileId: string): CacheEntry | null;
|
|
628
|
-
set(fileId: string, content: Buffer, mimeType: string, fileName: string): void;
|
|
629
|
-
private delete;
|
|
630
|
-
clear(): void;
|
|
631
|
-
get stats(): {
|
|
632
|
-
entries: number;
|
|
633
|
-
sizeBytes: number;
|
|
634
|
-
maxSizeBytes: number;
|
|
635
|
-
};
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
interface CommitWatcherConfig {
|
|
639
|
-
projectDir: string;
|
|
640
|
-
pollIntervalMs: number;
|
|
641
|
-
debounceMs: number;
|
|
642
|
-
}
|
|
643
|
-
interface NewCommitsData {
|
|
644
|
-
branch: string;
|
|
645
|
-
previousSha: string;
|
|
646
|
-
newCommitSha: string;
|
|
647
|
-
commitCount: number;
|
|
648
|
-
latestMessage: string;
|
|
649
|
-
latestAuthor: string;
|
|
650
|
-
}
|
|
651
|
-
interface CommitWatcherCallbacks {
|
|
652
|
-
onNewCommits: (data: NewCommitsData) => Promise<void>;
|
|
653
|
-
}
|
|
654
|
-
declare class CommitWatcher {
|
|
655
|
-
private config;
|
|
656
|
-
private callbacks;
|
|
657
|
-
private interval;
|
|
658
|
-
private lastKnownRemoteSha;
|
|
659
|
-
private branch;
|
|
660
|
-
private debounceTimer;
|
|
661
|
-
private isSyncing;
|
|
662
|
-
constructor(config: CommitWatcherConfig, callbacks: CommitWatcherCallbacks);
|
|
663
|
-
start(branch: string): void;
|
|
664
|
-
stop(): void;
|
|
665
|
-
private getLocalHeadSha;
|
|
666
|
-
private poll;
|
|
667
|
-
private handleNewCommits;
|
|
668
|
-
}
|
|
669
|
-
|
|
670
488
|
/** Returns true if the working tree has uncommitted changes (staged or unstaged). */
|
|
671
489
|
declare function hasUncommittedChanges(cwd: string): boolean;
|
|
672
490
|
/** Returns the current branch name, or null if on detached HEAD. */
|
|
@@ -706,316 +524,6 @@ declare function detachWorktreeBranch(projectDir: string, branch: string): void;
|
|
|
706
524
|
*/
|
|
707
525
|
declare function removeWorktree(projectDir: string, taskId: string): void;
|
|
708
526
|
|
|
709
|
-
interface BreakpointInfo {
|
|
710
|
-
breakpointId: string;
|
|
711
|
-
file: string;
|
|
712
|
-
line: number;
|
|
713
|
-
condition?: string;
|
|
714
|
-
}
|
|
715
|
-
interface ProbeInfo {
|
|
716
|
-
probeId: string;
|
|
717
|
-
breakpointId: string;
|
|
718
|
-
file: string;
|
|
719
|
-
line: number;
|
|
720
|
-
expressions: string[];
|
|
721
|
-
label: string;
|
|
722
|
-
}
|
|
723
|
-
interface ProbeHit {
|
|
724
|
-
label: string;
|
|
725
|
-
data: Record<string, unknown>;
|
|
726
|
-
timestamp: number;
|
|
727
|
-
}
|
|
728
|
-
interface CallFrameInfo {
|
|
729
|
-
index: number;
|
|
730
|
-
functionName: string;
|
|
731
|
-
file: string;
|
|
732
|
-
line: number;
|
|
733
|
-
column: number;
|
|
734
|
-
callFrameId: string;
|
|
735
|
-
}
|
|
736
|
-
interface ScopeVariable {
|
|
737
|
-
name: string;
|
|
738
|
-
type: string;
|
|
739
|
-
value: string;
|
|
740
|
-
}
|
|
741
|
-
interface PausedState {
|
|
742
|
-
callFrames: CallFrameInfo[];
|
|
743
|
-
reason: string;
|
|
744
|
-
hitBreakpoints?: string[];
|
|
745
|
-
}
|
|
746
|
-
type InspectorProtocol = "cdp" | "webkit";
|
|
747
|
-
declare class CdpDebugClient {
|
|
748
|
-
private ws;
|
|
749
|
-
private requestId;
|
|
750
|
-
private pendingRequests;
|
|
751
|
-
private breakpoints;
|
|
752
|
-
private probes;
|
|
753
|
-
private probeCounter;
|
|
754
|
-
private probeBufferInjected;
|
|
755
|
-
private pausedState;
|
|
756
|
-
private autoResumeTimer;
|
|
757
|
-
private protocol;
|
|
758
|
-
private onPausedCallback;
|
|
759
|
-
private onResumedCallback;
|
|
760
|
-
private onAutoResumedCallback;
|
|
761
|
-
connect(wsUrl: string, protocol?: InspectorProtocol): Promise<void>;
|
|
762
|
-
disconnect(): void;
|
|
763
|
-
isConnected(): boolean;
|
|
764
|
-
getProtocol(): InspectorProtocol;
|
|
765
|
-
setBreakpoint(file: string, line: number, condition?: string): Promise<string>;
|
|
766
|
-
removeBreakpoint(breakpointId: string): Promise<void>;
|
|
767
|
-
removeAllBreakpoints(): Promise<void>;
|
|
768
|
-
listBreakpoints(): BreakpointInfo[];
|
|
769
|
-
setLogpoint(file: string, line: number, expressions: string[], label?: string): Promise<string>;
|
|
770
|
-
removeProbe(probeId: string): Promise<void>;
|
|
771
|
-
listProbes(): ProbeInfo[];
|
|
772
|
-
getProbeResults(label?: string, limit?: number): Promise<ProbeHit[]>;
|
|
773
|
-
clearProbeResults(label?: string): Promise<void>;
|
|
774
|
-
isPaused(): boolean;
|
|
775
|
-
getPausedState(): PausedState | null;
|
|
776
|
-
getCallStack(): CallFrameInfo[];
|
|
777
|
-
getScopeVariables(callFrameId: string): Promise<ScopeVariable[]>;
|
|
778
|
-
resume(): Promise<void>;
|
|
779
|
-
stepOver(): Promise<void>;
|
|
780
|
-
stepInto(): Promise<void>;
|
|
781
|
-
evaluate(expression: string, callFrameId?: string): Promise<{
|
|
782
|
-
type: string;
|
|
783
|
-
value: string;
|
|
784
|
-
}>;
|
|
785
|
-
onPaused(callback: (state: PausedState) => void): void;
|
|
786
|
-
onResumed(callback: () => void): void;
|
|
787
|
-
onAutoResumed(callback: () => void): void;
|
|
788
|
-
private send;
|
|
789
|
-
private handleMessage;
|
|
790
|
-
private handlePaused;
|
|
791
|
-
private ensureProbeBuffer;
|
|
792
|
-
private extractEvalError;
|
|
793
|
-
private fileToUrlRegex;
|
|
794
|
-
private formatRemoteObject;
|
|
795
|
-
private truncateValue;
|
|
796
|
-
private clearAutoResumeTimer;
|
|
797
|
-
private cleanup;
|
|
798
|
-
}
|
|
799
|
-
|
|
800
|
-
interface ConsoleMessage {
|
|
801
|
-
level: string;
|
|
802
|
-
text: string;
|
|
803
|
-
timestamp: number;
|
|
804
|
-
url?: string;
|
|
805
|
-
line?: number;
|
|
806
|
-
}
|
|
807
|
-
interface NetworkRequest {
|
|
808
|
-
url: string;
|
|
809
|
-
method: string;
|
|
810
|
-
status?: number;
|
|
811
|
-
resourceType?: string;
|
|
812
|
-
timestamp: number;
|
|
813
|
-
duration?: number;
|
|
814
|
-
}
|
|
815
|
-
interface ClientPageError {
|
|
816
|
-
message: string;
|
|
817
|
-
stack?: string;
|
|
818
|
-
timestamp: number;
|
|
819
|
-
}
|
|
820
|
-
|
|
821
|
-
declare class PlaywrightDebugClient {
|
|
822
|
-
private browser;
|
|
823
|
-
private page;
|
|
824
|
-
private cdpSession;
|
|
825
|
-
private breakpoints;
|
|
826
|
-
private probes;
|
|
827
|
-
private probeCounter;
|
|
828
|
-
private probeBufferInjected;
|
|
829
|
-
private pausedState;
|
|
830
|
-
private autoResumeTimer;
|
|
831
|
-
private inactivityTimer;
|
|
832
|
-
private onPausedCallback;
|
|
833
|
-
private onResumedCallback;
|
|
834
|
-
private onAutoResumedCallback;
|
|
835
|
-
private consoleMessages;
|
|
836
|
-
private networkRequests;
|
|
837
|
-
private pageErrors;
|
|
838
|
-
private sourceMapDetected;
|
|
839
|
-
launch(previewUrl: string): Promise<void>;
|
|
840
|
-
close(): Promise<void>;
|
|
841
|
-
isConnected(): boolean;
|
|
842
|
-
hasSourceMaps(): boolean | null;
|
|
843
|
-
setBreakpoint(file: string, line: number, condition?: string): Promise<string>;
|
|
844
|
-
removeBreakpoint(breakpointId: string): Promise<void>;
|
|
845
|
-
removeAllBreakpoints(): Promise<void>;
|
|
846
|
-
listBreakpoints(): BreakpointInfo[];
|
|
847
|
-
setLogpoint(file: string, line: number, expressions: string[], label?: string): Promise<string>;
|
|
848
|
-
removeProbe(probeId: string): Promise<void>;
|
|
849
|
-
listProbes(): ProbeInfo[];
|
|
850
|
-
getProbeResults(label?: string, limit?: number): Promise<ProbeHit[]>;
|
|
851
|
-
clearProbeResults(label?: string): Promise<void>;
|
|
852
|
-
isPaused(): boolean;
|
|
853
|
-
getPausedState(): PausedState | null;
|
|
854
|
-
getCallStack(): CallFrameInfo[];
|
|
855
|
-
getScopeVariables(callFrameId: string): Promise<ScopeVariable[]>;
|
|
856
|
-
resume(): Promise<void>;
|
|
857
|
-
stepOver(): Promise<void>;
|
|
858
|
-
stepInto(): Promise<void>;
|
|
859
|
-
evaluate(expression: string, callFrameId?: string): Promise<{
|
|
860
|
-
type: string;
|
|
861
|
-
value: string;
|
|
862
|
-
}>;
|
|
863
|
-
navigate(url: string): Promise<void>;
|
|
864
|
-
click(selector: string): Promise<void>;
|
|
865
|
-
screenshot(): Promise<string>;
|
|
866
|
-
getCurrentUrl(): string;
|
|
867
|
-
getConsoleMessages(level?: string, limit?: number): ConsoleMessage[];
|
|
868
|
-
getNetworkRequests(filter?: string, limit?: number): NetworkRequest[];
|
|
869
|
-
getPageErrors(limit?: number): ClientPageError[];
|
|
870
|
-
onPaused(callback: (state: PausedState) => void): void;
|
|
871
|
-
onResumed(callback: () => void): void;
|
|
872
|
-
onAutoResumed(callback: () => void): void;
|
|
873
|
-
private setupCdpEvents;
|
|
874
|
-
private handlePaused;
|
|
875
|
-
private setupPassiveCapture;
|
|
876
|
-
private checkSourceMaps;
|
|
877
|
-
private ensureProbeBuffer;
|
|
878
|
-
private requireSession;
|
|
879
|
-
private requirePage;
|
|
880
|
-
private fileToUrlRegex;
|
|
881
|
-
private clearAutoResumeTimer;
|
|
882
|
-
private resetInactivityTimer;
|
|
883
|
-
private clearInactivityTimer;
|
|
884
|
-
}
|
|
885
|
-
|
|
886
|
-
type InspectorRuntime = "node" | "bun" | "unknown";
|
|
887
|
-
interface DebugEventHandler {
|
|
888
|
-
onDebugModeEntered: () => void;
|
|
889
|
-
onDebugModeExited: () => void;
|
|
890
|
-
onBreakpointHit: (state: PausedState) => void;
|
|
891
|
-
onClientBreakpointHit: (state: PausedState) => void;
|
|
892
|
-
onAutoResumed: () => void;
|
|
893
|
-
onDebugError: (message: string) => void;
|
|
894
|
-
onOutput: (stream: "stdout" | "stderr", data: string) => void;
|
|
895
|
-
}
|
|
896
|
-
interface DebugModeOptions {
|
|
897
|
-
serverSide?: boolean;
|
|
898
|
-
clientSide?: boolean;
|
|
899
|
-
previewUrl?: string;
|
|
900
|
-
}
|
|
901
|
-
declare class DebugManager {
|
|
902
|
-
private cdpClient;
|
|
903
|
-
private playwrightClient;
|
|
904
|
-
private debugProcess;
|
|
905
|
-
private _isDebugMode;
|
|
906
|
-
private _isClientDebugMode;
|
|
907
|
-
private startCommand;
|
|
908
|
-
private workingDir;
|
|
909
|
-
private eventHandler;
|
|
910
|
-
private breakpointHitQueue;
|
|
911
|
-
private clientBreakpointHitQueue;
|
|
912
|
-
constructor(startCommand: string, workingDir: string, eventHandler: DebugEventHandler);
|
|
913
|
-
isDebugMode(): boolean;
|
|
914
|
-
isClientDebugMode(): boolean;
|
|
915
|
-
getClient(): CdpDebugClient | null;
|
|
916
|
-
getPlaywrightClient(): PlaywrightDebugClient | null;
|
|
917
|
-
drainBreakpointHitQueue(): PausedState[];
|
|
918
|
-
drainClientBreakpointHitQueue(): PausedState[];
|
|
919
|
-
enterDebugMode(killCurrentProcess?: () => void, options?: DebugModeOptions): Promise<void>;
|
|
920
|
-
exitDebugMode(restartNormalServer?: () => void): Promise<void>;
|
|
921
|
-
private activateServerDebug;
|
|
922
|
-
private activateClientDebug;
|
|
923
|
-
private ensurePlaywrightInstalled;
|
|
924
|
-
private startWithInspector;
|
|
925
|
-
}
|
|
926
|
-
declare function detectRuntime(startCommand: string): InspectorRuntime;
|
|
927
|
-
declare function injectBunInspectFlag(command: string): string;
|
|
928
|
-
|
|
929
|
-
/**
|
|
930
|
-
* Orchestrates the debug session lifecycle, tracks state for the web UI,
|
|
931
|
-
* and generates session summaries. Wraps DebugManager events and forwards
|
|
932
|
-
* state changes to the API via AgentConnection.
|
|
933
|
-
*/
|
|
934
|
-
declare class DebugLifecycleManager {
|
|
935
|
-
private connection;
|
|
936
|
-
private debugManager;
|
|
937
|
-
private hypothesis?;
|
|
938
|
-
private sessionStartedAt?;
|
|
939
|
-
private breakpointsHitCount;
|
|
940
|
-
private telemetryEvents;
|
|
941
|
-
private reproduceRequested;
|
|
942
|
-
private keyFindings;
|
|
943
|
-
private _isActive;
|
|
944
|
-
constructor(connection: AgentConnection);
|
|
945
|
-
get isActive(): boolean;
|
|
946
|
-
setDebugManager(manager: DebugManager): void;
|
|
947
|
-
/**
|
|
948
|
-
* Creates a DebugEventHandler that bridges DebugManager events
|
|
949
|
-
* to the lifecycle manager and broadcasts state to the web UI.
|
|
950
|
-
*/
|
|
951
|
-
createEventHandler(baseOnOutput: (stream: "stdout" | "stderr", data: string) => void): DebugEventHandler;
|
|
952
|
-
/** Mark the hypothesis for the current debug session */
|
|
953
|
-
setHypothesis(hypothesis: string): void;
|
|
954
|
-
/** Signal that the user has been asked to reproduce the bug */
|
|
955
|
-
requestReproduce(hypothesis?: string): void;
|
|
956
|
-
/** Add a telemetry event to the debug session */
|
|
957
|
-
addTelemetryEvent(event: DebugTelemetryEvent): void;
|
|
958
|
-
/** Generate and broadcast a debug session summary, then reset state */
|
|
959
|
-
completeSession(): DebugSessionSummary | null;
|
|
960
|
-
/** Auto-exit cleanup — called when agent session ends */
|
|
961
|
-
autoCleanup(): void;
|
|
962
|
-
private getBreakpoints;
|
|
963
|
-
private getProbes;
|
|
964
|
-
private buildState;
|
|
965
|
-
private broadcastState;
|
|
966
|
-
}
|
|
967
|
-
|
|
968
|
-
interface Observation {
|
|
969
|
-
description: string;
|
|
970
|
-
confirmsHypothesis: boolean;
|
|
971
|
-
iteration: number;
|
|
972
|
-
timestamp: number;
|
|
973
|
-
}
|
|
974
|
-
interface HypothesisState {
|
|
975
|
-
hypothesis: string | null;
|
|
976
|
-
iteration: number;
|
|
977
|
-
observations: Observation[];
|
|
978
|
-
active: boolean;
|
|
979
|
-
conclusion: string | null;
|
|
980
|
-
}
|
|
981
|
-
declare class HypothesisTracker {
|
|
982
|
-
private hypothesis;
|
|
983
|
-
private iteration;
|
|
984
|
-
private observations;
|
|
985
|
-
private _active;
|
|
986
|
-
private conclusion;
|
|
987
|
-
/**
|
|
988
|
-
* Start or update the current debugging hypothesis.
|
|
989
|
-
* Increments the iteration count if a hypothesis was already set.
|
|
990
|
-
*/
|
|
991
|
-
setHypothesis(text: string): {
|
|
992
|
-
accepted: boolean;
|
|
993
|
-
message: string;
|
|
994
|
-
};
|
|
995
|
-
/**
|
|
996
|
-
* Record an observation from debug data (breakpoint hit, telemetry, etc.).
|
|
997
|
-
*/
|
|
998
|
-
recordObservation(description: string, confirmsHypothesis: boolean): void;
|
|
999
|
-
/**
|
|
1000
|
-
* End the debug session with a conclusion.
|
|
1001
|
-
*/
|
|
1002
|
-
concludeSession(conclusion: string): string;
|
|
1003
|
-
/**
|
|
1004
|
-
* Get formatted debug context for injection into the agent's system prompt.
|
|
1005
|
-
* Returns empty string if no active session.
|
|
1006
|
-
*/
|
|
1007
|
-
getDebugContext(): string;
|
|
1008
|
-
/**
|
|
1009
|
-
* Get the full state (for serialization/testing).
|
|
1010
|
-
*/
|
|
1011
|
-
getState(): HypothesisState;
|
|
1012
|
-
isActive(): boolean;
|
|
1013
|
-
getIteration(): number;
|
|
1014
|
-
getMaxIterations(): number;
|
|
1015
|
-
private getSessionSummary;
|
|
1016
|
-
private reset;
|
|
1017
|
-
}
|
|
1018
|
-
|
|
1019
527
|
interface ConveyorConfig {
|
|
1020
528
|
setupCommand?: string;
|
|
1021
529
|
startCommand?: string;
|
|
@@ -1039,4 +547,4 @@ declare function runStartCommand(cmd: string, cwd: string, onOutput: (stream: "s
|
|
|
1039
547
|
/** Fetch full git history if the repo was cloned with --depth=1. */
|
|
1040
548
|
declare function unshallowRepo(workspaceDir: string): void;
|
|
1041
549
|
|
|
1042
|
-
export { AgentConnection, type AgentConnectionConfig, type AgentRunnerCallbacks, type AgentRunnerConfig, type ApiKeyUpdateData,
|
|
550
|
+
export { AgentConnection, type AgentConnectionConfig, type AgentRunnerCallbacks, type AgentRunnerConfig, type ApiKeyUpdateData, type ConveyorConfig, type IncomingMessage, type LifecycleCallbacks, type LifecycleConfig, type ModeAction, type ModeTaskContext, PlanSync, SessionRunner, type SessionRunnerCallbacks, type SessionRunnerConfig, type SetModeData, detachWorktreeBranch, ensureWorktree, flushPendingChanges, getCurrentBranch, hasUncommittedChanges, hasUnpushedCommits, loadConveyorConfig, loadForwardPorts, pushToOrigin, removeWorktree, runAuthTokenCommand, runSetupCommand, runStartCommand, stageAndCommit, unshallowRepo, updateRemoteToken };
|