ascii-chat
Binary v0.16.50-198-g78f51665f
Library lib/v0.3.2-2240-g78f51665f
Video chat in your terminal
Loading...
Searching...
No Matches
general.c
Go to the documentation of this file.
1
12
13#include <options/registry/common.h>
14
15// ============================================================================
16// GENERAL CATEGORY - General-purpose options
17// ============================================================================
18static const char *g_mcp_transport_values[] = {"http", "stdio", NULL};
19
21 {.long_name = "server",
22 .type = OPTION_TYPE_BOOL,
23 .offset = offsetof(options_t, mcp_server_restricted),
24 .help_text = "Restrict MCP capabilities for cloud deployment (no webcam or caller-selected filesystem paths).",
25 .group = "MCP",
26 .env_var_name = "ASCII_CHAT_SERVER",
27 .mode_bitmask = OPTION_MODE_MCP_SERVER},
28 {.long_name = "downloads-dir",
29 .type = OPTION_TYPE_STRING,
30 .offset = offsetof(options_t, mcp_downloads_dir),
31 .default_value = "",
32 .default_value_size = OPTIONS_BUFF_SIZE,
33 .help_text = "Directory for temporary hosted MCP downloads (default: application data directory).",
34 .group = "MCP",
35 .env_var_name = "ASCII_CHAT_DOWNLOADS_DIR",
36 .mode_bitmask = OPTION_MODE_MCP_SERVER},
37 {.long_name = "downloads-url-prefix",
38 .type = OPTION_TYPE_STRING,
39 .offset = offsetof(options_t, mcp_downloads_url_prefix),
40 .default_value = "",
41 .default_value_size = OPTIONS_BUFF_SIZE,
42 .help_text = "Public HTTP(S) base URL for hosted download links, e.g. https://mcp.example.com.",
43 .group = "MCP",
44 .env_var_name = "ASCII_CHAT_DOWNLOADS_URL_PREFIX",
45 .mode_bitmask = OPTION_MODE_MCP_SERVER},
46 {.long_name = "transport",
47 .type = OPTION_TYPE_STRING,
48 .offset = offsetof(options_t, mcp_transport),
49 .default_value = "stdio",
50 .default_value_size = OPTIONS_BUFF_SIZE,
51 .help_text = "MCP transport: http or stdio (default). --server independently restricts cloud capabilities.",
52 .metadata = {.enum_values = g_mcp_transport_values, .input_type = OPTION_INPUT_ENUM},
53 .group = "MCP",
54 .env_var_name = "ASCII_CHAT_TRANSPORT",
55 .mode_bitmask = OPTION_MODE_MCP_SERVER},
56 {.long_name = "http-origin",
57 .type = OPTION_TYPE_STRING,
58 .offset = offsetof(options_t, http_origin),
59 .default_value = "https://mcp.ascii-chat.com",
60 .default_value_size = OPTIONS_BUFF_SIZE,
61 .help_text = "Allowed browser Origin for MCP HTTP requests.",
62 .group = "MCP",
63 .env_var_name = "ASCII_CHAT_HTTP_ORIGIN",
64 .mode_bitmask = OPTION_MODE_MCP_SERVER},
65 // GENERAL GROUP (binary-level + all modes)
66 {"help",
67 'h',
69 0,
70 NULL,
71 0,
72 "Show this help message and exit.",
73 "GENERAL",
74 NULL,
75 false,
76 NULL,
77 NULL,
78 NULL,
79 false,
80 false,
82 {0},
83 NULL},
84 {"version", 'v', OPTION_TYPE_ACTION, 0, NULL, 0, "Show version information and exit.", "GENERAL", NULL, false, NULL, NULL, NULL, false, false, OPTION_MODE_BINARY, {0}, NULL},
85 {"splash-screen",
86 '\0',
88 offsetof(options_t, splash_screen),
89 &default_splash_value,
90 sizeof(bool),
91 "Enable or disable splash screen with ASCII art. Overrides CLAUDECODE environment variable.",
92 "GENERAL",
93 NULL,
94 false,
95 "ASCII_CHAT_SPLASH_SCREEN",
96 NULL,
97 NULL,
98 false,
99 true, // optional_arg: allows --splash-screen to toggle or --splash-screen=true/false
101 {0},
102 NULL},
103 {"status-screen",
104 '\0',
106 offsetof(options_t, status_screen),
107 &default_status_screen_value,
108 sizeof(bool),
109 "Enable or disable live status screen display. Overrides non-interactive terminal checks.",
110 "GENERAL",
111 NULL,
112 false,
113 "ASCII_CHAT_STATUS_SCREEN",
114 NULL,
115 NULL,
116 false,
117 true, // optional_arg: allows --status-screen to toggle or --status-screen=true/false
119 {0},
120 NULL},
121 {"keepawake",
122 '\0',
124 offsetof(options_t, enable_keepawake),
125 &default_enable_keepawake_value,
126 sizeof(bool),
127 "Explicitly enable system sleep prevention (keepawake mode).",
128 "GENERAL",
129 NULL,
130 false,
131 "ASCII_CHAT_KEEPAWAKE",
132 NULL,
133 NULL,
134 false,
135 false,
137 {0},
138 NULL},
139 {"no-keepawake",
140 '\0',
142 offsetof(options_t, disable_keepawake),
143 &default_disable_keepawake_value,
144 sizeof(bool),
145 "Disable system sleep prevention (allow OS to sleep).",
146 "GENERAL",
147 NULL,
148 false,
149 "ASCII_CHAT_NO_KEEPAWAKE",
150 NULL,
151 NULL,
152 false,
153 false,
155 {0},
156 NULL},
157 {"check-update", '\0', OPTION_TYPE_ACTION, 0, NULL, 0, "Check for updates from GitHub releases and exit.", "GENERAL", NULL, false, NULL, NULL, NULL, false, false, OPTION_MODE_BINARY, {0}, NULL},
158 {"no-check-update",
159 '\0',
161 offsetof(options_t, no_check_update),
162 &default_no_check_update_value,
163 sizeof(bool),
164 "Disable automatic update checks at startup.",
165 "GENERAL",
166 NULL,
167 false,
168 "ASCII_CHAT_NO_CHECK_UPDATE",
169 NULL,
170 NULL,
171 false,
172 false,
174 {0},
175 NULL},
176
@ OPTION_INPUT_ENUM
Choose from fixed set of enum values.
Definition builder.h:187
@ OPTION_TYPE_STRING
String value (–name foo).
Definition builder.h:173
@ OPTION_TYPE_ACTION
Action that executes and may exit (–list-webcams, etc.).
Definition builder.h:176
@ OPTION_TYPE_BOOL
Boolean flag (–flag, no value).
Definition builder.h:171
struct options_state options_t
Immutable, RCU-published snapshot of the application's runtime configuration.
#define OPTIONS_BUFF_SIZE
Buffer size for option string values.
Definition options.h:305
@ OPTION_MODE_ALL
All modes + binary.
Definition options.h:943
@ OPTION_MODE_BINARY
Binary-level options (parsed before mode detection).
Definition options.h:942
@ OPTION_MODE_CLIENT
Client mode (bit 1).
Definition options.h:936
@ OPTION_MODE_DISCOVERY
Discovery mode (bit 4).
Definition options.h:939
@ OPTION_MODE_SERVER
Server mode (bit 0).
Definition options.h:935
@ OPTION_MODE_MIRROR
Mirror mode (bit 2).
Definition options.h:937
@ OPTION_MODE_MCP_SERVER
Definition options.h:940
@ OPTION_MODE_DISCOVERY_SVC
Discovery server mode (bit 3).
Definition options.h:938
const registry_entry_t g_general_entries[]
Definition general.c:20
#define REGISTRY_TERMINATOR()
Initialize a terminator entry (sentinel value for array end) Uses designated initializers to properly...
Registry entry - stores option definition with mode bitmask and metadata.