@hua-labs/tap 0.2.0 → 0.2.2

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.
package/README.md CHANGED
@@ -108,7 +108,7 @@ npx @hua-labs/tap status --json
108
108
  "message": "2 runtime(s) installed",
109
109
  "warnings": [],
110
110
  "data": {
111
- "version": "0.2.0",
111
+ "version": "0.2.2",
112
112
  "commsDir": "/path/to/comms",
113
113
  "runtimes": {
114
114
  "claude": { "status": "active", "bridgeMode": "native-push" },
@@ -165,7 +165,7 @@ Each runtime has an adapter that:
165
165
 
166
166
  The adapter contract (`RuntimeAdapter`) is the extension point for adding new runtimes.
167
167
 
168
- ## Changelog (0.2.0)
168
+ ## Changelog (0.2.2)
169
169
 
170
170
  ### Bridge
171
171
 
@@ -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 };