@mirasoth/soothe-client 0.5.4 → 0.5.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/index.d.cts CHANGED
@@ -170,7 +170,7 @@ declare const DEFAULT_CLIENT_CAPABILITIES: string[];
170
170
  declare const CLIENT_VERSION = "0.5.3";
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
- 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";
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_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";
174
174
  /** Base fields shared by every protocol-1 message. */
175
175
  interface BaseEnvelope {
176
176
  proto: string;
@@ -668,8 +668,6 @@ declare class Client extends EventEmitter {
668
668
  sendLoopStateGet(loopID: string): Promise<void>;
669
669
  /** Applies partial checkpoint values. */
670
670
  sendLoopStateUpdate(loopID: string, values: Record<string, unknown>, asNode?: string): Promise<void>;
671
- /** Requests display card ledger snapshot. */
672
- sendLoopCardsFetch(loopID: string): Promise<void>;
673
671
  /** Requests the full loop history. */
674
672
  sendLoopHistoryFetch(loopID: string): Promise<void>;
675
673
  /** Requests MCP server status. */
@@ -686,8 +684,6 @@ declare class Client extends EventEmitter {
686
684
  getLoopState(loopID: string, timeout?: number): Promise<Record<string, unknown>>;
687
685
  /** Updates loop state and waits for response. */
688
686
  updateLoopState(loopID: string, values: Record<string, unknown>, asNode?: string, timeout?: number): Promise<Record<string, unknown>>;
689
- /** Requests display cards and waits for response. */
690
- fetchLoopCards(loopID: string, timeout?: number): Promise<Record<string, unknown>>;
691
687
  /** Requests MCP status and waits for response. */
692
688
  getMCPStatus(timeout?: number): Promise<Record<string, unknown>>;
693
689
  /** Requests loop history and waits for response. */
@@ -828,8 +824,6 @@ declare function fetchLoopHistory(client: Client, loopID: string, timeout?: numb
828
824
  declare function authenticate(client: Client, accessKey: string, secretKey: string, timeout?: number): Promise<Record<string, unknown>>;
829
825
  /** Refreshes the daemon-side auth token and waits for the response. */
830
826
  declare function refreshAuthToken(client: Client, refreshToken: string, timeout?: number): Promise<Record<string, unknown>>;
831
- /** Fetch bound display-card snapshot for a loop. */
832
- declare function fetchLoopCards(client: Client, loopID: string, timeout?: number): Promise<Record<string, unknown>>;
833
827
  /** Fetch persisted conversation/activity rows for a loop. */
834
828
  declare function fetchLoopMessages(client: Client, loopID: string, opts?: {
835
829
  limit?: number;
@@ -889,7 +883,7 @@ declare function inboundNeedsDeliveryAck(event: Record<string, unknown>): boolea
889
883
  /**
890
884
  * Persistence seam for appkit.
891
885
  *
892
- * SessionStore abstracts per-application storage: the session↔loop-id mapping
886
+ * LoopSessionStore abstracts per-application storage: the session↔loop-id mapping
893
887
  * that ConnectionPool consults to decide bootstrap vs reattach, and the
894
888
  * message rows TurnRunner writes back when a turn completes. Applications
895
889
  * implement this against their own store (Postgres, Redis, in-memory, …).
@@ -897,7 +891,7 @@ declare function inboundNeedsDeliveryAck(event: Record<string, unknown>): boolea
897
891
  * Implementations must be safe for concurrent use.
898
892
  */
899
893
  /** Persisted mapping between an application session id and the daemon loop id. */
900
- interface SessionEntry {
894
+ interface LoopSessionEntry {
901
895
  workspaceID: string;
902
896
  sessionID: string;
903
897
  loopID: string;
@@ -926,9 +920,9 @@ interface SessionMessage {
926
920
  * loop id once bootstrapped. TurnRunner persists the final assistant reply
927
921
  * and error rows via appendMessage.
928
922
  */
929
- interface SessionStore {
923
+ interface LoopSessionStore {
930
924
  /** Returns the persisted entry for sessionID, or null if no record exists. */
931
- getSession(sessionID: string): Promise<SessionEntry | null>;
925
+ getSession(sessionID: string): Promise<LoopSessionEntry | null>;
932
926
  /** Persists a new session↔loop mapping. */
933
927
  createSession(workspaceID: string, sessionID: string, loopID: string, sessionType: string): Promise<void>;
934
928
  /** Stamps the session's last-used timestamp. */
@@ -1219,7 +1213,7 @@ type BootstrapFunc = (client: ManagedClient, workspaceID: string, userID: string
1219
1213
  * active connection when still live, otherwise bootstraps a fresh loop
1220
1214
  * (loop_new + subscribe) or reattaches an existing one (loop_reattach +
1221
1215
  * subscribe + reattachAndProbe). Persistence of session↔loop mappings is
1222
- * abstracted behind SessionStore.
1216
+ * abstracted behind LoopSessionStore.
1223
1217
  *
1224
1218
  * The app-agnostic successor to triarch's SoothePoolManager connection
1225
1219
  * mechanics.
@@ -1274,7 +1268,7 @@ declare class ConnectionPool {
1274
1268
  * defaultPoolConfig is used; if scfg is null, defaultConfig is used; nil
1275
1269
  * factory/bootstrap fall back to the defaults.
1276
1270
  */
1277
- constructor(url: string, store: SessionStore, cfg?: PoolConfig | null, scfg?: Config | null, factory?: ClientFactory | null);
1271
+ constructor(url: string, store: LoopSessionStore, cfg?: PoolConfig | null, scfg?: Config | null, factory?: ClientFactory | null);
1278
1272
  /** Overrides the loop bootstrap function (useful for test fakes). */
1279
1273
  withBootstrap(f: BootstrapFunc): ConnectionPool;
1280
1274
  /**
@@ -1411,7 +1405,7 @@ declare class TurnRunner {
1411
1405
  private buildInput;
1412
1406
  private onComplete;
1413
1407
  private onError;
1414
- constructor(pool: ConnectionPool, gate: QueryGate, classifier: EventClassifier, store: SessionStore, broadcaster: SSEBroadcaster | null, cfg: TurnConfig);
1408
+ constructor(pool: ConnectionPool, gate: QueryGate, classifier: EventClassifier, store: LoopSessionStore, broadcaster: SSEBroadcaster | null, cfg: TurnConfig);
1415
1409
  withInputBuilder(f: typeof inputMessageForLoop): TurnRunner;
1416
1410
  withOnComplete(f: OnComplete): TurnRunner;
1417
1411
  withOnError(f: OnError): TurnRunner;
@@ -1545,12 +1539,6 @@ declare class DaemonSession {
1545
1539
  private withRpcLock;
1546
1540
  private ensureRpcConnected;
1547
1541
  listLoops(_limit?: number): Promise<Record<string, unknown>>;
1548
- fetchLoopCards(loopId: string): Promise<{
1549
- cards: unknown[];
1550
- seq: number;
1551
- contextTokens: number;
1552
- success: boolean;
1553
- }>;
1554
1542
  fetchLoopHistory(loopId: string): Promise<{
1555
1543
  goals: unknown[];
1556
1544
  liveCards: unknown[];
@@ -1606,4 +1594,4 @@ declare class CardProjection {
1606
1594
  apply(data: unknown): boolean;
1607
1595
  }
1608
1596
 
1609
- export { type Attachment, type BaseEnvelope, CLIENT_VERSION, CardProjection, type CardWireDict, 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, EventCardFinalized, EventCardReplayBegin, EventCardReplayEnd, EventCardUpdated, EventClassifier, EventDeepResearchCompleted, EventDeepResearchCrawlSummary, EventDeepResearchGatherSummary, EventDeepResearchProgress, EventDeepResearchStarted, EventDeepResearchStepCompleted, 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 ParsedCardFrame, 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, parseCardCustomPayload, parseNamespace, pingEnvelope, pongEnvelope, protocol1Rpc, refreshAuthToken, requestDaemonConfigReload, requestDaemonShutdown, requestEnvelope, shouldShow, splitWirePayload, subscribeEnvelope, unsubscribeEnvelope, validateLoopInputIntentHint, waitDaemonReady, waitLoopStatusWithID, waitSubscriptionConfirmed };
1597
+ export { type Attachment, type BaseEnvelope, CLIENT_VERSION, CardProjection, type CardWireDict, 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, EventCardFinalized, EventCardReplayBegin, EventCardReplayEnd, EventCardUpdated, EventClassifier, EventDeepResearchCompleted, EventDeepResearchCrawlSummary, EventDeepResearchGatherSummary, EventDeepResearchProgress, EventDeepResearchStarted, EventDeepResearchStepCompleted, 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 LoopSessionEntry, type LoopSessionStore, type MessageType, type MethodName, type NegotiatedCapabilities, type NextEnvelope, type NotificationEnvelope, type OnComplete, type OnError, PROTO_VERSION, type ParsedCardFrame, 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 SessionMessage, 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, fetchLoopHistory, fetchLoopMessages, fetchSkillsCatalog, idleTimeoutForTurn, inboundNeedsDeliveryAck, inputMessageForLoop, isCompletionEvent, isDaemonLive, isDaemonTurnEndEvent, isSubagentProgressEvent, isTurnEndCustomData, isTurnProgressChunk, isValidVerbosityLevel, loadConfigFromEnv, newLoopInputMessage, newLoopNewMessage, newLoopSubscribeMessage, newRequestID, notificationEnvelope, parseCardCustomPayload, parseNamespace, pingEnvelope, pongEnvelope, protocol1Rpc, refreshAuthToken, requestDaemonConfigReload, requestDaemonShutdown, requestEnvelope, shouldShow, splitWirePayload, subscribeEnvelope, unsubscribeEnvelope, validateLoopInputIntentHint, waitDaemonReady, waitLoopStatusWithID, waitSubscriptionConfirmed };
package/dist/index.d.ts CHANGED
@@ -170,7 +170,7 @@ declare const DEFAULT_CLIENT_CAPABILITIES: string[];
170
170
  declare const CLIENT_VERSION = "0.5.3";
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
- 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";
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_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";
174
174
  /** Base fields shared by every protocol-1 message. */
175
175
  interface BaseEnvelope {
176
176
  proto: string;
@@ -668,8 +668,6 @@ declare class Client extends EventEmitter {
668
668
  sendLoopStateGet(loopID: string): Promise<void>;
669
669
  /** Applies partial checkpoint values. */
670
670
  sendLoopStateUpdate(loopID: string, values: Record<string, unknown>, asNode?: string): Promise<void>;
671
- /** Requests display card ledger snapshot. */
672
- sendLoopCardsFetch(loopID: string): Promise<void>;
673
671
  /** Requests the full loop history. */
674
672
  sendLoopHistoryFetch(loopID: string): Promise<void>;
675
673
  /** Requests MCP server status. */
@@ -686,8 +684,6 @@ declare class Client extends EventEmitter {
686
684
  getLoopState(loopID: string, timeout?: number): Promise<Record<string, unknown>>;
687
685
  /** Updates loop state and waits for response. */
688
686
  updateLoopState(loopID: string, values: Record<string, unknown>, asNode?: string, timeout?: number): Promise<Record<string, unknown>>;
689
- /** Requests display cards and waits for response. */
690
- fetchLoopCards(loopID: string, timeout?: number): Promise<Record<string, unknown>>;
691
687
  /** Requests MCP status and waits for response. */
692
688
  getMCPStatus(timeout?: number): Promise<Record<string, unknown>>;
693
689
  /** Requests loop history and waits for response. */
@@ -828,8 +824,6 @@ declare function fetchLoopHistory(client: Client, loopID: string, timeout?: numb
828
824
  declare function authenticate(client: Client, accessKey: string, secretKey: string, timeout?: number): Promise<Record<string, unknown>>;
829
825
  /** Refreshes the daemon-side auth token and waits for the response. */
830
826
  declare function refreshAuthToken(client: Client, refreshToken: string, timeout?: number): Promise<Record<string, unknown>>;
831
- /** Fetch bound display-card snapshot for a loop. */
832
- declare function fetchLoopCards(client: Client, loopID: string, timeout?: number): Promise<Record<string, unknown>>;
833
827
  /** Fetch persisted conversation/activity rows for a loop. */
834
828
  declare function fetchLoopMessages(client: Client, loopID: string, opts?: {
835
829
  limit?: number;
@@ -889,7 +883,7 @@ declare function inboundNeedsDeliveryAck(event: Record<string, unknown>): boolea
889
883
  /**
890
884
  * Persistence seam for appkit.
891
885
  *
892
- * SessionStore abstracts per-application storage: the session↔loop-id mapping
886
+ * LoopSessionStore abstracts per-application storage: the session↔loop-id mapping
893
887
  * that ConnectionPool consults to decide bootstrap vs reattach, and the
894
888
  * message rows TurnRunner writes back when a turn completes. Applications
895
889
  * implement this against their own store (Postgres, Redis, in-memory, …).
@@ -897,7 +891,7 @@ declare function inboundNeedsDeliveryAck(event: Record<string, unknown>): boolea
897
891
  * Implementations must be safe for concurrent use.
898
892
  */
899
893
  /** Persisted mapping between an application session id and the daemon loop id. */
900
- interface SessionEntry {
894
+ interface LoopSessionEntry {
901
895
  workspaceID: string;
902
896
  sessionID: string;
903
897
  loopID: string;
@@ -926,9 +920,9 @@ interface SessionMessage {
926
920
  * loop id once bootstrapped. TurnRunner persists the final assistant reply
927
921
  * and error rows via appendMessage.
928
922
  */
929
- interface SessionStore {
923
+ interface LoopSessionStore {
930
924
  /** Returns the persisted entry for sessionID, or null if no record exists. */
931
- getSession(sessionID: string): Promise<SessionEntry | null>;
925
+ getSession(sessionID: string): Promise<LoopSessionEntry | null>;
932
926
  /** Persists a new session↔loop mapping. */
933
927
  createSession(workspaceID: string, sessionID: string, loopID: string, sessionType: string): Promise<void>;
934
928
  /** Stamps the session's last-used timestamp. */
@@ -1219,7 +1213,7 @@ type BootstrapFunc = (client: ManagedClient, workspaceID: string, userID: string
1219
1213
  * active connection when still live, otherwise bootstraps a fresh loop
1220
1214
  * (loop_new + subscribe) or reattaches an existing one (loop_reattach +
1221
1215
  * subscribe + reattachAndProbe). Persistence of session↔loop mappings is
1222
- * abstracted behind SessionStore.
1216
+ * abstracted behind LoopSessionStore.
1223
1217
  *
1224
1218
  * The app-agnostic successor to triarch's SoothePoolManager connection
1225
1219
  * mechanics.
@@ -1274,7 +1268,7 @@ declare class ConnectionPool {
1274
1268
  * defaultPoolConfig is used; if scfg is null, defaultConfig is used; nil
1275
1269
  * factory/bootstrap fall back to the defaults.
1276
1270
  */
1277
- constructor(url: string, store: SessionStore, cfg?: PoolConfig | null, scfg?: Config | null, factory?: ClientFactory | null);
1271
+ constructor(url: string, store: LoopSessionStore, cfg?: PoolConfig | null, scfg?: Config | null, factory?: ClientFactory | null);
1278
1272
  /** Overrides the loop bootstrap function (useful for test fakes). */
1279
1273
  withBootstrap(f: BootstrapFunc): ConnectionPool;
1280
1274
  /**
@@ -1411,7 +1405,7 @@ declare class TurnRunner {
1411
1405
  private buildInput;
1412
1406
  private onComplete;
1413
1407
  private onError;
1414
- constructor(pool: ConnectionPool, gate: QueryGate, classifier: EventClassifier, store: SessionStore, broadcaster: SSEBroadcaster | null, cfg: TurnConfig);
1408
+ constructor(pool: ConnectionPool, gate: QueryGate, classifier: EventClassifier, store: LoopSessionStore, broadcaster: SSEBroadcaster | null, cfg: TurnConfig);
1415
1409
  withInputBuilder(f: typeof inputMessageForLoop): TurnRunner;
1416
1410
  withOnComplete(f: OnComplete): TurnRunner;
1417
1411
  withOnError(f: OnError): TurnRunner;
@@ -1545,12 +1539,6 @@ declare class DaemonSession {
1545
1539
  private withRpcLock;
1546
1540
  private ensureRpcConnected;
1547
1541
  listLoops(_limit?: number): Promise<Record<string, unknown>>;
1548
- fetchLoopCards(loopId: string): Promise<{
1549
- cards: unknown[];
1550
- seq: number;
1551
- contextTokens: number;
1552
- success: boolean;
1553
- }>;
1554
1542
  fetchLoopHistory(loopId: string): Promise<{
1555
1543
  goals: unknown[];
1556
1544
  liveCards: unknown[];
@@ -1606,4 +1594,4 @@ declare class CardProjection {
1606
1594
  apply(data: unknown): boolean;
1607
1595
  }
1608
1596
 
1609
- export { type Attachment, type BaseEnvelope, CLIENT_VERSION, CardProjection, type CardWireDict, 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, EventCardFinalized, EventCardReplayBegin, EventCardReplayEnd, EventCardUpdated, EventClassifier, EventDeepResearchCompleted, EventDeepResearchCrawlSummary, EventDeepResearchGatherSummary, EventDeepResearchProgress, EventDeepResearchStarted, EventDeepResearchStepCompleted, 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 ParsedCardFrame, 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, parseCardCustomPayload, parseNamespace, pingEnvelope, pongEnvelope, protocol1Rpc, refreshAuthToken, requestDaemonConfigReload, requestDaemonShutdown, requestEnvelope, shouldShow, splitWirePayload, subscribeEnvelope, unsubscribeEnvelope, validateLoopInputIntentHint, waitDaemonReady, waitLoopStatusWithID, waitSubscriptionConfirmed };
1597
+ export { type Attachment, type BaseEnvelope, CLIENT_VERSION, CardProjection, type CardWireDict, 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, EventCardFinalized, EventCardReplayBegin, EventCardReplayEnd, EventCardUpdated, EventClassifier, EventDeepResearchCompleted, EventDeepResearchCrawlSummary, EventDeepResearchGatherSummary, EventDeepResearchProgress, EventDeepResearchStarted, EventDeepResearchStepCompleted, 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 LoopSessionEntry, type LoopSessionStore, type MessageType, type MethodName, type NegotiatedCapabilities, type NextEnvelope, type NotificationEnvelope, type OnComplete, type OnError, PROTO_VERSION, type ParsedCardFrame, 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 SessionMessage, 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, fetchLoopHistory, fetchLoopMessages, fetchSkillsCatalog, idleTimeoutForTurn, inboundNeedsDeliveryAck, inputMessageForLoop, isCompletionEvent, isDaemonLive, isDaemonTurnEndEvent, isSubagentProgressEvent, isTurnEndCustomData, isTurnProgressChunk, isValidVerbosityLevel, loadConfigFromEnv, newLoopInputMessage, newLoopNewMessage, newLoopSubscribeMessage, newRequestID, notificationEnvelope, parseCardCustomPayload, parseNamespace, pingEnvelope, pongEnvelope, protocol1Rpc, refreshAuthToken, requestDaemonConfigReload, requestDaemonShutdown, requestEnvelope, shouldShow, splitWirePayload, subscribeEnvelope, unsubscribeEnvelope, validateLoopInputIntentHint, waitDaemonReady, waitLoopStatusWithID, waitSubscriptionConfirmed };
package/dist/index.js CHANGED
@@ -84,7 +84,7 @@ import {
84
84
  subscribeEnvelope,
85
85
  unsubscribeEnvelope,
86
86
  validateLoopInputIntentHint
87
- } from "./chunk-B5FIL7O4.js";
87
+ } from "./chunk-XEZBHENR.js";
88
88
 
89
89
  // src/session.ts
90
90
  async function bootstrapLoopSession(client, resumeLoopId, config, loopNew) {
@@ -287,7 +287,7 @@ async function checkDaemonStatus(client, timeout) {
287
287
  return client.requestResponse("daemon_status", {}, "daemon_status", timeout ?? 5e3);
288
288
  }
289
289
  async function isDaemonLive(wsURL, timeout) {
290
- const { Client: Client2 } = await import("./client-BOND6P6S.js");
290
+ const { Client: Client2 } = await import("./client-TQNJNIH2.js");
291
291
  const t = timeout ?? 5e3;
292
292
  const client = new Client2(wsURL, defaultConfig());
293
293
  try {
@@ -361,9 +361,6 @@ async function refreshAuthToken(client, refreshToken, timeout) {
361
361
  timeout ?? 15e3
362
362
  );
363
363
  }
364
- async function fetchLoopCards(client, loopID, timeout) {
365
- return client.fetchLoopCards(loopID, timeout);
366
- }
367
364
  async function fetchLoopMessages(client, loopID, opts) {
368
365
  return client.getLoopMessages(
369
366
  loopID,
@@ -374,7 +371,7 @@ async function fetchLoopMessages(client, loopID, opts) {
374
371
  );
375
372
  }
376
373
  async function connectedWebsocket(wsUrl, fn, timeoutMs = 3e4) {
377
- const { Client: Client2 } = await import("./client-BOND6P6S.js");
374
+ const { Client: Client2 } = await import("./client-TQNJNIH2.js");
378
375
  const client = new Client2(wsUrl, defaultConfig());
379
376
  const deadline = Date.now() + timeoutMs;
380
377
  try {
@@ -2113,25 +2110,6 @@ var DaemonSession = class {
2113
2110
  return this.rpcClient.listLoops(15e3);
2114
2111
  });
2115
2112
  }
2116
- async fetchLoopCards(loopId) {
2117
- const lid = String(loopId || "").trim();
2118
- if (!lid) return { cards: [], seq: 0, contextTokens: 0, success: false };
2119
- return this.withRpcLock(async () => {
2120
- await this.ensureRpcConnected();
2121
- try {
2122
- const resp = await this.rpcClient.fetchLoopCards(lid, 3e4);
2123
- const rawCards = resp.cards;
2124
- return {
2125
- cards: Array.isArray(rawCards) ? rawCards : [],
2126
- seq: Number(resp.seq ?? 0),
2127
- contextTokens: typeof resp.context_tokens === "number" && resp.context_tokens >= 0 ? resp.context_tokens : 0,
2128
- success: true
2129
- };
2130
- } catch {
2131
- return { cards: [], seq: 0, contextTokens: 0, success: false };
2132
- }
2133
- });
2134
- }
2135
2113
  async fetchLoopHistory(loopId) {
2136
2114
  const lid = String(loopId || "").trim();
2137
2115
  if (!lid) {
@@ -2456,7 +2434,6 @@ export {
2456
2434
  extractSootheLoopID,
2457
2435
  extractThinkingStep,
2458
2436
  fetchConfigSection,
2459
- fetchLoopCards,
2460
2437
  fetchLoopHistory,
2461
2438
  fetchLoopMessages,
2462
2439
  fetchSkillsCatalog,