@event4u/agent-config 9.28.0 → 9.30.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/.claude-plugin/marketplace.json +1 -1
- package/AGENTS.md +6 -6
- package/CHANGELOG.md +172 -5
- package/README.md +2 -1
- package/agents/templates/.ai-council.yml.example +55 -24
- package/dist/agent-src/commands/analyze/inbox.md +22 -1
- package/dist/agent-src/commands/cost/report.md +2 -2
- package/dist/agent-src/commands/explain-run.md +31 -1
- package/dist/agent-src/commands/team/adversarial.md +8 -7
- package/dist/agent-src/commands/team/delegate.md +14 -12
- package/dist/agent-src/commands/team/review.md +9 -8
- package/dist/agent-src/commands/team/status.md +9 -8
- package/dist/agent-src/commands/team.md +29 -19
- package/dist/agent-src/contexts/execution/auto-dispatch-classification.md +88 -2
- package/dist/agent-src/contexts/execution/auto-orchestration-activation.md +29 -21
- package/dist/agent-src/contexts/execution/host-capability-manifest.md +26 -15
- package/dist/agent-src/contexts/execution/orchestration-telemetry.md +22 -1
- package/dist/agent-src/contexts/execution/roadmap-process-loop.md +17 -0
- package/dist/agent-src/contexts/execution/subagent-response-contract.md +65 -1
- package/dist/agent-src/contexts/execution/subagent-routing.md +13 -11
- package/dist/agent-src/contexts/execution/subagent-spawn-contract.md +25 -0
- package/dist/agent-src/contexts/execution/subagent-steering.md +6 -3
- package/dist/agent-src/rules/delegation-policy.md +11 -7
- package/dist/agent-src/rules/preservation-guard.md +9 -0
- package/dist/agent-src/rules/settings-ask-protocol.md +8 -7
- package/dist/agent-src/rules/token-budget-discipline.md +1 -1
- package/dist/agent-src/scripts/roadmap_gates.ts +312 -0
- package/dist/agent-src/scripts/update_roadmap_progress.ts +72 -4
- package/dist/agent-src/skills/forensics-report/SKILL.md +114 -0
- package/dist/agent-src/skills/forensics-report/evals/triggers.json +17 -0
- package/dist/agent-src/skills/premortem/SKILL.md +30 -1
- package/dist/agent-src/skills/reasoning-orchestrator/SKILL.md +2 -1
- package/dist/agent-src/skills/subagent-orchestration/SKILL.md +17 -5
- package/dist/agent-src/skills/subagent-orchestration/schemas/subagent-status.json +61 -3
- package/dist/agent-src/skills/test-case-discovery/SKILL.md +1 -1
- package/dist/agent-src/templates/AGENTS.md +4 -4
- package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
- package/dist/agent-src/templates/roadmaps.md +23 -0
- package/dist/cli/registry.js +2 -0
- package/dist/cli/registry.js.map +1 -1
- package/dist/cli-delegate/{chunk-22GCIJ2O.js → chunk-66OVWGB5.js} +1 -1
- package/dist/cli-delegate/{chunk-7OMQCH4V.js → chunk-BTJNRUX3.js} +22 -35
- package/dist/cli-delegate/{chunk-DVRS2KVR.js → chunk-DDUNNFYX.js} +24 -17
- package/dist/cli-delegate/{chunk-PQSAQKHW.js → chunk-EQY4FLJB.js} +3 -3
- package/dist/cli-delegate/{chunk-2BE5I2MN.js → chunk-IYTGIG2Y.js} +155 -91
- package/dist/cli-delegate/{chunk-GB2FSUEE.js → chunk-LCFJIQ4J.js} +32 -0
- package/dist/cli-delegate/{chunk-VSYT7OHO.js → chunk-LVRYBKTI.js} +31 -2
- package/dist/cli-delegate/chunk-MMJL4TIX.js +18 -0
- package/dist/cli-delegate/{chunk-JXARCGVN.js → chunk-MP3JT3IU.js} +1 -1
- package/dist/cli-delegate/chunk-O3CO5BFB.js +161 -0
- package/dist/cli-delegate/{chunk-REKCMYOU.js → chunk-PFBV6XRT.js} +36 -20
- package/dist/cli-delegate/chunk-RVGBH4XK.js +142 -0
- package/dist/cli-delegate/cmd_analyze_session.js +1 -1
- package/dist/cli-delegate/cmd_brand_status.js +1 -1
- package/dist/cli-delegate/cmd_conformance.js +2803 -137
- package/dist/cli-delegate/cmd_doctor.js +10 -5
- package/dist/cli-delegate/cmd_explain.js +2 -2
- package/dist/cli-delegate/cmd_export.js +4 -4
- package/dist/cli-delegate/cmd_handoff.js +88 -8
- package/dist/cli-delegate/cmd_mcp_available.js +1 -1
- package/dist/cli-delegate/cmd_migrate.js +2 -2
- package/dist/cli-delegate/cmd_packs_active.js +2 -2
- package/dist/cli-delegate/cmd_prune.js +4 -4
- package/dist/cli-delegate/cmd_route_audit.js +3 -2
- package/dist/cli-delegate/cmd_route_explain.js +1 -1
- package/dist/cli-delegate/cmd_session_recycle.js +177 -0
- package/dist/cli-delegate/cmd_settings_get.js +2 -8
- package/dist/cli-delegate/cmd_settings_migrate.js +4 -4
- package/dist/cli-delegate/cmd_settings_set.js +2 -2
- package/dist/cli-delegate/cmd_sync.js +4 -4
- package/dist/cli-delegate/cmd_uninstall.js +4 -4
- package/dist/cli-delegate/cmd_update.js +1 -1
- package/dist/cli-delegate/cmd_upgrade.js +1 -1
- package/dist/cli-delegate/cmd_validate.js +4 -4
- package/dist/cli-delegate/cmd_versions.js +1 -1
- package/dist/discovery/deprecation-report.md +1 -1
- package/dist/discovery/discovery-manifest.json +72 -23
- package/dist/discovery/discovery-manifest.json.sha256 +1 -1
- package/dist/discovery/discovery-manifest.summary.md +3 -2
- package/dist/discovery/orphan-report.md +1 -1
- package/dist/discovery/packs.json +39 -2
- package/dist/discovery/trust-report.md +2 -2
- package/dist/discovery/workspaces.json +12 -4
- package/dist/hooks/dispatch.js +2278 -611
- package/dist/install/install.mjs +56 -17
- package/dist/mcp/registry-manifest.json +3 -3
- package/dist/mcp/server.json +2 -2
- package/dist/mcp/server.mjs +4122 -699
- package/dist/router.json +1 -1
- package/dist/scripts/_lib/agent_settings.js +54 -0
- package/dist/scripts/_lib/agent_settings.js.map +1 -1
- package/dist/scripts/condense.js +147 -2
- package/dist/scripts/condense.js.map +1 -1
- package/dist/server/schemas/settings.js +12 -7
- package/dist/server/schemas/settings.js.map +1 -1
- package/dist/shared/settingsCarveOut.js +0 -9
- package/dist/shared/settingsCarveOut.js.map +1 -1
- package/dist/shared/settingsClasses.js +11 -9
- package/dist/shared/settingsClasses.js.map +1 -1
- package/dist/ui/assets/index-B5qGYOJo.js +26 -0
- package/dist/ui/assets/index-B5qGYOJo.js.map +1 -0
- package/dist/ui/index.html +1 -1
- package/docs/contracts/settings-classes.md +58 -12
- package/package.json +1 -1
- package/src/agent-src/scripts/roadmap_gates.ts +312 -0
- package/src/agent-src/scripts/update_roadmap_progress.ts +72 -4
- package/src/agent-src/templates/AGENTS.md +4 -4
- package/src/config/agent-settings.template.yml +88 -66
- package/src/config/discovery/packs.yml +11 -0
- package/src/config/discovery/workspaces.yml +1 -1
- package/src/config/dispatch-economy-metrics.json +61 -0
- package/src/config/evaluator-budgets.json +4 -4
- package/src/config/gate-violation-baselines.json +3 -3
- package/src/config/hook-token-budget.json +91 -0
- package/src/config/recycle-threshold-budget.json +12 -0
- package/src/config/rule-enforcement-baseline.json +86 -0
- package/src/scripts/_cli/cmd_conformance.ts +31 -44
- package/src/scripts/_cli/cmd_doctor.ts +65 -48
- package/src/scripts/_cli/cmd_session_recycle.ts +226 -0
- package/src/scripts/_dispatch.bash +23 -0
- package/src/scripts/_lib/agent_settings.ts +58 -0
- package/src/scripts/_lib/auto_dispatch.corpus.test.ts +1 -1
- package/src/scripts/_lib/auto_dispatch.ts +23 -18
- package/src/scripts/_lib/capsule_trigger.ts +124 -0
- package/src/scripts/_lib/host_capability.ts +63 -6
- package/src/scripts/_lib/judgment_ladder.ts +634 -0
- package/src/scripts/_lib/orchestration_gate.ts +8 -0
- package/src/scripts/_lib/orchestration_record.ts +78 -10
- package/src/scripts/_lib/orchestration_savings.ts +1 -1
- package/src/scripts/_lib/recycle_envelope_paths.ts +35 -0
- package/src/scripts/_lib/self_repair.ts +354 -13
- package/src/scripts/_lib/self_repair_store.ts +28 -0
- package/src/scripts/_lib/session_eol.ts +230 -0
- package/src/scripts/_lib/session_role.ts +42 -0
- package/src/scripts/_lib/subagent_capsule.ts +341 -0
- package/src/scripts/_lib/subagent_response.ts +94 -0
- package/src/scripts/_lib/subagent_spawn.ts +13 -0
- package/src/scripts/_lib/subagent_steering.ts +9 -4
- package/src/scripts/_lib/tier_budget_routing.ts +6 -1
- package/src/scripts/_lib/worker_budget.ts +37 -2
- package/src/scripts/ai_council/clients.ts +126 -55
- package/src/scripts/ai_council/config.ts +94 -6
- package/src/scripts/ai_council/handoff.ts +113 -0
- package/src/scripts/ai_council/modes.ts +19 -4
- package/src/scripts/ai_council/orchestrator.ts +105 -0
- package/src/scripts/ai_council/quorum.ts +84 -0
- package/src/scripts/ai_council/session.ts +44 -0
- package/src/scripts/ai_council/transport_resolver.ts +127 -1
- package/src/scripts/ai_team/availability.ts +110 -0
- package/src/scripts/ai_team/config.ts +34 -14
- package/src/scripts/ai_team/team_dispatch.ts +71 -29
- package/src/scripts/ask_transport.ts +221 -0
- package/src/scripts/bench_critic_protocol.ts +396 -0
- package/src/scripts/bench_hook_injection.ts +234 -0
- package/src/scripts/check_adr_frontmatter.ts +84 -40
- package/src/scripts/check_branch_freshness.ts +1 -0
- package/src/scripts/check_corpus_staleness.ts +18 -4
- package/src/scripts/check_detector_corpus.ts +219 -0
- package/src/scripts/check_gitignore_freshness.ts +42 -8
- package/src/scripts/check_hook_bundle_freshness.ts +24 -1
- package/src/scripts/check_kernel_prefix_stability.ts +1 -0
- package/src/scripts/check_standing_rule_delivery.ts +73 -32
- package/src/scripts/check_static_layer_stability.ts +154 -0
- package/src/scripts/check_suppression_hygiene.ts +48 -0
- package/src/scripts/condense.ts +162 -2
- package/src/scripts/council_cli.ts +401 -25
- package/src/scripts/dispatch_economy_report.ts +448 -0
- package/src/scripts/dispatch_r2_reviewer.ts +15 -2
- package/src/scripts/explain_run.ts +206 -4
- package/src/scripts/forensics_report.ts +333 -0
- package/src/scripts/generate_settings_reference.ts +1 -0
- package/src/scripts/handoff_context_hook.ts +112 -4
- package/src/scripts/hook_manifest.yaml +117 -10
- package/src/scripts/hooks/concern_registry.ts +8 -0
- package/src/scripts/hooks/delegation_nudge_hook.ts +106 -35
- package/src/scripts/hooks/dispatch_hook.ts +39 -2
- package/src/scripts/hooks/edit_shape_hook.ts +303 -0
- package/src/scripts/hooks/orchestration_record_hook.ts +19 -1
- package/src/scripts/hooks/reread_guard_hook.ts +314 -0
- package/src/scripts/hooks/rtk_wrap_hook.ts +133 -14
- package/src/scripts/hooks/session_eol_hook.ts +268 -0
- package/src/scripts/hooks/turn_end_gate_hook.ts +507 -0
- package/src/scripts/install-hooks.sh +1 -1
- package/src/scripts/language_mirror_hook.ts +89 -0
- package/src/scripts/lint_decision_impact.ts +14 -1
- package/src/scripts/lint_discovery_vocabulary.ts +2 -0
- package/src/scripts/lint_hook_manifest.ts +82 -0
- package/src/scripts/lint_never_silent.ts +276 -0
- package/src/scripts/lint_no_activation_gates.ts +271 -0
- package/src/scripts/lint_readme_serial_comma.ts +1 -0
- package/src/scripts/lint_rule_enforcement_declaration.ts +347 -0
- package/src/scripts/measure_turn_end_gate.ts +194 -0
- package/src/scripts/orchestration_record.ts +12 -1
- package/src/scripts/rebuild_hook_bundle.ts +178 -0
- package/src/scripts/release.ts +74 -2
- package/src/scripts/report_conformance_funnel.ts +284 -0
- package/src/scripts/report_imperative_density.ts +1 -0
- package/src/scripts/routing_doctor.ts +118 -36
- package/src/scripts/score_skill_selection.ts +19 -5
- package/src/scripts/self_repair_cli.ts +337 -59
- package/src/scripts/session_eol_report.ts +261 -0
- package/src/scripts/team_events_spike.ts +271 -0
- package/src/scripts/team_review_gate_hook.ts +31 -9
- package/src/server/schemas/settings.ts +24 -17
- package/src/shared/settingsCarveOut.ts +0 -10
- package/src/shared/settingsClasses.ts +11 -9
- package/src/templates/compact-instructions.md +40 -0
- package/dist/ui/assets/index-DmR0mbk4.js +0 -26
- package/dist/ui/assets/index-DmR0mbk4.js.map +0 -1
|
@@ -4355,18 +4355,9 @@ var settingsSchema = external_exports.object({
|
|
|
4355
4355
|
}).default({})
|
|
4356
4356
|
}).default({}),
|
|
4357
4357
|
subagents: external_exports.object({
|
|
4358
|
-
enabled: external_exports.boolean().default(true).describe(
|
|
4359
|
-
"Global master switch for the subagent layer. true (default) = available; false = fully disabled (the canonical kill-switch \u2014 no auto-dispatch, no routing, everything runs in-session)."
|
|
4360
|
-
),
|
|
4361
|
-
auto: external_exports.enum(["off", "ask", "on"]).default("on").describe(
|
|
4362
|
-
"Automatic-dispatch mode. off = subagents only via explicit command. ask = classify the task and ask once before dispatching. on = auto-dispatch delegable tasks (surface the choice in one line). Shipped default is on on subagent-capable hosts (flipped from ask 2026-07-09, ADR-117), off elsewhere; no-op where the host has no subagent primitive."
|
|
4363
|
-
),
|
|
4364
4358
|
downshift: external_exports.boolean().default(true).describe(
|
|
4365
4359
|
"Route delegable sub-tasks to the lowest-capable model tier (cost + speed via model downshift). false = every subagent runs on the session tier."
|
|
4366
4360
|
),
|
|
4367
|
-
budget_routing: external_exports.enum(["ask", "auto", "off"]).default("ask").describe(
|
|
4368
|
-
"Budget-aware cheap-request delegation (docs/contracts/budget-routing.md): pick the cheapest classifier-adequate tier WITH available budget (cost.budgets.per_tier); cheap exhausted but strong funded \u2192 strong tier; all exhausted \u2192 session model + notice. Work is never blocked to save money; the session model is never switched (delegation with a model override). ask = confirm the first budget-motivated downshift per session (default). auto = apply silently with telemetry. off = today's behavior (single-flip rollback). Distinct from downshift: that is the quality/cost knob, this is the resource-availability gate."
|
|
4369
|
-
),
|
|
4370
4361
|
quota_arbitrage: external_exports.boolean().default(true).describe(
|
|
4371
4362
|
"Prefer a separate quota-pool model for delegable sub-tasks where the host manifest reports one. Optional bonus only \u2014 identical behaviour (minus the quota win) where unsupported. Never load-bearing."
|
|
4372
4363
|
),
|
|
@@ -4377,15 +4368,15 @@ var settingsSchema = external_exports.object({
|
|
|
4377
4368
|
}).default({}).describe(
|
|
4378
4369
|
"Per-tier model map for downshift routing. Each empty value uses the tier runtime default (no vendor model baked in)."
|
|
4379
4370
|
),
|
|
4380
|
-
host_capabilities: external_exports.object({}).passthrough().default({}).describe(
|
|
4381
|
-
"Optional override of the host-capability manifest (subagent_spawn / parallel_spawn / status_polling / separate_quota_pool). Any field set wins; omitted fields fall back to the all-false safe default. Empty = the agent resolves the manifest from host knowledge."
|
|
4382
|
-
),
|
|
4383
4371
|
implementer_model: external_exports.string().default("").describe(
|
|
4384
4372
|
"Override the model the orchestrator dispatches to subagents that write code (e.g. claude-sonnet-4, gpt-5). Empty (default) = inherit the session's primary model \u2014 cheapest and usually right."
|
|
4385
4373
|
),
|
|
4386
4374
|
judge_model: external_exports.string().default("").describe(
|
|
4387
4375
|
"Override the model used for review / judge subagents that critique implementer output. Empty (default) = one tier above the implementer model \u2014 picks up nuance the implementer missed."
|
|
4388
4376
|
),
|
|
4377
|
+
model_ceiling: external_exports.string().default("").describe(
|
|
4378
|
+
"Session-wide model CEILING for subagents (spend cap). Empty (default) = no ceiling. When set, suite-owned CLI spawn wrappers export CLAUDE_CODE_SUBAGENT_MODEL to the sessions they launch. Class C: a human sets it; the agent never writes or infers one."
|
|
4379
|
+
),
|
|
4389
4380
|
max_parallel: external_exports.number().int().min(1).default(3).describe(
|
|
4390
4381
|
"Hard cap on subagents running in parallel during /do-in-parallel, /do-competitively, and /judge runs. Raise for faster fan-out, lower if you hit rate limits or want lower token spend."
|
|
4391
4382
|
),
|
|
@@ -4399,14 +4390,11 @@ var settingsSchema = external_exports.object({
|
|
|
4399
4390
|
)
|
|
4400
4391
|
}),
|
|
4401
4392
|
ai_team: external_exports.object({
|
|
4402
|
-
enabled: external_exports.boolean().default(false).describe(
|
|
4403
|
-
"Master switch for the /team cross-model review family (docs/contracts/ai-team-config.md). false (default) = commands are never suggested and every invocation refuses with an enable pointer. true = the family is live; individual gates (allow_delegate) still apply."
|
|
4404
|
-
),
|
|
4405
4393
|
model: external_exports.string().default("auto").describe(
|
|
4406
4394
|
"Model handed to the codex CLI. 'auto' (default) = pass no --model flag so the CLI's own default applies \u2014 tracks the subscription's current strongest model instead of pinning a stale ID. Any other value passes through verbatim as `--model <value>`."
|
|
4407
4395
|
),
|
|
4408
4396
|
allow_delegate: external_exports.boolean().default(false).describe(
|
|
4409
|
-
"Second opt-in for the only wrapper that delegates write access (/team:delegate). false (default) = delegate refuses even when
|
|
4397
|
+
"Second opt-in for the only wrapper that delegates write access (/team:delegate). false (default) = delegate refuses even when /team itself is available. Availability (codex CLI installed + authenticated) is necessary but not sufficient \u2014 this key must ALSO be true before delegation is reachable."
|
|
4410
4398
|
),
|
|
4411
4399
|
max_calls_per_day: external_exports.number().int().min(0).default(50).describe(
|
|
4412
4400
|
"Per-day cap on team calls, read against the EXISTING cli_call_budget openai bucket (~/.event4u/agent-config/cli-calls.json, daily UTC reset) \u2014 one subscription, one counter, never a parallel count. 0 = block all team calls."
|
|
@@ -4422,7 +4410,15 @@ var settingsSchema = external_exports.object({
|
|
|
4422
4410
|
"Circuit-breaker bound: after this many CONSECUTIVE BLOCK verdicts in one session, a visible notice is injected exactly once and the managed layer stops re-blocking \u2014 the user decides, never an infinite Claude\u2194Codex loop. An ALLOW verdict resets the counter. Positive integer."
|
|
4423
4411
|
)
|
|
4424
4412
|
}).default({ managed: false, max_consecutive_blocks: 3 })
|
|
4425
|
-
}).default({
|
|
4413
|
+
}).default({ model: "auto", allow_delegate: false, max_calls_per_day: 50, suppress_setup_hint: false, review_gate: { managed: false, max_consecutive_blocks: 3 } }),
|
|
4414
|
+
emergency: external_exports.object({
|
|
4415
|
+
orchestration_halt: external_exports.boolean().default(false).describe(
|
|
4416
|
+
"The one audited incident switch over the always-on orchestration stack (subagents, council, team). NOT an activation gate: false (default) = the stack runs normally. true = halted; arming requires no ceremony. Disarming (returning to false) requires orchestration_halt_justification to be a non-empty string. Both transitions emit one telemetry line."
|
|
4417
|
+
),
|
|
4418
|
+
orchestration_halt_justification: external_exports.string().default("").describe(
|
|
4419
|
+
"Required non-empty before orchestration_halt may return to false. Ignored while arming the halt."
|
|
4420
|
+
)
|
|
4421
|
+
}).default({ orchestration_halt: false, orchestration_halt_justification: "" }),
|
|
4426
4422
|
onboarding: external_exports.object({
|
|
4427
4423
|
onboarded: external_exports.boolean().default(false).describe(
|
|
4428
4424
|
"Set to true once the developer has completed `agent-config setup`. The onboarding-gate rule blocks the first turn of every chat until this is true. Toggle back to false to re-trigger the wizard."
|
|
@@ -4547,6 +4543,17 @@ var settingsSchema = external_exports.object({
|
|
|
4547
4543
|
enabled: external_exports.boolean().default(false).describe(
|
|
4548
4544
|
"PreToolUse code-graph nudge (ADR-124 Phase 4). Default off. When on AND a native code-graph cache or a consumer-shipped graph.json/SCIP index is present, warns once per session (never blocks) as the agent is about to Grep/Glob or Read a source file \u2014 query the graph first for who-calls/where-used/impact questions (or rebuild if stale, build if absent). Source G\u2019s strict block-first-read mode is deliberately un-ported."
|
|
4549
4545
|
)
|
|
4546
|
+
}).default({}),
|
|
4547
|
+
turn_end_gate: external_exports.object({
|
|
4548
|
+
enabled: external_exports.boolean().default(false).describe(
|
|
4549
|
+
"Stop-slot turn-end gate (road-to-conformance-round5 Phase 3). Default off, and it is the only concern that can REFUSE a turn-end rather than a tool call \u2014 so it soaks behind an explicit opt-in before it binds. Round 5 measured the reason: both blocking carriers reached zero violations, neither advisory carrier did, and 19 wrong-language replies survived a pin that had fired 26-35 seconds earlier. A refused turn continues in the SAME turn and is never refused twice."
|
|
4550
|
+
),
|
|
4551
|
+
promissory: external_exports.boolean().default(true).describe(
|
|
4552
|
+
"Detector A of the turn-end gate: refuse a turn whose closing paragraph promises work not yet performed while asking the user nothing (20 measured occurrences). Inert while hooks.turn_end_gate.enabled is false."
|
|
4553
|
+
),
|
|
4554
|
+
language: external_exports.boolean().default(true).describe(
|
|
4555
|
+
"Detector B of the turn-end gate: refuse a turn whose user-visible prose is not in the pinned language, with fenced code, inline code, quoted tool output, tables, URLs, paths and identifiers excluded first (19 measured occurrences). Fires 18.0% of turns on the measured corpus, which is why the master switch is off by default. Inert while hooks.turn_end_gate.enabled is false."
|
|
4556
|
+
)
|
|
4550
4557
|
}).default({})
|
|
4551
4558
|
}),
|
|
4552
4559
|
decision_engine: external_exports.object({
|
|
@@ -2,10 +2,10 @@ import { createRequire as __acCreateRequire } from 'node:module'; const require
|
|
|
2
2
|
import {
|
|
3
3
|
ZodFirstPartyTypeKind,
|
|
4
4
|
settingsSchema
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-DDUNNFYX.js";
|
|
6
6
|
import {
|
|
7
7
|
main
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-MP3JT3IU.js";
|
|
9
9
|
import {
|
|
10
10
|
RULE_SOURCE_REL
|
|
11
11
|
} from "./chunk-BKO2AZ7Z.js";
|
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
import {
|
|
49
49
|
find_project_root_with_anchor,
|
|
50
50
|
load_agent_settings
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-LCFJIQ4J.js";
|
|
52
52
|
import {
|
|
53
53
|
event4u_root,
|
|
54
54
|
legacy_xdg_root,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
config_exports,
|
|
15
15
|
hardenedSpawnEnv
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-LVRYBKTI.js";
|
|
17
17
|
import {
|
|
18
18
|
DEFAULT_GITATTRIBUTES,
|
|
19
19
|
SECTION_HEADER,
|
|
@@ -41,9 +41,10 @@ import {
|
|
|
41
41
|
ProjectRootError,
|
|
42
42
|
ROOT_OVERRIDE_ENV,
|
|
43
43
|
find_project_root_with_trace,
|
|
44
|
+
load_agent_settings,
|
|
44
45
|
project_settings_path,
|
|
45
46
|
resolve_project_root
|
|
46
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-LCFJIQ4J.js";
|
|
47
48
|
import {
|
|
48
49
|
event4u_root,
|
|
49
50
|
resolve_with_fallback,
|
|
@@ -186,7 +187,9 @@ __export(clients_exports, {
|
|
|
186
187
|
_OpenAICompatibleClient: () => _OpenAICompatibleClient,
|
|
187
188
|
_is_reasoning_model: () => _is_reasoning_model,
|
|
188
189
|
_read_until_marker: () => _read_until_marker,
|
|
190
|
+
_resetModelCeilingMemo: () => _resetModelCeilingMemo,
|
|
189
191
|
_setMonotonicSource: () => _setMonotonicSource,
|
|
192
|
+
_subagentModelCeiling: () => _subagentModelCeiling,
|
|
190
193
|
_today_utc_iso: () => _today_utc_iso,
|
|
191
194
|
assertCacheBreakpointOrder: () => assertCacheBreakpointOrder,
|
|
192
195
|
load_anthropic_key: () => load_anthropic_key,
|
|
@@ -200,6 +203,9 @@ import { spawnSync } from "node:child_process";
|
|
|
200
203
|
import * as fs4 from "node:fs";
|
|
201
204
|
import * as path4 from "node:path";
|
|
202
205
|
|
|
206
|
+
// src/scripts/_lib/session_role.ts
|
|
207
|
+
var SESSION_ROLE_ENV = "AGENT_CONFIG_SESSION_ROLE";
|
|
208
|
+
|
|
203
209
|
// src/scripts/ai_council/events_log.ts
|
|
204
210
|
import * as crypto from "node:crypto";
|
|
205
211
|
import * as fs3 from "node:fs";
|
|
@@ -405,6 +411,25 @@ function _pyJsonStringRaw(s) {
|
|
|
405
411
|
}
|
|
406
412
|
|
|
407
413
|
// src/scripts/ai_council/clients.ts
|
|
414
|
+
var _modelCeilingMemo = /* @__PURE__ */ new Map();
|
|
415
|
+
function _subagentModelCeiling(cwd = process.cwd()) {
|
|
416
|
+
const hit = _modelCeilingMemo.get(cwd);
|
|
417
|
+
if (hit !== void 0) return hit;
|
|
418
|
+
let ceiling;
|
|
419
|
+
try {
|
|
420
|
+
const settings = load_agent_settings({ cwd });
|
|
421
|
+
const sub = settings["subagents"] ?? {};
|
|
422
|
+
const v = typeof sub["model_ceiling"] === "string" ? sub["model_ceiling"].trim() : "";
|
|
423
|
+
ceiling = v.length > 0 ? v : null;
|
|
424
|
+
} catch {
|
|
425
|
+
ceiling = null;
|
|
426
|
+
}
|
|
427
|
+
_modelCeilingMemo.set(cwd, ceiling);
|
|
428
|
+
return ceiling;
|
|
429
|
+
}
|
|
430
|
+
function _resetModelCeilingMemo() {
|
|
431
|
+
_modelCeilingMemo.clear();
|
|
432
|
+
}
|
|
408
433
|
var ANTHROPIC_KEY_FILENAME = "anthropic.key";
|
|
409
434
|
var OPENAI_KEY_FILENAME = "openai.key";
|
|
410
435
|
var ANTHROPIC_KEY_PATH = write_target(ANTHROPIC_KEY_FILENAME);
|
|
@@ -1091,8 +1116,19 @@ var CliClient = class extends ExternalAIClient {
|
|
|
1091
1116
|
"429",
|
|
1092
1117
|
"usage limit"
|
|
1093
1118
|
];
|
|
1094
|
-
|
|
1119
|
+
/**
|
|
1120
|
+
* `identity` carries the subclass constants (`name`, `default_binary`)
|
|
1121
|
+
* that construction validates against. They are passed explicitly rather
|
|
1122
|
+
* than read off `this.name` / `this.default_binary` because subclass
|
|
1123
|
+
* instance-field initializers (`override default_binary = 'claude'`,
|
|
1124
|
+
* declared in the subclass body) run only AFTER this `super()` call
|
|
1125
|
+
* returns — reading them here, before that happens, would always see the
|
|
1126
|
+
* base class's own field defaults (`''`), not the subclass override.
|
|
1127
|
+
*/
|
|
1128
|
+
constructor(opts, identity) {
|
|
1095
1129
|
super();
|
|
1130
|
+
this.name = identity.name;
|
|
1131
|
+
this.default_binary = identity.default_binary;
|
|
1096
1132
|
this.model = opts.model;
|
|
1097
1133
|
this.timeout_seconds = opts.timeout_seconds ?? DEFAULT_CLI_TIMEOUT_SECONDS;
|
|
1098
1134
|
this.max_calls_per_day = opts.max_calls_per_day ?? null;
|
|
@@ -1139,7 +1175,25 @@ var CliClient = class extends ExternalAIClient {
|
|
|
1139
1175
|
// (loader preload, git *_COMMAND, NODE_OPTIONS, …) so an
|
|
1140
1176
|
// attacker-influenced parent env cannot RCE via the spawned CLI
|
|
1141
1177
|
// or a `git` it invokes internally.
|
|
1142
|
-
|
|
1178
|
+
// Role marking (token-economy-dispatch Phase 2.2): a council
|
|
1179
|
+
// member CLI session is worker-class — it never talks to OUR
|
|
1180
|
+
// user, never dispatches sub-workers, never runs a council.
|
|
1181
|
+
// The spawned vendor CLI loads this repo's hook chains; the
|
|
1182
|
+
// marker lets the dispatcher run the thinner worker chain
|
|
1183
|
+
// (manifest `roles.worker.drop`; pre_tool_use guards are
|
|
1184
|
+
// structurally exempt). This is the ONE in-tree spawn point
|
|
1185
|
+
// that launches a separate CLI session today — Agent-tool
|
|
1186
|
+
// subagents share the host process env and cannot be marked
|
|
1187
|
+
// (probed live 2026-08-10; see _lib/session_role.ts).
|
|
1188
|
+
// The optional model ceiling (subagents.model_ceiling, class C)
|
|
1189
|
+
// rides the same spawn: a spend cap the human set per install.
|
|
1190
|
+
env: hardenedSpawnEnv({
|
|
1191
|
+
[SESSION_ROLE_ENV]: "worker",
|
|
1192
|
+
...(() => {
|
|
1193
|
+
const ceiling = _subagentModelCeiling();
|
|
1194
|
+
return ceiling !== null ? { CLAUDE_CODE_SUBAGENT_MODEL: ceiling } : {};
|
|
1195
|
+
})()
|
|
1196
|
+
})
|
|
1143
1197
|
};
|
|
1144
1198
|
if (stdinPayload !== null) {
|
|
1145
1199
|
spawnOpts.input = stdinPayload;
|
|
@@ -1297,18 +1351,19 @@ var CliClient = class extends ExternalAIClient {
|
|
|
1297
1351
|
}
|
|
1298
1352
|
};
|
|
1299
1353
|
var AnthropicCliClient = class extends CliClient {
|
|
1300
|
-
name = "anthropic";
|
|
1301
|
-
default_binary = "claude";
|
|
1302
1354
|
subscription_label = "claude-pro";
|
|
1303
1355
|
constructor(opts = {}) {
|
|
1304
|
-
super(
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1356
|
+
super(
|
|
1357
|
+
{
|
|
1358
|
+
model: opts.model ?? DEFAULT_ANTHROPIC_CLI_MODEL,
|
|
1359
|
+
binary: opts.binary,
|
|
1360
|
+
timeout_seconds: opts.timeout_seconds,
|
|
1361
|
+
max_calls_per_day: opts.max_calls_per_day,
|
|
1362
|
+
warn_at: opts.warn_at,
|
|
1363
|
+
cli_calls_path: opts.cli_calls_path
|
|
1364
|
+
},
|
|
1365
|
+
{ name: "anthropic", default_binary: "claude" }
|
|
1366
|
+
);
|
|
1312
1367
|
}
|
|
1313
1368
|
_build_command(system_prompt, user_prompt, max_tokens) {
|
|
1314
1369
|
void user_prompt;
|
|
@@ -1368,8 +1423,6 @@ var AnthropicCliClient = class extends CliClient {
|
|
|
1368
1423
|
}
|
|
1369
1424
|
};
|
|
1370
1425
|
var OpenAICliClient = class extends CliClient {
|
|
1371
|
-
name = "openai";
|
|
1372
|
-
default_binary = "codex";
|
|
1373
1426
|
subscription_label = "chatgpt-plus";
|
|
1374
1427
|
static _AUTH_FAILURE_PATTERNS = [
|
|
1375
1428
|
...CliClient._AUTH_FAILURE_PATTERNS,
|
|
@@ -1378,14 +1431,17 @@ var OpenAICliClient = class extends CliClient {
|
|
|
1378
1431
|
"401"
|
|
1379
1432
|
];
|
|
1380
1433
|
constructor(opts = {}) {
|
|
1381
|
-
super(
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1434
|
+
super(
|
|
1435
|
+
{
|
|
1436
|
+
model: opts.model ?? DEFAULT_OPENAI_CLI_MODEL,
|
|
1437
|
+
binary: opts.binary,
|
|
1438
|
+
timeout_seconds: opts.timeout_seconds,
|
|
1439
|
+
max_calls_per_day: opts.max_calls_per_day,
|
|
1440
|
+
warn_at: opts.warn_at,
|
|
1441
|
+
cli_calls_path: opts.cli_calls_path
|
|
1442
|
+
},
|
|
1443
|
+
{ name: "openai", default_binary: "codex" }
|
|
1444
|
+
);
|
|
1389
1445
|
}
|
|
1390
1446
|
_build_command(system_prompt, user_prompt, max_tokens) {
|
|
1391
1447
|
void max_tokens;
|
|
@@ -1474,8 +1530,6 @@ var OpenAICliClient = class extends CliClient {
|
|
|
1474
1530
|
}
|
|
1475
1531
|
};
|
|
1476
1532
|
var GeminiCliClient = class extends CliClient {
|
|
1477
|
-
name = "gemini";
|
|
1478
|
-
default_binary = "gemini";
|
|
1479
1533
|
subscription_label = "gemini-pro";
|
|
1480
1534
|
static _AUTH_FAILURE_PATTERNS = [
|
|
1481
1535
|
...CliClient._AUTH_FAILURE_PATTERNS,
|
|
@@ -1484,14 +1538,17 @@ var GeminiCliClient = class extends CliClient {
|
|
|
1484
1538
|
"oauth"
|
|
1485
1539
|
];
|
|
1486
1540
|
constructor(opts = {}) {
|
|
1487
|
-
super(
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1541
|
+
super(
|
|
1542
|
+
{
|
|
1543
|
+
model: opts.model ?? DEFAULT_GEMINI_CLI_MODEL,
|
|
1544
|
+
binary: opts.binary,
|
|
1545
|
+
timeout_seconds: opts.timeout_seconds,
|
|
1546
|
+
max_calls_per_day: opts.max_calls_per_day,
|
|
1547
|
+
warn_at: opts.warn_at,
|
|
1548
|
+
cli_calls_path: opts.cli_calls_path
|
|
1549
|
+
},
|
|
1550
|
+
{ name: "gemini", default_binary: "gemini" }
|
|
1551
|
+
);
|
|
1495
1552
|
}
|
|
1496
1553
|
_build_command(system_prompt, user_prompt, max_tokens) {
|
|
1497
1554
|
void user_prompt;
|
|
@@ -1566,8 +1623,6 @@ var GeminiCliClient = class extends CliClient {
|
|
|
1566
1623
|
}
|
|
1567
1624
|
};
|
|
1568
1625
|
var XAICliClient = class extends CliClient {
|
|
1569
|
-
name = "xai";
|
|
1570
|
-
default_binary = "grok";
|
|
1571
1626
|
billable = true;
|
|
1572
1627
|
// community CLI consumes an API key — billable applies
|
|
1573
1628
|
static _AUTH_FAILURE_PATTERNS = [
|
|
@@ -1577,14 +1632,17 @@ var XAICliClient = class extends CliClient {
|
|
|
1577
1632
|
"unauthorized"
|
|
1578
1633
|
];
|
|
1579
1634
|
constructor(opts = {}) {
|
|
1580
|
-
super(
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1635
|
+
super(
|
|
1636
|
+
{
|
|
1637
|
+
model: opts.model ?? DEFAULT_XAI_MODEL,
|
|
1638
|
+
binary: opts.binary,
|
|
1639
|
+
timeout_seconds: opts.timeout_seconds,
|
|
1640
|
+
max_calls_per_day: opts.max_calls_per_day,
|
|
1641
|
+
warn_at: opts.warn_at,
|
|
1642
|
+
cli_calls_path: opts.cli_calls_path
|
|
1643
|
+
},
|
|
1644
|
+
{ name: "xai", default_binary: "grok" }
|
|
1645
|
+
);
|
|
1588
1646
|
}
|
|
1589
1647
|
_build_command(system_prompt, user_prompt, max_tokens) {
|
|
1590
1648
|
void system_prompt;
|
|
@@ -1610,8 +1668,6 @@ var XAICliClient = class extends CliClient {
|
|
|
1610
1668
|
}
|
|
1611
1669
|
};
|
|
1612
1670
|
var PerplexityCliClient = class extends CliClient {
|
|
1613
|
-
name = "perplexity";
|
|
1614
|
-
default_binary = "perplexity";
|
|
1615
1671
|
billable = true;
|
|
1616
1672
|
// community CLI consumes an API key — billable applies
|
|
1617
1673
|
static _AUTH_FAILURE_PATTERNS = [
|
|
@@ -1621,14 +1677,17 @@ var PerplexityCliClient = class extends CliClient {
|
|
|
1621
1677
|
"unauthorized"
|
|
1622
1678
|
];
|
|
1623
1679
|
constructor(opts = {}) {
|
|
1624
|
-
super(
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1680
|
+
super(
|
|
1681
|
+
{
|
|
1682
|
+
model: opts.model ?? DEFAULT_PERPLEXITY_MODEL,
|
|
1683
|
+
binary: opts.binary,
|
|
1684
|
+
timeout_seconds: opts.timeout_seconds,
|
|
1685
|
+
max_calls_per_day: opts.max_calls_per_day,
|
|
1686
|
+
warn_at: opts.warn_at,
|
|
1687
|
+
cli_calls_path: opts.cli_calls_path
|
|
1688
|
+
},
|
|
1689
|
+
{ name: "perplexity", default_binary: "perplexity" }
|
|
1690
|
+
);
|
|
1632
1691
|
}
|
|
1633
1692
|
_build_command(system_prompt, user_prompt, max_tokens) {
|
|
1634
1693
|
void system_prompt;
|
|
@@ -2471,7 +2530,8 @@ function resolveTransport(opts) {
|
|
|
2471
2530
|
billing,
|
|
2472
2531
|
authSource,
|
|
2473
2532
|
makesProviderCall: false,
|
|
2474
|
-
reason: null
|
|
2533
|
+
reason: null,
|
|
2534
|
+
absentReason: null
|
|
2475
2535
|
};
|
|
2476
2536
|
}
|
|
2477
2537
|
if (mode === "api" || mode === "cli") {
|
|
@@ -2481,7 +2541,8 @@ function resolveTransport(opts) {
|
|
|
2481
2541
|
billing,
|
|
2482
2542
|
authSource,
|
|
2483
2543
|
makesProviderCall: true,
|
|
2484
|
-
reason: null
|
|
2544
|
+
reason: null,
|
|
2545
|
+
absentReason: null
|
|
2485
2546
|
};
|
|
2486
2547
|
}
|
|
2487
2548
|
if (mode !== "auto") {
|
|
@@ -2501,7 +2562,8 @@ function resolveTransport(opts) {
|
|
|
2501
2562
|
billing,
|
|
2502
2563
|
authSource,
|
|
2503
2564
|
makesProviderCall: true,
|
|
2504
|
-
reason: null
|
|
2565
|
+
reason: null,
|
|
2566
|
+
absentReason: null
|
|
2505
2567
|
};
|
|
2506
2568
|
}
|
|
2507
2569
|
const keyPresent = opts.apiKeyPresent ?? hasSource(report, provider, KEY_AUTH_SOURCES);
|
|
@@ -2512,12 +2574,18 @@ function resolveTransport(opts) {
|
|
|
2512
2574
|
billing,
|
|
2513
2575
|
authSource,
|
|
2514
2576
|
makesProviderCall: true,
|
|
2515
|
-
reason: null
|
|
2577
|
+
reason: null,
|
|
2578
|
+
absentReason: null
|
|
2516
2579
|
};
|
|
2517
2580
|
}
|
|
2518
|
-
return unavailable(
|
|
2581
|
+
return unavailable(
|
|
2582
|
+
provider,
|
|
2583
|
+
billing,
|
|
2584
|
+
autoUnavailableReason(provider, binary, cliAuthed),
|
|
2585
|
+
classifyStaticAbsentReason(binary)
|
|
2586
|
+
);
|
|
2519
2587
|
}
|
|
2520
|
-
function unavailable(_provider, billing, reason) {
|
|
2588
|
+
function unavailable(_provider, billing, reason, absentReason = null) {
|
|
2521
2589
|
return {
|
|
2522
2590
|
available: false,
|
|
2523
2591
|
transport: null,
|
|
@@ -2526,9 +2594,13 @@ function unavailable(_provider, billing, reason) {
|
|
|
2526
2594
|
billing,
|
|
2527
2595
|
authSource: null,
|
|
2528
2596
|
makesProviderCall: false,
|
|
2529
|
-
reason
|
|
2597
|
+
reason,
|
|
2598
|
+
absentReason
|
|
2530
2599
|
};
|
|
2531
2600
|
}
|
|
2601
|
+
function classifyStaticAbsentReason(binary) {
|
|
2602
|
+
return binary === null ? "no_binary" : "no_auth";
|
|
2603
|
+
}
|
|
2532
2604
|
function autoUnavailableReason(provider, binary, cliAuthed) {
|
|
2533
2605
|
const expected = PROVIDER_CLI_META[provider]?.[0] ?? provider;
|
|
2534
2606
|
if (binary === null && !cliAuthed) {
|
|
@@ -2787,7 +2859,6 @@ var AI_TEAM_REVIEW_GATE_DEFAULTS = Object.freeze({
|
|
|
2787
2859
|
max_consecutive_blocks: 3
|
|
2788
2860
|
});
|
|
2789
2861
|
var AI_TEAM_DEFAULTS = Object.freeze({
|
|
2790
|
-
enabled: false,
|
|
2791
2862
|
model: "auto",
|
|
2792
2863
|
allow_delegate: false,
|
|
2793
2864
|
max_calls_per_day: 50,
|
|
@@ -4382,6 +4453,13 @@ function osErrorStr(exc) {
|
|
|
4382
4453
|
return String(exc);
|
|
4383
4454
|
}
|
|
4384
4455
|
var _CLI_PROVIDER_META = PROVIDER_CLI_META;
|
|
4456
|
+
function _effectiveMemberMode(member, cfg) {
|
|
4457
|
+
return member.mode ?? cfg.defaults.mode;
|
|
4458
|
+
}
|
|
4459
|
+
function _mayRunOverCli(member, cfg) {
|
|
4460
|
+
const mode = _effectiveMemberMode(member, cfg);
|
|
4461
|
+
return mode === "cli" || mode === "auto";
|
|
4462
|
+
}
|
|
4385
4463
|
function _check_council_cli(project_root) {
|
|
4386
4464
|
const { load_cli_call_counts: load_cli_call_counts2 } = clients_exports;
|
|
4387
4465
|
const { load_council_config, resolve_config_path } = config_exports;
|
|
@@ -4407,7 +4485,7 @@ function _check_council_cli(project_root) {
|
|
|
4407
4485
|
}
|
|
4408
4486
|
const cli_members = [];
|
|
4409
4487
|
for (const [name, m] of cfg.members.entries()) {
|
|
4410
|
-
if (m.enabled && m
|
|
4488
|
+
if (m.enabled && _mayRunOverCli(m, cfg) && name in _CLI_PROVIDER_META) {
|
|
4411
4489
|
cli_members.push([name, m]);
|
|
4412
4490
|
}
|
|
4413
4491
|
}
|
|
@@ -4506,18 +4584,11 @@ function _team_codex_binary_name(project_root) {
|
|
|
4506
4584
|
return default_bin;
|
|
4507
4585
|
}
|
|
4508
4586
|
const member = cfg.members.get("openai");
|
|
4509
|
-
if (member && member.enabled && member
|
|
4587
|
+
if (member && member.enabled && _mayRunOverCli(member, cfg) && member.binary) {
|
|
4510
4588
|
return member.binary;
|
|
4511
4589
|
}
|
|
4512
4590
|
return default_bin;
|
|
4513
4591
|
}
|
|
4514
|
-
function _settings_flag(val) {
|
|
4515
|
-
if (typeof val === "boolean") return val;
|
|
4516
|
-
if (typeof val === "string") {
|
|
4517
|
-
return ["true", "yes", "on", "1"].includes(val.trim().toLowerCase());
|
|
4518
|
-
}
|
|
4519
|
-
return false;
|
|
4520
|
-
}
|
|
4521
4592
|
function _jwt_exp(token) {
|
|
4522
4593
|
if (typeof token !== "string") return null;
|
|
4523
4594
|
const parts = token.split(".");
|
|
@@ -4682,31 +4753,14 @@ function _check_detection(project_root) {
|
|
|
4682
4753
|
}
|
|
4683
4754
|
function _check_team(project_root) {
|
|
4684
4755
|
const ai_team = _read_ai_team_block(project_root);
|
|
4685
|
-
const enabled = _settings_flag(ai_team["enabled"]);
|
|
4686
4756
|
const gateRaw = ai_team["review_gate"];
|
|
4687
4757
|
const gate = typeof gateRaw === "object" && gateRaw !== null && !Array.isArray(gateRaw) ? gateRaw : {};
|
|
4688
|
-
const gate_managed = _settings_flag(gate["managed"]);
|
|
4689
|
-
if (!enabled) {
|
|
4690
|
-
if (gate_managed) {
|
|
4691
|
-
return {
|
|
4692
|
-
id: "team",
|
|
4693
|
-
status: "warn",
|
|
4694
|
-
message: "half-configured: ai_team.review_gate.managed is on but ai_team.enabled is false \u2014 the gate never runs",
|
|
4695
|
-
remedy: "set `ai_team.enabled: true` in .agent-settings.yml, or remove `ai_team.review_gate.managed`"
|
|
4696
|
-
};
|
|
4697
|
-
}
|
|
4698
|
-
return {
|
|
4699
|
-
id: "team",
|
|
4700
|
-
status: "ok",
|
|
4701
|
-
message: "team mode not configured (default-off)",
|
|
4702
|
-
remedy: "opt in via `ai_team.enabled: true` in .agent-settings.yml, then re-run `agent-config doctor --check team`"
|
|
4703
|
-
};
|
|
4704
|
-
}
|
|
4705
4758
|
const remedies = [];
|
|
4706
4759
|
const binary_name = _team_codex_binary_name(project_root);
|
|
4707
4760
|
const binary_resolved = shutilWhich(binary_name);
|
|
4708
4761
|
const binary_glyph = binary_resolved !== null ? "\u2705" : "\u274C";
|
|
4709
|
-
|
|
4762
|
+
const binary_missing = binary_resolved === null;
|
|
4763
|
+
if (binary_missing) {
|
|
4710
4764
|
remedies.push("install the codex CLI: `npm install -g @openai/codex`");
|
|
4711
4765
|
}
|
|
4712
4766
|
const auth_path = path8.join(_codex_home(), "auth.json");
|
|
@@ -4747,6 +4801,14 @@ function _check_team(project_root) {
|
|
|
4747
4801
|
const gate_str = gate_signal.gate_str;
|
|
4748
4802
|
remedies.push(...gate_signal.remedies);
|
|
4749
4803
|
const detail = `codex binary ${binary_glyph} (${binary_name}) \xB7 ${auth_str} \xB7 ${plugin_str} \xB7 ${gate_str}`;
|
|
4804
|
+
if (binary_missing && !authed) {
|
|
4805
|
+
return {
|
|
4806
|
+
id: "team",
|
|
4807
|
+
status: "ok",
|
|
4808
|
+
message: `team unavailable (default) \u2014 codex CLI not installed \xB7 ${detail}`,
|
|
4809
|
+
remedy: remedies.join("; ")
|
|
4810
|
+
};
|
|
4811
|
+
}
|
|
4750
4812
|
if (remedies.length > 0) {
|
|
4751
4813
|
return {
|
|
4752
4814
|
id: "team",
|
|
@@ -4758,7 +4820,7 @@ function _check_team(project_root) {
|
|
|
4758
4820
|
return {
|
|
4759
4821
|
id: "team",
|
|
4760
4822
|
status: "ok",
|
|
4761
|
-
message: `team
|
|
4823
|
+
message: `team available \xB7 ${detail}`,
|
|
4762
4824
|
remedy: ""
|
|
4763
4825
|
};
|
|
4764
4826
|
}
|
|
@@ -5525,6 +5587,7 @@ export {
|
|
|
5525
5587
|
_check_git_identity,
|
|
5526
5588
|
_check_manifest_integrity,
|
|
5527
5589
|
_check_lockfile_freshness,
|
|
5590
|
+
shutilWhich,
|
|
5528
5591
|
_check_global_binary,
|
|
5529
5592
|
_check_claude_plugin,
|
|
5530
5593
|
_check_claude_command_wrappers,
|
|
@@ -5539,6 +5602,7 @@ export {
|
|
|
5539
5602
|
_check_mcp_beta_readiness,
|
|
5540
5603
|
_check_tier_usage_readiness,
|
|
5541
5604
|
_check_council_cli,
|
|
5605
|
+
_team_codex_binary_name,
|
|
5542
5606
|
_read_council_facts,
|
|
5543
5607
|
_detection_report,
|
|
5544
5608
|
_reset_detection_memo,
|
|
@@ -406,8 +406,40 @@ function load_agent_settings(options = {}) {
|
|
|
406
406
|
_deep_merge(merged, layer);
|
|
407
407
|
}
|
|
408
408
|
}
|
|
409
|
+
_warn_removed_always_on_keys(merged);
|
|
409
410
|
return merged;
|
|
410
411
|
}
|
|
412
|
+
var REMOVED_ALWAYS_ON_KEYS = [
|
|
413
|
+
"subagents.enabled",
|
|
414
|
+
"subagents.auto",
|
|
415
|
+
"subagents.host_capabilities",
|
|
416
|
+
"subagents.budget_routing",
|
|
417
|
+
"ai_team.enabled"
|
|
418
|
+
];
|
|
419
|
+
var _warnedRemovedAlwaysOnKeys = /* @__PURE__ */ new Set();
|
|
420
|
+
function _readDottedSettingsPath(root, dotted) {
|
|
421
|
+
let node = root;
|
|
422
|
+
for (const part of dotted.split(".")) {
|
|
423
|
+
if (typeof node !== "object" || node === null || Array.isArray(node)) {
|
|
424
|
+
return void 0;
|
|
425
|
+
}
|
|
426
|
+
node = node[part];
|
|
427
|
+
}
|
|
428
|
+
return node;
|
|
429
|
+
}
|
|
430
|
+
function _warn_removed_always_on_keys(merged) {
|
|
431
|
+
for (const key of REMOVED_ALWAYS_ON_KEYS) {
|
|
432
|
+
if (_warnedRemovedAlwaysOnKeys.has(key)) {
|
|
433
|
+
continue;
|
|
434
|
+
}
|
|
435
|
+
if (_readDottedSettingsPath(merged, key) === void 0) {
|
|
436
|
+
continue;
|
|
437
|
+
}
|
|
438
|
+
_warnedRemovedAlwaysOnKeys.add(key);
|
|
439
|
+
process.stderr.write(`${key} was removed (always-on orchestration); ignored.
|
|
440
|
+
`);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
411
443
|
function* iter_setting_overrides(options = {}) {
|
|
412
444
|
const project_path = options.project_path ?? null;
|
|
413
445
|
const user_global_path = options.user_global_path ?? null;
|