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,77 @@
1
+ export declare const TELEGRAM_ENV_REGISTRY: readonly [{
2
+ readonly name: "TELEGRAM_BOT_TOKEN";
3
+ readonly description: "Telegram bot token from @BotFather. Required to run the Telegram bot surface.";
4
+ readonly type: "string";
5
+ readonly required: false;
6
+ readonly category: "telegram";
7
+ readonly secret: true;
8
+ }, {
9
+ readonly name: "AFK_TELEGRAM_BOT_TOKEN";
10
+ readonly description: "Alternative env var name for the Telegram bot token, accepted by the setup wizard.";
11
+ readonly type: "string";
12
+ readonly required: false;
13
+ readonly category: "telegram";
14
+ readonly secret: true;
15
+ }, {
16
+ readonly name: "AFK_TELEGRAM_ALLOWED_CHAT_IDS";
17
+ readonly description: "Comma-separated list of Telegram chat IDs allowed to interact with the bot. Required when the bot is running.";
18
+ readonly type: "string";
19
+ readonly required: false;
20
+ readonly example: "123456789,987654321";
21
+ readonly category: "telegram";
22
+ }, {
23
+ readonly name: "AFK_TELEGRAM_TAG_ONLY_CHAT_IDS";
24
+ readonly description: "Comma-separated list of Telegram chat IDs where the bot answers only when addressed (a reply to the bot, an @mention of the bot, or a text_mention resolving to the bot). Slash-commands are unaffected; chats not listed behave as usual. The afk.config.json telegram.tagOnlyChats block takes precedence. Requires Telegram privacy mode OFF (BotFather /setprivacy Disable) for non-addressed group messages to reach the bot.";
25
+ readonly type: "string";
26
+ readonly required: false;
27
+ readonly example: "-100987654321,123456789";
28
+ readonly category: "telegram";
29
+ }, {
30
+ readonly name: "AFK_TELEGRAM_PRIMARY_CHAT_ID";
31
+ readonly description: "Default chat ID for outbound notifications (primary-mode routing). When unset, notifications go to the first private/DM chat in AFK_TELEGRAM_ALLOWED_CHAT_IDS. The afk.config.json telegram.notify block takes precedence.";
32
+ readonly type: "string";
33
+ readonly required: false;
34
+ readonly example: "123456789";
35
+ readonly category: "telegram";
36
+ }, {
37
+ readonly name: "AFK_TELEGRAM_NOTIFY_MODE";
38
+ readonly description: "Outbound notification fan-out: primary (default — one chat), broadcast (every allowed chat), or custom (afk.config.json telegram.notify.targets). The afk.config.json telegram.notify.mode takes precedence.";
39
+ readonly type: "string";
40
+ readonly required: false;
41
+ readonly example: "broadcast";
42
+ readonly category: "telegram";
43
+ }, {
44
+ readonly name: "TELEGRAM_DATA_DIR";
45
+ readonly description: "Override the directory where Telegram bot state is stored. Defaults to ~/.afk/state/telegram/.";
46
+ readonly type: "string";
47
+ readonly required: false;
48
+ readonly category: "telegram";
49
+ }, {
50
+ readonly name: "TELEGRAM_VERBOSE";
51
+ readonly description: "Set to a truthy value ('1'/'true'/'yes'/'on', case-insensitive) to log per-message details from the Telegram bot — chat IDs, message text, latency.";
52
+ readonly type: "boolean";
53
+ readonly required: false;
54
+ readonly example: "true";
55
+ readonly category: "telegram";
56
+ }, {
57
+ readonly name: "AFK_TELEGRAM_TRACE";
58
+ readonly description: "Set to 1 to dump raw bridge traffic between the agent and the Telegram bot — debugging only.";
59
+ readonly type: "boolean";
60
+ readonly required: false;
61
+ readonly example: "1";
62
+ readonly category: "debug";
63
+ }, {
64
+ readonly name: "AFK_TELEGRAM_CWD";
65
+ readonly description: "Override the working directory used by the Telegram bot when spawning agent sessions.";
66
+ readonly type: "string";
67
+ readonly required: false;
68
+ readonly category: "telegram";
69
+ }, {
70
+ readonly name: "AFK_TELEGRAM_SESSION_IDLE_MS";
71
+ readonly description: "Milliseconds of inactivity after which an idle AgentSession is closed and its memory freed. sessionData (model/cwd preferences) is kept in-memory and reloaded on demand from disk. Default: 14400000 (4 hours).";
72
+ readonly type: "number";
73
+ readonly required: false;
74
+ readonly default: "14400000";
75
+ readonly example: "3600000";
76
+ readonly category: "telegram";
77
+ }];
@@ -0,0 +1,112 @@
1
+ export declare const UI_ENV_REGISTRY: readonly [{
2
+ readonly name: "AFK_BANNER_PLAIN";
3
+ readonly description: "Suppress the ANSI-colored banner at REPL startup. Useful for non-TTY captures and CI logs.";
4
+ readonly type: "boolean";
5
+ readonly required: false;
6
+ readonly example: "1";
7
+ readonly category: "misc";
8
+ }, {
9
+ readonly name: "AFK_PLAIN_OUTPUT";
10
+ readonly description: string;
11
+ readonly type: "boolean";
12
+ readonly required: false;
13
+ readonly example: "1";
14
+ readonly category: "misc";
15
+ }, {
16
+ readonly name: "AFK_SPINNER_TIPS";
17
+ readonly description: "Show rotating tips in the loading spinner during long calls. 1 = on, 0 = off.";
18
+ readonly type: "boolean";
19
+ readonly required: false;
20
+ readonly category: "misc";
21
+ }, {
22
+ readonly name: "AFK_GOBLIN_SPINNER";
23
+ readonly description: "Goblin-themed working spinner (olive frames + goblin verbs) while the agent runs tools. 1 = on (default), 0 = classic dim spinner.";
24
+ readonly type: "boolean";
25
+ readonly required: false;
26
+ readonly example: "0";
27
+ readonly category: "misc";
28
+ }, {
29
+ readonly name: "AFK_GOBLIN_MASCOT";
30
+ readonly description: "Reacting goblin mini-sprite in the reserved footer band while the agent runs tools (3 rows, animated). 1 = on, unset/0 = off (default). Claims terminal rows, so it is opt-in.";
31
+ readonly type: "boolean";
32
+ readonly required: false;
33
+ readonly example: "1";
34
+ readonly category: "misc";
35
+ }, {
36
+ readonly name: "AFK_TERM_TITLE";
37
+ readonly description: "Set the terminal/tab title (OSC 2) to reflect afk state — \"afk — <cwd> · running\" during a turn, \"afk — <cwd>\" when idle, cleared on exit. 1 = on (default when stdout is a TTY), 0 = leave the title alone. TTY-only.";
38
+ readonly type: "boolean";
39
+ readonly required: false;
40
+ readonly example: "0";
41
+ readonly category: "misc";
42
+ }, {
43
+ readonly name: "AFK_NOTIFY";
44
+ readonly description: "Emit a desktop completion notification (OSC 9) on turn completion, for terminals that map OSC 9 to system notifications (iTerm2, kitty, WezTerm). Opt-in and off by default (intrusive). 1 = on. TTY-only.";
45
+ readonly type: "boolean";
46
+ readonly required: false;
47
+ readonly example: "1";
48
+ readonly category: "misc";
49
+ }, {
50
+ readonly name: "AFK_SHOW_DIFFS";
51
+ readonly description: "Show inline diffs in the tool-lane output for edit/write tool calls. 1 = on, 0 = off.";
52
+ readonly type: "boolean";
53
+ readonly required: false;
54
+ readonly category: "misc";
55
+ }, {
56
+ readonly name: "AFK_TURN_SEPARATOR";
57
+ readonly description: "Render a dim horizontal rule between conversation turns in the REPL. 0 = off, unset/1 = on (default). TTY-only: piped/one-shot output (afk chat) never emits the rule.";
58
+ readonly type: "boolean";
59
+ readonly required: false;
60
+ readonly example: "0";
61
+ readonly category: "misc";
62
+ }, {
63
+ readonly name: "AFK_STREAM_BUFFER_MS";
64
+ readonly description: "Input buffer window for TUI streaming in milliseconds. When set to a positive value, incoming tokens are micro-batched before parsing and rendering, producing smoother visual output. The first token after idle always passes through immediately (leading-edge). 0 = disabled (every token is parsed individually). Reasonable range: 8-50.";
65
+ readonly type: "number";
66
+ readonly required: false;
67
+ readonly default: "0";
68
+ readonly example: "16";
69
+ readonly category: "display";
70
+ }, {
71
+ readonly name: "AFK_SKILL_STREAM_VERBOSE";
72
+ readonly description: "Verbose streaming output when a skill is dispatched. Logs sub-agent setup, intermediate events, and final result.";
73
+ readonly type: "boolean";
74
+ readonly required: false;
75
+ readonly category: "debug";
76
+ }, {
77
+ readonly name: "FORCE_COLOR";
78
+ readonly description: "Standard Node convention. Force-enable ANSI color output even when stdout is not a TTY.";
79
+ readonly type: "string";
80
+ readonly required: false;
81
+ readonly example: "1";
82
+ readonly category: "process";
83
+ }, {
84
+ readonly name: "NO_COLOR";
85
+ readonly description: "Standard convention (https://no-color.org). When set to any non-empty value, disables ANSI color output.";
86
+ readonly type: "string";
87
+ readonly required: false;
88
+ readonly example: "1";
89
+ readonly category: "process";
90
+ }, {
91
+ readonly name: "AFK_THEME";
92
+ readonly description: string;
93
+ readonly type: "string";
94
+ readonly required: false;
95
+ readonly default: "dark";
96
+ readonly example: "light";
97
+ readonly category: "misc";
98
+ }, {
99
+ readonly name: "COLORFGBG";
100
+ readonly description: string;
101
+ readonly type: "string";
102
+ readonly required: false;
103
+ readonly example: "15;0";
104
+ readonly category: "process";
105
+ }, {
106
+ readonly name: "COLORTERM";
107
+ readonly description: string;
108
+ readonly type: "string";
109
+ readonly required: false;
110
+ readonly example: "truecolor";
111
+ readonly category: "process";
112
+ }];
@@ -0,0 +1,2 @@
1
+ import type { ScrapeResult } from './scrape.js';
2
+ export declare function emptyScrapeMessage(url: string, result: ScrapeResult): string;
@@ -7,11 +7,23 @@ export interface ScrapeOptions {
7
7
  signal: AbortSignal;
8
8
  lookupFn?: EgressGuardOptions['lookupFn'];
9
9
  }
10
+ export interface ScrapeDiagnostics {
11
+ fetch?: {
12
+ httpStatus: number;
13
+ finalUrl: string;
14
+ contentType: string;
15
+ rawBodyBytes?: number;
16
+ };
17
+ render: 'not-run' | 'failed' | 'succeeded';
18
+ renderHttpStatus?: number | null;
19
+ renderFinalUrl?: string;
20
+ }
10
21
  export interface ScrapeResult {
11
22
  title: string;
12
23
  markdown: string;
13
24
  finalUrl: string;
14
25
  usedRender: boolean;
26
+ diagnostics?: ScrapeDiagnostics;
15
27
  advisory?: string;
16
28
  }
17
29
  export declare function scrapeToMarkdown(url: string, opts: ScrapeOptions): Promise<ScrapeResult>;