-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathconstants.hpp
More file actions
39 lines (31 loc) · 1.42 KB
/
Copy pathconstants.hpp
File metadata and controls
39 lines (31 loc) · 1.42 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
#pragma once
namespace acecode {
namespace constants {
// Token estimation
constexpr int CHARS_PER_TOKEN = 4;
// Output limits
constexpr size_t MAX_BASH_OUTPUT_SIZE = 100 * 1024; // 100KB
constexpr size_t MAX_GLOB_RESULTS = 500;
constexpr size_t MAX_GREP_RESULTS = 200;
// Timeouts
constexpr int DEFAULT_BASH_TIMEOUT_MS = 120000; // 2 minutes
// Daemon / web defaults
// 固定默认端口。用户可通过 config.json 的 web.port 或 daemon --port 覆盖;
// Service 模式下端口被占直接拒启,不 retry。
constexpr int DEFAULT_WEB_PORT = 12399;
constexpr int DEFAULT_HEARTBEAT_INTERVAL_MS = 2000;
constexpr int DEFAULT_HEARTBEAT_TIMEOUT_MS = 15000;
constexpr int TOKEN_BYTES = 32; // raw bytes; url-safe base64 encodes to ~43 chars
// Subdirectories under ~/.acecode/
inline constexpr const char* SUBDIR_RUN = "run";
inline constexpr const char* SUBDIR_LOGS = "logs";
// Runtime files inside ~/.acecode/run/
inline constexpr const char* RUN_FILE_PID = "daemon.pid";
inline constexpr const char* RUN_FILE_PORT = "daemon.port";
inline constexpr const char* RUN_FILE_GUID = "daemon.guid";
inline constexpr const char* RUN_FILE_HEARTBEAT = "heartbeat";
inline constexpr const char* RUN_FILE_TOKEN = "token";
inline constexpr const char* RUN_FILE_DESKTOP_MANAGED = "desktop-managed.json";
inline constexpr const char* RUN_FILE_DESKTOP_OWNER = "desktop-owner.json";
} // namespace constants
} // namespace acecode