@phren/cli 0.3.10 → 0.3.12
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/dist/bridge/agent-hook-stores.d.ts +3 -0
- package/dist/bridge/agent-hook-stores.js +5 -0
- package/dist/bridge/agent-hooks.d.ts +159 -5
- package/dist/bridge/agent-hooks.js +663 -49
- package/dist/bridge/approval-summary.d.ts +16 -0
- package/dist/bridge/approval-summary.js +133 -0
- package/dist/bridge/authority-command.d.ts +20 -0
- package/dist/bridge/authority-command.js +120 -0
- package/dist/bridge/authority.d.ts +223 -0
- package/dist/bridge/authority.js +231 -0
- package/dist/bridge/claude-account-setup.d.ts +14 -0
- package/dist/bridge/claude-account-setup.js +69 -0
- package/dist/bridge/claude-accounts.d.ts +49 -0
- package/dist/bridge/claude-accounts.js +195 -0
- package/dist/bridge/code-routes.js +2 -2
- package/dist/bridge/codex-app-server.d.ts +144 -0
- package/dist/bridge/codex-app-server.js +319 -0
- package/dist/bridge/codex-auth-refresh.d.ts +33 -0
- package/dist/bridge/codex-auth-refresh.js +71 -0
- package/dist/bridge/codex-question-reply.d.ts +16 -0
- package/dist/bridge/codex-question-reply.js +57 -0
- package/dist/bridge/codex-review-mode.d.ts +10 -0
- package/dist/bridge/codex-review-mode.js +74 -0
- package/dist/bridge/codex-servers.d.ts +217 -0
- package/dist/bridge/codex-servers.js +636 -0
- package/dist/bridge/command.js +94 -4
- package/dist/bridge/computer-identity.d.ts +75 -0
- package/dist/bridge/computer-identity.js +166 -0
- package/dist/bridge/conductor-group.d.ts +91 -8
- package/dist/bridge/conductor-group.js +105 -9
- package/dist/bridge/conductor-role.d.ts +94 -0
- package/dist/bridge/conductor-role.js +176 -0
- package/dist/bridge/conductor-sets.d.ts +20 -0
- package/dist/bridge/conductor-sets.js +59 -0
- package/dist/bridge/dispatch-command.d.ts +3 -0
- package/dist/bridge/dispatch-command.js +75 -11
- package/dist/bridge/dispatch-returns.d.ts +123 -19
- package/dist/bridge/dispatch-returns.js +357 -50
- package/dist/bridge/dispatch.d.ts +103 -2
- package/dist/bridge/dispatch.js +272 -40
- package/dist/bridge/fanout-messages.js +2 -2
- package/dist/bridge/fanouts.d.ts +7 -1
- package/dist/bridge/fanouts.js +40 -5
- package/dist/bridge/folder-trust.d.ts +56 -0
- package/dist/bridge/folder-trust.js +195 -0
- package/dist/bridge/grants.d.ts +22 -1
- package/dist/bridge/grants.js +57 -9
- package/dist/bridge/hand-off.d.ts +21 -9
- package/dist/bridge/hand-off.js +58 -45
- package/dist/bridge/harness-status.d.ts +11 -0
- package/dist/bridge/harness-status.js +32 -0
- package/dist/bridge/harnesses.d.ts +39 -0
- package/dist/bridge/harnesses.js +65 -0
- package/dist/bridge/health.d.ts +2 -0
- package/dist/bridge/health.js +1 -1
- package/dist/bridge/herdr.d.ts +11 -2
- package/dist/bridge/herdr.js +98 -23
- package/dist/bridge/hook-fast.d.ts +4 -0
- package/dist/bridge/hook-fast.js +68 -0
- package/dist/bridge/install.d.ts +16 -1
- package/dist/bridge/install.js +88 -21
- package/dist/bridge/launch-brief.d.ts +96 -0
- package/dist/bridge/launch-brief.js +164 -0
- package/dist/bridge/model-switch.d.ts +3 -0
- package/dist/bridge/model-switch.js +17 -1
- package/dist/bridge/models.d.ts +8 -4
- package/dist/bridge/models.js +24 -8
- package/dist/bridge/mux-wire.d.ts +9 -0
- package/dist/bridge/mux-wire.js +19 -0
- package/dist/bridge/opencode-pane-server.d.ts +113 -0
- package/dist/bridge/opencode-pane-server.js +332 -0
- package/dist/bridge/opencode-panes.d.ts +111 -0
- package/dist/bridge/opencode-panes.js +295 -0
- package/dist/bridge/pane-accounts.d.ts +8 -0
- package/dist/bridge/pane-accounts.js +46 -0
- package/dist/bridge/prompt-startup.d.ts +5 -0
- package/dist/bridge/prompt-startup.js +24 -0
- package/dist/bridge/protocol.d.ts +5 -0
- package/dist/bridge/protocol.js +4 -0
- package/dist/bridge/push.d.ts +5 -4
- package/dist/bridge/push.js +6 -4
- package/dist/bridge/questions.d.ts +37 -2
- package/dist/bridge/questions.js +158 -15
- package/dist/bridge/resources.d.ts +125 -0
- package/dist/bridge/resources.js +314 -0
- package/dist/bridge/schedule-format.d.ts +2 -0
- package/dist/bridge/schedule-format.js +3 -0
- package/dist/bridge/schedule-launch.d.ts +2 -1
- package/dist/bridge/schedule-launch.js +23 -53
- package/dist/bridge/schedule-watch.d.ts +10 -1
- package/dist/bridge/schedule-watch.js +54 -2
- package/dist/bridge/server-launch.d.ts +22 -5
- package/dist/bridge/server-launch.js +225 -29
- package/dist/bridge/server-overview.d.ts +8 -2
- package/dist/bridge/server-overview.js +26 -5
- package/dist/bridge/server-pane-routes.d.ts +2 -0
- package/dist/bridge/server-pane-routes.js +145 -15
- package/dist/bridge/server-routes.d.ts +11 -1
- package/dist/bridge/server-routes.js +195 -36
- package/dist/bridge/server-stream.d.ts +2 -0
- package/dist/bridge/server-stream.js +22 -8
- package/dist/bridge/server.d.ts +6 -1
- package/dist/bridge/server.js +47 -12
- package/dist/bridge/session-activity.d.ts +81 -0
- package/dist/bridge/session-activity.js +117 -0
- package/dist/bridge/session-rename.d.ts +48 -0
- package/dist/bridge/session-rename.js +190 -0
- package/dist/bridge/session-servers.js +2 -2
- package/dist/bridge/settings-switch.d.ts +60 -0
- package/dist/bridge/settings-switch.js +287 -0
- package/dist/bridge/speech-voice.d.ts +55 -0
- package/dist/bridge/speech-voice.js +132 -0
- package/dist/bridge/speech.d.ts +70 -11
- package/dist/bridge/speech.js +169 -41
- package/dist/bridge/terminal-herdr.js +9 -3
- package/dist/bridge/terminal-tmux.d.ts +3 -3
- package/dist/bridge/terminal-tmux.js +24 -9
- package/dist/bridge/terminal.d.ts +27 -4
- package/dist/bridge/terminal.js +8 -1
- package/dist/bridge/transcript-claude.js +62 -12
- package/dist/bridge/transcript-codex.d.ts +0 -2
- package/dist/bridge/transcript-codex.js +29 -4
- package/dist/bridge/transcript-preview.d.ts +1 -0
- package/dist/bridge/transcript-preview.js +24 -4
- package/dist/bridge/transcripts.d.ts +15 -2
- package/dist/bridge/transcripts.js +47 -16
- package/dist/bridge/turn-records.d.ts +85 -0
- package/dist/bridge/turn-records.js +143 -0
- package/dist/bridge/uploads.d.ts +3 -0
- package/dist/bridge/uploads.js +14 -0
- package/dist/bridge/usage.d.ts +73 -28
- package/dist/bridge/usage.js +313 -340
- package/dist/bridge-hook.mjs +24624 -18450
- package/dist/cli/claude-unmanaged.d.ts +12 -0
- package/dist/cli/claude-unmanaged.js +105 -0
- package/dist/cli/schedules.js +2 -1
- package/dist/cli/session-start.js +10 -1
- package/dist/cli/session-stop.js +9 -1
- package/dist/cli-registry.d.ts +2 -0
- package/dist/cli-registry.js +37 -5
- package/dist/computers/command.d.ts +6 -0
- package/dist/computers/command.js +152 -0
- package/dist/computers/mcp.d.ts +1 -0
- package/dist/computers/mcp.js +97 -0
- package/dist/computers/read.d.ts +85 -0
- package/dist/computers/read.js +177 -0
- package/dist/data/task-receipts.d.ts +19 -0
- package/dist/data/task-receipts.js +68 -0
- package/dist/data/tasks.js +4 -1
- package/dist/entrypoint.js +10 -0
- package/dist/fanout/adapters/claude.js +15 -2
- package/dist/fanout/adapters/types.d.ts +6 -0
- package/dist/fanout/launcher.d.ts +5 -1
- package/dist/fanout/launcher.js +34 -3
- package/dist/fanout/picker.js +3 -2
- package/dist/fanout/usage.js +1 -1
- package/dist/generated/memory-ui-graph.browser.js +63 -63
- package/dist/graph-core/model.js +24 -3
- package/dist/graph-core/types.d.ts +4 -1
- package/dist/graph-core/types.js +1 -0
- package/dist/init/init-preset.js +7 -3
- package/dist/init/init-uninstall.js +2 -11
- package/dist/init/teardown.d.ts +3 -0
- package/dist/init/teardown.js +47 -0
- package/dist/link/context.js +21 -9
- package/dist/mcp/plugin-mode.js +1 -1
- package/dist/memory-ui-graph.runtime.js +63 -63
- package/dist/modules/code-package.d.ts +1 -0
- package/dist/modules/code-package.js +36 -7
- package/dist/modules/registry.js +14 -13
- package/dist/profile-store.d.ts +6 -0
- package/dist/profile-store.js +25 -1
- package/dist/shell/graph/glyphs.js +4 -0
- package/dist/shell/graph/graph-view.js +2 -0
- package/dist/status.js +7 -1
- package/dist/sync/task-claim.js +3 -2
- package/dist/task/lifecycle.js +25 -4
- package/dist/test-global-setup.js +5 -0
- package/dist/tools/dispatch.js +35 -2
- package/dist/tools/tasks.js +10 -1
- package/package.json +1 -1
- package/plugins/opencode/phren-transcript.js +87 -4
- package/starter/global/skills/conductor/SKILL.md +17 -2
- package/starter/global/skills/fanout/SKILL.md +3 -0
|
@@ -17,6 +17,9 @@ export declare class PushBindingStore {
|
|
|
17
17
|
consume(binding: string): PushBinding | undefined;
|
|
18
18
|
/** The binding's action without spending it: a tap that opens the app. */
|
|
19
19
|
peek(binding: string): PushBinding | undefined;
|
|
20
|
+
/** Keeps an action's bindings answerable until `expiresAt`: an ask its
|
|
21
|
+
* agent still lists must stay answerable from its notification. */
|
|
22
|
+
extendAction(action: string, expiresAt: number): void;
|
|
20
23
|
dropAction(action: string): void;
|
|
21
24
|
clear(): void;
|
|
22
25
|
get size(): number;
|
|
@@ -42,6 +42,11 @@ export class PushBindingStore {
|
|
|
42
42
|
const value = this.values.get(binding);
|
|
43
43
|
return value && value.expiresAt > this.now() ? value : undefined;
|
|
44
44
|
}
|
|
45
|
+
/** Keeps an action's bindings answerable until `expiresAt`: an ask its
|
|
46
|
+
* agent still lists must stay answerable from its notification. */
|
|
47
|
+
extendAction(action, expiresAt) { for (const value of this.values.values())
|
|
48
|
+
if (value.action === action && value.expiresAt < expiresAt)
|
|
49
|
+
value.expiresAt = expiresAt; }
|
|
45
50
|
dropAction(action) { for (const [key, value] of this.values)
|
|
46
51
|
if (value.action === action)
|
|
47
52
|
this.values.delete(key); }
|
|
@@ -1,33 +1,88 @@
|
|
|
1
1
|
import { type ModuleSnapshot } from "../modules/runtime.js";
|
|
2
|
-
import { type ServerResponse } from "node:http";
|
|
3
2
|
import { type Json, type Provider, type Target } from "./protocol.js";
|
|
4
3
|
import { ToolChanges } from "./changes.js";
|
|
5
4
|
import { ApprovalPushService } from "./push.js";
|
|
5
|
+
import { type RequestKind } from "./approval-summary.js";
|
|
6
6
|
import { type DialogAnswer, type DialogQuestion } from "./claude-question-dialog.js";
|
|
7
7
|
import { type TerminalChoice } from "./terminal-choice.js";
|
|
8
8
|
import { ApprovalWatchLeases } from "./agent-hook-stores.js";
|
|
9
|
+
import type { AppServerRequestId, PendingServerRequest } from "./codex-app-server.js";
|
|
10
|
+
import { PaneServerWatcher, type PaneAsks } from "./opencode-panes.js";
|
|
11
|
+
import type { PaneClient, PaneServerEntry } from "./opencode-pane-server.js";
|
|
9
12
|
export { permissionPrompt, terminalChoice, visibleTerminalChoice, type TerminalChoice, type TerminalQuestion } from "./terminal-choice.js";
|
|
10
13
|
export { ApprovalWatchLeases, PushBindingStore, recordedSession } from "./agent-hook-stores.js";
|
|
14
|
+
/** Where a held request's answer goes: the callback's HTTP response, or the
|
|
15
|
+
* reply to a Codex app-server request (codex-servers.ts). Either takes the
|
|
16
|
+
* PermissionRequest-shaped JSON; "{}" gives the request back to the terminal. */
|
|
17
|
+
interface HeldReply {
|
|
18
|
+
end(body: string): unknown;
|
|
19
|
+
readonly destroyed: boolean;
|
|
20
|
+
}
|
|
11
21
|
interface Pending {
|
|
12
22
|
target: Target;
|
|
13
|
-
response:
|
|
23
|
+
response: HeldReply;
|
|
14
24
|
tool: string;
|
|
15
25
|
input: unknown;
|
|
16
26
|
message: string;
|
|
27
|
+
request: string;
|
|
28
|
+
requestKind: RequestKind;
|
|
17
29
|
title?: string;
|
|
18
30
|
choice?: TerminalChoice;
|
|
19
31
|
expiresAt: string;
|
|
20
|
-
timer
|
|
32
|
+
timer?: NodeJS.Timeout;
|
|
21
33
|
conductor?: {
|
|
22
34
|
action: "dispatch" | "hand_off";
|
|
23
35
|
project?: string;
|
|
24
36
|
computer?: string;
|
|
25
37
|
};
|
|
38
|
+
/** A server request of the Hook's own Codex app-server: answered over RPC, never held on a timer. */
|
|
39
|
+
appServer?: {
|
|
40
|
+
requestId: AppServerRequestId;
|
|
41
|
+
answer: (result: Json) => void;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/** The approval card's tool and input for an app-server request, in the
|
|
45
|
+
* shapes `approvalSummary` and the phone already read for Codex's hook.
|
|
46
|
+
* Undefined for questions (`item/tool/requestUserInput`) and MCP
|
|
47
|
+
* elicitations, which stay in the pane. */
|
|
48
|
+
export declare function appServerApproval(request: PendingServerRequest): {
|
|
49
|
+
tool: string;
|
|
50
|
+
input: Json;
|
|
51
|
+
} | undefined;
|
|
52
|
+
/** The app-server's answer for the phone's allow or deny (T3's
|
|
53
|
+
* CodexSessionRuntime shapes: accept / decline, a permission grant or none). */
|
|
54
|
+
export declare function appServerDecision(request: PendingServerRequest, allow: boolean): Json;
|
|
55
|
+
/** What a dispatched worker's Hook tells the dispatching Hook it is waiting on:
|
|
56
|
+
* a card without the request's full message or details, which can run to 32 KB
|
|
57
|
+
* and cross SSH on every poll. */
|
|
58
|
+
export interface ForwardedApproval {
|
|
59
|
+
actionId: string;
|
|
60
|
+
tool: string;
|
|
61
|
+
title?: string;
|
|
62
|
+
request?: string;
|
|
63
|
+
requestKind?: RequestKind;
|
|
64
|
+
expiresAt?: string;
|
|
65
|
+
/** The pane is drawing this as a terminal dialog; the answer types its keys. */
|
|
66
|
+
terminal?: true;
|
|
67
|
+
conductor?: Pending["conductor"];
|
|
68
|
+
/** This Hook already pushed the request to a phone, so the dispatching Hook does not push it again. */
|
|
69
|
+
pushed?: true;
|
|
26
70
|
}
|
|
27
71
|
/** A conductor `dispatch` or `hand_off` permission ask the Hook can answer
|
|
28
72
|
* itself under a standing grant, or offer the phone two grant-writing answers. */
|
|
29
73
|
export declare function conductorCall(tool: string, input: unknown): Pending["conductor"] | undefined;
|
|
30
74
|
export type DeliveryOutcome = "delivered" | "blocked" | "pending";
|
|
75
|
+
/** A phone message the Hook answered as delivered or queued, kept under the
|
|
76
|
+
* phone's delivery id so the phone can ask what became of it by that id.
|
|
77
|
+
* Holds a hash of the prompt's words, never the prompt. */
|
|
78
|
+
interface TrackedDelivery {
|
|
79
|
+
source: Provider;
|
|
80
|
+
session: string;
|
|
81
|
+
key: string;
|
|
82
|
+
state: "queued" | "delivered" | "blocked";
|
|
83
|
+
at: number;
|
|
84
|
+
}
|
|
85
|
+
export type TrackedState = TrackedDelivery["state"] | "unknown";
|
|
31
86
|
/** This socket is deliberately separate from the phone's HTTP pipe. Only local
|
|
32
87
|
* agent callbacks can register identities or create an approval request. */
|
|
33
88
|
export declare class AgentHooks {
|
|
@@ -41,6 +96,8 @@ export declare class AgentHooks {
|
|
|
41
96
|
* party that knows which conversation consumed the text, so it is the one
|
|
42
97
|
* that can refuse it when that is not the conversation the phone meant. */
|
|
43
98
|
private deliveries;
|
|
99
|
+
/** Phone messages by delivery id, until TRACK_MS: see `trackDelivery`. */
|
|
100
|
+
private tracked;
|
|
44
101
|
/** The permission request a conversation is drawing in its own terminal
|
|
45
102
|
* because nobody was there to hold it: what the phone shows above its
|
|
46
103
|
* answer keys until the pane stops waiting. `dialog` marks a choice parsed
|
|
@@ -74,8 +131,18 @@ export declare class AgentHooks {
|
|
|
74
131
|
* action, what an answer from the notification types. */
|
|
75
132
|
private dialogPushes;
|
|
76
133
|
private dialogActions;
|
|
77
|
-
/**
|
|
134
|
+
/** Terminal dialogs offered to a dispatching Hook, by pane: the `dialog-` action minted for the dialog's current title. */
|
|
135
|
+
private forwardedDialogs;
|
|
136
|
+
/** Requests this Hook pushed to its own phone on behalf of a dispatched worker on another computer: action -> the answer to send back. */
|
|
137
|
+
private forwardedPushes;
|
|
138
|
+
/** Panes a dispatching Hook polled lately (`server\npane\nsource` -> expiry). */
|
|
139
|
+
private dispatchLeases;
|
|
140
|
+
/** opencode permission asks seen on disk or listed by a served pane, by request id. */
|
|
78
141
|
private opencode;
|
|
142
|
+
/** Questions served OpenCode panes are asking, by question id. */
|
|
143
|
+
private servedQuestions;
|
|
144
|
+
/** One event subscription per served OpenCode pane; ticked with the Hook. */
|
|
145
|
+
readonly paneServers: PaneServerWatcher;
|
|
79
146
|
private closed;
|
|
80
147
|
private opencodeSweep?;
|
|
81
148
|
private opencodeLive;
|
|
@@ -88,6 +155,9 @@ export declare class AgentHooks {
|
|
|
88
155
|
private fanoutSeen;
|
|
89
156
|
private fanoutTimer?;
|
|
90
157
|
private fanoutArchiveTimer?;
|
|
158
|
+
/** The name the phone paired with (macOS Computer Name), for approval alerts;
|
|
159
|
+
* the short host name until that lookup answers. */
|
|
160
|
+
private computerName;
|
|
91
161
|
constructor(push?: ApprovalPushService, modules?: ModuleSnapshot | undefined);
|
|
92
162
|
private approvalsDirectory;
|
|
93
163
|
private scheduleOpencodeSweep;
|
|
@@ -97,6 +167,30 @@ export declare class AgentHooks {
|
|
|
97
167
|
* forgotten. */
|
|
98
168
|
sweepOpencodeApprovals(): Promise<void>;
|
|
99
169
|
private readOpencodeApprovals;
|
|
170
|
+
/** The pane a served OpenCode ask belongs to, as the phone names it: the
|
|
171
|
+
* pane's place from its terminal, and the root of the asking session (a
|
|
172
|
+
* subagent's ask shows on the conversation the pane shows). */
|
|
173
|
+
private servedTarget;
|
|
174
|
+
/** Everything a served pane is asking right now. New asks become the same
|
|
175
|
+
* cards (and pushes) as the plugin's file asks; asks no longer listed were
|
|
176
|
+
* answered in the TUI or went away, and their cards go with them. */
|
|
177
|
+
servedAsks(entry: PaneServerEntry, client: PaneClient, asks: PaneAsks): Promise<void>;
|
|
178
|
+
/** A served pane's process is gone: nothing it asked can be answered. */
|
|
179
|
+
servedGone(key: string): void;
|
|
180
|
+
/** The question a served OpenCode pane is asking, in the shape the phone
|
|
181
|
+
* answers Claude's AskUserQuestion with (`/v1/questions/answer`). */
|
|
182
|
+
servedQuestion(target: Target): Json | undefined;
|
|
183
|
+
private servedClient;
|
|
184
|
+
/** Answers a served pane's permission ask over its own API. */
|
|
185
|
+
private answerServed;
|
|
186
|
+
/** The phone's answers to a served pane's question: the labels it chose
|
|
187
|
+
* (and a typed answer) per question, for exactly the questions it shows. */
|
|
188
|
+
answerServedQuestion(target: Target, questions: DialogQuestion[], answers: DialogAnswer[]): Promise<void>;
|
|
189
|
+
/** Keys the phone sends to a served OpenCode pane that its API answers
|
|
190
|
+
* better than the terminal: Esc declines a pending question or stops a
|
|
191
|
+
* working turn (`session.abort`), and a digit answers a pending
|
|
192
|
+
* single-question, single-choice set. False leaves the keys to the pane. */
|
|
193
|
+
servedKeys(target: Target, keys: readonly string[], status: string): Promise<boolean>;
|
|
100
194
|
/** A session's exact pane. A recorded binding carries the full target; when
|
|
101
195
|
* there is none, Herdr's explicit session identity names the pane. */
|
|
102
196
|
private resolveTarget;
|
|
@@ -113,18 +207,32 @@ export declare class AgentHooks {
|
|
|
113
207
|
* after `waitMs`: a busy agent queues typed input and submits it only when
|
|
114
208
|
* its turn ends, so the record outlives the wait (up to ten minutes) and a
|
|
115
209
|
* late submission to the wrong conversation is still refused. */
|
|
116
|
-
expectDelivery(target: Target, text: string, waitMs?: number): Promise<DeliveryOutcome>;
|
|
210
|
+
expectDelivery(target: Target, text: string, waitMs?: number, signal?: AbortSignal): Promise<DeliveryOutcome>;
|
|
117
211
|
/** A prompt Phren typed into `target` that its conversation has not submitted yet. */
|
|
118
212
|
deliveryPending(target: Target, text: string): boolean;
|
|
119
213
|
/** Wait again for a delivery `expectDelivery` already reported pending,
|
|
120
214
|
* after the Hook pressed Enter a second time. */
|
|
121
215
|
awaitLateDelivery(target: Target, text: string, waitMs?: number): Promise<DeliveryOutcome>;
|
|
216
|
+
/** Remember a phone message's outcome under its delivery id. A queued one
|
|
217
|
+
* is tracked only while its typed record still waits for the agent's hook,
|
|
218
|
+
* so the hook's later answer always reaches it (`settleTracked`). */
|
|
219
|
+
trackDelivery(id: string, target: Target, text: string, state: "queued" | "delivered"): void;
|
|
220
|
+
/** What became of the phone message `id` sent to `target`'s conversation:
|
|
221
|
+
* queued until the agent submits it, then delivered, or blocked when
|
|
222
|
+
* another conversation in the pane took it. Unknown when the Hook did not
|
|
223
|
+
* track it, it was for another conversation, or it is older than TRACK_MS. */
|
|
224
|
+
deliveryState(id: string, target: Target): TrackedState;
|
|
225
|
+
/** The oldest queued message tracked for `delivery`'s conversation with these words. */
|
|
226
|
+
private settleTracked;
|
|
122
227
|
/** The conversation `target` just submitted `prompt`. Nothing Phren typed
|
|
123
228
|
* matches: a locally typed prompt, always allowed. Otherwise the oldest
|
|
124
229
|
* matching delivery decides: its own conversation consumes it; any other
|
|
125
230
|
* conversation is told to drop it, so the text is never spoken to the
|
|
126
231
|
* wrong agent and the phone can safely send it again. */
|
|
127
232
|
private submitted;
|
|
233
|
+
/** The conversation's own turn events, for dispatch returns (turn-records.ts).
|
|
234
|
+
* A failed write never fails the agent's callback. */
|
|
235
|
+
private recordTurn;
|
|
128
236
|
private rememberTerminalPrompt;
|
|
129
237
|
/** The request the agent is showing in its terminal, if one fell through
|
|
130
238
|
* in the last fifteen minutes; the caller only asks while the pane waits. */
|
|
@@ -216,13 +324,59 @@ export declare class AgentHooks {
|
|
|
216
324
|
* hook behind it, so this is the only way it reaches a phone with phren
|
|
217
325
|
* closed. Each dialog is pushed once; a pane that stops waiting drops it. */
|
|
218
326
|
observeWaitingPanes(server: string, panes: Json[], resolve: (pane: Json) => Promise<Target | undefined>): Promise<void>;
|
|
327
|
+
/** Keeps the held asks of these dispatched panes for the dispatching Hook's
|
|
328
|
+
* next polls: without a phone, a watcher or push here, a worker's request
|
|
329
|
+
* would go straight to its terminal and only its `blocked` state would
|
|
330
|
+
* reach the conductor. Keyed by pane, since a worker that has not yet
|
|
331
|
+
* reported a conversation has no session. */
|
|
332
|
+
leaseDispatch(targets: readonly {
|
|
333
|
+
server: string;
|
|
334
|
+
pane: string;
|
|
335
|
+
source: string;
|
|
336
|
+
}[]): void;
|
|
337
|
+
private dispatchLeased;
|
|
338
|
+
private dropForwardedDialog;
|
|
339
|
+
/** What this pane's worker is waiting on, for the dispatching Hook: the held
|
|
340
|
+
* or app-server request, else the terminal dialog the pane draws (offered
|
|
341
|
+
* under a `dialog-` action the answer route accepts). */
|
|
342
|
+
workerApproval(target: Target): ForwardedApproval | undefined;
|
|
343
|
+
/** A worker's request on another computer, sent to this Hook's own phone:
|
|
344
|
+
* the notification's answer calls `answer`, which sends it back over the
|
|
345
|
+
* dispatch path. */
|
|
346
|
+
pushForwarded(summary: {
|
|
347
|
+
provider: string;
|
|
348
|
+
computer: string;
|
|
349
|
+
project?: string;
|
|
350
|
+
request: string;
|
|
351
|
+
requestKind?: RequestKind;
|
|
352
|
+
}, answer: (decision: "approve" | "deny") => Promise<void>): void;
|
|
219
353
|
private adoptReleasedHold;
|
|
220
354
|
private dropDialogPush;
|
|
355
|
+
/** The dialog a pane's screen shows now. Codex draws "> 1. Yes, proceed (y)"
|
|
356
|
+
* rows and Copilot a boxed select with a cursor row, both answered by moving
|
|
357
|
+
* to a row; OpenCode's prompt is one row of options whose cursor is only a
|
|
358
|
+
* color; the other fallbacks number rows without a key in the label. */
|
|
359
|
+
private screenDialog;
|
|
221
360
|
/** Approve picks the dialog's yes/allow row (else its first), Deny its
|
|
222
361
|
* no/deny row (else Escape), typed as the pane's own keys. */
|
|
223
362
|
private answerDialog;
|
|
224
363
|
private dropPushBindings;
|
|
364
|
+
/** A server request from one of the Hook's own Codex app-servers: an
|
|
365
|
+
* approval card like a held PermissionRequest, pushed the same way, but
|
|
366
|
+
* with no hold timer. The request stays parked in Codex until someone
|
|
367
|
+
* answers it, here or in the pane's TUI (`codexResolved`). */
|
|
368
|
+
codexRequest(target: Target, request: PendingServerRequest, answer: (result: Json) => void): void;
|
|
369
|
+
/** Another client (the pane's TUI) answered the request, or this one declined it. */
|
|
370
|
+
codexResolved(target: Target, requestId: AppServerRequestId): void;
|
|
225
371
|
start(): Promise<void>;
|
|
226
372
|
close(): void;
|
|
227
373
|
}
|
|
374
|
+
/** What a Stop payload says about the turn it ends: the harness's last
|
|
375
|
+
* assistant message (Claude, Codex) and, from Claude Code, the background
|
|
376
|
+
* tasks still in flight, which will wake the conversation again when they
|
|
377
|
+
* finish. Absent fields are left out, so the Hook falls back to the transcript. */
|
|
378
|
+
export declare function stopFacts(value: Json): {
|
|
379
|
+
background?: number;
|
|
380
|
+
reply?: string;
|
|
381
|
+
};
|
|
228
382
|
export declare function agentHook(source: Provider): Promise<void>;
|