@adhdev/daemon-core 0.9.19 → 0.9.21

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.
@@ -22,6 +22,7 @@ type SeedCliChatMessage = Omit<Partial<CliChatMessage>, 'role'> & {
22
22
  role?: string;
23
23
  content?: string;
24
24
  };
25
+ export declare function appendBoundedText(current: string, chunk: string, maxChars: number): string;
25
26
  export declare class ProviderCliAdapter implements CliAdapter {
26
27
  private extraArgs;
27
28
  readonly cliType: string;
@@ -49,15 +50,17 @@ export declare class ProviderCliAdapter implements CliAdapter {
49
50
  private spawnAt;
50
51
  private startupFirstOutputAt;
51
52
  private onPtyDataCallback;
52
- private pendingOutputParseBuffer;
53
+ private pendingOutputParseChunks;
53
54
  private pendingOutputParseTimer;
54
- private ptyOutputBuffer;
55
+ private ptyOutputChunks;
55
56
  private ptyOutputFlushTimer;
56
57
  private pendingTerminalQueryTail;
57
58
  private lastOutputAt;
58
59
  private lastNonEmptyOutputAt;
59
60
  private lastScreenChangeAt;
60
61
  private lastScreenSnapshot;
62
+ private lastScreenText;
63
+ private lastScreenSnapshotReadAt;
61
64
  private serverConn;
62
65
  private logBuffer;
63
66
  private lastApprovalResolvedAt;
@@ -96,11 +99,18 @@ export declare class ProviderCliAdapter implements CliAdapter {
96
99
  private traceSeq;
97
100
  private traceSessionId;
98
101
  private parsedStatusCache;
102
+ private lastStatusHotPathParseAt;
103
+ private static readonly STATUS_HOT_PATH_PARSE_MIN_INTERVAL_MS;
104
+ private static readonly SCREEN_SNAPSHOT_MIN_INTERVAL_MS;
99
105
  private static readonly MAX_TRACE_ENTRIES;
100
106
  private readonly providerResolutionMeta;
101
107
  private static readonly FINISH_RETRY_DELAY_MS;
102
108
  private static readonly MAX_FINISH_RETRIES;
103
109
  private syncMessageViews;
110
+ private readTerminalScreenText;
111
+ private shouldReadTerminalScreenSnapshot;
112
+ private resetTerminalScreen;
113
+ private getFreshParsedStatusCache;
104
114
  private getIdleFinishConfirmMs;
105
115
  private getStatusActivityHoldMs;
106
116
  private setStatus;
@@ -145,6 +155,7 @@ export declare class ProviderCliAdapter implements CliAdapter {
145
155
  private finishResponse;
146
156
  private maybeCommitVisibleIdleTranscript;
147
157
  private commitCurrentTranscript;
158
+ private runParseSession;
148
159
  private runDetectStatus;
149
160
  private runParseApproval;
150
161
  private hasActionableApproval;
@@ -166,8 +177,17 @@ export declare class ProviderCliAdapter implements CliAdapter {
166
177
  * Uses resolveAction script if available, otherwise falls back to standard text.
167
178
  */
168
179
  resolveAction(data: any): Promise<void>;
180
+ private isSubmitStuck;
169
181
  private writeToPty;
170
182
  private resetPendingSendState;
183
+ private commitSendUserTurn;
184
+ private armResponseTimeout;
185
+ private writeSubmitKeyForRetry;
186
+ private retrySubmitIfStuck;
187
+ private retryImmediateSubmitIfStuck;
188
+ private submitSendKey;
189
+ private submitImmediatePrompt;
190
+ private waitForEchoAndSubmit;
171
191
  sendMessage(text: string): Promise<void>;
172
192
  getPartialResponse(): string;
173
193
  getRuntimeMetadata(): PtyRuntimeMetadata | null;
@@ -23,7 +23,20 @@ export interface CliSessionStatus {
23
23
  errorMessage?: string;
24
24
  errorReason?: string;
25
25
  }
26
+ export interface ParsedSession {
27
+ status: string;
28
+ messages: any[];
29
+ modal: {
30
+ message: string;
31
+ buttons: string[];
32
+ } | null;
33
+ parsedStatus: string | null;
34
+ }
26
35
  export interface CliScripts {
36
+ parseSession?: (input: CliScriptInput & {
37
+ tail?: string;
38
+ tailScreen?: CliScreenSnapshot;
39
+ }) => ParsedSession | null;
27
40
  parseOutput?: (input: CliScriptInput) => any;
28
41
  detectStatus?: (input: CliStatusInput) => string | null;
29
42
  parseApproval?: (input: CliApprovalInput) => {
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * Core logic for daemon: CDP, Provider, IDE detection, CLI/ACP adapters and more.
5
5
  */
6
6
  export type { ChatBubbleState, ChatMessage, ExtensionInfo, CommandResult as CoreCommandResult, ProviderConfig, DaemonEvent, StatusResponse, SystemInfo, DetectedIde, ProviderInfo, AgentEntry, } from './types.js';
7
- export type { SessionEntry, CompactSessionEntry, CompactDaemonEntry, CloudDaemonSummaryEntry, DashboardBootstrapDaemonEntry, VersionUpdateReason, CloudStatusReportPayload, DaemonStatusEventPayload, DashboardStatusEventPayload, SessionTransport, SessionKind, SessionCapability, AgentSessionStream, ReadChatCursor, ReadChatSyncMode, ReadChatSyncResult, TransportTopic, SessionChatTailSubscriptionParams, MachineRuntimeSubscriptionParams, SessionHostDiagnosticsSubscriptionParams, SessionModalSubscriptionParams, DaemonMetadataSubscriptionParams, SessionChatTailUpdate, MachineRuntimeUpdate, SessionHostDiagnosticsUpdate, SessionModalUpdate, DaemonMetadataUpdate, TopicUpdateEnvelope, SubscribeRequest, UnsubscribeRequest, StandaloneWsStatusPayload, AvailableProviderInfo, AcpConfigOption, AcpMode, ProviderControlSchema, StatusReportPayload, MachineInfo, SessionHostDiagnosticsSnapshot, SessionHostRecord, SessionHostWriteOwner, SessionHostAttachedClient, SessionHostLogEntry, SessionHostRequestTrace, SessionHostRuntimeTransition, DetectedIdeInfo, WorkspaceEntry, ProviderSummaryItem, ProviderSummaryMetadata, ProviderState, ProviderStatus, ProviderErrorReason, SessionActiveChatData, ActiveChatData, IdeProviderState, CliProviderState, AcpProviderState, ExtensionProviderState, } from './shared-types.js';
7
+ export type { SessionEntry, CompactSessionEntry, CompactDaemonEntry, CloudDaemonSummaryEntry, DashboardBootstrapDaemonEntry, VersionUpdateReason, CloudStatusReportPayload, DaemonStatusEventPayload, DashboardStatusEventPayload, SessionTransport, SessionKind, SessionCapability, AgentSessionStream, ReadChatCursor, ReadChatSyncMode, ReadChatSyncResult, TransportTopic, SessionChatTailSubscriptionParams, SessionRuntimeOutputSubscriptionParams, MachineRuntimeSubscriptionParams, SessionHostDiagnosticsSubscriptionParams, SessionModalSubscriptionParams, DaemonMetadataSubscriptionParams, SessionChatTailUpdate, MachineRuntimeUpdate, SessionHostDiagnosticsUpdate, SessionModalUpdate, DaemonMetadataUpdate, TopicUpdateEnvelope, SubscribeRequest, UnsubscribeRequest, StandaloneWsStatusPayload, AvailableProviderInfo, AcpConfigOption, AcpMode, ProviderControlSchema, StatusReportPayload, MachineInfo, SessionHostDiagnosticsSnapshot, SessionHostRecord, SessionHostWriteOwner, SessionHostAttachedClient, SessionHostLogEntry, SessionHostRequestTrace, SessionHostRuntimeTransition, DetectedIdeInfo, WorkspaceEntry, ProviderSummaryItem, ProviderSummaryMetadata, ProviderState, ProviderStatus, ProviderErrorReason, SessionActiveChatData, ActiveChatData, IdeProviderState, CliProviderState, AcpProviderState, ExtensionProviderState, } from './shared-types.js';
8
8
  import type { RuntimeWriteOwner as _RuntimeWriteOwner } from './shared-types-extra.js';
9
9
  import type { RuntimeAttachedClient as _RuntimeAttachedClient } from './shared-types-extra.js';
10
10
  import type { RecentLaunchEntry as _RecentLaunchEntry } from './shared-types.js';