wip: undo properly remove messages from UI
This commit is contained in:
@@ -190,6 +190,12 @@ func (m *messagesComponent) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
if msg.Properties.Part.SessionID == m.app.Session.ID {
|
||||
cmds = append(cmds, m.renderView())
|
||||
}
|
||||
case opencode.EventListResponseEventMessagePartRemoved:
|
||||
if msg.Properties.SessionID == m.app.Session.ID {
|
||||
// Clear the cache when a part is removed to ensure proper re-rendering
|
||||
m.cache.Clear()
|
||||
cmds = append(cmds, m.renderView())
|
||||
}
|
||||
case renderCompleteMsg:
|
||||
m.partCount = msg.partCount
|
||||
m.lineCount = msg.lineCount
|
||||
|
||||
@@ -402,6 +402,58 @@ func (a Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
a.app.Messages[messageIndex] = message
|
||||
}
|
||||
}
|
||||
case opencode.EventListResponseEventMessagePartRemoved:
|
||||
slog.Info("message part removed", "session", msg.Properties.SessionID, "message", msg.Properties.MessageID, "part", msg.Properties.PartID)
|
||||
if msg.Properties.SessionID == a.app.Session.ID {
|
||||
messageIndex := slices.IndexFunc(a.app.Messages, func(m app.Message) bool {
|
||||
switch casted := m.Info.(type) {
|
||||
case opencode.UserMessage:
|
||||
return casted.ID == msg.Properties.MessageID
|
||||
case opencode.AssistantMessage:
|
||||
return casted.ID == msg.Properties.MessageID
|
||||
}
|
||||
return false
|
||||
})
|
||||
if messageIndex > -1 {
|
||||
message := a.app.Messages[messageIndex]
|
||||
partIndex := slices.IndexFunc(message.Parts, func(p opencode.PartUnion) bool {
|
||||
switch casted := p.(type) {
|
||||
case opencode.TextPart:
|
||||
return casted.ID == msg.Properties.PartID
|
||||
case opencode.FilePart:
|
||||
return casted.ID == msg.Properties.PartID
|
||||
case opencode.ToolPart:
|
||||
return casted.ID == msg.Properties.PartID
|
||||
case opencode.StepStartPart:
|
||||
return casted.ID == msg.Properties.PartID
|
||||
case opencode.StepFinishPart:
|
||||
return casted.ID == msg.Properties.PartID
|
||||
}
|
||||
return false
|
||||
})
|
||||
if partIndex > -1 {
|
||||
// Remove the part at partIndex
|
||||
message.Parts = append(message.Parts[:partIndex], message.Parts[partIndex+1:]...)
|
||||
a.app.Messages[messageIndex] = message
|
||||
}
|
||||
}
|
||||
}
|
||||
case opencode.EventListResponseEventMessageRemoved:
|
||||
slog.Info("message removed", "session", msg.Properties.SessionID, "message", msg.Properties.MessageID)
|
||||
if msg.Properties.SessionID == a.app.Session.ID {
|
||||
messageIndex := slices.IndexFunc(a.app.Messages, func(m app.Message) bool {
|
||||
switch casted := m.Info.(type) {
|
||||
case opencode.UserMessage:
|
||||
return casted.ID == msg.Properties.MessageID
|
||||
case opencode.AssistantMessage:
|
||||
return casted.ID == msg.Properties.MessageID
|
||||
}
|
||||
return false
|
||||
})
|
||||
if messageIndex > -1 {
|
||||
a.app.Messages = append(a.app.Messages[:messageIndex], a.app.Messages[messageIndex+1:]...)
|
||||
}
|
||||
}
|
||||
case opencode.EventListResponseEventMessageUpdated:
|
||||
if msg.Properties.Info.SessionID == a.app.Session.ID {
|
||||
matchIndex := slices.IndexFunc(a.app.Messages, func(m app.Message) bool {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
configured_endpoints: 26
|
||||
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/opencode%2Fopencode-5748199af356c3243a46a466e73b5d0bab7eaa0c56895e1d0f903d637f61d0bb.yml
|
||||
openapi_spec_hash: c04f6b6be54b05d9b1283c24e870163b
|
||||
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/opencode%2Fopencode-62d8fccba4eb8dc3a80434e0849eab3352e49fb96a718bb7b6d17ed8e582b716.yml
|
||||
openapi_spec_hash: 4ff9376cf9634e91731e63fe482ea532
|
||||
config_hash: 1ae82c93499b9f0b9ba828b8919f9cb3
|
||||
|
||||
@@ -36,14 +36,14 @@ Methods:
|
||||
|
||||
Response Types:
|
||||
|
||||
- <a href="https://pkg.go.dev/github.com/sst/opencode-sdk-go">opencode</a>.<a href="https://pkg.go.dev/github.com/sst/opencode-sdk-go#Match">Match</a>
|
||||
- <a href="https://pkg.go.dev/github.com/sst/opencode-sdk-go">opencode</a>.<a href="https://pkg.go.dev/github.com/sst/opencode-sdk-go#Symbol">Symbol</a>
|
||||
- <a href="https://pkg.go.dev/github.com/sst/opencode-sdk-go">opencode</a>.<a href="https://pkg.go.dev/github.com/sst/opencode-sdk-go#FindTextResponse">FindTextResponse</a>
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="get /find/file">client.Find.<a href="https://pkg.go.dev/github.com/sst/opencode-sdk-go#FindService.Files">Files</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, query <a href="https://pkg.go.dev/github.com/sst/opencode-sdk-go">opencode</a>.<a href="https://pkg.go.dev/github.com/sst/opencode-sdk-go#FindFilesParams">FindFilesParams</a>) ([]<a href="https://pkg.go.dev/builtin#string">string</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
|
||||
- <code title="get /find/symbol">client.Find.<a href="https://pkg.go.dev/github.com/sst/opencode-sdk-go#FindService.Symbols">Symbols</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, query <a href="https://pkg.go.dev/github.com/sst/opencode-sdk-go">opencode</a>.<a href="https://pkg.go.dev/github.com/sst/opencode-sdk-go#FindSymbolsParams">FindSymbolsParams</a>) ([]<a href="https://pkg.go.dev/github.com/sst/opencode-sdk-go">opencode</a>.<a href="https://pkg.go.dev/github.com/sst/opencode-sdk-go#Symbol">Symbol</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
|
||||
- <code title="get /find">client.Find.<a href="https://pkg.go.dev/github.com/sst/opencode-sdk-go#FindService.Text">Text</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, query <a href="https://pkg.go.dev/github.com/sst/opencode-sdk-go">opencode</a>.<a href="https://pkg.go.dev/github.com/sst/opencode-sdk-go#FindTextParams">FindTextParams</a>) ([]<a href="https://pkg.go.dev/github.com/sst/opencode-sdk-go">opencode</a>.<a href="https://pkg.go.dev/github.com/sst/opencode-sdk-go#Match">Match</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
|
||||
- <code title="get /find">client.Find.<a href="https://pkg.go.dev/github.com/sst/opencode-sdk-go#FindService.Text">Text</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, query <a href="https://pkg.go.dev/github.com/sst/opencode-sdk-go">opencode</a>.<a href="https://pkg.go.dev/github.com/sst/opencode-sdk-go#FindTextParams">FindTextParams</a>) ([]<a href="https://pkg.go.dev/github.com/sst/opencode-sdk-go">opencode</a>.<a href="https://pkg.go.dev/github.com/sst/opencode-sdk-go#FindTextResponse">FindTextResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
|
||||
|
||||
# File
|
||||
|
||||
|
||||
@@ -146,11 +146,12 @@ func (r appTimeJSON) RawJSON() string {
|
||||
}
|
||||
|
||||
type Mode struct {
|
||||
Name string `json:"name,required"`
|
||||
Tools map[string]bool `json:"tools,required"`
|
||||
Model ModeModel `json:"model"`
|
||||
Prompt string `json:"prompt"`
|
||||
JSON modeJSON `json:"-"`
|
||||
Name string `json:"name,required"`
|
||||
Tools map[string]bool `json:"tools,required"`
|
||||
Model ModeModel `json:"model"`
|
||||
Prompt string `json:"prompt"`
|
||||
Temperature float64 `json:"temperature"`
|
||||
JSON modeJSON `json:"-"`
|
||||
}
|
||||
|
||||
// modeJSON contains the JSON metadata for the struct [Mode]
|
||||
@@ -159,6 +160,7 @@ type modeJSON struct {
|
||||
Tools apijson.Field
|
||||
Model apijson.Field
|
||||
Prompt apijson.Field
|
||||
Temperature apijson.Field
|
||||
raw string
|
||||
ExtraFields map[string]apijson.Field
|
||||
}
|
||||
|
||||
@@ -43,6 +43,8 @@ func (r *ConfigService) Get(ctx context.Context, opts ...option.RequestOption) (
|
||||
type Config struct {
|
||||
// JSON schema reference for configuration validation
|
||||
Schema string `json:"$schema"`
|
||||
// Modes configuration, see https://opencode.ai/docs/modes
|
||||
Agent ConfigAgent `json:"agent"`
|
||||
// @deprecated Use 'share' field instead. Share newly created sessions
|
||||
// automatically
|
||||
Autoshare bool `json:"autoshare"`
|
||||
@@ -81,6 +83,7 @@ type Config struct {
|
||||
// configJSON contains the JSON metadata for the struct [Config]
|
||||
type configJSON struct {
|
||||
Schema apijson.Field
|
||||
Agent apijson.Field
|
||||
Autoshare apijson.Field
|
||||
Autoupdate apijson.Field
|
||||
DisabledProviders apijson.Field
|
||||
@@ -108,6 +111,50 @@ func (r configJSON) RawJSON() string {
|
||||
return r.raw
|
||||
}
|
||||
|
||||
// Modes configuration, see https://opencode.ai/docs/modes
|
||||
type ConfigAgent struct {
|
||||
General ConfigAgentGeneral `json:"general"`
|
||||
ExtraFields map[string]ConfigAgent `json:"-,extras"`
|
||||
JSON configAgentJSON `json:"-"`
|
||||
}
|
||||
|
||||
// configAgentJSON contains the JSON metadata for the struct [ConfigAgent]
|
||||
type configAgentJSON struct {
|
||||
General apijson.Field
|
||||
raw string
|
||||
ExtraFields map[string]apijson.Field
|
||||
}
|
||||
|
||||
func (r *ConfigAgent) UnmarshalJSON(data []byte) (err error) {
|
||||
return apijson.UnmarshalRoot(data, r)
|
||||
}
|
||||
|
||||
func (r configAgentJSON) RawJSON() string {
|
||||
return r.raw
|
||||
}
|
||||
|
||||
type ConfigAgentGeneral struct {
|
||||
Description string `json:"description,required"`
|
||||
JSON configAgentGeneralJSON `json:"-"`
|
||||
ModeConfig
|
||||
}
|
||||
|
||||
// configAgentGeneralJSON contains the JSON metadata for the struct
|
||||
// [ConfigAgentGeneral]
|
||||
type configAgentGeneralJSON struct {
|
||||
Description apijson.Field
|
||||
raw string
|
||||
ExtraFields map[string]apijson.Field
|
||||
}
|
||||
|
||||
func (r *ConfigAgentGeneral) UnmarshalJSON(data []byte) (err error) {
|
||||
return apijson.UnmarshalRoot(data, r)
|
||||
}
|
||||
|
||||
func (r configAgentGeneralJSON) RawJSON() string {
|
||||
return r.raw
|
||||
}
|
||||
|
||||
type ConfigExperimental struct {
|
||||
Hook ConfigExperimentalHook `json:"hook"`
|
||||
JSON configExperimentalJSON `json:"-"`
|
||||
@@ -716,16 +763,20 @@ func (r McpRemoteConfigType) IsKnown() bool {
|
||||
}
|
||||
|
||||
type ModeConfig struct {
|
||||
Model string `json:"model"`
|
||||
Prompt string `json:"prompt"`
|
||||
Tools map[string]bool `json:"tools"`
|
||||
JSON modeConfigJSON `json:"-"`
|
||||
Disable bool `json:"disable"`
|
||||
Model string `json:"model"`
|
||||
Prompt string `json:"prompt"`
|
||||
Temperature float64 `json:"temperature"`
|
||||
Tools map[string]bool `json:"tools"`
|
||||
JSON modeConfigJSON `json:"-"`
|
||||
}
|
||||
|
||||
// modeConfigJSON contains the JSON metadata for the struct [ModeConfig]
|
||||
type modeConfigJSON struct {
|
||||
Disable apijson.Field
|
||||
Model apijson.Field
|
||||
Prompt apijson.Field
|
||||
Temperature apijson.Field
|
||||
Tools apijson.Field
|
||||
raw string
|
||||
ExtraFields map[string]apijson.Field
|
||||
|
||||
@@ -48,19 +48,19 @@ func (r *EventService) ListStreaming(ctx context.Context, opts ...option.Request
|
||||
|
||||
type EventListResponse struct {
|
||||
// This field can have the runtime type of
|
||||
// [EventListResponseEventLspClientDiagnosticsProperties],
|
||||
// [EventListResponseEventPermissionUpdatedProperties],
|
||||
// [EventListResponseEventFileEditedProperties],
|
||||
// [EventListResponseEventInstallationUpdatedProperties],
|
||||
// [EventListResponseEventLspClientDiagnosticsProperties],
|
||||
// [EventListResponseEventMessageUpdatedProperties],
|
||||
// [EventListResponseEventMessageRemovedProperties],
|
||||
// [EventListResponseEventMessagePartUpdatedProperties],
|
||||
// [EventListResponseEventMessagePartRemovedProperties],
|
||||
// [EventListResponseEventStorageWriteProperties],
|
||||
// [EventListResponseEventPermissionUpdatedProperties],
|
||||
// [EventListResponseEventFileEditedProperties],
|
||||
// [EventListResponseEventSessionUpdatedProperties],
|
||||
// [EventListResponseEventSessionDeletedProperties],
|
||||
// [EventListResponseEventSessionIdleProperties],
|
||||
// [EventListResponseEventSessionErrorProperties],
|
||||
// [EventListResponseEventSessionErrorProperties], [interface{}],
|
||||
// [EventListResponseEventFileWatcherUpdatedProperties],
|
||||
// [EventListResponseEventIdeInstalledProperties].
|
||||
Properties interface{} `json:"properties,required"`
|
||||
@@ -95,31 +95,32 @@ func (r *EventListResponse) UnmarshalJSON(data []byte) (err error) {
|
||||
// specific types for more type safety.
|
||||
//
|
||||
// Possible runtime types of the union are
|
||||
// [EventListResponseEventLspClientDiagnostics],
|
||||
// [EventListResponseEventPermissionUpdated], [EventListResponseEventFileEdited],
|
||||
// [EventListResponseEventInstallationUpdated],
|
||||
// [EventListResponseEventLspClientDiagnostics],
|
||||
// [EventListResponseEventMessageUpdated], [EventListResponseEventMessageRemoved],
|
||||
// [EventListResponseEventMessagePartUpdated],
|
||||
// [EventListResponseEventMessagePartRemoved],
|
||||
// [EventListResponseEventStorageWrite], [EventListResponseEventSessionUpdated],
|
||||
// [EventListResponseEventStorageWrite], [EventListResponseEventPermissionUpdated],
|
||||
// [EventListResponseEventFileEdited], [EventListResponseEventSessionUpdated],
|
||||
// [EventListResponseEventSessionDeleted], [EventListResponseEventSessionIdle],
|
||||
// [EventListResponseEventSessionError],
|
||||
// [EventListResponseEventSessionError], [EventListResponseEventServerConnected],
|
||||
// [EventListResponseEventFileWatcherUpdated],
|
||||
// [EventListResponseEventIdeInstalled].
|
||||
func (r EventListResponse) AsUnion() EventListResponseUnion {
|
||||
return r.union
|
||||
}
|
||||
|
||||
// Union satisfied by [EventListResponseEventLspClientDiagnostics],
|
||||
// [EventListResponseEventPermissionUpdated], [EventListResponseEventFileEdited],
|
||||
// [EventListResponseEventInstallationUpdated],
|
||||
// Union satisfied by [EventListResponseEventInstallationUpdated],
|
||||
// [EventListResponseEventLspClientDiagnostics],
|
||||
// [EventListResponseEventMessageUpdated], [EventListResponseEventMessageRemoved],
|
||||
// [EventListResponseEventMessagePartUpdated],
|
||||
// [EventListResponseEventMessagePartRemoved],
|
||||
// [EventListResponseEventStorageWrite], [EventListResponseEventSessionUpdated],
|
||||
// [EventListResponseEventStorageWrite], [EventListResponseEventPermissionUpdated],
|
||||
// [EventListResponseEventFileEdited], [EventListResponseEventSessionUpdated],
|
||||
// [EventListResponseEventSessionDeleted], [EventListResponseEventSessionIdle],
|
||||
// [EventListResponseEventSessionError], [EventListResponseEventFileWatcherUpdated]
|
||||
// or [EventListResponseEventIdeInstalled].
|
||||
// [EventListResponseEventSessionError], [EventListResponseEventServerConnected],
|
||||
// [EventListResponseEventFileWatcherUpdated] or
|
||||
// [EventListResponseEventIdeInstalled].
|
||||
type EventListResponseUnion interface {
|
||||
implementsEventListResponse()
|
||||
}
|
||||
@@ -128,26 +129,16 @@ func init() {
|
||||
apijson.RegisterUnion(
|
||||
reflect.TypeOf((*EventListResponseUnion)(nil)).Elem(),
|
||||
"type",
|
||||
apijson.UnionVariant{
|
||||
TypeFilter: gjson.JSON,
|
||||
Type: reflect.TypeOf(EventListResponseEventLspClientDiagnostics{}),
|
||||
DiscriminatorValue: "lsp.client.diagnostics",
|
||||
},
|
||||
apijson.UnionVariant{
|
||||
TypeFilter: gjson.JSON,
|
||||
Type: reflect.TypeOf(EventListResponseEventPermissionUpdated{}),
|
||||
DiscriminatorValue: "permission.updated",
|
||||
},
|
||||
apijson.UnionVariant{
|
||||
TypeFilter: gjson.JSON,
|
||||
Type: reflect.TypeOf(EventListResponseEventFileEdited{}),
|
||||
DiscriminatorValue: "file.edited",
|
||||
},
|
||||
apijson.UnionVariant{
|
||||
TypeFilter: gjson.JSON,
|
||||
Type: reflect.TypeOf(EventListResponseEventInstallationUpdated{}),
|
||||
DiscriminatorValue: "installation.updated",
|
||||
},
|
||||
apijson.UnionVariant{
|
||||
TypeFilter: gjson.JSON,
|
||||
Type: reflect.TypeOf(EventListResponseEventLspClientDiagnostics{}),
|
||||
DiscriminatorValue: "lsp.client.diagnostics",
|
||||
},
|
||||
apijson.UnionVariant{
|
||||
TypeFilter: gjson.JSON,
|
||||
Type: reflect.TypeOf(EventListResponseEventMessageUpdated{}),
|
||||
@@ -173,6 +164,16 @@ func init() {
|
||||
Type: reflect.TypeOf(EventListResponseEventStorageWrite{}),
|
||||
DiscriminatorValue: "storage.write",
|
||||
},
|
||||
apijson.UnionVariant{
|
||||
TypeFilter: gjson.JSON,
|
||||
Type: reflect.TypeOf(EventListResponseEventPermissionUpdated{}),
|
||||
DiscriminatorValue: "permission.updated",
|
||||
},
|
||||
apijson.UnionVariant{
|
||||
TypeFilter: gjson.JSON,
|
||||
Type: reflect.TypeOf(EventListResponseEventFileEdited{}),
|
||||
DiscriminatorValue: "file.edited",
|
||||
},
|
||||
apijson.UnionVariant{
|
||||
TypeFilter: gjson.JSON,
|
||||
Type: reflect.TypeOf(EventListResponseEventSessionUpdated{}),
|
||||
@@ -193,6 +194,11 @@ func init() {
|
||||
Type: reflect.TypeOf(EventListResponseEventSessionError{}),
|
||||
DiscriminatorValue: "session.error",
|
||||
},
|
||||
apijson.UnionVariant{
|
||||
TypeFilter: gjson.JSON,
|
||||
Type: reflect.TypeOf(EventListResponseEventServerConnected{}),
|
||||
DiscriminatorValue: "server.connected",
|
||||
},
|
||||
apijson.UnionVariant{
|
||||
TypeFilter: gjson.JSON,
|
||||
Type: reflect.TypeOf(EventListResponseEventFileWatcherUpdated{}),
|
||||
@@ -206,6 +212,66 @@ func init() {
|
||||
)
|
||||
}
|
||||
|
||||
type EventListResponseEventInstallationUpdated struct {
|
||||
Properties EventListResponseEventInstallationUpdatedProperties `json:"properties,required"`
|
||||
Type EventListResponseEventInstallationUpdatedType `json:"type,required"`
|
||||
JSON eventListResponseEventInstallationUpdatedJSON `json:"-"`
|
||||
}
|
||||
|
||||
// eventListResponseEventInstallationUpdatedJSON contains the JSON metadata for the
|
||||
// struct [EventListResponseEventInstallationUpdated]
|
||||
type eventListResponseEventInstallationUpdatedJSON struct {
|
||||
Properties apijson.Field
|
||||
Type apijson.Field
|
||||
raw string
|
||||
ExtraFields map[string]apijson.Field
|
||||
}
|
||||
|
||||
func (r *EventListResponseEventInstallationUpdated) UnmarshalJSON(data []byte) (err error) {
|
||||
return apijson.UnmarshalRoot(data, r)
|
||||
}
|
||||
|
||||
func (r eventListResponseEventInstallationUpdatedJSON) RawJSON() string {
|
||||
return r.raw
|
||||
}
|
||||
|
||||
func (r EventListResponseEventInstallationUpdated) implementsEventListResponse() {}
|
||||
|
||||
type EventListResponseEventInstallationUpdatedProperties struct {
|
||||
Version string `json:"version,required"`
|
||||
JSON eventListResponseEventInstallationUpdatedPropertiesJSON `json:"-"`
|
||||
}
|
||||
|
||||
// eventListResponseEventInstallationUpdatedPropertiesJSON contains the JSON
|
||||
// metadata for the struct [EventListResponseEventInstallationUpdatedProperties]
|
||||
type eventListResponseEventInstallationUpdatedPropertiesJSON struct {
|
||||
Version apijson.Field
|
||||
raw string
|
||||
ExtraFields map[string]apijson.Field
|
||||
}
|
||||
|
||||
func (r *EventListResponseEventInstallationUpdatedProperties) UnmarshalJSON(data []byte) (err error) {
|
||||
return apijson.UnmarshalRoot(data, r)
|
||||
}
|
||||
|
||||
func (r eventListResponseEventInstallationUpdatedPropertiesJSON) RawJSON() string {
|
||||
return r.raw
|
||||
}
|
||||
|
||||
type EventListResponseEventInstallationUpdatedType string
|
||||
|
||||
const (
|
||||
EventListResponseEventInstallationUpdatedTypeInstallationUpdated EventListResponseEventInstallationUpdatedType = "installation.updated"
|
||||
)
|
||||
|
||||
func (r EventListResponseEventInstallationUpdatedType) IsKnown() bool {
|
||||
switch r {
|
||||
case EventListResponseEventInstallationUpdatedTypeInstallationUpdated:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type EventListResponseEventLspClientDiagnostics struct {
|
||||
Properties EventListResponseEventLspClientDiagnosticsProperties `json:"properties,required"`
|
||||
Type EventListResponseEventLspClientDiagnosticsType `json:"type,required"`
|
||||
@@ -268,215 +334,6 @@ func (r EventListResponseEventLspClientDiagnosticsType) IsKnown() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
type EventListResponseEventPermissionUpdated struct {
|
||||
Properties EventListResponseEventPermissionUpdatedProperties `json:"properties,required"`
|
||||
Type EventListResponseEventPermissionUpdatedType `json:"type,required"`
|
||||
JSON eventListResponseEventPermissionUpdatedJSON `json:"-"`
|
||||
}
|
||||
|
||||
// eventListResponseEventPermissionUpdatedJSON contains the JSON metadata for the
|
||||
// struct [EventListResponseEventPermissionUpdated]
|
||||
type eventListResponseEventPermissionUpdatedJSON struct {
|
||||
Properties apijson.Field
|
||||
Type apijson.Field
|
||||
raw string
|
||||
ExtraFields map[string]apijson.Field
|
||||
}
|
||||
|
||||
func (r *EventListResponseEventPermissionUpdated) UnmarshalJSON(data []byte) (err error) {
|
||||
return apijson.UnmarshalRoot(data, r)
|
||||
}
|
||||
|
||||
func (r eventListResponseEventPermissionUpdatedJSON) RawJSON() string {
|
||||
return r.raw
|
||||
}
|
||||
|
||||
func (r EventListResponseEventPermissionUpdated) implementsEventListResponse() {}
|
||||
|
||||
type EventListResponseEventPermissionUpdatedProperties struct {
|
||||
ID string `json:"id,required"`
|
||||
Metadata map[string]interface{} `json:"metadata,required"`
|
||||
SessionID string `json:"sessionID,required"`
|
||||
Time EventListResponseEventPermissionUpdatedPropertiesTime `json:"time,required"`
|
||||
Title string `json:"title,required"`
|
||||
JSON eventListResponseEventPermissionUpdatedPropertiesJSON `json:"-"`
|
||||
}
|
||||
|
||||
// eventListResponseEventPermissionUpdatedPropertiesJSON contains the JSON metadata
|
||||
// for the struct [EventListResponseEventPermissionUpdatedProperties]
|
||||
type eventListResponseEventPermissionUpdatedPropertiesJSON struct {
|
||||
ID apijson.Field
|
||||
Metadata apijson.Field
|
||||
SessionID apijson.Field
|
||||
Time apijson.Field
|
||||
Title apijson.Field
|
||||
raw string
|
||||
ExtraFields map[string]apijson.Field
|
||||
}
|
||||
|
||||
func (r *EventListResponseEventPermissionUpdatedProperties) UnmarshalJSON(data []byte) (err error) {
|
||||
return apijson.UnmarshalRoot(data, r)
|
||||
}
|
||||
|
||||
func (r eventListResponseEventPermissionUpdatedPropertiesJSON) RawJSON() string {
|
||||
return r.raw
|
||||
}
|
||||
|
||||
type EventListResponseEventPermissionUpdatedPropertiesTime struct {
|
||||
Created float64 `json:"created,required"`
|
||||
JSON eventListResponseEventPermissionUpdatedPropertiesTimeJSON `json:"-"`
|
||||
}
|
||||
|
||||
// eventListResponseEventPermissionUpdatedPropertiesTimeJSON contains the JSON
|
||||
// metadata for the struct [EventListResponseEventPermissionUpdatedPropertiesTime]
|
||||
type eventListResponseEventPermissionUpdatedPropertiesTimeJSON struct {
|
||||
Created apijson.Field
|
||||
raw string
|
||||
ExtraFields map[string]apijson.Field
|
||||
}
|
||||
|
||||
func (r *EventListResponseEventPermissionUpdatedPropertiesTime) UnmarshalJSON(data []byte) (err error) {
|
||||
return apijson.UnmarshalRoot(data, r)
|
||||
}
|
||||
|
||||
func (r eventListResponseEventPermissionUpdatedPropertiesTimeJSON) RawJSON() string {
|
||||
return r.raw
|
||||
}
|
||||
|
||||
type EventListResponseEventPermissionUpdatedType string
|
||||
|
||||
const (
|
||||
EventListResponseEventPermissionUpdatedTypePermissionUpdated EventListResponseEventPermissionUpdatedType = "permission.updated"
|
||||
)
|
||||
|
||||
func (r EventListResponseEventPermissionUpdatedType) IsKnown() bool {
|
||||
switch r {
|
||||
case EventListResponseEventPermissionUpdatedTypePermissionUpdated:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type EventListResponseEventFileEdited struct {
|
||||
Properties EventListResponseEventFileEditedProperties `json:"properties,required"`
|
||||
Type EventListResponseEventFileEditedType `json:"type,required"`
|
||||
JSON eventListResponseEventFileEditedJSON `json:"-"`
|
||||
}
|
||||
|
||||
// eventListResponseEventFileEditedJSON contains the JSON metadata for the struct
|
||||
// [EventListResponseEventFileEdited]
|
||||
type eventListResponseEventFileEditedJSON struct {
|
||||
Properties apijson.Field
|
||||
Type apijson.Field
|
||||
raw string
|
||||
ExtraFields map[string]apijson.Field
|
||||
}
|
||||
|
||||
func (r *EventListResponseEventFileEdited) UnmarshalJSON(data []byte) (err error) {
|
||||
return apijson.UnmarshalRoot(data, r)
|
||||
}
|
||||
|
||||
func (r eventListResponseEventFileEditedJSON) RawJSON() string {
|
||||
return r.raw
|
||||
}
|
||||
|
||||
func (r EventListResponseEventFileEdited) implementsEventListResponse() {}
|
||||
|
||||
type EventListResponseEventFileEditedProperties struct {
|
||||
File string `json:"file,required"`
|
||||
JSON eventListResponseEventFileEditedPropertiesJSON `json:"-"`
|
||||
}
|
||||
|
||||
// eventListResponseEventFileEditedPropertiesJSON contains the JSON metadata for
|
||||
// the struct [EventListResponseEventFileEditedProperties]
|
||||
type eventListResponseEventFileEditedPropertiesJSON struct {
|
||||
File apijson.Field
|
||||
raw string
|
||||
ExtraFields map[string]apijson.Field
|
||||
}
|
||||
|
||||
func (r *EventListResponseEventFileEditedProperties) UnmarshalJSON(data []byte) (err error) {
|
||||
return apijson.UnmarshalRoot(data, r)
|
||||
}
|
||||
|
||||
func (r eventListResponseEventFileEditedPropertiesJSON) RawJSON() string {
|
||||
return r.raw
|
||||
}
|
||||
|
||||
type EventListResponseEventFileEditedType string
|
||||
|
||||
const (
|
||||
EventListResponseEventFileEditedTypeFileEdited EventListResponseEventFileEditedType = "file.edited"
|
||||
)
|
||||
|
||||
func (r EventListResponseEventFileEditedType) IsKnown() bool {
|
||||
switch r {
|
||||
case EventListResponseEventFileEditedTypeFileEdited:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type EventListResponseEventInstallationUpdated struct {
|
||||
Properties EventListResponseEventInstallationUpdatedProperties `json:"properties,required"`
|
||||
Type EventListResponseEventInstallationUpdatedType `json:"type,required"`
|
||||
JSON eventListResponseEventInstallationUpdatedJSON `json:"-"`
|
||||
}
|
||||
|
||||
// eventListResponseEventInstallationUpdatedJSON contains the JSON metadata for the
|
||||
// struct [EventListResponseEventInstallationUpdated]
|
||||
type eventListResponseEventInstallationUpdatedJSON struct {
|
||||
Properties apijson.Field
|
||||
Type apijson.Field
|
||||
raw string
|
||||
ExtraFields map[string]apijson.Field
|
||||
}
|
||||
|
||||
func (r *EventListResponseEventInstallationUpdated) UnmarshalJSON(data []byte) (err error) {
|
||||
return apijson.UnmarshalRoot(data, r)
|
||||
}
|
||||
|
||||
func (r eventListResponseEventInstallationUpdatedJSON) RawJSON() string {
|
||||
return r.raw
|
||||
}
|
||||
|
||||
func (r EventListResponseEventInstallationUpdated) implementsEventListResponse() {}
|
||||
|
||||
type EventListResponseEventInstallationUpdatedProperties struct {
|
||||
Version string `json:"version,required"`
|
||||
JSON eventListResponseEventInstallationUpdatedPropertiesJSON `json:"-"`
|
||||
}
|
||||
|
||||
// eventListResponseEventInstallationUpdatedPropertiesJSON contains the JSON
|
||||
// metadata for the struct [EventListResponseEventInstallationUpdatedProperties]
|
||||
type eventListResponseEventInstallationUpdatedPropertiesJSON struct {
|
||||
Version apijson.Field
|
||||
raw string
|
||||
ExtraFields map[string]apijson.Field
|
||||
}
|
||||
|
||||
func (r *EventListResponseEventInstallationUpdatedProperties) UnmarshalJSON(data []byte) (err error) {
|
||||
return apijson.UnmarshalRoot(data, r)
|
||||
}
|
||||
|
||||
func (r eventListResponseEventInstallationUpdatedPropertiesJSON) RawJSON() string {
|
||||
return r.raw
|
||||
}
|
||||
|
||||
type EventListResponseEventInstallationUpdatedType string
|
||||
|
||||
const (
|
||||
EventListResponseEventInstallationUpdatedTypeInstallationUpdated EventListResponseEventInstallationUpdatedType = "installation.updated"
|
||||
)
|
||||
|
||||
func (r EventListResponseEventInstallationUpdatedType) IsKnown() bool {
|
||||
switch r {
|
||||
case EventListResponseEventInstallationUpdatedTypeInstallationUpdated:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type EventListResponseEventMessageUpdated struct {
|
||||
Properties EventListResponseEventMessageUpdatedProperties `json:"properties,required"`
|
||||
Type EventListResponseEventMessageUpdatedType `json:"type,required"`
|
||||
@@ -687,6 +544,7 @@ func (r EventListResponseEventMessagePartRemoved) implementsEventListResponse()
|
||||
type EventListResponseEventMessagePartRemovedProperties struct {
|
||||
MessageID string `json:"messageID,required"`
|
||||
PartID string `json:"partID,required"`
|
||||
SessionID string `json:"sessionID,required"`
|
||||
JSON eventListResponseEventMessagePartRemovedPropertiesJSON `json:"-"`
|
||||
}
|
||||
|
||||
@@ -695,6 +553,7 @@ type EventListResponseEventMessagePartRemovedProperties struct {
|
||||
type eventListResponseEventMessagePartRemovedPropertiesJSON struct {
|
||||
MessageID apijson.Field
|
||||
PartID apijson.Field
|
||||
SessionID apijson.Field
|
||||
raw string
|
||||
ExtraFields map[string]apijson.Field
|
||||
}
|
||||
@@ -783,6 +642,155 @@ func (r EventListResponseEventStorageWriteType) IsKnown() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
type EventListResponseEventPermissionUpdated struct {
|
||||
Properties EventListResponseEventPermissionUpdatedProperties `json:"properties,required"`
|
||||
Type EventListResponseEventPermissionUpdatedType `json:"type,required"`
|
||||
JSON eventListResponseEventPermissionUpdatedJSON `json:"-"`
|
||||
}
|
||||
|
||||
// eventListResponseEventPermissionUpdatedJSON contains the JSON metadata for the
|
||||
// struct [EventListResponseEventPermissionUpdated]
|
||||
type eventListResponseEventPermissionUpdatedJSON struct {
|
||||
Properties apijson.Field
|
||||
Type apijson.Field
|
||||
raw string
|
||||
ExtraFields map[string]apijson.Field
|
||||
}
|
||||
|
||||
func (r *EventListResponseEventPermissionUpdated) UnmarshalJSON(data []byte) (err error) {
|
||||
return apijson.UnmarshalRoot(data, r)
|
||||
}
|
||||
|
||||
func (r eventListResponseEventPermissionUpdatedJSON) RawJSON() string {
|
||||
return r.raw
|
||||
}
|
||||
|
||||
func (r EventListResponseEventPermissionUpdated) implementsEventListResponse() {}
|
||||
|
||||
type EventListResponseEventPermissionUpdatedProperties struct {
|
||||
ID string `json:"id,required"`
|
||||
Metadata map[string]interface{} `json:"metadata,required"`
|
||||
SessionID string `json:"sessionID,required"`
|
||||
Time EventListResponseEventPermissionUpdatedPropertiesTime `json:"time,required"`
|
||||
Title string `json:"title,required"`
|
||||
JSON eventListResponseEventPermissionUpdatedPropertiesJSON `json:"-"`
|
||||
}
|
||||
|
||||
// eventListResponseEventPermissionUpdatedPropertiesJSON contains the JSON metadata
|
||||
// for the struct [EventListResponseEventPermissionUpdatedProperties]
|
||||
type eventListResponseEventPermissionUpdatedPropertiesJSON struct {
|
||||
ID apijson.Field
|
||||
Metadata apijson.Field
|
||||
SessionID apijson.Field
|
||||
Time apijson.Field
|
||||
Title apijson.Field
|
||||
raw string
|
||||
ExtraFields map[string]apijson.Field
|
||||
}
|
||||
|
||||
func (r *EventListResponseEventPermissionUpdatedProperties) UnmarshalJSON(data []byte) (err error) {
|
||||
return apijson.UnmarshalRoot(data, r)
|
||||
}
|
||||
|
||||
func (r eventListResponseEventPermissionUpdatedPropertiesJSON) RawJSON() string {
|
||||
return r.raw
|
||||
}
|
||||
|
||||
type EventListResponseEventPermissionUpdatedPropertiesTime struct {
|
||||
Created float64 `json:"created,required"`
|
||||
JSON eventListResponseEventPermissionUpdatedPropertiesTimeJSON `json:"-"`
|
||||
}
|
||||
|
||||
// eventListResponseEventPermissionUpdatedPropertiesTimeJSON contains the JSON
|
||||
// metadata for the struct [EventListResponseEventPermissionUpdatedPropertiesTime]
|
||||
type eventListResponseEventPermissionUpdatedPropertiesTimeJSON struct {
|
||||
Created apijson.Field
|
||||
raw string
|
||||
ExtraFields map[string]apijson.Field
|
||||
}
|
||||
|
||||
func (r *EventListResponseEventPermissionUpdatedPropertiesTime) UnmarshalJSON(data []byte) (err error) {
|
||||
return apijson.UnmarshalRoot(data, r)
|
||||
}
|
||||
|
||||
func (r eventListResponseEventPermissionUpdatedPropertiesTimeJSON) RawJSON() string {
|
||||
return r.raw
|
||||
}
|
||||
|
||||
type EventListResponseEventPermissionUpdatedType string
|
||||
|
||||
const (
|
||||
EventListResponseEventPermissionUpdatedTypePermissionUpdated EventListResponseEventPermissionUpdatedType = "permission.updated"
|
||||
)
|
||||
|
||||
func (r EventListResponseEventPermissionUpdatedType) IsKnown() bool {
|
||||
switch r {
|
||||
case EventListResponseEventPermissionUpdatedTypePermissionUpdated:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type EventListResponseEventFileEdited struct {
|
||||
Properties EventListResponseEventFileEditedProperties `json:"properties,required"`
|
||||
Type EventListResponseEventFileEditedType `json:"type,required"`
|
||||
JSON eventListResponseEventFileEditedJSON `json:"-"`
|
||||
}
|
||||
|
||||
// eventListResponseEventFileEditedJSON contains the JSON metadata for the struct
|
||||
// [EventListResponseEventFileEdited]
|
||||
type eventListResponseEventFileEditedJSON struct {
|
||||
Properties apijson.Field
|
||||
Type apijson.Field
|
||||
raw string
|
||||
ExtraFields map[string]apijson.Field
|
||||
}
|
||||
|
||||
func (r *EventListResponseEventFileEdited) UnmarshalJSON(data []byte) (err error) {
|
||||
return apijson.UnmarshalRoot(data, r)
|
||||
}
|
||||
|
||||
func (r eventListResponseEventFileEditedJSON) RawJSON() string {
|
||||
return r.raw
|
||||
}
|
||||
|
||||
func (r EventListResponseEventFileEdited) implementsEventListResponse() {}
|
||||
|
||||
type EventListResponseEventFileEditedProperties struct {
|
||||
File string `json:"file,required"`
|
||||
JSON eventListResponseEventFileEditedPropertiesJSON `json:"-"`
|
||||
}
|
||||
|
||||
// eventListResponseEventFileEditedPropertiesJSON contains the JSON metadata for
|
||||
// the struct [EventListResponseEventFileEditedProperties]
|
||||
type eventListResponseEventFileEditedPropertiesJSON struct {
|
||||
File apijson.Field
|
||||
raw string
|
||||
ExtraFields map[string]apijson.Field
|
||||
}
|
||||
|
||||
func (r *EventListResponseEventFileEditedProperties) UnmarshalJSON(data []byte) (err error) {
|
||||
return apijson.UnmarshalRoot(data, r)
|
||||
}
|
||||
|
||||
func (r eventListResponseEventFileEditedPropertiesJSON) RawJSON() string {
|
||||
return r.raw
|
||||
}
|
||||
|
||||
type EventListResponseEventFileEditedType string
|
||||
|
||||
const (
|
||||
EventListResponseEventFileEditedTypeFileEdited EventListResponseEventFileEditedType = "file.edited"
|
||||
)
|
||||
|
||||
func (r EventListResponseEventFileEditedType) IsKnown() bool {
|
||||
switch r {
|
||||
case EventListResponseEventFileEditedTypeFileEdited:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type EventListResponseEventSessionUpdated struct {
|
||||
Properties EventListResponseEventSessionUpdatedProperties `json:"properties,required"`
|
||||
Type EventListResponseEventSessionUpdatedType `json:"type,required"`
|
||||
@@ -1159,6 +1167,45 @@ func (r EventListResponseEventSessionErrorType) IsKnown() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
type EventListResponseEventServerConnected struct {
|
||||
Properties interface{} `json:"properties,required"`
|
||||
Type EventListResponseEventServerConnectedType `json:"type,required"`
|
||||
JSON eventListResponseEventServerConnectedJSON `json:"-"`
|
||||
}
|
||||
|
||||
// eventListResponseEventServerConnectedJSON contains the JSON metadata for the
|
||||
// struct [EventListResponseEventServerConnected]
|
||||
type eventListResponseEventServerConnectedJSON struct {
|
||||
Properties apijson.Field
|
||||
Type apijson.Field
|
||||
raw string
|
||||
ExtraFields map[string]apijson.Field
|
||||
}
|
||||
|
||||
func (r *EventListResponseEventServerConnected) UnmarshalJSON(data []byte) (err error) {
|
||||
return apijson.UnmarshalRoot(data, r)
|
||||
}
|
||||
|
||||
func (r eventListResponseEventServerConnectedJSON) RawJSON() string {
|
||||
return r.raw
|
||||
}
|
||||
|
||||
func (r EventListResponseEventServerConnected) implementsEventListResponse() {}
|
||||
|
||||
type EventListResponseEventServerConnectedType string
|
||||
|
||||
const (
|
||||
EventListResponseEventServerConnectedTypeServerConnected EventListResponseEventServerConnectedType = "server.connected"
|
||||
)
|
||||
|
||||
func (r EventListResponseEventServerConnectedType) IsKnown() bool {
|
||||
switch r {
|
||||
case EventListResponseEventServerConnectedTypeServerConnected:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type EventListResponseEventFileWatcherUpdated struct {
|
||||
Properties EventListResponseEventFileWatcherUpdatedProperties `json:"properties,required"`
|
||||
Type EventListResponseEventFileWatcherUpdatedType `json:"type,required"`
|
||||
@@ -1299,26 +1346,27 @@ func (r EventListResponseEventIdeInstalledType) IsKnown() bool {
|
||||
type EventListResponseType string
|
||||
|
||||
const (
|
||||
EventListResponseTypeLspClientDiagnostics EventListResponseType = "lsp.client.diagnostics"
|
||||
EventListResponseTypePermissionUpdated EventListResponseType = "permission.updated"
|
||||
EventListResponseTypeFileEdited EventListResponseType = "file.edited"
|
||||
EventListResponseTypeInstallationUpdated EventListResponseType = "installation.updated"
|
||||
EventListResponseTypeLspClientDiagnostics EventListResponseType = "lsp.client.diagnostics"
|
||||
EventListResponseTypeMessageUpdated EventListResponseType = "message.updated"
|
||||
EventListResponseTypeMessageRemoved EventListResponseType = "message.removed"
|
||||
EventListResponseTypeMessagePartUpdated EventListResponseType = "message.part.updated"
|
||||
EventListResponseTypeMessagePartRemoved EventListResponseType = "message.part.removed"
|
||||
EventListResponseTypeStorageWrite EventListResponseType = "storage.write"
|
||||
EventListResponseTypePermissionUpdated EventListResponseType = "permission.updated"
|
||||
EventListResponseTypeFileEdited EventListResponseType = "file.edited"
|
||||
EventListResponseTypeSessionUpdated EventListResponseType = "session.updated"
|
||||
EventListResponseTypeSessionDeleted EventListResponseType = "session.deleted"
|
||||
EventListResponseTypeSessionIdle EventListResponseType = "session.idle"
|
||||
EventListResponseTypeSessionError EventListResponseType = "session.error"
|
||||
EventListResponseTypeServerConnected EventListResponseType = "server.connected"
|
||||
EventListResponseTypeFileWatcherUpdated EventListResponseType = "file.watcher.updated"
|
||||
EventListResponseTypeIdeInstalled EventListResponseType = "ide.installed"
|
||||
)
|
||||
|
||||
func (r EventListResponseType) IsKnown() bool {
|
||||
switch r {
|
||||
case EventListResponseTypeLspClientDiagnostics, EventListResponseTypePermissionUpdated, EventListResponseTypeFileEdited, EventListResponseTypeInstallationUpdated, EventListResponseTypeMessageUpdated, EventListResponseTypeMessageRemoved, EventListResponseTypeMessagePartUpdated, EventListResponseTypeMessagePartRemoved, EventListResponseTypeStorageWrite, EventListResponseTypeSessionUpdated, EventListResponseTypeSessionDeleted, EventListResponseTypeSessionIdle, EventListResponseTypeSessionError, EventListResponseTypeFileWatcherUpdated, EventListResponseTypeIdeInstalled:
|
||||
case EventListResponseTypeInstallationUpdated, EventListResponseTypeLspClientDiagnostics, EventListResponseTypeMessageUpdated, EventListResponseTypeMessageRemoved, EventListResponseTypeMessagePartUpdated, EventListResponseTypeMessagePartRemoved, EventListResponseTypeStorageWrite, EventListResponseTypePermissionUpdated, EventListResponseTypeFileEdited, EventListResponseTypeSessionUpdated, EventListResponseTypeSessionDeleted, EventListResponseTypeSessionIdle, EventListResponseTypeSessionError, EventListResponseTypeServerConnected, EventListResponseTypeFileWatcherUpdated, EventListResponseTypeIdeInstalled:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
|
||||
@@ -50,126 +50,13 @@ func (r *FindService) Symbols(ctx context.Context, query FindSymbolsParams, opts
|
||||
}
|
||||
|
||||
// Find text in files
|
||||
func (r *FindService) Text(ctx context.Context, query FindTextParams, opts ...option.RequestOption) (res *[]Match, err error) {
|
||||
func (r *FindService) Text(ctx context.Context, query FindTextParams, opts ...option.RequestOption) (res *[]FindTextResponse, err error) {
|
||||
opts = append(r.Options[:], opts...)
|
||||
path := "find"
|
||||
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...)
|
||||
return
|
||||
}
|
||||
|
||||
type Match struct {
|
||||
AbsoluteOffset float64 `json:"absolute_offset,required"`
|
||||
LineNumber float64 `json:"line_number,required"`
|
||||
Lines MatchLines `json:"lines,required"`
|
||||
Path MatchPath `json:"path,required"`
|
||||
Submatches []MatchSubmatch `json:"submatches,required"`
|
||||
JSON matchJSON `json:"-"`
|
||||
}
|
||||
|
||||
// matchJSON contains the JSON metadata for the struct [Match]
|
||||
type matchJSON struct {
|
||||
AbsoluteOffset apijson.Field
|
||||
LineNumber apijson.Field
|
||||
Lines apijson.Field
|
||||
Path apijson.Field
|
||||
Submatches apijson.Field
|
||||
raw string
|
||||
ExtraFields map[string]apijson.Field
|
||||
}
|
||||
|
||||
func (r *Match) UnmarshalJSON(data []byte) (err error) {
|
||||
return apijson.UnmarshalRoot(data, r)
|
||||
}
|
||||
|
||||
func (r matchJSON) RawJSON() string {
|
||||
return r.raw
|
||||
}
|
||||
|
||||
type MatchLines struct {
|
||||
Text string `json:"text,required"`
|
||||
JSON matchLinesJSON `json:"-"`
|
||||
}
|
||||
|
||||
// matchLinesJSON contains the JSON metadata for the struct [MatchLines]
|
||||
type matchLinesJSON struct {
|
||||
Text apijson.Field
|
||||
raw string
|
||||
ExtraFields map[string]apijson.Field
|
||||
}
|
||||
|
||||
func (r *MatchLines) UnmarshalJSON(data []byte) (err error) {
|
||||
return apijson.UnmarshalRoot(data, r)
|
||||
}
|
||||
|
||||
func (r matchLinesJSON) RawJSON() string {
|
||||
return r.raw
|
||||
}
|
||||
|
||||
type MatchPath struct {
|
||||
Text string `json:"text,required"`
|
||||
JSON matchPathJSON `json:"-"`
|
||||
}
|
||||
|
||||
// matchPathJSON contains the JSON metadata for the struct [MatchPath]
|
||||
type matchPathJSON struct {
|
||||
Text apijson.Field
|
||||
raw string
|
||||
ExtraFields map[string]apijson.Field
|
||||
}
|
||||
|
||||
func (r *MatchPath) UnmarshalJSON(data []byte) (err error) {
|
||||
return apijson.UnmarshalRoot(data, r)
|
||||
}
|
||||
|
||||
func (r matchPathJSON) RawJSON() string {
|
||||
return r.raw
|
||||
}
|
||||
|
||||
type MatchSubmatch struct {
|
||||
End float64 `json:"end,required"`
|
||||
Match MatchSubmatchesMatch `json:"match,required"`
|
||||
Start float64 `json:"start,required"`
|
||||
JSON matchSubmatchJSON `json:"-"`
|
||||
}
|
||||
|
||||
// matchSubmatchJSON contains the JSON metadata for the struct [MatchSubmatch]
|
||||
type matchSubmatchJSON struct {
|
||||
End apijson.Field
|
||||
Match apijson.Field
|
||||
Start apijson.Field
|
||||
raw string
|
||||
ExtraFields map[string]apijson.Field
|
||||
}
|
||||
|
||||
func (r *MatchSubmatch) UnmarshalJSON(data []byte) (err error) {
|
||||
return apijson.UnmarshalRoot(data, r)
|
||||
}
|
||||
|
||||
func (r matchSubmatchJSON) RawJSON() string {
|
||||
return r.raw
|
||||
}
|
||||
|
||||
type MatchSubmatchesMatch struct {
|
||||
Text string `json:"text,required"`
|
||||
JSON matchSubmatchesMatchJSON `json:"-"`
|
||||
}
|
||||
|
||||
// matchSubmatchesMatchJSON contains the JSON metadata for the struct
|
||||
// [MatchSubmatchesMatch]
|
||||
type matchSubmatchesMatchJSON struct {
|
||||
Text apijson.Field
|
||||
raw string
|
||||
ExtraFields map[string]apijson.Field
|
||||
}
|
||||
|
||||
func (r *MatchSubmatchesMatch) UnmarshalJSON(data []byte) (err error) {
|
||||
return apijson.UnmarshalRoot(data, r)
|
||||
}
|
||||
|
||||
func (r matchSubmatchesMatchJSON) RawJSON() string {
|
||||
return r.raw
|
||||
}
|
||||
|
||||
type Symbol struct {
|
||||
Kind float64 `json:"kind,required"`
|
||||
Location SymbolLocation `json:"location,required"`
|
||||
@@ -285,6 +172,123 @@ func (r symbolLocationRangeStartJSON) RawJSON() string {
|
||||
return r.raw
|
||||
}
|
||||
|
||||
type FindTextResponse struct {
|
||||
AbsoluteOffset float64 `json:"absolute_offset,required"`
|
||||
LineNumber float64 `json:"line_number,required"`
|
||||
Lines FindTextResponseLines `json:"lines,required"`
|
||||
Path FindTextResponsePath `json:"path,required"`
|
||||
Submatches []FindTextResponseSubmatch `json:"submatches,required"`
|
||||
JSON findTextResponseJSON `json:"-"`
|
||||
}
|
||||
|
||||
// findTextResponseJSON contains the JSON metadata for the struct
|
||||
// [FindTextResponse]
|
||||
type findTextResponseJSON struct {
|
||||
AbsoluteOffset apijson.Field
|
||||
LineNumber apijson.Field
|
||||
Lines apijson.Field
|
||||
Path apijson.Field
|
||||
Submatches apijson.Field
|
||||
raw string
|
||||
ExtraFields map[string]apijson.Field
|
||||
}
|
||||
|
||||
func (r *FindTextResponse) UnmarshalJSON(data []byte) (err error) {
|
||||
return apijson.UnmarshalRoot(data, r)
|
||||
}
|
||||
|
||||
func (r findTextResponseJSON) RawJSON() string {
|
||||
return r.raw
|
||||
}
|
||||
|
||||
type FindTextResponseLines struct {
|
||||
Text string `json:"text,required"`
|
||||
JSON findTextResponseLinesJSON `json:"-"`
|
||||
}
|
||||
|
||||
// findTextResponseLinesJSON contains the JSON metadata for the struct
|
||||
// [FindTextResponseLines]
|
||||
type findTextResponseLinesJSON struct {
|
||||
Text apijson.Field
|
||||
raw string
|
||||
ExtraFields map[string]apijson.Field
|
||||
}
|
||||
|
||||
func (r *FindTextResponseLines) UnmarshalJSON(data []byte) (err error) {
|
||||
return apijson.UnmarshalRoot(data, r)
|
||||
}
|
||||
|
||||
func (r findTextResponseLinesJSON) RawJSON() string {
|
||||
return r.raw
|
||||
}
|
||||
|
||||
type FindTextResponsePath struct {
|
||||
Text string `json:"text,required"`
|
||||
JSON findTextResponsePathJSON `json:"-"`
|
||||
}
|
||||
|
||||
// findTextResponsePathJSON contains the JSON metadata for the struct
|
||||
// [FindTextResponsePath]
|
||||
type findTextResponsePathJSON struct {
|
||||
Text apijson.Field
|
||||
raw string
|
||||
ExtraFields map[string]apijson.Field
|
||||
}
|
||||
|
||||
func (r *FindTextResponsePath) UnmarshalJSON(data []byte) (err error) {
|
||||
return apijson.UnmarshalRoot(data, r)
|
||||
}
|
||||
|
||||
func (r findTextResponsePathJSON) RawJSON() string {
|
||||
return r.raw
|
||||
}
|
||||
|
||||
type FindTextResponseSubmatch struct {
|
||||
End float64 `json:"end,required"`
|
||||
Match FindTextResponseSubmatchesMatch `json:"match,required"`
|
||||
Start float64 `json:"start,required"`
|
||||
JSON findTextResponseSubmatchJSON `json:"-"`
|
||||
}
|
||||
|
||||
// findTextResponseSubmatchJSON contains the JSON metadata for the struct
|
||||
// [FindTextResponseSubmatch]
|
||||
type findTextResponseSubmatchJSON struct {
|
||||
End apijson.Field
|
||||
Match apijson.Field
|
||||
Start apijson.Field
|
||||
raw string
|
||||
ExtraFields map[string]apijson.Field
|
||||
}
|
||||
|
||||
func (r *FindTextResponseSubmatch) UnmarshalJSON(data []byte) (err error) {
|
||||
return apijson.UnmarshalRoot(data, r)
|
||||
}
|
||||
|
||||
func (r findTextResponseSubmatchJSON) RawJSON() string {
|
||||
return r.raw
|
||||
}
|
||||
|
||||
type FindTextResponseSubmatchesMatch struct {
|
||||
Text string `json:"text,required"`
|
||||
JSON findTextResponseSubmatchesMatchJSON `json:"-"`
|
||||
}
|
||||
|
||||
// findTextResponseSubmatchesMatchJSON contains the JSON metadata for the struct
|
||||
// [FindTextResponseSubmatchesMatch]
|
||||
type findTextResponseSubmatchesMatchJSON struct {
|
||||
Text apijson.Field
|
||||
raw string
|
||||
ExtraFields map[string]apijson.Field
|
||||
}
|
||||
|
||||
func (r *FindTextResponseSubmatchesMatch) UnmarshalJSON(data []byte) (err error) {
|
||||
return apijson.UnmarshalRoot(data, r)
|
||||
}
|
||||
|
||||
func (r findTextResponseSubmatchesMatchJSON) RawJSON() string {
|
||||
return r.raw
|
||||
}
|
||||
|
||||
type FindFilesParams struct {
|
||||
Query param.Field[string] `query:"query,required"`
|
||||
}
|
||||
|
||||
@@ -1073,6 +1073,7 @@ func (r sessionTimeJSON) RawJSON() string {
|
||||
|
||||
type SessionRevert struct {
|
||||
MessageID string `json:"messageID,required"`
|
||||
Diff string `json:"diff"`
|
||||
PartID string `json:"partID"`
|
||||
Snapshot string `json:"snapshot"`
|
||||
JSON sessionRevertJSON `json:"-"`
|
||||
@@ -1081,6 +1082,7 @@ type SessionRevert struct {
|
||||
// sessionRevertJSON contains the JSON metadata for the struct [SessionRevert]
|
||||
type sessionRevertJSON struct {
|
||||
MessageID apijson.Field
|
||||
Diff apijson.Field
|
||||
PartID apijson.Field
|
||||
Snapshot apijson.Field
|
||||
raw string
|
||||
@@ -2039,6 +2041,7 @@ type SessionChatParams struct {
|
||||
ProviderID param.Field[string] `json:"providerID,required"`
|
||||
MessageID param.Field[string] `json:"messageID"`
|
||||
Mode param.Field[string] `json:"mode"`
|
||||
System param.Field[string] `json:"system"`
|
||||
Tools param.Field[map[string]bool] `json:"tools"`
|
||||
}
|
||||
|
||||
|
||||
@@ -131,6 +131,7 @@ func TestSessionChatWithOptionalParams(t *testing.T) {
|
||||
ProviderID: opencode.F("providerID"),
|
||||
MessageID: opencode.F("msg"),
|
||||
Mode: opencode.F("mode"),
|
||||
System: opencode.F("system"),
|
||||
Tools: opencode.F(map[string]bool{
|
||||
"foo": true,
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user