@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
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Composio, Inc.
|
|
4
|
+
Copyright (c) 2026 slievr (Athene fork)
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "agent-codex",
|
|
4
|
+
"package": "@made-by-moonlight/athene-plugin-agent-codex",
|
|
5
|
+
"slot": "agent",
|
|
6
|
+
"description": "Agent plugin: OpenAI Codex CLI",
|
|
7
|
+
"source": "registry",
|
|
8
|
+
"latestVersion": "0.2.0"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"id": "agent-aider",
|
|
12
|
+
"package": "@made-by-moonlight/athene-plugin-agent-aider",
|
|
13
|
+
"slot": "agent",
|
|
14
|
+
"description": "Agent plugin: Aider CLI",
|
|
15
|
+
"source": "registry",
|
|
16
|
+
"latestVersion": "0.2.0"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"id": "agent-opencode",
|
|
20
|
+
"package": "@made-by-moonlight/athene-plugin-agent-opencode",
|
|
21
|
+
"slot": "agent",
|
|
22
|
+
"description": "Agent plugin: OpenCode CLI",
|
|
23
|
+
"source": "registry",
|
|
24
|
+
"latestVersion": "0.2.0"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"id": "agent-kimicode",
|
|
28
|
+
"package": "@made-by-moonlight/athene-plugin-agent-kimicode",
|
|
29
|
+
"slot": "agent",
|
|
30
|
+
"description": "Agent plugin: Kimi Code CLI (MoonshotAI)",
|
|
31
|
+
"source": "registry",
|
|
32
|
+
"latestVersion": "0.1.0"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"id": "notifier-openclaw",
|
|
36
|
+
"package": "@made-by-moonlight/athene-plugin-notifier-openclaw",
|
|
37
|
+
"slot": "notifier",
|
|
38
|
+
"description": "Notifier plugin: OpenClaw webhook notifications",
|
|
39
|
+
"source": "registry",
|
|
40
|
+
"setupAction": "openclaw-setup",
|
|
41
|
+
"latestVersion": "0.1.1"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"id": "notifier-discord",
|
|
45
|
+
"package": "@made-by-moonlight/athene-plugin-notifier-discord",
|
|
46
|
+
"slot": "notifier",
|
|
47
|
+
"description": "Notifier plugin: Discord notifications",
|
|
48
|
+
"source": "registry",
|
|
49
|
+
"latestVersion": "0.1.0"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"id": "tracker-gitlab",
|
|
53
|
+
"package": "@made-by-moonlight/athene-plugin-tracker-gitlab",
|
|
54
|
+
"slot": "tracker",
|
|
55
|
+
"description": "Tracker plugin: GitLab issues",
|
|
56
|
+
"source": "registry",
|
|
57
|
+
"latestVersion": "0.1.1"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"id": "scm-gitlab",
|
|
61
|
+
"package": "@made-by-moonlight/athene-plugin-scm-gitlab",
|
|
62
|
+
"slot": "scm",
|
|
63
|
+
"description": "SCM plugin: GitLab pull/merge requests",
|
|
64
|
+
"source": "registry",
|
|
65
|
+
"latestVersion": "0.1.1"
|
|
66
|
+
}
|
|
67
|
+
]
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
# PowerShell port of athene-doctor.sh — Windows-native health checks for AO.
|
|
2
|
+
# Invoked by `athene doctor` on Windows via runRepoScript().
|
|
3
|
+
|
|
4
|
+
$ErrorActionPreference = 'Continue'
|
|
5
|
+
|
|
6
|
+
# Manual arg parsing — matches athene-doctor.sh's `--fix` / `-h` / `--help` flags
|
|
7
|
+
# rather than PowerShell's `-Fix` convention, so the calling contract is
|
|
8
|
+
# identical on Linux/macOS/Windows.
|
|
9
|
+
$Fix = $false
|
|
10
|
+
$Help = $false
|
|
11
|
+
foreach ($a in $args) {
|
|
12
|
+
switch ($a) {
|
|
13
|
+
'--fix' { $Fix = $true }
|
|
14
|
+
'-h' { $Help = $true }
|
|
15
|
+
'--help' { $Help = $true }
|
|
16
|
+
default {
|
|
17
|
+
Write-Error "Unknown option: $a"
|
|
18
|
+
exit 1
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if ($Help) {
|
|
24
|
+
@'
|
|
25
|
+
Usage: athene doctor [--fix]
|
|
26
|
+
|
|
27
|
+
Checks install, PATH, binaries, service health, stale temp files, and runtime sanity.
|
|
28
|
+
|
|
29
|
+
Options:
|
|
30
|
+
--fix Apply safe fixes for missing launcher links, missing support dirs, and stale temp files
|
|
31
|
+
'@ | Write-Host
|
|
32
|
+
exit 0
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
# AO_REPO_ROOT and AO_SCRIPT_LAYOUT are exported by runRepoScript().
|
|
36
|
+
$RepoRoot = if ($env:AO_REPO_ROOT) { $env:AO_REPO_ROOT } else { (Resolve-Path (Join-Path $PSScriptRoot '..')).Path }
|
|
37
|
+
$ScriptLayout = $env:AO_SCRIPT_LAYOUT
|
|
38
|
+
if (-not $ScriptLayout) {
|
|
39
|
+
if ((Test-Path (Join-Path $RepoRoot 'package.json')) -and
|
|
40
|
+
(Test-Path (Join-Path $RepoRoot 'dist/index.js')) -and
|
|
41
|
+
-not (Test-Path (Join-Path $RepoRoot 'packages'))) {
|
|
42
|
+
$ScriptLayout = 'package-install'
|
|
43
|
+
} else {
|
|
44
|
+
$ScriptLayout = 'source-checkout'
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
$DefaultConfigHome = if ($env:USERPROFILE) { $env:USERPROFILE } else { $RepoRoot }
|
|
49
|
+
|
|
50
|
+
$script:PassCount = 0
|
|
51
|
+
$script:WarnCount = 0
|
|
52
|
+
$script:FailCount = 0
|
|
53
|
+
$script:FixCount = 0
|
|
54
|
+
|
|
55
|
+
function Write-Pass($msg) { $script:PassCount++; Write-Host "PASS $msg" }
|
|
56
|
+
function Write-Warn2($msg) { $script:WarnCount++; Write-Host "WARN $msg" }
|
|
57
|
+
function Write-Fail($msg) { $script:FailCount++; Write-Host "FAIL $msg" }
|
|
58
|
+
function Write-Fixed($msg) { $script:FixCount++; Write-Host "FIXED $msg" }
|
|
59
|
+
|
|
60
|
+
function Expand-HomePath([string]$p) {
|
|
61
|
+
if ($p -like '~/*' -or $p -like '~\*') {
|
|
62
|
+
return Join-Path $DefaultConfigHome $p.Substring(2)
|
|
63
|
+
}
|
|
64
|
+
if ($p -eq '~') { return $DefaultConfigHome }
|
|
65
|
+
return $p
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function Find-AoConfig {
|
|
69
|
+
if ($env:AO_CONFIG_PATH -and (Test-Path $env:AO_CONFIG_PATH)) {
|
|
70
|
+
return $env:AO_CONFIG_PATH
|
|
71
|
+
}
|
|
72
|
+
$current = Get-Location | Select-Object -ExpandProperty Path
|
|
73
|
+
while ($current) {
|
|
74
|
+
foreach ($name in @('agent-orchestrator.yaml', 'agent-orchestrator.yml')) {
|
|
75
|
+
$candidate = Join-Path $current $name
|
|
76
|
+
if (Test-Path $candidate) { return $candidate }
|
|
77
|
+
}
|
|
78
|
+
$parent = Split-Path $current -Parent
|
|
79
|
+
if (-not $parent -or $parent -eq $current) { break }
|
|
80
|
+
$current = $parent
|
|
81
|
+
}
|
|
82
|
+
foreach ($candidate in @(
|
|
83
|
+
(Join-Path $RepoRoot 'agent-orchestrator.yaml'),
|
|
84
|
+
(Join-Path $DefaultConfigHome '.agent-orchestrator.yaml')
|
|
85
|
+
)) {
|
|
86
|
+
if (Test-Path $candidate) { return $candidate }
|
|
87
|
+
}
|
|
88
|
+
return $null
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function Read-ConfigValue([string]$key, [string]$file) {
|
|
92
|
+
$line = Get-Content $file -ErrorAction SilentlyContinue |
|
|
93
|
+
Where-Object { $_ -match "^\s*${key}:" } |
|
|
94
|
+
Select-Object -First 1
|
|
95
|
+
if (-not $line) { return '' }
|
|
96
|
+
# Strip key, comments, quotes, surrounding whitespace.
|
|
97
|
+
$val = ($line -replace "^\s*${key}:", '').Trim()
|
|
98
|
+
$val = ($val -split '#', 2)[0].Trim()
|
|
99
|
+
$val = $val.Trim('"').Trim("'").Trim()
|
|
100
|
+
return $val
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function Ensure-Dir([string]$dir, [string]$label, [string]$fixHint) {
|
|
104
|
+
if (Test-Path $dir -PathType Container) {
|
|
105
|
+
Write-Pass "$label exists at $dir"
|
|
106
|
+
return
|
|
107
|
+
}
|
|
108
|
+
if ($Fix) {
|
|
109
|
+
try {
|
|
110
|
+
New-Item -ItemType Directory -Path $dir -Force | Out-Null
|
|
111
|
+
Write-Fixed "$label created at $dir"
|
|
112
|
+
} catch {
|
|
113
|
+
Write-Fail "$label could not be created at $dir. Fix: $fixHint"
|
|
114
|
+
}
|
|
115
|
+
return
|
|
116
|
+
}
|
|
117
|
+
Write-Warn2 "$label is missing at $dir. Fix: $fixHint"
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function Check-Command([string]$name, [string]$required, [string]$fixHint) {
|
|
121
|
+
$resolved = Get-Command $name -ErrorAction SilentlyContinue
|
|
122
|
+
if (-not $resolved) {
|
|
123
|
+
if ($required -eq 'required') {
|
|
124
|
+
Write-Fail "$name is not in PATH. Fix: $fixHint"
|
|
125
|
+
} else {
|
|
126
|
+
Write-Warn2 "$name is not in PATH. Fix: $fixHint"
|
|
127
|
+
}
|
|
128
|
+
return $false
|
|
129
|
+
}
|
|
130
|
+
Write-Pass "$name resolves to $($resolved.Source)"
|
|
131
|
+
return $true
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function Check-Node {
|
|
135
|
+
if (-not (Check-Command 'node' 'required' 'install Node.js 20+ and reopen your shell')) { return }
|
|
136
|
+
$version = (& node --version 2>$null)
|
|
137
|
+
if (-not $version) { return }
|
|
138
|
+
$major = [int](($version.TrimStart('v')) -split '\.')[0]
|
|
139
|
+
if ($major -lt 20) {
|
|
140
|
+
Write-Fail "Node.js 20+ is required, found $version. Fix: install Node.js 20+"
|
|
141
|
+
return
|
|
142
|
+
}
|
|
143
|
+
Write-Pass "Node.js version $version is supported"
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function Check-Git {
|
|
147
|
+
if (-not (Check-Command 'git' 'required' 'install git 2.25+ and reopen your shell')) { return }
|
|
148
|
+
$out = (& git --version 2>$null)
|
|
149
|
+
if (-not $out) { return }
|
|
150
|
+
$match = [regex]::Match($out, '(\d+)\.(\d+)')
|
|
151
|
+
if (-not $match.Success) {
|
|
152
|
+
Write-Fail "git 2.25+ is required, could not parse '$out'. Fix: upgrade git"
|
|
153
|
+
return
|
|
154
|
+
}
|
|
155
|
+
$major = [int]$match.Groups[1].Value
|
|
156
|
+
$minor = [int]$match.Groups[2].Value
|
|
157
|
+
if ($major -lt 2 -or ($major -eq 2 -and $minor -lt 25)) {
|
|
158
|
+
Write-Fail "git 2.25+ is required, found $major.$minor. Fix: upgrade git"
|
|
159
|
+
return
|
|
160
|
+
}
|
|
161
|
+
Write-Pass "git version $major.$minor supports worktrees"
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function Check-Pnpm {
|
|
165
|
+
$required = 'required'
|
|
166
|
+
$hint = 'enable corepack or run npm install -g pnpm'
|
|
167
|
+
if ($ScriptLayout -eq 'package-install') {
|
|
168
|
+
$required = 'optional'
|
|
169
|
+
$hint = 'install pnpm if you plan to use pnpm-managed repos with AO'
|
|
170
|
+
}
|
|
171
|
+
if (-not (Check-Command 'pnpm' $required $hint)) { return }
|
|
172
|
+
$version = (& pnpm --version 2>$null)
|
|
173
|
+
$shown = if ($version) { $version } else { 'unknown' }
|
|
174
|
+
Write-Pass "pnpm version $shown is available"
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function Check-Launcher {
|
|
178
|
+
$resolved = Get-Command 'athene' -ErrorAction SilentlyContinue
|
|
179
|
+
if ($resolved) {
|
|
180
|
+
Write-Pass "ao launcher resolves to $($resolved.Source)"
|
|
181
|
+
return
|
|
182
|
+
}
|
|
183
|
+
if ($ScriptLayout -eq 'source-checkout' -and $Fix -and (Get-Command npm -ErrorAction SilentlyContinue) -and (Test-Path (Join-Path $RepoRoot 'packages/athene'))) {
|
|
184
|
+
Push-Location (Join-Path $RepoRoot 'packages/athene')
|
|
185
|
+
try {
|
|
186
|
+
$null = & npm link --force 2>&1
|
|
187
|
+
if ($LASTEXITCODE -eq 0 -and (Get-Command 'athene' -ErrorAction SilentlyContinue)) {
|
|
188
|
+
Write-Fixed "ao launcher refreshed with npm link --force"
|
|
189
|
+
return
|
|
190
|
+
}
|
|
191
|
+
} finally { Pop-Location }
|
|
192
|
+
Write-Warn2 "ao launcher refresh failed. Fix: cd $RepoRoot\packages\ao; npm link --force"
|
|
193
|
+
return
|
|
194
|
+
}
|
|
195
|
+
if ($ScriptLayout -eq 'package-install') {
|
|
196
|
+
Write-Warn2 "ao launcher is not in PATH. Fix: reinstall with npm install -g @made-by-moonlight/athene@latest"
|
|
197
|
+
return
|
|
198
|
+
}
|
|
199
|
+
Write-Warn2 "ao launcher is not in PATH. Fix: cd $RepoRoot; pwsh scripts/setup.ps1 (or run npm link --force in packages/athene)"
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function Check-Tmux {
|
|
203
|
+
# tmux is not native on Windows. The default Windows runtime is `process`,
|
|
204
|
+
# so tmux is informational only.
|
|
205
|
+
if (Get-Command 'tmux' -ErrorAction SilentlyContinue) {
|
|
206
|
+
Write-Pass "tmux is installed (note: Windows default runtime is 'process')"
|
|
207
|
+
return
|
|
208
|
+
}
|
|
209
|
+
Write-Pass "tmux not installed (Windows default runtime is 'process' — tmux not required)"
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
function Check-Gh {
|
|
213
|
+
if (-not (Get-Command 'gh' -ErrorAction SilentlyContinue)) {
|
|
214
|
+
Write-Warn2 "GitHub CLI is not installed. Fix: install gh from https://cli.github.com/"
|
|
215
|
+
return
|
|
216
|
+
}
|
|
217
|
+
& gh auth status *> $null
|
|
218
|
+
if ($LASTEXITCODE -eq 0) {
|
|
219
|
+
Write-Pass "gh is installed and authenticated"
|
|
220
|
+
return
|
|
221
|
+
}
|
|
222
|
+
Write-Warn2 "gh is installed but not authenticated. Fix: run gh auth login"
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
function Check-InstallLayout {
|
|
226
|
+
if ($ScriptLayout -eq 'package-install') {
|
|
227
|
+
$checks = @(
|
|
228
|
+
@{ Path = 'package.json'; Label = 'CLI package metadata is present' }
|
|
229
|
+
@{ Path = 'dist/index.js'; Label = 'packaged CLI entrypoint exists' }
|
|
230
|
+
@{ Path = 'dist/assets/scripts/athene-doctor.ps1'; Label = 'bundled doctor script is available' }
|
|
231
|
+
@{ Path = 'dist/assets/scripts/athene-update.ps1'; Label = 'bundled update script is available' }
|
|
232
|
+
)
|
|
233
|
+
foreach ($c in $checks) {
|
|
234
|
+
$full = Join-Path $RepoRoot $c.Path
|
|
235
|
+
if (Test-Path $full) { Write-Pass $c.Label } else { Write-Fail "$($c.Label) (missing $full). Fix: reinstall @made-by-moonlight/athene" }
|
|
236
|
+
}
|
|
237
|
+
return
|
|
238
|
+
}
|
|
239
|
+
if (Test-Path (Join-Path $RepoRoot 'node_modules')) {
|
|
240
|
+
Write-Pass "dependencies are installed at $RepoRoot\node_modules"
|
|
241
|
+
} else {
|
|
242
|
+
Write-Fail "dependencies are missing at $RepoRoot\node_modules. Fix: run pnpm install"
|
|
243
|
+
}
|
|
244
|
+
if (Test-Path (Join-Path $RepoRoot 'packages/core/dist/index.js')) {
|
|
245
|
+
Write-Pass "core package is built"
|
|
246
|
+
} else {
|
|
247
|
+
Write-Fail "core package is not built. Fix: run pnpm --filter @made-by-moonlight/athene-core build"
|
|
248
|
+
}
|
|
249
|
+
if (Test-Path (Join-Path $RepoRoot 'packages/cli/dist/index.js')) {
|
|
250
|
+
Write-Pass "CLI package is built"
|
|
251
|
+
} else {
|
|
252
|
+
Write-Fail "CLI package is not built. Fix: run pnpm --filter @made-by-moonlight/athene-cli build"
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
function Check-RuntimeSanity {
|
|
257
|
+
if ($ScriptLayout -eq 'package-install') {
|
|
258
|
+
$entry = Join-Path $RepoRoot 'dist/index.js'
|
|
259
|
+
if (-not (Test-Path $entry)) {
|
|
260
|
+
Write-Fail "packaged CLI entrypoint is missing. Fix: reinstall @made-by-moonlight/athene"
|
|
261
|
+
return
|
|
262
|
+
}
|
|
263
|
+
& node $entry --version *> $null
|
|
264
|
+
if ($LASTEXITCODE -eq 0) {
|
|
265
|
+
Write-Pass "packaged CLI runtime sanity check passed (athene --version)"
|
|
266
|
+
} else {
|
|
267
|
+
Write-Fail "packaged CLI runtime sanity check failed. Fix: reinstall @made-by-moonlight/athene"
|
|
268
|
+
}
|
|
269
|
+
return
|
|
270
|
+
}
|
|
271
|
+
$entry = Join-Path $RepoRoot 'packages/athene/bin/athene.js'
|
|
272
|
+
if (-not (Test-Path $entry)) {
|
|
273
|
+
Write-Fail "launcher entrypoint is missing. Fix: reinstall from a clean checkout"
|
|
274
|
+
return
|
|
275
|
+
}
|
|
276
|
+
& node $entry --version *> $null
|
|
277
|
+
if ($LASTEXITCODE -eq 0) {
|
|
278
|
+
Write-Pass "launcher runtime sanity check passed (athene --version)"
|
|
279
|
+
} else {
|
|
280
|
+
Write-Fail "launcher runtime sanity check failed. Fix: run pnpm build and refresh the launcher"
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
function Check-ConfigDirs {
|
|
285
|
+
$configPath = Find-AoConfig
|
|
286
|
+
if (-not $configPath) {
|
|
287
|
+
Write-Warn2 "No agent-orchestrator config was found. Fix: run ao init --auto in a target repo"
|
|
288
|
+
return
|
|
289
|
+
}
|
|
290
|
+
Write-Pass "config found at $configPath"
|
|
291
|
+
$dataDir = Read-ConfigValue 'dataDir' $configPath
|
|
292
|
+
$worktreeDir = Read-ConfigValue 'worktreeDir' $configPath
|
|
293
|
+
if (-not $dataDir) { $dataDir = Join-Path $DefaultConfigHome '.agent-orchestrator' }
|
|
294
|
+
if (-not $worktreeDir) { $worktreeDir = Join-Path $DefaultConfigHome '.worktrees' }
|
|
295
|
+
$dataDir = Expand-HomePath $dataDir
|
|
296
|
+
$worktreeDir = Expand-HomePath $worktreeDir
|
|
297
|
+
Ensure-Dir $dataDir 'metadata directory' "New-Item -ItemType Directory -Path $dataDir -Force"
|
|
298
|
+
Ensure-Dir $worktreeDir 'worktree directory' "New-Item -ItemType Directory -Path $worktreeDir -Force"
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
function Check-StaleTempFiles {
|
|
302
|
+
$tempRoot = if ($env:AO_DOCTOR_TMP_ROOT) { $env:AO_DOCTOR_TMP_ROOT } else { Join-Path $env:TEMP 'agent-orchestrator' }
|
|
303
|
+
if (-not (Test-Path $tempRoot)) {
|
|
304
|
+
Write-Pass "temp root exists check skipped because $tempRoot does not exist"
|
|
305
|
+
return
|
|
306
|
+
}
|
|
307
|
+
$cutoff = (Get-Date).AddMinutes(-60)
|
|
308
|
+
$stale = Get-ChildItem -Path $tempRoot -File -ErrorAction SilentlyContinue |
|
|
309
|
+
Where-Object { $_.LastWriteTime -lt $cutoff -and ($_.Name -like 'ao-*.tmp' -or $_.Name -like 'ao-*.pid' -or $_.Name -like 'ao-*.lock') }
|
|
310
|
+
|
|
311
|
+
if (-not $stale -or $stale.Count -eq 0) {
|
|
312
|
+
Write-Pass "no stale temp files were detected under $tempRoot"
|
|
313
|
+
return
|
|
314
|
+
}
|
|
315
|
+
if ($Fix) {
|
|
316
|
+
$deleted = 0
|
|
317
|
+
foreach ($f in $stale) {
|
|
318
|
+
try { Remove-Item $f.FullName -Force; $deleted++ } catch { }
|
|
319
|
+
}
|
|
320
|
+
if ($deleted -eq $stale.Count) {
|
|
321
|
+
Write-Fixed "$deleted stale temp files removed from $tempRoot"
|
|
322
|
+
} else {
|
|
323
|
+
Write-Warn2 "Only removed $deleted of $($stale.Count) stale temp files from $tempRoot. Fix: inspect that directory manually"
|
|
324
|
+
}
|
|
325
|
+
return
|
|
326
|
+
}
|
|
327
|
+
Write-Warn2 "$($stale.Count) stale temp files older than 60 minutes found under $tempRoot. Fix: rerun athene doctor --fix"
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
Write-Host "Athene Doctor`n"
|
|
331
|
+
|
|
332
|
+
Check-Node
|
|
333
|
+
Check-Git
|
|
334
|
+
Check-Pnpm
|
|
335
|
+
Check-Launcher
|
|
336
|
+
Check-Tmux
|
|
337
|
+
Check-Gh
|
|
338
|
+
Check-ConfigDirs
|
|
339
|
+
Check-StaleTempFiles
|
|
340
|
+
Check-InstallLayout
|
|
341
|
+
Check-RuntimeSanity
|
|
342
|
+
|
|
343
|
+
Write-Host ""
|
|
344
|
+
Write-Host "Results: $script:PassCount PASS, $script:WarnCount WARN, $script:FailCount FAIL, $script:FixCount FIXED"
|
|
345
|
+
|
|
346
|
+
if ($script:FailCount -gt 0) {
|
|
347
|
+
Write-Error "Environment needs attention before AO is safe to update or run."
|
|
348
|
+
exit 1
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
Write-Host "Environment looks healthy enough to run Athene."
|
|
352
|
+
exit 0
|