@mirasoth/soothe-client 0.5.7 → 0.5.9

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
@@ -136,17 +136,11 @@ declare const INTENT_HINT_OCR: "ocr";
136
136
  declare const INTENT_HINT_EMBED: "embed";
137
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
- /** Legacy intent_hint values removed from the daemon wire contract. */
140
- declare const REMOVED_INTENT_HINTS: readonly ["direct_llm", "quiz", "direct_model"];
141
- type RemovedIntentHint = (typeof REMOVED_INTENT_HINTS)[number];
142
139
  /**
143
140
  * 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.
141
+ * (e.g. ``resume_clarification``, ``skill:foo``).
146
142
  */
147
143
  type LoopInputIntentHint = IntentHint | (string & {});
148
- /** Returns an error message when ``hint`` is a removed legacy value; otherwise null. */
149
- declare function validateLoopInputIntentHint(hint: string): string | null;
150
144
  /** Phases emitted on ``mode=messages`` for user-visible loop assistant output. */
151
145
  declare const LOOP_ASSISTANT_OUTPUT_PHASES: readonly ["goal_completion", "quiz", "autonomous_goal", "chitchat", "text_completion", "image_to_text", "ocr", "embed", "plan_direct"];
152
146
  type LoopAssistantOutputPhase = (typeof LOOP_ASSISTANT_OUTPUT_PHASES)[number];
@@ -170,7 +164,7 @@ declare const DEFAULT_CLIENT_CAPABILITIES: string[];
170
164
  declare const CLIENT_VERSION = "0.5.3";
171
165
  type MessageType = "connection_init" | "connection_ack" | "request" | "response" | "notification" | "subscribe" | "next" | "error" | "complete" | "unsubscribe" | "ping" | "pong" | "receipt_response" | "disconnect" | "status";
172
166
  /** 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_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" | "autopilot_top" | "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";
167
+ 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_execution_state_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" | "autopilot_top" | "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
168
  /** Base fields shared by every protocol-1 message. */
175
169
  interface BaseEnvelope {
176
170
  proto: string;
@@ -294,11 +288,8 @@ type DecodedMessage = RequestEnvelope | ResponseEnvelope | NotificationEnvelope
294
288
  interface LoopInputParams {
295
289
  loop_id: string;
296
290
  content: string;
297
- autonomous?: boolean;
298
- max_iterations?: number;
299
291
  preferred_subagent?: string;
300
- /** @deprecated Ignored by daemon; loop_input always uses non-interactive autonomous mode. */
301
- interactive?: boolean;
292
+ intake_scope?: "trivial" | "simple" | "complex";
302
293
  model?: string;
303
294
  model_params?: Record<string, unknown>;
304
295
  attachments?: Record<string, unknown>[];
@@ -450,11 +441,9 @@ declare function isSubagentProgressEvent(eventType: string): boolean;
450
441
  interface InputOptions {
451
442
  /** Subscribed StrangeLoop id (required for loop_input). */
452
443
  loopID?: string;
453
- autonomous?: boolean;
454
- maxIterations?: number;
455
444
  subagent?: string;
456
- /** @deprecated Ignored by daemon; loop_input always uses non-interactive autonomous mode. */
457
- interactive?: boolean;
445
+ /** Forced StrangeLoop intake scope (trivial|simple|complex). */
446
+ intakeScope?: "trivial" | "simple" | "complex";
458
447
  model?: string;
459
448
  modelParams?: Record<string, unknown>;
460
449
  attachments?: Record<string, unknown>[];
@@ -588,9 +577,9 @@ declare class Client extends EventEmitter {
588
577
  private readLiveEventWithTimeout;
589
578
  /**
590
579
  * Sends a `request` envelope and waits for the matching `response` (or
591
- * `error`) correlated by `id`. Returns the `result` object.
580
+ * `error`) correlated by `id`. Returns the `result` object.
592
581
  *
593
- * Multiplexer-aware: registers a pending RPC wait
582
+ * Multiplexer-aware: registers a pending RPC wait
594
583
  * keyed by the request id so that, even when a `receiveMessages()` reader
595
584
  * is concurrently active, the matching `response`/`error` is routed to
596
585
  * this caller instead of being discarded or buffered behind a stream.
@@ -660,8 +649,16 @@ declare class Client extends EventEmitter {
660
649
  getLoop(loopID: string, timeout?: number): Promise<Record<string, unknown>>;
661
650
  /** Requests loop tree and waits for response. */
662
651
  getLoopTree(loopID: string, timeout?: number): Promise<Record<string, unknown>>;
652
+ /** Prunes old checkpoint branches for a loop and waits for response. */
653
+ pruneLoop(loopID: string, keepLatest?: number, timeout?: number): Promise<Record<string, unknown>>;
663
654
  /** Requests loop deletion and waits for response. */
664
655
  deleteLoop(loopID: string, timeout?: number): Promise<Record<string, unknown>>;
656
+ /** Reattaches to an existing loop and waits for response. */
657
+ reattachLoop(loopID: string, timeout?: number): Promise<Record<string, unknown>>;
658
+ /** Detaches from a loop (unsubscribe) and waits for response. */
659
+ detachLoop(loopID: string, timeout?: number): Promise<Record<string, unknown>>;
660
+ /** Fetches the execution state snapshot (plan, step_index, iteration, status). */
661
+ getLoopExecutionState(loopID: string, timeout?: number): Promise<Record<string, unknown>>;
665
662
  /** Requests persisted conversation/activity rows. */
666
663
  sendLoopMessages(loopID: string, limit?: number, offset?: number, includeEvents?: boolean): Promise<void>;
667
664
  /** Requests LangGraph checkpoint channel values. */
@@ -777,7 +774,11 @@ declare class CommandClient {
777
774
  request(method: MethodName, params?: Record<string, unknown>): Promise<Record<string, unknown>>;
778
775
  jobCreate(goal: string, workspace?: string): Promise<Record<string, unknown>>;
779
776
  jobStatus(jobId: string): Promise<Record<string, unknown>>;
777
+ jobPause(jobId: string): Promise<Record<string, unknown>>;
778
+ jobResume(jobId: string): Promise<Record<string, unknown>>;
780
779
  jobCancel(jobId: string): Promise<Record<string, unknown>>;
780
+ jobDag(jobId: string): Promise<Record<string, unknown>>;
781
+ jobGuidance(jobId: string, content: string, goalId?: string): Promise<Record<string, unknown>>;
781
782
  /** Return autopilot scheduler status (running / dreaming / pool). */
782
783
  autopilotStatus(): Promise<Record<string, unknown>>;
783
784
  /** Submit a new autopilot goal (returns goal_id). */
@@ -807,6 +808,8 @@ declare class CommandClient {
807
808
  autopilotTop(includeTerminal?: boolean): Promise<Record<string, unknown>>;
808
809
  cronAdd(text: string, priority?: number): Promise<Record<string, unknown>>;
809
810
  cronList(status?: string): Promise<Record<string, unknown>>;
811
+ cronShow(jobId: string): Promise<Record<string, unknown>>;
812
+ cronCancel(jobId: string): Promise<Record<string, unknown>>;
810
813
  }
811
814
 
812
815
  /**
@@ -1406,6 +1409,7 @@ interface TurnConfig {
1406
1409
  interface InputOpts {
1407
1410
  intentHint?: LoopInputIntentHint;
1408
1411
  preferredSubagent?: string;
1412
+ intakeScope?: "trivial" | "simple" | "complex";
1409
1413
  responseSchema?: Record<string, unknown>;
1410
1414
  responseSchemaName?: string;
1411
1415
  responseSchemaStrict?: boolean;
@@ -1553,8 +1557,6 @@ declare class DaemonSession {
1553
1557
  close(): Promise<void>;
1554
1558
  detach(): Promise<void>;
1555
1559
  sendTurn(text: string, options?: {
1556
- autonomous?: boolean;
1557
- maxIterations?: number;
1558
1560
  preferredSubagent?: string;
1559
1561
  model?: string;
1560
1562
  modelParams?: Record<string, unknown>;
@@ -1626,4 +1628,4 @@ declare class CardProjection {
1626
1628
  apply(data: unknown): boolean;
1627
1629
  }
1628
1630
 
1629
- 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, formatTurnId, frameSeq, frameTurnId, idleTimeoutForTurn, inboundNeedsDeliveryAck, inputMessageForLoop, isCompletionEvent, isDaemonLive, isDaemonTurnEndEvent, isIdleTerminalAllowed, isSubagentProgressEvent, isTurnEndCustomData, isTurnProgressChunk, isTurnTerminalAllowed, isValidVerbosityLevel, loadConfigFromEnv, newLoopInputMessage, newLoopNewMessage, newLoopSubscribeMessage, newRequestID, notificationEnvelope, parseCardCustomPayload, parseNamespace, parseTurnGeneration, pingEnvelope, pongEnvelope, protocol1Rpc, refreshAuthToken, requestDaemonConfigReload, requestDaemonShutdown, requestEnvelope, shouldShow, splitWirePayload, subscribeEnvelope, turnIdsMatch, unsubscribeEnvelope, validateLoopInputIntentHint, waitDaemonReady, waitLoopStatusWithID, waitSubscriptionConfirmed };
1631
+ 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, type ReceiptResponseEnvelope, ReconnectError, 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, formatTurnId, frameSeq, frameTurnId, idleTimeoutForTurn, inboundNeedsDeliveryAck, inputMessageForLoop, isCompletionEvent, isDaemonLive, isDaemonTurnEndEvent, isIdleTerminalAllowed, isSubagentProgressEvent, isTurnEndCustomData, isTurnProgressChunk, isTurnTerminalAllowed, isValidVerbosityLevel, loadConfigFromEnv, newLoopInputMessage, newLoopNewMessage, newLoopSubscribeMessage, newRequestID, notificationEnvelope, parseCardCustomPayload, parseNamespace, parseTurnGeneration, pingEnvelope, pongEnvelope, protocol1Rpc, refreshAuthToken, requestDaemonConfigReload, requestDaemonShutdown, requestEnvelope, shouldShow, splitWirePayload, subscribeEnvelope, turnIdsMatch, unsubscribeEnvelope, waitDaemonReady, waitLoopStatusWithID, waitSubscriptionConfirmed };
package/dist/index.d.ts CHANGED
@@ -136,17 +136,11 @@ declare const INTENT_HINT_OCR: "ocr";
136
136
  declare const INTENT_HINT_EMBED: "embed";
137
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
- /** Legacy intent_hint values removed from the daemon wire contract. */
140
- declare const REMOVED_INTENT_HINTS: readonly ["direct_llm", "quiz", "direct_model"];
141
- type RemovedIntentHint = (typeof REMOVED_INTENT_HINTS)[number];
142
139
  /**
143
140
  * 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.
141
+ * (e.g. ``resume_clarification``, ``skill:foo``).
146
142
  */
147
143
  type LoopInputIntentHint = IntentHint | (string & {});
148
- /** Returns an error message when ``hint`` is a removed legacy value; otherwise null. */
149
- declare function validateLoopInputIntentHint(hint: string): string | null;
150
144
  /** Phases emitted on ``mode=messages`` for user-visible loop assistant output. */
151
145
  declare const LOOP_ASSISTANT_OUTPUT_PHASES: readonly ["goal_completion", "quiz", "autonomous_goal", "chitchat", "text_completion", "image_to_text", "ocr", "embed", "plan_direct"];
152
146
  type LoopAssistantOutputPhase = (typeof LOOP_ASSISTANT_OUTPUT_PHASES)[number];
@@ -170,7 +164,7 @@ declare const DEFAULT_CLIENT_CAPABILITIES: string[];
170
164
  declare const CLIENT_VERSION = "0.5.3";
171
165
  type MessageType = "connection_init" | "connection_ack" | "request" | "response" | "notification" | "subscribe" | "next" | "error" | "complete" | "unsubscribe" | "ping" | "pong" | "receipt_response" | "disconnect" | "status";
172
166
  /** 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_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" | "autopilot_top" | "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";
167
+ 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_execution_state_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" | "autopilot_top" | "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
168
  /** Base fields shared by every protocol-1 message. */
175
169
  interface BaseEnvelope {
176
170
  proto: string;
@@ -294,11 +288,8 @@ type DecodedMessage = RequestEnvelope | ResponseEnvelope | NotificationEnvelope
294
288
  interface LoopInputParams {
295
289
  loop_id: string;
296
290
  content: string;
297
- autonomous?: boolean;
298
- max_iterations?: number;
299
291
  preferred_subagent?: string;
300
- /** @deprecated Ignored by daemon; loop_input always uses non-interactive autonomous mode. */
301
- interactive?: boolean;
292
+ intake_scope?: "trivial" | "simple" | "complex";
302
293
  model?: string;
303
294
  model_params?: Record<string, unknown>;
304
295
  attachments?: Record<string, unknown>[];
@@ -450,11 +441,9 @@ declare function isSubagentProgressEvent(eventType: string): boolean;
450
441
  interface InputOptions {
451
442
  /** Subscribed StrangeLoop id (required for loop_input). */
452
443
  loopID?: string;
453
- autonomous?: boolean;
454
- maxIterations?: number;
455
444
  subagent?: string;
456
- /** @deprecated Ignored by daemon; loop_input always uses non-interactive autonomous mode. */
457
- interactive?: boolean;
445
+ /** Forced StrangeLoop intake scope (trivial|simple|complex). */
446
+ intakeScope?: "trivial" | "simple" | "complex";
458
447
  model?: string;
459
448
  modelParams?: Record<string, unknown>;
460
449
  attachments?: Record<string, unknown>[];
@@ -588,9 +577,9 @@ declare class Client extends EventEmitter {
588
577
  private readLiveEventWithTimeout;
589
578
  /**
590
579
  * Sends a `request` envelope and waits for the matching `response` (or
591
- * `error`) correlated by `id`. Returns the `result` object.
580
+ * `error`) correlated by `id`. Returns the `result` object.
592
581
  *
593
- * Multiplexer-aware: registers a pending RPC wait
582
+ * Multiplexer-aware: registers a pending RPC wait
594
583
  * keyed by the request id so that, even when a `receiveMessages()` reader
595
584
  * is concurrently active, the matching `response`/`error` is routed to
596
585
  * this caller instead of being discarded or buffered behind a stream.
@@ -660,8 +649,16 @@ declare class Client extends EventEmitter {
660
649
  getLoop(loopID: string, timeout?: number): Promise<Record<string, unknown>>;
661
650
  /** Requests loop tree and waits for response. */
662
651
  getLoopTree(loopID: string, timeout?: number): Promise<Record<string, unknown>>;
652
+ /** Prunes old checkpoint branches for a loop and waits for response. */
653
+ pruneLoop(loopID: string, keepLatest?: number, timeout?: number): Promise<Record<string, unknown>>;
663
654
  /** Requests loop deletion and waits for response. */
664
655
  deleteLoop(loopID: string, timeout?: number): Promise<Record<string, unknown>>;
656
+ /** Reattaches to an existing loop and waits for response. */
657
+ reattachLoop(loopID: string, timeout?: number): Promise<Record<string, unknown>>;
658
+ /** Detaches from a loop (unsubscribe) and waits for response. */
659
+ detachLoop(loopID: string, timeout?: number): Promise<Record<string, unknown>>;
660
+ /** Fetches the execution state snapshot (plan, step_index, iteration, status). */
661
+ getLoopExecutionState(loopID: string, timeout?: number): Promise<Record<string, unknown>>;
665
662
  /** Requests persisted conversation/activity rows. */
666
663
  sendLoopMessages(loopID: string, limit?: number, offset?: number, includeEvents?: boolean): Promise<void>;
667
664
  /** Requests LangGraph checkpoint channel values. */
@@ -777,7 +774,11 @@ declare class CommandClient {
777
774
  request(method: MethodName, params?: Record<string, unknown>): Promise<Record<string, unknown>>;
778
775
  jobCreate(goal: string, workspace?: string): Promise<Record<string, unknown>>;
779
776
  jobStatus(jobId: string): Promise<Record<string, unknown>>;
777
+ jobPause(jobId: string): Promise<Record<string, unknown>>;
778
+ jobResume(jobId: string): Promise<Record<string, unknown>>;
780
779
  jobCancel(jobId: string): Promise<Record<string, unknown>>;
780
+ jobDag(jobId: string): Promise<Record<string, unknown>>;
781
+ jobGuidance(jobId: string, content: string, goalId?: string): Promise<Record<string, unknown>>;
781
782
  /** Return autopilot scheduler status (running / dreaming / pool). */
782
783
  autopilotStatus(): Promise<Record<string, unknown>>;
783
784
  /** Submit a new autopilot goal (returns goal_id). */
@@ -807,6 +808,8 @@ declare class CommandClient {
807
808
  autopilotTop(includeTerminal?: boolean): Promise<Record<string, unknown>>;
808
809
  cronAdd(text: string, priority?: number): Promise<Record<string, unknown>>;
809
810
  cronList(status?: string): Promise<Record<string, unknown>>;
811
+ cronShow(jobId: string): Promise<Record<string, unknown>>;
812
+ cronCancel(jobId: string): Promise<Record<string, unknown>>;
810
813
  }
811
814
 
812
815
  /**
@@ -1406,6 +1409,7 @@ interface TurnConfig {
1406
1409
  interface InputOpts {
1407
1410
  intentHint?: LoopInputIntentHint;
1408
1411
  preferredSubagent?: string;
1412
+ intakeScope?: "trivial" | "simple" | "complex";
1409
1413
  responseSchema?: Record<string, unknown>;
1410
1414
  responseSchemaName?: string;
1411
1415
  responseSchemaStrict?: boolean;
@@ -1553,8 +1557,6 @@ declare class DaemonSession {
1553
1557
  close(): Promise<void>;
1554
1558
  detach(): Promise<void>;
1555
1559
  sendTurn(text: string, options?: {
1556
- autonomous?: boolean;
1557
- maxIterations?: number;
1558
1560
  preferredSubagent?: string;
1559
1561
  model?: string;
1560
1562
  modelParams?: Record<string, unknown>;
@@ -1626,4 +1628,4 @@ declare class CardProjection {
1626
1628
  apply(data: unknown): boolean;
1627
1629
  }
1628
1630
 
1629
- 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, formatTurnId, frameSeq, frameTurnId, idleTimeoutForTurn, inboundNeedsDeliveryAck, inputMessageForLoop, isCompletionEvent, isDaemonLive, isDaemonTurnEndEvent, isIdleTerminalAllowed, isSubagentProgressEvent, isTurnEndCustomData, isTurnProgressChunk, isTurnTerminalAllowed, isValidVerbosityLevel, loadConfigFromEnv, newLoopInputMessage, newLoopNewMessage, newLoopSubscribeMessage, newRequestID, notificationEnvelope, parseCardCustomPayload, parseNamespace, parseTurnGeneration, pingEnvelope, pongEnvelope, protocol1Rpc, refreshAuthToken, requestDaemonConfigReload, requestDaemonShutdown, requestEnvelope, shouldShow, splitWirePayload, subscribeEnvelope, turnIdsMatch, unsubscribeEnvelope, validateLoopInputIntentHint, waitDaemonReady, waitLoopStatusWithID, waitSubscriptionConfirmed };
1631
+ 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, type ReceiptResponseEnvelope, ReconnectError, 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, formatTurnId, frameSeq, frameTurnId, idleTimeoutForTurn, inboundNeedsDeliveryAck, inputMessageForLoop, isCompletionEvent, isDaemonLive, isDaemonTurnEndEvent, isIdleTerminalAllowed, isSubagentProgressEvent, isTurnEndCustomData, isTurnProgressChunk, isTurnTerminalAllowed, isValidVerbosityLevel, loadConfigFromEnv, newLoopInputMessage, newLoopNewMessage, newLoopSubscribeMessage, newRequestID, notificationEnvelope, parseCardCustomPayload, parseNamespace, parseTurnGeneration, pingEnvelope, pongEnvelope, protocol1Rpc, refreshAuthToken, requestDaemonConfigReload, requestDaemonShutdown, requestEnvelope, shouldShow, splitWirePayload, subscribeEnvelope, turnIdsMatch, unsubscribeEnvelope, waitDaemonReady, waitLoopStatusWithID, waitSubscriptionConfirmed };
package/dist/index.js CHANGED
@@ -3,7 +3,6 @@ import {
3
3
  Client,
4
4
  ConnectionError,
5
5
  DEFAULT_CLIENT_CAPABILITIES,
6
- DEFAULT_DELIVERABLE_PHASES,
7
6
  DaemonError,
8
7
  DisconnectCause,
9
8
  EventAutopilotGoalCompleted,
@@ -43,13 +42,7 @@ import {
43
42
  EventToolCompleted,
44
43
  EventToolError,
45
44
  EventToolStarted,
46
- INTENT_HINT_EMBED,
47
- INTENT_HINT_IMAGE_TO_TEXT,
48
- INTENT_HINT_OCR,
49
- INTENT_HINT_TEXT_COMPLETION,
50
- LOOP_ASSISTANT_OUTPUT_PHASES,
51
45
  PROTO_VERSION,
52
- REMOVED_INTENT_HINTS,
53
46
  ReconnectError,
54
47
  STREAM_END,
55
48
  StaleLoopError,
@@ -82,9 +75,34 @@ import {
82
75
  shouldShow,
83
76
  splitWirePayload,
84
77
  subscribeEnvelope,
85
- unsubscribeEnvelope,
86
- validateLoopInputIntentHint
87
- } from "./chunk-56Z7SUGW.js";
78
+ unsubscribeEnvelope
79
+ } from "./chunk-GYTZI5RE.js";
80
+
81
+ // src/intent_hints.ts
82
+ var INTENT_HINT_TEXT_COMPLETION = "text_completion";
83
+ var INTENT_HINT_IMAGE_TO_TEXT = "image_to_text";
84
+ var INTENT_HINT_OCR = "ocr";
85
+ var INTENT_HINT_EMBED = "embed";
86
+ var LOOP_ASSISTANT_OUTPUT_PHASES = [
87
+ "goal_completion",
88
+ "quiz",
89
+ "autonomous_goal",
90
+ "chitchat",
91
+ "text_completion",
92
+ "image_to_text",
93
+ "ocr",
94
+ "embed",
95
+ "plan_direct"
96
+ ];
97
+ var DEFAULT_DELIVERABLE_PHASES = /* @__PURE__ */ new Set([
98
+ "quiz",
99
+ "goal_completion",
100
+ "chitchat",
101
+ "text_completion",
102
+ "image_to_text",
103
+ "ocr",
104
+ "embed"
105
+ ]);
88
106
 
89
107
  // src/session.ts
90
108
  async function bootstrapLoopSession(client, resumeLoopId, config, loopNew) {
@@ -218,9 +236,23 @@ var CommandClient = class {
218
236
  async jobStatus(jobId) {
219
237
  return this.request("job_status", { job_id: jobId });
220
238
  }
239
+ async jobPause(jobId) {
240
+ return this.request("job_pause", { job_id: jobId });
241
+ }
242
+ async jobResume(jobId) {
243
+ return this.request("job_resume", { job_id: jobId });
244
+ }
221
245
  async jobCancel(jobId) {
222
246
  return this.request("job_cancel", { job_id: jobId });
223
247
  }
248
+ async jobDag(jobId) {
249
+ return this.request("job_dag", { job_id: jobId });
250
+ }
251
+ async jobGuidance(jobId, content, goalId) {
252
+ const params = { job_id: jobId, content };
253
+ if (goalId) params.goal_id = goalId;
254
+ return this.request("job_guidance", params);
255
+ }
224
256
  /** Return autopilot scheduler status (running / dreaming / pool). */
225
257
  async autopilotStatus() {
226
258
  return this.request("autopilot_status");
@@ -284,6 +316,12 @@ var CommandClient = class {
284
316
  if (status) params.status = status;
285
317
  return this.request("cron_list", params);
286
318
  }
319
+ async cronShow(jobId) {
320
+ return this.request("cron_show", { job_id: jobId });
321
+ }
322
+ async cronCancel(jobId) {
323
+ return this.request("cron_cancel", { job_id: jobId });
324
+ }
287
325
  };
288
326
 
289
327
  // src/helpers.ts
@@ -291,7 +329,7 @@ async function checkDaemonStatus(client, timeout) {
291
329
  return client.requestResponse("daemon_status", {}, "daemon_status", timeout ?? 5e3);
292
330
  }
293
331
  async function isDaemonLive(wsURL, timeout) {
294
- const { Client: Client2 } = await import("./client-CUYIRMFW.js");
332
+ const { Client: Client2 } = await import("./client-NNEEEY7Z.js");
295
333
  const t = timeout ?? 5e3;
296
334
  const client = new Client2(wsURL, defaultConfig());
297
335
  try {
@@ -375,7 +413,7 @@ async function fetchLoopMessages(client, loopID, opts) {
375
413
  );
376
414
  }
377
415
  async function connectedWebsocket(wsUrl, fn, timeoutMs = 3e4) {
378
- const { Client: Client2 } = await import("./client-CUYIRMFW.js");
416
+ const { Client: Client2 } = await import("./client-NNEEEY7Z.js");
379
417
  const client = new Client2(wsUrl, defaultConfig());
380
418
  const deadline = Date.now() + timeoutMs;
381
419
  try {
@@ -1596,13 +1634,10 @@ function inputMessageForLoop(text, loopID, attachments, opts) {
1596
1634
  if (attachments && attachments.length > 0) msg.attachments = attachments;
1597
1635
  if (opts) {
1598
1636
  if (opts.intentHint?.trim()) {
1599
- const hintError = validateLoopInputIntentHint(opts.intentHint);
1600
- if (hintError) {
1601
- throw new Error(hintError);
1602
- }
1603
1637
  msg.intent_hint = opts.intentHint.trim();
1604
1638
  }
1605
1639
  if (opts.preferredSubagent?.trim()) msg.preferred_subagent = opts.preferredSubagent.trim();
1640
+ if (opts.intakeScope?.trim()) msg.intake_scope = opts.intakeScope.trim();
1606
1641
  if (opts.responseSchema && Object.keys(opts.responseSchema).length > 0) {
1607
1642
  msg.response_schema = opts.responseSchema;
1608
1643
  }
@@ -2125,8 +2160,6 @@ var DaemonSession = class {
2125
2160
  if (!this.loopId) throw new Error("No active loop session");
2126
2161
  await this.client.sendInput(text, {
2127
2162
  loopID: this.loopId,
2128
- autonomous: options?.autonomous,
2129
- maxIterations: options?.maxIterations,
2130
2163
  subagent: options?.preferredSubagent,
2131
2164
  model: options?.model,
2132
2165
  modelParams: options?.modelParams,
@@ -2529,7 +2562,6 @@ export {
2529
2562
  PROTO_VERSION,
2530
2563
  PooledConn,
2531
2564
  QueryGate,
2532
- REMOVED_INTENT_HINTS,
2533
2565
  ReconnectError,
2534
2566
  SSEBroadcaster,
2535
2567
  STREAM_END,
@@ -2603,7 +2635,6 @@ export {
2603
2635
  subscribeEnvelope,
2604
2636
  turnIdsMatch,
2605
2637
  unsubscribeEnvelope,
2606
- validateLoopInputIntentHint,
2607
2638
  waitDaemonReady,
2608
2639
  waitLoopStatusWithID,
2609
2640
  waitSubscriptionConfirmed