@mirasoth/soothe-client 0.5.5 → 0.5.8
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/{chunk-XEZBHENR.js → chunk-CFGENQFE.js} +14 -57
- package/dist/chunk-CFGENQFE.js.map +1 -0
- package/dist/client-57KMIFVI.js +7 -0
- package/dist/index.cjs +206 -89
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +42 -22
- package/dist/index.d.ts +42 -22
- package/dist/index.js +188 -40
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-XEZBHENR.js.map +0 -1
- package/dist/client-TQNJNIH2.js +0 -7
- /package/dist/{client-TQNJNIH2.js.map → client-57KMIFVI.js.map} +0 -0
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``).
|
|
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" | "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_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
|
-
|
|
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
|
-
/**
|
|
457
|
-
|
|
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>[];
|
|
@@ -734,6 +723,11 @@ declare class Client extends EventEmitter {
|
|
|
734
723
|
autopilotListJobs(timeout?: number): Promise<Record<string, unknown>>;
|
|
735
724
|
/** Get a root job with DAG snapshot. Prefer getJobStatus / getJobDag. */
|
|
736
725
|
autopilotGetJob(jobId: string, timeout?: number): Promise<Record<string, unknown>>;
|
|
726
|
+
/** Jobs → goals → loops snapshot for CLI top. */
|
|
727
|
+
autopilotTop(timeoutOrOptions?: number | {
|
|
728
|
+
includeTerminal?: boolean;
|
|
729
|
+
timeout?: number;
|
|
730
|
+
}): Promise<Record<string, unknown>>;
|
|
737
731
|
/** Subscribes to autopilot worker events. */
|
|
738
732
|
autopilotSubscribe(timeout?: number): Promise<string>;
|
|
739
733
|
/** Unsubscribes from autopilot worker events. */
|
|
@@ -798,6 +792,8 @@ declare class CommandClient {
|
|
|
798
792
|
autopilotListJobs(): Promise<Record<string, unknown>>;
|
|
799
793
|
/** Get a root job with DAG snapshot. Prefer jobStatus / getJobDag. */
|
|
800
794
|
autopilotGetJob(jobId: string): Promise<Record<string, unknown>>;
|
|
795
|
+
/** Jobs → goals → loops snapshot for CLI top. */
|
|
796
|
+
autopilotTop(includeTerminal?: boolean): Promise<Record<string, unknown>>;
|
|
801
797
|
cronAdd(text: string, priority?: number): Promise<Record<string, unknown>>;
|
|
802
798
|
cronList(status?: string): Promise<Record<string, unknown>>;
|
|
803
799
|
}
|
|
@@ -880,6 +876,30 @@ declare function isTurnProgressChunk(mode: string, data: unknown): boolean;
|
|
|
880
876
|
/** True when the client should bump delivery_ack sequence for this frame. */
|
|
881
877
|
declare function inboundNeedsDeliveryAck(event: Record<string, unknown>): boolean;
|
|
882
878
|
|
|
879
|
+
/**
|
|
880
|
+
* Turn / stream boundary helpers (`turn_id` / `seq`).
|
|
881
|
+
* Used by DaemonSession for demuxing concurrent goal turns.
|
|
882
|
+
*/
|
|
883
|
+
declare function formatTurnId(loopId: string, generation: number): string;
|
|
884
|
+
declare function parseTurnGeneration(turnId: string | null | undefined): number | null;
|
|
885
|
+
declare function frameTurnId(frame: Record<string, unknown> | null | undefined): string | null;
|
|
886
|
+
declare function frameSeq(frame: Record<string, unknown> | null | undefined): number | null;
|
|
887
|
+
/** Absent ids never match. */
|
|
888
|
+
declare function turnIdsMatch(expected: string | null | undefined, candidate: string | null | undefined): boolean;
|
|
889
|
+
declare function isTurnTerminalAllowed(opts: {
|
|
890
|
+
expectedTurnId: string | null | undefined;
|
|
891
|
+
frameTurnId: string | null | undefined;
|
|
892
|
+
queryStarted: boolean;
|
|
893
|
+
turnProgressSeen: boolean;
|
|
894
|
+
}): boolean;
|
|
895
|
+
declare function isIdleTerminalAllowed(opts: {
|
|
896
|
+
expectedTurnId: string | null | undefined;
|
|
897
|
+
frameTurnId: string | null | undefined;
|
|
898
|
+
queryStarted: boolean;
|
|
899
|
+
turnProgressSeen: boolean;
|
|
900
|
+
cancellationSeen?: boolean;
|
|
901
|
+
}): boolean;
|
|
902
|
+
|
|
883
903
|
/**
|
|
884
904
|
* Persistence seam for appkit.
|
|
885
905
|
*
|
|
@@ -1375,6 +1395,7 @@ interface TurnConfig {
|
|
|
1375
1395
|
interface InputOpts {
|
|
1376
1396
|
intentHint?: LoopInputIntentHint;
|
|
1377
1397
|
preferredSubagent?: string;
|
|
1398
|
+
intakeScope?: "trivial" | "simple" | "complex";
|
|
1378
1399
|
responseSchema?: Record<string, unknown>;
|
|
1379
1400
|
responseSchemaName?: string;
|
|
1380
1401
|
responseSchemaStrict?: boolean;
|
|
@@ -1431,11 +1452,12 @@ declare const TURN_END_IDLE = "status.idle";
|
|
|
1431
1452
|
declare const TURN_END_STOPPED = "status.stopped";
|
|
1432
1453
|
declare class TurnLifecycleGate {
|
|
1433
1454
|
sawRunning: boolean;
|
|
1434
|
-
sawStreamPayload: boolean;
|
|
1435
1455
|
sawTurnProgress: boolean;
|
|
1456
|
+
expectedTurnId: string | null;
|
|
1457
|
+
cancellationSeen: boolean;
|
|
1436
1458
|
observe(msg: unknown): void;
|
|
1437
|
-
allowStreamEnd(): boolean;
|
|
1438
|
-
allowIdleComplete(): boolean;
|
|
1459
|
+
allowStreamEnd(frameTurn: string | null): boolean;
|
|
1460
|
+
allowIdleComplete(frameTurn: string | null): boolean;
|
|
1439
1461
|
}
|
|
1440
1462
|
declare class TurnBoundary {
|
|
1441
1463
|
readonly gate: TurnLifecycleGate;
|
|
@@ -1521,8 +1543,6 @@ declare class DaemonSession {
|
|
|
1521
1543
|
close(): Promise<void>;
|
|
1522
1544
|
detach(): Promise<void>;
|
|
1523
1545
|
sendTurn(text: string, options?: {
|
|
1524
|
-
autonomous?: boolean;
|
|
1525
|
-
maxIterations?: number;
|
|
1526
1546
|
preferredSubagent?: string;
|
|
1527
1547
|
model?: string;
|
|
1528
1548
|
modelParams?: Record<string, unknown>;
|
|
@@ -1594,4 +1614,4 @@ declare class CardProjection {
|
|
|
1594
1614
|
apply(data: unknown): boolean;
|
|
1595
1615
|
}
|
|
1596
1616
|
|
|
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,
|
|
1617
|
+
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``).
|
|
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" | "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_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
|
-
|
|
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
|
-
/**
|
|
457
|
-
|
|
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>[];
|
|
@@ -734,6 +723,11 @@ declare class Client extends EventEmitter {
|
|
|
734
723
|
autopilotListJobs(timeout?: number): Promise<Record<string, unknown>>;
|
|
735
724
|
/** Get a root job with DAG snapshot. Prefer getJobStatus / getJobDag. */
|
|
736
725
|
autopilotGetJob(jobId: string, timeout?: number): Promise<Record<string, unknown>>;
|
|
726
|
+
/** Jobs → goals → loops snapshot for CLI top. */
|
|
727
|
+
autopilotTop(timeoutOrOptions?: number | {
|
|
728
|
+
includeTerminal?: boolean;
|
|
729
|
+
timeout?: number;
|
|
730
|
+
}): Promise<Record<string, unknown>>;
|
|
737
731
|
/** Subscribes to autopilot worker events. */
|
|
738
732
|
autopilotSubscribe(timeout?: number): Promise<string>;
|
|
739
733
|
/** Unsubscribes from autopilot worker events. */
|
|
@@ -798,6 +792,8 @@ declare class CommandClient {
|
|
|
798
792
|
autopilotListJobs(): Promise<Record<string, unknown>>;
|
|
799
793
|
/** Get a root job with DAG snapshot. Prefer jobStatus / getJobDag. */
|
|
800
794
|
autopilotGetJob(jobId: string): Promise<Record<string, unknown>>;
|
|
795
|
+
/** Jobs → goals → loops snapshot for CLI top. */
|
|
796
|
+
autopilotTop(includeTerminal?: boolean): Promise<Record<string, unknown>>;
|
|
801
797
|
cronAdd(text: string, priority?: number): Promise<Record<string, unknown>>;
|
|
802
798
|
cronList(status?: string): Promise<Record<string, unknown>>;
|
|
803
799
|
}
|
|
@@ -880,6 +876,30 @@ declare function isTurnProgressChunk(mode: string, data: unknown): boolean;
|
|
|
880
876
|
/** True when the client should bump delivery_ack sequence for this frame. */
|
|
881
877
|
declare function inboundNeedsDeliveryAck(event: Record<string, unknown>): boolean;
|
|
882
878
|
|
|
879
|
+
/**
|
|
880
|
+
* Turn / stream boundary helpers (`turn_id` / `seq`).
|
|
881
|
+
* Used by DaemonSession for demuxing concurrent goal turns.
|
|
882
|
+
*/
|
|
883
|
+
declare function formatTurnId(loopId: string, generation: number): string;
|
|
884
|
+
declare function parseTurnGeneration(turnId: string | null | undefined): number | null;
|
|
885
|
+
declare function frameTurnId(frame: Record<string, unknown> | null | undefined): string | null;
|
|
886
|
+
declare function frameSeq(frame: Record<string, unknown> | null | undefined): number | null;
|
|
887
|
+
/** Absent ids never match. */
|
|
888
|
+
declare function turnIdsMatch(expected: string | null | undefined, candidate: string | null | undefined): boolean;
|
|
889
|
+
declare function isTurnTerminalAllowed(opts: {
|
|
890
|
+
expectedTurnId: string | null | undefined;
|
|
891
|
+
frameTurnId: string | null | undefined;
|
|
892
|
+
queryStarted: boolean;
|
|
893
|
+
turnProgressSeen: boolean;
|
|
894
|
+
}): boolean;
|
|
895
|
+
declare function isIdleTerminalAllowed(opts: {
|
|
896
|
+
expectedTurnId: string | null | undefined;
|
|
897
|
+
frameTurnId: string | null | undefined;
|
|
898
|
+
queryStarted: boolean;
|
|
899
|
+
turnProgressSeen: boolean;
|
|
900
|
+
cancellationSeen?: boolean;
|
|
901
|
+
}): boolean;
|
|
902
|
+
|
|
883
903
|
/**
|
|
884
904
|
* Persistence seam for appkit.
|
|
885
905
|
*
|
|
@@ -1375,6 +1395,7 @@ interface TurnConfig {
|
|
|
1375
1395
|
interface InputOpts {
|
|
1376
1396
|
intentHint?: LoopInputIntentHint;
|
|
1377
1397
|
preferredSubagent?: string;
|
|
1398
|
+
intakeScope?: "trivial" | "simple" | "complex";
|
|
1378
1399
|
responseSchema?: Record<string, unknown>;
|
|
1379
1400
|
responseSchemaName?: string;
|
|
1380
1401
|
responseSchemaStrict?: boolean;
|
|
@@ -1431,11 +1452,12 @@ declare const TURN_END_IDLE = "status.idle";
|
|
|
1431
1452
|
declare const TURN_END_STOPPED = "status.stopped";
|
|
1432
1453
|
declare class TurnLifecycleGate {
|
|
1433
1454
|
sawRunning: boolean;
|
|
1434
|
-
sawStreamPayload: boolean;
|
|
1435
1455
|
sawTurnProgress: boolean;
|
|
1456
|
+
expectedTurnId: string | null;
|
|
1457
|
+
cancellationSeen: boolean;
|
|
1436
1458
|
observe(msg: unknown): void;
|
|
1437
|
-
allowStreamEnd(): boolean;
|
|
1438
|
-
allowIdleComplete(): boolean;
|
|
1459
|
+
allowStreamEnd(frameTurn: string | null): boolean;
|
|
1460
|
+
allowIdleComplete(frameTurn: string | null): boolean;
|
|
1439
1461
|
}
|
|
1440
1462
|
declare class TurnBoundary {
|
|
1441
1463
|
readonly gate: TurnLifecycleGate;
|
|
@@ -1521,8 +1543,6 @@ declare class DaemonSession {
|
|
|
1521
1543
|
close(): Promise<void>;
|
|
1522
1544
|
detach(): Promise<void>;
|
|
1523
1545
|
sendTurn(text: string, options?: {
|
|
1524
|
-
autonomous?: boolean;
|
|
1525
|
-
maxIterations?: number;
|
|
1526
1546
|
preferredSubagent?: string;
|
|
1527
1547
|
model?: string;
|
|
1528
1548
|
modelParams?: Record<string, unknown>;
|
|
@@ -1594,4 +1614,4 @@ declare class CardProjection {
|
|
|
1594
1614
|
apply(data: unknown): boolean;
|
|
1595
1615
|
}
|
|
1596
1616
|
|
|
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,
|
|
1617
|
+
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 };
|