helloagents 3.0.12 → 3.0.15-beta.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/.claude-plugin/marketplace.json +6 -4
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/README.md +169 -30
- package/README_CN.md +169 -30
- package/bootstrap-lite.md +27 -20
- package/bootstrap.md +30 -23
- package/cli.mjs +119 -11
- package/gemini-extension.json +1 -1
- package/install.ps1 +125 -0
- package/install.sh +118 -0
- package/package.json +23 -4
- package/scripts/advisor-state.mjs +36 -63
- package/scripts/capability-registry.mjs +3 -3
- package/scripts/cli-branch.mjs +84 -0
- package/scripts/cli-codex-config.mjs +11 -20
- package/scripts/cli-codex.mjs +32 -38
- package/scripts/cli-doctor-render.mjs +4 -0
- package/scripts/cli-doctor.mjs +40 -30
- package/scripts/cli-host-detect.mjs +0 -1
- package/scripts/cli-hosts.mjs +16 -8
- package/scripts/cli-lifecycle-hosts.mjs +92 -27
- package/scripts/cli-lifecycle.mjs +9 -7
- package/scripts/cli-messages.mjs +34 -16
- package/scripts/cli-runtime-carrier.mjs +36 -0
- package/scripts/cli-runtime-root.mjs +72 -0
- package/scripts/cli-toml.mjs +0 -79
- package/scripts/cli-utils.mjs +30 -4
- package/scripts/closeout-state.mjs +35 -62
- package/scripts/delivery-gate-messages.mjs +70 -0
- package/scripts/delivery-gate.mjs +9 -75
- package/scripts/guard-rules.mjs +42 -42
- package/scripts/guard.mjs +44 -24
- package/scripts/notify-context.mjs +19 -28
- package/scripts/notify-gates.mjs +2 -0
- package/scripts/notify-route.mjs +9 -7
- package/scripts/notify-ui.mjs +46 -33
- package/scripts/notify.mjs +60 -32
- package/scripts/project-storage.mjs +35 -66
- package/scripts/ralph-loop.mjs +36 -31
- package/scripts/replay-state.mjs +31 -128
- package/scripts/review-state.mjs +34 -61
- package/scripts/runtime-artifacts.mjs +95 -0
- package/scripts/runtime-context.mjs +35 -29
- package/scripts/runtime-scope.mjs +313 -0
- package/scripts/session-capsule.mjs +202 -0
- package/scripts/turn-state-cli.mjs +17 -0
- package/scripts/turn-state.mjs +185 -66
- package/scripts/turn-stop-gate.mjs +24 -6
- package/scripts/verify-state.mjs +34 -85
- package/scripts/visual-state.mjs +38 -65
- package/scripts/workflow-core.mjs +2 -2
- package/scripts/workflow-plan-files.mjs +1 -1
- package/scripts/workflow-recommendation.mjs +17 -13
- package/scripts/workflow-state.mjs +5 -5
- package/skills/commands/build/SKILL.md +1 -1
- package/skills/commands/commit/SKILL.md +1 -1
- package/skills/commands/help/SKILL.md +3 -3
- package/skills/commands/loop/SKILL.md +1 -1
- package/skills/commands/plan/SKILL.md +8 -6
- package/skills/commands/prd/SKILL.md +5 -3
- package/skills/commands/verify/SKILL.md +5 -5
- package/skills/hello-debug/SKILL.md +20 -3
- package/skills/hello-review/SKILL.md +2 -2
- package/skills/hello-subagent/SKILL.md +2 -2
- package/skills/hello-test/SKILL.md +6 -2
- package/skills/hello-ui/SKILL.md +4 -4
- package/skills/hello-verify/SKILL.md +10 -7
- package/skills/helloagents/SKILL.md +12 -7
- package/templates/context.md +6 -0
- package/templates/plans/plan.md +3 -0
- package/templates/plans/tasks.md +8 -3
package/cli.mjs
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
'use strict'
|
|
7
7
|
|
|
8
8
|
import { homedir } from 'node:os'
|
|
9
|
+
import { existsSync } from 'node:fs'
|
|
10
|
+
import { spawnSync } from 'node:child_process'
|
|
9
11
|
import { dirname, join, resolve } from 'node:path'
|
|
10
12
|
import { fileURLToPath } from 'node:url'
|
|
11
13
|
|
|
@@ -23,11 +25,14 @@ import {
|
|
|
23
25
|
syncVersion,
|
|
24
26
|
} from './scripts/cli-lifecycle.mjs'
|
|
25
27
|
import { initCliDoctor, runDoctor } from './scripts/cli-doctor.mjs'
|
|
28
|
+
import { runBranchSwitch } from './scripts/cli-branch.mjs'
|
|
26
29
|
import { createMessageHelpers, createInstallMessagePrinter } from './scripts/cli-messages.mjs'
|
|
30
|
+
import { getStableRuntimeRoot, removeRuntimeRoot, syncRuntimeRoot } from './scripts/cli-runtime-root.mjs'
|
|
27
31
|
|
|
28
32
|
const HOME = homedir()
|
|
29
33
|
const PKG_ROOT = resolve(dirname(fileURLToPath(import.meta.url)))
|
|
30
34
|
const HELLOAGENTS_HOME = join(HOME, '.helloagents')
|
|
35
|
+
const RUNTIME_ROOT = getStableRuntimeRoot(HOME)
|
|
31
36
|
const CONFIG_FILE = join(HELLOAGENTS_HOME, 'helloagents.json')
|
|
32
37
|
const pkg = loadPackageVersion(PKG_ROOT)
|
|
33
38
|
|
|
@@ -44,7 +49,8 @@ const { printHelp, printInstallMsg } = createInstallMessagePrinter({
|
|
|
44
49
|
})
|
|
45
50
|
initCliLifecycle({
|
|
46
51
|
home: HOME,
|
|
47
|
-
pkgRoot:
|
|
52
|
+
pkgRoot: RUNTIME_ROOT,
|
|
53
|
+
sourceRoot: PKG_ROOT,
|
|
48
54
|
helloagentsHome: HELLOAGENTS_HOME,
|
|
49
55
|
configFile: CONFIG_FILE,
|
|
50
56
|
pkgVersion: pkg.version,
|
|
@@ -54,7 +60,8 @@ initCliLifecycle({
|
|
|
54
60
|
})
|
|
55
61
|
initCliDoctor({
|
|
56
62
|
home: HOME,
|
|
57
|
-
pkgRoot:
|
|
63
|
+
pkgRoot: RUNTIME_ROOT,
|
|
64
|
+
sourceRoot: PKG_ROOT,
|
|
58
65
|
pkgVersion: pkg.version,
|
|
59
66
|
msg,
|
|
60
67
|
readSettings,
|
|
@@ -64,17 +71,29 @@ initCliDoctor({
|
|
|
64
71
|
getHostLabel,
|
|
65
72
|
})
|
|
66
73
|
|
|
74
|
+
function ensureRuntimeRoot() {
|
|
75
|
+
syncRuntimeRoot(PKG_ROOT, RUNTIME_ROOT)
|
|
76
|
+
}
|
|
77
|
+
|
|
67
78
|
function printPostinstallMessage() {
|
|
68
79
|
console.log(`\n HelloAGENTS v${pkg.version}\n`)
|
|
69
80
|
ensureConfig(HELLOAGENTS_HOME, CONFIG_FILE, safeJson, ensureDir)
|
|
81
|
+
ensureRuntimeRoot()
|
|
70
82
|
ok('~/.helloagents/helloagents.json')
|
|
83
|
+
ok('~/.helloagents/helloagents')
|
|
71
84
|
|
|
72
85
|
const settings = readSettings()
|
|
73
86
|
const mode = settings.install_mode || DEFAULTS.install_mode
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
87
|
+
const deployMessage = shouldDeployFromEnv()
|
|
88
|
+
? msg(
|
|
89
|
+
' HelloAGENTS 包已安装,正在按环境变量部署。\n',
|
|
90
|
+
' HelloAGENTS package installed; deploying from environment variables.\n',
|
|
91
|
+
)
|
|
92
|
+
: msg(
|
|
93
|
+
` HelloAGENTS 包已安装,尚未自动部署到任何 CLI。\n 使用显式命令部署:\n helloagents install codex --${mode}\n helloagents install --all --${mode}\n`,
|
|
94
|
+
` HelloAGENTS package installed. No CLI targets were configured automatically.\n Deploy explicitly with:\n helloagents install codex --${mode}\n helloagents install --all --${mode}\n`,
|
|
95
|
+
)
|
|
96
|
+
console.log(deployMessage)
|
|
78
97
|
}
|
|
79
98
|
|
|
80
99
|
function runSafely(handler) {
|
|
@@ -86,21 +105,110 @@ function runSafely(handler) {
|
|
|
86
105
|
}
|
|
87
106
|
}
|
|
88
107
|
|
|
108
|
+
function resolveRuntimeScript(scriptName) {
|
|
109
|
+
const runtimeScript = join(RUNTIME_ROOT, 'scripts', scriptName)
|
|
110
|
+
if (existsSync(runtimeScript)) return runtimeScript
|
|
111
|
+
return join(PKG_ROOT, 'scripts', scriptName)
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function runRuntimeScript(scriptName, scriptArgs) {
|
|
115
|
+
const result = spawnSync(process.execPath, [resolveRuntimeScript(scriptName), ...scriptArgs], {
|
|
116
|
+
stdio: 'inherit',
|
|
117
|
+
windowsHide: true,
|
|
118
|
+
})
|
|
119
|
+
if (result.error) {
|
|
120
|
+
console.error(`\n ✗ ${result.error.message}\n`)
|
|
121
|
+
process.exitCode = 1
|
|
122
|
+
return
|
|
123
|
+
}
|
|
124
|
+
process.exitCode = typeof result.status === 'number' ? result.status : 1
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function envFlag(name) {
|
|
128
|
+
return ['1', 'true', 'yes', 'on'].includes(String(process.env[name] || '').toLowerCase())
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function parseCompactLifecycleSpec() {
|
|
132
|
+
const raw = String(process.env.HELLOAGENTS || '').trim()
|
|
133
|
+
if (!raw) return null
|
|
134
|
+
|
|
135
|
+
const parts = raw.split(':')
|
|
136
|
+
if (parts.length > 2 || !parts[0]) {
|
|
137
|
+
throw new Error(msg('HELLOAGENTS 必须是 target[:mode],例如 codex:global', 'HELLOAGENTS must be target[:mode], for example codex:global'))
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const target = normalizeHost(parts[0].trim().toLowerCase())
|
|
141
|
+
const mode = (parts[1] || '').trim().toLowerCase()
|
|
142
|
+
if (!target) throw new Error(msg(`不支持的 HELLOAGENTS 目标:${parts[0]}`, `Unsupported HELLOAGENTS target: ${parts[0]}`))
|
|
143
|
+
if (mode && !['standby', 'global'].includes(mode)) {
|
|
144
|
+
throw new Error(msg(`不支持的 HELLOAGENTS 模式:${mode}`, `Unsupported HELLOAGENTS mode: ${mode}`))
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
return { target, mode }
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function lifecycleArgsFromEnv(defaultTarget = 'all') {
|
|
151
|
+
const compact = parseCompactLifecycleSpec()
|
|
152
|
+
const target = (
|
|
153
|
+
process.env.HELLOAGENTS_TARGET
|
|
154
|
+
|| process.env.HELLOAGENTS_HOST
|
|
155
|
+
|| compact?.target
|
|
156
|
+
|| defaultTarget
|
|
157
|
+
).trim()
|
|
158
|
+
const mode = (process.env.HELLOAGENTS_MODE || compact?.mode || '').trim().toLowerCase()
|
|
159
|
+
const args = [target === 'all' ? '--all' : target]
|
|
160
|
+
if (mode) args.push(`--${mode}`)
|
|
161
|
+
return args
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function shouldDeployFromEnv() {
|
|
165
|
+
return envFlag('HELLOAGENTS_DEPLOY') || Boolean(String(process.env.HELLOAGENTS || '').trim())
|
|
166
|
+
}
|
|
167
|
+
|
|
89
168
|
const argv = process.argv.slice(2)
|
|
90
169
|
const cmd = argv[0] || ''
|
|
91
170
|
|
|
92
|
-
if (cmd === '
|
|
171
|
+
if (cmd === 'codex-notify') {
|
|
172
|
+
runRuntimeScript('notify.mjs', ['codex-notify', ...argv.slice(1)])
|
|
173
|
+
} else if (cmd === 'notify') {
|
|
174
|
+
runRuntimeScript('notify.mjs', argv.slice(1))
|
|
175
|
+
} else if (cmd === 'guard') {
|
|
176
|
+
runRuntimeScript('guard.mjs', argv.slice(1))
|
|
177
|
+
} else if (cmd === 'ralph-loop') {
|
|
178
|
+
runRuntimeScript('ralph-loop.mjs', argv.slice(1))
|
|
179
|
+
} else if (cmd === 'postinstall') {
|
|
93
180
|
printPostinstallMessage()
|
|
181
|
+
if (shouldDeployFromEnv()) {
|
|
182
|
+
runSafely(() => runScopedLifecycle('install', lifecycleArgsFromEnv()))
|
|
183
|
+
}
|
|
94
184
|
} else if (cmd === 'preuninstall') {
|
|
95
|
-
|
|
185
|
+
runSafely(() => {
|
|
186
|
+
const cleanupArgs = argv.length > 1 ? argv.slice(1) : lifecycleArgsFromEnv('all')
|
|
187
|
+
runScopedLifecycle('cleanup', cleanupArgs)
|
|
188
|
+
if (cleanupArgs.includes('--all')) removeRuntimeRoot(RUNTIME_ROOT)
|
|
189
|
+
})
|
|
96
190
|
} else if (cmd === 'sync-version') {
|
|
97
191
|
syncVersion()
|
|
98
192
|
} else if (cmd === 'doctor') {
|
|
99
193
|
runSafely(() => runDoctor(argv.slice(1)))
|
|
100
194
|
} else if (cmd === '--global' || cmd === '--standby') {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
195
|
+
runSafely(() => {
|
|
196
|
+
ensureRuntimeRoot()
|
|
197
|
+
switchMode(cmd === '--global' ? 'global' : 'standby')
|
|
198
|
+
})
|
|
199
|
+
} else if (cmd === 'branch' || cmd === 'switch-branch') {
|
|
200
|
+
runSafely(() => runBranchSwitch(argv.slice(1)))
|
|
201
|
+
} else if (['install', 'update', 'uninstall', 'cleanup'].includes(cmd)) {
|
|
202
|
+
runSafely(() => {
|
|
203
|
+
const action = cmd
|
|
204
|
+
const lifecycleArgs = argv.slice(1)
|
|
205
|
+
if (cmd === 'install' || cmd === 'update') ensureRuntimeRoot()
|
|
206
|
+
runScopedLifecycle(action, lifecycleArgs)
|
|
207
|
+
const positionals = lifecycleArgs.filter((arg) => !arg.startsWith('--'))
|
|
208
|
+
if (action === 'uninstall' && (lifecycleArgs.includes('--all') || positionals.length === 0)) {
|
|
209
|
+
removeRuntimeRoot(RUNTIME_ROOT)
|
|
210
|
+
}
|
|
211
|
+
})
|
|
104
212
|
} else {
|
|
105
213
|
printHelp()
|
|
106
214
|
}
|
package/gemini-extension.json
CHANGED
package/install.ps1
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# HelloAGENTS one-shot installer.
|
|
2
|
+
#
|
|
3
|
+
# Environment:
|
|
4
|
+
# HELLOAGENTS=all|claude|gemini|codex[:standby|global]
|
|
5
|
+
# HELLOAGENTS_ACTION=install|update|uninstall|switch-branch|branch
|
|
6
|
+
# HELLOAGENTS_TARGET=all|claude|gemini|codex
|
|
7
|
+
# HELLOAGENTS_MODE=standby|global
|
|
8
|
+
# HELLOAGENTS_BRANCH=main|beta|...
|
|
9
|
+
# HELLOAGENTS_PACKAGE=helloagents|github:owner/repo#ref|...
|
|
10
|
+
|
|
11
|
+
$ErrorActionPreference = "Stop"
|
|
12
|
+
|
|
13
|
+
$Action = if ($env:HELLOAGENTS_ACTION) { $env:HELLOAGENTS_ACTION } else { "install" }
|
|
14
|
+
$Target = if ($env:HELLOAGENTS_TARGET) { $env:HELLOAGENTS_TARGET } else { "" }
|
|
15
|
+
$Mode = if ($env:HELLOAGENTS_MODE) { $env:HELLOAGENTS_MODE } else { "" }
|
|
16
|
+
$Branch = if ($env:HELLOAGENTS_BRANCH) { $env:HELLOAGENTS_BRANCH } else { "" }
|
|
17
|
+
$Package = if ($env:HELLOAGENTS_PACKAGE) { $env:HELLOAGENTS_PACKAGE } else { "" }
|
|
18
|
+
|
|
19
|
+
if ($env:HELLOAGENTS) {
|
|
20
|
+
$Parts = $env:HELLOAGENTS.Split(":", 2)
|
|
21
|
+
if (-not $Parts[0]) {
|
|
22
|
+
throw "HELLOAGENTS must be target[:mode], for example codex:global"
|
|
23
|
+
}
|
|
24
|
+
if (-not $Target) { $Target = $Parts[0] }
|
|
25
|
+
if (-not $Mode -and $Parts.Count -gt 1) { $Mode = $Parts[1] }
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (-not $Target) { $Target = "all" }
|
|
29
|
+
if (-not $Mode) { $Mode = "standby" }
|
|
30
|
+
$Target = $Target.ToLowerInvariant()
|
|
31
|
+
$Mode = $Mode.ToLowerInvariant()
|
|
32
|
+
|
|
33
|
+
if (@("all", "claude", "gemini", "codex") -notcontains $Target) {
|
|
34
|
+
throw "Unsupported HELLOAGENTS target: $Target"
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (@("standby", "global") -notcontains $Mode) {
|
|
38
|
+
throw "Unsupported HELLOAGENTS mode: $Mode"
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (-not $Package) {
|
|
42
|
+
if ($Branch) {
|
|
43
|
+
$Package = "github:hellowind777/helloagents#$Branch"
|
|
44
|
+
} else {
|
|
45
|
+
$Package = "helloagents"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function Invoke-Npm {
|
|
50
|
+
param([string[]]$Args)
|
|
51
|
+
& npm @Args
|
|
52
|
+
if ($LASTEXITCODE -ne 0) {
|
|
53
|
+
throw "npm $($Args -join ' ') failed with exit code $LASTEXITCODE"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function Enable-PostinstallDeploy {
|
|
58
|
+
$env:HELLOAGENTS_DEPLOY = "1"
|
|
59
|
+
$env:HELLOAGENTS_TARGET = $Target
|
|
60
|
+
$env:HELLOAGENTS_MODE = $Mode
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function Invoke-HostScript {
|
|
64
|
+
param([string]$ScriptName)
|
|
65
|
+
if ($Target -eq "all") {
|
|
66
|
+
Invoke-Npm @("explore", "-g", "helloagents", "--", "npm", "run", $ScriptName, "--", "--all", "--$Mode")
|
|
67
|
+
} else {
|
|
68
|
+
Invoke-Npm @("explore", "-g", "helloagents", "--", "npm", "run", $ScriptName, "--", $Target, "--$Mode")
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function Sync-Hosts {
|
|
73
|
+
Invoke-HostScript "sync-hosts"
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function Cleanup-Hosts {
|
|
77
|
+
Invoke-HostScript "cleanup-hosts"
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function Uninstall-Hosts {
|
|
81
|
+
Invoke-HostScript "uninstall"
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
switch ($Action) {
|
|
85
|
+
"install" {
|
|
86
|
+
Enable-PostinstallDeploy
|
|
87
|
+
Invoke-Npm @("install", "-g", $Package)
|
|
88
|
+
}
|
|
89
|
+
"update" {
|
|
90
|
+
if ($Branch -or $env:HELLOAGENTS_PACKAGE) {
|
|
91
|
+
Invoke-Npm @("install", "-g", $Package)
|
|
92
|
+
} else {
|
|
93
|
+
& npm update -g helloagents
|
|
94
|
+
if ($LASTEXITCODE -ne 0) {
|
|
95
|
+
Invoke-Npm @("install", "-g", "helloagents")
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
Sync-Hosts
|
|
99
|
+
}
|
|
100
|
+
"switch-branch" {
|
|
101
|
+
if (-not $Branch -and -not $env:HELLOAGENTS_PACKAGE) {
|
|
102
|
+
throw "HELLOAGENTS_BRANCH or HELLOAGENTS_PACKAGE is required for switch-branch"
|
|
103
|
+
}
|
|
104
|
+
Invoke-Npm @("install", "-g", $Package)
|
|
105
|
+
Sync-Hosts
|
|
106
|
+
}
|
|
107
|
+
"branch" {
|
|
108
|
+
if (-not $Branch -and -not $env:HELLOAGENTS_PACKAGE) {
|
|
109
|
+
throw "HELLOAGENTS_BRANCH or HELLOAGENTS_PACKAGE is required for branch"
|
|
110
|
+
}
|
|
111
|
+
Invoke-Npm @("install", "-g", $Package)
|
|
112
|
+
Sync-Hosts
|
|
113
|
+
}
|
|
114
|
+
"uninstall" {
|
|
115
|
+
try {
|
|
116
|
+
Uninstall-Hosts
|
|
117
|
+
} catch {
|
|
118
|
+
Write-Warning "Failed to cleanup HelloAGENTS host integrations before uninstall: $_"
|
|
119
|
+
}
|
|
120
|
+
Invoke-Npm @("uninstall", "-g", "helloagents")
|
|
121
|
+
}
|
|
122
|
+
default {
|
|
123
|
+
throw "Unsupported HELLOAGENTS_ACTION: $Action"
|
|
124
|
+
}
|
|
125
|
+
}
|
package/install.sh
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
#!/usr/bin/env sh
|
|
2
|
+
set -eu
|
|
3
|
+
|
|
4
|
+
# HelloAGENTS one-shot installer.
|
|
5
|
+
#
|
|
6
|
+
# Environment:
|
|
7
|
+
# HELLOAGENTS=all|claude|gemini|codex[:standby|global]
|
|
8
|
+
# HELLOAGENTS_ACTION=install|update|uninstall|switch-branch|branch
|
|
9
|
+
# HELLOAGENTS_TARGET=all|claude|gemini|codex
|
|
10
|
+
# HELLOAGENTS_MODE=standby|global
|
|
11
|
+
# HELLOAGENTS_BRANCH=main|beta|...
|
|
12
|
+
# HELLOAGENTS_PACKAGE=helloagents|github:owner/repo#ref|...
|
|
13
|
+
|
|
14
|
+
ACTION="${HELLOAGENTS_ACTION:-install}"
|
|
15
|
+
TARGET="${HELLOAGENTS_TARGET:-}"
|
|
16
|
+
MODE="${HELLOAGENTS_MODE:-}"
|
|
17
|
+
BRANCH="${HELLOAGENTS_BRANCH:-}"
|
|
18
|
+
PACKAGE="${HELLOAGENTS_PACKAGE:-}"
|
|
19
|
+
|
|
20
|
+
if [ -n "${HELLOAGENTS:-}" ]; then
|
|
21
|
+
SPEC_TARGET="${HELLOAGENTS%%:*}"
|
|
22
|
+
SPEC_MODE=""
|
|
23
|
+
if [ -z "$SPEC_TARGET" ]; then
|
|
24
|
+
echo "HELLOAGENTS must be target[:mode], for example codex:global" >&2
|
|
25
|
+
exit 1
|
|
26
|
+
fi
|
|
27
|
+
if [ "$SPEC_TARGET" != "$HELLOAGENTS" ]; then
|
|
28
|
+
SPEC_MODE="${HELLOAGENTS#*:}"
|
|
29
|
+
fi
|
|
30
|
+
TARGET="${TARGET:-$SPEC_TARGET}"
|
|
31
|
+
MODE="${MODE:-$SPEC_MODE}"
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
TARGET="${TARGET:-all}"
|
|
35
|
+
MODE="${MODE:-standby}"
|
|
36
|
+
TARGET="$(printf '%s' "$TARGET" | tr '[:upper:]' '[:lower:]')"
|
|
37
|
+
MODE="$(printf '%s' "$MODE" | tr '[:upper:]' '[:lower:]')"
|
|
38
|
+
|
|
39
|
+
case "$TARGET" in
|
|
40
|
+
all|claude|gemini|codex) ;;
|
|
41
|
+
*) echo "Unsupported HELLOAGENTS target: $TARGET" >&2; exit 1 ;;
|
|
42
|
+
esac
|
|
43
|
+
|
|
44
|
+
case "$MODE" in
|
|
45
|
+
standby|global) ;;
|
|
46
|
+
*) echo "Unsupported HELLOAGENTS mode: $MODE" >&2; exit 1 ;;
|
|
47
|
+
esac
|
|
48
|
+
|
|
49
|
+
if [ -z "$PACKAGE" ]; then
|
|
50
|
+
if [ -n "$BRANCH" ]; then
|
|
51
|
+
PACKAGE="github:hellowind777/helloagents#$BRANCH"
|
|
52
|
+
else
|
|
53
|
+
PACKAGE="helloagents"
|
|
54
|
+
fi
|
|
55
|
+
fi
|
|
56
|
+
|
|
57
|
+
sync_hosts() {
|
|
58
|
+
if [ "$TARGET" = "all" ]; then
|
|
59
|
+
npm explore -g helloagents -- npm run sync-hosts -- --all "--$MODE"
|
|
60
|
+
else
|
|
61
|
+
npm explore -g helloagents -- npm run sync-hosts -- "$TARGET" "--$MODE"
|
|
62
|
+
fi
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
cleanup_hosts() {
|
|
66
|
+
if [ "$TARGET" = "all" ]; then
|
|
67
|
+
npm explore -g helloagents -- npm run cleanup-hosts -- --all "--$MODE"
|
|
68
|
+
else
|
|
69
|
+
npm explore -g helloagents -- npm run cleanup-hosts -- "$TARGET" "--$MODE"
|
|
70
|
+
fi
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
uninstall_hosts() {
|
|
74
|
+
if [ "$TARGET" = "all" ]; then
|
|
75
|
+
npm explore -g helloagents -- npm run uninstall -- --all "--$MODE"
|
|
76
|
+
else
|
|
77
|
+
npm explore -g helloagents -- npm run uninstall -- "$TARGET" "--$MODE"
|
|
78
|
+
fi
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
enable_postinstall_deploy() {
|
|
82
|
+
export HELLOAGENTS_DEPLOY=1
|
|
83
|
+
export HELLOAGENTS_TARGET="$TARGET"
|
|
84
|
+
export HELLOAGENTS_MODE="$MODE"
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
case "$ACTION" in
|
|
88
|
+
install)
|
|
89
|
+
enable_postinstall_deploy
|
|
90
|
+
npm install -g "$PACKAGE"
|
|
91
|
+
;;
|
|
92
|
+
update)
|
|
93
|
+
if [ -n "$BRANCH" ] || [ -n "${HELLOAGENTS_PACKAGE:-}" ]; then
|
|
94
|
+
npm install -g "$PACKAGE"
|
|
95
|
+
else
|
|
96
|
+
npm update -g helloagents || npm install -g helloagents
|
|
97
|
+
fi
|
|
98
|
+
sync_hosts
|
|
99
|
+
;;
|
|
100
|
+
switch-branch|branch)
|
|
101
|
+
if [ -z "$BRANCH" ] && [ -z "${HELLOAGENTS_PACKAGE:-}" ]; then
|
|
102
|
+
echo "HELLOAGENTS_BRANCH or HELLOAGENTS_PACKAGE is required for switch-branch" >&2
|
|
103
|
+
exit 1
|
|
104
|
+
fi
|
|
105
|
+
npm install -g "$PACKAGE"
|
|
106
|
+
sync_hosts
|
|
107
|
+
;;
|
|
108
|
+
uninstall)
|
|
109
|
+
if ! uninstall_hosts; then
|
|
110
|
+
echo "Warning: failed to cleanup HelloAGENTS host integrations before uninstall" >&2
|
|
111
|
+
fi
|
|
112
|
+
npm uninstall -g helloagents
|
|
113
|
+
;;
|
|
114
|
+
*)
|
|
115
|
+
echo "Unsupported HELLOAGENTS_ACTION: $ACTION" >&2
|
|
116
|
+
exit 1
|
|
117
|
+
;;
|
|
118
|
+
esac
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "helloagents",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.15-beta.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "HelloAGENTS — The orchestration kernel that makes any AI CLI smarter. Adds intelligent routing, quality verification (Ralph Loop), safety guards, and notifications.",
|
|
6
6
|
"author": "HelloWind",
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
},
|
|
13
13
|
"bin": {
|
|
14
14
|
"helloagents": "cli.mjs",
|
|
15
|
-
"helloagents-js": "cli.mjs"
|
|
15
|
+
"helloagents-js": "cli.mjs",
|
|
16
|
+
"helloagents-turn-state": "scripts/turn-state-cli.mjs"
|
|
16
17
|
},
|
|
17
18
|
"scripts": {
|
|
18
19
|
"test": "node --test",
|
|
@@ -20,7 +21,13 @@
|
|
|
20
21
|
"preuninstall": "node cli.mjs preuninstall",
|
|
21
22
|
"uninstall": "node cli.mjs preuninstall",
|
|
22
23
|
"postuninstall": "node cli.mjs preuninstall",
|
|
23
|
-
"prepublishOnly": "node cli.mjs sync-version"
|
|
24
|
+
"prepublishOnly": "node cli.mjs sync-version",
|
|
25
|
+
"deploy": "node cli.mjs install",
|
|
26
|
+
"deploy:standby": "node cli.mjs install --all --standby",
|
|
27
|
+
"deploy:global": "node cli.mjs install --all --global",
|
|
28
|
+
"sync-hosts": "node cli.mjs update",
|
|
29
|
+
"cleanup-hosts": "node cli.mjs cleanup",
|
|
30
|
+
"switch-branch": "node cli.mjs switch-branch"
|
|
24
31
|
},
|
|
25
32
|
"files": [
|
|
26
33
|
"cli.mjs",
|
|
@@ -32,11 +39,23 @@
|
|
|
32
39
|
"bootstrap.md",
|
|
33
40
|
"bootstrap-lite.md",
|
|
34
41
|
"README_CN.md",
|
|
42
|
+
"install.sh",
|
|
43
|
+
"install.ps1",
|
|
35
44
|
"gemini-extension.json",
|
|
36
45
|
".claude-plugin/",
|
|
37
46
|
".codex-plugin/"
|
|
38
47
|
],
|
|
39
|
-
"keywords": [
|
|
48
|
+
"keywords": [
|
|
49
|
+
"ai",
|
|
50
|
+
"agent",
|
|
51
|
+
"claude",
|
|
52
|
+
"codex",
|
|
53
|
+
"cli",
|
|
54
|
+
"orchestration",
|
|
55
|
+
"subagent",
|
|
56
|
+
"hooks",
|
|
57
|
+
"skills"
|
|
58
|
+
],
|
|
40
59
|
"engines": {
|
|
41
60
|
"node": ">=18"
|
|
42
61
|
}
|