@openacp/cli 0.4.10 → 0.5.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/README.md +57 -4
- package/dist/agent-catalog-4IAJ7HEG.js +10 -0
- package/dist/agent-registry-B5YAMA4T.js +8 -0
- package/dist/agent-store-ZBXGOFPH.js +8 -0
- package/dist/api-client-UN7BXQOQ.js +11 -0
- package/dist/{autostart-DZ3MHHMM.js → autostart-K73RQZVV.js} +3 -3
- package/dist/chunk-5HGXUCMX.js +83 -0
- package/dist/chunk-5HGXUCMX.js.map +1 -0
- package/dist/{chunk-UAUTLC4E.js → chunk-D73LCTPF.js} +75 -37
- package/dist/chunk-D73LCTPF.js.map +1 -0
- package/dist/{chunk-LYKCQTH5.js → chunk-ESOPMQAY.js} +5 -1
- package/dist/chunk-ESOPMQAY.js.map +1 -0
- package/dist/{chunk-KPI4HGJC.js → chunk-FWN3UIRT.js} +1631 -970
- package/dist/chunk-FWN3UIRT.js.map +1 -0
- package/dist/chunk-IRGYTNLP.js +650 -0
- package/dist/chunk-IRGYTNLP.js.map +1 -0
- package/dist/{chunk-ZRFBLD3W.js → chunk-JRF4G4X7.js} +71 -25
- package/dist/chunk-JRF4G4X7.js.map +1 -0
- package/dist/{chunk-6MJLVZXV.js → chunk-LAFKARV3.js} +58 -21
- package/dist/{chunk-6MJLVZXV.js.map → chunk-LAFKARV3.js.map} +1 -1
- package/dist/chunk-NAMYZIS5.js +1 -0
- package/dist/{chunk-HZD3CGPK.js → chunk-NDR5JCS7.js} +3 -3
- package/dist/chunk-OORPX73T.js +30 -0
- package/dist/chunk-OORPX73T.js.map +1 -0
- package/dist/{chunk-V3BA2MJ6.js → chunk-RF3DUYFO.js} +2 -2
- package/dist/chunk-S3DRLJPM.js +422 -0
- package/dist/chunk-S3DRLJPM.js.map +1 -0
- package/dist/chunk-UG6X672R.js +90 -0
- package/dist/chunk-UG6X672R.js.map +1 -0
- package/dist/{chunk-C6YIUTGR.js → chunk-VBEWSWVL.js} +2 -2
- package/dist/{chunk-MRKYJ422.js → chunk-X6LLG7XN.js} +2 -2
- package/dist/chunk-XJJ7LPXP.js +85 -0
- package/dist/chunk-XJJ7LPXP.js.map +1 -0
- package/dist/chunk-Z46LGZ7R.js +110 -0
- package/dist/chunk-Z46LGZ7R.js.map +1 -0
- package/dist/cli.js +313 -52
- package/dist/cli.js.map +1 -1
- package/dist/{config-H2DSEHNW.js → config-PCPIBPUA.js} +3 -3
- package/dist/config-editor-5L7AJ5AF.js +12 -0
- package/dist/config-editor-5L7AJ5AF.js.map +1 -0
- package/dist/config-registry-SNKA2EH2.js +17 -0
- package/dist/config-registry-SNKA2EH2.js.map +1 -0
- package/dist/{daemon-VF6HJQXD.js → daemon-JZLFRUW6.js} +4 -4
- package/dist/daemon-JZLFRUW6.js.map +1 -0
- package/dist/data/registry-snapshot.json +876 -0
- package/dist/doctor-N2HKKUUQ.js +9 -0
- package/dist/doctor-N2HKKUUQ.js.map +1 -0
- package/dist/index.d.ts +212 -43
- package/dist/index.js +43 -14
- package/dist/install-cloudflared-BTGUD7SW.js +8 -0
- package/dist/install-cloudflared-BTGUD7SW.js.map +1 -0
- package/dist/log-SPS2S6FO.js +19 -0
- package/dist/log-SPS2S6FO.js.map +1 -0
- package/dist/{main-G6XDM7EZ.js → main-37GLOJ7G.js} +21 -15
- package/dist/{main-G6XDM7EZ.js.map → main-37GLOJ7G.js.map} +1 -1
- package/dist/menu-6RCPBVGQ.js +15 -0
- package/dist/menu-6RCPBVGQ.js.map +1 -0
- package/dist/{setup-FCVL75K6.js → setup-QAS3QW3M.js} +5 -4
- package/dist/setup-QAS3QW3M.js.map +1 -0
- package/dist/{tunnel-service-DASSH7OA.js → tunnel-service-LEVPLXAZ.js} +3 -3
- package/package.json +10 -2
- package/dist/agent-registry-7HC6D4CH.js +0 -7
- package/dist/chunk-KPI4HGJC.js.map +0 -1
- package/dist/chunk-LYKCQTH5.js.map +0 -1
- package/dist/chunk-UAUTLC4E.js.map +0 -1
- package/dist/chunk-VA2M52CM.js +0 -15
- package/dist/chunk-VA2M52CM.js.map +0 -1
- package/dist/chunk-ZRFBLD3W.js.map +0 -1
- package/dist/config-editor-SKS4LJLT.js +0 -11
- package/dist/install-cloudflared-ILUXKLAC.js +0 -8
- /package/dist/{agent-registry-7HC6D4CH.js.map → agent-catalog-4IAJ7HEG.js.map} +0 -0
- /package/dist/{autostart-DZ3MHHMM.js.map → agent-registry-B5YAMA4T.js.map} +0 -0
- /package/dist/{config-H2DSEHNW.js.map → agent-store-ZBXGOFPH.js.map} +0 -0
- /package/dist/{config-editor-SKS4LJLT.js.map → api-client-UN7BXQOQ.js.map} +0 -0
- /package/dist/{daemon-VF6HJQXD.js.map → autostart-K73RQZVV.js.map} +0 -0
- /package/dist/{install-cloudflared-ILUXKLAC.js.map → chunk-NAMYZIS5.js.map} +0 -0
- /package/dist/{chunk-HZD3CGPK.js.map → chunk-NDR5JCS7.js.map} +0 -0
- /package/dist/{chunk-V3BA2MJ6.js.map → chunk-RF3DUYFO.js.map} +0 -0
- /package/dist/{chunk-C6YIUTGR.js.map → chunk-VBEWSWVL.js.map} +0 -0
- /package/dist/{chunk-MRKYJ422.js.map → chunk-X6LLG7XN.js.map} +0 -0
- /package/dist/{setup-FCVL75K6.js.map → config-PCPIBPUA.js.map} +0 -0
- /package/dist/{tunnel-service-DASSH7OA.js.map → tunnel-service-LEVPLXAZ.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import pino from 'pino';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
+
import { EventEmitter } from 'node:events';
|
|
3
4
|
import { Readable, Writable } from 'node:stream';
|
|
4
5
|
import { PromptResponse } from '@agentclientprotocol/sdk';
|
|
5
6
|
|
|
@@ -95,6 +96,82 @@ interface AgentDefinition {
|
|
|
95
96
|
workingDirectory?: string;
|
|
96
97
|
env?: Record<string, string>;
|
|
97
98
|
}
|
|
99
|
+
type AgentDistribution = "npx" | "uvx" | "binary" | "custom";
|
|
100
|
+
interface InstalledAgent {
|
|
101
|
+
registryId: string | null;
|
|
102
|
+
name: string;
|
|
103
|
+
version: string;
|
|
104
|
+
distribution: AgentDistribution;
|
|
105
|
+
command: string;
|
|
106
|
+
args: string[];
|
|
107
|
+
env: Record<string, string>;
|
|
108
|
+
workingDirectory?: string;
|
|
109
|
+
installedAt: string;
|
|
110
|
+
binaryPath: string | null;
|
|
111
|
+
}
|
|
112
|
+
interface RegistryBinaryTarget {
|
|
113
|
+
archive: string;
|
|
114
|
+
cmd: string;
|
|
115
|
+
args?: string[];
|
|
116
|
+
env?: Record<string, string>;
|
|
117
|
+
}
|
|
118
|
+
interface RegistryDistribution {
|
|
119
|
+
npx?: {
|
|
120
|
+
package: string;
|
|
121
|
+
args?: string[];
|
|
122
|
+
env?: Record<string, string>;
|
|
123
|
+
};
|
|
124
|
+
uvx?: {
|
|
125
|
+
package: string;
|
|
126
|
+
args?: string[];
|
|
127
|
+
env?: Record<string, string>;
|
|
128
|
+
};
|
|
129
|
+
binary?: Record<string, RegistryBinaryTarget>;
|
|
130
|
+
}
|
|
131
|
+
interface RegistryAgent {
|
|
132
|
+
id: string;
|
|
133
|
+
name: string;
|
|
134
|
+
version: string;
|
|
135
|
+
description: string;
|
|
136
|
+
repository?: string;
|
|
137
|
+
website?: string;
|
|
138
|
+
authors?: string[];
|
|
139
|
+
license?: string;
|
|
140
|
+
icon?: string;
|
|
141
|
+
distribution: RegistryDistribution;
|
|
142
|
+
}
|
|
143
|
+
interface AgentListItem {
|
|
144
|
+
key: string;
|
|
145
|
+
registryId: string;
|
|
146
|
+
name: string;
|
|
147
|
+
version: string;
|
|
148
|
+
description?: string;
|
|
149
|
+
distribution: AgentDistribution;
|
|
150
|
+
installed: boolean;
|
|
151
|
+
available: boolean;
|
|
152
|
+
missingDeps?: string[];
|
|
153
|
+
}
|
|
154
|
+
interface AvailabilityResult {
|
|
155
|
+
available: boolean;
|
|
156
|
+
reason?: string;
|
|
157
|
+
missing?: Array<{
|
|
158
|
+
label: string;
|
|
159
|
+
installHint: string;
|
|
160
|
+
}>;
|
|
161
|
+
}
|
|
162
|
+
interface InstallProgress {
|
|
163
|
+
onStart(agentId: string, agentName: string): void | Promise<void>;
|
|
164
|
+
onStep(step: string): void | Promise<void>;
|
|
165
|
+
onDownloadProgress(percent: number): void | Promise<void>;
|
|
166
|
+
onSuccess(agentName: string): void | Promise<void>;
|
|
167
|
+
onError(error: string, hint?: string): void | Promise<void>;
|
|
168
|
+
}
|
|
169
|
+
interface InstallResult {
|
|
170
|
+
ok: boolean;
|
|
171
|
+
agentKey: string;
|
|
172
|
+
error?: string;
|
|
173
|
+
hint?: string;
|
|
174
|
+
}
|
|
98
175
|
type SessionStatus = "initializing" | "active" | "cancelled" | "finished" | "error";
|
|
99
176
|
interface SessionRecord<P = Record<string, unknown>> {
|
|
100
177
|
sessionId: string;
|
|
@@ -185,7 +262,7 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
185
262
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
186
263
|
adapter: z.ZodOptional<z.ZodString>;
|
|
187
264
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
188
|
-
agents: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
265
|
+
agents: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
189
266
|
command: z.ZodString;
|
|
190
267
|
args: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
191
268
|
workingDirectory: z.ZodOptional<z.ZodString>;
|
|
@@ -200,7 +277,7 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
200
277
|
args?: string[] | undefined;
|
|
201
278
|
workingDirectory?: string | undefined;
|
|
202
279
|
env?: Record<string, string> | undefined;
|
|
203
|
-
}
|
|
280
|
+
}>>>>;
|
|
204
281
|
defaultAgent: z.ZodString;
|
|
205
282
|
workspace: z.ZodDefault<z.ZodObject<{
|
|
206
283
|
baseDir: z.ZodDefault<z.ZodString>;
|
|
@@ -312,6 +389,12 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
312
389
|
port: number;
|
|
313
390
|
host: string;
|
|
314
391
|
};
|
|
392
|
+
agents: Record<string, {
|
|
393
|
+
command: string;
|
|
394
|
+
args: string[];
|
|
395
|
+
env: Record<string, string>;
|
|
396
|
+
workingDirectory?: string | undefined;
|
|
397
|
+
}>;
|
|
315
398
|
tunnel: {
|
|
316
399
|
options: Record<string, unknown>;
|
|
317
400
|
enabled: boolean;
|
|
@@ -323,12 +406,6 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
323
406
|
token?: string | undefined;
|
|
324
407
|
};
|
|
325
408
|
};
|
|
326
|
-
agents: Record<string, {
|
|
327
|
-
command: string;
|
|
328
|
-
args: string[];
|
|
329
|
-
env: Record<string, string>;
|
|
330
|
-
workingDirectory?: string | undefined;
|
|
331
|
-
}>;
|
|
332
409
|
channels: Record<string, z.objectOutputType<{
|
|
333
410
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
334
411
|
adapter: z.ZodOptional<z.ZodString>;
|
|
@@ -359,12 +436,6 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
359
436
|
installedAt?: string | undefined;
|
|
360
437
|
}>;
|
|
361
438
|
}, {
|
|
362
|
-
agents: Record<string, {
|
|
363
|
-
command: string;
|
|
364
|
-
args?: string[] | undefined;
|
|
365
|
-
workingDirectory?: string | undefined;
|
|
366
|
-
env?: Record<string, string> | undefined;
|
|
367
|
-
}>;
|
|
368
439
|
channels: Record<string, z.objectInputType<{
|
|
369
440
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
370
441
|
adapter: z.ZodOptional<z.ZodString>;
|
|
@@ -374,6 +445,12 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
374
445
|
port?: number | undefined;
|
|
375
446
|
host?: string | undefined;
|
|
376
447
|
} | undefined;
|
|
448
|
+
agents?: Record<string, {
|
|
449
|
+
command: string;
|
|
450
|
+
args?: string[] | undefined;
|
|
451
|
+
workingDirectory?: string | undefined;
|
|
452
|
+
env?: Record<string, string> | undefined;
|
|
453
|
+
}> | undefined;
|
|
377
454
|
tunnel?: {
|
|
378
455
|
options?: Record<string, unknown> | undefined;
|
|
379
456
|
enabled?: boolean | undefined;
|
|
@@ -412,13 +489,13 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
412
489
|
}>;
|
|
413
490
|
type Config = z.infer<typeof ConfigSchema>;
|
|
414
491
|
declare function expandHome(p: string): string;
|
|
415
|
-
declare class ConfigManager {
|
|
492
|
+
declare class ConfigManager extends EventEmitter {
|
|
416
493
|
private config;
|
|
417
494
|
private configPath;
|
|
418
495
|
constructor();
|
|
419
496
|
load(): Promise<void>;
|
|
420
497
|
get(): Config;
|
|
421
|
-
save(updates: Record<string, unknown
|
|
498
|
+
save(updates: Record<string, unknown>, changePath?: string): Promise<void>;
|
|
422
499
|
resolveWorkspace(input?: string): string;
|
|
423
500
|
exists(): Promise<boolean>;
|
|
424
501
|
getConfigPath(): string;
|
|
@@ -437,6 +514,8 @@ declare const log: {
|
|
|
437
514
|
child: (bindings: pino.Bindings) => pino.Logger<never, boolean>;
|
|
438
515
|
};
|
|
439
516
|
declare function initLogger(config: LoggingConfig): Logger;
|
|
517
|
+
/** Change log level at runtime. Pino transport targets respect parent level changes automatically. */
|
|
518
|
+
declare function setLogLevel(level: string): void;
|
|
440
519
|
declare function createChildLogger(context: {
|
|
441
520
|
module: string;
|
|
442
521
|
[key: string]: unknown;
|
|
@@ -519,9 +598,48 @@ declare class AgentInstance {
|
|
|
519
598
|
destroy(): Promise<void>;
|
|
520
599
|
}
|
|
521
600
|
|
|
601
|
+
declare class AgentStore {
|
|
602
|
+
private data;
|
|
603
|
+
private filePath;
|
|
604
|
+
constructor(filePath?: string);
|
|
605
|
+
load(): void;
|
|
606
|
+
exists(): boolean;
|
|
607
|
+
getInstalled(): Record<string, InstalledAgent>;
|
|
608
|
+
getAgent(key: string): InstalledAgent | undefined;
|
|
609
|
+
addAgent(key: string, agent: InstalledAgent): void;
|
|
610
|
+
removeAgent(key: string): void;
|
|
611
|
+
hasAgent(key: string): boolean;
|
|
612
|
+
private save;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
declare class AgentCatalog {
|
|
616
|
+
private store;
|
|
617
|
+
private registryAgents;
|
|
618
|
+
constructor(store?: AgentStore);
|
|
619
|
+
load(): void;
|
|
620
|
+
fetchRegistry(): Promise<void>;
|
|
621
|
+
refreshRegistryIfStale(): Promise<void>;
|
|
622
|
+
getRegistryAgents(): RegistryAgent[];
|
|
623
|
+
getRegistryAgent(registryId: string): RegistryAgent | undefined;
|
|
624
|
+
findRegistryAgent(keyOrId: string): RegistryAgent | undefined;
|
|
625
|
+
getInstalled(): InstalledAgent[];
|
|
626
|
+
getInstalledEntries(): Record<string, InstalledAgent>;
|
|
627
|
+
getInstalledAgent(key: string): InstalledAgent | undefined;
|
|
628
|
+
getAvailable(): AgentListItem[];
|
|
629
|
+
checkAvailability(keyOrId: string): AvailabilityResult;
|
|
630
|
+
install(keyOrId: string, progress?: InstallProgress, force?: boolean): Promise<InstallResult>;
|
|
631
|
+
uninstall(key: string): Promise<{
|
|
632
|
+
ok: boolean;
|
|
633
|
+
error?: string;
|
|
634
|
+
}>;
|
|
635
|
+
resolve(key: string): AgentDefinition | undefined;
|
|
636
|
+
private isCacheStale;
|
|
637
|
+
private loadRegistryFromCacheOrSnapshot;
|
|
638
|
+
}
|
|
639
|
+
|
|
522
640
|
declare class AgentManager {
|
|
523
|
-
private
|
|
524
|
-
constructor(
|
|
641
|
+
private catalog;
|
|
642
|
+
constructor(catalog: AgentCatalog);
|
|
525
643
|
getAvailableAgents(): AgentDefinition[];
|
|
526
644
|
getAgent(name: string): AgentDefinition | undefined;
|
|
527
645
|
spawn(agentName: string, workingDirectory: string): Promise<AgentInstance>;
|
|
@@ -571,6 +689,9 @@ declare class PermissionGate {
|
|
|
571
689
|
private resolveFn?;
|
|
572
690
|
private rejectFn?;
|
|
573
691
|
private settled;
|
|
692
|
+
private timeoutTimer?;
|
|
693
|
+
private timeoutMs;
|
|
694
|
+
constructor(timeoutMs?: number);
|
|
574
695
|
setPending(request: PermissionRequest): Promise<string>;
|
|
575
696
|
resolve(optionId: string): void;
|
|
576
697
|
reject(reason?: string): void;
|
|
@@ -578,6 +699,7 @@ declare class PermissionGate {
|
|
|
578
699
|
get currentRequest(): PermissionRequest | undefined;
|
|
579
700
|
/** The request ID of the current pending request, undefined after settlement */
|
|
580
701
|
get requestId(): string | undefined;
|
|
702
|
+
private clearTimeout;
|
|
581
703
|
private cleanup;
|
|
582
704
|
}
|
|
583
705
|
|
|
@@ -585,6 +707,8 @@ interface SessionEvents {
|
|
|
585
707
|
agent_event: (event: AgentEvent) => void;
|
|
586
708
|
permission_request: (request: PermissionRequest) => void;
|
|
587
709
|
session_end: (reason: string) => void;
|
|
710
|
+
status_change: (from: SessionStatus, to: SessionStatus) => void;
|
|
711
|
+
named: (name: string) => void;
|
|
588
712
|
error: (error: Error) => void;
|
|
589
713
|
}
|
|
590
714
|
declare class Session extends TypedEmitter<SessionEvents> {
|
|
@@ -595,10 +719,9 @@ declare class Session extends TypedEmitter<SessionEvents> {
|
|
|
595
719
|
workingDirectory: string;
|
|
596
720
|
agentInstance: AgentInstance;
|
|
597
721
|
agentSessionId: string;
|
|
598
|
-
|
|
722
|
+
private _status;
|
|
599
723
|
name?: string;
|
|
600
724
|
createdAt: Date;
|
|
601
|
-
adapter?: ChannelAdapter;
|
|
602
725
|
dangerousMode: boolean;
|
|
603
726
|
log: Logger;
|
|
604
727
|
readonly permissionGate: PermissionGate;
|
|
@@ -610,15 +733,16 @@ declare class Session extends TypedEmitter<SessionEvents> {
|
|
|
610
733
|
workingDirectory: string;
|
|
611
734
|
agentInstance: AgentInstance;
|
|
612
735
|
});
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
736
|
+
get status(): SessionStatus;
|
|
737
|
+
/** Transition to active — from initializing, error, or cancelled */
|
|
738
|
+
activate(): void;
|
|
739
|
+
/** Transition to error — from initializing or active */
|
|
740
|
+
fail(reason: string): void;
|
|
741
|
+
/** Transition to finished — from active only. Emits session_end for backward compat. */
|
|
742
|
+
finish(reason?: string): void;
|
|
743
|
+
/** Transition to cancelled — from active only (terminal session cancel) */
|
|
744
|
+
markCancelled(): void;
|
|
745
|
+
private transition;
|
|
622
746
|
/** Number of prompts waiting in queue */
|
|
623
747
|
get queueDepth(): number;
|
|
624
748
|
get promptRunning(): boolean;
|
|
@@ -628,7 +752,8 @@ declare class Session extends TypedEmitter<SessionEvents> {
|
|
|
628
752
|
/** Fire-and-forget warm-up: primes model cache while user types their first message */
|
|
629
753
|
warmup(): Promise<void>;
|
|
630
754
|
private runWarmup;
|
|
631
|
-
|
|
755
|
+
/** Cancel the current prompt and clear the queue. Stays in active state. */
|
|
756
|
+
abortPrompt(): Promise<void>;
|
|
632
757
|
destroy(): Promise<void>;
|
|
633
758
|
}
|
|
634
759
|
|
|
@@ -721,11 +846,7 @@ declare class SessionManager {
|
|
|
721
846
|
getRecordByAgentSessionId(agentSessionId: string): SessionRecord | undefined;
|
|
722
847
|
getRecordByThread(channelId: string, threadId: string): SessionRecord | undefined;
|
|
723
848
|
registerSession(session: Session): void;
|
|
724
|
-
|
|
725
|
-
updateSessionActivity(sessionId: string): Promise<void>;
|
|
726
|
-
updateSessionStatus(sessionId: string, status: SessionStatus): Promise<void>;
|
|
727
|
-
updateSessionDangerousMode(sessionId: string, dangerousMode: boolean): Promise<void>;
|
|
728
|
-
updateSessionName(sessionId: string, name: string): Promise<void>;
|
|
849
|
+
patchRecord(sessionId: string, patch: Partial<SessionRecord>): Promise<void>;
|
|
729
850
|
getSessionRecord(sessionId: string): SessionRecord | undefined;
|
|
730
851
|
cancelSession(sessionId: string): Promise<void>;
|
|
731
852
|
listSessions(channelId?: string): Session[];
|
|
@@ -736,8 +857,31 @@ declare class SessionManager {
|
|
|
736
857
|
destroyAll(): Promise<void>;
|
|
737
858
|
}
|
|
738
859
|
|
|
860
|
+
interface BridgeDeps {
|
|
861
|
+
messageTransformer: MessageTransformer;
|
|
862
|
+
notificationManager: NotificationManager;
|
|
863
|
+
sessionManager: SessionManager;
|
|
864
|
+
}
|
|
865
|
+
declare class SessionBridge {
|
|
866
|
+
private session;
|
|
867
|
+
private adapter;
|
|
868
|
+
private deps;
|
|
869
|
+
private connected;
|
|
870
|
+
private agentEventHandler?;
|
|
871
|
+
private statusChangeHandler?;
|
|
872
|
+
private namedHandler?;
|
|
873
|
+
constructor(session: Session, adapter: ChannelAdapter, deps: BridgeDeps);
|
|
874
|
+
connect(): void;
|
|
875
|
+
disconnect(): void;
|
|
876
|
+
private wireAgentToSession;
|
|
877
|
+
private wireSessionToAdapter;
|
|
878
|
+
private wirePermissions;
|
|
879
|
+
private wireLifecycle;
|
|
880
|
+
}
|
|
881
|
+
|
|
739
882
|
declare class OpenACPCore {
|
|
740
883
|
configManager: ConfigManager;
|
|
884
|
+
agentCatalog: AgentCatalog;
|
|
741
885
|
agentManager: AgentManager;
|
|
742
886
|
sessionManager: SessionManager;
|
|
743
887
|
notificationManager: NotificationManager;
|
|
@@ -755,6 +899,15 @@ declare class OpenACPCore {
|
|
|
755
899
|
start(): Promise<void>;
|
|
756
900
|
stop(): Promise<void>;
|
|
757
901
|
handleMessage(message: IncomingMessage): Promise<void>;
|
|
902
|
+
createSession(params: {
|
|
903
|
+
channelId: string;
|
|
904
|
+
agentName: string;
|
|
905
|
+
workingDirectory: string;
|
|
906
|
+
resumeAgentSessionId?: string;
|
|
907
|
+
existingSessionId?: string;
|
|
908
|
+
createThread?: boolean;
|
|
909
|
+
initialName?: string;
|
|
910
|
+
}): Promise<Session>;
|
|
758
911
|
handleNewSession(channelId: string, agentName?: string, workspacePath?: string): Promise<Session>;
|
|
759
912
|
adoptSession(agentName: string, agentSessionId: string, cwd: string): Promise<{
|
|
760
913
|
ok: true;
|
|
@@ -768,7 +921,8 @@ declare class OpenACPCore {
|
|
|
768
921
|
}>;
|
|
769
922
|
handleNewChat(channelId: string, currentThreadId: string): Promise<Session | null>;
|
|
770
923
|
private lazyResume;
|
|
771
|
-
|
|
924
|
+
/** Create a SessionBridge for the given session and adapter */
|
|
925
|
+
createBridge(session: Session, adapter: ChannelAdapter): SessionBridge;
|
|
772
926
|
}
|
|
773
927
|
|
|
774
928
|
interface AdapterFactory {
|
|
@@ -807,7 +961,7 @@ declare function uninstallAutoStart(): {
|
|
|
807
961
|
};
|
|
808
962
|
declare function isAutoStartInstalled(): boolean;
|
|
809
963
|
|
|
810
|
-
declare function runConfigEditor(configManager: ConfigManager): Promise<void>;
|
|
964
|
+
declare function runConfigEditor(configManager: ConfigManager, mode?: 'file' | 'api', apiPort?: number): Promise<void>;
|
|
811
965
|
|
|
812
966
|
interface TopicInfo {
|
|
813
967
|
sessionId: string;
|
|
@@ -879,6 +1033,7 @@ declare class ApiServer {
|
|
|
879
1033
|
private handleToggleDangerous;
|
|
880
1034
|
private handleHealth;
|
|
881
1035
|
private handleVersion;
|
|
1036
|
+
private handleGetEditableConfig;
|
|
882
1037
|
private handleGetConfig;
|
|
883
1038
|
private handleUpdateConfig;
|
|
884
1039
|
private handleListAdapters;
|
|
@@ -896,6 +1051,22 @@ declare class ApiServer {
|
|
|
896
1051
|
private readBody;
|
|
897
1052
|
}
|
|
898
1053
|
|
|
1054
|
+
interface ConfigFieldDef {
|
|
1055
|
+
path: string;
|
|
1056
|
+
displayName: string;
|
|
1057
|
+
group: string;
|
|
1058
|
+
type: 'toggle' | 'select' | 'number' | 'string';
|
|
1059
|
+
options?: string[] | ((config: Config) => string[]);
|
|
1060
|
+
scope: 'safe' | 'sensitive';
|
|
1061
|
+
hotReload: boolean;
|
|
1062
|
+
}
|
|
1063
|
+
declare const CONFIG_REGISTRY: ConfigFieldDef[];
|
|
1064
|
+
declare function getFieldDef(path: string): ConfigFieldDef | undefined;
|
|
1065
|
+
declare function getSafeFields(): ConfigFieldDef[];
|
|
1066
|
+
declare function isHotReloadable(path: string): boolean;
|
|
1067
|
+
declare function resolveOptions(def: ConfigFieldDef, config: Config): string[] | undefined;
|
|
1068
|
+
declare function getConfigValue(config: Config, path: string): unknown;
|
|
1069
|
+
|
|
899
1070
|
interface TelegramChannelConfig {
|
|
900
1071
|
enabled: boolean;
|
|
901
1072
|
botToken: string;
|
|
@@ -907,16 +1078,15 @@ interface TelegramChannelConfig {
|
|
|
907
1078
|
declare class TelegramAdapter extends ChannelAdapter<OpenACPCore> {
|
|
908
1079
|
private bot;
|
|
909
1080
|
private telegramConfig;
|
|
910
|
-
private sessionDrafts;
|
|
911
|
-
private sessionTextBuffers;
|
|
912
|
-
private toolCallMessages;
|
|
913
1081
|
private permissionHandler;
|
|
914
1082
|
private assistantSession;
|
|
915
1083
|
private assistantInitializing;
|
|
916
1084
|
private notificationTopicId;
|
|
917
1085
|
private assistantTopicId;
|
|
918
|
-
private skillMessages;
|
|
919
1086
|
private sendQueue;
|
|
1087
|
+
private toolTracker;
|
|
1088
|
+
private draftManager;
|
|
1089
|
+
private skillManager;
|
|
920
1090
|
private sessionTrackers;
|
|
921
1091
|
private getOrCreateTracker;
|
|
922
1092
|
constructor(core: OpenACPCore, config: TelegramChannelConfig);
|
|
@@ -931,7 +1101,6 @@ declare class TelegramAdapter extends ChannelAdapter<OpenACPCore> {
|
|
|
931
1101
|
deleteSessionThread(sessionId: string): Promise<void>;
|
|
932
1102
|
sendSkillCommands(sessionId: string, commands: AgentCommand[]): Promise<void>;
|
|
933
1103
|
cleanupSkillCommands(sessionId: string): Promise<void>;
|
|
934
|
-
private finalizeDraft;
|
|
935
1104
|
}
|
|
936
1105
|
|
|
937
|
-
export { type AdapterFactory, type AgentCommand, type AgentDefinition, type AgentEvent, AgentInstance, AgentManager, type ApiConfig, ApiServer, ChannelAdapter, type ChannelConfig, type CleanupResult, type Config, ConfigManager, type DeleteTopicResult, type IChannelAdapter, type IncomingMessage, type Logger, type LoggingConfig, MessageTransformer, NotificationManager, type NotificationMessage, OpenACPCore, type OutgoingMessage, PLUGINS_DIR, PermissionGate, type PermissionOption, type PermissionRequest, type PlanEntry, PromptQueue, Session, type SessionEvents, SessionManager, type SessionRecord, type SessionStatus, StderrCapture, TelegramAdapter, type TelegramPlatformData, type TopicInfo, TopicManager, TypedEmitter, cleanupOldSessionLogs, createChildLogger, createSessionLogger, expandHome, getPidPath, getStatus, initLogger, installAutoStart, installPlugin, isAutoStartInstalled, isAutoStartSupported, listPlugins, loadAdapterFactory, log, nodeToWebReadable, nodeToWebWritable, runConfigEditor, shutdownLogger, startDaemon, stopDaemon, uninstallAutoStart, uninstallPlugin };
|
|
1106
|
+
export { type AdapterFactory, AgentCatalog, type AgentCommand, type AgentDefinition, type AgentDistribution, type AgentEvent, AgentInstance, type AgentListItem, AgentManager, AgentStore, type ApiConfig, ApiServer, type AvailabilityResult, type BridgeDeps, CONFIG_REGISTRY, ChannelAdapter, type ChannelConfig, type CleanupResult, type Config, type ConfigFieldDef, ConfigManager, type DeleteTopicResult, 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 };
|
package/dist/index.js
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
PermissionGate,
|
|
10
10
|
PromptQueue,
|
|
11
11
|
Session,
|
|
12
|
+
SessionBridge,
|
|
12
13
|
SessionManager,
|
|
13
14
|
StderrCapture,
|
|
14
15
|
TelegramAdapter,
|
|
@@ -16,47 +17,68 @@ import {
|
|
|
16
17
|
TypedEmitter,
|
|
17
18
|
nodeToWebReadable,
|
|
18
19
|
nodeToWebWritable
|
|
19
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-FWN3UIRT.js";
|
|
21
|
+
import "./chunk-NAMYZIS5.js";
|
|
22
|
+
import "./chunk-UG6X672R.js";
|
|
23
|
+
import {
|
|
24
|
+
AgentCatalog
|
|
25
|
+
} from "./chunk-S3DRLJPM.js";
|
|
26
|
+
import {
|
|
27
|
+
AgentStore
|
|
28
|
+
} from "./chunk-5HGXUCMX.js";
|
|
20
29
|
import {
|
|
21
30
|
runConfigEditor
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import
|
|
24
|
-
|
|
31
|
+
} from "./chunk-LAFKARV3.js";
|
|
32
|
+
import {
|
|
33
|
+
installAutoStart,
|
|
34
|
+
isAutoStartInstalled,
|
|
35
|
+
isAutoStartSupported,
|
|
36
|
+
uninstallAutoStart
|
|
37
|
+
} from "./chunk-X6LLG7XN.js";
|
|
38
|
+
import "./chunk-D73LCTPF.js";
|
|
39
|
+
import "./chunk-XJJ7LPXP.js";
|
|
40
|
+
import "./chunk-IRGYTNLP.js";
|
|
25
41
|
import {
|
|
26
42
|
installPlugin,
|
|
27
43
|
listPlugins,
|
|
28
44
|
loadAdapterFactory,
|
|
29
45
|
uninstallPlugin
|
|
30
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-NDR5JCS7.js";
|
|
47
|
+
import {
|
|
48
|
+
CONFIG_REGISTRY,
|
|
49
|
+
getConfigValue,
|
|
50
|
+
getFieldDef,
|
|
51
|
+
getSafeFields,
|
|
52
|
+
isHotReloadable,
|
|
53
|
+
resolveOptions
|
|
54
|
+
} from "./chunk-Z46LGZ7R.js";
|
|
31
55
|
import {
|
|
32
56
|
getPidPath,
|
|
33
57
|
getStatus,
|
|
34
58
|
startDaemon,
|
|
35
59
|
stopDaemon
|
|
36
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-VBEWSWVL.js";
|
|
37
61
|
import {
|
|
38
62
|
ConfigManager,
|
|
39
63
|
PLUGINS_DIR,
|
|
40
64
|
expandHome
|
|
41
|
-
} from "./chunk-
|
|
42
|
-
import {
|
|
43
|
-
installAutoStart,
|
|
44
|
-
isAutoStartInstalled,
|
|
45
|
-
isAutoStartSupported,
|
|
46
|
-
uninstallAutoStart
|
|
47
|
-
} from "./chunk-MRKYJ422.js";
|
|
65
|
+
} from "./chunk-JRF4G4X7.js";
|
|
48
66
|
import {
|
|
49
67
|
cleanupOldSessionLogs,
|
|
50
68
|
createChildLogger,
|
|
51
69
|
createSessionLogger,
|
|
52
70
|
initLogger,
|
|
53
71
|
log,
|
|
72
|
+
setLogLevel,
|
|
54
73
|
shutdownLogger
|
|
55
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-ESOPMQAY.js";
|
|
56
75
|
export {
|
|
76
|
+
AgentCatalog,
|
|
57
77
|
AgentInstance,
|
|
58
78
|
AgentManager,
|
|
79
|
+
AgentStore,
|
|
59
80
|
ApiServer,
|
|
81
|
+
CONFIG_REGISTRY,
|
|
60
82
|
ChannelAdapter,
|
|
61
83
|
ConfigManager,
|
|
62
84
|
MessageTransformer,
|
|
@@ -66,6 +88,7 @@ export {
|
|
|
66
88
|
PermissionGate,
|
|
67
89
|
PromptQueue,
|
|
68
90
|
Session,
|
|
91
|
+
SessionBridge,
|
|
69
92
|
SessionManager,
|
|
70
93
|
StderrCapture,
|
|
71
94
|
TelegramAdapter,
|
|
@@ -75,19 +98,25 @@ export {
|
|
|
75
98
|
createChildLogger,
|
|
76
99
|
createSessionLogger,
|
|
77
100
|
expandHome,
|
|
101
|
+
getConfigValue,
|
|
102
|
+
getFieldDef,
|
|
78
103
|
getPidPath,
|
|
104
|
+
getSafeFields,
|
|
79
105
|
getStatus,
|
|
80
106
|
initLogger,
|
|
81
107
|
installAutoStart,
|
|
82
108
|
installPlugin,
|
|
83
109
|
isAutoStartInstalled,
|
|
84
110
|
isAutoStartSupported,
|
|
111
|
+
isHotReloadable,
|
|
85
112
|
listPlugins,
|
|
86
113
|
loadAdapterFactory,
|
|
87
114
|
log,
|
|
88
115
|
nodeToWebReadable,
|
|
89
116
|
nodeToWebWritable,
|
|
117
|
+
resolveOptions,
|
|
90
118
|
runConfigEditor,
|
|
119
|
+
setLogLevel,
|
|
91
120
|
shutdownLogger,
|
|
92
121
|
startDaemon,
|
|
93
122
|
stopDaemon,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cleanupOldSessionLogs,
|
|
3
|
+
createChildLogger,
|
|
4
|
+
createSessionLogger,
|
|
5
|
+
initLogger,
|
|
6
|
+
log,
|
|
7
|
+
setLogLevel,
|
|
8
|
+
shutdownLogger
|
|
9
|
+
} from "./chunk-ESOPMQAY.js";
|
|
10
|
+
export {
|
|
11
|
+
cleanupOldSessionLogs,
|
|
12
|
+
createChildLogger,
|
|
13
|
+
createSessionLogger,
|
|
14
|
+
initLogger,
|
|
15
|
+
log,
|
|
16
|
+
setLogLevel,
|
|
17
|
+
shutdownLogger
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=log-SPS2S6FO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|