@openacp/cli 2026.403.8 → 2026.404.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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as Attachment, O as OutgoingMessage, I as IChannelAdapter, N as NotificationMessage, a as AgentEvent, S as StopReason, P as PermissionRequest, U as UsageRecord, b as AgentCapabilities, c as AgentDefinition, M as McpServerConfig, d as SetConfigOptionValue, e as InstalledAgent, R as RegistryAgent, f as AgentListItem, g as AvailabilityResult, h as InstallProgress, i as InstallResult, j as SessionStatus, C as ConfigOption, k as AgentSwitchEntry, l as AgentCommand, m as SessionRecord, 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-BL33p1ZP.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-BL33p1ZP.js';
1
+ import { A as Attachment, O as OutgoingMessage, I as IChannelAdapter, N as NotificationMessage, a as AgentEvent, S as StopReason, P as PermissionRequest, U as UsageRecord, b as AgentCapabilities, c as AgentDefinition, M as McpServerConfig, d as SetConfigOptionValue, e as InstalledAgent, R as RegistryAgent, f as AgentListItem, g as AvailabilityResult, h as InstallProgress, i as InstallResult, j as SessionStatus, C as ConfigOption, k as AgentSwitchEntry, l as AgentCommand, T as TurnContext, m as TurnRouting, n as SessionRecord, o as UsageRecordEvent, p as IncomingMessage, D as DisplayVerbosity, q as ChannelConfig, r as AdapterCapabilities, s as ToolCallMeta, V as ViewerLinks, t as OutputMode, u as PlanEntry } from './channel-CmTWKnpK.js';
2
+ export { v as AgentDistribution, w as AuthMethod, x as AuthenticateRequest, y as ChannelAdapter, z as ConfigSelectChoice, B as ConfigSelectGroup, E as ContentBlock, K as KIND_ICONS, F as ModelInfo, G as NewSessionResponse, H as PermissionOption, J as PromptResponse, L as RegistryBinaryTarget, Q as RegistryDistribution, W as STATUS_ICONS, X as SessionListItem, Y as SessionListResponse, Z as SessionMode, _ as SessionModeState, $ as SessionModelState, a0 as TelegramPlatformData, a1 as ToolUpdateMeta, a2 as createTurnContext, a3 as getEffectiveTarget, a4 as isSystemEvent } from './channel-CmTWKnpK.js';
3
3
  import pino from 'pino';
4
4
  import * as zod from 'zod';
5
5
  import { ZodSchema, z } from 'zod';
@@ -1428,7 +1428,9 @@ interface SessionEvents {
1428
1428
  declare class Session extends TypedEmitter<SessionEvents> {
1429
1429
  id: string;
1430
1430
  channelId: string;
1431
- threadId: string;
1431
+ /** @deprecated Use threadIds map directly. Getter returns primary adapter's threadId. */
1432
+ get threadId(): string;
1433
+ set threadId(value: string);
1432
1434
  agentName: string;
1433
1435
  workingDirectory: string;
1434
1436
  agentInstance: AgentInstance;
@@ -1451,6 +1453,12 @@ declare class Session extends TypedEmitter<SessionEvents> {
1451
1453
  middlewareChain?: MiddlewareChain;
1452
1454
  /** Latest commands emitted by the agent — buffered before bridge connects so they're not lost */
1453
1455
  latestCommands: AgentCommand[] | null;
1456
+ /** Adapters currently attached to this session (including primary) */
1457
+ attachedAdapters: string[];
1458
+ /** Per-adapter thread IDs: adapterId → threadId */
1459
+ threadIds: Map<string, string>;
1460
+ /** Active turn context — sealed on prompt dequeue, cleared on turn end */
1461
+ activeTurnContext: TurnContext | null;
1454
1462
  readonly permissionGate: PermissionGate;
1455
1463
  private readonly queue;
1456
1464
  private speechService?;
@@ -1464,6 +1472,10 @@ declare class Session extends TypedEmitter<SessionEvents> {
1464
1472
  speechService?: SpeechService;
1465
1473
  isAssistant?: boolean;
1466
1474
  });
1475
+ /** Wire a listener on the current agentInstance to buffer commands_update events.
1476
+ * Must be called after every agentInstance replacement (constructor + switchAgent). */
1477
+ private commandsBufferCleanup?;
1478
+ private wireCommandsBuffer;
1467
1479
  get status(): SessionStatus;
1468
1480
  /** Transition to active — from initializing, error, or cancelled */
1469
1481
  activate(): void;
@@ -1479,7 +1491,7 @@ declare class Session extends TypedEmitter<SessionEvents> {
1479
1491
  get promptRunning(): boolean;
1480
1492
  setContext(markdown: string): void;
1481
1493
  setVoiceMode(mode: "off" | "next" | "on"): void;
1482
- enqueuePrompt(text: string, attachments?: Attachment[]): Promise<void>;
1494
+ enqueuePrompt(text: string, attachments?: Attachment[], routing?: TurnRouting): Promise<void>;
1483
1495
  private processPrompt;
1484
1496
  private maybeTranscribeAudio;
1485
1497
  private processTTSResponse;
@@ -1525,8 +1537,8 @@ declare class PromptQueue {
1525
1537
  private queue;
1526
1538
  private processing;
1527
1539
  private abortController;
1528
- constructor(processor: (text: string, attachments?: Attachment[]) => Promise<void>, onError?: ((err: unknown) => void) | undefined);
1529
- enqueue(text: string, attachments?: Attachment[]): Promise<void>;
1540
+ constructor(processor: (text: string, attachments?: Attachment[], routing?: TurnRouting) => Promise<void>, onError?: ((err: unknown) => void) | undefined);
1541
+ enqueue(text: string, attachments?: Attachment[], routing?: TurnRouting): Promise<void>;
1530
1542
  private process;
1531
1543
  private drainNext;
1532
1544
  clear(): void;
@@ -1590,6 +1602,8 @@ interface EventBusEvents {
1590
1602
  sessionId: string;
1591
1603
  requestId: string;
1592
1604
  decision: string;
1605
+ optionId?: string;
1606
+ resolvedBy?: string;
1593
1607
  }) => void;
1594
1608
  "kernel:booted": () => void;
1595
1609
  "system:ready": () => void;
@@ -1649,6 +1663,22 @@ interface EventBusEvents {
1649
1663
  declare class EventBus extends TypedEmitter<EventBusEvents> {
1650
1664
  }
1651
1665
 
1666
+ interface SessionSummary {
1667
+ id: string;
1668
+ agent: string;
1669
+ status: SessionStatus;
1670
+ name: string | null;
1671
+ workspace: string;
1672
+ channelId: string;
1673
+ createdAt: string;
1674
+ lastActiveAt: string | null;
1675
+ dangerousMode: boolean;
1676
+ queueDepth: number;
1677
+ promptRunning: boolean;
1678
+ configOptions?: ConfigOption[];
1679
+ capabilities: AgentCapabilities | null;
1680
+ isLive: boolean;
1681
+ }
1652
1682
  declare class SessionManager {
1653
1683
  private sessions;
1654
1684
  private store;
@@ -1669,6 +1699,7 @@ declare class SessionManager {
1669
1699
  getSessionRecord(sessionId: string): SessionRecord | undefined;
1670
1700
  cancelSession(sessionId: string): Promise<void>;
1671
1701
  listSessions(channelId?: string): Session[];
1702
+ listAllSessions(channelId?: string): SessionSummary[];
1672
1703
  listRecords(filter?: {
1673
1704
  statuses?: string[];
1674
1705
  }): SessionRecord[];
@@ -1681,6 +1712,8 @@ declare class SessionManager {
1681
1712
  /**
1682
1713
  * Forcefully destroy all sessions (kill agent subprocesses).
1683
1714
  * Use only when sessions must be fully torn down (e.g. archive).
1715
+ * Unlike shutdownAll(), this does NOT snapshot live session state (acpState, etc.)
1716
+ * because destroyed sessions are terminal and will not be resumed.
1684
1717
  */
1685
1718
  destroyAll(): Promise<void>;
1686
1719
  }
@@ -1706,12 +1739,15 @@ declare class SessionBridge {
1706
1739
  private deps;
1707
1740
  private connected;
1708
1741
  private cleanupFns;
1709
- constructor(session: Session, adapter: IChannelAdapter, deps: BridgeDeps);
1742
+ readonly adapterId: string;
1743
+ constructor(session: Session, adapter: IChannelAdapter, deps: BridgeDeps, adapterId?: string);
1710
1744
  private get tracer();
1711
1745
  /** Register a listener and track it for cleanup */
1712
1746
  private listen;
1713
1747
  /** Send message to adapter, optionally running through message:outgoing middleware */
1714
1748
  private sendMessage;
1749
+ /** Determine if this bridge should forward the given event based on turn routing. */
1750
+ shouldForward(event: AgentEvent): boolean;
1715
1751
  connect(): void;
1716
1752
  disconnect(): void;
1717
1753
  /** Dispatch an agent event through middleware and to the adapter */
@@ -2014,6 +2050,7 @@ declare class SessionFactory {
2014
2050
  * Used by adapter command handlers and handleMessage().
2015
2051
  */
2016
2052
  getOrResume(channelId: string, threadId: string): Promise<Session | null>;
2053
+ getOrResumeById(sessionId: string): Promise<Session | null>;
2017
2054
  private lazyResume;
2018
2055
  handleNewSession(channelId: string, agentName?: string, workspacePath?: string, options?: {
2019
2056
  createThread?: boolean;
@@ -2224,7 +2261,7 @@ declare class OpenACPCore {
2224
2261
  sessionManager: SessionManager;
2225
2262
  messageTransformer: MessageTransformer;
2226
2263
  adapters: Map<string, IChannelAdapter>;
2227
- /** sessionId → SessionBridge — tracks active bridges for disconnect/reconnect during agent switch */
2264
+ /** "adapterId:sessionId" → SessionBridge — tracks active bridges for disconnect/reconnect */
2228
2265
  private bridges;
2229
2266
  /** Set by main.ts — triggers graceful shutdown with restart exit code */
2230
2267
  requestRestart: (() => Promise<void>) | null;
@@ -2299,11 +2336,21 @@ declare class OpenACPCore {
2299
2336
  resumed: boolean;
2300
2337
  }>;
2301
2338
  getOrResumeSession(channelId: string, threadId: string): Promise<Session | null>;
2339
+ getOrResumeSessionById(sessionId: string): Promise<Session | null>;
2340
+ attachAdapter(sessionId: string, adapterId: string): Promise<{
2341
+ threadId: string;
2342
+ }>;
2343
+ detachAdapter(sessionId: string, adapterId: string): Promise<void>;
2344
+ private buildPlatformsFromSession;
2345
+ /** Composite bridge key: "adapterId:sessionId" */
2346
+ private bridgeKey;
2347
+ /** Get all bridge keys for a session (regardless of adapter) */
2348
+ private getSessionBridgeKeys;
2302
2349
  /** Connect a session bridge for the given session (used by AssistantManager) */
2303
2350
  connectSessionBridge(session: Session): void;
2304
2351
  /** Create a SessionBridge for the given session and adapter.
2305
- * Disconnects any existing bridge for the same session first. */
2306
- createBridge(session: Session, adapter: IChannelAdapter): SessionBridge;
2352
+ * Disconnects any existing bridge for the same adapter+session first. */
2353
+ createBridge(session: Session, adapter: IChannelAdapter, adapterId?: string): SessionBridge;
2307
2354
  }
2308
2355
 
2309
2356
  interface RegisteredCommand extends CommandDef {
@@ -3141,4 +3188,4 @@ declare class TelegramAdapter extends MessagingAdapter {
3141
3188
  archiveSessionTopic(sessionId: string): Promise<void>;
3142
3189
  }
3143
3190
 
3144
- 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, 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, 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, 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, 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 };
3191
+ 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, 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, 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, type STTResult, SecurityGuard, type SecurityService, SendQueue, Session, SessionBridge, type SessionCreateParams, type SessionEvents, SessionFactory, type SessionListResult, SessionManager, SessionRecord, SessionStatus, type SessionSummary, SetConfigOptionValue, type SettingsAPI, type SideEffectDeps, type SpeechProviderConfig, SpeechService, type SpeechServiceConfig, type SpeechServiceInterface, StaticServer, StderrCapture, StopReason, StreamAdapter, type TTSOptions, type 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, TurnContext, TurnRouting, 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 };