@raidiant/notifai 10.0.0 → 10.1.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 +31 -0
- package/README.md +4 -1
- package/dist/cli-bin.d.ts +21 -1
- package/dist/cli-bin.js +141 -10
- package/dist/cli-bin.js.map +1 -1
- package/dist/cli-update-contract.d.ts +7 -0
- package/dist/cli-update-contract.js +10 -0
- package/dist/cli-update-contract.js.map +1 -0
- package/dist/client.d.ts +6 -1
- package/dist/client.js +1 -0
- package/dist/client.js.map +1 -1
- package/dist/codex-wake.d.ts +2 -0
- package/dist/codex-wake.js +2 -1
- package/dist/codex-wake.js.map +1 -1
- package/dist/commands-auth.d.ts +15 -1
- package/dist/commands-auth.js +32 -14
- package/dist/commands-auth.js.map +1 -1
- package/dist/commands-core.d.ts +10 -1
- package/dist/commands-core.js +13 -4
- package/dist/commands-core.js.map +1 -1
- package/dist/commands-devices.d.ts +10 -1
- package/dist/commands-devices.js +17 -13
- package/dist/commands-devices.js.map +1 -1
- package/dist/commands-doctor.js +158 -71
- package/dist/commands-doctor.js.map +1 -1
- package/dist/commands-harness-context.js +8 -0
- package/dist/commands-harness-context.js.map +1 -1
- package/dist/commands-hooks.js +169 -15
- package/dist/commands-hooks.js.map +1 -1
- package/dist/commands-init.d.ts +16 -0
- package/dist/commands-init.js +254 -91
- package/dist/commands-init.js.map +1 -1
- package/dist/commands-send.d.ts +1 -1
- package/dist/commands-send.js +121 -35
- package/dist/commands-send.js.map +1 -1
- package/dist/commands-update.d.ts +10 -0
- package/dist/commands-update.js +141 -0
- package/dist/commands-update.js.map +1 -0
- package/dist/commands.d.ts +2 -1
- package/dist/commands.js +2 -1
- package/dist/commands.js.map +1 -1
- package/dist/harnesses.d.ts +2 -2
- package/dist/harnesses.js +22 -2
- package/dist/harnesses.js.map +1 -1
- package/dist/hook-adapter.d.ts +2 -0
- package/dist/hook-adapter.js +12 -1
- package/dist/hook-adapter.js.map +1 -1
- package/dist/hooks.d.ts +43 -2
- package/dist/hooks.js +163 -21
- package/dist/hooks.js.map +1 -1
- package/dist/install-hooks.js +15 -9
- package/dist/install-hooks.js.map +1 -1
- package/dist/interactive.js +20 -23
- package/dist/interactive.js.map +1 -1
- package/dist/main-run.d.ts +1 -0
- package/dist/main-run.js +42 -0
- package/dist/main-run.js.map +1 -0
- package/dist/main.js +10 -31
- package/dist/main.js.map +1 -1
- package/dist/node-floor.d.ts +18 -0
- package/dist/node-floor.js +35 -0
- package/dist/node-floor.js.map +1 -0
- package/dist/openclaw-plugin.d.ts +49 -0
- package/dist/openclaw-plugin.js +350 -0
- package/dist/openclaw-plugin.js.map +1 -0
- package/dist/program.d.ts +2 -1
- package/dist/program.js +31 -13
- package/dist/program.js.map +1 -1
- package/dist/question-settlement-process.d.ts +15 -0
- package/dist/question-settlement-process.js +35 -0
- package/dist/question-settlement-process.js.map +1 -0
- package/dist/readiness.d.ts +25 -1
- package/dist/readiness.js +32 -2
- package/dist/readiness.js.map +1 -1
- package/dist/session-activation.js +1 -1
- package/dist/session-activation.js.map +1 -1
- package/dist/setup-destinations.d.ts +23 -0
- package/dist/setup-destinations.js +44 -0
- package/dist/setup-destinations.js.map +1 -0
- package/dist/ui/help.d.ts +4 -5
- package/dist/ui/help.js +5 -6
- package/dist/ui/help.js.map +1 -1
- package/package.json +2 -2
- package/src/cli-bin.test.ts +145 -7
- package/src/cli-bin.ts +176 -10
- package/src/cli-update-contract.ts +9 -0
- package/src/cli-update.test.ts +125 -0
- package/src/client.ts +7 -0
- package/src/codex-wake.ts +5 -1
- package/src/commands-auth.ts +47 -13
- package/src/commands-core.ts +21 -4
- package/src/commands-devices.ts +23 -16
- package/src/commands-doctor.ts +197 -75
- package/src/commands-harness-context.ts +8 -0
- package/src/commands-hooks.ts +210 -18
- package/src/commands-init.ts +275 -92
- package/src/commands-send.ts +145 -39
- package/src/commands-update.ts +180 -0
- package/src/commands.test.ts +701 -53
- package/src/commands.ts +2 -0
- package/src/fixtures/openclaw-2026.7.1-2-agent-local.json +57 -0
- package/src/harness-integration.test.ts +82 -0
- package/src/harnesses.test.ts +9 -1
- package/src/harnesses.ts +24 -2
- package/src/hook-adapter.ts +14 -0
- package/src/hooks.test.ts +275 -0
- package/src/hooks.ts +270 -18
- package/src/install-hooks.test.ts +208 -0
- package/src/install-hooks.ts +19 -9
- package/src/interactive.test.ts +31 -0
- package/src/interactive.ts +20 -26
- package/src/main-run.ts +45 -0
- package/src/main.ts +9 -33
- package/src/node-floor.test.ts +27 -0
- package/src/node-floor.ts +37 -0
- package/src/openclaw-plugin.ts +409 -0
- package/src/program.test.ts +35 -0
- package/src/program.ts +37 -12
- package/src/question-settlement-process.ts +47 -0
- package/src/readiness.ts +35 -2
- package/src/session-activation.ts +1 -1
- package/src/setup-destinations.test.ts +41 -0
- package/src/setup-destinations.ts +50 -0
- package/src/skill.test.ts +13 -2
- package/src/ui/help.test.ts +16 -0
- package/src/ui/help.ts +6 -7
- package/src/commands-devices.test.ts +0 -15
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest'
|
|
2
|
+
import {
|
|
3
|
+
companionPlatformLabel,
|
|
4
|
+
setupAccessUrl,
|
|
5
|
+
setupCompanionUrl,
|
|
6
|
+
supportPageUrl,
|
|
7
|
+
} from './setup-destinations.js'
|
|
8
|
+
|
|
9
|
+
describe('focused setup destinations', () => {
|
|
10
|
+
it('sends a hosted reader to the dashboard they can sign in to', () => {
|
|
11
|
+
expect(setupAccessUrl('https://api.notifai.sh')).toBe('https://app.notifai.sh/setup/access')
|
|
12
|
+
expect(setupCompanionUrl('https://notifai.fly.dev')).toBe(
|
|
13
|
+
'https://app.notifai.sh/setup/companion',
|
|
14
|
+
)
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
it('keeps a self-host on its own origin', () => {
|
|
18
|
+
expect(setupAccessUrl('https://notify.example.com/')).toBe(
|
|
19
|
+
'https://notify.example.com/setup/access',
|
|
20
|
+
)
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
it('carries the platform this terminal already asked about', () => {
|
|
24
|
+
expect(setupCompanionUrl('https://api.notifai.sh', 'iphone')).toBe(
|
|
25
|
+
'https://app.notifai.sh/setup/companion?platform=iphone',
|
|
26
|
+
)
|
|
27
|
+
expect(setupAccessUrl('https://api.notifai.sh', 'android')).toBe(
|
|
28
|
+
'https://app.notifai.sh/setup/access?platform=android',
|
|
29
|
+
)
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
it('keeps the omnibus help page separate from any setup errand', () => {
|
|
33
|
+
expect(supportPageUrl('https://api.notifai.sh')).toBe('https://app.notifai.sh/support')
|
|
34
|
+
expect(setupAccessUrl('https://api.notifai.sh')).not.toContain('/support')
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
it('names each platform the way a reader would', () => {
|
|
38
|
+
expect(companionPlatformLabel('iphone')).toBe('iPhone')
|
|
39
|
+
expect(companionPlatformLabel('android')).toBe('Android')
|
|
40
|
+
})
|
|
41
|
+
})
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a cross-surface setup errand is finished.
|
|
3
|
+
*
|
|
4
|
+
* Every handoff opens the destination for exactly one errand, carrying the
|
|
5
|
+
* platform when this terminal already asked for it. The omnibus help page is
|
|
6
|
+
* help: it covers access, two install routes, billing, refunds, deletion,
|
|
7
|
+
* privacy and terms, and its own next step is to go somewhere else. Sending
|
|
8
|
+
* someone there for a named gate makes them find it themselves.
|
|
9
|
+
*
|
|
10
|
+
* The server prints these same paths into `next_action`, which is the value
|
|
11
|
+
* this CLI prefers whenever it has one. These builders are the fallback for
|
|
12
|
+
* the paths where it does not, and they must stay spelled the same.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/** The two platforms that can receive a notification. Mac is not one. */
|
|
16
|
+
export const COMPANION_PLATFORMS = ['iphone', 'android'] as const
|
|
17
|
+
export type CompanionPlatform = (typeof COMPANION_PLATFORMS)[number]
|
|
18
|
+
|
|
19
|
+
export function companionPlatformLabel(platform: CompanionPlatform): string {
|
|
20
|
+
return platform === 'iphone' ? 'iPhone' : 'Android'
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The dashboard a reader can sign in to, which is not always the API origin.
|
|
25
|
+
* Only the hosted deployment splits them; a self-host serves both from one.
|
|
26
|
+
*/
|
|
27
|
+
function dashboardOrigin(baseUrl: string): string {
|
|
28
|
+
const normalized = baseUrl.replace(/\/+$/, '')
|
|
29
|
+
if (normalized === 'https://api.notifai.sh' || normalized === 'https://notifai.fly.dev') {
|
|
30
|
+
return 'https://app.notifai.sh'
|
|
31
|
+
}
|
|
32
|
+
return normalized
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Getting this Account access to Notifai, and nothing else. */
|
|
36
|
+
export function setupAccessUrl(baseUrl: string, platform?: CompanionPlatform): string {
|
|
37
|
+
const base = `${dashboardOrigin(baseUrl)}/setup/access`
|
|
38
|
+
return platform === undefined ? base : `${base}?platform=${platform}`
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Installing the Companion App on one named platform. */
|
|
42
|
+
export function setupCompanionUrl(baseUrl: string, platform?: CompanionPlatform): string {
|
|
43
|
+
const base = `${dashboardOrigin(baseUrl)}/setup/companion`
|
|
44
|
+
return platform === undefined ? base : `${base}?platform=${platform}`
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** General help: billing, policies, and everything setup is not. */
|
|
48
|
+
export function supportPageUrl(baseUrl: string): string {
|
|
49
|
+
return `${dashboardOrigin(baseUrl)}/support`
|
|
50
|
+
}
|
package/src/skill.test.ts
CHANGED
|
@@ -252,7 +252,7 @@ describe('Notifai agent skill', () => {
|
|
|
252
252
|
// Harness names may appear only in setup/routing material, where the
|
|
253
253
|
// harness IS the subject.
|
|
254
254
|
for (const heading of ['## Decide whether to notify', '## Send', '## Ask a question', '## When the answer arrives']) {
|
|
255
|
-
expect(section(heading), heading).not.toMatch(/OpenCode|Orca|Cursor|Codex|Hermes/)
|
|
255
|
+
expect(section(heading), heading).not.toMatch(/OpenCode|OpenClaw|Orca|Cursor|Codex|Hermes/)
|
|
256
256
|
}
|
|
257
257
|
})
|
|
258
258
|
|
|
@@ -278,6 +278,17 @@ describe('Notifai agent skill', () => {
|
|
|
278
278
|
expect(ask).toMatch(/tell me here/i)
|
|
279
279
|
})
|
|
280
280
|
|
|
281
|
+
it('keeps local registration distinct from submission and delivery evidence', () => {
|
|
282
|
+
const ask = section('## Ask a question')
|
|
283
|
+
expect(ask).toMatch(/`registered: true`[\s\S]{0,180}local/i)
|
|
284
|
+
expect(ask).toMatch(/not yet been submitted as a\s+Notification\s+Request/i)
|
|
285
|
+
expect(ask).toMatch(/no Provider Acceptance/i)
|
|
286
|
+
expect(ask).toContain('notifai status <question_id> --json')
|
|
287
|
+
expect(ask).toMatch(/local.*frozen.*live.*answered.*withdrawn.*retired/is)
|
|
288
|
+
expect(ask).toMatch(/never call a question\s+sent\s+or\s+delivered\s+from registration alone/i)
|
|
289
|
+
expect(ask).toMatch(/inspect or close the original[\s\S]{0,160}do not register/i)
|
|
290
|
+
})
|
|
291
|
+
|
|
281
292
|
it('requires an acknowledgement before any resumed work', () => {
|
|
282
293
|
const answers = section('## When the answer arrives')
|
|
283
294
|
const acknowledge = answers.indexOf('notifai acknowledge')
|
|
@@ -397,7 +408,7 @@ describe('Notifai agent skill', () => {
|
|
|
397
408
|
it('moves per-harness mechanics into progressive disclosure', () => {
|
|
398
409
|
expect(skill).toContain('[Harness setup and recovery](references/harness-setup.md)')
|
|
399
410
|
expect(skill).toMatch(/read it when you are\s+installing hooks or diagnosing routing/i)
|
|
400
|
-
for (const harness of ['Claude Code', 'Codex', 'Cursor', 'OpenCode', 'Hermes']) {
|
|
411
|
+
for (const harness of ['Claude Code', 'Codex', 'Cursor', 'OpenCode', 'OpenClaw', 'Hermes']) {
|
|
401
412
|
expect(harnessReference).toContain(`**${harness}:**`)
|
|
402
413
|
}
|
|
403
414
|
expect(harnessReference).toMatch(/exact `HERMES_SESSION_ID`/i)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest'
|
|
2
|
+
import { rootHelpFooter } from './help.js'
|
|
3
|
+
|
|
4
|
+
function stripAnsi(text: string): string {
|
|
5
|
+
return text.replace(/\u001B\[[0-9;]*m/g, '')
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
describe('rootHelpFooter', () => {
|
|
9
|
+
it('leads first-run with init, not the interactive app', () => {
|
|
10
|
+
const footer = stripAnsi(rootHelpFooter())
|
|
11
|
+
const start = footer.slice(footer.indexOf('Start here'))
|
|
12
|
+
const firstCommand = start.match(/notifai(?: init)?/)?.[0]
|
|
13
|
+
expect(firstCommand).toBe('notifai init')
|
|
14
|
+
expect(start.indexOf('notifai init')).toBeLessThan(start.search(/notifai\s{2,}/))
|
|
15
|
+
})
|
|
16
|
+
})
|
package/src/ui/help.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Help that answers "what can I do here", not "what strings does argv accept".
|
|
3
3
|
*
|
|
4
|
-
* The old help listed seventeen commands in one flat column, with the
|
|
5
|
-
* user needs (`init
|
|
4
|
+
* The old help listed seventeen commands in one flat column, with the one a new
|
|
5
|
+
* user needs (`init`) sitting between a platform capability dump and
|
|
6
6
|
* an entry point marked "Internal:". Everything was equally prominent, which is
|
|
7
7
|
* the same as nothing being prominent.
|
|
8
8
|
*
|
|
@@ -102,18 +102,17 @@ export const helpConfiguration: HelpConfiguration = {
|
|
|
102
102
|
/**
|
|
103
103
|
* Footer for the root help.
|
|
104
104
|
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
* there.
|
|
105
|
+
* First-run is `notifai init`. The interactive app is what a human opens
|
|
106
|
+
* later, once setup is no longer the thing in the way.
|
|
108
107
|
*/
|
|
109
108
|
export function rootHelpFooter(): string {
|
|
110
109
|
const lines = [
|
|
111
110
|
'',
|
|
112
111
|
style.heading('Start here'),
|
|
112
|
+
` ${style.code('notifai init')} ${style.dim(`${glyph.arrow} set this project up, step by step`)}`,
|
|
113
113
|
` ${style.code('notifai')} ${style.dim(
|
|
114
|
-
`${glyph.arrow}
|
|
114
|
+
`${glyph.arrow} after setup: status, settings, devices, test sends`,
|
|
115
115
|
)}`,
|
|
116
|
-
` ${style.code('notifai init')} ${style.dim(`${glyph.arrow} set this project up, step by step`)}`,
|
|
117
116
|
'',
|
|
118
117
|
style.heading('First call, for an agent'),
|
|
119
118
|
` ${style.code('notifai send --kind done --title "All 42 tests passed" --body "Finished in 3m 10s. Next: review the release candidate."')}`,
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest'
|
|
2
|
-
import { supportPageUrl } from './commands-devices.js'
|
|
3
|
-
|
|
4
|
-
describe('supportPageUrl', () => {
|
|
5
|
-
it('routes hosted control-plane origins to the dashboard support surface', () => {
|
|
6
|
-
expect(supportPageUrl('https://api.notifai.sh')).toBe('https://app.notifai.sh/support')
|
|
7
|
-
expect(supportPageUrl('https://notifai.fly.dev/')).toBe('https://app.notifai.sh/support')
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
it('keeps a self-hosted deployment on its own support route', () => {
|
|
11
|
-
expect(supportPageUrl('https://notifai.example.test/')).toBe(
|
|
12
|
-
'https://notifai.example.test/support',
|
|
13
|
-
)
|
|
14
|
-
})
|
|
15
|
-
})
|