@mirasoth/soothe-client 0.5.0 → 0.5.2

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/index.d.cts CHANGED
@@ -124,7 +124,7 @@ declare function defaultConfig(): Config;
124
124
  declare function loadConfigFromEnv(): Config;
125
125
 
126
126
  /**
127
- * Daemon ``loop_input`` intent_hint values (direct model turns, no agent graph).
127
+ * Daemon ``loop_input`` intent_hint values (non-agent turns).
128
128
  */
129
129
  /** Text-only chat completion via the configured ``default`` role. */
130
130
  declare const INTENT_HINT_TEXT_COMPLETION: "text_completion";
@@ -134,23 +134,23 @@ declare const INTENT_HINT_IMAGE_TO_TEXT: "image_to_text";
134
134
  declare const INTENT_HINT_OCR: "ocr";
135
135
  /** Embedding via the configured ``embedding`` role (text-only; JSON vector response). */
136
136
  declare const INTENT_HINT_EMBED: "embed";
137
- /** Supported daemon direct-model intent hints. */
137
+ /** Supported daemon intent_hint values for non-agent turns. */
138
138
  type IntentHint = typeof INTENT_HINT_TEXT_COMPLETION | typeof INTENT_HINT_IMAGE_TO_TEXT | typeof INTENT_HINT_OCR | typeof INTENT_HINT_EMBED;
139
139
  /** Legacy intent_hint values removed from the daemon wire contract. */
140
- declare const REMOVED_INTENT_HINTS: readonly ["direct_llm", "quiz"];
140
+ declare const REMOVED_INTENT_HINTS: readonly ["direct_llm", "quiz", "direct_model"];
141
141
  type RemovedIntentHint = (typeof REMOVED_INTENT_HINTS)[number];
142
142
  /**
143
- * Wire ``loop_input.intent_hint``: direct model hints or agent-path pass-through
144
- * (e.g. ``resume_clarification``, ``skill:foo``). Legacy ``direct_llm`` and
145
- * ``quiz`` are rejected before send.
143
+ * Wire ``loop_input.intent_hint``: intent-hint values or agent-path pass-through
144
+ * (e.g. ``resume_clarification``, ``skill:foo``). Legacy ``direct_llm``, ``quiz``,
145
+ * and ``direct_model`` are rejected before send.
146
146
  */
147
147
  type LoopInputIntentHint = IntentHint | (string & {});
148
148
  /** Returns an error message when ``hint`` is a removed legacy value; otherwise null. */
149
149
  declare function validateLoopInputIntentHint(hint: string): string | null;
150
150
  /** Phases emitted on ``mode=messages`` for user-visible loop assistant output. */
151
- declare const LOOP_ASSISTANT_OUTPUT_PHASES: readonly ["goal_completion", "quiz", "autonomous_goal", "direct_model", "text_completion", "image_to_text", "ocr", "embed", "plan_direct"];
151
+ declare const LOOP_ASSISTANT_OUTPUT_PHASES: readonly ["goal_completion", "quiz", "autonomous_goal", "chitchat", "text_completion", "image_to_text", "ocr", "embed", "plan_direct"];
152
152
  type LoopAssistantOutputPhase = (typeof LOOP_ASSISTANT_OUTPUT_PHASES)[number];
153
- /** Default deliverable phases for triarch-style apps (direct hints + agent outputs). */
153
+ /** Default deliverable phases for triarch-style apps (intent hints + agent outputs). */
154
154
  declare const DEFAULT_DELIVERABLE_PHASES: ReadonlySet<string>;
155
155
 
156
156
  /**
@@ -167,7 +167,7 @@ declare const PROTO_VERSION = "1";
167
167
  /** Default client capabilities declared in the connection_init handshake. */
168
168
  declare const DEFAULT_CLIENT_CAPABILITIES: string[];
169
169
  /** Client version reported in the connection_init handshake. */
170
- declare const CLIENT_VERSION = "0.5.0";
170
+ declare const CLIENT_VERSION = "0.5.2";
171
171
  type MessageType = "connection_init" | "connection_ack" | "request" | "response" | "notification" | "subscribe" | "next" | "error" | "complete" | "unsubscribe" | "ping" | "pong" | "receipt_response" | "disconnect" | "status";
172
172
  /** Method names carried in the envelope `method` field. */
173
173
  type MethodName = "loop_list" | "loop_get" | "loop_tree" | "loop_prune" | "loop_delete" | "loop_new" | "loop_reattach" | "loop_detach" | "loop_input" | "loop_messages" | "loop_state_get" | "loop_state_update" | "loop_cards_fetch" | "loop_history_fetch" | "loop_events" | "autopilot_events" | "job_create" | "job_status" | "job_pause" | "job_resume" | "job_cancel" | "job_dag" | "job_guidance" | "autopilot_status" | "autopilot_submit" | "autopilot_list_goals" | "autopilot_get_goal" | "autopilot_cancel_goal" | "autopilot_cancel_all" | "autopilot_wake" | "autopilot_dream" | "autopilot_resume" | "autopilot_list_jobs" | "autopilot_get_job" | "daemon_status" | "daemon_shutdown" | "config_get" | "config_reload" | "skills_list" | "invoke_skill" | "models_list" | "mcp_status" | "auth" | "auth_refresh" | "slash_command" | "rpc_command" | "delivery_ack" | "cron_add" | "cron_list" | "cron_show" | "cron_cancel" | "disconnect";
@@ -460,7 +460,7 @@ interface InputOptions {
460
460
  model?: string;
461
461
  modelParams?: Record<string, unknown>;
462
462
  attachments?: Record<string, unknown>[];
463
- /** Daemon direct-model hint or agent-path pass-through (resume_clarification, skill:foo). */
463
+ /** Daemon intent_hint or agent-path pass-through (resume_clarification, skill:foo). */
464
464
  intentHint?: LoopInputIntentHint;
465
465
  /** JSON Schema for structured output (text_completion or image_to_text). */
466
466
  responseSchema?: Record<string, unknown>;
@@ -1050,7 +1050,7 @@ interface ChatEventResult {
1050
1050
  /**
1051
1051
  * Product-specific decisions an EventClassifier needs. The DeliverablePhases
1052
1052
  * set is the key product knob: which message `phase` values count as
1053
- * user-facing deliverables (triarch uses quiz, goal_completion, direct_model, and
1053
+ * user-facing deliverables (triarch uses quiz, goal_completion, chitchat, and
1054
1054
  * direct intent_hint phases text_completion, image_to_text, ocr, embed;
1055
1055
  * other apps pass their own).
1056
1056
  */
@@ -1064,9 +1064,8 @@ interface ClassifierConfig {
1064
1064
  /** Optional app override of the default thinking-step event allowlist. */
1065
1065
  thinkingStepEvents?: ReadonlySet<string>;
1066
1066
  /**
1067
- * When true, a status frame with state=idle and non-empty accumulated
1068
- * assistant text is DeliverableComplete (typical for direct-model turns).
1069
- * Default false keeps Continue-on-status behaviour.
1067
+ * Standalone classify only. Prefer TurnRunner + TurnBoundary for turn end
1068
+ * (DaemonSession contract). Default false.
1070
1069
  */
1071
1070
  treatStatusIdleAsComplete?: boolean;
1072
1071
  }
@@ -1113,8 +1112,8 @@ declare class EventClassifier {
1113
1112
  private classifyMessagesMode;
1114
1113
  /**
1115
1114
  * Extracts plain assistant text from mode="messages" events that carry a
1116
- * terminal AIMessage without loop-tagged phase metadata (legacy direct_llm turns
1117
- * before phase tagging; prefer deliverablePhases including text_completion).
1115
+ * terminal AIMessage without loop-tagged phase metadata (prefer named
1116
+ * deliverablePhases such as text_completion).
1118
1117
  */
1119
1118
  private messagesModeAssistantContent;
1120
1119
  /** soothe output/responded events that carry user-facing final text. */
@@ -1336,11 +1335,10 @@ declare function compactAttachments(atts: Record<string, unknown>[], opts?: Comp
1336
1335
  * Turn runner for appkit.
1337
1336
  *
1338
1337
  * Executes one query turn end-to-end: acquire a pooled connection, enforce
1339
- * single-flight, send loop_input, consume the event stream, classify events,
1340
- * resolve the deliverable, persist the reply, and broadcast completion.
1338
+ * single-flight, send loop_input, consume the event stream, persist/broadcast.
1341
1339
  *
1342
- * Supports lifecycle knobs: idle timeout, soft-complete
1343
- * policies, attachment compaction, and stream-close soft-complete.
1340
+ * Turn end is owned by TurnBoundary (DaemonSession.iterTurnChunks contract).
1341
+ * EventClassifier selects content and may early-complete on deliverable phases.
1344
1342
  */
1345
1343
 
1346
1344
  /** Returned when a turn exceeds the configured timeout and policy is Fail. */
@@ -1430,6 +1428,32 @@ declare class TurnRunner {
1430
1428
  private broadcastError;
1431
1429
  }
1432
1430
 
1431
+ /**
1432
+ * DaemonSession turn-end contract for the pool TurnRunner path.
1433
+ * TurnRunner owns one TurnBoundary per execute; EventClassifier may
1434
+ * early-complete on deliverable phases for UX only.
1435
+ */
1436
+
1437
+ declare const TURN_END_STREAM_END = "soothe.stream.end";
1438
+ declare const TURN_END_IDLE = "status.idle";
1439
+ declare const TURN_END_STOPPED = "status.stopped";
1440
+ declare class TurnLifecycleGate {
1441
+ sawRunning: boolean;
1442
+ sawStreamPayload: boolean;
1443
+ sawTurnProgress: boolean;
1444
+ observe(msg: unknown): void;
1445
+ allowStreamEnd(): boolean;
1446
+ allowIdleComplete(): boolean;
1447
+ }
1448
+ declare class TurnBoundary {
1449
+ readonly gate: TurnLifecycleGate;
1450
+ ended: boolean;
1451
+ reason: string;
1452
+ feed(msg: unknown): [boolean, string];
1453
+ private mark;
1454
+ }
1455
+ declare function isDaemonTurnEndEvent(completionEvent: string): boolean;
1456
+
1433
1457
  /**
1434
1458
  * Per-turn observability counters for daemon stream consumption.
1435
1459
  */
@@ -1546,4 +1570,4 @@ declare class DaemonSession {
1546
1570
  }): AsyncGenerator<TurnChunk>;
1547
1571
  }
1548
1572
 
1549
- export { type Attachment, type BaseEnvelope, CLIENT_VERSION, type ChatEventResult, ChatEventTerminal, type ClassifierConfig, Client, CommandClient, type CompactImageOptions, type CompleteEnvelope, type Config, type ConnectionAckEnvelope, ConnectionError, type ConnectionInitEnvelope, ConnectionPool, DEFAULT_CLIENT_CAPABILITIES, DEFAULT_DELIVERABLE_PHASES, DEFAULT_POST_IDLE_DRAIN_MS, DEFAULT_THINKING_STEP_EVENTS, DaemonError, DaemonSession, type DaemonSessionOptions, type DecodedMessage, DisconnectCause, type DisconnectEnvelope, ErrIdleTimeout, ErrPoolExhausted, ErrQueryBusy, ErrQueryTimeout, type ErrorEnvelope, EventAutopilotGoalCompleted, EventAutopilotGoalCreated, EventAutopilotGoalProgress, EventAutopilotGoalStatus, EventAutopilotWorkerAssigned, EventAutopilotWorkerUnassigned, EventCardCreated, EventCardReplayBegin, EventCardReplayEnd, EventClassifier, EventDeepResearchCompleted, EventDeepResearchCrawlSummary, EventDeepResearchGatherSummary, EventDeepResearchProgress, EventDeepResearchStarted, EventDeepResearchStepCompleted, EventExplorerCompleted, EventExplorerMilestone, EventExplorerStarted, EventExplorerStepCompleted, EventFinalReport, EventGeneralFailed, EventLoopReattachedWire, EventMessageReceived, EventMessageSent, EventPlanCreated, EventReplayComplete, EventStrangeLoopCompleted, EventStrangeLoopContextCompacted, EventStrangeLoopPlanDecision, EventStrangeLoopReasoned, EventStrangeLoopStarted, EventStrangeLoopStepCompleted, EventStrangeLoopStepQueued, EventStrangeLoopStepStarted, EventStreamToolCallUpdate, EventToolCallUpdatesBatch, EventToolCompleted, EventToolError, EventToolStarted, INTENT_HINT_EMBED, INTENT_HINT_IMAGE_TO_TEXT, INTENT_HINT_OCR, INTENT_HINT_TEXT_COMPLETION, type InputOptions, type InputOpts, type IntentHint, LOOP_ASSISTANT_OUTPUT_PHASES, type LoopAssistantOutputPhase, type LoopInputIntentHint, type LoopInputParams, type LoopNewOptions, type MessageType, type MethodName, type NegotiatedCapabilities, type NextEnvelope, type NotificationEnvelope, type OnComplete, type OnError, PROTO_VERSION, type PingEnvelope, type PongEnvelope, type PoolConfig, PooledConn, QueryGate, REMOVED_INTENT_HINTS, type ReceiptResponseEnvelope, ReconnectError, type RemovedIntentHint, type RequestEnvelope, type ResponseEnvelope, SSEBroadcaster, type SSEEvent, STREAM_END, type SessionEntry, type SessionMessage, type SessionStore, StaleLoopError, type StatusFrame, StreamCloseFail, type StreamClosePolicy, StreamCloseSoftComplete, type StreamEventPayload, type SubscribeEnvelope, TimeoutError, TimeoutPolicy, type TurnChunk, type TurnConfig, TurnEventStats, TurnRunner, type UnsubscribeEnvelope, type VerbosityLevel, VerbosityTier, authenticate, bootstrapLoopSession, checkDaemonStatus, classifyEventVerbosity, compactAttachments, compactImageAttachment, connectWithRetries, connectedWebsocket, connectionInitEnvelope, decodeMessage, defaultConfig, defaultPoolConfig, disconnectCauseName, disconnectEnvelope, encodeMessage, extractSootheLoopID, extractThinkingStep, fetchConfigSection, fetchLoopCards, fetchLoopHistory, fetchLoopMessages, fetchSkillsCatalog, idleTimeoutForTurn, inboundNeedsDeliveryAck, inputMessageForLoop, isCompletionEvent, isDaemonLive, isSubagentProgressEvent, isTurnEndCustomData, isTurnProgressChunk, isValidVerbosityLevel, loadConfigFromEnv, newLoopInputMessage, newLoopNewMessage, newLoopSubscribeMessage, newRequestID, notificationEnvelope, parseNamespace, pingEnvelope, pongEnvelope, protocol1Rpc, refreshAuthToken, requestDaemonConfigReload, requestDaemonShutdown, requestEnvelope, shouldShow, splitWirePayload, subscribeEnvelope, unsubscribeEnvelope, validateLoopInputIntentHint, waitDaemonReady, waitLoopStatusWithID, waitSubscriptionConfirmed };
1573
+ export { type Attachment, type BaseEnvelope, CLIENT_VERSION, type ChatEventResult, ChatEventTerminal, type ClassifierConfig, Client, CommandClient, type CompactImageOptions, type CompleteEnvelope, type Config, type ConnectionAckEnvelope, ConnectionError, type ConnectionInitEnvelope, ConnectionPool, DEFAULT_CLIENT_CAPABILITIES, DEFAULT_DELIVERABLE_PHASES, DEFAULT_POST_IDLE_DRAIN_MS, DEFAULT_THINKING_STEP_EVENTS, DaemonError, DaemonSession, type DaemonSessionOptions, type DecodedMessage, DisconnectCause, type DisconnectEnvelope, ErrIdleTimeout, ErrPoolExhausted, ErrQueryBusy, ErrQueryTimeout, type ErrorEnvelope, EventAutopilotGoalCompleted, EventAutopilotGoalCreated, EventAutopilotGoalProgress, EventAutopilotGoalStatus, EventAutopilotWorkerAssigned, EventAutopilotWorkerUnassigned, EventCardCreated, EventCardReplayBegin, EventCardReplayEnd, EventClassifier, EventDeepResearchCompleted, EventDeepResearchCrawlSummary, EventDeepResearchGatherSummary, EventDeepResearchProgress, EventDeepResearchStarted, EventDeepResearchStepCompleted, EventExplorerCompleted, EventExplorerMilestone, EventExplorerStarted, EventExplorerStepCompleted, EventFinalReport, EventGeneralFailed, EventLoopReattachedWire, EventMessageReceived, EventMessageSent, EventPlanCreated, EventReplayComplete, EventStrangeLoopCompleted, EventStrangeLoopContextCompacted, EventStrangeLoopPlanDecision, EventStrangeLoopReasoned, EventStrangeLoopStarted, EventStrangeLoopStepCompleted, EventStrangeLoopStepQueued, EventStrangeLoopStepStarted, EventStreamToolCallUpdate, EventToolCallUpdatesBatch, EventToolCompleted, EventToolError, EventToolStarted, INTENT_HINT_EMBED, INTENT_HINT_IMAGE_TO_TEXT, INTENT_HINT_OCR, INTENT_HINT_TEXT_COMPLETION, type InputOptions, type InputOpts, type IntentHint, LOOP_ASSISTANT_OUTPUT_PHASES, type LoopAssistantOutputPhase, type LoopInputIntentHint, type LoopInputParams, type LoopNewOptions, type MessageType, type MethodName, type NegotiatedCapabilities, type NextEnvelope, type NotificationEnvelope, type OnComplete, type OnError, PROTO_VERSION, type PingEnvelope, type PongEnvelope, type PoolConfig, PooledConn, QueryGate, REMOVED_INTENT_HINTS, type ReceiptResponseEnvelope, ReconnectError, type RemovedIntentHint, type RequestEnvelope, type ResponseEnvelope, SSEBroadcaster, type SSEEvent, STREAM_END, type SessionEntry, type SessionMessage, type SessionStore, StaleLoopError, type StatusFrame, StreamCloseFail, type StreamClosePolicy, StreamCloseSoftComplete, type StreamEventPayload, type SubscribeEnvelope, TURN_END_IDLE, TURN_END_STOPPED, TURN_END_STREAM_END, TimeoutError, TimeoutPolicy, TurnBoundary, type TurnChunk, type TurnConfig, TurnEventStats, TurnLifecycleGate, TurnRunner, type UnsubscribeEnvelope, type VerbosityLevel, VerbosityTier, authenticate, bootstrapLoopSession, checkDaemonStatus, classifyEventVerbosity, compactAttachments, compactImageAttachment, connectWithRetries, connectedWebsocket, connectionInitEnvelope, decodeMessage, defaultConfig, defaultPoolConfig, disconnectCauseName, disconnectEnvelope, encodeMessage, extractSootheLoopID, extractThinkingStep, fetchConfigSection, fetchLoopCards, fetchLoopHistory, fetchLoopMessages, fetchSkillsCatalog, idleTimeoutForTurn, inboundNeedsDeliveryAck, inputMessageForLoop, isCompletionEvent, isDaemonLive, isDaemonTurnEndEvent, isSubagentProgressEvent, isTurnEndCustomData, isTurnProgressChunk, isValidVerbosityLevel, loadConfigFromEnv, newLoopInputMessage, newLoopNewMessage, newLoopSubscribeMessage, newRequestID, notificationEnvelope, parseNamespace, pingEnvelope, pongEnvelope, protocol1Rpc, refreshAuthToken, requestDaemonConfigReload, requestDaemonShutdown, requestEnvelope, shouldShow, splitWirePayload, subscribeEnvelope, unsubscribeEnvelope, validateLoopInputIntentHint, waitDaemonReady, waitLoopStatusWithID, waitSubscriptionConfirmed };
package/dist/index.d.ts CHANGED
@@ -124,7 +124,7 @@ declare function defaultConfig(): Config;
124
124
  declare function loadConfigFromEnv(): Config;
125
125
 
126
126
  /**
127
- * Daemon ``loop_input`` intent_hint values (direct model turns, no agent graph).
127
+ * Daemon ``loop_input`` intent_hint values (non-agent turns).
128
128
  */
129
129
  /** Text-only chat completion via the configured ``default`` role. */
130
130
  declare const INTENT_HINT_TEXT_COMPLETION: "text_completion";
@@ -134,23 +134,23 @@ declare const INTENT_HINT_IMAGE_TO_TEXT: "image_to_text";
134
134
  declare const INTENT_HINT_OCR: "ocr";
135
135
  /** Embedding via the configured ``embedding`` role (text-only; JSON vector response). */
136
136
  declare const INTENT_HINT_EMBED: "embed";
137
- /** Supported daemon direct-model intent hints. */
137
+ /** Supported daemon intent_hint values for non-agent turns. */
138
138
  type IntentHint = typeof INTENT_HINT_TEXT_COMPLETION | typeof INTENT_HINT_IMAGE_TO_TEXT | typeof INTENT_HINT_OCR | typeof INTENT_HINT_EMBED;
139
139
  /** Legacy intent_hint values removed from the daemon wire contract. */
140
- declare const REMOVED_INTENT_HINTS: readonly ["direct_llm", "quiz"];
140
+ declare const REMOVED_INTENT_HINTS: readonly ["direct_llm", "quiz", "direct_model"];
141
141
  type RemovedIntentHint = (typeof REMOVED_INTENT_HINTS)[number];
142
142
  /**
143
- * Wire ``loop_input.intent_hint``: direct model hints or agent-path pass-through
144
- * (e.g. ``resume_clarification``, ``skill:foo``). Legacy ``direct_llm`` and
145
- * ``quiz`` are rejected before send.
143
+ * Wire ``loop_input.intent_hint``: intent-hint values or agent-path pass-through
144
+ * (e.g. ``resume_clarification``, ``skill:foo``). Legacy ``direct_llm``, ``quiz``,
145
+ * and ``direct_model`` are rejected before send.
146
146
  */
147
147
  type LoopInputIntentHint = IntentHint | (string & {});
148
148
  /** Returns an error message when ``hint`` is a removed legacy value; otherwise null. */
149
149
  declare function validateLoopInputIntentHint(hint: string): string | null;
150
150
  /** Phases emitted on ``mode=messages`` for user-visible loop assistant output. */
151
- declare const LOOP_ASSISTANT_OUTPUT_PHASES: readonly ["goal_completion", "quiz", "autonomous_goal", "direct_model", "text_completion", "image_to_text", "ocr", "embed", "plan_direct"];
151
+ declare const LOOP_ASSISTANT_OUTPUT_PHASES: readonly ["goal_completion", "quiz", "autonomous_goal", "chitchat", "text_completion", "image_to_text", "ocr", "embed", "plan_direct"];
152
152
  type LoopAssistantOutputPhase = (typeof LOOP_ASSISTANT_OUTPUT_PHASES)[number];
153
- /** Default deliverable phases for triarch-style apps (direct hints + agent outputs). */
153
+ /** Default deliverable phases for triarch-style apps (intent hints + agent outputs). */
154
154
  declare const DEFAULT_DELIVERABLE_PHASES: ReadonlySet<string>;
155
155
 
156
156
  /**
@@ -167,7 +167,7 @@ declare const PROTO_VERSION = "1";
167
167
  /** Default client capabilities declared in the connection_init handshake. */
168
168
  declare const DEFAULT_CLIENT_CAPABILITIES: string[];
169
169
  /** Client version reported in the connection_init handshake. */
170
- declare const CLIENT_VERSION = "0.5.0";
170
+ declare const CLIENT_VERSION = "0.5.2";
171
171
  type MessageType = "connection_init" | "connection_ack" | "request" | "response" | "notification" | "subscribe" | "next" | "error" | "complete" | "unsubscribe" | "ping" | "pong" | "receipt_response" | "disconnect" | "status";
172
172
  /** Method names carried in the envelope `method` field. */
173
173
  type MethodName = "loop_list" | "loop_get" | "loop_tree" | "loop_prune" | "loop_delete" | "loop_new" | "loop_reattach" | "loop_detach" | "loop_input" | "loop_messages" | "loop_state_get" | "loop_state_update" | "loop_cards_fetch" | "loop_history_fetch" | "loop_events" | "autopilot_events" | "job_create" | "job_status" | "job_pause" | "job_resume" | "job_cancel" | "job_dag" | "job_guidance" | "autopilot_status" | "autopilot_submit" | "autopilot_list_goals" | "autopilot_get_goal" | "autopilot_cancel_goal" | "autopilot_cancel_all" | "autopilot_wake" | "autopilot_dream" | "autopilot_resume" | "autopilot_list_jobs" | "autopilot_get_job" | "daemon_status" | "daemon_shutdown" | "config_get" | "config_reload" | "skills_list" | "invoke_skill" | "models_list" | "mcp_status" | "auth" | "auth_refresh" | "slash_command" | "rpc_command" | "delivery_ack" | "cron_add" | "cron_list" | "cron_show" | "cron_cancel" | "disconnect";
@@ -460,7 +460,7 @@ interface InputOptions {
460
460
  model?: string;
461
461
  modelParams?: Record<string, unknown>;
462
462
  attachments?: Record<string, unknown>[];
463
- /** Daemon direct-model hint or agent-path pass-through (resume_clarification, skill:foo). */
463
+ /** Daemon intent_hint or agent-path pass-through (resume_clarification, skill:foo). */
464
464
  intentHint?: LoopInputIntentHint;
465
465
  /** JSON Schema for structured output (text_completion or image_to_text). */
466
466
  responseSchema?: Record<string, unknown>;
@@ -1050,7 +1050,7 @@ interface ChatEventResult {
1050
1050
  /**
1051
1051
  * Product-specific decisions an EventClassifier needs. The DeliverablePhases
1052
1052
  * set is the key product knob: which message `phase` values count as
1053
- * user-facing deliverables (triarch uses quiz, goal_completion, direct_model, and
1053
+ * user-facing deliverables (triarch uses quiz, goal_completion, chitchat, and
1054
1054
  * direct intent_hint phases text_completion, image_to_text, ocr, embed;
1055
1055
  * other apps pass their own).
1056
1056
  */
@@ -1064,9 +1064,8 @@ interface ClassifierConfig {
1064
1064
  /** Optional app override of the default thinking-step event allowlist. */
1065
1065
  thinkingStepEvents?: ReadonlySet<string>;
1066
1066
  /**
1067
- * When true, a status frame with state=idle and non-empty accumulated
1068
- * assistant text is DeliverableComplete (typical for direct-model turns).
1069
- * Default false keeps Continue-on-status behaviour.
1067
+ * Standalone classify only. Prefer TurnRunner + TurnBoundary for turn end
1068
+ * (DaemonSession contract). Default false.
1070
1069
  */
1071
1070
  treatStatusIdleAsComplete?: boolean;
1072
1071
  }
@@ -1113,8 +1112,8 @@ declare class EventClassifier {
1113
1112
  private classifyMessagesMode;
1114
1113
  /**
1115
1114
  * Extracts plain assistant text from mode="messages" events that carry a
1116
- * terminal AIMessage without loop-tagged phase metadata (legacy direct_llm turns
1117
- * before phase tagging; prefer deliverablePhases including text_completion).
1115
+ * terminal AIMessage without loop-tagged phase metadata (prefer named
1116
+ * deliverablePhases such as text_completion).
1118
1117
  */
1119
1118
  private messagesModeAssistantContent;
1120
1119
  /** soothe output/responded events that carry user-facing final text. */
@@ -1336,11 +1335,10 @@ declare function compactAttachments(atts: Record<string, unknown>[], opts?: Comp
1336
1335
  * Turn runner for appkit.
1337
1336
  *
1338
1337
  * Executes one query turn end-to-end: acquire a pooled connection, enforce
1339
- * single-flight, send loop_input, consume the event stream, classify events,
1340
- * resolve the deliverable, persist the reply, and broadcast completion.
1338
+ * single-flight, send loop_input, consume the event stream, persist/broadcast.
1341
1339
  *
1342
- * Supports lifecycle knobs: idle timeout, soft-complete
1343
- * policies, attachment compaction, and stream-close soft-complete.
1340
+ * Turn end is owned by TurnBoundary (DaemonSession.iterTurnChunks contract).
1341
+ * EventClassifier selects content and may early-complete on deliverable phases.
1344
1342
  */
1345
1343
 
1346
1344
  /** Returned when a turn exceeds the configured timeout and policy is Fail. */
@@ -1430,6 +1428,32 @@ declare class TurnRunner {
1430
1428
  private broadcastError;
1431
1429
  }
1432
1430
 
1431
+ /**
1432
+ * DaemonSession turn-end contract for the pool TurnRunner path.
1433
+ * TurnRunner owns one TurnBoundary per execute; EventClassifier may
1434
+ * early-complete on deliverable phases for UX only.
1435
+ */
1436
+
1437
+ declare const TURN_END_STREAM_END = "soothe.stream.end";
1438
+ declare const TURN_END_IDLE = "status.idle";
1439
+ declare const TURN_END_STOPPED = "status.stopped";
1440
+ declare class TurnLifecycleGate {
1441
+ sawRunning: boolean;
1442
+ sawStreamPayload: boolean;
1443
+ sawTurnProgress: boolean;
1444
+ observe(msg: unknown): void;
1445
+ allowStreamEnd(): boolean;
1446
+ allowIdleComplete(): boolean;
1447
+ }
1448
+ declare class TurnBoundary {
1449
+ readonly gate: TurnLifecycleGate;
1450
+ ended: boolean;
1451
+ reason: string;
1452
+ feed(msg: unknown): [boolean, string];
1453
+ private mark;
1454
+ }
1455
+ declare function isDaemonTurnEndEvent(completionEvent: string): boolean;
1456
+
1433
1457
  /**
1434
1458
  * Per-turn observability counters for daemon stream consumption.
1435
1459
  */
@@ -1546,4 +1570,4 @@ declare class DaemonSession {
1546
1570
  }): AsyncGenerator<TurnChunk>;
1547
1571
  }
1548
1572
 
1549
- export { type Attachment, type BaseEnvelope, CLIENT_VERSION, type ChatEventResult, ChatEventTerminal, type ClassifierConfig, Client, CommandClient, type CompactImageOptions, type CompleteEnvelope, type Config, type ConnectionAckEnvelope, ConnectionError, type ConnectionInitEnvelope, ConnectionPool, DEFAULT_CLIENT_CAPABILITIES, DEFAULT_DELIVERABLE_PHASES, DEFAULT_POST_IDLE_DRAIN_MS, DEFAULT_THINKING_STEP_EVENTS, DaemonError, DaemonSession, type DaemonSessionOptions, type DecodedMessage, DisconnectCause, type DisconnectEnvelope, ErrIdleTimeout, ErrPoolExhausted, ErrQueryBusy, ErrQueryTimeout, type ErrorEnvelope, EventAutopilotGoalCompleted, EventAutopilotGoalCreated, EventAutopilotGoalProgress, EventAutopilotGoalStatus, EventAutopilotWorkerAssigned, EventAutopilotWorkerUnassigned, EventCardCreated, EventCardReplayBegin, EventCardReplayEnd, EventClassifier, EventDeepResearchCompleted, EventDeepResearchCrawlSummary, EventDeepResearchGatherSummary, EventDeepResearchProgress, EventDeepResearchStarted, EventDeepResearchStepCompleted, EventExplorerCompleted, EventExplorerMilestone, EventExplorerStarted, EventExplorerStepCompleted, EventFinalReport, EventGeneralFailed, EventLoopReattachedWire, EventMessageReceived, EventMessageSent, EventPlanCreated, EventReplayComplete, EventStrangeLoopCompleted, EventStrangeLoopContextCompacted, EventStrangeLoopPlanDecision, EventStrangeLoopReasoned, EventStrangeLoopStarted, EventStrangeLoopStepCompleted, EventStrangeLoopStepQueued, EventStrangeLoopStepStarted, EventStreamToolCallUpdate, EventToolCallUpdatesBatch, EventToolCompleted, EventToolError, EventToolStarted, INTENT_HINT_EMBED, INTENT_HINT_IMAGE_TO_TEXT, INTENT_HINT_OCR, INTENT_HINT_TEXT_COMPLETION, type InputOptions, type InputOpts, type IntentHint, LOOP_ASSISTANT_OUTPUT_PHASES, type LoopAssistantOutputPhase, type LoopInputIntentHint, type LoopInputParams, type LoopNewOptions, type MessageType, type MethodName, type NegotiatedCapabilities, type NextEnvelope, type NotificationEnvelope, type OnComplete, type OnError, PROTO_VERSION, type PingEnvelope, type PongEnvelope, type PoolConfig, PooledConn, QueryGate, REMOVED_INTENT_HINTS, type ReceiptResponseEnvelope, ReconnectError, type RemovedIntentHint, type RequestEnvelope, type ResponseEnvelope, SSEBroadcaster, type SSEEvent, STREAM_END, type SessionEntry, type SessionMessage, type SessionStore, StaleLoopError, type StatusFrame, StreamCloseFail, type StreamClosePolicy, StreamCloseSoftComplete, type StreamEventPayload, type SubscribeEnvelope, TimeoutError, TimeoutPolicy, type TurnChunk, type TurnConfig, TurnEventStats, TurnRunner, type UnsubscribeEnvelope, type VerbosityLevel, VerbosityTier, authenticate, bootstrapLoopSession, checkDaemonStatus, classifyEventVerbosity, compactAttachments, compactImageAttachment, connectWithRetries, connectedWebsocket, connectionInitEnvelope, decodeMessage, defaultConfig, defaultPoolConfig, disconnectCauseName, disconnectEnvelope, encodeMessage, extractSootheLoopID, extractThinkingStep, fetchConfigSection, fetchLoopCards, fetchLoopHistory, fetchLoopMessages, fetchSkillsCatalog, idleTimeoutForTurn, inboundNeedsDeliveryAck, inputMessageForLoop, isCompletionEvent, isDaemonLive, isSubagentProgressEvent, isTurnEndCustomData, isTurnProgressChunk, isValidVerbosityLevel, loadConfigFromEnv, newLoopInputMessage, newLoopNewMessage, newLoopSubscribeMessage, newRequestID, notificationEnvelope, parseNamespace, pingEnvelope, pongEnvelope, protocol1Rpc, refreshAuthToken, requestDaemonConfigReload, requestDaemonShutdown, requestEnvelope, shouldShow, splitWirePayload, subscribeEnvelope, unsubscribeEnvelope, validateLoopInputIntentHint, waitDaemonReady, waitLoopStatusWithID, waitSubscriptionConfirmed };
1573
+ export { type Attachment, type BaseEnvelope, CLIENT_VERSION, type ChatEventResult, ChatEventTerminal, type ClassifierConfig, Client, CommandClient, type CompactImageOptions, type CompleteEnvelope, type Config, type ConnectionAckEnvelope, ConnectionError, type ConnectionInitEnvelope, ConnectionPool, DEFAULT_CLIENT_CAPABILITIES, DEFAULT_DELIVERABLE_PHASES, DEFAULT_POST_IDLE_DRAIN_MS, DEFAULT_THINKING_STEP_EVENTS, DaemonError, DaemonSession, type DaemonSessionOptions, type DecodedMessage, DisconnectCause, type DisconnectEnvelope, ErrIdleTimeout, ErrPoolExhausted, ErrQueryBusy, ErrQueryTimeout, type ErrorEnvelope, EventAutopilotGoalCompleted, EventAutopilotGoalCreated, EventAutopilotGoalProgress, EventAutopilotGoalStatus, EventAutopilotWorkerAssigned, EventAutopilotWorkerUnassigned, EventCardCreated, EventCardReplayBegin, EventCardReplayEnd, EventClassifier, EventDeepResearchCompleted, EventDeepResearchCrawlSummary, EventDeepResearchGatherSummary, EventDeepResearchProgress, EventDeepResearchStarted, EventDeepResearchStepCompleted, EventExplorerCompleted, EventExplorerMilestone, EventExplorerStarted, EventExplorerStepCompleted, EventFinalReport, EventGeneralFailed, EventLoopReattachedWire, EventMessageReceived, EventMessageSent, EventPlanCreated, EventReplayComplete, EventStrangeLoopCompleted, EventStrangeLoopContextCompacted, EventStrangeLoopPlanDecision, EventStrangeLoopReasoned, EventStrangeLoopStarted, EventStrangeLoopStepCompleted, EventStrangeLoopStepQueued, EventStrangeLoopStepStarted, EventStreamToolCallUpdate, EventToolCallUpdatesBatch, EventToolCompleted, EventToolError, EventToolStarted, INTENT_HINT_EMBED, INTENT_HINT_IMAGE_TO_TEXT, INTENT_HINT_OCR, INTENT_HINT_TEXT_COMPLETION, type InputOptions, type InputOpts, type IntentHint, LOOP_ASSISTANT_OUTPUT_PHASES, type LoopAssistantOutputPhase, type LoopInputIntentHint, type LoopInputParams, type LoopNewOptions, type MessageType, type MethodName, type NegotiatedCapabilities, type NextEnvelope, type NotificationEnvelope, type OnComplete, type OnError, PROTO_VERSION, type PingEnvelope, type PongEnvelope, type PoolConfig, PooledConn, QueryGate, REMOVED_INTENT_HINTS, type ReceiptResponseEnvelope, ReconnectError, type RemovedIntentHint, type RequestEnvelope, type ResponseEnvelope, SSEBroadcaster, type SSEEvent, STREAM_END, type SessionEntry, type SessionMessage, type SessionStore, StaleLoopError, type StatusFrame, StreamCloseFail, type StreamClosePolicy, StreamCloseSoftComplete, type StreamEventPayload, type SubscribeEnvelope, TURN_END_IDLE, TURN_END_STOPPED, TURN_END_STREAM_END, TimeoutError, TimeoutPolicy, TurnBoundary, type TurnChunk, type TurnConfig, TurnEventStats, TurnLifecycleGate, TurnRunner, type UnsubscribeEnvelope, type VerbosityLevel, VerbosityTier, authenticate, bootstrapLoopSession, checkDaemonStatus, classifyEventVerbosity, compactAttachments, compactImageAttachment, connectWithRetries, connectedWebsocket, connectionInitEnvelope, decodeMessage, defaultConfig, defaultPoolConfig, disconnectCauseName, disconnectEnvelope, encodeMessage, extractSootheLoopID, extractThinkingStep, fetchConfigSection, fetchLoopCards, fetchLoopHistory, fetchLoopMessages, fetchSkillsCatalog, idleTimeoutForTurn, inboundNeedsDeliveryAck, inputMessageForLoop, isCompletionEvent, isDaemonLive, isDaemonTurnEndEvent, isSubagentProgressEvent, isTurnEndCustomData, isTurnProgressChunk, isValidVerbosityLevel, loadConfigFromEnv, newLoopInputMessage, newLoopNewMessage, newLoopSubscribeMessage, newRequestID, notificationEnvelope, parseNamespace, pingEnvelope, pongEnvelope, protocol1Rpc, refreshAuthToken, requestDaemonConfigReload, requestDaemonShutdown, requestEnvelope, shouldShow, splitWirePayload, subscribeEnvelope, unsubscribeEnvelope, validateLoopInputIntentHint, waitDaemonReady, waitLoopStatusWithID, waitSubscriptionConfirmed };
package/dist/index.js CHANGED
@@ -86,7 +86,7 @@ import {
86
86
  subscribeEnvelope,
87
87
  unsubscribeEnvelope,
88
88
  validateLoopInputIntentHint
89
- } from "./chunk-A6WGUBQE.js";
89
+ } from "./chunk-NSWLUFSA.js";
90
90
 
91
91
  // src/session.ts
92
92
  async function bootstrapLoopSession(client, resumeLoopId, config, loopNew) {
@@ -289,7 +289,7 @@ async function checkDaemonStatus(client, timeout) {
289
289
  return client.requestResponse("daemon_status", {}, "daemon_status", timeout ?? 5e3);
290
290
  }
291
291
  async function isDaemonLive(wsURL, timeout) {
292
- const { Client: Client2 } = await import("./client-UEBVV6HI.js");
292
+ const { Client: Client2 } = await import("./client-YTWVWNAN.js");
293
293
  const t = timeout ?? 5e3;
294
294
  const client = new Client2(wsURL, defaultConfig());
295
295
  try {
@@ -376,7 +376,7 @@ async function fetchLoopMessages(client, loopID, opts) {
376
376
  );
377
377
  }
378
378
  async function connectedWebsocket(wsUrl, fn, timeoutMs = 3e4) {
379
- const { Client: Client2 } = await import("./client-UEBVV6HI.js");
379
+ const { Client: Client2 } = await import("./client-YTWVWNAN.js");
380
380
  const client = new Client2(wsUrl, defaultConfig());
381
381
  const deadline = Date.now() + timeoutMs;
382
382
  try {
@@ -679,6 +679,8 @@ var EventClassifier = class {
679
679
  if (!eventType) return false;
680
680
  switch (eventType) {
681
681
  case "status.idle":
682
+ case "status.stopped":
683
+ case "soothe.stream.end":
682
684
  case "idle_timeout":
683
685
  case "query_timeout":
684
686
  case "stream_closed":
@@ -872,9 +874,9 @@ var EventClassifier = class {
872
874
  return this.continueResult(content);
873
875
  }
874
876
  }
875
- const [directContent, directOk] = this.messagesModeAssistantContent(data);
876
- if (directOk && this.isSubstantiveAssistantReply(directContent)) {
877
- return this.deliverableResult(directContent, "soothe.protocol.message.direct_model");
877
+ const [unphasedContent, unphasedOk] = this.messagesModeAssistantContent(data);
878
+ if (unphasedOk) {
879
+ return this.continueResult(unphasedContent);
878
880
  }
879
881
  if (hasPayload && rawContent) {
880
882
  if (isTerminalMessageType(msgType) || msgType === "") {
@@ -889,8 +891,8 @@ var EventClassifier = class {
889
891
  }
890
892
  /**
891
893
  * Extracts plain assistant text from mode="messages" events that carry a
892
- * terminal AIMessage without loop-tagged phase metadata (legacy direct_llm turns
893
- * before phase tagging; prefer deliverablePhases including text_completion).
894
+ * terminal AIMessage without loop-tagged phase metadata (prefer named
895
+ * deliverablePhases such as text_completion).
894
896
  */
895
897
  messagesModeAssistantContent(data) {
896
898
  if (!Array.isArray(data) || data.length === 0) return ["", false];
@@ -1381,6 +1383,107 @@ async function compactAttachments(atts, opts) {
1381
1383
  return out;
1382
1384
  }
1383
1385
 
1386
+ // src/appkit/turn_boundary.ts
1387
+ var TURN_END_STREAM_END = STREAM_END;
1388
+ var TURN_END_IDLE = "status.idle";
1389
+ var TURN_END_STOPPED = "status.stopped";
1390
+ var TurnLifecycleGate = class {
1391
+ sawRunning = false;
1392
+ sawStreamPayload = false;
1393
+ sawTurnProgress = false;
1394
+ observe(msg) {
1395
+ const frame = normalizeFrame(msg);
1396
+ if (!frame) return;
1397
+ const typ = String(frame.type ?? "");
1398
+ if (typ === "status") {
1399
+ if (String(frame.state ?? "").trim().toLowerCase() === "running") {
1400
+ this.sawRunning = true;
1401
+ }
1402
+ return;
1403
+ }
1404
+ if (typ === "event") {
1405
+ this.sawStreamPayload = true;
1406
+ const mode = String(frame.mode ?? "");
1407
+ if (isTurnProgressChunk(mode, frame.data)) {
1408
+ this.sawTurnProgress = true;
1409
+ }
1410
+ }
1411
+ }
1412
+ allowStreamEnd() {
1413
+ return this.sawRunning && this.sawTurnProgress;
1414
+ }
1415
+ allowIdleComplete() {
1416
+ return this.sawRunning && this.sawStreamPayload;
1417
+ }
1418
+ };
1419
+ var TurnBoundary = class {
1420
+ gate = new TurnLifecycleGate();
1421
+ ended = false;
1422
+ reason = "";
1423
+ feed(msg) {
1424
+ if (this.ended) return [true, this.reason];
1425
+ this.gate.observe(msg);
1426
+ const frame = normalizeFrame(msg);
1427
+ if (!frame) return [false, ""];
1428
+ const typ = String(frame.type ?? "");
1429
+ if (typ === "status") {
1430
+ const state = String(frame.state ?? "").trim().toLowerCase();
1431
+ if (state === "stopped" && this.gate.sawRunning) {
1432
+ return this.mark(TURN_END_STOPPED);
1433
+ }
1434
+ if (state === "idle" && this.gate.allowIdleComplete()) {
1435
+ return this.mark(TURN_END_IDLE);
1436
+ }
1437
+ return [false, ""];
1438
+ }
1439
+ if (typ === "event") {
1440
+ const mode = String(frame.mode ?? "");
1441
+ if (mode === "custom" && isTurnEndCustomData(frame.data) && this.gate.allowStreamEnd()) {
1442
+ return this.mark(TURN_END_STREAM_END);
1443
+ }
1444
+ }
1445
+ return [false, ""];
1446
+ }
1447
+ mark(reason) {
1448
+ this.ended = true;
1449
+ this.reason = reason;
1450
+ return [true, reason];
1451
+ }
1452
+ };
1453
+ function isDaemonTurnEndEvent(completionEvent) {
1454
+ const e = (completionEvent ?? "").trim();
1455
+ return e === TURN_END_STREAM_END || e === TURN_END_IDLE || e === TURN_END_STOPPED;
1456
+ }
1457
+ function normalizeFrame(msg) {
1458
+ if (!msg || typeof msg !== "object") return null;
1459
+ const m = msg;
1460
+ if (m.type === "next") {
1461
+ const payload = m.payload ?? {};
1462
+ const inner = payload.data;
1463
+ if (inner && typeof inner === "object" && inner.type === "status") {
1464
+ return inner;
1465
+ }
1466
+ if (inner && typeof inner === "object" && inner.mode) {
1467
+ return {
1468
+ type: "event",
1469
+ mode: inner.mode,
1470
+ data: inner.data,
1471
+ namespace: inner.namespace ?? payload.namespace
1472
+ };
1473
+ }
1474
+ if (payload.mode) {
1475
+ return {
1476
+ type: "event",
1477
+ mode: payload.mode,
1478
+ data: payload.data,
1479
+ namespace: payload.namespace
1480
+ };
1481
+ }
1482
+ return null;
1483
+ }
1484
+ return m;
1485
+ }
1486
+
1384
1487
  // src/appkit/turn_runner.ts
1385
1488
  var ErrQueryTimeout = class extends Error {
1386
1489
  constructor() {
@@ -1521,6 +1624,7 @@ var TurnRunner = class {
1521
1624
  }
1522
1625
  let assistantContent = "";
1523
1626
  const startedAt = Date.now();
1627
+ const boundary = new TurnBoundary();
1524
1628
  const idleForTurn = idleTimeoutForTurn(this.cfg, (attachments?.length ?? 0) > 0);
1525
1629
  let idleReject = null;
1526
1630
  const armIdle = () => {
@@ -1613,6 +1717,7 @@ var TurnRunner = class {
1613
1717
  }
1614
1718
  idleRace = armIdle();
1615
1719
  const msg = res.value;
1720
+ const [ended, endReason] = boundary.feed(msg);
1616
1721
  const eventResult = this.classifier.classify(msg, assistantContent);
1617
1722
  if (eventResult.err && eventResult.terminal === 2 /* FailedComplete */) {
1618
1723
  clearIdle();
@@ -1634,7 +1739,7 @@ var TurnRunner = class {
1634
1739
  eventResult,
1635
1740
  assistantContent
1636
1741
  );
1637
- if (deliverable) {
1742
+ if (deliverable && !isDaemonTurnEndEvent(eventResult.completionEvent ?? "")) {
1638
1743
  clearIdle();
1639
1744
  await this.completeTurn(
1640
1745
  sessionID,
@@ -1645,6 +1750,24 @@ var TurnRunner = class {
1645
1750
  );
1646
1751
  return;
1647
1752
  }
1753
+ if (ended) {
1754
+ clearIdle();
1755
+ if (this.classifier.isSubstantiveAssistantReply(assistantContent)) {
1756
+ await this.completeTurn(
1757
+ sessionID,
1758
+ loopID,
1759
+ assistantContent.trim(),
1760
+ startedAt,
1761
+ endReason
1762
+ );
1763
+ return;
1764
+ }
1765
+ const err = new Error(`turn ended (${endReason}) with no assistant content`);
1766
+ await this.persistFailed(sessionID, loopID, err);
1767
+ this.broadcastError(sessionID, err);
1768
+ this.onError?.(sessionID, loopID, err);
1769
+ throw err;
1770
+ }
1648
1771
  }
1649
1772
  } finally {
1650
1773
  clearIdle();
@@ -2231,9 +2354,14 @@ export {
2231
2354
  StaleLoopError,
2232
2355
  StreamCloseFail,
2233
2356
  StreamCloseSoftComplete,
2357
+ TURN_END_IDLE,
2358
+ TURN_END_STOPPED,
2359
+ TURN_END_STREAM_END,
2234
2360
  TimeoutError,
2235
2361
  TimeoutPolicy,
2362
+ TurnBoundary,
2236
2363
  TurnEventStats,
2364
+ TurnLifecycleGate,
2237
2365
  TurnRunner,
2238
2366
  VerbosityTier,
2239
2367
  authenticate,
@@ -2263,6 +2391,7 @@ export {
2263
2391
  inputMessageForLoop,
2264
2392
  isCompletionEvent,
2265
2393
  isDaemonLive,
2394
+ isDaemonTurnEndEvent,
2266
2395
  isSubagentProgressEvent,
2267
2396
  isTurnEndCustomData,
2268
2397
  isTurnProgressChunk,