@raidiant/notifai 10.1.6 → 11.0.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.
- package/CHANGELOG.md +56 -0
- package/README.md +28 -16
- package/dist/claude-wake.d.ts +1 -2
- package/dist/claude-wake.js +15 -61
- package/dist/claude-wake.js.map +1 -1
- package/dist/cli-bin.js +3 -14
- package/dist/cli-bin.js.map +1 -1
- package/dist/cli-contract.d.ts +12 -0
- package/dist/cli-contract.js +19 -0
- package/dist/cli-contract.js.map +1 -0
- package/dist/cli-release.d.ts +0 -1
- package/dist/cli-release.js +5 -21
- package/dist/cli-release.js.map +1 -1
- package/dist/client.d.ts +2 -2
- package/dist/codex-wake.d.ts +1 -1
- package/dist/codex-wake.js +8 -36
- package/dist/codex-wake.js.map +1 -1
- package/dist/command-session.js +2 -1
- package/dist/command-session.js.map +1 -1
- package/dist/commands-acknowledge.d.ts +13 -0
- package/dist/commands-acknowledge.js +67 -0
- package/dist/commands-acknowledge.js.map +1 -0
- package/dist/commands-ask.d.ts +63 -0
- package/dist/commands-ask.js +407 -0
- package/dist/commands-ask.js.map +1 -0
- package/dist/commands-close.d.ts +6 -0
- package/dist/commands-close.js +197 -0
- package/dist/commands-close.js.map +1 -0
- package/dist/commands-config.js +2 -2
- package/dist/commands-config.js.map +1 -1
- package/dist/commands-core.js +2 -2
- package/dist/commands-core.js.map +1 -1
- package/dist/commands-doctor.js +89 -134
- package/dist/commands-doctor.js.map +1 -1
- package/dist/commands-harness-context.d.ts +0 -1
- package/dist/commands-harness-context.js +2 -4
- package/dist/commands-harness-context.js.map +1 -1
- package/dist/commands-hook-diagnostics.d.ts +27 -0
- package/dist/commands-hook-diagnostics.js +97 -0
- package/dist/commands-hook-diagnostics.js.map +1 -0
- package/dist/commands-hook-install.d.ts +26 -0
- package/dist/commands-hook-install.js +549 -0
- package/dist/commands-hook-install.js.map +1 -0
- package/dist/commands-hook-run.d.ts +29 -0
- package/dist/commands-hook-run.js +517 -0
- package/dist/commands-hook-run.js.map +1 -0
- package/dist/commands-init.d.ts +2 -7
- package/dist/commands-init.js +59 -92
- package/dist/commands-init.js.map +1 -1
- package/dist/commands-send.js +35 -3
- package/dist/commands-send.js.map +1 -1
- package/dist/commands-skill.js +5 -5
- package/dist/commands-skill.js.map +1 -1
- package/dist/commands-update.js +17 -31
- package/dist/commands-update.js.map +1 -1
- package/dist/commands.d.ts +11 -6
- package/dist/commands.js +9 -4
- package/dist/commands.js.map +1 -1
- package/dist/config-schema.js +2 -2
- package/dist/config-schema.js.map +1 -1
- package/dist/config.d.ts +14 -4
- package/dist/config.js +35 -9
- package/dist/config.js.map +1 -1
- package/dist/file-lock.d.ts +3 -0
- package/dist/file-lock.js +33 -17
- package/dist/file-lock.js.map +1 -1
- package/dist/guidance-content.js +30 -15
- package/dist/guidance-content.js.map +1 -1
- package/dist/harnesses.d.ts +2 -2
- package/dist/harnesses.js +10 -2
- package/dist/harnesses.js.map +1 -1
- package/dist/hook-acknowledgements.d.ts +42 -0
- package/dist/hook-acknowledgements.js +316 -0
- package/dist/hook-acknowledgements.js.map +1 -0
- package/dist/hook-adapter.js +7 -4
- package/dist/hook-adapter.js.map +1 -1
- package/dist/hook-events.d.ts +6 -0
- package/dist/hook-events.js +22 -0
- package/dist/hook-events.js.map +1 -0
- package/dist/hook-gates.d.ts +7 -0
- package/dist/hook-gates.js +21 -0
- package/dist/hook-gates.js.map +1 -0
- package/dist/hook-lifecycle.d.ts +93 -0
- package/dist/{hooks.js → hook-lifecycle.js} +61 -1359
- package/dist/hook-lifecycle.js.map +1 -0
- package/dist/hook-project-sessions.d.ts +28 -0
- package/dist/hook-project-sessions.js +141 -0
- package/dist/hook-project-sessions.js.map +1 -0
- package/dist/hook-question-lock.d.ts +7 -0
- package/dist/hook-question-lock.js +173 -0
- package/dist/hook-question-lock.js.map +1 -0
- package/dist/hook-question-retirement.d.ts +57 -0
- package/dist/hook-question-retirement.js +261 -0
- package/dist/hook-question-retirement.js.map +1 -0
- package/dist/hook-question-state.d.ts +45 -0
- package/dist/hook-question-state.js +196 -0
- package/dist/hook-question-state.js.map +1 -0
- package/dist/hook-session-state.d.ts +31 -0
- package/dist/hook-session-state.js +249 -0
- package/dist/hook-session-state.js.map +1 -0
- package/dist/{hooks.d.ts → hook-types.d.ts} +17 -236
- package/dist/hook-types.js +4 -0
- package/dist/hook-types.js.map +1 -0
- package/dist/install-hooks.d.ts +72 -60
- package/dist/install-hooks.js +292 -211
- package/dist/install-hooks.js.map +1 -1
- package/dist/interactive.d.ts +3 -16
- package/dist/interactive.js +19 -95
- package/dist/interactive.js.map +1 -1
- package/dist/local-path.d.ts +7 -0
- package/dist/local-path.js +27 -0
- package/dist/local-path.js.map +1 -0
- package/dist/node-floor.js +3 -10
- package/dist/node-floor.js.map +1 -1
- package/dist/npm-invocation.d.ts +34 -0
- package/dist/npm-invocation.js +53 -0
- package/dist/npm-invocation.js.map +1 -0
- package/dist/openclaw-plugin.d.ts +12 -3
- package/dist/openclaw-plugin.js +42 -16
- package/dist/openclaw-plugin.js.map +1 -1
- package/dist/opencode-plugin.d.ts +2 -2
- package/dist/opencode-plugin.js +4 -6
- package/dist/opencode-plugin.js.map +1 -1
- package/dist/program.js +11 -13
- package/dist/program.js.map +1 -1
- package/dist/project-enablement.d.ts +6 -0
- package/dist/project-enablement.js +11 -27
- package/dist/project-enablement.js.map +1 -1
- package/dist/question-settlement-process.d.ts +1 -1
- package/dist/readiness.d.ts +3 -3
- package/dist/readiness.js +14 -6
- package/dist/readiness.js.map +1 -1
- package/dist/send.d.ts +8 -4
- package/dist/send.js +145 -26
- package/dist/send.js.map +1 -1
- package/dist/session-activation.d.ts +3 -1
- package/dist/session-activation.js +16 -0
- package/dist/session-activation.js.map +1 -1
- package/dist/skill-source/manifest.json +4 -4
- package/dist/skill-source/notifai/SKILL.md +67 -63
- package/dist/skill-source/notifai/references/harness-setup.md +62 -28
- package/dist/ui/config-view.d.ts +0 -2
- package/dist/ui/config-view.js +1 -5
- package/dist/ui/config-view.js.map +1 -1
- package/dist/ui/theme.d.ts +0 -3
- package/dist/ui/theme.js +0 -1
- package/dist/ui/theme.js.map +1 -1
- package/dist/version.d.ts +22 -0
- package/dist/version.js +51 -0
- package/dist/version.js.map +1 -0
- package/dist/wake-support.d.ts +8 -0
- package/dist/wake-support.js +38 -0
- package/dist/wake-support.js.map +1 -0
- package/package.json +2 -2
- package/dist/cli-update-contract.d.ts +0 -7
- package/dist/cli-update-contract.js +0 -10
- package/dist/cli-update-contract.js.map +0 -1
- package/dist/commands-hooks.d.ts +0 -160
- package/dist/commands-hooks.js +0 -1798
- package/dist/commands-hooks.js.map +0 -1
- package/dist/hooks.js.map +0 -1
|
@@ -47,7 +47,7 @@ says the guidance exceeded its bound, read it once before judging an Agent Event
|
|
|
47
47
|
notifai guidance
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
`notifai guidance` prints `when-to-notify`, `titles`, `
|
|
50
|
+
`notifai guidance` prints `when-to-notify`, `titles`, `content`, `questions`, and
|
|
51
51
|
`acknowledgements` under `from=you`, `from=this repository`, then
|
|
52
52
|
`from=shipped default`. The first decides whether to notify; the others own the words.
|
|
53
53
|
|
|
@@ -95,6 +95,7 @@ and carry only Project context:
|
|
|
95
95
|
notifai send --kind done \
|
|
96
96
|
--session-label "Account creation" \
|
|
97
97
|
--title "Users can now create accounts" \
|
|
98
|
+
--summary "Sign-up, verification, and login now work on staging." \
|
|
98
99
|
--body "Sign-up, email verification, and login work end to end on staging. Next: password reset, unless you want something else first."
|
|
99
100
|
```
|
|
100
101
|
|
|
@@ -119,30 +120,36 @@ Work needs a User response to continue? Ask an answerable question — even if
|
|
|
119
120
|
blocked. Use one-way blocked only when no User reply would resume the work.
|
|
120
121
|
Reporting ready is a response.
|
|
121
122
|
|
|
122
|
-
|
|
123
|
-
body, and summary line carry. The shape on the wire:
|
|
123
|
+
`titles` and `content` guidance own each field. The wire shape:
|
|
124
124
|
|
|
125
125
|
- **Title** — stands alone; the kind and the Project travel as their own
|
|
126
126
|
fields, never in it.
|
|
127
|
-
- **
|
|
128
|
-
|
|
129
|
-
-
|
|
130
|
-
|
|
127
|
+
- **Summary** — required purpose-written one-line plain text for banners and
|
|
128
|
+
lists, hard limit 240 Unicode characters.
|
|
129
|
+
- **Body** — optional standalone Markdown for focused detail. It contains the
|
|
130
|
+
Summary's information plus useful detail; focused views show Body or Summary,
|
|
131
|
+
never both. Omit it when Summary is enough.
|
|
132
|
+
|
|
133
|
+
Use readable Markdown structure. Summary has no Markdown or media markup.
|
|
131
134
|
|
|
132
135
|
```bash
|
|
133
136
|
notifai send --kind failed \
|
|
134
137
|
--title "The pricing page isn't live" \
|
|
135
|
-
--
|
|
138
|
+
--summary "Rolled back cleanly; production still shows the old page." \
|
|
136
139
|
--body-file ./deploy-report.md
|
|
137
140
|
```
|
|
138
141
|
|
|
139
|
-
Use `--body-file <path|->` for
|
|
140
|
-
channel-neutral: never assume a phone, a desktop, or a gesture like "tap here".
|
|
142
|
+
Use `--body-file <path|->` for long content. Keep wording channel-neutral.
|
|
141
143
|
|
|
142
144
|
Other controls: `--thread-id` groups; `--collapse-key` replaces your earlier
|
|
143
|
-
matching notification; `--ttl` bounds useful delivery.
|
|
144
|
-
to 8 items, paired with `--image-alt`; `media:1`…`media:8` reference them.
|
|
145
|
+
matching notification; `--ttl` bounds useful delivery.
|
|
145
146
|
Use `notifai capabilities --platform <platform>` for destination contracts.
|
|
147
|
+
|
|
148
|
+
Repeat `--image <path|url>` (up to 8), paired with `--image-alt`; all reach the
|
|
149
|
+
gallery. Reference any or all in Body with Markdown image syntax:
|
|
150
|
+
`- Bob:  `. Bare `media:1`, `[…](media:1)`,
|
|
151
|
+
or a position with no `--image` is an error.
|
|
152
|
+
|
|
146
153
|
`--sound`, `--level`, and `--device` belong to the User.
|
|
147
154
|
`--sound` takes a shipped name or a custom name/id from `notifai sounds`.
|
|
148
155
|
Use `--retry` only for the same unresolved Agent Event; the CLI reuses one
|
|
@@ -164,16 +171,14 @@ the active harness proves the exact current Agent Session.
|
|
|
164
171
|
|
|
165
172
|
## Ask a question
|
|
166
173
|
|
|
167
|
-
A question must be answerable from the notification itself.
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
notification.
|
|
174
|
+
A question must be answerable from the notification itself. The positional
|
|
175
|
+
question is its Summary (under 240 characters) and supplies the notification
|
|
176
|
+
title. Put reasoning in the optional standalone Markdown Body. Offer 2-6 closed choices, one
|
|
177
|
+
flag per choice — commas inside a label are literal. A typed answer is always
|
|
178
|
+
possible; closed choices appear after pressing and holding the notification.
|
|
172
179
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
`send --reply`, it is the *first line of the body* — the title is not the
|
|
176
|
-
question — and context follows after a blank line.
|
|
180
|
+
For both `ask` and `send --reply`, the Summary is the exact answerable question.
|
|
181
|
+
Notifai never infers or truncates it from Body.
|
|
177
182
|
|
|
178
183
|
### Default: resume when they answer
|
|
179
184
|
|
|
@@ -186,7 +191,7 @@ notifai ask "Which environment should I roll out to?" \
|
|
|
186
191
|
--choice Staging --choice Production --choice Cancel
|
|
187
192
|
```
|
|
188
193
|
|
|
189
|
-
Add `--json` for choice ids and the
|
|
194
|
+
Add `--json` for choice ids and the `question_id`.
|
|
190
195
|
|
|
191
196
|
`registered: true` is local only. It has not yet been submitted as a
|
|
192
197
|
Notification Request and has no Provider Acceptance. Never call a question sent
|
|
@@ -207,13 +212,12 @@ turn. That commitment turns the arriving answer into work.
|
|
|
207
212
|
**Never say where the answer must arrive:** not "tell me here" or "type it at
|
|
208
213
|
this prompt". The route is the harness's concern.
|
|
209
214
|
|
|
210
|
-
Other surfaces: `--multi` combines answers; `--body`/`--body-file` adds
|
|
211
|
-
`--image`/`--image-alt` adds evidence; `--form <path|->` groups up to 10
|
|
212
|
-
questions
|
|
215
|
+
Other surfaces: `--multi` combines answers; `--body`/`--body-file` adds Body;
|
|
216
|
+
`--image`/`--image-alt` adds evidence; `--form <path|->` groups up to 10
|
|
217
|
+
questions and requires a set-level `summary`.
|
|
213
218
|
|
|
214
|
-
Keep independent questions as separate `ask` calls. Retire
|
|
215
|
-
|
|
216
|
-
it — with
|
|
219
|
+
Keep independent questions as separate `ask` calls. Retire a registration
|
|
220
|
+
that is obsolete or that they answer in the conversation with
|
|
217
221
|
`notifai close <question_id>` or `notifai close --pending`.
|
|
218
222
|
|
|
219
223
|
Keep every ID after a timeout or unavailable route. Inspect the original with
|
|
@@ -238,7 +242,7 @@ Question Routing unavailable and the owner can stay alive:
|
|
|
238
242
|
```bash
|
|
239
243
|
notifai send --reply \
|
|
240
244
|
--title "Schema change ready" \
|
|
241
|
-
--
|
|
245
|
+
--summary "Deploy the schema change to production now?" \
|
|
242
246
|
--choice "Deploy now" --choice "Wait for off-peak" \
|
|
243
247
|
--reply-window 86400 --reply-timeout 86400
|
|
244
248
|
```
|
|
@@ -250,16 +254,15 @@ an unsupported-harness fallback, the foreground owner stays alive through the
|
|
|
250
254
|
complete answer window and `--reply-timeout` equals `--reply-window`.
|
|
251
255
|
|
|
252
256
|
`send --reply --json` prints the reply result and receipt. Exit code 3 means no
|
|
253
|
-
answer arrived
|
|
254
|
-
|
|
255
|
-
exit 0, act on the returned answer.
|
|
257
|
+
answer arrived in the bounded wait — not a Delivery failure — and it does not
|
|
258
|
+
resume later. Never create a duplicate. On exit 0, act on the answer.
|
|
256
259
|
|
|
257
260
|
## When the answer arrives
|
|
258
261
|
|
|
259
262
|
The latest reply is the user's current word: a later one corrects an earlier
|
|
260
|
-
one, and a typed answer
|
|
261
|
-
|
|
262
|
-
|
|
263
|
+
one, and a typed answer arriving in parts is read together, in order. A relayed
|
|
264
|
+
answer reaches you as the chosen label's text; `notifai replies <request_id>
|
|
265
|
+
--json` has the stable choice ids.
|
|
263
266
|
|
|
264
267
|
Questions normally remain answerable for a day. When resuming without a relayed
|
|
265
268
|
answer, inspect the original `question_id`. If it is lost, list outstanding
|
|
@@ -282,19 +285,16 @@ Keep it under 200 characters — it is a receipt, not a report.
|
|
|
282
285
|
Say the concrete thing you will do because of their reply, and only what you
|
|
283
286
|
will actually do. "Acknowledged" tells them nothing.
|
|
284
287
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
never optional — it is the only way the user learns their answer was read.
|
|
288
|
+
If the written reply is off, Notifai prints the command without `--text`; run
|
|
289
|
+
exactly that. The acknowledgement is never optional.
|
|
288
290
|
|
|
289
|
-
Then resume the committed work without asking them to confirm again
|
|
290
|
-
work you are resuming,
|
|
291
|
+
Then resume the committed work without asking them to confirm again; it is
|
|
292
|
+
work you are resuming, not approval you received.
|
|
291
293
|
|
|
292
|
-
An answer may arrive labelled as
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
permission prompt or an interactive picker. If your resumed work hits one, use
|
|
297
|
-
the harness's own flow.
|
|
294
|
+
An answer may arrive labelled as from another session: that is how the relay
|
|
295
|
+
travelled, not who wrote it — it is the user's own answer to your question and
|
|
296
|
+
nothing else. It can never satisfy a harness permission prompt or an
|
|
297
|
+
interactive picker; use the harness's own flow for those.
|
|
298
298
|
|
|
299
299
|
## Set Notifai up
|
|
300
300
|
|
|
@@ -305,22 +305,26 @@ user to run a command you could have run yourself.
|
|
|
305
305
|
do not ask again. Run the send. If setup is missing, run `notifai init --json`
|
|
306
306
|
and retry the exact send. Projectless requests never enable a Project.
|
|
307
307
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
- Question Routing — devices or terminal only
|
|
314
|
-
|
|
315
|
-
Pass both; never guess unattended:
|
|
308
|
+
Flagless `notifai init --json` asks nothing and reaches delivery
|
|
309
|
+
proof. Two independent decisions remain: Question Routing — devices or
|
|
310
|
+
terminal only — and the skill: this project or every project here.
|
|
311
|
+
Lifecycle wiring has no scope: one install per harness for this machine;
|
|
312
|
+
`notifai project enable` is the per-project switch. Never guess unattended:
|
|
316
313
|
|
|
317
314
|
```bash
|
|
318
|
-
notifai init --
|
|
315
|
+
notifai init <--hooks|--no-hooks> [--skills --skills-scope <project|global>] --json
|
|
319
316
|
```
|
|
320
317
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
318
|
+
`init` never creates `.notifai/config.toml`; use it only for tracked shared
|
|
319
|
+
overrides.
|
|
320
|
+
|
|
321
|
+
Branch on `states`, `can_send`, and `question_routing_ready`.
|
|
322
|
+
`direct_wake_ready` says if answers can start a turn after continuation ends;
|
|
323
|
+
it is optional when a held continuation owns the answer,
|
|
324
|
+
and `null` when no direct-wake assessment exists. A nonzero exit is a gap to
|
|
325
|
+
close, never bypass.
|
|
326
|
+
Do not follow a successful structured init with doctor. `ask --json` performs
|
|
327
|
+
its own exact-session admission check.
|
|
324
328
|
|
|
325
329
|
Then gather the human-only steps its reported gap needs:
|
|
326
330
|
|
|
@@ -328,12 +332,12 @@ Then gather the human-only steps its reported gap needs:
|
|
|
328
332
|
- installing the companion app, signing in, and allowing notifications
|
|
329
333
|
|
|
330
334
|
Never emulate User-owned actions, claim to approve hooks yourself, or claim an
|
|
331
|
-
unlisted harness. Harness
|
|
335
|
+
unlisted harness. Harness trust wording lives in the setup reference.
|
|
332
336
|
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
+
When sign-in looks fine but nothing sends, `notifai auth status --json` and
|
|
338
|
+
`notifai auth access --json` separate a pairing problem from an account without
|
|
339
|
+
an active plan — report which one it is instead of calling it a delivery
|
|
340
|
+
failure.
|
|
337
341
|
|
|
338
342
|
On `no_active_devices`, run `notifai init --json`, close its gap, then repeat the
|
|
339
343
|
exact original send with `--retry`. A verification Notification does not deliver
|
|
@@ -30,17 +30,25 @@ either as broken.
|
|
|
30
30
|
## Install deliberately
|
|
31
31
|
|
|
32
32
|
Flagless `notifai init --json` needs no answer and closes everything before
|
|
33
|
-
this point. Hooks place files, so this is where a question belongs: ask
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
tell the user to run setup commands
|
|
33
|
+
this point. Hooks place files, so this is where a question belongs: ask whether
|
|
34
|
+
they want questions routed. There is no scope to ask about — Notifai installs
|
|
35
|
+
one lifecycle mechanism per harness, for this machine, and whether it acts in a
|
|
36
|
+
project is `notifai project enable`. Never tell the user to run setup commands
|
|
37
|
+
themselves.
|
|
37
38
|
|
|
38
39
|
```bash
|
|
39
|
-
notifai init --hooks --
|
|
40
|
+
notifai init --hooks --json
|
|
40
41
|
```
|
|
41
42
|
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
Installing the agent guidance skill keeps its own independent placement choice,
|
|
44
|
+
which belongs to `npx skills` and says nothing about where hooks land:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
notifai init --skills --skills-scope <project|global> --json
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
A machine-wide Notifai skill is guidance, not routing evidence. The active
|
|
51
|
+
harness needs its installed hook and a current session pointer.
|
|
44
52
|
|
|
45
53
|
Installed definitions call one stable user-level adapter at
|
|
46
54
|
`~/.notifai/bin/hook-adapter`. `hooks install` atomically retargets that adapter
|
|
@@ -55,15 +63,22 @@ later upgrades must not require another.
|
|
|
55
63
|
|
|
56
64
|
`notifai ask --json` owns its admission check. On failure, branch on its stable
|
|
57
65
|
`code`, `check_id`, `exit_code`, and `remedy`; do not run a routine doctor pass
|
|
58
|
-
first.
|
|
59
|
-
|
|
66
|
+
first. The current Agent Session's UserPromptSubmit observation proves that the
|
|
67
|
+
exact session owns this turn. A historical Stop observation is diagnostic
|
|
68
|
+
telemetry, not an admission prerequisite: the installed, trusted, current,
|
|
69
|
+
singular Stop definition and its continuation owner establish that the asking
|
|
70
|
+
turn can route the question. Ask exposes no `--session-id` override and will
|
|
71
|
+
not guess one.
|
|
60
72
|
When the failure includes a User-owned trust or permission `user_action`, relay
|
|
61
73
|
the exact `remedy`, say the hooks need the User's trust or approval, and wait.
|
|
62
74
|
Never bypass that gap with `notifai send --reply`.
|
|
63
75
|
|
|
64
76
|
`hooks-wake-route` reports, without probing anything, whether an answer could
|
|
65
|
-
start a turn in this exact Agent Session
|
|
66
|
-
|
|
77
|
+
start a turn in this exact Agent Session after its ordinary continuation has
|
|
78
|
+
returned. It never blocks Question Routing. On Windows, Claude Code has no
|
|
79
|
+
direct inbox wake because upstream exposes no inbox socket: its blocking Stop
|
|
80
|
+
still holds the complete answer window and returns the answer to the same Agent
|
|
81
|
+
Session without another User prompt.
|
|
67
82
|
|
|
68
83
|
Notifai never writes trust approvals. If its diagnosis and Codex disagree,
|
|
69
84
|
`/hooks` is authoritative.
|
|
@@ -95,10 +110,12 @@ request ID, inspect the original with `notifai replies <request_id> --json` and
|
|
|
95
110
|
SessionStart is absent, reinstall the current hooks and start a fresh Agent Session;
|
|
96
111
|
UserPromptSubmit does not activate it. Codex SubagentStart uses the same
|
|
97
112
|
reporting-only worker contract and explicit textual delegation rule as
|
|
98
|
-
Claude.
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
113
|
+
Claude. Notifai writes the Machine layer's `~/.codex/hooks.json`, and joins
|
|
114
|
+
inline `[hooks]` in that layer's `config.toml` only when the User's own hooks
|
|
115
|
+
already live there. One install covers every project and every worktree, so
|
|
116
|
+
there is nothing to repeat in a new checkout; a Project-scoped `.codex` hook
|
|
117
|
+
file from an older Notifai is removed once the Machine copy is proven
|
|
118
|
+
current.
|
|
102
119
|
- **Cursor:** start one fresh conversation, send one prompt, and let the first
|
|
103
120
|
completed or errored turn finish. Cursor's `SessionStart` context is currently
|
|
104
121
|
lossy, so one visible synthetic follow-up activates Notifai through its native
|
|
@@ -151,13 +168,18 @@ can send with Source Context without those.
|
|
|
151
168
|
The session that registered a question owns the answer's return. The last
|
|
152
169
|
meter differs per harness:
|
|
153
170
|
|
|
154
|
-
- **Claude Code:** the Stop hook is asynchronous. It returns at once,
|
|
155
|
-
turn is never held and the terminal stays the user's, and the same
|
|
156
|
-
keeps waiting out of band for the complete answer window. When the
|
|
157
|
-
arrives it is posted to that Agent Session's own inbox socket: an idle
|
|
158
|
-
Session starts a new turn with it, and a busy one receives it when its
|
|
159
|
-
turn ends. An Agent Session that is provably gone is cold-resumed
|
|
160
|
-
never one whose liveness probe cannot rule it out.
|
|
171
|
+
- **Claude Code on POSIX:** the Stop hook is asynchronous. It returns at once,
|
|
172
|
+
so the turn is never held and the terminal stays the user's, and the same
|
|
173
|
+
process keeps waiting out of band for the complete answer window. When the
|
|
174
|
+
answer arrives it is posted to that Agent Session's own inbox socket: an idle
|
|
175
|
+
Agent Session starts a new turn with it, and a busy one receives it when its
|
|
176
|
+
current turn ends. An Agent Session that is provably gone is cold-resumed
|
|
177
|
+
instead — never one whose liveness probe cannot rule it out.
|
|
178
|
+
- **Claude Code on Windows:** the Stop hook stays held through the complete
|
|
179
|
+
answer window. When the answer arrives it returns `decision: block`, starting
|
|
180
|
+
the successor turn in the same Agent Session without another User prompt.
|
|
181
|
+
Direct inbox wake is unavailable, but it is not needed while this exact Stop
|
|
182
|
+
continuation owns the answer.
|
|
161
183
|
- **Codex:** the Stop hook is the waiter. It holds until the answer arrives or
|
|
162
184
|
the complete answer window ends, then continues the session by returning
|
|
163
185
|
`decision: block`.
|
|
@@ -188,9 +210,11 @@ If a companion device is missing, ask the user to open a supported companion
|
|
|
188
210
|
build, sign in, and grant notification permission. Do not emulate that, and do
|
|
189
211
|
not treat Provider Acceptance as Companion Receipt proof.
|
|
190
212
|
|
|
191
|
-
To stop
|
|
192
|
-
|
|
193
|
-
|
|
213
|
+
To stop Notifai acting in one project while leaving other projects wired, run
|
|
214
|
+
`notifai project disable` — that is the per-project switch. `notifai hooks
|
|
215
|
+
uninstall` removes the machine's lifecycle wiring for every project; pass
|
|
216
|
+
`--harness <name>` to name one when several are wired. Uninstall also clears
|
|
217
|
+
any Project-scoped hook file an older Notifai left in this checkout.
|
|
194
218
|
|
|
195
219
|
## Reading the record
|
|
196
220
|
|
|
@@ -213,15 +237,25 @@ setting; `notifai config show --explain` includes advanced keys and the file
|
|
|
213
237
|
each value came from. Beyond the usual scopes, `--session <id>` writes a
|
|
214
238
|
preference that lasts only for one Agent Session.
|
|
215
239
|
|
|
240
|
+
With no scope flag, `notifai config set` writes Machine-Global Configuration.
|
|
241
|
+
`--local` writes a personal Project Override under the user's configuration
|
|
242
|
+
directory; one local Git checkout and all its linked worktrees resolve to the
|
|
243
|
+
same file. `--project` is deliberately different: it writes the tracked shared
|
|
244
|
+
`.notifai/config.toml` at the repository root. Do not create that repository
|
|
245
|
+
file during setup or to preserve personal state, and do not reach into another
|
|
246
|
+
worktree to write it—make the explicit shared change in the active checkout and
|
|
247
|
+
merge it through Git.
|
|
248
|
+
|
|
216
249
|
`ask_notifications` is the setting that turns question routing off for a scope;
|
|
217
250
|
`ask_grace_seconds` is the terminal-first window described above;
|
|
218
251
|
`reply_window_seconds` is how long an answer is still accepted, a day by
|
|
219
252
|
default and up to three.
|
|
220
253
|
|
|
221
254
|
Those are three different controls and only the last one decides whether an
|
|
222
|
-
answer is still wanted. Question Routing owns that complete window
|
|
223
|
-
waits out of band and wakes the Agent Session
|
|
224
|
-
held
|
|
255
|
+
answer is still wanted. Question Routing owns that complete window. Claude Code
|
|
256
|
+
waits out of band and wakes the Agent Session on POSIX; on Windows its Stop
|
|
257
|
+
stays held and returns the answer as the same Agent Session's continuation,
|
|
258
|
+
like Codex. The journal is crash recovery, not the ordinary delivery path.
|
|
225
259
|
|
|
226
260
|
`NOTIFAI_NO_INPUT=1` guarantees no command will ever prompt, which is what you
|
|
227
261
|
want in CI or any shell with nobody at it. `NOTIFAI_CREDENTIALS=file` stores the
|
package/dist/ui/config-view.d.ts
CHANGED
|
@@ -28,5 +28,3 @@ export declare function renderConfigList(config: CliConfig, options?: {
|
|
|
28
28
|
export declare function renderConfigExplain(key: ConfigKey, config: CliConfig): string[];
|
|
29
29
|
/** The flat form, unchanged, for anything that is not a person at a terminal. */
|
|
30
30
|
export declare function renderConfigPlain(config: CliConfig, explain: boolean): string[];
|
|
31
|
-
/** Longest visible line, for callers that need to size a rule or a box. */
|
|
32
|
-
export declare function widestLine(lines: readonly string[]): number;
|
package/dist/ui/config-view.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { CONFIG_KEYS } from '../config.js';
|
|
9
9
|
import { CONFIG_GROUPS, acceptedValues, configInfo, configKeysByGroup, describeSource, formatValue, } from '../config-schema.js';
|
|
10
|
-
import { glyph, pad, style, terminalWidth,
|
|
10
|
+
import { glyph, pad, style, terminalWidth, wrap } from './theme.js';
|
|
11
11
|
/**
|
|
12
12
|
* The full settings listing, grouped and explained.
|
|
13
13
|
*
|
|
@@ -105,8 +105,4 @@ export function renderConfigPlain(config, explain) {
|
|
|
105
105
|
return `${key} = ${JSON.stringify(entry.value)}${provenance}`;
|
|
106
106
|
});
|
|
107
107
|
}
|
|
108
|
-
/** Longest visible line, for callers that need to size a rule or a box. */
|
|
109
|
-
export function widestLine(lines) {
|
|
110
|
-
return Math.max(0, ...lines.map((line) => width(line)));
|
|
111
|
-
}
|
|
112
108
|
//# sourceMappingURL=config-view.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-view.js","sourceRoot":"","sources":["../../src/ui/config-view.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,WAAW,EAAkC,MAAM,cAAc,CAAA;AAC1E,OAAO,EACL,aAAa,EACb,cAAc,EACd,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,WAAW,GACZ,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"config-view.js","sourceRoot":"","sources":["../../src/ui/config-view.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,WAAW,EAAkC,MAAM,cAAc,CAAA;AAC1E,OAAO,EACL,aAAa,EACb,cAAc,EACd,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,WAAW,GACZ,MAAM,qBAAqB,CAAA;AAC5B,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AA;IAC9D,KAAK,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,sBAAsB,GAAG,IAAI,OAAO,EAAE,CAAC,EAAE,CAAC,CAAA;IAC/F,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;QAC1D,KAAK,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,wBAAwB,GAAG,EAAE,CAAC,EAAE,CAAC,CAAA;IACzF,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IACd,OAAO,KAAK,CAAA;AACd,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,iBAAiB,CAAC,MAAiB,EAAE,OAAgB;IACnE,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QAC7B,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;QACzB,MAAM,UAAU,GAAG,OAAO,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,CAAA;QACvD,OAAO,GAAG,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,UAAU,EAAE,CAAA;IAC/D,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
package/dist/ui/theme.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
/** True when the terminal can render the box-drawing and status glyphs below. */
|
|
2
2
|
export declare const unicode: boolean;
|
|
3
|
-
export declare const color: import("picocolors/types.js").Colors & {
|
|
4
|
-
createColors: (enabled?: boolean) => import("picocolors/types.js").Colors;
|
|
5
|
-
};
|
|
6
3
|
/**
|
|
7
4
|
* Brand ramp, shared with the companion app icon: pink → coral → rose →
|
|
8
5
|
* magenta. Used for the wordmark and for accenting the surfaces a human sees.
|
package/dist/ui/theme.js
CHANGED
|
@@ -30,7 +30,6 @@ function supportsTrueColor(env = process.env) {
|
|
|
30
30
|
return true;
|
|
31
31
|
return env['TERM_PROGRAM'] === 'iTerm.app' || env['TERM_PROGRAM'] === 'vscode';
|
|
32
32
|
}
|
|
33
|
-
export const color = pc;
|
|
34
33
|
/**
|
|
35
34
|
* Brand ramp, shared with the companion app icon: pink → coral → rose →
|
|
36
35
|
* magenta. Used for the wordmark and for accenting the surfaces a human sees.
|
package/dist/ui/theme.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../../src/ui/theme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,iFAAiF;AACjF,MAAM,CAAC,MAAM,OAAO,GAClB,OAAO,CAAC,QAAQ,KAAK,OAAO;IAC5B,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,SAAS;IACvC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,KAAK,QAAQ;IACxC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,cAAc,CAAA;AAE9C,6EAA6E;AAC7E,SAAS,iBAAiB,CAAC,MAAyB,OAAO,CAAC,GAAG;IAC7D,IAAI,CAAC,EAAE,CAAC,gBAAgB;QAAE,OAAO,KAAK,CAAA;IACtC,MAAM,SAAS,GAAG,GAAG,CAAC,WAAW,CAAC,IAAI,EAAE,CAAA;IACxC,IAAI,sBAAsB,CAAC,IAAI,CAAC,SAAS,CAAC;QAAE,OAAO,IAAI,CAAA;IACvD,OAAO,GAAG,CAAC,cAAc,CAAC,KAAK,WAAW,IAAI,GAAG,CAAC,cAAc,CAAC,KAAK,QAAQ,CAAA;AAChF,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../../src/ui/theme.ts"],"names":[],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The numeric release identity shared by CLI, harness, and runtime checks.
|
|
4
|
+
* Pre-release/build suffixes identify artifacts but do not change capability
|
|
5
|
+
* floors, matching the version comparisons these callers previously owned.
|
|
6
|
+
*
|
|
7
|
+
* @param {string} value
|
|
8
|
+
* @returns {readonly [number, number, number] | null}
|
|
9
|
+
*/
|
|
10
|
+
export function parseVersion(value: string): readonly [number, number, number] | null;
|
|
11
|
+
/**
|
|
12
|
+
* Compare two release identities without silently treating malformed input as
|
|
13
|
+
* zero. Every caller must choose its own safe posture for `unparseable`.
|
|
14
|
+
*
|
|
15
|
+
* @param {string} left
|
|
16
|
+
* @param {string} right
|
|
17
|
+
* @returns {VersionComparison}
|
|
18
|
+
*/
|
|
19
|
+
export function compareVersions(left: string, right: string): VersionComparison;
|
|
20
|
+
/** @param {string} value */
|
|
21
|
+
export function isSemVer(value: string): boolean;
|
|
22
|
+
export type VersionComparison = "before" | "equal" | "after" | "unparseable";
|
package/dist/version.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
const SEMVER = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-(?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*)(?:\.(?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*))*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/;
|
|
2
|
+
const ORDERED_VERSION = /^v?(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/;
|
|
3
|
+
/** @typedef {'before' | 'equal' | 'after' | 'unparseable'} VersionComparison */
|
|
4
|
+
/**
|
|
5
|
+
* The numeric release identity shared by CLI, harness, and runtime checks.
|
|
6
|
+
* Pre-release/build suffixes identify artifacts but do not change capability
|
|
7
|
+
* floors, matching the version comparisons these callers previously owned.
|
|
8
|
+
*
|
|
9
|
+
* @param {string} value
|
|
10
|
+
* @returns {readonly [number, number, number] | null}
|
|
11
|
+
*/
|
|
12
|
+
export function parseVersion(value) {
|
|
13
|
+
const match = ORDERED_VERSION.exec(value);
|
|
14
|
+
if (match === null)
|
|
15
|
+
return null;
|
|
16
|
+
const parsed = /** @type {readonly [number, number, number]} */ ([
|
|
17
|
+
Number(match[1]),
|
|
18
|
+
Number(match[2]),
|
|
19
|
+
Number(match[3]),
|
|
20
|
+
]);
|
|
21
|
+
return parsed.every(Number.isSafeInteger) ? parsed : null;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Compare two release identities without silently treating malformed input as
|
|
25
|
+
* zero. Every caller must choose its own safe posture for `unparseable`.
|
|
26
|
+
*
|
|
27
|
+
* @param {string} left
|
|
28
|
+
* @param {string} right
|
|
29
|
+
* @returns {VersionComparison}
|
|
30
|
+
*/
|
|
31
|
+
export function compareVersions(left, right) {
|
|
32
|
+
const a = parseVersion(left);
|
|
33
|
+
const b = parseVersion(right);
|
|
34
|
+
if (a === null || b === null)
|
|
35
|
+
return 'unparseable';
|
|
36
|
+
for (let index = 0; index < a.length; index += 1) {
|
|
37
|
+
const leftPart = a[index];
|
|
38
|
+
const rightPart = b[index];
|
|
39
|
+
if (leftPart === undefined || rightPart === undefined)
|
|
40
|
+
return 'unparseable';
|
|
41
|
+
if (leftPart === rightPart)
|
|
42
|
+
continue;
|
|
43
|
+
return leftPart < rightPart ? 'before' : 'after';
|
|
44
|
+
}
|
|
45
|
+
return 'equal';
|
|
46
|
+
}
|
|
47
|
+
/** @param {string} value */
|
|
48
|
+
export function isSemVer(value) {
|
|
49
|
+
return SEMVER.test(value);
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.js"],"names":[],"mappings":"AAAA,MAAM,MAAM,GAAG,iLAAiL,CAAA;AAChM,MAAM,eAAe,GAAG,oCAAoC,CAAA;AAE5D,gFAAgF;AAEhF;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,KAAK;I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KAAK;IAC5B,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAC3B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DeliveryOutcome } from './hook-types.js';
|
|
2
|
+
export declare function holdForNextTurn(reason: string): DeliveryOutcome;
|
|
3
|
+
export declare function cancelledDelivery(): DeliveryOutcome;
|
|
4
|
+
/** Run one harness child and preserve its diagnostic stderr on failure. */
|
|
5
|
+
export declare function runWakeCommand(command: string, args: readonly string[], options?: {
|
|
6
|
+
cwd?: string;
|
|
7
|
+
env?: NodeJS.ProcessEnv;
|
|
8
|
+
}): Promise<string>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
export function holdForNextTurn(reason) {
|
|
3
|
+
return {
|
|
4
|
+
notes: [`holding the accepted answer for the next turn: ${reason}`],
|
|
5
|
+
log: { route: 'hold-for-next-turn', stage: 'queued', reason },
|
|
6
|
+
acknowledgement: 'held',
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export function cancelledDelivery() {
|
|
10
|
+
return {
|
|
11
|
+
notes: ['the Agent Session ended before answer delivery; stopping this observer'],
|
|
12
|
+
log: { route: 'hold-for-next-turn', stage: 'queued', reason: 'session-ended' },
|
|
13
|
+
acknowledgement: 'held',
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
/** Run one harness child and preserve its diagnostic stderr on failure. */
|
|
17
|
+
export function runWakeCommand(command, args, options = {}) {
|
|
18
|
+
return new Promise((resolve, reject) => {
|
|
19
|
+
const child = spawn(command, [...args], {
|
|
20
|
+
...(options.cwd === undefined ? {} : { cwd: options.cwd }),
|
|
21
|
+
...(options.env === undefined ? {} : { env: options.env }),
|
|
22
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
23
|
+
});
|
|
24
|
+
const stdout = [];
|
|
25
|
+
const stderr = [];
|
|
26
|
+
child.stdout?.on('data', (chunk) => stdout.push(Buffer.from(chunk)));
|
|
27
|
+
child.stderr?.on('data', (chunk) => stderr.push(Buffer.from(chunk)));
|
|
28
|
+
child.once('error', reject);
|
|
29
|
+
child.once('exit', (code, signal) => {
|
|
30
|
+
if (code === 0) {
|
|
31
|
+
resolve(Buffer.concat(stdout).toString());
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
reject(new Error(`${command} ${args[0] ?? ''} exited ${code === null ? `on ${String(signal)}` : String(code)}: ${Buffer.concat(stderr).toString().trim()}`));
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=wake-support.js.map
|