@hua-labs/tap 0.2.0 → 0.2.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.
@@ -0,0 +1,55 @@
1
+ type BusyMode = "wait" | "steer";
2
+ interface Options {
3
+ repoRoot: string;
4
+ commsDir: string;
5
+ agentId: string;
6
+ agentName: string;
7
+ stateDir: string;
8
+ pollSeconds: number;
9
+ reconnectSeconds: number;
10
+ messageLookbackMinutes: number;
11
+ processExistingMessages: boolean;
12
+ dryRun: boolean;
13
+ runOnce: boolean;
14
+ waitAfterDispatchSeconds: number;
15
+ appServerUrl: string;
16
+ connectAppServerUrl: string;
17
+ gatewayTokenFile: string | null;
18
+ busyMode: BusyMode;
19
+ threadId: string | null;
20
+ ephemeral: boolean;
21
+ }
22
+ interface Candidate {
23
+ markerId: string;
24
+ filePath: string;
25
+ fileName: string;
26
+ sender: string;
27
+ recipient: string;
28
+ subject: string;
29
+ body: string;
30
+ mtimeMs: number;
31
+ }
32
+ interface HeadlessWarmupClient {
33
+ activeTurnId: string | null;
34
+ lastTurnStatus: string | null;
35
+ startTurn(inputText: string): Promise<string | null>;
36
+ refreshCurrentThreadState(): Promise<void>;
37
+ }
38
+ interface HeartbeatStoreRecord {
39
+ id?: string;
40
+ agent?: string;
41
+ }
42
+ type HeartbeatStore = Record<string, HeartbeatStoreRecord>;
43
+ declare const HEADLESS_WARMUP_PROMPT: string;
44
+ declare function resolveAgentId(preferredAgentName?: string | null): string;
45
+ declare function recipientMatchesAgent(recipient: string, agentId: string, agentName: string): boolean;
46
+ declare function isOwnMessageSender(sender: string, agentId: string, agentName: string): boolean;
47
+ declare function resolveAddressLabel(address: string, heartbeats: HeartbeatStore): string;
48
+ declare function resolveCurrentAgentName(agentId: string, fallbackAgentName: string, heartbeats: HeartbeatStore): string;
49
+ declare function buildUserInput(candidate: Candidate, agentName: string, heartbeats: HeartbeatStore): string;
50
+ declare function waitForTurnCompletion(client: Pick<HeadlessWarmupClient, "activeTurnId" | "lastTurnStatus" | "refreshCurrentThreadState">, turnId: string, timeoutMs: number): Promise<string | null>;
51
+ declare function maybeBootstrapHeadlessTurn(options: Options, cutoff: Date, client: HeadlessWarmupClient): Promise<boolean>;
52
+ declare function buildOptions(argv: string[]): Options;
53
+ declare function main(): Promise<void>;
54
+
55
+ export { HEADLESS_WARMUP_PROMPT, type HeadlessWarmupClient, buildOptions, buildUserInput, isOwnMessageSender, main, maybeBootstrapHeadlessTurn, recipientMatchesAgent, resolveAddressLabel, resolveAgentId, resolveCurrentAgentName, waitForTurnCompletion };