| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456 |
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
- import { APIResource } from '../core/resource';
- import * as ConfigAPI from './config';
- import { APIPromise } from '../core/api-promise';
- import { RequestOptions } from '../internal/request-options';
- export class ConfigResource extends APIResource {
- /**
- * Get config info
- */
- get(options?: RequestOptions): APIPromise<Config> {
- return this._client.get('/config', options);
- }
- }
- export interface Config {
- /**
- * JSON schema reference for configuration validation
- */
- $schema?: string;
- /**
- * @deprecated Use 'share' field instead. Share newly created sessions
- * automatically
- */
- autoshare?: boolean;
- /**
- * Automatically update to the latest version
- */
- autoupdate?: boolean;
- /**
- * Disable providers that are loaded automatically
- */
- disabled_providers?: Array<string>;
- experimental?: Config.Experimental;
- /**
- * Additional instruction files or patterns to include
- */
- instructions?: Array<string>;
- /**
- * Custom keybind configurations
- */
- keybinds?: KeybindsConfig;
- /**
- * @deprecated Always uses stretch layout.
- */
- layout?: 'auto' | 'stretch';
- /**
- * MCP (Model Context Protocol) server configurations
- */
- mcp?: { [key: string]: McpLocalConfig | McpRemoteConfig };
- /**
- * Modes configuration, see https://opencode.ai/docs/modes
- */
- mode?: Config.Mode;
- /**
- * Model to use in the format of provider/model, eg anthropic/claude-2
- */
- model?: string;
- /**
- * Custom provider configurations and model overrides
- */
- provider?: { [key: string]: Config.Provider };
- /**
- * Control sharing behavior:'manual' allows manual sharing via commands, 'auto'
- * enables automatic sharing, 'disabled' disables all sharing
- */
- share?: 'manual' | 'auto' | 'disabled';
- /**
- * Small model to use for tasks like summarization and title generation in the
- * format of provider/model
- */
- small_model?: string;
- /**
- * Theme name to use for the interface
- */
- theme?: string;
- /**
- * Custom username to display in conversations instead of system username
- */
- username?: string;
- }
- export namespace Config {
- export interface Experimental {
- hook?: Experimental.Hook;
- }
- export namespace Experimental {
- export interface Hook {
- file_edited?: { [key: string]: Array<Hook.FileEdited> };
- session_completed?: Array<Hook.SessionCompleted>;
- }
- export namespace Hook {
- export interface FileEdited {
- command: Array<string>;
- environment?: { [key: string]: string };
- }
- export interface SessionCompleted {
- command: Array<string>;
- environment?: { [key: string]: string };
- }
- }
- }
- /**
- * Modes configuration, see https://opencode.ai/docs/modes
- */
- export interface Mode {
- build?: ConfigAPI.ModeConfig;
- plan?: ConfigAPI.ModeConfig;
- [k: string]: ConfigAPI.ModeConfig | undefined;
- }
- export interface Provider {
- models: { [key: string]: Provider.Models };
- id?: string;
- api?: string;
- env?: Array<string>;
- name?: string;
- npm?: string;
- options?: Provider.Options;
- }
- export namespace Provider {
- export interface Models {
- id?: string;
- attachment?: boolean;
- cost?: Models.Cost;
- limit?: Models.Limit;
- name?: string;
- options?: { [key: string]: unknown };
- reasoning?: boolean;
- release_date?: string;
- temperature?: boolean;
- tool_call?: boolean;
- }
- export namespace Models {
- export interface Cost {
- input: number;
- output: number;
- cache_read?: number;
- cache_write?: number;
- }
- export interface Limit {
- context: number;
- output: number;
- }
- }
- export interface Options {
- apiKey?: string;
- baseURL?: string;
- [k: string]: unknown;
- }
- }
- }
- export interface KeybindsConfig {
- /**
- * Exit the application
- */
- app_exit: string;
- /**
- * Show help dialog
- */
- app_help: string;
- /**
- * Open external editor
- */
- editor_open: string;
- /**
- * Close file
- */
- file_close: string;
- /**
- * Split/unified diff
- */
- file_diff_toggle: string;
- /**
- * List files
- */
- file_list: string;
- /**
- * Search file
- */
- file_search: string;
- /**
- * Clear input field
- */
- input_clear: string;
- /**
- * Insert newline in input
- */
- input_newline: string;
- /**
- * Paste from clipboard
- */
- input_paste: string;
- /**
- * Submit input
- */
- input_submit: string;
- /**
- * Leader key for keybind combinations
- */
- leader: string;
- /**
- * Copy message
- */
- messages_copy: string;
- /**
- * Navigate to first message
- */
- messages_first: string;
- /**
- * Scroll messages down by half page
- */
- messages_half_page_down: string;
- /**
- * Scroll messages up by half page
- */
- messages_half_page_up: string;
- /**
- * Navigate to last message
- */
- messages_last: string;
- /**
- * Toggle layout
- */
- messages_layout_toggle: string;
- /**
- * Navigate to next message
- */
- messages_next: string;
- /**
- * Scroll messages down by one page
- */
- messages_page_down: string;
- /**
- * Scroll messages up by one page
- */
- messages_page_up: string;
- /**
- * Navigate to previous message
- */
- messages_previous: string;
- /**
- * Redo message
- */
- messages_redo: string;
- /**
- * @deprecated use messages_undo. Revert message
- */
- messages_revert: string;
- /**
- * Undo message
- */
- messages_undo: string;
- /**
- * List available models
- */
- model_list: string;
- /**
- * Create/update AGENTS.md
- */
- project_init: string;
- /**
- * Compact the session
- */
- session_compact: string;
- /**
- * Export session to editor
- */
- session_export: string;
- /**
- * Interrupt current session
- */
- session_interrupt: string;
- /**
- * List all sessions
- */
- session_list: string;
- /**
- * Create a new session
- */
- session_new: string;
- /**
- * Share current session
- */
- session_share: string;
- /**
- * Unshare current session
- */
- session_unshare: string;
- /**
- * Next mode
- */
- switch_mode: string;
- /**
- * Previous Mode
- */
- switch_mode_reverse: string;
- /**
- * List available themes
- */
- theme_list: string;
- /**
- * Toggle tool details
- */
- tool_details: string;
- }
- export interface McpLocalConfig {
- /**
- * Command and arguments to run the MCP server
- */
- command: Array<string>;
- /**
- * Type of MCP server connection
- */
- type: 'local';
- /**
- * Enable or disable the MCP server on startup
- */
- enabled?: boolean;
- /**
- * Environment variables to set when running the MCP server
- */
- environment?: { [key: string]: string };
- }
- export interface McpRemoteConfig {
- /**
- * Type of MCP server connection
- */
- type: 'remote';
- /**
- * URL of the remote MCP server
- */
- url: string;
- /**
- * Enable or disable the MCP server on startup
- */
- enabled?: boolean;
- /**
- * Headers to send with the request
- */
- headers?: { [key: string]: string };
- }
- export interface ModeConfig {
- model?: string;
- prompt?: string;
- tools?: { [key: string]: boolean };
- }
- export declare namespace ConfigResource {
- export {
- type Config as Config,
- type KeybindsConfig as KeybindsConfig,
- type McpLocalConfig as McpLocalConfig,
- type McpRemoteConfig as McpRemoteConfig,
- type ModeConfig as ModeConfig,
- };
- }
|