@hermespilot/link 0.7.8-beta.0 → 0.7.9-beta.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/dist/{chunk-A3USRRZU.js → chunk-Y5S7U77X.js} +3988 -1117
- package/dist/cli/index.js +5 -3
- package/dist/http/app.d.ts +141 -35
- package/dist/http/app.js +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -43,6 +43,7 @@ import {
|
|
|
43
43
|
readTuiGatewayStatus,
|
|
44
44
|
reportLinkStatusToServer,
|
|
45
45
|
resolveConversationRunBackend,
|
|
46
|
+
resolveHermesBin,
|
|
46
47
|
resolveHermesConfigPath,
|
|
47
48
|
resolveHermesProfileDir,
|
|
48
49
|
resolveLanguage,
|
|
@@ -54,7 +55,7 @@ import {
|
|
|
54
55
|
stopDaemonProcess,
|
|
55
56
|
summarizeUsageProbeEnsure,
|
|
56
57
|
translate
|
|
57
|
-
} from "../chunk-
|
|
58
|
+
} from "../chunk-Y5S7U77X.js";
|
|
58
59
|
|
|
59
60
|
// src/cli/index.ts
|
|
60
61
|
import { Command } from "commander";
|
|
@@ -263,8 +264,9 @@ function autostartEnvironment() {
|
|
|
263
264
|
if (pathValue) {
|
|
264
265
|
environment.PATH = pathValue;
|
|
265
266
|
}
|
|
266
|
-
const
|
|
267
|
-
|
|
267
|
+
const explicitHermesBin = process.env.HERMES_BIN?.trim();
|
|
268
|
+
const hermesBin = explicitHermesBin || resolveHermesBin();
|
|
269
|
+
if (explicitHermesBin || path.isAbsolute(hermesBin)) {
|
|
268
270
|
environment.HERMES_BIN = hermesBin;
|
|
269
271
|
}
|
|
270
272
|
const hermesPython = process.env.HERMES_PYTHON?.trim();
|
package/dist/http/app.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ interface ConversationSummary {
|
|
|
24
24
|
updated_at?: string;
|
|
25
25
|
};
|
|
26
26
|
profile: ConversationProfileSummary;
|
|
27
|
+
goal?: ConversationGoalState;
|
|
27
28
|
last_message: {
|
|
28
29
|
id: string;
|
|
29
30
|
role: string;
|
|
@@ -44,8 +45,12 @@ interface ConversationRuntimeMetadata {
|
|
|
44
45
|
model: {
|
|
45
46
|
id: string;
|
|
46
47
|
provider?: string;
|
|
48
|
+
provider_key?: string;
|
|
49
|
+
base_url?: string;
|
|
50
|
+
api_mode?: string;
|
|
47
51
|
context_window?: number;
|
|
48
52
|
reasoning_effort?: string;
|
|
53
|
+
reasoning_support_policy?: string;
|
|
49
54
|
};
|
|
50
55
|
context: {
|
|
51
56
|
input_tokens: number;
|
|
@@ -55,11 +60,11 @@ interface ConversationRuntimeMetadata {
|
|
|
55
60
|
used_tokens?: number;
|
|
56
61
|
window_tokens?: number;
|
|
57
62
|
usage_percent?: number;
|
|
58
|
-
source:
|
|
63
|
+
source: "explicit" | "probe" | "estimated" | "unknown";
|
|
59
64
|
updated_at?: string;
|
|
60
65
|
};
|
|
61
66
|
}
|
|
62
|
-
type ConversationTitleSource =
|
|
67
|
+
type ConversationTitleSource = "default" | "temporary_user_message" | "temporary_fallback" | "manual" | "generated" | "hermes";
|
|
63
68
|
interface ConversationMessagesPageInfo {
|
|
64
69
|
limit: number;
|
|
65
70
|
has_more_before: boolean;
|
|
@@ -67,10 +72,10 @@ interface ConversationMessagesPageInfo {
|
|
|
67
72
|
oldest_message_id: string | null;
|
|
68
73
|
newest_message_id: string | null;
|
|
69
74
|
}
|
|
70
|
-
type ConversationEventStreamReason =
|
|
75
|
+
type ConversationEventStreamReason = "terminal" | "active_run" | "queued_run" | "context_compression" | "recovering" | "requires_user_action" | "unknown";
|
|
71
76
|
interface ConversationEventStreamRunSummary {
|
|
72
77
|
id: string;
|
|
73
|
-
status: LinkRun[
|
|
78
|
+
status: LinkRun["status"];
|
|
74
79
|
assistant_message_id: string;
|
|
75
80
|
requires_user_action: boolean;
|
|
76
81
|
updated_at: string;
|
|
@@ -84,7 +89,7 @@ interface ConversationEventStreamState {
|
|
|
84
89
|
latest_runs: ConversationEventStreamRunSummary[];
|
|
85
90
|
}
|
|
86
91
|
interface LinkMessagePart {
|
|
87
|
-
type:
|
|
92
|
+
type: "text" | "image" | "file" | "audio" | "video" | "unsupported";
|
|
88
93
|
text?: string;
|
|
89
94
|
blob?: string;
|
|
90
95
|
mime?: string;
|
|
@@ -92,21 +97,21 @@ interface LinkMessagePart {
|
|
|
92
97
|
filename?: string;
|
|
93
98
|
url?: string;
|
|
94
99
|
local_path?: string;
|
|
95
|
-
kind?:
|
|
100
|
+
kind?: "voice";
|
|
96
101
|
is_voice_note?: boolean;
|
|
97
102
|
duration_ms?: number;
|
|
98
103
|
waveform?: number[];
|
|
99
104
|
}
|
|
100
105
|
interface LinkMessageAgentEvent {
|
|
101
106
|
id: string;
|
|
102
|
-
kind?:
|
|
107
|
+
kind?: "tool" | "thinking_delta";
|
|
103
108
|
title: string;
|
|
104
|
-
status:
|
|
109
|
+
status: "running" | "completed" | "failed" | "info";
|
|
105
110
|
created_at: string;
|
|
106
111
|
subtitle?: string;
|
|
107
112
|
detail?: string;
|
|
108
113
|
text?: string;
|
|
109
|
-
phase?:
|
|
114
|
+
phase?: "thinking" | "final";
|
|
110
115
|
completed_at?: string;
|
|
111
116
|
raw?: {
|
|
112
117
|
format: string;
|
|
@@ -115,24 +120,24 @@ interface LinkMessageAgentEvent {
|
|
|
115
120
|
}
|
|
116
121
|
type LinkMessageBlock = {
|
|
117
122
|
id: string;
|
|
118
|
-
type:
|
|
123
|
+
type: "text";
|
|
119
124
|
text: string;
|
|
120
125
|
created_at: string;
|
|
121
126
|
updated_at?: string;
|
|
122
127
|
} | {
|
|
123
128
|
id: string;
|
|
124
|
-
type:
|
|
129
|
+
type: "agent_events";
|
|
125
130
|
events: LinkMessageAgentEvent[];
|
|
126
131
|
created_at: string;
|
|
127
132
|
updated_at?: string;
|
|
128
133
|
};
|
|
129
|
-
type LinkApprovalDecisionScope =
|
|
130
|
-
type LinkApprovalDecision = LinkApprovalDecisionScope |
|
|
131
|
-
type LinkApprovalStatus =
|
|
134
|
+
type LinkApprovalDecisionScope = "once" | "session" | "always";
|
|
135
|
+
type LinkApprovalDecision = LinkApprovalDecisionScope | "deny";
|
|
136
|
+
type LinkApprovalStatus = "pending" | "approved" | "denied" | "expired";
|
|
132
137
|
interface LinkApprovalRequest {
|
|
133
138
|
id: string;
|
|
134
139
|
status: LinkApprovalStatus;
|
|
135
|
-
kind:
|
|
140
|
+
kind: "terminal_command";
|
|
136
141
|
command: string;
|
|
137
142
|
description?: string;
|
|
138
143
|
pattern_key?: string;
|
|
@@ -151,15 +156,15 @@ interface LinkMessage {
|
|
|
151
156
|
id: string;
|
|
152
157
|
schema_version: 1;
|
|
153
158
|
conversation_id: string;
|
|
154
|
-
role:
|
|
155
|
-
status:
|
|
159
|
+
role: "user" | "assistant" | "tool" | "system";
|
|
160
|
+
status: "queued" | "completed" | "streaming" | "failed" | "cancelled";
|
|
156
161
|
run_id?: string;
|
|
157
162
|
client_message_id?: string;
|
|
158
163
|
created_at: string;
|
|
159
164
|
updated_at: string;
|
|
160
165
|
sender: {
|
|
161
166
|
id: string;
|
|
162
|
-
type:
|
|
167
|
+
type: "human" | "agent" | "system" | "tool";
|
|
163
168
|
display_name: string;
|
|
164
169
|
profile_uid?: string;
|
|
165
170
|
profile?: string;
|
|
@@ -204,7 +209,7 @@ interface UnarchiveConversationResult {
|
|
|
204
209
|
}
|
|
205
210
|
interface BulkDeleteConversationResult {
|
|
206
211
|
conversation_id: string;
|
|
207
|
-
status:
|
|
212
|
+
status: "deleted" | "failed";
|
|
208
213
|
hermes_deleted?: boolean;
|
|
209
214
|
hermes_session_ids?: string[];
|
|
210
215
|
deleted_at?: string;
|
|
@@ -215,15 +220,15 @@ interface BulkDeleteConversationResult {
|
|
|
215
220
|
}
|
|
216
221
|
interface BulkArchiveConversationResult {
|
|
217
222
|
conversation_id: string;
|
|
218
|
-
status:
|
|
223
|
+
status: "archived" | "failed";
|
|
219
224
|
archived_at?: string;
|
|
220
225
|
error?: {
|
|
221
226
|
code: string;
|
|
222
227
|
message: string;
|
|
223
228
|
};
|
|
224
229
|
}
|
|
225
|
-
type ConversationClearPlanStatus =
|
|
226
|
-
type ConversationClearPlanTargetStatus =
|
|
230
|
+
type ConversationClearPlanStatus = "prepared" | "executing" | "completed" | "failed";
|
|
231
|
+
type ConversationClearPlanTargetStatus = "active" | "archived";
|
|
227
232
|
interface ConversationClearPlan {
|
|
228
233
|
id: string;
|
|
229
234
|
status: ConversationClearPlanStatus;
|
|
@@ -250,13 +255,32 @@ interface ConversationArchivePlan {
|
|
|
250
255
|
conversations: BulkArchiveConversationResult[];
|
|
251
256
|
completed_at?: string;
|
|
252
257
|
}
|
|
258
|
+
interface ConversationGoalState {
|
|
259
|
+
title: string;
|
|
260
|
+
content: string;
|
|
261
|
+
status: "active" | "paused" | "done" | "cleared";
|
|
262
|
+
updated_at: string;
|
|
263
|
+
turns_used?: number;
|
|
264
|
+
max_turns?: number;
|
|
265
|
+
last_reason?: string;
|
|
266
|
+
usage?: {
|
|
267
|
+
input_tokens: number;
|
|
268
|
+
output_tokens: number;
|
|
269
|
+
total_tokens: number;
|
|
270
|
+
context_tokens?: number;
|
|
271
|
+
context_window?: number;
|
|
272
|
+
usage_percent?: number;
|
|
273
|
+
run_ids?: string[];
|
|
274
|
+
};
|
|
275
|
+
}
|
|
253
276
|
interface LinkRun {
|
|
254
277
|
id: string;
|
|
255
|
-
kind?:
|
|
256
|
-
|
|
278
|
+
kind?: "agent" | "command" | "compression";
|
|
279
|
+
mode?: "message" | "goal";
|
|
280
|
+
queue_mode?: "guided_interrupt";
|
|
257
281
|
queue_promoted_at?: string;
|
|
258
282
|
guided_after_run_id?: string;
|
|
259
|
-
hermes_backend?:
|
|
283
|
+
hermes_backend?: "tui_gateway" | "responses" | "runs";
|
|
260
284
|
hermes_run_id?: string;
|
|
261
285
|
hermes_response_id?: string;
|
|
262
286
|
hermes_rpc_session_id?: string;
|
|
@@ -265,7 +289,7 @@ interface LinkRun {
|
|
|
265
289
|
trigger_message_id: string;
|
|
266
290
|
assistant_message_id: string;
|
|
267
291
|
hermes_session_id: string;
|
|
268
|
-
status:
|
|
292
|
+
status: "queued" | "running" | "completed" | "failed" | "cancelled" | "unknown";
|
|
269
293
|
started_at: string;
|
|
270
294
|
completed_at?: string;
|
|
271
295
|
error_message?: string;
|
|
@@ -278,7 +302,11 @@ interface LinkRun {
|
|
|
278
302
|
language?: string;
|
|
279
303
|
model?: string;
|
|
280
304
|
provider?: string;
|
|
305
|
+
base_url?: string;
|
|
306
|
+
api_mode?: string;
|
|
281
307
|
context_window?: number;
|
|
308
|
+
reasoning_effort?: string;
|
|
309
|
+
reasoning_support_policy?: string;
|
|
282
310
|
usage?: {
|
|
283
311
|
input_tokens: number;
|
|
284
312
|
output_tokens: number;
|
|
@@ -286,12 +314,61 @@ interface LinkRun {
|
|
|
286
314
|
context_tokens?: number;
|
|
287
315
|
context_window?: number;
|
|
288
316
|
usage_percent?: number;
|
|
289
|
-
context_source?:
|
|
317
|
+
context_source?: "explicit" | "probe" | "estimated" | "native";
|
|
290
318
|
};
|
|
319
|
+
context_compression?: ContextCompressionMetadata;
|
|
320
|
+
}
|
|
321
|
+
interface ContextCompressionMetadata {
|
|
322
|
+
operation_id: string;
|
|
323
|
+
generation: number;
|
|
324
|
+
status: "compressing" | "completed" | "failed" | "timed_out" | "cancelled";
|
|
325
|
+
started_at: string;
|
|
326
|
+
completed_at?: string;
|
|
327
|
+
source?: "manual" | "auto";
|
|
328
|
+
focus_provided?: boolean;
|
|
329
|
+
previous_session_id?: string;
|
|
330
|
+
next_session_id?: string;
|
|
331
|
+
usage_before?: ContextCompressionUsage;
|
|
332
|
+
usage_after?: ContextCompressionUsage;
|
|
333
|
+
error_code?: string;
|
|
334
|
+
error_message?: string;
|
|
335
|
+
}
|
|
336
|
+
interface ContextCompressionUsage {
|
|
337
|
+
context_tokens?: number;
|
|
338
|
+
context_window?: number;
|
|
339
|
+
usage_percent?: number;
|
|
340
|
+
source?: "native";
|
|
341
|
+
}
|
|
342
|
+
interface ContextCompressionResult {
|
|
343
|
+
conversation_id: string;
|
|
344
|
+
operation: {
|
|
345
|
+
id: string;
|
|
346
|
+
status: ContextCompressionMetadata["status"];
|
|
347
|
+
marker_message_id: string;
|
|
348
|
+
run_id: string;
|
|
349
|
+
started_at: string;
|
|
350
|
+
};
|
|
351
|
+
user_message?: Pick<LinkMessage, "id" | "status">;
|
|
352
|
+
assistant_message: Pick<LinkMessage, "id" | "status">;
|
|
353
|
+
run: Pick<LinkRun, "id" | "status">;
|
|
354
|
+
last_event_seq: number;
|
|
355
|
+
conversation?: ConversationSummary;
|
|
356
|
+
event_stream?: ConversationEventStreamState;
|
|
357
|
+
}
|
|
358
|
+
interface StartContextCompressionInput {
|
|
359
|
+
conversationId: string;
|
|
360
|
+
focus?: string;
|
|
361
|
+
clientOperationId?: string;
|
|
362
|
+
rawContent?: string;
|
|
363
|
+
createUserMessage?: boolean;
|
|
364
|
+
accountId?: string;
|
|
365
|
+
appInstanceId?: string;
|
|
366
|
+
language?: string;
|
|
291
367
|
}
|
|
292
368
|
interface SendMessageInput {
|
|
293
369
|
conversationId: string;
|
|
294
370
|
content: string;
|
|
371
|
+
mode?: "message" | "goal";
|
|
295
372
|
attachments?: MessageAttachmentInput[];
|
|
296
373
|
clientMessageId?: string;
|
|
297
374
|
idempotencyKey?: string;
|
|
@@ -319,21 +396,29 @@ interface ConversationMessagesPageOptions {
|
|
|
319
396
|
}
|
|
320
397
|
interface SendMessageResult {
|
|
321
398
|
conversation_id: string;
|
|
322
|
-
user_message: Pick<LinkMessage,
|
|
323
|
-
assistant_message: Pick<LinkMessage,
|
|
324
|
-
run: Pick<LinkRun,
|
|
399
|
+
user_message: Pick<LinkMessage, "id" | "status">;
|
|
400
|
+
assistant_message: Pick<LinkMessage, "id" | "status">;
|
|
401
|
+
run: Pick<LinkRun, "id" | "status">;
|
|
325
402
|
last_event_seq: number;
|
|
326
403
|
conversation?: ConversationSummary;
|
|
327
404
|
runtime?: ConversationRuntimeMetadata;
|
|
405
|
+
goal?: ConversationGoalState;
|
|
406
|
+
}
|
|
407
|
+
interface ConversationGoalControlResult {
|
|
408
|
+
conversation_id: string;
|
|
409
|
+
goal: ConversationGoalState;
|
|
410
|
+
last_event_seq: number;
|
|
411
|
+
cancel_run?: Pick<LinkRun, "id" | "status">;
|
|
412
|
+
run?: Pick<LinkRun, "id" | "status">;
|
|
328
413
|
}
|
|
329
414
|
interface CancelRunResult {
|
|
330
415
|
conversation_id: string;
|
|
331
|
-
run: Pick<LinkRun,
|
|
416
|
+
run: Pick<LinkRun, "id" | "status">;
|
|
332
417
|
last_event_seq: number;
|
|
333
418
|
}
|
|
334
419
|
interface QueuedRunActionResult {
|
|
335
420
|
conversation_id: string;
|
|
336
|
-
queued_run: Pick<LinkRun,
|
|
421
|
+
queued_run: Pick<LinkRun, "id" | "status">;
|
|
337
422
|
last_event_seq: number;
|
|
338
423
|
}
|
|
339
424
|
type ConversationEventListener = (event: ConversationEvent) => void;
|
|
@@ -383,6 +468,10 @@ interface LinkStatisticsFilter {
|
|
|
383
468
|
profileName?: string | null;
|
|
384
469
|
}
|
|
385
470
|
|
|
471
|
+
type SupportedLanguage = 'zh-CN' | 'en';
|
|
472
|
+
|
|
473
|
+
type HermesReasoningEffort = 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
|
|
474
|
+
|
|
386
475
|
type LogLevel = 'debug' | 'info' | 'warn' | 'error';
|
|
387
476
|
interface FileLoggerOptions {
|
|
388
477
|
paths?: RuntimePaths;
|
|
@@ -411,8 +500,6 @@ declare class FileLogger {
|
|
|
411
500
|
private rotateIfNeeded;
|
|
412
501
|
}
|
|
413
502
|
|
|
414
|
-
type SupportedLanguage = 'zh-CN' | 'en';
|
|
415
|
-
|
|
416
503
|
interface ConversationWorkspace {
|
|
417
504
|
id: string;
|
|
418
505
|
name: string;
|
|
@@ -462,6 +549,7 @@ declare class ConversationService {
|
|
|
462
549
|
private readonly maintenance;
|
|
463
550
|
private readonly orchestration;
|
|
464
551
|
private readonly queries;
|
|
552
|
+
private readonly contextCompression;
|
|
465
553
|
private readonly runLifecycle;
|
|
466
554
|
private hermesSessionSyncPromise;
|
|
467
555
|
private cronDeliverySyncPromise;
|
|
@@ -496,6 +584,11 @@ declare class ConversationService {
|
|
|
496
584
|
accountId?: string;
|
|
497
585
|
appInstanceId?: string;
|
|
498
586
|
workspaceId?: string | null;
|
|
587
|
+
modelId?: string;
|
|
588
|
+
modelProvider?: string;
|
|
589
|
+
modelBaseUrl?: string;
|
|
590
|
+
modelApiMode?: string;
|
|
591
|
+
reasoningEffort?: HermesReasoningEffort;
|
|
499
592
|
}): Promise<ConversationSummary>;
|
|
500
593
|
ensureCronInboxConversation(input?: {
|
|
501
594
|
profileName?: string;
|
|
@@ -542,9 +635,19 @@ declare class ConversationService {
|
|
|
542
635
|
page: ConversationMessagesPageInfo;
|
|
543
636
|
event_stream: ConversationEventStreamState;
|
|
544
637
|
}>;
|
|
545
|
-
setConversationModel(conversationId: string,
|
|
638
|
+
setConversationModel(conversationId: string, input: string | {
|
|
639
|
+
modelId?: string;
|
|
640
|
+
modelProvider?: string;
|
|
641
|
+
modelBaseUrl?: string;
|
|
642
|
+
modelApiMode?: string;
|
|
643
|
+
reasoningEffort?: HermesReasoningEffort;
|
|
644
|
+
}): Promise<{
|
|
546
645
|
conversation_id: string;
|
|
547
646
|
default_model: string;
|
|
647
|
+
conversation_model?: string;
|
|
648
|
+
default_reasoning_effort?: string;
|
|
649
|
+
conversation_reasoning_effort?: string;
|
|
650
|
+
scope: 'conversation';
|
|
548
651
|
runtime: ConversationRuntimeMetadata;
|
|
549
652
|
last_event_seq: number;
|
|
550
653
|
}>;
|
|
@@ -573,6 +676,9 @@ declare class ConversationService {
|
|
|
573
676
|
subscribeAll(listener: ConversationEventListener): () => void;
|
|
574
677
|
shouldPublishNotificationEvent(event: Pick<ConversationEvent, 'type' | 'conversation_id' | 'payload'>): Promise<boolean>;
|
|
575
678
|
sendMessage(input: SendMessageInput): Promise<SendMessageResult>;
|
|
679
|
+
setGoalPaused(conversationId: string, paused: boolean, language?: SupportedLanguage): Promise<ConversationGoalControlResult>;
|
|
680
|
+
clearGoal(conversationId: string, language?: SupportedLanguage): Promise<ConversationGoalControlResult>;
|
|
681
|
+
startContextCompression(input: StartContextCompressionInput): Promise<ContextCompressionResult>;
|
|
576
682
|
cancelRun(conversationId: string, runId: string): Promise<CancelRunResult>;
|
|
577
683
|
cancelRunById(runId: string): Promise<CancelRunResult>;
|
|
578
684
|
guideQueuedRun(conversationId: string, runId: string): Promise<QueuedRunActionResult>;
|
package/dist/http/app.js
CHANGED