@event4u/agent-config 9.26.0 → 9.27.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/CHANGELOG.md +57 -229
- package/dist/agent-src/commands/analyze/conformance.md +19 -0
- package/dist/agent-src/commands/roadmap/next.md +65 -3
- package/dist/agent-src/rules/active-remediation.md +2 -0
- package/dist/agent-src/rules/analysis-skill-routing.md +2 -0
- package/dist/agent-src/rules/architecture.md +2 -0
- package/dist/agent-src/rules/artifact-drafting-protocol.md +2 -0
- package/dist/agent-src/rules/artifact-engagement-recording.md +2 -0
- package/dist/agent-src/rules/augment-edit-discipline.md +2 -0
- package/dist/agent-src/rules/autonomous-execution.md +2 -0
- package/dist/agent-src/rules/brand-consistency.md +2 -0
- package/dist/agent-src/rules/brand-source-of-truth.md +2 -0
- package/dist/agent-src/rules/broken-access-control.md +2 -0
- package/dist/agent-src/rules/cli-output-handling.md +2 -0
- package/dist/agent-src/rules/code-comment-discipline.md +2 -0
- package/dist/agent-src/rules/code-provenance.md +2 -0
- package/dist/agent-src/rules/command-suggestion-policy.md +2 -0
- package/dist/agent-src/rules/commit-conventions.md +2 -0
- package/dist/agent-src/rules/communication-through-line.md +2 -0
- package/dist/agent-src/rules/content-quoting-floor.md +2 -0
- package/dist/agent-src/rules/context-hygiene.md +10 -0
- package/dist/agent-src/rules/copilot-routing.md +2 -0
- package/dist/agent-src/rules/cross-source-consistency.md +2 -0
- package/dist/agent-src/rules/decision-revisit-gate.md +2 -0
- package/dist/agent-src/rules/delegation-policy.md +2 -0
- package/dist/agent-src/rules/design-fidelity.md +2 -0
- package/dist/agent-src/rules/design-review-after-ui-write.md +4 -0
- package/dist/agent-src/rules/devcontainer-routing.md +2 -0
- package/dist/agent-src/rules/doc-screenshot-hygiene.md +2 -0
- package/dist/agent-src/rules/docker-commands.md +2 -0
- package/dist/agent-src/rules/domain-adoption-policy.md +2 -0
- package/dist/agent-src/rules/domain-safety-disclaimer.md +2 -0
- package/dist/agent-src/rules/domain-safety-pii.md +2 -0
- package/dist/agent-src/rules/domain-safety-retention.md +2 -0
- package/dist/agent-src/rules/downstream-changes.md +2 -0
- package/dist/agent-src/rules/engineering-safety-floor.md +2 -0
- package/dist/agent-src/rules/evaluator-independence.md +13 -3
- package/dist/agent-src/rules/external-code-graph-interop.md +2 -0
- package/dist/agent-src/rules/external-reference-deep-dive.md +2 -0
- package/dist/agent-src/rules/fast-path-marker-visibility.md +2 -0
- package/dist/agent-src/rules/finance-safety-floor.md +2 -0
- package/dist/agent-src/rules/framework-neutrality-in-generic-skills.md +2 -0
- package/dist/agent-src/rules/git-history-discipline.md +3 -1
- package/dist/agent-src/rules/guidelines.md +2 -0
- package/dist/agent-src/rules/history-discipline.md +2 -0
- package/dist/agent-src/rules/icon-consistency.md +2 -0
- package/dist/agent-src/rules/image-likeness-and-rights.md +2 -0
- package/dist/agent-src/rules/improve-before-implement.md +2 -0
- package/dist/agent-src/rules/invite-challenge.md +2 -0
- package/dist/agent-src/rules/laravel-routing.md +2 -0
- package/dist/agent-src/rules/laravel-translations.md +2 -0
- package/dist/agent-src/rules/legal-safety-floor.md +2 -0
- package/dist/agent-src/rules/lethal-trifecta-guard.md +2 -0
- package/dist/agent-src/rules/linked-projects-onboarding-gate.md +2 -0
- package/dist/agent-src/rules/low-impact-corpus-privacy-floor.md +2 -0
- package/dist/agent-src/rules/markdown-safe-codeblocks.md +2 -0
- package/dist/agent-src/rules/media-governance-routing.md +2 -0
- package/dist/agent-src/rules/media-sync-ground-truth.md +2 -0
- package/dist/agent-src/rules/minimal-safe-diff.md +2 -0
- package/dist/agent-src/rules/missing-tool-handling.md +2 -0
- package/dist/agent-src/rules/model-recommendation.md +2 -0
- package/dist/agent-src/rules/no-attribution-footers.md +2 -0
- package/dist/agent-src/rules/no-decorative-emojis-in-git-surfaces.md +2 -0
- package/dist/agent-src/rules/no-pr-progress-comments.md +2 -0
- package/dist/agent-src/rules/no-roadmap-references.md +2 -0
- package/dist/agent-src/rules/notes-first-reasoning.md +2 -0
- package/dist/agent-src/rules/onboarding-gate.md +2 -0
- package/dist/agent-src/rules/output-discipline.md +2 -0
- package/dist/agent-src/rules/package-ci-checks.md +2 -0
- package/dist/agent-src/rules/persona-governance.md +2 -0
- package/dist/agent-src/rules/php-coding.md +2 -0
- package/dist/agent-src/rules/prefer-enums-over-literals.md +2 -0
- package/dist/agent-src/rules/preservation-guard.md +2 -0
- package/dist/agent-src/rules/provider-lifecycle-discipline.md +2 -0
- package/dist/agent-src/rules/question-not-instruction.md +2 -0
- package/dist/agent-src/rules/reviewer-awareness.md +2 -0
- package/dist/agent-src/rules/roadmap-ci-steps-policy.md +2 -0
- package/dist/agent-src/rules/roadmap-progress-sync.md +2 -0
- package/dist/agent-src/rules/role-mode-adherence.md +2 -0
- package/dist/agent-src/rules/rule-type-governance.md +2 -0
- package/dist/agent-src/rules/runtime-safety.md +2 -0
- package/dist/agent-src/rules/scale-discipline.md +2 -0
- package/dist/agent-src/rules/secret-vcs-guard.md +2 -0
- package/dist/agent-src/rules/security-sensitive-stop.md +2 -0
- package/dist/agent-src/rules/senior-engineering-discipline.md +2 -0
- package/dist/agent-src/rules/session-canary.md +61 -19
- package/dist/agent-src/rules/settings-ask-protocol.md +4 -0
- package/dist/agent-src/rules/size-enforcement.md +2 -0
- package/dist/agent-src/rules/skill-improvement-trigger.md +2 -0
- package/dist/agent-src/rules/skill-quality.md +2 -0
- package/dist/agent-src/rules/slash-command-routing-policy.md +2 -0
- package/dist/agent-src/rules/source-confidentiality.md +2 -0
- package/dist/agent-src/rules/source-discovery-gate.md +2 -0
- package/dist/agent-src/rules/source-of-truth.md +2 -0
- package/dist/agent-src/rules/spreadsheet-source-quality.md +2 -0
- package/dist/agent-src/rules/strategy-safety-floor.md +2 -0
- package/dist/agent-src/rules/symfony-routing.md +2 -0
- package/dist/agent-src/rules/think-before-action.md +2 -0
- package/dist/agent-src/rules/token-budget-discipline.md +2 -0
- package/dist/agent-src/rules/token-efficiency.md +2 -0
- package/dist/agent-src/rules/token-optimizer-maintenance.md +2 -0
- package/dist/agent-src/rules/tool-safety.md +2 -0
- package/dist/agent-src/rules/ui-audit-gate.md +4 -0
- package/dist/agent-src/rules/untrusted-input-defense.md +2 -0
- package/dist/agent-src/rules/upstream-proposal.md +2 -0
- package/dist/agent-src/rules/user-interaction.md +2 -0
- package/dist/agent-src/rules/user-interrupt-priority.md +2 -0
- package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
- package/dist/cli/registry.js +2 -0
- package/dist/cli/registry.js.map +1 -1
- package/dist/cli-delegate/{chunk-SJQMJI7M.js → chunk-3KJIMFTB.js} +1 -1
- package/dist/cli-delegate/{chunk-BSLUHV2F.js → chunk-BCPIOAGV.js} +148 -133
- package/dist/cli-delegate/cmd_conformance.js +1 -1
- package/dist/cli-delegate/cmd_doctor.js +1 -1
- package/dist/cli-delegate/cmd_export.js +1 -1
- package/dist/cli-delegate/cmd_prune.js +1 -1
- package/dist/cli-delegate/cmd_settings_migrate.js +1 -1
- package/dist/cli-delegate/cmd_sync.js +1 -1
- package/dist/cli-delegate/cmd_uninstall.js +1 -1
- package/dist/cli-delegate/cmd_validate.js +1 -1
- package/dist/discovery/deprecation-report.md +1 -1
- package/dist/discovery/discovery-manifest.json +109 -109
- package/dist/discovery/discovery-manifest.json.sha256 +1 -1
- package/dist/discovery/discovery-manifest.summary.md +1 -1
- package/dist/discovery/orphan-report.md +1 -1
- package/dist/discovery/packs.json +2 -2
- package/dist/discovery/trust-report.md +1 -1
- package/dist/discovery/workspaces.json +2 -2
- package/dist/hooks/dispatch.js +796 -289
- package/dist/install/install.mjs +1 -1
- package/dist/mcp/registry-manifest.json +2 -2
- package/dist/mcp/server.json +2 -2
- package/dist/mcp/server.mjs +571 -417
- package/dist/scripts/condense.js +33 -2
- package/dist/scripts/condense.js.map +1 -1
- package/dist/server/io/yamlIO.js +85 -0
- package/dist/server/io/yamlIO.js.map +1 -1
- package/dist/server/routes/settings.js +1 -12
- package/dist/server/routes/settings.js.map +1 -1
- package/dist/server/routes/wizard.js +52 -2
- package/dist/server/routes/wizard.js.map +1 -1
- package/dist/shared/settingsCarveOut.js +118 -0
- package/dist/shared/settingsCarveOut.js.map +1 -0
- package/dist/shared/settingsSurface.js +7 -1
- package/dist/shared/settingsSurface.js.map +1 -1
- package/dist/ui/assets/index-DmR0mbk4.js.map +1 -1
- package/package.json +1 -1
- package/src/config/evaluator-budgets.json +4 -4
- package/src/scripts/_cli/cmd_doctor.ts +6 -21
- package/src/scripts/_dispatch.bash +18 -0
- package/src/scripts/_lib/git_common_dir.ts +128 -0
- package/src/scripts/_lib/obligation_frequency.ts +391 -0
- package/src/scripts/_lib/session_register.ts +361 -0
- package/src/scripts/check_enforcement_coverage.ts +192 -7
- package/src/scripts/check_rule_projection_integrity.ts +364 -0
- package/src/scripts/condense.ts +36 -2
- package/src/scripts/conformance_scan.ts +35 -0
- package/src/scripts/generate_settings_reference.ts +232 -0
- package/src/scripts/hook_manifest.yaml +68 -27
- package/src/scripts/hooks/block_no_verify.ts +56 -1
- package/src/scripts/hooks/block_unauthorized_git.ts +67 -1
- package/src/scripts/hooks/concern_registry.ts +2 -0
- package/src/scripts/language_mirror_hook.ts +56 -6
- package/src/scripts/orchestration_backfill.ts +354 -0
- package/src/scripts/release.ts +142 -36
- package/src/scripts/schemas/rule.schema.json +5 -0
- package/src/scripts/session_canary_hook.ts +35 -3
- package/src/scripts/session_register_hook.ts +288 -0
- package/src/scripts/sessions_cli.ts +140 -0
- package/src/scripts/validate_frontmatter.ts +68 -0
- package/src/server/io/yamlIO.ts +87 -0
- package/src/shared/settingsCarveOut.ts +143 -0
- package/src/shared/settingsSurface.ts +7 -1
package/dist/mcp/server.mjs
CHANGED
|
@@ -1669,17 +1669,17 @@ var require_visit = __commonJS({
|
|
|
1669
1669
|
visit.BREAK = BREAK;
|
|
1670
1670
|
visit.SKIP = SKIP;
|
|
1671
1671
|
visit.REMOVE = REMOVE;
|
|
1672
|
-
function visit_(key, node, visitor,
|
|
1673
|
-
const ctrl = callVisitor(key, node, visitor,
|
|
1672
|
+
function visit_(key, node, visitor, path52) {
|
|
1673
|
+
const ctrl = callVisitor(key, node, visitor, path52);
|
|
1674
1674
|
if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
|
|
1675
|
-
replaceNode(key,
|
|
1676
|
-
return visit_(key, ctrl, visitor,
|
|
1675
|
+
replaceNode(key, path52, ctrl);
|
|
1676
|
+
return visit_(key, ctrl, visitor, path52);
|
|
1677
1677
|
}
|
|
1678
1678
|
if (typeof ctrl !== "symbol") {
|
|
1679
1679
|
if (identity.isCollection(node)) {
|
|
1680
|
-
|
|
1680
|
+
path52 = Object.freeze(path52.concat(node));
|
|
1681
1681
|
for (let i = 0; i < node.items.length; ++i) {
|
|
1682
|
-
const ci = visit_(i, node.items[i], visitor,
|
|
1682
|
+
const ci = visit_(i, node.items[i], visitor, path52);
|
|
1683
1683
|
if (typeof ci === "number")
|
|
1684
1684
|
i = ci - 1;
|
|
1685
1685
|
else if (ci === BREAK)
|
|
@@ -1690,13 +1690,13 @@ var require_visit = __commonJS({
|
|
|
1690
1690
|
}
|
|
1691
1691
|
}
|
|
1692
1692
|
} else if (identity.isPair(node)) {
|
|
1693
|
-
|
|
1694
|
-
const ck = visit_("key", node.key, visitor,
|
|
1693
|
+
path52 = Object.freeze(path52.concat(node));
|
|
1694
|
+
const ck = visit_("key", node.key, visitor, path52);
|
|
1695
1695
|
if (ck === BREAK)
|
|
1696
1696
|
return BREAK;
|
|
1697
1697
|
else if (ck === REMOVE)
|
|
1698
1698
|
node.key = null;
|
|
1699
|
-
const cv = visit_("value", node.value, visitor,
|
|
1699
|
+
const cv = visit_("value", node.value, visitor, path52);
|
|
1700
1700
|
if (cv === BREAK)
|
|
1701
1701
|
return BREAK;
|
|
1702
1702
|
else if (cv === REMOVE)
|
|
@@ -1717,17 +1717,17 @@ var require_visit = __commonJS({
|
|
|
1717
1717
|
visitAsync.BREAK = BREAK;
|
|
1718
1718
|
visitAsync.SKIP = SKIP;
|
|
1719
1719
|
visitAsync.REMOVE = REMOVE;
|
|
1720
|
-
async function visitAsync_(key, node, visitor,
|
|
1721
|
-
const ctrl = await callVisitor(key, node, visitor,
|
|
1720
|
+
async function visitAsync_(key, node, visitor, path52) {
|
|
1721
|
+
const ctrl = await callVisitor(key, node, visitor, path52);
|
|
1722
1722
|
if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
|
|
1723
|
-
replaceNode(key,
|
|
1724
|
-
return visitAsync_(key, ctrl, visitor,
|
|
1723
|
+
replaceNode(key, path52, ctrl);
|
|
1724
|
+
return visitAsync_(key, ctrl, visitor, path52);
|
|
1725
1725
|
}
|
|
1726
1726
|
if (typeof ctrl !== "symbol") {
|
|
1727
1727
|
if (identity.isCollection(node)) {
|
|
1728
|
-
|
|
1728
|
+
path52 = Object.freeze(path52.concat(node));
|
|
1729
1729
|
for (let i = 0; i < node.items.length; ++i) {
|
|
1730
|
-
const ci = await visitAsync_(i, node.items[i], visitor,
|
|
1730
|
+
const ci = await visitAsync_(i, node.items[i], visitor, path52);
|
|
1731
1731
|
if (typeof ci === "number")
|
|
1732
1732
|
i = ci - 1;
|
|
1733
1733
|
else if (ci === BREAK)
|
|
@@ -1738,13 +1738,13 @@ var require_visit = __commonJS({
|
|
|
1738
1738
|
}
|
|
1739
1739
|
}
|
|
1740
1740
|
} else if (identity.isPair(node)) {
|
|
1741
|
-
|
|
1742
|
-
const ck = await visitAsync_("key", node.key, visitor,
|
|
1741
|
+
path52 = Object.freeze(path52.concat(node));
|
|
1742
|
+
const ck = await visitAsync_("key", node.key, visitor, path52);
|
|
1743
1743
|
if (ck === BREAK)
|
|
1744
1744
|
return BREAK;
|
|
1745
1745
|
else if (ck === REMOVE)
|
|
1746
1746
|
node.key = null;
|
|
1747
|
-
const cv = await visitAsync_("value", node.value, visitor,
|
|
1747
|
+
const cv = await visitAsync_("value", node.value, visitor, path52);
|
|
1748
1748
|
if (cv === BREAK)
|
|
1749
1749
|
return BREAK;
|
|
1750
1750
|
else if (cv === REMOVE)
|
|
@@ -1771,23 +1771,23 @@ var require_visit = __commonJS({
|
|
|
1771
1771
|
}
|
|
1772
1772
|
return visitor;
|
|
1773
1773
|
}
|
|
1774
|
-
function callVisitor(key, node, visitor,
|
|
1774
|
+
function callVisitor(key, node, visitor, path52) {
|
|
1775
1775
|
if (typeof visitor === "function")
|
|
1776
|
-
return visitor(key, node,
|
|
1776
|
+
return visitor(key, node, path52);
|
|
1777
1777
|
if (identity.isMap(node))
|
|
1778
|
-
return visitor.Map?.(key, node,
|
|
1778
|
+
return visitor.Map?.(key, node, path52);
|
|
1779
1779
|
if (identity.isSeq(node))
|
|
1780
|
-
return visitor.Seq?.(key, node,
|
|
1780
|
+
return visitor.Seq?.(key, node, path52);
|
|
1781
1781
|
if (identity.isPair(node))
|
|
1782
|
-
return visitor.Pair?.(key, node,
|
|
1782
|
+
return visitor.Pair?.(key, node, path52);
|
|
1783
1783
|
if (identity.isScalar(node))
|
|
1784
|
-
return visitor.Scalar?.(key, node,
|
|
1784
|
+
return visitor.Scalar?.(key, node, path52);
|
|
1785
1785
|
if (identity.isAlias(node))
|
|
1786
|
-
return visitor.Alias?.(key, node,
|
|
1786
|
+
return visitor.Alias?.(key, node, path52);
|
|
1787
1787
|
return void 0;
|
|
1788
1788
|
}
|
|
1789
|
-
function replaceNode(key,
|
|
1790
|
-
const parent =
|
|
1789
|
+
function replaceNode(key, path52, node) {
|
|
1790
|
+
const parent = path52[path52.length - 1];
|
|
1791
1791
|
if (identity.isCollection(parent)) {
|
|
1792
1792
|
parent.items[key] = node;
|
|
1793
1793
|
} else if (identity.isPair(parent)) {
|
|
@@ -2397,10 +2397,10 @@ var require_Collection = __commonJS({
|
|
|
2397
2397
|
var createNode = require_createNode();
|
|
2398
2398
|
var identity = require_identity();
|
|
2399
2399
|
var Node = require_Node();
|
|
2400
|
-
function collectionFromPath(schema,
|
|
2400
|
+
function collectionFromPath(schema, path52, value) {
|
|
2401
2401
|
let v = value;
|
|
2402
|
-
for (let i =
|
|
2403
|
-
const k =
|
|
2402
|
+
for (let i = path52.length - 1; i >= 0; --i) {
|
|
2403
|
+
const k = path52[i];
|
|
2404
2404
|
if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
|
|
2405
2405
|
const a = [];
|
|
2406
2406
|
a[k] = v;
|
|
@@ -2419,7 +2419,7 @@ var require_Collection = __commonJS({
|
|
|
2419
2419
|
sourceObjects: /* @__PURE__ */ new Map()
|
|
2420
2420
|
});
|
|
2421
2421
|
}
|
|
2422
|
-
var isEmptyPath = (
|
|
2422
|
+
var isEmptyPath = (path52) => path52 == null || typeof path52 === "object" && !!path52[Symbol.iterator]().next().done;
|
|
2423
2423
|
var Collection = class extends Node.NodeBase {
|
|
2424
2424
|
constructor(type, schema) {
|
|
2425
2425
|
super(type);
|
|
@@ -2449,11 +2449,11 @@ var require_Collection = __commonJS({
|
|
|
2449
2449
|
* be a Pair instance or a `{ key, value }` object, which may not have a key
|
|
2450
2450
|
* that already exists in the map.
|
|
2451
2451
|
*/
|
|
2452
|
-
addIn(
|
|
2453
|
-
if (isEmptyPath(
|
|
2452
|
+
addIn(path52, value) {
|
|
2453
|
+
if (isEmptyPath(path52))
|
|
2454
2454
|
this.add(value);
|
|
2455
2455
|
else {
|
|
2456
|
-
const [key, ...rest] =
|
|
2456
|
+
const [key, ...rest] = path52;
|
|
2457
2457
|
const node = this.get(key, true);
|
|
2458
2458
|
if (identity.isCollection(node))
|
|
2459
2459
|
node.addIn(rest, value);
|
|
@@ -2467,8 +2467,8 @@ var require_Collection = __commonJS({
|
|
|
2467
2467
|
* Removes a value from the collection.
|
|
2468
2468
|
* @returns `true` if the item was found and removed.
|
|
2469
2469
|
*/
|
|
2470
|
-
deleteIn(
|
|
2471
|
-
const [key, ...rest] =
|
|
2470
|
+
deleteIn(path52) {
|
|
2471
|
+
const [key, ...rest] = path52;
|
|
2472
2472
|
if (rest.length === 0)
|
|
2473
2473
|
return this.delete(key);
|
|
2474
2474
|
const node = this.get(key, true);
|
|
@@ -2482,8 +2482,8 @@ var require_Collection = __commonJS({
|
|
|
2482
2482
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
2483
2483
|
* `true` (collections are always returned intact).
|
|
2484
2484
|
*/
|
|
2485
|
-
getIn(
|
|
2486
|
-
const [key, ...rest] =
|
|
2485
|
+
getIn(path52, keepScalar) {
|
|
2486
|
+
const [key, ...rest] = path52;
|
|
2487
2487
|
const node = this.get(key, true);
|
|
2488
2488
|
if (rest.length === 0)
|
|
2489
2489
|
return !keepScalar && identity.isScalar(node) ? node.value : node;
|
|
@@ -2501,8 +2501,8 @@ var require_Collection = __commonJS({
|
|
|
2501
2501
|
/**
|
|
2502
2502
|
* Checks if the collection includes a value with the key `key`.
|
|
2503
2503
|
*/
|
|
2504
|
-
hasIn(
|
|
2505
|
-
const [key, ...rest] =
|
|
2504
|
+
hasIn(path52) {
|
|
2505
|
+
const [key, ...rest] = path52;
|
|
2506
2506
|
if (rest.length === 0)
|
|
2507
2507
|
return this.has(key);
|
|
2508
2508
|
const node = this.get(key, true);
|
|
@@ -2512,8 +2512,8 @@ var require_Collection = __commonJS({
|
|
|
2512
2512
|
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
2513
2513
|
* boolean to add/remove the item from the set.
|
|
2514
2514
|
*/
|
|
2515
|
-
setIn(
|
|
2516
|
-
const [key, ...rest] =
|
|
2515
|
+
setIn(path52, value) {
|
|
2516
|
+
const [key, ...rest] = path52;
|
|
2517
2517
|
if (rest.length === 0) {
|
|
2518
2518
|
this.set(key, value);
|
|
2519
2519
|
} else {
|
|
@@ -5028,9 +5028,9 @@ var require_Document = __commonJS({
|
|
|
5028
5028
|
this.contents.add(value);
|
|
5029
5029
|
}
|
|
5030
5030
|
/** Adds a value to the document. */
|
|
5031
|
-
addIn(
|
|
5031
|
+
addIn(path52, value) {
|
|
5032
5032
|
if (assertCollection(this.contents))
|
|
5033
|
-
this.contents.addIn(
|
|
5033
|
+
this.contents.addIn(path52, value);
|
|
5034
5034
|
}
|
|
5035
5035
|
/**
|
|
5036
5036
|
* Create a new `Alias` node, ensuring that the target `node` has the required anchor.
|
|
@@ -5105,14 +5105,14 @@ var require_Document = __commonJS({
|
|
|
5105
5105
|
* Removes a value from the document.
|
|
5106
5106
|
* @returns `true` if the item was found and removed.
|
|
5107
5107
|
*/
|
|
5108
|
-
deleteIn(
|
|
5109
|
-
if (Collection.isEmptyPath(
|
|
5108
|
+
deleteIn(path52) {
|
|
5109
|
+
if (Collection.isEmptyPath(path52)) {
|
|
5110
5110
|
if (this.contents == null)
|
|
5111
5111
|
return false;
|
|
5112
5112
|
this.contents = null;
|
|
5113
5113
|
return true;
|
|
5114
5114
|
}
|
|
5115
|
-
return assertCollection(this.contents) ? this.contents.deleteIn(
|
|
5115
|
+
return assertCollection(this.contents) ? this.contents.deleteIn(path52) : false;
|
|
5116
5116
|
}
|
|
5117
5117
|
/**
|
|
5118
5118
|
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
@@ -5127,10 +5127,10 @@ var require_Document = __commonJS({
|
|
|
5127
5127
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
5128
5128
|
* `true` (collections are always returned intact).
|
|
5129
5129
|
*/
|
|
5130
|
-
getIn(
|
|
5131
|
-
if (Collection.isEmptyPath(
|
|
5130
|
+
getIn(path52, keepScalar) {
|
|
5131
|
+
if (Collection.isEmptyPath(path52))
|
|
5132
5132
|
return !keepScalar && identity.isScalar(this.contents) ? this.contents.value : this.contents;
|
|
5133
|
-
return identity.isCollection(this.contents) ? this.contents.getIn(
|
|
5133
|
+
return identity.isCollection(this.contents) ? this.contents.getIn(path52, keepScalar) : void 0;
|
|
5134
5134
|
}
|
|
5135
5135
|
/**
|
|
5136
5136
|
* Checks if the document includes a value with the key `key`.
|
|
@@ -5141,10 +5141,10 @@ var require_Document = __commonJS({
|
|
|
5141
5141
|
/**
|
|
5142
5142
|
* Checks if the document includes a value at `path`.
|
|
5143
5143
|
*/
|
|
5144
|
-
hasIn(
|
|
5145
|
-
if (Collection.isEmptyPath(
|
|
5144
|
+
hasIn(path52) {
|
|
5145
|
+
if (Collection.isEmptyPath(path52))
|
|
5146
5146
|
return this.contents !== void 0;
|
|
5147
|
-
return identity.isCollection(this.contents) ? this.contents.hasIn(
|
|
5147
|
+
return identity.isCollection(this.contents) ? this.contents.hasIn(path52) : false;
|
|
5148
5148
|
}
|
|
5149
5149
|
/**
|
|
5150
5150
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
@@ -5161,13 +5161,13 @@ var require_Document = __commonJS({
|
|
|
5161
5161
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
5162
5162
|
* boolean to add/remove the item from the set.
|
|
5163
5163
|
*/
|
|
5164
|
-
setIn(
|
|
5165
|
-
if (Collection.isEmptyPath(
|
|
5164
|
+
setIn(path52, value) {
|
|
5165
|
+
if (Collection.isEmptyPath(path52)) {
|
|
5166
5166
|
this.contents = value;
|
|
5167
5167
|
} else if (this.contents == null) {
|
|
5168
|
-
this.contents = Collection.collectionFromPath(this.schema, Array.from(
|
|
5168
|
+
this.contents = Collection.collectionFromPath(this.schema, Array.from(path52), value);
|
|
5169
5169
|
} else if (assertCollection(this.contents)) {
|
|
5170
|
-
this.contents.setIn(
|
|
5170
|
+
this.contents.setIn(path52, value);
|
|
5171
5171
|
}
|
|
5172
5172
|
}
|
|
5173
5173
|
/**
|
|
@@ -7127,9 +7127,9 @@ var require_cst_visit = __commonJS({
|
|
|
7127
7127
|
visit.BREAK = BREAK;
|
|
7128
7128
|
visit.SKIP = SKIP;
|
|
7129
7129
|
visit.REMOVE = REMOVE;
|
|
7130
|
-
visit.itemAtPath = (cst,
|
|
7130
|
+
visit.itemAtPath = (cst, path52) => {
|
|
7131
7131
|
let item = cst;
|
|
7132
|
-
for (const [field, index] of
|
|
7132
|
+
for (const [field, index] of path52) {
|
|
7133
7133
|
const tok = item?.[field];
|
|
7134
7134
|
if (tok && "items" in tok) {
|
|
7135
7135
|
item = tok.items[index];
|
|
@@ -7138,23 +7138,23 @@ var require_cst_visit = __commonJS({
|
|
|
7138
7138
|
}
|
|
7139
7139
|
return item;
|
|
7140
7140
|
};
|
|
7141
|
-
visit.parentCollection = (cst,
|
|
7142
|
-
const parent = visit.itemAtPath(cst,
|
|
7143
|
-
const field =
|
|
7141
|
+
visit.parentCollection = (cst, path52) => {
|
|
7142
|
+
const parent = visit.itemAtPath(cst, path52.slice(0, -1));
|
|
7143
|
+
const field = path52[path52.length - 1][0];
|
|
7144
7144
|
const coll = parent?.[field];
|
|
7145
7145
|
if (coll && "items" in coll)
|
|
7146
7146
|
return coll;
|
|
7147
7147
|
throw new Error("Parent collection not found");
|
|
7148
7148
|
};
|
|
7149
|
-
function _visit(
|
|
7150
|
-
let ctrl = visitor(item,
|
|
7149
|
+
function _visit(path52, item, visitor) {
|
|
7150
|
+
let ctrl = visitor(item, path52);
|
|
7151
7151
|
if (typeof ctrl === "symbol")
|
|
7152
7152
|
return ctrl;
|
|
7153
7153
|
for (const field of ["key", "value"]) {
|
|
7154
7154
|
const token = item[field];
|
|
7155
7155
|
if (token && "items" in token) {
|
|
7156
7156
|
for (let i = 0; i < token.items.length; ++i) {
|
|
7157
|
-
const ci = _visit(Object.freeze(
|
|
7157
|
+
const ci = _visit(Object.freeze(path52.concat([[field, i]])), token.items[i], visitor);
|
|
7158
7158
|
if (typeof ci === "number")
|
|
7159
7159
|
i = ci - 1;
|
|
7160
7160
|
else if (ci === BREAK)
|
|
@@ -7165,10 +7165,10 @@ var require_cst_visit = __commonJS({
|
|
|
7165
7165
|
}
|
|
7166
7166
|
}
|
|
7167
7167
|
if (typeof ctrl === "function" && field === "key")
|
|
7168
|
-
ctrl = ctrl(item,
|
|
7168
|
+
ctrl = ctrl(item, path52);
|
|
7169
7169
|
}
|
|
7170
7170
|
}
|
|
7171
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
7171
|
+
return typeof ctrl === "function" ? ctrl(item, path52) : ctrl;
|
|
7172
7172
|
}
|
|
7173
7173
|
exports.visit = visit;
|
|
7174
7174
|
}
|
|
@@ -8470,14 +8470,14 @@ var require_parser = __commonJS({
|
|
|
8470
8470
|
case "scalar":
|
|
8471
8471
|
case "single-quoted-scalar":
|
|
8472
8472
|
case "double-quoted-scalar": {
|
|
8473
|
-
const
|
|
8473
|
+
const fs58 = this.flowScalar(this.type);
|
|
8474
8474
|
if (atNextItem || it.value) {
|
|
8475
|
-
map.items.push({ start, key:
|
|
8475
|
+
map.items.push({ start, key: fs58, sep: [] });
|
|
8476
8476
|
this.onKeyLine = true;
|
|
8477
8477
|
} else if (it.sep) {
|
|
8478
|
-
this.stack.push(
|
|
8478
|
+
this.stack.push(fs58);
|
|
8479
8479
|
} else {
|
|
8480
|
-
Object.assign(it, { key:
|
|
8480
|
+
Object.assign(it, { key: fs58, sep: [] });
|
|
8481
8481
|
this.onKeyLine = true;
|
|
8482
8482
|
}
|
|
8483
8483
|
return;
|
|
@@ -8605,13 +8605,13 @@ var require_parser = __commonJS({
|
|
|
8605
8605
|
case "scalar":
|
|
8606
8606
|
case "single-quoted-scalar":
|
|
8607
8607
|
case "double-quoted-scalar": {
|
|
8608
|
-
const
|
|
8608
|
+
const fs58 = this.flowScalar(this.type);
|
|
8609
8609
|
if (!it || it.value)
|
|
8610
|
-
fc.items.push({ start: [], key:
|
|
8610
|
+
fc.items.push({ start: [], key: fs58, sep: [] });
|
|
8611
8611
|
else if (it.sep)
|
|
8612
|
-
this.stack.push(
|
|
8612
|
+
this.stack.push(fs58);
|
|
8613
8613
|
else
|
|
8614
|
-
Object.assign(it, { key:
|
|
8614
|
+
Object.assign(it, { key: fs58, sep: [] });
|
|
8615
8615
|
return;
|
|
8616
8616
|
}
|
|
8617
8617
|
case "flow-map-end":
|
|
@@ -13073,6 +13073,109 @@ var init_agent_src = __esm({
|
|
|
13073
13073
|
}
|
|
13074
13074
|
});
|
|
13075
13075
|
|
|
13076
|
+
// src/scripts/_lib/kernel_rules.ts
|
|
13077
|
+
var KERNEL_RULE_IDS, KERNEL_RULE_FILENAMES, KERNEL_RULE_ID_SET;
|
|
13078
|
+
var init_kernel_rules = __esm({
|
|
13079
|
+
"src/scripts/_lib/kernel_rules.ts"() {
|
|
13080
|
+
"use strict";
|
|
13081
|
+
KERNEL_RULE_IDS = [
|
|
13082
|
+
"agent-authority",
|
|
13083
|
+
"ask-when-uncertain",
|
|
13084
|
+
"commit-policy",
|
|
13085
|
+
"direct-answers",
|
|
13086
|
+
"language-and-tone",
|
|
13087
|
+
"no-cheap-questions",
|
|
13088
|
+
"non-destructive-by-default",
|
|
13089
|
+
"scope-control",
|
|
13090
|
+
"verify-before-complete"
|
|
13091
|
+
];
|
|
13092
|
+
KERNEL_RULE_FILENAMES = new Set(
|
|
13093
|
+
KERNEL_RULE_IDS.map((id) => `${id}.md`)
|
|
13094
|
+
);
|
|
13095
|
+
KERNEL_RULE_ID_SET = new Set(KERNEL_RULE_IDS);
|
|
13096
|
+
}
|
|
13097
|
+
});
|
|
13098
|
+
|
|
13099
|
+
// src/scripts/_lib/obligation_frequency.ts
|
|
13100
|
+
function is_frequency(v) {
|
|
13101
|
+
return typeof v === "string" && FREQUENCIES.includes(v);
|
|
13102
|
+
}
|
|
13103
|
+
function covers(carrier, obligation) {
|
|
13104
|
+
if (obligation === "none") return true;
|
|
13105
|
+
if (carrier.mode === "sweep") return SWEEPABLE.has(obligation);
|
|
13106
|
+
if (carrier.frequency === "none") return false;
|
|
13107
|
+
if (CROSS_ROOT_COVERAGE.some(([c, o]) => c === carrier.frequency && o === obligation)) {
|
|
13108
|
+
return true;
|
|
13109
|
+
}
|
|
13110
|
+
if (ROOT_OF[carrier.frequency] !== ROOT_OF[obligation]) return false;
|
|
13111
|
+
return DEPTH[carrier.frequency] <= DEPTH[obligation];
|
|
13112
|
+
}
|
|
13113
|
+
function frequency_prose_conflicts(body, declared) {
|
|
13114
|
+
const out = [];
|
|
13115
|
+
for (const [freq, re] of PROSE_SIGNALS) {
|
|
13116
|
+
if (!re.test(body)) continue;
|
|
13117
|
+
if (covers({ frequency: declared, mode: "point" }, freq)) continue;
|
|
13118
|
+
if (!out.includes(freq)) out.push(freq);
|
|
13119
|
+
}
|
|
13120
|
+
return out;
|
|
13121
|
+
}
|
|
13122
|
+
function has_frequency_override(text) {
|
|
13123
|
+
return /^#\s*frequency-override:\s*\S/m.test(text);
|
|
13124
|
+
}
|
|
13125
|
+
var FREQUENCIES, ROOT_OF, CROSS_ROOT_COVERAGE, DEPTH, SWEEPABLE, PROSE_SIGNALS;
|
|
13126
|
+
var init_obligation_frequency = __esm({
|
|
13127
|
+
"src/scripts/_lib/obligation_frequency.ts"() {
|
|
13128
|
+
"use strict";
|
|
13129
|
+
FREQUENCIES = [
|
|
13130
|
+
"per-edit",
|
|
13131
|
+
"per-turn",
|
|
13132
|
+
"per-task",
|
|
13133
|
+
"per-session",
|
|
13134
|
+
"per-event",
|
|
13135
|
+
"per-commit",
|
|
13136
|
+
"per-file-write",
|
|
13137
|
+
"none"
|
|
13138
|
+
];
|
|
13139
|
+
ROOT_OF = {
|
|
13140
|
+
"per-turn": "lifecycle",
|
|
13141
|
+
"per-task": "lifecycle",
|
|
13142
|
+
"per-session": "lifecycle",
|
|
13143
|
+
"per-edit": "tool-call",
|
|
13144
|
+
"per-file-write": "tool-call",
|
|
13145
|
+
"per-commit": "repository",
|
|
13146
|
+
"per-event": "external-event",
|
|
13147
|
+
none: "none"
|
|
13148
|
+
};
|
|
13149
|
+
CROSS_ROOT_COVERAGE = [
|
|
13150
|
+
["per-edit", "per-commit"]
|
|
13151
|
+
];
|
|
13152
|
+
DEPTH = {
|
|
13153
|
+
"per-turn": 0,
|
|
13154
|
+
"per-task": 1,
|
|
13155
|
+
"per-session": 2,
|
|
13156
|
+
"per-edit": 0,
|
|
13157
|
+
"per-file-write": 1,
|
|
13158
|
+
"per-commit": 0,
|
|
13159
|
+
"per-event": 0,
|
|
13160
|
+
none: 0
|
|
13161
|
+
};
|
|
13162
|
+
SWEEPABLE = /* @__PURE__ */ new Set([
|
|
13163
|
+
"per-edit",
|
|
13164
|
+
"per-file-write",
|
|
13165
|
+
"per-commit"
|
|
13166
|
+
]);
|
|
13167
|
+
PROSE_SIGNALS = [
|
|
13168
|
+
["per-turn", /\b(every|each) (reply|turn|answer|response)\b/i],
|
|
13169
|
+
["per-turn", /\bper (reply|turn)\b/i],
|
|
13170
|
+
["per-task", /\b(every|each) (new )?task\b/i],
|
|
13171
|
+
["per-edit", /\bafter every (code )?edit\b/i],
|
|
13172
|
+
["per-edit", /\b(every|each) edit\b/i],
|
|
13173
|
+
["per-commit", /\b(in the )?same commit\b/i],
|
|
13174
|
+
["per-commit", /\b(every|each) commit\b/i]
|
|
13175
|
+
];
|
|
13176
|
+
}
|
|
13177
|
+
});
|
|
13178
|
+
|
|
13076
13179
|
// src/scripts/validate_frontmatter.ts
|
|
13077
13180
|
import * as fs18 from "node:fs";
|
|
13078
13181
|
import * as path17 from "node:path";
|
|
@@ -13642,6 +13745,31 @@ function pyRepr(value) {
|
|
|
13642
13745
|
function pyListRepr(values) {
|
|
13643
13746
|
return `[${values.map((v) => pyRepr(v)).join(", ")}]`;
|
|
13644
13747
|
}
|
|
13748
|
+
function check_obligation_frequency(filePath, text, data) {
|
|
13749
|
+
const id = path17.basename(filePath).replace(/\.md$/, "");
|
|
13750
|
+
if (KERNEL_RULE_ID_SET.has(id)) return [];
|
|
13751
|
+
const declared = data["obligation_frequency"];
|
|
13752
|
+
if (!is_frequency(declared)) {
|
|
13753
|
+
return [
|
|
13754
|
+
new SchemaError(
|
|
13755
|
+
"$.obligation_frequency",
|
|
13756
|
+
"required",
|
|
13757
|
+
"Missing required property 'obligation_frequency' \u2014 how often this rule's obligation comes due. Without it check_enforcement_coverage cannot join the rule against its carrier's firing frequency and reports it unclassified."
|
|
13758
|
+
)
|
|
13759
|
+
];
|
|
13760
|
+
}
|
|
13761
|
+
if (has_frequency_override(text)) return [];
|
|
13762
|
+
const conflicts = frequency_prose_conflicts(text, declared);
|
|
13763
|
+
if (conflicts.length === 0) return [];
|
|
13764
|
+
return [
|
|
13765
|
+
new SchemaError(
|
|
13766
|
+
"$.obligation_frequency",
|
|
13767
|
+
"frequency-prose-drift",
|
|
13768
|
+
`declared '${declared}', but the prose reads as ${conflicts.join(" / ")} \u2014 either the declaration or the prose moved. Silence an audited mismatch with a \`# frequency-override: <reason>\` comment in the frontmatter.`,
|
|
13769
|
+
"warning"
|
|
13770
|
+
)
|
|
13771
|
+
];
|
|
13772
|
+
}
|
|
13645
13773
|
function _iter_artefacts(root) {
|
|
13646
13774
|
const targets = [];
|
|
13647
13775
|
const mapping = [
|
|
@@ -13737,6 +13865,9 @@ function _main(argv) {
|
|
|
13737
13865
|
const schema = load_schema(artefactType);
|
|
13738
13866
|
apply_schema_defaults(data, schema);
|
|
13739
13867
|
const errors = validate(data, schema);
|
|
13868
|
+
if (artefactType === "rule") {
|
|
13869
|
+
errors.push(...check_obligation_frequency(p, text, data));
|
|
13870
|
+
}
|
|
13740
13871
|
const fatal = errors.filter((e) => e.severity === "error");
|
|
13741
13872
|
const warnings = errors.filter((e) => e.severity === "warning");
|
|
13742
13873
|
if (fatal.length > 0) {
|
|
@@ -13838,6 +13969,8 @@ var init_validate_frontmatter = __esm({
|
|
|
13838
13969
|
"use strict";
|
|
13839
13970
|
import_yaml3 = __toESM(require_dist(), 1);
|
|
13840
13971
|
init_agent_src();
|
|
13972
|
+
init_kernel_rules();
|
|
13973
|
+
init_obligation_frequency();
|
|
13841
13974
|
_FRONTMATTER_RE = /^---\n([\s\S]*?)\n---\n/;
|
|
13842
13975
|
SchemaError = class {
|
|
13843
13976
|
path;
|
|
@@ -14604,7 +14737,7 @@ function lint_router_frontmatter(ruleId, frontmatter, ruleType) {
|
|
|
14604
14737
|
if (ruleType === "manual") {
|
|
14605
14738
|
return issues;
|
|
14606
14739
|
}
|
|
14607
|
-
const isKernel =
|
|
14740
|
+
const isKernel = KERNEL_RULE_IDS2.has(ruleId) || ruleType === "always";
|
|
14608
14741
|
if (isKernel) {
|
|
14609
14742
|
if (triggers !== null) {
|
|
14610
14743
|
issues.push(
|
|
@@ -17684,7 +17817,7 @@ function _isCliEntry7() {
|
|
|
17684
17817
|
return false;
|
|
17685
17818
|
}
|
|
17686
17819
|
}
|
|
17687
|
-
var _HERE4, REQUIRED_PERSONA_SECTIONS_CORE, REQUIRED_PERSONA_SECTIONS_SPECIALIST, VALID_PERSONA_TIERS, PERSONA_LINE_BUDGETS, REQUIRED_USERTYPE_SECTIONS, USERTYPE_LINE_BUDGET, VALID_PERSONA_WINGS, PERSONA_LINE_BUDGETS_BY_WING, REQUIRED_SKILL_SECTIONS, SECTION_ALIASES, RECOMMENDED_SKILL_SECTIONS, RULE_BAD_SIGNS, FRUGALITY_WRITER_SKILLS, FRUGALITY_CHARTER_RELPATH, FRUGALITY_CHARTER_INDEX_RULES, VAGUE_VALIDATION_PATTERNS, TRIGGER_WARNING_PATTERNS, ORDERED_STEP_PATTERN, SECTION_PATTERN, FRONTMATTER_PATTERN, DESCRIPTION_PATTERN, STATUS_PATTERN, REPLACED_BY_PATTERN, TIER_PATTERN, TYPE_PATTERN, SOURCE_PATTERN, SENIOR_RELATED_SKILLS_PATTERN, SENIOR_RELATED_WHEN_PATTERN, SENIOR_RELATED_WHEN_NOT_PATTERN, SENIOR_PROACTIVE_PATTERN, SENIOR_OUTPUT_PATTERN, H1_PATTERN, DOUBLE_BLANK_PATTERN, VALID_RULE_TYPES, VALID_RULE_SOURCES, ROUTER_ALLOWED_TRIGGER_KEYS,
|
|
17820
|
+
var _HERE4, REQUIRED_PERSONA_SECTIONS_CORE, REQUIRED_PERSONA_SECTIONS_SPECIALIST, VALID_PERSONA_TIERS, PERSONA_LINE_BUDGETS, REQUIRED_USERTYPE_SECTIONS, USERTYPE_LINE_BUDGET, VALID_PERSONA_WINGS, PERSONA_LINE_BUDGETS_BY_WING, REQUIRED_SKILL_SECTIONS, SECTION_ALIASES, RECOMMENDED_SKILL_SECTIONS, RULE_BAD_SIGNS, FRUGALITY_WRITER_SKILLS, FRUGALITY_CHARTER_RELPATH, FRUGALITY_CHARTER_INDEX_RULES, VAGUE_VALIDATION_PATTERNS, TRIGGER_WARNING_PATTERNS, ORDERED_STEP_PATTERN, SECTION_PATTERN, FRONTMATTER_PATTERN, DESCRIPTION_PATTERN, STATUS_PATTERN, REPLACED_BY_PATTERN, TIER_PATTERN, TYPE_PATTERN, SOURCE_PATTERN, SENIOR_RELATED_SKILLS_PATTERN, SENIOR_RELATED_WHEN_PATTERN, SENIOR_RELATED_WHEN_NOT_PATTERN, SENIOR_PROACTIVE_PATTERN, SENIOR_OUTPUT_PATTERN, H1_PATTERN, DOUBLE_BLANK_PATTERN, VALID_RULE_TYPES, VALID_RULE_SOURCES, ROUTER_ALLOWED_TRIGGER_KEYS, KERNEL_RULE_IDS2, VALID_EXECUTION_TYPES, VALID_EXECUTION_HANDLERS, VALID_EXECUTION_SAFETY_MODES, VALID_EXECUTION_FIELDS, WING3_SPINE_SLOTS, CONTEXT_SPINE_INLINE_PATTERN, WING3_SAAS_URL_PATTERN, WING3_VENDOR_BLACKLIST, WING3_STACK_LOCKED_PATTERN, WING3_CHANNEL_TACTIC_PATTERN, WING4_SPINE_SLOTS, WING4_SAAS_URL_PATTERN, WING4_VENDOR_BLACKLIST, WING4_STAGE_AGNOSTIC_PATTERN, Issue, LintResult, _ROLE_CONTRACT_CANDIDATES, _ROLE_CONTRACT_SLUGS_CACHE, _ROLE_CONTRACT_REF_PATTERN, PROCEDURE_HEADING_PATTERN, COMMAND_FRONTMATTER_DELEGATION_KEYS, MD_LINK_PATTERN_G, NAME_PATTERN, DISABLE_MODEL_PATTERN, _INSPECT_VERB_PATTERN, last_changed_scope_reason, last_changed_base_diff_ok, _INTERACTION_NAME_PATTERNS, _INTERACTION_CONTENT_KEYWORDS, _EXEC_FILE_SIGNALS, _EXEC_CONTENT_SIGNALS, _TASK_TYPE_SIGNALS, _VERIFICATION_TOOLS, _FRUGALITY_STANDARDS_PATTERN, _FRUGALITY_CHARTER_LINK_PATTERN, _MD_LINK_PATTERN, _MALICE_CRED_EXFIL, _MALICE_REMOTE_EXEC, _MALICE_FORCE_PUSH, _MALICE_CHMOD_SECRETS, _MALICE_SHELL_INJECT, _MALICE_PATTERNS, _NAG_UPDATE_CHECK, _NAG_STAY_CURRENT, _NAG_SELF_PROMO, _NAG_BEST_SKILL, _NAG_MUST_USE, _NAG_ALWAYS_USE, _NAG_PATTERNS, _OUTPUT_SCHEMA_KEY_PATTERN, _SCHEMA_ARTEFACT_TYPES, ArgError, isCliEntry2;
|
|
17688
17821
|
var init_skill_linter = __esm({
|
|
17689
17822
|
"src/scripts/skill_linter.ts"() {
|
|
17690
17823
|
"use strict";
|
|
@@ -17793,7 +17926,7 @@ var init_skill_linter = __esm({
|
|
|
17793
17926
|
"path_prefix",
|
|
17794
17927
|
"command"
|
|
17795
17928
|
]);
|
|
17796
|
-
|
|
17929
|
+
KERNEL_RULE_IDS2 = /* @__PURE__ */ new Set([
|
|
17797
17930
|
"agent-authority",
|
|
17798
17931
|
"ask-when-uncertain",
|
|
17799
17932
|
"commit-policy",
|
|
@@ -21250,8 +21383,8 @@ function lockfile_path(env) {
|
|
|
21250
21383
|
}
|
|
21251
21384
|
return write_target("installed.lock", { env: env ?? null });
|
|
21252
21385
|
}
|
|
21253
|
-
function read_lockfile(
|
|
21254
|
-
const target =
|
|
21386
|
+
function read_lockfile(path52) {
|
|
21387
|
+
const target = path52 ?? lockfile_path();
|
|
21255
21388
|
let text;
|
|
21256
21389
|
try {
|
|
21257
21390
|
text = fs31.readFileSync(target, { encoding: "utf-8" });
|
|
@@ -21461,18 +21594,18 @@ function manifest_path(project_root, env) {
|
|
|
21461
21594
|
}
|
|
21462
21595
|
return fsPath.join(project_root, DEFAULT_MANIFEST_RELATIVE);
|
|
21463
21596
|
}
|
|
21464
|
-
function read_manifest(
|
|
21597
|
+
function read_manifest(path52) {
|
|
21465
21598
|
let text;
|
|
21466
21599
|
try {
|
|
21467
|
-
text = require_read_text(
|
|
21600
|
+
text = require_read_text(path52);
|
|
21468
21601
|
} catch {
|
|
21469
21602
|
return null;
|
|
21470
21603
|
}
|
|
21471
21604
|
const data = _parse_manual(text);
|
|
21472
21605
|
return _normalise_v2_shape(data);
|
|
21473
21606
|
}
|
|
21474
|
-
function require_read_text(
|
|
21475
|
-
return fs33.readFileSync(
|
|
21607
|
+
function require_read_text(path52) {
|
|
21608
|
+
return fs33.readFileSync(path52, { encoding: "utf-8" });
|
|
21476
21609
|
}
|
|
21477
21610
|
function _normalise_v2_shape(data) {
|
|
21478
21611
|
if (data["tools"] === void 0 || data["tools"] === null) {
|
|
@@ -21653,9 +21786,9 @@ function stable_sort(items, key) {
|
|
|
21653
21786
|
return a.index - b.index;
|
|
21654
21787
|
}).map((entry) => entry.item);
|
|
21655
21788
|
}
|
|
21656
|
-
function write_manifest(
|
|
21789
|
+
function write_manifest(path52, version, tools, options = {}) {
|
|
21657
21790
|
const rendered = _render(version, tools, { deploy_roots: options.deploy_roots ?? null });
|
|
21658
|
-
return write_atomic(
|
|
21791
|
+
return write_atomic(path52, rendered);
|
|
21659
21792
|
}
|
|
21660
21793
|
function upsert_tool(existing, options) {
|
|
21661
21794
|
const {
|
|
@@ -22258,6 +22391,44 @@ var init_duplicate_scope_census = __esm({
|
|
|
22258
22391
|
}
|
|
22259
22392
|
});
|
|
22260
22393
|
|
|
22394
|
+
// src/scripts/_lib/git_common_dir.ts
|
|
22395
|
+
import fs36 from "node:fs";
|
|
22396
|
+
import path34 from "node:path";
|
|
22397
|
+
function realpath_or_self(p) {
|
|
22398
|
+
try {
|
|
22399
|
+
return fs36.realpathSync(p);
|
|
22400
|
+
} catch {
|
|
22401
|
+
return p;
|
|
22402
|
+
}
|
|
22403
|
+
}
|
|
22404
|
+
function git_common_dir(project_root) {
|
|
22405
|
+
const dot_git = path34.join(project_root, ".git");
|
|
22406
|
+
try {
|
|
22407
|
+
const st = fs36.statSync(dot_git);
|
|
22408
|
+
if (st.isDirectory()) {
|
|
22409
|
+
return realpath_or_self(dot_git);
|
|
22410
|
+
}
|
|
22411
|
+
const m = fs36.readFileSync(dot_git, "utf-8").match(/^gitdir:\s*(.+)\s*$/m);
|
|
22412
|
+
if (m === null) {
|
|
22413
|
+
return null;
|
|
22414
|
+
}
|
|
22415
|
+
const gitdir = path34.resolve(project_root, m[1].trim());
|
|
22416
|
+
const commondir_file = path34.join(gitdir, "commondir");
|
|
22417
|
+
if (fs36.existsSync(commondir_file)) {
|
|
22418
|
+
const common = path34.resolve(gitdir, fs36.readFileSync(commondir_file, "utf-8").trim());
|
|
22419
|
+
return realpath_or_self(common);
|
|
22420
|
+
}
|
|
22421
|
+
return realpath_or_self(gitdir);
|
|
22422
|
+
} catch {
|
|
22423
|
+
return null;
|
|
22424
|
+
}
|
|
22425
|
+
}
|
|
22426
|
+
var init_git_common_dir = __esm({
|
|
22427
|
+
"src/scripts/_lib/git_common_dir.ts"() {
|
|
22428
|
+
"use strict";
|
|
22429
|
+
}
|
|
22430
|
+
});
|
|
22431
|
+
|
|
22261
22432
|
// src/scripts/_lib/spawn_env.ts
|
|
22262
22433
|
function isDeniedByFamily(name) {
|
|
22263
22434
|
if (name.startsWith("LD_") || name.startsWith("DYLD_")) return true;
|
|
@@ -22330,8 +22501,8 @@ var init_spawn_env = __esm({
|
|
|
22330
22501
|
|
|
22331
22502
|
// src/scripts/ai_council/events_log.ts
|
|
22332
22503
|
import * as crypto4 from "node:crypto";
|
|
22333
|
-
import * as
|
|
22334
|
-
import * as
|
|
22504
|
+
import * as fs37 from "node:fs";
|
|
22505
|
+
import * as path35 from "node:path";
|
|
22335
22506
|
import { fileURLToPath as fileURLToPath23 } from "node:url";
|
|
22336
22507
|
function _hash_original_ask(originalAsk) {
|
|
22337
22508
|
if (!originalAsk) {
|
|
@@ -22427,9 +22598,9 @@ function appendEvent(event, opts = {}) {
|
|
|
22427
22598
|
}
|
|
22428
22599
|
}
|
|
22429
22600
|
const target = opts.logPath != null ? opts.logPath : _DEFAULT_LOG_PATH;
|
|
22430
|
-
|
|
22601
|
+
fs37.mkdirSync(path35.dirname(target), { recursive: true });
|
|
22431
22602
|
const line = _pyJsonDumpsCompact(record);
|
|
22432
|
-
|
|
22603
|
+
fs37.appendFileSync(target, line + "\n", { encoding: "utf-8" });
|
|
22433
22604
|
return true;
|
|
22434
22605
|
}
|
|
22435
22606
|
function _isoSecondsZ(d) {
|
|
@@ -22527,8 +22698,8 @@ var init_events_log = __esm({
|
|
|
22527
22698
|
]);
|
|
22528
22699
|
_KILL_SWITCH_ENV = "AGENT_CONFIG_NO_EVENTS_LOG";
|
|
22529
22700
|
_HERE11 = fileURLToPath23(import.meta.url);
|
|
22530
|
-
_REPO_ROOT =
|
|
22531
|
-
_DEFAULT_LOG_PATH =
|
|
22701
|
+
_REPO_ROOT = path35.resolve(path35.dirname(_HERE11), "..", "..", "..");
|
|
22702
|
+
_DEFAULT_LOG_PATH = path35.join(
|
|
22532
22703
|
_REPO_ROOT,
|
|
22533
22704
|
"agents",
|
|
22534
22705
|
"runtime",
|
|
@@ -22594,8 +22765,8 @@ __export(clients_exports, {
|
|
|
22594
22765
|
reset_cli_call_counts: () => reset_cli_call_counts
|
|
22595
22766
|
});
|
|
22596
22767
|
import { spawnSync as spawnSync7 } from "node:child_process";
|
|
22597
|
-
import * as
|
|
22598
|
-
import * as
|
|
22768
|
+
import * as fs38 from "node:fs";
|
|
22769
|
+
import * as path36 from "node:path";
|
|
22599
22770
|
function _resolveKeyPath(filename) {
|
|
22600
22771
|
const found = resolve_with_fallback(filename);
|
|
22601
22772
|
if (found !== null) {
|
|
@@ -22631,13 +22802,13 @@ function _setMonotonicSource(fn) {
|
|
|
22631
22802
|
return prev;
|
|
22632
22803
|
}
|
|
22633
22804
|
function _loadKey(p, prefix, installScript) {
|
|
22634
|
-
if (!
|
|
22805
|
+
if (!fs38.existsSync(p)) {
|
|
22635
22806
|
throw new KeyGateError(
|
|
22636
22807
|
`Key not found at ${p}.
|
|
22637
22808
|
Install it with: bash ${installScript}`
|
|
22638
22809
|
);
|
|
22639
22810
|
}
|
|
22640
|
-
const st =
|
|
22811
|
+
const st = fs38.statSync(p);
|
|
22641
22812
|
const mode = st.mode & 511;
|
|
22642
22813
|
if (mode !== 384) {
|
|
22643
22814
|
throw new KeyGateError(
|
|
@@ -22645,7 +22816,7 @@ function _loadKey(p, prefix, installScript) {
|
|
|
22645
22816
|
Fix: chmod 600 ${p}`
|
|
22646
22817
|
);
|
|
22647
22818
|
}
|
|
22648
|
-
const key =
|
|
22819
|
+
const key = fs38.readFileSync(p, { encoding: "utf-8" }).trim();
|
|
22649
22820
|
if (!key) {
|
|
22650
22821
|
throw new KeyGateError(`${p} is empty.`);
|
|
22651
22822
|
}
|
|
@@ -22718,12 +22889,12 @@ function _today_utc_iso() {
|
|
|
22718
22889
|
}
|
|
22719
22890
|
function load_cli_call_counts(p = null) {
|
|
22720
22891
|
const target = p !== null ? p : _cliCallsStatePath();
|
|
22721
|
-
if (!
|
|
22892
|
+
if (!fs38.existsSync(target)) {
|
|
22722
22893
|
return {};
|
|
22723
22894
|
}
|
|
22724
22895
|
let data;
|
|
22725
22896
|
try {
|
|
22726
|
-
data = JSON.parse(
|
|
22897
|
+
data = JSON.parse(fs38.readFileSync(target, { encoding: "utf-8" }));
|
|
22727
22898
|
} catch {
|
|
22728
22899
|
return {};
|
|
22729
22900
|
}
|
|
@@ -22750,8 +22921,8 @@ function record_cli_call(provider, p = null) {
|
|
|
22750
22921
|
const target = p !== null ? p : _cliCallsStatePath();
|
|
22751
22922
|
const counts = load_cli_call_counts(target);
|
|
22752
22923
|
counts[provider] = (counts[provider] ?? 0) + 1;
|
|
22753
|
-
|
|
22754
|
-
|
|
22924
|
+
fs38.mkdirSync(path36.dirname(target), { recursive: true });
|
|
22925
|
+
fs38.writeFileSync(
|
|
22755
22926
|
target,
|
|
22756
22927
|
_jsonDumpsIndent2({ date: _today_utc_iso(), counts }),
|
|
22757
22928
|
{ encoding: "utf-8" }
|
|
@@ -22766,8 +22937,8 @@ function reset_cli_call_counts(provider = null, p = null) {
|
|
|
22766
22937
|
} else {
|
|
22767
22938
|
delete counts[provider];
|
|
22768
22939
|
}
|
|
22769
|
-
|
|
22770
|
-
|
|
22940
|
+
fs38.mkdirSync(path36.dirname(target), { recursive: true });
|
|
22941
|
+
fs38.writeFileSync(
|
|
22771
22942
|
target,
|
|
22772
22943
|
_jsonDumpsIndent2({ date: _today_utc_iso(), counts }),
|
|
22773
22944
|
{ encoding: "utf-8" }
|
|
@@ -23062,7 +23233,7 @@ function _pyJsonStringAscii(s) {
|
|
|
23062
23233
|
return out + '"';
|
|
23063
23234
|
}
|
|
23064
23235
|
function _which(name) {
|
|
23065
|
-
if (name.includes(
|
|
23236
|
+
if (name.includes(path36.sep) || path36.sep !== "/" && name.includes("/")) {
|
|
23066
23237
|
return _isExecutable(name) ? name : null;
|
|
23067
23238
|
}
|
|
23068
23239
|
const pathEnv = process.env.PATH ?? "";
|
|
@@ -23070,12 +23241,12 @@ function _which(name) {
|
|
|
23070
23241
|
return null;
|
|
23071
23242
|
}
|
|
23072
23243
|
const exts = process.platform === "win32" ? (process.env.PATHEXT ?? ".COM;.EXE;.BAT;.CMD").split(";").filter(Boolean) : [""];
|
|
23073
|
-
for (const dir of pathEnv.split(
|
|
23244
|
+
for (const dir of pathEnv.split(path36.delimiter)) {
|
|
23074
23245
|
if (!dir) {
|
|
23075
23246
|
continue;
|
|
23076
23247
|
}
|
|
23077
23248
|
for (const ext of exts) {
|
|
23078
|
-
const candidate =
|
|
23249
|
+
const candidate = path36.join(dir, name + ext);
|
|
23079
23250
|
if (_isExecutable(candidate)) {
|
|
23080
23251
|
return candidate;
|
|
23081
23252
|
}
|
|
@@ -23085,7 +23256,7 @@ function _which(name) {
|
|
|
23085
23256
|
}
|
|
23086
23257
|
function _isExecutable(p) {
|
|
23087
23258
|
try {
|
|
23088
|
-
const st =
|
|
23259
|
+
const st = fs38.statSync(p);
|
|
23089
23260
|
if (!st.isFile()) {
|
|
23090
23261
|
return false;
|
|
23091
23262
|
}
|
|
@@ -23112,7 +23283,7 @@ function _defaultStdin() {
|
|
|
23112
23283
|
function ensure() {
|
|
23113
23284
|
if (buffer === null) {
|
|
23114
23285
|
try {
|
|
23115
|
-
buffer =
|
|
23286
|
+
buffer = fs38.readFileSync(0, { encoding: "utf-8" });
|
|
23116
23287
|
} catch {
|
|
23117
23288
|
buffer = "";
|
|
23118
23289
|
}
|
|
@@ -24359,9 +24530,9 @@ __export(config_exports, {
|
|
|
24359
24530
|
resolve_api_key: () => resolve_api_key,
|
|
24360
24531
|
resolve_config_path: () => resolve_config_path
|
|
24361
24532
|
});
|
|
24362
|
-
import * as
|
|
24533
|
+
import * as fs39 from "node:fs";
|
|
24363
24534
|
import * as os8 from "node:os";
|
|
24364
|
-
import * as
|
|
24535
|
+
import * as path37 from "node:path";
|
|
24365
24536
|
function _pyReprStr(s) {
|
|
24366
24537
|
const hasSingle = s.includes("'");
|
|
24367
24538
|
const hasDouble = s.includes('"');
|
|
@@ -24532,7 +24703,7 @@ function _expanduser2(p) {
|
|
|
24532
24703
|
return os8.homedir();
|
|
24533
24704
|
}
|
|
24534
24705
|
if (p.startsWith("~/") || process.platform === "win32" && p.startsWith("~\\")) {
|
|
24535
|
-
return
|
|
24706
|
+
return path37.join(os8.homedir(), p.slice(2));
|
|
24536
24707
|
}
|
|
24537
24708
|
return p;
|
|
24538
24709
|
}
|
|
@@ -24561,14 +24732,14 @@ function resolve_config_path(project_root, options = {}) {
|
|
|
24561
24732
|
});
|
|
24562
24733
|
}
|
|
24563
24734
|
function load_council_config(p) {
|
|
24564
|
-
if (!
|
|
24735
|
+
if (!fs39.existsSync(p)) {
|
|
24565
24736
|
throw new CouncilConfigError(
|
|
24566
24737
|
`Council config not found at ${p}. Create it per docs/contracts/ai-council-config.md.`
|
|
24567
24738
|
);
|
|
24568
24739
|
}
|
|
24569
24740
|
let raw;
|
|
24570
24741
|
try {
|
|
24571
|
-
const text =
|
|
24742
|
+
const text = fs39.readFileSync(p, "utf-8");
|
|
24572
24743
|
const parsed = (0, import_yaml5.parse)(text, { version: "1.1" });
|
|
24573
24744
|
raw = parsed === null || parsed === void 0 ? {} : parsed;
|
|
24574
24745
|
} catch (exc) {
|
|
@@ -25539,16 +25710,16 @@ function resolve_api_key(ref, scope = "api_key_ref") {
|
|
|
25539
25710
|
}
|
|
25540
25711
|
resolved = found;
|
|
25541
25712
|
}
|
|
25542
|
-
if (!
|
|
25713
|
+
if (!fs39.existsSync(resolved)) {
|
|
25543
25714
|
throw new CouncilConfigError(`${scope}: key file does not exist at ${resolved}.`);
|
|
25544
25715
|
}
|
|
25545
|
-
const mode =
|
|
25716
|
+
const mode = fs39.statSync(resolved).mode & 4095;
|
|
25546
25717
|
if (mode !== 384) {
|
|
25547
25718
|
throw new CouncilConfigError(
|
|
25548
25719
|
`${scope}: unsafe permissions on ${resolved}: got ${_pyOct(mode)}, expected 0o600. Fix: chmod 600 ${resolved}`
|
|
25549
25720
|
);
|
|
25550
25721
|
}
|
|
25551
|
-
const value =
|
|
25722
|
+
const value = fs39.readFileSync(resolved, "utf-8").trim();
|
|
25552
25723
|
if (value === "") {
|
|
25553
25724
|
throw new CouncilConfigError(`${scope}: key file at ${resolved} is empty.`);
|
|
25554
25725
|
}
|
|
@@ -25759,9 +25930,9 @@ var init_agentSwitchDetection = __esm({
|
|
|
25759
25930
|
|
|
25760
25931
|
// src/scripts/_lib/environment_detector.ts
|
|
25761
25932
|
import { spawnSync as spawnSync8 } from "node:child_process";
|
|
25762
|
-
import * as
|
|
25933
|
+
import * as fs40 from "node:fs";
|
|
25763
25934
|
import * as os9 from "node:os";
|
|
25764
|
-
import * as
|
|
25935
|
+
import * as path38 from "node:path";
|
|
25765
25936
|
function knownProviders() {
|
|
25766
25937
|
return Object.keys(PROVIDER_CLI_META);
|
|
25767
25938
|
}
|
|
@@ -25776,7 +25947,7 @@ function classifyBilling(provider, source) {
|
|
|
25776
25947
|
function codexHome(env) {
|
|
25777
25948
|
const map = env ?? process.env;
|
|
25778
25949
|
const override = (map["CODEX_HOME"] ?? "").trim();
|
|
25779
|
-
return override !== "" ? override :
|
|
25950
|
+
return override !== "" ? override : path38.join(homeOf(env), ".codex");
|
|
25780
25951
|
}
|
|
25781
25952
|
function homeOf(env) {
|
|
25782
25953
|
const map = env ?? process.env;
|
|
@@ -25800,14 +25971,14 @@ ${res.stderr ?? ""}`;
|
|
|
25800
25971
|
}
|
|
25801
25972
|
function isFile2(p) {
|
|
25802
25973
|
try {
|
|
25803
|
-
return
|
|
25974
|
+
return fs40.statSync(p).isFile();
|
|
25804
25975
|
} catch {
|
|
25805
25976
|
return false;
|
|
25806
25977
|
}
|
|
25807
25978
|
}
|
|
25808
25979
|
function exists2(p) {
|
|
25809
25980
|
try {
|
|
25810
|
-
return
|
|
25981
|
+
return fs40.existsSync(p);
|
|
25811
25982
|
} catch {
|
|
25812
25983
|
return false;
|
|
25813
25984
|
}
|
|
@@ -25815,7 +25986,7 @@ function exists2(p) {
|
|
|
25815
25986
|
function classifyCodexAuth(authPath) {
|
|
25816
25987
|
let data;
|
|
25817
25988
|
try {
|
|
25818
|
-
data = JSON.parse(
|
|
25989
|
+
data = JSON.parse(fs40.readFileSync(authPath, "utf-8"));
|
|
25819
25990
|
} catch {
|
|
25820
25991
|
return "cli-api-key";
|
|
25821
25992
|
}
|
|
@@ -25832,18 +26003,18 @@ function cliSubscriptionEvidence(provider, home, env, claudeConfigDir) {
|
|
|
25832
26003
|
if (provider === "anthropic") {
|
|
25833
26004
|
const configDir = claudeConfigDir;
|
|
25834
26005
|
for (const rel of [".credentials.json", "credentials.json"]) {
|
|
25835
|
-
const p =
|
|
26006
|
+
const p = path38.join(configDir, rel);
|
|
25836
26007
|
if (isFile2(p)) return { source: "cli-subscription", evidence: p };
|
|
25837
26008
|
}
|
|
25838
26009
|
return null;
|
|
25839
26010
|
}
|
|
25840
26011
|
if (provider === "openai") {
|
|
25841
|
-
const p =
|
|
26012
|
+
const p = path38.join(codexHome(env), "auth.json");
|
|
25842
26013
|
if (isFile2(p)) return { source: classifyCodexAuth(p), evidence: p };
|
|
25843
26014
|
return null;
|
|
25844
26015
|
}
|
|
25845
26016
|
if (provider === "gemini") {
|
|
25846
|
-
const p =
|
|
26017
|
+
const p = path38.join(home, ".gemini", "oauth_creds.json");
|
|
25847
26018
|
if (isFile2(p)) return { source: "cli-subscription", evidence: p };
|
|
25848
26019
|
return null;
|
|
25849
26020
|
}
|
|
@@ -25875,7 +26046,7 @@ function detectHosts(opts) {
|
|
|
25875
26046
|
function detectAuth(opts) {
|
|
25876
26047
|
const env = opts.env ?? process.env;
|
|
25877
26048
|
const home = opts.home ?? homeOf(opts.env);
|
|
25878
|
-
const claudeConfigDir = opts.home === void 0 && opts.env === void 0 ? claude_config_dir() : (env["CLAUDE_CONFIG_DIR"] ?? "").trim() ||
|
|
26049
|
+
const claudeConfigDir = opts.home === void 0 && opts.env === void 0 ? claude_config_dir() : (env["CLAUDE_CONFIG_DIR"] ?? "").trim() || path38.join(home, ".claude");
|
|
25879
26050
|
const auth = [];
|
|
25880
26051
|
const keys = [];
|
|
25881
26052
|
for (const provider of knownProviders()) {
|
|
@@ -26080,7 +26251,7 @@ var init_transport_resolver = __esm({
|
|
|
26080
26251
|
});
|
|
26081
26252
|
|
|
26082
26253
|
// src/scripts/_cli/detection_report.ts
|
|
26083
|
-
import * as
|
|
26254
|
+
import * as path39 from "node:path";
|
|
26084
26255
|
function envRefResolves(ref, env) {
|
|
26085
26256
|
if (ref === null || !ref.startsWith("env:")) return false;
|
|
26086
26257
|
const name = ref.slice("env:".length).trim();
|
|
@@ -26155,7 +26326,7 @@ function cliBinaryPresent(environment, provider, binaryOverride) {
|
|
|
26155
26326
|
const expected = PROVIDER_CLI_META[provider]?.[0];
|
|
26156
26327
|
if (expected === void 0) return false;
|
|
26157
26328
|
return environment.hosts.some(
|
|
26158
|
-
(h) => h.binary !== null && stripExe(
|
|
26329
|
+
(h) => h.binary !== null && stripExe(path39.basename(h.binary)) === expected
|
|
26159
26330
|
);
|
|
26160
26331
|
}
|
|
26161
26332
|
function stripExe(name) {
|
|
@@ -26353,17 +26524,17 @@ var init_config2 = __esm({
|
|
|
26353
26524
|
|
|
26354
26525
|
// src/scripts/ai_team/review_gate.ts
|
|
26355
26526
|
import * as crypto5 from "node:crypto";
|
|
26356
|
-
import * as
|
|
26527
|
+
import * as fs41 from "node:fs";
|
|
26357
26528
|
import * as os10 from "node:os";
|
|
26358
|
-
import * as
|
|
26529
|
+
import * as path40 from "node:path";
|
|
26359
26530
|
function _workspace_state_segment(workspace_root) {
|
|
26360
26531
|
let canonical = workspace_root;
|
|
26361
26532
|
try {
|
|
26362
|
-
canonical =
|
|
26533
|
+
canonical = fs41.realpathSync.native(workspace_root);
|
|
26363
26534
|
} catch {
|
|
26364
26535
|
canonical = workspace_root;
|
|
26365
26536
|
}
|
|
26366
|
-
const slug_source =
|
|
26537
|
+
const slug_source = path40.basename(workspace_root) || "workspace";
|
|
26367
26538
|
const slug = slug_source.replace(/[^a-zA-Z0-9._-]+/g, "-").replace(/^-+|-+$/g, "") || "workspace";
|
|
26368
26539
|
const hash = crypto5.createHash("sha256").update(canonical).digest("hex").slice(0, 16);
|
|
26369
26540
|
return `${slug}-${hash}`;
|
|
@@ -26373,19 +26544,19 @@ function upstream_state_dir_candidates(workspace_root) {
|
|
|
26373
26544
|
const candidates = [];
|
|
26374
26545
|
const env = (process.env["CLAUDE_PLUGIN_DATA"] ?? "").trim();
|
|
26375
26546
|
if (env !== "") {
|
|
26376
|
-
candidates.push(
|
|
26547
|
+
candidates.push(path40.join(env, "state", segment));
|
|
26377
26548
|
}
|
|
26378
26549
|
candidates.push(
|
|
26379
|
-
|
|
26550
|
+
path40.join(claude_config_dir(), "plugins", "data", _CODEX_PLUGIN_DATA_DIRNAME, "state", segment)
|
|
26380
26551
|
);
|
|
26381
|
-
candidates.push(
|
|
26552
|
+
candidates.push(path40.join(os10.tmpdir(), "codex-companion", segment));
|
|
26382
26553
|
return candidates;
|
|
26383
26554
|
}
|
|
26384
26555
|
function upstream_gate_enabled(workspace_root) {
|
|
26385
26556
|
for (const dir of upstream_state_dir_candidates(workspace_root)) {
|
|
26386
26557
|
let parsed;
|
|
26387
26558
|
try {
|
|
26388
|
-
parsed = JSON.parse(
|
|
26559
|
+
parsed = JSON.parse(fs41.readFileSync(path40.join(dir, "state.json"), "utf-8"));
|
|
26389
26560
|
} catch {
|
|
26390
26561
|
continue;
|
|
26391
26562
|
}
|
|
@@ -26438,7 +26609,7 @@ var init_review_gate = __esm({
|
|
|
26438
26609
|
init_claude_plugin();
|
|
26439
26610
|
init_state_io();
|
|
26440
26611
|
init_config2();
|
|
26441
|
-
GATE_LEDGER_RELPATH =
|
|
26612
|
+
GATE_LEDGER_RELPATH = path40.join("agents", "runtime", "team", "events.log");
|
|
26442
26613
|
_CODEX_PLUGIN_DATA_DIRNAME = `${CODEX_PLUGIN_ID}-${CODEX_MARKETPLACE_NAME}`;
|
|
26443
26614
|
UPSTREAM_GATE_COST_WARNING = "The review gate can create a long-running Claude/Codex loop and may drain usage limits quickly.";
|
|
26444
26615
|
}
|
|
@@ -26452,9 +26623,9 @@ var init_surface_tiers = __esm({
|
|
|
26452
26623
|
});
|
|
26453
26624
|
|
|
26454
26625
|
// src/scripts/_lib/scoped_projection.ts
|
|
26455
|
-
import * as
|
|
26626
|
+
import * as fs42 from "node:fs";
|
|
26456
26627
|
import { createRequire as createRequire5 } from "node:module";
|
|
26457
|
-
import * as
|
|
26628
|
+
import * as path41 from "node:path";
|
|
26458
26629
|
function isPlainObject2(v) {
|
|
26459
26630
|
return typeof v === "object" && v !== null && !Array.isArray(v);
|
|
26460
26631
|
}
|
|
@@ -26472,8 +26643,8 @@ function yamlSafeLoad(text) {
|
|
|
26472
26643
|
}
|
|
26473
26644
|
}
|
|
26474
26645
|
function load_packs_registry(package_root) {
|
|
26475
|
-
const vocab_path =
|
|
26476
|
-
const data = yamlSafeLoad(
|
|
26646
|
+
const vocab_path = path41.join(package_root, PACKS_YML_REL);
|
|
26647
|
+
const data = yamlSafeLoad(fs42.readFileSync(vocab_path, "utf-8"));
|
|
26477
26648
|
if (!Array.isArray(data)) {
|
|
26478
26649
|
throw new Error(`packs.yml did not parse to a list: ${vocab_path}`);
|
|
26479
26650
|
}
|
|
@@ -26545,13 +26716,13 @@ var init_scoped_projection = __esm({
|
|
|
26545
26716
|
"engineering",
|
|
26546
26717
|
"agent-config-maintainer"
|
|
26547
26718
|
]);
|
|
26548
|
-
PACKS_YML_REL =
|
|
26719
|
+
PACKS_YML_REL = path41.join("src", "config", "discovery", "packs.yml");
|
|
26549
26720
|
RULE_PACKS_AUTO = "auto";
|
|
26550
26721
|
}
|
|
26551
26722
|
});
|
|
26552
26723
|
|
|
26553
26724
|
// src/install/ruleInScope.ts
|
|
26554
|
-
import * as
|
|
26725
|
+
import * as fs43 from "node:fs";
|
|
26555
26726
|
function parseYaml4(text) {
|
|
26556
26727
|
try {
|
|
26557
26728
|
const data = YAML4.parse(text, { version: "1.1" });
|
|
@@ -26589,7 +26760,7 @@ function rule_in_scope(source_path, scope, pack_scope = null, role_scope = null)
|
|
|
26589
26760
|
if (scope === null && pack_scope === null && role_scope === null) {
|
|
26590
26761
|
return true;
|
|
26591
26762
|
}
|
|
26592
|
-
const [meta] = parseFrontmatter(
|
|
26763
|
+
const [meta] = parseFrontmatter(fs43.readFileSync(source_path, "utf-8"));
|
|
26593
26764
|
if (meta["type"] === "always" || meta["alwaysApply"] === true) {
|
|
26594
26765
|
return true;
|
|
26595
26766
|
}
|
|
@@ -26614,8 +26785,8 @@ var init_ruleInScope = __esm({
|
|
|
26614
26785
|
});
|
|
26615
26786
|
|
|
26616
26787
|
// src/install/rule_scope.ts
|
|
26617
|
-
import * as
|
|
26618
|
-
import * as
|
|
26788
|
+
import * as fs44 from "node:fs";
|
|
26789
|
+
import * as path42 from "node:path";
|
|
26619
26790
|
function _list(value) {
|
|
26620
26791
|
if (Array.isArray(value) && value.length > 0) {
|
|
26621
26792
|
return value.map((v) => String(v));
|
|
@@ -26647,7 +26818,7 @@ function ruleFileArrives(sourcePath, scope) {
|
|
|
26647
26818
|
if (!sourcePath.endsWith(".md")) {
|
|
26648
26819
|
return true;
|
|
26649
26820
|
}
|
|
26650
|
-
const basename18 =
|
|
26821
|
+
const basename18 = path42.basename(sourcePath);
|
|
26651
26822
|
if (COMPAT_ALWAYS_EXCLUDED.includes(basename18)) {
|
|
26652
26823
|
return false;
|
|
26653
26824
|
}
|
|
@@ -26656,7 +26827,7 @@ function ruleFileArrives(sourcePath, scope) {
|
|
|
26656
26827
|
function excludedRuleBasenames(rulesDir, scope) {
|
|
26657
26828
|
let entries;
|
|
26658
26829
|
try {
|
|
26659
|
-
entries =
|
|
26830
|
+
entries = fs44.readdirSync(rulesDir).sort();
|
|
26660
26831
|
} catch {
|
|
26661
26832
|
return [];
|
|
26662
26833
|
}
|
|
@@ -26665,9 +26836,9 @@ function excludedRuleBasenames(rulesDir, scope) {
|
|
|
26665
26836
|
if (!name.endsWith(".md")) {
|
|
26666
26837
|
continue;
|
|
26667
26838
|
}
|
|
26668
|
-
const full =
|
|
26839
|
+
const full = path42.join(rulesDir, name);
|
|
26669
26840
|
try {
|
|
26670
|
-
if (!
|
|
26841
|
+
if (!fs44.statSync(full).isFile()) {
|
|
26671
26842
|
continue;
|
|
26672
26843
|
}
|
|
26673
26844
|
} catch {
|
|
@@ -26758,21 +26929,21 @@ __export(cmd_doctor_exports, {
|
|
|
26758
26929
|
main: () => main15
|
|
26759
26930
|
});
|
|
26760
26931
|
import * as crypto6 from "node:crypto";
|
|
26761
|
-
import * as
|
|
26932
|
+
import * as fs45 from "node:fs";
|
|
26762
26933
|
import * as os11 from "node:os";
|
|
26763
|
-
import * as
|
|
26934
|
+
import * as path43 from "node:path";
|
|
26764
26935
|
import process15 from "node:process";
|
|
26765
26936
|
import { fileURLToPath as fileURLToPath24, pathToFileURL as pathToFileURL15 } from "node:url";
|
|
26766
26937
|
function expanduser5(p) {
|
|
26767
26938
|
if (p === "~") return os11.homedir();
|
|
26768
26939
|
if (p.startsWith("~/") || p.startsWith("~\\")) {
|
|
26769
|
-
return
|
|
26940
|
+
return path43.join(os11.homedir(), p.slice(2));
|
|
26770
26941
|
}
|
|
26771
26942
|
return p;
|
|
26772
26943
|
}
|
|
26773
26944
|
function pathExists(p) {
|
|
26774
26945
|
try {
|
|
26775
|
-
|
|
26946
|
+
fs45.statSync(p);
|
|
26776
26947
|
return true;
|
|
26777
26948
|
} catch {
|
|
26778
26949
|
return false;
|
|
@@ -26780,27 +26951,27 @@ function pathExists(p) {
|
|
|
26780
26951
|
}
|
|
26781
26952
|
function isFile3(p) {
|
|
26782
26953
|
try {
|
|
26783
|
-
return
|
|
26954
|
+
return fs45.statSync(p).isFile();
|
|
26784
26955
|
} catch {
|
|
26785
26956
|
return false;
|
|
26786
26957
|
}
|
|
26787
26958
|
}
|
|
26788
26959
|
function isDir2(p) {
|
|
26789
26960
|
try {
|
|
26790
|
-
return
|
|
26961
|
+
return fs45.statSync(p).isDirectory();
|
|
26791
26962
|
} catch {
|
|
26792
26963
|
return false;
|
|
26793
26964
|
}
|
|
26794
26965
|
}
|
|
26795
26966
|
function resolvePath(p) {
|
|
26796
26967
|
try {
|
|
26797
|
-
return
|
|
26968
|
+
return fs45.realpathSync(path43.resolve(p));
|
|
26798
26969
|
} catch {
|
|
26799
|
-
return
|
|
26970
|
+
return path43.resolve(p);
|
|
26800
26971
|
}
|
|
26801
26972
|
}
|
|
26802
26973
|
function readText2(p) {
|
|
26803
|
-
return
|
|
26974
|
+
return fs45.readFileSync(p, "utf-8");
|
|
26804
26975
|
}
|
|
26805
26976
|
function _jsonStrAscii3(s) {
|
|
26806
26977
|
let out = '"';
|
|
@@ -26907,7 +27078,7 @@ function _resolve_project_root(arg) {
|
|
|
26907
27078
|
return resolve_project_root(arg);
|
|
26908
27079
|
}
|
|
26909
27080
|
function _detect_install_mode(project_root) {
|
|
26910
|
-
const marker =
|
|
27081
|
+
const marker = path43.join(project_root, _INSTALL_MODE_MARKER_REL);
|
|
26911
27082
|
if (isFile3(marker)) {
|
|
26912
27083
|
let value;
|
|
26913
27084
|
try {
|
|
@@ -26919,9 +27090,9 @@ function _detect_install_mode(project_root) {
|
|
|
26919
27090
|
return [value, "marker-file"];
|
|
26920
27091
|
}
|
|
26921
27092
|
}
|
|
26922
|
-
const has_agents_md = pathExists(
|
|
27093
|
+
const has_agents_md = pathExists(path43.join(project_root, "AGENTS.md"));
|
|
26923
27094
|
const has_copilot = pathExists(
|
|
26924
|
-
|
|
27095
|
+
path43.join(project_root, ".github", "copilot-instructions.md")
|
|
26925
27096
|
);
|
|
26926
27097
|
if (has_agents_md && has_copilot) {
|
|
26927
27098
|
return ["full", "heuristic"];
|
|
@@ -26941,7 +27112,7 @@ function _settings_layer_chain(project_root) {
|
|
|
26941
27112
|
return layers;
|
|
26942
27113
|
}
|
|
26943
27114
|
function _detect_wrapper(project_root) {
|
|
26944
|
-
const wrapper =
|
|
27115
|
+
const wrapper = path43.join(project_root, "agent-config");
|
|
26945
27116
|
if (!pathExists(wrapper)) {
|
|
26946
27117
|
return { path: String(wrapper), exists: false, embedded_root: null };
|
|
26947
27118
|
}
|
|
@@ -27008,21 +27179,21 @@ function _emit_context_text(ctx) {
|
|
|
27008
27179
|
}
|
|
27009
27180
|
function _resolve_path(project_root, raw) {
|
|
27010
27181
|
let p = expanduser5(raw);
|
|
27011
|
-
if (!
|
|
27012
|
-
p =
|
|
27182
|
+
if (!path43.isAbsolute(p)) {
|
|
27183
|
+
p = path43.join(project_root, p);
|
|
27013
27184
|
}
|
|
27014
27185
|
return p;
|
|
27015
27186
|
}
|
|
27016
27187
|
function _sha256(p) {
|
|
27017
27188
|
try {
|
|
27018
|
-
const data =
|
|
27189
|
+
const data = fs45.readFileSync(p);
|
|
27019
27190
|
return crypto6.createHash("sha256").update(data).digest("hex");
|
|
27020
27191
|
} catch {
|
|
27021
27192
|
return null;
|
|
27022
27193
|
}
|
|
27023
27194
|
}
|
|
27024
27195
|
function _read_inline_package_tag(p) {
|
|
27025
|
-
if (
|
|
27196
|
+
if (path43.extname(p) !== ".md") {
|
|
27026
27197
|
return NO_FRONTMATTER;
|
|
27027
27198
|
}
|
|
27028
27199
|
let text;
|
|
@@ -27151,13 +27322,13 @@ function rglob2(root) {
|
|
|
27151
27322
|
const walk = (dir) => {
|
|
27152
27323
|
let entries;
|
|
27153
27324
|
try {
|
|
27154
|
-
entries =
|
|
27325
|
+
entries = fs45.readdirSync(dir, { withFileTypes: true });
|
|
27155
27326
|
} catch {
|
|
27156
27327
|
return;
|
|
27157
27328
|
}
|
|
27158
27329
|
entries.sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0);
|
|
27159
27330
|
for (const ent of entries) {
|
|
27160
|
-
const full =
|
|
27331
|
+
const full = path43.join(dir, ent.name);
|
|
27161
27332
|
out.push(full);
|
|
27162
27333
|
let dirLike = ent.isDirectory();
|
|
27163
27334
|
if (ent.isSymbolicLink()) {
|
|
@@ -27232,19 +27403,19 @@ function _foreign_records(project_root, foreign) {
|
|
|
27232
27403
|
return out;
|
|
27233
27404
|
}
|
|
27234
27405
|
function relativeTo(p, base) {
|
|
27235
|
-
const rel =
|
|
27406
|
+
const rel = path43.relative(base, p);
|
|
27236
27407
|
if (rel === "") return rel;
|
|
27237
|
-
if (rel.startsWith("..") ||
|
|
27408
|
+
if (rel.startsWith("..") || path43.isAbsolute(rel)) {
|
|
27238
27409
|
return null;
|
|
27239
27410
|
}
|
|
27240
27411
|
return rel;
|
|
27241
27412
|
}
|
|
27242
27413
|
function _is_global_only_consumer(project_root) {
|
|
27243
|
-
return isFile3(
|
|
27414
|
+
return isFile3(path43.join(project_root, INSTALL_MODE_MARKER_RELATIVE)) || isDir2(path43.join(project_root, "agents", "overrides"));
|
|
27244
27415
|
}
|
|
27245
27416
|
function _check_scope(project_root) {
|
|
27246
27417
|
for (const marker of ["pnpm-workspace.yaml", "lerna.json"]) {
|
|
27247
|
-
if (pathExists(
|
|
27418
|
+
if (pathExists(path43.join(project_root, marker))) {
|
|
27248
27419
|
return {
|
|
27249
27420
|
id: "scope",
|
|
27250
27421
|
status: "warn",
|
|
@@ -27253,7 +27424,7 @@ function _check_scope(project_root) {
|
|
|
27253
27424
|
};
|
|
27254
27425
|
}
|
|
27255
27426
|
}
|
|
27256
|
-
const pkg =
|
|
27427
|
+
const pkg = path43.join(project_root, "package.json");
|
|
27257
27428
|
if (pathExists(pkg)) {
|
|
27258
27429
|
try {
|
|
27259
27430
|
const data = JSON.parse(readText2(pkg));
|
|
@@ -27276,26 +27447,8 @@ function _check_scope(project_root) {
|
|
|
27276
27447
|
};
|
|
27277
27448
|
}
|
|
27278
27449
|
function _git_config_path(project_root) {
|
|
27279
|
-
const
|
|
27280
|
-
|
|
27281
|
-
const st = fs44.statSync(gd);
|
|
27282
|
-
if (st.isDirectory()) {
|
|
27283
|
-
return path42.join(gd, "config");
|
|
27284
|
-
}
|
|
27285
|
-
const m = readText2(gd).match(/^gitdir:\s*(.+)\s*$/m);
|
|
27286
|
-
if (m === null) {
|
|
27287
|
-
return null;
|
|
27288
|
-
}
|
|
27289
|
-
const gdPath = path42.resolve(project_root, m[1].trim());
|
|
27290
|
-
const commondirFile = path42.join(gdPath, "commondir");
|
|
27291
|
-
if (pathExists(commondirFile)) {
|
|
27292
|
-
const common = path42.resolve(gdPath, readText2(commondirFile).trim());
|
|
27293
|
-
return path42.join(common, "config");
|
|
27294
|
-
}
|
|
27295
|
-
return path42.join(gdPath, "config");
|
|
27296
|
-
} catch {
|
|
27297
|
-
return null;
|
|
27298
|
-
}
|
|
27450
|
+
const common = git_common_dir(project_root);
|
|
27451
|
+
return common === null ? null : path43.join(common, "config");
|
|
27299
27452
|
}
|
|
27300
27453
|
function _parse_git_user(configText) {
|
|
27301
27454
|
let inUser = false;
|
|
@@ -27325,7 +27478,7 @@ function _check_git_identity(project_root) {
|
|
|
27325
27478
|
}
|
|
27326
27479
|
let ident = _parse_git_user(readText2(cfgPath));
|
|
27327
27480
|
if (ident.name === null && ident.email === null) {
|
|
27328
|
-
const globalCfg =
|
|
27481
|
+
const globalCfg = path43.join(os11.homedir(), ".gitconfig");
|
|
27329
27482
|
if (pathExists(globalCfg)) {
|
|
27330
27483
|
ident = _parse_git_user(readText2(globalCfg));
|
|
27331
27484
|
}
|
|
@@ -27386,7 +27539,7 @@ function _package_root() {
|
|
|
27386
27539
|
}
|
|
27387
27540
|
function _current_package_version() {
|
|
27388
27541
|
try {
|
|
27389
|
-
const data = JSON.parse(readText2(
|
|
27542
|
+
const data = JSON.parse(readText2(path43.join(_package_root(), "package.json")));
|
|
27390
27543
|
const v = data["version"];
|
|
27391
27544
|
if (typeof v === "string" && v.trim()) {
|
|
27392
27545
|
return v.trim();
|
|
@@ -27430,7 +27583,7 @@ function _check_lockfile_freshness(manifest) {
|
|
|
27430
27583
|
};
|
|
27431
27584
|
}
|
|
27432
27585
|
function shutilWhich(name) {
|
|
27433
|
-
if (
|
|
27586
|
+
if (path43.dirname(name) !== "." && (name.includes("/") || name.includes("\\"))) {
|
|
27434
27587
|
return isExecutableFile(name) ? name : null;
|
|
27435
27588
|
}
|
|
27436
27589
|
const pathEnv = process15.env["PATH"] || "";
|
|
@@ -27443,12 +27596,12 @@ function shutilWhich(name) {
|
|
|
27443
27596
|
if (seenDirs.has(d)) continue;
|
|
27444
27597
|
seenDirs.add(d);
|
|
27445
27598
|
for (const ext of exts) {
|
|
27446
|
-
const candidate =
|
|
27599
|
+
const candidate = path43.join(d, name + (ext === "" ? "" : ext.toLowerCase() === ext ? ext : ext));
|
|
27447
27600
|
if (isExecutableFile(candidate)) {
|
|
27448
27601
|
return candidate;
|
|
27449
27602
|
}
|
|
27450
27603
|
if (ext !== "") {
|
|
27451
|
-
const upper =
|
|
27604
|
+
const upper = path43.join(d, name + ext);
|
|
27452
27605
|
if (isExecutableFile(upper)) return upper;
|
|
27453
27606
|
}
|
|
27454
27607
|
}
|
|
@@ -27457,10 +27610,10 @@ function shutilWhich(name) {
|
|
|
27457
27610
|
}
|
|
27458
27611
|
function isExecutableFile(p) {
|
|
27459
27612
|
try {
|
|
27460
|
-
const st =
|
|
27613
|
+
const st = fs45.statSync(p);
|
|
27461
27614
|
if (!st.isFile()) return false;
|
|
27462
27615
|
if (process15.platform === "win32") return true;
|
|
27463
|
-
|
|
27616
|
+
fs45.accessSync(p, fs45.constants.X_OK);
|
|
27464
27617
|
return true;
|
|
27465
27618
|
} catch {
|
|
27466
27619
|
return false;
|
|
@@ -27524,7 +27677,7 @@ function _check_claude_plugin() {
|
|
|
27524
27677
|
remedy: ""
|
|
27525
27678
|
};
|
|
27526
27679
|
}
|
|
27527
|
-
const projection =
|
|
27680
|
+
const projection = path43.join(os11.homedir(), ".claude", "skills");
|
|
27528
27681
|
const projection_present = isDir2(projection);
|
|
27529
27682
|
if (projection_present) {
|
|
27530
27683
|
return {
|
|
@@ -27561,8 +27714,8 @@ function _check_claude_command_wrappers() {
|
|
|
27561
27714
|
remedy: ""
|
|
27562
27715
|
};
|
|
27563
27716
|
}
|
|
27564
|
-
const anchor =
|
|
27565
|
-
const commands_dir =
|
|
27717
|
+
const anchor = path43.join(os11.homedir(), ".claude");
|
|
27718
|
+
const commands_dir = path43.join(anchor, "commands");
|
|
27566
27719
|
if (!isDir2(commands_dir)) {
|
|
27567
27720
|
return {
|
|
27568
27721
|
id: "claude-command-wrappers",
|
|
@@ -27571,8 +27724,8 @@ function _check_claude_command_wrappers() {
|
|
|
27571
27724
|
remedy: ""
|
|
27572
27725
|
};
|
|
27573
27726
|
}
|
|
27574
|
-
const flat_probe =
|
|
27575
|
-
const wrapper_probe =
|
|
27727
|
+
const flat_probe = fs45.existsSync(path43.join(commands_dir, "commit.md"));
|
|
27728
|
+
const wrapper_probe = fs45.existsSync(path43.join(anchor, "skills", "commit", "SKILL.md"));
|
|
27576
27729
|
if (wrapper_probe) {
|
|
27577
27730
|
return {
|
|
27578
27731
|
id: "claude-command-wrappers",
|
|
@@ -27597,7 +27750,7 @@ function _check_claude_command_wrappers() {
|
|
|
27597
27750
|
};
|
|
27598
27751
|
}
|
|
27599
27752
|
function _check_surface_state() {
|
|
27600
|
-
const matrix_path =
|
|
27753
|
+
const matrix_path = path43.join(_package_root(), "src", "config", "surface-matrix.yml");
|
|
27601
27754
|
if (!isFile3(matrix_path)) {
|
|
27602
27755
|
return {
|
|
27603
27756
|
id: "surface-state",
|
|
@@ -27621,7 +27774,7 @@ function _check_surface_state() {
|
|
|
27621
27774
|
remedy: "agent-config upgrade (reinstalls the package data files)"
|
|
27622
27775
|
};
|
|
27623
27776
|
}
|
|
27624
|
-
const _expand = (p) => p.startsWith("~/") ?
|
|
27777
|
+
const _expand = (p) => p.startsWith("~/") ? path43.join(os11.homedir(), p.slice(2)) : path43.join(_package_root(), p);
|
|
27625
27778
|
const violations = [];
|
|
27626
27779
|
const remedies = [];
|
|
27627
27780
|
let checked = 0;
|
|
@@ -27663,7 +27816,7 @@ function _check_surface_state() {
|
|
|
27663
27816
|
}
|
|
27664
27817
|
function pathExistsAny(p) {
|
|
27665
27818
|
try {
|
|
27666
|
-
|
|
27819
|
+
fs45.statSync(p);
|
|
27667
27820
|
return true;
|
|
27668
27821
|
} catch {
|
|
27669
27822
|
return false;
|
|
@@ -27679,13 +27832,13 @@ function _check_hook_wiring() {
|
|
|
27679
27832
|
remedy: ""
|
|
27680
27833
|
};
|
|
27681
27834
|
}
|
|
27682
|
-
const settings_path =
|
|
27835
|
+
const settings_path = path43.join(os11.homedir(), ".claude", "settings.json");
|
|
27683
27836
|
let missing;
|
|
27684
27837
|
try {
|
|
27685
27838
|
const matrix = build_claude_hook_matrix(
|
|
27686
|
-
|
|
27839
|
+
path43.join(_package_root(), "src", "scripts", "hook_manifest.yaml")
|
|
27687
27840
|
);
|
|
27688
|
-
const settings = pathExists(settings_path) ? JSON.parse(
|
|
27841
|
+
const settings = pathExists(settings_path) ? JSON.parse(fs45.readFileSync(settings_path, "utf8")) : {};
|
|
27689
27842
|
const hooks = (settings["hooks"] ?? {}) || {};
|
|
27690
27843
|
missing = Object.keys(matrix).filter((ev) => {
|
|
27691
27844
|
const groups = hooks[ev];
|
|
@@ -27760,7 +27913,7 @@ function _check_mcp_mode(project_root) {
|
|
|
27760
27913
|
];
|
|
27761
27914
|
const found = [];
|
|
27762
27915
|
for (const [rel, label] of candidates) {
|
|
27763
|
-
const p =
|
|
27916
|
+
const p = path43.join(project_root, rel);
|
|
27764
27917
|
if (!pathExists(p)) {
|
|
27765
27918
|
continue;
|
|
27766
27919
|
}
|
|
@@ -27792,7 +27945,7 @@ function _check_mcp_mode(project_root) {
|
|
|
27792
27945
|
};
|
|
27793
27946
|
}
|
|
27794
27947
|
function _check_offline_readiness() {
|
|
27795
|
-
const script =
|
|
27948
|
+
const script = path43.join(_package_root(), "src", "scripts", "hermetic-install.sh");
|
|
27796
27949
|
if (!pathExists(script)) {
|
|
27797
27950
|
return {
|
|
27798
27951
|
id: "offline-readiness",
|
|
@@ -27850,7 +28003,7 @@ function _check_stale_orphans() {
|
|
|
27850
28003
|
(a, b) => a < b ? -1 : a > b ? 1 : 0
|
|
27851
28004
|
);
|
|
27852
28005
|
for (const root_name of ownedSorted) {
|
|
27853
|
-
const root =
|
|
28006
|
+
const root = path43.join(anchor, root_name);
|
|
27854
28007
|
if (!isDir2(root)) {
|
|
27855
28008
|
continue;
|
|
27856
28009
|
}
|
|
@@ -27865,7 +28018,7 @@ function _check_stale_orphans() {
|
|
|
27865
28018
|
if (rel === null) {
|
|
27866
28019
|
continue;
|
|
27867
28020
|
}
|
|
27868
|
-
const relPosix2 = rel.split(
|
|
28021
|
+
const relPosix2 = rel.split(path43.sep).join("/");
|
|
27869
28022
|
if (recorded_set.has(relPosix2)) {
|
|
27870
28023
|
continue;
|
|
27871
28024
|
}
|
|
@@ -27914,14 +28067,14 @@ function _check_rule_scope_drift(project_root) {
|
|
|
27914
28067
|
let rules_dir = null;
|
|
27915
28068
|
let found = 0;
|
|
27916
28069
|
for (const rel of _RULE_PROJECTION_DIRS) {
|
|
27917
|
-
const cand =
|
|
28070
|
+
const cand = path43.join(project_root, rel);
|
|
27918
28071
|
if (!isDir2(cand)) {
|
|
27919
28072
|
continue;
|
|
27920
28073
|
}
|
|
27921
28074
|
let count = 0;
|
|
27922
28075
|
try {
|
|
27923
|
-
for (const name of
|
|
27924
|
-
if (name.endsWith(".md") && isFile3(
|
|
28076
|
+
for (const name of fs45.readdirSync(cand)) {
|
|
28077
|
+
if (name.endsWith(".md") && isFile3(path43.join(cand, name))) {
|
|
27925
28078
|
count += 1;
|
|
27926
28079
|
}
|
|
27927
28080
|
}
|
|
@@ -27975,14 +28128,14 @@ function _check_rule_scope_drift(project_root) {
|
|
|
27975
28128
|
};
|
|
27976
28129
|
}
|
|
27977
28130
|
function _check_duplicate_scope_rules(project_root, userRulesDirOverride) {
|
|
27978
|
-
const user_rules_dir = userRulesDirOverride ??
|
|
28131
|
+
const user_rules_dir = userRulesDirOverride ?? path43.join(os11.homedir(), ".claude", "rules");
|
|
27979
28132
|
let project_rules_dir = null;
|
|
27980
28133
|
if (_is_source_repo(project_root)) {
|
|
27981
|
-
const cand =
|
|
28134
|
+
const cand = path43.join(project_root, "dist", "agent-src", "rules");
|
|
27982
28135
|
if (isDir2(cand)) project_rules_dir = cand;
|
|
27983
28136
|
} else {
|
|
27984
28137
|
for (const rel of _RULE_PROJECTION_DIRS) {
|
|
27985
|
-
const cand =
|
|
28138
|
+
const cand = path43.join(project_root, rel);
|
|
27986
28139
|
if (isDir2(cand)) {
|
|
27987
28140
|
project_rules_dir = cand;
|
|
27988
28141
|
break;
|
|
@@ -28051,7 +28204,7 @@ function _check_mcp_beta_readiness(project_root) {
|
|
|
28051
28204
|
}
|
|
28052
28205
|
const pending = [];
|
|
28053
28206
|
for (const [gate_id, rel] of MCP_BETA_GATES) {
|
|
28054
|
-
if (!pathExists(
|
|
28207
|
+
if (!pathExists(path43.join(project_root, rel))) {
|
|
28055
28208
|
pending.push(`${gate_id} (${rel})`);
|
|
28056
28209
|
}
|
|
28057
28210
|
}
|
|
@@ -28072,7 +28225,7 @@ function _check_mcp_beta_readiness(project_root) {
|
|
|
28072
28225
|
}
|
|
28073
28226
|
function _check_tier_usage_readiness(project_root) {
|
|
28074
28227
|
const settings_file = project_settings_path(project_root);
|
|
28075
|
-
let log_path =
|
|
28228
|
+
let log_path = path43.join(project_root, ".agent-tier-usage.jsonl");
|
|
28076
28229
|
let enabled = false;
|
|
28077
28230
|
if (isFile3(settings_file)) {
|
|
28078
28231
|
let raw;
|
|
@@ -28091,7 +28244,7 @@ function _check_tier_usage_readiness(project_root) {
|
|
|
28091
28244
|
const outputRaw = tu["output"];
|
|
28092
28245
|
const output = typeof outputRaw === "object" && outputRaw !== null && !Array.isArray(outputRaw) ? outputRaw : {};
|
|
28093
28246
|
if (typeof output["path"] === "string" && output["path"].trim()) {
|
|
28094
|
-
log_path =
|
|
28247
|
+
log_path = path43.join(project_root, output["path"].trim());
|
|
28095
28248
|
}
|
|
28096
28249
|
const val = tu["enabled"];
|
|
28097
28250
|
if (typeof val === "boolean") {
|
|
@@ -28116,7 +28269,7 @@ function _check_tier_usage_readiness(project_root) {
|
|
|
28116
28269
|
return {
|
|
28117
28270
|
id: "tier-usage-readiness",
|
|
28118
28271
|
status: "warn",
|
|
28119
|
-
message: `tier-usage telemetry on but ${
|
|
28272
|
+
message: `tier-usage telemetry on but ${path43.basename(log_path)} not yet written \u2014 no signal accumulated`,
|
|
28120
28273
|
remedy: "run any tracked command to seed the log; the dispatcher writes one record per invocation"
|
|
28121
28274
|
};
|
|
28122
28275
|
}
|
|
@@ -28131,7 +28284,7 @@ function _check_tier_usage_readiness(project_root) {
|
|
|
28131
28284
|
return {
|
|
28132
28285
|
id: "tier-usage-readiness",
|
|
28133
28286
|
status: "fail",
|
|
28134
|
-
message: `cannot read ${
|
|
28287
|
+
message: `cannot read ${path43.basename(log_path)}: ${osErrorStr2(exc)}`,
|
|
28135
28288
|
remedy: "fix permissions on the tier-usage log"
|
|
28136
28289
|
};
|
|
28137
28290
|
}
|
|
@@ -28162,7 +28315,7 @@ function _check_tier_usage_readiness(project_root) {
|
|
|
28162
28315
|
return {
|
|
28163
28316
|
id: "tier-usage-readiness",
|
|
28164
28317
|
status: "fail",
|
|
28165
|
-
message: `${total} record(s) in ${
|
|
28318
|
+
message: `${total} record(s) in ${path43.basename(log_path)} but 0 passed the privacy floor \u2014 report would refuse to render`,
|
|
28166
28319
|
remedy: "inspect the log; the dispatcher is writing records the contract forbids (paths, argv, message bodies)"
|
|
28167
28320
|
};
|
|
28168
28321
|
}
|
|
@@ -28170,19 +28323,19 @@ function _check_tier_usage_readiness(project_root) {
|
|
|
28170
28323
|
return {
|
|
28171
28324
|
id: "tier-usage-readiness",
|
|
28172
28325
|
status: "warn",
|
|
28173
|
-
message: `${
|
|
28326
|
+
message: `${path43.basename(log_path)} present but empty \u2014 no signal yet`,
|
|
28174
28327
|
remedy: "run any tracked command to seed the log"
|
|
28175
28328
|
};
|
|
28176
28329
|
}
|
|
28177
28330
|
return {
|
|
28178
28331
|
id: "tier-usage-readiness",
|
|
28179
28332
|
status: "ok",
|
|
28180
|
-
message: `${valid} record(s) past the privacy floor in ${
|
|
28333
|
+
message: `${valid} record(s) past the privacy floor in ${path43.basename(log_path)} \u2014 retiering signal available`,
|
|
28181
28334
|
remedy: ""
|
|
28182
28335
|
};
|
|
28183
28336
|
}
|
|
28184
28337
|
function readText0(p) {
|
|
28185
|
-
return
|
|
28338
|
+
return fs45.readFileSync(p, "utf-8");
|
|
28186
28339
|
}
|
|
28187
28340
|
function osErrorStr2(exc) {
|
|
28188
28341
|
if (exc && typeof exc === "object" && "message" in exc) {
|
|
@@ -28354,7 +28507,7 @@ function _epoch_seconds(value) {
|
|
|
28354
28507
|
function _codex_auth_expiry(auth_path) {
|
|
28355
28508
|
let data;
|
|
28356
28509
|
try {
|
|
28357
|
-
data = JSON.parse(
|
|
28510
|
+
data = JSON.parse(fs45.readFileSync(auth_path, "utf-8"));
|
|
28358
28511
|
} catch {
|
|
28359
28512
|
return null;
|
|
28360
28513
|
}
|
|
@@ -28516,7 +28669,7 @@ function _check_team(project_root) {
|
|
|
28516
28669
|
if (binary_resolved === null) {
|
|
28517
28670
|
remedies.push("install the codex CLI: `npm install -g @openai/codex`");
|
|
28518
28671
|
}
|
|
28519
|
-
const auth_path =
|
|
28672
|
+
const auth_path = path43.join(_codex_home(), "auth.json");
|
|
28520
28673
|
const authed = pathExists(auth_path);
|
|
28521
28674
|
let auth_str;
|
|
28522
28675
|
if (!authed) {
|
|
@@ -28596,7 +28749,7 @@ function _check_unsupported_combos(manifest) {
|
|
|
28596
28749
|
};
|
|
28597
28750
|
}
|
|
28598
28751
|
function _wizard_state_path() {
|
|
28599
|
-
return
|
|
28752
|
+
return path43.join(event4u_root(), "state", "wizard-state.json");
|
|
28600
28753
|
}
|
|
28601
28754
|
function _check_wizard_state() {
|
|
28602
28755
|
const state_pth = _wizard_state_path();
|
|
@@ -28676,7 +28829,7 @@ function _check_wizard_state() {
|
|
|
28676
28829
|
};
|
|
28677
28830
|
}
|
|
28678
28831
|
function _check_settings_review_pending() {
|
|
28679
|
-
const delta_pth =
|
|
28832
|
+
const delta_pth = path43.join(event4u_root(), "state", "settings-delta.json");
|
|
28680
28833
|
if (!pathExists(delta_pth)) {
|
|
28681
28834
|
return {
|
|
28682
28835
|
id: "settings-review-pending",
|
|
@@ -28702,7 +28855,7 @@ function _check_settings_review_pending() {
|
|
|
28702
28855
|
}
|
|
28703
28856
|
function _check_memory_merge_union(project_root) {
|
|
28704
28857
|
const remedy = "run: npx tsx src/scripts/sync_gitattributes.ts (or `agent-config refresh --project`)";
|
|
28705
|
-
const target =
|
|
28858
|
+
const target = path43.join(project_root, DEFAULT_GITATTRIBUTES);
|
|
28706
28859
|
if (!pathExists(target)) {
|
|
28707
28860
|
return {
|
|
28708
28861
|
id: "memory-merge-union",
|
|
@@ -29169,7 +29322,7 @@ function _run_repair(opts) {
|
|
|
29169
29322
|
};
|
|
29170
29323
|
if (exists3) {
|
|
29171
29324
|
try {
|
|
29172
|
-
|
|
29325
|
+
fs45.unlinkSync(state_pth);
|
|
29173
29326
|
} catch (exc) {
|
|
29174
29327
|
payload["action"] = "error";
|
|
29175
29328
|
payload["error"] = osErrorStr2(exc);
|
|
@@ -29264,13 +29417,13 @@ function _isCliEntry15() {
|
|
|
29264
29417
|
if (process15.argv[1] === void 0) {
|
|
29265
29418
|
return false;
|
|
29266
29419
|
}
|
|
29267
|
-
const argvUrl = pathToFileURL15(
|
|
29420
|
+
const argvUrl = pathToFileURL15(path43.resolve(process15.argv[1])).href;
|
|
29268
29421
|
if (import.meta.url === argvUrl) {
|
|
29269
29422
|
return true;
|
|
29270
29423
|
}
|
|
29271
29424
|
try {
|
|
29272
|
-
const here =
|
|
29273
|
-
const argv =
|
|
29425
|
+
const here = fs45.realpathSync(fileURLToPath24(import.meta.url));
|
|
29426
|
+
const argv = fs45.realpathSync(path43.resolve(process15.argv[1]));
|
|
29274
29427
|
return here === argv;
|
|
29275
29428
|
} catch {
|
|
29276
29429
|
return false;
|
|
@@ -29289,6 +29442,7 @@ var init_cmd_doctor = __esm({
|
|
|
29289
29442
|
init_user_global_paths();
|
|
29290
29443
|
init_global_deploy_inventory();
|
|
29291
29444
|
init_duplicate_scope_census();
|
|
29445
|
+
init_git_common_dir();
|
|
29292
29446
|
init_sync_gitattributes();
|
|
29293
29447
|
init_agent_settings();
|
|
29294
29448
|
init_clients();
|
|
@@ -29478,9 +29632,9 @@ function detectToolPresence(root) {
|
|
|
29478
29632
|
agentsMd: existsSync20(join40(root, "AGENTS.md"))
|
|
29479
29633
|
};
|
|
29480
29634
|
}
|
|
29481
|
-
function isDir3(
|
|
29635
|
+
function isDir3(path52) {
|
|
29482
29636
|
try {
|
|
29483
|
-
return statSync28(
|
|
29637
|
+
return statSync28(path52).isDirectory();
|
|
29484
29638
|
} catch {
|
|
29485
29639
|
return false;
|
|
29486
29640
|
}
|
|
@@ -29542,9 +29696,9 @@ __export(cmd_conformance_exports, {
|
|
|
29542
29696
|
routeTargetPaths: () => routeTargetPaths,
|
|
29543
29697
|
runConformanceChecks: () => runConformanceChecks
|
|
29544
29698
|
});
|
|
29545
|
-
import * as
|
|
29699
|
+
import * as fs46 from "node:fs";
|
|
29546
29700
|
import * as os12 from "node:os";
|
|
29547
|
-
import * as
|
|
29701
|
+
import * as path44 from "node:path";
|
|
29548
29702
|
import process16 from "node:process";
|
|
29549
29703
|
import { spawnSync as spawnSync9 } from "node:child_process";
|
|
29550
29704
|
import { fileURLToPath as fileURLToPath25, pathToFileURL as pathToFileURL16 } from "node:url";
|
|
@@ -29561,17 +29715,17 @@ function conformanceLogPath() {
|
|
|
29561
29715
|
if (override && override.trim().length > 0) {
|
|
29562
29716
|
return override;
|
|
29563
29717
|
}
|
|
29564
|
-
return
|
|
29718
|
+
return path44.join(os12.homedir(), ".event4u", "agent-config", "conformance-log.jsonl");
|
|
29565
29719
|
}
|
|
29566
29720
|
function installLogPath() {
|
|
29567
29721
|
const override = process16.env["AGENT_CONFIG_INSTALL_LOG"];
|
|
29568
29722
|
if (override && override.trim().length > 0) {
|
|
29569
29723
|
return override;
|
|
29570
29724
|
}
|
|
29571
|
-
return
|
|
29725
|
+
return path44.join(os12.homedir(), ".event4u", "agent-config", "install-log.jsonl");
|
|
29572
29726
|
}
|
|
29573
29727
|
function _check_txlog_clean(logPath = installLogPath()) {
|
|
29574
|
-
if (!
|
|
29728
|
+
if (!fs46.existsSync(logPath)) {
|
|
29575
29729
|
return {
|
|
29576
29730
|
id: "txlog-clean",
|
|
29577
29731
|
status: "ok",
|
|
@@ -29605,11 +29759,11 @@ function _check_txlog_clean(logPath = installLogPath()) {
|
|
|
29605
29759
|
};
|
|
29606
29760
|
}
|
|
29607
29761
|
function routeTargetPaths(target) {
|
|
29608
|
-
return routeTargetPathsPosix(target).map((rel) =>
|
|
29762
|
+
return routeTargetPathsPosix(target).map((rel) => path44.join(...rel.split("/")));
|
|
29609
29763
|
}
|
|
29610
29764
|
function _check_router_pointers(packageRoot = PACKAGE_ROOT2) {
|
|
29611
|
-
const routerPath =
|
|
29612
|
-
if (!
|
|
29765
|
+
const routerPath = path44.join(packageRoot, "dist", "router.json");
|
|
29766
|
+
if (!fs46.existsSync(routerPath)) {
|
|
29613
29767
|
return {
|
|
29614
29768
|
id: "router-pointers",
|
|
29615
29769
|
status: "fail",
|
|
@@ -29619,7 +29773,7 @@ function _check_router_pointers(packageRoot = PACKAGE_ROOT2) {
|
|
|
29619
29773
|
}
|
|
29620
29774
|
let router;
|
|
29621
29775
|
try {
|
|
29622
|
-
router = JSON.parse(
|
|
29776
|
+
router = JSON.parse(fs46.readFileSync(routerPath, "utf8"));
|
|
29623
29777
|
} catch (exc) {
|
|
29624
29778
|
return {
|
|
29625
29779
|
id: "router-pointers",
|
|
@@ -29628,13 +29782,13 @@ function _check_router_pointers(packageRoot = PACKAGE_ROOT2) {
|
|
|
29628
29782
|
remedy: "reinstall the package \u2014 dist/router.json is corrupt"
|
|
29629
29783
|
};
|
|
29630
29784
|
}
|
|
29631
|
-
const rulesDir =
|
|
29785
|
+
const rulesDir = path44.join(packageRoot, "dist", "agent-src", "rules");
|
|
29632
29786
|
const broken = [];
|
|
29633
29787
|
let ids = 0;
|
|
29634
29788
|
let targets = 0;
|
|
29635
29789
|
for (const kernelId of router["kernel"] ?? []) {
|
|
29636
29790
|
ids += 1;
|
|
29637
|
-
if (!
|
|
29791
|
+
if (!fs46.existsSync(path44.join(rulesDir, `${kernelId}.md`))) {
|
|
29638
29792
|
broken.push(`kernel:${kernelId} \u2192 rules/${kernelId}.md missing`);
|
|
29639
29793
|
}
|
|
29640
29794
|
}
|
|
@@ -29642,7 +29796,7 @@ function _check_router_pointers(packageRoot = PACKAGE_ROOT2) {
|
|
|
29642
29796
|
for (const entry of router[tier] ?? []) {
|
|
29643
29797
|
const ruleId = String(entry["id"] ?? "");
|
|
29644
29798
|
ids += 1;
|
|
29645
|
-
if (!
|
|
29799
|
+
if (!fs46.existsSync(path44.join(rulesDir, `${ruleId}.md`))) {
|
|
29646
29800
|
broken.push(`${tier}:${ruleId} \u2192 rules/${ruleId}.md missing`);
|
|
29647
29801
|
}
|
|
29648
29802
|
for (const target of entry["routes_to"] ?? []) {
|
|
@@ -29652,7 +29806,7 @@ function _check_router_pointers(packageRoot = PACKAGE_ROOT2) {
|
|
|
29652
29806
|
broken.push(`${ruleId} \u2192 unparseable routes_to ${JSON.stringify(target)}`);
|
|
29653
29807
|
continue;
|
|
29654
29808
|
}
|
|
29655
|
-
if (!candidates.some((rel) =>
|
|
29809
|
+
if (!candidates.some((rel) => fs46.existsSync(path44.join(packageRoot, rel)))) {
|
|
29656
29810
|
broken.push(`${ruleId} \u2192 ${target} (${candidates[0]} missing)`);
|
|
29657
29811
|
}
|
|
29658
29812
|
}
|
|
@@ -29684,9 +29838,9 @@ function detectSmokePlatform(projectRoot) {
|
|
|
29684
29838
|
return "claude";
|
|
29685
29839
|
}
|
|
29686
29840
|
function dispatcherRunner(packageRoot) {
|
|
29687
|
-
const localTsx =
|
|
29688
|
-
const script =
|
|
29689
|
-
if (
|
|
29841
|
+
const localTsx = path44.join(packageRoot, "node_modules", ".bin", "tsx");
|
|
29842
|
+
const script = path44.join(packageRoot, "src", "scripts", "hooks", "dispatch_hook.ts");
|
|
29843
|
+
if (fs46.existsSync(localTsx)) {
|
|
29690
29844
|
return [localTsx, script];
|
|
29691
29845
|
}
|
|
29692
29846
|
return ["npx", "tsx", script];
|
|
@@ -29736,12 +29890,12 @@ function _check_hook_dispatcher(projectRoot, packageRoot = PACKAGE_ROOT2, opts =
|
|
|
29736
29890
|
};
|
|
29737
29891
|
}
|
|
29738
29892
|
function readSettingsMode(projectRoot) {
|
|
29739
|
-
const settingsPath =
|
|
29740
|
-
if (!
|
|
29893
|
+
const settingsPath = path44.join(projectRoot, ".agent-settings.yml");
|
|
29894
|
+
if (!fs46.existsSync(settingsPath)) {
|
|
29741
29895
|
return "eager-all";
|
|
29742
29896
|
}
|
|
29743
29897
|
try {
|
|
29744
|
-
const parsed = YAML6.parse(
|
|
29898
|
+
const parsed = YAML6.parse(fs46.readFileSync(settingsPath, "utf8"));
|
|
29745
29899
|
const lean = parsed?.["lean_projection"] ?? null;
|
|
29746
29900
|
const mode = lean?.["mode"];
|
|
29747
29901
|
return typeof mode === "string" && mode.length > 0 ? mode : "eager-all";
|
|
@@ -29752,7 +29906,7 @@ function readSettingsMode(projectRoot) {
|
|
|
29752
29906
|
function kernelIdsFromRouter(packageRoot) {
|
|
29753
29907
|
try {
|
|
29754
29908
|
const router = JSON.parse(
|
|
29755
|
-
|
|
29909
|
+
fs46.readFileSync(path44.join(packageRoot, "dist", "router.json"), "utf8")
|
|
29756
29910
|
);
|
|
29757
29911
|
return new Set((router["kernel"] ?? []).map(String));
|
|
29758
29912
|
} catch {
|
|
@@ -29769,8 +29923,8 @@ function _check_lean_projection(projectRoot, packageRoot = PACKAGE_ROOT2, projec
|
|
|
29769
29923
|
remedy: "set lean_projection.mode to 'eager-all' or 'thin' in .agent-settings.yml"
|
|
29770
29924
|
};
|
|
29771
29925
|
}
|
|
29772
|
-
const rulesDir = projectedRulesDir ??
|
|
29773
|
-
if (!
|
|
29926
|
+
const rulesDir = projectedRulesDir ?? path44.join(projectRoot, ".augment", "rules");
|
|
29927
|
+
if (!fs46.existsSync(rulesDir)) {
|
|
29774
29928
|
return {
|
|
29775
29929
|
id: "lean-projection",
|
|
29776
29930
|
status: "skipped",
|
|
@@ -29779,7 +29933,7 @@ function _check_lean_projection(projectRoot, packageRoot = PACKAGE_ROOT2, projec
|
|
|
29779
29933
|
};
|
|
29780
29934
|
}
|
|
29781
29935
|
const kernel = kernelIdsFromRouter(packageRoot);
|
|
29782
|
-
const files =
|
|
29936
|
+
const files = fs46.readdirSync(rulesDir).filter((f) => f.endsWith(".md") && f !== "INDEX.md").sort();
|
|
29783
29937
|
const nonKernel = files.filter((f) => !kernel.has(f.replace(/\.md$/, "")));
|
|
29784
29938
|
if (nonKernel.length === 0) {
|
|
29785
29939
|
return {
|
|
@@ -29793,7 +29947,7 @@ function _check_lean_projection(projectRoot, packageRoot = PACKAGE_ROOT2, projec
|
|
|
29793
29947
|
for (const f of nonKernel) {
|
|
29794
29948
|
let text = "";
|
|
29795
29949
|
try {
|
|
29796
|
-
text =
|
|
29950
|
+
text = fs46.readFileSync(path44.join(rulesDir, f), "utf8");
|
|
29797
29951
|
} catch {
|
|
29798
29952
|
continue;
|
|
29799
29953
|
}
|
|
@@ -29824,8 +29978,8 @@ function _check_lean_projection(projectRoot, packageRoot = PACKAGE_ROOT2, projec
|
|
|
29824
29978
|
function _check_host_manifest(projectRoot) {
|
|
29825
29979
|
const detected = Object.entries(detectToolPresence(projectRoot)).filter(([, v]) => v === true).map(([k]) => k);
|
|
29826
29980
|
const detectedNote = detected.length > 0 ? `detected surfaces: ${detected.join(", ")}` : "no surfaces detected";
|
|
29827
|
-
const settingsPath =
|
|
29828
|
-
if (!
|
|
29981
|
+
const settingsPath = path44.join(projectRoot, ".agent-settings.yml");
|
|
29982
|
+
if (!fs46.existsSync(settingsPath)) {
|
|
29829
29983
|
return {
|
|
29830
29984
|
id: "host-manifest",
|
|
29831
29985
|
status: "ok",
|
|
@@ -29835,7 +29989,7 @@ function _check_host_manifest(projectRoot) {
|
|
|
29835
29989
|
}
|
|
29836
29990
|
let parsed = null;
|
|
29837
29991
|
try {
|
|
29838
|
-
parsed = YAML6.parse(
|
|
29992
|
+
parsed = YAML6.parse(fs46.readFileSync(settingsPath, "utf8"));
|
|
29839
29993
|
} catch (exc) {
|
|
29840
29994
|
return {
|
|
29841
29995
|
id: "host-manifest",
|
|
@@ -30032,13 +30186,13 @@ function _isCliEntry16() {
|
|
|
30032
30186
|
if (process16.argv[1] === void 0) {
|
|
30033
30187
|
return false;
|
|
30034
30188
|
}
|
|
30035
|
-
const argvUrl = pathToFileURL16(
|
|
30189
|
+
const argvUrl = pathToFileURL16(path44.resolve(process16.argv[1])).href;
|
|
30036
30190
|
if (import.meta.url === argvUrl) {
|
|
30037
30191
|
return true;
|
|
30038
30192
|
}
|
|
30039
30193
|
try {
|
|
30040
|
-
const here =
|
|
30041
|
-
const argv =
|
|
30194
|
+
const here = fs46.realpathSync(fileURLToPath25(import.meta.url));
|
|
30195
|
+
const argv = fs46.realpathSync(path44.resolve(process16.argv[1]));
|
|
30042
30196
|
return here === argv;
|
|
30043
30197
|
} catch {
|
|
30044
30198
|
return false;
|
|
@@ -30102,7 +30256,7 @@ __export(settings_exports, {
|
|
|
30102
30256
|
read_tier_usage_settings: () => read_tier_usage_settings
|
|
30103
30257
|
});
|
|
30104
30258
|
import { createRequire as createRequire6 } from "node:module";
|
|
30105
|
-
import * as
|
|
30259
|
+
import * as fs47 from "node:fs";
|
|
30106
30260
|
function _isPlainObject8(v) {
|
|
30107
30261
|
return typeof v === "object" && v !== null && !Array.isArray(v) && !(v instanceof Date);
|
|
30108
30262
|
}
|
|
@@ -30139,7 +30293,7 @@ function _coerce_path(value, def) {
|
|
|
30139
30293
|
}
|
|
30140
30294
|
function _isFile13(p) {
|
|
30141
30295
|
try {
|
|
30142
|
-
return
|
|
30296
|
+
return fs47.statSync(p).isFile();
|
|
30143
30297
|
} catch {
|
|
30144
30298
|
return false;
|
|
30145
30299
|
}
|
|
@@ -30150,7 +30304,7 @@ function read_settings(p) {
|
|
|
30150
30304
|
if (_isFile13(p)) {
|
|
30151
30305
|
let raw = {};
|
|
30152
30306
|
try {
|
|
30153
|
-
raw = YAML7.parse(
|
|
30307
|
+
raw = YAML7.parse(fs47.readFileSync(p, "utf-8"), { version: "1.1" });
|
|
30154
30308
|
if (raw === null || raw === void 0) {
|
|
30155
30309
|
raw = {};
|
|
30156
30310
|
}
|
|
@@ -30184,7 +30338,7 @@ function read_tier_usage_settings(p) {
|
|
|
30184
30338
|
if (_isFile13(p)) {
|
|
30185
30339
|
let raw = {};
|
|
30186
30340
|
try {
|
|
30187
|
-
raw = YAML7.parse(
|
|
30341
|
+
raw = YAML7.parse(fs47.readFileSync(p, "utf-8"), { version: "1.1" });
|
|
30188
30342
|
if (raw === null || raw === void 0) {
|
|
30189
30343
|
raw = {};
|
|
30190
30344
|
}
|
|
@@ -30722,7 +30876,7 @@ __export(aggregator_exports, {
|
|
|
30722
30876
|
aggregate: () => aggregate2,
|
|
30723
30877
|
rank_artefacts: () => rank_artefacts
|
|
30724
30878
|
});
|
|
30725
|
-
import * as
|
|
30879
|
+
import * as fs48 from "node:fs";
|
|
30726
30880
|
function _key(kind, artId) {
|
|
30727
30881
|
return `${kind}\0${artId}`;
|
|
30728
30882
|
}
|
|
@@ -30759,7 +30913,7 @@ function* _iter_events(log_path) {
|
|
|
30759
30913
|
if (!_isFile14(log_path)) {
|
|
30760
30914
|
return;
|
|
30761
30915
|
}
|
|
30762
|
-
const text =
|
|
30916
|
+
const text = fs48.readFileSync(log_path, "utf-8");
|
|
30763
30917
|
const lines = _pyFileLines(text);
|
|
30764
30918
|
let lineNo = 0;
|
|
30765
30919
|
for (const line of lines) {
|
|
@@ -30793,7 +30947,7 @@ function _pyFileLines(text) {
|
|
|
30793
30947
|
}
|
|
30794
30948
|
function _isFile14(p) {
|
|
30795
30949
|
try {
|
|
30796
|
-
return
|
|
30950
|
+
return fs48.statSync(p).isFile();
|
|
30797
30951
|
} catch {
|
|
30798
30952
|
return false;
|
|
30799
30953
|
}
|
|
@@ -31307,7 +31461,7 @@ var init_report_renderer = __esm({
|
|
|
31307
31461
|
});
|
|
31308
31462
|
|
|
31309
31463
|
// src/scripts/ai_council/bundler.ts
|
|
31310
|
-
import * as
|
|
31464
|
+
import * as fs49 from "node:fs";
|
|
31311
31465
|
function _context(mode, text, manifest = [], excluded = []) {
|
|
31312
31466
|
return { mode, text, manifest, excluded };
|
|
31313
31467
|
}
|
|
@@ -31365,10 +31519,10 @@ function bundle_prompt(text) {
|
|
|
31365
31519
|
return _context("prompt", _enforceSize(redacted, "prompt"), ["<inline prompt>"]);
|
|
31366
31520
|
}
|
|
31367
31521
|
function bundle_roadmap(p) {
|
|
31368
|
-
if (!
|
|
31522
|
+
if (!fs49.existsSync(p)) {
|
|
31369
31523
|
throw new FileNotFoundError2(`Roadmap not found: ${p}`);
|
|
31370
31524
|
}
|
|
31371
|
-
const raw =
|
|
31525
|
+
const raw = fs49.readFileSync(p, { encoding: "utf-8" });
|
|
31372
31526
|
const redacted = redact(raw);
|
|
31373
31527
|
return _context(
|
|
31374
31528
|
"roadmap",
|
|
@@ -31931,8 +32085,8 @@ not. Cite the peer-reviewer label and the targeted response label
|
|
|
31931
32085
|
});
|
|
31932
32086
|
|
|
31933
32087
|
// src/scripts/ai_council/advisors.ts
|
|
31934
|
-
import * as
|
|
31935
|
-
import * as
|
|
32088
|
+
import * as fs50 from "node:fs";
|
|
32089
|
+
import * as path45 from "node:path";
|
|
31936
32090
|
function _split_frontmatter(raw) {
|
|
31937
32091
|
const match = _FRONTMATTER_RE2.exec(raw);
|
|
31938
32092
|
if (!match) {
|
|
@@ -31960,12 +32114,12 @@ function _display_name_from(advisor_name, frontmatter) {
|
|
|
31960
32114
|
}
|
|
31961
32115
|
function resolve_persona_text(persona_path, repo_root) {
|
|
31962
32116
|
const candidates = [
|
|
31963
|
-
|
|
31964
|
-
|
|
32117
|
+
path45.join(repo_root, "dist/agent-src", persona_path),
|
|
32118
|
+
path45.join(repo_root, ".agent-src.uncondensed", persona_path)
|
|
31965
32119
|
];
|
|
31966
32120
|
for (const candidate of candidates) {
|
|
31967
|
-
if (
|
|
31968
|
-
const raw =
|
|
32121
|
+
if (fs50.existsSync(candidate)) {
|
|
32122
|
+
const raw = fs50.readFileSync(candidate, "utf-8");
|
|
31969
32123
|
const [meta, body] = _split_frontmatter(raw);
|
|
31970
32124
|
return [body.trim(), meta];
|
|
31971
32125
|
}
|
|
@@ -32375,7 +32529,7 @@ __export(low_impact_corpus_exports, {
|
|
|
32375
32529
|
load_validated_phrases: () => load_validated_phrases,
|
|
32376
32530
|
parse_corpus_strict: () => parse_corpus_strict
|
|
32377
32531
|
});
|
|
32378
|
-
import * as
|
|
32532
|
+
import * as fs51 from "node:fs";
|
|
32379
32533
|
function _entry(phrase, normalised, section, line_no, trailing_metadata = "") {
|
|
32380
32534
|
return { phrase, normalised, section, line_no, trailing_metadata };
|
|
32381
32535
|
}
|
|
@@ -32548,10 +32702,10 @@ function _checkHeadingDrift(text, title) {
|
|
|
32548
32702
|
}
|
|
32549
32703
|
function parse_corpus_strict(corpusPath) {
|
|
32550
32704
|
const p = corpusPath;
|
|
32551
|
-
if (!
|
|
32705
|
+
if (!fs51.existsSync(p)) {
|
|
32552
32706
|
return new CorpusParseResult();
|
|
32553
32707
|
}
|
|
32554
|
-
const text =
|
|
32708
|
+
const text = fs51.readFileSync(p, { encoding: "utf-8" });
|
|
32555
32709
|
const allTitles = _SECTION_KEYS.map((k) => _SECTION_TITLES[k]);
|
|
32556
32710
|
const resultSections = {
|
|
32557
32711
|
validated: [],
|
|
@@ -32614,10 +32768,10 @@ function load_anti_example_phrases(corpusPath) {
|
|
|
32614
32768
|
}
|
|
32615
32769
|
function load_corpus_lock(yamlPath) {
|
|
32616
32770
|
const p = yamlPath;
|
|
32617
|
-
if (!
|
|
32771
|
+
if (!fs51.existsSync(p)) {
|
|
32618
32772
|
return new CorpusParseResult();
|
|
32619
32773
|
}
|
|
32620
|
-
const parsed = (0, import_yaml7.parse)(
|
|
32774
|
+
const parsed = (0, import_yaml7.parse)(fs51.readFileSync(p, { encoding: "utf-8" }), { version: "1.1" });
|
|
32621
32775
|
const doc = parsed === null || parsed === void 0 ? {} : parsed;
|
|
32622
32776
|
const schemaVersion = doc["schema_version"];
|
|
32623
32777
|
if (schemaVersion !== 1) {
|
|
@@ -32679,7 +32833,7 @@ function _deriveLockPath(corpusPath) {
|
|
|
32679
32833
|
}
|
|
32680
32834
|
function _loadSectionFromLock(corpusPath, section) {
|
|
32681
32835
|
const lockPath = _deriveLockPath(corpusPath);
|
|
32682
|
-
if (!
|
|
32836
|
+
if (!fs51.existsSync(lockPath)) {
|
|
32683
32837
|
return null;
|
|
32684
32838
|
}
|
|
32685
32839
|
try {
|
|
@@ -32691,10 +32845,10 @@ function _loadSectionFromLock(corpusPath, section) {
|
|
|
32691
32845
|
}
|
|
32692
32846
|
function _loadSectionLenient(corpusPath, section) {
|
|
32693
32847
|
const p = corpusPath;
|
|
32694
|
-
if (!
|
|
32848
|
+
if (!fs51.existsSync(p)) {
|
|
32695
32849
|
return [];
|
|
32696
32850
|
}
|
|
32697
|
-
const text =
|
|
32851
|
+
const text = fs51.readFileSync(p, { encoding: "utf-8" });
|
|
32698
32852
|
const allTitles = _SECTION_KEYS.map((k) => _SECTION_TITLES[k]);
|
|
32699
32853
|
const bounds = _sectionBounds(text, _SECTION_TITLES[section], allTitles);
|
|
32700
32854
|
if (bounds === null) {
|
|
@@ -33474,8 +33628,8 @@ var init_necessity = __esm({
|
|
|
33474
33628
|
});
|
|
33475
33629
|
|
|
33476
33630
|
// src/scripts/ai_council/budget_guard.ts
|
|
33477
|
-
import * as
|
|
33478
|
-
import * as
|
|
33631
|
+
import * as fs52 from "node:fs";
|
|
33632
|
+
import * as path46 from "node:path";
|
|
33479
33633
|
function _resolveLedgerPath(p) {
|
|
33480
33634
|
if (p !== null) {
|
|
33481
33635
|
return p;
|
|
@@ -33490,18 +33644,18 @@ function _nowUtcMs() {
|
|
|
33490
33644
|
return Date.now();
|
|
33491
33645
|
}
|
|
33492
33646
|
function _ensureLedgerDir(p) {
|
|
33493
|
-
const parent =
|
|
33647
|
+
const parent = path46.dirname(p);
|
|
33494
33648
|
try {
|
|
33495
|
-
|
|
33649
|
+
fs52.mkdirSync(parent, { recursive: true });
|
|
33496
33650
|
let mode;
|
|
33497
33651
|
try {
|
|
33498
|
-
mode =
|
|
33652
|
+
mode = fs52.statSync(parent).mode & 511;
|
|
33499
33653
|
} catch {
|
|
33500
33654
|
mode = 448;
|
|
33501
33655
|
}
|
|
33502
33656
|
if (mode !== 448) {
|
|
33503
33657
|
try {
|
|
33504
|
-
|
|
33658
|
+
fs52.chmodSync(parent, 448);
|
|
33505
33659
|
} catch {
|
|
33506
33660
|
}
|
|
33507
33661
|
}
|
|
@@ -33513,18 +33667,18 @@ function _ensureLedgerDir(p) {
|
|
|
33513
33667
|
}
|
|
33514
33668
|
}
|
|
33515
33669
|
function _ensureLedgerFileMode(p) {
|
|
33516
|
-
if (!
|
|
33670
|
+
if (!fs52.existsSync(p)) {
|
|
33517
33671
|
return;
|
|
33518
33672
|
}
|
|
33519
33673
|
let current;
|
|
33520
33674
|
try {
|
|
33521
|
-
current =
|
|
33675
|
+
current = fs52.statSync(p).mode & 511;
|
|
33522
33676
|
} catch {
|
|
33523
33677
|
return;
|
|
33524
33678
|
}
|
|
33525
33679
|
if (current !== 384) {
|
|
33526
33680
|
try {
|
|
33527
|
-
|
|
33681
|
+
fs52.chmodSync(p, 384);
|
|
33528
33682
|
} catch {
|
|
33529
33683
|
}
|
|
33530
33684
|
}
|
|
@@ -33676,11 +33830,11 @@ function pyNumToStr(n) {
|
|
|
33676
33830
|
}
|
|
33677
33831
|
function read_entries2(p = null) {
|
|
33678
33832
|
const resolved = _resolveLedgerPath(p);
|
|
33679
|
-
if (!
|
|
33833
|
+
if (!fs52.existsSync(resolved)) {
|
|
33680
33834
|
return [];
|
|
33681
33835
|
}
|
|
33682
33836
|
const out = [];
|
|
33683
|
-
const text =
|
|
33837
|
+
const text = fs52.readFileSync(resolved, "utf-8");
|
|
33684
33838
|
for (const rawLine of text.split(/\r\n|\r|\n/u)) {
|
|
33685
33839
|
const line = rawLine.trim();
|
|
33686
33840
|
if (line === "") {
|
|
@@ -33783,7 +33937,7 @@ function record_spend(usd, provider, model, options = {}) {
|
|
|
33783
33937
|
)}
|
|
33784
33938
|
`;
|
|
33785
33939
|
try {
|
|
33786
|
-
|
|
33940
|
+
fs52.appendFileSync(p, entry, { encoding: "utf-8" });
|
|
33787
33941
|
} catch (exc) {
|
|
33788
33942
|
process.stderr.write(`[council:budget_guard] write failed: ${_errStr(exc)}
|
|
33789
33943
|
`);
|
|
@@ -33906,8 +34060,8 @@ function aggregate_scores(findings, scores) {
|
|
|
33906
34060
|
by_id.get(s.finding_id).push(s);
|
|
33907
34061
|
}
|
|
33908
34062
|
const out = /* @__PURE__ */ new Map();
|
|
33909
|
-
for (const [fid,
|
|
33910
|
-
if (
|
|
34063
|
+
for (const [fid, fs58] of by_id) {
|
|
34064
|
+
if (fs58.length === 0) {
|
|
33911
34065
|
out.set(
|
|
33912
34066
|
fid,
|
|
33913
34067
|
new ConsensusMetadata({
|
|
@@ -33923,13 +34077,13 @@ function aggregate_scores(findings, scores) {
|
|
|
33923
34077
|
);
|
|
33924
34078
|
continue;
|
|
33925
34079
|
}
|
|
33926
|
-
const mean =
|
|
33927
|
-
const agree_rate =
|
|
34080
|
+
const mean = fs58.reduce((acc, s) => acc + s.score, 0) / fs58.length;
|
|
34081
|
+
const agree_rate = fs58.filter((s) => s.agree).length / fs58.length;
|
|
33928
34082
|
const strength = mean / 10 * agree_rate;
|
|
33929
|
-
const dissent =
|
|
33930
|
-
const concur =
|
|
33931
|
-
const scorers =
|
|
33932
|
-
const dissent_reasons =
|
|
34083
|
+
const dissent = fs58.filter((s) => !s.agree).length;
|
|
34084
|
+
const concur = fs58.filter((s) => s.agree).length;
|
|
34085
|
+
const scorers = fs58.map((s) => s.scorer);
|
|
34086
|
+
const dissent_reasons = fs58.filter((s) => !s.agree).map((s) => [s.scorer, s.reason]);
|
|
33933
34087
|
const mean_rounded = pyRound(mean, 2);
|
|
33934
34088
|
out.set(
|
|
33935
34089
|
fid,
|
|
@@ -34310,11 +34464,11 @@ __export(pricing_exports, {
|
|
|
34310
34464
|
prices_file_for: () => prices_file_for,
|
|
34311
34465
|
reprice_with_cache: () => reprice_with_cache
|
|
34312
34466
|
});
|
|
34313
|
-
import * as
|
|
34314
|
-
import * as
|
|
34467
|
+
import * as fs53 from "node:fs";
|
|
34468
|
+
import * as path47 from "node:path";
|
|
34315
34469
|
import { fileURLToPath as fileURLToPath26 } from "node:url";
|
|
34316
34470
|
function prices_file_for(repo_root) {
|
|
34317
|
-
return
|
|
34471
|
+
return path47.join(repo_root, "agents", "runtime", ".agent-prices.md");
|
|
34318
34472
|
}
|
|
34319
34473
|
function lookup(table, provider, model) {
|
|
34320
34474
|
return table.prices.get(priceKey(provider, model)) ?? null;
|
|
@@ -34408,16 +34562,16 @@ function is_stale(table, now) {
|
|
|
34408
34562
|
return last < last_monday_utc(now);
|
|
34409
34563
|
}
|
|
34410
34564
|
function load_prices(p = PRICES_FILE) {
|
|
34411
|
-
if (!
|
|
34565
|
+
if (!fs53.existsSync(p)) {
|
|
34412
34566
|
bootstrap_from_defaults(p);
|
|
34413
34567
|
}
|
|
34414
|
-
return _parse4(
|
|
34568
|
+
return _parse4(fs53.readFileSync(p, "utf-8"));
|
|
34415
34569
|
}
|
|
34416
34570
|
function bootstrap_from_defaults(p = PRICES_FILE) {
|
|
34417
|
-
|
|
34571
|
+
fs53.mkdirSync(path47.dirname(p), { recursive: true });
|
|
34418
34572
|
const rows = as_rows();
|
|
34419
34573
|
const body = _render_markdown(LAST_UPDATED, "shipped-default", rows);
|
|
34420
|
-
|
|
34574
|
+
fs53.writeFileSync(p, body, "utf-8");
|
|
34421
34575
|
}
|
|
34422
34576
|
function _fmt62f(x) {
|
|
34423
34577
|
const s = x.toFixed(2);
|
|
@@ -34540,8 +34694,8 @@ var init_pricing = __esm({
|
|
|
34540
34694
|
"use strict";
|
|
34541
34695
|
init_default_prices();
|
|
34542
34696
|
_HERE14 = fileURLToPath26(import.meta.url);
|
|
34543
|
-
REPO_ROOT2 =
|
|
34544
|
-
PRICES_FILE =
|
|
34697
|
+
REPO_ROOT2 = path47.resolve(path47.dirname(_HERE14), "..", "..", "..");
|
|
34698
|
+
PRICES_FILE = path47.join(REPO_ROOT2, "agents", "runtime", ".agent-prices.md");
|
|
34545
34699
|
_CHARS_PER_TOKEN = 4;
|
|
34546
34700
|
CACHE_READ_MULTIPLIER = 0.1;
|
|
34547
34701
|
CACHE_WRITE_MULTIPLIER_5M = 1.25;
|
|
@@ -36081,18 +36235,18 @@ __export(project_context_exports, {
|
|
|
36081
36235
|
REPO_PURPOSE_MAX_CHARS: () => REPO_PURPOSE_MAX_CHARS,
|
|
36082
36236
|
detect_project_context: () => detect_project_context
|
|
36083
36237
|
});
|
|
36084
|
-
import * as
|
|
36085
|
-
import * as
|
|
36238
|
+
import * as fs54 from "node:fs";
|
|
36239
|
+
import * as path48 from "node:path";
|
|
36086
36240
|
function _isPlainObject11(v) {
|
|
36087
36241
|
return typeof v === "object" && v !== null && !Array.isArray(v);
|
|
36088
36242
|
}
|
|
36089
36243
|
function _read_json(p) {
|
|
36090
|
-
if (!
|
|
36244
|
+
if (!fs54.existsSync(p)) {
|
|
36091
36245
|
return null;
|
|
36092
36246
|
}
|
|
36093
36247
|
let raw;
|
|
36094
36248
|
try {
|
|
36095
|
-
raw =
|
|
36249
|
+
raw = fs54.readFileSync(p, "utf-8");
|
|
36096
36250
|
} catch {
|
|
36097
36251
|
return null;
|
|
36098
36252
|
}
|
|
@@ -36114,7 +36268,7 @@ function _name_from(composer, pkg, root) {
|
|
|
36114
36268
|
}
|
|
36115
36269
|
}
|
|
36116
36270
|
try {
|
|
36117
|
-
const base =
|
|
36271
|
+
const base = path48.basename(root);
|
|
36118
36272
|
return base || null;
|
|
36119
36273
|
} catch {
|
|
36120
36274
|
return null;
|
|
@@ -36183,12 +36337,12 @@ function _splitlines10(text) {
|
|
|
36183
36337
|
return parts;
|
|
36184
36338
|
}
|
|
36185
36339
|
function _purpose_from_readme(p) {
|
|
36186
|
-
if (!
|
|
36340
|
+
if (!fs54.existsSync(p)) {
|
|
36187
36341
|
return null;
|
|
36188
36342
|
}
|
|
36189
36343
|
let text;
|
|
36190
36344
|
try {
|
|
36191
|
-
text =
|
|
36345
|
+
text = fs54.readFileSync(p, "utf-8");
|
|
36192
36346
|
} catch {
|
|
36193
36347
|
return null;
|
|
36194
36348
|
}
|
|
@@ -36272,13 +36426,13 @@ function _rfind(haystack, needle) {
|
|
|
36272
36426
|
return -1;
|
|
36273
36427
|
}
|
|
36274
36428
|
function detect_project_context(root) {
|
|
36275
|
-
const resolvedRoot =
|
|
36276
|
-
const composer = _read_json(
|
|
36277
|
-
const pkg = _read_json(
|
|
36429
|
+
const resolvedRoot = path48.resolve(root ?? process.cwd());
|
|
36430
|
+
const composer = _read_json(path48.join(resolvedRoot, "composer.json"));
|
|
36431
|
+
const pkg = _read_json(path48.join(resolvedRoot, "package.json"));
|
|
36278
36432
|
return new ProjectContext(
|
|
36279
36433
|
_name_from(composer, pkg, resolvedRoot),
|
|
36280
36434
|
_stack_from(composer, pkg),
|
|
36281
|
-
_purpose_from_readme(
|
|
36435
|
+
_purpose_from_readme(path48.join(resolvedRoot, "README.md"))
|
|
36282
36436
|
);
|
|
36283
36437
|
}
|
|
36284
36438
|
var REPO_PURPOSE_MAX_CHARS, _HEADING_RE, _BADGE_RE, _HTML_RE, ProjectContext;
|
|
@@ -36548,7 +36702,7 @@ __export(shadow_dispatch_exports, {
|
|
|
36548
36702
|
slo_banner: () => slo_banner,
|
|
36549
36703
|
slo_status: () => slo_status
|
|
36550
36704
|
});
|
|
36551
|
-
import * as
|
|
36705
|
+
import * as fs55 from "node:fs";
|
|
36552
36706
|
import { createHash as createHash9 } from "node:crypto";
|
|
36553
36707
|
function should_shadow(sampleRate, opts = {}) {
|
|
36554
36708
|
const rate = Math.max(0, Math.min(1, sampleRate));
|
|
@@ -36586,7 +36740,7 @@ function record_shadow_decision(logPath, opts) {
|
|
|
36586
36740
|
escalated,
|
|
36587
36741
|
escalation_reason: escalationReason
|
|
36588
36742
|
};
|
|
36589
|
-
|
|
36743
|
+
fs55.mkdirSync(_dirname2(logPath), { recursive: true });
|
|
36590
36744
|
const row = _pyJsonDumps2({
|
|
36591
36745
|
timestamp: decision.timestamp,
|
|
36592
36746
|
query_hash: decision.query_hash,
|
|
@@ -36596,7 +36750,7 @@ function record_shadow_decision(logPath, opts) {
|
|
|
36596
36750
|
escalated: decision.escalated,
|
|
36597
36751
|
escalation_reason: decision.escalation_reason
|
|
36598
36752
|
}) + "\n";
|
|
36599
|
-
|
|
36753
|
+
fs55.appendFileSync(logPath, row, { encoding: "utf-8" });
|
|
36600
36754
|
return decision;
|
|
36601
36755
|
}
|
|
36602
36756
|
function _isoNowSeconds() {
|
|
@@ -36605,10 +36759,10 @@ function _isoNowSeconds() {
|
|
|
36605
36759
|
return `${pad(d.getUTCFullYear(), 4)}-${pad(d.getUTCMonth() + 1)}-${pad(d.getUTCDate())}T${pad(d.getUTCHours())}:${pad(d.getUTCMinutes())}:${pad(d.getUTCSeconds())}+00:00`;
|
|
36606
36760
|
}
|
|
36607
36761
|
function* _iterLog(logPath) {
|
|
36608
|
-
if (!
|
|
36762
|
+
if (!fs55.existsSync(logPath)) {
|
|
36609
36763
|
return;
|
|
36610
36764
|
}
|
|
36611
|
-
const content =
|
|
36765
|
+
const content = fs55.readFileSync(logPath, { encoding: "utf-8" });
|
|
36612
36766
|
for (const rawLine of _splitlines11(content)) {
|
|
36613
36767
|
const line = _strip7(rawLine);
|
|
36614
36768
|
if (!line) {
|
|
@@ -37529,8 +37683,8 @@ __export(council_cli_exports, {
|
|
|
37529
37683
|
load_settings: () => load_settings,
|
|
37530
37684
|
main: () => main17
|
|
37531
37685
|
});
|
|
37532
|
-
import * as
|
|
37533
|
-
import * as
|
|
37686
|
+
import * as fs56 from "node:fs";
|
|
37687
|
+
import * as path49 from "node:path";
|
|
37534
37688
|
import { fileURLToPath as fileURLToPath27, pathToFileURL as pathToFileURL17 } from "node:url";
|
|
37535
37689
|
function _pyFixed6(x, ndigits) {
|
|
37536
37690
|
if (!Number.isFinite(x)) {
|
|
@@ -37739,7 +37893,7 @@ function _stderr2(s) {
|
|
|
37739
37893
|
function load_settings(p = SETTINGS_FILE2, opts = {}) {
|
|
37740
37894
|
const ai_council_path = opts.ai_council_path ?? AI_COUNCIL_FILE;
|
|
37741
37895
|
const settings = load_agent_settings({ project_path: p });
|
|
37742
|
-
if (
|
|
37896
|
+
if (fs56.existsSync(ai_council_path)) {
|
|
37743
37897
|
const cfg = load_council_config(ai_council_path);
|
|
37744
37898
|
settings["ai_council"] = _synthesize_ai_council_block(cfg);
|
|
37745
37899
|
}
|
|
@@ -38115,7 +38269,7 @@ function build_question(opts) {
|
|
|
38115
38269
|
let ctx;
|
|
38116
38270
|
let artefact;
|
|
38117
38271
|
if (input_mode === "prompt") {
|
|
38118
|
-
const text =
|
|
38272
|
+
const text = fs56.readFileSync(input_path, "utf-8");
|
|
38119
38273
|
ctx = bundle_prompt(text);
|
|
38120
38274
|
artefact = String(input_path);
|
|
38121
38275
|
} else if (input_mode === "roadmap") {
|
|
@@ -38258,9 +38412,9 @@ function _maybe_write_decision_replay(opts) {
|
|
|
38258
38412
|
include_member_arguments: include_args
|
|
38259
38413
|
})
|
|
38260
38414
|
);
|
|
38261
|
-
const target =
|
|
38262
|
-
|
|
38263
|
-
|
|
38415
|
+
const target = path49.join(path49.dirname(opts.out_path), "decision-replay.md");
|
|
38416
|
+
fs56.mkdirSync(path49.dirname(target), { recursive: true });
|
|
38417
|
+
fs56.writeFileSync(target, replay, { encoding: "utf-8" });
|
|
38264
38418
|
return target;
|
|
38265
38419
|
}
|
|
38266
38420
|
function _peer_review_active(ai_cfg, args) {
|
|
@@ -39150,8 +39304,8 @@ function cmd_run(args, opts = {}) {
|
|
|
39150
39304
|
kind: "responses",
|
|
39151
39305
|
subcommand: "run"
|
|
39152
39306
|
});
|
|
39153
|
-
|
|
39154
|
-
|
|
39307
|
+
fs56.mkdirSync(path49.dirname(_resolveTarget(out_path)), { recursive: true });
|
|
39308
|
+
fs56.writeFileSync(_resolveTarget(out_path), _jsonDumpsIndent22(payload) + "\n", { encoding: "utf-8" });
|
|
39155
39309
|
_stdout2(
|
|
39156
39310
|
`
|
|
39157
39311
|
council:run \xB7 wrote ${out_path} (estimated $${_pyFixed6(estimated_total, 4)} / actual $${_pyFixed6(actual_total, 4)})
|
|
@@ -39176,7 +39330,7 @@ function _debate_round_filename(round_number) {
|
|
|
39176
39330
|
return `debate-round-${round_number}.json`;
|
|
39177
39331
|
}
|
|
39178
39332
|
function _write_debate_round(out_dir, round_number, responses, opts) {
|
|
39179
|
-
|
|
39333
|
+
fs56.mkdirSync(_resolveTarget(out_dir), { recursive: true });
|
|
39180
39334
|
let actual_total = 0;
|
|
39181
39335
|
for (const r of responses) {
|
|
39182
39336
|
if (r.error) {
|
|
@@ -39200,15 +39354,15 @@ function _write_debate_round(out_dir, round_number, responses, opts) {
|
|
|
39200
39354
|
prompt_cache_round_gap_ms: opts.cache_gap_ms_since_previous_round ?? null,
|
|
39201
39355
|
responses: _serialise_responses(responses)
|
|
39202
39356
|
};
|
|
39203
|
-
const out_path =
|
|
39204
|
-
|
|
39357
|
+
const out_path = path49.join(_resolveTarget(out_dir), _debate_round_filename(round_number));
|
|
39358
|
+
fs56.writeFileSync(out_path, _jsonDumpsIndent22(payload) + "\n", { encoding: "utf-8" });
|
|
39205
39359
|
return out_path;
|
|
39206
39360
|
}
|
|
39207
39361
|
function _load_debate_seed(p, expected_members) {
|
|
39208
|
-
if (!
|
|
39362
|
+
if (!fs56.existsSync(p)) {
|
|
39209
39363
|
throw new FileNotFoundError3(`--continue-as-debate path not found: ${p}`);
|
|
39210
39364
|
}
|
|
39211
|
-
const payload = JSON.parse(
|
|
39365
|
+
const payload = JSON.parse(fs56.readFileSync(p, "utf-8"));
|
|
39212
39366
|
const source_members = (payload["members"] || []).slice();
|
|
39213
39367
|
const expected_labels = expected_members.map((m) => `${m.name}/${m.model}`);
|
|
39214
39368
|
if (!_listEq(source_members, expected_labels)) {
|
|
@@ -39254,7 +39408,7 @@ function _readStdinLine() {
|
|
|
39254
39408
|
try {
|
|
39255
39409
|
const buf = Buffer.alloc(4096);
|
|
39256
39410
|
const fd = 0;
|
|
39257
|
-
const n =
|
|
39411
|
+
const n = fs56.readSync(fd, buf, 0, buf.length, null);
|
|
39258
39412
|
return buf.toString("utf-8", 0, n).split("\n")[0]?.trim().toLowerCase() ?? "";
|
|
39259
39413
|
} catch {
|
|
39260
39414
|
return "";
|
|
@@ -39480,7 +39634,7 @@ council:debate \xB7 ${all_rounds.length} round(s) complete \xB7 actual $${_pyFix
|
|
|
39480
39634
|
return errors_last.length > 0 && errors_last.length === last.length ? 1 : 0;
|
|
39481
39635
|
}
|
|
39482
39636
|
function cmd_render(args) {
|
|
39483
|
-
const payload = JSON.parse(
|
|
39637
|
+
const payload = JSON.parse(fs56.readFileSync(args.responses, "utf-8"));
|
|
39484
39638
|
const items = payload["responses"] || [];
|
|
39485
39639
|
const explicit = _getattr3(args, "prompt_mode", null);
|
|
39486
39640
|
const mode = explicit || payload["prompt_mode"] || payload["mode"];
|
|
@@ -39506,8 +39660,8 @@ function cmd_render(args) {
|
|
|
39506
39660
|
kind: "sessions",
|
|
39507
39661
|
subcommand: "render"
|
|
39508
39662
|
});
|
|
39509
|
-
|
|
39510
|
-
|
|
39663
|
+
fs56.mkdirSync(path49.dirname(_resolveTarget(out_path)), { recursive: true });
|
|
39664
|
+
fs56.writeFileSync(_resolveTarget(out_path), body + "\n", { encoding: "utf-8" });
|
|
39511
39665
|
_stdout2(`council:render \xB7 wrote ${out_path}
|
|
39512
39666
|
`);
|
|
39513
39667
|
return 0;
|
|
@@ -39518,15 +39672,15 @@ function cmd_render(args) {
|
|
|
39518
39672
|
function _cmd_replay_low_impact_stats(args) {
|
|
39519
39673
|
const li = low_impact_exports;
|
|
39520
39674
|
const responses_path = args.responses;
|
|
39521
|
-
const log_path =
|
|
39522
|
-
if (!
|
|
39675
|
+
const log_path = path49.join(path49.dirname(responses_path), "low-impact-resolutions.md");
|
|
39676
|
+
if (!fs56.existsSync(log_path)) {
|
|
39523
39677
|
_stdout2(
|
|
39524
39678
|
`council:replay \xB7 no low-impact-resolutions.md alongside ${responses_path} \u2014 session had no fast-path entries.
|
|
39525
39679
|
`
|
|
39526
39680
|
);
|
|
39527
39681
|
return 0;
|
|
39528
39682
|
}
|
|
39529
|
-
const body =
|
|
39683
|
+
const body = fs56.readFileSync(log_path, "utf-8");
|
|
39530
39684
|
const stats = li.parse_low_impact_log(body);
|
|
39531
39685
|
const out = li.render_low_impact_stats(stats);
|
|
39532
39686
|
if (_getattr3(args, "output", null)) {
|
|
@@ -39534,8 +39688,8 @@ function _cmd_replay_low_impact_stats(args) {
|
|
|
39534
39688
|
kind: "sessions",
|
|
39535
39689
|
subcommand: "replay"
|
|
39536
39690
|
});
|
|
39537
|
-
|
|
39538
|
-
|
|
39691
|
+
fs56.mkdirSync(path49.dirname(_resolveTarget(target)), { recursive: true });
|
|
39692
|
+
fs56.writeFileSync(_resolveTarget(target), out, { encoding: "utf-8" });
|
|
39539
39693
|
_stdout2(`council:replay \xB7 wrote ${target}
|
|
39540
39694
|
`);
|
|
39541
39695
|
return 0;
|
|
@@ -39547,7 +39701,7 @@ function cmd_replay(args) {
|
|
|
39547
39701
|
if (_getattr3(args, "low_impact_stats", false)) {
|
|
39548
39702
|
return _cmd_replay_low_impact_stats(args);
|
|
39549
39703
|
}
|
|
39550
|
-
const payload = JSON.parse(
|
|
39704
|
+
const payload = JSON.parse(fs56.readFileSync(args.responses, "utf-8"));
|
|
39551
39705
|
const consensus = _deserialise_consensus(payload["consensus"]);
|
|
39552
39706
|
if (consensus === null) {
|
|
39553
39707
|
_stderr2(
|
|
@@ -39572,8 +39726,8 @@ function cmd_replay(args) {
|
|
|
39572
39726
|
kind: "sessions",
|
|
39573
39727
|
subcommand: "replay"
|
|
39574
39728
|
});
|
|
39575
|
-
|
|
39576
|
-
|
|
39729
|
+
fs56.mkdirSync(path49.dirname(_resolveTarget(out_path)), { recursive: true });
|
|
39730
|
+
fs56.writeFileSync(_resolveTarget(out_path), body, { encoding: "utf-8" });
|
|
39577
39731
|
_stdout2(`council:replay \xB7 wrote ${out_path}
|
|
39578
39732
|
`);
|
|
39579
39733
|
} else {
|
|
@@ -39630,8 +39784,8 @@ function cmd_quota(args, opts = {}) {
|
|
|
39630
39784
|
}
|
|
39631
39785
|
function _validate_council_output_path(path_str, opts) {
|
|
39632
39786
|
const expected_rel = COUNCIL_CANONICAL_DIRS[opts.kind];
|
|
39633
|
-
const expected_abs = _resolveReal(
|
|
39634
|
-
const target =
|
|
39787
|
+
const expected_abs = _resolveReal(path49.join(REPO_ROOT3, expected_rel));
|
|
39788
|
+
const target = path49.isAbsolute(path_str) ? path_str : path49.join(REPO_ROOT3, path_str);
|
|
39635
39789
|
const target_resolved = _resolveReal(target);
|
|
39636
39790
|
if (!_isRelativeTo(target_resolved, expected_abs)) {
|
|
39637
39791
|
throw new ArgumentTypeError(
|
|
@@ -39641,12 +39795,12 @@ function _validate_council_output_path(path_str, opts) {
|
|
|
39641
39795
|
return path_str;
|
|
39642
39796
|
}
|
|
39643
39797
|
function _resolveTarget(path_str) {
|
|
39644
|
-
return
|
|
39798
|
+
return path49.isAbsolute(path_str) ? path_str : path49.join(REPO_ROOT3, path_str);
|
|
39645
39799
|
}
|
|
39646
39800
|
function _resolveReal(p) {
|
|
39647
|
-
const abs =
|
|
39801
|
+
const abs = path49.resolve(p);
|
|
39648
39802
|
try {
|
|
39649
|
-
return
|
|
39803
|
+
return fs56.realpathSync(abs);
|
|
39650
39804
|
} catch {
|
|
39651
39805
|
return abs;
|
|
39652
39806
|
}
|
|
@@ -39655,8 +39809,8 @@ function _isRelativeTo(target, base) {
|
|
|
39655
39809
|
if (target === base) {
|
|
39656
39810
|
return true;
|
|
39657
39811
|
}
|
|
39658
|
-
const rel =
|
|
39659
|
-
return rel !== "" && !rel.startsWith("..") && !
|
|
39812
|
+
const rel = path49.relative(base, target);
|
|
39813
|
+
return rel !== "" && !rel.startsWith("..") && !path49.isAbsolute(rel);
|
|
39660
39814
|
}
|
|
39661
39815
|
function _topError(message) {
|
|
39662
39816
|
_stderr2(_TOP_USAGE2);
|
|
@@ -40017,13 +40171,13 @@ function _isCliEntry17() {
|
|
|
40017
40171
|
if (process.argv[1] === void 0) {
|
|
40018
40172
|
return false;
|
|
40019
40173
|
}
|
|
40020
|
-
const argvUrl = pathToFileURL17(
|
|
40174
|
+
const argvUrl = pathToFileURL17(path49.resolve(process.argv[1])).href;
|
|
40021
40175
|
if (import.meta.url === argvUrl) {
|
|
40022
40176
|
return true;
|
|
40023
40177
|
}
|
|
40024
40178
|
try {
|
|
40025
|
-
const here =
|
|
40026
|
-
const argv =
|
|
40179
|
+
const here = fs56.realpathSync(fileURLToPath27(import.meta.url));
|
|
40180
|
+
const argv = fs56.realpathSync(path49.resolve(process.argv[1]));
|
|
40027
40181
|
return here === argv;
|
|
40028
40182
|
} catch {
|
|
40029
40183
|
return false;
|
|
@@ -40075,7 +40229,7 @@ var init_council_cli = __esm({
|
|
|
40075
40229
|
"xai",
|
|
40076
40230
|
"perplexity"
|
|
40077
40231
|
]);
|
|
40078
|
-
_HERE15 =
|
|
40232
|
+
_HERE15 = path49.dirname(fileURLToPath27(import.meta.url));
|
|
40079
40233
|
[REPO_ROOT3] = resolve_project_root(null);
|
|
40080
40234
|
SETTINGS_FILE2 = project_settings_path(REPO_ROOT3);
|
|
40081
40235
|
AI_COUNCIL_FILE = resolve_config_path(REPO_ROOT3);
|
|
@@ -40177,7 +40331,7 @@ var init_safety_envelope = __esm({
|
|
|
40177
40331
|
});
|
|
40178
40332
|
|
|
40179
40333
|
// src/scripts/mcp_server/__main__.ts
|
|
40180
|
-
import * as
|
|
40334
|
+
import * as path51 from "node:path";
|
|
40181
40335
|
import { fileURLToPath as fileURLToPath29 } from "node:url";
|
|
40182
40336
|
|
|
40183
40337
|
// src/scripts/mcp_server/index.ts
|
|
@@ -40225,8 +40379,8 @@ init_prompts();
|
|
|
40225
40379
|
init_resources();
|
|
40226
40380
|
|
|
40227
40381
|
// src/scripts/mcp_server/tools.ts
|
|
40228
|
-
import * as
|
|
40229
|
-
import * as
|
|
40382
|
+
import * as fs57 from "node:fs";
|
|
40383
|
+
import * as path50 from "node:path";
|
|
40230
40384
|
import { fileURLToPath as fileURLToPath28 } from "node:url";
|
|
40231
40385
|
|
|
40232
40386
|
// src/scripts/chat_history.ts
|
|
@@ -42474,9 +42628,9 @@ function _strip8(s) {
|
|
|
42474
42628
|
}
|
|
42475
42629
|
function _resolvePath2(p) {
|
|
42476
42630
|
try {
|
|
42477
|
-
return
|
|
42631
|
+
return fs57.realpathSync(p);
|
|
42478
42632
|
} catch {
|
|
42479
|
-
return
|
|
42633
|
+
return path50.resolve(p);
|
|
42480
42634
|
}
|
|
42481
42635
|
}
|
|
42482
42636
|
function _resolveConsumerRoot(override) {
|
|
@@ -42486,14 +42640,14 @@ function _resolveConsumerRoot(override) {
|
|
|
42486
42640
|
return _resolvePath2(process.cwd());
|
|
42487
42641
|
}
|
|
42488
42642
|
function _relativeUnder(target, root) {
|
|
42489
|
-
const rel =
|
|
42643
|
+
const rel = path50.relative(root, target);
|
|
42490
42644
|
if (rel === "") {
|
|
42491
42645
|
return "";
|
|
42492
42646
|
}
|
|
42493
|
-
if (rel.startsWith("..") ||
|
|
42647
|
+
if (rel.startsWith("..") || path50.isAbsolute(rel)) {
|
|
42494
42648
|
return null;
|
|
42495
42649
|
}
|
|
42496
|
-
return rel.split(
|
|
42650
|
+
return rel.split(path50.sep).join("/");
|
|
42497
42651
|
}
|
|
42498
42652
|
function _reprStrList(values) {
|
|
42499
42653
|
return `[${values.map((v) => `'${v}'`).join(", ")}]`;
|
|
@@ -42502,11 +42656,11 @@ function _validateInTreePath(raw, consumerRoot) {
|
|
|
42502
42656
|
const root = _resolvePath2(consumerRoot);
|
|
42503
42657
|
let target;
|
|
42504
42658
|
if (raw === null || raw === void 0 || raw === "") {
|
|
42505
|
-
target =
|
|
42506
|
-
} else if (
|
|
42659
|
+
target = path50.join(root, "agents", "runtime", ".agent-chat-history");
|
|
42660
|
+
} else if (path50.isAbsolute(raw)) {
|
|
42507
42661
|
target = _resolvePath2(raw);
|
|
42508
42662
|
} else {
|
|
42509
|
-
target = _resolvePath2(
|
|
42663
|
+
target = _resolvePath2(path50.join(root, raw));
|
|
42510
42664
|
}
|
|
42511
42665
|
const rel = _relativeUnder(target, root);
|
|
42512
42666
|
if (rel === null) {
|
|
@@ -42544,11 +42698,11 @@ async function _lintSkillsHandler(args, consumerRoot) {
|
|
|
42544
42698
|
if (typeof raw !== "string") {
|
|
42545
42699
|
throw new Error("'paths' entries must be strings");
|
|
42546
42700
|
}
|
|
42547
|
-
const resolved =
|
|
42701
|
+
const resolved = path50.isAbsolute(raw) ? _resolvePath2(raw) : _resolvePath2(path50.join(root, raw));
|
|
42548
42702
|
if (_relativeUnder(resolved, root) === null) {
|
|
42549
42703
|
throw new Error(`path escapes consumer_root: ${resolved}`);
|
|
42550
42704
|
}
|
|
42551
|
-
if (
|
|
42705
|
+
if (fs57.existsSync(resolved)) {
|
|
42552
42706
|
paths.push(resolved);
|
|
42553
42707
|
}
|
|
42554
42708
|
}
|
|
@@ -42585,7 +42739,7 @@ async function _chatHistoryAppendHandler(args, consumerRoot) {
|
|
|
42585
42739
|
if (typeof minSchema !== "number" || !Number.isInteger(minSchema) || typeof minSchema === "boolean") {
|
|
42586
42740
|
throw new Error("'min_schema_version' must be an integer");
|
|
42587
42741
|
}
|
|
42588
|
-
const existingHeader =
|
|
42742
|
+
const existingHeader = fs57.existsSync(target) ? _chReadHeader(target) : null;
|
|
42589
42743
|
const observed = existingHeader !== null && typeof existingHeader === "object" ? _pyInt7(existingHeader.v ?? 0) : SCHEMA_VERSION3;
|
|
42590
42744
|
if (observed < minSchema) {
|
|
42591
42745
|
throw new Error(`chat-history schema ${observed} below required ${minSchema}`);
|
|
@@ -42600,8 +42754,8 @@ async function _chatHistoryAppendHandler(args, consumerRoot) {
|
|
|
42600
42754
|
session: session === void 0 ? null : session
|
|
42601
42755
|
};
|
|
42602
42756
|
}
|
|
42603
|
-
if (!
|
|
42604
|
-
|
|
42757
|
+
if (!fs57.existsSync(target) || _chReadHeader(target) === null) {
|
|
42758
|
+
fs57.mkdirSync(path50.dirname(target), { recursive: true });
|
|
42605
42759
|
_chInit(target);
|
|
42606
42760
|
}
|
|
42607
42761
|
_chAppend(entry, target, session ?? null);
|
|
@@ -42645,7 +42799,7 @@ async function _chatHistoryReadHandler(args, consumerRoot) {
|
|
|
42645
42799
|
if (detail !== "full" && detail !== "index") {
|
|
42646
42800
|
throw new Error("'detail' must be 'index' or 'full'");
|
|
42647
42801
|
}
|
|
42648
|
-
if (!
|
|
42802
|
+
if (!fs57.existsSync(target)) {
|
|
42649
42803
|
return { path: target, entries: [], count: 0 };
|
|
42650
42804
|
}
|
|
42651
42805
|
if (around !== void 0 && around !== null) {
|
|
@@ -42747,8 +42901,8 @@ async function _memoryStatusHandler(_args, consumerRoot) {
|
|
|
42747
42901
|
}
|
|
42748
42902
|
return result;
|
|
42749
42903
|
}
|
|
42750
|
-
var _PACKAGE_ROOT2 =
|
|
42751
|
-
|
|
42904
|
+
var _PACKAGE_ROOT2 = path50.resolve(
|
|
42905
|
+
path50.dirname(fileURLToPath28(import.meta.url)),
|
|
42752
42906
|
"..",
|
|
42753
42907
|
"..",
|
|
42754
42908
|
".."
|
|
@@ -42792,10 +42946,10 @@ async function _memorySignalHandler(args, consumerRoot) {
|
|
|
42792
42946
|
async function _roadmapProgressHandler(args, consumerRoot) {
|
|
42793
42947
|
const dryRun = _pyTruthy6(args.dry_run ?? false);
|
|
42794
42948
|
const root = _resolvePath2(consumerRoot);
|
|
42795
|
-
const roadmapRoot =
|
|
42796
|
-
const target =
|
|
42949
|
+
const roadmapRoot = path50.join(root, "agents", "roadmaps");
|
|
42950
|
+
const target = path50.join(root, "agents", "roadmaps-progress.md");
|
|
42797
42951
|
const urp = await Promise.resolve().then(() => (init_update_roadmap_progress(), update_roadmap_progress_exports));
|
|
42798
|
-
if (!
|
|
42952
|
+
if (!fs57.existsSync(roadmapRoot)) {
|
|
42799
42953
|
return {
|
|
42800
42954
|
written: false,
|
|
42801
42955
|
path: target,
|
|
@@ -42810,7 +42964,7 @@ async function _roadmapProgressHandler(args, consumerRoot) {
|
|
|
42810
42964
|
const stepsDone = roadmaps.reduce((s, r) => s + r.done, 0);
|
|
42811
42965
|
const stepsTotal = roadmaps.reduce((s, r) => s + r.total_active, 0);
|
|
42812
42966
|
if (!dryRun) {
|
|
42813
|
-
|
|
42967
|
+
fs57.writeFileSync(target, content, "utf-8");
|
|
42814
42968
|
}
|
|
42815
42969
|
return {
|
|
42816
42970
|
written: !dryRun,
|
|
@@ -42831,11 +42985,11 @@ async function _roadmapArchiveHandler(_args, consumerRoot) {
|
|
|
42831
42985
|
let dashboardRegenerated = false;
|
|
42832
42986
|
if (archived.length > 0) {
|
|
42833
42987
|
const urp = await Promise.resolve().then(() => (init_update_roadmap_progress(), update_roadmap_progress_exports));
|
|
42834
|
-
const roadmapRoot =
|
|
42835
|
-
if (
|
|
42988
|
+
const roadmapRoot = path50.join(root, "agents", "roadmaps");
|
|
42989
|
+
if (fs57.existsSync(roadmapRoot)) {
|
|
42836
42990
|
const roadmaps = urp.collect(roadmapRoot);
|
|
42837
|
-
|
|
42838
|
-
|
|
42991
|
+
fs57.writeFileSync(
|
|
42992
|
+
path50.join(root, "agents", "roadmaps-progress.md"),
|
|
42839
42993
|
urp.render(roadmaps, urp.collect_bundles(root)),
|
|
42840
42994
|
"utf-8"
|
|
42841
42995
|
);
|
|
@@ -42851,9 +43005,9 @@ async function _roadmapArchiveHandler(_args, consumerRoot) {
|
|
|
42851
43005
|
async function _capabilitiesIndexHandler(args, consumerRoot) {
|
|
42852
43006
|
const check = _pyTruthy6(args.check ?? false);
|
|
42853
43007
|
const cap = await Promise.resolve().then(() => (init_generate_capabilities_index(), generate_capabilities_index_exports));
|
|
42854
|
-
const out =
|
|
43008
|
+
const out = path50.join(_PACKAGE_ROOT2, "CAPABILITIES.yaml");
|
|
42855
43009
|
const content = cap.build();
|
|
42856
|
-
const onDisk =
|
|
43010
|
+
const onDisk = fs57.existsSync(out) ? fs57.readFileSync(out, "utf-8") : "";
|
|
42857
43011
|
const drift = onDisk !== content;
|
|
42858
43012
|
if (check) {
|
|
42859
43013
|
return { check: true, written: false, drift, path: out };
|
|
@@ -42864,7 +43018,7 @@ async function _capabilitiesIndexHandler(args, consumerRoot) {
|
|
|
42864
43018
|
`CAPABILITIES.yaml path escapes consumer_root: ${out} not under ${root}`
|
|
42865
43019
|
);
|
|
42866
43020
|
}
|
|
42867
|
-
|
|
43021
|
+
fs57.writeFileSync(out, content, "utf-8");
|
|
42868
43022
|
return { check: false, written: true, drift, path: out };
|
|
42869
43023
|
}
|
|
42870
43024
|
async function _runDoctorLeg(consumerRoot) {
|
|
@@ -42964,11 +43118,11 @@ async function _councilEstimateHandler(args, consumerRoot) {
|
|
|
42964
43118
|
throw new Error("'depth' must be 'shallow' or 'deep' when provided");
|
|
42965
43119
|
}
|
|
42966
43120
|
const root = _resolvePath2(consumerRoot);
|
|
42967
|
-
const target =
|
|
43121
|
+
const target = path50.isAbsolute(inputRaw) ? _resolvePath2(inputRaw) : _resolvePath2(path50.join(root, inputRaw));
|
|
42968
43122
|
if (_relativeUnder(target, root) === null) {
|
|
42969
43123
|
throw new Error(`path escapes consumer_root: ${target}`);
|
|
42970
43124
|
}
|
|
42971
|
-
if (!
|
|
43125
|
+
if (!fs57.existsSync(target)) {
|
|
42972
43126
|
throw new Error(`input_path not found: ${target}`);
|
|
42973
43127
|
}
|
|
42974
43128
|
const cli = await Promise.resolve().then(() => (init_council_cli(), council_cli_exports));
|
|
@@ -43030,18 +43184,18 @@ async function _runTestsHandler(args, consumerRoot) {
|
|
|
43030
43184
|
if (typeof relPathRaw !== "string" || !_strip8(relPathRaw)) {
|
|
43031
43185
|
throw new Error("'path' must be a non-empty string when provided");
|
|
43032
43186
|
}
|
|
43033
|
-
const resolved =
|
|
43187
|
+
const resolved = path50.isAbsolute(relPathRaw) ? _resolvePath2(relPathRaw) : _resolvePath2(path50.join(root, relPathRaw));
|
|
43034
43188
|
const rel = _relativeUnder(resolved, root);
|
|
43035
43189
|
if (rel === null) {
|
|
43036
43190
|
throw new Error(`path escapes consumer_root: ${resolved}`);
|
|
43037
43191
|
}
|
|
43038
|
-
if (!
|
|
43192
|
+
if (!fs57.existsSync(resolved)) {
|
|
43039
43193
|
throw new Error(`path not found: ${resolved}`);
|
|
43040
43194
|
}
|
|
43041
43195
|
relArg = rel;
|
|
43042
43196
|
}
|
|
43043
|
-
const vitestEntry =
|
|
43044
|
-
if (!
|
|
43197
|
+
const vitestEntry = path50.join(root, "node_modules", "vitest", "vitest.mjs");
|
|
43198
|
+
if (!fs57.existsSync(vitestEntry)) {
|
|
43045
43199
|
throw new Error(
|
|
43046
43200
|
"run_tests pilot supports vitest projects only \u2014 node_modules/vitest/vitest.mjs not found under consumer_root"
|
|
43047
43201
|
);
|
|
@@ -43647,8 +43801,8 @@ function _strCmp3(a, b) {
|
|
|
43647
43801
|
return a < b ? -1 : a > b ? 1 : 0;
|
|
43648
43802
|
}
|
|
43649
43803
|
function _pathlibCompare3(a, b) {
|
|
43650
|
-
const pa = a.split(
|
|
43651
|
-
const pb = b.split(
|
|
43804
|
+
const pa = a.split(path50.sep);
|
|
43805
|
+
const pb = b.split(path50.sep);
|
|
43652
43806
|
const n = Math.min(pa.length, pb.length);
|
|
43653
43807
|
for (let i = 0; i < n; i++) {
|
|
43654
43808
|
const c = _strCmp3(pa[i], pb[i]);
|
|
@@ -43873,7 +44027,7 @@ function main18() {
|
|
|
43873
44027
|
|
|
43874
44028
|
// src/scripts/mcp_server/__main__.ts
|
|
43875
44029
|
var _selfPath = fileURLToPath29(import.meta.url);
|
|
43876
|
-
var _invokedDirectly2 = globalThis.__AC_MCP_BUNDLE_DIRECT === true || process.argv[1] !== void 0 &&
|
|
44030
|
+
var _invokedDirectly2 = globalThis.__AC_MCP_BUNDLE_DIRECT === true || process.argv[1] !== void 0 && path51.resolve(process.argv[1]) === path51.resolve(_selfPath);
|
|
43877
44031
|
if (_invokedDirectly2) {
|
|
43878
44032
|
main18();
|
|
43879
44033
|
}
|