@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
package/scripts/check-docs.mjs
CHANGED
|
@@ -142,7 +142,7 @@ if (process.env.AHUB_CHECK_ROADMAP === "1") {
|
|
|
142
142
|
if (!jsonOutput) for (const report of reports) console.log(`docs: ${report}`);
|
|
143
143
|
if (requireFresh && reports.length) errors.push("release requires fresh documentation stamps");
|
|
144
144
|
if (requireFresh && errors.length) errors.push("release refused: merge the release PR with a merge commit and verify all documentation stamps before tagging");
|
|
145
|
-
if (jsonOutput) console.log(JSON.stringify({ schemaVersion: 1, ...(headId ? { head: headId } : {}), ...(packageVersion ? { version: packageVersion } : {}), documents, errors: errors.length, fresh: !errors.length && !reports.length }));
|
|
145
|
+
if (jsonOutput) console.log(JSON.stringify({ schemaVersion: 1, ...(headId ? { head: headId } : {}), ...(packageVersion ? { version: packageVersion } : {}), documents, errors: errors.length, fresh: !errors.length && !reports.length, ...(committed && errors.length ? { messages: errors.slice(0, 3).map(message => message.slice(0, 300)) } : {}) }));
|
|
146
146
|
else for (const error of errors) console.error(`docs: ERROR ${error}`);
|
|
147
147
|
if (errors.length) process.exitCode = 1;
|
|
148
148
|
else if (!jsonOutput) console.log(`docs: OK (${reports.length} stale document${reports.length === 1 ? "" : "s"})`);
|
package/src/adapters/acp.ts
CHANGED
|
@@ -567,7 +567,7 @@ export class AcpPeer extends BasePeer {
|
|
|
567
567
|
}
|
|
568
568
|
} catch (error) {
|
|
569
569
|
if (error instanceof RpcTimeoutError && current()) {
|
|
570
|
-
if (this.activeDeliveryId) this.delivery({ id: this.activeDeliveryId, state: "failed_safe", reason: "ACP model acknowledgement timed out before a prompt was sent; restart this peer before retrying" });
|
|
570
|
+
if (this.activeDeliveryId) this.delivery({ id: this.activeDeliveryId, state: "failed_safe", reason: "ACP model acknowledgement timed out before a prompt was sent; restart this peer before retrying", failureCause: "timeout" });
|
|
571
571
|
this.activeDeliveryId = undefined; this.activeLegacy = undefined;
|
|
572
572
|
this.modelUnknown = true; this.turn++; this.setState("offline");
|
|
573
573
|
await this.stop();
|
|
@@ -646,7 +646,7 @@ export class AcpPeer extends BasePeer {
|
|
|
646
646
|
// invalidates its generation, while stopping still prevents a drain.
|
|
647
647
|
if (legacy?.turn === this.turn) this.onFailed?.(legacy.envs);
|
|
648
648
|
if (reason !== undefined) this.turn++; // a requested stop cannot escalate or complete the cancelled turn
|
|
649
|
-
if (this.activeDeliveryId) this.delivery({ id: this.activeDeliveryId, state: "needs_review", reason: reason ?? "ACP session stopped before settlement" });
|
|
649
|
+
if (this.activeDeliveryId) this.delivery({ id: this.activeDeliveryId, state: "needs_review", reason: reason ?? "ACP session stopped before settlement", failureCause: "turn aborted" });
|
|
650
650
|
this.settleSteers("needs_review", reason ?? "ACP session stopped before settlement");
|
|
651
651
|
this.activeDeliveryId = undefined;
|
|
652
652
|
const proc = this.proc;
|
|
@@ -669,19 +669,19 @@ export class AcpPeer extends BasePeer {
|
|
|
669
669
|
/** Resolves once the prompt is in flight; the turn result arrives on its own. */
|
|
670
670
|
async deliver(envs: Envelope[], deliveryId?: string): Promise<void> {
|
|
671
671
|
if (this.state !== "idle" || this.stopping) {
|
|
672
|
-
if (deliveryId) this.delivery({ id: deliveryId, state: "failed_safe", reason: `${this.id} is ${this.state}
|
|
672
|
+
if (deliveryId) this.delivery({ id: deliveryId, state: "failed_safe", reason: `${this.id} is ${this.state}`, failureCause: this.state === "offline" ? "peer offline" : "adapter refused" });
|
|
673
673
|
throw new Error(`${this.id} is ${this.state}`);
|
|
674
674
|
}
|
|
675
675
|
let selection: ModelOverrideSelection | undefined;
|
|
676
676
|
try { selection = this.opts.getModelOverride?.(); }
|
|
677
677
|
catch {
|
|
678
|
-
if (deliveryId) this.delivery({ id: deliveryId, state: "failed_safe", reason: "ACP retained model selection is unavailable; inspect model status, clear the override or restart before retrying" });
|
|
678
|
+
if (deliveryId) this.delivery({ id: deliveryId, state: "failed_safe", reason: "ACP retained model selection is unavailable; inspect model status, clear the override or restart before retrying", failureCause: "adapter refused" });
|
|
679
679
|
throw new Error("ACP retained model selection is unavailable; inspect model status, clear the override or restart before retrying");
|
|
680
680
|
}
|
|
681
681
|
const target = selection?.model ?? this.modelBaseline;
|
|
682
682
|
if (selection && (!target || !this.acceptsModelOverride(target))) {
|
|
683
683
|
selection.rejected?.();
|
|
684
|
-
if (deliveryId) this.delivery({ id: deliveryId, state: "failed_safe", reason: "ACP model is not advertised by this verified session; inspect model status and retry" });
|
|
684
|
+
if (deliveryId) this.delivery({ id: deliveryId, state: "failed_safe", reason: "ACP model is not advertised by this verified session; inspect model status and retry", failureCause: "adapter refused" });
|
|
685
685
|
throw new Error("ACP model is not advertised by this verified session; inspect model status and retry");
|
|
686
686
|
}
|
|
687
687
|
const turn = ++this.turn;
|
|
@@ -709,7 +709,7 @@ export class AcpPeer extends BasePeer {
|
|
|
709
709
|
catch (error) {
|
|
710
710
|
if (turn === this.turn && !this.modelTurn?.sent) {
|
|
711
711
|
selection.rejected?.();
|
|
712
|
-
if (deliveryId && this.activeDeliveryId === deliveryId) this.delivery({ id: deliveryId, state: "failed_safe", reason: "ACP model change did not admit a prompt; inspect status and retry" });
|
|
712
|
+
if (deliveryId && this.activeDeliveryId === deliveryId) this.delivery({ id: deliveryId, state: "failed_safe", reason: "ACP model change did not admit a prompt; inspect status and retry", failureCause: "adapter refused" });
|
|
713
713
|
this.activeDeliveryId = undefined; this.activeLegacy = undefined; this.modelTurn = undefined;
|
|
714
714
|
this.endActivity("model change refused", true);
|
|
715
715
|
if (!this.stopping && (this.state as PeerState) === "busy") this.setState("idle");
|
|
@@ -744,9 +744,9 @@ export class AcpPeer extends BasePeer {
|
|
|
744
744
|
if (result?.stopReason !== "end_turn") this.reportTurnFailure(envs, `ACP prompt ended without normal completion (${String(result?.stopReason ?? "unknown")})`);
|
|
745
745
|
if (deliveryId && this.activeDeliveryId === deliveryId) {
|
|
746
746
|
this.acceptDelivery();
|
|
747
|
-
this.delivery({ id: deliveryId, state: result?.stopReason === "end_turn" ? "completed" : "needs_review", ...(result?.stopReason === "end_turn" ? {} : { reason: "ACP prompt ended without normal completion" }) });
|
|
747
|
+
this.delivery({ id: deliveryId, state: result?.stopReason === "end_turn" ? "completed" : "needs_review", ...(result?.stopReason === "end_turn" ? {} : { reason: "ACP prompt ended without normal completion", failureCause: "turn aborted" as const }) });
|
|
748
748
|
}
|
|
749
|
-
this.settleSteers(result?.stopReason === "end_turn" ? "completed" : "needs_review", "ACP prompt ended without normal completion");
|
|
749
|
+
this.settleSteers(result?.stopReason === "end_turn" ? "completed" : "needs_review", "ACP prompt ended without normal completion", "turn aborted");
|
|
750
750
|
})
|
|
751
751
|
.catch((e: Error) => {
|
|
752
752
|
if (turn !== this.turn) {
|
|
@@ -756,7 +756,7 @@ export class AcpPeer extends BasePeer {
|
|
|
756
756
|
if (!this.modelTurn?.acknowledged) this.modelTurn?.selection.rejected?.();
|
|
757
757
|
this.endActivity("failed", true);
|
|
758
758
|
const reason = this.nativePolicy !== undefined || this.opts.requireOwnedGroup ? "Configured ACP prompt failed" : sanitize(e.message);
|
|
759
|
-
this.settleSteers("needs_review", reason);
|
|
759
|
+
this.settleSteers("needs_review", reason, "push error");
|
|
760
760
|
this.opts.log?.(this.nativePolicy !== undefined || this.opts.requireOwnedGroup ? "Configured ACP prompt failed; native details withheld" : `[${this.id}] prompt failed: ${reason}`);
|
|
761
761
|
const quota = !this.stopping && this.kimiAgent ? acpQuotaRefusal(e.message) : undefined;
|
|
762
762
|
if (quota) {
|
|
@@ -764,12 +764,12 @@ export class AcpPeer extends BasePeer {
|
|
|
764
764
|
try { paused = this.opts.onQuotaRefusal?.(quota) === true; }
|
|
765
765
|
catch (error) { this.opts.log?.(`[${this.id}] quota pause failed: ${sanitize(error instanceof Error ? error.message : String(error))}`); }
|
|
766
766
|
const safe = paused && !this.deliveryAccepted && !this.promptActivity;
|
|
767
|
-
if (deliveryId && this.activeDeliveryId === deliveryId) this.delivery({ id: deliveryId, state: safe ? "failed_safe" : "needs_review", reason, ...(safe ? { quota: true as const } : {}) });
|
|
767
|
+
if (deliveryId && this.activeDeliveryId === deliveryId) this.delivery({ id: deliveryId, state: safe ? "failed_safe" : "needs_review", reason, failureCause: safe ? "adapter refused" : "push error", ...(safe ? { quota: true as const } : {}) });
|
|
768
768
|
else if (!deliveryId && this.activeLegacy?.turn === turn) { this.activeLegacy = undefined; this.onFailed?.(envs, safe ? { quota: true } : undefined); }
|
|
769
769
|
return; // quota relay owns reassignment, not the ordinary turn-failure path
|
|
770
770
|
}
|
|
771
771
|
this.reportTurnFailure(envs, reason);
|
|
772
|
-
if (deliveryId && this.activeDeliveryId === deliveryId) this.delivery({ id: deliveryId, state: "needs_review", reason });
|
|
772
|
+
if (deliveryId && this.activeDeliveryId === deliveryId) this.delivery({ id: deliveryId, state: "needs_review", reason, failureCause: "push error" });
|
|
773
773
|
else if (!deliveryId && this.activeLegacy?.turn === turn) { this.activeLegacy = undefined; this.onFailed?.(envs); }
|
|
774
774
|
})
|
|
775
775
|
.finally(() => {
|
|
@@ -890,8 +890,8 @@ export class AcpPeer extends BasePeer {
|
|
|
890
890
|
this.opts.log?.(`[${this.id}] ${reason}`);
|
|
891
891
|
for (const p of this.pending.values()) p.reject(new Error(reason));
|
|
892
892
|
this.pending.clear();
|
|
893
|
-
if (this.activeDeliveryId) this.delivery({ id: this.activeDeliveryId, state: "needs_review", reason });
|
|
894
|
-
this.settleSteers("needs_review", reason);
|
|
893
|
+
if (this.activeDeliveryId) this.delivery({ id: this.activeDeliveryId, state: "needs_review", reason, failureCause: "push error" });
|
|
894
|
+
this.settleSteers("needs_review", reason, "push error");
|
|
895
895
|
this.activeDeliveryId = undefined;
|
|
896
896
|
this.setState("offline");
|
|
897
897
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { NATIVE_ROUTING_POLICY, NATIVE_ADAPTER_POLICY } from "../definitions/native-adapter-policy.ts";
|
|
1
2
|
import { runAgyEntry } from "./entry.ts";
|
|
2
3
|
import type { AdapterDefinition, LaunchContext, LaunchPlan } from "../registry-types.ts";
|
|
3
4
|
import { AGY_REVIEWER_VARIANT } from "../definitions/reviewer-variants.ts";
|
|
4
|
-
import {
|
|
5
|
+
import { NATIVE_FACTS_HOOKS } from "../native-facts-hooks.ts";
|
|
5
6
|
|
|
6
7
|
const DISPLAY = { palette: { fg: "#6558a6", bg: "#f1effa" } };
|
|
7
8
|
const shellQuote = (value: string): string => `'${value.replace(/'/g, `'\\''`)}'`;
|
|
@@ -14,37 +15,19 @@ function agyLaunch(ctx: LaunchContext): LaunchPlan {
|
|
|
14
15
|
|
|
15
16
|
/** Antigravity is an unmanaged, pull-only peer attached from its native project plugin. */
|
|
16
17
|
export const AGY_DEFINITION: AdapterDefinition = {
|
|
17
|
-
|
|
18
|
-
kind: "agy",
|
|
19
|
-
projection: { roleRank: 7, helpRank: 4, plannerEligible: false, conductorEligible: false, reviewerEligible: false },
|
|
20
|
-
displayName: "Antigravity",
|
|
21
|
-
family: "agy",
|
|
22
|
-
transport: "ws-pull",
|
|
23
|
-
roles: ["implementer", "verifier"],
|
|
24
|
-
optional: true,
|
|
25
|
-
defaultOnRoster: false,
|
|
26
|
-
trust: { onPrem: false, hubSandboxed: false },
|
|
18
|
+
...NATIVE_ADAPTER_POLICY.agy.metadata,
|
|
27
19
|
start: {
|
|
28
|
-
|
|
29
|
-
defaultForm: "tui",
|
|
20
|
+
...NATIVE_ADAPTER_POLICY.agy.start,
|
|
30
21
|
launch: agyLaunch,
|
|
31
|
-
conductorStartable: false,
|
|
32
|
-
hubSwitches: [],
|
|
33
|
-
ownedFlags: ["--new", "--continue", "--conversation", "--resume"],
|
|
34
22
|
conductorStartArgs: args => args.length ? new Error("conductor starts accept no launch overrides; use ahub agy") : {},
|
|
35
23
|
},
|
|
36
|
-
|
|
24
|
+
|
|
37
25
|
attach: { externalHello: true,
|
|
38
26
|
pullOnlyForms: ["tui"],
|
|
39
27
|
recoveryLaunch: instance => ({ kind: "agy", peer: instance }),
|
|
40
28
|
pullOnlyNotice: "pull-only: messages wait for hub_inbox; permission modes and session recovery are not managed",
|
|
41
29
|
},
|
|
42
|
-
|
|
43
|
-
unmanaged: "Antigravity selects its own permission mode in its TUI; no hub permission mode",
|
|
44
|
-
unmanagedForms: ["tui"],
|
|
45
|
-
unmanagedNote: "Antigravity approves tools in its own TUI; no hub permission mode",
|
|
46
|
-
unmanagedStatusNote: "unmanaged native permission policy",
|
|
47
|
-
},
|
|
30
|
+
|
|
48
31
|
session: {
|
|
49
32
|
idField: "sessionId",
|
|
50
33
|
currentId: () => undefined,
|
|
@@ -52,10 +35,10 @@ export const AGY_DEFINITION: AdapterDefinition = {
|
|
|
52
35
|
recoveryRefusal: () => "Antigravity session continuity and resume are unavailable until native behavior is verified",
|
|
53
36
|
},
|
|
54
37
|
turnEnd: "native-hook",
|
|
55
|
-
cli: {
|
|
38
|
+
cli: { ...NATIVE_ADAPTER_POLICY.agy.cli, entry: { lifecycleAdmission: true, execute: runAgyEntry } },
|
|
56
39
|
display: DISPLAY,
|
|
57
|
-
routing:
|
|
40
|
+
routing: NATIVE_ROUTING_POLICY.agy,
|
|
58
41
|
reviewer: { defaultPool: false, declaration: "automatic", unavailable: "agy is an implementer peer (#485)" },
|
|
59
42
|
reviewerVariant: AGY_REVIEWER_VARIANT,
|
|
60
|
-
hooks: { factsHook:
|
|
43
|
+
hooks: { factsHook: NATIVE_FACTS_HOOKS.agy },
|
|
61
44
|
};
|
|
@@ -5,6 +5,7 @@ import { spawn, spawnSync } from "node:child_process";
|
|
|
5
5
|
import { dirname, resolve } from "node:path";
|
|
6
6
|
import type { NativeCliEntryContext } from "../definitions/native-cli-entry-types.ts";
|
|
7
7
|
import { bundleInStatus, rosterInStatus } from "../../hub/status-roster.ts";
|
|
8
|
+
import { printLaunchCheck } from "../../cli/launch-check.ts";
|
|
8
9
|
import { ensureAgyMcp, cleanupAgyMcp, type AgyMcpOptions } from "../../cli/agy-mcp.ts";
|
|
9
10
|
import { peerChildEnv } from "../../hub/child-process.ts";
|
|
10
11
|
|
|
@@ -68,6 +69,7 @@ export async function runAgyEntry(ctx: NativeCliEntryContext): Promise<void> {
|
|
|
68
69
|
if (!hub.features.includes("native_hook_launch")) fail("running hub lacks the verified native hook launcher; upgrade or restart it before launching agy");
|
|
69
70
|
const status = (await hub.request({ t: "status" })).status;
|
|
70
71
|
if (rosterInStatus(status, "agy") !== true) fail("agy is off roster; add it with ahub roster add agy");
|
|
72
|
+
printLaunchCheck(status, "agy", ctx.definition, "tui");
|
|
71
73
|
const admitted = await hub.request({ t: "native_hook_launch", op: "begin", peer: "agy" });
|
|
72
74
|
if (!admitted.ok || typeof admitted.launchId !== "string" || typeof admitted.instanceId !== "string") fail(admitted.error ?? "native hook launch was not admitted");
|
|
73
75
|
const serverJs = bundleInStatus(status) ?? resolve(cliDir, "../../plugins/agent-hub/server.js");
|
|
@@ -7,7 +7,7 @@ import type { ClaudeChannelEvidence } from "./claude-channel-evidence.ts";
|
|
|
7
7
|
/** Only the control socket operations the peer owns; authentication remains in the daemon. */
|
|
8
8
|
export interface ChannelSocket {
|
|
9
9
|
readyState: number;
|
|
10
|
-
data: { launchId?: string; claudeSessionId?: string; protocol?: number; standbyId?: string; retainStandby?: boolean; clientPid?: number; clientVersion?: string; channel?: boolean; channelEvidence?: ClaudeChannelEvidence; cwd?: string; peerGeneration?: string | number; detachedByPerson?: boolean };
|
|
10
|
+
data: { launchId?: string; claudeSessionId?: string; protocol?: number; standbyId?: string; retainStandby?: boolean; clientPid?: number; clientVersion?: string; channel?: boolean; channelEvidence?: ClaudeChannelEvidence; cwd?: string; peerGeneration?: string | number; detachedByPerson?: boolean; accountLabel?: string };
|
|
11
11
|
send(data: string): unknown;
|
|
12
12
|
close(code?: number, reason?: string): void;
|
|
13
13
|
}
|
|
@@ -224,6 +224,8 @@ export class WsPeer extends BasePeer {
|
|
|
224
224
|
if (!this.sock || !this.pullOnly) return;
|
|
225
225
|
this.sock.send(JSON.stringify({ t: "queued", queued: counts.queued, important: counts.important }));
|
|
226
226
|
}
|
|
227
|
+
/** #1810: the declared account label of the session that owns this peer, if it reported a declared home; never the path. */
|
|
228
|
+
get accountLabel(): string | undefined { return this.sock?.data.accountLabel; }
|
|
227
229
|
owns(sock: ChannelSocket): boolean { return this.sock === sock; }
|
|
228
230
|
ownsSocket(socket: object): boolean { return this.sock === socket; }
|
|
229
231
|
bindNativeSession(session: string): void {
|
|
@@ -11,14 +11,18 @@ const DISABLING = new Set(["-p", "--print", "--output-format", "--background", "
|
|
|
11
11
|
|
|
12
12
|
// ponytail: current native launches expose only a flattened direct-parent argv row; this does not prove registration or authenticate the host. Replace it with an explicit per-server client opt-in when Claude publishes one.
|
|
13
13
|
/** Classify a flattened `ps` command only when its leading argv tokens are unambiguous. */
|
|
14
|
-
export function classifyClaudeParentCommand(command: string): ClaudeChannelEvidence {
|
|
14
|
+
export function classifyClaudeParentCommand(command: string, rejectedArgument?: (position: number) => void): ClaudeChannelEvidence {
|
|
15
15
|
if (!command || command.length > 4096 || /[\n\r\0]/.test(command)) return "launch-unverified";
|
|
16
16
|
const argv = command.trim().split(/\s+/);
|
|
17
17
|
const executable = argv[0]?.split("/").at(-1);
|
|
18
|
-
|
|
18
|
+
const reject = (position: number): ClaudeChannelEvidence => { rejectedArgument?.(position); return "launch-unverified"; };
|
|
19
|
+
if (executable !== "claude") return reject(0);
|
|
20
|
+
if (argv[1] !== "--dangerously-load-development-channels") return reject(1);
|
|
21
|
+
if (argv.length < 3 || !TARGETS.has(argv[2]!)) return reject(2);
|
|
19
22
|
// The channel flag is ignored by print/background/daemon forms. A later repeated
|
|
20
23
|
// flag can change the selected channels, so those commands fail closed as well.
|
|
21
|
-
|
|
24
|
+
const rejected = argv.slice(3).findIndex(arg => DISABLING.has(arg) || arg.startsWith("--print=") || arg.startsWith("--output-format=") || arg.startsWith("-p") || arg === "--dangerously-load-development-channels" || arg.startsWith("--dangerously-load-development-channels="));
|
|
25
|
+
if (rejected >= 0) return reject(rejected + 3);
|
|
22
26
|
return "development-channel-launch";
|
|
23
27
|
}
|
|
24
28
|
|