agent-afk 5.192.1 → 5.194.0

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.
@@ -19,6 +19,7 @@ export interface HandoffRecord {
19
19
  answeredAt?: string;
20
20
  answerSource?: string;
21
21
  originalCommand: string;
22
+ telegramMessageId?: number;
22
23
  }
23
24
  export declare function writeHandoff(record: HandoffRecord, handoffsDir?: string): Promise<void>;
24
25
  export declare function readHandoff(taskId: string, handoffsDir?: string): Promise<HandoffRecord | null>;
@@ -1,15 +1,19 @@
1
1
  import type { ElicitationHandler } from '../elicitation-router.js';
2
+ import type { Telegraf } from 'telegraf';
2
3
  export interface DaemonElicitationOpts {
3
4
  taskId: string;
4
5
  originalCommand: string;
5
6
  queueDir?: string;
6
7
  handoffsDir?: string;
8
+ bot?: Telegraf;
9
+ chatId?: number;
10
+ threadId?: number;
7
11
  }
8
12
  export declare function makeDaemonElicitationHandler(opts: DaemonElicitationOpts): ElicitationHandler;
9
13
  export interface RecoveryResult {
10
14
  renotified: number;
11
15
  expired: number;
12
16
  }
13
- export declare function recoverPendingHandoffs(handoffsDir?: string, queueDir?: string): Promise<RecoveryResult>;
17
+ export declare function recoverPendingHandoffs(handoffsDir?: string, queueDir?: string, bot?: Telegraf): Promise<RecoveryResult>;
14
18
  export declare function answerHandoff(taskId: string, answer: unknown, source: string, handoffsDir?: string): Promise<boolean>;
15
19
  export declare function cleanupHandoff(taskId: string, handoffsDir?: string): Promise<void>;
@@ -0,0 +1,29 @@
1
+ ---
2
+ name: orient
3
+ description: At end-of-session, dispatches a read-only sub-agent to survey recent work and drafts a vaguely-specific priming prompt the next session can paste to orient itself and plan its next sprint. Produces orientation, not prescription — candidate directions are framed as questions, not decisions.
4
+ context: load
5
+ ---
6
+
7
+ ## Sub-agent contract
8
+ /contract
9
+
10
+ Dispatch one read-only research sub-agent to survey recent work across four narrow targets, then produce a single markdown prompt block the user can paste into a fresh session.
11
+
12
+ **Sub-agent surveys:**
13
+ - Memory: the **`memory_search` tool** (2–3 keyword queries on the current work; FTS5 syntax) + hot memory at `~/.afk/state/memory/HOT.md`. Do **not** grep `~/.claude/projects/**/memory/` — that path is vestigial and empty on both trees; the archive is SQLite and only `memory_search` reaches it. Report which stores you consulted.
14
+ - Git activity in this repo + sibling repos the session touched (`git log --oneline -10`, open PRs, dirty state)
15
+ - `experiments/` docs (if present) relevant to the current work
16
+ - Telemetry/state files the session interacted with (e.g. `~/.afk/agent-framework/*.jsonl`)
17
+
18
+ **Return exactly this shape (≤ 60 lines total):**
19
+ 1. One-line project identity + one-line "where we are" (current phase / latest milestone)
20
+ 2. 3–5 bullets on what shipped recently — commits, PRs, empirical closures; be specific
21
+ 3. Memory pointers by filename only (next session's memory system auto-loads — don't restate)
22
+ 4. 2–4 **candidate directions** framed as questions or possibilities, **never** as a decided plan
23
+ 5. Closing line inviting the next session to run `/ground-state` first, then propose a plan
24
+
25
+ **Discipline the contract enforces:** orientation, not execution. Handoff briefs drift toward prescription by default; the "questions-as-possibilities" framing is the guardrail so the receiving session plans with fresh judgment.
26
+
27
+ Relay the prompt to the user. On request, save to `/tmp/orient-<ISO8601>.md`.
28
+
29
+ **Skip when:** no substantive work to carry forward, user wants a bare `/compact`, or user already has a decided plan (use `/mint` or draft directly).