@rallycry/conveyor-agent 6.0.3 → 6.0.5

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/cli.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  ProjectRunner,
5
5
  createServiceLogger,
6
6
  errorMeta
7
- } from "./chunk-SL5MRNSI.js";
7
+ } from "./chunk-PLSKXQTB.js";
8
8
 
9
9
  // src/cli.ts
10
10
  import { readFileSync } from "fs";
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { SDKUserMessage } from '@anthropic-ai/claude-agent-sdk';
2
2
  import * as _project_shared from '@project/shared';
3
- import { AgentRunnerStatus, MultimodalBlock, ProjectEnvironmentStatus, ChatMessageResponse, TaskFileResponse, TaskContext, AgentEvent, AgentQuestion, IncomingMessagePayload, SetModePayload, AgentMode, SubtaskCreatePayload, SubtaskUpdateFields, SubtaskResponse, StartChildCloudBuildResponse, TaskLookupResponse, UpdateTaskPropertiesPayload, IconListItem, GenerateIconResponse, TaskPropertiesResponse, TriggerIdentificationResponse, ModeTransitionPayload, IncidentDTO, TaskIncidentDTO, TagAuditRunnerRequest, TagAuditRunnerResponse, TagAuditProgressActivity } from '@project/shared';
4
- export { AgentEvent, ChatMessage, TaskContext, TaskFileContext } from '@project/shared';
3
+ import { AgentRunnerStatus, MultimodalBlock, ProjectEnvironmentStatus, ChatMessageResponse, TaskFileResponse, TaskContext, AgentEvent, AgentQuestion, IncomingMessagePayload, SetModePayload, AgentMode, SubtaskCreatePayload, SubtaskUpdateFields, SubtaskResponse, StartChildCloudBuildResponse, TaskLookupResponse, UpdateTaskPropertiesPayload, IconListItem, GenerateIconResponse, TaskPropertiesResponse, TriggerIdentificationResponse, ModeTransitionPayload, DebugSessionState, DebugSessionSummary, IncidentDTO, TaskIncidentDTO, TagAuditRunnerRequest, TagAuditRunnerResponse, TagAuditProgressActivity, DebugTelemetryEvent } from '@project/shared';
4
+ export { AgentEvent, ChatMessage, DebugBreakpointHit, DebugModeEvent, TaskContext, TaskFileContext } from '@project/shared';
5
5
  import { ChildProcess } from 'node:child_process';
6
6
 
7
7
  interface AgentRunnerConfig {
@@ -213,6 +213,9 @@ declare class ConveyorConnection {
213
213
  triggerIdentification(): Promise<TriggerIdentificationResponse>;
214
214
  refreshAuthToken(): Promise<boolean>;
215
215
  emitModeTransition(payload: ModeTransitionPayload): void;
216
+ emitDebugStateChanged(state: DebugSessionState): void;
217
+ emitDebugSessionComplete(summary: DebugSessionSummary): void;
218
+ emitDebugReproduceRequested(hypothesis?: string): void;
216
219
  searchIncidents(status?: string, source?: string): Promise<IncidentDTO[]>;
217
220
  getTaskIncidents(taskId?: string): Promise<TaskIncidentDTO[]>;
218
221
  disconnect(): void;
@@ -422,4 +425,260 @@ declare function loadConveyorConfig(_workspaceDir?: string): ConveyorConfig | nu
422
425
  declare function runSetupCommand(cmd: string, cwd: string, onOutput: (stream: "stdout" | "stderr", data: string) => void): Promise<void>;
423
426
  declare function runStartCommand(cmd: string, cwd: string, onOutput: (stream: "stdout" | "stderr", data: string) => void): ChildProcess;
424
427
 
425
- export { type AgentContext, AgentRunner, type AgentRunnerCallbacks, type AgentRunnerConfig, type ChatHistoryMessage, type ConveyorConfig, ConveyorConnection, FileCache, type IncomingChatMessage, ProjectConnection, type ProjectConnectionConfig, ProjectRunner, type ProjectRunnerConfig, type TaskAssignment, ensureWorktree, loadConveyorConfig, removeWorktree, runSetupCommand, runStartCommand };
428
+ interface BreakpointInfo {
429
+ breakpointId: string;
430
+ file: string;
431
+ line: number;
432
+ condition?: string;
433
+ }
434
+ interface ProbeInfo {
435
+ probeId: string;
436
+ breakpointId: string;
437
+ file: string;
438
+ line: number;
439
+ expressions: string[];
440
+ label: string;
441
+ }
442
+ interface ProbeHit {
443
+ label: string;
444
+ data: Record<string, unknown>;
445
+ timestamp: number;
446
+ }
447
+ interface CallFrameInfo {
448
+ index: number;
449
+ functionName: string;
450
+ file: string;
451
+ line: number;
452
+ column: number;
453
+ callFrameId: string;
454
+ }
455
+ interface ScopeVariable {
456
+ name: string;
457
+ type: string;
458
+ value: string;
459
+ }
460
+ interface PausedState {
461
+ callFrames: CallFrameInfo[];
462
+ reason: string;
463
+ hitBreakpoints?: string[];
464
+ }
465
+ type InspectorProtocol = "cdp" | "webkit";
466
+ declare class CdpDebugClient {
467
+ private ws;
468
+ private requestId;
469
+ private pendingRequests;
470
+ private breakpoints;
471
+ private probes;
472
+ private probeCounter;
473
+ private probeBufferInjected;
474
+ private pausedState;
475
+ private autoResumeTimer;
476
+ private protocol;
477
+ private onPausedCallback;
478
+ private onResumedCallback;
479
+ private onAutoResumedCallback;
480
+ connect(wsUrl: string, protocol?: InspectorProtocol): Promise<void>;
481
+ disconnect(): void;
482
+ isConnected(): boolean;
483
+ getProtocol(): InspectorProtocol;
484
+ setBreakpoint(file: string, line: number, condition?: string): Promise<string>;
485
+ removeBreakpoint(breakpointId: string): Promise<void>;
486
+ removeAllBreakpoints(): Promise<void>;
487
+ listBreakpoints(): BreakpointInfo[];
488
+ setLogpoint(file: string, line: number, expressions: string[], label?: string): Promise<string>;
489
+ removeProbe(probeId: string): Promise<void>;
490
+ listProbes(): ProbeInfo[];
491
+ getProbeResults(label?: string, limit?: number): Promise<ProbeHit[]>;
492
+ clearProbeResults(label?: string): Promise<void>;
493
+ isPaused(): boolean;
494
+ getPausedState(): PausedState | null;
495
+ getCallStack(): CallFrameInfo[];
496
+ getScopeVariables(callFrameId: string): Promise<ScopeVariable[]>;
497
+ resume(): Promise<void>;
498
+ stepOver(): Promise<void>;
499
+ stepInto(): Promise<void>;
500
+ evaluate(expression: string, callFrameId?: string): Promise<{
501
+ type: string;
502
+ value: string;
503
+ }>;
504
+ onPaused(callback: (state: PausedState) => void): void;
505
+ onResumed(callback: () => void): void;
506
+ onAutoResumed(callback: () => void): void;
507
+ private send;
508
+ private handleMessage;
509
+ private handlePaused;
510
+ private ensureProbeBuffer;
511
+ private extractEvalError;
512
+ private fileToUrlRegex;
513
+ private formatRemoteObject;
514
+ private truncateValue;
515
+ private clearAutoResumeTimer;
516
+ private cleanup;
517
+ }
518
+
519
+ interface ConsoleMessage {
520
+ level: string;
521
+ text: string;
522
+ timestamp: number;
523
+ url?: string;
524
+ line?: number;
525
+ }
526
+ interface NetworkRequest {
527
+ url: string;
528
+ method: string;
529
+ status?: number;
530
+ resourceType?: string;
531
+ timestamp: number;
532
+ duration?: number;
533
+ }
534
+ interface ClientPageError {
535
+ message: string;
536
+ stack?: string;
537
+ timestamp: number;
538
+ }
539
+
540
+ declare class PlaywrightDebugClient {
541
+ private browser;
542
+ private page;
543
+ private cdpSession;
544
+ private breakpoints;
545
+ private probes;
546
+ private probeCounter;
547
+ private probeBufferInjected;
548
+ private pausedState;
549
+ private autoResumeTimer;
550
+ private inactivityTimer;
551
+ private onPausedCallback;
552
+ private onResumedCallback;
553
+ private onAutoResumedCallback;
554
+ private consoleMessages;
555
+ private networkRequests;
556
+ private pageErrors;
557
+ private sourceMapDetected;
558
+ launch(previewUrl: string): Promise<void>;
559
+ close(): Promise<void>;
560
+ isConnected(): boolean;
561
+ hasSourceMaps(): boolean | null;
562
+ setBreakpoint(file: string, line: number, condition?: string): Promise<string>;
563
+ removeBreakpoint(breakpointId: string): Promise<void>;
564
+ removeAllBreakpoints(): Promise<void>;
565
+ listBreakpoints(): BreakpointInfo[];
566
+ setLogpoint(file: string, line: number, expressions: string[], label?: string): Promise<string>;
567
+ removeProbe(probeId: string): Promise<void>;
568
+ listProbes(): ProbeInfo[];
569
+ getProbeResults(label?: string, limit?: number): Promise<ProbeHit[]>;
570
+ clearProbeResults(label?: string): Promise<void>;
571
+ isPaused(): boolean;
572
+ getPausedState(): PausedState | null;
573
+ getCallStack(): CallFrameInfo[];
574
+ getScopeVariables(callFrameId: string): Promise<ScopeVariable[]>;
575
+ resume(): Promise<void>;
576
+ stepOver(): Promise<void>;
577
+ stepInto(): Promise<void>;
578
+ evaluate(expression: string, callFrameId?: string): Promise<{
579
+ type: string;
580
+ value: string;
581
+ }>;
582
+ navigate(url: string): Promise<void>;
583
+ click(selector: string): Promise<void>;
584
+ screenshot(): Promise<string>;
585
+ getCurrentUrl(): string;
586
+ getConsoleMessages(level?: string, limit?: number): ConsoleMessage[];
587
+ getNetworkRequests(filter?: string, limit?: number): NetworkRequest[];
588
+ getPageErrors(limit?: number): ClientPageError[];
589
+ onPaused(callback: (state: PausedState) => void): void;
590
+ onResumed(callback: () => void): void;
591
+ onAutoResumed(callback: () => void): void;
592
+ private setupCdpEvents;
593
+ private handlePaused;
594
+ private setupPassiveCapture;
595
+ private checkSourceMaps;
596
+ private ensureProbeBuffer;
597
+ private requireSession;
598
+ private requirePage;
599
+ private fileToUrlRegex;
600
+ private clearAutoResumeTimer;
601
+ private resetInactivityTimer;
602
+ private clearInactivityTimer;
603
+ }
604
+
605
+ interface DebugEventHandler {
606
+ onDebugModeEntered: () => void;
607
+ onDebugModeExited: () => void;
608
+ onBreakpointHit: (state: PausedState) => void;
609
+ onClientBreakpointHit: (state: PausedState) => void;
610
+ onAutoResumed: () => void;
611
+ onDebugError: (message: string) => void;
612
+ onOutput: (stream: "stdout" | "stderr", data: string) => void;
613
+ }
614
+ interface DebugModeOptions {
615
+ serverSide?: boolean;
616
+ clientSide?: boolean;
617
+ previewUrl?: string;
618
+ }
619
+ declare class DebugManager {
620
+ private cdpClient;
621
+ private playwrightClient;
622
+ private debugProcess;
623
+ private _isDebugMode;
624
+ private _isClientDebugMode;
625
+ private startCommand;
626
+ private workingDir;
627
+ private eventHandler;
628
+ private breakpointHitQueue;
629
+ private clientBreakpointHitQueue;
630
+ constructor(startCommand: string, workingDir: string, eventHandler: DebugEventHandler);
631
+ isDebugMode(): boolean;
632
+ isClientDebugMode(): boolean;
633
+ getClient(): CdpDebugClient | null;
634
+ getPlaywrightClient(): PlaywrightDebugClient | null;
635
+ drainBreakpointHitQueue(): PausedState[];
636
+ drainClientBreakpointHitQueue(): PausedState[];
637
+ enterDebugMode(killCurrentProcess?: () => void, options?: DebugModeOptions): Promise<void>;
638
+ exitDebugMode(restartNormalServer?: () => void): Promise<void>;
639
+ private activateServerDebug;
640
+ private activateClientDebug;
641
+ private ensurePlaywrightInstalled;
642
+ private startWithInspector;
643
+ }
644
+
645
+ /**
646
+ * Orchestrates the debug session lifecycle, tracks state for the web UI,
647
+ * and generates session summaries. Wraps DebugManager events and forwards
648
+ * state changes to the API via ConveyorConnection.
649
+ */
650
+ declare class DebugLifecycleManager {
651
+ private connection;
652
+ private debugManager;
653
+ private hypothesis?;
654
+ private sessionStartedAt?;
655
+ private breakpointsHitCount;
656
+ private telemetryEvents;
657
+ private reproduceRequested;
658
+ private keyFindings;
659
+ private _isActive;
660
+ constructor(connection: ConveyorConnection);
661
+ get isActive(): boolean;
662
+ setDebugManager(manager: DebugManager): void;
663
+ /**
664
+ * Creates a DebugEventHandler that bridges DebugManager events
665
+ * to the lifecycle manager and broadcasts state to the web UI.
666
+ */
667
+ createEventHandler(baseOnOutput: (stream: "stdout" | "stderr", data: string) => void): DebugEventHandler;
668
+ /** Mark the hypothesis for the current debug session */
669
+ setHypothesis(hypothesis: string): void;
670
+ /** Signal that the user has been asked to reproduce the bug */
671
+ requestReproduce(hypothesis?: string): void;
672
+ /** Add a telemetry event to the debug session */
673
+ addTelemetryEvent(event: DebugTelemetryEvent): void;
674
+ /** Generate and broadcast a debug session summary, then reset state */
675
+ completeSession(): DebugSessionSummary | null;
676
+ /** Auto-exit cleanup — called when agent session ends */
677
+ autoCleanup(): void;
678
+ private getBreakpoints;
679
+ private getProbes;
680
+ private buildState;
681
+ private broadcastState;
682
+ }
683
+
684
+ export { type AgentContext, AgentRunner, type AgentRunnerCallbacks, type AgentRunnerConfig, type BreakpointInfo, type CallFrameInfo, CdpDebugClient, type ChatHistoryMessage, type ConveyorConfig, ConveyorConnection, type DebugEventHandler, DebugLifecycleManager, DebugManager, FileCache, type IncomingChatMessage, type PausedState, ProjectConnection, type ProjectConnectionConfig, ProjectRunner, type ProjectRunnerConfig, type ScopeVariable, type TaskAssignment, ensureWorktree, loadConveyorConfig, removeWorktree, runSetupCommand, runStartCommand };