@raidiant/notifai 10.1.1 → 10.1.2
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 +20 -0
- package/dist/commands-core.d.ts +1 -1
- package/dist/commands-init.js +9 -6
- package/dist/commands-init.js.map +1 -1
- package/dist/commands-send-support.js +3 -0
- package/dist/commands-send-support.js.map +1 -1
- package/dist/commands-skill.js +72 -54
- package/dist/commands-skill.js.map +1 -1
- package/dist/invocation-context.d.ts +1 -0
- package/dist/invocation-context.js +9 -1
- package/dist/invocation-context.js.map +1 -1
- package/dist/native-skills.d.ts +13 -3
- package/dist/native-skills.js +51 -12
- package/dist/native-skills.js.map +1 -1
- package/dist/node-floor.d.ts +2 -1
- package/dist/node-floor.js +9 -5
- package/dist/node-floor.js.map +1 -1
- package/dist/orca-session-title.d.ts +5 -4
- package/dist/orca-session-title.js +32 -19
- package/dist/orca-session-title.js.map +1 -1
- package/dist/platform.d.ts +11 -17
- package/dist/platform.js +20 -23
- package/dist/platform.js.map +1 -1
- package/dist/release.d.ts +5 -5
- package/dist/release.js +5 -5
- package/dist/setup-destinations.js +1 -1
- package/dist/setup-destinations.js.map +1 -1
- package/dist/skill-integrity.d.ts +49 -0
- package/dist/skill-integrity.js +154 -0
- package/dist/skill-integrity.js.map +1 -0
- package/dist/skill-source/manifest.json +16 -0
- package/dist/skill-source/notifai/SKILL.md +390 -0
- package/dist/skill-source/notifai/references/harness-setup.md +220 -0
- package/package.json +11 -14
- package/src/atomic-file.ts +0 -198
- package/src/claude-wake.test.ts +0 -321
- package/src/claude-wake.ts +0 -499
- package/src/cli-bin.test.ts +0 -176
- package/src/cli-bin.ts +0 -233
- package/src/cli-release.test.ts +0 -46
- package/src/cli-release.ts +0 -78
- package/src/cli-update-contract.ts +0 -9
- package/src/cli-update.test.ts +0 -125
- package/src/client.test.ts +0 -390
- package/src/client.ts +0 -352
- package/src/codex-wake.test.ts +0 -254
- package/src/codex-wake.ts +0 -301
- package/src/command-session.ts +0 -38
- package/src/commands-agent-sessions.ts +0 -72
- package/src/commands-auth.ts +0 -238
- package/src/commands-config.ts +0 -336
- package/src/commands-core.ts +0 -312
- package/src/commands-devices.ts +0 -180
- package/src/commands-doctor.ts +0 -1501
- package/src/commands-guidance.ts +0 -181
- package/src/commands-harness-context.ts +0 -207
- package/src/commands-hook-shape.ts +0 -69
- package/src/commands-hooks.ts +0 -2318
- package/src/commands-init.ts +0 -1055
- package/src/commands-io.ts +0 -108
- package/src/commands-logs.ts +0 -243
- package/src/commands-project.ts +0 -47
- package/src/commands-send-support.test.ts +0 -156
- package/src/commands-send-support.ts +0 -311
- package/src/commands-send.ts +0 -875
- package/src/commands-setup-proof.test.ts +0 -72
- package/src/commands-setup-proof.ts +0 -124
- package/src/commands-skill.test.ts +0 -44
- package/src/commands-skill.ts +0 -204
- package/src/commands-sounds.test.ts +0 -106
- package/src/commands-sounds.ts +0 -49
- package/src/commands-update.ts +0 -180
- package/src/commands.test.ts +0 -8297
- package/src/commands.ts +0 -77
- package/src/config-schema.test.ts +0 -153
- package/src/config-schema.ts +0 -349
- package/src/config.test.ts +0 -581
- package/src/config.ts +0 -475
- package/src/credentials.test.ts +0 -403
- package/src/credentials.ts +0 -403
- package/src/file-lock-process-worker.test.ts +0 -64
- package/src/file-lock.test.ts +0 -320
- package/src/file-lock.ts +0 -393
- package/src/fixtures/hermes-0.20.6-classic-cli-local.json +0 -50
- package/src/fixtures/openclaw-2026.7.1-2-agent-local.json +0 -57
- package/src/generated-session-label.ts +0 -155
- package/src/guidance-content.ts +0 -278
- package/src/guidance-render.ts +0 -56
- package/src/guidance.test.ts +0 -327
- package/src/guidance.ts +0 -233
- package/src/harness-integration.test.ts +0 -294
- package/src/harnesses.test.ts +0 -149
- package/src/harnesses.ts +0 -164
- package/src/hook-adapter.test.ts +0 -496
- package/src/hook-adapter.ts +0 -424
- package/src/hook-input.test.ts +0 -39
- package/src/hook-input.ts +0 -72
- package/src/hooks.test.ts +0 -5824
- package/src/hooks.ts +0 -4011
- package/src/install-hooks.test.ts +0 -1614
- package/src/install-hooks.ts +0 -1501
- package/src/interactive.test.ts +0 -387
- package/src/interactive.ts +0 -858
- package/src/invocation-context.test.ts +0 -352
- package/src/invocation-context.ts +0 -197
- package/src/logging-process-worker.test.ts +0 -45
- package/src/logging.test.ts +0 -544
- package/src/logging.ts +0 -698
- package/src/main-run.ts +0 -45
- package/src/main.ts +0 -12
- package/src/native-skills.test.ts +0 -115
- package/src/native-skills.ts +0 -162
- package/src/node-floor.test.ts +0 -27
- package/src/node-floor.ts +0 -37
- package/src/onboarding-docs.test.ts +0 -25
- package/src/openclaw-plugin.ts +0 -409
- package/src/opencode-plugin.ts +0 -298
- package/src/orca-session-title.test.ts +0 -54
- package/src/orca-session-title.ts +0 -103
- package/src/pack-feedback-slice.test.ts +0 -212
- package/src/pack-feedback-slice.ts +0 -187
- package/src/platform.test.ts +0 -152
- package/src/platform.ts +0 -173
- package/src/program.test.ts +0 -317
- package/src/program.ts +0 -842
- package/src/project-enablement.test.ts +0 -55
- package/src/project-enablement.ts +0 -99
- package/src/question-caps.test.ts +0 -49
- package/src/question-settlement-process.ts +0 -47
- package/src/question-timing.ts +0 -56
- package/src/readiness.test.ts +0 -25
- package/src/readiness.ts +0 -212
- package/src/release.ts +0 -51
- package/src/send-attempts.test.ts +0 -143
- package/src/send-attempts.ts +0 -188
- package/src/send.test.ts +0 -28
- package/src/send.ts +0 -436
- package/src/session-activation.ts +0 -61
- package/src/session-end-log-lock-worker.test.ts +0 -35
- package/src/session-labels.test.ts +0 -490
- package/src/session-labels.ts +0 -474
- package/src/setup-destinations.test.ts +0 -41
- package/src/setup-destinations.ts +0 -50
- package/src/skill.test.ts +0 -426
- package/src/sound-ref.test.ts +0 -31
- package/src/sound-ref.ts +0 -34
- package/src/trust-policy.test.ts +0 -701
- package/src/ui/banner.ts +0 -95
- package/src/ui/config-view.test.ts +0 -90
- package/src/ui/config-view.ts +0 -138
- package/src/ui/help.test.ts +0 -16
- package/src/ui/help.ts +0 -128
- package/src/ui/theme.test.ts +0 -92
- package/src/ui/theme.ts +0 -265
- package/src/url-policy.ts +0 -399
- package/tsconfig.json +0 -10
package/src/commands-devices.ts
DELETED
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
import { PLATFORMS, type Platform, type RoutableDevice } from '@raidiant/notifai-protocol'
|
|
2
|
-
import {
|
|
3
|
-
EXIT,
|
|
4
|
-
authedClient,
|
|
5
|
-
loadLoggedConfig,
|
|
6
|
-
makeClient,
|
|
7
|
-
reportError,
|
|
8
|
-
resolvedBaseUrl,
|
|
9
|
-
type CommandDeps,
|
|
10
|
-
} from './commands-core.js'
|
|
11
|
-
import {
|
|
12
|
-
companionPlatformLabel,
|
|
13
|
-
setupCompanionUrl,
|
|
14
|
-
type CompanionPlatform,
|
|
15
|
-
} from './setup-destinations.js'
|
|
16
|
-
|
|
17
|
-
// ---------------------------------------------------------------------------
|
|
18
|
-
// devices / capabilities
|
|
19
|
-
// ---------------------------------------------------------------------------
|
|
20
|
-
|
|
21
|
-
export async function devicesCommand(
|
|
22
|
-
deps: CommandDeps,
|
|
23
|
-
flags: { json?: boolean; platform?: string },
|
|
24
|
-
): Promise<number> {
|
|
25
|
-
if (flags.platform !== undefined && !(PLATFORMS as readonly string[]).includes(flags.platform)) {
|
|
26
|
-
deps.io.err(`Unknown platform "${flags.platform}" — use ${PLATFORMS.join(' or ')}.`)
|
|
27
|
-
return EXIT.usage
|
|
28
|
-
}
|
|
29
|
-
const platform = flags.platform as Platform | undefined
|
|
30
|
-
const config = loadLoggedConfig(deps, { cwd: deps.cwd, env: deps.env })
|
|
31
|
-
const authed = authedClient(deps, config)
|
|
32
|
-
if (!authed) return EXIT.auth
|
|
33
|
-
try {
|
|
34
|
-
const result = await authed.client.listDevices()
|
|
35
|
-
const devices =
|
|
36
|
-
platform === undefined
|
|
37
|
-
? result.devices
|
|
38
|
-
: result.devices.filter((device) => device.platform === platform)
|
|
39
|
-
if (flags.json) {
|
|
40
|
-
deps.io.out(JSON.stringify({ ...result, devices }, null, 2))
|
|
41
|
-
return EXIT.ok
|
|
42
|
-
}
|
|
43
|
-
if (devices.length === 0) {
|
|
44
|
-
if (platform !== undefined) {
|
|
45
|
-
deps.io.out(`No ${platform} devices registered.`)
|
|
46
|
-
return EXIT.ok
|
|
47
|
-
}
|
|
48
|
-
const setupUrl = setupCompanionUrl(authed.baseUrl)
|
|
49
|
-
let email: string | null = null
|
|
50
|
-
try {
|
|
51
|
-
email = (await authed.client.accessStatus()).email
|
|
52
|
-
} catch {
|
|
53
|
-
// Best-effort: the empty-state copy still names the destination.
|
|
54
|
-
}
|
|
55
|
-
deps.io.out(
|
|
56
|
-
`No devices yet. Set up a Companion App at ${setupUrl}, ${sameAccountSignInLine(email)}, and allow notifications.`,
|
|
57
|
-
)
|
|
58
|
-
return EXIT.ok
|
|
59
|
-
}
|
|
60
|
-
for (const d of devices) {
|
|
61
|
-
deps.io.out(
|
|
62
|
-
`${d.device_id} ${d.display_name} ${d.platform} ${d.status_message ?? 'Working'}`,
|
|
63
|
-
)
|
|
64
|
-
}
|
|
65
|
-
return EXIT.ok
|
|
66
|
-
} catch (err) {
|
|
67
|
-
return reportError(deps, err)
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Devices as data, for surfaces that render them themselves.
|
|
73
|
-
*
|
|
74
|
-
* `devicesCommand` prints and returns an exit code, which is the right shape
|
|
75
|
-
* for a command and the wrong one for a menu that wants to show names beside
|
|
76
|
-
* checkboxes. Silent on every failure by design: the interactive app already
|
|
77
|
-
* shows the credential and connectivity state on its status card, so a second
|
|
78
|
-
* error line here would be reporting the same fault twice.
|
|
79
|
-
*/
|
|
80
|
-
export async function deviceInventory(deps: CommandDeps): Promise<RoutableDevice[] | null> {
|
|
81
|
-
if (!deps.store.load()) return null
|
|
82
|
-
const config = loadLoggedConfig(deps, { cwd: deps.cwd, env: deps.env })
|
|
83
|
-
const authed = authedClient(deps, config)
|
|
84
|
-
if (!authed) return null
|
|
85
|
-
try {
|
|
86
|
-
return (await authed.client.listDevices()).devices
|
|
87
|
-
} catch {
|
|
88
|
-
return null
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/** Whether a device is in a state where a notification would actually arrive. */
|
|
93
|
-
export function canDeviceReceive(device: RoutableDevice): boolean {
|
|
94
|
-
return deviceCanReceive(device)
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export async function capabilitiesCommand(
|
|
98
|
-
deps: CommandDeps,
|
|
99
|
-
flags: { json?: boolean; platform?: Platform },
|
|
100
|
-
): Promise<number> {
|
|
101
|
-
// Locally, and with the same message `send` gives. Spending a round trip to
|
|
102
|
-
// have the server answer "Request validation failed" told the caller neither
|
|
103
|
-
// which flag was wrong nor what it accepts.
|
|
104
|
-
if (flags.platform !== undefined && !(PLATFORMS as readonly string[]).includes(flags.platform)) {
|
|
105
|
-
deps.io.err(`Unknown platform "${flags.platform}" — use ${PLATFORMS.join(' or ')}.`)
|
|
106
|
-
return EXIT.usage
|
|
107
|
-
}
|
|
108
|
-
const config = loadLoggedConfig(deps, { cwd: deps.cwd, env: deps.env })
|
|
109
|
-
const credential = deps.store.load()
|
|
110
|
-
const baseUrl = resolvedBaseUrl(config, credential)
|
|
111
|
-
const client = makeClient(deps, baseUrl, null)
|
|
112
|
-
try {
|
|
113
|
-
const doc = await client.capabilities(flags.platform ?? 'ios')
|
|
114
|
-
if (flags.json) {
|
|
115
|
-
deps.io.out(JSON.stringify(doc, null, 2))
|
|
116
|
-
return EXIT.ok
|
|
117
|
-
}
|
|
118
|
-
deps.io.out(`${doc.platform} capability contract v${doc.schema_version} (payload limit ${doc.payload_limit_bytes} bytes)`)
|
|
119
|
-
for (const field of doc.fields) {
|
|
120
|
-
deps.io.out(` ${field.path}: ${field.status}${field.reason ? ` — ${field.reason}` : ''}`)
|
|
121
|
-
}
|
|
122
|
-
return EXIT.ok
|
|
123
|
-
} catch (err) {
|
|
124
|
-
return reportError(deps, err)
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
/** Same-account line for the device hop; prefers the real email when known. */
|
|
129
|
-
export function sameAccountSignInLine(email: string | null | undefined): string {
|
|
130
|
-
return email
|
|
131
|
-
? `sign in with the same email as this account (${email})`
|
|
132
|
-
: 'sign in with the same email as this account'
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* What is actually left to do on the phone.
|
|
137
|
-
*
|
|
138
|
-
* Three sub-states, three remedies. "Install the app" is useless advice to
|
|
139
|
-
* someone who installed it and then declined the permission prompt, and
|
|
140
|
-
* offering install steps to a registered device says this terminal did not
|
|
141
|
-
* read the state it just fetched.
|
|
142
|
-
*/
|
|
143
|
-
export function deviceInstallRemedy(options: {
|
|
144
|
-
baseUrl: string
|
|
145
|
-
email: string | null
|
|
146
|
-
devices: readonly RoutableDevice[]
|
|
147
|
-
platform?: CompanionPlatform
|
|
148
|
-
}): string {
|
|
149
|
-
const sameEmail = sameAccountSignInLine(options.email)
|
|
150
|
-
if (options.devices.length === 0) {
|
|
151
|
-
const destination = setupCompanionUrl(options.baseUrl, options.platform)
|
|
152
|
-
const named =
|
|
153
|
-
options.platform === undefined
|
|
154
|
-
? 'the Companion App'
|
|
155
|
-
: `Notifai on ${companionPlatformLabel(options.platform)}`
|
|
156
|
-
return `open the steps for ${named} at ${destination}, install it, ${sameEmail}, and allow notifications`
|
|
157
|
-
}
|
|
158
|
-
if (options.devices.some((d) => d.permission_status === 'denied')) {
|
|
159
|
-
return "allow notifications for Notifai in the device's Settings"
|
|
160
|
-
}
|
|
161
|
-
return 'open Notifai on the device and allow its notification prompt'
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
export function deviceCanReceive(device: RoutableDevice): boolean {
|
|
165
|
-
const receiveIsFloored =
|
|
166
|
-
device.support?.state === 'must_update' &&
|
|
167
|
-
device.support.affected_operation === 'receive_notifications'
|
|
168
|
-
return (
|
|
169
|
-
!receiveIsFloored &&
|
|
170
|
-
device.registration_healthy &&
|
|
171
|
-
(device.permission_status === 'authorized' || device.permission_status === 'provisional')
|
|
172
|
-
)
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
export function readyCompanionDevices(devices: readonly RoutableDevice[]): RoutableDevice[] {
|
|
176
|
-
return devices.filter(
|
|
177
|
-
(device) =>
|
|
178
|
-
(device.platform === 'ios' || device.platform === 'android') && deviceCanReceive(device),
|
|
179
|
-
)
|
|
180
|
-
}
|