feat(api): api update

This commit is contained in:
stainless-app[bot] 2025-07-03 16:06:49 +00:00
parent 1c8c91c017
commit f8c7148ae5
5 changed files with 116 additions and 37 deletions

View file

@ -1,4 +1,4 @@
configured_endpoints: 20
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/opencode%2Fopencode-e2f67adede4455c3fe4507ac6f0b2ed1a91ee951ab30e01179555c18765750d4.yml
openapi_spec_hash: 6005bcfff58c025d61739be42030a339
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/opencode%2Fopencode-945f9da9e9a4c4008834deef63e4346c0076e020eed3d3c98c249095033c1ac5.yml
openapi_spec_hash: 522a44f6cb0677435fe2ac7693848ad7
config_hash: 6c8822d278ba83456e5eed6d774ca230

View file

@ -58,6 +58,8 @@ type Config struct {
// Disable providers that are loaded automatically
DisabledProviders []string `json:"disabled_providers"`
Experimental ConfigExperimental `json:"experimental"`
// Additional instruction files or patterns to include
Instructions []string `json:"instructions"`
// Custom keybind configurations
Keybinds Keybinds `json:"keybinds"`
// MCP (Model Context Protocol) server configurations
@ -78,6 +80,7 @@ type configJSON struct {
Autoupdate apijson.Field
DisabledProviders apijson.Field
Experimental apijson.Field
Instructions apijson.Field
Keybinds apijson.Field
Mcp apijson.Field
Model apijson.Field

View file

@ -54,6 +54,7 @@ type EventListResponse struct {
// [EventListResponseEventStorageWriteProperties],
// [EventListResponseEventInstallationUpdatedProperties],
// [EventListResponseEventMessageUpdatedProperties],
// [EventListResponseEventMessageRemovedProperties],
// [EventListResponseEventMessagePartUpdatedProperties],
// [EventListResponseEventSessionUpdatedProperties],
// [EventListResponseEventSessionDeletedProperties],
@ -96,7 +97,7 @@ func (r *EventListResponse) UnmarshalJSON(data []byte) (err error) {
// [EventListResponseEventPermissionUpdated], [EventListResponseEventFileEdited],
// [EventListResponseEventStorageWrite],
// [EventListResponseEventInstallationUpdated],
// [EventListResponseEventMessageUpdated],
// [EventListResponseEventMessageUpdated], [EventListResponseEventMessageRemoved],
// [EventListResponseEventMessagePartUpdated],
// [EventListResponseEventSessionUpdated], [EventListResponseEventSessionDeleted],
// [EventListResponseEventSessionIdle], [EventListResponseEventSessionError],
@ -109,7 +110,7 @@ func (r EventListResponse) AsUnion() EventListResponseUnion {
// [EventListResponseEventPermissionUpdated], [EventListResponseEventFileEdited],
// [EventListResponseEventStorageWrite],
// [EventListResponseEventInstallationUpdated],
// [EventListResponseEventMessageUpdated],
// [EventListResponseEventMessageUpdated], [EventListResponseEventMessageRemoved],
// [EventListResponseEventMessagePartUpdated],
// [EventListResponseEventSessionUpdated], [EventListResponseEventSessionDeleted],
// [EventListResponseEventSessionIdle], [EventListResponseEventSessionError] or
@ -152,6 +153,11 @@ func init() {
Type: reflect.TypeOf(EventListResponseEventMessageUpdated{}),
DiscriminatorValue: "message.updated",
},
apijson.UnionVariant{
TypeFilter: gjson.JSON,
Type: reflect.TypeOf(EventListResponseEventMessageRemoved{}),
DiscriminatorValue: "message.removed",
},
apijson.UnionVariant{
TypeFilter: gjson.JSON,
Type: reflect.TypeOf(EventListResponseEventMessagePartUpdated{}),
@ -578,6 +584,68 @@ func (r EventListResponseEventMessageUpdatedType) IsKnown() bool {
return false
}
type EventListResponseEventMessageRemoved struct {
Properties EventListResponseEventMessageRemovedProperties `json:"properties,required"`
Type EventListResponseEventMessageRemovedType `json:"type,required"`
JSON eventListResponseEventMessageRemovedJSON `json:"-"`
}
// eventListResponseEventMessageRemovedJSON contains the JSON metadata for the
// struct [EventListResponseEventMessageRemoved]
type eventListResponseEventMessageRemovedJSON struct {
Properties apijson.Field
Type apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *EventListResponseEventMessageRemoved) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r eventListResponseEventMessageRemovedJSON) RawJSON() string {
return r.raw
}
func (r EventListResponseEventMessageRemoved) implementsEventListResponse() {}
type EventListResponseEventMessageRemovedProperties struct {
MessageID string `json:"messageID,required"`
SessionID string `json:"sessionID,required"`
JSON eventListResponseEventMessageRemovedPropertiesJSON `json:"-"`
}
// eventListResponseEventMessageRemovedPropertiesJSON contains the JSON metadata
// for the struct [EventListResponseEventMessageRemovedProperties]
type eventListResponseEventMessageRemovedPropertiesJSON struct {
MessageID apijson.Field
SessionID apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *EventListResponseEventMessageRemovedProperties) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r eventListResponseEventMessageRemovedPropertiesJSON) RawJSON() string {
return r.raw
}
type EventListResponseEventMessageRemovedType string
const (
EventListResponseEventMessageRemovedTypeMessageRemoved EventListResponseEventMessageRemovedType = "message.removed"
)
func (r EventListResponseEventMessageRemovedType) IsKnown() bool {
switch r {
case EventListResponseEventMessageRemovedTypeMessageRemoved:
return true
}
return false
}
type EventListResponseEventMessagePartUpdated struct {
Properties EventListResponseEventMessagePartUpdatedProperties `json:"properties,required"`
Type EventListResponseEventMessagePartUpdatedType `json:"type,required"`
@ -1094,6 +1162,7 @@ const (
EventListResponseTypeStorageWrite EventListResponseType = "storage.write"
EventListResponseTypeInstallationUpdated EventListResponseType = "installation.updated"
EventListResponseTypeMessageUpdated EventListResponseType = "message.updated"
EventListResponseTypeMessageRemoved EventListResponseType = "message.removed"
EventListResponseTypeMessagePartUpdated EventListResponseType = "message.part.updated"
EventListResponseTypeSessionUpdated EventListResponseType = "session.updated"
EventListResponseTypeSessionDeleted EventListResponseType = "session.deleted"
@ -1104,7 +1173,7 @@ const (
func (r EventListResponseType) IsKnown() bool {
switch r {
case EventListResponseTypeLspClientDiagnostics, EventListResponseTypePermissionUpdated, EventListResponseTypeFileEdited, EventListResponseTypeStorageWrite, EventListResponseTypeInstallationUpdated, EventListResponseTypeMessageUpdated, EventListResponseTypeMessagePartUpdated, EventListResponseTypeSessionUpdated, EventListResponseTypeSessionDeleted, EventListResponseTypeSessionIdle, EventListResponseTypeSessionError, EventListResponseTypeFileWatcherUpdated:
case EventListResponseTypeLspClientDiagnostics, EventListResponseTypePermissionUpdated, EventListResponseTypeFileEdited, EventListResponseTypeStorageWrite, EventListResponseTypeInstallationUpdated, EventListResponseTypeMessageUpdated, EventListResponseTypeMessageRemoved, EventListResponseTypeMessagePartUpdated, EventListResponseTypeSessionUpdated, EventListResponseTypeSessionDeleted, EventListResponseTypeSessionIdle, EventListResponseTypeSessionError, EventListResponseTypeFileWatcherUpdated:
return true
}
return false

View file

@ -88,9 +88,9 @@ func (r FileReadResponseType) IsKnown() bool {
}
type FileStatusResponse struct {
Added float64 `json:"added,required"`
Added int64 `json:"added,required"`
File string `json:"file,required"`
Removed float64 `json:"removed,required"`
Removed int64 `json:"removed,required"`
Status FileStatusResponseStatus `json:"status,required"`
JSON fileStatusResponseJSON `json:"-"`
}

View file

@ -235,7 +235,7 @@ type MessageMetadata struct {
Tool map[string]MessageMetadataTool `json:"tool,required"`
Assistant MessageMetadataAssistant `json:"assistant"`
Error MessageMetadataError `json:"error"`
User MessageMetadataUser `json:"user"`
Snapshot string `json:"snapshot"`
JSON messageMetadataJSON `json:"-"`
}
@ -246,7 +246,7 @@ type messageMetadataJSON struct {
Tool apijson.Field
Assistant apijson.Field
Error apijson.Field
User apijson.Field
Snapshot apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
@ -285,6 +285,7 @@ func (r messageMetadataTimeJSON) RawJSON() string {
type MessageMetadataTool struct {
Time MessageMetadataToolTime `json:"time,required"`
Title string `json:"title,required"`
Snapshot string `json:"snapshot"`
ExtraFields map[string]interface{} `json:"-,extras"`
JSON messageMetadataToolJSON `json:"-"`
}
@ -294,6 +295,7 @@ type MessageMetadataTool struct {
type messageMetadataToolJSON struct {
Time apijson.Field
Title apijson.Field
Snapshot apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
@ -558,27 +560,6 @@ func (r MessageMetadataErrorName) IsKnown() bool {
return false
}
type MessageMetadataUser struct {
Snapshot string `json:"snapshot"`
JSON messageMetadataUserJSON `json:"-"`
}
// messageMetadataUserJSON contains the JSON metadata for the struct
// [MessageMetadataUser]
type messageMetadataUserJSON struct {
Snapshot apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *MessageMetadataUser) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r messageMetadataUserJSON) RawJSON() string {
return r.raw
}
type MessageRole string
const (
@ -786,13 +767,14 @@ func (r ReasoningPartParam) MarshalJSON() (data []byte, err error) {
func (r ReasoningPartParam) implementsMessagePartUnionParam() {}
type Session struct {
ID string `json:"id,required"`
Time SessionTime `json:"time,required"`
Title string `json:"title,required"`
Version string `json:"version,required"`
ParentID string `json:"parentID"`
Share SessionShare `json:"share"`
JSON sessionJSON `json:"-"`
ID string `json:"id,required"`
Time SessionTime `json:"time,required"`
Title string `json:"title,required"`
Version string `json:"version,required"`
ParentID string `json:"parentID"`
Revert SessionRevert `json:"revert"`
Share SessionShare `json:"share"`
JSON sessionJSON `json:"-"`
}
// sessionJSON contains the JSON metadata for the struct [Session]
@ -802,6 +784,7 @@ type sessionJSON struct {
Title apijson.Field
Version apijson.Field
ParentID apijson.Field
Revert apijson.Field
Share apijson.Field
raw string
ExtraFields map[string]apijson.Field
@ -837,6 +820,30 @@ func (r sessionTimeJSON) RawJSON() string {
return r.raw
}
type SessionRevert struct {
MessageID string `json:"messageID,required"`
Part float64 `json:"part,required"`
Snapshot string `json:"snapshot"`
JSON sessionRevertJSON `json:"-"`
}
// sessionRevertJSON contains the JSON metadata for the struct [SessionRevert]
type sessionRevertJSON struct {
MessageID apijson.Field
Part apijson.Field
Snapshot apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *SessionRevert) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r sessionRevertJSON) RawJSON() string {
return r.raw
}
type SessionShare struct {
URL string `json:"url,required"`
JSON sessionShareJSON `json:"-"`