@raidiant/notifai 9.2.2 → 10.0.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.
- package/CHANGELOG.md +45 -0
- package/README.md +8 -5
- package/dist/claude-wake.js +11 -0
- package/dist/claude-wake.js.map +1 -1
- package/dist/client.d.ts +3 -1
- package/dist/client.js +2 -0
- package/dist/client.js.map +1 -1
- package/dist/codex-wake.js +9 -0
- package/dist/codex-wake.js.map +1 -1
- package/dist/commands-agent-sessions.d.ts +6 -0
- package/dist/commands-agent-sessions.js +51 -0
- package/dist/commands-agent-sessions.js.map +1 -0
- package/dist/commands-config.js +11 -4
- package/dist/commands-config.js.map +1 -1
- package/dist/commands-core.d.ts +1 -1
- package/dist/commands-doctor.js +83 -6
- package/dist/commands-doctor.js.map +1 -1
- package/dist/commands-harness-context.d.ts +15 -2
- package/dist/commands-harness-context.js +32 -1
- package/dist/commands-harness-context.js.map +1 -1
- package/dist/commands-hook-shape.d.ts +4 -3
- package/dist/commands-hook-shape.js +19 -10
- package/dist/commands-hook-shape.js.map +1 -1
- package/dist/commands-hooks.d.ts +4 -3
- package/dist/commands-hooks.js +80 -23
- package/dist/commands-hooks.js.map +1 -1
- package/dist/commands-init.js +12 -1
- package/dist/commands-init.js.map +1 -1
- package/dist/commands-project.d.ts +4 -0
- package/dist/commands-project.js +41 -0
- package/dist/commands-project.js.map +1 -0
- package/dist/commands-send-support.js +0 -4
- package/dist/commands-send-support.js.map +1 -1
- package/dist/commands-send.js +12 -6
- package/dist/commands-send.js.map +1 -1
- package/dist/commands-skill.js +58 -0
- package/dist/commands-skill.js.map +1 -1
- package/dist/commands-sounds.d.ts +12 -0
- package/dist/commands-sounds.js +35 -0
- package/dist/commands-sounds.js.map +1 -0
- package/dist/commands.d.ts +3 -0
- package/dist/commands.js +3 -0
- package/dist/commands.js.map +1 -1
- package/dist/config-schema.js +7 -4
- package/dist/config-schema.js.map +1 -1
- package/dist/config.d.ts +6 -7
- package/dist/config.js +9 -9
- package/dist/config.js.map +1 -1
- package/dist/credentials.js +4 -1
- package/dist/credentials.js.map +1 -1
- package/dist/guidance-content.d.ts +3 -0
- package/dist/guidance-content.js +20 -0
- package/dist/guidance-content.js.map +1 -1
- package/dist/guidance-render.js +3 -3
- package/dist/guidance-render.js.map +1 -1
- package/dist/harnesses.d.ts +49 -7
- package/dist/harnesses.js +90 -24
- package/dist/harnesses.js.map +1 -1
- package/dist/hooks.d.ts +28 -52
- package/dist/hooks.js +393 -152
- package/dist/hooks.js.map +1 -1
- package/dist/install-hooks.d.ts +17 -39
- package/dist/install-hooks.js +21 -41
- package/dist/install-hooks.js.map +1 -1
- package/dist/invocation-context.d.ts +2 -2
- package/dist/orca-session-title.d.ts +2 -2
- package/dist/orca-session-title.js +3 -4
- package/dist/orca-session-title.js.map +1 -1
- package/dist/program.d.ts +6 -1
- package/dist/program.js +46 -5
- package/dist/program.js.map +1 -1
- package/dist/project-enablement.d.ts +15 -0
- package/dist/project-enablement.js +87 -0
- package/dist/project-enablement.js.map +1 -0
- package/dist/question-timing.d.ts +46 -0
- package/dist/question-timing.js +48 -0
- package/dist/question-timing.js.map +1 -0
- package/dist/readiness.d.ts +7 -0
- package/dist/readiness.js.map +1 -1
- package/dist/send.d.ts +2 -0
- package/dist/send.js +17 -15
- package/dist/send.js.map +1 -1
- package/dist/session-activation.d.ts +1 -1
- package/dist/session-activation.js +3 -4
- package/dist/session-activation.js.map +1 -1
- package/dist/session-labels.d.ts +18 -2
- package/dist/session-labels.js +79 -8
- package/dist/session-labels.js.map +1 -1
- package/dist/sound-ref.d.ts +23 -0
- package/dist/sound-ref.js +28 -0
- package/dist/sound-ref.js.map +1 -0
- package/package.json +3 -3
- package/src/claude-wake.test.ts +1 -0
- package/src/claude-wake.ts +10 -0
- package/src/client.test.ts +12 -0
- package/src/client.ts +8 -0
- package/src/codex-wake.test.ts +1 -0
- package/src/codex-wake.ts +9 -0
- package/src/commands-agent-sessions.ts +72 -0
- package/src/commands-config.ts +10 -4
- package/src/commands-core.ts +1 -1
- package/src/commands-doctor.ts +96 -8
- package/src/commands-harness-context.ts +48 -2
- package/src/commands-hook-shape.ts +26 -10
- package/src/commands-hooks.ts +95 -31
- package/src/commands-init.ts +11 -1
- package/src/commands-project.ts +47 -0
- package/src/commands-send-support.ts +0 -4
- package/src/commands-send.ts +10 -5
- package/src/commands-skill.test.ts +44 -0
- package/src/commands-skill.ts +57 -0
- package/src/commands-sounds.test.ts +106 -0
- package/src/commands-sounds.ts +49 -0
- package/src/commands.test.ts +386 -23
- package/src/commands.ts +10 -0
- package/src/config-schema.test.ts +1 -0
- package/src/config-schema.ts +7 -4
- package/src/config.test.ts +44 -23
- package/src/config.ts +13 -15
- package/src/credentials.test.ts +20 -0
- package/src/credentials.ts +4 -1
- package/src/fixtures/hermes-0.20.6-classic-cli-local.json +50 -0
- package/src/guidance-content.ts +22 -0
- package/src/guidance-render.ts +3 -3
- package/src/harness-integration.test.ts +212 -0
- package/src/harnesses.test.ts +107 -8
- package/src/harnesses.ts +111 -30
- package/src/hook-adapter.test.ts +27 -8
- package/src/hooks.test.ts +812 -83
- package/src/hooks.ts +529 -185
- package/src/install-hooks.test.ts +13 -16
- package/src/install-hooks.ts +40 -58
- package/src/invocation-context.ts +2 -2
- package/src/orca-session-title.test.ts +8 -49
- package/src/orca-session-title.ts +3 -5
- package/src/program.test.ts +45 -0
- package/src/program.ts +60 -4
- package/src/project-enablement.test.ts +55 -0
- package/src/project-enablement.ts +99 -0
- package/src/question-timing.ts +56 -0
- package/src/readiness.ts +8 -1
- package/src/send.ts +18 -20
- package/src/session-activation.ts +3 -4
- package/src/session-labels.test.ts +58 -9
- package/src/session-labels.ts +95 -12
- package/src/skill.test.ts +14 -3
- package/src/sound-ref.test.ts +31 -0
- package/src/sound-ref.ts +34 -0
- package/src/ui/config-view.test.ts +1 -0
package/dist/hooks.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { LifecycleEndState, MediaItemT, NotificationDraftT, QuestionT, Repl
|
|
|
2
2
|
import { type ApiClient } from './client.js';
|
|
3
3
|
import { type CliConfig } from './config.js';
|
|
4
4
|
import type { Logger } from './logging.js';
|
|
5
|
-
import { type DeliveryRoute, type
|
|
5
|
+
import { type DeliveryRoute, type HookInstallableHarness } from './harnesses.js';
|
|
6
6
|
/**
|
|
7
7
|
* Harness hook handlers.
|
|
8
8
|
*
|
|
@@ -12,12 +12,11 @@ import { type DeliveryRoute, type Harness } from './harnesses.js';
|
|
|
12
12
|
* proven exact-session continuation fail closed at question admission.
|
|
13
13
|
*
|
|
14
14
|
* Where the user is standing no longer decides anything here. It used to: the
|
|
15
|
-
* turn-end
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* configuration rather than implicitly with every keystroke.
|
|
15
|
+
* old turn-end route held the terminal briefly and made keyboard presence an
|
|
16
|
+
* input to whether it waited. The current policy is explicit instead: Claude
|
|
17
|
+
* Code owns the complete answer window out of band, while Codex owns it by
|
|
18
|
+
* holding the asking turn. Neither infers notification preference from
|
|
19
|
+
* keystrokes.
|
|
21
20
|
*/
|
|
22
21
|
/** Fields we read from harness hook JSON. Everything else is passed through. */
|
|
23
22
|
export interface HookEnvelope {
|
|
@@ -127,6 +126,11 @@ interface AcceptedAnswerDelivery {
|
|
|
127
126
|
* passes through.
|
|
128
127
|
*/
|
|
129
128
|
delivery_attempts?: number;
|
|
129
|
+
/**
|
|
130
|
+
* Linearization point between delivery and SessionEnd. Once recorded, the
|
|
131
|
+
* route began first; before it, SessionEnd cancellation wins.
|
|
132
|
+
*/
|
|
133
|
+
delivery_committed_at?: number;
|
|
130
134
|
/** Turns this answer has been held without being handed to the agent. */
|
|
131
135
|
held_deliveries?: number;
|
|
132
136
|
}
|
|
@@ -185,15 +189,13 @@ export interface PendingQuestion {
|
|
|
185
189
|
collapse_key?: string;
|
|
186
190
|
/** Exact fanout of the live question; routing config may change afterwards. */
|
|
187
191
|
device_ids?: string[];
|
|
188
|
-
/** Absolute end of the server reply window
|
|
192
|
+
/** Absolute end of the server reply window. */
|
|
189
193
|
reply_deadline_at?: number;
|
|
190
194
|
/**
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
* questions. Absent on state written before this field existed — treated as
|
|
196
|
-
* already spent, because that is the shape a degraded waiter left behind.
|
|
195
|
+
* Absolute process-owner deadline. It begins before submission and includes
|
|
196
|
+
* startup headroom, so it must be later than `reply_deadline_at`. Absent on
|
|
197
|
+
* state written before ownership was persisted — treated as already spent
|
|
198
|
+
* instead of inventing a fresh multi-day claim.
|
|
197
199
|
*/
|
|
198
200
|
owner_deadline_at?: number;
|
|
199
201
|
/** Frozen before the first network byte, so an ambiguous submit is replayable. */
|
|
@@ -207,51 +209,17 @@ interface PendingSubmissionIntent {
|
|
|
207
209
|
draft: NotificationDraftT;
|
|
208
210
|
owner_deadline_at: number;
|
|
209
211
|
}
|
|
210
|
-
/**
|
|
211
|
-
* The waiter's whole wall clock: the terminal-first timer, submission, and the
|
|
212
|
-
* wait for an answer, from the moment the turn-end hook starts.
|
|
213
|
-
*
|
|
214
|
-
* One plain ceiling, deliberately not a budget carved into reserves. The
|
|
215
|
-
* reserves existed to fit every phase inside a *held* turn; on Claude Code the
|
|
216
|
-
* turn is not held any more, and on a host that still holds one the useful
|
|
217
|
-
* question is only how long that host is willing to wait in total.
|
|
218
|
-
*/
|
|
219
|
-
export declare const WAITER_CEILING_SECONDS = 480;
|
|
220
|
-
/**
|
|
221
|
-
* The same wall clock where the waiter runs in the background instead of
|
|
222
|
-
* inside a held turn.
|
|
223
|
-
*
|
|
224
|
-
* On a host that holds its turn, 480 s is a real cost to the person sitting in
|
|
225
|
-
* front of it, and the number above is right. On Claude Code the Stop hook
|
|
226
|
-
* returns at once and the waiter is detached, so the same 480 s buys nothing
|
|
227
|
-
* and costs a direct wake: an answer arriving at minute nine had to wait for
|
|
228
|
-
* the session's next turn even though nothing was blocked.
|
|
229
|
-
*
|
|
230
|
-
* This sits under `CLAUDE_ASYNC_STOP_TIMEOUT_SECONDS` (3600) with headroom,
|
|
231
|
-
* because that declaration's kill is silent, and under the reply window the
|
|
232
|
-
* question was pushed with. Past it the journal still delivers at the next
|
|
233
|
-
* turn — the ceiling decides how long a *direct* wake stays possible, never
|
|
234
|
-
* whether the answer survives.
|
|
235
|
-
*/
|
|
236
|
-
export declare const DETACHED_WAITER_CEILING_SECONDS = 3300;
|
|
237
|
-
/** The waiter's wall clock, which depends on whether a turn is held open for it. */
|
|
238
|
-
export declare function waiterCeilingSeconds(detached: boolean): number;
|
|
239
212
|
/**
|
|
240
213
|
* The wire contract's shortest reply window. A question submitted with less
|
|
241
214
|
* than this is rejected outright, and accepting one would in any case let the
|
|
242
215
|
* server go on taking an answer after the waiter that owns it has returned.
|
|
243
216
|
*/
|
|
244
217
|
export declare const MIN_REPLY_WINDOW_SECONDS = 60;
|
|
245
|
-
/**
|
|
246
|
-
* HTTP budget reserved for the waiter's final reply fetch and close fence.
|
|
247
|
-
* Taken from the owner deadline rather than added after it, so the hook does
|
|
248
|
-
* not block past its ceiling. A near-zero remainder used to produce a
|
|
249
|
-
* misleading 0s timeout and an unproven retirement.
|
|
250
|
-
*/
|
|
251
|
-
export declare const FINALIZATION_NETWORK_BUDGET_SECONDS = 3;
|
|
252
218
|
export interface HookOutcome {
|
|
253
219
|
/** Written to stdout verbatim — the harness parses this as output. */
|
|
254
220
|
stdout?: string;
|
|
221
|
+
/** Commit a blocking continuation immediately before the harness stdout write. */
|
|
222
|
+
commitStdout?: () => boolean;
|
|
255
223
|
/** Whether stdout takes over the turn, rather than adding prompt context. */
|
|
256
224
|
decided?: boolean;
|
|
257
225
|
/** Diagnostics; harnesses surface hook stderr in the transcript. */
|
|
@@ -266,6 +234,12 @@ export interface ContinuationEvent {
|
|
|
266
234
|
remaining: number;
|
|
267
235
|
request_ids: string[];
|
|
268
236
|
journal_recorded_at: number;
|
|
237
|
+
/**
|
|
238
|
+
* Must be called immediately before the route's irreversible harness write.
|
|
239
|
+
* It atomically orders that write against SessionEnd; false means cancellation
|
|
240
|
+
* won and the route must hand nothing over.
|
|
241
|
+
*/
|
|
242
|
+
commitDelivery(): boolean;
|
|
269
243
|
}
|
|
270
244
|
/**
|
|
271
245
|
* How much a route's own return proves about where the answer ended up.
|
|
@@ -292,6 +266,8 @@ export type DeliveryAcknowledgement = 'delivered' | 'stdout' | 'held';
|
|
|
292
266
|
/** What a route returns: the hook's outcome plus what the attempt proved. */
|
|
293
267
|
export interface DeliveryOutcome {
|
|
294
268
|
stdout?: string;
|
|
269
|
+
/** Deferred SessionEnd fence for a blocking stdout continuation. */
|
|
270
|
+
commitStdout?: () => boolean;
|
|
295
271
|
notes?: string[];
|
|
296
272
|
log?: Record<string, unknown>;
|
|
297
273
|
acknowledgement: DeliveryAcknowledgement;
|
|
@@ -330,7 +306,7 @@ export declare function confirmCursorStopActivation(sessionId: string, env: Node
|
|
|
330
306
|
/** A fresh/cleared Cursor lifecycle makes its next Stop the fallback owner again. */
|
|
331
307
|
export declare function resetCursorStopActivation(sessionId: string, env: NodeJS.ProcessEnv): void;
|
|
332
308
|
export declare function pruneAbandonedSessions(env: NodeJS.ProcessEnv, now?: number, maxAgeMs?: number): number;
|
|
333
|
-
export declare function claimQuestionPush(sessionId: string, env: NodeJS.ProcessEnv, now?: number, beforeStaleReplace?: () => void): boolean;
|
|
309
|
+
export declare function claimQuestionPush(sessionId: string, env: NodeJS.ProcessEnv, now?: number, beforeStaleReplace?: () => void, ownerDeadlineAt?: number): boolean;
|
|
334
310
|
export declare function releaseQuestionPush(sessionId: string, env: NodeJS.ProcessEnv): void;
|
|
335
311
|
export interface ProjectSessionPointer {
|
|
336
312
|
sessionId: string;
|
|
@@ -397,7 +373,7 @@ export declare const GATE_REASONS: readonly ["no-session", "no-question", "answe
|
|
|
397
373
|
* emitted once; documenting them taught agents to filter for silence.
|
|
398
374
|
*/
|
|
399
375
|
export type GateReason = (typeof GATE_REASONS)[number];
|
|
400
|
-
export type HookHarness =
|
|
376
|
+
export type HookHarness = HookInstallableHarness;
|
|
401
377
|
/**
|
|
402
378
|
* Everything retirement needs. Narrower than a HookContext on purpose:
|
|
403
379
|
* `notifai ask` supersedes the previous question and it is a plain command with
|