mirror of
https://github.com/anomalyco/opencode-sdk-go.git
synced 2026-05-17 04:12:45 +00:00
feat(api): api update
This commit is contained in:
parent
551f9f0ed8
commit
4fc04fc711
5 changed files with 227 additions and 102 deletions
|
|
@ -1,4 +1,4 @@
|
|||
configured_endpoints: 43
|
||||
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/opencode%2Fopencode-273fc9fea965af661dfed0902d00f10d6ed844f0681ca861a58821c4902eac2f.yml
|
||||
openapi_spec_hash: c6144f23a1bac75f79be86edd405552b
|
||||
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/opencode%2Fopencode-5c627094d7b70a20907a0f9e5876a3a0bb9e1ffdbb94132192b8b98b5e59da97.yml
|
||||
openapi_spec_hash: 9b532c6babbd120cced490a7e07a15f5
|
||||
config_hash: 026ef000d34bf2f930e7b41e77d2d3ff
|
||||
|
|
|
|||
60
app.go
60
app.go
|
|
@ -62,6 +62,7 @@ type Model struct {
|
|||
Temperature bool `json:"temperature,required"`
|
||||
ToolCall bool `json:"tool_call,required"`
|
||||
Experimental bool `json:"experimental"`
|
||||
Modalities ModelModalities `json:"modalities"`
|
||||
Provider ModelProvider `json:"provider"`
|
||||
JSON modelJSON `json:"-"`
|
||||
}
|
||||
|
|
@ -79,6 +80,7 @@ type modelJSON struct {
|
|||
Temperature apijson.Field
|
||||
ToolCall apijson.Field
|
||||
Experimental apijson.Field
|
||||
Modalities apijson.Field
|
||||
Provider apijson.Field
|
||||
raw string
|
||||
ExtraFields map[string]apijson.Field
|
||||
|
|
@ -140,6 +142,64 @@ func (r modelLimitJSON) RawJSON() string {
|
|||
return r.raw
|
||||
}
|
||||
|
||||
type ModelModalities struct {
|
||||
Input []ModelModalitiesInput `json:"input,required"`
|
||||
Output []ModelModalitiesOutput `json:"output,required"`
|
||||
JSON modelModalitiesJSON `json:"-"`
|
||||
}
|
||||
|
||||
// modelModalitiesJSON contains the JSON metadata for the struct [ModelModalities]
|
||||
type modelModalitiesJSON struct {
|
||||
Input apijson.Field
|
||||
Output apijson.Field
|
||||
raw string
|
||||
ExtraFields map[string]apijson.Field
|
||||
}
|
||||
|
||||
func (r *ModelModalities) UnmarshalJSON(data []byte) (err error) {
|
||||
return apijson.UnmarshalRoot(data, r)
|
||||
}
|
||||
|
||||
func (r modelModalitiesJSON) RawJSON() string {
|
||||
return r.raw
|
||||
}
|
||||
|
||||
type ModelModalitiesInput string
|
||||
|
||||
const (
|
||||
ModelModalitiesInputText ModelModalitiesInput = "text"
|
||||
ModelModalitiesInputAudio ModelModalitiesInput = "audio"
|
||||
ModelModalitiesInputImage ModelModalitiesInput = "image"
|
||||
ModelModalitiesInputVideo ModelModalitiesInput = "video"
|
||||
ModelModalitiesInputPdf ModelModalitiesInput = "pdf"
|
||||
)
|
||||
|
||||
func (r ModelModalitiesInput) IsKnown() bool {
|
||||
switch r {
|
||||
case ModelModalitiesInputText, ModelModalitiesInputAudio, ModelModalitiesInputImage, ModelModalitiesInputVideo, ModelModalitiesInputPdf:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type ModelModalitiesOutput string
|
||||
|
||||
const (
|
||||
ModelModalitiesOutputText ModelModalitiesOutput = "text"
|
||||
ModelModalitiesOutputAudio ModelModalitiesOutput = "audio"
|
||||
ModelModalitiesOutputImage ModelModalitiesOutput = "image"
|
||||
ModelModalitiesOutputVideo ModelModalitiesOutput = "video"
|
||||
ModelModalitiesOutputPdf ModelModalitiesOutput = "pdf"
|
||||
)
|
||||
|
||||
func (r ModelModalitiesOutput) IsKnown() bool {
|
||||
switch r {
|
||||
case ModelModalitiesOutputText, ModelModalitiesOutputAudio, ModelModalitiesOutputImage, ModelModalitiesOutputVideo, ModelModalitiesOutputPdf:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type ModelProvider struct {
|
||||
Npm string `json:"npm,required"`
|
||||
JSON modelProviderJSON `json:"-"`
|
||||
|
|
|
|||
96
config.go
96
config.go
|
|
@ -1567,19 +1567,20 @@ func (r configProviderJSON) RawJSON() string {
|
|||
}
|
||||
|
||||
type ConfigProviderModel struct {
|
||||
ID string `json:"id"`
|
||||
Attachment bool `json:"attachment"`
|
||||
Cost ConfigProviderModelsCost `json:"cost"`
|
||||
Experimental bool `json:"experimental"`
|
||||
Limit ConfigProviderModelsLimit `json:"limit"`
|
||||
Name string `json:"name"`
|
||||
Options map[string]interface{} `json:"options"`
|
||||
Provider ConfigProviderModelsProvider `json:"provider"`
|
||||
Reasoning bool `json:"reasoning"`
|
||||
ReleaseDate string `json:"release_date"`
|
||||
Temperature bool `json:"temperature"`
|
||||
ToolCall bool `json:"tool_call"`
|
||||
JSON configProviderModelJSON `json:"-"`
|
||||
ID string `json:"id"`
|
||||
Attachment bool `json:"attachment"`
|
||||
Cost ConfigProviderModelsCost `json:"cost"`
|
||||
Experimental bool `json:"experimental"`
|
||||
Limit ConfigProviderModelsLimit `json:"limit"`
|
||||
Modalities ConfigProviderModelsModalities `json:"modalities"`
|
||||
Name string `json:"name"`
|
||||
Options map[string]interface{} `json:"options"`
|
||||
Provider ConfigProviderModelsProvider `json:"provider"`
|
||||
Reasoning bool `json:"reasoning"`
|
||||
ReleaseDate string `json:"release_date"`
|
||||
Temperature bool `json:"temperature"`
|
||||
ToolCall bool `json:"tool_call"`
|
||||
JSON configProviderModelJSON `json:"-"`
|
||||
}
|
||||
|
||||
// configProviderModelJSON contains the JSON metadata for the struct
|
||||
|
|
@ -1590,6 +1591,7 @@ type configProviderModelJSON struct {
|
|||
Cost apijson.Field
|
||||
Experimental apijson.Field
|
||||
Limit apijson.Field
|
||||
Modalities apijson.Field
|
||||
Name apijson.Field
|
||||
Options apijson.Field
|
||||
Provider apijson.Field
|
||||
|
|
@ -1659,6 +1661,65 @@ func (r configProviderModelsLimitJSON) RawJSON() string {
|
|||
return r.raw
|
||||
}
|
||||
|
||||
type ConfigProviderModelsModalities struct {
|
||||
Input []ConfigProviderModelsModalitiesInput `json:"input,required"`
|
||||
Output []ConfigProviderModelsModalitiesOutput `json:"output,required"`
|
||||
JSON configProviderModelsModalitiesJSON `json:"-"`
|
||||
}
|
||||
|
||||
// configProviderModelsModalitiesJSON contains the JSON metadata for the struct
|
||||
// [ConfigProviderModelsModalities]
|
||||
type configProviderModelsModalitiesJSON struct {
|
||||
Input apijson.Field
|
||||
Output apijson.Field
|
||||
raw string
|
||||
ExtraFields map[string]apijson.Field
|
||||
}
|
||||
|
||||
func (r *ConfigProviderModelsModalities) UnmarshalJSON(data []byte) (err error) {
|
||||
return apijson.UnmarshalRoot(data, r)
|
||||
}
|
||||
|
||||
func (r configProviderModelsModalitiesJSON) RawJSON() string {
|
||||
return r.raw
|
||||
}
|
||||
|
||||
type ConfigProviderModelsModalitiesInput string
|
||||
|
||||
const (
|
||||
ConfigProviderModelsModalitiesInputText ConfigProviderModelsModalitiesInput = "text"
|
||||
ConfigProviderModelsModalitiesInputAudio ConfigProviderModelsModalitiesInput = "audio"
|
||||
ConfigProviderModelsModalitiesInputImage ConfigProviderModelsModalitiesInput = "image"
|
||||
ConfigProviderModelsModalitiesInputVideo ConfigProviderModelsModalitiesInput = "video"
|
||||
ConfigProviderModelsModalitiesInputPdf ConfigProviderModelsModalitiesInput = "pdf"
|
||||
)
|
||||
|
||||
func (r ConfigProviderModelsModalitiesInput) IsKnown() bool {
|
||||
switch r {
|
||||
case ConfigProviderModelsModalitiesInputText, ConfigProviderModelsModalitiesInputAudio, ConfigProviderModelsModalitiesInputImage, ConfigProviderModelsModalitiesInputVideo, ConfigProviderModelsModalitiesInputPdf:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type ConfigProviderModelsModalitiesOutput string
|
||||
|
||||
const (
|
||||
ConfigProviderModelsModalitiesOutputText ConfigProviderModelsModalitiesOutput = "text"
|
||||
ConfigProviderModelsModalitiesOutputAudio ConfigProviderModelsModalitiesOutput = "audio"
|
||||
ConfigProviderModelsModalitiesOutputImage ConfigProviderModelsModalitiesOutput = "image"
|
||||
ConfigProviderModelsModalitiesOutputVideo ConfigProviderModelsModalitiesOutput = "video"
|
||||
ConfigProviderModelsModalitiesOutputPdf ConfigProviderModelsModalitiesOutput = "pdf"
|
||||
)
|
||||
|
||||
func (r ConfigProviderModelsModalitiesOutput) IsKnown() bool {
|
||||
switch r {
|
||||
case ConfigProviderModelsModalitiesOutputText, ConfigProviderModelsModalitiesOutputAudio, ConfigProviderModelsModalitiesOutputImage, ConfigProviderModelsModalitiesOutputVideo, ConfigProviderModelsModalitiesOutputPdf:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type ConfigProviderModelsProvider struct {
|
||||
Npm string `json:"npm,required"`
|
||||
JSON configProviderModelsProviderJSON `json:"-"`
|
||||
|
|
@ -1807,6 +1868,8 @@ type KeybindsConfig struct {
|
|||
AppExit string `json:"app_exit"`
|
||||
// Show help dialog
|
||||
AppHelp string `json:"app_help"`
|
||||
// List available commands
|
||||
CommandList string `json:"command_list"`
|
||||
// Open external editor
|
||||
EditorOpen string `json:"editor_open"`
|
||||
// @deprecated Close file
|
||||
|
|
@ -1881,6 +1944,10 @@ type KeybindsConfig struct {
|
|||
SessionTimeline string `json:"session_timeline"`
|
||||
// Unshare current session
|
||||
SessionUnshare string `json:"session_unshare"`
|
||||
// Toggle sidebar
|
||||
SidebarToggle string `json:"sidebar_toggle"`
|
||||
// View status
|
||||
StatusView string `json:"status_view"`
|
||||
// @deprecated use agent_cycle. Next agent
|
||||
SwitchAgent string `json:"switch_agent"`
|
||||
// @deprecated use agent_cycle_reverse. Previous agent
|
||||
|
|
@ -1905,6 +1972,7 @@ type keybindsConfigJSON struct {
|
|||
AgentList apijson.Field
|
||||
AppExit apijson.Field
|
||||
AppHelp apijson.Field
|
||||
CommandList apijson.Field
|
||||
EditorOpen apijson.Field
|
||||
FileClose apijson.Field
|
||||
FileDiffToggle apijson.Field
|
||||
|
|
@ -1942,6 +2010,8 @@ type keybindsConfigJSON struct {
|
|||
SessionShare apijson.Field
|
||||
SessionTimeline apijson.Field
|
||||
SessionUnshare apijson.Field
|
||||
SidebarToggle apijson.Field
|
||||
StatusView apijson.Field
|
||||
SwitchAgent apijson.Field
|
||||
SwitchAgentReverse apijson.Field
|
||||
SwitchMode apijson.Field
|
||||
|
|
|
|||
128
event.go
128
event.go
|
|
@ -54,7 +54,7 @@ func (r *EventService) ListStreaming(ctx context.Context, query EventListParams,
|
|||
type EventListResponse struct {
|
||||
// This field can have the runtime type of
|
||||
// [EventListResponseEventInstallationUpdatedProperties],
|
||||
// [EventListResponseEventLspClientDiagnosticsProperties],
|
||||
// [EventListResponseEventLspClientDiagnosticsProperties], [interface{}],
|
||||
// [EventListResponseEventMessageUpdatedProperties],
|
||||
// [EventListResponseEventMessageRemovedProperties],
|
||||
// [EventListResponseEventMessagePartUpdatedProperties],
|
||||
|
|
@ -67,8 +67,7 @@ type EventListResponse struct {
|
|||
// [EventListResponseEventSessionIdleProperties],
|
||||
// [EventListResponseEventSessionUpdatedProperties],
|
||||
// [EventListResponseEventSessionDeletedProperties],
|
||||
// [EventListResponseEventSessionErrorProperties], [interface{}],
|
||||
// [EventListResponseEventIdeInstalledProperties].
|
||||
// [EventListResponseEventSessionErrorProperties].
|
||||
Properties interface{} `json:"properties,required"`
|
||||
Type EventListResponseType `json:"type,required"`
|
||||
JSON eventListResponseJSON `json:"-"`
|
||||
|
|
@ -103,7 +102,8 @@ func (r *EventListResponse) UnmarshalJSON(data []byte) (err error) {
|
|||
// Possible runtime types of the union are
|
||||
// [EventListResponseEventInstallationUpdated],
|
||||
// [EventListResponseEventLspClientDiagnostics],
|
||||
// [EventListResponseEventMessageUpdated], [EventListResponseEventMessageRemoved],
|
||||
// [EventListResponseEventLspUpdated], [EventListResponseEventMessageUpdated],
|
||||
// [EventListResponseEventMessageRemoved],
|
||||
// [EventListResponseEventMessagePartUpdated],
|
||||
// [EventListResponseEventMessagePartRemoved],
|
||||
// [EventListResponseEventSessionCompacted],
|
||||
|
|
@ -112,14 +112,15 @@ func (r *EventListResponse) UnmarshalJSON(data []byte) (err error) {
|
|||
// [EventListResponseEventFileWatcherUpdated], [EventListResponseEventTodoUpdated],
|
||||
// [EventListResponseEventSessionIdle], [EventListResponseEventSessionUpdated],
|
||||
// [EventListResponseEventSessionDeleted], [EventListResponseEventSessionError],
|
||||
// [EventListResponseEventServerConnected], [EventListResponseEventIdeInstalled].
|
||||
// [EventListResponseEventServerConnected].
|
||||
func (r EventListResponse) AsUnion() EventListResponseUnion {
|
||||
return r.union
|
||||
}
|
||||
|
||||
// Union satisfied by [EventListResponseEventInstallationUpdated],
|
||||
// [EventListResponseEventLspClientDiagnostics],
|
||||
// [EventListResponseEventMessageUpdated], [EventListResponseEventMessageRemoved],
|
||||
// [EventListResponseEventLspUpdated], [EventListResponseEventMessageUpdated],
|
||||
// [EventListResponseEventMessageRemoved],
|
||||
// [EventListResponseEventMessagePartUpdated],
|
||||
// [EventListResponseEventMessagePartRemoved],
|
||||
// [EventListResponseEventSessionCompacted],
|
||||
|
|
@ -127,8 +128,8 @@ func (r EventListResponse) AsUnion() EventListResponseUnion {
|
|||
// [EventListResponseEventPermissionReplied], [EventListResponseEventFileEdited],
|
||||
// [EventListResponseEventFileWatcherUpdated], [EventListResponseEventTodoUpdated],
|
||||
// [EventListResponseEventSessionIdle], [EventListResponseEventSessionUpdated],
|
||||
// [EventListResponseEventSessionDeleted], [EventListResponseEventSessionError],
|
||||
// [EventListResponseEventServerConnected] or [EventListResponseEventIdeInstalled].
|
||||
// [EventListResponseEventSessionDeleted], [EventListResponseEventSessionError] or
|
||||
// [EventListResponseEventServerConnected].
|
||||
type EventListResponseUnion interface {
|
||||
implementsEventListResponse()
|
||||
}
|
||||
|
|
@ -145,6 +146,10 @@ func init() {
|
|||
TypeFilter: gjson.JSON,
|
||||
Type: reflect.TypeOf(EventListResponseEventLspClientDiagnostics{}),
|
||||
},
|
||||
apijson.UnionVariant{
|
||||
TypeFilter: gjson.JSON,
|
||||
Type: reflect.TypeOf(EventListResponseEventLspUpdated{}),
|
||||
},
|
||||
apijson.UnionVariant{
|
||||
TypeFilter: gjson.JSON,
|
||||
Type: reflect.TypeOf(EventListResponseEventMessageUpdated{}),
|
||||
|
|
@ -205,10 +210,6 @@ func init() {
|
|||
TypeFilter: gjson.JSON,
|
||||
Type: reflect.TypeOf(EventListResponseEventServerConnected{}),
|
||||
},
|
||||
apijson.UnionVariant{
|
||||
TypeFilter: gjson.JSON,
|
||||
Type: reflect.TypeOf(EventListResponseEventIdeInstalled{}),
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -334,6 +335,45 @@ func (r EventListResponseEventLspClientDiagnosticsType) IsKnown() bool {
|
|||
return false
|
||||
}
|
||||
|
||||
type EventListResponseEventLspUpdated struct {
|
||||
Properties interface{} `json:"properties,required"`
|
||||
Type EventListResponseEventLspUpdatedType `json:"type,required"`
|
||||
JSON eventListResponseEventLspUpdatedJSON `json:"-"`
|
||||
}
|
||||
|
||||
// eventListResponseEventLspUpdatedJSON contains the JSON metadata for the struct
|
||||
// [EventListResponseEventLspUpdated]
|
||||
type eventListResponseEventLspUpdatedJSON struct {
|
||||
Properties apijson.Field
|
||||
Type apijson.Field
|
||||
raw string
|
||||
ExtraFields map[string]apijson.Field
|
||||
}
|
||||
|
||||
func (r *EventListResponseEventLspUpdated) UnmarshalJSON(data []byte) (err error) {
|
||||
return apijson.UnmarshalRoot(data, r)
|
||||
}
|
||||
|
||||
func (r eventListResponseEventLspUpdatedJSON) RawJSON() string {
|
||||
return r.raw
|
||||
}
|
||||
|
||||
func (r EventListResponseEventLspUpdated) implementsEventListResponse() {}
|
||||
|
||||
type EventListResponseEventLspUpdatedType string
|
||||
|
||||
const (
|
||||
EventListResponseEventLspUpdatedTypeLspUpdated EventListResponseEventLspUpdatedType = "lsp.updated"
|
||||
)
|
||||
|
||||
func (r EventListResponseEventLspUpdatedType) IsKnown() bool {
|
||||
switch r {
|
||||
case EventListResponseEventLspUpdatedTypeLspUpdated:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type EventListResponseEventMessageUpdated struct {
|
||||
Properties EventListResponseEventMessageUpdatedProperties `json:"properties,required"`
|
||||
Type EventListResponseEventMessageUpdatedType `json:"type,required"`
|
||||
|
|
@ -1385,71 +1425,12 @@ func (r EventListResponseEventServerConnectedType) IsKnown() bool {
|
|||
return false
|
||||
}
|
||||
|
||||
type EventListResponseEventIdeInstalled struct {
|
||||
Properties EventListResponseEventIdeInstalledProperties `json:"properties,required"`
|
||||
Type EventListResponseEventIdeInstalledType `json:"type,required"`
|
||||
JSON eventListResponseEventIdeInstalledJSON `json:"-"`
|
||||
}
|
||||
|
||||
// eventListResponseEventIdeInstalledJSON contains the JSON metadata for the struct
|
||||
// [EventListResponseEventIdeInstalled]
|
||||
type eventListResponseEventIdeInstalledJSON struct {
|
||||
Properties apijson.Field
|
||||
Type apijson.Field
|
||||
raw string
|
||||
ExtraFields map[string]apijson.Field
|
||||
}
|
||||
|
||||
func (r *EventListResponseEventIdeInstalled) UnmarshalJSON(data []byte) (err error) {
|
||||
return apijson.UnmarshalRoot(data, r)
|
||||
}
|
||||
|
||||
func (r eventListResponseEventIdeInstalledJSON) RawJSON() string {
|
||||
return r.raw
|
||||
}
|
||||
|
||||
func (r EventListResponseEventIdeInstalled) implementsEventListResponse() {}
|
||||
|
||||
type EventListResponseEventIdeInstalledProperties struct {
|
||||
Ide string `json:"ide,required"`
|
||||
JSON eventListResponseEventIdeInstalledPropertiesJSON `json:"-"`
|
||||
}
|
||||
|
||||
// eventListResponseEventIdeInstalledPropertiesJSON contains the JSON metadata for
|
||||
// the struct [EventListResponseEventIdeInstalledProperties]
|
||||
type eventListResponseEventIdeInstalledPropertiesJSON struct {
|
||||
Ide apijson.Field
|
||||
raw string
|
||||
ExtraFields map[string]apijson.Field
|
||||
}
|
||||
|
||||
func (r *EventListResponseEventIdeInstalledProperties) UnmarshalJSON(data []byte) (err error) {
|
||||
return apijson.UnmarshalRoot(data, r)
|
||||
}
|
||||
|
||||
func (r eventListResponseEventIdeInstalledPropertiesJSON) RawJSON() string {
|
||||
return r.raw
|
||||
}
|
||||
|
||||
type EventListResponseEventIdeInstalledType string
|
||||
|
||||
const (
|
||||
EventListResponseEventIdeInstalledTypeIdeInstalled EventListResponseEventIdeInstalledType = "ide.installed"
|
||||
)
|
||||
|
||||
func (r EventListResponseEventIdeInstalledType) IsKnown() bool {
|
||||
switch r {
|
||||
case EventListResponseEventIdeInstalledTypeIdeInstalled:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type EventListResponseType string
|
||||
|
||||
const (
|
||||
EventListResponseTypeInstallationUpdated EventListResponseType = "installation.updated"
|
||||
EventListResponseTypeLspClientDiagnostics EventListResponseType = "lsp.client.diagnostics"
|
||||
EventListResponseTypeLspUpdated EventListResponseType = "lsp.updated"
|
||||
EventListResponseTypeMessageUpdated EventListResponseType = "message.updated"
|
||||
EventListResponseTypeMessageRemoved EventListResponseType = "message.removed"
|
||||
EventListResponseTypeMessagePartUpdated EventListResponseType = "message.part.updated"
|
||||
|
|
@ -1465,12 +1446,11 @@ const (
|
|||
EventListResponseTypeSessionDeleted EventListResponseType = "session.deleted"
|
||||
EventListResponseTypeSessionError EventListResponseType = "session.error"
|
||||
EventListResponseTypeServerConnected EventListResponseType = "server.connected"
|
||||
EventListResponseTypeIdeInstalled EventListResponseType = "ide.installed"
|
||||
)
|
||||
|
||||
func (r EventListResponseType) IsKnown() bool {
|
||||
switch r {
|
||||
case EventListResponseTypeInstallationUpdated, EventListResponseTypeLspClientDiagnostics, EventListResponseTypeMessageUpdated, EventListResponseTypeMessageRemoved, EventListResponseTypeMessagePartUpdated, EventListResponseTypeMessagePartRemoved, EventListResponseTypeSessionCompacted, EventListResponseTypePermissionUpdated, EventListResponseTypePermissionReplied, EventListResponseTypeFileEdited, EventListResponseTypeFileWatcherUpdated, EventListResponseTypeTodoUpdated, EventListResponseTypeSessionIdle, EventListResponseTypeSessionUpdated, EventListResponseTypeSessionDeleted, EventListResponseTypeSessionError, EventListResponseTypeServerConnected, EventListResponseTypeIdeInstalled:
|
||||
case EventListResponseTypeInstallationUpdated, EventListResponseTypeLspClientDiagnostics, EventListResponseTypeLspUpdated, EventListResponseTypeMessageUpdated, EventListResponseTypeMessageRemoved, EventListResponseTypeMessagePartUpdated, EventListResponseTypeMessagePartRemoved, EventListResponseTypeSessionCompacted, EventListResponseTypePermissionUpdated, EventListResponseTypePermissionReplied, EventListResponseTypeFileEdited, EventListResponseTypeFileWatcherUpdated, EventListResponseTypeTodoUpdated, EventListResponseTypeSessionIdle, EventListResponseTypeSessionUpdated, EventListResponseTypeSessionDeleted, EventListResponseTypeSessionError, EventListResponseTypeServerConnected:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
|
|
|
|||
41
session.go
41
session.go
|
|
@ -373,6 +373,7 @@ type AssistantMessage struct {
|
|||
Time AssistantMessageTime `json:"time,required"`
|
||||
Tokens AssistantMessageTokens `json:"tokens,required"`
|
||||
Error AssistantMessageError `json:"error"`
|
||||
Finish string `json:"finish"`
|
||||
Summary bool `json:"summary"`
|
||||
JSON assistantMessageJSON `json:"-"`
|
||||
}
|
||||
|
|
@ -392,6 +393,7 @@ type assistantMessageJSON struct {
|
|||
Time apijson.Field
|
||||
Tokens apijson.Field
|
||||
Error apijson.Field
|
||||
Finish apijson.Field
|
||||
Summary apijson.Field
|
||||
raw string
|
||||
ExtraFields map[string]apijson.Field
|
||||
|
|
@ -919,6 +921,7 @@ type Message struct {
|
|||
Cost float64 `json:"cost"`
|
||||
// This field can have the runtime type of [AssistantMessageError].
|
||||
Error interface{} `json:"error"`
|
||||
Finish string `json:"finish"`
|
||||
Mode string `json:"mode"`
|
||||
ModelID string `json:"modelID"`
|
||||
// This field can have the runtime type of [AssistantMessagePath].
|
||||
|
|
@ -941,6 +944,7 @@ type messageJSON struct {
|
|||
Time apijson.Field
|
||||
Cost apijson.Field
|
||||
Error apijson.Field
|
||||
Finish apijson.Field
|
||||
Mode apijson.Field
|
||||
ModelID apijson.Field
|
||||
Path apijson.Field
|
||||
|
|
@ -1871,13 +1875,16 @@ func (r toolPartJSON) RawJSON() string {
|
|||
func (r ToolPart) implementsPart() {}
|
||||
|
||||
type ToolPartState struct {
|
||||
// This field can have the runtime type of [map[string]interface{}].
|
||||
Input interface{} `json:"input,required"`
|
||||
Status ToolPartStateStatus `json:"status,required"`
|
||||
Error string `json:"error"`
|
||||
// This field can have the runtime type of [interface{}], [map[string]interface{}].
|
||||
Input interface{} `json:"input"`
|
||||
// This field can have the runtime type of [[]FilePart].
|
||||
Attachments interface{} `json:"attachments"`
|
||||
Error string `json:"error"`
|
||||
// This field can have the runtime type of [map[string]interface{}].
|
||||
Metadata interface{} `json:"metadata"`
|
||||
Output string `json:"output"`
|
||||
Raw string `json:"raw"`
|
||||
// This field can have the runtime type of [ToolStateRunningTime],
|
||||
// [ToolStateCompletedTime], [ToolStateErrorTime].
|
||||
Time interface{} `json:"time"`
|
||||
|
|
@ -1888,11 +1895,13 @@ type ToolPartState struct {
|
|||
|
||||
// toolPartStateJSON contains the JSON metadata for the struct [ToolPartState]
|
||||
type toolPartStateJSON struct {
|
||||
Status apijson.Field
|
||||
Error apijson.Field
|
||||
Input apijson.Field
|
||||
Status apijson.Field
|
||||
Attachments apijson.Field
|
||||
Error apijson.Field
|
||||
Metadata apijson.Field
|
||||
Output apijson.Field
|
||||
Raw apijson.Field
|
||||
Time apijson.Field
|
||||
Title apijson.Field
|
||||
raw string
|
||||
|
|
@ -1982,13 +1991,14 @@ func (r ToolPartType) IsKnown() bool {
|
|||
}
|
||||
|
||||
type ToolStateCompleted struct {
|
||||
Input map[string]interface{} `json:"input,required"`
|
||||
Metadata map[string]interface{} `json:"metadata,required"`
|
||||
Output string `json:"output,required"`
|
||||
Status ToolStateCompletedStatus `json:"status,required"`
|
||||
Time ToolStateCompletedTime `json:"time,required"`
|
||||
Title string `json:"title,required"`
|
||||
JSON toolStateCompletedJSON `json:"-"`
|
||||
Input map[string]interface{} `json:"input,required"`
|
||||
Metadata map[string]interface{} `json:"metadata,required"`
|
||||
Output string `json:"output,required"`
|
||||
Status ToolStateCompletedStatus `json:"status,required"`
|
||||
Time ToolStateCompletedTime `json:"time,required"`
|
||||
Title string `json:"title,required"`
|
||||
Attachments []FilePart `json:"attachments"`
|
||||
JSON toolStateCompletedJSON `json:"-"`
|
||||
}
|
||||
|
||||
// toolStateCompletedJSON contains the JSON metadata for the struct
|
||||
|
|
@ -2000,6 +2010,7 @@ type toolStateCompletedJSON struct {
|
|||
Status apijson.Field
|
||||
Time apijson.Field
|
||||
Title apijson.Field
|
||||
Attachments apijson.Field
|
||||
raw string
|
||||
ExtraFields map[string]apijson.Field
|
||||
}
|
||||
|
|
@ -2121,6 +2132,8 @@ func (r toolStateErrorTimeJSON) RawJSON() string {
|
|||
}
|
||||
|
||||
type ToolStatePending struct {
|
||||
Input map[string]interface{} `json:"input,required"`
|
||||
Raw string `json:"raw,required"`
|
||||
Status ToolStatePendingStatus `json:"status,required"`
|
||||
JSON toolStatePendingJSON `json:"-"`
|
||||
}
|
||||
|
|
@ -2128,6 +2141,8 @@ type ToolStatePending struct {
|
|||
// toolStatePendingJSON contains the JSON metadata for the struct
|
||||
// [ToolStatePending]
|
||||
type toolStatePendingJSON struct {
|
||||
Input apijson.Field
|
||||
Raw apijson.Field
|
||||
Status apijson.Field
|
||||
raw string
|
||||
ExtraFields map[string]apijson.Field
|
||||
|
|
@ -2158,7 +2173,7 @@ func (r ToolStatePendingStatus) IsKnown() bool {
|
|||
}
|
||||
|
||||
type ToolStateRunning struct {
|
||||
Input interface{} `json:"input,required"`
|
||||
Input map[string]interface{} `json:"input,required"`
|
||||
Status ToolStateRunningStatus `json:"status,required"`
|
||||
Time ToolStateRunningTime `json:"time,required"`
|
||||
Metadata map[string]interface{} `json:"metadata"`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue