@openacp/cli 2026.401.7 → 2026.402.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{channel-BOcUuhjt.d.ts → channel-DzDoNxa7.d.ts} +1 -1
- package/dist/cli.js +2890 -3937
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +292 -31
- package/dist/index.js +1383 -2650
- package/dist/index.js.map +1 -1
- package/dist/testing.d.ts +1 -1
- package/package.json +1 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AgentEvent, a as AgentCapabilities, P as PermissionRequest, b as AgentDefinition, M as McpServerConfig, S as SetConfigOptionValue, c as Attachment, I as InstalledAgent, R as RegistryAgent, d as AgentListItem, e as AvailabilityResult, f as InstallProgress, g as InstallResult, h as SessionStatus, C as ConfigOption, i as AgentSwitchEntry, j as SessionRecord, O as OutgoingMessage,
|
|
2
|
-
export { t as AgentDistribution, u as AuthMethod, v as AuthenticateRequest, w as ChannelAdapter, x as ConfigSelectChoice, y as ConfigSelectGroup, z as ContentBlock, K as KIND_ICONS, B as ModelInfo, E as NewSessionResponse, F as PermissionOption, G as PromptResponse, H as RegistryBinaryTarget, J as RegistryDistribution, L as STATUS_ICONS, Q as SessionListItem, W as SessionListResponse, X as SessionMode, Y as SessionModeState, Z as SessionModelState, _ as TelegramPlatformData, $ as ToolUpdateMeta } from './channel-
|
|
1
|
+
import { A as AgentEvent, a as AgentCapabilities, P as PermissionRequest, b as AgentDefinition, M as McpServerConfig, S as SetConfigOptionValue, c as Attachment, I as InstalledAgent, R as RegistryAgent, d as AgentListItem, e as AvailabilityResult, f as InstallProgress, g as InstallResult, h as SessionStatus, C as ConfigOption, i as AgentSwitchEntry, j as AgentCommand, k as SessionRecord, O as OutgoingMessage, l as IChannelAdapter, N as NotificationMessage, m as StopReason, U as UsageRecord, n as UsageRecordEvent, o as IncomingMessage, D as DisplayVerbosity, p as ChannelConfig, q as AdapterCapabilities, T as ToolCallMeta, V as ViewerLinks, r as OutputMode, s as PlanEntry } from './channel-DzDoNxa7.js';
|
|
2
|
+
export { t as AgentDistribution, u as AuthMethod, v as AuthenticateRequest, w as ChannelAdapter, x as ConfigSelectChoice, y as ConfigSelectGroup, z as ContentBlock, K as KIND_ICONS, B as ModelInfo, E as NewSessionResponse, F as PermissionOption, G as PromptResponse, H as RegistryBinaryTarget, J as RegistryDistribution, L as STATUS_ICONS, Q as SessionListItem, W as SessionListResponse, X as SessionMode, Y as SessionModeState, Z as SessionModelState, _ as TelegramPlatformData, $ as ToolUpdateMeta } from './channel-DzDoNxa7.js';
|
|
3
3
|
import pino from 'pino';
|
|
4
4
|
import * as zod from 'zod';
|
|
5
5
|
import { z, ZodSchema } from 'zod';
|
|
@@ -91,7 +91,7 @@ declare const UsageSchema: z.ZodDefault<z.ZodObject<{
|
|
|
91
91
|
type UsageConfig = z.infer<typeof UsageSchema>;
|
|
92
92
|
declare const ConfigSchema: z.ZodObject<{
|
|
93
93
|
instanceName: z.ZodOptional<z.ZodString>;
|
|
94
|
-
channels: z.ZodObject<{}, "strip", z.ZodObject<{
|
|
94
|
+
channels: z.ZodDefault<z.ZodObject<{}, "strip", z.ZodObject<{
|
|
95
95
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
96
96
|
adapter: z.ZodOptional<z.ZodString>;
|
|
97
97
|
displayVerbosity: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
|
|
@@ -136,7 +136,7 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
136
136
|
adapter: z.ZodOptional<z.ZodString>;
|
|
137
137
|
displayVerbosity: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
|
|
138
138
|
outputMode: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
|
|
139
|
-
}, z.ZodTypeAny, "passthrough">>, "strip"
|
|
139
|
+
}, z.ZodTypeAny, "passthrough">>, "strip">>>;
|
|
140
140
|
agents: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
141
141
|
command: z.ZodString;
|
|
142
142
|
args: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
@@ -456,14 +456,6 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
456
456
|
instanceName?: string | undefined;
|
|
457
457
|
outputMode?: "low" | "medium" | "high" | undefined;
|
|
458
458
|
}, {
|
|
459
|
-
channels: {} & {
|
|
460
|
-
[k: string]: z.objectInputType<{
|
|
461
|
-
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
462
|
-
adapter: z.ZodOptional<z.ZodString>;
|
|
463
|
-
displayVerbosity: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
|
|
464
|
-
outputMode: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
|
|
465
|
-
}, z.ZodTypeAny, "passthrough">;
|
|
466
|
-
};
|
|
467
459
|
defaultAgent: string;
|
|
468
460
|
api?: {
|
|
469
461
|
port?: number | undefined;
|
|
@@ -495,6 +487,22 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
495
487
|
retentionDays?: number | undefined;
|
|
496
488
|
} | undefined;
|
|
497
489
|
instanceName?: string | undefined;
|
|
490
|
+
channels?: z.objectInputType<{}, z.ZodObject<{
|
|
491
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
492
|
+
adapter: z.ZodOptional<z.ZodString>;
|
|
493
|
+
displayVerbosity: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
|
|
494
|
+
outputMode: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
|
|
495
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
496
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
497
|
+
adapter: z.ZodOptional<z.ZodString>;
|
|
498
|
+
displayVerbosity: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
|
|
499
|
+
outputMode: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
|
|
500
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
501
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
502
|
+
adapter: z.ZodOptional<z.ZodString>;
|
|
503
|
+
displayVerbosity: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
|
|
504
|
+
outputMode: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
|
|
505
|
+
}, z.ZodTypeAny, "passthrough">>, "strip"> | undefined;
|
|
498
506
|
outputMode?: "low" | "medium" | "high" | undefined;
|
|
499
507
|
workspace?: {
|
|
500
508
|
baseDir?: string | undefined;
|
|
@@ -549,6 +557,12 @@ declare class ConfigManager$1 extends EventEmitter {
|
|
|
549
557
|
load(): Promise<void>;
|
|
550
558
|
get(): Config;
|
|
551
559
|
save(updates: Record<string, unknown>, changePath?: string): Promise<void>;
|
|
560
|
+
/**
|
|
561
|
+
* Set a single config value by dot-path (e.g. "security.maxConcurrentSessions").
|
|
562
|
+
* Builds the nested update object, validates, and saves.
|
|
563
|
+
* Throws if the path contains blocked keys or the value fails Zod validation.
|
|
564
|
+
*/
|
|
565
|
+
setPath(dotPath: string, value: unknown): Promise<void>;
|
|
552
566
|
resolveWorkspace(input?: string): string;
|
|
553
567
|
exists(): Promise<boolean>;
|
|
554
568
|
getConfigPath(): string;
|
|
@@ -899,8 +913,11 @@ declare class Session extends TypedEmitter<SessionEvents> {
|
|
|
899
913
|
promptCount: number;
|
|
900
914
|
firstAgent: string;
|
|
901
915
|
agentSwitchHistory: AgentSwitchEntry[];
|
|
916
|
+
isAssistant: boolean;
|
|
902
917
|
log: Logger$1;
|
|
903
918
|
middlewareChain?: MiddlewareChain;
|
|
919
|
+
/** Latest commands emitted by the agent — buffered before bridge connects so they're not lost */
|
|
920
|
+
latestCommands: AgentCommand[] | null;
|
|
904
921
|
readonly permissionGate: PermissionGate;
|
|
905
922
|
private readonly queue;
|
|
906
923
|
private speechService?;
|
|
@@ -912,6 +929,7 @@ declare class Session extends TypedEmitter<SessionEvents> {
|
|
|
912
929
|
workingDirectory: string;
|
|
913
930
|
agentInstance: AgentInstance;
|
|
914
931
|
speechService?: SpeechService;
|
|
932
|
+
isAssistant?: boolean;
|
|
915
933
|
});
|
|
916
934
|
get status(): SessionStatus;
|
|
917
935
|
/** Transition to active — from initializing, error, or cancelled */
|
|
@@ -940,6 +958,8 @@ declare class Session extends TypedEmitter<SessionEvents> {
|
|
|
940
958
|
getConfigValue(id: string): string | undefined;
|
|
941
959
|
/** Set session name explicitly and emit 'named' event */
|
|
942
960
|
setName(name: string): void;
|
|
961
|
+
/** Send a config option change to the agent and update local state from the response. */
|
|
962
|
+
setConfigOption(configId: string, value: SetConfigOptionValue): Promise<void>;
|
|
943
963
|
updateConfigOptions(options: ConfigOption[]): Promise<void>;
|
|
944
964
|
/** Snapshot of current ACP state for persistence */
|
|
945
965
|
toAcpStateSnapshot(): NonNullable<SessionRecord["acpState"]>;
|
|
@@ -972,6 +992,27 @@ declare class PromptQueue {
|
|
|
972
992
|
get isProcessing(): boolean;
|
|
973
993
|
}
|
|
974
994
|
|
|
995
|
+
interface AssistantCommand {
|
|
996
|
+
command: string;
|
|
997
|
+
description: string;
|
|
998
|
+
}
|
|
999
|
+
interface AssistantSection {
|
|
1000
|
+
id: string;
|
|
1001
|
+
title: string;
|
|
1002
|
+
priority: number;
|
|
1003
|
+
buildContext: () => string | null;
|
|
1004
|
+
commands?: AssistantCommand[];
|
|
1005
|
+
}
|
|
1006
|
+
declare class AssistantRegistry {
|
|
1007
|
+
private sections;
|
|
1008
|
+
private _instanceRoot;
|
|
1009
|
+
/** Set the instance root path used in assistant guidelines */
|
|
1010
|
+
setInstanceRoot(root: string): void;
|
|
1011
|
+
register(section: AssistantSection): void;
|
|
1012
|
+
unregister(id: string): void;
|
|
1013
|
+
buildSystemPrompt(channelId?: string): string;
|
|
1014
|
+
}
|
|
1015
|
+
|
|
975
1016
|
type PluginPermission = 'events:read' | 'events:emit' | 'services:register' | 'services:use' | 'middleware:register' | 'commands:register' | 'storage:read' | 'storage:write' | 'kernel:access';
|
|
976
1017
|
interface OpenACPPlugin {
|
|
977
1018
|
/** Unique identifier, e.g., '@openacp/security' */
|
|
@@ -1102,7 +1143,26 @@ type CommandResponse = {
|
|
|
1102
1143
|
message: string;
|
|
1103
1144
|
} | {
|
|
1104
1145
|
type: 'silent';
|
|
1146
|
+
} | {
|
|
1147
|
+
type: 'delegated';
|
|
1105
1148
|
};
|
|
1149
|
+
interface MenuItem {
|
|
1150
|
+
id: string;
|
|
1151
|
+
label: string;
|
|
1152
|
+
priority: number;
|
|
1153
|
+
group?: string;
|
|
1154
|
+
action: {
|
|
1155
|
+
type: 'command';
|
|
1156
|
+
command: string;
|
|
1157
|
+
} | {
|
|
1158
|
+
type: 'delegate';
|
|
1159
|
+
prompt: string;
|
|
1160
|
+
} | {
|
|
1161
|
+
type: 'callback';
|
|
1162
|
+
callbackData: string;
|
|
1163
|
+
};
|
|
1164
|
+
visible?: () => boolean;
|
|
1165
|
+
}
|
|
1106
1166
|
interface MenuOption {
|
|
1107
1167
|
label: string;
|
|
1108
1168
|
command: string;
|
|
@@ -1186,6 +1246,14 @@ interface PluginContext {
|
|
|
1186
1246
|
getService<T>(name: string): T | undefined;
|
|
1187
1247
|
/** Register slash command. Requires 'commands:register'. */
|
|
1188
1248
|
registerCommand(def: CommandDef): void;
|
|
1249
|
+
/** Register a menu item. Requires 'commands:register'. */
|
|
1250
|
+
registerMenuItem(item: MenuItem): void;
|
|
1251
|
+
/** Unregister a menu item by id. Requires 'commands:register'. */
|
|
1252
|
+
unregisterMenuItem(id: string): void;
|
|
1253
|
+
/** Register an assistant section. Requires 'commands:register'. */
|
|
1254
|
+
registerAssistantSection(section: AssistantSection): void;
|
|
1255
|
+
/** Unregister an assistant section by id. Requires 'commands:register'. */
|
|
1256
|
+
unregisterAssistantSection(id: string): void;
|
|
1189
1257
|
/** Plugin-scoped storage. Requires 'storage:read' and/or 'storage:write'. */
|
|
1190
1258
|
storage: PluginStorage;
|
|
1191
1259
|
/** Plugin-scoped logger. Always available (no permission needed). */
|
|
@@ -1397,7 +1465,7 @@ interface ViewerStoreInterface {
|
|
|
1397
1465
|
}
|
|
1398
1466
|
interface TunnelServiceInterface {
|
|
1399
1467
|
getPublicUrl(): string;
|
|
1400
|
-
start(): Promise<string>;
|
|
1468
|
+
start(apiPort: number): Promise<string>;
|
|
1401
1469
|
stop(): Promise<void>;
|
|
1402
1470
|
getStore(): ViewerStoreInterface;
|
|
1403
1471
|
fileUrl(entryId: string): string;
|
|
@@ -1423,6 +1491,8 @@ declare class MessageTransformer {
|
|
|
1423
1491
|
|
|
1424
1492
|
interface SessionStore {
|
|
1425
1493
|
save(record: SessionRecord): Promise<void>;
|
|
1494
|
+
/** Immediately flush pending writes to disk (no debounce). */
|
|
1495
|
+
flush(): void;
|
|
1426
1496
|
get(sessionId: string): SessionRecord | undefined;
|
|
1427
1497
|
findByPlatform(channelId: string, predicate: (platform: Record<string, unknown>) => boolean): SessionRecord | undefined;
|
|
1428
1498
|
findByAgentSessionId(agentSessionId: string): SessionRecord | undefined;
|
|
@@ -1498,6 +1568,11 @@ interface EventBusEvents {
|
|
|
1498
1568
|
attachments?: unknown[];
|
|
1499
1569
|
}) => void;
|
|
1500
1570
|
"usage:recorded": (data: UsageRecordEvent) => void;
|
|
1571
|
+
"session:threadReady": (data: {
|
|
1572
|
+
sessionId: string;
|
|
1573
|
+
channelId: string;
|
|
1574
|
+
threadId: string;
|
|
1575
|
+
}) => void;
|
|
1501
1576
|
"session:configChanged": (data: {
|
|
1502
1577
|
sessionId: string;
|
|
1503
1578
|
}) => void;
|
|
@@ -1527,7 +1602,9 @@ declare class SessionManager {
|
|
|
1527
1602
|
getRecordByAgentSessionId(agentSessionId: string): SessionRecord | undefined;
|
|
1528
1603
|
getRecordByThread(channelId: string, threadId: string): SessionRecord | undefined;
|
|
1529
1604
|
registerSession(session: Session): void;
|
|
1530
|
-
patchRecord(sessionId: string, patch: Partial<SessionRecord
|
|
1605
|
+
patchRecord(sessionId: string, patch: Partial<SessionRecord>, options?: {
|
|
1606
|
+
immediate?: boolean;
|
|
1607
|
+
}): Promise<void>;
|
|
1531
1608
|
getSessionRecord(sessionId: string): SessionRecord | undefined;
|
|
1532
1609
|
cancelSession(sessionId: string): Promise<void>;
|
|
1533
1610
|
listSessions(channelId?: string): Session[];
|
|
@@ -1567,24 +1644,26 @@ declare class SessionBridge {
|
|
|
1567
1644
|
private adapter;
|
|
1568
1645
|
private deps;
|
|
1569
1646
|
private connected;
|
|
1570
|
-
private
|
|
1571
|
-
private sessionEventHandler?;
|
|
1572
|
-
private statusChangeHandler?;
|
|
1573
|
-
private namedHandler?;
|
|
1574
|
-
private promptCountHandler?;
|
|
1647
|
+
private cleanupFns;
|
|
1575
1648
|
constructor(session: Session, adapter: IChannelAdapter, deps: BridgeDeps);
|
|
1576
1649
|
private get tracer();
|
|
1650
|
+
/** Register a listener and track it for cleanup */
|
|
1651
|
+
private listen;
|
|
1577
1652
|
/** Send message to adapter, optionally running through message:outgoing middleware */
|
|
1578
1653
|
private sendMessage;
|
|
1579
1654
|
connect(): void;
|
|
1580
1655
|
disconnect(): void;
|
|
1581
|
-
|
|
1582
|
-
private
|
|
1656
|
+
/** Dispatch an agent event through middleware and to the adapter */
|
|
1657
|
+
private dispatchAgentEvent;
|
|
1583
1658
|
private handleAgentEvent;
|
|
1584
1659
|
/** Persist current ACP state (configOptions, agentCapabilities) to session store as cache */
|
|
1585
1660
|
private persistAcpState;
|
|
1586
|
-
|
|
1587
|
-
private
|
|
1661
|
+
/** Resolve a permission request through the full pipeline: middleware -> auto-approve -> ask user */
|
|
1662
|
+
private resolvePermission;
|
|
1663
|
+
/** Check if a permission request should be auto-approved (openacp commands or bypass mode) */
|
|
1664
|
+
private checkAutoApprove;
|
|
1665
|
+
/** Emit permission:afterResolve middleware hook (fire-and-forget) */
|
|
1666
|
+
private emitAfterResolve;
|
|
1588
1667
|
}
|
|
1589
1668
|
|
|
1590
1669
|
interface TunnelEntry {
|
|
@@ -1629,12 +1708,11 @@ declare class ViewerStore {
|
|
|
1629
1708
|
declare class TunnelService {
|
|
1630
1709
|
private registry;
|
|
1631
1710
|
private store;
|
|
1632
|
-
private server;
|
|
1633
1711
|
private config;
|
|
1634
|
-
private
|
|
1712
|
+
private apiPort;
|
|
1635
1713
|
private startError;
|
|
1636
1714
|
constructor(config: TunnelConfig, registryPath?: string, binDir?: string);
|
|
1637
|
-
start(): Promise<string>;
|
|
1715
|
+
start(apiPort: number): Promise<string>;
|
|
1638
1716
|
stop(): Promise<void>;
|
|
1639
1717
|
addTunnel(port: number, opts?: {
|
|
1640
1718
|
label?: string;
|
|
@@ -1700,10 +1778,127 @@ interface ContextResult {
|
|
|
1700
1778
|
};
|
|
1701
1779
|
}
|
|
1702
1780
|
|
|
1781
|
+
interface SessionHistory {
|
|
1782
|
+
version: 1;
|
|
1783
|
+
sessionId: string;
|
|
1784
|
+
turns: Turn[];
|
|
1785
|
+
}
|
|
1786
|
+
interface Turn {
|
|
1787
|
+
index: number;
|
|
1788
|
+
role: "user" | "assistant";
|
|
1789
|
+
timestamp: string;
|
|
1790
|
+
content?: string;
|
|
1791
|
+
attachments?: HistoryAttachment[];
|
|
1792
|
+
steps?: Step[];
|
|
1793
|
+
usage?: HistoryUsage;
|
|
1794
|
+
stopReason?: string;
|
|
1795
|
+
}
|
|
1796
|
+
interface HistoryAttachment {
|
|
1797
|
+
type: "image" | "audio" | "file";
|
|
1798
|
+
fileName: string;
|
|
1799
|
+
mimeType: string;
|
|
1800
|
+
size: number;
|
|
1801
|
+
}
|
|
1802
|
+
interface HistoryUsage {
|
|
1803
|
+
tokensUsed?: number;
|
|
1804
|
+
contextSize?: number;
|
|
1805
|
+
cost?: {
|
|
1806
|
+
amount: number;
|
|
1807
|
+
currency: string;
|
|
1808
|
+
};
|
|
1809
|
+
}
|
|
1810
|
+
type Step = ThinkingStep | TextStep | ToolCallStep | PlanStep | ImageStep | AudioStep | ResourceStep | ResourceLinkStep | ModeChangeStep | ConfigChangeStep;
|
|
1811
|
+
interface ThinkingStep {
|
|
1812
|
+
type: "thinking";
|
|
1813
|
+
content: string;
|
|
1814
|
+
}
|
|
1815
|
+
interface TextStep {
|
|
1816
|
+
type: "text";
|
|
1817
|
+
content: string;
|
|
1818
|
+
}
|
|
1819
|
+
interface ToolCallStep {
|
|
1820
|
+
type: "tool_call";
|
|
1821
|
+
id: string;
|
|
1822
|
+
name: string;
|
|
1823
|
+
kind?: string;
|
|
1824
|
+
status: string;
|
|
1825
|
+
input?: unknown;
|
|
1826
|
+
output?: unknown;
|
|
1827
|
+
diff?: {
|
|
1828
|
+
path: string;
|
|
1829
|
+
oldText?: string;
|
|
1830
|
+
newText: string;
|
|
1831
|
+
} | null;
|
|
1832
|
+
locations?: {
|
|
1833
|
+
path: string;
|
|
1834
|
+
line?: number;
|
|
1835
|
+
}[];
|
|
1836
|
+
permission?: {
|
|
1837
|
+
requested: boolean;
|
|
1838
|
+
outcome: string;
|
|
1839
|
+
} | null;
|
|
1840
|
+
}
|
|
1841
|
+
interface PlanStep {
|
|
1842
|
+
type: "plan";
|
|
1843
|
+
entries: {
|
|
1844
|
+
content: string;
|
|
1845
|
+
priority: string;
|
|
1846
|
+
status: string;
|
|
1847
|
+
}[];
|
|
1848
|
+
}
|
|
1849
|
+
interface ImageStep {
|
|
1850
|
+
type: "image";
|
|
1851
|
+
mimeType: string;
|
|
1852
|
+
filePath: string;
|
|
1853
|
+
size?: number;
|
|
1854
|
+
}
|
|
1855
|
+
interface AudioStep {
|
|
1856
|
+
type: "audio";
|
|
1857
|
+
mimeType: string;
|
|
1858
|
+
filePath: string;
|
|
1859
|
+
size?: number;
|
|
1860
|
+
}
|
|
1861
|
+
interface ResourceStep {
|
|
1862
|
+
type: "resource";
|
|
1863
|
+
uri: string;
|
|
1864
|
+
name: string;
|
|
1865
|
+
text?: string;
|
|
1866
|
+
}
|
|
1867
|
+
interface ResourceLinkStep {
|
|
1868
|
+
type: "resource_link";
|
|
1869
|
+
uri: string;
|
|
1870
|
+
name: string;
|
|
1871
|
+
title?: string;
|
|
1872
|
+
description?: string;
|
|
1873
|
+
}
|
|
1874
|
+
interface ModeChangeStep {
|
|
1875
|
+
type: "mode_change";
|
|
1876
|
+
modeId: string;
|
|
1877
|
+
}
|
|
1878
|
+
interface ConfigChangeStep {
|
|
1879
|
+
type: "config_change";
|
|
1880
|
+
configId: string;
|
|
1881
|
+
value: string;
|
|
1882
|
+
}
|
|
1883
|
+
|
|
1884
|
+
declare class HistoryStore {
|
|
1885
|
+
private readonly dir;
|
|
1886
|
+
constructor(dir: string);
|
|
1887
|
+
write(history: SessionHistory): Promise<void>;
|
|
1888
|
+
read(sessionId: string): Promise<SessionHistory | null>;
|
|
1889
|
+
exists(sessionId: string): Promise<boolean>;
|
|
1890
|
+
list(): Promise<string[]>;
|
|
1891
|
+
delete(sessionId: string): Promise<void>;
|
|
1892
|
+
private filePath;
|
|
1893
|
+
}
|
|
1894
|
+
|
|
1703
1895
|
declare class ContextManager {
|
|
1704
1896
|
private providers;
|
|
1705
1897
|
private cache;
|
|
1898
|
+
private historyStore?;
|
|
1706
1899
|
constructor(cachePath?: string);
|
|
1900
|
+
setHistoryStore(store: HistoryStore): void;
|
|
1901
|
+
getHistory(sessionId: string): Promise<SessionHistory | null>;
|
|
1707
1902
|
register(provider: ContextProvider): void;
|
|
1708
1903
|
getProvider(repoPath: string): Promise<ContextProvider | null>;
|
|
1709
1904
|
listSessions(query: ContextQuery): Promise<SessionListResult | null>;
|
|
@@ -1889,6 +2084,45 @@ declare class LifecycleManager {
|
|
|
1889
2084
|
shutdown(): Promise<void>;
|
|
1890
2085
|
}
|
|
1891
2086
|
|
|
2087
|
+
declare class MenuRegistry {
|
|
2088
|
+
private items;
|
|
2089
|
+
register(item: MenuItem): void;
|
|
2090
|
+
unregister(id: string): void;
|
|
2091
|
+
getItem(id: string): MenuItem | undefined;
|
|
2092
|
+
/** Get all visible items sorted by priority */
|
|
2093
|
+
getItems(): MenuItem[];
|
|
2094
|
+
}
|
|
2095
|
+
|
|
2096
|
+
interface AssistantManagerCore {
|
|
2097
|
+
createSession(params: {
|
|
2098
|
+
channelId: string;
|
|
2099
|
+
agentName: string;
|
|
2100
|
+
workingDirectory: string;
|
|
2101
|
+
initialName?: string;
|
|
2102
|
+
isAssistant?: boolean;
|
|
2103
|
+
}): Promise<Session>;
|
|
2104
|
+
connectSessionBridge(session: Session): void;
|
|
2105
|
+
configManager: {
|
|
2106
|
+
get(): {
|
|
2107
|
+
defaultAgent: string;
|
|
2108
|
+
};
|
|
2109
|
+
resolveWorkspace(): string;
|
|
2110
|
+
};
|
|
2111
|
+
}
|
|
2112
|
+
declare class AssistantManager {
|
|
2113
|
+
private core;
|
|
2114
|
+
private registry;
|
|
2115
|
+
private sessions;
|
|
2116
|
+
private readyState;
|
|
2117
|
+
private respawning;
|
|
2118
|
+
constructor(core: AssistantManagerCore, registry: AssistantRegistry);
|
|
2119
|
+
spawn(channelId: string, threadId: string): Promise<Session>;
|
|
2120
|
+
get(channelId: string): Session | null;
|
|
2121
|
+
isAssistant(sessionId: string): boolean;
|
|
2122
|
+
respawn(channelId: string, threadId: string): Promise<Session>;
|
|
2123
|
+
waitReady(channelId: string): Promise<void>;
|
|
2124
|
+
}
|
|
2125
|
+
|
|
1892
2126
|
interface InstanceContext {
|
|
1893
2127
|
id: string;
|
|
1894
2128
|
root: string;
|
|
@@ -1931,6 +2165,9 @@ declare class OpenACPCore {
|
|
|
1931
2165
|
readonly lifecycleManager: LifecycleManager;
|
|
1932
2166
|
private agentSwitchHandler;
|
|
1933
2167
|
readonly instanceContext?: InstanceContext;
|
|
2168
|
+
readonly menuRegistry: MenuRegistry;
|
|
2169
|
+
readonly assistantRegistry: AssistantRegistry;
|
|
2170
|
+
assistantManager: AssistantManager;
|
|
1934
2171
|
private getService;
|
|
1935
2172
|
get securityGuard(): SecurityGuard;
|
|
1936
2173
|
get notificationManager(): NotificationManager;
|
|
@@ -1989,7 +2226,10 @@ declare class OpenACPCore {
|
|
|
1989
2226
|
resumed: boolean;
|
|
1990
2227
|
}>;
|
|
1991
2228
|
getOrResumeSession(channelId: string, threadId: string): Promise<Session | null>;
|
|
1992
|
-
/**
|
|
2229
|
+
/** Connect a session bridge for the given session (used by AssistantManager) */
|
|
2230
|
+
connectSessionBridge(session: Session): void;
|
|
2231
|
+
/** Create a SessionBridge for the given session and adapter.
|
|
2232
|
+
* Disconnects any existing bridge for the same session first. */
|
|
1993
2233
|
createBridge(session: Session, adapter: IChannelAdapter): SessionBridge;
|
|
1994
2234
|
}
|
|
1995
2235
|
|
|
@@ -2178,10 +2418,28 @@ interface CreateTokenOpts {
|
|
|
2178
2418
|
expire: string;
|
|
2179
2419
|
scopes?: string[];
|
|
2180
2420
|
}
|
|
2421
|
+
interface StoredCode {
|
|
2422
|
+
code: string;
|
|
2423
|
+
role: string;
|
|
2424
|
+
scopes?: string[];
|
|
2425
|
+
name: string;
|
|
2426
|
+
expire: string;
|
|
2427
|
+
createdAt: string;
|
|
2428
|
+
expiresAt: string;
|
|
2429
|
+
used: boolean;
|
|
2430
|
+
}
|
|
2431
|
+
interface CreateCodeOpts {
|
|
2432
|
+
role: string;
|
|
2433
|
+
name: string;
|
|
2434
|
+
expire: string;
|
|
2435
|
+
scopes?: string[];
|
|
2436
|
+
codeTtlMs?: number;
|
|
2437
|
+
}
|
|
2181
2438
|
|
|
2182
2439
|
declare class TokenStore {
|
|
2183
2440
|
private filePath;
|
|
2184
2441
|
private tokens;
|
|
2442
|
+
private codes;
|
|
2185
2443
|
private savePromise;
|
|
2186
2444
|
private savePending;
|
|
2187
2445
|
constructor(filePath: string);
|
|
@@ -2194,9 +2452,14 @@ declare class TokenStore {
|
|
|
2194
2452
|
list(): StoredToken[];
|
|
2195
2453
|
private lastUsedSaveTimer;
|
|
2196
2454
|
updateLastUsed(id: string): void;
|
|
2197
|
-
/** Wait for any in-flight
|
|
2455
|
+
/** Wait for any in-flight and pending saves to complete */
|
|
2198
2456
|
flush(): Promise<void>;
|
|
2199
2457
|
destroy(): void;
|
|
2458
|
+
createCode(opts: CreateCodeOpts): StoredCode;
|
|
2459
|
+
getCode(code: string): StoredCode | undefined;
|
|
2460
|
+
exchangeCode(code: string): StoredCode | undefined;
|
|
2461
|
+
listCodes(): StoredCode[];
|
|
2462
|
+
revokeCode(code: string): void;
|
|
2200
2463
|
cleanup(): void;
|
|
2201
2464
|
}
|
|
2202
2465
|
|
|
@@ -2713,8 +2976,6 @@ declare class TelegramAdapter extends MessagingAdapter {
|
|
|
2713
2976
|
private telegramConfig;
|
|
2714
2977
|
private saveTopicIds?;
|
|
2715
2978
|
private permissionHandler;
|
|
2716
|
-
private assistantSession;
|
|
2717
|
-
private assistantInitializing;
|
|
2718
2979
|
private notificationTopicId;
|
|
2719
2980
|
private assistantTopicId;
|
|
2720
2981
|
private sendQueue;
|
|
@@ -2800,4 +3061,4 @@ declare class TelegramAdapter extends MessagingAdapter {
|
|
|
2800
3061
|
archiveSessionTopic(sessionId: string): Promise<void>;
|
|
2801
3062
|
}
|
|
2802
3063
|
|
|
2803
|
-
export { ActivityTracker, AdapterCapabilities, AgentCapabilities, AgentCatalog, AgentCommand, AgentDefinition, AgentEvent, AgentInstance, AgentListItem, AgentManager, AgentStore, AgentSwitchEntry, type ApiConfig, type ApiServerInstance, type ApiServerOptions, type ApiServerService, Attachment, AvailabilityResult, BaseRenderer, type BridgeDeps, CONFIG_REGISTRY, ChannelConfig, type CleanupResult, type CommandArgs, type CommandDef, CommandRegistry, type CommandResponse, type Config, type ConfigFieldDef, ConfigManager$1 as ConfigManager, ConfigOption, ContextManager, type ContextOptions, type ContextProvider, type ContextQuery, type ContextResult, type ContextService, type SessionInfo as ContextSessionInfo, type DeleteTopicResult, DisplaySpecBuilder, DisplayVerbosity, DoctorEngine, type DoctorReport, DraftManager, EntireProvider, EventBus, type EventBusEvents, FileService, type FileServiceInterface, GroqSTT, IChannelAdapter, type IRenderer, IncomingMessage, type InstallContext, InstallProgress, InstallResult, InstalledAgent, type ListItem, type Logger$1 as Logger, type LoggingConfig, McpServerConfig, type MenuOption, MessageTransformer, MessagingAdapter, type MessagingAdapterConfig, type MigrateContext, NotificationManager, NotificationMessage, type NotificationService, OpenACPCore, type OpenACPPlugin, OutgoingMessage, OutputMode, OutputModeResolver, PRODUCT_GUIDE, type PendingFix, PermissionGate, PermissionRequest, PlanEntry, type PluginContext, type PluginPermission, type PluginStorage, PromptQueue, RegistryAgent, type RenderedMessage, SSEManager, type STTOptions, type STTProvider$1 as STTProvider, type STTResult, SecurityGuard, type SecurityService, SendQueue, Session, SessionBridge, type SessionCreateParams, type SessionEvents, SessionFactory, type SessionListResult, SessionManager, SessionRecord, SessionStatus, SetConfigOptionValue, type SettingsAPI, type SideEffectDeps, type SpeechProviderConfig, SpeechService, type SpeechServiceConfig, type SpeechServiceInterface, StaticServer, StderrCapture, StopReason, StreamAdapter, type TTSOptions, type TTSProvider$1 as TTSProvider, type TTSResult, TelegramAdapter, type TerminalIO, ThoughtBuffer, type ThoughtDisplaySpec, ToolCallMeta, ToolCallTracker, type ToolCardSnapshot, ToolCardState, type ToolCardStateConfig, type ToolDisplaySpec, type ToolEntry, ToolStateMap, type TopicInfo, TopicManager, type TunnelServiceInterface, TypedEmitter, type UsageConfig, UsageRecord, UsageRecordEvent, type UsageService, ViewerLinks, cleanupOldSessionLogs, createApiServer, createApiServerService, createChildLogger, createSessionLogger, expandHome, extractContentText, formatTokens, formatToolSummary, formatToolTitle, getConfigValue, getFieldDef, getPidPath, getSafeFields, getStatus, initLogger, installAutoStart, isAutoStartInstalled, isAutoStartSupported, isHotReloadable, log, nodeToWebReadable, nodeToWebWritable, progressBar, resolveOptions, resolveToolIcon, runConfigEditor, setLogLevel, shutdownLogger, splitMessage, startDaemon, stopDaemon, stripCodeFences, truncateContent, uninstallAutoStart };
|
|
3064
|
+
export { ActivityTracker, AdapterCapabilities, AgentCapabilities, AgentCatalog, AgentCommand, AgentDefinition, AgentEvent, AgentInstance, AgentListItem, AgentManager, AgentStore, AgentSwitchEntry, type ApiConfig, type ApiServerInstance, type ApiServerOptions, type ApiServerService, type AssistantCommand, AssistantManager, AssistantRegistry, type AssistantSection, Attachment, AvailabilityResult, BaseRenderer, type BridgeDeps, CONFIG_REGISTRY, ChannelConfig, type CleanupResult, type CommandArgs, type CommandDef, CommandRegistry, type CommandResponse, type Config, type ConfigFieldDef, ConfigManager$1 as ConfigManager, ConfigOption, ContextManager, type ContextOptions, type ContextProvider, type ContextQuery, type ContextResult, type ContextService, type SessionInfo as ContextSessionInfo, type DeleteTopicResult, DisplaySpecBuilder, DisplayVerbosity, DoctorEngine, type DoctorReport, DraftManager, EntireProvider, EventBus, type EventBusEvents, FileService, type FileServiceInterface, GroqSTT, IChannelAdapter, type IRenderer, IncomingMessage, type InstallContext, InstallProgress, InstallResult, InstalledAgent, type ListItem, type Logger$1 as Logger, type LoggingConfig, McpServerConfig, type MenuItem, type MenuOption, MenuRegistry, MessageTransformer, MessagingAdapter, type MessagingAdapterConfig, type MigrateContext, NotificationManager, NotificationMessage, type NotificationService, OpenACPCore, type OpenACPPlugin, OutgoingMessage, OutputMode, OutputModeResolver, PRODUCT_GUIDE, type PendingFix, PermissionGate, PermissionRequest, PlanEntry, type PluginContext, type PluginPermission, type PluginStorage, PromptQueue, RegistryAgent, type RenderedMessage, SSEManager, type STTOptions, type STTProvider$1 as STTProvider, type STTResult, SecurityGuard, type SecurityService, SendQueue, Session, SessionBridge, type SessionCreateParams, type SessionEvents, SessionFactory, type SessionListResult, SessionManager, SessionRecord, SessionStatus, SetConfigOptionValue, type SettingsAPI, type SideEffectDeps, type SpeechProviderConfig, SpeechService, type SpeechServiceConfig, type SpeechServiceInterface, StaticServer, StderrCapture, StopReason, StreamAdapter, type TTSOptions, type TTSProvider$1 as TTSProvider, type TTSResult, TelegramAdapter, type TerminalIO, ThoughtBuffer, type ThoughtDisplaySpec, ToolCallMeta, ToolCallTracker, type ToolCardSnapshot, ToolCardState, type ToolCardStateConfig, type ToolDisplaySpec, type ToolEntry, ToolStateMap, type TopicInfo, TopicManager, type TunnelServiceInterface, TypedEmitter, type UsageConfig, UsageRecord, UsageRecordEvent, type UsageService, ViewerLinks, cleanupOldSessionLogs, createApiServer, createApiServerService, createChildLogger, createSessionLogger, expandHome, extractContentText, formatTokens, formatToolSummary, formatToolTitle, getConfigValue, getFieldDef, getPidPath, getSafeFields, getStatus, initLogger, installAutoStart, isAutoStartInstalled, isAutoStartSupported, isHotReloadable, log, nodeToWebReadable, nodeToWebWritable, progressBar, resolveOptions, resolveToolIcon, runConfigEditor, setLogLevel, shutdownLogger, splitMessage, startDaemon, stopDaemon, stripCodeFences, truncateContent, uninstallAutoStart };
|