@n1creator/openacp-cli 2026.712.8 → 2026.712.10
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 +106 -8
- package/dist/cli.js +5016 -1200
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +250 -10
- package/dist/index.js +3137 -580
- package/dist/index.js.map +1 -1
- package/package.json +4 -1
package/dist/index.d.ts
CHANGED
|
@@ -305,6 +305,17 @@ type CommandResponse = {
|
|
|
305
305
|
question: string;
|
|
306
306
|
onYes: string;
|
|
307
307
|
onNo: string;
|
|
308
|
+
} | {
|
|
309
|
+
/** Request one follow-up text value from the same authenticated conversation. */
|
|
310
|
+
type: 'input';
|
|
311
|
+
prompt: string;
|
|
312
|
+
/** Command invoked with the captured value in CommandArgs.interaction.capturedInput. */
|
|
313
|
+
command: string;
|
|
314
|
+
/** Sensitive values must be removed by the adapter before command dispatch. */
|
|
315
|
+
sensitive?: boolean;
|
|
316
|
+
/** Shown when an adapter cannot provide the requested input guarantees. */
|
|
317
|
+
fallback: string;
|
|
318
|
+
expiresInMs?: number;
|
|
308
319
|
} | {
|
|
309
320
|
type: 'error';
|
|
310
321
|
message: string;
|
|
@@ -354,6 +365,18 @@ interface CommandArgs {
|
|
|
354
365
|
channelId: string;
|
|
355
366
|
/** User ID who invoked the command */
|
|
356
367
|
userId: string;
|
|
368
|
+
/** Stable adapter conversation/topic identifier used to bind short-lived interactions. */
|
|
369
|
+
conversationId?: string;
|
|
370
|
+
/** Input guarantees offered by the invoking adapter. */
|
|
371
|
+
interaction?: {
|
|
372
|
+
textInput: boolean;
|
|
373
|
+
secureInput: 'private' | 'delete-after-capture' | 'none';
|
|
374
|
+
/** One-shot adapter-captured input. Never serialize this into a command string. */
|
|
375
|
+
capturedInput?: {
|
|
376
|
+
value: string;
|
|
377
|
+
sensitive: boolean;
|
|
378
|
+
};
|
|
379
|
+
};
|
|
357
380
|
/** Reply helper — sends message to the topic where command was invoked */
|
|
358
381
|
reply(content: string | CommandResponse | OutgoingMessage): Promise<void>;
|
|
359
382
|
/** Direct access to OpenACPCore instance. Available when 'kernel:access' permission is granted. */
|
|
@@ -1260,7 +1283,7 @@ declare class AgentInstance extends TypedEmitter<AgentInstanceEvents> {
|
|
|
1260
1283
|
*
|
|
1261
1284
|
* Does NOT create a session — callers must follow up with newSession or loadSession.
|
|
1262
1285
|
*/
|
|
1263
|
-
static spawnSubprocess(agentDef: AgentDefinition, workingDirectory: string, allowedPaths?: string[]): Promise<AgentInstance>;
|
|
1286
|
+
static spawnSubprocess(agentDef: AgentDefinition, workingDirectory: string, allowedPaths?: string[], environment?: Record<string, string>): Promise<AgentInstance>;
|
|
1264
1287
|
/**
|
|
1265
1288
|
* Monitor the subprocess for unexpected exits and emit error events.
|
|
1266
1289
|
*
|
|
@@ -1309,7 +1332,7 @@ declare class AgentInstance extends TypedEmitter<AgentInstanceEvents> {
|
|
|
1309
1332
|
* @param mcpServers - Optional MCP server configs to extend agent capabilities
|
|
1310
1333
|
* @param allowedPaths - Extra filesystem paths the agent may access
|
|
1311
1334
|
*/
|
|
1312
|
-
static spawn(agentDef: AgentDefinition, workingDirectory: string, mcpServers?: McpServerConfig[], allowedPaths?: string[]): Promise<AgentInstance>;
|
|
1335
|
+
static spawn(agentDef: AgentDefinition, workingDirectory: string, mcpServers?: McpServerConfig[], allowedPaths?: string[], environment?: Record<string, string>): Promise<AgentInstance>;
|
|
1313
1336
|
/**
|
|
1314
1337
|
* Spawn a new subprocess and restore an existing agent session.
|
|
1315
1338
|
*
|
|
@@ -1319,7 +1342,7 @@ declare class AgentInstance extends TypedEmitter<AgentInstanceEvents> {
|
|
|
1319
1342
|
*
|
|
1320
1343
|
* @param agentSessionId - The agent-side session ID to restore
|
|
1321
1344
|
*/
|
|
1322
|
-
static resume(agentDef: AgentDefinition, workingDirectory: string, agentSessionId: string, mcpServers?: McpServerConfig[], allowedPaths?: string[]): Promise<AgentInstance>;
|
|
1345
|
+
static resume(agentDef: AgentDefinition, workingDirectory: string, agentSessionId: string, mcpServers?: McpServerConfig[], allowedPaths?: string[], environment?: Record<string, string>): Promise<AgentInstance>;
|
|
1323
1346
|
/**
|
|
1324
1347
|
* Build the ACP Client callback object.
|
|
1325
1348
|
*
|
|
@@ -1418,13 +1441,15 @@ declare class AgentStore {
|
|
|
1418
1441
|
* and resolution (name → AgentDefinition for spawning).
|
|
1419
1442
|
*/
|
|
1420
1443
|
declare class AgentCatalog {
|
|
1444
|
+
private scopedFetch;
|
|
1445
|
+
private registryUrl;
|
|
1421
1446
|
private store;
|
|
1422
1447
|
/** Agents available in the remote registry (cached in memory after load). */
|
|
1423
1448
|
private registryAgents;
|
|
1424
1449
|
private cachePath;
|
|
1425
1450
|
/** Directory where binary agent archives are extracted to. */
|
|
1426
1451
|
private agentsDir;
|
|
1427
|
-
constructor(store: AgentStore, cachePath: string, agentsDir?: string);
|
|
1452
|
+
constructor(store: AgentStore, cachePath: string, agentsDir?: string, scopedFetch?: typeof fetch, registryUrl?: string);
|
|
1428
1453
|
/**
|
|
1429
1454
|
* Load installed agents from disk and hydrate the registry from cache/snapshot.
|
|
1430
1455
|
*
|
|
@@ -1485,6 +1510,164 @@ declare class AgentCatalog {
|
|
|
1485
1510
|
private loadRegistryFromCacheOrSnapshot;
|
|
1486
1511
|
}
|
|
1487
1512
|
|
|
1513
|
+
declare const PROXY_PROTOCOLS: readonly ["http", "https", "socks5", "socks5h"];
|
|
1514
|
+
type ProxyProtocol = typeof PROXY_PROTOCOLS[number];
|
|
1515
|
+
type ProxyRoute = 'direct' | 'inherit' | `profile:${string}`;
|
|
1516
|
+
interface ProxyProfileInput {
|
|
1517
|
+
id: string;
|
|
1518
|
+
name?: string;
|
|
1519
|
+
/** Write-only shorthand; mutually exclusive with endpoint/credential fields. */
|
|
1520
|
+
proxyUrl?: string;
|
|
1521
|
+
protocol?: ProxyProtocol;
|
|
1522
|
+
host?: string;
|
|
1523
|
+
port?: number;
|
|
1524
|
+
username?: string;
|
|
1525
|
+
password?: string;
|
|
1526
|
+
/** Explicitly remove an existing credential record. */
|
|
1527
|
+
clearCredentials?: boolean;
|
|
1528
|
+
noProxy?: string[];
|
|
1529
|
+
failClosed?: boolean;
|
|
1530
|
+
}
|
|
1531
|
+
/** Persisted and API-safe profile. Credentials are deliberately absent. */
|
|
1532
|
+
interface ProxyProfile {
|
|
1533
|
+
id: string;
|
|
1534
|
+
name: string;
|
|
1535
|
+
protocol: ProxyProtocol;
|
|
1536
|
+
host: string;
|
|
1537
|
+
port: number;
|
|
1538
|
+
noProxy: string[];
|
|
1539
|
+
failClosed: boolean;
|
|
1540
|
+
hasCredentials: boolean;
|
|
1541
|
+
}
|
|
1542
|
+
interface ProxyRoutingConfig {
|
|
1543
|
+
global: ProxyRoute;
|
|
1544
|
+
routes: Record<string, ProxyRoute>;
|
|
1545
|
+
}
|
|
1546
|
+
interface ProxyStatus {
|
|
1547
|
+
revision: number;
|
|
1548
|
+
profiles: ProxyProfile[];
|
|
1549
|
+
routing: ProxyRoutingConfig;
|
|
1550
|
+
scopes: string[];
|
|
1551
|
+
diagnostics: Array<{
|
|
1552
|
+
scope: string;
|
|
1553
|
+
route: ProxyRoute;
|
|
1554
|
+
resolvedFrom: string;
|
|
1555
|
+
childProcessSupport: 'native-env' | 'best-effort-socks-env' | 'not-applicable';
|
|
1556
|
+
warning?: string;
|
|
1557
|
+
}>;
|
|
1558
|
+
environment: {
|
|
1559
|
+
daemonWideProxyActive: boolean;
|
|
1560
|
+
compatibilityMode: boolean;
|
|
1561
|
+
variables: string[];
|
|
1562
|
+
message: string;
|
|
1563
|
+
};
|
|
1564
|
+
}
|
|
1565
|
+
interface ProxyRouteResolution {
|
|
1566
|
+
scope: string;
|
|
1567
|
+
route: ProxyRoute;
|
|
1568
|
+
resolvedFrom: string;
|
|
1569
|
+
profile?: ProxyProfile;
|
|
1570
|
+
}
|
|
1571
|
+
interface ProxyRouteChangeResult {
|
|
1572
|
+
scope: string;
|
|
1573
|
+
route: ProxyRoute;
|
|
1574
|
+
warmPoolInvalidated: boolean;
|
|
1575
|
+
activeAgentProcessesUnaffected: boolean;
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1578
|
+
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"];
|
|
1579
|
+
type RouteTester = (fetcher: typeof fetch) => Promise<void>;
|
|
1580
|
+
type RouteChangedListener = (scope: string, route: ProxyRoute) => void | Promise<void>;
|
|
1581
|
+
/** Scoped network policy. It never mutates process.env or a global fetch dispatcher. */
|
|
1582
|
+
declare class ProxyService {
|
|
1583
|
+
private readonly retiredLeaseTimeoutMs;
|
|
1584
|
+
private readonly allowedNodeEnvironmentFlags;
|
|
1585
|
+
private readonly store;
|
|
1586
|
+
private readonly scopes;
|
|
1587
|
+
private readonly testers;
|
|
1588
|
+
private readonly listeners;
|
|
1589
|
+
private readonly transports;
|
|
1590
|
+
private readonly facades;
|
|
1591
|
+
private mutationQueue;
|
|
1592
|
+
private policyGeneration;
|
|
1593
|
+
private readonly maxTransports;
|
|
1594
|
+
constructor(instanceRoot: string, retiredLeaseTimeoutMs?: number, allowedNodeEnvironmentFlags?: ReadonlySet<string>);
|
|
1595
|
+
private serialize;
|
|
1596
|
+
getPolicyGeneration(): number;
|
|
1597
|
+
private invalidatePolicyBeforeCommit;
|
|
1598
|
+
registerScope(scope: string): () => void;
|
|
1599
|
+
registerRouteTester(scope: string, tester: RouteTester): () => void;
|
|
1600
|
+
/**
|
|
1601
|
+
* Scope discovery is part of the durable policy schema, not only an in-memory
|
|
1602
|
+
* UI concern. Persisting registrations lets an operator configure a plugin or
|
|
1603
|
+
* agent while it is temporarily disabled and keeps the category list stable
|
|
1604
|
+
* across daemon restarts.
|
|
1605
|
+
*/
|
|
1606
|
+
private persistScope;
|
|
1607
|
+
onRouteChanged(listener: RouteChangedListener): () => void;
|
|
1608
|
+
listProfiles(): ProxyProfile[];
|
|
1609
|
+
getProfile(id: string): ProxyProfile | undefined;
|
|
1610
|
+
saveProfile(input: ProxyProfileInput): ProxyProfile;
|
|
1611
|
+
private buildProfile;
|
|
1612
|
+
/** Parse a write-only proxy URL into canonical components without retaining it. */
|
|
1613
|
+
parseProxyUrlInput(proxyUrl: string): Pick<ProxyProfileInput, 'protocol' | 'host' | 'port' | 'username' | 'password' | 'clearCredentials'>;
|
|
1614
|
+
private normalizeProfileInput;
|
|
1615
|
+
saveProfileSafely(input: ProxyProfileInput, expectedRevision?: number): Promise<ProxyProfile>;
|
|
1616
|
+
createProfileSafely(input: ProxyProfileInput, expectedRevision?: number): Promise<ProxyProfile>;
|
|
1617
|
+
updateProfileSafely(input: ProxyProfileInput, expectedRevision?: number): Promise<ProxyProfile>;
|
|
1618
|
+
private mutateProfileSafely;
|
|
1619
|
+
/** Import a conventional proxy env file without ever returning or logging its credential URL. */
|
|
1620
|
+
importEnvFile(id: string, envFile: string, name?: string): ProxyProfile;
|
|
1621
|
+
private parseEnvFile;
|
|
1622
|
+
importEnvFileSafely(id: string, envFile: string, name?: string, expectedRevision?: number): Promise<ProxyProfile>;
|
|
1623
|
+
deleteProfile(id: string, expectedRevision?: number): Promise<void>;
|
|
1624
|
+
/** Delete a profile, optionally reassigning every direct reference in one tested CAS transaction. */
|
|
1625
|
+
deleteProfileSafely(id: string, reassign?: ProxyRoute, expectedRevision?: number): Promise<{
|
|
1626
|
+
reassignedScopes: string[];
|
|
1627
|
+
}>;
|
|
1628
|
+
resolve(scope: string, routeOverride?: ProxyRoute): ProxyRouteResolution;
|
|
1629
|
+
private resolveFromConfig;
|
|
1630
|
+
setRoute(scope: string, route: ProxyRoute, expectedRevision?: number): Promise<ProxyRouteChangeResult>;
|
|
1631
|
+
clearRoute(scope: string, expectedRevision?: number): Promise<void>;
|
|
1632
|
+
getKnownScopes(): string[];
|
|
1633
|
+
createFetch(scope: string, routeOverride?: ProxyRoute): typeof fetch;
|
|
1634
|
+
private createTransport;
|
|
1635
|
+
private cacheTransport;
|
|
1636
|
+
buildAgentEnv(agentName: string, inherited: Record<string, string>): Record<string, string>;
|
|
1637
|
+
buildChildEnv(scope: string, inherited: Record<string, string>): Record<string, string>;
|
|
1638
|
+
test(scope: string, targetUrl?: string): Promise<{
|
|
1639
|
+
ok: boolean;
|
|
1640
|
+
status?: number;
|
|
1641
|
+
error?: string;
|
|
1642
|
+
}>;
|
|
1643
|
+
testProfile(id: string, targetUrl?: string): Promise<{
|
|
1644
|
+
ok: boolean;
|
|
1645
|
+
status?: number;
|
|
1646
|
+
error?: string;
|
|
1647
|
+
}>;
|
|
1648
|
+
/** Test an unsaved profile candidate entirely in memory. Credentials never reach persistence. */
|
|
1649
|
+
testProfileCandidate(input: ProxyProfileInput, targetUrl?: string): Promise<{
|
|
1650
|
+
ok: boolean;
|
|
1651
|
+
status?: number;
|
|
1652
|
+
error?: string;
|
|
1653
|
+
}>;
|
|
1654
|
+
status(): ProxyStatus;
|
|
1655
|
+
private validateRoute;
|
|
1656
|
+
private testCandidateRoutes;
|
|
1657
|
+
private createProfileFetch;
|
|
1658
|
+
/** Direct transport that ignores daemon-wide env proxy flags without global mutation. */
|
|
1659
|
+
private createDirectFetch;
|
|
1660
|
+
private acquireTransport;
|
|
1661
|
+
private releaseTransport;
|
|
1662
|
+
private retireTransport;
|
|
1663
|
+
private destroyTransport;
|
|
1664
|
+
private retireScopes;
|
|
1665
|
+
private scopesUsingProfile;
|
|
1666
|
+
private changedResolutionScopes;
|
|
1667
|
+
private allScopes;
|
|
1668
|
+
private releaseWithResponse;
|
|
1669
|
+
}
|
|
1670
|
+
|
|
1488
1671
|
/**
|
|
1489
1672
|
* High-level facade for spawning and resuming agent instances.
|
|
1490
1673
|
*
|
|
@@ -1502,10 +1685,13 @@ declare class AgentCatalog {
|
|
|
1502
1685
|
*/
|
|
1503
1686
|
declare class AgentManager {
|
|
1504
1687
|
private catalog;
|
|
1688
|
+
private proxyService?;
|
|
1505
1689
|
private warmEntry;
|
|
1506
1690
|
/** In-flight prewarm promise — guards against concurrent prewarm calls. */
|
|
1507
1691
|
private warming;
|
|
1508
|
-
constructor(catalog: AgentCatalog);
|
|
1692
|
+
constructor(catalog: AgentCatalog, proxyService?: ProxyService | undefined);
|
|
1693
|
+
private currentPolicyGeneration;
|
|
1694
|
+
private childEnv;
|
|
1509
1695
|
/** Return definitions for all installed agents. */
|
|
1510
1696
|
getAvailableAgents(): AgentDefinition[];
|
|
1511
1697
|
/** Look up a single agent definition by its short name (e.g., "claude", "gemini"). */
|
|
@@ -1743,8 +1929,10 @@ declare class SpeechService {
|
|
|
1743
1929
|
declare class GroqSTT implements STTProvider {
|
|
1744
1930
|
private apiKey;
|
|
1745
1931
|
private defaultModel;
|
|
1932
|
+
private scopedFetch;
|
|
1933
|
+
private getScopedFetch?;
|
|
1746
1934
|
readonly name = "groq";
|
|
1747
|
-
constructor(apiKey: string, defaultModel?: string);
|
|
1935
|
+
constructor(apiKey: string, defaultModel?: string, scopedFetch?: typeof fetch, getScopedFetch?: (() => typeof fetch) | undefined);
|
|
1748
1936
|
/**
|
|
1749
1937
|
* Transcribes audio using the Groq Whisper API.
|
|
1750
1938
|
*
|
|
@@ -1828,6 +2016,9 @@ declare class Session extends TypedEmitter<SessionEvents> {
|
|
|
1828
2016
|
private _abortedTurnIds;
|
|
1829
2017
|
/** Last completed turnId — used by abortPrompt() to retroactively mark a just-finished turn as interrupted */
|
|
1830
2018
|
private _lastCompletedTurnId;
|
|
2019
|
+
/** Idempotent teardown checkpoints allow cleanup retry after a partial failure. */
|
|
2020
|
+
private _destroyedAgent;
|
|
2021
|
+
private _closedLogger;
|
|
1831
2022
|
private _autoApprovedCommands;
|
|
1832
2023
|
get autoApprovedCommands(): string[];
|
|
1833
2024
|
constructor(opts: {
|
|
@@ -1857,7 +2048,7 @@ declare class Session extends TypedEmitter<SessionEvents> {
|
|
|
1857
2048
|
fail(reason: string): void;
|
|
1858
2049
|
/** Transition to finished — from active only. Emits session_end for backward compat. */
|
|
1859
2050
|
finish(reason?: string): void;
|
|
1860
|
-
/** Transition to cancelled — from active or error
|
|
2051
|
+
/** Transition to cancelled — from initializing, active, or error. */
|
|
1861
2052
|
markCancelled(): void;
|
|
1862
2053
|
private transition;
|
|
1863
2054
|
/** Number of prompts waiting in queue */
|
|
@@ -2263,6 +2454,16 @@ interface SessionSummary {
|
|
|
2263
2454
|
capabilities: AgentCapabilities | null;
|
|
2264
2455
|
isLive: boolean;
|
|
2265
2456
|
}
|
|
2457
|
+
interface CancelSessionResult {
|
|
2458
|
+
sessionId: string;
|
|
2459
|
+
cancelled: boolean;
|
|
2460
|
+
previousStatus: SessionStatus;
|
|
2461
|
+
status: 'cancelled' | 'finished';
|
|
2462
|
+
alreadyTerminal: boolean;
|
|
2463
|
+
/** Terminal state is durable, but process/logger cleanup needs another cancel retry. */
|
|
2464
|
+
cleanupPending: boolean;
|
|
2465
|
+
warning?: string;
|
|
2466
|
+
}
|
|
2266
2467
|
/**
|
|
2267
2468
|
* Registry for live Session instances. Provides lookup by session ID, channel+thread,
|
|
2268
2469
|
* or agent session ID. Coordinates session lifecycle: creation, cancellation, persistence,
|
|
@@ -2277,6 +2478,7 @@ declare class SessionManager {
|
|
|
2277
2478
|
private eventBus?;
|
|
2278
2479
|
middlewareChain?: MiddlewareChain;
|
|
2279
2480
|
private _shutdownComplete;
|
|
2481
|
+
private cancellationOps;
|
|
2280
2482
|
/**
|
|
2281
2483
|
* Inject the EventBus after construction. Deferred because EventBus is created
|
|
2282
2484
|
* after SessionManager during bootstrap, so it cannot be passed to the constructor.
|
|
@@ -2309,8 +2511,12 @@ declare class SessionManager {
|
|
|
2309
2511
|
}): Promise<void>;
|
|
2310
2512
|
/** Retrieve the persisted SessionRecord for a given session ID. Returns undefined if no store or record not found. */
|
|
2311
2513
|
getSessionRecord(sessionId: string): SessionRecord | undefined;
|
|
2312
|
-
/**
|
|
2313
|
-
|
|
2514
|
+
/**
|
|
2515
|
+
* Cancel a session exactly once. Concurrent callers share one operation;
|
|
2516
|
+
* terminal sessions return an idempotent result instead of throwing.
|
|
2517
|
+
*/
|
|
2518
|
+
cancelSession(sessionId: string): Promise<CancelSessionResult>;
|
|
2519
|
+
private performCancelSession;
|
|
2314
2520
|
/** List live (in-memory) sessions, optionally filtered by channel. Excludes assistant sessions. */
|
|
2315
2521
|
listSessions(channelId?: string): Session[];
|
|
2316
2522
|
/**
|
|
@@ -3342,6 +3548,8 @@ declare class OpenACPCore {
|
|
|
3342
3548
|
readonly menuRegistry: MenuRegistry;
|
|
3343
3549
|
readonly assistantRegistry: AssistantRegistry;
|
|
3344
3550
|
assistantManager: AssistantManager;
|
|
3551
|
+
/** Scoped proxy policy shared by transports, agent spawns, API and commands. */
|
|
3552
|
+
readonly proxyService: ProxyService;
|
|
3345
3553
|
/** @throws if the service hasn't been registered by its plugin yet */
|
|
3346
3554
|
private getService;
|
|
3347
3555
|
/** Access control and rate-limiting guard (provided by security plugin). */
|
|
@@ -3673,9 +3881,11 @@ interface PendingFix {
|
|
|
3673
3881
|
declare class DoctorEngine {
|
|
3674
3882
|
private dryRun;
|
|
3675
3883
|
private dataDir;
|
|
3884
|
+
private proxyService;
|
|
3676
3885
|
constructor(options?: {
|
|
3677
3886
|
dryRun?: boolean;
|
|
3678
3887
|
dataDir?: string;
|
|
3888
|
+
proxyService?: Pick<ProxyService, "createFetch">;
|
|
3679
3889
|
});
|
|
3680
3890
|
/**
|
|
3681
3891
|
* Executes all checks and returns an aggregated report.
|
|
@@ -5012,6 +5222,7 @@ declare class TelegramAdapter extends MessagingAdapter {
|
|
|
5012
5222
|
private sessionTrackers;
|
|
5013
5223
|
private callbackCache;
|
|
5014
5224
|
private callbackCounter;
|
|
5225
|
+
private pendingCommandInputs;
|
|
5015
5226
|
/** Pending skill commands queued when session.threadId was not yet set */
|
|
5016
5227
|
private _pendingSkillCommands;
|
|
5017
5228
|
/** Control message IDs per session (for updating status text/buttons) */
|
|
@@ -5035,6 +5246,25 @@ declare class TelegramAdapter extends MessagingAdapter {
|
|
|
5035
5246
|
private _prerequisiteWatcher;
|
|
5036
5247
|
/** Set during normal shutdown so bot.stop() does not trigger a self-restart. */
|
|
5037
5248
|
private _stopping;
|
|
5249
|
+
private unregisterProxyTester?;
|
|
5250
|
+
/** Serializes command-list reconciliations triggered by startup and plugin hot reloads. */
|
|
5251
|
+
private _commandSyncChain;
|
|
5252
|
+
private _pendingCommandSnapshot?;
|
|
5253
|
+
private _commandSyncWorkerRunning;
|
|
5254
|
+
private _commandSyncGeneration;
|
|
5255
|
+
private _commandSyncAbort?;
|
|
5256
|
+
private _commandSnapshotVersion;
|
|
5257
|
+
private _commandsReadyHandler?;
|
|
5258
|
+
private _latestCommandSnapshot?;
|
|
5259
|
+
private _commandApiReady;
|
|
5260
|
+
private _initialCommandSyncScheduled;
|
|
5261
|
+
private readonly commandOwnershipStore;
|
|
5262
|
+
private readonly commandOwnerIdentity;
|
|
5263
|
+
private readonly commandOwnerBotId;
|
|
5264
|
+
private readonly commandOwnerTakeoverRequested;
|
|
5265
|
+
private _commandOwnerClaimed;
|
|
5266
|
+
private _commandOwnerHeartbeat?;
|
|
5267
|
+
private telegramFetch;
|
|
5038
5268
|
/** Returns the configured Telegram supergroup chat ID. */
|
|
5039
5269
|
getChatId(): number;
|
|
5040
5270
|
/**
|
|
@@ -5051,6 +5281,15 @@ declare class TelegramAdapter extends MessagingAdapter {
|
|
|
5051
5281
|
notificationTopicId?: number;
|
|
5052
5282
|
assistantTopicId?: number;
|
|
5053
5283
|
}) => Promise<void>);
|
|
5284
|
+
/**
|
|
5285
|
+
* Capture command snapshots once startup begins. The normal boot path emits
|
|
5286
|
+
* SYSTEM_COMMANDS_READY before core.start(), so initial reconciliation reads the
|
|
5287
|
+
* authoritative registry state instead of relying on replay of that event. Once
|
|
5288
|
+
* the API is ready, later snapshots drive hot reloads.
|
|
5289
|
+
*/
|
|
5290
|
+
private subscribeToCommandSnapshots;
|
|
5291
|
+
/** Schedule one authoritative initial reconciliation after grammY is available. */
|
|
5292
|
+
private scheduleInitialCommandSync;
|
|
5054
5293
|
/**
|
|
5055
5294
|
* Set up the grammY bot, register all callback and message handlers, then perform
|
|
5056
5295
|
* two-phase startup: Phase 1 starts polling immediately; Phase 2 checks group
|
|
@@ -5069,6 +5308,7 @@ declare class TelegramAdapter extends MessagingAdapter {
|
|
|
5069
5308
|
* from the registry, deduplicating by command name. Non-critical.
|
|
5070
5309
|
*/
|
|
5071
5310
|
private syncCommandsWithRetry;
|
|
5311
|
+
private startCommandOwnerHeartbeat;
|
|
5072
5312
|
private initTopicDependentFeatures;
|
|
5073
5313
|
/**
|
|
5074
5314
|
* Handle the /retry command — re-runs prerequisite checks immediately.
|
|
@@ -5201,4 +5441,4 @@ declare class TelegramAdapter extends MessagingAdapter {
|
|
|
5201
5441
|
archiveSessionTopic(sessionId: string): Promise<void>;
|
|
5202
5442
|
}
|
|
5203
5443
|
|
|
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 };
|
|
5444
|
+
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 };
|