@staix/agent-hub 0.50.0 → 0.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +51 -0
- package/README.md +1 -1
- package/docs/adding-an-ai-tool.md +26 -4
- package/docs/agent-notes/README.md +1 -0
- package/docs/agent-notes/adapters.md +4 -3
- package/docs/agent-notes/budget.md +8 -2
- package/docs/agent-notes/daemon.md +13 -8
- package/docs/agent-notes/local-worker.md +3 -3
- package/docs/agent-notes/security-review.md +6 -5
- package/docs/agent-notes/tasks.md +10 -3
- package/docs/agent-notes/tests.md +4 -3
- package/docs/cooperbench.md +1 -1
- package/docs/design/adapters.md +21 -0
- package/docs/design/cli-output-inventory.md +165 -150
- package/docs/design/cli-output.md +4 -3
- package/docs/design/guidance-probes.md +1 -0
- package/docs/design/roadmap.md +3 -1
- package/docs/design/task-board.md +35 -0
- package/docs/dogfood.md +21 -3
- package/docs/events.md +4 -2
- package/docs/memory.md +5 -3
- package/docs/operations.md +259 -19
- package/docs/quickstart.md +29 -2
- package/docs/roadmap.json +20 -20
- package/docs/roadmap.md +2 -2
- package/docs/roles.md +1 -1
- package/docs/sdlc.md +29 -5
- package/docs/security.md +11 -5
- package/docs/specs/2026-09-19-agent-hub-design.md +44 -0
- package/docs/specs/2026-09-19-multi-project-design.md +4 -0
- package/docs/specs/2026-09-20-upgrade-recovery-design.md +17 -0
- package/docs/specs/mcp-endpoint.md +63 -0
- package/docs/verification/2026-11-29-agy-1.5.20.md +33 -0
- package/docs/verification/2026-11-29-claude-profile-hook.md +12 -0
- package/docs/verification/2026-11-29-idle-daemon-footprint.md +75 -0
- package/docs/verification/2026-11-29-kimi-281-reviewer-compat.md +38 -0
- package/docs/verification/2026-11-29-kimi-tui-281.md +12 -0
- package/docs/verification/2026-11-30-0.51.0.md +91 -0
- package/docs/verification/2026-11-30-account-switch-1806.md +445 -0
- package/docs/verification/2026-11-30-capability-listing-shape-1808.md +45 -0
- package/docs/verification/2026-11-30-upgrade-keep-1807.md +174 -0
- package/docs/verification/2026-12-01-1811-confirmation-receipt.md +19 -0
- package/docs/verification/2026-12-01-1811-orca-agent-list.md +20 -0
- package/docs/verification/2026-12-01-1811-orca-pane-key.md +21 -0
- package/docs/verification/2026-12-02-1819-claude-process-after-renewal.md +54 -0
- package/docs/verification/2026-12-02-agy-1.5.21.md +74 -0
- package/docs/verification/2026-12-02-claude-implementer-2.1.334.md +44 -0
- package/docs/verification/2026-12-02-cli-import-graph.md +33 -0
- package/docs/verification/2026-12-03-0.52.0.md +150 -0
- package/docs/verification/2026-12-03-codex-0173-reviewer-isolation.md +53 -0
- package/docs/verification/2026-12-03-codex-0173-reviewer-tool-call.md +34 -0
- package/docs/verification/2026-12-03-jcode-1.3.0.md +25 -0
- package/docs/verification/agy/README.md +17 -0
- package/docs/verification/agy/cli-surface.ts +68 -0
- package/docs/verification/agy/interactive-bridge.ts +92 -0
- package/docs/verification/agy/interactive-session.ts +131 -0
- package/docs/verification/agy/launcher-nonce.ts +215 -0
- package/docs/verification/agy/native-hooks.ts +210 -0
- package/docs/verification/agy/originals/agent-hub-681/cli-surface.ts +87 -0
- package/docs/verification/agy/originals/agent-hub-681/native-hooks-adapted.ts +91 -0
- package/docs/verification/agy/originals/agent-hub-681/tui-actual.ts +200 -0
- package/docs/verification/agy/originals/agent-hub-684/probe.ts +107 -0
- package/docs/verification/agy/originals.json +25 -0
- package/docs/verification/agy/permission-new-functions.ts +128 -0
- package/docs/verification/agy/run-probe.py +108 -0
- package/docs/verification/agy/runtime.ts +171 -0
- package/docs/verification/agy/tmux-helper-control.ts +6 -0
- package/docs/verification/agy/tmux-session.ts +235 -0
- package/docs/verified.json +87 -42
- package/package.json +3 -3
- package/plugins/agent-hub/.claude-plugin/plugin.json +1 -1
- package/plugins/agent-hub/compat.json +157 -0
- package/plugins/agent-hub/kimi-hook.js +1416 -24985
- package/plugins/agent-hub/server.js +17415 -32755
- package/scripts/check-docs.mjs +1 -1
- package/src/adapters/acp.ts +13 -13
- package/src/adapters/agy/definition.ts +9 -26
- package/src/adapters/agy/entry.ts +2 -0
- package/src/adapters/channel-peer.ts +3 -1
- package/src/adapters/claude-channel-evidence.ts +7 -3
- package/src/adapters/claude-channel.ts +38 -257
- package/src/adapters/claude-implementer.ts +3 -1
- package/src/adapters/codex-appserver.ts +77 -15
- package/src/adapters/compat.ts +78 -14
- package/src/adapters/configured-acp.ts +23 -163
- package/src/adapters/configured-adapter-policy.ts +160 -0
- package/src/adapters/configured-pull-entry.ts +53 -0
- package/src/adapters/configured-pull.ts +38 -0
- package/src/adapters/conformance/fakes/app-server.ts +9 -2
- package/src/adapters/declaration-catalog.ts +25 -0
- package/src/adapters/declaration-data.ts +342 -0
- package/src/adapters/declaration-resolution.ts +53 -0
- package/src/adapters/definitions/builtin-metadata.ts +62 -84
- package/src/adapters/definitions/jcode-launch.ts +13 -0
- package/src/adapters/definitions/native-adapter-policy.ts +390 -0
- package/src/adapters/definitions/native-cli-claude-launch.ts +6 -3
- package/src/adapters/definitions/native-cli-codex-launch.ts +2 -1
- package/src/adapters/definitions/native-cli-entry-claude.ts +17 -2
- package/src/adapters/definitions/native-cli-entry-codex.ts +2 -0
- package/src/adapters/definitions/native-cli-entry-jcode.ts +6 -2
- package/src/adapters/definitions/native-cli-entry-kimi.ts +2 -0
- package/src/adapters/definitions/native-cli-entry-pi.ts +2 -0
- package/src/adapters/definitions/native-cli-entry-qwen.ts +2 -0
- package/src/adapters/definitions/native-cli-entry-types.ts +12 -3
- package/src/adapters/definitions/native-cli-jcode-home-init.ts +1 -1
- package/src/adapters/definitions/native-cli-launch-common.ts +2 -2
- package/src/adapters/definitions/native-cli-preview-common.ts +1 -1
- package/src/adapters/definitions/native-cli-retained.ts +1 -1
- package/src/adapters/definitions/native-config-defaults.ts +1 -1
- package/src/adapters/definitions/native-configuration.ts +18 -0
- package/src/adapters/definitions/native-help.ts +24 -0
- package/src/adapters/definitions/native-launch-declarations.ts +34 -0
- package/src/adapters/definitions/native-launch-policy.ts +4 -0
- package/src/adapters/definitions/native-launch-settings.ts +72 -0
- package/src/adapters/definitions/native-light-cli.ts +18 -0
- package/src/adapters/definitions/native-light-preview.ts +10 -0
- package/src/adapters/definitions/native-wrapper-launch.ts +10 -0
- package/src/adapters/definitions/qwen.ts +6 -29
- package/src/adapters/definitions/reviewer-variants.ts +7 -8
- package/src/adapters/external-declarations.ts +31 -0
- package/src/adapters/external-modules.ts +4 -29
- package/src/adapters/jcode.ts +19 -12
- package/src/adapters/native-capabilities.ts +18 -8
- package/src/adapters/native-facts-hooks.ts +12 -0
- package/src/adapters/native-proof-ports.ts +1 -1
- package/src/adapters/presets.ts +136 -0
- package/src/adapters/qwen-dual.ts +2 -2
- package/src/adapters/registry-types.ts +3 -0
- package/src/adapters/registry.ts +20 -81
- package/src/adapters/reviewer-print.ts +26 -9
- package/src/adapters/role-eligibility.ts +2 -1
- package/src/cli/accounts-import.ts +72 -0
- package/src/cli/agents-latest-table.ts +88 -0
- package/src/cli/agents-latest.ts +22 -0
- package/src/cli/agents-output.ts +10 -0
- package/src/cli/agents-presets.ts +100 -0
- package/src/cli/agents.ts +1 -1
- package/src/cli/attention.ts +3 -2
- package/src/cli/autonomy-homes.ts +7 -2
- package/src/cli/autonomy-offline.ts +1 -1
- package/src/cli/bench.ts +1 -1
- package/src/cli/budget-renew-guidance.ts +129 -0
- package/src/cli/claude-homes.ts +9 -5
- package/src/cli/claude-profile-hook.ts +31 -11
- package/src/cli/command-context.ts +3 -0
- package/src/cli/command-table.ts +123 -0
- package/src/cli/commands/accounts.ts +8 -0
- package/src/cli/commands/agents.ts +18 -0
- package/src/cli/commands/answer.ts +28 -0
- package/src/cli/commands/ask.ts +17 -0
- package/src/cli/commands/autonomy.ts +83 -0
- package/src/cli/commands/backlog.ts +46 -0
- package/src/cli/commands/bench.ts +60 -0
- package/src/cli/commands/board.ts +48 -0
- package/src/cli/commands/broker.ts +9 -0
- package/src/cli/commands/budget.ts +96 -0
- package/src/cli/commands/capabilities.ts +12 -0
- package/src/cli/commands/check-path.ts +55 -0
- package/src/cli/commands/completion.ts +8 -0
- package/src/cli/commands/console.ts +12 -0
- package/src/cli/commands/daemon.ts +8 -0
- package/src/cli/commands/deliverables.ts +25 -0
- package/src/cli/commands/doctor.ts +249 -0
- package/src/cli/commands/down.ts +3 -0
- package/src/cli/commands/export.ts +15 -0
- package/src/cli/commands/facts.ts +15 -0
- package/src/cli/commands/goal.ts +22 -0
- package/src/cli/commands/guidance.ts +102 -0
- package/src/cli/commands/help.ts +17 -0
- package/src/cli/commands/host.ts +45 -0
- package/src/cli/commands/init.ts +121 -0
- package/src/cli/commands/instructed.ts +19 -0
- package/src/cli/commands/instruction-hook.ts +15 -0
- package/src/cli/commands/intake.ts +24 -0
- package/src/cli/commands/kill.ts +15 -0
- package/src/cli/commands/learn.ts +23 -0
- package/src/cli/commands/lineage.ts +30 -0
- package/src/cli/commands/logs.ts +21 -0
- package/src/cli/commands/manager.ts +15 -0
- package/src/cli/commands/memory.ts +21 -0
- package/src/cli/commands/model.ts +25 -0
- package/src/cli/commands/models.ts +40 -0
- package/src/cli/commands/native.ts +39 -0
- package/src/cli/commands/pause.ts +5 -0
- package/src/cli/commands/peer.ts +32 -0
- package/src/cli/commands/permission.ts +26 -0
- package/src/cli/commands/permit.ts +12 -0
- package/src/cli/commands/pet.ts +24 -0
- package/src/cli/commands/projects.ts +49 -0
- package/src/cli/commands/queue.ts +70 -0
- package/src/cli/commands/recovery-run.ts +13 -0
- package/src/cli/commands/recovery.ts +130 -0
- package/src/cli/commands/release.ts +23 -0
- package/src/cli/commands/releases.ts +91 -0
- package/src/cli/commands/remember.ts +6 -0
- package/src/cli/commands/report.ts +27 -0
- package/src/cli/commands/research.ts +53 -0
- package/src/cli/commands/reset.ts +89 -0
- package/src/cli/commands/restart.ts +5 -0
- package/src/cli/commands/results.ts +31 -0
- package/src/cli/commands/resume.ts +5 -0
- package/src/cli/commands/review.ts +24 -0
- package/src/cli/commands/roadmap.ts +21 -0
- package/src/cli/commands/role.ts +34 -0
- package/src/cli/commands/roles.ts +30 -0
- package/src/cli/commands/room.ts +14 -0
- package/src/cli/commands/roster.ts +48 -0
- package/src/cli/commands/route.ts +9 -0
- package/src/cli/commands/say.ts +21 -0
- package/src/cli/commands/schedule.ts +17 -0
- package/src/cli/commands/sdlc.ts +321 -0
- package/src/cli/commands/settings.ts +148 -0
- package/src/cli/commands/setup.ts +89 -0
- package/src/cli/commands/shared-refusals.ts +25 -0
- package/src/cli/commands/smoke.ts +44 -0
- package/src/cli/commands/source.ts +64 -0
- package/src/cli/commands/specs.ts +13 -0
- package/src/cli/commands/status.ts +28 -0
- package/src/cli/commands/stop.ts +17 -0
- package/src/cli/commands/structure.ts +60 -0
- package/src/cli/commands/study.ts +39 -0
- package/src/cli/commands/tail.ts +19 -0
- package/src/cli/commands/task.ts +114 -0
- package/src/cli/commands/title.ts +17 -0
- package/src/cli/commands/turns.ts +10 -0
- package/src/cli/commands/ui.ts +47 -0
- package/src/cli/commands/undo.ts +77 -0
- package/src/cli/commands/up.ts +39 -0
- package/src/cli/commands/upgrade.ts +5 -0
- package/src/cli/commands/usage.ts +33 -0
- package/src/cli/commands/version.ts +5 -0
- package/src/cli/commands/watch.ts +30 -0
- package/src/cli/commands/worktrees.ts +31 -0
- package/src/cli/conductor-recovery.ts +1 -1
- package/src/cli/console-state.ts +5 -138
- package/src/cli/console-versions.ts +1 -1
- package/src/cli/facts-hook.ts +11 -4
- package/src/cli/help.ts +44 -20
- package/src/cli/identity.ts +27 -4
- package/src/cli/init-prompt.ts +1 -1
- package/src/cli/init-settings.ts +4 -35
- package/src/cli/init.ts +1 -1
- package/src/cli/json-text-spans.ts +57 -0
- package/src/cli/launch-check.ts +156 -0
- package/src/cli/launch.ts +19 -70
- package/src/cli/light-dispatch.ts +29 -0
- package/src/cli/main.js +8 -1
- package/src/cli/main.ts +257 -2799
- package/src/cli/memory.ts +1 -1
- package/src/cli/orca-probe.ts +119 -0
- package/src/cli/output.ts +45 -3
- package/src/cli/preview.ts +11 -6
- package/src/cli/recovery-launch.ts +1 -1
- package/src/cli/recovery-version-preflight.ts +28 -9
- package/src/cli/replace-process.ts +22 -0
- package/src/cli/report-layout.ts +142 -0
- package/src/cli/roadmap-usage.ts +16 -0
- package/src/cli/roadmap.ts +3 -16
- package/src/cli/sdlc-doctor.ts +27 -0
- package/src/cli/sdlc-output.ts +55 -1
- package/src/cli/setup-homes.ts +2 -2
- package/src/cli/start-agents-run.ts +85 -7
- package/src/cli/start-check.ts +28 -0
- package/src/cli/statusline-tee.ts +25 -4
- package/src/cli/terminal-recovery.ts +53 -10
- package/src/cli/upgrade-interactive.ts +1 -0
- package/src/cli/upgrade-runtime.ts +12 -1
- package/src/cli/upgrade.ts +4 -15
- package/src/cli/warn-line.ts +1 -1
- package/src/hub/accounts.ts +148 -0
- package/src/hub/addons.ts +20 -0
- package/src/hub/agent-drift.ts +2 -1
- package/src/hub/budget-projection.ts +39 -7
- package/src/hub/budget.ts +231 -16
- package/src/hub/channel-project.ts +3 -3
- package/src/hub/ci-watch.ts +311 -79
- package/src/hub/conductor-peer.ts +24 -0
- package/src/hub/conductor.ts +2 -21
- package/src/hub/config-apply.ts +25 -14
- package/src/hub/config-edit.ts +1 -1
- package/src/hub/config-tier.ts +2 -0
- package/src/hub/config.ts +535 -0
- package/src/hub/control-client.ts +49 -1
- package/src/hub/daemon.ts +492 -569
- package/src/hub/delivery-public.ts +11 -0
- package/src/hub/events.ts +3 -0
- package/src/hub/home-tag.ts +12 -0
- package/src/hub/host.ts +217 -0
- package/src/hub/hub-check.ts +125 -0
- package/src/hub/hub-tools.ts +2 -1
- package/src/hub/instance-budget.ts +2 -2
- package/src/hub/instance-config.ts +15 -126
- package/src/hub/instances.ts +22 -6
- package/src/hub/instruction-receipt.ts +2 -2
- package/src/hub/kimi-usage.ts +38 -11
- package/src/hub/lifecycle.ts +86 -4
- package/src/hub/mcp-bridge-core.ts +98 -0
- package/src/hub/mcp-channel-push.ts +20 -0
- package/src/hub/mcp-endpoint-serve.ts +178 -0
- package/src/hub/mcp-endpoint.ts +226 -0
- package/src/hub/mcp-tool-call.ts +181 -0
- package/src/hub/operational-settings.ts +2 -0
- package/src/hub/orca-env.ts +6 -0
- package/src/hub/orca-state.ts +84 -0
- package/src/hub/path-policy.ts +1 -1
- package/src/hub/peers.ts +5 -1
- package/src/hub/permission-mode.ts +5 -41
- package/src/hub/permission-paths.ts +41 -0
- package/src/hub/project.ts +20 -0
- package/src/hub/protocol-window.ts +58 -0
- package/src/hub/quota-origin.ts +20 -0
- package/src/hub/recovery-policy.ts +1 -1
- package/src/hub/registry.ts +36 -2
- package/src/hub/releases-inventory.ts +198 -0
- package/src/hub/report.ts +1 -1
- package/src/hub/research.ts +1 -1
- package/src/hub/review-brief.ts +47 -2
- package/src/hub/roster.ts +6 -3
- package/src/hub/routing.ts +9 -2
- package/src/hub/runtime-capture-prune.ts +25 -3
- package/src/hub/runtime-prune-health.ts +8 -1
- package/src/hub/sdlc-check.ts +205 -0
- package/src/hub/sdlc-release-authorization.ts +42 -21
- package/src/hub/sdlc-release-diagnostics.ts +5 -0
- package/src/hub/sdlc-release-policy.ts +21 -7
- package/src/hub/sdlc-release.ts +80 -20
- package/src/hub/sdlc-sync.ts +146 -0
- package/src/hub/sdlc.ts +38 -5
- package/src/hub/settings.ts +7 -4
- package/src/hub/start-agents.ts +1 -1
- package/src/hub/start-mode.ts +11 -4
- package/src/hub/structure-budget.ts +131 -0
- package/src/hub/structure-scan.ts +149 -0
- package/src/hub/tasks-experiment.ts +455 -0
- package/src/hub/tasks-guidance.ts +606 -0
- package/src/hub/tasks-roadmap-plan.ts +419 -0
- package/src/hub/tasks-roadmap.ts +491 -0
- package/src/hub/tasks-study.ts +661 -0
- package/src/hub/tasks-survey.ts +192 -0
- package/src/hub/tasks.ts +457 -2584
- package/src/hub/terminal-open.ts +5 -3
- package/src/hub/tooling.ts +3 -19
- package/src/hub/usage-rollup.ts +9 -3
- package/src/local/tools.ts +5 -0
- package/src/ui/index.html +1 -1
- package/src/ui/needs.ts +17 -5
- package/src/ui/peer-palette.ts +2 -4
- package/src/ui/plugin.ts +1 -1
- package/templates/presets/agents.json +60 -0
- package/templates/presets/confirmation-matrix.json +8 -8
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { COMPLETION_SHELLS, completionScript } from "../completion.ts";
|
|
2
|
+
import type { CommandContext } from "../command-context.ts";
|
|
3
|
+
|
|
4
|
+
export function run({ args, fail }: CommandContext): void {
|
|
5
|
+
const script = completionScript(args[0]);
|
|
6
|
+
if (args.length !== 1 || !script) fail(`usage: ahub completion ${COMPLETION_SHELLS.join("|")}`);
|
|
7
|
+
process.stdout.write(script!);
|
|
8
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { runConsole } from "../console.ts";
|
|
2
|
+
import { resolveColor, streamEnv } from "../console-state.ts";
|
|
3
|
+
import type { CommandContext } from "../command-context.ts";
|
|
4
|
+
|
|
5
|
+
export async function run(context: CommandContext) {
|
|
6
|
+
const { args, connect, consoleInstalled, cwd, liveTest, stateDir } = context;
|
|
7
|
+
const fail: CommandContext["fail"] = context.fail;
|
|
8
|
+
if (args.some(arg => arg !== "--panels" && arg !== "--no-pet" && !arg.startsWith("--color=")) || args.filter(arg => arg.startsWith("--color=")).length > 1) fail("usage: ahub console [--panels] [--no-pet] [--color=auto|always|never]");
|
|
9
|
+
const color = resolveColor(args.find(arg => arg.startsWith("--color="))?.slice("--color=".length), streamEnv(!!process.stdin.isTTY && !!process.stdout.isTTY), "ahub");
|
|
10
|
+
if (color instanceof Error) return fail("usage: ahub console [--panels] [--no-pet] [--color=auto|always|never]");
|
|
11
|
+
await runConsole({ client: await connect(), cwd, stateDir, liveTest, panels: args.includes("--panels"), noPet: args.includes("--no-pet"), color, installed: consoleInstalled() });
|
|
12
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { runProjectDaemon } from "../../hub/lifecycle.ts";
|
|
2
|
+
import type { CommandContext } from "../command-context.ts";
|
|
3
|
+
|
|
4
|
+
export async function run({ args, registeredProject, unattendedEnv }: CommandContext) {
|
|
5
|
+
process.on("unhandledRejection", (e) => console.error(`${new Date().toISOString()} unhandled rejection:`, e));
|
|
6
|
+
process.on("uncaughtException", (e) => console.error(`${new Date().toISOString()} uncaught exception:`, e));
|
|
7
|
+
await runProjectDaemon(registeredProject(), unattendedEnv || args.includes("--unattended"));
|
|
8
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { DeliverableRow } from "../../hub/tasks.ts";
|
|
2
|
+
import type { CommandContext } from "../command-context.ts";
|
|
3
|
+
|
|
4
|
+
export async function run(context: CommandContext) {
|
|
5
|
+
const { args, outputOptions, takeFlags, taskOp } = context;
|
|
6
|
+
const fail: CommandContext["fail"] = context.fail;
|
|
7
|
+
// #317: what each task delivered and what a reviewer approved, by id, hash and size (a path only where the PII screen allows it). #933: an agent gets only the rows hub_task_show would show it.
|
|
8
|
+
const options = outputOptions();
|
|
9
|
+
const { one, rest } = takeFlags(args, ["--task"], []);
|
|
10
|
+
const approved = rest.includes("--approved"), check = rest.includes("--check");
|
|
11
|
+
const extra = rest.filter(arg => !["--json", "--full", "--approved", "--check"].includes(arg) && !arg.startsWith("--color="));
|
|
12
|
+
const task = one["--task"] === undefined ? undefined : Number(one["--task"]);
|
|
13
|
+
// takeFlags keeps the last of a repeated flag: for a command that selects a task that would silently drop one of two named tasks.
|
|
14
|
+
if (args.filter(arg => arg === "--task").length > 1) fail("usage: ahub deliverables [--task <id>] [--approved] [--check] [--json] [--color=auto|always|never] (--task takes one id)");
|
|
15
|
+
if (extra.length || (one["--task"] !== undefined && !/^[1-9]\d*$/.test(one["--task"])) || (task !== undefined && !Number.isSafeInteger(task))) fail("usage: ahub deliverables [--task <id>] [--approved] [--check] [--json] [--color=auto|always|never]");
|
|
16
|
+
const rows = JSON.parse(await taskOp("deliverables", { ...(task === undefined ? {} : { task }), ...(approved ? { approved: true } : {}), ...(check ? { check: true } : {}) })) as DeliverableRow[];
|
|
17
|
+
if (options.json) return console.log(JSON.stringify(rows, null, 2));
|
|
18
|
+
if (!rows.length) return console.log(task === undefined ? `no ${approved ? "approved " : ""}deliverables on the board` : `task #${task} has no ${approved ? "approved " : ""}deliverables`);
|
|
19
|
+
for (const row of rows) {
|
|
20
|
+
const flag = row.checked ? ({ changed: " (changed since review)", missing: " (a file is missing)", unknown: " (could not be measured)", unchanged: " (unchanged)" } as const)[row.result ?? "unknown"] : "";
|
|
21
|
+
console.log(`${row.title} [${row.state}${flag}]`); // `title` is the hub's publicTitle: it already starts with `#<id>`
|
|
22
|
+
for (const file of row.files) console.log(` ${file.id} ${file.path ?? "(private)"} ${file.format}${file.version ? ` ${file.version}` : ""} ${file.bytes} B sha256 ${file.sha256}${file.state ? ` ${file.state}` : ""}`);
|
|
23
|
+
}
|
|
24
|
+
if (!check) console.log("(hashes are the board's records; add --check to measure the files now)");
|
|
25
|
+
}
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { runtimePruneHealth } from "../../hub/runtime-prune-health.ts";
|
|
2
|
+
import { kimiSourceRow } from "../../hub/budget-notes.ts";
|
|
3
|
+
import { agentVersions } from "../agents.ts";
|
|
4
|
+
import { assessVersion, COMPAT, configuredCommands } from "../../adapters/compat.ts";
|
|
5
|
+
import { readInstanceRoleConfig, readInstanceConfigLayers } from "../../hub/instance-config.ts";
|
|
6
|
+
import { rosterAllows } from "../../hub/roster.ts";
|
|
7
|
+
import { definitionOf, DOCTOR_TOOL_PROBES, DOCTOR_MEMORY_CAPTURE_PEERS, DOCTOR_PLUGIN_PROBE, nativeDoctorCheck, nativeMemoryCaptureRow, nativeDoctorRecoveryIdentity, nativeDoctorOptionalProbes } from "../../adapters/registry.ts";
|
|
8
|
+
import { autonomyHomeStatus } from "../autonomy-homes.ts";
|
|
9
|
+
import { shellQuote } from "../shell-quote.ts";
|
|
10
|
+
import { catalogAssignments, loadRoleCatalog, selectedRoles } from "../../hub/roles.ts";
|
|
11
|
+
import { verifiedJcodeCommand } from "../../adapters/jcode.ts";
|
|
12
|
+
import { jcodeExtraMcpServers, splitJcodeMcpServers } from "../jcode-mcp.ts";
|
|
13
|
+
import { rolesRow } from "../role-doctor.ts";
|
|
14
|
+
import { classListRow, loadRouting } from "../../hub/routing.ts";
|
|
15
|
+
import { spawnSync } from "node:child_process";
|
|
16
|
+
import { orcaDoctorRow, orcaProbeRunner, readOrcaProbe } from "../orca-probe.ts";
|
|
17
|
+
import { orcaExecutable } from "../terminal-recovery.ts";
|
|
18
|
+
import { existsSync } from "node:fs";
|
|
19
|
+
import { homedir } from "node:os";
|
|
20
|
+
import { join, resolve } from "node:path";
|
|
21
|
+
import { readControl } from "../../hub/control-client.ts";
|
|
22
|
+
import { loadConfig } from "../../hub/config.ts";
|
|
23
|
+
import { pullRegistrationChecks } from "../../adapters/presets.ts";
|
|
24
|
+
import { Registry } from "../../hub/registry.ts";
|
|
25
|
+
import { OmniRoute } from "../../omniroute/client.ts";
|
|
26
|
+
import { planInit, sharedConfigRow } from "../init.ts";
|
|
27
|
+
import { HUB_SKILL_NAMES, hubSkillsPresent, parseList, pluginState, type InstalledPlugin } from "../setup.ts";
|
|
28
|
+
import { skillHostStates, skillStateRow } from "../skills-install.ts";
|
|
29
|
+
import { jcodeHomeSkillStates, jcodeSkillHomes } from "../../adapters/definitions/native-cli-jcode-home-init.ts";
|
|
30
|
+
import { VERSION } from "../../version.ts";
|
|
31
|
+
import { runtimeVersionWarnings } from "../runtime-version-warning.ts";
|
|
32
|
+
import { inspectMlx } from "../../models/mlx.ts";
|
|
33
|
+
import { type PeerRow } from "../status-lines.ts";
|
|
34
|
+
import { memoryStaleAnchorsCommand } from "../memory.ts";
|
|
35
|
+
import { formatMemoryStaleAnchors } from "../../hub/memory-stale-anchors.ts";
|
|
36
|
+
import { AGENT_MEM_REFUSAL, AGENT_MEM_VERSION } from "../../hub/memory-profile.ts";
|
|
37
|
+
import { asciiMarkers } from "../console-state.ts";
|
|
38
|
+
import { renderDoctor, renderOrphanCleanup, type DoctorCheck } from "../output.ts";
|
|
39
|
+
import { readSdlcFile, sdlcDoctorRow } from "../sdlc-doctor.ts";
|
|
40
|
+
import type { SdlcCheckReport } from "../../hub/sdlc-check.ts";
|
|
41
|
+
import type { CommandContext } from "../command-context.ts";
|
|
42
|
+
|
|
43
|
+
export async function run(context: CommandContext) {
|
|
44
|
+
const { args, cliDir, connect, cwd, doctorSetsExit, healthy, identity, inspectDoctorRouting, orphanDoctor, outputOptions, printOutput, readMemorySetup, stateDir } = context;
|
|
45
|
+
const fail: CommandContext["fail"] = context.fail;
|
|
46
|
+
const options = outputOptions();
|
|
47
|
+
if (args.includes("--stale-anchors")) {
|
|
48
|
+
if (args.some(arg => arg !== "--stale-anchors" && arg !== "--json")) fail("usage: ahub doctor --stale-anchors [--json]");
|
|
49
|
+
const report = await memoryStaleAnchorsCommand(cwd, { stateDir });
|
|
50
|
+
console.log(options.json ? JSON.stringify(report, null, 2) : formatMemoryStaleAnchors(report));
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
if (args.includes("--orphans")) {
|
|
54
|
+
if(identity.role==="tools" && args.includes("--kill")) {
|
|
55
|
+
// #812: the conductor's shell asks the hub to stop its own orphan; #899: the answer prints for a person unless --json.
|
|
56
|
+
const hub=await connect();
|
|
57
|
+
try {
|
|
58
|
+
const result=await hub.request({t:"conductor_operational",op:"orphans"},10_000);
|
|
59
|
+
if(result.ok!==true)fail(String(result.error??"orphan inspection unavailable"),result.refusalAudited===true,result.authorityRefused);
|
|
60
|
+
if (options.json) console.log(JSON.stringify(result,null,2));
|
|
61
|
+
else printOutput(renderOrphanCleanup(result, options.columns), options.color);
|
|
62
|
+
} finally{hub.close();}
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
return orphanDoctor(args.includes("--kill"), options);
|
|
66
|
+
}
|
|
67
|
+
const version = (bin: string) => {
|
|
68
|
+
const res = spawnSync(bin, ["--version"], { encoding: "utf8" });
|
|
69
|
+
return res.status === 0 ? res.stdout.trim().split("\n")[0]! : undefined;
|
|
70
|
+
};
|
|
71
|
+
const checks: DoctorCheck[] = [];
|
|
72
|
+
const row = (ok: boolean | undefined, name: string, detail: string) => { checks.push(nativeDoctorCheck(ok, name, detail)); };
|
|
73
|
+
|
|
74
|
+
try {
|
|
75
|
+
for (const check of runtimePruneHealth()) row(check.ok, check.name, check.detail);
|
|
76
|
+
// #1399: a project initialised by an older ahub keeps that version's instruction block until init runs again; doctor says so with the command.
|
|
77
|
+
try {
|
|
78
|
+
const stale = planInit(cwd).some(change => change.path === join(cwd, "AGENTS.md"));
|
|
79
|
+
row(stale ? undefined : true, "hub instructions", // a warning, never a failure: doctor's exit code stays what it was for a project that has not refreshed yet
|
|
80
|
+
stale ? `the managed block in AGENTS.md differs from this ahub version; preview with: cd ${cwd} && ahub init --dry-run; apply with: cd ${cwd} && ahub init --yes (text outside the markers is kept), then commit AGENTS.md` : "AGENTS.md managed block matches this ahub version");
|
|
81
|
+
} catch (error) { row(false, "hub instructions", `AGENTS.md could not be checked: ${error instanceof Error ? error.message : "unknown error"}; run ahub init --dry-run to see why`); }
|
|
82
|
+
// #1411 T2: a warning, never a failure, like the row above.
|
|
83
|
+
try { const shared = sharedConfigRow(cwd); if (shared) row(shared.ok, "shared config", shared.detail); }
|
|
84
|
+
catch (error) { row(undefined, "shared config", `could not be checked: ${error instanceof Error ? error.message : "unknown error"}`); }
|
|
85
|
+
// #1408 R2: who holds conductor, planner and reviewer as the loader settled them, and a conductor the loader ignored. A warning, never a failure, like the rows above.
|
|
86
|
+
try {
|
|
87
|
+
const settled = loadConfig(cwd), scope = readInstanceRoleConfig(cwd), layers = readInstanceConfigLayers(cwd);
|
|
88
|
+
const declared: Record<string, string[]> = {}, modes: Record<string, "tui" | "headless"> = {};
|
|
89
|
+
// The start mode the loader reads: the raw peers.<peer>.start_mode, a later layer winning, so doctor and the loader cannot disagree for an instance peer.
|
|
90
|
+
for (const layer of layers) { const peers = layer.raw.peers; if (peers && typeof peers === "object" && !Array.isArray(peers)) for (const [peer, block] of Object.entries(peers as Record<string, unknown>)) { const mode = block && typeof block === "object" ? (block as { start_mode?: unknown }).start_mode : undefined; if (mode === "tui" || mode === "headless") modes[peer] = mode; } }
|
|
91
|
+
for (const layer of layers) if (layer.raw.roles && typeof layer.raw.roles === "object" && !Array.isArray(layer.raw.roles)) for (const [peer, list] of Object.entries(layer.raw.roles as Record<string, unknown>)) if (Array.isArray(list)) declared[peer] = list.filter((role): role is string => typeof role === "string");
|
|
92
|
+
const result = rolesRow({ roles: settled.roles, declared: Object.keys(declared).length ? declared : undefined, startMode: peer => modes[peer],
|
|
93
|
+
rostered: peer => rosterAllows(settled.roster, peer, settled.pi.enabled, scope.instances, scope.catalog) });
|
|
94
|
+
row(result.ok, "roles", result.detail);
|
|
95
|
+
} catch (error) { row(undefined, "roles", `could not be checked: ${error instanceof Error ? error.message : "unknown error"}`); }
|
|
96
|
+
const catalog = loadRoleCatalog(cwd);
|
|
97
|
+
for (const error of catalog.errors) row(false, "catalog role", `${error.id}: ${error.reason}`);
|
|
98
|
+
try {
|
|
99
|
+
const config = loadConfig(cwd), assigned = catalogAssignments(config.catalog_roles);
|
|
100
|
+
for (const peer of Object.keys(assigned)) selectedRoles(peer, config.roles, assigned, catalog);
|
|
101
|
+
} catch { row(false, "catalog roles", "invalid assignment id, shape or flow base"); }
|
|
102
|
+
// #1626 C: a rostered peer that can implement but sits in no class list never gets a task from routing. A warning, like the rows above.
|
|
103
|
+
try {
|
|
104
|
+
const config = loadConfig(cwd), scope = readInstanceRoleConfig(cwd);
|
|
105
|
+
const roster = (peer: string) => rosterAllows(config.roster, peer, config.pi.enabled, scope.instances, scope.catalog);
|
|
106
|
+
const implementers = [...new Set([...Object.keys(config.roles), ...Object.keys(config.roster)])]
|
|
107
|
+
.filter(peer => roster(peer) && ((config.roles[peer] ?? []).includes("implementer") || [...(definitionOf(peer, scope.instances)?.roles ?? [])].includes("implementer")))
|
|
108
|
+
.sort();
|
|
109
|
+
const file = join(cwd, ".agenthub", "routing.toml");
|
|
110
|
+
const result = classListRow(implementers, loadRouting(cwd), file, existsSync(file));
|
|
111
|
+
// An advisory row, so it warns rather than failing: only a row the person must repair is a fail.
|
|
112
|
+
checks.push({ name: "routing classes", section: "Config", level: result.ok === undefined ? "warn" : result.ok ? "ok" : "fail", detail: result.detail });
|
|
113
|
+
} catch (error) { row(undefined, "routing classes", `could not be checked: ${error instanceof Error ? error.message : "unknown error"}`); }
|
|
114
|
+
for (const bin of DOCTOR_TOOL_PROBES) {
|
|
115
|
+
const v = version(bin);
|
|
116
|
+
row(!!v, bin, v ?? "not found on PATH");
|
|
117
|
+
}
|
|
118
|
+
const up = await healthy();
|
|
119
|
+
let daemonVersion: unknown;
|
|
120
|
+
row(up, "ahub daemon", up ? readControl(stateDir)!.url : "not running (ahub up)");
|
|
121
|
+
if (up) {
|
|
122
|
+
const hub = await connect();
|
|
123
|
+
try {
|
|
124
|
+
const { status } = await hub.request({ t: "status" });
|
|
125
|
+
daemonVersion = status.version; // Authenticated reply, never the unauthenticated disk manifest.
|
|
126
|
+
const pending = Object.values(status.peers as Record<string, PeerRow>).reduce((n, peer) => n + (peer.needsReview ?? 0), 0);
|
|
127
|
+
row(!status.deliveryError && pending === 0, "delivery recovery", status.deliveryError ?? (pending ? `${pending} deliveries need review; run ahub queue list` : "journal healthy; no deliveries need review"));
|
|
128
|
+
// #285 AC10: where Kimi's number comes from, and whether the hub can trust it right now. An older hub answers without `kimiSource`: no row, not a failure.
|
|
129
|
+
const quota = await hub.request({ t: "budget" });
|
|
130
|
+
const kimiRow = quota.ok ? kimiSourceRow(quota.kimiSource) : undefined;
|
|
131
|
+
if (kimiRow) row(kimiRow.ok, "kimi usage source", kimiRow.detail);
|
|
132
|
+
const observed = await hub.request({ t: "recovery", op: "inspect", expectedInstanceId: status.instanceId });
|
|
133
|
+
for (const peer of Object.values(observed.recovery?.peers ?? {}) as { id: string; state: string; sessionId?: string; threadId?: string }[]) {
|
|
134
|
+
const check = nativeDoctorRecoveryIdentity(peer);
|
|
135
|
+
if (check) row(check.ok, check.name, check.detail);
|
|
136
|
+
}
|
|
137
|
+
} finally { hub.close(); }
|
|
138
|
+
}
|
|
139
|
+
const plugins = parseList<InstalledPlugin>(spawnSync(DOCTOR_PLUGIN_PROBE.command, [...DOCTOR_PLUGIN_PROBE.argv], { encoding: "utf8" }).stdout ?? "");
|
|
140
|
+
const plugin = pluginState(plugins, join(cliDir, "..", ".."));
|
|
141
|
+
row(plugin.state === "current", DOCTOR_PLUGIN_PROBE.name, plugin.state === "missing" ? "missing: run ahub setup" : plugin.state === "current" ? `agent-hub@agent-hub ${plugin.version}` : `agent-hub@agent-hub is stale (${plugin.why}): run ahub setup`);
|
|
142
|
+
// #1622: one row for the hub's own skills, in the Claude plugin and on every other installed host; a tree the hub will not touch is a warning.
|
|
143
|
+
const skillsPresent = hubSkillsPresent(plugins);
|
|
144
|
+
const hostSkills = skillStateRow(skillHostStates({ home: homedir(), env: process.env }, HUB_SKILL_NAMES));
|
|
145
|
+
const claudeSkills = skillsPresent ? "Claude plugin skills present" : `missing from Claude user plugin; repair: cd ${shellQuote(cwd)} && ${plugin.state === "missing" ? "ahub setup" : "claude plugin uninstall agent-hub@agent-hub --scope user && ahub setup"}`;
|
|
146
|
+
const hostRepair = hostSkills.ok === false ? `; repair: cd ${shellQuote(cwd)} && ahub setup` : "";
|
|
147
|
+
// #1627 AC1b: the hub-owned jcode homes carry the skills too; a missing or stale tree there is the same repair.
|
|
148
|
+
const ownedHomes = jcodeHomeSkillStates(jcodeSkillHomes(loadConfig(cwd), process.env), HUB_SKILL_NAMES);
|
|
149
|
+
const ownedBad = ownedHomes.filter(state => state.state === "missing" || state.state === "stale" || state.state === "failed");
|
|
150
|
+
const ownedText = ownedHomes.length ? `; hub-owned jcode ${ownedHomes.map(state => `${state.home} ${state.state}`).join(", ")}${ownedBad.length ? `; repair: cd ${shellQuote(cwd)} && ahub setup` : ""}` : "";
|
|
151
|
+
row(skillsPresent ? (ownedBad.length ? false : hostSkills.ok) : false, "hub skills", `${claudeSkills}; ${hostSkills.detail}${hostRepair}${ownedText}`);
|
|
152
|
+
let profileRegistry: Registry | undefined;
|
|
153
|
+
try {
|
|
154
|
+
profileRegistry = new Registry();
|
|
155
|
+
const profiles = await autonomyHomeStatus(profileRegistry, homedir(), process.env, join(cliDir, "..", ".."), (argv, options) => {
|
|
156
|
+
const result = spawnSync(argv[0]!, argv.slice(1), { encoding: "utf8", env: options.env, timeout: options.timeoutMs, maxBuffer: 1024 * 1024 });
|
|
157
|
+
return { status: result.status ?? -1, stdout: result.stdout ?? "" };
|
|
158
|
+
});
|
|
159
|
+
for (const profile of profiles.homes) {
|
|
160
|
+
const installed = profile.hook.state === "installed";
|
|
161
|
+
checks.push({ name: `Claude profile hook: ${profile.home.path}`, section: "Hub", level: installed ? "ok" : "warn",
|
|
162
|
+
detail: installed ? profile.hook.reason : `${profile.hook.reason} Run CLAUDE_CONFIG_DIR=${shellQuote(profile.home.path)} ahub setup.` });
|
|
163
|
+
}
|
|
164
|
+
if (!profiles.complete) checks.push({ name: "Claude profile discovery", section: "Hub", level: "unknown",
|
|
165
|
+
detail: profiles.notices.join("; ") || "Claude profile discovery is incomplete; inspect the registered projects and selected homes before setup." });
|
|
166
|
+
} catch {
|
|
167
|
+
checks.push({ name: "Claude profile discovery", section: "Hub", level: "unknown", detail: "Claude profile inventory is unavailable; inspect the machine registry and selected homes before setup." });
|
|
168
|
+
} finally { profileRegistry?.close(); }
|
|
169
|
+
if (up) checks.push(...runtimeVersionWarnings(daemonVersion, VERSION, plugin.state === "missing" ? undefined : plugin.version));
|
|
170
|
+
|
|
171
|
+
// #1856 T2 AC2: one offline row; the hub answers from its own state and no GitHub read runs.
|
|
172
|
+
try {
|
|
173
|
+
let offline: SdlcCheckReport | undefined;
|
|
174
|
+
if (up) {
|
|
175
|
+
const sdlcHub = await connect();
|
|
176
|
+
try { const reply = await sdlcHub.request({ t: "sdlc", op: "check", offline: true }, 10_000); if (reply.ok) offline = reply as unknown as SdlcCheckReport; }
|
|
177
|
+
finally { sdlcHub.close(); }
|
|
178
|
+
}
|
|
179
|
+
checks.push(sdlcDoctorRow({ ...(offline ? { report: offline } : {}), file: readSdlcFile(cwd, VERSION), hubUp: up }));
|
|
180
|
+
} catch (error) { row(undefined, "sdlc", `could not be checked: ${error instanceof Error ? error.message : "unknown error"}; run ahub sdlc check`); }
|
|
181
|
+
const config = loadConfig(cwd);
|
|
182
|
+
row(!config.ignored, "config", config.ignored ? `${config.ignored.join("; ")} (move them to .agenthub/config.local.json)` : "no machine-local field ignored");
|
|
183
|
+
for (const line of config.releasePolicyNotices ?? []) row(false, "release policy", line);
|
|
184
|
+
for (const line of config.retired ?? []) row(false, "retired setting", line);
|
|
185
|
+
const { routing, errors: routingErrors } = inspectDoctorRouting(cwd);
|
|
186
|
+
for (const error of routingErrors) row(false, "routing", error);
|
|
187
|
+
for (const probe of nativeDoctorOptionalProbes(config)) {
|
|
188
|
+
if (probe.kind === "source-identity") row(verifiedJcodeCommand(probe.command, cwd), probe.name, probe.detail);
|
|
189
|
+
else if (probe.kind === "jcode-mcp") {
|
|
190
|
+
const { servers, unreadable } = jcodeExtraMcpServers(cwd, probe.home);
|
|
191
|
+
const { allowed, refused } = splitJcodeMcpServers(servers, probe.allow ?? []);
|
|
192
|
+
row(refused.length || unreadable.length ? false : true, probe.name,
|
|
193
|
+
[refused.length ? `${refused.length} besides the hub's own would load in the hub-owned jcode and are not allowed (${refused.join(", ")}); jcode has no switch to choose them, so remove them from its config, use another JCODE_HOME, or accept them by name in jcode_mcp_allow in .agenthub/config.local.json` : "",
|
|
194
|
+
allowed.length ? `allowed by the person: ${allowed.join(", ")}` : "",
|
|
195
|
+
unreadable.length ? `unreadable or unsafe, not listed: ${unreadable.join(", ")}` : ""].filter(Boolean).join("; ") || "none besides the hub's own");
|
|
196
|
+
} else {
|
|
197
|
+
const verdict = assessVersion(probe.compat, COMPAT[probe.compat].parse(version(probe.command[0]!) ?? ""));
|
|
198
|
+
row(verdict.ok ? verdict.state === "verified" || undefined : false, probe.name, verdict.ok ? verdict.note ?? probe.confirmed : `${probe.unconfirmed}: ${verdict.reason}`);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
// #691: one line for each installed gated CLI that is not on a verified version.
|
|
202
|
+
for (const agent of agentVersions(configuredCommands(config))) {
|
|
203
|
+
if (agent.executable && !(agent.verdict.ok && agent.verdict.state === "verified")) row(agent.verdict.ok ? undefined : false, `${agent.id} version`, agent.verdict.ok ? agent.verdict.note ?? agent.verdict.state : agent.verdict.reason);
|
|
204
|
+
}
|
|
205
|
+
// #1808 T4: when Orca is installed, a read-only shape check of the answers the upgrade recovery reads (names and types, never a value); it never refuses anything.
|
|
206
|
+
const orca = Bun.which(orcaExecutable());
|
|
207
|
+
if (orca) { const found = orcaDoctorRow(await readOrcaProbe(orcaProbeRunner(orca))); row(found.ok, found.name, found.detail); }
|
|
208
|
+
// #1809 AC6: a pull kind written from a preset needs the hub's bridge registered in that CLI; the check reads that CLI's settings file and never writes it.
|
|
209
|
+
for (const pull of pullRegistrationChecks(config.adapters, homedir())) row(pull.state === "present" ? true : pull.state === "missing" ? false : undefined, `${pull.kind} bridge registration`, pull.state === "present" ? "the hub's bridge is registered" : pull.state === "missing" ? `not registered in ${pull.preset}'s settings; run this yourself: ${pull.command}` : "the settings file could not be read");
|
|
210
|
+
const omni = new OmniRoute(config.omniroute);
|
|
211
|
+
const gateway = await omni.base();
|
|
212
|
+
row(gateway ? true : config.omniroute.urls.length || process.env.AGENTHUB_OMNIROUTE_URL ? false : undefined, "omniroute", gateway ? `${new URL(gateway).host} healthy` : config.omniroute.urls.length || process.env.AGENTHUB_OMNIROUTE_URL ? "no candidate reachable (VPN off?); ahub local cannot run" : "not configured: set omniroute.urls in .agenthub/config.local.json (any OpenAI-compatible gateway); ahub local cannot run");
|
|
213
|
+
row(!!omni.apiKey(), "omniroute key", omni.apiKey() ? "present" : "missing: set OMNIROUTE_API_KEY or omniroute.api_key_file in .agenthub/config.local.json");
|
|
214
|
+
if (!routing) {
|
|
215
|
+
row(undefined, "routing models", "routing could not be read");
|
|
216
|
+
} else if (gateway && omni.apiKey()) {
|
|
217
|
+
try {
|
|
218
|
+
const aliases = new Set([routing.local.fixed_model, ...Object.values(routing.classes).flatMap(policy => policy.fixed_model ? [policy.fixed_model] : []),
|
|
219
|
+
...Object.values(routing.hub_routes ?? {}).flatMap(route => [route.efficient ?? "fast", route.capable ?? "coding", ...(route.judge ? [route.judge] : [])])]);
|
|
220
|
+
const served = new Set(await omni.models());
|
|
221
|
+
const missing = [...aliases].filter(alias => !served.has(alias)).sort();
|
|
222
|
+
for (const alias of missing) row(false, "routing model", `${alias} is not served by the gateway`);
|
|
223
|
+
if (!missing.length) row(true, "routing models", `all ${aliases.size} routing aliases are served`);
|
|
224
|
+
} catch { row(undefined, "routing models", "could not read the gateway model inventory"); }
|
|
225
|
+
} else row(undefined, "routing models", "gateway model inventory unavailable");
|
|
226
|
+
const mlxConfig = config.mlx;
|
|
227
|
+
if (mlxConfig.enabled === false) row(true, "pi mlx", "disabled (mlx.enabled=false; local endpoint not probed)");
|
|
228
|
+
else {
|
|
229
|
+
const mlx = await inspectMlx({ ...mlxConfig, runtimeDir: mlxConfig.runtimeDir ? resolve(cwd, mlxConfig.runtimeDir) : undefined, modelPath: mlxConfig.modelPath ? resolve(cwd, mlxConfig.modelPath) : undefined });
|
|
230
|
+
row(mlx.state === "ready" || mlx.state === "stopped", "pi mlx", `${mlx.state}${mlx.model ? ` (${mlx.model})` : ""}${mlx.lastError ? `: ${mlx.lastError}` : ""}`);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
const memoryLibraryReady = AGENT_MEM_REFUSAL === undefined;
|
|
234
|
+
row(memoryLibraryReady, "memory library", memoryLibraryReady ? `amem ${AGENT_MEM_VERSION}; in-process, no claude-mem worker` : AGENT_MEM_REFUSAL!);
|
|
235
|
+
// #1008: memory capture is agent-mem's own setup state, read as structured data (`amem setup <tool> --json`, a preview that writes nothing), never dotfiles text. The caller's
|
|
236
|
+
// identity is NOT scrubbed: agent-mem screens a plan for an agent, and a refusal reads as unknown here instead of being laundered into a person's answer.
|
|
237
|
+
for (const tool of DOCTOR_MEMORY_CAPTURE_PEERS) {
|
|
238
|
+
const found = nativeMemoryCaptureRow(tool, readMemorySetup(tool));
|
|
239
|
+
row(found.ok, `memory capture: ${tool}`, found.detail);
|
|
240
|
+
}
|
|
241
|
+
} finally {
|
|
242
|
+
// Preserve findings already collected if a later probe (for example config parsing) throws.
|
|
243
|
+
if (options.json) console.log(JSON.stringify(checks, null, 2));
|
|
244
|
+
else printOutput(renderDoctor(checks, options.columns, Date.now(), options.full, asciiMarkers(process.env, args.includes("--ascii"))), options.color);
|
|
245
|
+
// CLI output standard v1: a check command exits 1 when any row is a failure (warnings and unknowns change nothing), `--json` included; the document is unchanged.
|
|
246
|
+
// `ahub setup` prints the same report but keeps its own exit code (`doctorSetsExit` is cleared there).
|
|
247
|
+
if (doctorSetsExit && checks.some(check => check.level === "fail")) process.exitCode = 1;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
import { readEvents } from "../../hub/events.ts";
|
|
3
|
+
import type { CommandContext } from "../command-context.ts";
|
|
4
|
+
|
|
5
|
+
export async function run(context: CommandContext) {
|
|
6
|
+
const { connect, identity, operationalIncomplete, since, stateDir } = context;
|
|
7
|
+
const fail: CommandContext["fail"] = context.fail;
|
|
8
|
+
if(identity.role==="tools") {
|
|
9
|
+
const hub=await connect();
|
|
10
|
+
try {const result=await hub.request({t:"conductor_operational",op:"export",since:since()});if(result.ok!==true)fail(String(result.error??"operational export unavailable"),result.refusalAudited===true,result.authorityRefused);for(const row of result.events??[])console.log(JSON.stringify(row));operationalIncomplete(result,"event");}
|
|
11
|
+
finally {hub.close();}
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
for (const e of readEvents(join(stateDir, "events.jsonl"), since())) console.log(JSON.stringify(e));
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { claudePeer as defaultChannelPeer } from "../../hub/claude-state.ts";
|
|
2
|
+
import { factsHook } from "../facts-hook.ts";
|
|
3
|
+
import type { CommandContext } from "../command-context.ts";
|
|
4
|
+
|
|
5
|
+
export async function run(context: CommandContext) {
|
|
6
|
+
const { args, stateDir } = context;
|
|
7
|
+
const fail: CommandContext["fail"] = context.fail;
|
|
8
|
+
if (!args.includes("--hook")) return fail("usage: ahub facts --hook (a Claude Code PreToolUse, PostToolUse and Stop hook)");
|
|
9
|
+
try {
|
|
10
|
+
const out = await factsHook(await Bun.stdin.text(), stateDir, process.env.AGENTHUB_PEER_ID ?? defaultChannelPeer(undefined));
|
|
11
|
+
if (out) console.log(out);
|
|
12
|
+
} catch {
|
|
13
|
+
// a hook that fails must not get in the way of the tool call
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { unknownOption, unknownOptionRefusal } from "../free-text.ts";
|
|
2
|
+
import { goalCommand } from "../memory.ts";
|
|
3
|
+
import { subcommandUsage } from "../help.ts";
|
|
4
|
+
import type { CommandContext } from "../command-context.ts";
|
|
5
|
+
|
|
6
|
+
export async function run(context: CommandContext) {
|
|
7
|
+
const { GOAL_NEW_FLAGS, GOAL_NEW_VALUE_FLAGS, args, caller, connect, cwd } = context;
|
|
8
|
+
const fail: CommandContext["fail"] = context.fail;
|
|
9
|
+
// #258: long-term tasks; a link goes through the project's hub, so Tasks validates the board task.
|
|
10
|
+
const link = async (goal: string, task: string) => {
|
|
11
|
+
const hub = await connect();
|
|
12
|
+
try { const r = await hub.request({ t: "goal_link", goal, task: Number(task) }); if (!r.ok) throw new Error(String(r.error)); return String(r.text); }
|
|
13
|
+
finally { hub.close(); }
|
|
14
|
+
};
|
|
15
|
+
// #1433: `goal new` takes its title from the words the flags leave, so `--help` or a mistyped flag would become the goal's title: refuse it before anything is written.
|
|
16
|
+
if (args[0] === "new") {
|
|
17
|
+
const titleWords = args.slice(1).filter((word, index, all) => !GOAL_NEW_FLAGS.includes(word) && !GOAL_NEW_VALUE_FLAGS.includes(all[index - 1] ?? ""));
|
|
18
|
+
const stray = unknownOption(titleWords);
|
|
19
|
+
if (stray) return fail(unknownOptionRefusal(stray, "ahub goal new", subcommandUsage("goal", "new")));
|
|
20
|
+
}
|
|
21
|
+
try { console.log(await goalCommand(args, cwd, { link, person: caller.role === "console" })); } catch (e) { fail((e as Error).message); }
|
|
22
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { terminalText } from "../console-state.ts";
|
|
2
|
+
import { closeSync, constants, fstatSync, openSync, readSync } from "node:fs";
|
|
3
|
+
import { resolve } from "node:path";
|
|
4
|
+
import { guidanceProbeUsage } from "../help.ts";
|
|
5
|
+
import type { CommandContext } from "../command-context.ts";
|
|
6
|
+
|
|
7
|
+
export async function run(context: CommandContext) {
|
|
8
|
+
const { args, connect, invokedFrom, liveTest } = context;
|
|
9
|
+
const fail: CommandContext["fail"] = context.fail;
|
|
10
|
+
const { parseGuidanceCommand, validateGuidancePageReply, validateGuidanceDiffReply, validateGuidanceReceipt, renderGuidance, renderGuidanceReceipt } = await import("../guidance.ts");
|
|
11
|
+
const { parseGuidanceVariantV1, GUIDANCE_RECORD_MAX_BYTES } = await import("../../hub/guidance-variants.ts");
|
|
12
|
+
const { parseGuidanceProbeSubcommand, parseGuidanceProbeRegistration, GUIDANCE_PROBE_REGISTRATION_BYTES,
|
|
13
|
+
parseGuidanceProbePublicReceipt, parseGuidanceProbePublicStatus, parseGuidanceProbeReceiptExport, GUIDANCE_PROBE_LIVE_LIMITS, GUIDANCE_PROBE_STOP_TIMEOUT_MS } = await import("../../hub/guidance-probes.ts");
|
|
14
|
+
const { guidanceProbeStatusLines } = await import("../../ui/guidance-view.ts");
|
|
15
|
+
let probeCommand;
|
|
16
|
+
try { probeCommand = parseGuidanceProbeSubcommand(args); } catch { return fail(guidanceProbeUsage(args)); }
|
|
17
|
+
if (probeCommand) {
|
|
18
|
+
if (liveTest) return fail("live-test cannot perform guidance probe operations as the person; use a current person or configured conductor session");
|
|
19
|
+
let registration: ReturnType<typeof parseGuidanceProbeRegistration> | undefined;
|
|
20
|
+
if (probeCommand.op === "register") {
|
|
21
|
+
try {
|
|
22
|
+
const fd = openSync(resolve(invokedFrom, probeCommand.file), constants.O_RDONLY | constants.O_NOFOLLOW | constants.O_NONBLOCK);
|
|
23
|
+
try {
|
|
24
|
+
if (!fstatSync(fd).isFile()) return fail("the guidance probe file must be a bounded regular JSON file");
|
|
25
|
+
const bytes = Buffer.alloc(GUIDANCE_PROBE_REGISTRATION_BYTES + 1); let got = 0;
|
|
26
|
+
while (got < bytes.length) { const read = readSync(fd, bytes, got, bytes.length - got, null); if (!read) break; got += read; }
|
|
27
|
+
if (got > GUIDANCE_PROBE_REGISTRATION_BYTES) return fail("the guidance probe registration exceeds its derived envelope bound");
|
|
28
|
+
registration = parseGuidanceProbeRegistration(JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes.subarray(0, got))));
|
|
29
|
+
if (!registration) return fail("invalid guidance probe registration; retain its complete bounded manifest and snapshots without trimming");
|
|
30
|
+
} finally { closeSync(fd); }
|
|
31
|
+
} catch { return fail("cannot read a valid bounded guidance probe registration; check its closed V1 manifest and snapshots"); }
|
|
32
|
+
}
|
|
33
|
+
const hub = await connect();
|
|
34
|
+
try {
|
|
35
|
+
if (!hub.features.includes("guidance_probes")) return fail("running hub lacks guidance_probes; upgrade and restart the hub, then retry ahub guidance");
|
|
36
|
+
if (probeCommand.op === "receipts" && !hub.features.includes("guidance_probe_receipts")) return fail("running hub lacks guidance_probe_receipts; upgrade and restart the hub, then retry ahub guidance probe receipts");
|
|
37
|
+
const request = probeCommand.op === "register" ? { t: "guidance_probe_register", registration: registration! }
|
|
38
|
+
: probeCommand.op === "start" ? { t: "guidance_probe_start", id: probeCommand.id, revision: probeCommand.revision, ...(probeCommand.variantId ? { variantId: probeCommand.variantId } : {}) }
|
|
39
|
+
: probeCommand.op === "cancel" ? { t: "guidance_probe_cancel", id: probeCommand.id, revision: probeCommand.revision }
|
|
40
|
+
: probeCommand.op === "receipts" ? { t: "guidance_probe_receipts", id: probeCommand.id }
|
|
41
|
+
: { t: "guidance_probe_show", id: probeCommand.id };
|
|
42
|
+
const result = await hub.request(request, probeCommand.op === "start" ? GUIDANCE_PROBE_LIVE_LIMITS.elapsedMs + GUIDANCE_PROBE_STOP_TIMEOUT_MS : undefined);
|
|
43
|
+
if (result.ok !== true) {
|
|
44
|
+
const detail = terminalText(result.error ?? "guidance probe outcome is unconfirmed").replace(/[\r\n]+/g, " ").slice(0, 512);
|
|
45
|
+
const nextStep = probeCommand.op === "register" ? "" : `; inspect ahub guidance probe show --id ${probeCommand.id} before any explicit retry`;
|
|
46
|
+
return fail(`${detail}${nextStep}`);
|
|
47
|
+
}
|
|
48
|
+
if (probeCommand.op === "receipts") {
|
|
49
|
+
const exported = parseGuidanceProbeReceiptExport(result.receipts);
|
|
50
|
+
if (!exported) return fail("guidance probe receipts are malformed or fail their digest check; inspect retained probe state before relying on them");
|
|
51
|
+
if (args.includes("--json")) console.log(JSON.stringify(exported, null, 2));
|
|
52
|
+
else for (const line of guidanceProbeStatusLines(exported)) console.log(terminalText(line));
|
|
53
|
+
} else if (probeCommand.op === "show") {
|
|
54
|
+
const status = parseGuidanceProbePublicStatus(result.status);
|
|
55
|
+
if (!status) return fail("guidance probe status is malformed; refresh its id and current task context");
|
|
56
|
+
if (args.includes("--json")) console.log(JSON.stringify(status, null, 2));
|
|
57
|
+
else console.log(`guidance probe ${status.id}: ${status.state}; revision ${status.revision}; evidence ${status.evidence}; workers ${status.counters.workerAttempts}; editors ${status.counters.editorAttempts}; model calls ${status.counters.modelCalls}; tool calls ${status.counters.toolCalls}; token usage ${status.counters.usageUnknown || status.counters.modelCalls === 0 ? "unknown" : status.counters.tokensObservedKnown}; cancelled ${status.cancelRequested ? "yes" : "no"}`);
|
|
58
|
+
} else {
|
|
59
|
+
const receipt = parseGuidanceProbePublicReceipt(result.receipt);
|
|
60
|
+
if (!receipt) return fail("guidance probe receipt is malformed; inspect retained probe state before retrying");
|
|
61
|
+
if (args.includes("--json")) console.log(JSON.stringify(receipt, null, 2));
|
|
62
|
+
else console.log(`guidance probe ${receipt.id}: ${receipt.state}; revision ${receipt.revision}; evidence ${receipt.evidence}${receipt.already ? "; already recorded" : ""}`);
|
|
63
|
+
}
|
|
64
|
+
} finally { hub.close(); }
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
let command; try { command = parseGuidanceCommand(args); } catch (error) { return fail((error as Error).message); }
|
|
68
|
+
if (liveTest && (command.op === "create" || command.op === "withdraw")) return fail("live-test cannot write guidance declarations as the person; use the current task actor without --live-test");
|
|
69
|
+
let variant: ReturnType<typeof parseGuidanceVariantV1> | undefined;
|
|
70
|
+
if (command.op === "create") {
|
|
71
|
+
try {
|
|
72
|
+
const fd = openSync(resolve(invokedFrom, command.file), constants.O_RDONLY | constants.O_NOFOLLOW | constants.O_NONBLOCK);
|
|
73
|
+
try {
|
|
74
|
+
if (!fstatSync(fd).isFile()) return fail("the guidance file must be a bounded regular JSON file");
|
|
75
|
+
const bytes = Buffer.alloc(GUIDANCE_RECORD_MAX_BYTES + 1); let got = 0;
|
|
76
|
+
while (got < bytes.length) { const read = readSync(fd, bytes, got, bytes.length - got, null); if (!read) break; got += read; }
|
|
77
|
+
if (got > GUIDANCE_RECORD_MAX_BYTES) return fail("the guidance file exceeds the 32 KiB input bound");
|
|
78
|
+
variant = parseGuidanceVariantV1(JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes.subarray(0, got))));
|
|
79
|
+
} finally { closeSync(fd); }
|
|
80
|
+
} catch { return fail("cannot read a valid bounded GuidanceVariantV1 file; check its shape, content id and protected role bytes"); }
|
|
81
|
+
}
|
|
82
|
+
const hub = await connect();
|
|
83
|
+
try {
|
|
84
|
+
if (!hub.features.includes("guidance_views")) return fail("running hub lacks guidance_views; upgrade and restart the hub and refresh the client plugin, then retry ahub guidance");
|
|
85
|
+
const { op, json, ...fields } = command;
|
|
86
|
+
const message = op === "create" ? { variant } : fields;
|
|
87
|
+
const result = await hub.request({ t: `guidance_${op}`, ...message });
|
|
88
|
+
if (result.ok !== true) return fail(`${terminalText(result.error ?? "guidance request is unconfirmed").replace(/[\r\n]+/g, " ").slice(0, 512)}; inspect ahub guidance list for the task before explicitly retrying a write`, result.refusalAudited === true, result.authorityRefused);
|
|
89
|
+
const options = { json };
|
|
90
|
+
if (command.op === "create" || command.op === "withdraw") {
|
|
91
|
+
let receipt;
|
|
92
|
+
try { receipt = validateGuidanceReceipt(result.receipt, command.op === "create" ? { id: variant!.id, taskId: variant!.taskId } : { id: command.id, taskId: command.taskId, status: "withdrawn" }); }
|
|
93
|
+
catch (error) { return fail((error as Error).message); }
|
|
94
|
+
if (options.json) console.log(JSON.stringify(receipt, null, 2)); else console.log(renderGuidanceReceipt(receipt).join("\n"));
|
|
95
|
+
} else {
|
|
96
|
+
let page;
|
|
97
|
+
try { page = command.op === "list" ? validateGuidancePageReply(result.guidance, command) : validateGuidanceDiffReply(result.guidance, command); }
|
|
98
|
+
catch { return fail("guidance reply is unavailable or malformed; refresh the task scope and upgrade the hub/client before retrying"); }
|
|
99
|
+
if (options.json) console.log(JSON.stringify(page, null, 2)); else console.log(renderGuidance(page).join("\n"));
|
|
100
|
+
}
|
|
101
|
+
} finally { hub.close(); }
|
|
102
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { isBuiltinAdapterKind } from "../../adapters/definitions/native-help.ts";
|
|
2
|
+
import { asciiMarkers, resolveColor, streamEnv } from "../console-state.ts";
|
|
3
|
+
import { renderHelp, configuredAcpHelp } from "../help.ts";
|
|
4
|
+
import type { CommandContext } from "../command-context.ts";
|
|
5
|
+
|
|
6
|
+
export function run(context: CommandContext) {
|
|
7
|
+
const { args, asksHelp, projectCatalog } = context;
|
|
8
|
+
const fail: CommandContext["fail"] = context.fail;
|
|
9
|
+
const color = resolveColor(undefined, streamEnv(!!process.stdout.isTTY), "ahub") === true;
|
|
10
|
+
const topic = asksHelp(args[0]) ? undefined : args[0];
|
|
11
|
+
const text = topic && !isBuiltinAdapterKind(topic) && projectCatalog.definitionOf(topic)?.start.daemonPort === "configured-print"
|
|
12
|
+
? `ahub ${topic} [--mode headless] [--print-command | --dry-run]\nConfigured print runs one sandboxed process per public advisory request. Declare it in untracked .agenthub/config.local.json, restart the hub, then enable roster.${topic}.`
|
|
13
|
+
: topic && !isBuiltinAdapterKind(topic) && projectCatalog.definitionOf(topic)?.permission.genericAcp !== undefined
|
|
14
|
+
? configuredAcpHelp(topic) : renderHelp(process.stdout.columns ?? 80, color, topic, undefined, asciiMarkers(process.env, args.includes("--ascii")));
|
|
15
|
+
if (!text) fail(`unknown command "${topic}"; run ahub help`);
|
|
16
|
+
console.log(text);
|
|
17
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { realPath } from "../../hub/project.ts";
|
|
2
|
+
import { launchHostedProject } from "../../hub/lifecycle.ts";
|
|
3
|
+
import { askHost, claimHostSocket, Host } from "../../hub/host.ts";
|
|
4
|
+
import { Registry } from "../../hub/registry.ts";
|
|
5
|
+
import { warnLine } from "../warn-line.ts";
|
|
6
|
+
import { resolve } from "node:path";
|
|
7
|
+
import type { CommandContext } from "../command-context.ts";
|
|
8
|
+
|
|
9
|
+
/** #1779 T3a: `ahub host --runtime <root> [--add-current] [--unattended]`, started by `ahub up` for a project with `host.shared`. Internal, like `ahub daemon`. */
|
|
10
|
+
export async function run({ args, registeredProject, unattendedEnv }: CommandContext) {
|
|
11
|
+
const at = args.indexOf("--runtime");
|
|
12
|
+
const runtimeArg = at >= 0 ? args[at + 1] : undefined;
|
|
13
|
+
if (!runtimeArg || runtimeArg.startsWith("--")) { warnLine("ahub host needs --runtime <root>"); process.exit(2); }
|
|
14
|
+
const runtimeRoot = realPath(resolve(runtimeArg));
|
|
15
|
+
// A host serves exactly the runtime it is running from: projects of another runtime belong to that runtime's host.
|
|
16
|
+
if (runtimeRoot !== realPath(resolve(import.meta.dir, "../../.."))) { warnLine("ahub host: --runtime is not the runtime this process runs from"); process.exit(2); }
|
|
17
|
+
const unattended = unattendedEnv || args.includes("--unattended");
|
|
18
|
+
const log = (line: string) => process.stderr.write(`${new Date().toISOString()} ${line}\n`);
|
|
19
|
+
const host = new Host({ log, launch: (project, options) => launchHostedProject(project, { ...options, env: process.env }) });
|
|
20
|
+
const registry = new Registry();
|
|
21
|
+
try {
|
|
22
|
+
const socket = await claimHostSocket(host, runtimeRoot, registry);
|
|
23
|
+
if (!socket.served) {
|
|
24
|
+
// Another host holds this runtime: join it while it answers, or fail closed and name the holder.
|
|
25
|
+
if (!args.includes("--add-current")) { warnLine(`another host (pid ${socket.holderPid}) already serves this runtime`, "stop it first, or add projects through ahub up"); process.exit(1); }
|
|
26
|
+
const project = registeredProject();
|
|
27
|
+
let reply = await askHost(runtimeRoot, { op: "add", project, unattended });
|
|
28
|
+
for (let attempt = 0; !reply && attempt < 20; attempt++) { await Bun.sleep(250); reply = await askHost(runtimeRoot, { op: "add", project, unattended }); }
|
|
29
|
+
if (!reply?.ok) {
|
|
30
|
+
warnLine(`the host of this runtime (pid ${socket.holderPid}) did not add the project: ${reply && !reply.ok ? reply.error : "no answer"}`, "wait for it to finish starting and run ahub up again, or stop that host");
|
|
31
|
+
process.exit(1);
|
|
32
|
+
}
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
host.install();
|
|
36
|
+
try {
|
|
37
|
+
if (args.includes("--add-current")) await host.add(registeredProject(), unattended);
|
|
38
|
+
} catch (error) {
|
|
39
|
+
warnLine(`host could not start its first project: ${(error as Error).message}`);
|
|
40
|
+
await host.stopAll();
|
|
41
|
+
}
|
|
42
|
+
await host.done;
|
|
43
|
+
socket.served.close();
|
|
44
|
+
} finally { registry.close(); }
|
|
45
|
+
}
|