/** * Wires the per-session capability surface that a `session_init` must install: * the outbound remote invoker (so `host.*` calls can reach the platform peer) * and the `runner.*` capabilities (audience: `runtime`) the platform dispatches * through `invokeRunnerCapability`. * * Rationale for the split from `serve.ts` and the getter-only dependency style: * `_devlog/notes/2026-07-17-env-mode-wire-fallback-recreate.md`. * * @category Runtime * @since 3.6.0 */ import type { ConnectorManager, PreMintedSecretProvider } from "@skaile/workspaces/connectors"; import type { McpServerDeclaration } from "@skaile/workspaces/core"; import type { CapabilityRegistry, RemoteCapabilityInvoker } from "./capability-registry.js"; import type { CompactionOrchestrator } from "./compaction/index.js"; import type { ExternalMcpManager } from "./external-mcp.js"; import { type AttachResult } from "./session-resource-handlers.js"; export interface SessionCapabilityWiringDeps { /** The per-session registry to wire. */ capabilityRegistry: CapabilityRegistry; /** Outbound bridge to the platform peer, installed via `setRemoteInvoker`. */ remoteCapabilityInvoker: RemoteCapabilityInvoker; /** The live unified connector manager, or null before the session is built. */ getResourceManager: () => ConnectorManager | null; /** The in-process pre-minted credential store, or undefined before init. */ getPreMintedSecrets: () => PreMintedSecretProvider | undefined; /** Re-emit `resources_available` so the frontend reflects the live change. */ emitResourcesAvailable: () => void; /** True when the active driver picks up newly-registered tools without a restart. */ driverPicksUpToolsLive: () => boolean; /** Returns `null` during the brief session-recreate gap; guard before use. */ getOrCreateMcpManager: () => ExternalMcpManager | null; /** The current compaction orchestrator, or null before the driver is built. */ getCompactionOrchestrator: () => CompactionOrchestrator | null; /** Absolute path to the session project directory. */ getProjectDir: () => string; /** Stage-then-fast-restart a skill by name (owned by `serve.ts`). */ attachSkillInstance: (name: string) => Promise; /** Record a live-attached MCP server so later session rebuilds respawn it (owned by `serve.ts`). */ registerLiveAttachedMcp: (declaration: McpServerDeclaration) => void; /** Queue a (backgrounded) driver restart so a non-live driver re-bakes its tool set. */ scheduleDriverRestartForToolChanges: (reason: string) => void; log: (msg: string) => void; } /** * Install the remote invoker and register the `runner.*` capabilities. * * Idempotent by construction: `setRemoteInvoker` replaces the prior invoker and * `register` is overwrite-by-name — so this is safe to call on every * `session_init`, whichever branch built the session. */ export declare function wireSessionCapabilities(deps: SessionCapabilityWiringDeps): void; //# sourceMappingURL=session-capability-wiring.d.ts.map