// This file is generated from schema/plugin-contract.schema.json. // Run `npm run generate:plugin-contract` after changing the contract. // Do not edit this file directly. export type ActivationEvent = "onStartupFinished" | `onCommand:${ContributionId}` | `onView:${ContributionId}` | `onProvider:${ContributionId}`; export type AuthenticationBeginPayload = { operationId: string; connectionProviderId: ContributionId; configuration: JsonValue; credential?: (SecretRef) | (CredentialRef) | (SecretLeaseRef); }; export type AuthenticationChallenge = ({ id: string; kind: "text" | "password" | "otp"; title: string; message?: string; placeholder?: string; }) | ({ id: string; kind: "choice"; title: string; message?: string; choices: Array<{ id: string; label: string; description?: string; }>; multiple?: boolean; }) | ({ id: string; kind: "confirmation"; title: string; message?: string; confirmLabel?: string; cancelLabel?: string; }) | ({ id: string; kind: "browser"; title: string; url: string; callbackUri?: string; }) | ({ id: string; kind: "deviceCode"; title: string; verificationUri: string; userCode: string; expiresAt: number; intervalMs?: number; }); export type AuthenticationResponsePayload = { operationId: string; challengeId: string; response: (string) | (boolean) | (Array) | (SecretLeaseRef); }; export type AuthenticationResult = ({ status: "challenge"; challenge: AuthenticationChallenge; }) | ({ status: "authenticated"; credential?: (SecretRef) | (CredentialRef); }) | ({ status: "cancelled"; message?: string; }) | ({ status: "failed"; message?: string; }); export type BoundedPermissionResource = string; export type ByteStreamAttachResult = { attached: true; }; export type ByteStreamConnectionDescriptor = { handleId: string; endpoint: ByteStreamEndpoint; inputStreamId: StreamId; outputStreamId: StreamId; windowBytes: 65536; hostBindingToken?: string; }; export type ByteStreamConnectRequest = { endpoint: ByteStreamEndpoint; allowLocal?: boolean; allowSelfSigned?: boolean; caPem?: string; servername?: string; }; export type ByteStreamEndpoint = string; export type ByteStreamFeature = "network.byte-streams"; export type ByteStreamHandleRequest = { handleId: string; }; export type ByteStreamLimits = {"connectionsPerRuntime":24,"connectionsTotal":128,"chunkBytes":65536,"bufferBytes":65536,"connectionBytes":536870912,"connectMs":10000,"idleMs":1800000,"lifetimeMs":28800000}; export type ByteStreamUpgradeTlsRequest = { handleId: string; servername?: string; allowSelfSigned?: boolean; caPem?: string; }; export type ByteStreamUpgradeTlsResult = { upgraded: true; authorized: boolean; protocol?: string; fingerprint256?: string; subject?: string; }; export type CommandContribution = { id: ContributionId; title: LocalizedText; category?: LocalizedText; description?: LocalizedText; icon?: IconReference; enablement?: ContextKeyExpression; interactive?: boolean; }; export type CompanionExecutable = { id: ContributionId; variants: Array; permissions?: Array; }; export type CompanionExecutableVariant = { path: RelativePackagePath; platforms: Array; sha256: string; }; export type CompanionPlatform = "darwin-arm64" | "darwin-x64" | "linux-arm64" | "linux-x64" | "win32-arm64" | "win32-x64"; export type ConnectionConfigurationPayload = { configuration: JsonValue; }; export type ConnectionControlPayload = { connectionId: string; operationId: string; }; export type ConnectionControlResult = null; export type ConnectionOpenPayload = { configuration: JsonValue; operationId: string; columns: number; rows: number; inputStreamId: string; outputStreamId: string; windowBytes: number; credential?: (SecretRef) | (CredentialRef) | (SecretLeaseRef); authenticationProviderId?: ContributionId; }; export type ConnectionOpenResult = { connectionId: string; status: "connecting" | "connected"; diagnostics?: Array; }; export type ConnectionProbeResult = { available: boolean; message?: string; capabilities?: { [key: string]: JsonValue }; }; export type ConnectionResizePayload = { connectionId: string; operationId: string; columns: number; rows: number; }; export type ConnectionSignalPayload = { connectionId: string; operationId: string; signal: "interrupt" | "terminate" | "kill" | "eof" | "break"; }; export type ConnectionStatusResult = { status: "connecting" | "connected" | "reconnecting" | "closed" | "error"; message?: string; retryable?: boolean; diagnostics?: Array; }; export type ConnectionValidateResult = { valid: boolean; issues: Array; }; export type ContextKeyExpression = string; export type ContributionId = string; export type CredentialRef = { kind: "credential"; id: string; }; export type FeatureId = string; export type FilesystemDirectoryEnumerationFeature = "filesystem.directory-enumeration"; export type HostByteStreamConfirmRequest = { kind: "network.stream.confirm"; endpoint: ByteStreamEndpoint; host: string; port: number; transport: "tcp" | "tls"; isLocal: boolean; }; export type HostByteStreamConnectRequest = ({ target: VaultHostRef; expectedRevision: string; endpoint: ByteStreamEndpoint; durable?: boolean; }) | ({ hostBindingToken: string; endpoint: ByteStreamEndpoint; }); export type HostByteStreamFeature = "network.host-byte-streams"; export type HostByteStreamLimits = {"connectionsPerRuntime":24,"connectionsTotal":128,"chunkBytes":65536,"bufferBytes":65536,"connectionBytes":536870912,"connectMs":120000,"idleMs":1800000,"lifetimeMs":28800000}; export type HostByteStreamTlsConfirmRequest = { kind: "network.stream.tlsConfirm"; endpoint: ByteStreamEndpoint; servername?: string; fingerprint256: string; subject: string; issuer: string; validTo: string; reason: string; }; export type HostClipboardReadRequest = { kind: "clipboard.read"; title: string; }; export type HostClipboardWriteRequest = { kind: "clipboard.write"; title: string; text: string; }; export type HostDrawnViewEvent = { nodeId: string; type: "click" | "input" | "change" | "keydown" | "keyup" | "focusin" | "focusout" | "compositionstart" | "compositionupdate" | "compositionend" | "dismiss" | "submit" | "reset" | "dblclick" | "contextmenu" | "scroll" | "widget"; value?: string; checked?: boolean; eventId?: number; data?: string; key?: string; ctrlKey?: boolean; metaKey?: boolean; altKey?: boolean; shiftKey?: boolean; values?: Array; x?: number; y?: number; scrollTop?: number; scrollLeft?: number; clientHeight?: number; clientWidth?: number; selectionStart?: number; selectionEnd?: number; widgetEvent?: string; detail?: JsonValue; }; export type HostDrawnViewMessage = ({ kind: "host-ui.open"; instanceId: string; stateScope?: string; }) | ({ kind: "host-ui.close"; instanceId: string; }) | ({ kind: "host-ui.update"; instanceId: string; sequence: number; acknowledgedEvent?: number; mutations: Array; css: string; }) | ({ kind: "host-ui.event"; instanceId: string; event: HostDrawnViewEvent; }); export type HostDrawnViewOpenRequest = { viewId: string; instanceId: string; scopeId: string; context?: { [key: string]: string | number | boolean | null }; }; export type HostDrawnViewsFeature = "views.host-drawn"; export type HostFileDialogFilter = { name: string; extensions: Array; }; export type HostFileHandleCloseRequest = { handleId: string; }; export type HostFileHandleReadRequest = { handleId: string; offset?: number; length?: number; encoding?: "base64" | "utf8"; }; export type HostFileHandleWriteRequest = { handleId: string; data: string; encoding?: "base64" | "utf8"; mode?: "replace" | "append"; commit?: boolean; }; export type HostInputRequest = { kind: "input"; title: string; initialValue?: HostSingleLineInputText; }; export type HostInteractionClosed = { requestId: string; closed: true; }; export type HostInteractionEvent = (HostInteractionPrompt) | (HostInteractionClosed); export type HostInteractionFeature = "host.interactions"; export type HostInteractionLimits = {"textBytes":4096,"clipboardBytes":4194304,"requestBytes":4259840,"items":100,"pendingPerRuntime":1,"pendingTotal":8,"requestsPerMinute":60,"timeoutMs":60000,"fileMaxBytes":67108864}; export type HostInteractionPrompt = { permissionMode?: "allow" | "ask" | "deny"; requestId: string; actionToken: string; pluginId: PluginId; pluginVersion: SemanticVersion; expiresAt: SafePositiveInteger; phase: "request" | "preview" | "commit"; request: (HostInteractionRequest) | (VaultHostActionRequest); previewText?: string; terminalSessionId?: string; terminalRendererId?: string; terminalLabel?: string; vaultTarget?: VaultHostLocalTarget; reviewedDraft?: (VaultHostCreateFields) | (VaultHostEditFields); durableHostId?: string; autoCommit?: boolean; }; export type HostInteractionReceipt = (boolean) | ({ completionToken: string; }); export type HostInteractionRequest = (HostQuickPickRequest) | (HostInputRequest) | (HostClipboardReadRequest) | (HostClipboardWriteRequest) | (HostTerminalSelectionReadRequest) | (HostTerminalInputProposalRequest); export type HostInteractionResponse = { requestId: string; actionToken: string; action: "cancel" | "preview" | "submit" | "commit" | "complete" | "fail"; value?: string; resources?: VaultHostSelectedResources; draft?: (VaultHostCreateFields) | (VaultHostEditFields); scriptsRun?: boolean; remember?: boolean; }; export type HostInteractionResult = ({ cancelled: true; }) | ({ cancelled: false; value: (string) | (true) | (SharedTerminalSelection); }) | (VaultHostSelectedResult) | (VaultHostActionAccepted) | (ByteStreamConnectionDescriptor) | ({ cancelled: false; approved: true; remember?: boolean; }); export type HostOpenFileRequest = { title?: string; filters?: Array; readAs?: "bytes" | "utf8"; maxBytes?: number; }; export type HostQuickPickItem = { id: string; label: string; description?: string; }; export type HostQuickPickRequest = { kind: "quickPick"; title: string; items: Array; }; export type HostSaveFileRequest = { title?: string; defaultName?: string; filters?: Array; data?: string; encoding?: "base64" | "utf8"; deferredWrite?: boolean; }; export type HostSingleLineInputText = string; export type HostTerminalInputProposalRequest = { kind: "terminal.input.propose"; title: string; handle: string; text: string; }; export type HostTerminalSelectionReadRequest = { kind: "terminal.selection.read"; title: string; }; export type HostTerminalTarget = (unknown); export type HostVaultFeature = "vault.host-actions"; export type IconReference = (ThemeIcon) | (PackageIcon); export type ImporterDetectPayload = { fileName?: string; mediaType?: string; sample: { encoding: "base64"; data: string; }; }; export type ImporterDetectResult = { confidence: number; format?: string; reason?: string; }; export type ImporterGroupDraft = string | { path: string; label?: string } | { path?: string; label: string }; export type ImporterHostDraft = ({ id?: string; label?: string; username?: string; group?: string; tags?: Array; os?: "linux" | "windows" | "macos"; deviceType?: "general" | "network"; identityId?: string; identityFileId?: string; telnetIdentityId?: string; notes?: string; theme?: string; sftpEncoding?: string; sftpFileProtocol?: "auto" | "sftp" | "scp"; moshEnabled?: boolean; etEnabled?: boolean; telnetEnabled?: boolean; sftpSudo?: boolean; requiresMfa?: boolean; useSshAgent?: boolean; identitiesOnly?: boolean; agentForwarding?: boolean; x11Forwarding?: boolean; showLineTimestamps?: boolean; disableDynamicTabTitle?: boolean; pinned?: boolean; autoOpenSftpPanel?: boolean; sftpFollowTerminalCwd?: boolean; port?: number; telnetPort?: number; etPort?: number; keepaliveInterval?: number; keepaliveCountMax?: number; } & ({ hostname: string; protocol?: "ssh" | "telnet" | "mosh" | "et" | "local" | "serial"; pluginConnection?: never; } | { hostname?: string; protocol: PluginHostProtocol; pluginConnection: ImporterPluginConnectionDraft; })); export type ImporterIdentityDraft = { id?: string; label: string; username: string; authMethod: "password" | "key" | "certificate"; password?: string; keyId?: string; }; export type ImporterKeyDraft = ({ id?: string; label: string; type: "RSA" | "ECDSA" | "ED25519"; publicKey?: string; certificate?: string; passphrase?: string; category?: "key" | "certificate" | "identity"; } & ({ privateKey: string; filePath?: never; } | { privateKey?: never; filePath: string; })); export type ImporterLimits = {"maxInputBytes":67108864,"maxOutputBytes":67108864,"maxRecordBytes":67108864,"maxRecords":10000}; export type ImporterParsePayload = { operationId: string; fileName?: string; mediaType?: string; inputStreamId: string; outputStreamId: string; windowBytes: number; options?: JsonValue; }; export type ImporterParseResult = { parsed: number; warnings: number; errors: number; }; export type ImporterPluginConnectionDraft = { providerId: ContributionId; configuration: JsonValue; authenticationProviderId?: ContributionId; credentialId?: string; }; export type ImporterRecord = ({ type: "draft"; draft: ({ kind: "host"; value: ImporterHostDraft; }) | ({ kind: "identity"; value: ImporterIdentityDraft; }) | ({ kind: "key"; value: ImporterKeyDraft; }) | ({ kind: "snippet"; value: ImporterSnippetDraft; }) | ({ kind: "group"; value: ImporterGroupDraft; }); }) | ({ type: "warning" | "error"; code?: string; message: string; path?: string; }) | ({ type: "progress"; completed: number; total?: number; message?: string; }); export type ImporterSnippetDraft = { id?: string; label: string; command: string; tags?: Array; kind?: "snippet" | "script"; description?: string; }; export type InteractiveCommandFeature = "commands.interactive"; export type InteractiveCommandLimits = {"timeoutMs":180000}; export type JsonPrimitive = (string) | (number) | (boolean) | (null); export type JsonRpcStandardErrorCode = -32700 | -32600 | -32601 | -32602 | -32603; export type JsonValue = (JsonPrimitive) | (Array) | ({ [key: string]: JsonValue }); export type JsonValueLimits = {"maxDepth":128,"maxNodes":100000}; export type KeybindingContribution = { command: ContributionId; key: string; mac?: string; linux?: string; windows?: string; when?: ContextKeyExpression; args?: JsonValue; }; export type LocalizedText = (string) | ({ [key: string]: string }); export type MenuContribution = { command: ContributionId; alt?: ContributionId; location: MenuLocation; title?: LocalizedText; icon?: IconReference; group?: string; order?: number; when?: ContextKeyExpression; enablement?: ContextKeyExpression; checked?: ContextKeyExpression; showKeybinding?: boolean; }; export type MenuLocation = "commandPalette" | "application" | "host/context" | "terminal/context" | "terminal/toolbar" | "statusBar"; export type NetworkCredentialLeaseFeature = "network.credential-lease"; export type NonResourceScopedPermission = "storage" | "ai.invoke" | "ai.agent.use" | "ai.agent.actions" | "context.selected.list" | "context.selected.read" | "runtime.advanced" | "settings.read" | "settings.write" | "commands" | "menus" | "views" | "ui.interact" | "clipboard.read" | "clipboard.write" | "terminal.metadata" | "terminal.output" | "terminal.input" | "terminal.decorate" | "terminal.complete" | "terminal.intercept.input" | "terminal.intercept.output" | "vault.metadata" | "vault.write" | "vault.credentials" | "sftp.read" | "sftp.write" | "secrets" | "provider.terminal" | "provider.connection" | "provider.authentication" | "provider.sync" | "provider.importer" | "terminal.selection.read" | "terminal.input.propose" | "network.hostStream"; export type NullableRpcId = (RpcId) | (null); export type PackageIcon = { kind: "package"; light: RelativePackagePath; dark?: RelativePackagePath; }; export type PermissionDecision = ({ requestId: string; decision: "allow"; scope: PermissionGrantScope; resources?: Array; }) | ({ requestId: string; decision: "deny" | "cancel"; }); export type PermissionDeclaration = PluginPermission | PermissionResourceDeclaration; export type PermissionGrantScope = "once" | "session" | "application" | "always"; export type PermissionRequest = { requestId: string; pluginId: PluginId; pluginVersion?: SemanticVersion; pluginName?: string; publisher?: string; runtimeId?: string | null; runtimeKind?: "browser" | "utility" | null; permission: PluginPermission; resources?: Array; resourceKinds?: Array; displayContext?: { action?: PluginAgentActionPreview; modelLabel?: string; selections?: Array<{ title: string; scope: "workspace" | "tab" | "session" | "host" | "note"; version: string; }>; }; relatedPermissions?: Array<{ permission: PluginPermission; resources: Array; }>; reason: string; operationId?: string; sessionId?: string; allowedScopes?: Array; }; export type PermissionResource = string; export type PermissionResourceDeclaration = { permission: PluginPermission; resources: Array; reason?: string; }; export type PermissionResourceKind = "exact" | "directory"; export type PermissionSet = { required?: Array; optional?: Array; }; export type PluginAgentActionPreview = { capabilityId: string; text: string; }; export type PluginAgentBackend = { backendRef: string; label: string; backend: PluginAgentBackendKind; status: "supported" | "unsupported" | "unavailable"; reason: "ready" | "not-configured" | "native-boundary-unverified" | "configuration-unavailable"; }; export type PluginAgentBackendKind = "catty" | "claude" | "codex" | "copilot" | "cursor" | "codebuddy" | "opencode" | "grok" | "mimo"; export type PluginAgentBackendsResult = { items: Array; }; export type PluginAgentCapabilities = ["session.environment","terminal.execute","terminal.start","terminal.poll","terminal.stop","harness.terminal.read_context"]; export type PluginAgentChatRef = { chatHandle: string; }; export type PluginAgentChatResult = { chatHandle: string; conversationRef: string; backendLabel: string; expiresAt: number; }; export type PluginAgentChatsResult = { items: Array; }; export type PluginAgentChatSummary = { conversationRef: string; title: string; backend: PluginAgentBackendKind; updatedAt: number; }; export type PluginAgentEvent = ({ kind: "text"; text: string; }) | ({ kind: "activity"; capabilityId: string; state: "started" | "completed" | "denied"; }) | ({ kind: "usage"; inputTokens: number; outputTokens: number; }) | ({ kind: "end"; reason: "completed" | "cancelled" | "unavailable" | "budget-exceeded"; }); export type PluginAgentFeature = "ai.agent-sessions"; export type PluginAgentHistoryResult = { items: Array; }; export type PluginAgentHostBackend = { hostHandle: string; label: string; backend: PluginAgentBackendKind; status: "supported" | "unsupported" | "unavailable"; reason: "ready" | "not-configured" | "native-boundary-unverified" | "configuration-unavailable"; }; export type PluginAgentHostRequest = ({ requestId: string; actionToken: string; runtimeId: string; kind: "agent.backends"; payload: PluginAIEmptyParams; }) | ({ requestId: string; actionToken: string; runtimeId: string; kind: "agent.targets"; payload: PluginAIEmptyParams; }) | ({ requestId: string; actionToken: string; runtimeId: string; kind: "agent.current"; payload: { hostHandle: string; }; }) | ({ requestId: string; actionToken: string; runtimeId: string; kind: "agent.run"; payload: { backendHandle: string; delegationTag: string; session: PluginAgentHostSession; terminalSessions: Array; text: string; capabilities: Array<"session.environment" | "terminal.execute" | "terminal.start" | "terminal.poll" | "terminal.stop" | "harness.terminal.read_context">; maxIterations: number; }; }) | ({ requestId: string; actionToken: string; runtimeId: string; kind: "agent.next"; payload: { hostHandle: string; }; }) | ({ requestId: string; actionToken: string; runtimeId: string; kind: "agent.stop"; payload: { hostHandle: string; }; }) | ({ requestId: string; actionToken: string; runtimeId: string; kind: "agent.release"; payload: { hostHandle: string; }; }) | ({ requestId: string; actionToken: string; runtimeId: string; kind: "request.cancel"; payload: { requestId: string; }; }) | ({ requestId: string; actionToken: string; runtimeId: string; kind: "runtime.release"; payload: PluginAIEmptyParams; }) | ({ requestId: string; actionToken: string; runtimeId: string; kind: "agent.close"; payload: { chatSessionId: string; }; }); export type PluginAgentHostResponse = ({ requestId: string; actionToken: string; result: PluginAgentHostResult; }) | ({ requestId: string; actionToken: string; error: true; }); export type PluginAgentHostResult = ({ backends: Array; }) | ({ targets: Array; }) | ({ current: boolean; }) | ({ hostHandle: string; }) | ({ ok: boolean; session?: PluginAgentHostSession; }) | ({ done: false; event: PluginAgentEvent; session?: PluginAgentHostSession; }) | ({ done: true; session: PluginAgentHostSession; }); export type PluginAgentHostSession = { conversationRef: string; id: string; title: string; agentId: string; scope: { type: "global"; }; messages: Array; createdAt: number; updatedAt: number; externalSessionId?: string; contextCompaction?: JsonValue; }; export type PluginAgentHostTerminal = { sessionId: string; hostId?: string; hostname: string; label: string; protocol?: string; username?: string; connected: boolean; }; export type PluginAgentMessage = { role: "user" | "assistant"; text: string; }; export type PluginAgentOpenParams = { backendRef: string; selectionHandle: string; conversationRef?: string; }; export type PluginAgentSendParams = { chatHandle: string; text: string; }; export type PluginAgentTargetsResult = { selectionHandle: string; expiresAt: number; items: Array; }; export type PluginAgentTargetSummary = { title: string; kind: "terminal"; }; export type PluginAgentTurnRef = { turnHandle: string; }; export type PluginAgentTurnResult = { turnHandle: string; expiresAt: number; }; export type PluginAIBooleanResult = { ok: boolean; }; export type PluginAIChatRef = { chatHandle: string; }; export type PluginAIChatResult = { chatHandle: string; model: string; expiresAt: number; }; export type PluginAIContextLimits = {"contexts":4,"inputBytes":16384,"chunkBytes":4096,"outputBytes":32768,"outputTokens":2048,"turnMs":60000}; export type PluginAIEmptyParams = Record; export type PluginAIHostContextRef = { hostHandle: string; version: string; }; export type PluginAIHostHandleRef = { hostHandle: string; }; export type PluginAIHostModelEvent = ({ kind: "text"; text: string; }) | ({ kind: "usage"; inputTokens?: number; outputTokens?: number; totalTokens?: number; }); export type PluginAIHostModelStart = { hostHandle: string; prompt: string; contexts: Array; maxOutputTokens: number; maxChunkBytes: number; }; export type PluginAIHostRequest = ({ requestId: string; actionToken: string; runtimeId: string; kind: "model.select"; payload: PluginAIEmptyParams; }) | ({ requestId: string; actionToken: string; runtimeId: string; kind: "model.current"; payload: PluginAIHostHandleRef; }) | ({ requestId: string; actionToken: string; runtimeId: string; kind: "model.start"; payload: PluginAIHostModelStart; }) | ({ requestId: string; actionToken: string; runtimeId: string; kind: "model.next"; payload: PluginAIHostHandleRef; }) | ({ requestId: string; actionToken: string; runtimeId: string; kind: "model.stop"; payload: PluginAIHostHandleRef; }) | ({ requestId: string; actionToken: string; runtimeId: string; kind: "model.release"; payload: PluginAIHostHandleRef; }) | ({ requestId: string; actionToken: string; runtimeId: string; kind: "context.select"; payload: PluginAIEmptyParams; }) | ({ requestId: string; actionToken: string; runtimeId: string; kind: "context.current"; payload: PluginAIHostContextRef; }) | ({ requestId: string; actionToken: string; runtimeId: string; kind: "context.read"; payload: PluginAIHostContextRef; }) | ({ requestId: string; actionToken: string; runtimeId: string; kind: "runtime.release"; payload: PluginAIEmptyParams; }) | ({ requestId: string; actionToken: string; runtimeId: string; kind: "request.cancel"; payload: { requestId: string; }; }); export type PluginAIHostResponse = ({ requestId: string; actionToken: string; result: PluginAIHostResult; }) | ({ requestId: string; actionToken: string; error: true; }); export type PluginAIHostResult = ({ hostHandle: string; label: string; }) | ({ hostHandle: string; }) | ({ current: boolean; }) | ({ done: true; }) | ({ done: false; event: PluginAIHostModelEvent; }) | ({ items: Array; }) | ({ text: string; }) | ({ ok: boolean; }); export type PluginAIHostSelectedSummary = { hostHandle: string; scope: "workspace" | "tab" | "session" | "host" | "note"; title: string; version: string; }; export type PluginAIModelInvocationFeature = "ai.model-invocation"; export type PluginAIStartTurnParams = { chatHandle: string; prompt: string; contexts?: Array; }; export type PluginAIStreamEvent = ({ kind: "text"; sequence: number; text: string; }) | ({ kind: "usage"; sequence: number; inputTokens?: number; outputTokens?: number; totalTokens?: number; }) | ({ kind: "end"; sequence: number; }); export type PluginAITurnRef = { turnHandle: string; }; export type PluginAITurnResult = { turnHandle: string; maxOutputTokens: 2048; reservedTokens: number; }; export type PluginContributions = { themes?: Array; settings?: Array; commands?: Array; keybindings?: Array; menus?: Array; views?: Array; providers?: Array; }; export type PluginEngineHeader = ({ netcatty: SemverRange; api: SemverRange; } & Record); export type PluginEngines = { netcatty: SemverRange; api: SemverRange; }; export type PluginEntrypoints = { browser?: RelativePackagePath; node?: RelativePackagePath; data?: "theme"; }; export type PluginErrorData = { pluginCode: PluginErrorName; details?: JsonValue; }; export type PluginErrorName = "cancelled" | "unknown" | "deadline_exceeded" | "invalid_argument" | "not_found" | "already_exists" | "permission_denied" | "resource_exhausted" | "failed_precondition" | "aborted" | "out_of_range" | "unavailable" | "unsupported" | "internal" | "data_loss" | "unauthenticated"; export type PluginFeatures = { required?: Array; optional?: Array; }; export type PluginHostProtocol = `plugin:${ContributionId}`; export type PluginId = string; export type PluginManifest = { $schema?: string; manifestVersion: 1; id: PluginId; name: string; displayName?: LocalizedText; description?: LocalizedText; version: SemanticVersion; publisher: string; license?: string; icon?: IconReference; homepage?: string; repository?: string; engines: PluginEngines; features?: PluginFeatures; main: PluginEntrypoints; activationEvents?: Array; permissions?: PermissionSet; contributes?: PluginContributions; companionExecutables?: Array; }; export type PluginManifestHeader = ({ $schema?: string; manifestVersion: number; id: PluginId; version: SemanticVersion; engines: PluginEngineHeader; } & Record); export type PluginNetworkAuthorization = { scheme?: "Basic" | "Bearer"; username?: string; }; export type PluginNetworkRequest = { url: string; method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD"; headers?: { [key: string]: string }; body?: { encoding: "utf8" | "base64"; data: string; }; timeoutMs?: number; credentialLease?: SecretLeaseRef; authorization?: PluginNetworkAuthorization; }; export type PluginNetworkResponse = { url: string; status: number; headers: { [key: string]: string }; body: { encoding: "base64"; data: string; }; }; export type PluginPermission = "storage" | "ai.invoke" | "ai.agent.use" | "ai.agent.actions" | "context.selected.list" | "context.selected.read" | "runtime.advanced" | "settings.read" | "settings.write" | "commands" | "menus" | "views" | "ui.interact" | "clipboard.read" | "clipboard.write" | "terminal.metadata" | "terminal.output" | "terminal.input" | "terminal.decorate" | "terminal.complete" | "terminal.intercept.input" | "terminal.intercept.output" | "vault.metadata" | "vault.write" | "vault.credentials" | "sftp.read" | "sftp.write" | "network" | "network.stream" | "filesystem.read" | "filesystem.write" | "secrets" | "companion.execute" | "provider.terminal" | "provider.connection" | "provider.authentication" | "provider.sync" | "provider.importer" | "terminal.selection.read" | "terminal.input.propose" | "network.hostStream"; export type PluginSelectedContextContent = { handle: string; scope: "workspace" | "tab" | "session" | "host" | "note"; title: string; version: string; expiresAt: number; text: string; }; export type PluginSelectedContextFeature = "context.selected-read"; export type PluginSelectedContextListResult = { items: Array; }; export type PluginSelectedContextRef = { handle: string; version: string; }; export type PluginSelectedContextSummary = { handle: string; scope: "workspace" | "tab" | "session" | "host" | "note"; title: string; version: string; expiresAt: number; }; export type PluginViewFocusEvent = { instanceId: string; }; export type PluginViewFocusRequest = PluginViewFocusEvent; export type PluginViewResourceRequest = { instanceId: string; path: RelativePackagePath; }; export type PluginViewResourceResult = { url: string; }; export type PluginWireErrorCode = -32001 | -32002 | -32003 | -32004 | -32005 | -32006 | -32007 | -32008 | -32009 | -32010 | -32011 | -32012 | -32013 | -32014 | -32015 | -32016; export type ProgressBegin = { kind: "begin"; title: string; message?: string; percentage?: number; cancellable?: boolean; }; export type ProgressEnd = { kind: "end"; message?: string; }; export type ProgressReport = { kind: "report"; message?: string; percentage?: number; increment?: number; }; export type ProgressToken = RpcId; export type ProgressValue = (ProgressBegin) | (ProgressReport) | (ProgressEnd); export type ProviderContribution = { id: ContributionId; label: LocalizedText; description?: LocalizedText; kind: ProviderKind; capabilities?: Array; configurationSchema?: JsonValue; }; export type ProviderKind = "terminal.completion" | "terminal.decoration" | "terminal.link" | "terminal.hover" | "terminal.matcher" | "terminal.semantic" | "terminal.prompt" | "terminal.background" | "terminal.theme" | "terminal.interceptor.input" | "terminal.interceptor.output" | "connection" | "authentication" | "sync" | "importer"; export type ProviderRequest = { providerId: ContributionId; operation: string; requestId: string; payload?: JsonValue; deadlineMs?: number; cancellationId?: string; }; export type ProviderResult = ({ requestId: string; status: "ok"; result: JsonValue; }) | ({ requestId: string; status: "cancelled"; }) | ({ requestId: string; status: "failed"; error: RpcErrorObject; }); export type ProviderValidationIssue = { path?: string; severity: "warning" | "error"; message: string; }; export type RelativePackagePath = string; export type RequiredPermissionDeclaration = (NonResourceScopedPermission) | (RequiredPermissionResourceDeclaration); export type RequiredPermissionResourceDeclaration = { permission: ResourceScopedPermission; resources: Array; reason?: string; }; export type ResourceScopedPermission = "network" | "network.stream" | "filesystem.read" | "filesystem.write" | "companion.execute"; export type RpcCancel = { jsonrpc: "2.0"; method: "$/cancelRequest"; params: { cancellationId: string; }; }; export type RpcErrorCode = (JsonRpcStandardErrorCode) | (PluginWireErrorCode); export type RpcErrorObject = { code: RpcErrorCode; message: string; data?: JsonValue; }; export type RpcFailure = { jsonrpc: "2.0"; id: NullableRpcId; error: RpcErrorObject; }; export type RpcId = (string) | (SafeUnsignedInteger); export type RpcLimits = {"maxJsonBytes":8388608}; export type RpcMessage = (RpcRequest) | (RpcNotification) | (RpcSuccess) | (RpcFailure) | (RpcCancel) | (RpcProgressNotification) | (RuntimeInitializeRequest) | (TerminalInterceptorAttachmentRequest); export type RpcNotification = { jsonrpc: "2.0"; method: string; params?: JsonValue; }; export type RpcProgressNotification = { jsonrpc: "2.0"; method: "$/progress"; params: { token: ProgressToken; value: ProgressValue; }; }; export type RpcRequest = { jsonrpc: "2.0"; id: RpcId; method: string; params?: JsonValue; deadlineMs?: number; cancellationId?: string; }; export type RpcSuccess = { jsonrpc: "2.0"; id: RpcId; result: JsonValue; }; export type RuntimeInitializeParams = { netcattyVersion: SemanticVersion; apiVersion: SemanticVersion; supportedFeatures: Array; }; export type RuntimeInitializeRequest = { jsonrpc: "2.0"; id: RpcId; method: "plugin.initialize"; params: RuntimeInitializeParams; deadlineMs?: number; cancellationId?: string; }; export type RuntimeInitializeResult = { pluginId: PluginId; pluginVersion: SemanticVersion; apiVersion: SemanticVersion; enabledFeatures: Array; }; export type RuntimeInitializeSuccess = { jsonrpc: "2.0"; id: RpcId; result: RuntimeInitializeResult; }; export type SafePositiveInteger = number; export type SafeUnsignedInteger = number; export type SecretLeaseRef = { kind: "secret-lease"; id: string; operationId: string; expiresAt: SafePositiveInteger; }; export type SecretRef = { kind: "secret"; id: string; key: string; }; export type SemanticVersion = string; export type SemverRange = string; export type SettingContribution = { id: ContributionId; label: LocalizedText; description?: LocalizedText; control: SettingControl; scope: SettingScope; default?: JsonValue; secret?: boolean; required?: boolean; options?: Array; minimum?: number; maximum?: number; step?: number; pattern?: string; placeholder?: LocalizedText; when?: ContextKeyExpression; restartRequired?: boolean; sync?: boolean; sortable?: boolean; valueSchema?: JsonValue; group?: LocalizedText; }; export type SettingControl = "switch" | "radio" | "select" | "multiselect" | "text" | "textarea" | "number" | "slider" | "password" | "color" | "font" | "file" | "directory" | "keybinding" | "list" | "table"; export type SettingOption = { value: string; label: LocalizedText; description?: LocalizedText; }; export type SettingScope = "application" | "workspace" | "host" | "session" | "device"; export type SharedTerminalSelection = { text: string; handle: string; expiresAt: SafePositiveInteger; }; export type StreamChunkByteLength = number; export type StreamChunkData = ({ encoding: "json"; value: JsonValue; byteLength: StreamChunkByteLength; }) | ({ encoding: "base64"; value: string; byteLength: StreamChunkByteLength; }) | ({ encoding: "transfer"; byteLength: StreamChunkByteLength; }); export type StreamCreditBytes = number; export type StreamFrame = ({ streamId: StreamId; sequence: 0; kind: "open"; windowBytes: StreamWindowBytes; }) | ({ streamId: StreamId; sequence: SafePositiveInteger; kind: "chunk"; data: StreamChunkData; }) | ({ streamId: StreamId; sequence: SafePositiveInteger; kind: "end" | "cancel"; }) | ({ streamId: StreamId; sequence: SafePositiveInteger; kind: "error"; error: RpcErrorObject; }) | ({ streamId: StreamId; sequence: SafeUnsignedInteger; kind: "windowUpdate"; creditBytes: StreamCreditBytes; }); export type StreamId = string; export type StreamLimits = {"maxStreamIdLength":128,"maxChunkBytes":16777216,"maxFrameJsonBytes":25165824,"minWindowBytes":1024,"maxWindowBytes":16777216,"maxCreditBytes":16777216}; export type StreamWindowBytes = number; export type SyncAccount = { id: string; email?: string; name?: string; avatarUrl?: string; }; export type SyncCapabilitiesResult = { revisions: boolean; conditionalWrites: boolean; atomicReplacement: boolean; maxObjectBytes?: number; maxObjects?: number; }; export type SyncConnectPayload = { configuration: JsonValue; operationId: string; credential?: (SecretRef) | (CredentialRef) | (SecretLeaseRef); }; export type SyncConnectResult = { account: SyncAccount; }; export type SyncDeleteObjectPayload = { key: SyncObjectKey; operationId: string; expectedRevision?: SyncObjectRevision; }; export type SyncDeleteObjectResult = { deleted: boolean; }; export type SyncDisconnectPayload = { operationId?: string; }; export type SyncDisconnectResult = null; export type SyncGetAccountPayload = { operationId?: string; }; export type SyncGetAccountResult = { account: (SyncAccount) | (null); }; export type SyncGetCapabilitiesPayload = { operationId?: string; }; export type SyncLimits = {"maxObjectBytes":67108864,"maxObjectKeyLength":1024,"maxRevisionLength":256,"inlineObjectBytes":92160}; export type SyncObjectKey = string; export type SyncObjectRevision = string; export type SyncReadObjectPayload = { key: SyncObjectKey; operationId: string; outputStreamId?: string; windowBytes?: number; }; export type SyncReadObjectResult = ({ found: false; }) | ({ found: true; byteLength: number; encoding: "base64"; data: string; revision?: SyncObjectRevision; contentType?: string; }) | ({ found: true; byteLength: number; streamed: true; revision?: SyncObjectRevision; contentType?: string; }); export type SyncWriteObjectPayload = { key: SyncObjectKey; operationId: string; byteLength: number; expectedRevision?: (SyncObjectRevision) | (null); encoding?: "base64"; data?: string; inputStreamId?: string; windowBytes?: number; }; export type SyncWriteObjectResult = { created: boolean; revision?: SyncObjectRevision; }; export type TerminalInputDraftFeature = "terminal.input-drafts"; export type TerminalInterceptorAttachmentDescriptor = { providerId: ContributionId; direction: "input" | "output"; session: TerminalSessionSnapshot; }; export type TerminalInterceptorAttachmentParams = { descriptor: TerminalInterceptorAttachmentDescriptor; }; export type TerminalInterceptorAttachmentRequest = { jsonrpc: "2.0"; id: RpcId; method: "plugin.terminal.interceptor.attach"; params: TerminalInterceptorAttachmentParams; deadlineMs?: number; cancellationId?: string; }; export type TerminalInterceptorAttachmentResult = { accepted: true; }; export type TerminalInterceptorAttachmentSuccess = { jsonrpc: "2.0"; id: RpcId; result: TerminalInterceptorAttachmentResult; }; export type TerminalInterceptorChunkByteLength = number; export type TerminalInterceptorChunkFrame = { type: "netcatty:terminal-interceptor:chunk"; sequence: SafePositiveInteger; direction: TerminalInterceptorDirection; creditBytes: TerminalInterceptorCreditBytes; byteLength: TerminalInterceptorChunkByteLength; }; export type TerminalInterceptorCreditBytes = number; export type TerminalInterceptorDirection = "input" | "output"; export type TerminalInterceptorFailedResultFrame = { type: "netcatty:terminal-interceptor:result"; sequence: SafePositiveInteger; status: "failed"; }; export type TerminalInterceptorFrame = (TerminalInterceptorReadyFrame) | (TerminalInterceptorChunkFrame) | (TerminalInterceptorOkResultFrame) | (TerminalInterceptorFailedResultFrame); export type TerminalInterceptorLimits = {"maxChunkBytes":65536,"maxWindowBytes":262144}; export type TerminalInterceptorOkResultFrame = { type: "netcatty:terminal-interceptor:result"; sequence: SafePositiveInteger; status: "ok"; creditBytes: TerminalInterceptorChunkByteLength; byteLength: TerminalInterceptorChunkByteLength; }; export type TerminalInterceptorReadyFrame = { type: "netcatty:terminal-interceptor:ready"; sessionId: string; direction: TerminalInterceptorDirection; windowBytes: TerminalInterceptorWindowBytes; }; export type TerminalInterceptorWindowBytes = number; export type TerminalSelectionSharingFeature = "terminal.selection-sharing"; export type TerminalSelectionSharingLimits = {"textBytes":4096,"handleTtlMs":120000,"handlesPerRuntime":4,"handlesTotal":64}; export type TerminalSessionSnapshot = { sessionId: string; hostId?: string; workspaceId?: string; protocol: string; status: "connecting" | "connected" | "disconnected"; cwd?: string; title?: string; shellType?: "posix" | "fish" | "powershell" | "cmd" | "unknown"; cols?: number; rows?: number; alternateScreen?: boolean; }; export type TerminalSidebarFeature = "views.terminal-sidebar"; export type ThemeIcon = { kind: "theme"; name: string; }; export type ThemePackApplyRequest = { expectedRevision: SafeUnsignedInteger; mode: "light" | "dark"; choice: (ThemePackChoice) | (null); }; export type ThemePackCatalog = { selection: ThemePackSelection; entries: Array; diagnostics: Array<{ pluginId: PluginId; themeId?: string; code: "invalid" | "unavailable" | "capacity"; }>; }; export type ThemePackChoice = { ref: ThemePackReference; }; export type ThemePackColors = { background?: string; foreground?: string; card?: string; cardForeground?: string; popover?: string; popoverForeground?: string; secondary?: string; secondaryForeground?: string; muted?: string; mutedForeground?: string; accent?: string; destructive?: string; destructiveForeground?: string; border?: string; input?: string; }; export type ThemePackContribution = { id: ContributionId; label: LocalizedText; variant: ThemePackVariant; entry: RelativePackagePath; }; export type ThemePackEntry = { ref: ThemePackReference; label: string; pluginName: string; dataOnly: boolean; palette: ThemePackPalette; }; export type ThemePackFeature = "appearance.theme-packs"; export type ThemePackLimits = {"jsonBytes":65536,"catalogEntries":256,"themesPerPackage":32}; export type ThemePackPalette = { formatVersion: 1; base: "light" | "dark"; colors: ThemePackColors; }; export type ThemePackReference = { pluginId: PluginId; themeId: ContributionId; version: SemanticVersion; digest: string; variant: ThemePackVariant; }; export type ThemePackSelection = { formatVersion: 1; revision: SafeUnsignedInteger; light: (ThemePackChoice) | (null); dark: (ThemePackChoice) | (null); }; export type ThemePackVariant = "light" | "dark"; export type VaultHostActionAccepted = { cancelled: false; status: "saved" | "requested"; }; export type VaultHostActionRequest = ({ kind: "vault.selectHosts"; title: string; }) | ({ kind: "vault.requestHostDraft"; draft: VaultHostCreateFields; }) | ({ kind: "vault.requestHostDraft"; target: VaultHostRef; expectedRevision: string; draft: VaultHostEditFields; }) | ({ kind: "vault.requestConnect"; target: VaultHostRef; expectedRevision: string; }) | ({ target: VaultHostRef; expectedRevision: string; endpoint: ByteStreamEndpoint; kind: "network.stream.connectViaHost"; durable?: boolean; }) | ({ kind: "network.stream.connectViaHost"; hostBindingToken: string; endpoint: ByteStreamEndpoint; }) | (HostByteStreamConfirmRequest) | (HostByteStreamTlsConfirmRequest); export type VaultHostActionResult = ({ cancelled: true; }) | (VaultHostActionAccepted); export type VaultHostBindingRevokeParams = { hostBindingToken: string; }; export type VaultHostConnectParams = { target: VaultHostRef; expectedRevision: string; }; export type VaultHostCreateFields = { label?: string; hostname: string; username?: string; port?: number; group?: string; tags?: Array; }; export type VaultHostDraftParams = ({ draft: VaultHostCreateFields; }) | ({ target: VaultHostRef; expectedRevision: string; draft: VaultHostEditFields; }); export type VaultHostEditFields = { label?: string; group?: string; tags?: Array; }; export type VaultHostLocalTarget = { resourceId: string; revision: string; }; export type VaultHostMetadata = { label: string; hostname: string; username: string; port?: number; group: string; tags: Array; protocol: string; }; export type VaultHostRef = { kind: "host.selection"; scope: "metadata"; handle: string; revision: string; expiresAt: SafePositiveInteger; }; export type VaultHostSelectedResources = Array<{ resourceId: string; revision: string; label: string; hostname: string; username: string; port?: number; group: string; tags: Array; protocol: string; }>; export type VaultHostSelectedResult = { cancelled: false; hosts: Array<{ target: VaultHostRef; metadata: VaultHostMetadata; }>; groups: Array<{ path: string; members: Array; }>; }; export type VaultHostSelectionResult = ({ cancelled: true; }) | (VaultHostSelectedResult); export type VaultPagesFeature = "views.vault-pages"; export type VaultSelectHostsParams = { title: string; }; export type ViewContribution = { id: ContributionId; title: LocalizedText; location: ViewLocation; icon?: IconReference; order?: number; when?: ContextKeyExpression; }; export type ViewLocation = "aside" | "panel" | "tab" | "modal" | "vault-page" | "terminal-sidebar"; export type WireIntegerLimits = {"maxSafeInteger":9007199254740991};