@openacp/cli 2026.406.1 → 2026.406.3

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, T as TurnContext, C as ConfigOption, k as AgentSwitchEntry, l as AgentCommand, 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-DstweC6V.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-DstweC6V.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, T as TurnContext, C as ConfigOption, k as AgentSwitchEntry, l as AgentCommand, 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-CKXNnTy4.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-CKXNnTy4.js';
3
3
  import pino from 'pino';
4
4
  import * as zod from 'zod';
5
5
  import { ZodSchema, z } from 'zod';
@@ -327,6 +327,7 @@ interface MiddlewarePayloadMap {
327
327
  sessionId: string;
328
328
  text: string;
329
329
  attachments?: Attachment[];
330
+ sourceAdapterId?: string;
330
331
  };
331
332
  'agent:beforeEvent': {
332
333
  sessionId: string;
@@ -549,6 +550,7 @@ declare const ConfigSchema: z.ZodObject<{
549
550
  defaultAgent: z.ZodString;
550
551
  workspace: z.ZodDefault<z.ZodObject<{
551
552
  baseDir: z.ZodDefault<z.ZodString>;
553
+ allowExternalWorkspaces: z.ZodDefault<z.ZodBoolean>;
552
554
  security: z.ZodDefault<z.ZodObject<{
553
555
  allowedPaths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
554
556
  envWhitelist: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
@@ -561,12 +563,14 @@ declare const ConfigSchema: z.ZodObject<{
561
563
  }>>;
562
564
  }, "strip", z.ZodTypeAny, {
563
565
  baseDir: string;
566
+ allowExternalWorkspaces: boolean;
564
567
  security: {
565
568
  allowedPaths: string[];
566
569
  envWhitelist: string[];
567
570
  };
568
571
  }, {
569
572
  baseDir?: string | undefined;
573
+ allowExternalWorkspaces?: boolean | undefined;
570
574
  security?: {
571
575
  allowedPaths?: string[] | undefined;
572
576
  envWhitelist?: string[] | undefined;
@@ -622,6 +626,7 @@ declare const ConfigSchema: z.ZodObject<{
622
626
  defaultAgent: string;
623
627
  workspace: {
624
628
  baseDir: string;
629
+ allowExternalWorkspaces: boolean;
625
630
  security: {
626
631
  allowedPaths: string[];
627
632
  envWhitelist: string[];
@@ -653,6 +658,7 @@ declare const ConfigSchema: z.ZodObject<{
653
658
  instanceName?: string | undefined;
654
659
  workspace?: {
655
660
  baseDir?: string | undefined;
661
+ allowExternalWorkspaces?: boolean | undefined;
656
662
  security?: {
657
663
  allowedPaths?: string[] | undefined;
658
664
  envWhitelist?: string[] | undefined;
@@ -853,8 +859,8 @@ declare class AgentInstance extends TypedEmitter<AgentInstanceEvents> {
853
859
  private constructor();
854
860
  private static spawnSubprocess;
855
861
  private setupCrashDetection;
856
- static spawn(agentDef: AgentDefinition, workingDirectory: string, mcpServers?: McpServerConfig[]): Promise<AgentInstance>;
857
- static resume(agentDef: AgentDefinition, workingDirectory: string, agentSessionId: string, mcpServers?: McpServerConfig[]): Promise<AgentInstance>;
862
+ static spawn(agentDef: AgentDefinition, workingDirectory: string, mcpServers?: McpServerConfig[], allowedPaths?: string[]): Promise<AgentInstance>;
863
+ static resume(agentDef: AgentDefinition, workingDirectory: string, agentSessionId: string, mcpServers?: McpServerConfig[], allowedPaths?: string[]): Promise<AgentInstance>;
858
864
  private createClient;
859
865
  setConfigOption(configId: string, value: SetConfigOptionValue): Promise<SetSessionConfigOptionResponse>;
860
866
  listSessions(cwd?: string, cursor?: string): Promise<ListSessionsResponse>;
@@ -925,8 +931,8 @@ declare class AgentManager {
925
931
  constructor(catalog: AgentCatalog);
926
932
  getAvailableAgents(): AgentDefinition[];
927
933
  getAgent(name: string): AgentDefinition | undefined;
928
- spawn(agentName: string, workingDirectory: string): Promise<AgentInstance>;
929
- resume(agentName: string, workingDirectory: string, agentSessionId: string): Promise<AgentInstance>;
934
+ spawn(agentName: string, workingDirectory: string, allowedPaths?: string[]): Promise<AgentInstance>;
935
+ resume(agentName: string, workingDirectory: string, agentSessionId: string, allowedPaths?: string[]): Promise<AgentInstance>;
930
936
  }
931
937
 
932
938
  /**
@@ -1043,7 +1049,9 @@ declare class Session extends TypedEmitter<SessionEvents> {
1043
1049
  set threadId(value: string);
1044
1050
  agentName: string;
1045
1051
  workingDirectory: string;
1046
- agentInstance: AgentInstance;
1052
+ private _agentInstance;
1053
+ get agentInstance(): AgentInstance;
1054
+ set agentInstance(agent: AgentInstance);
1047
1055
  agentSessionId: string;
1048
1056
  private _status;
1049
1057
  name?: string;
@@ -1069,9 +1077,6 @@ declare class Session extends TypedEmitter<SessionEvents> {
1069
1077
  threadIds: Map<string, string>;
1070
1078
  /** Active turn context — sealed on prompt dequeue, cleared on turn end */
1071
1079
  activeTurnContext: TurnContext | null;
1072
- /** The agentInstance for which the agent→session event relay is wired (prevents duplicate relays from multiple bridges).
1073
- * When the agent is swapped, the relay must be re-wired to the new instance. */
1074
- agentRelaySource: AgentInstance | null;
1075
1080
  readonly permissionGate: PermissionGate;
1076
1081
  private readonly queue;
1077
1082
  private speechService?;
@@ -1085,6 +1090,12 @@ declare class Session extends TypedEmitter<SessionEvents> {
1085
1090
  speechService?: SpeechService;
1086
1091
  isAssistant?: boolean;
1087
1092
  });
1093
+ /** Wire the agent→session event relay on the current agentInstance.
1094
+ * Removes any previous relay first to avoid duplicates on agent switch.
1095
+ * This relay ensures session.emit("agent_event") fires for ALL sessions,
1096
+ * including headless API sessions that have no SessionBridge attached. */
1097
+ private agentRelayCleanup?;
1098
+ private wireAgentRelay;
1088
1099
  /** Wire a listener on the current agentInstance to buffer commands_update events.
1089
1100
  * Must be called after every agentInstance replacement (constructor + switchAgent). */
1090
1101
  private commandsBufferCleanup?;
@@ -1188,6 +1199,7 @@ interface SessionStore {
1188
1199
  get(sessionId: string): SessionRecord | undefined;
1189
1200
  findByPlatform(channelId: string, predicate: (platform: Record<string, unknown>) => boolean): SessionRecord | undefined;
1190
1201
  findByAgentSessionId(agentSessionId: string): SessionRecord | undefined;
1202
+ findAssistant(channelId: string): SessionRecord | undefined;
1191
1203
  list(channelId?: string): SessionRecord[];
1192
1204
  remove(sessionId: string): Promise<void>;
1193
1205
  }
@@ -1535,6 +1547,7 @@ interface Turn {
1535
1547
  timestamp: string;
1536
1548
  content?: string;
1537
1549
  attachments?: HistoryAttachment[];
1550
+ sourceAdapterId?: string;
1538
1551
  steps?: Step[];
1539
1552
  usage?: HistoryUsage;
1540
1553
  stopReason?: string;
@@ -1667,6 +1680,7 @@ interface SessionCreateParams {
1667
1680
  resumeAgentSessionId?: string;
1668
1681
  existingSessionId?: string;
1669
1682
  initialName?: string;
1683
+ isAssistant?: boolean;
1670
1684
  }
1671
1685
  interface SideEffectDeps {
1672
1686
  eventBus: EventBus;
@@ -1861,6 +1875,7 @@ interface AssistantManagerCore {
1861
1875
  initialName?: string;
1862
1876
  isAssistant?: boolean;
1863
1877
  threadId?: string;
1878
+ existingSessionId?: string;
1864
1879
  }): Promise<Session>;
1865
1880
  connectSessionBridge(session: Session): void;
1866
1881
  configManager: {
@@ -1869,15 +1884,15 @@ interface AssistantManagerCore {
1869
1884
  };
1870
1885
  resolveWorkspace(): string;
1871
1886
  };
1887
+ sessionStore: SessionStore | null;
1872
1888
  }
1873
1889
  declare class AssistantManager {
1874
1890
  private core;
1875
1891
  private registry;
1876
1892
  private sessions;
1877
- private respawning;
1878
1893
  private pendingSystemPrompts;
1879
1894
  constructor(core: AssistantManagerCore, registry: AssistantRegistry);
1880
- spawn(channelId: string, threadId: string): Promise<Session>;
1895
+ getOrSpawn(channelId: string, threadId: string): Promise<Session>;
1881
1896
  get(channelId: string): Session | null;
1882
1897
  /**
1883
1898
  * Consume and return any pending system prompt for a channel.
@@ -1885,7 +1900,6 @@ declare class AssistantManager {
1885
1900
  */
1886
1901
  consumePendingSystemPrompt(channelId: string): string | undefined;
1887
1902
  isAssistant(sessionId: string): boolean;
1888
- respawn(channelId: string, threadId: string): Promise<Session>;
1889
1903
  }
1890
1904
 
1891
1905
  interface InstanceContext {
@@ -1924,7 +1938,7 @@ declare class OpenACPCore {
1924
1938
  /** Set by main.ts — triggers graceful shutdown with restart exit code */
1925
1939
  requestRestart: (() => Promise<void>) | null;
1926
1940
  private _tunnelService?;
1927
- private sessionStore;
1941
+ sessionStore: SessionStore | null;
1928
1942
  eventBus: EventBus;
1929
1943
  sessionFactory: SessionFactory;
1930
1944
  readonly lifecycleManager: LifecycleManager;
@@ -1962,6 +1976,7 @@ declare class OpenACPCore {
1962
1976
  createThread?: boolean;
1963
1977
  initialName?: string;
1964
1978
  threadId?: string;
1979
+ isAssistant?: boolean;
1965
1980
  }): Promise<Session>;
1966
1981
  handleNewSession(channelId: string, agentName?: string, workspacePath?: string, options?: {
1967
1982
  createThread?: boolean;