@n1creator/openacp-cli 2026.712.7 → 2026.712.9

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
@@ -1260,7 +1260,7 @@ declare class AgentInstance extends TypedEmitter<AgentInstanceEvents> {
1260
1260
  *
1261
1261
  * Does NOT create a session — callers must follow up with newSession or loadSession.
1262
1262
  */
1263
- static spawnSubprocess(agentDef: AgentDefinition, workingDirectory: string, allowedPaths?: string[]): Promise<AgentInstance>;
1263
+ static spawnSubprocess(agentDef: AgentDefinition, workingDirectory: string, allowedPaths?: string[], environment?: Record<string, string>): Promise<AgentInstance>;
1264
1264
  /**
1265
1265
  * Monitor the subprocess for unexpected exits and emit error events.
1266
1266
  *
@@ -1309,7 +1309,7 @@ declare class AgentInstance extends TypedEmitter<AgentInstanceEvents> {
1309
1309
  * @param mcpServers - Optional MCP server configs to extend agent capabilities
1310
1310
  * @param allowedPaths - Extra filesystem paths the agent may access
1311
1311
  */
1312
- static spawn(agentDef: AgentDefinition, workingDirectory: string, mcpServers?: McpServerConfig[], allowedPaths?: string[]): Promise<AgentInstance>;
1312
+ static spawn(agentDef: AgentDefinition, workingDirectory: string, mcpServers?: McpServerConfig[], allowedPaths?: string[], environment?: Record<string, string>): Promise<AgentInstance>;
1313
1313
  /**
1314
1314
  * Spawn a new subprocess and restore an existing agent session.
1315
1315
  *
@@ -1319,7 +1319,7 @@ declare class AgentInstance extends TypedEmitter<AgentInstanceEvents> {
1319
1319
  *
1320
1320
  * @param agentSessionId - The agent-side session ID to restore
1321
1321
  */
1322
- static resume(agentDef: AgentDefinition, workingDirectory: string, agentSessionId: string, mcpServers?: McpServerConfig[], allowedPaths?: string[]): Promise<AgentInstance>;
1322
+ static resume(agentDef: AgentDefinition, workingDirectory: string, agentSessionId: string, mcpServers?: McpServerConfig[], allowedPaths?: string[], environment?: Record<string, string>): Promise<AgentInstance>;
1323
1323
  /**
1324
1324
  * Build the ACP Client callback object.
1325
1325
  *
@@ -1418,13 +1418,15 @@ declare class AgentStore {
1418
1418
  * and resolution (name → AgentDefinition for spawning).
1419
1419
  */
1420
1420
  declare class AgentCatalog {
1421
+ private scopedFetch;
1422
+ private registryUrl;
1421
1423
  private store;
1422
1424
  /** Agents available in the remote registry (cached in memory after load). */
1423
1425
  private registryAgents;
1424
1426
  private cachePath;
1425
1427
  /** Directory where binary agent archives are extracted to. */
1426
1428
  private agentsDir;
1427
- constructor(store: AgentStore, cachePath: string, agentsDir?: string);
1429
+ constructor(store: AgentStore, cachePath: string, agentsDir?: string, scopedFetch?: typeof fetch, registryUrl?: string);
1428
1430
  /**
1429
1431
  * Load installed agents from disk and hydrate the registry from cache/snapshot.
1430
1432
  *
@@ -1485,6 +1487,144 @@ declare class AgentCatalog {
1485
1487
  private loadRegistryFromCacheOrSnapshot;
1486
1488
  }
1487
1489
 
1490
+ declare const PROXY_PROTOCOLS: readonly ["http", "https", "socks5", "socks5h"];
1491
+ type ProxyProtocol = typeof PROXY_PROTOCOLS[number];
1492
+ type ProxyRoute = 'direct' | 'inherit' | `profile:${string}`;
1493
+ interface ProxyProfileInput {
1494
+ id: string;
1495
+ name?: string;
1496
+ protocol: ProxyProtocol;
1497
+ host: string;
1498
+ port: number;
1499
+ username?: string;
1500
+ password?: string;
1501
+ noProxy?: string[];
1502
+ failClosed?: boolean;
1503
+ }
1504
+ /** Persisted and API-safe profile. Credentials are deliberately absent. */
1505
+ interface ProxyProfile {
1506
+ id: string;
1507
+ name: string;
1508
+ protocol: ProxyProtocol;
1509
+ host: string;
1510
+ port: number;
1511
+ noProxy: string[];
1512
+ failClosed: boolean;
1513
+ hasCredentials: boolean;
1514
+ }
1515
+ interface ProxyRoutingConfig {
1516
+ global: ProxyRoute;
1517
+ routes: Record<string, ProxyRoute>;
1518
+ }
1519
+ interface ProxyStatus {
1520
+ revision: number;
1521
+ profiles: ProxyProfile[];
1522
+ routing: ProxyRoutingConfig;
1523
+ scopes: string[];
1524
+ diagnostics: Array<{
1525
+ scope: string;
1526
+ route: ProxyRoute;
1527
+ resolvedFrom: string;
1528
+ childProcessSupport: 'native-env' | 'best-effort-socks-env' | 'not-applicable';
1529
+ warning?: string;
1530
+ }>;
1531
+ environment: {
1532
+ daemonWideProxyActive: boolean;
1533
+ compatibilityMode: boolean;
1534
+ variables: string[];
1535
+ message: string;
1536
+ };
1537
+ }
1538
+ interface ProxyRouteResolution {
1539
+ scope: string;
1540
+ route: ProxyRoute;
1541
+ resolvedFrom: string;
1542
+ profile?: ProxyProfile;
1543
+ }
1544
+ interface ProxyRouteChangeResult {
1545
+ scope: string;
1546
+ route: ProxyRoute;
1547
+ warmPoolInvalidated: boolean;
1548
+ activeAgentProcessesUnaffected: boolean;
1549
+ }
1550
+
1551
+ declare const PROXY_ENV_KEYS: readonly ["HTTP_PROXY", "HTTPS_PROXY", "ALL_PROXY", "NO_PROXY", "http_proxy", "https_proxy", "all_proxy", "no_proxy", "NODE_USE_ENV_PROXY"];
1552
+ type RouteTester = (fetcher: typeof fetch) => Promise<void>;
1553
+ type RouteChangedListener = (scope: string, route: ProxyRoute) => void | Promise<void>;
1554
+ /** Scoped network policy. It never mutates process.env or a global fetch dispatcher. */
1555
+ declare class ProxyService {
1556
+ private readonly retiredLeaseTimeoutMs;
1557
+ private readonly allowedNodeEnvironmentFlags;
1558
+ private readonly store;
1559
+ private readonly scopes;
1560
+ private readonly testers;
1561
+ private readonly listeners;
1562
+ private readonly transports;
1563
+ private readonly facades;
1564
+ private mutationQueue;
1565
+ private policyGeneration;
1566
+ private readonly maxTransports;
1567
+ constructor(instanceRoot: string, retiredLeaseTimeoutMs?: number, allowedNodeEnvironmentFlags?: ReadonlySet<string>);
1568
+ private serialize;
1569
+ getPolicyGeneration(): number;
1570
+ private invalidatePolicyBeforeCommit;
1571
+ registerScope(scope: string): () => void;
1572
+ registerRouteTester(scope: string, tester: RouteTester): () => void;
1573
+ /**
1574
+ * Scope discovery is part of the durable policy schema, not only an in-memory
1575
+ * UI concern. Persisting registrations lets an operator configure a plugin or
1576
+ * agent while it is temporarily disabled and keeps the category list stable
1577
+ * across daemon restarts.
1578
+ */
1579
+ private persistScope;
1580
+ onRouteChanged(listener: RouteChangedListener): () => void;
1581
+ listProfiles(): ProxyProfile[];
1582
+ getProfile(id: string): ProxyProfile | undefined;
1583
+ saveProfile(input: ProxyProfileInput): ProxyProfile;
1584
+ private buildProfile;
1585
+ saveProfileSafely(input: ProxyProfileInput, expectedRevision?: number): Promise<ProxyProfile>;
1586
+ /** Import a conventional proxy env file without ever returning or logging its credential URL. */
1587
+ importEnvFile(id: string, envFile: string, name?: string): ProxyProfile;
1588
+ private parseEnvFile;
1589
+ importEnvFileSafely(id: string, envFile: string, name?: string, expectedRevision?: number): Promise<ProxyProfile>;
1590
+ deleteProfile(id: string, expectedRevision?: number): Promise<void>;
1591
+ resolve(scope: string, routeOverride?: ProxyRoute): ProxyRouteResolution;
1592
+ private resolveFromConfig;
1593
+ setRoute(scope: string, route: ProxyRoute, expectedRevision?: number): Promise<ProxyRouteChangeResult>;
1594
+ clearRoute(scope: string, expectedRevision?: number): Promise<void>;
1595
+ getKnownScopes(): string[];
1596
+ createFetch(scope: string, routeOverride?: ProxyRoute): typeof fetch;
1597
+ private createTransport;
1598
+ private cacheTransport;
1599
+ buildAgentEnv(agentName: string, inherited: Record<string, string>): Record<string, string>;
1600
+ buildChildEnv(scope: string, inherited: Record<string, string>): Record<string, string>;
1601
+ test(scope: string, targetUrl?: string): Promise<{
1602
+ ok: boolean;
1603
+ status?: number;
1604
+ error?: string;
1605
+ }>;
1606
+ testProfile(id: string, targetUrl?: string): Promise<{
1607
+ ok: boolean;
1608
+ status?: number;
1609
+ error?: string;
1610
+ }>;
1611
+ status(): ProxyStatus;
1612
+ private validateRoute;
1613
+ private testCandidateRoutes;
1614
+ private createProfileFetch;
1615
+ /** Direct transport that ignores daemon-wide env proxy flags without global mutation. */
1616
+ private createDirectFetch;
1617
+ private acquireTransport;
1618
+ private releaseTransport;
1619
+ private retireTransport;
1620
+ private destroyTransport;
1621
+ private retireScopes;
1622
+ private scopesUsingProfile;
1623
+ private changedResolutionScopes;
1624
+ private allScopes;
1625
+ private releaseWithResponse;
1626
+ }
1627
+
1488
1628
  /**
1489
1629
  * High-level facade for spawning and resuming agent instances.
1490
1630
  *
@@ -1502,10 +1642,13 @@ declare class AgentCatalog {
1502
1642
  */
1503
1643
  declare class AgentManager {
1504
1644
  private catalog;
1645
+ private proxyService?;
1505
1646
  private warmEntry;
1506
1647
  /** In-flight prewarm promise — guards against concurrent prewarm calls. */
1507
1648
  private warming;
1508
- constructor(catalog: AgentCatalog);
1649
+ constructor(catalog: AgentCatalog, proxyService?: ProxyService | undefined);
1650
+ private currentPolicyGeneration;
1651
+ private childEnv;
1509
1652
  /** Return definitions for all installed agents. */
1510
1653
  getAvailableAgents(): AgentDefinition[];
1511
1654
  /** Look up a single agent definition by its short name (e.g., "claude", "gemini"). */
@@ -1743,8 +1886,10 @@ declare class SpeechService {
1743
1886
  declare class GroqSTT implements STTProvider {
1744
1887
  private apiKey;
1745
1888
  private defaultModel;
1889
+ private scopedFetch;
1890
+ private getScopedFetch?;
1746
1891
  readonly name = "groq";
1747
- constructor(apiKey: string, defaultModel?: string);
1892
+ constructor(apiKey: string, defaultModel?: string, scopedFetch?: typeof fetch, getScopedFetch?: (() => typeof fetch) | undefined);
1748
1893
  /**
1749
1894
  * Transcribes audio using the Groq Whisper API.
1750
1895
  *
@@ -3342,6 +3487,8 @@ declare class OpenACPCore {
3342
3487
  readonly menuRegistry: MenuRegistry;
3343
3488
  readonly assistantRegistry: AssistantRegistry;
3344
3489
  assistantManager: AssistantManager;
3490
+ /** Scoped proxy policy shared by transports, agent spawns, API and commands. */
3491
+ readonly proxyService: ProxyService;
3345
3492
  /** @throws if the service hasn't been registered by its plugin yet */
3346
3493
  private getService;
3347
3494
  /** Access control and rate-limiting guard (provided by security plugin). */
@@ -3673,9 +3820,11 @@ interface PendingFix {
3673
3820
  declare class DoctorEngine {
3674
3821
  private dryRun;
3675
3822
  private dataDir;
3823
+ private proxyService;
3676
3824
  constructor(options?: {
3677
3825
  dryRun?: boolean;
3678
3826
  dataDir?: string;
3827
+ proxyService?: Pick<ProxyService, "createFetch">;
3679
3828
  });
3680
3829
  /**
3681
3830
  * Executes all checks and returns an aggregated report.
@@ -5035,6 +5184,8 @@ declare class TelegramAdapter extends MessagingAdapter {
5035
5184
  private _prerequisiteWatcher;
5036
5185
  /** Set during normal shutdown so bot.stop() does not trigger a self-restart. */
5037
5186
  private _stopping;
5187
+ private unregisterProxyTester?;
5188
+ private telegramFetch;
5038
5189
  /** Returns the configured Telegram supergroup chat ID. */
5039
5190
  getChatId(): number;
5040
5191
  /**
@@ -5201,4 +5352,4 @@ declare class TelegramAdapter extends MessagingAdapter {
5201
5352
  archiveSessionTopic(sessionId: string): Promise<void>;
5202
5353
  }
5203
5354
 
5204
- 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, type FieldDef, 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 MiddlewareHook, type MiddlewarePayloadMap, type MigrateContext, NotificationService as NotificationManager, NotificationMessage, type NotificationService$1 as 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, TurnMeta, TurnRouting, TypedEmitter, 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 };
5355
+ 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, type FieldDef, 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 MiddlewareHook, type MiddlewarePayloadMap, type MigrateContext, NotificationService as NotificationManager, NotificationMessage, type NotificationService$1 as NotificationService, OpenACPCore, type OpenACPPlugin, OutgoingMessage, OutputMode, OutputModeResolver, PRODUCT_GUIDE, PROXY_ENV_KEYS, type PendingFix, PermissionGate, PermissionRequest, PlanEntry, type PluginContext, type PluginPermission, type PluginStorage, PromptQueue, type ProxyProfile, type ProxyProfileInput, type ProxyProtocol, type ProxyRoute, type ProxyRouteChangeResult, type ProxyRouteResolution, type ProxyRoutingConfig, ProxyService, type ProxyStatus, 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, TurnMeta, TurnRouting, TypedEmitter, 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 };