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