@staix/agent-hub 0.51.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 +35 -0
- package/README.md +1 -1
- package/docs/adding-an-ai-tool.md +24 -2
- package/docs/agent-notes/adapters.md +1 -0
- package/docs/agent-notes/budget.md +8 -2
- package/docs/agent-notes/daemon.md +13 -8
- package/docs/agent-notes/security-review.md +6 -5
- package/docs/agent-notes/tasks.md +5 -2
- package/docs/agent-notes/tests.md +4 -3
- package/docs/cooperbench.md +1 -1
- package/docs/design/adapters.md +4 -0
- package/docs/design/cli-output-inventory.md +162 -152
- package/docs/design/cli-output.md +4 -3
- package/docs/design/guidance-probes.md +1 -0
- package/docs/design/roadmap.md +2 -0
- package/docs/design/task-board.md +1 -0
- package/docs/dogfood.md +14 -0
- package/docs/events.md +4 -2
- package/docs/memory.md +5 -3
- package/docs/operations.md +210 -16
- package/docs/quickstart.md +12 -2
- package/docs/roles.md +1 -1
- package/docs/sdlc.md +26 -3
- package/docs/security.md +11 -5
- package/docs/specs/2026-09-19-agent-hub-design.md +43 -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-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 +82 -41
- 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 +621 -865
- package/plugins/agent-hub/server.js +17423 -32962
- package/src/adapters/agy/definition.ts +7 -24
- package/src/adapters/channel-peer.ts +3 -1
- 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 +74 -11
- 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 +61 -83
- 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 +3 -2
- package/src/adapters/definitions/native-cli-codex-launch.ts +2 -1
- package/src/adapters/definitions/native-cli-entry-jcode.ts +4 -2
- package/src/adapters/definitions/native-cli-entry-types.ts +9 -2
- package/src/adapters/definitions/native-cli-launch-common.ts +2 -2
- package/src/adapters/definitions/native-cli-retained.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 +3 -12
- package/src/adapters/native-capabilities.ts +18 -8
- 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/budget-renew-guidance.ts +129 -0
- package/src/cli/claude-homes.ts +9 -5
- 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 +9 -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/console-state.ts +5 -138
- package/src/cli/console-versions.ts +1 -1
- package/src/cli/help.ts +37 -15
- package/src/cli/identity.ts +23 -4
- package/src/cli/launch-check.ts +1 -2
- package/src/cli/launch.ts +13 -82
- package/src/cli/light-dispatch.ts +29 -0
- package/src/cli/main.js +8 -1
- package/src/cli/main.ts +233 -2816
- package/src/cli/orca-probe.ts +119 -0
- package/src/cli/output.ts +31 -2
- package/src/cli/preview.ts +10 -5
- 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 +1 -1
- package/src/cli/start-agents-run.ts +1 -1
- 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 +11 -0
- package/src/cli/upgrade.ts +4 -15
- 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/conductor-peer.ts +24 -0
- package/src/hub/conductor.ts +2 -21
- package/src/hub/config-apply.ts +24 -13
- package/src/hub/config-edit.ts +1 -1
- package/src/hub/config-tier.ts +2 -0
- package/src/hub/config.ts +31 -14
- package/src/hub/control-client.ts +48 -0
- package/src/hub/daemon.ts +421 -61
- 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-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/peers.ts +5 -1
- package/src/hub/permission-mode.ts +2 -1
- 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/registry.ts +36 -2
- 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/sdlc-check.ts +205 -0
- package/src/hub/sdlc-sync.ts +146 -0
- package/src/hub/sdlc.ts +33 -4
- 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 +319 -2548
- 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/templates/presets/agents.json +60 -0
- package/templates/presets/confirmation-matrix.json +8 -8
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { runLocalEntry } from "./native-cli-entry-local.ts";
|
|
6
|
-
import { runJcodeEntry } from "./native-cli-entry-jcode.ts";
|
|
1
|
+
import { LIGHT_NATIVE_CLI_ENTRIES } from "./native-light-cli.ts";
|
|
2
|
+
import { CLAUDE_LAUNCH_POLICY, CODEX_LAUNCH_POLICY } from "./native-launch-policy.ts";
|
|
3
|
+
import { NATIVE_ROUTING_POLICY, NATIVE_WATCH_CAPABILITIES, NATIVE_ADAPTER_POLICY, dualForms } from "./native-adapter-policy.ts";
|
|
4
|
+
import { KIMI_SETTER_VERSION } from "../compat.ts";
|
|
7
5
|
import { previewClaude } from "./native-cli-preview-claude.ts";
|
|
8
6
|
import { previewCodex } from "./native-cli-preview-codex.ts";
|
|
9
7
|
import { previewKimi } from "./native-cli-preview-kimi.ts";
|
|
@@ -12,12 +10,12 @@ import { previewJcode } from "./native-cli-preview-jcode.ts";
|
|
|
12
10
|
import { claudeReviewerBackend, CODEX_REVIEWER_VARIANT, KIMI_REVIEWER_VARIANT } from "./reviewer-variants.ts";
|
|
13
11
|
import { kimiAcpCommand } from "./native-daemon-kimi.ts";
|
|
14
12
|
import { claudeRecoveryLaunch, kimiRecoveryLaunch, claudeRetainedTerminalNotice, piRetainedTerminalNotice, codexRetainedTerminalNotice, codexRosterReturnNotice, jcodeStartPreflight, claudeObservedVersion, codexObservedVersion } from "./native-daemon-policy.ts";
|
|
15
|
-
import {
|
|
13
|
+
import { PI_CONFIGURATION, LOCAL_CONFIGURATION } from "./native-configuration.ts";
|
|
16
14
|
import { claudeCrashPlan, codexCrashPlan, kimiCrashPlan, piCrashPlan, localCrashPlan, jcodeCrashPlan, claudePluginInventory, codexPluginInventory, parsePiContinuity, codexToolSemantic } from "./native-policy-aux.ts";
|
|
17
15
|
import { piRecoveryContinuity } from "./native-recovery-continuity.ts";
|
|
18
16
|
import { piConductorStartArgs } from "./native-cli-pi.ts";
|
|
19
|
-
import { claudeNativeLaunch
|
|
20
|
-
import { codexNativeLaunch
|
|
17
|
+
import { claudeNativeLaunch } from "./native-cli-claude-launch.ts";
|
|
18
|
+
import { codexNativeLaunch } from "./native-cli-codex-launch.ts";
|
|
21
19
|
import { createCodex, createKimi, createJcode, createPi, createLocal, createClaudeReviewer, createClaudeImplementer } from "./native-factories.ts";
|
|
22
20
|
import { CLAUDE_DISPLAY, CODEX_DISPLAY, KIMI_DISPLAY, PI_DISPLAY, LOCAL_DISPLAY, JCODE_DISPLAY } from "./native-display.ts";
|
|
23
21
|
import { CLAUDE_RECOVERY_SESSION, CODEX_RECOVERY_SESSION, KIMI_RECOVERY_SESSION, PI_RECOVERY_SESSION, LOCAL_RECOVERY_SESSION, JCODE_RECOVERY_SESSION } from "./native-recovery.ts";
|
|
@@ -33,134 +31,114 @@ function sessionId(field: "sessionId" | "threadId"): (peer: PeerAdapter) => stri
|
|
|
33
31
|
return typeof value === "string" && value ? value : undefined;
|
|
34
32
|
};
|
|
35
33
|
}
|
|
36
|
-
const switches = Object.freeze(["--unattended", "--safe", "--new"]);
|
|
37
|
-
const implementerRoles = Object.freeze(["implementer", "verifier"]);
|
|
38
|
-
const dualForms = Object.freeze(["tui", "headless"] as const);
|
|
39
|
-
const headlessForms = Object.freeze(["headless"] as const);
|
|
40
|
-
const hubGrants = {
|
|
41
|
-
ask: "every write, edit and shell command asks",
|
|
42
|
-
"ask-when-needed": "write, edit and proven bounded read-only shell commands inside the project run without asking; other shell commands and git writes still ask",
|
|
43
|
-
"never-ask": "every tool runs without asking, inside the hub sandbox and path guard",
|
|
44
|
-
};
|
|
45
34
|
|
|
46
35
|
/**
|
|
47
36
|
* #223: a declared `claude-*` instance with `start_mode: "headless"` and roles exactly ["reviewer"]. The hub runs one
|
|
48
37
|
* fresh `claude -p` session per review request (src/adapters/claude-print.ts); it never owns a terminal or a session.
|
|
49
38
|
*/
|
|
50
39
|
const CLAUDE_REVIEWER_VARIANT: AdapterDefinition = {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
identity: { mcp: "env" }, instances: { mode: "headless" },
|
|
55
|
-
permission: { unmanaged: "each review runs read-only (Read, Grep, Glob) and may call only hub_review and hub_task_show" },
|
|
40
|
+
...NATIVE_ADAPTER_POLICY.claudeReviewer.metadata,
|
|
41
|
+
start: { create: createClaudeReviewer, ...NATIVE_ADAPTER_POLICY.claudeReviewer.start },
|
|
42
|
+
|
|
56
43
|
session: { idField: "sessionId", currentId: () => undefined, freshOnRestore: true, launchKind: "claude-print", crashPlan: () => ({ resume: {}, how: "claude reviewer: starts again; every review runs in a new session" }) },
|
|
57
44
|
turnEnd: "adapter", budget: { account: "claude" }, routing: { reviewOnly: true }, reviewer: { backend: claudeReviewerBackend, defaultPool: true, declaration: "automatic" },
|
|
58
|
-
cli: {
|
|
45
|
+
cli: { ...NATIVE_ADAPTER_POLICY.claudeReviewer.cli }, display: CLAUDE_DISPLAY,
|
|
59
46
|
};
|
|
60
47
|
|
|
61
48
|
/** #525 R5a: no idle child; the host binds an owned worktree and one native session per task. */
|
|
62
49
|
const CLAUDE_IMPLEMENTER_VARIANT: AdapterDefinition = {
|
|
63
|
-
|
|
50
|
+
...NATIVE_ADAPTER_POLICY.claudeImplementer.metadata,
|
|
64
51
|
modelOverride: { boundary: "turn" },
|
|
65
|
-
|
|
66
|
-
start: { create: createClaudeImplementer,
|
|
67
|
-
|
|
68
|
-
permission: { grants: { ask: "every write, edit and shell command asks", "ask-when-needed": "file tools, proven read-only shell commands and bound task commands inside the owned worktree may run automatically; protected paths and other commands ask" } },
|
|
52
|
+
|
|
53
|
+
start: { create: createClaudeImplementer, ...NATIVE_ADAPTER_POLICY.claudeImplementer.start },
|
|
54
|
+
|
|
69
55
|
session: { idField: "sessionId", currentId: sessionId("sessionId"), freshOnRestore: false, launchKind: "claude-implementer", crashPlan: () => ({ resume: {}, how: "Claude implementer resumes its recorded per-task sessions" }) },
|
|
70
56
|
turnEnd: "adapter", settle: { signal: "prompt-response" }, budget: { account: "claude" },
|
|
71
|
-
cli: {
|
|
57
|
+
cli: { ...NATIVE_ADAPTER_POLICY.claudeImplementer.cli }, display: CLAUDE_DISPLAY,
|
|
72
58
|
};
|
|
73
59
|
|
|
74
60
|
// Sources: peer-catalog.ts roles, roster.ts defaults, start-mode.ts forms, permission-mode.ts grants,
|
|
75
61
|
// daemon.ts runtime mappings/stop policy, budget.ts exemptions, and ui/peer-palette.ts CSS foregrounds.
|
|
76
62
|
export const NATIVE_BUILTIN_DEFINITIONS_WITHOUT_QWEN: readonly AdapterDefinition[] = Object.freeze([
|
|
77
63
|
{
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
start: {
|
|
82
|
-
|
|
83
|
-
identity: { mcp: "channel-plugin" }, instances: { mode: "external", roles: ["planner", "implementer", "verifier", "reviewer"] }, attach: { externalHello: true, recoveryLaunch: claudeRecoveryLaunch },
|
|
64
|
+
...NATIVE_ADAPTER_POLICY.claude.metadata,
|
|
65
|
+
questionWaitMs: 45000,
|
|
66
|
+
|
|
67
|
+
start: { ...NATIVE_ADAPTER_POLICY.claude.start, launch: claudeNativeLaunch, version: claudeObservedVersion, ...CLAUDE_LAUNCH_POLICY },
|
|
68
|
+
attach: { externalHello: true, recoveryLaunch: claudeRecoveryLaunch },
|
|
84
69
|
// Approval enforcement belongs to the verified native transport and host permission gate.
|
|
85
|
-
|
|
86
|
-
"ask-when-needed": "file tools on project files run without asking, outside .agenthub, .git and agent configuration; other tools keep Claude's own rules",
|
|
87
|
-
"never-ask": "every tool runs without asking" } },
|
|
70
|
+
|
|
88
71
|
session: { idField: "sessionId", currentId: sessionId("sessionId"), configDirEnv: "CLAUDE_CONFIG_DIR", zeroTurnFresh: true, launchKind: "claude-channel", launchRecord: true, ...CLAUDE_RECOVERY_SESSION, crashPlan: claudeCrashPlan, unrecordedTerminal: "always" },
|
|
89
72
|
turnEnd: "native-hook", settle: { signal: "native-stop" }, budget: { account: "claude", checkpoint: true, reader: { source: "claude status line", read: claudeWindows }, context: { source: "claude_statusline", read: claudeContext } },
|
|
90
|
-
cli: {
|
|
73
|
+
cli: { ...NATIVE_ADAPTER_POLICY.claude.cli, entry: { lifecycleAdmission: LIGHT_NATIVE_CLI_ENTRIES.claude.lifecycleAdmission, execute: LIGHT_NATIVE_CLI_ENTRIES.claude.execute }, preview: previewClaude, retainedTerminalNotice: claudeRetainedTerminalNotice, stopNotice: () => "this peer belongs to a native terminal; end it in its terminal" }, display: CLAUDE_DISPLAY, hooks: { recallPlatform: "claude", recallSource: "claude", recallInjected: true, pluginInventory: claudePluginInventory },
|
|
91
74
|
reviewerVariant: CLAUDE_REVIEWER_VARIANT, headlessVariant: CLAUDE_IMPLEMENTER_VARIANT,
|
|
92
75
|
},
|
|
93
76
|
{
|
|
94
77
|
reviewerVariant: CODEX_REVIEWER_VARIANT,
|
|
95
|
-
|
|
96
|
-
|
|
78
|
+
...NATIVE_ADAPTER_POLICY.codex.metadata,
|
|
79
|
+
questionWaitMs: 45000,
|
|
97
80
|
modelOverride: { boundary: "turn" },
|
|
98
|
-
|
|
99
|
-
start: { create: createCodex,
|
|
100
|
-
|
|
101
|
-
identity: { mcp: "env" }, instances: { mode: "headless" },
|
|
102
|
-
permission: { trackUnattended: true, grants: { ask: "the session's own approval policy applies again", "ask-when-needed": "approval policy on-request on every turn", "never-ask": "approval policy never on every turn: nothing asks" } },
|
|
81
|
+
|
|
82
|
+
start: { create: createCodex, ...NATIVE_ADAPTER_POLICY.codex.start, launch: codexNativeLaunch, version: codexObservedVersion, ...CODEX_LAUNCH_POLICY },
|
|
83
|
+
|
|
103
84
|
session: { nativeRevert: true, idField: "threadId", currentId: sessionId("threadId"), configDirEnv: "CODEX_HOME", zeroTurnFresh: true, launchKind: "codex", launchRecord: true, ...CODEX_RECOVERY_SESSION, crashPlan: codexCrashPlan, unrecordedTerminal: "always" },
|
|
104
85
|
turnEnd: "adapter", settle: { signal: "turn-completed" }, budget: { account: "codex", checkpoint: true, reader: { source: "codex rateLimits", read: codexWindows }, context: { source: "codex_token_usage", read: codexContext } },
|
|
105
|
-
cli: {
|
|
86
|
+
cli: { ...NATIVE_ADAPTER_POLICY.codex.cli, entry: { lifecycleAdmission: LIGHT_NATIVE_CLI_ENTRIES.codex.lifecycleAdmission, execute: LIGHT_NATIVE_CLI_ENTRIES.codex.execute }, preview: previewCodex, retainedTerminalNotice: codexRetainedTerminalNotice, rosterReturnNotice: codexRosterReturnNotice, stopNotice: () => "this peer belongs to a native terminal; end it in its terminal" }, display: CODEX_DISPLAY, hooks: { recallPlatform: "codex", recallSource: "codex", recallInjected: true, pluginInventory: codexPluginInventory, classifyTool: codexToolSemantic },
|
|
106
87
|
},
|
|
107
88
|
{
|
|
108
89
|
reviewerVariant: KIMI_REVIEWER_VARIANT,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
modelOverride: { boundary: "turn", acp: { admission: { nativeIdentity: true }, agentName: "Kimi Code CLI", version:
|
|
90
|
+
...NATIVE_ADAPTER_POLICY.kimi.metadata,
|
|
91
|
+
questionWaitMs: 45000,
|
|
92
|
+
modelOverride: { boundary: "turn", acp: { admission: { nativeIdentity: true }, agentName: "Kimi Code CLI", version: KIMI_SETTER_VERSION,
|
|
112
93
|
setter: "set_config_option", modelUpdate: "config_option_update", receipt: "docs/verification/2026-11-08-kimi-252-model-setter-1317.md" } },
|
|
113
|
-
|
|
94
|
+
|
|
114
95
|
start: { create: createKimi, acpCommand: kimiAcpCommand, explicitHeadlessMode: true, planCommand: () => "ahub kimi", daemonPort: "acp", forms: dualForms, defaultForm: "tui", conductorStartable: true, upStart: { allowed: true }, hubSwitches: [], ownedFlags: [] },
|
|
115
96
|
// ACP sessions carry headless identity; the existing CLI alone owns the TUI's project MCP entry.
|
|
116
|
-
|
|
97
|
+
attach: { pullOnlyForms: Object.freeze(["tui"] as const), recoveryLaunch: kimiRecoveryLaunch,
|
|
117
98
|
pullOnlyNotice: "pull-only: messages wait for hub_inbox; no push, steer, watchdog or automatic quota handoff",
|
|
118
99
|
admission: { reservedRefusal: "Kimi attaches pull-only in TUI mode; run ahub kimi", watchRefusal: "Kimi is in pull-only TUI mode; use its native terminal or start headless" } },
|
|
119
|
-
|
|
120
|
-
unmanagedForms: Object.freeze(["tui"] as const), unmanagedStatusNote: "Kimi approves tools in its own TUI; no hub permission mode", unmanagedNote: "Kimi approves tools and selects its permission mode in its own TUI; no hub permission mode" },
|
|
100
|
+
|
|
121
101
|
session: { idField: "sessionId", currentId: sessionId("sessionId"), freshOnRestore: true, launchKind: "acp", ...KIMI_RECOVERY_SESSION, crashPlan: kimiCrashPlan },
|
|
122
|
-
turnEnd: "adapter", settle: { signal: "prompt-response" }, budget: { account: "kimi", resetSoftTokensOnResume: true, context: { source: "acp_usage_update", read: acpContextValue } }, capabilities:
|
|
123
|
-
cli: {
|
|
102
|
+
turnEnd: "adapter", settle: { signal: "prompt-response" }, budget: { account: "kimi", resetSoftTokensOnResume: true, context: { source: "acp_usage_update", read: acpContextValue } }, capabilities: NATIVE_WATCH_CAPABILITIES, hooks: { factsHook: NATIVE_FACTS_HOOKS.kimi, recallPlatform: "kimi", recallSource: "kimi" },
|
|
103
|
+
cli: { ...NATIVE_ADAPTER_POLICY.kimi.cli, entry: { lifecycleAdmission: true, execute: async context => (await import("./native-cli-entry-kimi.ts")).runKimiEntry(context) }, preview: previewKimi, stopNotice: form => form === "tui" ? "Kimi belongs to its own TUI terminal; end it in that terminal" : "" }, display: KIMI_DISPLAY,
|
|
124
104
|
},
|
|
125
105
|
{
|
|
126
|
-
|
|
127
|
-
|
|
106
|
+
...NATIVE_ADAPTER_POLICY.pi.metadata,
|
|
107
|
+
questionWaitMs: 300000, title: "hub", titlePersistence: "native",
|
|
128
108
|
modelOverride: { boundary: "turn" },
|
|
129
|
-
|
|
130
|
-
start: { create: createPi,
|
|
131
|
-
|
|
109
|
+
|
|
110
|
+
start: { create: createPi, ...NATIVE_ADAPTER_POLICY.pi.start, conductorStartArgs: piConductorStartArgs },
|
|
111
|
+
|
|
132
112
|
// Approval enforcement belongs to the verified native transport and host permission gate.
|
|
133
|
-
|
|
113
|
+
|
|
134
114
|
session: { idField: "sessionId", currentId: sessionId("sessionId"), restoreOnStart: true, launchKind: "pi", launchRecord: true, ...PI_RECOVERY_SESSION, crashPlan: piCrashPlan, unrecordedTerminal: "tui", continuityBookmark: piRecoveryContinuity, continuity: { key: "pi", parse: parsePiContinuity } },
|
|
135
|
-
turnEnd: "adapter", settle: { signal: "agent-settled" }, budget: { account: "pi", instrumented: true, noQuotaReason: "on-prem backends have no provider quota", context: { source: "pi_usage", read: piContext } }, reporting: { tokensNotReported: true }, configuration:
|
|
136
|
-
routing:
|
|
137
|
-
cli: {
|
|
115
|
+
turnEnd: "adapter", settle: { signal: "agent-settled" }, budget: { account: "pi", instrumented: true, noQuotaReason: "on-prem backends have no provider quota", context: { source: "pi_usage", read: piContext } }, reporting: { tokensNotReported: true }, configuration: PI_CONFIGURATION,
|
|
116
|
+
routing: NATIVE_ROUTING_POLICY.pi,
|
|
117
|
+
cli: { ...NATIVE_ADAPTER_POLICY.pi.cli, entry: { lifecycleAdmission: false, execute: async context => (await import("./native-cli-entry-pi.ts")).runPiEntry(context) }, preview: previewPi, retainedTerminalNotice: piRetainedTerminalNotice }, display: PI_DISPLAY,
|
|
138
118
|
},
|
|
139
119
|
{
|
|
140
|
-
|
|
141
|
-
|
|
120
|
+
...NATIVE_ADAPTER_POLICY.local.metadata,
|
|
121
|
+
questionWaitMs: 300000, title: "hub",
|
|
142
122
|
modelOverride: { boundary: "turn" },
|
|
143
|
-
|
|
144
|
-
start: { create: createLocal,
|
|
145
|
-
|
|
123
|
+
|
|
124
|
+
start: { create: createLocal, ...NATIVE_ADAPTER_POLICY.local.start },
|
|
125
|
+
|
|
146
126
|
// Approval enforcement belongs to the verified native transport and host permission gate.
|
|
147
|
-
|
|
127
|
+
|
|
148
128
|
session: { idField: "sessionId", currentId: sessionId("sessionId"), freshOnRestore: true, launchKind: "local", ...LOCAL_RECOVERY_SESSION, crashPlan: localCrashPlan },
|
|
149
|
-
turnEnd: "adapter", settle: { signal: "route-outcome" }, budget: { account: "local", quotaExempt: true, instrumented: true, noQuotaReason: "on-prem gateway has no provider quota" }, configuration:
|
|
150
|
-
routing:
|
|
151
|
-
cli: {
|
|
129
|
+
turnEnd: "adapter", settle: { signal: "route-outcome" }, budget: { account: "local", quotaExempt: true, instrumented: true, noQuotaReason: "on-prem gateway has no provider quota" }, configuration: LOCAL_CONFIGURATION,
|
|
130
|
+
routing: NATIVE_ROUTING_POLICY.local,
|
|
131
|
+
cli: { ...NATIVE_ADAPTER_POLICY.local.cli, entry: { lifecycleAdmission: false, execute: async context => (await import("./native-cli-entry-local.ts")).runLocalEntry(context) } }, display: LOCAL_DISPLAY,
|
|
152
132
|
},
|
|
153
133
|
{
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
start: { create: createJcode, preflight: jcodeStartPreflight,
|
|
134
|
+
...NATIVE_ADAPTER_POLICY.jcode.metadata,
|
|
135
|
+
questionWaitMs: 45000,
|
|
136
|
+
|
|
137
|
+
start: { create: createJcode, preflight: jcodeStartPreflight, ...NATIVE_ADAPTER_POLICY.jcode.start },
|
|
158
138
|
// #685: an extra Jcode is a headless instance with its own native home, socket and state (instances.<id>.jcode_home).
|
|
159
|
-
|
|
160
|
-
permission: { unmanaged: "Jcode native policy is unmanaged; no hub mode mapping", grants: {
|
|
161
|
-
ask: "no verified hub mode mapping; native policy only", "ask-when-needed": "no verified hub mode mapping; native policy only", "never-ask": "no verified hub mode mapping; native policy only" } },
|
|
139
|
+
|
|
162
140
|
session: { idField: "sessionId", currentId: sessionId("sessionId"), launchKind: "jcode", ...JCODE_RECOVERY_SESSION, crashPlan: jcodeCrashPlan }, turnEnd: "adapter", settle: { signal: "prompt-response" }, budget: { account: "jcode", context: { source: "jcode_usage_update", read: jcodeContextValue } },
|
|
163
141
|
// Jcode has no dedicated CSS swatch today: retain peer-palette.ts's existing 'other' fallback.
|
|
164
|
-
cli: {
|
|
142
|
+
cli: { ...NATIVE_ADAPTER_POLICY.jcode.cli, entry: { lifecycleAdmission: LIGHT_NATIVE_CLI_ENTRIES.jcode.lifecycleAdmission, execute: LIGHT_NATIVE_CLI_ENTRIES.jcode.execute }, preview: previewJcode }, display: JCODE_DISPLAY, hooks: { recallPlatform: "jcode" },
|
|
165
143
|
},
|
|
166
144
|
] satisfies AdapterDefinition[]);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export function jcodeCommand(command: string[], kind: "serve" | "acp", socket: string, cwd: string, model?: string, profile?: string, provider?: string, peer = "jcode"): string[] {
|
|
2
|
+
if (!command.length || command.some(word => typeof word !== "string" || !word)) throw new Error("jcode_cmd must name an executable argv");
|
|
3
|
+
return [...command, kind, "--socket", socket, "--cwd", cwd, "--no-update", "--no-selfdev", ...(provider ? ["-p", provider] : []), ...(model ? ["--model", model] : []), ...(profile ? ["--provider-profile", profile] : []),
|
|
4
|
+
...(kind === "serve" ? ["--temporary-server", "--owner-pid", String(process.pid), "--server-name", `agent-hub-${peer}`] : ["--mcp-tools", "eager"])];
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function jcodeTuiCommand(command: string[], socket: string, sessionId: string, model?: string, profile?: string, provider?: string): string[] {
|
|
8
|
+
if (!command.length || command.some(word => typeof word !== "string" || !word)) throw new Error("jcode_cmd must name an executable argv");
|
|
9
|
+
return [...command, "--socket", socket, "--resume", sessionId, "--no-update", "--no-selfdev", ...(provider ? ["-p", provider] : []),
|
|
10
|
+
...(model ? ["--model", model] : []), ...(profile ? ["--provider-profile", profile] : [])];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const JCODE_HEADLESS_AFTER_RECOVERY = "jcode is running headless after recovery; run ahub stop jcode, then ahub jcode to get its TUI back";
|