@raidiant/notifai 10.1.1 → 10.1.3
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 +35 -0
- package/dist/commands-core.d.ts +4 -1
- package/dist/commands-core.js.map +1 -1
- package/dist/commands-doctor.js +2 -7
- package/dist/commands-doctor.js.map +1 -1
- package/dist/commands-hooks.d.ts +12 -0
- package/dist/commands-hooks.js +15 -1
- package/dist/commands-hooks.js.map +1 -1
- package/dist/commands-init.js +9 -6
- package/dist/commands-init.js.map +1 -1
- package/dist/commands-send-support.js +10 -11
- 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/harness-session-title.d.ts +22 -0
- package/dist/harness-session-title.js +74 -0
- package/dist/harness-session-title.js.map +1 -0
- package/dist/invocation-context.d.ts +1 -0
- package/dist/invocation-context.js +15 -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/session-labels.d.ts +2 -0
- package/dist/session-labels.js +20 -9
- package/dist/session-labels.js.map +1 -1
- 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-update.ts
DELETED
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
import { spawnSync } from 'node:child_process'
|
|
2
|
-
import { existsSync, realpathSync } from 'node:fs'
|
|
3
|
-
import path from 'node:path'
|
|
4
|
-
import {
|
|
5
|
-
inspectCliInstallations,
|
|
6
|
-
type CliInstallationInspection,
|
|
7
|
-
} from './cli-bin.js'
|
|
8
|
-
import { EXIT, type CommandDeps } from './commands-core.js'
|
|
9
|
-
import {
|
|
10
|
-
hookAdapterPath,
|
|
11
|
-
installHookAdapter,
|
|
12
|
-
inspectHookAdapter,
|
|
13
|
-
isNpxAdapterTarget,
|
|
14
|
-
} from './hook-adapter.js'
|
|
15
|
-
import { packageVersion } from './release.js'
|
|
16
|
-
import { compareCliSemVer } from './cli-release.js'
|
|
17
|
-
|
|
18
|
-
export interface CliUpdateFlags {
|
|
19
|
-
json?: boolean
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function runningArtifact(deps: CommandDeps): string | undefined {
|
|
23
|
-
const target = deps.hookInstallTarget
|
|
24
|
-
if (target !== undefined && !isNpxAdapterTarget(target)) return target.scriptPath
|
|
25
|
-
return process.argv[1]
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function npmRun(
|
|
29
|
-
deps: CommandDeps,
|
|
30
|
-
args: readonly string[],
|
|
31
|
-
): ReturnType<typeof spawnSync> {
|
|
32
|
-
const npmCli = deps.env['npm_execpath']
|
|
33
|
-
if (typeof npmCli === 'string' && npmCli !== '') {
|
|
34
|
-
return spawnSync(process.execPath, [npmCli, ...args], {
|
|
35
|
-
encoding: 'utf8',
|
|
36
|
-
env: deps.env,
|
|
37
|
-
windowsHide: true,
|
|
38
|
-
})
|
|
39
|
-
}
|
|
40
|
-
return spawnSync((deps.hookPlatform ?? process.platform) === 'win32' ? 'npm.cmd' : 'npm', args, {
|
|
41
|
-
encoding: 'utf8',
|
|
42
|
-
env: deps.env,
|
|
43
|
-
windowsHide: true,
|
|
44
|
-
})
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function inspection(deps: CommandDeps): CliInstallationInspection {
|
|
48
|
-
const artifact = runningArtifact(deps)
|
|
49
|
-
return inspectCliInstallations(
|
|
50
|
-
deps.env,
|
|
51
|
-
deps.hookPlatform ?? process.platform,
|
|
52
|
-
{
|
|
53
|
-
...(artifact === undefined ? {} : { runningArtifactPath: artifact }),
|
|
54
|
-
currentVersion: packageVersion(),
|
|
55
|
-
},
|
|
56
|
-
)
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function sameLocalPath(left: string, right: string): boolean {
|
|
60
|
-
const canonical = (value: string) => {
|
|
61
|
-
try {
|
|
62
|
-
return realpathSync(value)
|
|
63
|
-
} catch {
|
|
64
|
-
return path.resolve(value)
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return canonical(left) === canonical(right)
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function prefixIsAddressable(deps: CommandDeps, prefix: string): boolean {
|
|
71
|
-
const platform = deps.hookPlatform ?? process.platform
|
|
72
|
-
const raw = platform === 'win32' ? (deps.env['Path'] ?? deps.env['PATH'] ?? '') : (deps.env['PATH'] ?? '')
|
|
73
|
-
const delimiter = platform === 'win32' ? ';' : ':'
|
|
74
|
-
const commandDirectory = platform === 'win32' ? prefix : path.join(prefix, 'bin')
|
|
75
|
-
return raw.split(delimiter).some((directory) => directory !== '' && sameLocalPath(directory, commandDirectory))
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function failed(
|
|
79
|
-
deps: CommandDeps,
|
|
80
|
-
flags: CliUpdateFlags,
|
|
81
|
-
code: string,
|
|
82
|
-
before: CliInstallationInspection,
|
|
83
|
-
packageManagerPrefix: string | null,
|
|
84
|
-
): number {
|
|
85
|
-
if (flags.json === true) {
|
|
86
|
-
deps.io.out(JSON.stringify({ ok: false, code, package_manager_prefix: packageManagerPrefix, before }, null, 2))
|
|
87
|
-
} else {
|
|
88
|
-
deps.io.err('Notifai could not safely update the command that wins PATH. Run `notifai doctor --json` for the local installation details.')
|
|
89
|
-
}
|
|
90
|
-
return EXIT.failed
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Update the npm-global installation the shell actually resolves, then point
|
|
95
|
-
* the stable hook adapter at that same artifact. The npm executable may own a
|
|
96
|
-
* different global prefix; --prefix makes that ambient choice irrelevant.
|
|
97
|
-
*/
|
|
98
|
-
export function cliUpdateCommand(deps: CommandDeps, flags: CliUpdateFlags): number {
|
|
99
|
-
const before = inspection(deps)
|
|
100
|
-
const prefixResult = npmRun(deps, ['prefix', '--global'])
|
|
101
|
-
const packageManagerPrefix =
|
|
102
|
-
prefixResult.status === 0 && typeof prefixResult.stdout === 'string' && prefixResult.stdout.trim() !== ''
|
|
103
|
-
? prefixResult.stdout.trim()
|
|
104
|
-
: null
|
|
105
|
-
const pathCandidate = before.effective ?? before.entries[0] ?? null
|
|
106
|
-
const targetPrefix = pathCandidate === null
|
|
107
|
-
? packageManagerPrefix
|
|
108
|
-
: pathCandidate.install_prefix
|
|
109
|
-
if (targetPrefix === null) {
|
|
110
|
-
return failed(deps, flags, 'update_destination_unknown', before, packageManagerPrefix)
|
|
111
|
-
}
|
|
112
|
-
if (pathCandidate === null && !prefixIsAddressable(deps, targetPrefix)) {
|
|
113
|
-
return failed(deps, flags, 'package_manager_prefix_not_on_path', before, packageManagerPrefix)
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
const install = npmRun(deps, [
|
|
117
|
-
'install',
|
|
118
|
-
'--global',
|
|
119
|
-
'--prefix',
|
|
120
|
-
targetPrefix,
|
|
121
|
-
'@raidiant/notifai',
|
|
122
|
-
])
|
|
123
|
-
if (install.status !== 0) {
|
|
124
|
-
return failed(deps, flags, 'package_install_failed', before, packageManagerPrefix)
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
const after = inspection(deps)
|
|
128
|
-
const effective = after.effective
|
|
129
|
-
if (
|
|
130
|
-
effective === null ||
|
|
131
|
-
effective.artifact_path === null ||
|
|
132
|
-
effective.version === null ||
|
|
133
|
-
(before.effective !== null && effective.command_path !== before.effective.command_path)
|
|
134
|
-
) {
|
|
135
|
-
return failed(deps, flags, 'effective_command_not_repaired', before, packageManagerPrefix)
|
|
136
|
-
}
|
|
137
|
-
const minimumCurrent = before.current.version
|
|
138
|
-
const currentComparison = minimumCurrent === null
|
|
139
|
-
? null
|
|
140
|
-
: compareCliSemVer(effective.version, minimumCurrent)
|
|
141
|
-
if (
|
|
142
|
-
currentComparison !== null &&
|
|
143
|
-
currentComparison < 0
|
|
144
|
-
) {
|
|
145
|
-
return failed(deps, flags, 'effective_command_still_older', before, packageManagerPrefix)
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
let adapterRetargeted = false
|
|
149
|
-
const adapter = hookAdapterPath(deps.hookAdapterHome)
|
|
150
|
-
if (existsSync(adapter)) {
|
|
151
|
-
try {
|
|
152
|
-
adapterRetargeted = installHookAdapter(
|
|
153
|
-
{ execPath: process.execPath, scriptPath: effective.artifact_path },
|
|
154
|
-
deps.hookAdapterHome,
|
|
155
|
-
deps.hookPlatform ?? process.platform,
|
|
156
|
-
).changed
|
|
157
|
-
} catch {
|
|
158
|
-
return failed(deps, flags, 'hook_adapter_retarget_failed', before, packageManagerPrefix)
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
if (flags.json === true) {
|
|
163
|
-
const adapterInspection = existsSync(adapter)
|
|
164
|
-
? inspectHookAdapter(deps.hookAdapterHome, deps.hookPlatform ?? process.platform)
|
|
165
|
-
: null
|
|
166
|
-
deps.io.out(JSON.stringify({
|
|
167
|
-
ok: true,
|
|
168
|
-
package_manager_prefix: packageManagerPrefix,
|
|
169
|
-
update_prefix: targetPrefix,
|
|
170
|
-
before,
|
|
171
|
-
after,
|
|
172
|
-
hook_adapter: adapterInspection === null
|
|
173
|
-
? null
|
|
174
|
-
: { path: adapterInspection.path, target: adapterInspection.target, retargeted: adapterRetargeted },
|
|
175
|
-
}, null, 2))
|
|
176
|
-
} else {
|
|
177
|
-
deps.io.out('Notifai is updated. Re-run `notifai init` to continue setup.')
|
|
178
|
-
}
|
|
179
|
-
return EXIT.ok
|
|
180
|
-
}
|