@mirasoth/soothe-client 0.4.0 → 0.5.0
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/README.md +39 -21
- package/dist/{chunk-U6RMINYV.js → chunk-A6WGUBQE.js} +140 -42
- package/dist/chunk-A6WGUBQE.js.map +1 -0
- package/dist/client-UEBVV6HI.js +7 -0
- package/dist/index.cjs +199 -49
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +102 -49
- package/dist/index.d.ts +102 -49
- package/dist/index.js +72 -17
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-U6RMINYV.js.map +0 -1
- package/dist/client-UNPC32NQ.js +0 -7
- /package/dist/{client-UNPC32NQ.js.map → client-UEBVV6HI.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EventEmitter } from 'node:events';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Custom error types for the Soothe client
|
|
4
|
+
* Custom error types for the Soothe client.
|
|
5
5
|
*/
|
|
6
6
|
/** Represents a WebSocket connection failure. */
|
|
7
7
|
declare class ConnectionError extends Error {
|
|
@@ -11,13 +11,13 @@ declare class ConnectionError extends Error {
|
|
|
11
11
|
constructor(url: string, attempt: number, cause: Error);
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
|
-
* Represents an error reported by the Soothe daemon
|
|
14
|
+
* Represents an error reported by the Soothe daemon.
|
|
15
15
|
*
|
|
16
16
|
* The daemon's structured error object carries a numeric `code` from the
|
|
17
17
|
* reserved ranges, a human-readable `message`, and optional `data`.
|
|
18
18
|
*/
|
|
19
19
|
declare class DaemonError extends Error {
|
|
20
|
-
/** Numeric error code from the
|
|
20
|
+
/** Numeric error code from the daemon error registry. */
|
|
21
21
|
readonly code: number;
|
|
22
22
|
/** The daemon's error message text. */
|
|
23
23
|
readonly daemonMessage: string;
|
|
@@ -32,7 +32,7 @@ declare class TimeoutError extends Error {
|
|
|
32
32
|
constructor(operation: string, duration: string);
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
|
-
* Distinguishes clean vs unclean connection loss
|
|
35
|
+
* Distinguishes clean vs unclean connection loss.
|
|
36
36
|
*
|
|
37
37
|
* A clean drop follows a `disconnect` notification (loops keep running
|
|
38
38
|
* server-side); an unclean drop is a read/write error or a missed pong
|
|
@@ -40,9 +40,9 @@ declare class TimeoutError extends Error {
|
|
|
40
40
|
* event: the cause is emitted exactly once when the connection drops.
|
|
41
41
|
*/
|
|
42
42
|
declare enum DisconnectCause {
|
|
43
|
-
/** Abrupt loss: read/write error or missed pong
|
|
43
|
+
/** Abrupt loss: read/write error or missed pong. */
|
|
44
44
|
Unclean = 0,
|
|
45
|
-
/** Graceful peer-initiated `disconnect` notification
|
|
45
|
+
/** Graceful peer-initiated `disconnect` notification. */
|
|
46
46
|
Clean = 1
|
|
47
47
|
}
|
|
48
48
|
/** Human-readable cause name for logging. */
|
|
@@ -155,22 +155,22 @@ declare const DEFAULT_DELIVERABLE_PHASES: ReadonlySet<string>;
|
|
|
155
155
|
|
|
156
156
|
/**
|
|
157
157
|
* Protocol-1 wire envelope: message types, encode/decode, NDJSON splitting,
|
|
158
|
-
* and factory functions for the Soothe daemon
|
|
158
|
+
* and factory functions for the Soothe daemon.
|
|
159
159
|
*
|
|
160
160
|
* The unified `{proto, type, method, params, id}` envelope combines
|
|
161
161
|
* JSON-RPC 2.0's `method`/`params`/`id` structure with graphql-ws's `type`
|
|
162
162
|
* semantics for message class distinction.
|
|
163
163
|
*/
|
|
164
164
|
|
|
165
|
-
/** Protocol version string
|
|
165
|
+
/** Protocol version string. */
|
|
166
166
|
declare const PROTO_VERSION = "1";
|
|
167
167
|
/** Default client capabilities declared in the connection_init handshake. */
|
|
168
168
|
declare const DEFAULT_CLIENT_CAPABILITIES: string[];
|
|
169
169
|
/** Client version reported in the connection_init handshake. */
|
|
170
|
-
declare const CLIENT_VERSION = "0.
|
|
170
|
+
declare const CLIENT_VERSION = "0.5.0";
|
|
171
171
|
type MessageType = "connection_init" | "connection_ack" | "request" | "response" | "notification" | "subscribe" | "next" | "error" | "complete" | "unsubscribe" | "ping" | "pong" | "receipt_response" | "disconnect" | "status";
|
|
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" | "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";
|
|
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";
|
|
174
174
|
/** Base fields shared by every protocol-1 message. */
|
|
175
175
|
interface BaseEnvelope {
|
|
176
176
|
proto: string;
|
|
@@ -194,7 +194,7 @@ interface NotificationEnvelope extends BaseEnvelope {
|
|
|
194
194
|
type: "notification";
|
|
195
195
|
method: MethodName;
|
|
196
196
|
params?: Record<string, unknown>;
|
|
197
|
-
/** Optional receipt id for delivery confirmation
|
|
197
|
+
/** Optional receipt id for delivery confirmation. */
|
|
198
198
|
receipt?: string;
|
|
199
199
|
}
|
|
200
200
|
/** Start a subscription stream (events arrive as `next`). */
|
|
@@ -276,9 +276,9 @@ interface DisconnectEnvelope extends BaseEnvelope {
|
|
|
276
276
|
type: "disconnect";
|
|
277
277
|
}
|
|
278
278
|
/**
|
|
279
|
-
* A daemon status frame. `status` is a defined protocol-1 top-level type
|
|
280
|
-
*
|
|
281
|
-
*
|
|
279
|
+
* A daemon status frame. `status` is a defined protocol-1 top-level type:
|
|
280
|
+
* it passes through the daemon's legacy→`next` translator unchanged, so it
|
|
281
|
+
* is NOT wrapped in a `next` envelope.
|
|
282
282
|
*/
|
|
283
283
|
interface StatusFrame extends BaseEnvelope {
|
|
284
284
|
type: "status";
|
|
@@ -370,7 +370,7 @@ declare function splitWirePayload(data: string): string[];
|
|
|
370
370
|
* both shapes.
|
|
371
371
|
*/
|
|
372
372
|
declare function extractSootheLoopID(msg: unknown): [string, boolean];
|
|
373
|
-
/** Generates a new UUID correlation ID
|
|
373
|
+
/** Generates a new UUID correlation ID. */
|
|
374
374
|
declare function newRequestID(): string;
|
|
375
375
|
/** Creates a `loop_input` notification envelope. */
|
|
376
376
|
declare function newLoopInputMessage(loopID: string, content: string): NotificationEnvelope;
|
|
@@ -389,13 +389,16 @@ declare function newLoopSubscribeMessage(loopID: string, verbosity: string, stre
|
|
|
389
389
|
*/
|
|
390
390
|
|
|
391
391
|
declare const EventPlanCreated = "soothe.cognition.plan.created";
|
|
392
|
-
declare const
|
|
393
|
-
declare const
|
|
394
|
-
declare const
|
|
395
|
-
declare const
|
|
396
|
-
declare const
|
|
397
|
-
declare const
|
|
398
|
-
declare const
|
|
392
|
+
declare const EventExplorerStarted = "soothe.subagent.explorer.started";
|
|
393
|
+
declare const EventExplorerMilestone = "soothe.subagent.explorer.milestone";
|
|
394
|
+
declare const EventExplorerStepCompleted = "soothe.subagent.explorer.step.completed";
|
|
395
|
+
declare const EventExplorerCompleted = "soothe.subagent.explorer.completed";
|
|
396
|
+
declare const EventDeepResearchStarted = "soothe.subagent.deep_research.started";
|
|
397
|
+
declare const EventDeepResearchProgress = "soothe.subagent.deep_research.progress";
|
|
398
|
+
declare const EventDeepResearchStepCompleted = "soothe.subagent.deep_research.step.completed";
|
|
399
|
+
declare const EventDeepResearchGatherSummary = "soothe.subagent.deep_research.gather.summary";
|
|
400
|
+
declare const EventDeepResearchCrawlSummary = "soothe.subagent.deep_research.crawl.summary";
|
|
401
|
+
declare const EventDeepResearchCompleted = "soothe.subagent.deep_research.completed";
|
|
399
402
|
declare const EventReplayComplete = "replay_complete";
|
|
400
403
|
declare const EventLoopReattachedWire = "loop_reattached";
|
|
401
404
|
declare const EventCardReplayBegin = "card.replay_begin";
|
|
@@ -438,7 +441,7 @@ declare function isCompletionEvent(eventType: string): boolean;
|
|
|
438
441
|
declare function isSubagentProgressEvent(eventType: string): boolean;
|
|
439
442
|
|
|
440
443
|
/**
|
|
441
|
-
* Client manages a WebSocket session with the Soothe daemon
|
|
444
|
+
* Client manages a WebSocket session with the Soothe daemon.
|
|
442
445
|
*
|
|
443
446
|
* After close(), a new Client must be created to reconnect. The connection
|
|
444
447
|
* begins with a bidirectional connection_init/connection_ack handshake; no
|
|
@@ -524,8 +527,8 @@ declare class Client extends EventEmitter {
|
|
|
524
527
|
*/
|
|
525
528
|
private _signalDisconnect;
|
|
526
529
|
/**
|
|
527
|
-
* Re-dials the daemon and re-handshakes after a connection drop
|
|
528
|
-
*
|
|
530
|
+
* Re-dials the daemon and re-handshakes after a connection drop.
|
|
531
|
+
* Does not re-establish loop subscriptions; follow with
|
|
529
532
|
* `reattachAndProbe()` to resume a loop session. The caller should invoke
|
|
530
533
|
* this after the `'disconnected'` event fires. Reuses the same Client,
|
|
531
534
|
* resetting the drop signal and multiplexer.
|
|
@@ -540,7 +543,7 @@ declare class Client extends EventEmitter {
|
|
|
540
543
|
* Returns a `StaleLoopError` when the probe fails; callers should fall back
|
|
541
544
|
* to a fresh `loop_new` bootstrap.
|
|
542
545
|
*
|
|
543
|
-
*
|
|
546
|
+
* Note: connection-level readiness is the handshake's readiness_state
|
|
544
547
|
* (+ daemon_status); loop_get is a loop-scoped probe only, not a readiness
|
|
545
548
|
* probe.
|
|
546
549
|
*/
|
|
@@ -587,9 +590,9 @@ declare class Client extends EventEmitter {
|
|
|
587
590
|
private readLiveEventWithTimeout;
|
|
588
591
|
/**
|
|
589
592
|
* Sends a `request` envelope and waits for the matching `response` (or
|
|
590
|
-
|
|
593
|
+
* `error`) correlated by `id`. Returns the `result` object.
|
|
591
594
|
*
|
|
592
|
-
|
|
595
|
+
* Multiplexer-aware: registers a pending RPC wait
|
|
593
596
|
* keyed by the request id so that, even when a `receiveMessages()` reader
|
|
594
597
|
* is concurrently active, the matching `response`/`error` is routed to
|
|
595
598
|
* this caller instead of being discarded or buffered behind a stream.
|
|
@@ -669,7 +672,7 @@ declare class Client extends EventEmitter {
|
|
|
669
672
|
sendLoopStateUpdate(loopID: string, values: Record<string, unknown>, asNode?: string): Promise<void>;
|
|
670
673
|
/** Requests display card ledger snapshot. */
|
|
671
674
|
sendLoopCardsFetch(loopID: string): Promise<void>;
|
|
672
|
-
/** Requests the full loop history
|
|
675
|
+
/** Requests the full loop history. */
|
|
673
676
|
sendLoopHistoryFetch(loopID: string): Promise<void>;
|
|
674
677
|
/** Requests MCP server status. */
|
|
675
678
|
sendMCPStatus(): Promise<void>;
|
|
@@ -711,6 +714,32 @@ declare class Client extends EventEmitter {
|
|
|
711
714
|
getJobDag(jobId: string, timeout?: number): Promise<Record<string, unknown>>;
|
|
712
715
|
/** Sends guidance to a job or specific goal. */
|
|
713
716
|
sendJobGuidance(jobId: string, text: string, goalId?: string, timeout?: number): Promise<Record<string, unknown>>;
|
|
717
|
+
/** Return autopilot scheduler status (running / dreaming / pool). */
|
|
718
|
+
autopilotStatus(timeout?: number): Promise<Record<string, unknown>>;
|
|
719
|
+
/** Submit a new autopilot goal (returns goal_id). */
|
|
720
|
+
autopilotSubmit(description: string, opts?: {
|
|
721
|
+
priority?: number;
|
|
722
|
+
workspace?: string;
|
|
723
|
+
timeout?: number;
|
|
724
|
+
}): Promise<Record<string, unknown>>;
|
|
725
|
+
/** List all goals (including non-root children). */
|
|
726
|
+
autopilotListGoals(timeout?: number): Promise<Record<string, unknown>>;
|
|
727
|
+
/** Fetch one goal by id. */
|
|
728
|
+
autopilotGetGoal(goalId: string, timeout?: number): Promise<Record<string, unknown>>;
|
|
729
|
+
/** Cancel a goal and its non-terminal descendants. */
|
|
730
|
+
autopilotCancelGoal(goalId: string, timeout?: number): Promise<Record<string, unknown>>;
|
|
731
|
+
/** Cancel every open (non-terminal) goal. */
|
|
732
|
+
autopilotCancelAll(timeout?: number): Promise<Record<string, unknown>>;
|
|
733
|
+
/** Exit dreaming mode and resume scheduling. */
|
|
734
|
+
autopilotWake(timeout?: number): Promise<Record<string, unknown>>;
|
|
735
|
+
/** Force dreaming mode. */
|
|
736
|
+
autopilotDream(timeout?: number): Promise<Record<string, unknown>>;
|
|
737
|
+
/** Resume a suspended or blocked goal. */
|
|
738
|
+
autopilotResume(goalId: string, timeout?: number): Promise<Record<string, unknown>>;
|
|
739
|
+
/** List root goals only (jobs). Prefer createJob / getJobStatus for job control. */
|
|
740
|
+
autopilotListJobs(timeout?: number): Promise<Record<string, unknown>>;
|
|
741
|
+
/** Get a root job with DAG snapshot. Prefer getJobStatus / getJobDag. */
|
|
742
|
+
autopilotGetJob(jobId: string, timeout?: number): Promise<Record<string, unknown>>;
|
|
714
743
|
/** Subscribes to autopilot worker events. */
|
|
715
744
|
autopilotSubscribe(timeout?: number): Promise<string>;
|
|
716
745
|
/** Unsubscribes from autopilot worker events. */
|
|
@@ -733,7 +762,7 @@ declare class Client extends EventEmitter {
|
|
|
733
762
|
|
|
734
763
|
/**
|
|
735
764
|
* Ephemeral one-shot RPC client for jobs / cron / autopilot.
|
|
736
|
-
* Mirrors Python AsyncCommandClient / CommandClient
|
|
765
|
+
* Mirrors Python AsyncCommandClient / CommandClient.
|
|
737
766
|
*/
|
|
738
767
|
|
|
739
768
|
declare class CommandClient {
|
|
@@ -750,12 +779,37 @@ declare class CommandClient {
|
|
|
750
779
|
jobCreate(goal: string, workspace?: string): Promise<Record<string, unknown>>;
|
|
751
780
|
jobStatus(jobId: string): Promise<Record<string, unknown>>;
|
|
752
781
|
jobCancel(jobId: string): Promise<Record<string, unknown>>;
|
|
782
|
+
/** Return autopilot scheduler status (running / dreaming / pool). */
|
|
783
|
+
autopilotStatus(): Promise<Record<string, unknown>>;
|
|
784
|
+
/** Submit a new autopilot goal (returns goal_id). */
|
|
785
|
+
autopilotSubmit(description: string, opts?: {
|
|
786
|
+
priority?: number;
|
|
787
|
+
workspace?: string;
|
|
788
|
+
}): Promise<Record<string, unknown>>;
|
|
789
|
+
/** List all goals (including non-root children). */
|
|
790
|
+
autopilotListGoals(): Promise<Record<string, unknown>>;
|
|
791
|
+
/** Fetch one goal by id. */
|
|
792
|
+
autopilotGetGoal(goalId: string): Promise<Record<string, unknown>>;
|
|
793
|
+
/** Cancel a goal and its non-terminal descendants. */
|
|
794
|
+
autopilotCancelGoal(goalId: string): Promise<Record<string, unknown>>;
|
|
795
|
+
/** Cancel every open (non-terminal) goal. */
|
|
796
|
+
autopilotCancelAll(): Promise<Record<string, unknown>>;
|
|
797
|
+
/** Exit dreaming mode and resume scheduling. */
|
|
798
|
+
autopilotWake(): Promise<Record<string, unknown>>;
|
|
799
|
+
/** Force dreaming mode. */
|
|
800
|
+
autopilotDream(): Promise<Record<string, unknown>>;
|
|
801
|
+
/** Resume a suspended or blocked goal. */
|
|
802
|
+
autopilotResume(goalId: string): Promise<Record<string, unknown>>;
|
|
803
|
+
/** List root goals only (jobs). Prefer job* for job control. */
|
|
804
|
+
autopilotListJobs(): Promise<Record<string, unknown>>;
|
|
805
|
+
/** Get a root job with DAG snapshot. Prefer jobStatus / getJobDag. */
|
|
806
|
+
autopilotGetJob(jobId: string): Promise<Record<string, unknown>>;
|
|
753
807
|
cronAdd(text: string, priority?: number): Promise<Record<string, unknown>>;
|
|
754
808
|
cronList(status?: string): Promise<Record<string, unknown>>;
|
|
755
809
|
}
|
|
756
810
|
|
|
757
811
|
/**
|
|
758
|
-
* Convenience RPC helper functions for the Soothe client
|
|
812
|
+
* Convenience RPC helper functions for the Soothe client.
|
|
759
813
|
*/
|
|
760
814
|
|
|
761
815
|
/** Checks daemon status via RPC. */
|
|
@@ -770,7 +824,7 @@ declare function fetchSkillsCatalog(client: Client, timeout?: number): Promise<R
|
|
|
770
824
|
declare function fetchConfigSection(client: Client, section: string, timeout?: number): Promise<Record<string, unknown>>;
|
|
771
825
|
/** Requests daemon config reload via RPC. */
|
|
772
826
|
declare function requestDaemonConfigReload(client: Client, timeout?: number): Promise<Record<string, unknown>>;
|
|
773
|
-
/** Requests loop history
|
|
827
|
+
/** Requests loop history and waits for the response. */
|
|
774
828
|
declare function fetchLoopHistory(client: Client, loopID: string, timeout?: number): Promise<Record<string, unknown>>;
|
|
775
829
|
/** Submits credentials for daemon-side authentication and waits for the response. */
|
|
776
830
|
declare function authenticate(client: Client, accessKey: string, secretKey: string, timeout?: number): Promise<Record<string, unknown>>;
|
|
@@ -835,7 +889,7 @@ declare function isTurnProgressChunk(mode: string, data: unknown): boolean;
|
|
|
835
889
|
declare function inboundNeedsDeliveryAck(event: Record<string, unknown>): boolean;
|
|
836
890
|
|
|
837
891
|
/**
|
|
838
|
-
* Persistence seam for appkit
|
|
892
|
+
* Persistence seam for appkit.
|
|
839
893
|
*
|
|
840
894
|
* SessionStore abstracts per-application storage: the session↔loop-id mapping
|
|
841
895
|
* that ConnectionPool consults to decide bootstrap vs reattach, and the
|
|
@@ -896,7 +950,7 @@ interface SessionStore {
|
|
|
896
950
|
}
|
|
897
951
|
|
|
898
952
|
/**
|
|
899
|
-
* SSE-style pub/sub fan-out for appkit
|
|
953
|
+
* SSE-style pub/sub fan-out for appkit.
|
|
900
954
|
*
|
|
901
955
|
* Generic, string-keyed pub/sub for SSE-style event delivery. The
|
|
902
956
|
* application-agnostic successor to a domain-keyed broadcaster: applications
|
|
@@ -944,7 +998,7 @@ declare class SSEBroadcaster {
|
|
|
944
998
|
}
|
|
945
999
|
|
|
946
1000
|
/**
|
|
947
|
-
* Thinking-step extraction for appkit
|
|
1001
|
+
* Thinking-step extraction for appkit.
|
|
948
1002
|
*
|
|
949
1003
|
* Maps an allowlisted progress event to one structured UI line. Free-form
|
|
950
1004
|
* streams (tokens, reports, reasoning) are excluded. Ported from the Go
|
|
@@ -960,18 +1014,17 @@ declare const DEFAULT_THINKING_STEP_EVENTS: ReadonlySet<string>;
|
|
|
960
1014
|
declare function extractThinkingStep(eventType: string, data: Record<string, unknown> | null, allow?: ReadonlySet<string>): [string, boolean];
|
|
961
1015
|
|
|
962
1016
|
/**
|
|
963
|
-
* Event classifier for appkit
|
|
1017
|
+
* Event classifier for appkit.
|
|
964
1018
|
*
|
|
965
1019
|
* Maps a stream of decoded daemon events into deliverable/streaming/terminal
|
|
966
|
-
* outcomes, keyed on (namespace, mode, phase)
|
|
967
|
-
*
|
|
968
|
-
*
|
|
969
|
-
* constants to configuration.
|
|
1020
|
+
* outcomes, keyed on (namespace, mode, phase). The app-agnostic successor to
|
|
1021
|
+
* product-specific ProcessChatEvent helpers, with the deliverable phase set
|
|
1022
|
+
* promoted from hardcoded constants to configuration.
|
|
970
1023
|
*
|
|
971
1024
|
* Event shape: a protocol-1 `next` envelope carries
|
|
972
1025
|
* `{type:"next", payload:{namespace, mode, data, loop_id}}`. The daemon
|
|
973
1026
|
* wraps legacy free-form frames as `{payload:{namespace, mode:<orig type>,
|
|
974
|
-
* data:<orig frame>}}
|
|
1027
|
+
* data:<orig frame>}}`. The classifier inspects the payload's
|
|
975
1028
|
* `mode`/`data`/`namespace` and the inner message's `phase`/`type`/`content`.
|
|
976
1029
|
*/
|
|
977
1030
|
|
|
@@ -1069,7 +1122,7 @@ declare class EventClassifier {
|
|
|
1069
1122
|
}
|
|
1070
1123
|
|
|
1071
1124
|
/**
|
|
1072
|
-
* Single-flight query gate for appkit
|
|
1125
|
+
* Single-flight query gate for appkit.
|
|
1073
1126
|
*
|
|
1074
1127
|
* Enforces single-flight query execution per session id and the
|
|
1075
1128
|
* cancel-before-context ordering: when a query is cancelled, the daemon is
|
|
@@ -1117,7 +1170,7 @@ declare class QueryGate {
|
|
|
1117
1170
|
|
|
1118
1171
|
/**
|
|
1119
1172
|
* ManagedClient — the subset of the core Client that appkit's ConnectionPool
|
|
1120
|
-
* and TurnRunner depend on
|
|
1173
|
+
* and TurnRunner depend on.
|
|
1121
1174
|
*
|
|
1122
1175
|
* The concrete `Client` satisfies it; tests supply a fake. Defining it as an
|
|
1123
1176
|
* interface lets appkit be unit-tested without a live WebSocket daemon.
|
|
@@ -1163,7 +1216,7 @@ type ClientFactory = (url: string, config?: Config) => ManagedClient;
|
|
|
1163
1216
|
type BootstrapFunc = (client: ManagedClient, workspaceID: string, userID: string, config?: Config) => Promise<string>;
|
|
1164
1217
|
|
|
1165
1218
|
/**
|
|
1166
|
-
* Per-session connection pool for appkit
|
|
1219
|
+
* Per-session connection pool for appkit.
|
|
1167
1220
|
*
|
|
1168
1221
|
* Manages a pool of daemon connections, one active per session. Reuses an
|
|
1169
1222
|
* active connection when still live, otherwise bootstraps a fresh loop
|
|
@@ -1257,7 +1310,7 @@ declare class ConnectionPool {
|
|
|
1257
1310
|
}
|
|
1258
1311
|
|
|
1259
1312
|
/**
|
|
1260
|
-
* Attachment image compaction for appkit
|
|
1313
|
+
* Attachment image compaction for appkit.
|
|
1261
1314
|
*
|
|
1262
1315
|
* When `sharp` is installed (optionalDependency), oversized image/* payloads
|
|
1263
1316
|
* are downscaled. Without sharp, attachments pass through unchanged.
|
|
@@ -1280,13 +1333,13 @@ declare function compactImageAttachment(mimeType: string, dataB64: string, opts?
|
|
|
1280
1333
|
declare function compactAttachments(atts: Record<string, unknown>[], opts?: CompactImageOptions | null): Promise<Record<string, unknown>[]>;
|
|
1281
1334
|
|
|
1282
1335
|
/**
|
|
1283
|
-
* Turn runner for appkit
|
|
1336
|
+
* Turn runner for appkit.
|
|
1284
1337
|
*
|
|
1285
1338
|
* Executes one query turn end-to-end: acquire a pooled connection, enforce
|
|
1286
1339
|
* single-flight, send loop_input, consume the event stream, classify events,
|
|
1287
1340
|
* resolve the deliverable, persist the reply, and broadcast completion.
|
|
1288
1341
|
*
|
|
1289
|
-
* Supports
|
|
1342
|
+
* Supports lifecycle knobs: idle timeout, soft-complete
|
|
1290
1343
|
* policies, attachment compaction, and stream-close soft-complete.
|
|
1291
1344
|
*/
|
|
1292
1345
|
|
|
@@ -1493,4 +1546,4 @@ declare class DaemonSession {
|
|
|
1493
1546
|
}): AsyncGenerator<TurnChunk>;
|
|
1494
1547
|
}
|
|
1495
1548
|
|
|
1496
|
-
export { type Attachment, type BaseEnvelope, CLIENT_VERSION, type ChatEventResult, ChatEventTerminal, type ClassifierConfig, Client, CommandClient, type CompactImageOptions, type CompleteEnvelope, type Config, type ConnectionAckEnvelope, ConnectionError, type ConnectionInitEnvelope, ConnectionPool, DEFAULT_CLIENT_CAPABILITIES, DEFAULT_DELIVERABLE_PHASES, DEFAULT_POST_IDLE_DRAIN_MS, DEFAULT_THINKING_STEP_EVENTS, DaemonError, DaemonSession, type DaemonSessionOptions, type DecodedMessage, DisconnectCause, type DisconnectEnvelope, ErrIdleTimeout, ErrPoolExhausted, ErrQueryBusy, ErrQueryTimeout, type ErrorEnvelope, EventAutopilotGoalCompleted, EventAutopilotGoalCreated, EventAutopilotGoalProgress, EventAutopilotGoalStatus, EventAutopilotWorkerAssigned, EventAutopilotWorkerUnassigned, EventCardCreated, EventCardReplayBegin, EventCardReplayEnd, EventClassifier,
|
|
1549
|
+
export { type Attachment, type BaseEnvelope, CLIENT_VERSION, type ChatEventResult, ChatEventTerminal, type ClassifierConfig, Client, CommandClient, type CompactImageOptions, type CompleteEnvelope, type Config, type ConnectionAckEnvelope, ConnectionError, type ConnectionInitEnvelope, ConnectionPool, DEFAULT_CLIENT_CAPABILITIES, DEFAULT_DELIVERABLE_PHASES, DEFAULT_POST_IDLE_DRAIN_MS, DEFAULT_THINKING_STEP_EVENTS, DaemonError, DaemonSession, type DaemonSessionOptions, type DecodedMessage, DisconnectCause, type DisconnectEnvelope, ErrIdleTimeout, ErrPoolExhausted, ErrQueryBusy, ErrQueryTimeout, type ErrorEnvelope, EventAutopilotGoalCompleted, EventAutopilotGoalCreated, EventAutopilotGoalProgress, EventAutopilotGoalStatus, EventAutopilotWorkerAssigned, EventAutopilotWorkerUnassigned, EventCardCreated, EventCardReplayBegin, EventCardReplayEnd, EventClassifier, EventDeepResearchCompleted, EventDeepResearchCrawlSummary, EventDeepResearchGatherSummary, EventDeepResearchProgress, EventDeepResearchStarted, EventDeepResearchStepCompleted, EventExplorerCompleted, EventExplorerMilestone, EventExplorerStarted, EventExplorerStepCompleted, EventFinalReport, EventGeneralFailed, EventLoopReattachedWire, EventMessageReceived, EventMessageSent, EventPlanCreated, EventReplayComplete, EventStrangeLoopCompleted, EventStrangeLoopContextCompacted, EventStrangeLoopPlanDecision, EventStrangeLoopReasoned, EventStrangeLoopStarted, EventStrangeLoopStepCompleted, EventStrangeLoopStepQueued, EventStrangeLoopStepStarted, EventStreamToolCallUpdate, EventToolCallUpdatesBatch, EventToolCompleted, EventToolError, EventToolStarted, INTENT_HINT_EMBED, INTENT_HINT_IMAGE_TO_TEXT, INTENT_HINT_OCR, INTENT_HINT_TEXT_COMPLETION, type InputOptions, type InputOpts, type IntentHint, LOOP_ASSISTANT_OUTPUT_PHASES, type LoopAssistantOutputPhase, type LoopInputIntentHint, type LoopInputParams, type LoopNewOptions, type MessageType, type MethodName, type NegotiatedCapabilities, type NextEnvelope, type NotificationEnvelope, type OnComplete, type OnError, PROTO_VERSION, type PingEnvelope, type PongEnvelope, type PoolConfig, PooledConn, QueryGate, REMOVED_INTENT_HINTS, type ReceiptResponseEnvelope, ReconnectError, type RemovedIntentHint, type RequestEnvelope, type ResponseEnvelope, SSEBroadcaster, type SSEEvent, STREAM_END, type SessionEntry, type SessionMessage, type SessionStore, StaleLoopError, type StatusFrame, StreamCloseFail, type StreamClosePolicy, StreamCloseSoftComplete, type StreamEventPayload, type SubscribeEnvelope, TimeoutError, TimeoutPolicy, type TurnChunk, type TurnConfig, TurnEventStats, TurnRunner, type UnsubscribeEnvelope, type VerbosityLevel, VerbosityTier, authenticate, bootstrapLoopSession, checkDaemonStatus, classifyEventVerbosity, compactAttachments, compactImageAttachment, connectWithRetries, connectedWebsocket, connectionInitEnvelope, decodeMessage, defaultConfig, defaultPoolConfig, disconnectCauseName, disconnectEnvelope, encodeMessage, extractSootheLoopID, extractThinkingStep, fetchConfigSection, fetchLoopCards, fetchLoopHistory, fetchLoopMessages, fetchSkillsCatalog, idleTimeoutForTurn, inboundNeedsDeliveryAck, inputMessageForLoop, isCompletionEvent, isDaemonLive, isSubagentProgressEvent, isTurnEndCustomData, isTurnProgressChunk, isValidVerbosityLevel, loadConfigFromEnv, newLoopInputMessage, newLoopNewMessage, newLoopSubscribeMessage, newRequestID, notificationEnvelope, parseNamespace, pingEnvelope, pongEnvelope, protocol1Rpc, refreshAuthToken, requestDaemonConfigReload, requestDaemonShutdown, requestEnvelope, shouldShow, splitWirePayload, subscribeEnvelope, unsubscribeEnvelope, validateLoopInputIntentHint, waitDaemonReady, waitLoopStatusWithID, waitSubscriptionConfirmed };
|