wip: tui api

This commit is contained in:
Dax Raad
2025-07-22 12:14:14 -04:00
parent 01f8d3b05d
commit 5aafab118f
13 changed files with 127 additions and 414 deletions

View File

@@ -52,7 +52,6 @@ type EventListResponse struct {
// [EventListResponseEventPermissionUpdatedProperties],
// [EventListResponseEventFileEditedProperties],
// [EventListResponseEventInstallationUpdatedProperties],
// [EventListResponseEventIdeInstalledProperties],
// [EventListResponseEventMessageUpdatedProperties],
// [EventListResponseEventMessageRemovedProperties],
// [EventListResponseEventMessagePartUpdatedProperties],
@@ -61,7 +60,8 @@ type EventListResponse struct {
// [EventListResponseEventSessionDeletedProperties],
// [EventListResponseEventSessionIdleProperties],
// [EventListResponseEventSessionErrorProperties],
// [EventListResponseEventFileWatcherUpdatedProperties].
// [EventListResponseEventFileWatcherUpdatedProperties],
// [EventListResponseEventIdeInstalledProperties].
Properties interface{} `json:"properties,required"`
Type EventListResponseType `json:"type,required"`
JSON eventListResponseJSON `json:"-"`
@@ -97,13 +97,13 @@ func (r *EventListResponse) UnmarshalJSON(data []byte) (err error) {
// [EventListResponseEventLspClientDiagnostics],
// [EventListResponseEventPermissionUpdated], [EventListResponseEventFileEdited],
// [EventListResponseEventInstallationUpdated],
// [EventListResponseEventIdeInstalled],
// [EventListResponseEventMessageUpdated], [EventListResponseEventMessageRemoved],
// [EventListResponseEventMessagePartUpdated],
// [EventListResponseEventStorageWrite], [EventListResponseEventSessionUpdated],
// [EventListResponseEventSessionDeleted], [EventListResponseEventSessionIdle],
// [EventListResponseEventSessionError],
// [EventListResponseEventFileWatcherUpdated].
// [EventListResponseEventFileWatcherUpdated],
// [EventListResponseEventIdeInstalled].
func (r EventListResponse) AsUnion() EventListResponseUnion {
return r.union
}
@@ -111,13 +111,12 @@ func (r EventListResponse) AsUnion() EventListResponseUnion {
// Union satisfied by [EventListResponseEventLspClientDiagnostics],
// [EventListResponseEventPermissionUpdated], [EventListResponseEventFileEdited],
// [EventListResponseEventInstallationUpdated],
// [EventListResponseEventIdeInstalled],
// [EventListResponseEventMessageUpdated], [EventListResponseEventMessageRemoved],
// [EventListResponseEventMessagePartUpdated],
// [EventListResponseEventStorageWrite], [EventListResponseEventSessionUpdated],
// [EventListResponseEventSessionDeleted], [EventListResponseEventSessionIdle],
// [EventListResponseEventSessionError] or
// [EventListResponseEventFileWatcherUpdated].
// [EventListResponseEventSessionError], [EventListResponseEventFileWatcherUpdated]
// or [EventListResponseEventIdeInstalled].
type EventListResponseUnion interface {
implementsEventListResponse()
}
@@ -146,11 +145,6 @@ func init() {
Type: reflect.TypeOf(EventListResponseEventInstallationUpdated{}),
DiscriminatorValue: "installation.updated",
},
apijson.UnionVariant{
TypeFilter: gjson.JSON,
Type: reflect.TypeOf(EventListResponseEventIdeInstalled{}),
DiscriminatorValue: "ide.installed",
},
apijson.UnionVariant{
TypeFilter: gjson.JSON,
Type: reflect.TypeOf(EventListResponseEventMessageUpdated{}),
@@ -196,6 +190,11 @@ func init() {
Type: reflect.TypeOf(EventListResponseEventFileWatcherUpdated{}),
DiscriminatorValue: "file.watcher.updated",
},
apijson.UnionVariant{
TypeFilter: gjson.JSON,
Type: reflect.TypeOf(EventListResponseEventIdeInstalled{}),
DiscriminatorValue: "ide.installed",
},
)
}
@@ -470,66 +469,6 @@ func (r EventListResponseEventInstallationUpdatedType) 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 EventListResponseEventMessageUpdated struct {
Properties EventListResponseEventMessageUpdatedProperties `json:"properties,required"`
Type EventListResponseEventMessageUpdatedType `json:"type,required"`
@@ -1227,6 +1166,66 @@ func (r EventListResponseEventFileWatcherUpdatedType) 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 (
@@ -1234,7 +1233,6 @@ const (
EventListResponseTypePermissionUpdated EventListResponseType = "permission.updated"
EventListResponseTypeFileEdited EventListResponseType = "file.edited"
EventListResponseTypeInstallationUpdated EventListResponseType = "installation.updated"
EventListResponseTypeIdeInstalled EventListResponseType = "ide.installed"
EventListResponseTypeMessageUpdated EventListResponseType = "message.updated"
EventListResponseTypeMessageRemoved EventListResponseType = "message.removed"
EventListResponseTypeMessagePartUpdated EventListResponseType = "message.part.updated"
@@ -1244,11 +1242,12 @@ const (
EventListResponseTypeSessionIdle EventListResponseType = "session.idle"
EventListResponseTypeSessionError EventListResponseType = "session.error"
EventListResponseTypeFileWatcherUpdated EventListResponseType = "file.watcher.updated"
EventListResponseTypeIdeInstalled EventListResponseType = "ide.installed"
)
func (r EventListResponseType) IsKnown() bool {
switch r {
case EventListResponseTypeLspClientDiagnostics, EventListResponseTypePermissionUpdated, EventListResponseTypeFileEdited, EventListResponseTypeInstallationUpdated, EventListResponseTypeIdeInstalled, EventListResponseTypeMessageUpdated, EventListResponseTypeMessageRemoved, EventListResponseTypeMessagePartUpdated, EventListResponseTypeStorageWrite, EventListResponseTypeSessionUpdated, EventListResponseTypeSessionDeleted, EventListResponseTypeSessionIdle, EventListResponseTypeSessionError, EventListResponseTypeFileWatcherUpdated:
case EventListResponseTypeLspClientDiagnostics, EventListResponseTypePermissionUpdated, EventListResponseTypeFileEdited, EventListResponseTypeInstallationUpdated, EventListResponseTypeMessageUpdated, EventListResponseTypeMessageRemoved, EventListResponseTypeMessagePartUpdated, EventListResponseTypeStorageWrite, EventListResponseTypeSessionUpdated, EventListResponseTypeSessionDeleted, EventListResponseTypeSessionIdle, EventListResponseTypeSessionError, EventListResponseTypeFileWatcherUpdated, EventListResponseTypeIdeInstalled:
return true
}
return false