@mirasoth/soothe-client 0.5.2 → 0.5.4
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-NSWLUFSA.js → chunk-B5FIL7O4.js} +14 -15
- package/dist/{chunk-NSWLUFSA.js.map → chunk-B5FIL7O4.js.map} +1 -1
- package/dist/client-BOND6P6S.js +7 -0
- package/dist/index.cjs +97 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +45 -9
- package/dist/index.d.ts +45 -9
- package/dist/index.js +86 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/client-YTWVWNAN.js +0 -7
- /package/dist/{client-YTWVWNAN.js.map → client-BOND6P6S.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -167,7 +167,7 @@ declare const PROTO_VERSION = "1";
|
|
|
167
167
|
/** Default client capabilities declared in the connection_init handshake. */
|
|
168
168
|
declare const DEFAULT_CLIENT_CAPABILITIES: string[];
|
|
169
169
|
/** Client version reported in the connection_init handshake. */
|
|
170
|
-
declare const CLIENT_VERSION = "0.5.
|
|
170
|
+
declare const CLIENT_VERSION = "0.5.3";
|
|
171
171
|
type MessageType = "connection_init" | "connection_ack" | "request" | "response" | "notification" | "subscribe" | "next" | "error" | "complete" | "unsubscribe" | "ping" | "pong" | "receipt_response" | "disconnect" | "status";
|
|
172
172
|
/** Method names carried in the envelope `method` field. */
|
|
173
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";
|
|
@@ -389,10 +389,6 @@ declare function newLoopSubscribeMessage(loopID: string, verbosity: string, stre
|
|
|
389
389
|
*/
|
|
390
390
|
|
|
391
391
|
declare const EventPlanCreated = "soothe.cognition.plan.created";
|
|
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
392
|
declare const EventDeepResearchStarted = "soothe.subagent.deep_research.started";
|
|
397
393
|
declare const EventDeepResearchProgress = "soothe.subagent.deep_research.progress";
|
|
398
394
|
declare const EventDeepResearchStepCompleted = "soothe.subagent.deep_research.step.completed";
|
|
@@ -401,9 +397,11 @@ declare const EventDeepResearchCrawlSummary = "soothe.subagent.deep_research.cra
|
|
|
401
397
|
declare const EventDeepResearchCompleted = "soothe.subagent.deep_research.completed";
|
|
402
398
|
declare const EventReplayComplete = "replay_complete";
|
|
403
399
|
declare const EventLoopReattachedWire = "loop_reattached";
|
|
404
|
-
declare const
|
|
405
|
-
declare const
|
|
406
|
-
declare const
|
|
400
|
+
declare const EventCardCreated = "soothe.card.created";
|
|
401
|
+
declare const EventCardUpdated = "soothe.card.updated";
|
|
402
|
+
declare const EventCardFinalized = "soothe.card.finalized";
|
|
403
|
+
declare const EventCardReplayBegin = "soothe.card.replay.begin";
|
|
404
|
+
declare const EventCardReplayEnd = "soothe.card.replay.end";
|
|
407
405
|
declare const EventToolStarted = "soothe.tool.execution.started";
|
|
408
406
|
declare const EventToolCompleted = "soothe.tool.execution.completed";
|
|
409
407
|
declare const EventToolError = "soothe.tool.execution.error";
|
|
@@ -1570,4 +1568,42 @@ declare class DaemonSession {
|
|
|
1570
1568
|
}): AsyncGenerator<TurnChunk>;
|
|
1571
1569
|
}
|
|
1572
1570
|
|
|
1573
|
-
|
|
1571
|
+
/**
|
|
1572
|
+
* In-memory apply helpers for daemon `soothe.card.*` frames.
|
|
1573
|
+
*
|
|
1574
|
+
* Language clients stay transport/appkit — this projects card_id → wire dict
|
|
1575
|
+
* without mounting UI widgets.
|
|
1576
|
+
*/
|
|
1577
|
+
|
|
1578
|
+
type CardWireDict = Record<string, unknown> & {
|
|
1579
|
+
id?: string;
|
|
1580
|
+
type?: string;
|
|
1581
|
+
content?: string;
|
|
1582
|
+
};
|
|
1583
|
+
type ParsedCardFrame = {
|
|
1584
|
+
wireType: typeof EventCardReplayBegin | typeof EventCardReplayEnd;
|
|
1585
|
+
card: null;
|
|
1586
|
+
patch: Record<string, unknown>;
|
|
1587
|
+
} | {
|
|
1588
|
+
wireType: typeof EventCardCreated;
|
|
1589
|
+
card: CardWireDict;
|
|
1590
|
+
patch: Record<string, unknown>;
|
|
1591
|
+
} | {
|
|
1592
|
+
wireType: typeof EventCardUpdated | typeof EventCardFinalized;
|
|
1593
|
+
card: null;
|
|
1594
|
+
patch: Record<string, unknown>;
|
|
1595
|
+
};
|
|
1596
|
+
/** Parse a custom-mode card frame, or null if not a card frame. */
|
|
1597
|
+
declare function parseCardCustomPayload(data: unknown): ParsedCardFrame | null;
|
|
1598
|
+
/** card_id → wire dict projection driven by `soothe.card.*` frames. */
|
|
1599
|
+
declare class CardProjection {
|
|
1600
|
+
private cards;
|
|
1601
|
+
private _replaying;
|
|
1602
|
+
get replaying(): boolean;
|
|
1603
|
+
snapshot(): CardWireDict[];
|
|
1604
|
+
get(cardId: string): CardWireDict | undefined;
|
|
1605
|
+
/** Apply one custom-mode card payload. Returns true when handled. */
|
|
1606
|
+
apply(data: unknown): boolean;
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1609
|
+
export { type Attachment, type BaseEnvelope, CLIENT_VERSION, CardProjection, type CardWireDict, type ChatEventResult, ChatEventTerminal, type ClassifierConfig, Client, CommandClient, type CompactImageOptions, type CompleteEnvelope, type Config, type ConnectionAckEnvelope, ConnectionError, type ConnectionInitEnvelope, ConnectionPool, DEFAULT_CLIENT_CAPABILITIES, DEFAULT_DELIVERABLE_PHASES, DEFAULT_POST_IDLE_DRAIN_MS, DEFAULT_THINKING_STEP_EVENTS, DaemonError, DaemonSession, type DaemonSessionOptions, type DecodedMessage, DisconnectCause, type DisconnectEnvelope, ErrIdleTimeout, ErrPoolExhausted, ErrQueryBusy, ErrQueryTimeout, type ErrorEnvelope, EventAutopilotGoalCompleted, EventAutopilotGoalCreated, EventAutopilotGoalProgress, EventAutopilotGoalStatus, EventAutopilotWorkerAssigned, EventAutopilotWorkerUnassigned, EventCardCreated, EventCardFinalized, EventCardReplayBegin, EventCardReplayEnd, EventCardUpdated, EventClassifier, EventDeepResearchCompleted, EventDeepResearchCrawlSummary, EventDeepResearchGatherSummary, EventDeepResearchProgress, EventDeepResearchStarted, EventDeepResearchStepCompleted, EventFinalReport, EventGeneralFailed, EventLoopReattachedWire, EventMessageReceived, EventMessageSent, EventPlanCreated, EventReplayComplete, EventStrangeLoopCompleted, EventStrangeLoopContextCompacted, EventStrangeLoopPlanDecision, EventStrangeLoopReasoned, EventStrangeLoopStarted, EventStrangeLoopStepCompleted, EventStrangeLoopStepQueued, EventStrangeLoopStepStarted, EventStreamToolCallUpdate, EventToolCallUpdatesBatch, EventToolCompleted, EventToolError, EventToolStarted, INTENT_HINT_EMBED, INTENT_HINT_IMAGE_TO_TEXT, INTENT_HINT_OCR, INTENT_HINT_TEXT_COMPLETION, type InputOptions, type InputOpts, type IntentHint, LOOP_ASSISTANT_OUTPUT_PHASES, type LoopAssistantOutputPhase, type LoopInputIntentHint, type LoopInputParams, type LoopNewOptions, type MessageType, type MethodName, type NegotiatedCapabilities, type NextEnvelope, type NotificationEnvelope, type OnComplete, type OnError, PROTO_VERSION, type ParsedCardFrame, type PingEnvelope, type PongEnvelope, type PoolConfig, PooledConn, QueryGate, REMOVED_INTENT_HINTS, type ReceiptResponseEnvelope, ReconnectError, type RemovedIntentHint, type RequestEnvelope, type ResponseEnvelope, SSEBroadcaster, type SSEEvent, STREAM_END, type SessionEntry, type SessionMessage, type SessionStore, StaleLoopError, type StatusFrame, StreamCloseFail, type StreamClosePolicy, StreamCloseSoftComplete, type StreamEventPayload, type SubscribeEnvelope, TURN_END_IDLE, TURN_END_STOPPED, TURN_END_STREAM_END, TimeoutError, TimeoutPolicy, TurnBoundary, type TurnChunk, type TurnConfig, TurnEventStats, TurnLifecycleGate, TurnRunner, type UnsubscribeEnvelope, type VerbosityLevel, VerbosityTier, authenticate, bootstrapLoopSession, checkDaemonStatus, classifyEventVerbosity, compactAttachments, compactImageAttachment, connectWithRetries, connectedWebsocket, connectionInitEnvelope, decodeMessage, defaultConfig, defaultPoolConfig, disconnectCauseName, disconnectEnvelope, encodeMessage, extractSootheLoopID, extractThinkingStep, fetchConfigSection, fetchLoopCards, fetchLoopHistory, fetchLoopMessages, fetchSkillsCatalog, idleTimeoutForTurn, inboundNeedsDeliveryAck, inputMessageForLoop, isCompletionEvent, isDaemonLive, isDaemonTurnEndEvent, isSubagentProgressEvent, isTurnEndCustomData, isTurnProgressChunk, isValidVerbosityLevel, loadConfigFromEnv, newLoopInputMessage, newLoopNewMessage, newLoopSubscribeMessage, newRequestID, notificationEnvelope, parseCardCustomPayload, parseNamespace, pingEnvelope, pongEnvelope, protocol1Rpc, refreshAuthToken, requestDaemonConfigReload, requestDaemonShutdown, requestEnvelope, shouldShow, splitWirePayload, subscribeEnvelope, unsubscribeEnvelope, validateLoopInputIntentHint, waitDaemonReady, waitLoopStatusWithID, waitSubscriptionConfirmed };
|
package/dist/index.d.ts
CHANGED
|
@@ -167,7 +167,7 @@ declare const PROTO_VERSION = "1";
|
|
|
167
167
|
/** Default client capabilities declared in the connection_init handshake. */
|
|
168
168
|
declare const DEFAULT_CLIENT_CAPABILITIES: string[];
|
|
169
169
|
/** Client version reported in the connection_init handshake. */
|
|
170
|
-
declare const CLIENT_VERSION = "0.5.
|
|
170
|
+
declare const CLIENT_VERSION = "0.5.3";
|
|
171
171
|
type MessageType = "connection_init" | "connection_ack" | "request" | "response" | "notification" | "subscribe" | "next" | "error" | "complete" | "unsubscribe" | "ping" | "pong" | "receipt_response" | "disconnect" | "status";
|
|
172
172
|
/** Method names carried in the envelope `method` field. */
|
|
173
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";
|
|
@@ -389,10 +389,6 @@ declare function newLoopSubscribeMessage(loopID: string, verbosity: string, stre
|
|
|
389
389
|
*/
|
|
390
390
|
|
|
391
391
|
declare const EventPlanCreated = "soothe.cognition.plan.created";
|
|
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
392
|
declare const EventDeepResearchStarted = "soothe.subagent.deep_research.started";
|
|
397
393
|
declare const EventDeepResearchProgress = "soothe.subagent.deep_research.progress";
|
|
398
394
|
declare const EventDeepResearchStepCompleted = "soothe.subagent.deep_research.step.completed";
|
|
@@ -401,9 +397,11 @@ declare const EventDeepResearchCrawlSummary = "soothe.subagent.deep_research.cra
|
|
|
401
397
|
declare const EventDeepResearchCompleted = "soothe.subagent.deep_research.completed";
|
|
402
398
|
declare const EventReplayComplete = "replay_complete";
|
|
403
399
|
declare const EventLoopReattachedWire = "loop_reattached";
|
|
404
|
-
declare const
|
|
405
|
-
declare const
|
|
406
|
-
declare const
|
|
400
|
+
declare const EventCardCreated = "soothe.card.created";
|
|
401
|
+
declare const EventCardUpdated = "soothe.card.updated";
|
|
402
|
+
declare const EventCardFinalized = "soothe.card.finalized";
|
|
403
|
+
declare const EventCardReplayBegin = "soothe.card.replay.begin";
|
|
404
|
+
declare const EventCardReplayEnd = "soothe.card.replay.end";
|
|
407
405
|
declare const EventToolStarted = "soothe.tool.execution.started";
|
|
408
406
|
declare const EventToolCompleted = "soothe.tool.execution.completed";
|
|
409
407
|
declare const EventToolError = "soothe.tool.execution.error";
|
|
@@ -1570,4 +1568,42 @@ declare class DaemonSession {
|
|
|
1570
1568
|
}): AsyncGenerator<TurnChunk>;
|
|
1571
1569
|
}
|
|
1572
1570
|
|
|
1573
|
-
|
|
1571
|
+
/**
|
|
1572
|
+
* In-memory apply helpers for daemon `soothe.card.*` frames.
|
|
1573
|
+
*
|
|
1574
|
+
* Language clients stay transport/appkit — this projects card_id → wire dict
|
|
1575
|
+
* without mounting UI widgets.
|
|
1576
|
+
*/
|
|
1577
|
+
|
|
1578
|
+
type CardWireDict = Record<string, unknown> & {
|
|
1579
|
+
id?: string;
|
|
1580
|
+
type?: string;
|
|
1581
|
+
content?: string;
|
|
1582
|
+
};
|
|
1583
|
+
type ParsedCardFrame = {
|
|
1584
|
+
wireType: typeof EventCardReplayBegin | typeof EventCardReplayEnd;
|
|
1585
|
+
card: null;
|
|
1586
|
+
patch: Record<string, unknown>;
|
|
1587
|
+
} | {
|
|
1588
|
+
wireType: typeof EventCardCreated;
|
|
1589
|
+
card: CardWireDict;
|
|
1590
|
+
patch: Record<string, unknown>;
|
|
1591
|
+
} | {
|
|
1592
|
+
wireType: typeof EventCardUpdated | typeof EventCardFinalized;
|
|
1593
|
+
card: null;
|
|
1594
|
+
patch: Record<string, unknown>;
|
|
1595
|
+
};
|
|
1596
|
+
/** Parse a custom-mode card frame, or null if not a card frame. */
|
|
1597
|
+
declare function parseCardCustomPayload(data: unknown): ParsedCardFrame | null;
|
|
1598
|
+
/** card_id → wire dict projection driven by `soothe.card.*` frames. */
|
|
1599
|
+
declare class CardProjection {
|
|
1600
|
+
private cards;
|
|
1601
|
+
private _replaying;
|
|
1602
|
+
get replaying(): boolean;
|
|
1603
|
+
snapshot(): CardWireDict[];
|
|
1604
|
+
get(cardId: string): CardWireDict | undefined;
|
|
1605
|
+
/** Apply one custom-mode card payload. Returns true when handled. */
|
|
1606
|
+
apply(data: unknown): boolean;
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1609
|
+
export { type Attachment, type BaseEnvelope, CLIENT_VERSION, CardProjection, type CardWireDict, type ChatEventResult, ChatEventTerminal, type ClassifierConfig, Client, CommandClient, type CompactImageOptions, type CompleteEnvelope, type Config, type ConnectionAckEnvelope, ConnectionError, type ConnectionInitEnvelope, ConnectionPool, DEFAULT_CLIENT_CAPABILITIES, DEFAULT_DELIVERABLE_PHASES, DEFAULT_POST_IDLE_DRAIN_MS, DEFAULT_THINKING_STEP_EVENTS, DaemonError, DaemonSession, type DaemonSessionOptions, type DecodedMessage, DisconnectCause, type DisconnectEnvelope, ErrIdleTimeout, ErrPoolExhausted, ErrQueryBusy, ErrQueryTimeout, type ErrorEnvelope, EventAutopilotGoalCompleted, EventAutopilotGoalCreated, EventAutopilotGoalProgress, EventAutopilotGoalStatus, EventAutopilotWorkerAssigned, EventAutopilotWorkerUnassigned, EventCardCreated, EventCardFinalized, EventCardReplayBegin, EventCardReplayEnd, EventCardUpdated, EventClassifier, EventDeepResearchCompleted, EventDeepResearchCrawlSummary, EventDeepResearchGatherSummary, EventDeepResearchProgress, EventDeepResearchStarted, EventDeepResearchStepCompleted, EventFinalReport, EventGeneralFailed, EventLoopReattachedWire, EventMessageReceived, EventMessageSent, EventPlanCreated, EventReplayComplete, EventStrangeLoopCompleted, EventStrangeLoopContextCompacted, EventStrangeLoopPlanDecision, EventStrangeLoopReasoned, EventStrangeLoopStarted, EventStrangeLoopStepCompleted, EventStrangeLoopStepQueued, EventStrangeLoopStepStarted, EventStreamToolCallUpdate, EventToolCallUpdatesBatch, EventToolCompleted, EventToolError, EventToolStarted, INTENT_HINT_EMBED, INTENT_HINT_IMAGE_TO_TEXT, INTENT_HINT_OCR, INTENT_HINT_TEXT_COMPLETION, type InputOptions, type InputOpts, type IntentHint, LOOP_ASSISTANT_OUTPUT_PHASES, type LoopAssistantOutputPhase, type LoopInputIntentHint, type LoopInputParams, type LoopNewOptions, type MessageType, type MethodName, type NegotiatedCapabilities, type NextEnvelope, type NotificationEnvelope, type OnComplete, type OnError, PROTO_VERSION, type ParsedCardFrame, type PingEnvelope, type PongEnvelope, type PoolConfig, PooledConn, QueryGate, REMOVED_INTENT_HINTS, type ReceiptResponseEnvelope, ReconnectError, type RemovedIntentHint, type RequestEnvelope, type ResponseEnvelope, SSEBroadcaster, type SSEEvent, STREAM_END, type SessionEntry, type SessionMessage, type SessionStore, StaleLoopError, type StatusFrame, StreamCloseFail, type StreamClosePolicy, StreamCloseSoftComplete, type StreamEventPayload, type SubscribeEnvelope, TURN_END_IDLE, TURN_END_STOPPED, TURN_END_STREAM_END, TimeoutError, TimeoutPolicy, TurnBoundary, type TurnChunk, type TurnConfig, TurnEventStats, TurnLifecycleGate, TurnRunner, type UnsubscribeEnvelope, type VerbosityLevel, VerbosityTier, authenticate, bootstrapLoopSession, checkDaemonStatus, classifyEventVerbosity, compactAttachments, compactImageAttachment, connectWithRetries, connectedWebsocket, connectionInitEnvelope, decodeMessage, defaultConfig, defaultPoolConfig, disconnectCauseName, disconnectEnvelope, encodeMessage, extractSootheLoopID, extractThinkingStep, fetchConfigSection, fetchLoopCards, fetchLoopHistory, fetchLoopMessages, fetchSkillsCatalog, idleTimeoutForTurn, inboundNeedsDeliveryAck, inputMessageForLoop, isCompletionEvent, isDaemonLive, isDaemonTurnEndEvent, isSubagentProgressEvent, isTurnEndCustomData, isTurnProgressChunk, isValidVerbosityLevel, loadConfigFromEnv, newLoopInputMessage, newLoopNewMessage, newLoopSubscribeMessage, newRequestID, notificationEnvelope, parseCardCustomPayload, parseNamespace, pingEnvelope, pongEnvelope, protocol1Rpc, refreshAuthToken, requestDaemonConfigReload, requestDaemonShutdown, requestEnvelope, shouldShow, splitWirePayload, subscribeEnvelope, unsubscribeEnvelope, validateLoopInputIntentHint, waitDaemonReady, waitLoopStatusWithID, waitSubscriptionConfirmed };
|
package/dist/index.js
CHANGED
|
@@ -13,18 +13,16 @@ import {
|
|
|
13
13
|
EventAutopilotWorkerAssigned,
|
|
14
14
|
EventAutopilotWorkerUnassigned,
|
|
15
15
|
EventCardCreated,
|
|
16
|
+
EventCardFinalized,
|
|
16
17
|
EventCardReplayBegin,
|
|
17
18
|
EventCardReplayEnd,
|
|
19
|
+
EventCardUpdated,
|
|
18
20
|
EventDeepResearchCompleted,
|
|
19
21
|
EventDeepResearchCrawlSummary,
|
|
20
22
|
EventDeepResearchGatherSummary,
|
|
21
23
|
EventDeepResearchProgress,
|
|
22
24
|
EventDeepResearchStarted,
|
|
23
25
|
EventDeepResearchStepCompleted,
|
|
24
|
-
EventExplorerCompleted,
|
|
25
|
-
EventExplorerMilestone,
|
|
26
|
-
EventExplorerStarted,
|
|
27
|
-
EventExplorerStepCompleted,
|
|
28
26
|
EventFinalReport,
|
|
29
27
|
EventGeneralFailed,
|
|
30
28
|
EventLoopReattachedWire,
|
|
@@ -86,7 +84,7 @@ import {
|
|
|
86
84
|
subscribeEnvelope,
|
|
87
85
|
unsubscribeEnvelope,
|
|
88
86
|
validateLoopInputIntentHint
|
|
89
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-B5FIL7O4.js";
|
|
90
88
|
|
|
91
89
|
// src/session.ts
|
|
92
90
|
async function bootstrapLoopSession(client, resumeLoopId, config, loopNew) {
|
|
@@ -289,7 +287,7 @@ async function checkDaemonStatus(client, timeout) {
|
|
|
289
287
|
return client.requestResponse("daemon_status", {}, "daemon_status", timeout ?? 5e3);
|
|
290
288
|
}
|
|
291
289
|
async function isDaemonLive(wsURL, timeout) {
|
|
292
|
-
const { Client: Client2 } = await import("./client-
|
|
290
|
+
const { Client: Client2 } = await import("./client-BOND6P6S.js");
|
|
293
291
|
const t = timeout ?? 5e3;
|
|
294
292
|
const client = new Client2(wsURL, defaultConfig());
|
|
295
293
|
try {
|
|
@@ -376,7 +374,7 @@ async function fetchLoopMessages(client, loopID, opts) {
|
|
|
376
374
|
);
|
|
377
375
|
}
|
|
378
376
|
async function connectedWebsocket(wsUrl, fn, timeoutMs = 3e4) {
|
|
379
|
-
const { Client: Client2 } = await import("./client-
|
|
377
|
+
const { Client: Client2 } = await import("./client-BOND6P6S.js");
|
|
380
378
|
const client = new Client2(wsUrl, defaultConfig());
|
|
381
379
|
const deadline = Date.now() + timeoutMs;
|
|
382
380
|
try {
|
|
@@ -2281,8 +2279,86 @@ var DaemonSession = class {
|
|
|
2281
2279
|
}
|
|
2282
2280
|
}
|
|
2283
2281
|
};
|
|
2282
|
+
|
|
2283
|
+
// src/display/cardProjection.ts
|
|
2284
|
+
var CARD_MUTATION_TYPES = /* @__PURE__ */ new Set([
|
|
2285
|
+
EventCardCreated,
|
|
2286
|
+
EventCardUpdated,
|
|
2287
|
+
EventCardFinalized,
|
|
2288
|
+
EventCardReplayBegin,
|
|
2289
|
+
EventCardReplayEnd
|
|
2290
|
+
]);
|
|
2291
|
+
function parseCardCustomPayload(data) {
|
|
2292
|
+
if (!data || typeof data !== "object") return null;
|
|
2293
|
+
const d = data;
|
|
2294
|
+
const wireType = String(d.type ?? "").trim();
|
|
2295
|
+
if (!CARD_MUTATION_TYPES.has(wireType)) return null;
|
|
2296
|
+
if (wireType === EventCardReplayBegin || wireType === EventCardReplayEnd) {
|
|
2297
|
+
return { wireType, card: null, patch: {} };
|
|
2298
|
+
}
|
|
2299
|
+
const payload = d.data && typeof d.data === "object" ? { ...d.data } : {};
|
|
2300
|
+
const cardId = String(d.card_id ?? payload.id ?? "").trim();
|
|
2301
|
+
if (wireType === EventCardCreated) {
|
|
2302
|
+
if (!payload.type || payload.content === void 0) return null;
|
|
2303
|
+
if (!payload.id && cardId) payload.id = cardId;
|
|
2304
|
+
return { wireType, card: payload, patch: {} };
|
|
2305
|
+
}
|
|
2306
|
+
if (!payload.id && cardId) payload.id = cardId;
|
|
2307
|
+
return {
|
|
2308
|
+
wireType,
|
|
2309
|
+
card: null,
|
|
2310
|
+
patch: payload
|
|
2311
|
+
};
|
|
2312
|
+
}
|
|
2313
|
+
var CardProjection = class {
|
|
2314
|
+
cards = /* @__PURE__ */ new Map();
|
|
2315
|
+
_replaying = false;
|
|
2316
|
+
get replaying() {
|
|
2317
|
+
return this._replaying;
|
|
2318
|
+
}
|
|
2319
|
+
snapshot() {
|
|
2320
|
+
return [...this.cards.values()];
|
|
2321
|
+
}
|
|
2322
|
+
get(cardId) {
|
|
2323
|
+
return this.cards.get(cardId);
|
|
2324
|
+
}
|
|
2325
|
+
/** Apply one custom-mode card payload. Returns true when handled. */
|
|
2326
|
+
apply(data) {
|
|
2327
|
+
const parsed = parseCardCustomPayload(data);
|
|
2328
|
+
if (!parsed) return false;
|
|
2329
|
+
if (parsed.wireType === EventCardReplayBegin) {
|
|
2330
|
+
this._replaying = true;
|
|
2331
|
+
this.cards.clear();
|
|
2332
|
+
return true;
|
|
2333
|
+
}
|
|
2334
|
+
if (parsed.wireType === EventCardReplayEnd) {
|
|
2335
|
+
this._replaying = false;
|
|
2336
|
+
return true;
|
|
2337
|
+
}
|
|
2338
|
+
if (parsed.wireType === EventCardCreated && parsed.card) {
|
|
2339
|
+
const id = String(parsed.card.id ?? "").trim();
|
|
2340
|
+
if (id) this.cards.set(id, { ...parsed.card });
|
|
2341
|
+
return true;
|
|
2342
|
+
}
|
|
2343
|
+
if (parsed.wireType === EventCardUpdated || parsed.wireType === EventCardFinalized) {
|
|
2344
|
+
const id = String(parsed.patch.id ?? "").trim();
|
|
2345
|
+
if (!id) return true;
|
|
2346
|
+
const existing = this.cards.get(id);
|
|
2347
|
+
if (!existing) return true;
|
|
2348
|
+
const next = { ...existing };
|
|
2349
|
+
for (const [key, value] of Object.entries(parsed.patch)) {
|
|
2350
|
+
if (key === "id" || key === "type") continue;
|
|
2351
|
+
next[key] = value;
|
|
2352
|
+
}
|
|
2353
|
+
this.cards.set(id, next);
|
|
2354
|
+
return true;
|
|
2355
|
+
}
|
|
2356
|
+
return true;
|
|
2357
|
+
}
|
|
2358
|
+
};
|
|
2284
2359
|
export {
|
|
2285
2360
|
CLIENT_VERSION,
|
|
2361
|
+
CardProjection,
|
|
2286
2362
|
ChatEventTerminal,
|
|
2287
2363
|
Client,
|
|
2288
2364
|
CommandClient,
|
|
@@ -2306,8 +2382,10 @@ export {
|
|
|
2306
2382
|
EventAutopilotWorkerAssigned,
|
|
2307
2383
|
EventAutopilotWorkerUnassigned,
|
|
2308
2384
|
EventCardCreated,
|
|
2385
|
+
EventCardFinalized,
|
|
2309
2386
|
EventCardReplayBegin,
|
|
2310
2387
|
EventCardReplayEnd,
|
|
2388
|
+
EventCardUpdated,
|
|
2311
2389
|
EventClassifier,
|
|
2312
2390
|
EventDeepResearchCompleted,
|
|
2313
2391
|
EventDeepResearchCrawlSummary,
|
|
@@ -2315,10 +2393,6 @@ export {
|
|
|
2315
2393
|
EventDeepResearchProgress,
|
|
2316
2394
|
EventDeepResearchStarted,
|
|
2317
2395
|
EventDeepResearchStepCompleted,
|
|
2318
|
-
EventExplorerCompleted,
|
|
2319
|
-
EventExplorerMilestone,
|
|
2320
|
-
EventExplorerStarted,
|
|
2321
|
-
EventExplorerStepCompleted,
|
|
2322
2396
|
EventFinalReport,
|
|
2323
2397
|
EventGeneralFailed,
|
|
2324
2398
|
EventLoopReattachedWire,
|
|
@@ -2402,6 +2476,7 @@ export {
|
|
|
2402
2476
|
newLoopSubscribeMessage,
|
|
2403
2477
|
newRequestID,
|
|
2404
2478
|
notificationEnvelope,
|
|
2479
|
+
parseCardCustomPayload,
|
|
2405
2480
|
parseNamespace,
|
|
2406
2481
|
pingEnvelope,
|
|
2407
2482
|
pongEnvelope,
|