-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodels.go
More file actions
81 lines (63 loc) · 2.23 KB
/
models.go
File metadata and controls
81 lines (63 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package devtui
import (
"context"
"github.com/tinywasm/unixid"
"sync"
"sync/atomic"
"github.com/charmbracelet/bubbles/viewport"
tea "github.com/charmbracelet/bubbletea"
)
// GetLogsArgs defines arguments for the app_get_logs tool.
// ormc:formonly
type GetLogsArgs struct {
Section string `input:"text"`
}
// ActionArgs defines arguments for the tinywasm/action method.
// ormc:formonly
type ActionArgs struct {
Key string `input:"text"`
Value string `input:"text" json:",omitempty"`
}
// DevTUI mantiene el estado de la aplicación
type DevTUI struct {
*TuiConfig
*tuiStyle
apiKey string // stored from TuiConfig.APIKey
id *unixid.UnixID
ready bool
viewport viewport.Model
focused bool // is the app focused
TabSections []*tabSection // represent sections in the tui
activeTab int // current tab index
editModeActivated bool // global flag to edit config
shortcutRegistry *ShortcutRegistry // NEW: Global shortcut key registry
currentTime string
tabContentsChan chan tabContent
tea *tea.Program
testMode bool // private: only used in tests to enable synchronous behavior
// MCP integration: separate logger for MCP tool execution
mcpLogger func(message ...any) // injected by mcpserve via SetLog()
cursorVisible bool // for blinking effect
isShuttingDown atomic.Bool
sseCancel context.CancelFunc // cancels SSE HTTP request context
sseWg sync.WaitGroup // tracks SSE goroutine
}
type TuiConfig struct {
AppName string // app name eg: "MyApp"
AppVersion string // app version eg: "v1.0.0"
Debug bool // NEW: Enable debug mode for unfiltered logs
TestMode bool // Set to true for synchronous execution in tests
/*// *ColorPalette style for the TUI
// if nil it will use default style:
type ColorPalette struct {
Foreground string // eg: #F4F4F4
Background string // eg: #000000
Primary string // eg: #FF6600
Secondary string // eg: #666666
}*/
Color *ColorPalette
Logger func(messages ...any) // function to write log error
ClientMode bool // true if it should listen to SSE
ClientURL string // e.g. http://localhost:3030/logs
APIKey string // Bearer token for secured daemon; set by app, empty = open/local
}