@openacp/cli 0.5.3 → 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 +51 -16
- package/dist/action-detect-6M5GCGAU.js +15 -0
- package/dist/admin-IKPS5PFC.js +16 -0
- package/dist/agents-55NX3DHM.js +14 -0
- package/dist/{api-client-UN7BXQOQ.js → api-client-BH2JFHQW.js} +4 -2
- package/dist/{autostart-K73RQZVV.js → autostart-A7JRU4WJ.js} +6 -2
- package/dist/{chunk-ECBD5I5R.js → chunk-2KJC3ILH.js} +123 -16
- package/dist/chunk-2KJC3ILH.js.map +1 -0
- package/dist/{chunk-2Z2XPUD5.js → chunk-4LFDEW22.js} +53 -5
- 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-7G5QKLLF.js +105 -0
- package/dist/chunk-7G5QKLLF.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-AKIU4JBF.js +145 -0
- package/dist/chunk-AKIU4JBF.js.map +1 -0
- package/dist/{chunk-KSIQZC3J.js → chunk-EVFJW45N.js} +1 -1
- package/dist/chunk-EVFJW45N.js.map +1 -0
- package/dist/chunk-GINCOFNW.js +134 -0
- package/dist/chunk-GINCOFNW.js.map +1 -0
- package/dist/chunk-H7ZMPBZC.js +203 -0
- package/dist/chunk-H7ZMPBZC.js.map +1 -0
- package/dist/chunk-I7WC6E5S.js +71 -0
- package/dist/chunk-I7WC6E5S.js.map +1 -0
- package/dist/{chunk-6DAZSKE5.js → chunk-IMILOCR5.js} +2 -2
- package/dist/chunk-LGQYTK55.js +442 -0
- package/dist/chunk-LGQYTK55.js.map +1 -0
- package/dist/{chunk-X6LLG7XN.js → chunk-PMGNLNSH.js} +15 -6
- package/dist/chunk-PMGNLNSH.js.map +1 -0
- package/dist/{chunk-LCJIPE5S.js → chunk-R3UJUOXI.js} +889 -591
- package/dist/chunk-R3UJUOXI.js.map +1 -0
- package/dist/chunk-SM3G6UAX.js +122 -0
- package/dist/chunk-SM3G6UAX.js.map +1 -0
- package/dist/chunk-T22OLSET.js +265 -0
- package/dist/chunk-T22OLSET.js.map +1 -0
- package/dist/chunk-THBR6OXH.js +62 -0
- package/dist/chunk-THBR6OXH.js.map +1 -0
- package/dist/{chunk-5KYLXEG3.js → chunk-TOZQ3JFN.js} +52 -9
- package/dist/chunk-TOZQ3JFN.js.map +1 -0
- package/dist/{chunk-IQIPQTQT.js → chunk-UB7XUO7C.js} +171 -26
- package/dist/chunk-UB7XUO7C.js.map +1 -0
- package/dist/{chunk-OORPX73T.js → chunk-W3EYKZNQ.js} +17 -2
- package/dist/chunk-W3EYKZNQ.js.map +1 -0
- package/dist/{chunk-K53OZH5Y.js → chunk-ZCHNAM3B.js} +76 -2
- package/dist/chunk-ZCHNAM3B.js.map +1 -0
- package/dist/cli.js +30 -29
- package/dist/cli.js.map +1 -1
- package/dist/{config-OH26EIWN.js → config-AK2W3E67.js} +2 -2
- package/dist/config-editor-VIA7A72X.js +12 -0
- package/dist/{config-registry-SNKA2EH2.js → config-registry-QQOJ2GQP.js} +2 -2
- package/dist/{daemon-VKCONJUY.js → daemon-G27YZUWB.js} +3 -3
- package/dist/discord-2DKRH45T.js +2044 -0
- package/dist/discord-2DKRH45T.js.map +1 -0
- package/dist/doctor-AN6AZ3PF.js +9 -0
- package/dist/doctor-CHCYUTV5.js +14 -0
- package/dist/doctor-CHCYUTV5.js.map +1 -0
- package/dist/index.d.ts +331 -6
- package/dist/index.js +21 -11
- package/dist/{main-NEYPQHB4.js → main-56SPFYW4.js} +32 -24
- package/dist/main-56SPFYW4.js.map +1 -0
- package/dist/{menu-J5YVH665.js → menu-XR2GET2B.js} +2 -2
- package/dist/menu-XR2GET2B.js.map +1 -0
- package/dist/new-session-DRRP2J7E.js +16 -0
- package/dist/new-session-DRRP2J7E.js.map +1 -0
- package/dist/session-FVFLBREJ.js +19 -0
- package/dist/session-FVFLBREJ.js.map +1 -0
- package/dist/settings-LPOLJ6SA.js +12 -0
- package/dist/settings-LPOLJ6SA.js.map +1 -0
- package/dist/{setup-ZCWGOEAH.js → setup-IPWJCIJM.js} +9 -5
- package/dist/setup-IPWJCIJM.js.map +1 -0
- package/dist/{version-VC5CPXBX.js → version-ALWGGVKM.js} +2 -2
- package/dist/version-ALWGGVKM.js.map +1 -0
- package/package.json +2 -1
- package/dist/chunk-2Z2XPUD5.js.map +0 -1
- package/dist/chunk-5KYLXEG3.js.map +0 -1
- package/dist/chunk-ECBD5I5R.js.map +0 -1
- package/dist/chunk-IQIPQTQT.js.map +0 -1
- package/dist/chunk-IURZ4QHG.js.map +0 -1
- package/dist/chunk-K53OZH5Y.js.map +0 -1
- package/dist/chunk-KSIQZC3J.js.map +0 -1
- package/dist/chunk-LCJIPE5S.js.map +0 -1
- package/dist/chunk-OORPX73T.js.map +0 -1
- package/dist/chunk-X6LLG7XN.js.map +0 -1
- package/dist/chunk-Z46LGZ7R.js.map +0 -1
- package/dist/config-editor-5TICUK3K.js +0 -12
- package/dist/doctor-X6UCE7GQ.js +0 -9
- package/dist/main-NEYPQHB4.js.map +0 -1
- /package/dist/{api-client-UN7BXQOQ.js.map → action-detect-6M5GCGAU.js.map} +0 -0
- /package/dist/{autostart-K73RQZVV.js.map → admin-IKPS5PFC.js.map} +0 -0
- /package/dist/{config-OH26EIWN.js.map → agents-55NX3DHM.js.map} +0 -0
- /package/dist/{config-editor-5TICUK3K.js.map → api-client-BH2JFHQW.js.map} +0 -0
- /package/dist/{config-registry-SNKA2EH2.js.map → autostart-A7JRU4WJ.js.map} +0 -0
- /package/dist/{chunk-6DAZSKE5.js.map → chunk-IMILOCR5.js.map} +0 -0
- /package/dist/{daemon-VKCONJUY.js.map → config-AK2W3E67.js.map} +0 -0
- /package/dist/{doctor-X6UCE7GQ.js.map → config-editor-VIA7A72X.js.map} +0 -0
- /package/dist/{menu-J5YVH665.js.map → config-registry-QQOJ2GQP.js.map} +0 -0
- /package/dist/{setup-ZCWGOEAH.js.map → daemon-G27YZUWB.js.map} +0 -0
- /package/dist/{version-VC5CPXBX.js.map → doctor-AN6AZ3PF.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,30 @@ 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
|
+
}
|
|
236
|
+
interface DiscordPlatformData {
|
|
237
|
+
threadId: string;
|
|
238
|
+
skillMsgId?: string;
|
|
239
|
+
}
|
|
212
240
|
|
|
213
241
|
declare const PLUGINS_DIR: string;
|
|
214
242
|
declare const LoggingSchema: z.ZodDefault<z.ZodObject<{
|
|
@@ -272,6 +300,26 @@ declare const TunnelSchema: z.ZodDefault<z.ZodObject<{
|
|
|
272
300
|
} | undefined;
|
|
273
301
|
}>>;
|
|
274
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>;
|
|
275
323
|
declare const ConfigSchema: z.ZodObject<{
|
|
276
324
|
channels: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
277
325
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -398,6 +446,25 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
398
446
|
token?: string | undefined;
|
|
399
447
|
} | undefined;
|
|
400
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
|
+
}>>;
|
|
401
468
|
integrations: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
402
469
|
installed: z.ZodBoolean;
|
|
403
470
|
installedAt: z.ZodOptional<z.ZodString>;
|
|
@@ -408,6 +475,88 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
408
475
|
installed: boolean;
|
|
409
476
|
installedAt?: string | undefined;
|
|
410
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
|
+
}>>>;
|
|
411
560
|
}, "strip", z.ZodTypeAny, {
|
|
412
561
|
api: {
|
|
413
562
|
port: number;
|
|
@@ -456,10 +605,33 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
456
605
|
sessionStore: {
|
|
457
606
|
ttlDays: number;
|
|
458
607
|
};
|
|
608
|
+
usage: {
|
|
609
|
+
enabled: boolean;
|
|
610
|
+
warningThreshold: number;
|
|
611
|
+
currency: string;
|
|
612
|
+
retentionDays: number;
|
|
613
|
+
monthlyBudget?: number | undefined;
|
|
614
|
+
};
|
|
459
615
|
integrations: Record<string, {
|
|
460
616
|
installed: boolean;
|
|
461
617
|
installedAt?: string | undefined;
|
|
462
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
|
+
};
|
|
463
635
|
}, {
|
|
464
636
|
channels: Record<string, z.objectInputType<{
|
|
465
637
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -508,10 +680,33 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
508
680
|
sessionStore?: {
|
|
509
681
|
ttlDays?: number | undefined;
|
|
510
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;
|
|
511
690
|
integrations?: Record<string, {
|
|
512
691
|
installed: boolean;
|
|
513
692
|
installedAt?: string | undefined;
|
|
514
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;
|
|
515
710
|
}>;
|
|
516
711
|
type Config = z.infer<typeof ConfigSchema>;
|
|
517
712
|
declare function expandHome(p: string): string;
|
|
@@ -584,6 +779,9 @@ declare abstract class ChannelAdapter<TCore = unknown> implements IChannelAdapte
|
|
|
584
779
|
deleteSessionThread(_sessionId: string): Promise<void>;
|
|
585
780
|
sendSkillCommands(_sessionId: string, _commands: AgentCommand[]): Promise<void>;
|
|
586
781
|
cleanupSkillCommands(_sessionId: string): Promise<void>;
|
|
782
|
+
archiveSessionTopic(_sessionId: string): Promise<{
|
|
783
|
+
newThreadId: string;
|
|
784
|
+
} | null>;
|
|
587
785
|
}
|
|
588
786
|
|
|
589
787
|
declare class NotificationManager {
|
|
@@ -739,6 +937,70 @@ declare class PermissionGate {
|
|
|
739
937
|
private cleanup;
|
|
740
938
|
}
|
|
741
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
|
+
|
|
742
1004
|
interface SessionEvents {
|
|
743
1005
|
agent_event: (event: AgentEvent) => void;
|
|
744
1006
|
permission_request: (request: PermissionRequest) => void;
|
|
@@ -759,15 +1021,18 @@ declare class Session extends TypedEmitter<SessionEvents> {
|
|
|
759
1021
|
name?: string;
|
|
760
1022
|
createdAt: Date;
|
|
761
1023
|
dangerousMode: boolean;
|
|
1024
|
+
archiving: boolean;
|
|
762
1025
|
log: Logger;
|
|
763
1026
|
readonly permissionGate: PermissionGate;
|
|
764
1027
|
private readonly queue;
|
|
1028
|
+
private speechService?;
|
|
765
1029
|
constructor(opts: {
|
|
766
1030
|
id?: string;
|
|
767
1031
|
channelId: string;
|
|
768
1032
|
agentName: string;
|
|
769
1033
|
workingDirectory: string;
|
|
770
1034
|
agentInstance: AgentInstance;
|
|
1035
|
+
speechService?: SpeechService;
|
|
771
1036
|
});
|
|
772
1037
|
get status(): SessionStatus;
|
|
773
1038
|
/** Transition to active — from initializing, error, or cancelled */
|
|
@@ -784,6 +1049,7 @@ declare class Session extends TypedEmitter<SessionEvents> {
|
|
|
784
1049
|
get promptRunning(): boolean;
|
|
785
1050
|
enqueuePrompt(text: string, attachments?: Attachment[]): Promise<void>;
|
|
786
1051
|
private processPrompt;
|
|
1052
|
+
private maybeTranscribeAudio;
|
|
787
1053
|
private autoName;
|
|
788
1054
|
/** Fire-and-forget warm-up: primes model cache while user types their first message */
|
|
789
1055
|
warmup(): Promise<void>;
|
|
@@ -949,6 +1215,47 @@ declare class SessionBridge {
|
|
|
949
1215
|
private wireLifecycle;
|
|
950
1216
|
}
|
|
951
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
|
+
|
|
952
1259
|
declare class OpenACPCore {
|
|
953
1260
|
configManager: ConfigManager;
|
|
954
1261
|
agentCatalog: AgentCatalog;
|
|
@@ -957,18 +1264,28 @@ declare class OpenACPCore {
|
|
|
957
1264
|
notificationManager: NotificationManager;
|
|
958
1265
|
messageTransformer: MessageTransformer;
|
|
959
1266
|
fileService: FileService;
|
|
1267
|
+
readonly speechService: SpeechService;
|
|
960
1268
|
adapters: Map<string, ChannelAdapter>;
|
|
961
1269
|
/** Set by main.ts — triggers graceful shutdown with restart exit code */
|
|
962
1270
|
requestRestart: (() => Promise<void>) | null;
|
|
963
1271
|
private _tunnelService?;
|
|
964
1272
|
private sessionStore;
|
|
965
1273
|
private resumeLocks;
|
|
1274
|
+
readonly usageStore: UsageStore | null;
|
|
1275
|
+
readonly usageBudget: UsageBudget | null;
|
|
966
1276
|
constructor(configManager: ConfigManager);
|
|
967
1277
|
get tunnelService(): TunnelService | undefined;
|
|
968
1278
|
set tunnelService(service: TunnelService | undefined);
|
|
969
1279
|
registerAdapter(name: string, adapter: ChannelAdapter): void;
|
|
970
1280
|
start(): Promise<void>;
|
|
971
1281
|
stop(): Promise<void>;
|
|
1282
|
+
archiveSession(sessionId: string): Promise<{
|
|
1283
|
+
ok: true;
|
|
1284
|
+
newThreadId: string;
|
|
1285
|
+
} | {
|
|
1286
|
+
ok: false;
|
|
1287
|
+
error: string;
|
|
1288
|
+
}>;
|
|
972
1289
|
handleMessage(message: IncomingMessage): Promise<void>;
|
|
973
1290
|
createSession(params: {
|
|
974
1291
|
channelId: string;
|
|
@@ -1014,11 +1331,11 @@ declare function startDaemon(pidPath?: string, logDir?: string): {
|
|
|
1014
1331
|
} | {
|
|
1015
1332
|
error: string;
|
|
1016
1333
|
};
|
|
1017
|
-
declare function stopDaemon(pidPath?: string): {
|
|
1334
|
+
declare function stopDaemon(pidPath?: string): Promise<{
|
|
1018
1335
|
stopped: boolean;
|
|
1019
1336
|
pid?: number;
|
|
1020
1337
|
error?: string;
|
|
1021
|
-
}
|
|
1338
|
+
}>;
|
|
1022
1339
|
declare function getPidPath(): string;
|
|
1023
1340
|
|
|
1024
1341
|
declare function isAutoStartSupported(): boolean;
|
|
@@ -1091,12 +1408,16 @@ declare class ApiServer {
|
|
|
1091
1408
|
private actualPort;
|
|
1092
1409
|
private portFilePath;
|
|
1093
1410
|
private startedAt;
|
|
1094
|
-
|
|
1411
|
+
private secret;
|
|
1412
|
+
private secretFilePath;
|
|
1413
|
+
constructor(core: OpenACPCore, config: ApiConfig, portFilePath?: string, topicManager?: TopicManager | undefined, secretFilePath?: string);
|
|
1095
1414
|
start(): Promise<void>;
|
|
1096
1415
|
stop(): Promise<void>;
|
|
1097
1416
|
getPort(): number;
|
|
1098
1417
|
private writePortFile;
|
|
1099
1418
|
private removePortFile;
|
|
1419
|
+
private loadOrCreateSecret;
|
|
1420
|
+
private authenticate;
|
|
1100
1421
|
private handleRequest;
|
|
1101
1422
|
private handleCreateSession;
|
|
1102
1423
|
private handleSendPrompt;
|
|
@@ -1115,6 +1436,7 @@ declare class ApiServer {
|
|
|
1115
1436
|
private handleTunnelStopAll;
|
|
1116
1437
|
private handleNotify;
|
|
1117
1438
|
private handleRestart;
|
|
1439
|
+
private handleArchiveSession;
|
|
1118
1440
|
private handleCancelSession;
|
|
1119
1441
|
private handleListSessions;
|
|
1120
1442
|
private handleAdoptSession;
|
|
@@ -1180,6 +1502,9 @@ declare class TelegramAdapter extends ChannelAdapter<OpenACPCore> {
|
|
|
1180
1502
|
private downloadTelegramFile;
|
|
1181
1503
|
private handleIncomingMedia;
|
|
1182
1504
|
cleanupSkillCommands(sessionId: string): Promise<void>;
|
|
1505
|
+
archiveSessionTopic(sessionId: string): Promise<{
|
|
1506
|
+
newThreadId: string;
|
|
1507
|
+
} | null>;
|
|
1183
1508
|
}
|
|
1184
1509
|
|
|
1185
|
-
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, 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
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
AgentInstance,
|
|
3
3
|
AgentManager,
|
|
4
4
|
ApiServer,
|
|
5
|
-
ChannelAdapter,
|
|
6
5
|
FileService,
|
|
6
|
+
GroqSTT,
|
|
7
7
|
MessageTransformer,
|
|
8
8
|
NotificationManager,
|
|
9
9
|
OpenACPCore,
|
|
@@ -12,25 +12,31 @@ import {
|
|
|
12
12
|
Session,
|
|
13
13
|
SessionBridge,
|
|
14
14
|
SessionManager,
|
|
15
|
+
SpeechService,
|
|
15
16
|
StderrCapture,
|
|
16
17
|
TelegramAdapter,
|
|
17
18
|
TopicManager,
|
|
18
19
|
TypedEmitter,
|
|
20
|
+
UsageBudget,
|
|
21
|
+
UsageStore,
|
|
19
22
|
nodeToWebReadable,
|
|
20
23
|
nodeToWebWritable
|
|
21
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-R3UJUOXI.js";
|
|
25
|
+
import {
|
|
26
|
+
ChannelAdapter
|
|
27
|
+
} from "./chunk-LGQYTK55.js";
|
|
22
28
|
import {
|
|
23
29
|
runConfigEditor
|
|
24
|
-
} from "./chunk-
|
|
25
|
-
import "./chunk-
|
|
30
|
+
} from "./chunk-UB7XUO7C.js";
|
|
31
|
+
import "./chunk-ZCHNAM3B.js";
|
|
26
32
|
import "./chunk-NAMYZIS5.js";
|
|
27
|
-
import "./chunk-
|
|
33
|
+
import "./chunk-7QJS2XBD.js";
|
|
28
34
|
import {
|
|
29
35
|
getPidPath,
|
|
30
36
|
getStatus,
|
|
31
37
|
startDaemon,
|
|
32
38
|
stopDaemon
|
|
33
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-TOZQ3JFN.js";
|
|
34
40
|
import {
|
|
35
41
|
AgentCatalog
|
|
36
42
|
} from "./chunk-J6X5SW6O.js";
|
|
@@ -42,15 +48,15 @@ import {
|
|
|
42
48
|
isAutoStartInstalled,
|
|
43
49
|
isAutoStartSupported,
|
|
44
50
|
uninstallAutoStart
|
|
45
|
-
} from "./chunk-
|
|
46
|
-
import "./chunk-
|
|
51
|
+
} from "./chunk-PMGNLNSH.js";
|
|
52
|
+
import "./chunk-2KJC3ILH.js";
|
|
47
53
|
import "./chunk-JKBFUAJK.js";
|
|
48
54
|
import {
|
|
49
55
|
installPlugin,
|
|
50
56
|
listPlugins,
|
|
51
57
|
loadAdapterFactory,
|
|
52
58
|
uninstallPlugin
|
|
53
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-IMILOCR5.js";
|
|
54
60
|
import {
|
|
55
61
|
CONFIG_REGISTRY,
|
|
56
62
|
getConfigValue,
|
|
@@ -58,12 +64,12 @@ import {
|
|
|
58
64
|
getSafeFields,
|
|
59
65
|
isHotReloadable,
|
|
60
66
|
resolveOptions
|
|
61
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-4TR5Y3MP.js";
|
|
62
68
|
import {
|
|
63
69
|
ConfigManager,
|
|
64
70
|
PLUGINS_DIR,
|
|
65
71
|
expandHome
|
|
66
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-4LFDEW22.js";
|
|
67
73
|
import {
|
|
68
74
|
cleanupOldSessionLogs,
|
|
69
75
|
createChildLogger,
|
|
@@ -83,6 +89,7 @@ export {
|
|
|
83
89
|
ChannelAdapter,
|
|
84
90
|
ConfigManager,
|
|
85
91
|
FileService,
|
|
92
|
+
GroqSTT,
|
|
86
93
|
MessageTransformer,
|
|
87
94
|
NotificationManager,
|
|
88
95
|
OpenACPCore,
|
|
@@ -92,10 +99,13 @@ export {
|
|
|
92
99
|
Session,
|
|
93
100
|
SessionBridge,
|
|
94
101
|
SessionManager,
|
|
102
|
+
SpeechService,
|
|
95
103
|
StderrCapture,
|
|
96
104
|
TelegramAdapter,
|
|
97
105
|
TopicManager,
|
|
98
106
|
TypedEmitter,
|
|
107
|
+
UsageBudget,
|
|
108
|
+
UsageStore,
|
|
99
109
|
cleanupOldSessionLogs,
|
|
100
110
|
createChildLogger,
|
|
101
111
|
createSessionLogger,
|