agent-afk 5.286.2 → 5.287.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/agent/awareness/presence.d.ts +5 -0
  2. package/dist/agent/awareness/presence.peer.d.ts +7 -0
  3. package/dist/agent/peer/envelope.d.ts +18 -0
  4. package/dist/agent/peer/guards.d.ts +18 -0
  5. package/dist/agent/peer/inbound-mode.d.ts +2 -0
  6. package/dist/agent/peer/inbox-store.d.ts +27 -0
  7. package/dist/agent/peer/send.d.ts +18 -0
  8. package/dist/agent/tools/handlers/index.d.ts +2 -1
  9. package/dist/agent/tools/handlers/peer.d.ts +4 -0
  10. package/dist/agent/tools/schemas.d.ts +1 -0
  11. package/dist/agent/tools/schemas.peer.d.ts +4 -0
  12. package/dist/agent/tools/system-prompt.d.ts +2 -1
  13. package/dist/agent/trace/emit.d.ts +2 -1
  14. package/dist/agent/trace/events.d.ts +45 -0
  15. package/dist/agent/trace/index.d.ts +3 -2
  16. package/dist/agent/trace/types.d.ts +16 -1
  17. package/dist/cli/commands/interactive/bootstrap-resume.d.ts +11 -0
  18. package/dist/cli/commands/interactive/bootstrap-sidebands.d.ts +3 -0
  19. package/dist/cli/commands/interactive/footer-painters.d.ts +12 -0
  20. package/dist/cli/commands/interactive/footer-subsystems.d.ts +2 -0
  21. package/dist/cli/commands/interactive/footer-subsystems.peer.d.ts +3 -0
  22. package/dist/cli/commands/interactive/loop-iteration.drain.d.ts +3 -0
  23. package/dist/cli/commands/interactive/loop-iteration.hooks.d.ts +7 -0
  24. package/dist/cli/commands/interactive/loop-iteration.injections.d.ts +6 -0
  25. package/dist/cli/commands/interactive/loop-iteration.shell-branch.d.ts +7 -0
  26. package/dist/cli/commands/interactive/loop-iteration.slash-branch.d.ts +19 -0
  27. package/dist/cli/commands/interactive/loop-iteration.turn-run.d.ts +12 -0
  28. package/dist/cli/commands/interactive/peer-inbox-notifier.d.ts +48 -0
  29. package/dist/cli/commands/interactive/peer-inbox-scan.d.ts +18 -0
  30. package/dist/cli/commands/interactive/peer-inbox-startup-sweep.d.ts +1 -0
  31. package/dist/cli/commands/interactive/shared.d.ts +3 -0
  32. package/dist/cli/commands/trace-event-render.d.ts +8 -0
  33. package/dist/cli/commands/trace-lifecycle-render.d.ts +3 -0
  34. package/dist/cli/commands/trace-peer-format.d.ts +2 -0
  35. package/dist/cli/commands/trace-phase-render.d.ts +2 -0
  36. package/dist/cli/commands/trace-summary-render.d.ts +13 -0
  37. package/dist/cli/commands/trace.d.ts +2 -7
  38. package/dist/cli/slash/commands/inbox.d.ts +4 -0
  39. package/dist/cli/slash/commands/name.d.ts +2 -0
  40. package/dist/cli/slash/commands/peers.d.ts +2 -0
  41. package/dist/cli.mjs +416 -409
  42. package/dist/config/env.auth.d.ts +141 -0
  43. package/dist/config/env.d.ts +72 -49
  44. package/dist/config/env.daemon.d.ts +166 -0
  45. package/dist/config/env.debug.d.ts +162 -0
  46. package/dist/config/env.misc.d.ts +136 -0
  47. package/dist/config/env.model-tiers.d.ts +230 -0
  48. package/dist/config/env.model.d.ts +199 -0
  49. package/dist/config/env.paths.d.ts +42 -0
  50. package/dist/config/env.peer.d.ts +31 -0
  51. package/dist/config/env.telegram.d.ts +77 -0
  52. package/dist/config/env.ui.d.ts +112 -0
  53. package/dist/http-client/scrape-diagnostics.d.ts +2 -0
  54. package/dist/http-client/scrape.d.ts +12 -0
  55. package/dist/index.mjs +158 -156
  56. package/dist/paths.d.ts +1 -0
  57. package/dist/paths.peer.d.ts +2 -0
  58. package/dist/telegram.mjs +199 -197
  59. package/package.json +1 -1
@@ -0,0 +1,141 @@
1
+ export declare const AUTH_ENV_REGISTRY: readonly [{
2
+ readonly name: "AFK_SYSTEM_PROMPT";
3
+ readonly description: "Raw operator-overlay prompt. Highest-priority overlay (over afk.config.json and AFK.md). Appended on top of the framework base (system-prompt.md) under an \"# Operator configuration\" header — it augments, never replaces, the base.";
4
+ readonly type: "string";
5
+ readonly required: false;
6
+ readonly example: "You are a helpful agent.";
7
+ readonly category: "model";
8
+ }, {
9
+ readonly name: "AFK_DUMP_PROMPT";
10
+ readonly description: "Write the resolved system prompt to a file at startup. Accepts a path or 1 for default location.";
11
+ readonly type: "string";
12
+ readonly required: false;
13
+ readonly example: "/tmp/afk-prompt.txt";
14
+ readonly category: "debug";
15
+ }, {
16
+ readonly name: "ANTHROPIC_API_KEY";
17
+ readonly description: "Anthropic API key. Tier-1 credential — overrides keychain OAuth and CLAUDE_CODE_OAUTH_TOKEN.";
18
+ readonly type: "string";
19
+ readonly required: false;
20
+ readonly category: "auth";
21
+ readonly secret: true;
22
+ }, {
23
+ readonly name: "CLAUDE_CODE_OAUTH_TOKEN";
24
+ readonly description: "Claude Code OAuth token. Tier-2 credential — used when ANTHROPIC_API_KEY is unset; falls back to keychain.";
25
+ readonly type: "string";
26
+ readonly required: false;
27
+ readonly category: "auth";
28
+ readonly secret: true;
29
+ }, {
30
+ readonly name: "OPENAI_API_KEY";
31
+ readonly description: "OpenAI API key for the openai-compatible provider (gpt-*, o1*, o3*, o4* models).";
32
+ readonly type: "string";
33
+ readonly required: false;
34
+ readonly category: "auth";
35
+ readonly secret: true;
36
+ }, {
37
+ readonly name: "CODEX_API_KEY";
38
+ readonly description: "Fallback OpenAI API key for the openai-compatible provider, read after OPENAI_API_KEY. Legacy name from the removed @openai/codex-sdk integration — prefer OPENAI_API_KEY.";
39
+ readonly type: "string";
40
+ readonly required: false;
41
+ readonly category: "auth";
42
+ readonly secret: true;
43
+ }, {
44
+ readonly name: "XAI_API_KEY";
45
+ readonly description: "xAI API key for the xai provider (Grok models) in API-key mode. Metered; distinct from SuperGrok / SuperGrok Heavy / X Premium+ OAuth.";
46
+ readonly type: "string";
47
+ readonly required: false;
48
+ readonly category: "auth";
49
+ readonly secret: true;
50
+ }, {
51
+ readonly name: "AFK_XAI_BASE_URL";
52
+ readonly description: "Base URL for xAI API-key mode. Default https://api.x.ai/v1. The OpenAI SDK appends /chat/completions.";
53
+ readonly type: "string";
54
+ readonly required: false;
55
+ readonly example: "https://api.x.ai/v1";
56
+ readonly category: "model";
57
+ }, {
58
+ readonly name: "AFK_XAI_OAUTH_BASE_URL";
59
+ readonly description: "Base URL for xAI SuperGrok / SuperGrok Heavy / X Premium+ OAuth inference. Default https://cli-chat-proxy.grok.com/v1 (subscription path). Some accounts work on https://api.x.ai/v1 with OAuth — override if needed. Distinct from AFK_XAI_BASE_URL (API-key mode).";
60
+ readonly type: "string";
61
+ readonly required: false;
62
+ readonly example: "https://cli-chat-proxy.grok.com/v1";
63
+ readonly category: "model";
64
+ }, {
65
+ readonly name: "AFK_XAI_GROK_CLIENT_VERSION";
66
+ readonly description: "Override the semver sent as x-grok-client-version to the xAI OAuth CLI chat proxy. Use only if the proxy raises its required Grok CLI version before agent-afk is updated; invalid values fall back to the official Grok Build version file or built-in compatible default.";
67
+ readonly type: "string";
68
+ readonly required: false;
69
+ readonly example: "1.0.6";
70
+ readonly category: "model";
71
+ }, {
72
+ readonly name: "AFK_LOCAL_API_KEY";
73
+ readonly description: "Placeholder API key for local Anthropic-compatible servers (vllm-mlx, etc.). Set when AFK_LOCAL_BASE_URL is configured.";
74
+ readonly type: "string";
75
+ readonly required: false;
76
+ readonly default: "local";
77
+ readonly example: "local";
78
+ readonly category: "auth";
79
+ readonly secret: true;
80
+ }, {
81
+ readonly name: "AFK_LOCAL_BASE_URL";
82
+ readonly description: "Base URL for a self-hosted Anthropic-compatible server. When set, routes traffic away from api.anthropic.com.";
83
+ readonly type: "string";
84
+ readonly required: false;
85
+ readonly example: "http://127.0.0.1:8080";
86
+ readonly category: "model";
87
+ }, {
88
+ readonly name: "AFK_OPENAI_BASE_URL";
89
+ readonly description: "Base URL override for the OpenAI-compatible provider. Used for local shims (mlx_lm.server, Ollama, vLLM, LM Studio). The OpenAI SDK appends `/chat/completions` itself — a value ending in `/chat/completions` will be stripped at config-load time with a one-shot warning.";
90
+ readonly type: "string";
91
+ readonly required: false;
92
+ readonly example: "http://127.0.0.1:8000/v1";
93
+ readonly category: "model";
94
+ }, {
95
+ readonly name: "AFK_OPENAI_USE_RESPONSES";
96
+ readonly description: "Opt the OpenAI-compatible provider into the OpenAI Responses API instead of Chat Completions for API-key sessions. Truthy values: 1, true, yes, on. The ChatGPT-subscription OAuth path uses Responses automatically regardless of this flag.";
97
+ readonly type: "boolean";
98
+ readonly required: false;
99
+ readonly example: "1";
100
+ readonly category: "model";
101
+ }, {
102
+ readonly name: "AFK_OPENAI_CHATGPT_OAUTH";
103
+ readonly description: "Use ChatGPT-subscription OAuth credentials from ~/.codex/auth.json (auth_mode: chatgpt) as OpenAI provider auth. Off by default. Set to 1/true/yes/on to enable. READ-ONLY: AFK never refreshes these tokens — re-run codex when the access token expires. Routes requests over the Responses API to the private ChatGPT backend (chatgpt.com/backend-api).";
104
+ readonly type: "boolean";
105
+ readonly required: false;
106
+ readonly example: "1";
107
+ readonly category: "model";
108
+ }, {
109
+ readonly name: "AFK_PROVIDER";
110
+ readonly description: "Force provider selection (anthropic | anthropic-direct | openai | openai-compatible | openai-codex | xai | xai-oauth). Overrides the model-name heuristic. Same surface as the --provider CLI flag; CLI flag wins when both are set.";
111
+ readonly type: "string";
112
+ readonly required: false;
113
+ readonly example: "openai-compatible";
114
+ readonly category: "model";
115
+ }, {
116
+ readonly name: "EXA_API_KEY";
117
+ readonly description: "Exa (exa.ai) search API key, enabling web_scrape search mode. Free tier (20k requests/month) available at https://exa.ai. When unset, search mode returns an actionable error; markdown and raw modes are unaffected.";
118
+ readonly type: "string";
119
+ readonly required: false;
120
+ readonly category: "auth";
121
+ readonly secret: true;
122
+ }, {
123
+ readonly name: "AFK_IMAGE_API_KEY";
124
+ readonly description: "Dedicated OpenAI API key for the image_generate tool. Checked before OPENAI_API_KEY to keep image billing separate from chat completions. When unset, OPENAI_API_KEY is used as a fallback. Get a key from https://platform.openai.com/api-keys.";
125
+ readonly type: "string";
126
+ readonly required: false;
127
+ readonly category: "auth";
128
+ readonly secret: true;
129
+ }, {
130
+ readonly name: "AFK_IMAGE_SESSION_LIMIT";
131
+ readonly description: "Maximum number of images the image_generate tool may produce per session. Prevents runaway spend in autonomous loops. Default: 10.";
132
+ readonly type: "string";
133
+ readonly required: false;
134
+ readonly category: "misc";
135
+ }, {
136
+ readonly name: "AFK_IMAGE_ALLOW_DAEMON";
137
+ readonly description: "Set to \"1\" to allow image_generate in daemon/cron sessions. Blocked by default to prevent unattended API spend.";
138
+ readonly type: "string";
139
+ readonly required: false;
140
+ readonly category: "misc";
141
+ }];
@@ -633,13 +633,6 @@ export declare const ENV_REGISTRY: readonly [{
633
633
  readonly required: false;
634
634
  readonly example: "true";
635
635
  readonly category: "telegram";
636
- }, {
637
- readonly name: "TMUX";
638
- readonly description: string;
639
- readonly type: "string";
640
- readonly required: false;
641
- readonly example: "/tmp/tmux-501/default,12345,0";
642
- readonly category: "process";
643
636
  }, {
644
637
  readonly name: "AFK_TELEGRAM_TRACE";
645
638
  readonly description: "Set to 1 to dump raw bridge traffic between the agent and the Telegram bot — debugging only.";
@@ -661,6 +654,36 @@ export declare const ENV_REGISTRY: readonly [{
661
654
  readonly default: "14400000";
662
655
  readonly example: "3600000";
663
656
  readonly category: "telegram";
657
+ }, {
658
+ readonly name: "TMUX";
659
+ readonly description: string;
660
+ readonly type: "string";
661
+ readonly required: false;
662
+ readonly example: "/tmp/tmux-501/default,12345,0";
663
+ readonly category: "process";
664
+ }, {
665
+ readonly name: "AFK_PEER_INBOUND";
666
+ readonly description: string;
667
+ readonly type: "string";
668
+ readonly required: false;
669
+ readonly default: "accept";
670
+ readonly example: "hold";
671
+ readonly category: "misc";
672
+ }, {
673
+ readonly name: "AFK_PEER_POLL_MS";
674
+ readonly description: string;
675
+ readonly type: "number";
676
+ readonly required: false;
677
+ readonly default: "1000";
678
+ readonly example: "2000";
679
+ readonly category: "misc";
680
+ }, {
681
+ readonly name: "TMUX_PANE";
682
+ readonly description: string;
683
+ readonly type: "string";
684
+ readonly required: false;
685
+ readonly example: "%0";
686
+ readonly category: "process";
664
687
  }, {
665
688
  readonly name: "CODEX_HOME";
666
689
  readonly description: "Codex configuration, plugin, and skill directory used for imports. Defaults to ~/.codex.";
@@ -855,20 +878,6 @@ export declare const ENV_REGISTRY: readonly [{
855
878
  readonly type: "string";
856
879
  readonly required: false;
857
880
  readonly category: "worktree";
858
- }, {
859
- readonly name: "AFK_MCP_HEALTHCHECK";
860
- readonly description: string;
861
- readonly type: "boolean";
862
- readonly required: false;
863
- readonly example: "1";
864
- readonly category: "mcp";
865
- }, {
866
- readonly name: "AFK_ALLOW_PROJECT_MCP";
867
- readonly description: "Opt-in to loading + spawning MCP servers declared in <cwd>/.mcp.json. Fail-closed: when unset (or 0), project-local servers are NOT spawned; set to a truthy value (1/true/yes/on) to load them. A project-local .mcp.json spawns arbitrary commands on session start, so it is off by default to prevent code execution when entering an untrusted repo (issue #571). Skipped servers are listed in a startup warning with the opt-in instruction.";
868
- readonly type: "boolean";
869
- readonly required: false;
870
- readonly example: "1";
871
- readonly category: "mcp";
872
881
  }, {
873
882
  readonly name: "AFK_AUTO_ROUTING";
874
883
  readonly description: "Auto-route bare slash inputs to matching skills. Applies to interactive, chat, telegram, and daemon surfaces.";
@@ -915,6 +924,20 @@ export declare const ENV_REGISTRY: readonly [{
915
924
  readonly default: "7";
916
925
  readonly example: "10";
917
926
  readonly category: "misc";
927
+ }, {
928
+ readonly name: "AFK_MCP_HEALTHCHECK";
929
+ readonly description: string;
930
+ readonly type: "boolean";
931
+ readonly required: false;
932
+ readonly example: "1";
933
+ readonly category: "mcp";
934
+ }, {
935
+ readonly name: "AFK_ALLOW_PROJECT_MCP";
936
+ readonly description: "Opt-in to loading + spawning MCP servers declared in <cwd>/.mcp.json. Fail-closed: when unset (or 0), project-local servers are NOT spawned; set to a truthy value (1/true/yes/on) to load them. A project-local .mcp.json spawns arbitrary commands on session start, so it is off by default to prevent code execution when entering an untrusted repo (issue #571). Skipped servers are listed in a startup warning with the opt-in instruction.";
937
+ readonly type: "boolean";
938
+ readonly required: false;
939
+ readonly example: "1";
940
+ readonly category: "mcp";
918
941
  }, {
919
942
  readonly name: "AFK_BANNER_PLAIN";
920
943
  readonly description: "Suppress the ANSI-colored banner at REPL startup. Useful for non-TTY captures and CI logs.";
@@ -1012,6 +1035,20 @@ export declare const ENV_REGISTRY: readonly [{
1012
1035
  readonly default: "dark";
1013
1036
  readonly example: "light";
1014
1037
  readonly category: "misc";
1038
+ }, {
1039
+ readonly name: "COLORFGBG";
1040
+ readonly description: string;
1041
+ readonly type: "string";
1042
+ readonly required: false;
1043
+ readonly example: "15;0";
1044
+ readonly category: "process";
1045
+ }, {
1046
+ readonly name: "COLORTERM";
1047
+ readonly description: string;
1048
+ readonly type: "string";
1049
+ readonly required: false;
1050
+ readonly example: "truecolor";
1051
+ readonly category: "process";
1015
1052
  }, {
1016
1053
  readonly name: "AFK_TEXT_MEASURE";
1017
1054
  readonly description: string;
@@ -1044,20 +1081,6 @@ export declare const ENV_REGISTRY: readonly [{
1044
1081
  readonly default: "";
1045
1082
  readonly example: "1";
1046
1083
  readonly category: "display";
1047
- }, {
1048
- readonly name: "COLORFGBG";
1049
- readonly description: string;
1050
- readonly type: "string";
1051
- readonly required: false;
1052
- readonly example: "15;0";
1053
- readonly category: "process";
1054
- }, {
1055
- readonly name: "COLORTERM";
1056
- readonly description: string;
1057
- readonly type: "string";
1058
- readonly required: false;
1059
- readonly example: "truecolor";
1060
- readonly category: "process";
1061
1084
  }, {
1062
1085
  readonly name: "AFK_DEBUG";
1063
1086
  readonly description: "Enable verbose debug logging across the codebase. Accepts 1 to enable.";
@@ -1150,20 +1173,6 @@ export declare const ENV_REGISTRY: readonly [{
1150
1173
  readonly default: "0";
1151
1174
  readonly example: "1";
1152
1175
  readonly category: "misc";
1153
- }, {
1154
- readonly name: "AFK_MESSAGE_JOURNAL_DISABLED";
1155
- readonly description: string;
1156
- readonly type: "boolean";
1157
- readonly required: false;
1158
- readonly example: "1";
1159
- readonly category: "debug";
1160
- }, {
1161
- readonly name: "AFK_SESSION_LEDGER_DISABLED";
1162
- readonly description: string;
1163
- readonly type: "boolean";
1164
- readonly required: false;
1165
- readonly example: "1";
1166
- readonly category: "debug";
1167
1176
  }, {
1168
1177
  readonly name: "AFK_RUN_RECEIPT_DISABLED";
1169
1178
  readonly description: string;
@@ -1233,6 +1242,20 @@ export declare const ENV_REGISTRY: readonly [{
1233
1242
  readonly type: "boolean";
1234
1243
  readonly required: false;
1235
1244
  readonly category: "process";
1245
+ }, {
1246
+ readonly name: "AFK_MESSAGE_JOURNAL_DISABLED";
1247
+ readonly description: string;
1248
+ readonly type: "boolean";
1249
+ readonly required: false;
1250
+ readonly example: "1";
1251
+ readonly category: "debug";
1252
+ }, {
1253
+ readonly name: "AFK_SESSION_LEDGER_DISABLED";
1254
+ readonly description: string;
1255
+ readonly type: "boolean";
1256
+ readonly required: false;
1257
+ readonly example: "1";
1258
+ readonly category: "debug";
1236
1259
  }, {
1237
1260
  readonly name: "AFK_BROWSER_HEADLESS";
1238
1261
  readonly description: string;
@@ -0,0 +1,166 @@
1
+ export declare const DAEMON_ENV_REGISTRY: readonly [{
2
+ readonly name: "AFK_DAEMON_CWD";
3
+ readonly description: "Working directory used by the daemon process for spawned agent sessions.";
4
+ readonly type: "string";
5
+ readonly required: false;
6
+ readonly category: "daemon";
7
+ }, {
8
+ readonly name: "AFK_DAEMON_TASK";
9
+ readonly description: "Default task description for the daemon. Falls back to afk.config.json daemon.task.";
10
+ readonly type: "string";
11
+ readonly required: false;
12
+ readonly category: "daemon";
13
+ }, {
14
+ readonly name: "AFK_DAEMON_TASK_ID";
15
+ readonly description: "Task identifier the daemon uses to scope its state directory and telemetry.";
16
+ readonly type: "string";
17
+ readonly required: false;
18
+ readonly category: "daemon";
19
+ }, {
20
+ readonly name: "AFK_DAEMON_HOST";
21
+ readonly description: "Bind address for the daemon control HTTP surface. Defaults to 127.0.0.1 (loopback only). The control surface is unauthenticated, so bind a non-loopback address such as 0.0.0.0 only on a trusted or firewalled network. Overridden by the --host flag.";
22
+ readonly type: "string";
23
+ readonly required: false;
24
+ readonly category: "daemon";
25
+ }, {
26
+ readonly name: "AFK_SESSIONSTART_COOLDOWN_MS";
27
+ readonly description: "Cooldown in milliseconds between SessionStart trigger fires in the daemon. Prevents thundering-herd on rapid restarts.";
28
+ readonly type: "number";
29
+ readonly required: false;
30
+ readonly category: "daemon";
31
+ }, {
32
+ readonly name: "AFK_DAEMON_SHELL_TIMEOUT_MS";
33
+ readonly description: "Wall-clock timeout in milliseconds for executor:shell scheduled tasks. Defaults to 2700000 (45 minutes), matching the agent executor budget (AFK_SUBAGENT_TIMEOUT_MS). The child process is killed on timeout; the telemetry errorMessage will read \"daemon shell timeout after NNNs\" to distinguish a daemon-imposed kill from a process or network failure.";
34
+ readonly type: "number";
35
+ readonly required: false;
36
+ readonly category: "daemon";
37
+ }, {
38
+ readonly name: "AFK_WEB_PORT";
39
+ readonly description: "Port for the `afk web` browser surface. Defaults to 4141; falls back to an ephemeral port when taken. Overridden by --port.";
40
+ readonly type: "number";
41
+ readonly required: false;
42
+ readonly example: "4141";
43
+ readonly category: "daemon";
44
+ }, {
45
+ readonly name: "AFK_WEB_HOST";
46
+ readonly description: "Bind address for the `afk web` browser surface. Defaults to 127.0.0.1. Unlike the daemon control surface, a non-loopback bind is REFUSED unless AFK_WEB_TOKEN (or --token) is also set, because this surface can submit prompts and approve tool use. Overridden by --host.";
47
+ readonly type: "string";
48
+ readonly required: false;
49
+ readonly example: "127.0.0.1";
50
+ readonly category: "daemon";
51
+ }, {
52
+ readonly name: "AFK_WEB_TOKEN";
53
+ readonly description: "Bearer token for the `afk web` surface. When unset, a random per-run token is minted and printed in the startup URL. Setting this explicitly is also what permits a non-loopback bind.";
54
+ readonly type: "string";
55
+ readonly required: false;
56
+ readonly category: "daemon";
57
+ readonly secret: true;
58
+ }, {
59
+ readonly name: "AFK_WORKTREE_AUTONAME";
60
+ readonly description: "Auto-rename worktree branches based on the first user message in interactive mode. 1 = on (default), 0 = off.";
61
+ readonly type: "boolean";
62
+ readonly required: false;
63
+ readonly default: "1";
64
+ readonly example: "0";
65
+ readonly category: "worktree";
66
+ }, {
67
+ readonly name: "AFK_WORKTREE_BRANCH_PREFIX";
68
+ readonly description: "Branch-name prefix for AFK-managed worktrees. Default afk/. Set to empty string to drop the prefix.";
69
+ readonly type: "string";
70
+ readonly required: false;
71
+ readonly default: "afk/";
72
+ readonly example: "wt/";
73
+ readonly category: "worktree";
74
+ }, {
75
+ readonly name: "AFK_WORKTREE_BASE";
76
+ readonly description: "Override the base git ref for worktrees created with --worktree. By default AFK bases worktrees on the remote's default branch (e.g. origin/main), fetched fresh. Set this to pin a different ref, or to HEAD to base on the local checkout. Overridden per-session by --worktree-base.";
77
+ readonly type: "string";
78
+ readonly required: false;
79
+ readonly example: "origin/main";
80
+ readonly category: "worktree";
81
+ }, {
82
+ readonly name: "AFK_WORKTREE_ON_EXIT";
83
+ readonly description: "Clean-worktree quit policy for interactive --worktree sessions: ask, keep, or remove.";
84
+ readonly type: "string";
85
+ readonly required: false;
86
+ readonly example: "ask";
87
+ readonly category: "worktree";
88
+ }, {
89
+ readonly name: "AFK_WORKTREE_BOOT_PRUNE";
90
+ readonly description: "When set, the daemon prunes stale worktrees at boot in addition to the cron-driven sweep.";
91
+ readonly type: "boolean";
92
+ readonly required: false;
93
+ readonly category: "worktree";
94
+ }, {
95
+ readonly name: "AFK_WORKTREE_PRUNE_DISABLE";
96
+ readonly description: "Disable the worktree prune job entirely. Useful for long-running tests.";
97
+ readonly type: "boolean";
98
+ readonly required: false;
99
+ readonly category: "worktree";
100
+ }, {
101
+ readonly name: "AFK_WORKTREE_MAX_AGE_CLEAN";
102
+ readonly description: "Maximum age (in days) before a clean worktree is auto-pruned. Default 14.";
103
+ readonly type: "number";
104
+ readonly required: false;
105
+ readonly default: "14";
106
+ readonly category: "worktree";
107
+ }, {
108
+ readonly name: "AFK_WORKTREE_MAX_AGE_DIRTY";
109
+ readonly description: "Maximum age (in days) before a dirty worktree is auto-pruned. Default 30.";
110
+ readonly type: "number";
111
+ readonly required: false;
112
+ readonly default: "30";
113
+ readonly category: "worktree";
114
+ }, {
115
+ readonly name: "AFK_WORKTREE_SWEEP_ROOT";
116
+ readonly description: "Override the root directory under which AFK worktrees are tracked for pruning.";
117
+ readonly type: "string";
118
+ readonly required: false;
119
+ readonly category: "worktree";
120
+ }, {
121
+ readonly name: "AFK_AUTO_ROUTING";
122
+ readonly description: "Auto-route bare slash inputs to matching skills. Applies to interactive, chat, telegram, and daemon surfaces.";
123
+ readonly type: "boolean";
124
+ readonly required: false;
125
+ readonly example: "true";
126
+ readonly category: "routing";
127
+ }, {
128
+ readonly name: "AFK_INTERNAL";
129
+ readonly description: "Tier gate. Set to exactly `1` to unlock — only the literal string \"1\" unlocks (other truthy values like \"true\"/\"yes\" leave the tier locked). When unlocked, skills tagged `audience: 'internal'` (e.g. /audit-fit, harvest/distill plugins) become visible at end-user surfaces (slash-command list, --help, tab-complete, system-prompt skill manifest). Default unset = public tier — internal skills are hidden. Not an access-control boundary; it gates surfacing, not the underlying registry.";
130
+ readonly type: "boolean";
131
+ readonly required: false;
132
+ readonly example: "1";
133
+ readonly category: "routing";
134
+ }, {
135
+ readonly name: "AFK_SHELL_PASSTHROUGH";
136
+ readonly description: "Enable the interactive REPL `!cmd` / `!&cmd` shell-passthrough feature. On by default. Set to 0, false, off, or no (case-insensitive) to disable, so inputs beginning with ! are sent to the model as literal text instead of being executed as shell commands. Equivalent to the --no-shell-passthrough flag.";
137
+ readonly type: "boolean";
138
+ readonly required: false;
139
+ readonly default: "1";
140
+ readonly example: "0";
141
+ readonly category: "misc";
142
+ }, {
143
+ readonly name: "AFK_BG_AUTO_DELIVER";
144
+ readonly description: "Auto-deliver background subagent results into the model context on the next user turn (interactive REPL). On by default. Set to 0, false, off, or no (case-insensitive) to disable, restoring the manual /bgsub:join retrieval flow.";
145
+ readonly type: "boolean";
146
+ readonly required: false;
147
+ readonly default: "1";
148
+ readonly example: "0";
149
+ readonly category: "misc";
150
+ }, {
151
+ readonly name: "AFK_BASH_PREVIEW_HEAD_LINES";
152
+ readonly description: string;
153
+ readonly type: "number";
154
+ readonly required: false;
155
+ readonly default: "0";
156
+ readonly example: "3";
157
+ readonly category: "misc";
158
+ }, {
159
+ readonly name: "AFK_BASH_PREVIEW_TAIL_LINES";
160
+ readonly description: string;
161
+ readonly type: "number";
162
+ readonly required: false;
163
+ readonly default: "7";
164
+ readonly example: "10";
165
+ readonly category: "misc";
166
+ }];
@@ -0,0 +1,162 @@
1
+ export declare const DEBUG_ENV_REGISTRY: readonly [{
2
+ readonly name: "AFK_DEBUG";
3
+ readonly description: "Enable verbose debug logging across the codebase. Accepts 1 to enable.";
4
+ readonly type: "boolean";
5
+ readonly required: false;
6
+ readonly example: "1";
7
+ readonly category: "debug";
8
+ }, {
9
+ readonly name: "AFK_DEBUG_CLIPBOARD";
10
+ readonly description: "Debug bracketed-paste and image-paste handling in the interactive REPL.";
11
+ readonly type: "boolean";
12
+ readonly required: false;
13
+ readonly category: "debug";
14
+ }, {
15
+ readonly name: "AFK_DEBUG_COMPOSITOR";
16
+ readonly description: "Gate compositor phase-boundary traces to stderr; any truthy value enables.";
17
+ readonly type: "boolean";
18
+ readonly required: false;
19
+ readonly category: "debug";
20
+ }, {
21
+ readonly name: "AFK_TRACE_DISABLED";
22
+ readonly description: "Disable the agent trace subsystem entirely. Set to 1 to skip trace file writes.";
23
+ readonly type: "boolean";
24
+ readonly required: false;
25
+ readonly example: "1";
26
+ readonly category: "debug";
27
+ }, {
28
+ readonly name: "AFK_WITNESS_RETENTION_DISABLE";
29
+ readonly description: "Disable the witness-tree retention sweep entirely, so no session directory is ever evicted.";
30
+ readonly type: "boolean";
31
+ readonly required: false;
32
+ readonly example: "1";
33
+ readonly category: "debug";
34
+ }, {
35
+ readonly name: "AFK_WITNESS_MAX_AGE_DAYS";
36
+ readonly description: "Evict a witness session directory once its newest content is older than this many days. Default 30.";
37
+ readonly type: "number";
38
+ readonly required: false;
39
+ readonly default: "30";
40
+ readonly category: "debug";
41
+ }, {
42
+ readonly name: "AFK_WITNESS_MAX_BYTES";
43
+ readonly description: "Aggregate byte cap for the witness tree; oldest session directories are evicted first once exceeded. Default 2147483648 (2 GiB).";
44
+ readonly type: "number";
45
+ readonly required: false;
46
+ readonly default: "2147483648";
47
+ readonly category: "debug";
48
+ }, {
49
+ readonly name: "AFK_SESSION_RETENTION_DISABLE";
50
+ readonly description: "Disable the session sidecar retention sweep entirely, so no state/sessions/*.json file is ever evicted.";
51
+ readonly type: "boolean";
52
+ readonly required: false;
53
+ readonly example: "1";
54
+ readonly category: "debug";
55
+ }, {
56
+ readonly name: "AFK_SESSION_MAX_AGE_DAYS";
57
+ readonly description: "Evict a session sidecar file once it is older than this many days (based on savedAt). Default 30.";
58
+ readonly type: "number";
59
+ readonly required: false;
60
+ readonly default: "30";
61
+ readonly category: "debug";
62
+ }, {
63
+ readonly name: "AFK_SESSION_MAX_COUNT";
64
+ readonly description: "Count-based safety valve: evict oldest session sidecars first once the total exceeds this number. Default 1000.";
65
+ readonly type: "number";
66
+ readonly required: false;
67
+ readonly default: "1000";
68
+ readonly category: "debug";
69
+ }, {
70
+ readonly name: "AFK_WAVE_MANIFEST_DISABLED";
71
+ readonly description: string;
72
+ readonly type: "boolean";
73
+ readonly required: false;
74
+ readonly default: "0";
75
+ readonly example: "1";
76
+ readonly category: "misc";
77
+ }, {
78
+ readonly name: "AFK_WAVE_MANIFEST_TTL_HOURS";
79
+ readonly description: string;
80
+ readonly type: "number";
81
+ readonly required: false;
82
+ readonly default: "48";
83
+ readonly example: "24";
84
+ readonly category: "misc";
85
+ }, {
86
+ readonly name: "AFK_WAVE_RESUME_UNATTENDED";
87
+ readonly description: string;
88
+ readonly type: "boolean";
89
+ readonly required: false;
90
+ readonly default: "0";
91
+ readonly example: "1";
92
+ readonly category: "misc";
93
+ }, {
94
+ readonly name: "AFK_RUN_RECEIPT_DISABLED";
95
+ readonly description: string;
96
+ readonly type: "boolean";
97
+ readonly required: false;
98
+ readonly example: "1";
99
+ readonly category: "debug";
100
+ }, {
101
+ readonly name: "AFK_SUBAGENT_RESULT_CAP_BYTES";
102
+ readonly description: string;
103
+ readonly type: "number";
104
+ readonly required: false;
105
+ readonly default: "32768";
106
+ readonly example: "16384";
107
+ readonly category: "model";
108
+ }, {
109
+ readonly name: "AFK_SUBAGENT_LOG";
110
+ readonly description: string;
111
+ readonly type: "boolean";
112
+ readonly required: false;
113
+ readonly example: "1";
114
+ readonly category: "debug";
115
+ }, {
116
+ readonly name: "DEBUG";
117
+ readonly description: "Standard Node `debug`-package convention. When set to 1, enables verbose logging in several modules alongside AFK_DEBUG.";
118
+ readonly type: "string";
119
+ readonly required: false;
120
+ readonly category: "debug";
121
+ }, {
122
+ readonly name: "AGENT_AFK_ASCII";
123
+ readonly description: "Force the interactive REPL tool-lane renderer to ASCII-only glyphs instead of the default Unicode box-drawing set. Accepts 1/true/yes (case-insensitive). Useful for terminals whose font lacks ┃├╰├ glyphs.";
124
+ readonly type: "boolean";
125
+ readonly required: false;
126
+ readonly example: "1";
127
+ readonly category: "debug";
128
+ }, {
129
+ readonly name: "AGENT_SURFACE";
130
+ readonly description: string;
131
+ readonly type: "string";
132
+ readonly required: false;
133
+ readonly default: "afk";
134
+ readonly example: "afk";
135
+ readonly category: "process";
136
+ }, {
137
+ readonly name: "CI";
138
+ readonly description: "Standard CI-detection convention. Auto-set by GitHub Actions, CircleCI, etc. Used to switch off TTY-only UX.";
139
+ readonly type: "string";
140
+ readonly required: false;
141
+ readonly example: "true";
142
+ readonly category: "process";
143
+ }, {
144
+ readonly name: "NODE_ENV";
145
+ readonly description: "Standard Node environment marker. test | development | production. Used by routing-telemetry.ts to suppress test-time writes.";
146
+ readonly type: "string";
147
+ readonly required: false;
148
+ readonly example: "production";
149
+ readonly category: "process";
150
+ }, {
151
+ readonly name: "VITEST";
152
+ readonly description: "Set automatically by Vitest. Used at runtime to short-circuit code paths that should not fire in tests.";
153
+ readonly type: "string";
154
+ readonly required: false;
155
+ readonly category: "process";
156
+ }, {
157
+ readonly name: "NO_UPDATE_NOTIFIER";
158
+ readonly description: "Disable the update-available notifier on CLI startup. Standard convention shared with many Node CLIs.";
159
+ readonly type: "boolean";
160
+ readonly required: false;
161
+ readonly category: "process";
162
+ }];