@made-by-moonlight/athene-cli 0.9.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/LICENSE +22 -0
- package/dist/assets/plugin-registry.json +67 -0
- package/dist/assets/scripts/athene-doctor.ps1 +352 -0
- package/dist/assets/scripts/athene-doctor.sh +552 -0
- package/dist/assets/scripts/athene-update.ps1 +224 -0
- package/dist/assets/scripts/athene-update.sh +252 -0
- package/dist/commands/completion.d.ts +3 -0
- package/dist/commands/completion.d.ts.map +1 -0
- package/dist/commands/completion.js +26 -0
- package/dist/commands/completion.js.map +1 -0
- package/dist/commands/config.d.ts +11 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +89 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/dashboard.d.ts +3 -0
- package/dist/commands/dashboard.d.ts.map +1 -0
- package/dist/commands/dashboard.js +103 -0
- package/dist/commands/dashboard.js.map +1 -0
- package/dist/commands/doctor.d.ts +3 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +329 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/events.d.ts +3 -0
- package/dist/commands/events.d.ts.map +1 -0
- package/dist/commands/events.js +172 -0
- package/dist/commands/events.js.map +1 -0
- package/dist/commands/migrate-storage.d.ts +3 -0
- package/dist/commands/migrate-storage.d.ts.map +1 -0
- package/dist/commands/migrate-storage.js +78 -0
- package/dist/commands/migrate-storage.js.map +1 -0
- package/dist/commands/notify.d.ts +3 -0
- package/dist/commands/notify.d.ts.map +1 -0
- package/dist/commands/notify.js +143 -0
- package/dist/commands/notify.js.map +1 -0
- package/dist/commands/open.d.ts +3 -0
- package/dist/commands/open.d.ts.map +1 -0
- package/dist/commands/open.js +167 -0
- package/dist/commands/open.js.map +1 -0
- package/dist/commands/plugin.d.ts +3 -0
- package/dist/commands/plugin.d.ts.map +1 -0
- package/dist/commands/plugin.js +462 -0
- package/dist/commands/plugin.js.map +1 -0
- package/dist/commands/project.d.ts +3 -0
- package/dist/commands/project.d.ts.map +1 -0
- package/dist/commands/project.js +143 -0
- package/dist/commands/project.js.map +1 -0
- package/dist/commands/report.d.ts +19 -0
- package/dist/commands/report.d.ts.map +1 -0
- package/dist/commands/report.js +114 -0
- package/dist/commands/report.js.map +1 -0
- package/dist/commands/review-check.d.ts +3 -0
- package/dist/commands/review-check.d.ts.map +1 -0
- package/dist/commands/review-check.js +122 -0
- package/dist/commands/review-check.js.map +1 -0
- package/dist/commands/review.d.ts +3 -0
- package/dist/commands/review.d.ts.map +1 -0
- package/dist/commands/review.js +215 -0
- package/dist/commands/review.js.map +1 -0
- package/dist/commands/send.d.ts +3 -0
- package/dist/commands/send.d.ts.map +1 -0
- package/dist/commands/send.js +187 -0
- package/dist/commands/send.js.map +1 -0
- package/dist/commands/session.d.ts +3 -0
- package/dist/commands/session.d.ts.map +1 -0
- package/dist/commands/session.js +439 -0
- package/dist/commands/session.js.map +1 -0
- package/dist/commands/setup.d.ts +5 -0
- package/dist/commands/setup.d.ts.map +1 -0
- package/dist/commands/setup.js +297 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/commands/spawn.d.ts +4 -0
- package/dist/commands/spawn.d.ts.map +1 -0
- package/dist/commands/spawn.js +436 -0
- package/dist/commands/spawn.js.map +1 -0
- package/dist/commands/start.d.ts +21 -0
- package/dist/commands/start.d.ts.map +1 -0
- package/dist/commands/start.js +1836 -0
- package/dist/commands/start.js.map +1 -0
- package/dist/commands/status.d.ts +3 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +556 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/update.d.ts +15 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +652 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/commands/verify.d.ts +3 -0
- package/dist/commands/verify.d.ts.map +1 -0
- package/dist/commands/verify.js +131 -0
- package/dist/commands/verify.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/bun-tmp-janitor.d.ts +18 -0
- package/dist/lib/bun-tmp-janitor.d.ts.map +1 -0
- package/dist/lib/bun-tmp-janitor.js +127 -0
- package/dist/lib/bun-tmp-janitor.js.map +1 -0
- package/dist/lib/caller-context.d.ts +13 -0
- package/dist/lib/caller-context.d.ts.map +1 -0
- package/dist/lib/caller-context.js +20 -0
- package/dist/lib/caller-context.js.map +1 -0
- package/dist/lib/cli-errors.d.ts +8 -0
- package/dist/lib/cli-errors.d.ts.map +1 -0
- package/dist/lib/cli-errors.js +20 -0
- package/dist/lib/cli-errors.js.map +1 -0
- package/dist/lib/completion.d.ts +13 -0
- package/dist/lib/completion.d.ts.map +1 -0
- package/dist/lib/completion.js +428 -0
- package/dist/lib/completion.js.map +1 -0
- package/dist/lib/composio-setup.d.ts +65 -0
- package/dist/lib/composio-setup.d.ts.map +1 -0
- package/dist/lib/composio-setup.js +3255 -0
- package/dist/lib/composio-setup.js.map +1 -0
- package/dist/lib/config-instruction.d.ts +2 -0
- package/dist/lib/config-instruction.d.ts.map +1 -0
- package/dist/lib/config-instruction.js +193 -0
- package/dist/lib/config-instruction.js.map +1 -0
- package/dist/lib/constants.d.ts +3 -0
- package/dist/lib/constants.d.ts.map +1 -0
- package/dist/lib/constants.js +3 -0
- package/dist/lib/constants.js.map +1 -0
- package/dist/lib/create-session-manager.d.ts +26 -0
- package/dist/lib/create-session-manager.d.ts.map +1 -0
- package/dist/lib/create-session-manager.js +55 -0
- package/dist/lib/create-session-manager.js.map +1 -0
- package/dist/lib/credential-resolver.d.ts +37 -0
- package/dist/lib/credential-resolver.d.ts.map +1 -0
- package/dist/lib/credential-resolver.js +105 -0
- package/dist/lib/credential-resolver.js.map +1 -0
- package/dist/lib/daemon.d.ts +69 -0
- package/dist/lib/daemon.d.ts.map +1 -0
- package/dist/lib/daemon.js +77 -0
- package/dist/lib/daemon.js.map +1 -0
- package/dist/lib/dashboard-rebuild.d.ts +53 -0
- package/dist/lib/dashboard-rebuild.d.ts.map +1 -0
- package/dist/lib/dashboard-rebuild.js +188 -0
- package/dist/lib/dashboard-rebuild.js.map +1 -0
- package/dist/lib/dashboard-setup.d.ts +14 -0
- package/dist/lib/dashboard-setup.d.ts.map +1 -0
- package/dist/lib/dashboard-setup.js +192 -0
- package/dist/lib/dashboard-setup.js.map +1 -0
- package/dist/lib/dashboard-url.d.ts +19 -0
- package/dist/lib/dashboard-url.d.ts.map +1 -0
- package/dist/lib/dashboard-url.js +25 -0
- package/dist/lib/dashboard-url.js.map +1 -0
- package/dist/lib/desktop-setup.d.ts +21 -0
- package/dist/lib/desktop-setup.d.ts.map +1 -0
- package/dist/lib/desktop-setup.js +556 -0
- package/dist/lib/desktop-setup.js.map +1 -0
- package/dist/lib/detect-agent.d.ts +24 -0
- package/dist/lib/detect-agent.d.ts.map +1 -0
- package/dist/lib/detect-agent.js +69 -0
- package/dist/lib/detect-agent.js.map +1 -0
- package/dist/lib/detect-env.d.ts +14 -0
- package/dist/lib/detect-env.d.ts.map +1 -0
- package/dist/lib/detect-env.js +46 -0
- package/dist/lib/detect-env.js.map +1 -0
- package/dist/lib/discord-setup.d.ts +20 -0
- package/dist/lib/discord-setup.d.ts.map +1 -0
- package/dist/lib/discord-setup.js +584 -0
- package/dist/lib/discord-setup.js.map +1 -0
- package/dist/lib/format.d.ts +11 -0
- package/dist/lib/format.d.ts.map +1 -0
- package/dist/lib/format.js +116 -0
- package/dist/lib/format.js.map +1 -0
- package/dist/lib/git-utils.d.ts +14 -0
- package/dist/lib/git-utils.d.ts.map +1 -0
- package/dist/lib/git-utils.js +45 -0
- package/dist/lib/git-utils.js.map +1 -0
- package/dist/lib/install-helpers.d.ts +24 -0
- package/dist/lib/install-helpers.d.ts.map +1 -0
- package/dist/lib/install-helpers.js +76 -0
- package/dist/lib/install-helpers.js.map +1 -0
- package/dist/lib/lifecycle-service.d.ts +11 -0
- package/dist/lib/lifecycle-service.d.ts.map +1 -0
- package/dist/lib/lifecycle-service.js +65 -0
- package/dist/lib/lifecycle-service.js.map +1 -0
- package/dist/lib/notifier-routing.d.ts +35 -0
- package/dist/lib/notifier-routing.d.ts.map +1 -0
- package/dist/lib/notifier-routing.js +133 -0
- package/dist/lib/notifier-routing.js.map +1 -0
- package/dist/lib/notify-test.d.ts +72 -0
- package/dist/lib/notify-test.d.ts.map +1 -0
- package/dist/lib/notify-test.js +674 -0
- package/dist/lib/notify-test.js.map +1 -0
- package/dist/lib/openclaw-probe.d.ts +38 -0
- package/dist/lib/openclaw-probe.d.ts.map +1 -0
- package/dist/lib/openclaw-probe.js +146 -0
- package/dist/lib/openclaw-probe.js.map +1 -0
- package/dist/lib/openclaw-setup.d.ts +19 -0
- package/dist/lib/openclaw-setup.d.ts.map +1 -0
- package/dist/lib/openclaw-setup.js +684 -0
- package/dist/lib/openclaw-setup.js.map +1 -0
- package/dist/lib/path-equality.d.ts +29 -0
- package/dist/lib/path-equality.d.ts.map +1 -0
- package/dist/lib/path-equality.js +52 -0
- package/dist/lib/path-equality.js.map +1 -0
- package/dist/lib/plugin-marketplace.d.ts +24 -0
- package/dist/lib/plugin-marketplace.d.ts.map +1 -0
- package/dist/lib/plugin-marketplace.js +175 -0
- package/dist/lib/plugin-marketplace.js.map +1 -0
- package/dist/lib/plugin-scaffold.d.ts +14 -0
- package/dist/lib/plugin-scaffold.d.ts.map +1 -0
- package/dist/lib/plugin-scaffold.js +174 -0
- package/dist/lib/plugin-scaffold.js.map +1 -0
- package/dist/lib/plugin-store.d.ts +9 -0
- package/dist/lib/plugin-store.d.ts.map +1 -0
- package/dist/lib/plugin-store.js +121 -0
- package/dist/lib/plugin-store.js.map +1 -0
- package/dist/lib/plugins.d.ts +17 -0
- package/dist/lib/plugins.d.ts.map +1 -0
- package/dist/lib/plugins.js +65 -0
- package/dist/lib/plugins.js.map +1 -0
- package/dist/lib/portfolio-display.d.ts +10 -0
- package/dist/lib/portfolio-display.d.ts.map +1 -0
- package/dist/lib/portfolio-display.js +17 -0
- package/dist/lib/portfolio-display.js.map +1 -0
- package/dist/lib/preflight.d.ts +27 -0
- package/dist/lib/preflight.d.ts.map +1 -0
- package/dist/lib/preflight.js +77 -0
- package/dist/lib/preflight.js.map +1 -0
- package/dist/lib/prevent-sleep.d.ts +34 -0
- package/dist/lib/prevent-sleep.d.ts.map +1 -0
- package/dist/lib/prevent-sleep.js +65 -0
- package/dist/lib/prevent-sleep.js.map +1 -0
- package/dist/lib/project-detection.d.ts +11 -0
- package/dist/lib/project-detection.d.ts.map +1 -0
- package/dist/lib/project-detection.js +206 -0
- package/dist/lib/project-detection.js.map +1 -0
- package/dist/lib/project-resolution.d.ts +10 -0
- package/dist/lib/project-resolution.d.ts.map +1 -0
- package/dist/lib/project-resolution.js +17 -0
- package/dist/lib/project-resolution.js.map +1 -0
- package/dist/lib/project-supervisor.d.ts +28 -0
- package/dist/lib/project-supervisor.d.ts.map +1 -0
- package/dist/lib/project-supervisor.js +167 -0
- package/dist/lib/project-supervisor.js.map +1 -0
- package/dist/lib/prompts.d.ts +7 -0
- package/dist/lib/prompts.d.ts.map +1 -0
- package/dist/lib/prompts.js +37 -0
- package/dist/lib/prompts.js.map +1 -0
- package/dist/lib/repo-utils.d.ts +16 -0
- package/dist/lib/repo-utils.d.ts.map +1 -0
- package/dist/lib/repo-utils.js +26 -0
- package/dist/lib/repo-utils.js.map +1 -0
- package/dist/lib/resolve-project.d.ts +113 -0
- package/dist/lib/resolve-project.d.ts.map +1 -0
- package/dist/lib/resolve-project.js +433 -0
- package/dist/lib/resolve-project.js.map +1 -0
- package/dist/lib/routes.d.ts +2 -0
- package/dist/lib/routes.d.ts.map +1 -0
- package/dist/lib/routes.js +5 -0
- package/dist/lib/routes.js.map +1 -0
- package/dist/lib/running-state.d.ts +76 -0
- package/dist/lib/running-state.d.ts.map +1 -0
- package/dist/lib/running-state.js +338 -0
- package/dist/lib/running-state.js.map +1 -0
- package/dist/lib/script-runner.d.ts +10 -0
- package/dist/lib/script-runner.d.ts.map +1 -0
- package/dist/lib/script-runner.js +189 -0
- package/dist/lib/script-runner.js.map +1 -0
- package/dist/lib/session-utils.d.ts +14 -0
- package/dist/lib/session-utils.d.ts.map +1 -0
- package/dist/lib/session-utils.js +58 -0
- package/dist/lib/session-utils.js.map +1 -0
- package/dist/lib/shell.d.ts +17 -0
- package/dist/lib/shell.d.ts.map +1 -0
- package/dist/lib/shell.js +90 -0
- package/dist/lib/shell.js.map +1 -0
- package/dist/lib/shutdown.d.ts +30 -0
- package/dist/lib/shutdown.d.ts.map +1 -0
- package/dist/lib/shutdown.js +177 -0
- package/dist/lib/shutdown.js.map +1 -0
- package/dist/lib/slack-setup.d.ts +17 -0
- package/dist/lib/slack-setup.d.ts.map +1 -0
- package/dist/lib/slack-setup.js +485 -0
- package/dist/lib/slack-setup.js.map +1 -0
- package/dist/lib/startup-preflight.d.ts +36 -0
- package/dist/lib/startup-preflight.d.ts.map +1 -0
- package/dist/lib/startup-preflight.js +273 -0
- package/dist/lib/startup-preflight.js.map +1 -0
- package/dist/lib/update-channel-onboarding.d.ts +52 -0
- package/dist/lib/update-channel-onboarding.d.ts.map +1 -0
- package/dist/lib/update-channel-onboarding.js +107 -0
- package/dist/lib/update-channel-onboarding.js.map +1 -0
- package/dist/lib/update-check.d.ts +161 -0
- package/dist/lib/update-check.d.ts.map +1 -0
- package/dist/lib/update-check.js +504 -0
- package/dist/lib/update-check.js.map +1 -0
- package/dist/lib/web-dir.d.ts +47 -0
- package/dist/lib/web-dir.d.ts.map +1 -0
- package/dist/lib/web-dir.js +179 -0
- package/dist/lib/web-dir.js.map +1 -0
- package/dist/lib/webhook-setup.d.ts +16 -0
- package/dist/lib/webhook-setup.d.ts.map +1 -0
- package/dist/lib/webhook-setup.js +383 -0
- package/dist/lib/webhook-setup.js.map +1 -0
- package/dist/options/version.d.ts +2 -0
- package/dist/options/version.d.ts.map +1 -0
- package/dist/options/version.js +7 -0
- package/dist/options/version.js.map +1 -0
- package/dist/program.d.ts +3 -0
- package/dist/program.d.ts.map +1 -0
- package/dist/program.js +63 -0
- package/dist/program.js.map +1 -0
- package/package.json +80 -0
- package/templates/rules/base.md +4 -0
- package/templates/rules/go.md +8 -0
- package/templates/rules/javascript.md +4 -0
- package/templates/rules/nextjs.md +7 -0
- package/templates/rules/pnpm-workspaces.md +4 -0
- package/templates/rules/python.md +8 -0
- package/templates/rules/react.md +8 -0
- package/templates/rules/typescript.md +6 -0
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
# PowerShell port of athene-update.sh — Windows-native source-checkout updater for AO.
|
|
2
|
+
# Invoked by `athene update` on Windows via runRepoScript() when install method is 'git'.
|
|
3
|
+
|
|
4
|
+
$ErrorActionPreference = 'Stop'
|
|
5
|
+
|
|
6
|
+
# Manual arg parsing — matches athene-update.sh's `--skip-smoke` / `--smoke-only` /
|
|
7
|
+
# `-h` / `--help` flags rather than PowerShell's `-SkipSmoke` convention, so the
|
|
8
|
+
# calling contract is identical on Linux/macOS/Windows.
|
|
9
|
+
$SkipSmoke = $false
|
|
10
|
+
$SmokeOnly = $false
|
|
11
|
+
$Help = $false
|
|
12
|
+
foreach ($a in $args) {
|
|
13
|
+
switch ($a) {
|
|
14
|
+
'--skip-smoke' { $SkipSmoke = $true }
|
|
15
|
+
'--smoke-only' { $SmokeOnly = $true }
|
|
16
|
+
'-h' { $Help = $true }
|
|
17
|
+
'--help' { $Help = $true }
|
|
18
|
+
default {
|
|
19
|
+
Write-Error "Unknown option: $a"
|
|
20
|
+
exit 1
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if ($Help) {
|
|
26
|
+
@'
|
|
27
|
+
Usage: athene update [--skip-smoke] [--smoke-only]
|
|
28
|
+
|
|
29
|
+
Fast-forwards the local Athene install repo to main, installs deps,
|
|
30
|
+
clean-rebuilds all workspace packages, refreshes the ao launcher, and runs smoke tests.
|
|
31
|
+
|
|
32
|
+
Options:
|
|
33
|
+
--skip-smoke Skip smoke tests after rebuild
|
|
34
|
+
--smoke-only Run smoke tests without fetching or rebuilding
|
|
35
|
+
'@ | Write-Host
|
|
36
|
+
exit 0
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if ($SkipSmoke -and $SmokeOnly) {
|
|
40
|
+
Write-Error "Conflicting options: use either --skip-smoke or --smoke-only, not both."
|
|
41
|
+
exit 1
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
$TargetBranch = if ($env:AO_UPDATE_BRANCH) { $env:AO_UPDATE_BRANCH } else { 'main' }
|
|
45
|
+
|
|
46
|
+
function Test-AoRepoRoot([string]$path) {
|
|
47
|
+
return (Test-Path (Join-Path $path 'packages/athene/bin/athene.js')) -and
|
|
48
|
+
(Test-Path (Join-Path $path 'packages/cli'))
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function Find-RepoRootFrom([string]$start) {
|
|
52
|
+
$dir = (Resolve-Path $start).Path
|
|
53
|
+
while ($dir) {
|
|
54
|
+
if (Test-AoRepoRoot $dir) { return $dir }
|
|
55
|
+
$parent = Split-Path -Parent $dir
|
|
56
|
+
if (-not $parent -or $parent -eq $dir) { break }
|
|
57
|
+
$dir = $parent
|
|
58
|
+
}
|
|
59
|
+
return $null
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function Resolve-RepoRoot {
|
|
63
|
+
if ($env:AO_REPO_ROOT) { return $env:AO_REPO_ROOT }
|
|
64
|
+
$fromScript = Find-RepoRootFrom $PSScriptRoot
|
|
65
|
+
if ($fromScript) { return $fromScript }
|
|
66
|
+
$fromCwd = Find-RepoRootFrom (Get-Location).Path
|
|
67
|
+
if ($fromCwd) { return $fromCwd }
|
|
68
|
+
Write-Error "Unable to find Athene repo root. Fix: run via athene update or set AO_REPO_ROOT."
|
|
69
|
+
exit 1
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
$RepoRoot = Resolve-RepoRoot
|
|
73
|
+
|
|
74
|
+
function Require-Command([string]$name, [string]$fixHint) {
|
|
75
|
+
if (-not (Get-Command $name -ErrorAction SilentlyContinue)) {
|
|
76
|
+
Write-Error "Missing required command: $name. Fix: $fixHint"
|
|
77
|
+
exit 1
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function Run-Cmd {
|
|
82
|
+
Write-Host "-> $($args -join ' ')"
|
|
83
|
+
& $args[0] @($args | Select-Object -Skip 1)
|
|
84
|
+
if ($LASTEXITCODE -ne 0) {
|
|
85
|
+
throw "Command failed: $($args -join ' ') (exit $LASTEXITCODE)"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function Has-Remote([string]$name) {
|
|
90
|
+
& git remote get-url $name *> $null
|
|
91
|
+
return ($LASTEXITCODE -eq 0)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function Get-RemoteUrl([string]$name) {
|
|
95
|
+
$url = & git remote get-url $name 2>$null
|
|
96
|
+
if ($LASTEXITCODE -ne 0) { return '' }
|
|
97
|
+
return $url
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function Get-GithubRepoSlug([string]$remoteName) {
|
|
101
|
+
$url = Get-RemoteUrl $remoteName
|
|
102
|
+
if (-not $url) { return $null }
|
|
103
|
+
$patterns = @(
|
|
104
|
+
'^https://github\.com/(.+?)(?:\.git)?$',
|
|
105
|
+
'^http://github\.com/(.+?)(?:\.git)?$',
|
|
106
|
+
'^ssh://git@github\.com/(.+?)(?:\.git)?$',
|
|
107
|
+
'^git@github\.com:(.+?)(?:\.git)?$'
|
|
108
|
+
)
|
|
109
|
+
foreach ($p in $patterns) {
|
|
110
|
+
$m = [regex]::Match($url, $p)
|
|
111
|
+
if ($m.Success) { return $m.Groups[1].Value }
|
|
112
|
+
}
|
|
113
|
+
return $null
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function Resolve-UpdateRemote {
|
|
117
|
+
if (Has-Remote 'upstream') { return 'upstream' }
|
|
118
|
+
return 'origin'
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function Sync-OriginWithUpstream {
|
|
122
|
+
if (-not (Has-Remote 'origin') -or -not (Has-Remote 'upstream')) { return }
|
|
123
|
+
if (-not (Get-Command 'gh' -ErrorAction SilentlyContinue)) {
|
|
124
|
+
Write-Host "Skipping fork sync: gh is not installed. Local update will use upstream/$TargetBranch directly."
|
|
125
|
+
return
|
|
126
|
+
}
|
|
127
|
+
$originRepo = Get-GithubRepoSlug 'origin'
|
|
128
|
+
$upstreamRepo = Get-GithubRepoSlug 'upstream'
|
|
129
|
+
if (-not $originRepo -or -not $upstreamRepo) { return }
|
|
130
|
+
Write-Host ""
|
|
131
|
+
Write-Host "Syncing $originRepo/$TargetBranch with $upstreamRepo/$TargetBranch via gh..."
|
|
132
|
+
try {
|
|
133
|
+
Run-Cmd gh repo sync $originRepo --source $upstreamRepo --branch $TargetBranch
|
|
134
|
+
} catch {
|
|
135
|
+
Write-Warning "Failed to sync $originRepo/$TargetBranch from $upstreamRepo/$TargetBranch via gh. Continuing with upstream/$TargetBranch for the local update."
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function Run-SmokeTests {
|
|
140
|
+
Write-Host ""
|
|
141
|
+
Write-Host "Running smoke tests..."
|
|
142
|
+
$aoBin = Join-Path $RepoRoot 'packages/athene/bin/athene.js'
|
|
143
|
+
Run-Cmd node $aoBin --version
|
|
144
|
+
Run-Cmd node $aoBin doctor --help
|
|
145
|
+
Run-Cmd node $aoBin update --help
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function Ensure-RepoClean([string]$reason) {
|
|
149
|
+
$status = & git status --porcelain
|
|
150
|
+
if ($status) {
|
|
151
|
+
Write-Error $reason
|
|
152
|
+
exit 1
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function Ensure-OnTargetBranch {
|
|
157
|
+
$current = (& git branch --show-current).Trim()
|
|
158
|
+
if ($current -ne $TargetBranch) {
|
|
159
|
+
Write-Error "Current branch is $current, expected $TargetBranch. Fix: git switch $TargetBranch then rerun athene update."
|
|
160
|
+
exit 1
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
Write-Host "Athene Update`n"
|
|
165
|
+
|
|
166
|
+
Require-Command 'node' 'install Node.js 20+'
|
|
167
|
+
|
|
168
|
+
Set-Location $RepoRoot
|
|
169
|
+
|
|
170
|
+
$UpdateRemote = Resolve-UpdateRemote
|
|
171
|
+
|
|
172
|
+
if (-not $SmokeOnly) {
|
|
173
|
+
Require-Command 'git' 'install git 2.25+'
|
|
174
|
+
Require-Command 'pnpm' 'enable corepack or run npm install -g pnpm'
|
|
175
|
+
Require-Command 'npm' 'install npm with Node.js'
|
|
176
|
+
|
|
177
|
+
& git rev-parse --is-inside-work-tree *> $null
|
|
178
|
+
if ($LASTEXITCODE -ne 0) {
|
|
179
|
+
Write-Error "The update command must run inside the Athene git checkout."
|
|
180
|
+
exit 1
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
Ensure-RepoClean 'Working tree is dirty. Fix: commit or stash local changes before running athene update.'
|
|
184
|
+
Ensure-OnTargetBranch
|
|
185
|
+
|
|
186
|
+
Sync-OriginWithUpstream
|
|
187
|
+
|
|
188
|
+
Run-Cmd git fetch $UpdateRemote $TargetBranch
|
|
189
|
+
|
|
190
|
+
$localSha = (& git rev-parse HEAD).Trim()
|
|
191
|
+
$remoteSha = (& git rev-parse "$UpdateRemote/$TargetBranch").Trim()
|
|
192
|
+
|
|
193
|
+
if ($localSha -eq $remoteSha) {
|
|
194
|
+
Write-Host ""
|
|
195
|
+
Write-Host "Already on latest version."
|
|
196
|
+
} else {
|
|
197
|
+
Run-Cmd git pull --ff-only $UpdateRemote $TargetBranch
|
|
198
|
+
Run-Cmd pnpm install
|
|
199
|
+
|
|
200
|
+
Run-Cmd pnpm -r --if-present clean
|
|
201
|
+
Run-Cmd pnpm build
|
|
202
|
+
|
|
203
|
+
Write-Host ""
|
|
204
|
+
Write-Host "Refreshing ao launcher..."
|
|
205
|
+
Push-Location (Join-Path $RepoRoot 'packages/athene')
|
|
206
|
+
try {
|
|
207
|
+
& npm link --force
|
|
208
|
+
if ($LASTEXITCODE -ne 0) {
|
|
209
|
+
Write-Error "npm link --force failed. On Windows, retry from an elevated terminal: cd $RepoRoot\packages\ao; npm link --force"
|
|
210
|
+
exit 1
|
|
211
|
+
}
|
|
212
|
+
} finally { Pop-Location }
|
|
213
|
+
|
|
214
|
+
Ensure-RepoClean 'Update modified tracked files. Inspect git status, review the changes, and rerun after restoring a clean checkout if needed.'
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
if (-not $SkipSmoke) {
|
|
219
|
+
Run-SmokeTests
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
Write-Host ""
|
|
223
|
+
Write-Host "Update complete."
|
|
224
|
+
exit 0
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
|
|
5
|
+
SKIP_SMOKE=false
|
|
6
|
+
SMOKE_ONLY=false
|
|
7
|
+
TARGET_BRANCH="${AO_UPDATE_BRANCH:-main}"
|
|
8
|
+
|
|
9
|
+
while [ $# -gt 0 ]; do
|
|
10
|
+
case "$1" in
|
|
11
|
+
--skip-smoke)
|
|
12
|
+
SKIP_SMOKE=true
|
|
13
|
+
;;
|
|
14
|
+
--smoke-only)
|
|
15
|
+
SMOKE_ONLY=true
|
|
16
|
+
;;
|
|
17
|
+
-h|--help)
|
|
18
|
+
cat <<'EOF'
|
|
19
|
+
Usage: athene update [--skip-smoke] [--smoke-only]
|
|
20
|
+
|
|
21
|
+
Fast-forwards the local Athene install repo to main, installs deps,
|
|
22
|
+
clean-rebuilds all workspace packages, refreshes the athene launcher, and runs smoke tests.
|
|
23
|
+
|
|
24
|
+
Options:
|
|
25
|
+
--skip-smoke Skip smoke tests after rebuild
|
|
26
|
+
--smoke-only Run smoke tests without fetching or rebuilding
|
|
27
|
+
EOF
|
|
28
|
+
exit 0
|
|
29
|
+
;;
|
|
30
|
+
*)
|
|
31
|
+
printf 'Unknown option: %s\n' "$1" >&2
|
|
32
|
+
exit 1
|
|
33
|
+
;;
|
|
34
|
+
esac
|
|
35
|
+
shift
|
|
36
|
+
done
|
|
37
|
+
|
|
38
|
+
if [ "$SKIP_SMOKE" = true ] && [ "$SMOKE_ONLY" = true ]; then
|
|
39
|
+
printf 'Conflicting options: use either --skip-smoke or --smoke-only, not both.\n' >&2
|
|
40
|
+
exit 1
|
|
41
|
+
fi
|
|
42
|
+
|
|
43
|
+
is_repo_root() {
|
|
44
|
+
local candidate="$1"
|
|
45
|
+
[ -f "$candidate/packages/athene/bin/athene.js" ] && [ -d "$candidate/packages/cli" ]
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
find_repo_root_from() {
|
|
49
|
+
local dir="$1"
|
|
50
|
+
while [ -n "$dir" ] && [ "$dir" != "/" ]; do
|
|
51
|
+
if is_repo_root "$dir"; then
|
|
52
|
+
printf '%s\n' "$dir"
|
|
53
|
+
return 0
|
|
54
|
+
fi
|
|
55
|
+
dir="$(dirname "$dir")"
|
|
56
|
+
done
|
|
57
|
+
return 1
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
resolve_repo_root() {
|
|
61
|
+
if [ -n "${AO_REPO_ROOT:-}" ]; then
|
|
62
|
+
printf '%s\n' "$AO_REPO_ROOT"
|
|
63
|
+
return 0
|
|
64
|
+
fi
|
|
65
|
+
|
|
66
|
+
local script_dir
|
|
67
|
+
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
68
|
+
find_repo_root_from "$script_dir" || find_repo_root_from "$PWD"
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if ! REPO_ROOT="$(resolve_repo_root)"; then
|
|
72
|
+
printf 'Unable to find Athene repo root. Fix: run via athene update or set AO_REPO_ROOT.\n' >&2
|
|
73
|
+
exit 1
|
|
74
|
+
fi
|
|
75
|
+
|
|
76
|
+
require_command() {
|
|
77
|
+
local name="$1"
|
|
78
|
+
local fix_hint="$2"
|
|
79
|
+
if ! command -v "$name" >/dev/null 2>&1; then
|
|
80
|
+
printf 'Missing required command: %s. Fix: %s\n' "$name" "$fix_hint" >&2
|
|
81
|
+
exit 1
|
|
82
|
+
fi
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
run_cmd() {
|
|
86
|
+
printf -- '-> %s\n' "$*"
|
|
87
|
+
"$@"
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
has_remote() {
|
|
91
|
+
git remote get-url "$1" >/dev/null 2>&1
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
get_remote_url() {
|
|
95
|
+
git remote get-url "$1" 2>/dev/null || true
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
get_github_repo_slug() {
|
|
99
|
+
local remote_name="$1"
|
|
100
|
+
local remote_url
|
|
101
|
+
remote_url="$(get_remote_url "$remote_name")"
|
|
102
|
+
|
|
103
|
+
case "$remote_url" in
|
|
104
|
+
https://github.com/*)
|
|
105
|
+
remote_url="${remote_url#https://github.com/}"
|
|
106
|
+
;;
|
|
107
|
+
http://github.com/*)
|
|
108
|
+
remote_url="${remote_url#http://github.com/}"
|
|
109
|
+
;;
|
|
110
|
+
ssh://git@github.com/*)
|
|
111
|
+
remote_url="${remote_url#ssh://git@github.com/}"
|
|
112
|
+
;;
|
|
113
|
+
git@github.com:*)
|
|
114
|
+
remote_url="${remote_url#git@github.com:}"
|
|
115
|
+
;;
|
|
116
|
+
*)
|
|
117
|
+
return 1
|
|
118
|
+
;;
|
|
119
|
+
esac
|
|
120
|
+
|
|
121
|
+
remote_url="${remote_url%.git}"
|
|
122
|
+
printf '%s\n' "$remote_url"
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
resolve_update_remote() {
|
|
126
|
+
if has_remote upstream; then
|
|
127
|
+
printf 'upstream\n'
|
|
128
|
+
return
|
|
129
|
+
fi
|
|
130
|
+
|
|
131
|
+
printf 'origin\n'
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
maybe_sync_origin_with_upstream() {
|
|
135
|
+
local origin_repo
|
|
136
|
+
local upstream_repo
|
|
137
|
+
|
|
138
|
+
if ! has_remote origin || ! has_remote upstream; then
|
|
139
|
+
return
|
|
140
|
+
fi
|
|
141
|
+
|
|
142
|
+
if ! command -v gh >/dev/null 2>&1; then
|
|
143
|
+
printf 'Skipping fork sync: gh is not installed. Local update will use upstream/%s directly.\n' \
|
|
144
|
+
"$TARGET_BRANCH"
|
|
145
|
+
return
|
|
146
|
+
fi
|
|
147
|
+
|
|
148
|
+
origin_repo="$(get_github_repo_slug origin)" || return
|
|
149
|
+
upstream_repo="$(get_github_repo_slug upstream)" || return
|
|
150
|
+
|
|
151
|
+
printf '\nSyncing %s/%s with %s/%s via gh...\n' \
|
|
152
|
+
"$origin_repo" "$TARGET_BRANCH" "$upstream_repo" "$TARGET_BRANCH"
|
|
153
|
+
|
|
154
|
+
if ! run_cmd gh repo sync "$origin_repo" --source "$upstream_repo" --branch "$TARGET_BRANCH"; then
|
|
155
|
+
printf 'WARNING: Failed to sync %s/%s from %s/%s via gh. Continuing with upstream/%s for the local update.\n' \
|
|
156
|
+
"$origin_repo" "$TARGET_BRANCH" "$upstream_repo" "$TARGET_BRANCH" "$TARGET_BRANCH" >&2
|
|
157
|
+
fi
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
run_smoke_tests() {
|
|
161
|
+
printf '\nRunning smoke tests...\n'
|
|
162
|
+
run_cmd node "$REPO_ROOT/packages/athene/bin/athene.js" --version
|
|
163
|
+
run_cmd node "$REPO_ROOT/packages/athene/bin/athene.js" doctor --help
|
|
164
|
+
run_cmd node "$REPO_ROOT/packages/athene/bin/athene.js" update --help
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
ensure_repo_clean() {
|
|
168
|
+
local reason="$1"
|
|
169
|
+
local status_output
|
|
170
|
+
status_output="$(git status --porcelain)"
|
|
171
|
+
if [ -n "$status_output" ]; then
|
|
172
|
+
printf '%s\n' "$reason" >&2
|
|
173
|
+
exit 1
|
|
174
|
+
fi
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
ensure_on_target_branch() {
|
|
178
|
+
local current_branch
|
|
179
|
+
current_branch="$(git branch --show-current)"
|
|
180
|
+
if [ "$current_branch" != "$TARGET_BRANCH" ]; then
|
|
181
|
+
printf 'Current branch is %s, expected %s. Fix: git switch %s && rerun athene update.\n' \
|
|
182
|
+
"$current_branch" "$TARGET_BRANCH" "$TARGET_BRANCH" >&2
|
|
183
|
+
exit 1
|
|
184
|
+
fi
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
printf 'Athene Update\n\n'
|
|
188
|
+
|
|
189
|
+
require_command node "install Node.js 20+"
|
|
190
|
+
|
|
191
|
+
cd "$REPO_ROOT"
|
|
192
|
+
|
|
193
|
+
UPDATE_REMOTE="$(resolve_update_remote)"
|
|
194
|
+
|
|
195
|
+
if [ "$SMOKE_ONLY" = false ]; then
|
|
196
|
+
require_command git "install git 2.25+"
|
|
197
|
+
require_command pnpm "enable corepack or run npm install -g pnpm"
|
|
198
|
+
require_command npm "install npm with Node.js"
|
|
199
|
+
|
|
200
|
+
if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
|
201
|
+
printf 'The update command must run inside the Athene git checkout.\n' >&2
|
|
202
|
+
exit 1
|
|
203
|
+
fi
|
|
204
|
+
|
|
205
|
+
ensure_repo_clean "Working tree is dirty. Fix: commit or stash local changes before running athene update."
|
|
206
|
+
ensure_on_target_branch
|
|
207
|
+
|
|
208
|
+
maybe_sync_origin_with_upstream
|
|
209
|
+
|
|
210
|
+
run_cmd git fetch "$UPDATE_REMOTE" "$TARGET_BRANCH"
|
|
211
|
+
|
|
212
|
+
local_sha="$(git rev-parse HEAD)"
|
|
213
|
+
remote_sha="$(git rev-parse "$UPDATE_REMOTE/$TARGET_BRANCH")"
|
|
214
|
+
if [ "$local_sha" = "$remote_sha" ]; then
|
|
215
|
+
printf '\nAlready on latest version.\n'
|
|
216
|
+
else
|
|
217
|
+
run_cmd git pull --ff-only "$UPDATE_REMOTE" "$TARGET_BRANCH"
|
|
218
|
+
run_cmd pnpm install
|
|
219
|
+
|
|
220
|
+
run_cmd pnpm -r --if-present clean
|
|
221
|
+
run_cmd pnpm build
|
|
222
|
+
|
|
223
|
+
printf '\nRefreshing ao launcher...\n'
|
|
224
|
+
(
|
|
225
|
+
cd "$REPO_ROOT/packages/athene"
|
|
226
|
+
npm_link_error="$(mktemp)"
|
|
227
|
+
if npm link --force 2>"$npm_link_error"; then
|
|
228
|
+
rm -f "$npm_link_error"
|
|
229
|
+
elif [ -t 0 ]; then
|
|
230
|
+
rm -f "$npm_link_error"
|
|
231
|
+
printf ' Launcher refresh failed. Retrying with sudo...\n'
|
|
232
|
+
if ! sudo npm link --force; then
|
|
233
|
+
printf 'ERROR: sudo npm link --force failed. Inspect npm output above.\n' >&2
|
|
234
|
+
exit 1
|
|
235
|
+
fi
|
|
236
|
+
else
|
|
237
|
+
cat "$npm_link_error" >&2
|
|
238
|
+
rm -f "$npm_link_error"
|
|
239
|
+
printf 'ERROR: Launcher refresh failed. Run manually: cd %s/packages/athene && sudo npm link --force\n' "$REPO_ROOT"
|
|
240
|
+
exit 1
|
|
241
|
+
fi
|
|
242
|
+
)
|
|
243
|
+
|
|
244
|
+
ensure_repo_clean "Update modified tracked files. Inspect git status, review the changes, and rerun after restoring a clean checkout if needed."
|
|
245
|
+
fi
|
|
246
|
+
fi
|
|
247
|
+
|
|
248
|
+
if [ "$SKIP_SMOKE" = false ]; then
|
|
249
|
+
run_smoke_tests
|
|
250
|
+
fi
|
|
251
|
+
|
|
252
|
+
printf '\nUpdate complete.\n'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completion.d.ts","sourceRoot":"","sources":["../../src/commands/completion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOzC,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA8BzD"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { formatCompletionSuggestions, generateZshCompletion, getCompletionSuggestions, } from "../lib/completion.js";
|
|
2
|
+
export function registerCompletion(program) {
|
|
3
|
+
const completion = program
|
|
4
|
+
.command("completion")
|
|
5
|
+
.description("Generate shell completion scripts");
|
|
6
|
+
completion
|
|
7
|
+
.command("zsh")
|
|
8
|
+
.description("Print the zsh completion script")
|
|
9
|
+
.action(() => {
|
|
10
|
+
process.stdout.write(generateZshCompletion(program));
|
|
11
|
+
});
|
|
12
|
+
program
|
|
13
|
+
.command("__complete", { hidden: true })
|
|
14
|
+
.description("Internal helper for shell completions")
|
|
15
|
+
.argument("<kind>", "Completion data kind")
|
|
16
|
+
.option("--include-terminated", "Include terminated sessions")
|
|
17
|
+
.option("--include-orchestrators", "Include orchestrator sessions")
|
|
18
|
+
.action(async (kind, opts) => {
|
|
19
|
+
const suggestions = await getCompletionSuggestions(kind, opts);
|
|
20
|
+
const output = formatCompletionSuggestions(suggestions);
|
|
21
|
+
if (output.length > 0) {
|
|
22
|
+
process.stdout.write(`${output}\n`);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=completion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completion.js","sourceRoot":"","sources":["../../src/commands/completion.ts"],"names":[],"mappings":"AACA,OAAO,EACL,2BAA2B,EAC3B,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,UAAU,kBAAkB,CAAC,OAAgB;IACjD,MAAM,UAAU,GAAG,OAAO;SACvB,OAAO,CAAC,YAAY,CAAC;SACrB,WAAW,CAAC,mCAAmC,CAAC,CAAC;IAEpD,UAAU;SACP,OAAO,CAAC,KAAK,CAAC;SACd,WAAW,CAAC,iCAAiC,CAAC;SAC9C,MAAM,CAAC,GAAG,EAAE;QACX,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;IAEL,OAAO;SACJ,OAAO,CAAC,YAAY,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;SACvC,WAAW,CAAC,uCAAuC,CAAC;SACpD,QAAQ,CAAC,QAAQ,EAAE,sBAAsB,CAAC;SAC1C,MAAM,CAAC,sBAAsB,EAAE,6BAA6B,CAAC;SAC7D,MAAM,CAAC,yBAAyB,EAAE,+BAA+B,CAAC;SAClE,MAAM,CACL,KAAK,EACH,IAAY,EACZ,IAAqE,EACrE,EAAE;QACF,MAAM,WAAW,GAAG,MAAM,wBAAwB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC/D,MAAM,MAAM,GAAG,2BAA2B,CAAC,WAAW,CAAC,CAAC;QACxD,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACtB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,IAAI,CAAC,CAAC;QACtC,CAAC;IACH,CAAC,CACF,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `athene config` — read/write fields in ~/.agent-orchestrator/config.yaml.
|
|
3
|
+
*
|
|
4
|
+
* Today this only manages `updateChannel` and `installMethod`, which are the
|
|
5
|
+
* two settings the release pipeline depends on. We deliberately resist adding
|
|
6
|
+
* a generic key/value writer — the global config has Zod validation and most
|
|
7
|
+
* fields are not safe to set blindly from a flag.
|
|
8
|
+
*/
|
|
9
|
+
import type { Command } from "commander";
|
|
10
|
+
export declare function registerConfig(program: Command): void;
|
|
11
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAwEzC,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAqCrD"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `athene config` — read/write fields in ~/.agent-orchestrator/config.yaml.
|
|
3
|
+
*
|
|
4
|
+
* Today this only manages `updateChannel` and `installMethod`, which are the
|
|
5
|
+
* two settings the release pipeline depends on. We deliberately resist adding
|
|
6
|
+
* a generic key/value writer — the global config has Zod validation and most
|
|
7
|
+
* fields are not safe to set blindly from a flag.
|
|
8
|
+
*/
|
|
9
|
+
import chalk from "chalk";
|
|
10
|
+
import { createDefaultGlobalConfig, getGlobalConfigPath, loadGlobalConfig, saveGlobalConfig, UpdateChannelSchema, InstallMethodOverrideSchema, } from "@made-by-moonlight/athene-core";
|
|
11
|
+
import { existsSync } from "node:fs";
|
|
12
|
+
const SUPPORTED_KEYS = ["updateChannel", "installMethod"];
|
|
13
|
+
function isSupportedKey(value) {
|
|
14
|
+
return SUPPORTED_KEYS.includes(value);
|
|
15
|
+
}
|
|
16
|
+
function loadOrInit() {
|
|
17
|
+
const path = getGlobalConfigPath();
|
|
18
|
+
if (existsSync(path)) {
|
|
19
|
+
const config = loadGlobalConfig(path);
|
|
20
|
+
if (config)
|
|
21
|
+
return config;
|
|
22
|
+
}
|
|
23
|
+
return createDefaultGlobalConfig();
|
|
24
|
+
}
|
|
25
|
+
function setUpdateChannel(value) {
|
|
26
|
+
const parsed = UpdateChannelSchema.safeParse(value);
|
|
27
|
+
if (!parsed.success) {
|
|
28
|
+
console.error(chalk.red(`Invalid value for updateChannel: "${value}". Expected: stable | nightly | manual`));
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
31
|
+
const channel = parsed.data;
|
|
32
|
+
const config = loadOrInit();
|
|
33
|
+
saveGlobalConfig({ ...config, updateChannel: channel }, getGlobalConfigPath());
|
|
34
|
+
console.log(chalk.green(`✓ updateChannel set to ${chalk.bold(channel)}`));
|
|
35
|
+
}
|
|
36
|
+
function setInstallMethod(value) {
|
|
37
|
+
const parsed = InstallMethodOverrideSchema.safeParse(value);
|
|
38
|
+
if (!parsed.success) {
|
|
39
|
+
console.error(chalk.red(`Invalid value for installMethod: "${value}". Expected: git | npm-global | pnpm-global | bun-global | homebrew | unknown`));
|
|
40
|
+
process.exit(1);
|
|
41
|
+
}
|
|
42
|
+
const method = parsed.data;
|
|
43
|
+
const config = loadOrInit();
|
|
44
|
+
saveGlobalConfig({ ...config, installMethod: method }, getGlobalConfigPath());
|
|
45
|
+
console.log(chalk.green(`✓ installMethod set to ${chalk.bold(method)}`));
|
|
46
|
+
}
|
|
47
|
+
function showGet(key) {
|
|
48
|
+
const path = getGlobalConfigPath();
|
|
49
|
+
if (!existsSync(path)) {
|
|
50
|
+
console.log(chalk.dim("(unset)"));
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const config = loadGlobalConfig(path);
|
|
54
|
+
const value = config?.[key];
|
|
55
|
+
console.log(value === undefined ? chalk.dim("(unset)") : String(value));
|
|
56
|
+
}
|
|
57
|
+
export function registerConfig(program) {
|
|
58
|
+
const config = program
|
|
59
|
+
.command("config")
|
|
60
|
+
.description("Read or write global AO config (~/.agent-orchestrator/config.yaml)");
|
|
61
|
+
config
|
|
62
|
+
.command("set <key> <value>")
|
|
63
|
+
.description(`Set a config value. Keys: ${SUPPORTED_KEYS.join(", ")}`)
|
|
64
|
+
.action((key, value) => {
|
|
65
|
+
if (!isSupportedKey(key)) {
|
|
66
|
+
console.error(chalk.red(`Unsupported config key: "${key}". Supported: ${SUPPORTED_KEYS.join(", ")}`));
|
|
67
|
+
process.exit(1);
|
|
68
|
+
}
|
|
69
|
+
switch (key) {
|
|
70
|
+
case "updateChannel":
|
|
71
|
+
setUpdateChannel(value);
|
|
72
|
+
break;
|
|
73
|
+
case "installMethod":
|
|
74
|
+
setInstallMethod(value);
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
config
|
|
79
|
+
.command("get <key>")
|
|
80
|
+
.description(`Read a config value. Keys: ${SUPPORTED_KEYS.join(", ")}`)
|
|
81
|
+
.action((key) => {
|
|
82
|
+
if (!isSupportedKey(key)) {
|
|
83
|
+
console.error(chalk.red(`Unsupported config key: "${key}". Supported: ${SUPPORTED_KEYS.join(", ")}`));
|
|
84
|
+
process.exit(1);
|
|
85
|
+
}
|
|
86
|
+
showGet(key);
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,yBAAyB,EACzB,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,2BAA2B,GAI5B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,MAAM,cAAc,GAAG,CAAC,eAAe,EAAE,eAAe,CAAU,CAAC;AAGnE,SAAS,cAAc,CAAC,KAAa;IACnC,OAAQ,cAAoC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC/D,CAAC;AAED,SAAS,UAAU;IACjB,MAAM,IAAI,GAAG,mBAAmB,EAAE,CAAC;IACnC,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACrB,MAAM,MAAM,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;QACtC,IAAI,MAAM;YAAE,OAAO,MAAM,CAAC;IAC5B,CAAC;IACD,OAAO,yBAAyB,EAAE,CAAC;AACrC,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAa;I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