chore: sync repo

This commit is contained in:
stainless-app[bot] 2025-08-31 06:00:06 +00:00
parent 817f1a0816
commit 9b3134a27e
161 changed files with 1 additions and 20065 deletions

View file

@ -1,103 +0,0 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from .app import (
AppResource,
AsyncAppResource,
AppResourceWithRawResponse,
AsyncAppResourceWithRawResponse,
AppResourceWithStreamingResponse,
AsyncAppResourceWithStreamingResponse,
)
from .tui import (
TuiResource,
AsyncTuiResource,
TuiResourceWithRawResponse,
AsyncTuiResourceWithRawResponse,
TuiResourceWithStreamingResponse,
AsyncTuiResourceWithStreamingResponse,
)
from .file import (
FileResource,
AsyncFileResource,
FileResourceWithRawResponse,
AsyncFileResourceWithRawResponse,
FileResourceWithStreamingResponse,
AsyncFileResourceWithStreamingResponse,
)
from .find import (
FindResource,
AsyncFindResource,
FindResourceWithRawResponse,
AsyncFindResourceWithRawResponse,
FindResourceWithStreamingResponse,
AsyncFindResourceWithStreamingResponse,
)
from .event import (
EventResource,
AsyncEventResource,
EventResourceWithRawResponse,
AsyncEventResourceWithRawResponse,
EventResourceWithStreamingResponse,
AsyncEventResourceWithStreamingResponse,
)
from .config import (
ConfigResource,
AsyncConfigResource,
ConfigResourceWithRawResponse,
AsyncConfigResourceWithRawResponse,
ConfigResourceWithStreamingResponse,
AsyncConfigResourceWithStreamingResponse,
)
from .session import (
SessionResource,
AsyncSessionResource,
SessionResourceWithRawResponse,
AsyncSessionResourceWithRawResponse,
SessionResourceWithStreamingResponse,
AsyncSessionResourceWithStreamingResponse,
)
__all__ = [
"EventResource",
"AsyncEventResource",
"EventResourceWithRawResponse",
"AsyncEventResourceWithRawResponse",
"EventResourceWithStreamingResponse",
"AsyncEventResourceWithStreamingResponse",
"AppResource",
"AsyncAppResource",
"AppResourceWithRawResponse",
"AsyncAppResourceWithRawResponse",
"AppResourceWithStreamingResponse",
"AsyncAppResourceWithStreamingResponse",
"FindResource",
"AsyncFindResource",
"FindResourceWithRawResponse",
"AsyncFindResourceWithRawResponse",
"FindResourceWithStreamingResponse",
"AsyncFindResourceWithStreamingResponse",
"FileResource",
"AsyncFileResource",
"FileResourceWithRawResponse",
"AsyncFileResourceWithRawResponse",
"FileResourceWithStreamingResponse",
"AsyncFileResourceWithStreamingResponse",
"ConfigResource",
"AsyncConfigResource",
"ConfigResourceWithRawResponse",
"AsyncConfigResourceWithRawResponse",
"ConfigResourceWithStreamingResponse",
"AsyncConfigResourceWithStreamingResponse",
"SessionResource",
"AsyncSessionResource",
"SessionResourceWithRawResponse",
"AsyncSessionResourceWithRawResponse",
"SessionResourceWithStreamingResponse",
"AsyncSessionResourceWithStreamingResponse",
"TuiResource",
"AsyncTuiResource",
"TuiResourceWithRawResponse",
"AsyncTuiResourceWithRawResponse",
"TuiResourceWithStreamingResponse",
"AsyncTuiResourceWithStreamingResponse",
]

View file

@ -1,408 +0,0 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from __future__ import annotations
from typing import Dict
from typing_extensions import Literal
import httpx
from ..types import app_log_params
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._utils import maybe_transform, async_maybe_transform
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
to_raw_response_wrapper,
to_streamed_response_wrapper,
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
from ..types.app import App
from .._base_client import make_request_options
from ..types.app_log_response import AppLogResponse
from ..types.app_init_response import AppInitResponse
from ..types.app_modes_response import AppModesResponse
from ..types.app_providers_response import AppProvidersResponse
__all__ = ["AppResource", "AsyncAppResource"]
class AppResource(SyncAPIResource):
@cached_property
def with_raw_response(self) -> AppResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/sst/opencode-sdk-python#accessing-raw-response-data-eg-headers
"""
return AppResourceWithRawResponse(self)
@cached_property
def with_streaming_response(self) -> AppResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
For more information, see https://www.github.com/sst/opencode-sdk-python#with_streaming_response
"""
return AppResourceWithStreamingResponse(self)
def get(
self,
*,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> App:
"""Get app info"""
return self._get(
"/app",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=App,
)
def init(
self,
*,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AppInitResponse:
"""Initialize the app"""
return self._post(
"/app/init",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=AppInitResponse,
)
def log(
self,
*,
level: Literal["debug", "info", "error", "warn"],
message: str,
service: str,
extra: Dict[str, object] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AppLogResponse:
"""
Write a log entry to the server logs
Args:
level: Log level
message: Log message
service: Service name for the log entry
extra: Additional metadata for the log entry
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
"""
return self._post(
"/log",
body=maybe_transform(
{
"level": level,
"message": message,
"service": service,
"extra": extra,
},
app_log_params.AppLogParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=AppLogResponse,
)
def modes(
self,
*,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AppModesResponse:
"""List all modes"""
return self._get(
"/mode",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=AppModesResponse,
)
def providers(
self,
*,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AppProvidersResponse:
"""List all providers"""
return self._get(
"/config/providers",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=AppProvidersResponse,
)
class AsyncAppResource(AsyncAPIResource):
@cached_property
def with_raw_response(self) -> AsyncAppResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/sst/opencode-sdk-python#accessing-raw-response-data-eg-headers
"""
return AsyncAppResourceWithRawResponse(self)
@cached_property
def with_streaming_response(self) -> AsyncAppResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
For more information, see https://www.github.com/sst/opencode-sdk-python#with_streaming_response
"""
return AsyncAppResourceWithStreamingResponse(self)
async def get(
self,
*,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> App:
"""Get app info"""
return await self._get(
"/app",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=App,
)
async def init(
self,
*,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AppInitResponse:
"""Initialize the app"""
return await self._post(
"/app/init",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=AppInitResponse,
)
async def log(
self,
*,
level: Literal["debug", "info", "error", "warn"],
message: str,
service: str,
extra: Dict[str, object] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AppLogResponse:
"""
Write a log entry to the server logs
Args:
level: Log level
message: Log message
service: Service name for the log entry
extra: Additional metadata for the log entry
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
"""
return await self._post(
"/log",
body=await async_maybe_transform(
{
"level": level,
"message": message,
"service": service,
"extra": extra,
},
app_log_params.AppLogParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=AppLogResponse,
)
async def modes(
self,
*,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AppModesResponse:
"""List all modes"""
return await self._get(
"/mode",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=AppModesResponse,
)
async def providers(
self,
*,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AppProvidersResponse:
"""List all providers"""
return await self._get(
"/config/providers",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=AppProvidersResponse,
)
class AppResourceWithRawResponse:
def __init__(self, app: AppResource) -> None:
self._app = app
self.get = to_raw_response_wrapper(
app.get,
)
self.init = to_raw_response_wrapper(
app.init,
)
self.log = to_raw_response_wrapper(
app.log,
)
self.modes = to_raw_response_wrapper(
app.modes,
)
self.providers = to_raw_response_wrapper(
app.providers,
)
class AsyncAppResourceWithRawResponse:
def __init__(self, app: AsyncAppResource) -> None:
self._app = app
self.get = async_to_raw_response_wrapper(
app.get,
)
self.init = async_to_raw_response_wrapper(
app.init,
)
self.log = async_to_raw_response_wrapper(
app.log,
)
self.modes = async_to_raw_response_wrapper(
app.modes,
)
self.providers = async_to_raw_response_wrapper(
app.providers,
)
class AppResourceWithStreamingResponse:
def __init__(self, app: AppResource) -> None:
self._app = app
self.get = to_streamed_response_wrapper(
app.get,
)
self.init = to_streamed_response_wrapper(
app.init,
)
self.log = to_streamed_response_wrapper(
app.log,
)
self.modes = to_streamed_response_wrapper(
app.modes,
)
self.providers = to_streamed_response_wrapper(
app.providers,
)
class AsyncAppResourceWithStreamingResponse:
def __init__(self, app: AsyncAppResource) -> None:
self._app = app
self.get = async_to_streamed_response_wrapper(
app.get,
)
self.init = async_to_streamed_response_wrapper(
app.init,
)
self.log = async_to_streamed_response_wrapper(
app.log,
)
self.modes = async_to_streamed_response_wrapper(
app.modes,
)
self.providers = async_to_streamed_response_wrapper(
app.providers,
)

View file

@ -1,135 +0,0 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from __future__ import annotations
import httpx
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
to_raw_response_wrapper,
to_streamed_response_wrapper,
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
from .._base_client import make_request_options
from ..types.config import Config
__all__ = ["ConfigResource", "AsyncConfigResource"]
class ConfigResource(SyncAPIResource):
@cached_property
def with_raw_response(self) -> ConfigResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/sst/opencode-sdk-python#accessing-raw-response-data-eg-headers
"""
return ConfigResourceWithRawResponse(self)
@cached_property
def with_streaming_response(self) -> ConfigResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
For more information, see https://www.github.com/sst/opencode-sdk-python#with_streaming_response
"""
return ConfigResourceWithStreamingResponse(self)
def get(
self,
*,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Config:
"""Get config info"""
return self._get(
"/config",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=Config,
)
class AsyncConfigResource(AsyncAPIResource):
@cached_property
def with_raw_response(self) -> AsyncConfigResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/sst/opencode-sdk-python#accessing-raw-response-data-eg-headers
"""
return AsyncConfigResourceWithRawResponse(self)
@cached_property
def with_streaming_response(self) -> AsyncConfigResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
For more information, see https://www.github.com/sst/opencode-sdk-python#with_streaming_response
"""
return AsyncConfigResourceWithStreamingResponse(self)
async def get(
self,
*,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Config:
"""Get config info"""
return await self._get(
"/config",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=Config,
)
class ConfigResourceWithRawResponse:
def __init__(self, config: ConfigResource) -> None:
self._config = config
self.get = to_raw_response_wrapper(
config.get,
)
class AsyncConfigResourceWithRawResponse:
def __init__(self, config: AsyncConfigResource) -> None:
self._config = config
self.get = async_to_raw_response_wrapper(
config.get,
)
class ConfigResourceWithStreamingResponse:
def __init__(self, config: ConfigResource) -> None:
self._config = config
self.get = to_streamed_response_wrapper(
config.get,
)
class AsyncConfigResourceWithStreamingResponse:
def __init__(self, config: AsyncConfigResource) -> None:
self._config = config
self.get = async_to_streamed_response_wrapper(
config.get,
)

View file

@ -1,142 +0,0 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from __future__ import annotations
from typing import Any, cast
import httpx
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
to_raw_response_wrapper,
to_streamed_response_wrapper,
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
from .._streaming import Stream, AsyncStream
from .._base_client import make_request_options
from ..types.event_list_response import EventListResponse
__all__ = ["EventResource", "AsyncEventResource"]
class EventResource(SyncAPIResource):
@cached_property
def with_raw_response(self) -> EventResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/sst/opencode-sdk-python#accessing-raw-response-data-eg-headers
"""
return EventResourceWithRawResponse(self)
@cached_property
def with_streaming_response(self) -> EventResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
For more information, see https://www.github.com/sst/opencode-sdk-python#with_streaming_response
"""
return EventResourceWithStreamingResponse(self)
def list(
self,
*,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Stream[EventListResponse]:
"""Get events"""
return self._get(
"/event",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=cast(Any, EventListResponse), # Union types cannot be passed in as arguments in the type system
stream=True,
stream_cls=Stream[EventListResponse],
)
class AsyncEventResource(AsyncAPIResource):
@cached_property
def with_raw_response(self) -> AsyncEventResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/sst/opencode-sdk-python#accessing-raw-response-data-eg-headers
"""
return AsyncEventResourceWithRawResponse(self)
@cached_property
def with_streaming_response(self) -> AsyncEventResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
For more information, see https://www.github.com/sst/opencode-sdk-python#with_streaming_response
"""
return AsyncEventResourceWithStreamingResponse(self)
async def list(
self,
*,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AsyncStream[EventListResponse]:
"""Get events"""
return await self._get(
"/event",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=cast(Any, EventListResponse), # Union types cannot be passed in as arguments in the type system
stream=True,
stream_cls=AsyncStream[EventListResponse],
)
class EventResourceWithRawResponse:
def __init__(self, event: EventResource) -> None:
self._event = event
self.list = to_raw_response_wrapper(
event.list,
)
class AsyncEventResourceWithRawResponse:
def __init__(self, event: AsyncEventResource) -> None:
self._event = event
self.list = async_to_raw_response_wrapper(
event.list,
)
class EventResourceWithStreamingResponse:
def __init__(self, event: EventResource) -> None:
self._event = event
self.list = to_streamed_response_wrapper(
event.list,
)
class AsyncEventResourceWithStreamingResponse:
def __init__(self, event: AsyncEventResource) -> None:
self._event = event
self.list = async_to_streamed_response_wrapper(
event.list,
)

View file

@ -1,220 +0,0 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from __future__ import annotations
import httpx
from ..types import file_read_params
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._utils import maybe_transform, async_maybe_transform
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
to_raw_response_wrapper,
to_streamed_response_wrapper,
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
from .._base_client import make_request_options
from ..types.file_read_response import FileReadResponse
from ..types.file_status_response import FileStatusResponse
__all__ = ["FileResource", "AsyncFileResource"]
class FileResource(SyncAPIResource):
@cached_property
def with_raw_response(self) -> FileResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/sst/opencode-sdk-python#accessing-raw-response-data-eg-headers
"""
return FileResourceWithRawResponse(self)
@cached_property
def with_streaming_response(self) -> FileResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
For more information, see https://www.github.com/sst/opencode-sdk-python#with_streaming_response
"""
return FileResourceWithStreamingResponse(self)
def read(
self,
*,
path: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> FileReadResponse:
"""
Read a file
Args:
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
"""
return self._get(
"/file",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=maybe_transform({"path": path}, file_read_params.FileReadParams),
),
cast_to=FileReadResponse,
)
def status(
self,
*,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> FileStatusResponse:
"""Get file status"""
return self._get(
"/file/status",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=FileStatusResponse,
)
class AsyncFileResource(AsyncAPIResource):
@cached_property
def with_raw_response(self) -> AsyncFileResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/sst/opencode-sdk-python#accessing-raw-response-data-eg-headers
"""
return AsyncFileResourceWithRawResponse(self)
@cached_property
def with_streaming_response(self) -> AsyncFileResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
For more information, see https://www.github.com/sst/opencode-sdk-python#with_streaming_response
"""
return AsyncFileResourceWithStreamingResponse(self)
async def read(
self,
*,
path: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> FileReadResponse:
"""
Read a file
Args:
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
"""
return await self._get(
"/file",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=await async_maybe_transform({"path": path}, file_read_params.FileReadParams),
),
cast_to=FileReadResponse,
)
async def status(
self,
*,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> FileStatusResponse:
"""Get file status"""
return await self._get(
"/file/status",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=FileStatusResponse,
)
class FileResourceWithRawResponse:
def __init__(self, file: FileResource) -> None:
self._file = file
self.read = to_raw_response_wrapper(
file.read,
)
self.status = to_raw_response_wrapper(
file.status,
)
class AsyncFileResourceWithRawResponse:
def __init__(self, file: AsyncFileResource) -> None:
self._file = file
self.read = async_to_raw_response_wrapper(
file.read,
)
self.status = async_to_raw_response_wrapper(
file.status,
)
class FileResourceWithStreamingResponse:
def __init__(self, file: FileResource) -> None:
self._file = file
self.read = to_streamed_response_wrapper(
file.read,
)
self.status = to_streamed_response_wrapper(
file.status,
)
class AsyncFileResourceWithStreamingResponse:
def __init__(self, file: AsyncFileResource) -> None:
self._file = file
self.read = async_to_streamed_response_wrapper(
file.read,
)
self.status = async_to_streamed_response_wrapper(
file.status,
)

View file

@ -1,335 +0,0 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from __future__ import annotations
import httpx
from ..types import find_text_params, find_files_params, find_symbols_params
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._utils import maybe_transform, async_maybe_transform
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
to_raw_response_wrapper,
to_streamed_response_wrapper,
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
from .._base_client import make_request_options
from ..types.find_text_response import FindTextResponse
from ..types.find_files_response import FindFilesResponse
from ..types.find_symbols_response import FindSymbolsResponse
__all__ = ["FindResource", "AsyncFindResource"]
class FindResource(SyncAPIResource):
@cached_property
def with_raw_response(self) -> FindResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/sst/opencode-sdk-python#accessing-raw-response-data-eg-headers
"""
return FindResourceWithRawResponse(self)
@cached_property
def with_streaming_response(self) -> FindResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
For more information, see https://www.github.com/sst/opencode-sdk-python#with_streaming_response
"""
return FindResourceWithStreamingResponse(self)
def files(
self,
*,
query: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> FindFilesResponse:
"""
Find files
Args:
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
"""
return self._get(
"/find/file",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=maybe_transform({"query": query}, find_files_params.FindFilesParams),
),
cast_to=FindFilesResponse,
)
def symbols(
self,
*,
query: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> FindSymbolsResponse:
"""
Find workspace symbols
Args:
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
"""
return self._get(
"/find/symbol",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=maybe_transform({"query": query}, find_symbols_params.FindSymbolsParams),
),
cast_to=FindSymbolsResponse,
)
def text(
self,
*,
pattern: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> FindTextResponse:
"""
Find text in files
Args:
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
"""
return self._get(
"/find",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=maybe_transform({"pattern": pattern}, find_text_params.FindTextParams),
),
cast_to=FindTextResponse,
)
class AsyncFindResource(AsyncAPIResource):
@cached_property
def with_raw_response(self) -> AsyncFindResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/sst/opencode-sdk-python#accessing-raw-response-data-eg-headers
"""
return AsyncFindResourceWithRawResponse(self)
@cached_property
def with_streaming_response(self) -> AsyncFindResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
For more information, see https://www.github.com/sst/opencode-sdk-python#with_streaming_response
"""
return AsyncFindResourceWithStreamingResponse(self)
async def files(
self,
*,
query: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> FindFilesResponse:
"""
Find files
Args:
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
"""
return await self._get(
"/find/file",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=await async_maybe_transform({"query": query}, find_files_params.FindFilesParams),
),
cast_to=FindFilesResponse,
)
async def symbols(
self,
*,
query: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> FindSymbolsResponse:
"""
Find workspace symbols
Args:
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
"""
return await self._get(
"/find/symbol",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=await async_maybe_transform({"query": query}, find_symbols_params.FindSymbolsParams),
),
cast_to=FindSymbolsResponse,
)
async def text(
self,
*,
pattern: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> FindTextResponse:
"""
Find text in files
Args:
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
"""
return await self._get(
"/find",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=await async_maybe_transform({"pattern": pattern}, find_text_params.FindTextParams),
),
cast_to=FindTextResponse,
)
class FindResourceWithRawResponse:
def __init__(self, find: FindResource) -> None:
self._find = find
self.files = to_raw_response_wrapper(
find.files,
)
self.symbols = to_raw_response_wrapper(
find.symbols,
)
self.text = to_raw_response_wrapper(
find.text,
)
class AsyncFindResourceWithRawResponse:
def __init__(self, find: AsyncFindResource) -> None:
self._find = find
self.files = async_to_raw_response_wrapper(
find.files,
)
self.symbols = async_to_raw_response_wrapper(
find.symbols,
)
self.text = async_to_raw_response_wrapper(
find.text,
)
class FindResourceWithStreamingResponse:
def __init__(self, find: FindResource) -> None:
self._find = find
self.files = to_streamed_response_wrapper(
find.files,
)
self.symbols = to_streamed_response_wrapper(
find.symbols,
)
self.text = to_streamed_response_wrapper(
find.text,
)
class AsyncFindResourceWithStreamingResponse:
def __init__(self, find: AsyncFindResource) -> None:
self._find = find
self.files = async_to_streamed_response_wrapper(
find.files,
)
self.symbols = async_to_streamed_response_wrapper(
find.symbols,
)
self.text = async_to_streamed_response_wrapper(
find.text,
)

File diff suppressed because it is too large Load diff

View file

@ -1,214 +0,0 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from __future__ import annotations
import httpx
from ..types import tui_append_prompt_params
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._utils import maybe_transform, async_maybe_transform
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
to_raw_response_wrapper,
to_streamed_response_wrapper,
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
from .._base_client import make_request_options
from ..types.tui_open_help_response import TuiOpenHelpResponse
from ..types.tui_append_prompt_response import TuiAppendPromptResponse
__all__ = ["TuiResource", "AsyncTuiResource"]
class TuiResource(SyncAPIResource):
@cached_property
def with_raw_response(self) -> TuiResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/sst/opencode-sdk-python#accessing-raw-response-data-eg-headers
"""
return TuiResourceWithRawResponse(self)
@cached_property
def with_streaming_response(self) -> TuiResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
For more information, see https://www.github.com/sst/opencode-sdk-python#with_streaming_response
"""
return TuiResourceWithStreamingResponse(self)
def append_prompt(
self,
*,
text: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> TuiAppendPromptResponse:
"""
Append prompt to the TUI
Args:
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
"""
return self._post(
"/tui/append-prompt",
body=maybe_transform({"text": text}, tui_append_prompt_params.TuiAppendPromptParams),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=TuiAppendPromptResponse,
)
def open_help(
self,
*,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> TuiOpenHelpResponse:
"""Open the help dialog"""
return self._post(
"/tui/open-help",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=TuiOpenHelpResponse,
)
class AsyncTuiResource(AsyncAPIResource):
@cached_property
def with_raw_response(self) -> AsyncTuiResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/sst/opencode-sdk-python#accessing-raw-response-data-eg-headers
"""
return AsyncTuiResourceWithRawResponse(self)
@cached_property
def with_streaming_response(self) -> AsyncTuiResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
For more information, see https://www.github.com/sst/opencode-sdk-python#with_streaming_response
"""
return AsyncTuiResourceWithStreamingResponse(self)
async def append_prompt(
self,
*,
text: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> TuiAppendPromptResponse:
"""
Append prompt to the TUI
Args:
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
"""
return await self._post(
"/tui/append-prompt",
body=await async_maybe_transform({"text": text}, tui_append_prompt_params.TuiAppendPromptParams),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=TuiAppendPromptResponse,
)
async def open_help(
self,
*,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> TuiOpenHelpResponse:
"""Open the help dialog"""
return await self._post(
"/tui/open-help",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=TuiOpenHelpResponse,
)
class TuiResourceWithRawResponse:
def __init__(self, tui: TuiResource) -> None:
self._tui = tui
self.append_prompt = to_raw_response_wrapper(
tui.append_prompt,
)
self.open_help = to_raw_response_wrapper(
tui.open_help,
)
class AsyncTuiResourceWithRawResponse:
def __init__(self, tui: AsyncTuiResource) -> None:
self._tui = tui
self.append_prompt = async_to_raw_response_wrapper(
tui.append_prompt,
)
self.open_help = async_to_raw_response_wrapper(
tui.open_help,
)
class TuiResourceWithStreamingResponse:
def __init__(self, tui: TuiResource) -> None:
self._tui = tui
self.append_prompt = to_streamed_response_wrapper(
tui.append_prompt,
)
self.open_help = to_streamed_response_wrapper(
tui.open_help,
)
class AsyncTuiResourceWithStreamingResponse:
def __init__(self, tui: AsyncTuiResource) -> None:
self._tui = tui
self.append_prompt = async_to_streamed_response_wrapper(
tui.append_prompt,
)
self.open_help = async_to_streamed_response_wrapper(
tui.open_help,
)