@mirasoth/soothe-client 0.5.0 → 0.5.1
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-A6WGUBQE.js → chunk-R43B23MJ.js} +8 -7
- package/dist/chunk-R43B23MJ.js.map +1 -0
- package/dist/client-SCSBM3EL.js +7 -0
- package/dist/index.cjs +12 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -14
- package/dist/index.d.ts +14 -14
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-A6WGUBQE.js.map +0 -1
- package/dist/client-UEBVV6HI.js +0 -7
- /package/dist/{client-UEBVV6HI.js.map → client-SCSBM3EL.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -124,7 +124,7 @@ declare function defaultConfig(): Config;
|
|
|
124
124
|
declare function loadConfigFromEnv(): Config;
|
|
125
125
|
|
|
126
126
|
/**
|
|
127
|
-
* Daemon ``loop_input`` intent_hint values (
|
|
127
|
+
* Daemon ``loop_input`` intent_hint values (non-agent turns).
|
|
128
128
|
*/
|
|
129
129
|
/** Text-only chat completion via the configured ``default`` role. */
|
|
130
130
|
declare const INTENT_HINT_TEXT_COMPLETION: "text_completion";
|
|
@@ -134,23 +134,23 @@ declare const INTENT_HINT_IMAGE_TO_TEXT: "image_to_text";
|
|
|
134
134
|
declare const INTENT_HINT_OCR: "ocr";
|
|
135
135
|
/** Embedding via the configured ``embedding`` role (text-only; JSON vector response). */
|
|
136
136
|
declare const INTENT_HINT_EMBED: "embed";
|
|
137
|
-
/** Supported daemon
|
|
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
139
|
/** Legacy intent_hint values removed from the daemon wire contract. */
|
|
140
|
-
declare const REMOVED_INTENT_HINTS: readonly ["direct_llm", "quiz"];
|
|
140
|
+
declare const REMOVED_INTENT_HINTS: readonly ["direct_llm", "quiz", "direct_model"];
|
|
141
141
|
type RemovedIntentHint = (typeof REMOVED_INTENT_HINTS)[number];
|
|
142
142
|
/**
|
|
143
|
-
* Wire ``loop_input.intent_hint``:
|
|
144
|
-
* (e.g. ``resume_clarification``, ``skill:foo``). Legacy ``direct_llm``
|
|
145
|
-
* ``
|
|
143
|
+
* 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.
|
|
146
146
|
*/
|
|
147
147
|
type LoopInputIntentHint = IntentHint | (string & {});
|
|
148
148
|
/** Returns an error message when ``hint`` is a removed legacy value; otherwise null. */
|
|
149
149
|
declare function validateLoopInputIntentHint(hint: string): string | null;
|
|
150
150
|
/** Phases emitted on ``mode=messages`` for user-visible loop assistant output. */
|
|
151
|
-
declare const LOOP_ASSISTANT_OUTPUT_PHASES: readonly ["goal_completion", "quiz", "autonomous_goal", "
|
|
151
|
+
declare const LOOP_ASSISTANT_OUTPUT_PHASES: readonly ["goal_completion", "quiz", "autonomous_goal", "chitchat", "text_completion", "image_to_text", "ocr", "embed", "plan_direct"];
|
|
152
152
|
type LoopAssistantOutputPhase = (typeof LOOP_ASSISTANT_OUTPUT_PHASES)[number];
|
|
153
|
-
/** Default deliverable phases for triarch-style apps (
|
|
153
|
+
/** Default deliverable phases for triarch-style apps (intent hints + agent outputs). */
|
|
154
154
|
declare const DEFAULT_DELIVERABLE_PHASES: ReadonlySet<string>;
|
|
155
155
|
|
|
156
156
|
/**
|
|
@@ -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.1";
|
|
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";
|
|
@@ -460,7 +460,7 @@ interface InputOptions {
|
|
|
460
460
|
model?: string;
|
|
461
461
|
modelParams?: Record<string, unknown>;
|
|
462
462
|
attachments?: Record<string, unknown>[];
|
|
463
|
-
/** Daemon
|
|
463
|
+
/** Daemon intent_hint or agent-path pass-through (resume_clarification, skill:foo). */
|
|
464
464
|
intentHint?: LoopInputIntentHint;
|
|
465
465
|
/** JSON Schema for structured output (text_completion or image_to_text). */
|
|
466
466
|
responseSchema?: Record<string, unknown>;
|
|
@@ -1050,7 +1050,7 @@ interface ChatEventResult {
|
|
|
1050
1050
|
/**
|
|
1051
1051
|
* Product-specific decisions an EventClassifier needs. The DeliverablePhases
|
|
1052
1052
|
* set is the key product knob: which message `phase` values count as
|
|
1053
|
-
* user-facing deliverables (triarch uses quiz, goal_completion,
|
|
1053
|
+
* user-facing deliverables (triarch uses quiz, goal_completion, chitchat, and
|
|
1054
1054
|
* direct intent_hint phases text_completion, image_to_text, ocr, embed;
|
|
1055
1055
|
* other apps pass their own).
|
|
1056
1056
|
*/
|
|
@@ -1065,7 +1065,7 @@ interface ClassifierConfig {
|
|
|
1065
1065
|
thinkingStepEvents?: ReadonlySet<string>;
|
|
1066
1066
|
/**
|
|
1067
1067
|
* When true, a status frame with state=idle and non-empty accumulated
|
|
1068
|
-
* assistant text is DeliverableComplete (typical for
|
|
1068
|
+
* assistant text is DeliverableComplete (typical for intent-hint turns).
|
|
1069
1069
|
* Default false keeps Continue-on-status behaviour.
|
|
1070
1070
|
*/
|
|
1071
1071
|
treatStatusIdleAsComplete?: boolean;
|
|
@@ -1113,8 +1113,8 @@ declare class EventClassifier {
|
|
|
1113
1113
|
private classifyMessagesMode;
|
|
1114
1114
|
/**
|
|
1115
1115
|
* Extracts plain assistant text from mode="messages" events that carry a
|
|
1116
|
-
* terminal AIMessage without loop-tagged phase metadata (
|
|
1117
|
-
*
|
|
1116
|
+
* terminal AIMessage without loop-tagged phase metadata (prefer named
|
|
1117
|
+
* deliverablePhases such as text_completion).
|
|
1118
1118
|
*/
|
|
1119
1119
|
private messagesModeAssistantContent;
|
|
1120
1120
|
/** soothe output/responded events that carry user-facing final text. */
|
package/dist/index.d.ts
CHANGED
|
@@ -124,7 +124,7 @@ declare function defaultConfig(): Config;
|
|
|
124
124
|
declare function loadConfigFromEnv(): Config;
|
|
125
125
|
|
|
126
126
|
/**
|
|
127
|
-
* Daemon ``loop_input`` intent_hint values (
|
|
127
|
+
* Daemon ``loop_input`` intent_hint values (non-agent turns).
|
|
128
128
|
*/
|
|
129
129
|
/** Text-only chat completion via the configured ``default`` role. */
|
|
130
130
|
declare const INTENT_HINT_TEXT_COMPLETION: "text_completion";
|
|
@@ -134,23 +134,23 @@ declare const INTENT_HINT_IMAGE_TO_TEXT: "image_to_text";
|
|
|
134
134
|
declare const INTENT_HINT_OCR: "ocr";
|
|
135
135
|
/** Embedding via the configured ``embedding`` role (text-only; JSON vector response). */
|
|
136
136
|
declare const INTENT_HINT_EMBED: "embed";
|
|
137
|
-
/** Supported daemon
|
|
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
139
|
/** Legacy intent_hint values removed from the daemon wire contract. */
|
|
140
|
-
declare const REMOVED_INTENT_HINTS: readonly ["direct_llm", "quiz"];
|
|
140
|
+
declare const REMOVED_INTENT_HINTS: readonly ["direct_llm", "quiz", "direct_model"];
|
|
141
141
|
type RemovedIntentHint = (typeof REMOVED_INTENT_HINTS)[number];
|
|
142
142
|
/**
|
|
143
|
-
* Wire ``loop_input.intent_hint``:
|
|
144
|
-
* (e.g. ``resume_clarification``, ``skill:foo``). Legacy ``direct_llm``
|
|
145
|
-
* ``
|
|
143
|
+
* 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.
|
|
146
146
|
*/
|
|
147
147
|
type LoopInputIntentHint = IntentHint | (string & {});
|
|
148
148
|
/** Returns an error message when ``hint`` is a removed legacy value; otherwise null. */
|
|
149
149
|
declare function validateLoopInputIntentHint(hint: string): string | null;
|
|
150
150
|
/** Phases emitted on ``mode=messages`` for user-visible loop assistant output. */
|
|
151
|
-
declare const LOOP_ASSISTANT_OUTPUT_PHASES: readonly ["goal_completion", "quiz", "autonomous_goal", "
|
|
151
|
+
declare const LOOP_ASSISTANT_OUTPUT_PHASES: readonly ["goal_completion", "quiz", "autonomous_goal", "chitchat", "text_completion", "image_to_text", "ocr", "embed", "plan_direct"];
|
|
152
152
|
type LoopAssistantOutputPhase = (typeof LOOP_ASSISTANT_OUTPUT_PHASES)[number];
|
|
153
|
-
/** Default deliverable phases for triarch-style apps (
|
|
153
|
+
/** Default deliverable phases for triarch-style apps (intent hints + agent outputs). */
|
|
154
154
|
declare const DEFAULT_DELIVERABLE_PHASES: ReadonlySet<string>;
|
|
155
155
|
|
|
156
156
|
/**
|
|
@@ -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.1";
|
|
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";
|
|
@@ -460,7 +460,7 @@ interface InputOptions {
|
|
|
460
460
|
model?: string;
|
|
461
461
|
modelParams?: Record<string, unknown>;
|
|
462
462
|
attachments?: Record<string, unknown>[];
|
|
463
|
-
/** Daemon
|
|
463
|
+
/** Daemon intent_hint or agent-path pass-through (resume_clarification, skill:foo). */
|
|
464
464
|
intentHint?: LoopInputIntentHint;
|
|
465
465
|
/** JSON Schema for structured output (text_completion or image_to_text). */
|
|
466
466
|
responseSchema?: Record<string, unknown>;
|
|
@@ -1050,7 +1050,7 @@ interface ChatEventResult {
|
|
|
1050
1050
|
/**
|
|
1051
1051
|
* Product-specific decisions an EventClassifier needs. The DeliverablePhases
|
|
1052
1052
|
* set is the key product knob: which message `phase` values count as
|
|
1053
|
-
* user-facing deliverables (triarch uses quiz, goal_completion,
|
|
1053
|
+
* user-facing deliverables (triarch uses quiz, goal_completion, chitchat, and
|
|
1054
1054
|
* direct intent_hint phases text_completion, image_to_text, ocr, embed;
|
|
1055
1055
|
* other apps pass their own).
|
|
1056
1056
|
*/
|
|
@@ -1065,7 +1065,7 @@ interface ClassifierConfig {
|
|
|
1065
1065
|
thinkingStepEvents?: ReadonlySet<string>;
|
|
1066
1066
|
/**
|
|
1067
1067
|
* When true, a status frame with state=idle and non-empty accumulated
|
|
1068
|
-
* assistant text is DeliverableComplete (typical for
|
|
1068
|
+
* assistant text is DeliverableComplete (typical for intent-hint turns).
|
|
1069
1069
|
* Default false keeps Continue-on-status behaviour.
|
|
1070
1070
|
*/
|
|
1071
1071
|
treatStatusIdleAsComplete?: boolean;
|
|
@@ -1113,8 +1113,8 @@ declare class EventClassifier {
|
|
|
1113
1113
|
private classifyMessagesMode;
|
|
1114
1114
|
/**
|
|
1115
1115
|
* Extracts plain assistant text from mode="messages" events that carry a
|
|
1116
|
-
* terminal AIMessage without loop-tagged phase metadata (
|
|
1117
|
-
*
|
|
1116
|
+
* terminal AIMessage without loop-tagged phase metadata (prefer named
|
|
1117
|
+
* deliverablePhases such as text_completion).
|
|
1118
1118
|
*/
|
|
1119
1119
|
private messagesModeAssistantContent;
|
|
1120
1120
|
/** soothe output/responded events that carry user-facing final text. */
|
package/dist/index.js
CHANGED
|
@@ -86,7 +86,7 @@ import {
|
|
|
86
86
|
subscribeEnvelope,
|
|
87
87
|
unsubscribeEnvelope,
|
|
88
88
|
validateLoopInputIntentHint
|
|
89
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-R43B23MJ.js";
|
|
90
90
|
|
|
91
91
|
// src/session.ts
|
|
92
92
|
async function bootstrapLoopSession(client, resumeLoopId, config, loopNew) {
|
|
@@ -289,7 +289,7 @@ async function checkDaemonStatus(client, timeout) {
|
|
|
289
289
|
return client.requestResponse("daemon_status", {}, "daemon_status", timeout ?? 5e3);
|
|
290
290
|
}
|
|
291
291
|
async function isDaemonLive(wsURL, timeout) {
|
|
292
|
-
const { Client: Client2 } = await import("./client-
|
|
292
|
+
const { Client: Client2 } = await import("./client-SCSBM3EL.js");
|
|
293
293
|
const t = timeout ?? 5e3;
|
|
294
294
|
const client = new Client2(wsURL, defaultConfig());
|
|
295
295
|
try {
|
|
@@ -376,7 +376,7 @@ async function fetchLoopMessages(client, loopID, opts) {
|
|
|
376
376
|
);
|
|
377
377
|
}
|
|
378
378
|
async function connectedWebsocket(wsUrl, fn, timeoutMs = 3e4) {
|
|
379
|
-
const { Client: Client2 } = await import("./client-
|
|
379
|
+
const { Client: Client2 } = await import("./client-SCSBM3EL.js");
|
|
380
380
|
const client = new Client2(wsUrl, defaultConfig());
|
|
381
381
|
const deadline = Date.now() + timeoutMs;
|
|
382
382
|
try {
|
|
@@ -872,9 +872,9 @@ var EventClassifier = class {
|
|
|
872
872
|
return this.continueResult(content);
|
|
873
873
|
}
|
|
874
874
|
}
|
|
875
|
-
const [
|
|
876
|
-
if (
|
|
877
|
-
return this.
|
|
875
|
+
const [unphasedContent, unphasedOk] = this.messagesModeAssistantContent(data);
|
|
876
|
+
if (unphasedOk) {
|
|
877
|
+
return this.continueResult(unphasedContent);
|
|
878
878
|
}
|
|
879
879
|
if (hasPayload && rawContent) {
|
|
880
880
|
if (isTerminalMessageType(msgType) || msgType === "") {
|
|
@@ -889,8 +889,8 @@ var EventClassifier = class {
|
|
|
889
889
|
}
|
|
890
890
|
/**
|
|
891
891
|
* Extracts plain assistant text from mode="messages" events that carry a
|
|
892
|
-
* terminal AIMessage without loop-tagged phase metadata (
|
|
893
|
-
*
|
|
892
|
+
* terminal AIMessage without loop-tagged phase metadata (prefer named
|
|
893
|
+
* deliverablePhases such as text_completion).
|
|
894
894
|
*/
|
|
895
895
|
messagesModeAssistantContent(data) {
|
|
896
896
|
if (!Array.isArray(data) || data.length === 0) return ["", false];
|