@raidiant/notifai 9.0.0 → 9.2.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 +14 -0
- package/dist/command-session.d.ts +14 -0
- package/dist/command-session.js +30 -0
- package/dist/command-session.js.map +1 -0
- package/dist/commands-doctor.js +17 -15
- package/dist/commands-doctor.js.map +1 -1
- package/dist/commands-guidance.js +3 -29
- package/dist/commands-guidance.js.map +1 -1
- package/dist/commands-harness-context.js +21 -1
- package/dist/commands-harness-context.js.map +1 -1
- package/dist/commands-hooks.d.ts +11 -1
- package/dist/commands-hooks.js +98 -184
- package/dist/commands-hooks.js.map +1 -1
- package/dist/commands-init.d.ts +2 -0
- package/dist/commands-init.js +41 -21
- package/dist/commands-init.js.map +1 -1
- package/dist/commands-send.d.ts +1 -0
- package/dist/commands-send.js +62 -14
- package/dist/commands-send.js.map +1 -1
- package/dist/commands-setup-proof.d.ts +4 -3
- package/dist/commands-setup-proof.js +29 -14
- package/dist/commands-setup-proof.js.map +1 -1
- package/dist/commands.d.ts +1 -1
- package/dist/commands.js +1 -1
- package/dist/commands.js.map +1 -1
- package/dist/guidance-render.d.ts +20 -0
- package/dist/guidance-render.js +42 -0
- package/dist/guidance-render.js.map +1 -0
- package/dist/hooks.d.ts +16 -13
- package/dist/hooks.js +57 -32
- package/dist/hooks.js.map +1 -1
- package/dist/opencode-plugin.js +32 -5
- package/dist/opencode-plugin.js.map +1 -1
- package/dist/program.js +21 -12
- package/dist/program.js.map +1 -1
- package/dist/readiness.d.ts +6 -0
- package/dist/readiness.js +37 -0
- package/dist/readiness.js.map +1 -1
- package/dist/send-attempts.d.ts +26 -0
- package/dist/send-attempts.js +139 -0
- package/dist/send-attempts.js.map +1 -0
- package/dist/session-activation.d.ts +4 -8
- package/dist/session-activation.js +25 -14
- package/dist/session-activation.js.map +1 -1
- package/package.json +1 -1
- package/src/command-session.ts +38 -0
- package/src/commands-doctor.ts +18 -28
- package/src/commands-guidance.ts +3 -38
- package/src/commands-harness-context.ts +20 -1
- package/src/commands-hooks.ts +219 -220
- package/src/commands-init.ts +46 -24
- package/src/commands-send.ts +70 -14
- package/src/commands-setup-proof.test.ts +72 -0
- package/src/commands-setup-proof.ts +33 -14
- package/src/commands.test.ts +209 -67
- package/src/commands.ts +1 -0
- package/src/guidance-render.ts +56 -0
- package/src/guidance.test.ts +28 -0
- package/src/hooks.test.ts +42 -137
- package/src/hooks.ts +67 -46
- package/src/install-hooks.test.ts +41 -16
- package/src/opencode-plugin.ts +35 -5
- package/src/program.ts +22 -12
- package/src/readiness.ts +44 -0
- package/src/send-attempts.test.ts +143 -0
- package/src/send-attempts.ts +188 -0
- package/src/session-activation.ts +35 -18
- package/src/skill.test.ts +22 -23
package/src/skill.test.ts
CHANGED
|
@@ -47,30 +47,31 @@ const section = (heading: string): string => {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
describe('Notifai agent skill', () => {
|
|
50
|
-
it('routes proactively in
|
|
50
|
+
it('routes proactively in owner sessions without turning ordinary workers into senders', () => {
|
|
51
51
|
// The frontmatter description is the only skill text available during
|
|
52
|
-
// automatic selection.
|
|
53
|
-
//
|
|
54
|
-
|
|
55
|
-
expect(description).toMatch(/
|
|
56
|
-
expect(description).toMatch(/
|
|
52
|
+
// automatic selection. It must select parent owners and workers given
|
|
53
|
+
// explicit delegation without selecting every ordinary worker.
|
|
54
|
+
expect(description).toMatch(/every agent session that owns User-visible Notification Requests/i)
|
|
55
|
+
expect(description).toMatch(/parent owns by default/i)
|
|
56
|
+
expect(description).toMatch(/worker only when ownership is explicitly delegated/i)
|
|
57
|
+
expect(description).toMatch(/even when the user does not mention (?:Notifai|it)/i)
|
|
57
58
|
expect(description).toMatch(/guidance/i)
|
|
58
59
|
|
|
59
60
|
const decide = section('## Decide whether to notify')
|
|
60
|
-
expect(decide).toMatch(/
|
|
61
|
-
expect(decide).toMatch(/read
|
|
62
|
-
expect(decide).toMatch(/parent owns
|
|
63
|
-
expect(decide).toMatch(/
|
|
64
|
-
expect(decide).toMatch(/workers[\s\S]{0,100}do not send
|
|
61
|
+
expect(decide).toMatch(/owner session lifecycle context normally includes.*effective\s+guidance/is)
|
|
62
|
+
expect(decide).toMatch(/context is absent.*read it once before judging an Agent\s+Event/is)
|
|
63
|
+
expect(decide).toMatch(/parent owns by default/i)
|
|
64
|
+
expect(decide).toMatch(/explicit textual\s+delegation makes a worker the owner/i)
|
|
65
|
+
expect(decide).toMatch(/ordinary workers[\s\S]{0,100}do not load or send/i)
|
|
65
66
|
})
|
|
66
67
|
|
|
67
68
|
it('preserves the original Agent Event across setup and ambiguous delivery', () => {
|
|
68
69
|
expect(skill).toMatch(
|
|
69
|
-
/interrupted or killed `send`[\s\S]
|
|
70
|
+
/interrupted or killed `send`[\s\S]*do not correlate redacted logs by title[\s\S]*re-run the exact semantic send with\s+`--retry`/i,
|
|
70
71
|
)
|
|
71
|
-
expect(skill).toMatch(/
|
|
72
|
-
expect(skill).toMatch(/`no_active_devices`[\s\S]*repeat the
|
|
73
|
-
expect(skill).toMatch(/verification Notification[\s\S]*does not deliver
|
|
72
|
+
expect(skill).toMatch(/opaque matching attempt[\s\S]*refuse ambiguity/i)
|
|
73
|
+
expect(skill).toMatch(/`no_active_devices`[\s\S]*repeat the\s+(?:exact\s+)?original send/i)
|
|
74
|
+
expect(skill).toMatch(/verification Notification[\s\S]*does not deliver\s+the original Agent Event/i)
|
|
74
75
|
})
|
|
75
76
|
|
|
76
77
|
it('fits inside the budget a skill is actually read within', () => {
|
|
@@ -224,17 +225,16 @@ describe('Notifai agent skill', () => {
|
|
|
224
225
|
expect(send).toMatch(/kind and the project travel as their own\s+fields, never in it/i)
|
|
225
226
|
})
|
|
226
227
|
|
|
227
|
-
it('
|
|
228
|
+
it('lets callers repeat one immutable semantic session name without supplying its id', () => {
|
|
228
229
|
const send = section('## Send')
|
|
229
230
|
expect(send).toContain('--session-label')
|
|
230
|
-
expect(send).toMatch(/first Notification\s+Request/i)
|
|
231
231
|
expect(send).toMatch(/2-6 words/i)
|
|
232
|
-
expect(send).toMatch(/
|
|
232
|
+
expect(send).toMatch(/when the current\s+environment exposes an exact session/i)
|
|
233
233
|
expect(send).toMatch(/without an exact session[\s\S]{0,160}usage\s+error/i)
|
|
234
234
|
expect(send).toMatch(/omit `--session-label`/i)
|
|
235
235
|
expect(send).toMatch(/name the\s+environment supplies wins/i)
|
|
236
236
|
expect(send).toMatch(/freezes one semantic name/i)
|
|
237
|
-
expect(send).toMatch(/
|
|
237
|
+
expect(send).toMatch(/safe to repeat the same `--session-label` on every send and ask/i)
|
|
238
238
|
// The one exception to permanence: garbage names are recoverable.
|
|
239
239
|
expect(send).toMatch(/generated fallback name[\s\S]*replaced by a later\s+semantic name/i)
|
|
240
240
|
expect(send).toMatch(/never pass\s+`--session-id`/i)
|
|
@@ -309,8 +309,8 @@ describe('Notifai agent skill', () => {
|
|
|
309
309
|
expect(setup).toMatch(/never tell the\s+user to run a command you could have run/i)
|
|
310
310
|
expect(setup).toMatch(/browser/i)
|
|
311
311
|
expect(setup).toMatch(/companion/i)
|
|
312
|
-
expect(setup).toContain('notifai
|
|
313
|
-
expect(setup).
|
|
312
|
+
expect(setup).toContain('notifai init --json')
|
|
313
|
+
expect(setup).toMatch(/do not follow a successful structured init\s+with doctor/i)
|
|
314
314
|
expect(setup).toContain('--setup-scope')
|
|
315
315
|
})
|
|
316
316
|
|
|
@@ -371,7 +371,6 @@ describe('Notifai agent skill', () => {
|
|
|
371
371
|
'notifai replies',
|
|
372
372
|
'notifai acknowledge',
|
|
373
373
|
'notifai close',
|
|
374
|
-
'notifai doctor',
|
|
375
374
|
'notifai init',
|
|
376
375
|
'notifai config show',
|
|
377
376
|
'notifai guidance',
|
|
@@ -389,7 +388,7 @@ describe('Notifai agent skill', () => {
|
|
|
389
388
|
expect(harnessReference).toContain(`**${harness}:**`)
|
|
390
389
|
}
|
|
391
390
|
// The agent runs what a process can run; the human only does the human part.
|
|
392
|
-
expect(harnessReference).
|
|
391
|
+
expect(harnessReference).toMatch(/let init install and assess\s+the hooks/i)
|
|
393
392
|
expect(harnessReference).toMatch(/run `notifai login` yourself/i)
|
|
394
393
|
expect(harnessReference).toMatch(/only the user can approve/i)
|
|
395
394
|
})
|