/** * WeCom push configuration + the single shared ACTIVE predicate * (push-backend-requirements §6/§8/§10). * * Precedence mirrors `mergeCommon` (file > env): the `push` section of * ~/.config/zcode-acp/config.json wins over the ZCODE_ACP_PUSH_* env vars. * ACTIVE = enabled AND complete credentials (corpId/agentId/secret) — a push * that cannot summon anyone must not hold an offline interaction either, so * `pushIfOffline` and the interaction hold read the SAME predicate. An * OPTIONAL relay (static-IP proxy for the WeCom API) rides along when both * url+token are present; a half-configured relay warns once and pushes direct. * * Resolved lazily ONCE per process: an enabled-but-incomplete setup logs one * warning at first resolution and every hook then no-ops (silent degradation). */ export interface PushRelayConfig { /** Base URL (trailing slashes stripped); calls go to `${url}/cgi-bin/…`. */ url: string; /** Shared secret sent as `x-relay-token` on every relayed call. */ token: string; } /** Per-kind switches for settled-event push (§5.2) — default all ON. */ export interface PushNotifyConfig { turn: boolean; goal: boolean; run: boolean; task: boolean; compact: boolean; /** Pending interaction asks (§5.1): zero-client push + the unanswered watchdog. */ ask: boolean; /** Workflow stage transitions (phase entered / node failed): mid-run digest push. */ workflowStage: boolean; /** Quota threshold warnings (5h/weekly windows at 60/80/90/95/98/exhausted). */ quota: boolean; } /** Default quiet window for settled pushes (§5.2): user active → no ping. */ export declare const PUSH_QUIET_WINDOW_MS = 30000; /** Default unanswered-ask watchdog delay (§5.1 v1.3): push if still pending. */ export declare const PUSH_ASK_WATCHDOG_MS = 120000; /** * Default unanswered PERMISSION-ask watchdog: a permission ask BLOCKS a * running tool on a human answer — the 120s question window reads as "no * notification" for two full minutes on a popup the user never saw * (observed 2026-10-01 on workflow approvals). Questions (AskUserQuestion) * keep the long window; `permissionAskDelayMs` tunes this tier alone. */ export declare const PUSH_PERMISSION_ASK_WATCHDOG_MS = 15000; export interface PushConfig { corpId: string; agentId: number; secret: string; toUser: string; contentDetail: "full" | "minimal"; /** Static-IP relay for the WeCom API (企业可信IP needs a stable source). */ relay?: PushRelayConfig; /** Settled-event switches, file-only (`push.notify`), every kind default true. */ notify: PushNotifyConfig; /** * Suppress a settled push within this many ms of the last user * prompt/cancel (§5.2 quiet window); 0 disables. File-only, default * {@link PUSH_QUIET_WINDOW_MS}. */ quietMs: number; /** * Unanswered-ask watchdog delay (§5.1 v1.3): push a pending interaction ask * after this many ms with no answer, clients connected or not; 0 pushes at * dispatch time. File-only, default {@link PUSH_ASK_WATCHDOG_MS}. */ askDelayMs: number; /** * Same watchdog for PERMISSION asks specifically (a blocked tool call): * file-only, default {@link PUSH_PERMISSION_ASK_WATCHDOG_MS}. */ permissionAskDelayMs: number; } export declare function resolvePushConfig(env: NodeJS.ProcessEnv): PushConfig | null; /** The shared ACTIVE predicate (resolve-once per process). */ export declare function pushActive(): boolean; /** The resolved config when ACTIVE, null otherwise (resolves on first use). */ export declare function pushConfig(): PushConfig | null; /** Test hook: forget the process-wide resolution. */ export declare function resetPushConfigForTests(): void; //# sourceMappingURL=config.d.ts.map