@openacp/cli 0.6.0 → 0.6.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/README.md +11 -2
- package/dist/{chunk-MHFCZGRW.js → chunk-2KJC3ILH.js} +13 -3
- package/dist/{chunk-MHFCZGRW.js.map → chunk-2KJC3ILH.js.map} +1 -1
- package/dist/{chunk-DWQKUECJ.js → chunk-4LFDEW22.js} +42 -4
- package/dist/chunk-4LFDEW22.js.map +1 -0
- package/dist/{chunk-Z46LGZ7R.js → chunk-4TR5Y3MP.js} +18 -1
- package/dist/chunk-4TR5Y3MP.js.map +1 -0
- package/dist/{chunk-IURZ4QHG.js → chunk-7QJS2XBD.js} +2 -1
- package/dist/chunk-7QJS2XBD.js.map +1 -0
- package/dist/{chunk-3WPG7GXA.js → chunk-GINCOFNW.js} +2 -2
- package/dist/{chunk-437NLISU.js → chunk-IMILOCR5.js} +2 -2
- package/dist/{chunk-5NBWM7P6.js → chunk-LGQYTK55.js} +5 -1
- package/dist/chunk-LGQYTK55.js.map +1 -0
- package/dist/{chunk-V2V767XI.js → chunk-R3UJUOXI.js} +842 -162
- package/dist/chunk-R3UJUOXI.js.map +1 -0
- package/dist/{chunk-YYQXWA62.js → chunk-TOZQ3JFN.js} +2 -2
- package/dist/{chunk-6Q7PZWCL.js → chunk-UB7XUO7C.js} +3 -3
- package/dist/{chunk-SPX7CKWV.js → chunk-ZCHNAM3B.js} +2 -2
- package/dist/cli.js +19 -19
- package/dist/{config-KF2MQWAP.js → config-AK2W3E67.js} +2 -2
- package/dist/{config-editor-OTODXUF7.js → config-editor-VIA7A72X.js} +4 -4
- package/dist/{config-registry-SNKA2EH2.js → config-registry-QQOJ2GQP.js} +2 -2
- package/dist/{daemon-U6UC7OM4.js → daemon-G27YZUWB.js} +3 -3
- package/dist/{discord-SLLKRUP7.js → discord-2DKRH45T.js} +16 -6
- package/dist/discord-2DKRH45T.js.map +1 -0
- package/dist/doctor-AN6AZ3PF.js +9 -0
- package/dist/{doctor-DB5PRQ6D.js → doctor-CHCYUTV5.js} +4 -4
- package/dist/index.d.ts +320 -3
- package/dist/index.js +18 -10
- package/dist/{main-M6RH3SS5.js → main-56SPFYW4.js} +16 -16
- package/dist/{menu-J5YVH665.js → menu-XR2GET2B.js} +2 -2
- package/dist/{setup-LI5CKYDK.js → setup-IPWJCIJM.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-5NBWM7P6.js.map +0 -1
- package/dist/chunk-DWQKUECJ.js.map +0 -1
- package/dist/chunk-IURZ4QHG.js.map +0 -1
- package/dist/chunk-V2V767XI.js.map +0 -1
- package/dist/chunk-Z46LGZ7R.js.map +0 -1
- package/dist/discord-SLLKRUP7.js.map +0 -1
- package/dist/doctor-SYWNJFYK.js +0 -9
- /package/dist/{chunk-3WPG7GXA.js.map → chunk-GINCOFNW.js.map} +0 -0
- /package/dist/{chunk-437NLISU.js.map → chunk-IMILOCR5.js.map} +0 -0
- /package/dist/{chunk-YYQXWA62.js.map → chunk-TOZQ3JFN.js.map} +0 -0
- /package/dist/{chunk-6Q7PZWCL.js.map → chunk-UB7XUO7C.js.map} +0 -0
- /package/dist/{chunk-SPX7CKWV.js.map → chunk-ZCHNAM3B.js.map} +0 -0
- /package/dist/{config-KF2MQWAP.js.map → config-AK2W3E67.js.map} +0 -0
- /package/dist/{config-editor-OTODXUF7.js.map → config-editor-VIA7A72X.js.map} +0 -0
- /package/dist/{config-registry-SNKA2EH2.js.map → config-registry-QQOJ2GQP.js.map} +0 -0
- /package/dist/{daemon-U6UC7OM4.js.map → daemon-G27YZUWB.js.map} +0 -0
- /package/dist/{doctor-DB5PRQ6D.js.map → doctor-AN6AZ3PF.js.map} +0 -0
- /package/dist/{doctor-SYWNJFYK.js.map → doctor-CHCYUTV5.js.map} +0 -0
- /package/dist/{main-M6RH3SS5.js.map → main-56SPFYW4.js.map} +0 -0
- /package/dist/{menu-J5YVH665.js.map → menu-XR2GET2B.js.map} +0 -0
- /package/dist/{setup-LI5CKYDK.js.map → setup-IPWJCIJM.js.map} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ interface Attachment {
|
|
|
10
10
|
fileName: string;
|
|
11
11
|
mimeType: string;
|
|
12
12
|
size: number;
|
|
13
|
+
originalFilePath?: string;
|
|
13
14
|
}
|
|
14
15
|
interface IncomingMessage {
|
|
15
16
|
channelId: string;
|
|
@@ -19,7 +20,7 @@ interface IncomingMessage {
|
|
|
19
20
|
attachments?: Attachment[];
|
|
20
21
|
}
|
|
21
22
|
interface OutgoingMessage {
|
|
22
|
-
type: "text" | "thought" | "tool_call" | "tool_update" | "plan" | "usage" | "session_end" | "error" | "attachment";
|
|
23
|
+
type: "text" | "thought" | "tool_call" | "tool_update" | "plan" | "usage" | "session_end" | "error" | "attachment" | "system_message";
|
|
23
24
|
text: string;
|
|
24
25
|
metadata?: Record<string, unknown>;
|
|
25
26
|
attachment?: Attachment;
|
|
@@ -37,7 +38,7 @@ interface PermissionOption {
|
|
|
37
38
|
interface NotificationMessage {
|
|
38
39
|
sessionId: string;
|
|
39
40
|
sessionName?: string;
|
|
40
|
-
type: "completed" | "error" | "permission" | "input_required";
|
|
41
|
+
type: "completed" | "error" | "permission" | "input_required" | "budget_warning";
|
|
41
42
|
summary: string;
|
|
42
43
|
deepLink?: string;
|
|
43
44
|
}
|
|
@@ -100,6 +101,9 @@ type AgentEvent = {
|
|
|
100
101
|
} | {
|
|
101
102
|
type: "error";
|
|
102
103
|
message: string;
|
|
104
|
+
} | {
|
|
105
|
+
type: "system_message";
|
|
106
|
+
message: string;
|
|
103
107
|
};
|
|
104
108
|
interface PlanEntry {
|
|
105
109
|
content: string;
|
|
@@ -209,6 +213,26 @@ interface TelegramPlatformData {
|
|
|
209
213
|
topicId: number;
|
|
210
214
|
skillMsgId?: number;
|
|
211
215
|
}
|
|
216
|
+
interface UsageRecord {
|
|
217
|
+
id: string;
|
|
218
|
+
sessionId: string;
|
|
219
|
+
agentName: string;
|
|
220
|
+
tokensUsed: number;
|
|
221
|
+
contextSize: number;
|
|
222
|
+
cost?: {
|
|
223
|
+
amount: number;
|
|
224
|
+
currency: string;
|
|
225
|
+
};
|
|
226
|
+
timestamp: string;
|
|
227
|
+
}
|
|
228
|
+
interface UsageSummary {
|
|
229
|
+
period: "today" | "week" | "month" | "all";
|
|
230
|
+
totalTokens: number;
|
|
231
|
+
totalCost: number;
|
|
232
|
+
currency: string;
|
|
233
|
+
sessionCount: number;
|
|
234
|
+
recordCount: number;
|
|
235
|
+
}
|
|
212
236
|
interface DiscordPlatformData {
|
|
213
237
|
threadId: string;
|
|
214
238
|
skillMsgId?: string;
|
|
@@ -276,6 +300,26 @@ declare const TunnelSchema: z.ZodDefault<z.ZodObject<{
|
|
|
276
300
|
} | undefined;
|
|
277
301
|
}>>;
|
|
278
302
|
type TunnelConfig = z.infer<typeof TunnelSchema>;
|
|
303
|
+
declare const UsageSchema: z.ZodDefault<z.ZodObject<{
|
|
304
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
305
|
+
monthlyBudget: z.ZodOptional<z.ZodNumber>;
|
|
306
|
+
warningThreshold: z.ZodDefault<z.ZodNumber>;
|
|
307
|
+
currency: z.ZodDefault<z.ZodString>;
|
|
308
|
+
retentionDays: z.ZodDefault<z.ZodNumber>;
|
|
309
|
+
}, "strip", z.ZodTypeAny, {
|
|
310
|
+
enabled: boolean;
|
|
311
|
+
warningThreshold: number;
|
|
312
|
+
currency: string;
|
|
313
|
+
retentionDays: number;
|
|
314
|
+
monthlyBudget?: number | undefined;
|
|
315
|
+
}, {
|
|
316
|
+
enabled?: boolean | undefined;
|
|
317
|
+
monthlyBudget?: number | undefined;
|
|
318
|
+
warningThreshold?: number | undefined;
|
|
319
|
+
currency?: string | undefined;
|
|
320
|
+
retentionDays?: number | undefined;
|
|
321
|
+
}>>;
|
|
322
|
+
type UsageConfig = z.infer<typeof UsageSchema>;
|
|
279
323
|
declare const ConfigSchema: z.ZodObject<{
|
|
280
324
|
channels: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
281
325
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -402,6 +446,25 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
402
446
|
token?: string | undefined;
|
|
403
447
|
} | undefined;
|
|
404
448
|
}>>;
|
|
449
|
+
usage: z.ZodDefault<z.ZodObject<{
|
|
450
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
451
|
+
monthlyBudget: z.ZodOptional<z.ZodNumber>;
|
|
452
|
+
warningThreshold: z.ZodDefault<z.ZodNumber>;
|
|
453
|
+
currency: z.ZodDefault<z.ZodString>;
|
|
454
|
+
retentionDays: z.ZodDefault<z.ZodNumber>;
|
|
455
|
+
}, "strip", z.ZodTypeAny, {
|
|
456
|
+
enabled: boolean;
|
|
457
|
+
warningThreshold: number;
|
|
458
|
+
currency: string;
|
|
459
|
+
retentionDays: number;
|
|
460
|
+
monthlyBudget?: number | undefined;
|
|
461
|
+
}, {
|
|
462
|
+
enabled?: boolean | undefined;
|
|
463
|
+
monthlyBudget?: number | undefined;
|
|
464
|
+
warningThreshold?: number | undefined;
|
|
465
|
+
currency?: string | undefined;
|
|
466
|
+
retentionDays?: number | undefined;
|
|
467
|
+
}>>;
|
|
405
468
|
integrations: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
406
469
|
installed: z.ZodBoolean;
|
|
407
470
|
installedAt: z.ZodOptional<z.ZodString>;
|
|
@@ -412,6 +475,88 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
412
475
|
installed: boolean;
|
|
413
476
|
installedAt?: string | undefined;
|
|
414
477
|
}>>>;
|
|
478
|
+
speech: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
479
|
+
stt: z.ZodDefault<z.ZodObject<{
|
|
480
|
+
provider: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
481
|
+
providers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
482
|
+
apiKey: z.ZodString;
|
|
483
|
+
model: z.ZodOptional<z.ZodString>;
|
|
484
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
485
|
+
apiKey: z.ZodString;
|
|
486
|
+
model: z.ZodOptional<z.ZodString>;
|
|
487
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
488
|
+
apiKey: z.ZodString;
|
|
489
|
+
model: z.ZodOptional<z.ZodString>;
|
|
490
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
491
|
+
}, "strip", z.ZodTypeAny, {
|
|
492
|
+
provider: string | null;
|
|
493
|
+
providers: Record<string, z.objectOutputType<{
|
|
494
|
+
apiKey: z.ZodString;
|
|
495
|
+
model: z.ZodOptional<z.ZodString>;
|
|
496
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
497
|
+
}, {
|
|
498
|
+
provider?: string | null | undefined;
|
|
499
|
+
providers?: Record<string, z.objectInputType<{
|
|
500
|
+
apiKey: z.ZodString;
|
|
501
|
+
model: z.ZodOptional<z.ZodString>;
|
|
502
|
+
}, z.ZodTypeAny, "passthrough">> | undefined;
|
|
503
|
+
}>>;
|
|
504
|
+
tts: z.ZodDefault<z.ZodObject<{
|
|
505
|
+
provider: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
506
|
+
providers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
507
|
+
apiKey: z.ZodString;
|
|
508
|
+
model: z.ZodOptional<z.ZodString>;
|
|
509
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
510
|
+
apiKey: z.ZodString;
|
|
511
|
+
model: z.ZodOptional<z.ZodString>;
|
|
512
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
513
|
+
apiKey: z.ZodString;
|
|
514
|
+
model: z.ZodOptional<z.ZodString>;
|
|
515
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
516
|
+
}, "strip", z.ZodTypeAny, {
|
|
517
|
+
provider: string | null;
|
|
518
|
+
providers: Record<string, z.objectOutputType<{
|
|
519
|
+
apiKey: z.ZodString;
|
|
520
|
+
model: z.ZodOptional<z.ZodString>;
|
|
521
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
522
|
+
}, {
|
|
523
|
+
provider?: string | null | undefined;
|
|
524
|
+
providers?: Record<string, z.objectInputType<{
|
|
525
|
+
apiKey: z.ZodString;
|
|
526
|
+
model: z.ZodOptional<z.ZodString>;
|
|
527
|
+
}, z.ZodTypeAny, "passthrough">> | undefined;
|
|
528
|
+
}>>;
|
|
529
|
+
}, "strip", z.ZodTypeAny, {
|
|
530
|
+
stt: {
|
|
531
|
+
provider: string | null;
|
|
532
|
+
providers: Record<string, z.objectOutputType<{
|
|
533
|
+
apiKey: z.ZodString;
|
|
534
|
+
model: z.ZodOptional<z.ZodString>;
|
|
535
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
536
|
+
};
|
|
537
|
+
tts: {
|
|
538
|
+
provider: string | null;
|
|
539
|
+
providers: Record<string, z.objectOutputType<{
|
|
540
|
+
apiKey: z.ZodString;
|
|
541
|
+
model: z.ZodOptional<z.ZodString>;
|
|
542
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
543
|
+
};
|
|
544
|
+
}, {
|
|
545
|
+
stt?: {
|
|
546
|
+
provider?: string | null | undefined;
|
|
547
|
+
providers?: Record<string, z.objectInputType<{
|
|
548
|
+
apiKey: z.ZodString;
|
|
549
|
+
model: z.ZodOptional<z.ZodString>;
|
|
550
|
+
}, z.ZodTypeAny, "passthrough">> | undefined;
|
|
551
|
+
} | undefined;
|
|
552
|
+
tts?: {
|
|
553
|
+
provider?: string | null | undefined;
|
|
554
|
+
providers?: Record<string, z.objectInputType<{
|
|
555
|
+
apiKey: z.ZodString;
|
|
556
|
+
model: z.ZodOptional<z.ZodString>;
|
|
557
|
+
}, z.ZodTypeAny, "passthrough">> | undefined;
|
|
558
|
+
} | undefined;
|
|
559
|
+
}>>>;
|
|
415
560
|
}, "strip", z.ZodTypeAny, {
|
|
416
561
|
api: {
|
|
417
562
|
port: number;
|
|
@@ -460,10 +605,33 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
460
605
|
sessionStore: {
|
|
461
606
|
ttlDays: number;
|
|
462
607
|
};
|
|
608
|
+
usage: {
|
|
609
|
+
enabled: boolean;
|
|
610
|
+
warningThreshold: number;
|
|
611
|
+
currency: string;
|
|
612
|
+
retentionDays: number;
|
|
613
|
+
monthlyBudget?: number | undefined;
|
|
614
|
+
};
|
|
463
615
|
integrations: Record<string, {
|
|
464
616
|
installed: boolean;
|
|
465
617
|
installedAt?: string | undefined;
|
|
466
618
|
}>;
|
|
619
|
+
speech: {
|
|
620
|
+
stt: {
|
|
621
|
+
provider: string | null;
|
|
622
|
+
providers: Record<string, z.objectOutputType<{
|
|
623
|
+
apiKey: z.ZodString;
|
|
624
|
+
model: z.ZodOptional<z.ZodString>;
|
|
625
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
626
|
+
};
|
|
627
|
+
tts: {
|
|
628
|
+
provider: string | null;
|
|
629
|
+
providers: Record<string, z.objectOutputType<{
|
|
630
|
+
apiKey: z.ZodString;
|
|
631
|
+
model: z.ZodOptional<z.ZodString>;
|
|
632
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
633
|
+
};
|
|
634
|
+
};
|
|
467
635
|
}, {
|
|
468
636
|
channels: Record<string, z.objectInputType<{
|
|
469
637
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -512,10 +680,33 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
512
680
|
sessionStore?: {
|
|
513
681
|
ttlDays?: number | undefined;
|
|
514
682
|
} | undefined;
|
|
683
|
+
usage?: {
|
|
684
|
+
enabled?: boolean | undefined;
|
|
685
|
+
monthlyBudget?: number | undefined;
|
|
686
|
+
warningThreshold?: number | undefined;
|
|
687
|
+
currency?: string | undefined;
|
|
688
|
+
retentionDays?: number | undefined;
|
|
689
|
+
} | undefined;
|
|
515
690
|
integrations?: Record<string, {
|
|
516
691
|
installed: boolean;
|
|
517
692
|
installedAt?: string | undefined;
|
|
518
693
|
}> | undefined;
|
|
694
|
+
speech?: {
|
|
695
|
+
stt?: {
|
|
696
|
+
provider?: string | null | undefined;
|
|
697
|
+
providers?: Record<string, z.objectInputType<{
|
|
698
|
+
apiKey: z.ZodString;
|
|
699
|
+
model: z.ZodOptional<z.ZodString>;
|
|
700
|
+
}, z.ZodTypeAny, "passthrough">> | undefined;
|
|
701
|
+
} | undefined;
|
|
702
|
+
tts?: {
|
|
703
|
+
provider?: string | null | undefined;
|
|
704
|
+
providers?: Record<string, z.objectInputType<{
|
|
705
|
+
apiKey: z.ZodString;
|
|
706
|
+
model: z.ZodOptional<z.ZodString>;
|
|
707
|
+
}, z.ZodTypeAny, "passthrough">> | undefined;
|
|
708
|
+
} | undefined;
|
|
709
|
+
} | undefined;
|
|
519
710
|
}>;
|
|
520
711
|
type Config = z.infer<typeof ConfigSchema>;
|
|
521
712
|
declare function expandHome(p: string): string;
|
|
@@ -588,6 +779,9 @@ declare abstract class ChannelAdapter<TCore = unknown> implements IChannelAdapte
|
|
|
588
779
|
deleteSessionThread(_sessionId: string): Promise<void>;
|
|
589
780
|
sendSkillCommands(_sessionId: string, _commands: AgentCommand[]): Promise<void>;
|
|
590
781
|
cleanupSkillCommands(_sessionId: string): Promise<void>;
|
|
782
|
+
archiveSessionTopic(_sessionId: string): Promise<{
|
|
783
|
+
newThreadId: string;
|
|
784
|
+
} | null>;
|
|
591
785
|
}
|
|
592
786
|
|
|
593
787
|
declare class NotificationManager {
|
|
@@ -743,6 +937,70 @@ declare class PermissionGate {
|
|
|
743
937
|
private cleanup;
|
|
744
938
|
}
|
|
745
939
|
|
|
940
|
+
interface STTOptions {
|
|
941
|
+
language?: string;
|
|
942
|
+
model?: string;
|
|
943
|
+
}
|
|
944
|
+
interface STTResult {
|
|
945
|
+
text: string;
|
|
946
|
+
language?: string;
|
|
947
|
+
duration?: number;
|
|
948
|
+
}
|
|
949
|
+
interface TTSOptions {
|
|
950
|
+
language?: string;
|
|
951
|
+
voice?: string;
|
|
952
|
+
model?: string;
|
|
953
|
+
}
|
|
954
|
+
interface TTSResult {
|
|
955
|
+
audioBuffer: Buffer;
|
|
956
|
+
mimeType: string;
|
|
957
|
+
}
|
|
958
|
+
interface STTProvider {
|
|
959
|
+
readonly name: string;
|
|
960
|
+
transcribe(audioBuffer: Buffer, mimeType: string, options?: STTOptions): Promise<STTResult>;
|
|
961
|
+
}
|
|
962
|
+
interface TTSProvider {
|
|
963
|
+
readonly name: string;
|
|
964
|
+
synthesize(text: string, options?: TTSOptions): Promise<TTSResult>;
|
|
965
|
+
}
|
|
966
|
+
interface SpeechProviderConfig {
|
|
967
|
+
apiKey: string;
|
|
968
|
+
model?: string;
|
|
969
|
+
[key: string]: unknown;
|
|
970
|
+
}
|
|
971
|
+
interface SpeechServiceConfig {
|
|
972
|
+
stt: {
|
|
973
|
+
provider: string | null;
|
|
974
|
+
providers: Record<string, SpeechProviderConfig>;
|
|
975
|
+
};
|
|
976
|
+
tts: {
|
|
977
|
+
provider: string | null;
|
|
978
|
+
providers: Record<string, SpeechProviderConfig>;
|
|
979
|
+
};
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
declare class SpeechService {
|
|
983
|
+
private config;
|
|
984
|
+
private sttProviders;
|
|
985
|
+
private ttsProviders;
|
|
986
|
+
constructor(config: SpeechServiceConfig);
|
|
987
|
+
registerSTTProvider(name: string, provider: STTProvider): void;
|
|
988
|
+
registerTTSProvider(name: string, provider: TTSProvider): void;
|
|
989
|
+
isSTTAvailable(): boolean;
|
|
990
|
+
isTTSAvailable(): boolean;
|
|
991
|
+
transcribe(audioBuffer: Buffer, mimeType: string, options?: STTOptions): Promise<STTResult>;
|
|
992
|
+
synthesize(text: string, options?: TTSOptions): Promise<TTSResult>;
|
|
993
|
+
updateConfig(config: SpeechServiceConfig): void;
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
declare class GroqSTT implements STTProvider {
|
|
997
|
+
private apiKey;
|
|
998
|
+
private defaultModel;
|
|
999
|
+
readonly name = "groq";
|
|
1000
|
+
constructor(apiKey: string, defaultModel?: string);
|
|
1001
|
+
transcribe(audioBuffer: Buffer, mimeType: string, options?: STTOptions): Promise<STTResult>;
|
|
1002
|
+
}
|
|
1003
|
+
|
|
746
1004
|
interface SessionEvents {
|
|
747
1005
|
agent_event: (event: AgentEvent) => void;
|
|
748
1006
|
permission_request: (request: PermissionRequest) => void;
|
|
@@ -763,15 +1021,18 @@ declare class Session extends TypedEmitter<SessionEvents> {
|
|
|
763
1021
|
name?: string;
|
|
764
1022
|
createdAt: Date;
|
|
765
1023
|
dangerousMode: boolean;
|
|
1024
|
+
archiving: boolean;
|
|
766
1025
|
log: Logger;
|
|
767
1026
|
readonly permissionGate: PermissionGate;
|
|
768
1027
|
private readonly queue;
|
|
1028
|
+
private speechService?;
|
|
769
1029
|
constructor(opts: {
|
|
770
1030
|
id?: string;
|
|
771
1031
|
channelId: string;
|
|
772
1032
|
agentName: string;
|
|
773
1033
|
workingDirectory: string;
|
|
774
1034
|
agentInstance: AgentInstance;
|
|
1035
|
+
speechService?: SpeechService;
|
|
775
1036
|
});
|
|
776
1037
|
get status(): SessionStatus;
|
|
777
1038
|
/** Transition to active — from initializing, error, or cancelled */
|
|
@@ -788,6 +1049,7 @@ declare class Session extends TypedEmitter<SessionEvents> {
|
|
|
788
1049
|
get promptRunning(): boolean;
|
|
789
1050
|
enqueuePrompt(text: string, attachments?: Attachment[]): Promise<void>;
|
|
790
1051
|
private processPrompt;
|
|
1052
|
+
private maybeTranscribeAudio;
|
|
791
1053
|
private autoName;
|
|
792
1054
|
/** Fire-and-forget warm-up: primes model cache while user types their first message */
|
|
793
1055
|
warmup(): Promise<void>;
|
|
@@ -953,6 +1215,47 @@ declare class SessionBridge {
|
|
|
953
1215
|
private wireLifecycle;
|
|
954
1216
|
}
|
|
955
1217
|
|
|
1218
|
+
declare class UsageStore {
|
|
1219
|
+
private filePath;
|
|
1220
|
+
private retentionDays;
|
|
1221
|
+
private records;
|
|
1222
|
+
private debounceTimer;
|
|
1223
|
+
private cleanupInterval;
|
|
1224
|
+
private flushHandler;
|
|
1225
|
+
constructor(filePath: string, retentionDays: number);
|
|
1226
|
+
append(record: UsageRecord): void;
|
|
1227
|
+
query(period: "today" | "week" | "month" | "all"): UsageSummary;
|
|
1228
|
+
getMonthlyTotal(): {
|
|
1229
|
+
totalCost: number;
|
|
1230
|
+
currency: string;
|
|
1231
|
+
};
|
|
1232
|
+
cleanup(): void;
|
|
1233
|
+
flushSync(): void;
|
|
1234
|
+
destroy(): void;
|
|
1235
|
+
private load;
|
|
1236
|
+
private getCutoff;
|
|
1237
|
+
private scheduleDiskWrite;
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
declare class UsageBudget {
|
|
1241
|
+
private store;
|
|
1242
|
+
private config;
|
|
1243
|
+
private now;
|
|
1244
|
+
private lastNotifiedStatus;
|
|
1245
|
+
private lastNotifiedMonth;
|
|
1246
|
+
constructor(store: UsageStore, config: UsageConfig, now?: () => Date);
|
|
1247
|
+
check(): {
|
|
1248
|
+
status: "ok" | "warning" | "exceeded";
|
|
1249
|
+
message?: string;
|
|
1250
|
+
};
|
|
1251
|
+
getStatus(): {
|
|
1252
|
+
status: "ok" | "warning" | "exceeded";
|
|
1253
|
+
used: number;
|
|
1254
|
+
budget: number;
|
|
1255
|
+
percent: number;
|
|
1256
|
+
};
|
|
1257
|
+
}
|
|
1258
|
+
|
|
956
1259
|
declare class OpenACPCore {
|
|
957
1260
|
configManager: ConfigManager;
|
|
958
1261
|
agentCatalog: AgentCatalog;
|
|
@@ -961,18 +1264,28 @@ declare class OpenACPCore {
|
|
|
961
1264
|
notificationManager: NotificationManager;
|
|
962
1265
|
messageTransformer: MessageTransformer;
|
|
963
1266
|
fileService: FileService;
|
|
1267
|
+
readonly speechService: SpeechService;
|
|
964
1268
|
adapters: Map<string, ChannelAdapter>;
|
|
965
1269
|
/** Set by main.ts — triggers graceful shutdown with restart exit code */
|
|
966
1270
|
requestRestart: (() => Promise<void>) | null;
|
|
967
1271
|
private _tunnelService?;
|
|
968
1272
|
private sessionStore;
|
|
969
1273
|
private resumeLocks;
|
|
1274
|
+
readonly usageStore: UsageStore | null;
|
|
1275
|
+
readonly usageBudget: UsageBudget | null;
|
|
970
1276
|
constructor(configManager: ConfigManager);
|
|
971
1277
|
get tunnelService(): TunnelService | undefined;
|
|
972
1278
|
set tunnelService(service: TunnelService | undefined);
|
|
973
1279
|
registerAdapter(name: string, adapter: ChannelAdapter): void;
|
|
974
1280
|
start(): Promise<void>;
|
|
975
1281
|
stop(): Promise<void>;
|
|
1282
|
+
archiveSession(sessionId: string): Promise<{
|
|
1283
|
+
ok: true;
|
|
1284
|
+
newThreadId: string;
|
|
1285
|
+
} | {
|
|
1286
|
+
ok: false;
|
|
1287
|
+
error: string;
|
|
1288
|
+
}>;
|
|
976
1289
|
handleMessage(message: IncomingMessage): Promise<void>;
|
|
977
1290
|
createSession(params: {
|
|
978
1291
|
channelId: string;
|
|
@@ -1123,6 +1436,7 @@ declare class ApiServer {
|
|
|
1123
1436
|
private handleTunnelStopAll;
|
|
1124
1437
|
private handleNotify;
|
|
1125
1438
|
private handleRestart;
|
|
1439
|
+
private handleArchiveSession;
|
|
1126
1440
|
private handleCancelSession;
|
|
1127
1441
|
private handleListSessions;
|
|
1128
1442
|
private handleAdoptSession;
|
|
@@ -1188,6 +1502,9 @@ declare class TelegramAdapter extends ChannelAdapter<OpenACPCore> {
|
|
|
1188
1502
|
private downloadTelegramFile;
|
|
1189
1503
|
private handleIncomingMedia;
|
|
1190
1504
|
cleanupSkillCommands(sessionId: string): Promise<void>;
|
|
1505
|
+
archiveSessionTopic(sessionId: string): Promise<{
|
|
1506
|
+
newThreadId: string;
|
|
1507
|
+
} | null>;
|
|
1191
1508
|
}
|
|
1192
1509
|
|
|
1193
|
-
export { type AdapterFactory, AgentCatalog, type AgentCommand, type AgentDefinition, type AgentDistribution, type AgentEvent, AgentInstance, type AgentListItem, AgentManager, AgentStore, type ApiConfig, ApiServer, type Attachment, type AvailabilityResult, type BridgeDeps, CONFIG_REGISTRY, ChannelAdapter, type ChannelConfig, type CleanupResult, type Config, type ConfigFieldDef, ConfigManager, type DeleteTopicResult, type DiscordPlatformData, FileService, type IChannelAdapter, type IncomingMessage, type InstallProgress, type InstallResult, type InstalledAgent, type Logger, type LoggingConfig, MessageTransformer, NotificationManager, type NotificationMessage, OpenACPCore, type OutgoingMessage, PLUGINS_DIR, PermissionGate, type PermissionOption, type PermissionRequest, type PlanEntry, PromptQueue, type RegistryAgent, type RegistryBinaryTarget, type RegistryDistribution, Session, SessionBridge, type SessionEvents, SessionManager, type SessionRecord, type SessionStatus, StderrCapture, TelegramAdapter, type TelegramPlatformData, type TopicInfo, TopicManager, TypedEmitter, cleanupOldSessionLogs, createChildLogger, createSessionLogger, expandHome, getConfigValue, getFieldDef, getPidPath, getSafeFields, getStatus, initLogger, installAutoStart, installPlugin, isAutoStartInstalled, isAutoStartSupported, isHotReloadable, listPlugins, loadAdapterFactory, log, nodeToWebReadable, nodeToWebWritable, resolveOptions, runConfigEditor, setLogLevel, shutdownLogger, startDaemon, stopDaemon, uninstallAutoStart, uninstallPlugin };
|
|
1510
|
+
export { type AdapterFactory, AgentCatalog, type AgentCommand, type AgentDefinition, type AgentDistribution, type AgentEvent, AgentInstance, type AgentListItem, AgentManager, AgentStore, type ApiConfig, ApiServer, type Attachment, type AvailabilityResult, type BridgeDeps, CONFIG_REGISTRY, ChannelAdapter, type ChannelConfig, type CleanupResult, type Config, type ConfigFieldDef, ConfigManager, type DeleteTopicResult, type DiscordPlatformData, FileService, GroqSTT, type IChannelAdapter, type IncomingMessage, type InstallProgress, type InstallResult, type InstalledAgent, type Logger, type LoggingConfig, MessageTransformer, NotificationManager, type NotificationMessage, OpenACPCore, type OutgoingMessage, PLUGINS_DIR, PermissionGate, type PermissionOption, type PermissionRequest, type PlanEntry, PromptQueue, type RegistryAgent, type RegistryBinaryTarget, type RegistryDistribution, type STTOptions, type STTProvider, type STTResult, Session, SessionBridge, type SessionEvents, SessionManager, type SessionRecord, type SessionStatus, type SpeechProviderConfig, SpeechService, type SpeechServiceConfig, StderrCapture, type TTSOptions, type TTSProvider, type TTSResult, TelegramAdapter, type TelegramPlatformData, type TopicInfo, TopicManager, TypedEmitter, UsageBudget, type UsageConfig, type UsageRecord, UsageStore, type UsageSummary, cleanupOldSessionLogs, createChildLogger, createSessionLogger, expandHome, getConfigValue, getFieldDef, getPidPath, getSafeFields, getStatus, initLogger, installAutoStart, installPlugin, isAutoStartInstalled, isAutoStartSupported, isHotReloadable, listPlugins, loadAdapterFactory, log, nodeToWebReadable, nodeToWebWritable, resolveOptions, runConfigEditor, setLogLevel, shutdownLogger, startDaemon, stopDaemon, uninstallAutoStart, uninstallPlugin };
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
AgentManager,
|
|
4
4
|
ApiServer,
|
|
5
5
|
FileService,
|
|
6
|
+
GroqSTT,
|
|
6
7
|
MessageTransformer,
|
|
7
8
|
NotificationManager,
|
|
8
9
|
OpenACPCore,
|
|
@@ -11,28 +12,31 @@ import {
|
|
|
11
12
|
Session,
|
|
12
13
|
SessionBridge,
|
|
13
14
|
SessionManager,
|
|
15
|
+
SpeechService,
|
|
14
16
|
StderrCapture,
|
|
15
17
|
TelegramAdapter,
|
|
16
18
|
TopicManager,
|
|
17
19
|
TypedEmitter,
|
|
20
|
+
UsageBudget,
|
|
21
|
+
UsageStore,
|
|
18
22
|
nodeToWebReadable,
|
|
19
23
|
nodeToWebWritable
|
|
20
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-R3UJUOXI.js";
|
|
21
25
|
import {
|
|
22
26
|
ChannelAdapter
|
|
23
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-LGQYTK55.js";
|
|
24
28
|
import {
|
|
25
29
|
runConfigEditor
|
|
26
|
-
} from "./chunk-
|
|
27
|
-
import "./chunk-
|
|
30
|
+
} from "./chunk-UB7XUO7C.js";
|
|
31
|
+
import "./chunk-ZCHNAM3B.js";
|
|
28
32
|
import "./chunk-NAMYZIS5.js";
|
|
29
|
-
import "./chunk-
|
|
33
|
+
import "./chunk-7QJS2XBD.js";
|
|
30
34
|
import {
|
|
31
35
|
getPidPath,
|
|
32
36
|
getStatus,
|
|
33
37
|
startDaemon,
|
|
34
38
|
stopDaemon
|
|
35
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-TOZQ3JFN.js";
|
|
36
40
|
import {
|
|
37
41
|
AgentCatalog
|
|
38
42
|
} from "./chunk-J6X5SW6O.js";
|
|
@@ -45,14 +49,14 @@ import {
|
|
|
45
49
|
isAutoStartSupported,
|
|
46
50
|
uninstallAutoStart
|
|
47
51
|
} from "./chunk-PMGNLNSH.js";
|
|
48
|
-
import "./chunk-
|
|
52
|
+
import "./chunk-2KJC3ILH.js";
|
|
49
53
|
import "./chunk-JKBFUAJK.js";
|
|
50
54
|
import {
|
|
51
55
|
installPlugin,
|
|
52
56
|
listPlugins,
|
|
53
57
|
loadAdapterFactory,
|
|
54
58
|
uninstallPlugin
|
|
55
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-IMILOCR5.js";
|
|
56
60
|
import {
|
|
57
61
|
CONFIG_REGISTRY,
|
|
58
62
|
getConfigValue,
|
|
@@ -60,12 +64,12 @@ import {
|
|
|
60
64
|
getSafeFields,
|
|
61
65
|
isHotReloadable,
|
|
62
66
|
resolveOptions
|
|
63
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-4TR5Y3MP.js";
|
|
64
68
|
import {
|
|
65
69
|
ConfigManager,
|
|
66
70
|
PLUGINS_DIR,
|
|
67
71
|
expandHome
|
|
68
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-4LFDEW22.js";
|
|
69
73
|
import {
|
|
70
74
|
cleanupOldSessionLogs,
|
|
71
75
|
createChildLogger,
|
|
@@ -85,6 +89,7 @@ export {
|
|
|
85
89
|
ChannelAdapter,
|
|
86
90
|
ConfigManager,
|
|
87
91
|
FileService,
|
|
92
|
+
GroqSTT,
|
|
88
93
|
MessageTransformer,
|
|
89
94
|
NotificationManager,
|
|
90
95
|
OpenACPCore,
|
|
@@ -94,10 +99,13 @@ export {
|
|
|
94
99
|
Session,
|
|
95
100
|
SessionBridge,
|
|
96
101
|
SessionManager,
|
|
102
|
+
SpeechService,
|
|
97
103
|
StderrCapture,
|
|
98
104
|
TelegramAdapter,
|
|
99
105
|
TopicManager,
|
|
100
106
|
TypedEmitter,
|
|
107
|
+
UsageBudget,
|
|
108
|
+
UsageStore,
|
|
101
109
|
cleanupOldSessionLogs,
|
|
102
110
|
createChildLogger,
|
|
103
111
|
createSessionLogger,
|
|
@@ -4,25 +4,25 @@ import {
|
|
|
4
4
|
OpenACPCore,
|
|
5
5
|
TelegramAdapter,
|
|
6
6
|
TopicManager
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-R3UJUOXI.js";
|
|
8
|
+
import "./chunk-LGQYTK55.js";
|
|
9
|
+
import "./chunk-UB7XUO7C.js";
|
|
10
|
+
import "./chunk-ZCHNAM3B.js";
|
|
11
11
|
import "./chunk-NAMYZIS5.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-7QJS2XBD.js";
|
|
13
|
+
import "./chunk-TOZQ3JFN.js";
|
|
14
14
|
import "./chunk-J6X5SW6O.js";
|
|
15
15
|
import "./chunk-5HGXUCMX.js";
|
|
16
16
|
import "./chunk-PMGNLNSH.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-2KJC3ILH.js";
|
|
18
18
|
import "./chunk-JKBFUAJK.js";
|
|
19
19
|
import {
|
|
20
20
|
loadAdapterFactory
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import "./chunk-
|
|
21
|
+
} from "./chunk-IMILOCR5.js";
|
|
22
|
+
import "./chunk-4TR5Y3MP.js";
|
|
23
23
|
import {
|
|
24
24
|
ConfigManager
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-4LFDEW22.js";
|
|
26
26
|
import {
|
|
27
27
|
cleanupOldSessionLogs,
|
|
28
28
|
initLogger,
|
|
@@ -35,7 +35,7 @@ var RESTART_EXIT_CODE = 75;
|
|
|
35
35
|
var shuttingDown = false;
|
|
36
36
|
async function startServer() {
|
|
37
37
|
if (process.argv.includes("--daemon-child")) {
|
|
38
|
-
const { writePidFile, readPidFile, getPidPath, shouldAutoStart } = await import("./daemon-
|
|
38
|
+
const { writePidFile, readPidFile, getPidPath, shouldAutoStart } = await import("./daemon-G27YZUWB.js");
|
|
39
39
|
if (!shouldAutoStart()) {
|
|
40
40
|
process.exit(0);
|
|
41
41
|
}
|
|
@@ -54,7 +54,7 @@ async function startServer() {
|
|
|
54
54
|
const configManager = new ConfigManager();
|
|
55
55
|
const configExists = await configManager.exists();
|
|
56
56
|
if (!configExists) {
|
|
57
|
-
const { runSetup } = await import("./setup-
|
|
57
|
+
const { runSetup } = await import("./setup-IPWJCIJM.js");
|
|
58
58
|
const shouldStart = await runSetup(configManager);
|
|
59
59
|
if (!shouldStart) process.exit(0);
|
|
60
60
|
}
|
|
@@ -80,7 +80,7 @@ async function startServer() {
|
|
|
80
80
|
core.registerAdapter("telegram", new TelegramAdapter(core, channelConfig));
|
|
81
81
|
log.info({ adapter: "telegram" }, "Adapter registered");
|
|
82
82
|
} else if (channelName === "discord") {
|
|
83
|
-
const { DiscordAdapter } = await import("./discord-
|
|
83
|
+
const { DiscordAdapter } = await import("./discord-2DKRH45T.js");
|
|
84
84
|
core.registerAdapter("discord", new DiscordAdapter(core, channelConfig));
|
|
85
85
|
log.info({ adapter: "discord" }, "Adapter registered");
|
|
86
86
|
} else if (channelConfig.adapter) {
|
|
@@ -116,13 +116,13 @@ async function startServer() {
|
|
|
116
116
|
}
|
|
117
117
|
const isDaemon = process.argv.includes("--daemon-child");
|
|
118
118
|
if (isDaemon) {
|
|
119
|
-
const { removePidFile, getPidPath } = await import("./daemon-
|
|
119
|
+
const { removePidFile, getPidPath } = await import("./daemon-G27YZUWB.js");
|
|
120
120
|
removePidFile(getPidPath());
|
|
121
121
|
}
|
|
122
122
|
if (exitCode === RESTART_EXIT_CODE) {
|
|
123
123
|
if (isDaemon) {
|
|
124
124
|
const { spawn: spawnChild } = await import("child_process");
|
|
125
|
-
const { expandHome } = await import("./config-
|
|
125
|
+
const { expandHome } = await import("./config-AK2W3E67.js");
|
|
126
126
|
const fs = await import("fs");
|
|
127
127
|
const pathMod = await import("path");
|
|
128
128
|
const cliPath = pathMod.resolve(process.argv[1]);
|
|
@@ -195,4 +195,4 @@ export {
|
|
|
195
195
|
RESTART_EXIT_CODE,
|
|
196
196
|
startServer
|
|
197
197
|
};
|
|
198
|
-
//# sourceMappingURL=main-
|
|
198
|
+
//# sourceMappingURL=main-56SPFYW4.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
handleClear,
|
|
5
5
|
handleHelp,
|
|
6
6
|
handleMenu
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-7QJS2XBD.js";
|
|
8
8
|
export {
|
|
9
9
|
buildMenuKeyboard,
|
|
10
10
|
buildSkillMessages,
|
|
@@ -12,4 +12,4 @@ export {
|
|
|
12
12
|
handleHelp,
|
|
13
13
|
handleMenu
|
|
14
14
|
};
|
|
15
|
-
//# sourceMappingURL=menu-
|
|
15
|
+
//# sourceMappingURL=menu-XR2GET2B.js.map
|
|
@@ -11,9 +11,9 @@ import {
|
|
|
11
11
|
validateBotToken,
|
|
12
12
|
validateChatId,
|
|
13
13
|
validateDiscordToken
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-2KJC3ILH.js";
|
|
15
15
|
import "./chunk-JKBFUAJK.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-4LFDEW22.js";
|
|
17
17
|
import "./chunk-ESOPMQAY.js";
|
|
18
18
|
export {
|
|
19
19
|
detectAgents,
|
|
@@ -29,4 +29,4 @@ export {
|
|
|
29
29
|
validateChatId,
|
|
30
30
|
validateDiscordToken
|
|
31
31
|
};
|
|
32
|
-
//# sourceMappingURL=setup-
|
|
32
|
+
//# sourceMappingURL=setup-IPWJCIJM.js.map
|