@event4u/agent-config 9.12.0 → 9.14.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 +110 -238
- package/README.md +1 -1
- package/dist/agent-src/commands/optimize/deep.md +147 -0
- package/dist/agent-src/commands/optimize.md +12 -6
- package/dist/agent-src/rules/active-remediation.md +0 -2
- package/dist/agent-src/rules/architecture.md +0 -1
- package/dist/agent-src/rules/artifact-drafting-protocol.md +0 -4
- package/dist/agent-src/rules/autonomous-execution.md +1 -2
- package/dist/agent-src/rules/broken-access-control.md +0 -2
- package/dist/agent-src/rules/code-comment-discipline.md +0 -3
- package/dist/agent-src/rules/code-provenance.md +0 -3
- package/dist/agent-src/rules/communication-through-line.md +2 -3
- package/dist/agent-src/rules/content-quoting-floor.md +0 -2
- package/dist/agent-src/rules/context-hygiene.md +1 -3
- package/dist/agent-src/rules/decision-revisit-gate.md +0 -2
- package/dist/agent-src/rules/design-fidelity.md +29 -0
- package/dist/agent-src/rules/domain-adoption-policy.md +0 -3
- package/dist/agent-src/rules/downstream-changes.md +10 -1
- package/dist/agent-src/rules/external-reference-deep-dive.md +0 -7
- package/dist/agent-src/rules/fast-path-marker-visibility.md +0 -1
- package/dist/agent-src/rules/git-history-discipline.md +0 -7
- package/dist/agent-src/rules/guidelines.md +0 -2
- package/dist/agent-src/rules/improve-before-implement.md +4 -2
- package/dist/agent-src/rules/invite-challenge.md +0 -4
- package/dist/agent-src/rules/linked-projects-onboarding-gate.md +0 -2
- package/dist/agent-src/rules/markdown-safe-codeblocks.md +0 -1
- package/dist/agent-src/rules/minimal-safe-diff.md +2 -2
- package/dist/agent-src/rules/missing-tool-handling.md +0 -1
- package/dist/agent-src/rules/no-attribution-footers.md +0 -3
- package/dist/agent-src/rules/no-decorative-emojis-in-git-surfaces.md +8 -5
- package/dist/agent-src/rules/no-pr-progress-comments.md +1 -3
- package/dist/agent-src/rules/no-roadmap-references.md +0 -2
- package/dist/agent-src/rules/output-discipline.md +0 -1
- package/dist/agent-src/rules/prefer-enums-over-literals.md +0 -2
- package/dist/agent-src/rules/preservation-guard.md +0 -3
- package/dist/agent-src/rules/role-mode-adherence.md +0 -1
- package/dist/agent-src/rules/secret-vcs-guard.md +0 -2
- package/dist/agent-src/rules/senior-engineering-discipline.md +0 -2
- package/dist/agent-src/rules/session-canary.md +0 -2
- package/dist/agent-src/rules/size-enforcement.md +0 -5
- package/dist/agent-src/rules/source-confidentiality.md +0 -3
- package/dist/agent-src/rules/source-discovery-gate.md +0 -2
- package/dist/agent-src/rules/think-before-action.md +3 -3
- package/dist/agent-src/rules/token-budget-discipline.md +0 -1
- package/dist/agent-src/rules/token-efficiency.md +1 -2
- package/dist/agent-src/rules/tool-safety.md +0 -1
- package/dist/agent-src/rules/user-interaction.md +0 -3
- package/dist/agent-src/rules/user-interrupt-priority.md +0 -1
- package/dist/agent-src/skills/agent-docs-writing/SKILL.md +8 -0
- package/dist/agent-src/skills/analysis-skill-router/SKILL.md +55 -86
- package/dist/agent-src/skills/character-consistency/SKILL.md +7 -4
- package/dist/agent-src/skills/decision-record/SKILL.md +8 -0
- package/dist/agent-src/skills/design-review/SKILL.md +11 -0
- package/dist/agent-src/skills/design-system-capture/reference/design-system-json.md +8 -0
- package/dist/agent-src/skills/existing-ui-audit/SKILL.md +34 -3
- package/dist/agent-src/skills/fe-design/SKILL.md +10 -0
- package/dist/agent-src/skills/motion-choreographer/SKILL.md +7 -4
- package/dist/agent-src/skills/overbuild-review-lens/SKILL.md +201 -0
- package/dist/agent-src/skills/performance/SKILL.md +14 -0
- package/dist/agent-src/skills/pixar-storyteller/SKILL.md +8 -5
- package/dist/agent-src/skills/scene-expander/SKILL.md +9 -6
- package/dist/agent-src/skills/supply-chain-intake/SKILL.md +10 -0
- package/dist/agent-src/skills/universal-project-analysis/SKILL.md +14 -37
- package/dist/agent-src/skills/video-director/SKILL.md +9 -6
- package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
- package/dist/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +154 -13
- package/dist/agent-src/templates/scripts/work_engine/directives/ui/design.ts +118 -0
- package/dist/agent-src/templates/scripts/work_engine/directives/ui/polish.ts +40 -0
- package/dist/agent-src/templates/scripts/work_engine/state.ts +55 -0
- package/dist/cli-delegate/{chunk-QFKQLQ7X.js → chunk-GCVFLBP2.js} +399 -365
- 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 +123 -73
- package/dist/discovery/discovery-manifest.json.sha256 +1 -1
- package/dist/discovery/discovery-manifest.summary.md +4 -4
- package/dist/discovery/orphan-report.md +1 -1
- package/dist/discovery/packs.json +10 -8
- package/dist/discovery/trust-report.md +3 -3
- package/dist/discovery/workspaces.json +8 -6
- package/dist/hooks/dispatch.js +174 -13
- package/dist/install/install.mjs +648 -614
- package/dist/mcp/registry-manifest.json +3 -3
- package/dist/mcp/server.json +2 -2
- package/dist/mcp/server.mjs +783 -507
- package/dist/router.json +1 -1
- package/dist/scripts/condense.js +2 -2
- package/docs/MIGRATION.md +1 -1
- package/docs/guidelines/agent-infra/agent-interaction-and-decision-quality.md +71 -0
- package/docs/guidelines/agent-infra/minimal-safe-diff-mechanics.md +24 -1
- package/docs/guidelines/code-clarity.md +9 -2
- package/docs/guidelines/design-fidelity-mechanics.md +44 -0
- package/llms.txt +63 -27
- package/package.json +4 -4
- package/src/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +154 -13
- package/src/agent-src/templates/scripts/work_engine/directives/ui/design.ts +118 -0
- package/src/agent-src/templates/scripts/work_engine/directives/ui/polish.ts +40 -0
- package/src/agent-src/templates/scripts/work_engine/state.ts +55 -0
- package/src/config/agent-settings.template.yml +8 -0
- package/src/scripts/_lib/counted_probe.ts +142 -0
- package/src/scripts/_lib/exec_evidence.ts +5 -0
- package/src/scripts/_lib/overbuild_lens_contract.ts +196 -0
- package/src/scripts/_lib/release_scope.ts +207 -0
- package/src/scripts/_lib/scoped_projection.ts +212 -0
- package/src/scripts/ai_council/stance_tally.ts +37 -2
- package/src/scripts/audit_auto_rules.ts +9 -9
- package/src/scripts/audit_likelihood.ts +3 -3
- package/src/scripts/audit_overlap.ts +2 -2
- package/src/scripts/audit_skill_overlap.ts +233 -95
- package/src/scripts/audit_skill_overlap_allowlist.json +4 -0
- package/src/scripts/build_proof.ts +15 -1
- package/src/scripts/check_artefact_count_messaging.ts +128 -15
- package/src/scripts/check_dependency_floors.ts +16 -6
- package/src/scripts/check_gate_coverage.ts +6 -6
- package/src/scripts/check_kernel_rule_bundle.ts +5 -4
- package/src/scripts/check_token_quality_golden.ts +0 -18
- package/src/scripts/code_graph/loader.ts +35 -6
- package/src/scripts/compile_router.ts +3 -8
- package/src/scripts/condense.ts +2 -2
- package/src/scripts/count_scoped_projection.ts +104 -0
- package/src/scripts/explain_run.ts +0 -1
- package/src/scripts/generate_pack_manifests.ts +3 -20
- package/src/scripts/hooks/block_kernel_rule_writes.ts +145 -10
- package/src/scripts/hooks/block_no_verify.ts +101 -0
- package/src/scripts/install.ts +13 -90
- package/src/scripts/lint_agent_security.ts +5 -4
- package/src/scripts/lint_framework_leakage_allowlist.json +2 -2
- package/src/scripts/lint_regression.ts +92 -1
- package/src/scripts/lint_skill_descriptions.ts +93 -5
- package/src/scripts/project_thin_rules.ts +2 -2
- package/src/scripts/release.ts +107 -3
- package/src/scripts/resolve_lint_scope.ts +53 -0
- package/src/scripts/router_telemetry.ts +0 -5
- package/src/scripts/runtime_dispatcher.ts +40 -0
- package/src/scripts/schemas/pack.schema.json +1 -5
- package/src/scripts/schemas/rule.schema.json +1 -2
- package/src/scripts/self_review_gate.ts +15 -73
- package/src/scripts/skill_linter.ts +160 -11
- package/src/scripts/sweep_dead_scan_roots.ts +550 -0
- package/src/scripts/trigger_coverage.ts +11 -37
- package/src/scripts/update_counts.ts +90 -11
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, path50) {
|
|
1673
|
+
const ctrl = callVisitor(key, node, visitor, path50);
|
|
1674
1674
|
if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
|
|
1675
|
-
replaceNode(key,
|
|
1676
|
-
return visit_(key, ctrl, visitor,
|
|
1675
|
+
replaceNode(key, path50, ctrl);
|
|
1676
|
+
return visit_(key, ctrl, visitor, path50);
|
|
1677
1677
|
}
|
|
1678
1678
|
if (typeof ctrl !== "symbol") {
|
|
1679
1679
|
if (identity.isCollection(node)) {
|
|
1680
|
-
|
|
1680
|
+
path50 = Object.freeze(path50.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, path50);
|
|
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
|
+
path50 = Object.freeze(path50.concat(node));
|
|
1694
|
+
const ck = visit_("key", node.key, visitor, path50);
|
|
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, path50);
|
|
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, path50) {
|
|
1721
|
+
const ctrl = await callVisitor(key, node, visitor, path50);
|
|
1722
1722
|
if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
|
|
1723
|
-
replaceNode(key,
|
|
1724
|
-
return visitAsync_(key, ctrl, visitor,
|
|
1723
|
+
replaceNode(key, path50, ctrl);
|
|
1724
|
+
return visitAsync_(key, ctrl, visitor, path50);
|
|
1725
1725
|
}
|
|
1726
1726
|
if (typeof ctrl !== "symbol") {
|
|
1727
1727
|
if (identity.isCollection(node)) {
|
|
1728
|
-
|
|
1728
|
+
path50 = Object.freeze(path50.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, path50);
|
|
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
|
+
path50 = Object.freeze(path50.concat(node));
|
|
1742
|
+
const ck = await visitAsync_("key", node.key, visitor, path50);
|
|
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, path50);
|
|
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, path50) {
|
|
1775
1775
|
if (typeof visitor === "function")
|
|
1776
|
-
return visitor(key, node,
|
|
1776
|
+
return visitor(key, node, path50);
|
|
1777
1777
|
if (identity.isMap(node))
|
|
1778
|
-
return visitor.Map?.(key, node,
|
|
1778
|
+
return visitor.Map?.(key, node, path50);
|
|
1779
1779
|
if (identity.isSeq(node))
|
|
1780
|
-
return visitor.Seq?.(key, node,
|
|
1780
|
+
return visitor.Seq?.(key, node, path50);
|
|
1781
1781
|
if (identity.isPair(node))
|
|
1782
|
-
return visitor.Pair?.(key, node,
|
|
1782
|
+
return visitor.Pair?.(key, node, path50);
|
|
1783
1783
|
if (identity.isScalar(node))
|
|
1784
|
-
return visitor.Scalar?.(key, node,
|
|
1784
|
+
return visitor.Scalar?.(key, node, path50);
|
|
1785
1785
|
if (identity.isAlias(node))
|
|
1786
|
-
return visitor.Alias?.(key, node,
|
|
1786
|
+
return visitor.Alias?.(key, node, path50);
|
|
1787
1787
|
return void 0;
|
|
1788
1788
|
}
|
|
1789
|
-
function replaceNode(key,
|
|
1790
|
-
const parent =
|
|
1789
|
+
function replaceNode(key, path50, node) {
|
|
1790
|
+
const parent = path50[path50.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, path50, value) {
|
|
2401
2401
|
let v = value;
|
|
2402
|
-
for (let i =
|
|
2403
|
-
const k =
|
|
2402
|
+
for (let i = path50.length - 1; i >= 0; --i) {
|
|
2403
|
+
const k = path50[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 = (path50) => path50 == null || typeof path50 === "object" && !!path50[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(path50, value) {
|
|
2453
|
+
if (isEmptyPath(path50))
|
|
2454
2454
|
this.add(value);
|
|
2455
2455
|
else {
|
|
2456
|
-
const [key, ...rest] =
|
|
2456
|
+
const [key, ...rest] = path50;
|
|
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(path50) {
|
|
2471
|
+
const [key, ...rest] = path50;
|
|
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(path50, keepScalar) {
|
|
2486
|
+
const [key, ...rest] = path50;
|
|
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(path50) {
|
|
2505
|
+
const [key, ...rest] = path50;
|
|
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(path50, value) {
|
|
2516
|
+
const [key, ...rest] = path50;
|
|
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(path50, value) {
|
|
5032
5032
|
if (assertCollection(this.contents))
|
|
5033
|
-
this.contents.addIn(
|
|
5033
|
+
this.contents.addIn(path50, 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(path50) {
|
|
5109
|
+
if (Collection.isEmptyPath(path50)) {
|
|
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(path50) : 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(path50, keepScalar) {
|
|
5131
|
+
if (Collection.isEmptyPath(path50))
|
|
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(path50, 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(path50) {
|
|
5145
|
+
if (Collection.isEmptyPath(path50))
|
|
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(path50) : 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(path50, value) {
|
|
5165
|
+
if (Collection.isEmptyPath(path50)) {
|
|
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(path50), value);
|
|
5169
5169
|
} else if (assertCollection(this.contents)) {
|
|
5170
|
-
this.contents.setIn(
|
|
5170
|
+
this.contents.setIn(path50, 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, path50) => {
|
|
7131
7131
|
let item = cst;
|
|
7132
|
-
for (const [field, index] of
|
|
7132
|
+
for (const [field, index] of path50) {
|
|
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, path50) => {
|
|
7142
|
+
const parent = visit.itemAtPath(cst, path50.slice(0, -1));
|
|
7143
|
+
const field = path50[path50.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(path50, item, visitor) {
|
|
7150
|
+
let ctrl = visitor(item, path50);
|
|
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(path50.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, path50);
|
|
7169
7169
|
}
|
|
7170
7170
|
}
|
|
7171
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
7171
|
+
return typeof ctrl === "function" ? ctrl(item, path50) : ctrl;
|
|
7172
7172
|
}
|
|
7173
7173
|
exports.visit = visit;
|
|
7174
7174
|
}
|
|
@@ -13808,6 +13808,205 @@ var init_validate_frontmatter = __esm({
|
|
|
13808
13808
|
}
|
|
13809
13809
|
});
|
|
13810
13810
|
|
|
13811
|
+
// src/scripts/_lib/counted_probe.ts
|
|
13812
|
+
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
13813
|
+
function runCountedProbe(command, args, opts = {}) {
|
|
13814
|
+
const maxBuffer = opts.maxBuffer ?? DEFAULT_PROBE_MAX_BUFFER;
|
|
13815
|
+
const res = spawnSync2(command, [...args], {
|
|
13816
|
+
cwd: opts.cwd,
|
|
13817
|
+
encoding: "utf-8",
|
|
13818
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
13819
|
+
maxBuffer,
|
|
13820
|
+
...opts.timeout === void 0 ? {} : { timeout: opts.timeout },
|
|
13821
|
+
...opts.env === void 0 ? {} : { env: opts.env }
|
|
13822
|
+
});
|
|
13823
|
+
return interpretProbeResult(res, `${command} ${args.join(" ")}`.trim(), maxBuffer);
|
|
13824
|
+
}
|
|
13825
|
+
function interpretProbeResult(res, command, maxBuffer = DEFAULT_PROBE_MAX_BUFFER) {
|
|
13826
|
+
const stdout = res.stdout ?? "";
|
|
13827
|
+
const stderr = res.stderr ?? "";
|
|
13828
|
+
if (res.error) {
|
|
13829
|
+
if (res.error.code === "ENOBUFS") {
|
|
13830
|
+
throw new ProbeOverflowError(command, maxBuffer);
|
|
13831
|
+
}
|
|
13832
|
+
return {
|
|
13833
|
+
ok: false,
|
|
13834
|
+
stdout,
|
|
13835
|
+
stderr,
|
|
13836
|
+
status: res.status,
|
|
13837
|
+
failure: `${res.error.code ?? res.error.message}`
|
|
13838
|
+
};
|
|
13839
|
+
}
|
|
13840
|
+
if ((res.status ?? 1) !== 0) {
|
|
13841
|
+
return {
|
|
13842
|
+
ok: false,
|
|
13843
|
+
stdout,
|
|
13844
|
+
stderr,
|
|
13845
|
+
status: res.status,
|
|
13846
|
+
failure: `exited ${res.status ?? "(null)"}`
|
|
13847
|
+
};
|
|
13848
|
+
}
|
|
13849
|
+
return { ok: true, stdout, stderr, status: res.status, failure: null };
|
|
13850
|
+
}
|
|
13851
|
+
var DEFAULT_PROBE_MAX_BUFFER, ProbeOverflowError;
|
|
13852
|
+
var init_counted_probe = __esm({
|
|
13853
|
+
"src/scripts/_lib/counted_probe.ts"() {
|
|
13854
|
+
"use strict";
|
|
13855
|
+
DEFAULT_PROBE_MAX_BUFFER = 64 * 1024 * 1024;
|
|
13856
|
+
ProbeOverflowError = class extends Error {
|
|
13857
|
+
constructor(command, maxBuffer) {
|
|
13858
|
+
super(
|
|
13859
|
+
`probe \`${command}\` exceeded its ${Math.round(maxBuffer / (1024 * 1024))} MiB output buffer \u2014 the read was truncated, so any count derived from it would be wrong. This is an error rather than a zero on purpose: a counting probe that degrades to zero reports a clean result it never measured. Raise the buffer or narrow the command.`
|
|
13860
|
+
);
|
|
13861
|
+
this.command = command;
|
|
13862
|
+
this.maxBuffer = maxBuffer;
|
|
13863
|
+
this.name = "ProbeOverflowError";
|
|
13864
|
+
}
|
|
13865
|
+
command;
|
|
13866
|
+
maxBuffer;
|
|
13867
|
+
};
|
|
13868
|
+
}
|
|
13869
|
+
});
|
|
13870
|
+
|
|
13871
|
+
// src/scripts/_lib/release_scope.ts
|
|
13872
|
+
import { spawnSync as spawnSync3 } from "node:child_process";
|
|
13873
|
+
import path18 from "node:path";
|
|
13874
|
+
import { fileURLToPath as fileURLToPath12 } from "node:url";
|
|
13875
|
+
function detectReleaseVersion(patchText) {
|
|
13876
|
+
const addedLines = patchText.split("\n").filter((l) => l.startsWith("+") && !l.startsWith("+++")).map((l) => l.slice(1));
|
|
13877
|
+
let changelogVersion = null;
|
|
13878
|
+
let packageVersion = null;
|
|
13879
|
+
for (const line of addedLines) {
|
|
13880
|
+
const changelogMatch = /^##\s*\[(\d+\.\d+\.\d+)\]/.exec(line);
|
|
13881
|
+
if (changelogMatch) changelogVersion = changelogMatch[1] ?? null;
|
|
13882
|
+
const packageMatch = /^\s*"version"\s*:\s*"(\d+\.\d+\.\d+)"/.exec(line);
|
|
13883
|
+
if (packageMatch) packageVersion = packageMatch[1] ?? null;
|
|
13884
|
+
}
|
|
13885
|
+
if (changelogVersion && packageVersion && changelogVersion === packageVersion) {
|
|
13886
|
+
return changelogVersion;
|
|
13887
|
+
}
|
|
13888
|
+
return null;
|
|
13889
|
+
}
|
|
13890
|
+
function releaseDetectionPatch(baseRef, cwd) {
|
|
13891
|
+
const r = spawnSync3("git", ["diff", `${baseRef}...HEAD`, "--", "CHANGELOG.md", "package.json"], {
|
|
13892
|
+
cwd,
|
|
13893
|
+
encoding: "utf8",
|
|
13894
|
+
maxBuffer: 8 * 1024 * 1024
|
|
13895
|
+
});
|
|
13896
|
+
return (r.stdout ?? "").toString();
|
|
13897
|
+
}
|
|
13898
|
+
function detectReleaseVersionFromGit(baseRef, cwd = REPO_ROOT) {
|
|
13899
|
+
return detectReleaseVersion(releaseDetectionPatch(baseRef, cwd));
|
|
13900
|
+
}
|
|
13901
|
+
function parseSemver(raw) {
|
|
13902
|
+
const m = /^v?(\d+)\.(\d+)\.(\d+)$/.exec(raw.trim());
|
|
13903
|
+
if (!m) return null;
|
|
13904
|
+
return [Number(m[1]), Number(m[2]), Number(m[3])];
|
|
13905
|
+
}
|
|
13906
|
+
function semverLessThan(a, b) {
|
|
13907
|
+
const [aMajor, aMinor, aPatch] = a;
|
|
13908
|
+
const [bMajor, bMinor, bPatch] = b;
|
|
13909
|
+
if (aMajor !== bMajor) return aMajor < bMajor;
|
|
13910
|
+
if (aMinor !== bMinor) return aMinor < bMinor;
|
|
13911
|
+
return aPatch < bPatch;
|
|
13912
|
+
}
|
|
13913
|
+
function pickPreviousTag(version, tags) {
|
|
13914
|
+
const target = parseSemver(version);
|
|
13915
|
+
if (!target) return null;
|
|
13916
|
+
let best = null;
|
|
13917
|
+
for (const raw of tags) {
|
|
13918
|
+
const parsed = parseSemver(raw);
|
|
13919
|
+
if (!parsed) continue;
|
|
13920
|
+
if (!semverLessThan(parsed, target)) continue;
|
|
13921
|
+
if (!best || semverLessThan(best.parsed, parsed)) best = { raw, parsed };
|
|
13922
|
+
}
|
|
13923
|
+
return best ? best.raw : null;
|
|
13924
|
+
}
|
|
13925
|
+
function localTags(cwd) {
|
|
13926
|
+
const r = spawnSync3("git", ["tag", "--list"], { cwd, encoding: "utf8", maxBuffer: 8 * 1024 * 1024 });
|
|
13927
|
+
if ((r.status ?? 1) !== 0) return [];
|
|
13928
|
+
return (r.stdout ?? "").split("\n").map((l) => l.trim()).filter((l) => l.length > 0);
|
|
13929
|
+
}
|
|
13930
|
+
function resolveContentLintScope(opts = {}) {
|
|
13931
|
+
const cwd = opts.cwd ?? REPO_ROOT;
|
|
13932
|
+
const baseRef = opts.baseRef ?? "origin/main";
|
|
13933
|
+
const explicit = opts.since ?? process.env["RELEASE_LINT_BASE"] ?? null;
|
|
13934
|
+
if (explicit !== null && explicit.trim() !== "") {
|
|
13935
|
+
const base = explicit.trim();
|
|
13936
|
+
return {
|
|
13937
|
+
base,
|
|
13938
|
+
isRelease: false,
|
|
13939
|
+
version: null,
|
|
13940
|
+
previousTag: null,
|
|
13941
|
+
reason: `scope pinned to ${base} by an explicit override`
|
|
13942
|
+
};
|
|
13943
|
+
}
|
|
13944
|
+
const version = detectReleaseVersionFromGit(baseRef, cwd);
|
|
13945
|
+
if (version === null) {
|
|
13946
|
+
return {
|
|
13947
|
+
base: baseRef,
|
|
13948
|
+
isRelease: false,
|
|
13949
|
+
version: null,
|
|
13950
|
+
previousTag: null,
|
|
13951
|
+
reason: `ordinary PR \u2014 scope is ${baseRef}...HEAD`
|
|
13952
|
+
};
|
|
13953
|
+
}
|
|
13954
|
+
const previousTag = pickPreviousTag(version, localTags(cwd));
|
|
13955
|
+
if (previousTag === null) {
|
|
13956
|
+
return {
|
|
13957
|
+
base: baseRef,
|
|
13958
|
+
isRelease: true,
|
|
13959
|
+
version,
|
|
13960
|
+
previousTag: null,
|
|
13961
|
+
reason: `release ${version} detected, but no earlier semver tag is reachable \u2014 scope stays ${baseRef}...HEAD and therefore sees only the release wrapper`
|
|
13962
|
+
};
|
|
13963
|
+
}
|
|
13964
|
+
return {
|
|
13965
|
+
base: previousTag,
|
|
13966
|
+
isRelease: true,
|
|
13967
|
+
version,
|
|
13968
|
+
previousTag,
|
|
13969
|
+
reason: `release ${version} detected \u2014 scope widened to ${previousTag}...HEAD so the check sees the release, not the version bump`
|
|
13970
|
+
};
|
|
13971
|
+
}
|
|
13972
|
+
var __dirname, REPO_ROOT;
|
|
13973
|
+
var init_release_scope = __esm({
|
|
13974
|
+
"src/scripts/_lib/release_scope.ts"() {
|
|
13975
|
+
"use strict";
|
|
13976
|
+
__dirname = path18.dirname(fileURLToPath12(import.meta.url));
|
|
13977
|
+
REPO_ROOT = path18.resolve(__dirname, "..", "..", "..");
|
|
13978
|
+
}
|
|
13979
|
+
});
|
|
13980
|
+
|
|
13981
|
+
// src/scripts/_lib/scan_scope.ts
|
|
13982
|
+
function assertScanned(opts) {
|
|
13983
|
+
if (opts.scanned > 0) {
|
|
13984
|
+
return;
|
|
13985
|
+
}
|
|
13986
|
+
if (opts.allowEmpty !== void 0 && opts.allowEmpty.trim() !== "") {
|
|
13987
|
+
return;
|
|
13988
|
+
}
|
|
13989
|
+
const roots = opts.roots.length > 0 ? opts.roots.join(", ") : "(no root declared)";
|
|
13990
|
+
throw new DeadScopeError(
|
|
13991
|
+
opts.gate,
|
|
13992
|
+
`${opts.gate}: scanned 0 ${opts.units} under ${roots} \u2014 the scan scope is dead or the root moved. A gate that read nothing has not passed. Repoint the root (prefer the shared resolver in _lib/agent_src.ts), or declare a justified \`allowEmpty\` reason if an empty corpus is genuinely expected.`
|
|
13993
|
+
);
|
|
13994
|
+
}
|
|
13995
|
+
var DeadScopeError;
|
|
13996
|
+
var init_scan_scope = __esm({
|
|
13997
|
+
"src/scripts/_lib/scan_scope.ts"() {
|
|
13998
|
+
"use strict";
|
|
13999
|
+
DeadScopeError = class extends Error {
|
|
14000
|
+
gate;
|
|
14001
|
+
constructor(gate, message) {
|
|
14002
|
+
super(message);
|
|
14003
|
+
this.name = "DeadScopeError";
|
|
14004
|
+
this.gate = gate;
|
|
14005
|
+
}
|
|
14006
|
+
};
|
|
14007
|
+
}
|
|
14008
|
+
});
|
|
14009
|
+
|
|
13811
14010
|
// src/scripts/skill_linter.ts
|
|
13812
14011
|
var skill_linter_exports = {};
|
|
13813
14012
|
__export(skill_linter_exports, {
|
|
@@ -13837,6 +14036,8 @@ __export(skill_linter_exports, {
|
|
|
13837
14036
|
gather_all_candidate_files: () => gather_all_candidate_files,
|
|
13838
14037
|
gather_candidate_files_under: () => gather_candidate_files_under,
|
|
13839
14038
|
gather_changed_candidate_files: () => gather_changed_candidate_files,
|
|
14039
|
+
last_changed_base_diff_ok: () => last_changed_base_diff_ok,
|
|
14040
|
+
last_changed_scope_reason: () => last_changed_scope_reason,
|
|
13840
14041
|
lint_command: () => lint_command,
|
|
13841
14042
|
lint_file: () => lint_file,
|
|
13842
14043
|
lint_guideline: () => lint_guideline,
|
|
@@ -13853,11 +14054,10 @@ __export(skill_linter_exports, {
|
|
|
13853
14054
|
parse_output_schema: () => parse_output_schema,
|
|
13854
14055
|
validate_evals_json: () => validate_evals_json
|
|
13855
14056
|
});
|
|
13856
|
-
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
13857
14057
|
import * as fs19 from "node:fs";
|
|
13858
|
-
import * as
|
|
14058
|
+
import * as path19 from "node:path";
|
|
13859
14059
|
import process7 from "node:process";
|
|
13860
|
-
import { fileURLToPath as
|
|
14060
|
+
import { fileURLToPath as fileURLToPath13, pathToFileURL as pathToFileURL7 } from "node:url";
|
|
13861
14061
|
function splitlines(text) {
|
|
13862
14062
|
if (text === "") {
|
|
13863
14063
|
return [];
|
|
@@ -13916,7 +14116,7 @@ function rglob(root, predicate) {
|
|
|
13916
14116
|
return;
|
|
13917
14117
|
}
|
|
13918
14118
|
for (const ent of entries) {
|
|
13919
|
-
const full =
|
|
14119
|
+
const full = path19.join(dir, ent.name);
|
|
13920
14120
|
if (ent.isDirectory()) {
|
|
13921
14121
|
walk(full);
|
|
13922
14122
|
} else if (predicate(ent.name)) {
|
|
@@ -13934,18 +14134,18 @@ function glob(dir, predicate) {
|
|
|
13934
14134
|
} catch {
|
|
13935
14135
|
return [];
|
|
13936
14136
|
}
|
|
13937
|
-
return entries.filter((e) => e.isFile() && predicate(e.name)).map((e) =>
|
|
14137
|
+
return entries.filter((e) => e.isFile() && predicate(e.name)).map((e) => path19.join(dir, e.name));
|
|
13938
14138
|
}
|
|
13939
14139
|
function basename8(p) {
|
|
13940
|
-
return
|
|
14140
|
+
return path19.basename(p);
|
|
13941
14141
|
}
|
|
13942
14142
|
function stem(p) {
|
|
13943
|
-
const b =
|
|
14143
|
+
const b = path19.basename(p);
|
|
13944
14144
|
const dot = b.lastIndexOf(".");
|
|
13945
14145
|
return dot > 0 ? b.slice(0, dot) : b;
|
|
13946
14146
|
}
|
|
13947
14147
|
function parentName(p) {
|
|
13948
|
-
return
|
|
14148
|
+
return path19.basename(path19.dirname(p));
|
|
13949
14149
|
}
|
|
13950
14150
|
function dedupePreserveOrder(items) {
|
|
13951
14151
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -14450,7 +14650,7 @@ function lint_router_frontmatter(ruleId, frontmatter, ruleType) {
|
|
|
14450
14650
|
);
|
|
14451
14651
|
}
|
|
14452
14652
|
} else {
|
|
14453
|
-
const repoRoot =
|
|
14653
|
+
const repoRoot = path19.resolve(_HERE4, "..", "..");
|
|
14454
14654
|
routesTo.forEach((item, idx) => {
|
|
14455
14655
|
if (typeof item !== "string" || !item.includes(":")) {
|
|
14456
14656
|
issues.push(new Issue("error", "route_shape_invalid", `routes_to[${idx}] must be 'kind:id'`));
|
|
@@ -14463,12 +14663,12 @@ function lint_router_frontmatter(ruleId, frontmatter, ruleType) {
|
|
|
14463
14663
|
if (kind === "skill") {
|
|
14464
14664
|
target = resolve_logical(`skills/${targetId}/SKILL.md`);
|
|
14465
14665
|
} else if (kind === "guideline") {
|
|
14466
|
-
const gpath =
|
|
14666
|
+
const gpath = path19.join(repoRoot, "docs", "guidelines", `${targetId}.md`);
|
|
14467
14667
|
target = exists(gpath) ? gpath : null;
|
|
14468
14668
|
} else if (kind === "command") {
|
|
14469
14669
|
target = resolve_logical(`commands/${targetId}.md`);
|
|
14470
14670
|
} else if (kind === "contract") {
|
|
14471
|
-
const cpath =
|
|
14671
|
+
const cpath = path19.join(repoRoot, "docs", "contracts", `${targetId}.md`);
|
|
14472
14672
|
if (exists(cpath)) {
|
|
14473
14673
|
target = cpath;
|
|
14474
14674
|
} else {
|
|
@@ -15096,7 +15296,7 @@ function lint_skill(p, text) {
|
|
|
15096
15296
|
return new LintResult(p, "skill", classify_status(issues), issues, dedupePreserveOrder(suggestions));
|
|
15097
15297
|
}
|
|
15098
15298
|
function validate_evals_json(skillPath) {
|
|
15099
|
-
const evalsPath =
|
|
15299
|
+
const evalsPath = path19.join(path19.dirname(skillPath), "evals", "evals.json");
|
|
15100
15300
|
if (!isFile(evalsPath)) {
|
|
15101
15301
|
return [];
|
|
15102
15302
|
}
|
|
@@ -15668,14 +15868,14 @@ function gather_all_candidate_files(root) {
|
|
|
15668
15868
|
const sources = artefact_roots();
|
|
15669
15869
|
if (sources.length > 0) {
|
|
15670
15870
|
for (const srcRoot of sources) {
|
|
15671
|
-
const skillsDir =
|
|
15871
|
+
const skillsDir = path19.join(srcRoot, "skills");
|
|
15672
15872
|
if (isDir(skillsDir)) {
|
|
15673
15873
|
for (const f of rglob(skillsDir, (b) => b === "SKILL.md")) {
|
|
15674
15874
|
add(f, srcRoot);
|
|
15675
15875
|
}
|
|
15676
15876
|
}
|
|
15677
15877
|
for (const sub of ["rules", "commands", "guidelines"]) {
|
|
15678
|
-
const base =
|
|
15878
|
+
const base = path19.join(srcRoot, sub);
|
|
15679
15879
|
if (exists(base)) {
|
|
15680
15880
|
for (const f of rglob(base, (b) => b.endsWith(".md"))) {
|
|
15681
15881
|
add(f, srcRoot);
|
|
@@ -15683,7 +15883,7 @@ function gather_all_candidate_files(root) {
|
|
|
15683
15883
|
}
|
|
15684
15884
|
}
|
|
15685
15885
|
for (const sub of ["personas", "user-types"]) {
|
|
15686
|
-
const base =
|
|
15886
|
+
const base = path19.join(srcRoot, sub);
|
|
15687
15887
|
if (exists(base)) {
|
|
15688
15888
|
for (const f of glob(base, (b) => b.endsWith(".md"))) {
|
|
15689
15889
|
if (basename8(f).toLowerCase() === "readme.md") {
|
|
@@ -15693,13 +15893,13 @@ function gather_all_candidate_files(root) {
|
|
|
15693
15893
|
}
|
|
15694
15894
|
}
|
|
15695
15895
|
}
|
|
15696
|
-
const charter =
|
|
15896
|
+
const charter = path19.join(srcRoot, FRUGALITY_CHARTER_RELPATH);
|
|
15697
15897
|
if (exists(charter) && !isSymlink(charter)) {
|
|
15698
15898
|
add(charter, srcRoot);
|
|
15699
15899
|
}
|
|
15700
15900
|
}
|
|
15701
15901
|
} else {
|
|
15702
|
-
const augmentRoot =
|
|
15902
|
+
const augmentRoot = path19.join(root, "dist/agent-src");
|
|
15703
15903
|
if (exists(augmentRoot)) {
|
|
15704
15904
|
const subPatterns = [
|
|
15705
15905
|
["skills", (b) => b === "SKILL.md"],
|
|
@@ -15708,7 +15908,7 @@ function gather_all_candidate_files(root) {
|
|
|
15708
15908
|
["guidelines", (b) => b.endsWith(".md")]
|
|
15709
15909
|
];
|
|
15710
15910
|
for (const [sub, pred] of subPatterns) {
|
|
15711
|
-
const base =
|
|
15911
|
+
const base = path19.join(augmentRoot, sub);
|
|
15712
15912
|
if (exists(base)) {
|
|
15713
15913
|
for (const f of rglob(base, pred)) {
|
|
15714
15914
|
add(f, augmentRoot);
|
|
@@ -15716,7 +15916,7 @@ function gather_all_candidate_files(root) {
|
|
|
15716
15916
|
}
|
|
15717
15917
|
}
|
|
15718
15918
|
for (const sub of ["personas", "user-types"]) {
|
|
15719
|
-
const base =
|
|
15919
|
+
const base = path19.join(augmentRoot, sub);
|
|
15720
15920
|
if (exists(base)) {
|
|
15721
15921
|
for (const f of glob(base, (b) => b.endsWith(".md"))) {
|
|
15722
15922
|
if (basename8(f).toLowerCase() === "readme.md") {
|
|
@@ -15726,7 +15926,7 @@ function gather_all_candidate_files(root) {
|
|
|
15726
15926
|
}
|
|
15727
15927
|
}
|
|
15728
15928
|
}
|
|
15729
|
-
const charter =
|
|
15929
|
+
const charter = path19.join(augmentRoot, FRUGALITY_CHARTER_RELPATH);
|
|
15730
15930
|
if (exists(charter) && !isSymlink(charter)) {
|
|
15731
15931
|
add(charter, augmentRoot);
|
|
15732
15932
|
}
|
|
@@ -15751,14 +15951,14 @@ function gather_candidate_files_under(srcRoot) {
|
|
|
15751
15951
|
seen.add(resolved);
|
|
15752
15952
|
out.push(file);
|
|
15753
15953
|
};
|
|
15754
|
-
const skillsDir =
|
|
15954
|
+
const skillsDir = path19.join(srcRoot, "skills");
|
|
15755
15955
|
if (exists(skillsDir)) {
|
|
15756
15956
|
for (const f of rglob(skillsDir, (b) => b === "SKILL.md")) {
|
|
15757
15957
|
push(f);
|
|
15758
15958
|
}
|
|
15759
15959
|
}
|
|
15760
15960
|
for (const sub of ["rules", "commands", "guidelines"]) {
|
|
15761
|
-
const base =
|
|
15961
|
+
const base = path19.join(srcRoot, sub);
|
|
15762
15962
|
if (exists(base)) {
|
|
15763
15963
|
for (const f of rglob(base, (b) => b.endsWith(".md"))) {
|
|
15764
15964
|
push(f);
|
|
@@ -15766,7 +15966,7 @@ function gather_candidate_files_under(srcRoot) {
|
|
|
15766
15966
|
}
|
|
15767
15967
|
}
|
|
15768
15968
|
for (const sub of ["personas", "user-types"]) {
|
|
15769
|
-
const base =
|
|
15969
|
+
const base = path19.join(srcRoot, sub);
|
|
15770
15970
|
if (exists(base)) {
|
|
15771
15971
|
for (const f of glob(base, (b) => b.endsWith(".md"))) {
|
|
15772
15972
|
if (basename8(f).toLowerCase() === "readme.md") {
|
|
@@ -15776,26 +15976,31 @@ function gather_candidate_files_under(srcRoot) {
|
|
|
15776
15976
|
}
|
|
15777
15977
|
}
|
|
15778
15978
|
}
|
|
15779
|
-
const charter =
|
|
15979
|
+
const charter = path19.join(srcRoot, FRUGALITY_CHARTER_RELPATH);
|
|
15780
15980
|
if (exists(charter) && !isSymlink(charter)) {
|
|
15781
15981
|
push(charter);
|
|
15782
15982
|
}
|
|
15783
15983
|
return sortedUnique(out);
|
|
15784
15984
|
}
|
|
15785
|
-
function gather_changed_candidate_files(root) {
|
|
15985
|
+
function gather_changed_candidate_files(root, since) {
|
|
15986
|
+
const scope = resolveContentLintScope({ cwd: root, since: since ?? null });
|
|
15987
|
+
last_changed_scope_reason = scope.reason;
|
|
15988
|
+
last_changed_base_diff_ok = false;
|
|
15786
15989
|
const diffCommands = [
|
|
15787
|
-
["git", "diff", "--name-only",
|
|
15990
|
+
["git", "diff", "--name-only", `${scope.base}...HEAD`],
|
|
15788
15991
|
["git", "diff", "--name-only", "--cached", "HEAD"],
|
|
15789
15992
|
["git", "diff", "--name-only", "HEAD"]
|
|
15790
15993
|
];
|
|
15791
15994
|
try {
|
|
15792
15995
|
let rawLines = [];
|
|
15996
|
+
let first = true;
|
|
15793
15997
|
for (const cmd of diffCommands) {
|
|
15794
|
-
const result =
|
|
15795
|
-
|
|
15796
|
-
|
|
15797
|
-
|
|
15798
|
-
|
|
15998
|
+
const result = runCountedProbe(cmd[0], cmd.slice(1), { cwd: root });
|
|
15999
|
+
if (first) {
|
|
16000
|
+
last_changed_base_diff_ok = result.ok;
|
|
16001
|
+
first = false;
|
|
16002
|
+
}
|
|
16003
|
+
if (result.ok && result.stdout.trim()) {
|
|
15799
16004
|
rawLines = splitlines(result.stdout);
|
|
15800
16005
|
break;
|
|
15801
16006
|
}
|
|
@@ -15806,7 +16011,7 @@ function gather_changed_candidate_files(root) {
|
|
|
15806
16011
|
if (!raw) {
|
|
15807
16012
|
continue;
|
|
15808
16013
|
}
|
|
15809
|
-
const p =
|
|
16014
|
+
const p = path19.join(root, raw);
|
|
15810
16015
|
if (!exists(p)) {
|
|
15811
16016
|
continue;
|
|
15812
16017
|
}
|
|
@@ -15818,14 +16023,18 @@ function gather_changed_candidate_files(root) {
|
|
|
15818
16023
|
if (!inSource) {
|
|
15819
16024
|
continue;
|
|
15820
16025
|
}
|
|
15821
|
-
const isMd =
|
|
16026
|
+
const isMd = path19.extname(p) === ".md";
|
|
15822
16027
|
const inEvals = norm.includes("/evals/");
|
|
15823
16028
|
if (!inEvals && (basename8(p) === "SKILL.md" || isMd && (norm.includes("/rules/") || norm.includes("/commands/")))) {
|
|
15824
16029
|
files.push(p);
|
|
15825
16030
|
}
|
|
15826
16031
|
}
|
|
15827
16032
|
return sortedUnique(files);
|
|
15828
|
-
} catch {
|
|
16033
|
+
} catch (exc) {
|
|
16034
|
+
if (exc instanceof ProbeOverflowError) {
|
|
16035
|
+
throw exc;
|
|
16036
|
+
}
|
|
16037
|
+
last_changed_scope_reason = `change set unresolvable (${exc instanceof Error ? exc.message : String(exc)})`;
|
|
15829
16038
|
return [];
|
|
15830
16039
|
}
|
|
15831
16040
|
}
|
|
@@ -16356,7 +16565,7 @@ function lint_frugality_charter_index(p, text) {
|
|
|
16356
16565
|
return [];
|
|
16357
16566
|
}
|
|
16358
16567
|
const issues = [];
|
|
16359
|
-
const rulesDir =
|
|
16568
|
+
const rulesDir = path19.join(path19.dirname(path19.dirname(path19.dirname(p))), "rules");
|
|
16360
16569
|
const ruleSlugsCache = /* @__PURE__ */ new Map();
|
|
16361
16570
|
const canonicalSatisfied = /* @__PURE__ */ new Set();
|
|
16362
16571
|
for (const linkMatch of text.matchAll(_MD_LINK_PATTERN)) {
|
|
@@ -16375,7 +16584,7 @@ function lint_frugality_charter_index(p, text) {
|
|
|
16375
16584
|
canonicalSatisfied.add(ruleName);
|
|
16376
16585
|
}
|
|
16377
16586
|
if (!ruleSlugsCache.has(ruleName)) {
|
|
16378
|
-
const ruleFile =
|
|
16587
|
+
const ruleFile = path19.join(rulesDir, ruleName);
|
|
16379
16588
|
if (!exists(ruleFile)) {
|
|
16380
16589
|
issues.push(
|
|
16381
16590
|
new Issue(
|
|
@@ -16442,7 +16651,7 @@ function lint_governance(p, _text, artifactType, repoRoot) {
|
|
|
16442
16651
|
logical = idx !== -1 ? norm.slice(idx + marker.length) : null;
|
|
16443
16652
|
}
|
|
16444
16653
|
if (logical) {
|
|
16445
|
-
const condensedPath =
|
|
16654
|
+
const condensedPath = path19.join(repoRoot, "dist/agent-src", logical);
|
|
16446
16655
|
if (!exists(condensedPath)) {
|
|
16447
16656
|
issues.push(
|
|
16448
16657
|
new Issue(
|
|
@@ -16556,7 +16765,7 @@ function load_output_schema(skillPath) {
|
|
|
16556
16765
|
if (basename8(skillPath) !== "SKILL.md") {
|
|
16557
16766
|
return null;
|
|
16558
16767
|
}
|
|
16559
|
-
const schemaPath =
|
|
16768
|
+
const schemaPath = path19.join(path19.dirname(skillPath), "evals", "output-schema.yml");
|
|
16560
16769
|
if (!exists(schemaPath)) {
|
|
16561
16770
|
return null;
|
|
16562
16771
|
}
|
|
@@ -16627,7 +16836,7 @@ function lint_file(p, repoRoot = null) {
|
|
|
16627
16836
|
const artifactType = detect_artifact_type(p, text);
|
|
16628
16837
|
let displayPath = p;
|
|
16629
16838
|
if (repoRoot) {
|
|
16630
|
-
if (isUnder(p, repoRoot) ||
|
|
16839
|
+
if (isUnder(p, repoRoot) || path19.resolve(p) === path19.resolve(repoRoot)) {
|
|
16631
16840
|
displayPath = relPosixNative(p, repoRoot);
|
|
16632
16841
|
}
|
|
16633
16842
|
}
|
|
@@ -16787,18 +16996,18 @@ function check_condensation_pairs(root) {
|
|
|
16787
16996
|
["commands", "*.md", false]
|
|
16788
16997
|
];
|
|
16789
16998
|
for (const [subdir, pattern, isNested] of pairs) {
|
|
16790
|
-
const condensedDir =
|
|
16999
|
+
const condensedDir = path19.join(root, "dist/agent-src", subdir);
|
|
16791
17000
|
const uncondensedNames = /* @__PURE__ */ new Set();
|
|
16792
17001
|
let anySource = false;
|
|
16793
17002
|
for (const srcRoot of artefact_roots()) {
|
|
16794
|
-
const uncondensedDir =
|
|
17003
|
+
const uncondensedDir = path19.join(srcRoot, subdir);
|
|
16795
17004
|
if (!exists(uncondensedDir)) {
|
|
16796
17005
|
continue;
|
|
16797
17006
|
}
|
|
16798
17007
|
anySource = true;
|
|
16799
17008
|
if (isNested) {
|
|
16800
17009
|
for (const d of iterdir(uncondensedDir)) {
|
|
16801
|
-
if (isDir(d) && exists(
|
|
17010
|
+
if (isDir(d) && exists(path19.join(d, pattern))) {
|
|
16802
17011
|
uncondensedNames.add(basename8(d));
|
|
16803
17012
|
}
|
|
16804
17013
|
}
|
|
@@ -16817,7 +17026,7 @@ function check_condensation_pairs(root) {
|
|
|
16817
17026
|
if (exists(condensedDir)) {
|
|
16818
17027
|
if (isNested) {
|
|
16819
17028
|
for (const d of iterdir(condensedDir)) {
|
|
16820
|
-
if (isDir(d) && exists(
|
|
17029
|
+
if (isDir(d) && exists(path19.join(d, pattern))) {
|
|
16821
17030
|
condensedNames.add(basename8(d));
|
|
16822
17031
|
}
|
|
16823
17032
|
}
|
|
@@ -16858,13 +17067,13 @@ function check_condensation_pairs(root) {
|
|
|
16858
17067
|
}
|
|
16859
17068
|
function check_condensation_quality(root) {
|
|
16860
17069
|
const results = [];
|
|
16861
|
-
const condensedDir =
|
|
17070
|
+
const condensedDir = path19.join(root, "dist/agent-src", "skills");
|
|
16862
17071
|
if (!exists(condensedDir)) {
|
|
16863
17072
|
return results;
|
|
16864
17073
|
}
|
|
16865
17074
|
const skillSources = [];
|
|
16866
17075
|
for (const srcRoot of artefact_roots()) {
|
|
16867
|
-
const uncondensedDir =
|
|
17076
|
+
const uncondensedDir = path19.join(srcRoot, "skills");
|
|
16868
17077
|
if (exists(uncondensedDir)) {
|
|
16869
17078
|
skillSources.push(...iterdir(uncondensedDir).sort());
|
|
16870
17079
|
}
|
|
@@ -16874,8 +17083,8 @@ function check_condensation_quality(root) {
|
|
|
16874
17083
|
}
|
|
16875
17084
|
const preservedSections = ["When to use", "Procedure", "Gotcha", "Gotchas", "Do NOT", "Output format", "Output"];
|
|
16876
17085
|
for (const skillDir of skillSources) {
|
|
16877
|
-
const src =
|
|
16878
|
-
const dst =
|
|
17086
|
+
const src = path19.join(skillDir, "SKILL.md");
|
|
17087
|
+
const dst = path19.join(condensedDir, basename8(skillDir), "SKILL.md");
|
|
16879
17088
|
if (!exists(src) || !exists(dst)) {
|
|
16880
17089
|
continue;
|
|
16881
17090
|
}
|
|
@@ -16947,7 +17156,7 @@ function check_duplication(root) {
|
|
|
16947
17156
|
const skillDirs = [];
|
|
16948
17157
|
const seen = /* @__PURE__ */ new Set();
|
|
16949
17158
|
for (const srcRoot of artefact_roots()) {
|
|
16950
|
-
const sd =
|
|
17159
|
+
const sd = path19.join(srcRoot, "skills");
|
|
16951
17160
|
if (!exists(sd)) {
|
|
16952
17161
|
continue;
|
|
16953
17162
|
}
|
|
@@ -16963,7 +17172,7 @@ function check_duplication(root) {
|
|
|
16963
17172
|
}
|
|
16964
17173
|
const skillData = [];
|
|
16965
17174
|
for (const skillDir of skillDirs) {
|
|
16966
|
-
const skillFile =
|
|
17175
|
+
const skillFile = path19.join(skillDir, "SKILL.md");
|
|
16967
17176
|
if (!exists(skillFile)) {
|
|
16968
17177
|
continue;
|
|
16969
17178
|
}
|
|
@@ -17137,6 +17346,7 @@ function parse_args2(argv) {
|
|
|
17137
17346
|
condensationQuality: false,
|
|
17138
17347
|
strictWarnings: false,
|
|
17139
17348
|
report: false,
|
|
17349
|
+
since: null,
|
|
17140
17350
|
repoRoot: ".",
|
|
17141
17351
|
quiet: false
|
|
17142
17352
|
};
|
|
@@ -17146,6 +17356,15 @@ function parse_args2(argv) {
|
|
|
17146
17356
|
args.all = true;
|
|
17147
17357
|
} else if (a === "--changed") {
|
|
17148
17358
|
args.changed = true;
|
|
17359
|
+
} else if (a === "--since") {
|
|
17360
|
+
const v = argv[i + 1];
|
|
17361
|
+
i += 1;
|
|
17362
|
+
if (v === void 0 || v.startsWith("--")) {
|
|
17363
|
+
throw new ArgError("argument --since: expected a git ref");
|
|
17364
|
+
}
|
|
17365
|
+
args.since = v;
|
|
17366
|
+
} else if (a.startsWith("--since=")) {
|
|
17367
|
+
args.since = a.slice("--since=".length);
|
|
17149
17368
|
} else if (a === "--format") {
|
|
17150
17369
|
const v = argv[i + 1];
|
|
17151
17370
|
i += 1;
|
|
@@ -17182,6 +17401,29 @@ function parse_args2(argv) {
|
|
|
17182
17401
|
}
|
|
17183
17402
|
return args;
|
|
17184
17403
|
}
|
|
17404
|
+
function _release_scope_requires_findings(root, since) {
|
|
17405
|
+
const scope = resolveContentLintScope({ cwd: root, since: since ?? null });
|
|
17406
|
+
return scope.isRelease && scope.previousTag !== null;
|
|
17407
|
+
}
|
|
17408
|
+
function _changed_filter_matches_head(root) {
|
|
17409
|
+
const result = runCountedProbe("git", ["ls-files", "--", "dist/agent-src"], { cwd: root });
|
|
17410
|
+
if (!result.ok) {
|
|
17411
|
+
return false;
|
|
17412
|
+
}
|
|
17413
|
+
for (const raw of splitlines(result.stdout)) {
|
|
17414
|
+
const norm = raw.trim().replace(/\\/g, "/");
|
|
17415
|
+
if (!norm || norm.includes("/evals/")) {
|
|
17416
|
+
continue;
|
|
17417
|
+
}
|
|
17418
|
+
if (!norm.startsWith("dist/agent-src/") && !norm.includes("/dist/agent-src/")) {
|
|
17419
|
+
continue;
|
|
17420
|
+
}
|
|
17421
|
+
if (norm.endsWith("/SKILL.md") || norm.endsWith(".md") && (norm.includes("/rules/") || norm.includes("/commands/"))) {
|
|
17422
|
+
return true;
|
|
17423
|
+
}
|
|
17424
|
+
}
|
|
17425
|
+
return false;
|
|
17426
|
+
}
|
|
17185
17427
|
function main7(argv) {
|
|
17186
17428
|
let args;
|
|
17187
17429
|
try {
|
|
@@ -17194,17 +17436,19 @@ function main7(argv) {
|
|
|
17194
17436
|
}
|
|
17195
17437
|
throw e;
|
|
17196
17438
|
}
|
|
17197
|
-
const root =
|
|
17439
|
+
const root = path19.resolve(args.repoRoot);
|
|
17198
17440
|
try {
|
|
17199
17441
|
const paths = [];
|
|
17200
17442
|
if (args.all || args.report) {
|
|
17201
17443
|
paths.push(...gather_all_candidate_files(root));
|
|
17202
17444
|
}
|
|
17203
17445
|
if (args.changed) {
|
|
17204
|
-
paths.push(...gather_changed_candidate_files(root));
|
|
17446
|
+
paths.push(...gather_changed_candidate_files(root, args.since));
|
|
17447
|
+
process7.stderr.write(`skill_linter --changed: ${last_changed_scope_reason}
|
|
17448
|
+
`);
|
|
17205
17449
|
}
|
|
17206
17450
|
for (const raw of args.paths) {
|
|
17207
|
-
const p =
|
|
17451
|
+
const p = path19.isAbsolute(raw) ? raw : path19.resolve(root, raw);
|
|
17208
17452
|
if (!exists(p)) {
|
|
17209
17453
|
continue;
|
|
17210
17454
|
}
|
|
@@ -17223,6 +17467,29 @@ function main7(argv) {
|
|
|
17223
17467
|
process7.stdout.write(`${format_json([])}
|
|
17224
17468
|
`);
|
|
17225
17469
|
}
|
|
17470
|
+
if (args.changed && _release_scope_requires_findings(root, args.since)) {
|
|
17471
|
+
if (last_changed_base_diff_ok && _changed_filter_matches_head(root)) {
|
|
17472
|
+
process7.stderr.write(
|
|
17473
|
+
"\u2705 verified-empty release scope: the base-span diff ran cleanly and the corpus filter still matches tracked files at HEAD \u2014 this release genuinely changes no skill/rule file. The gate is alive, not blind.\n"
|
|
17474
|
+
);
|
|
17475
|
+
} else {
|
|
17476
|
+
try {
|
|
17477
|
+
assertScanned({
|
|
17478
|
+
gate: "skill_linter --changed (release PR)",
|
|
17479
|
+
scanned: 0,
|
|
17480
|
+
units: "skill/rule files",
|
|
17481
|
+
roots: [last_changed_scope_reason]
|
|
17482
|
+
});
|
|
17483
|
+
} catch (exc) {
|
|
17484
|
+
if (exc instanceof DeadScopeError) {
|
|
17485
|
+
process7.stderr.write(`\u274C ${exc.message}
|
|
17486
|
+
`);
|
|
17487
|
+
return 2;
|
|
17488
|
+
}
|
|
17489
|
+
throw exc;
|
|
17490
|
+
}
|
|
17491
|
+
}
|
|
17492
|
+
}
|
|
17226
17493
|
process7.stderr.write("No matching skill/rule files found.\n");
|
|
17227
17494
|
return 0;
|
|
17228
17495
|
}
|
|
@@ -17307,22 +17574,22 @@ function pyPercent(value) {
|
|
|
17307
17574
|
}
|
|
17308
17575
|
function iterdir(dir) {
|
|
17309
17576
|
try {
|
|
17310
|
-
return fs19.readdirSync(dir).map((name) =>
|
|
17577
|
+
return fs19.readdirSync(dir).map((name) => path19.join(dir, name));
|
|
17311
17578
|
} catch {
|
|
17312
17579
|
return [];
|
|
17313
17580
|
}
|
|
17314
17581
|
}
|
|
17315
17582
|
function isUnder(child, parent) {
|
|
17316
|
-
const c =
|
|
17317
|
-
const par =
|
|
17318
|
-
const rel =
|
|
17319
|
-
return rel !== "" && !rel.startsWith("..") && !
|
|
17583
|
+
const c = path19.resolve(child);
|
|
17584
|
+
const par = path19.resolve(parent);
|
|
17585
|
+
const rel = path19.relative(par, c);
|
|
17586
|
+
return rel !== "" && !rel.startsWith("..") && !path19.isAbsolute(rel);
|
|
17320
17587
|
}
|
|
17321
17588
|
function relPosix(child, parent) {
|
|
17322
|
-
return
|
|
17589
|
+
return path19.relative(path19.resolve(parent), path19.resolve(child)).split(path19.sep).join("/");
|
|
17323
17590
|
}
|
|
17324
17591
|
function relPosixNative(child, parent) {
|
|
17325
|
-
return
|
|
17592
|
+
return path19.relative(path19.resolve(parent), path19.resolve(child));
|
|
17326
17593
|
}
|
|
17327
17594
|
function sortedUnique(items) {
|
|
17328
17595
|
return [...new Set(items)].sort(comparePathComponents);
|
|
@@ -17388,25 +17655,28 @@ function _isCliEntry7() {
|
|
|
17388
17655
|
if (process7.argv[1] === void 0) {
|
|
17389
17656
|
return false;
|
|
17390
17657
|
}
|
|
17391
|
-
const argvUrl = pathToFileURL7(
|
|
17658
|
+
const argvUrl = pathToFileURL7(path19.resolve(process7.argv[1])).href;
|
|
17392
17659
|
if (import.meta.url === argvUrl) {
|
|
17393
17660
|
return true;
|
|
17394
17661
|
}
|
|
17395
17662
|
try {
|
|
17396
|
-
const here = fs19.realpathSync(
|
|
17397
|
-
const argv = fs19.realpathSync(
|
|
17663
|
+
const here = fs19.realpathSync(fileURLToPath13(import.meta.url));
|
|
17664
|
+
const argv = fs19.realpathSync(path19.resolve(process7.argv[1]));
|
|
17398
17665
|
return here === argv;
|
|
17399
17666
|
} catch {
|
|
17400
17667
|
return false;
|
|
17401
17668
|
}
|
|
17402
17669
|
}
|
|
17403
|
-
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_IDS, 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, _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;
|
|
17670
|
+
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_IDS, 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;
|
|
17404
17671
|
var init_skill_linter = __esm({
|
|
17405
17672
|
"src/scripts/skill_linter.ts"() {
|
|
17406
17673
|
"use strict";
|
|
17407
17674
|
init_validate_frontmatter();
|
|
17408
17675
|
init_agent_src();
|
|
17409
|
-
|
|
17676
|
+
init_counted_probe();
|
|
17677
|
+
init_release_scope();
|
|
17678
|
+
init_scan_scope();
|
|
17679
|
+
_HERE4 = path19.dirname(fileURLToPath13(import.meta.url));
|
|
17410
17680
|
REQUIRED_PERSONA_SECTIONS_CORE = [
|
|
17411
17681
|
"Focus",
|
|
17412
17682
|
"Mindset",
|
|
@@ -17502,7 +17772,6 @@ var init_skill_linter = __esm({
|
|
|
17502
17772
|
ROUTER_ALLOWED_TRIGGER_KEYS = /* @__PURE__ */ new Set([
|
|
17503
17773
|
"keyword",
|
|
17504
17774
|
"phrase",
|
|
17505
|
-
"intent",
|
|
17506
17775
|
"file_pattern",
|
|
17507
17776
|
"path_prefix",
|
|
17508
17777
|
"command"
|
|
@@ -17573,6 +17842,8 @@ var init_skill_linter = __esm({
|
|
|
17573
17842
|
NAME_PATTERN = /^name:\s*"?(.*?)"?\s*$/m;
|
|
17574
17843
|
DISABLE_MODEL_PATTERN = /^disable-model-invocation:\s*"?(true|false)"?\s*$/m;
|
|
17575
17844
|
_INSPECT_VERB_PATTERN = /\b(?:inspect|examine|audit|survey|read|look\s+at|check|review|understand|identify|analyze|analyse|detect|gather|discover)\b/i;
|
|
17845
|
+
last_changed_scope_reason = "";
|
|
17846
|
+
last_changed_base_diff_ok = false;
|
|
17576
17847
|
_INTERACTION_NAME_PATTERNS = /skill-router|handoff|analysis-skill|skill-writing|skill-reviewer|model-recommendation|developer-like-execution|universal-project-analysis|interaction|autonomous-mode|feature-planning/i;
|
|
17577
17848
|
_INTERACTION_CONTENT_KEYWORDS = [
|
|
17578
17849
|
"handoff",
|
|
@@ -17694,9 +17965,9 @@ __export(memory_signal_exports, {
|
|
|
17694
17965
|
});
|
|
17695
17966
|
import * as crypto3 from "node:crypto";
|
|
17696
17967
|
import * as fs20 from "node:fs";
|
|
17697
|
-
import * as
|
|
17968
|
+
import * as path20 from "node:path";
|
|
17698
17969
|
import process8 from "node:process";
|
|
17699
|
-
import { fileURLToPath as
|
|
17970
|
+
import { fileURLToPath as fileURLToPath14, pathToFileURL as pathToFileURL8 } from "node:url";
|
|
17700
17971
|
function _setIntakeRoot2(p) {
|
|
17701
17972
|
INTAKE_ROOT3 = p;
|
|
17702
17973
|
}
|
|
@@ -17731,7 +18002,7 @@ function _new_id() {
|
|
|
17731
18002
|
function _monthly_file() {
|
|
17732
18003
|
const d = /* @__PURE__ */ new Date();
|
|
17733
18004
|
const ym = `${d.getUTCFullYear().toString().padStart(4, "0")}-${(d.getUTCMonth() + 1).toString().padStart(2, "0")}`;
|
|
17734
|
-
return
|
|
18005
|
+
return path20.join(INTAKE_ROOT3, `signals-${ym}.jsonl`);
|
|
17735
18006
|
}
|
|
17736
18007
|
function _parseFromIso(ts) {
|
|
17737
18008
|
const m = /^(\d{4})-(\d{2})-(\d{2})[ T](\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,6}))?(Z|[+-]\d{2}:\d{2})?$/.exec(ts);
|
|
@@ -17813,7 +18084,7 @@ function _globSignals(root) {
|
|
|
17813
18084
|
} catch {
|
|
17814
18085
|
return [];
|
|
17815
18086
|
}
|
|
17816
|
-
return names.filter((n) => n.startsWith("signals-") && n.endsWith(".jsonl")).sort().map((n) =>
|
|
18087
|
+
return names.filter((n) => n.startsWith("signals-") && n.endsWith(".jsonl")).sort().map((n) => path20.join(root, n));
|
|
17817
18088
|
}
|
|
17818
18089
|
function emit(entry_type, p, body, options = {}) {
|
|
17819
18090
|
const extra = options.extra ?? null;
|
|
@@ -17978,13 +18249,13 @@ function _isCliEntry8() {
|
|
|
17978
18249
|
if (process8.argv[1] === void 0) {
|
|
17979
18250
|
return false;
|
|
17980
18251
|
}
|
|
17981
|
-
const argvUrl = pathToFileURL8(
|
|
18252
|
+
const argvUrl = pathToFileURL8(path20.resolve(process8.argv[1])).href;
|
|
17982
18253
|
if (import.meta.url === argvUrl) {
|
|
17983
18254
|
return true;
|
|
17984
18255
|
}
|
|
17985
18256
|
try {
|
|
17986
|
-
const here = fs20.realpathSync(
|
|
17987
|
-
const argv = fs20.realpathSync(
|
|
18257
|
+
const here = fs20.realpathSync(fileURLToPath14(import.meta.url));
|
|
18258
|
+
const argv = fs20.realpathSync(path20.resolve(process8.argv[1]));
|
|
17988
18259
|
return here === argv;
|
|
17989
18260
|
} catch {
|
|
17990
18261
|
return false;
|
|
@@ -17994,7 +18265,7 @@ var INTAKE_ROOT3, SETTINGS_FILE, VALID_TYPES, RATE_LIMIT_WINDOW_DAYS, _PROG4, _U
|
|
|
17994
18265
|
var init_memory_signal = __esm({
|
|
17995
18266
|
"src/agent-src/templates/scripts/memory_signal.ts"() {
|
|
17996
18267
|
"use strict";
|
|
17997
|
-
INTAKE_ROOT3 =
|
|
18268
|
+
INTAKE_ROOT3 = path20.join("agents", "memory", "intake");
|
|
17998
18269
|
SETTINGS_FILE = ".agent-settings.yml";
|
|
17999
18270
|
VALID_TYPES = /* @__PURE__ */ new Set([
|
|
18000
18271
|
"historical-patterns",
|
|
@@ -18039,10 +18310,10 @@ __export(update_roadmap_progress_exports, {
|
|
|
18039
18310
|
unarchived_complete: () => unarchived_complete
|
|
18040
18311
|
});
|
|
18041
18312
|
import { createRequire as createRequire4 } from "node:module";
|
|
18042
|
-
import { spawnSync as
|
|
18313
|
+
import { spawnSync as spawnSync4 } from "node:child_process";
|
|
18043
18314
|
import * as fs21 from "node:fs";
|
|
18044
|
-
import * as
|
|
18045
|
-
import { fileURLToPath as
|
|
18315
|
+
import * as path21 from "node:path";
|
|
18316
|
+
import { fileURLToPath as fileURLToPath15, pathToFileURL as pathToFileURL9 } from "node:url";
|
|
18046
18317
|
function _pyRound4(x) {
|
|
18047
18318
|
const floor = Math.floor(x);
|
|
18048
18319
|
const diff = x - floor;
|
|
@@ -18088,14 +18359,14 @@ function is_draft(fm) {
|
|
|
18088
18359
|
return DRAFT_VALUES.has((fm["status"] ?? "").toLowerCase());
|
|
18089
18360
|
}
|
|
18090
18361
|
function is_roadmap_candidate(p) {
|
|
18091
|
-
const name =
|
|
18362
|
+
const name = path21.basename(p);
|
|
18092
18363
|
if (EXCLUDE_NAMES.has(name)) {
|
|
18093
18364
|
return false;
|
|
18094
18365
|
}
|
|
18095
18366
|
if (EXCLUDE_PREFIXES.some((pre) => name.startsWith(pre))) {
|
|
18096
18367
|
return false;
|
|
18097
18368
|
}
|
|
18098
|
-
const parts = p.split(
|
|
18369
|
+
const parts = p.split(path21.sep).filter((s) => s !== "");
|
|
18099
18370
|
if (parts.some((part) => EXCLUDE_DIRS.has(part))) {
|
|
18100
18371
|
return false;
|
|
18101
18372
|
}
|
|
@@ -18272,12 +18543,12 @@ function parse_roadmap(p, roadmap_root) {
|
|
|
18272
18543
|
return stats;
|
|
18273
18544
|
}
|
|
18274
18545
|
function _stem2(p) {
|
|
18275
|
-
const base =
|
|
18546
|
+
const base = path21.basename(p);
|
|
18276
18547
|
const dot = base.lastIndexOf(".");
|
|
18277
18548
|
return dot > 0 ? base.slice(0, dot) : base;
|
|
18278
18549
|
}
|
|
18279
18550
|
function _relPosix(root, p) {
|
|
18280
|
-
return
|
|
18551
|
+
return path21.relative(root, p).split(path21.sep).join("/");
|
|
18281
18552
|
}
|
|
18282
18553
|
function _blockerAnchor(rel) {
|
|
18283
18554
|
const stem2 = rel.endsWith(".md") ? rel.slice(0, -3) : rel;
|
|
@@ -18297,7 +18568,7 @@ function _rglobMdSorted3(root) {
|
|
|
18297
18568
|
return;
|
|
18298
18569
|
}
|
|
18299
18570
|
for (const ent of entries) {
|
|
18300
|
-
const full =
|
|
18571
|
+
const full = path21.join(dir, ent.name);
|
|
18301
18572
|
if (ent.isDirectory()) {
|
|
18302
18573
|
walk(full);
|
|
18303
18574
|
} else if (ent.isSymbolicLink() && _isDir8(full)) {
|
|
@@ -18352,7 +18623,7 @@ function pending_iron_law_3(roadmaps) {
|
|
|
18352
18623
|
return roadmaps.filter((r) => r.total_active > 0 && r.open_ === 0 && r.deferred > 0);
|
|
18353
18624
|
}
|
|
18354
18625
|
function collect_bundles(repo_root) {
|
|
18355
|
-
const reg =
|
|
18626
|
+
const reg = path21.join(repo_root, "agents", "tickets", "_registry.yml");
|
|
18356
18627
|
if (!fs21.existsSync(reg)) {
|
|
18357
18628
|
return [];
|
|
18358
18629
|
}
|
|
@@ -18374,7 +18645,7 @@ function collect_bundles(repo_root) {
|
|
|
18374
18645
|
for (const slug of Object.keys(bundleMap).sort()) {
|
|
18375
18646
|
const metaRaw = bundleMap[slug];
|
|
18376
18647
|
const meta = metaRaw && typeof metaRaw === "object" && !Array.isArray(metaRaw) ? metaRaw : {};
|
|
18377
|
-
const bdir =
|
|
18648
|
+
const bdir = path21.join(repo_root, "agents", "tickets", slug);
|
|
18378
18649
|
let n = 0;
|
|
18379
18650
|
if (_isDir8(bdir)) {
|
|
18380
18651
|
try {
|
|
@@ -18570,13 +18841,13 @@ function _parseArgs5(argv) {
|
|
|
18570
18841
|
}
|
|
18571
18842
|
function _fallback_git_toplevel(repo_root) {
|
|
18572
18843
|
try {
|
|
18573
|
-
const r =
|
|
18844
|
+
const r = spawnSync4("git", ["rev-parse", "--show-toplevel"], {
|
|
18574
18845
|
cwd: repo_root,
|
|
18575
18846
|
encoding: "utf-8",
|
|
18576
18847
|
timeout: 1e4
|
|
18577
18848
|
});
|
|
18578
18849
|
const top = (r.stdout || "").trim();
|
|
18579
|
-
if (r.status === 0 && top !== "" && _isDir8(
|
|
18850
|
+
if (r.status === 0 && top !== "" && _isDir8(path21.join(top, "agents", "roadmaps"))) {
|
|
18580
18851
|
return top;
|
|
18581
18852
|
}
|
|
18582
18853
|
} catch {
|
|
@@ -18586,11 +18857,11 @@ function _fallback_git_toplevel(repo_root) {
|
|
|
18586
18857
|
function main9(argv) {
|
|
18587
18858
|
const args = _parseArgs5(argv ?? process.argv.slice(2));
|
|
18588
18859
|
let repo_root = args.repo_root;
|
|
18589
|
-
if (repo_root === process.cwd() && !_isDir8(
|
|
18860
|
+
if (repo_root === process.cwd() && !_isDir8(path21.join(repo_root, "agents", "roadmaps"))) {
|
|
18590
18861
|
repo_root = _fallback_git_toplevel(repo_root);
|
|
18591
18862
|
}
|
|
18592
|
-
const roadmap_root =
|
|
18593
|
-
const target =
|
|
18863
|
+
const roadmap_root = path21.join(repo_root, "agents", "roadmaps");
|
|
18864
|
+
const target = path21.join(repo_root, "agents", "roadmaps-progress.md");
|
|
18594
18865
|
if (!_isDir8(roadmap_root)) {
|
|
18595
18866
|
if (args.check) {
|
|
18596
18867
|
return 0;
|
|
@@ -18688,13 +18959,13 @@ function _isCliEntry9() {
|
|
|
18688
18959
|
if (process.argv[1] === void 0) {
|
|
18689
18960
|
return false;
|
|
18690
18961
|
}
|
|
18691
|
-
const argvUrl = pathToFileURL9(
|
|
18962
|
+
const argvUrl = pathToFileURL9(path21.resolve(process.argv[1])).href;
|
|
18692
18963
|
if (import.meta.url === argvUrl) {
|
|
18693
18964
|
return true;
|
|
18694
18965
|
}
|
|
18695
18966
|
try {
|
|
18696
|
-
const here = fs21.realpathSync(
|
|
18697
|
-
const argv = fs21.realpathSync(
|
|
18967
|
+
const here = fs21.realpathSync(fileURLToPath15(import.meta.url));
|
|
18968
|
+
const argv = fs21.realpathSync(path21.resolve(process.argv[1]));
|
|
18698
18969
|
return here === argv;
|
|
18699
18970
|
} catch {
|
|
18700
18971
|
return false;
|
|
@@ -18704,7 +18975,7 @@ var _HERE5, _require3, CHECKBOX_RE, PHASE_RE, TITLE_RE, EXCLUDE_NAMES, EXCLUDE_P
|
|
|
18704
18975
|
var init_update_roadmap_progress = __esm({
|
|
18705
18976
|
"src/agent-src/scripts/update_roadmap_progress.ts"() {
|
|
18706
18977
|
"use strict";
|
|
18707
|
-
_HERE5 =
|
|
18978
|
+
_HERE5 = fileURLToPath15(import.meta.url);
|
|
18708
18979
|
_require3 = createRequire4(import.meta.url);
|
|
18709
18980
|
CHECKBOX_RE = /^[ \t\n\r\f\v]*[-*][ \t\n\r\f\v]+\[([ xX~\-])\][ \t\n\r\f\v]/gm;
|
|
18710
18981
|
PHASE_RE = /^(#{2,3})[ \t\n\r\f\v]+Phase[ \t\n\r\f\v]+(\d+(?:\.\d+)*[a-z]?|[IVX]+|[A-Z](?:\d+)?)(?:[\s:—\-]+([\s\S]*?))?[ \t\f\v\r]*$/gm;
|
|
@@ -18859,13 +19130,13 @@ __export(archive_completed_roadmaps_exports, {
|
|
|
18859
19130
|
archive_completed: () => archive_completed,
|
|
18860
19131
|
main: () => main10
|
|
18861
19132
|
});
|
|
18862
|
-
import { spawnSync as
|
|
19133
|
+
import { spawnSync as spawnSync5 } from "node:child_process";
|
|
18863
19134
|
import * as fs22 from "node:fs";
|
|
18864
|
-
import * as
|
|
19135
|
+
import * as path22 from "node:path";
|
|
18865
19136
|
import process9 from "node:process";
|
|
18866
|
-
import { fileURLToPath as
|
|
19137
|
+
import { fileURLToPath as fileURLToPath16, pathToFileURL as pathToFileURL10 } from "node:url";
|
|
18867
19138
|
function _run(cmd, cwd) {
|
|
18868
|
-
const res =
|
|
19139
|
+
const res = spawnSync5(cmd[0], cmd.slice(1), { cwd, encoding: "utf-8" });
|
|
18869
19140
|
if (res.error) {
|
|
18870
19141
|
return { returncode: -1, stdout: res.stdout ?? "", stderr: String(res.error.message ?? "") };
|
|
18871
19142
|
}
|
|
@@ -18921,7 +19192,7 @@ function _inbound_ref_rewrite(root, old_rel, new_rel, dry_run, tracked = true) {
|
|
|
18921
19192
|
if (!rel || rel === old_rel) {
|
|
18922
19193
|
continue;
|
|
18923
19194
|
}
|
|
18924
|
-
const fp =
|
|
19195
|
+
const fp = path22.join(root, rel);
|
|
18925
19196
|
let text;
|
|
18926
19197
|
try {
|
|
18927
19198
|
text = fs22.readFileSync(fp, { encoding: "utf-8" });
|
|
@@ -18942,17 +19213,17 @@ function _replaceAll(text, oldStr, newStr) {
|
|
|
18942
19213
|
return text.split(oldStr).join(newStr);
|
|
18943
19214
|
}
|
|
18944
19215
|
function _git_mv(root, src_rel, dst_rel, dry_run) {
|
|
18945
|
-
const dst =
|
|
19216
|
+
const dst = path22.join(root, dst_rel);
|
|
18946
19217
|
if (dry_run) {
|
|
18947
19218
|
return { ok: true, tracked: true };
|
|
18948
19219
|
}
|
|
18949
|
-
fs22.mkdirSync(
|
|
19220
|
+
fs22.mkdirSync(path22.dirname(dst), { recursive: true });
|
|
18950
19221
|
const cp = _run(["git", "mv", src_rel, dst_rel], root);
|
|
18951
19222
|
if (cp.returncode === 0) {
|
|
18952
19223
|
return { ok: true, tracked: true };
|
|
18953
19224
|
}
|
|
18954
19225
|
try {
|
|
18955
|
-
fs22.renameSync(
|
|
19226
|
+
fs22.renameSync(path22.join(root, src_rel), dst);
|
|
18956
19227
|
return { ok: true, tracked: false };
|
|
18957
19228
|
} catch {
|
|
18958
19229
|
return { ok: false, tracked: false };
|
|
@@ -18972,7 +19243,7 @@ function _fs_grep_files(root, needle) {
|
|
|
18972
19243
|
if (e.name.startsWith(".git") || SKIP.has(e.name)) {
|
|
18973
19244
|
continue;
|
|
18974
19245
|
}
|
|
18975
|
-
const abs =
|
|
19246
|
+
const abs = path22.join(dirAbs, e.name);
|
|
18976
19247
|
if (e.isDirectory()) {
|
|
18977
19248
|
walk(abs);
|
|
18978
19249
|
} else if (e.isFile() && /\.(md|json|ya?ml|ts|js|txt)$/.test(e.name)) {
|
|
@@ -18983,7 +19254,7 @@ function _fs_grep_files(root, needle) {
|
|
|
18983
19254
|
continue;
|
|
18984
19255
|
}
|
|
18985
19256
|
if (text.includes(needle)) {
|
|
18986
|
-
hits.push(
|
|
19257
|
+
hits.push(path22.relative(root, abs).split(path22.sep).join("/"));
|
|
18987
19258
|
}
|
|
18988
19259
|
}
|
|
18989
19260
|
}
|
|
@@ -18993,7 +19264,7 @@ function _fs_grep_files(root, needle) {
|
|
|
18993
19264
|
}
|
|
18994
19265
|
function archive_completed(root, opts) {
|
|
18995
19266
|
const { changed_only, base, dry_run } = opts;
|
|
18996
|
-
const roadmap_root =
|
|
19267
|
+
const roadmap_root = path22.join(root, "agents", "roadmaps");
|
|
18997
19268
|
if (!_isDir9(roadmap_root)) {
|
|
18998
19269
|
return [];
|
|
18999
19270
|
}
|
|
@@ -19047,29 +19318,29 @@ function _regen_dashboard(root, dry_run) {
|
|
|
19047
19318
|
if (dry_run) {
|
|
19048
19319
|
return;
|
|
19049
19320
|
}
|
|
19050
|
-
const script =
|
|
19321
|
+
const script = path22.join(path22.dirname(_HERE6), "update_roadmap_progress.ts");
|
|
19051
19322
|
_runTwin(root, script);
|
|
19052
|
-
const dash =
|
|
19323
|
+
const dash = path22.join(root, "agents", "roadmaps-progress.md");
|
|
19053
19324
|
if (_isFile8(dash)) {
|
|
19054
19325
|
_run(["git", "add", "--", "agents/roadmaps-progress.md"], root);
|
|
19055
19326
|
}
|
|
19056
19327
|
}
|
|
19057
19328
|
function _runTwin(root, script) {
|
|
19058
19329
|
const binName = process9.platform === "win32" ? "tsx.cmd" : "tsx";
|
|
19059
|
-
let dir =
|
|
19330
|
+
let dir = path22.dirname(_HERE6);
|
|
19060
19331
|
for (; ; ) {
|
|
19061
|
-
const candidate =
|
|
19332
|
+
const candidate = path22.join(dir, "node_modules", ".bin", binName);
|
|
19062
19333
|
if (fs22.existsSync(candidate)) {
|
|
19063
|
-
|
|
19334
|
+
spawnSync5(candidate, [script], { cwd: root, encoding: "utf-8" });
|
|
19064
19335
|
return;
|
|
19065
19336
|
}
|
|
19066
|
-
const parent =
|
|
19337
|
+
const parent = path22.dirname(dir);
|
|
19067
19338
|
if (parent === dir) {
|
|
19068
19339
|
break;
|
|
19069
19340
|
}
|
|
19070
19341
|
dir = parent;
|
|
19071
19342
|
}
|
|
19072
|
-
|
|
19343
|
+
spawnSync5("npx", ["tsx", script], { cwd: root, encoding: "utf-8" });
|
|
19073
19344
|
}
|
|
19074
19345
|
function _usage2() {
|
|
19075
19346
|
return `usage: ${_PROG6} [-h] [--all] [--base BASE] [--dry-run]
|
|
@@ -19138,13 +19409,13 @@ function _isCliEntry10() {
|
|
|
19138
19409
|
if (process9.argv[1] === void 0) {
|
|
19139
19410
|
return false;
|
|
19140
19411
|
}
|
|
19141
|
-
const argvUrl = pathToFileURL10(
|
|
19412
|
+
const argvUrl = pathToFileURL10(path22.resolve(process9.argv[1])).href;
|
|
19142
19413
|
if (import.meta.url === argvUrl) {
|
|
19143
19414
|
return true;
|
|
19144
19415
|
}
|
|
19145
19416
|
try {
|
|
19146
|
-
const here = fs22.realpathSync(
|
|
19147
|
-
const argv = fs22.realpathSync(
|
|
19417
|
+
const here = fs22.realpathSync(fileURLToPath16(import.meta.url));
|
|
19418
|
+
const argv = fs22.realpathSync(path22.resolve(process9.argv[1]));
|
|
19148
19419
|
return here === argv;
|
|
19149
19420
|
} catch {
|
|
19150
19421
|
return false;
|
|
@@ -19155,7 +19426,7 @@ var init_archive_completed_roadmaps = __esm({
|
|
|
19155
19426
|
"src/agent-src/scripts/archive_completed_roadmaps.ts"() {
|
|
19156
19427
|
"use strict";
|
|
19157
19428
|
init_update_roadmap_progress();
|
|
19158
|
-
_HERE6 =
|
|
19429
|
+
_HERE6 = fileURLToPath16(import.meta.url);
|
|
19159
19430
|
ArgparseExit2 = class extends Error {
|
|
19160
19431
|
code;
|
|
19161
19432
|
constructor(code) {
|
|
@@ -19192,9 +19463,9 @@ __export(generate_capabilities_index_exports, {
|
|
|
19192
19463
|
main: () => main11
|
|
19193
19464
|
});
|
|
19194
19465
|
import * as fs23 from "node:fs";
|
|
19195
|
-
import * as
|
|
19466
|
+
import * as path23 from "node:path";
|
|
19196
19467
|
import process10 from "node:process";
|
|
19197
|
-
import { fileURLToPath as
|
|
19468
|
+
import { fileURLToPath as fileURLToPath17, pathToFileURL as pathToFileURL11 } from "node:url";
|
|
19198
19469
|
function _isFile9(p) {
|
|
19199
19470
|
try {
|
|
19200
19471
|
return fs23.statSync(p).isFile();
|
|
@@ -19270,7 +19541,7 @@ function _globSkillMds() {
|
|
|
19270
19541
|
}
|
|
19271
19542
|
const found = [];
|
|
19272
19543
|
for (const ent of entries) {
|
|
19273
|
-
const dir =
|
|
19544
|
+
const dir = path23.join(SKILLS_DIR, ent.name);
|
|
19274
19545
|
const isDir4 = ent.isDirectory() || ent.isSymbolicLink() && (() => {
|
|
19275
19546
|
try {
|
|
19276
19547
|
return fs23.statSync(dir).isDirectory();
|
|
@@ -19281,7 +19552,7 @@ function _globSkillMds() {
|
|
|
19281
19552
|
if (!isDir4) {
|
|
19282
19553
|
continue;
|
|
19283
19554
|
}
|
|
19284
|
-
const md =
|
|
19555
|
+
const md = path23.join(dir, "SKILL.md");
|
|
19285
19556
|
if (_isFile9(md)) {
|
|
19286
19557
|
found.push(md);
|
|
19287
19558
|
}
|
|
@@ -19302,7 +19573,7 @@ function _skill_packs() {
|
|
|
19302
19573
|
continue;
|
|
19303
19574
|
}
|
|
19304
19575
|
const fmDict = fm;
|
|
19305
|
-
const name = _nameOr(fmDict["name"],
|
|
19576
|
+
const name = _nameOr(fmDict["name"], path23.basename(path23.dirname(skillMd)));
|
|
19306
19577
|
const packs = fmDict["packs"];
|
|
19307
19578
|
const packList = _pyTruthy(packs) ? packs : [];
|
|
19308
19579
|
for (const pidRaw of packList) {
|
|
@@ -19324,7 +19595,7 @@ function _command_packs() {
|
|
|
19324
19595
|
continue;
|
|
19325
19596
|
}
|
|
19326
19597
|
const fmDict = fm;
|
|
19327
|
-
const name = _nameOr(fmDict["name"],
|
|
19598
|
+
const name = _nameOr(fmDict["name"], path23.basename(path23.dirname(cmdMd)));
|
|
19328
19599
|
const packsVal = fmDict["packs"];
|
|
19329
19600
|
const pids = new Set(
|
|
19330
19601
|
(_pyTruthy(packsVal) ? packsVal : []).map((x) => String(x))
|
|
@@ -19554,13 +19825,13 @@ function _isCliEntry11() {
|
|
|
19554
19825
|
if (process10.argv[1] === void 0) {
|
|
19555
19826
|
return false;
|
|
19556
19827
|
}
|
|
19557
|
-
const argvUrl = pathToFileURL11(
|
|
19828
|
+
const argvUrl = pathToFileURL11(path23.resolve(process10.argv[1])).href;
|
|
19558
19829
|
if (import.meta.url === argvUrl) {
|
|
19559
19830
|
return true;
|
|
19560
19831
|
}
|
|
19561
19832
|
try {
|
|
19562
|
-
const here = fs23.realpathSync(
|
|
19563
|
-
const argv = fs23.realpathSync(
|
|
19833
|
+
const here = fs23.realpathSync(fileURLToPath17(import.meta.url));
|
|
19834
|
+
const argv = fs23.realpathSync(path23.resolve(process10.argv[1]));
|
|
19564
19835
|
return here === argv;
|
|
19565
19836
|
} catch {
|
|
19566
19837
|
return false;
|
|
@@ -19573,11 +19844,11 @@ var init_generate_capabilities_index = __esm({
|
|
|
19573
19844
|
import_yaml4 = __toESM(require_dist(), 1);
|
|
19574
19845
|
init_agent_src();
|
|
19575
19846
|
init_validate_frontmatter();
|
|
19576
|
-
_HERE7 =
|
|
19577
|
-
ROOT2 =
|
|
19578
|
-
OUT =
|
|
19579
|
-
PACKS_YML =
|
|
19580
|
-
SKILLS_DIR =
|
|
19847
|
+
_HERE7 = fileURLToPath17(import.meta.url);
|
|
19848
|
+
ROOT2 = path23.resolve(path23.dirname(_HERE7), "..", "..");
|
|
19849
|
+
OUT = path23.join(ROOT2, "CAPABILITIES.yaml");
|
|
19850
|
+
PACKS_YML = path23.join(ROOT2, "src", "config", "discovery", "packs.yml");
|
|
19851
|
+
SKILLS_DIR = path23.join(ROOT2, "src", "skills");
|
|
19581
19852
|
TIME_BUDGET_S = 5;
|
|
19582
19853
|
SIZE_BUDGET_BYTES = 50 * 1024;
|
|
19583
19854
|
_ArgExit = class extends Error {
|
|
@@ -19591,14 +19862,14 @@ var init_generate_capabilities_index = __esm({
|
|
|
19591
19862
|
// src/scripts/_lib/claude_plugin.ts
|
|
19592
19863
|
import * as fs24 from "node:fs";
|
|
19593
19864
|
import * as os4 from "node:os";
|
|
19594
|
-
import * as
|
|
19865
|
+
import * as path24 from "node:path";
|
|
19595
19866
|
import process11 from "node:process";
|
|
19596
19867
|
function claude_config_dir() {
|
|
19597
19868
|
const env = (process11.env["CLAUDE_CONFIG_DIR"] ?? "").trim();
|
|
19598
|
-
return env !== "" ? env :
|
|
19869
|
+
return env !== "" ? env : path24.join(os4.homedir(), ".claude");
|
|
19599
19870
|
}
|
|
19600
19871
|
function _plugin_id_recorded(plugin_id) {
|
|
19601
|
-
const p =
|
|
19872
|
+
const p = path24.join(claude_config_dir(), "plugins", "installed_plugins.json");
|
|
19602
19873
|
let data;
|
|
19603
19874
|
try {
|
|
19604
19875
|
data = JSON.parse(fs24.readFileSync(p, "utf-8"));
|
|
@@ -19616,7 +19887,7 @@ function claude_plugin_installed() {
|
|
|
19616
19887
|
return _plugin_id_recorded(CLAUDE_PLUGIN_ID);
|
|
19617
19888
|
}
|
|
19618
19889
|
function _plugin_marketplaces(plugin_id) {
|
|
19619
|
-
const p =
|
|
19890
|
+
const p = path24.join(claude_config_dir(), "plugins", "installed_plugins.json");
|
|
19620
19891
|
let data;
|
|
19621
19892
|
try {
|
|
19622
19893
|
data = JSON.parse(fs24.readFileSync(p, "utf-8"));
|
|
@@ -19630,7 +19901,7 @@ function _plugin_marketplaces(plugin_id) {
|
|
|
19630
19901
|
return Object.keys(plugins).filter((k) => k.startsWith(prefix)).map((k) => k.slice(prefix.length));
|
|
19631
19902
|
}
|
|
19632
19903
|
function _marketplace_source_repo(marketplace) {
|
|
19633
|
-
const p =
|
|
19904
|
+
const p = path24.join(claude_config_dir(), "plugins", "known_marketplaces.json");
|
|
19634
19905
|
let data;
|
|
19635
19906
|
try {
|
|
19636
19907
|
data = JSON.parse(fs24.readFileSync(p, "utf-8"));
|
|
@@ -19657,7 +19928,7 @@ function codex_plugin_identity() {
|
|
|
19657
19928
|
return { installed: true, identity_verified };
|
|
19658
19929
|
}
|
|
19659
19930
|
function claude_plugin_snapshot_version() {
|
|
19660
|
-
const p =
|
|
19931
|
+
const p = path24.join(
|
|
19661
19932
|
claude_config_dir(),
|
|
19662
19933
|
"plugins",
|
|
19663
19934
|
"marketplaces",
|
|
@@ -19796,8 +20067,8 @@ var init_claude_settings_hooks = __esm({
|
|
|
19796
20067
|
|
|
19797
20068
|
// src/scripts/_lib/cli_wrapper.ts
|
|
19798
20069
|
import fs26 from "node:fs";
|
|
19799
|
-
import
|
|
19800
|
-
import { fileURLToPath as
|
|
20070
|
+
import path25 from "node:path";
|
|
20071
|
+
import { fileURLToPath as fileURLToPath18 } from "node:url";
|
|
19801
20072
|
function _is_file2(p) {
|
|
19802
20073
|
try {
|
|
19803
20074
|
return fs26.statSync(p).isFile();
|
|
@@ -19806,7 +20077,7 @@ function _is_file2(p) {
|
|
|
19806
20077
|
}
|
|
19807
20078
|
}
|
|
19808
20079
|
function _target(project_root) {
|
|
19809
|
-
return
|
|
20080
|
+
return path25.join(project_root, "agent-config");
|
|
19810
20081
|
}
|
|
19811
20082
|
function install_cli_wrapper(project_root) {
|
|
19812
20083
|
if (!_is_file2(_TEMPLATE)) return null;
|
|
@@ -19819,13 +20090,13 @@ var _PACKAGE_ROOT, _TEMPLATE;
|
|
|
19819
20090
|
var init_cli_wrapper = __esm({
|
|
19820
20091
|
"src/scripts/_lib/cli_wrapper.ts"() {
|
|
19821
20092
|
"use strict";
|
|
19822
|
-
_PACKAGE_ROOT =
|
|
19823
|
-
|
|
20093
|
+
_PACKAGE_ROOT = path25.resolve(
|
|
20094
|
+
path25.dirname(fileURLToPath18(import.meta.url)),
|
|
19824
20095
|
"..",
|
|
19825
20096
|
"..",
|
|
19826
20097
|
".."
|
|
19827
20098
|
);
|
|
19828
|
-
_TEMPLATE =
|
|
20099
|
+
_TEMPLATE = path25.join(
|
|
19829
20100
|
_PACKAGE_ROOT,
|
|
19830
20101
|
"src",
|
|
19831
20102
|
"templates",
|
|
@@ -19856,9 +20127,9 @@ __export(sync_gitignore_exports, {
|
|
|
19856
20127
|
unified_diff: () => unified_diff
|
|
19857
20128
|
});
|
|
19858
20129
|
import * as fs27 from "node:fs";
|
|
19859
|
-
import * as
|
|
20130
|
+
import * as path26 from "node:path";
|
|
19860
20131
|
import process12 from "node:process";
|
|
19861
|
-
import { fileURLToPath as
|
|
20132
|
+
import { fileURLToPath as fileURLToPath19, pathToFileURL as pathToFileURL12 } from "node:url";
|
|
19862
20133
|
function _strip4(ln) {
|
|
19863
20134
|
return ln.replace(/\n+$/, "").replace(/\s+$/, "");
|
|
19864
20135
|
}
|
|
@@ -20259,7 +20530,7 @@ function main12(argv) {
|
|
|
20259
20530
|
}
|
|
20260
20531
|
return 0;
|
|
20261
20532
|
}
|
|
20262
|
-
fs27.mkdirSync(
|
|
20533
|
+
fs27.mkdirSync(path26.dirname(path26.resolve(target)), { recursive: true });
|
|
20263
20534
|
fs27.writeFileSync(target, new_text, "utf-8");
|
|
20264
20535
|
if (!args.quiet) {
|
|
20265
20536
|
const action = args.replace ? "replaced" : "updated";
|
|
@@ -20280,13 +20551,13 @@ function _isCliEntry12() {
|
|
|
20280
20551
|
if (process12.argv[1] === void 0) {
|
|
20281
20552
|
return false;
|
|
20282
20553
|
}
|
|
20283
|
-
const argvUrl = pathToFileURL12(
|
|
20554
|
+
const argvUrl = pathToFileURL12(path26.resolve(process12.argv[1])).href;
|
|
20284
20555
|
if (import.meta.url === argvUrl) {
|
|
20285
20556
|
return true;
|
|
20286
20557
|
}
|
|
20287
20558
|
try {
|
|
20288
|
-
const here = fs27.realpathSync(
|
|
20289
|
-
const argv = fs27.realpathSync(
|
|
20559
|
+
const here = fs27.realpathSync(fileURLToPath19(import.meta.url));
|
|
20560
|
+
const argv = fs27.realpathSync(path26.resolve(process12.argv[1]));
|
|
20290
20561
|
return here === argv;
|
|
20291
20562
|
} catch {
|
|
20292
20563
|
return false;
|
|
@@ -20299,9 +20570,9 @@ var init_sync_gitignore = __esm({
|
|
|
20299
20570
|
SECTION_HEADER = "# event4u/agent-config";
|
|
20300
20571
|
SECTION_FOOTER = "# event4u/agent-config \u2014 END";
|
|
20301
20572
|
DEFAULT_GITIGNORE = ".gitignore";
|
|
20302
|
-
_HERE8 =
|
|
20303
|
-
DEFAULT_TEMPLATE =
|
|
20304
|
-
|
|
20573
|
+
_HERE8 = fileURLToPath19(import.meta.url);
|
|
20574
|
+
DEFAULT_TEMPLATE = path26.join(
|
|
20575
|
+
path26.dirname(_HERE8),
|
|
20305
20576
|
"..",
|
|
20306
20577
|
"..",
|
|
20307
20578
|
"src",
|
|
@@ -20356,9 +20627,9 @@ __export(sync_gitattributes_exports, {
|
|
|
20356
20627
|
template_entries: () => template_entries2
|
|
20357
20628
|
});
|
|
20358
20629
|
import * as fs28 from "node:fs";
|
|
20359
|
-
import * as
|
|
20630
|
+
import * as path27 from "node:path";
|
|
20360
20631
|
import process13 from "node:process";
|
|
20361
|
-
import { fileURLToPath as
|
|
20632
|
+
import { fileURLToPath as fileURLToPath20, pathToFileURL as pathToFileURL13 } from "node:url";
|
|
20362
20633
|
function _strip5(ln) {
|
|
20363
20634
|
return ln.replace(/\n+$/, "").replace(/\s+$/, "");
|
|
20364
20635
|
}
|
|
@@ -20531,7 +20802,7 @@ function main13(argv) {
|
|
|
20531
20802
|
}
|
|
20532
20803
|
return 1;
|
|
20533
20804
|
}
|
|
20534
|
-
fs28.mkdirSync(
|
|
20805
|
+
fs28.mkdirSync(path27.dirname(path27.resolve(target)), { recursive: true });
|
|
20535
20806
|
fs28.writeFileSync(target, new_text, "utf-8");
|
|
20536
20807
|
if (!args.quiet) {
|
|
20537
20808
|
process13.stdout.write(
|
|
@@ -20545,13 +20816,13 @@ function _isCliEntry13() {
|
|
|
20545
20816
|
if (process13.argv[1] === void 0) {
|
|
20546
20817
|
return false;
|
|
20547
20818
|
}
|
|
20548
|
-
const argvUrl = pathToFileURL13(
|
|
20819
|
+
const argvUrl = pathToFileURL13(path27.resolve(process13.argv[1])).href;
|
|
20549
20820
|
if (import.meta.url === argvUrl) {
|
|
20550
20821
|
return true;
|
|
20551
20822
|
}
|
|
20552
20823
|
try {
|
|
20553
|
-
const here = fs28.realpathSync(
|
|
20554
|
-
const argv = fs28.realpathSync(
|
|
20824
|
+
const here = fs28.realpathSync(fileURLToPath20(import.meta.url));
|
|
20825
|
+
const argv = fs28.realpathSync(path27.resolve(process13.argv[1]));
|
|
20555
20826
|
return here === argv;
|
|
20556
20827
|
} catch {
|
|
20557
20828
|
return false;
|
|
@@ -20564,9 +20835,9 @@ var init_sync_gitattributes = __esm({
|
|
|
20564
20835
|
SECTION_HEADER2 = "# --- BEGIN agent-config managed: memory merge attributes ---";
|
|
20565
20836
|
SECTION_FOOTER2 = "# --- END agent-config managed: memory merge attributes ---";
|
|
20566
20837
|
DEFAULT_GITATTRIBUTES = ".gitattributes";
|
|
20567
|
-
_HERE9 =
|
|
20568
|
-
DEFAULT_TEMPLATE2 =
|
|
20569
|
-
|
|
20838
|
+
_HERE9 = fileURLToPath20(import.meta.url);
|
|
20839
|
+
DEFAULT_TEMPLATE2 = path27.join(
|
|
20840
|
+
path27.dirname(_HERE9),
|
|
20570
20841
|
"..",
|
|
20571
20842
|
"agent-src",
|
|
20572
20843
|
"templates",
|
|
@@ -20588,14 +20859,14 @@ var init_sync_gitattributes = __esm({
|
|
|
20588
20859
|
|
|
20589
20860
|
// src/scripts/_lib/package_root.ts
|
|
20590
20861
|
import * as fs29 from "node:fs";
|
|
20591
|
-
import * as
|
|
20592
|
-
import { fileURLToPath as
|
|
20862
|
+
import * as path28 from "node:path";
|
|
20863
|
+
import { fileURLToPath as fileURLToPath21 } from "node:url";
|
|
20593
20864
|
function resolvePackageRoot(fromUrlOrPath, legacyHops = 3) {
|
|
20594
|
-
const start = fromUrlOrPath.startsWith("file:") ?
|
|
20595
|
-
const startDir =
|
|
20865
|
+
const start = fromUrlOrPath.startsWith("file:") ? fileURLToPath21(fromUrlOrPath) : fromUrlOrPath;
|
|
20866
|
+
const startDir = path28.dirname(start);
|
|
20596
20867
|
let dir = startDir;
|
|
20597
20868
|
for (let i = 0; i < MAX_ASCENT; i++) {
|
|
20598
|
-
const manifest =
|
|
20869
|
+
const manifest = path28.join(dir, "package.json");
|
|
20599
20870
|
if (fs29.existsSync(manifest)) {
|
|
20600
20871
|
try {
|
|
20601
20872
|
const parsed = JSON.parse(fs29.readFileSync(manifest, "utf8"));
|
|
@@ -20605,13 +20876,13 @@ function resolvePackageRoot(fromUrlOrPath, legacyHops = 3) {
|
|
|
20605
20876
|
} catch {
|
|
20606
20877
|
}
|
|
20607
20878
|
}
|
|
20608
|
-
const parent =
|
|
20879
|
+
const parent = path28.dirname(dir);
|
|
20609
20880
|
if (parent === dir) {
|
|
20610
20881
|
break;
|
|
20611
20882
|
}
|
|
20612
20883
|
dir = parent;
|
|
20613
20884
|
}
|
|
20614
|
-
return
|
|
20885
|
+
return path28.resolve(startDir, ...Array.from({ length: legacyHops }, () => ".."));
|
|
20615
20886
|
}
|
|
20616
20887
|
var PACKAGE_NAME, MAX_ASCENT;
|
|
20617
20888
|
var init_package_root = __esm({
|
|
@@ -20624,10 +20895,10 @@ var init_package_root = __esm({
|
|
|
20624
20895
|
|
|
20625
20896
|
// src/scripts/_cli/cmd_refresh.ts
|
|
20626
20897
|
import * as fs30 from "node:fs";
|
|
20627
|
-
import * as
|
|
20628
|
-
import { spawnSync as
|
|
20898
|
+
import * as path29 from "node:path";
|
|
20899
|
+
import { spawnSync as spawnSync6 } from "node:child_process";
|
|
20629
20900
|
import process14 from "node:process";
|
|
20630
|
-
import { fileURLToPath as
|
|
20901
|
+
import { fileURLToPath as fileURLToPath22, pathToFileURL as pathToFileURL14 } from "node:url";
|
|
20631
20902
|
function _print2(out, line = "") {
|
|
20632
20903
|
out.write(line + "\n");
|
|
20633
20904
|
}
|
|
@@ -20662,8 +20933,8 @@ function _writeText(p, text) {
|
|
|
20662
20933
|
function _remove_legacy_consumer_bridge_marker(project_root, env = null) {
|
|
20663
20934
|
const env_map = env ?? process14.env;
|
|
20664
20935
|
if (env_map["AGENT_CONFIG_DEV_MODE"] === "1") return null;
|
|
20665
|
-
if (_isDir10(
|
|
20666
|
-
const target =
|
|
20936
|
+
if (_isDir10(path29.join(project_root, SRC_MARKER_DIR))) return null;
|
|
20937
|
+
const target = path29.join(project_root, CONSUMER_BRIDGE_MARKER_RELPATH);
|
|
20667
20938
|
if (!_isFile12(target)) return null;
|
|
20668
20939
|
try {
|
|
20669
20940
|
fs30.rmSync(target);
|
|
@@ -20673,7 +20944,7 @@ function _remove_legacy_consumer_bridge_marker(project_root, env = null) {
|
|
|
20673
20944
|
return target;
|
|
20674
20945
|
}
|
|
20675
20946
|
function _default_runner(cmd) {
|
|
20676
|
-
const r =
|
|
20947
|
+
const r = spawnSync6(cmd[0], cmd.slice(1), { stdio: "inherit" });
|
|
20677
20948
|
if (r.error) {
|
|
20678
20949
|
_stderr.write(`agent-config refresh: cannot run ${cmd[0]}: ${osErrorStr(r.error)}
|
|
20679
20950
|
`);
|
|
@@ -20688,7 +20959,7 @@ function osErrorStr(exc) {
|
|
|
20688
20959
|
return String(exc);
|
|
20689
20960
|
}
|
|
20690
20961
|
function _refresh_global(runner, out, err) {
|
|
20691
|
-
const install_sh =
|
|
20962
|
+
const install_sh = path29.join(PACKAGE_ROOT, "src", "scripts", "install");
|
|
20692
20963
|
if (!_isFile12(install_sh)) {
|
|
20693
20964
|
_print2(err, `\u274C agent-config refresh: installer not found at ${install_sh}`);
|
|
20694
20965
|
return 1;
|
|
@@ -20703,13 +20974,13 @@ function _refresh_global(runner, out, err) {
|
|
|
20703
20974
|
return 0;
|
|
20704
20975
|
}
|
|
20705
20976
|
function _is_source_repo(project_root) {
|
|
20706
|
-
if (_isDir10(
|
|
20977
|
+
if (_isDir10(path29.join(project_root, "dist/agent-src"))) {
|
|
20707
20978
|
return true;
|
|
20708
20979
|
}
|
|
20709
20980
|
if (_glob_packages_uncondensed(project_root).length > 0) {
|
|
20710
20981
|
return true;
|
|
20711
20982
|
}
|
|
20712
|
-
const pkg =
|
|
20983
|
+
const pkg = path29.join(project_root, "package.json");
|
|
20713
20984
|
if (_isFile12(pkg)) {
|
|
20714
20985
|
try {
|
|
20715
20986
|
const data = JSON.parse(_readText(pkg));
|
|
@@ -20722,7 +20993,7 @@ function _is_source_repo(project_root) {
|
|
|
20722
20993
|
return false;
|
|
20723
20994
|
}
|
|
20724
20995
|
function _glob_packages_uncondensed(project_root) {
|
|
20725
|
-
const packages =
|
|
20996
|
+
const packages = path29.join(project_root, "packages");
|
|
20726
20997
|
let entries;
|
|
20727
20998
|
try {
|
|
20728
20999
|
entries = fs30.readdirSync(packages);
|
|
@@ -20731,7 +21002,7 @@ function _glob_packages_uncondensed(project_root) {
|
|
|
20731
21002
|
}
|
|
20732
21003
|
const out = [];
|
|
20733
21004
|
for (const name of entries) {
|
|
20734
|
-
const candidate =
|
|
21005
|
+
const candidate = path29.join(packages, name, SRC_MARKER_DIR);
|
|
20735
21006
|
if (_exists5(candidate)) {
|
|
20736
21007
|
out.push(candidate);
|
|
20737
21008
|
}
|
|
@@ -20750,9 +21021,9 @@ function _refresh_project(project_root, out, err) {
|
|
|
20750
21021
|
if (removed !== null) {
|
|
20751
21022
|
_print2(out, `\u2705 removed legacy bridge marker: ${removed}`);
|
|
20752
21023
|
}
|
|
20753
|
-
const overrides =
|
|
21024
|
+
const overrides = path29.join(project_root, "agents", "overrides");
|
|
20754
21025
|
fs30.mkdirSync(overrides, { recursive: true });
|
|
20755
|
-
const keep =
|
|
21026
|
+
const keep = path29.join(overrides, "README.md");
|
|
20756
21027
|
if (!_exists5(keep)) {
|
|
20757
21028
|
_writeText(
|
|
20758
21029
|
keep,
|
|
@@ -20780,7 +21051,7 @@ function _sync_gitignore(project_root, out, err) {
|
|
|
20780
21051
|
_print2(err, `\u26A0\uFE0F refresh --project: gitignore sync unavailable (${osErrorStr(exc)})`);
|
|
20781
21052
|
return 0;
|
|
20782
21053
|
}
|
|
20783
|
-
const rc = mod.main(["--path",
|
|
21054
|
+
const rc = mod.main(["--path", path29.join(project_root, ".gitignore")]);
|
|
20784
21055
|
if (rc !== 0 && rc !== null && rc !== void 0) {
|
|
20785
21056
|
_print2(err, `\u26A0\uFE0F refresh --project: gitignore sync returned ${rc}`);
|
|
20786
21057
|
} else {
|
|
@@ -20796,7 +21067,7 @@ function _sync_gitattributes(project_root, out, err) {
|
|
|
20796
21067
|
_print2(err, `\u26A0\uFE0F refresh --project: gitattributes sync unavailable (${osErrorStr(exc)})`);
|
|
20797
21068
|
return 0;
|
|
20798
21069
|
}
|
|
20799
|
-
const rc = mod.main(["--path",
|
|
21070
|
+
const rc = mod.main(["--path", path29.join(project_root, ".gitattributes")]);
|
|
20800
21071
|
if (rc !== 0 && rc !== null && rc !== void 0) {
|
|
20801
21072
|
_print2(err, `\u26A0\uFE0F refresh --project: gitattributes sync returned ${rc}`);
|
|
20802
21073
|
} else {
|
|
@@ -20876,13 +21147,13 @@ function _isCliEntry14() {
|
|
|
20876
21147
|
if (process14.argv[1] === void 0) {
|
|
20877
21148
|
return false;
|
|
20878
21149
|
}
|
|
20879
|
-
const argvUrl = pathToFileURL14(
|
|
21150
|
+
const argvUrl = pathToFileURL14(path29.resolve(process14.argv[1])).href;
|
|
20880
21151
|
if (import.meta.url === argvUrl) {
|
|
20881
21152
|
return true;
|
|
20882
21153
|
}
|
|
20883
21154
|
try {
|
|
20884
|
-
const here = fs30.realpathSync(
|
|
20885
|
-
const argv = fs30.realpathSync(
|
|
21155
|
+
const here = fs30.realpathSync(fileURLToPath22(import.meta.url));
|
|
21156
|
+
const argv = fs30.realpathSync(path29.resolve(process14.argv[1]));
|
|
20886
21157
|
return here === argv;
|
|
20887
21158
|
} catch {
|
|
20888
21159
|
return false;
|
|
@@ -20897,7 +21168,7 @@ var init_cmd_refresh = __esm({
|
|
|
20897
21168
|
init_sync_gitattributes();
|
|
20898
21169
|
init_package_root();
|
|
20899
21170
|
PACKAGE_ROOT = resolvePackageRoot(import.meta.url);
|
|
20900
|
-
_HERE10 =
|
|
21171
|
+
_HERE10 = fileURLToPath22(import.meta.url);
|
|
20901
21172
|
ArgparseExit3 = class extends Error {
|
|
20902
21173
|
constructor(code) {
|
|
20903
21174
|
super(`argparse-exit-${code}`);
|
|
@@ -20907,7 +21178,7 @@ var init_cmd_refresh = __esm({
|
|
|
20907
21178
|
};
|
|
20908
21179
|
_stdout = { write: (t) => process14.stdout.write(t) };
|
|
20909
21180
|
_stderr = { write: (t) => process14.stderr.write(t) };
|
|
20910
|
-
CONSUMER_BRIDGE_MARKER_RELPATH =
|
|
21181
|
+
CONSUMER_BRIDGE_MARKER_RELPATH = path29.join("agents", ".event4u-bridge.yml");
|
|
20911
21182
|
SRC_MARKER_DIR = ".agent-src.uncondensed";
|
|
20912
21183
|
PROG3 = "agent-config refresh";
|
|
20913
21184
|
USAGE = `usage: ${PROG3} [-h] [--global] [--project]
|
|
@@ -20936,7 +21207,7 @@ var init_install_layout = __esm({
|
|
|
20936
21207
|
// src/scripts/_lib/installed_lock.ts
|
|
20937
21208
|
import * as fs31 from "node:fs";
|
|
20938
21209
|
import * as os5 from "node:os";
|
|
20939
|
-
import * as
|
|
21210
|
+
import * as path30 from "node:path";
|
|
20940
21211
|
function _default_lockfile() {
|
|
20941
21212
|
return write_target("installed.lock");
|
|
20942
21213
|
}
|
|
@@ -20945,7 +21216,7 @@ function expanduser2(p) {
|
|
|
20945
21216
|
return os5.homedir();
|
|
20946
21217
|
}
|
|
20947
21218
|
if (p.startsWith("~/") || process.platform === "win32" && p.startsWith("~\\")) {
|
|
20948
|
-
return
|
|
21219
|
+
return path30.join(os5.homedir(), p.slice(2));
|
|
20949
21220
|
}
|
|
20950
21221
|
return p;
|
|
20951
21222
|
}
|
|
@@ -20961,8 +21232,8 @@ function lockfile_path(env) {
|
|
|
20961
21232
|
}
|
|
20962
21233
|
return write_target("installed.lock", { env: env ?? null });
|
|
20963
21234
|
}
|
|
20964
|
-
function read_lockfile(
|
|
20965
|
-
const target =
|
|
21235
|
+
function read_lockfile(path50) {
|
|
21236
|
+
const target = path50 ?? lockfile_path();
|
|
20966
21237
|
let text;
|
|
20967
21238
|
try {
|
|
20968
21239
|
text = fs31.readFileSync(target, { encoding: "utf-8" });
|
|
@@ -21036,7 +21307,7 @@ var init_installed_lock = __esm({
|
|
|
21036
21307
|
|
|
21037
21308
|
// src/scripts/_lib/fs_atomic.ts
|
|
21038
21309
|
import fs32 from "node:fs";
|
|
21039
|
-
import
|
|
21310
|
+
import path31 from "node:path";
|
|
21040
21311
|
import { randomBytes as randomBytes2 } from "node:crypto";
|
|
21041
21312
|
function _normalize_encoding(encoding) {
|
|
21042
21313
|
const compact = encoding.toLowerCase().replace(/[-_\s]/g, "");
|
|
@@ -21052,8 +21323,8 @@ function _normalize_encoding(encoding) {
|
|
|
21052
21323
|
}
|
|
21053
21324
|
function write_atomic(p, data, options = {}) {
|
|
21054
21325
|
const encoding = options.encoding ?? "utf-8";
|
|
21055
|
-
const target =
|
|
21056
|
-
const parent =
|
|
21326
|
+
const target = path31.normalize(p);
|
|
21327
|
+
const parent = path31.dirname(target);
|
|
21057
21328
|
fs32.mkdirSync(parent, { recursive: true });
|
|
21058
21329
|
let payload;
|
|
21059
21330
|
if (typeof data === "string") {
|
|
@@ -21068,9 +21339,9 @@ function write_atomic(p, data, options = {}) {
|
|
|
21068
21339
|
let fd = null;
|
|
21069
21340
|
let tmp_path = "";
|
|
21070
21341
|
for (let attempt = 0; attempt < 32; attempt += 1) {
|
|
21071
|
-
tmp_path =
|
|
21342
|
+
tmp_path = path31.join(
|
|
21072
21343
|
parent,
|
|
21073
|
-
`.${
|
|
21344
|
+
`.${path31.basename(target)}.tmp.${randomBytes2(6).toString("hex")}`
|
|
21074
21345
|
);
|
|
21075
21346
|
try {
|
|
21076
21347
|
fd = fs32.openSync(tmp_path, "wx", 384);
|
|
@@ -21172,18 +21443,18 @@ function manifest_path(project_root, env) {
|
|
|
21172
21443
|
}
|
|
21173
21444
|
return fsPath.join(project_root, DEFAULT_MANIFEST_RELATIVE);
|
|
21174
21445
|
}
|
|
21175
|
-
function read_manifest(
|
|
21446
|
+
function read_manifest(path50) {
|
|
21176
21447
|
let text;
|
|
21177
21448
|
try {
|
|
21178
|
-
text = require_read_text(
|
|
21449
|
+
text = require_read_text(path50);
|
|
21179
21450
|
} catch {
|
|
21180
21451
|
return null;
|
|
21181
21452
|
}
|
|
21182
21453
|
const data = _parse_manual(text);
|
|
21183
21454
|
return _normalise_v2_shape(data);
|
|
21184
21455
|
}
|
|
21185
|
-
function require_read_text(
|
|
21186
|
-
return fs33.readFileSync(
|
|
21456
|
+
function require_read_text(path50) {
|
|
21457
|
+
return fs33.readFileSync(path50, { encoding: "utf-8" });
|
|
21187
21458
|
}
|
|
21188
21459
|
function _normalise_v2_shape(data) {
|
|
21189
21460
|
if (data["tools"] === void 0 || data["tools"] === null) {
|
|
@@ -21364,9 +21635,9 @@ function stable_sort(items, key) {
|
|
|
21364
21635
|
return a.index - b.index;
|
|
21365
21636
|
}).map((entry) => entry.item);
|
|
21366
21637
|
}
|
|
21367
|
-
function write_manifest(
|
|
21638
|
+
function write_manifest(path50, version, tools, options = {}) {
|
|
21368
21639
|
const rendered = _render(version, tools, { deploy_roots: options.deploy_roots ?? null });
|
|
21369
|
-
return write_atomic(
|
|
21640
|
+
return write_atomic(path50, rendered);
|
|
21370
21641
|
}
|
|
21371
21642
|
function upsert_tool(existing, options) {
|
|
21372
21643
|
const {
|
|
@@ -21498,13 +21769,13 @@ __export(global_deploy_inventory_exports, {
|
|
|
21498
21769
|
import { randomBytes as randomBytes3 } from "node:crypto";
|
|
21499
21770
|
import * as fs34 from "node:fs";
|
|
21500
21771
|
import * as os7 from "node:os";
|
|
21501
|
-
import * as
|
|
21772
|
+
import * as path32 from "node:path";
|
|
21502
21773
|
function expanduser4(p) {
|
|
21503
21774
|
if (p === "~") {
|
|
21504
21775
|
return os7.homedir();
|
|
21505
21776
|
}
|
|
21506
21777
|
if (p.startsWith("~/") || process.platform === "win32" && p.startsWith("~\\")) {
|
|
21507
|
-
return
|
|
21778
|
+
return path32.join(os7.homedir(), p.slice(2));
|
|
21508
21779
|
}
|
|
21509
21780
|
return p;
|
|
21510
21781
|
}
|
|
@@ -21512,14 +21783,14 @@ function resolve_path(p) {
|
|
|
21512
21783
|
try {
|
|
21513
21784
|
return fs34.realpathSync(p);
|
|
21514
21785
|
} catch {
|
|
21515
|
-
const abs =
|
|
21516
|
-
const parts = abs.split(
|
|
21786
|
+
const abs = path32.resolve(p);
|
|
21787
|
+
const parts = abs.split(path32.sep);
|
|
21517
21788
|
for (let i = parts.length; i > 0; i -= 1) {
|
|
21518
|
-
const prefix = parts.slice(0, i).join(
|
|
21789
|
+
const prefix = parts.slice(0, i).join(path32.sep) || path32.sep;
|
|
21519
21790
|
try {
|
|
21520
21791
|
const real = fs34.realpathSync(prefix);
|
|
21521
21792
|
const rest = parts.slice(i);
|
|
21522
|
-
return rest.length > 0 ?
|
|
21793
|
+
return rest.length > 0 ? path32.join(real, ...rest) : real;
|
|
21523
21794
|
} catch {
|
|
21524
21795
|
continue;
|
|
21525
21796
|
}
|
|
@@ -21558,13 +21829,13 @@ function load_inventory(p) {
|
|
|
21558
21829
|
}
|
|
21559
21830
|
function save_inventory(data, p) {
|
|
21560
21831
|
const target = p ?? inventory_path();
|
|
21561
|
-
fs34.mkdirSync(
|
|
21832
|
+
fs34.mkdirSync(path32.dirname(target), { recursive: true });
|
|
21562
21833
|
const payload = json_dumps_sorted(data, 2) + "\n";
|
|
21563
|
-
const parent =
|
|
21834
|
+
const parent = path32.dirname(target);
|
|
21564
21835
|
let fd = null;
|
|
21565
21836
|
let tmp_name = "";
|
|
21566
21837
|
for (let attempt = 0; attempt < 32; attempt += 1) {
|
|
21567
|
-
tmp_name =
|
|
21838
|
+
tmp_name = path32.join(parent, `${path32.basename(target)}.${randomBytes3(6).toString("hex")}`);
|
|
21568
21839
|
try {
|
|
21569
21840
|
fd = fs34.openSync(tmp_name, "wx", 384);
|
|
21570
21841
|
break;
|
|
@@ -21661,7 +21932,7 @@ function expected_deploy_files(src, dest_rel, file_filter = null) {
|
|
|
21661
21932
|
const _walk = (node, prefix) => {
|
|
21662
21933
|
const entries = fs34.readdirSync(node).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
21663
21934
|
for (const name of entries) {
|
|
21664
|
-
const entry =
|
|
21935
|
+
const entry = path32.join(node, name);
|
|
21665
21936
|
const rel = join_rel(prefix, name);
|
|
21666
21937
|
const lst = fs34.lstatSync(entry);
|
|
21667
21938
|
if (lst.isDirectory() && !lst.isSymbolicLink()) {
|
|
@@ -21688,13 +21959,13 @@ function expected_deploy_files(src, dest_rel, file_filter = null) {
|
|
|
21688
21959
|
return out;
|
|
21689
21960
|
}
|
|
21690
21961
|
function join_rel(prefix, name) {
|
|
21691
|
-
return prefix ?
|
|
21962
|
+
return prefix ? path32.join(prefix, name) : name;
|
|
21692
21963
|
}
|
|
21693
21964
|
function as_posix(p) {
|
|
21694
21965
|
if (p === "") {
|
|
21695
21966
|
return ".";
|
|
21696
21967
|
}
|
|
21697
|
-
return p.split(
|
|
21968
|
+
return p.split(path32.sep).join("/");
|
|
21698
21969
|
}
|
|
21699
21970
|
function reap_stale(tool_id, anchor, current_files, inventory, dry_run = false) {
|
|
21700
21971
|
const tools = inventory["tools"] ?? {};
|
|
@@ -21719,9 +21990,9 @@ function reap_stale(tool_id, anchor, current_files, inventory, dry_run = false)
|
|
|
21719
21990
|
if (typeof rel !== "string" || !rel || rel.startsWith("/") || rel.startsWith("..")) {
|
|
21720
21991
|
continue;
|
|
21721
21992
|
}
|
|
21722
|
-
const target =
|
|
21993
|
+
const target = path32.join(anchor_resolved, rel);
|
|
21723
21994
|
try {
|
|
21724
|
-
relative_to(resolve_path(
|
|
21995
|
+
relative_to(resolve_path(path32.dirname(target)), anchor_resolved);
|
|
21725
21996
|
} catch {
|
|
21726
21997
|
continue;
|
|
21727
21998
|
}
|
|
@@ -21746,7 +22017,7 @@ function reap_stale(tool_id, anchor, current_files, inventory, dry_run = false)
|
|
|
21746
22017
|
continue;
|
|
21747
22018
|
}
|
|
21748
22019
|
deleted.push(target);
|
|
21749
|
-
prune_candidates.add(
|
|
22020
|
+
prune_candidates.add(path32.dirname(target));
|
|
21750
22021
|
}
|
|
21751
22022
|
prune_empty_dirs(prune_candidates, anchor_resolved);
|
|
21752
22023
|
return deleted;
|
|
@@ -21757,7 +22028,7 @@ function reap_tagged_orphans(anchor, dest_subs, current_files, package_tag, dry_
|
|
|
21757
22028
|
const prune_candidates = /* @__PURE__ */ new Set();
|
|
21758
22029
|
const needle = `package: ${package_tag}`;
|
|
21759
22030
|
for (const dest_sub of dest_subs) {
|
|
21760
|
-
const root = dest_sub ?
|
|
22031
|
+
const root = dest_sub ? path32.join(anchor_resolved, dest_sub) : anchor_resolved;
|
|
21761
22032
|
let root_stat;
|
|
21762
22033
|
try {
|
|
21763
22034
|
root_stat = fs34.statSync(root);
|
|
@@ -21782,7 +22053,7 @@ function reap_tagged_orphans(anchor, dest_subs, current_files, package_tag, dry_
|
|
|
21782
22053
|
continue;
|
|
21783
22054
|
}
|
|
21784
22055
|
try {
|
|
21785
|
-
relative_to(resolve_path(
|
|
22056
|
+
relative_to(resolve_path(path32.dirname(md)), anchor_resolved);
|
|
21786
22057
|
} catch {
|
|
21787
22058
|
continue;
|
|
21788
22059
|
}
|
|
@@ -21811,7 +22082,7 @@ function reap_tagged_orphans(anchor, dest_subs, current_files, package_tag, dry_
|
|
|
21811
22082
|
continue;
|
|
21812
22083
|
}
|
|
21813
22084
|
deleted.push(md);
|
|
21814
|
-
prune_candidates.add(
|
|
22085
|
+
prune_candidates.add(path32.dirname(md));
|
|
21815
22086
|
}
|
|
21816
22087
|
}
|
|
21817
22088
|
prune_empty_dirs(prune_candidates, anchor_resolved);
|
|
@@ -21831,7 +22102,7 @@ function record_deploy(tool_id, anchor, current_files, inventory) {
|
|
|
21831
22102
|
}
|
|
21832
22103
|
function prune_empty_dirs(prune_candidates, anchor_resolved) {
|
|
21833
22104
|
const ordered = [...prune_candidates].sort(
|
|
21834
|
-
(a, b) => b.split(
|
|
22105
|
+
(a, b) => b.split(path32.sep).length - a.split(path32.sep).length
|
|
21835
22106
|
);
|
|
21836
22107
|
for (const start of ordered) {
|
|
21837
22108
|
let node = start;
|
|
@@ -21841,26 +22112,26 @@ function prune_empty_dirs(prune_candidates, anchor_resolved) {
|
|
|
21841
22112
|
} catch {
|
|
21842
22113
|
break;
|
|
21843
22114
|
}
|
|
21844
|
-
node =
|
|
22115
|
+
node = path32.dirname(node);
|
|
21845
22116
|
}
|
|
21846
22117
|
}
|
|
21847
22118
|
}
|
|
21848
22119
|
function is_ancestor(anchor, node) {
|
|
21849
|
-
const rel =
|
|
21850
|
-
return rel !== "" && !rel.startsWith("..") && !
|
|
22120
|
+
const rel = path32.relative(anchor, node);
|
|
22121
|
+
return rel !== "" && !rel.startsWith("..") && !path32.isAbsolute(rel);
|
|
21851
22122
|
}
|
|
21852
22123
|
function relative_to(child, parent) {
|
|
21853
22124
|
if (child === parent) {
|
|
21854
22125
|
return "";
|
|
21855
22126
|
}
|
|
21856
|
-
const rel =
|
|
21857
|
-
if (rel.startsWith("..") ||
|
|
22127
|
+
const rel = path32.relative(parent, child);
|
|
22128
|
+
if (rel.startsWith("..") || path32.isAbsolute(rel)) {
|
|
21858
22129
|
throw new Error(`'${child}' is not in the subpath of '${parent}'`);
|
|
21859
22130
|
}
|
|
21860
22131
|
return rel;
|
|
21861
22132
|
}
|
|
21862
22133
|
function relative_to_posix(child, parent) {
|
|
21863
|
-
return
|
|
22134
|
+
return path32.relative(parent, child).split(path32.sep).join("/");
|
|
21864
22135
|
}
|
|
21865
22136
|
function rglob_md(root) {
|
|
21866
22137
|
const out = [];
|
|
@@ -21872,7 +22143,7 @@ function rglob_md(root) {
|
|
|
21872
22143
|
return;
|
|
21873
22144
|
}
|
|
21874
22145
|
for (const name of names) {
|
|
21875
|
-
const full =
|
|
22146
|
+
const full = path32.join(dir, name);
|
|
21876
22147
|
let lst;
|
|
21877
22148
|
try {
|
|
21878
22149
|
lst = fs34.lstatSync(full);
|
|
@@ -21927,7 +22198,7 @@ var init_global_deploy_inventory = __esm({
|
|
|
21927
22198
|
|
|
21928
22199
|
// src/scripts/_lib/duplicate_scope_census.ts
|
|
21929
22200
|
import * as fs35 from "node:fs";
|
|
21930
|
-
import * as
|
|
22201
|
+
import * as path33 from "node:path";
|
|
21931
22202
|
function censusDuplicateScope(userRulesDir, projectRulesDir) {
|
|
21932
22203
|
if (!fs35.existsSync(userRulesDir) || !fs35.existsSync(projectRulesDir)) {
|
|
21933
22204
|
return {
|
|
@@ -21944,8 +22215,8 @@ function censusDuplicateScope(userRulesDir, projectRulesDir) {
|
|
|
21944
22215
|
for (const f of projectFiles) {
|
|
21945
22216
|
if (!userFiles.has(f)) continue;
|
|
21946
22217
|
shared.push(f);
|
|
21947
|
-
const a = fs35.statSync(
|
|
21948
|
-
const b = fs35.statSync(
|
|
22218
|
+
const a = fs35.statSync(path33.join(userRulesDir, f)).size;
|
|
22219
|
+
const b = fs35.statSync(path33.join(projectRulesDir, f)).size;
|
|
21949
22220
|
duplicateChars += Math.min(a, b);
|
|
21950
22221
|
}
|
|
21951
22222
|
shared.sort();
|
|
@@ -22042,8 +22313,8 @@ var init_spawn_env = __esm({
|
|
|
22042
22313
|
// src/scripts/ai_council/events_log.ts
|
|
22043
22314
|
import * as crypto4 from "node:crypto";
|
|
22044
22315
|
import * as fs36 from "node:fs";
|
|
22045
|
-
import * as
|
|
22046
|
-
import { fileURLToPath as
|
|
22316
|
+
import * as path34 from "node:path";
|
|
22317
|
+
import { fileURLToPath as fileURLToPath23 } from "node:url";
|
|
22047
22318
|
function _hash_original_ask(originalAsk) {
|
|
22048
22319
|
if (!originalAsk) {
|
|
22049
22320
|
return "0".repeat(12);
|
|
@@ -22138,7 +22409,7 @@ function appendEvent(event, opts = {}) {
|
|
|
22138
22409
|
}
|
|
22139
22410
|
}
|
|
22140
22411
|
const target = opts.logPath != null ? opts.logPath : _DEFAULT_LOG_PATH;
|
|
22141
|
-
fs36.mkdirSync(
|
|
22412
|
+
fs36.mkdirSync(path34.dirname(target), { recursive: true });
|
|
22142
22413
|
const line = _pyJsonDumpsCompact(record);
|
|
22143
22414
|
fs36.appendFileSync(target, line + "\n", { encoding: "utf-8" });
|
|
22144
22415
|
return true;
|
|
@@ -22237,9 +22508,9 @@ var init_events_log = __esm({
|
|
|
22237
22508
|
"block_quota"
|
|
22238
22509
|
]);
|
|
22239
22510
|
_KILL_SWITCH_ENV = "AGENT_CONFIG_NO_EVENTS_LOG";
|
|
22240
|
-
_HERE11 =
|
|
22241
|
-
_REPO_ROOT =
|
|
22242
|
-
_DEFAULT_LOG_PATH =
|
|
22511
|
+
_HERE11 = fileURLToPath23(import.meta.url);
|
|
22512
|
+
_REPO_ROOT = path34.resolve(path34.dirname(_HERE11), "..", "..", "..");
|
|
22513
|
+
_DEFAULT_LOG_PATH = path34.join(
|
|
22243
22514
|
_REPO_ROOT,
|
|
22244
22515
|
"agents",
|
|
22245
22516
|
"runtime",
|
|
@@ -22304,9 +22575,9 @@ __export(clients_exports, {
|
|
|
22304
22575
|
record_cli_call: () => record_cli_call,
|
|
22305
22576
|
reset_cli_call_counts: () => reset_cli_call_counts
|
|
22306
22577
|
});
|
|
22307
|
-
import { spawnSync as
|
|
22578
|
+
import { spawnSync as spawnSync7 } from "node:child_process";
|
|
22308
22579
|
import * as fs37 from "node:fs";
|
|
22309
|
-
import * as
|
|
22580
|
+
import * as path35 from "node:path";
|
|
22310
22581
|
function _resolveKeyPath(filename) {
|
|
22311
22582
|
const found = resolve_with_fallback(filename);
|
|
22312
22583
|
if (found !== null) {
|
|
@@ -22396,7 +22667,7 @@ function _curlJsonPost(url, extraHeaders, body) {
|
|
|
22396
22667
|
}
|
|
22397
22668
|
args.push("--connect-timeout", "30", "--max-time", "290");
|
|
22398
22669
|
args.push("-w", "\n%{http_code}", "--data-binary", "@-");
|
|
22399
|
-
const r =
|
|
22670
|
+
const r = spawnSync7("curl", args, {
|
|
22400
22671
|
input: JSON.stringify(body),
|
|
22401
22672
|
encoding: "utf8",
|
|
22402
22673
|
maxBuffer: 64 * 1024 * 1024,
|
|
@@ -22461,7 +22732,7 @@ function record_cli_call(provider, p = null) {
|
|
|
22461
22732
|
const target = p !== null ? p : _cliCallsStatePath();
|
|
22462
22733
|
const counts = load_cli_call_counts(target);
|
|
22463
22734
|
counts[provider] = (counts[provider] ?? 0) + 1;
|
|
22464
|
-
fs37.mkdirSync(
|
|
22735
|
+
fs37.mkdirSync(path35.dirname(target), { recursive: true });
|
|
22465
22736
|
fs37.writeFileSync(
|
|
22466
22737
|
target,
|
|
22467
22738
|
_jsonDumpsIndent2({ date: _today_utc_iso(), counts }),
|
|
@@ -22477,7 +22748,7 @@ function reset_cli_call_counts(provider = null, p = null) {
|
|
|
22477
22748
|
} else {
|
|
22478
22749
|
delete counts[provider];
|
|
22479
22750
|
}
|
|
22480
|
-
fs37.mkdirSync(
|
|
22751
|
+
fs37.mkdirSync(path35.dirname(target), { recursive: true });
|
|
22481
22752
|
fs37.writeFileSync(
|
|
22482
22753
|
target,
|
|
22483
22754
|
_jsonDumpsIndent2({ date: _today_utc_iso(), counts }),
|
|
@@ -22773,7 +23044,7 @@ function _pyJsonStringAscii(s) {
|
|
|
22773
23044
|
return out + '"';
|
|
22774
23045
|
}
|
|
22775
23046
|
function _which(name) {
|
|
22776
|
-
if (name.includes(
|
|
23047
|
+
if (name.includes(path35.sep) || path35.sep !== "/" && name.includes("/")) {
|
|
22777
23048
|
return _isExecutable(name) ? name : null;
|
|
22778
23049
|
}
|
|
22779
23050
|
const pathEnv = process.env.PATH ?? "";
|
|
@@ -22781,12 +23052,12 @@ function _which(name) {
|
|
|
22781
23052
|
return null;
|
|
22782
23053
|
}
|
|
22783
23054
|
const exts = process.platform === "win32" ? (process.env.PATHEXT ?? ".COM;.EXE;.BAT;.CMD").split(";").filter(Boolean) : [""];
|
|
22784
|
-
for (const dir of pathEnv.split(
|
|
23055
|
+
for (const dir of pathEnv.split(path35.delimiter)) {
|
|
22785
23056
|
if (!dir) {
|
|
22786
23057
|
continue;
|
|
22787
23058
|
}
|
|
22788
23059
|
for (const ext of exts) {
|
|
22789
|
-
const candidate =
|
|
23060
|
+
const candidate = path35.join(dir, name + ext);
|
|
22790
23061
|
if (_isExecutable(candidate)) {
|
|
22791
23062
|
return candidate;
|
|
22792
23063
|
}
|
|
@@ -23407,7 +23678,7 @@ ${user_prompt}`;
|
|
|
23407
23678
|
if (stdinPayload !== null) {
|
|
23408
23679
|
spawnOpts.input = stdinPayload;
|
|
23409
23680
|
}
|
|
23410
|
-
const r =
|
|
23681
|
+
const r = spawnSync7(argv0, cmd.slice(1), spawnOpts);
|
|
23411
23682
|
if (r.error) {
|
|
23412
23683
|
const err = r.error;
|
|
23413
23684
|
if (r.signal === "SIGTERM" || err.code === "ETIMEDOUT") {
|
|
@@ -24072,7 +24343,7 @@ __export(config_exports, {
|
|
|
24072
24343
|
});
|
|
24073
24344
|
import * as fs38 from "node:fs";
|
|
24074
24345
|
import * as os8 from "node:os";
|
|
24075
|
-
import * as
|
|
24346
|
+
import * as path36 from "node:path";
|
|
24076
24347
|
function _pyReprStr(s) {
|
|
24077
24348
|
const hasSingle = s.includes("'");
|
|
24078
24349
|
const hasDouble = s.includes('"');
|
|
@@ -24243,7 +24514,7 @@ function _expanduser2(p) {
|
|
|
24243
24514
|
return os8.homedir();
|
|
24244
24515
|
}
|
|
24245
24516
|
if (p.startsWith("~/") || process.platform === "win32" && p.startsWith("~\\")) {
|
|
24246
|
-
return
|
|
24517
|
+
return path36.join(os8.homedir(), p.slice(2));
|
|
24247
24518
|
}
|
|
24248
24519
|
return p;
|
|
24249
24520
|
}
|
|
@@ -25469,10 +25740,10 @@ var init_agentSwitchDetection = __esm({
|
|
|
25469
25740
|
});
|
|
25470
25741
|
|
|
25471
25742
|
// src/scripts/_lib/environment_detector.ts
|
|
25472
|
-
import { spawnSync as
|
|
25743
|
+
import { spawnSync as spawnSync8 } from "node:child_process";
|
|
25473
25744
|
import * as fs39 from "node:fs";
|
|
25474
25745
|
import * as os9 from "node:os";
|
|
25475
|
-
import * as
|
|
25746
|
+
import * as path37 from "node:path";
|
|
25476
25747
|
function knownProviders() {
|
|
25477
25748
|
return Object.keys(PROVIDER_CLI_META);
|
|
25478
25749
|
}
|
|
@@ -25487,7 +25758,7 @@ function classifyBilling(provider, source) {
|
|
|
25487
25758
|
function codexHome(env) {
|
|
25488
25759
|
const map = env ?? process.env;
|
|
25489
25760
|
const override = (map["CODEX_HOME"] ?? "").trim();
|
|
25490
|
-
return override !== "" ? override :
|
|
25761
|
+
return override !== "" ? override : path37.join(homeOf(env), ".codex");
|
|
25491
25762
|
}
|
|
25492
25763
|
function homeOf(env) {
|
|
25493
25764
|
const map = env ?? process.env;
|
|
@@ -25496,7 +25767,7 @@ function homeOf(env) {
|
|
|
25496
25767
|
}
|
|
25497
25768
|
function defaultProbeVersion(binary) {
|
|
25498
25769
|
try {
|
|
25499
|
-
const res =
|
|
25770
|
+
const res = spawnSync8(binary, ["--version"], {
|
|
25500
25771
|
timeout: VERSION_PROBE_TIMEOUT_MS,
|
|
25501
25772
|
encoding: "utf-8",
|
|
25502
25773
|
windowsHide: true,
|
|
@@ -25543,18 +25814,18 @@ function cliSubscriptionEvidence(provider, home, env, claudeConfigDir) {
|
|
|
25543
25814
|
if (provider === "anthropic") {
|
|
25544
25815
|
const configDir = claudeConfigDir;
|
|
25545
25816
|
for (const rel of [".credentials.json", "credentials.json"]) {
|
|
25546
|
-
const p =
|
|
25817
|
+
const p = path37.join(configDir, rel);
|
|
25547
25818
|
if (isFile2(p)) return { source: "cli-subscription", evidence: p };
|
|
25548
25819
|
}
|
|
25549
25820
|
return null;
|
|
25550
25821
|
}
|
|
25551
25822
|
if (provider === "openai") {
|
|
25552
|
-
const p =
|
|
25823
|
+
const p = path37.join(codexHome(env), "auth.json");
|
|
25553
25824
|
if (isFile2(p)) return { source: classifyCodexAuth(p), evidence: p };
|
|
25554
25825
|
return null;
|
|
25555
25826
|
}
|
|
25556
25827
|
if (provider === "gemini") {
|
|
25557
|
-
const p =
|
|
25828
|
+
const p = path37.join(home, ".gemini", "oauth_creds.json");
|
|
25558
25829
|
if (isFile2(p)) return { source: "cli-subscription", evidence: p };
|
|
25559
25830
|
return null;
|
|
25560
25831
|
}
|
|
@@ -25586,7 +25857,7 @@ function detectHosts(opts) {
|
|
|
25586
25857
|
function detectAuth(opts) {
|
|
25587
25858
|
const env = opts.env ?? process.env;
|
|
25588
25859
|
const home = opts.home ?? homeOf(opts.env);
|
|
25589
|
-
const claudeConfigDir = opts.home === void 0 && opts.env === void 0 ? claude_config_dir() : (env["CLAUDE_CONFIG_DIR"] ?? "").trim() ||
|
|
25860
|
+
const claudeConfigDir = opts.home === void 0 && opts.env === void 0 ? claude_config_dir() : (env["CLAUDE_CONFIG_DIR"] ?? "").trim() || path37.join(home, ".claude");
|
|
25590
25861
|
const auth = [];
|
|
25591
25862
|
const keys = [];
|
|
25592
25863
|
for (const provider of knownProviders()) {
|
|
@@ -25791,7 +26062,7 @@ var init_transport_resolver = __esm({
|
|
|
25791
26062
|
});
|
|
25792
26063
|
|
|
25793
26064
|
// src/scripts/_cli/detection_report.ts
|
|
25794
|
-
import * as
|
|
26065
|
+
import * as path38 from "node:path";
|
|
25795
26066
|
function envRefResolves(ref, env) {
|
|
25796
26067
|
if (ref === null || !ref.startsWith("env:")) return false;
|
|
25797
26068
|
const name = ref.slice("env:".length).trim();
|
|
@@ -25866,7 +26137,7 @@ function cliBinaryPresent(environment, provider, binaryOverride) {
|
|
|
25866
26137
|
const expected = PROVIDER_CLI_META[provider]?.[0];
|
|
25867
26138
|
if (expected === void 0) return false;
|
|
25868
26139
|
return environment.hosts.some(
|
|
25869
|
-
(h) => h.binary !== null && stripExe(
|
|
26140
|
+
(h) => h.binary !== null && stripExe(path38.basename(h.binary)) === expected
|
|
25870
26141
|
);
|
|
25871
26142
|
}
|
|
25872
26143
|
function stripExe(name) {
|
|
@@ -26066,7 +26337,7 @@ var init_config2 = __esm({
|
|
|
26066
26337
|
import * as crypto5 from "node:crypto";
|
|
26067
26338
|
import * as fs40 from "node:fs";
|
|
26068
26339
|
import * as os10 from "node:os";
|
|
26069
|
-
import * as
|
|
26340
|
+
import * as path39 from "node:path";
|
|
26070
26341
|
function _workspace_state_segment(workspace_root) {
|
|
26071
26342
|
let canonical = workspace_root;
|
|
26072
26343
|
try {
|
|
@@ -26074,7 +26345,7 @@ function _workspace_state_segment(workspace_root) {
|
|
|
26074
26345
|
} catch {
|
|
26075
26346
|
canonical = workspace_root;
|
|
26076
26347
|
}
|
|
26077
|
-
const slug_source =
|
|
26348
|
+
const slug_source = path39.basename(workspace_root) || "workspace";
|
|
26078
26349
|
const slug = slug_source.replace(/[^a-zA-Z0-9._-]+/g, "-").replace(/^-+|-+$/g, "") || "workspace";
|
|
26079
26350
|
const hash = crypto5.createHash("sha256").update(canonical).digest("hex").slice(0, 16);
|
|
26080
26351
|
return `${slug}-${hash}`;
|
|
@@ -26084,19 +26355,19 @@ function upstream_state_dir_candidates(workspace_root) {
|
|
|
26084
26355
|
const candidates = [];
|
|
26085
26356
|
const env = (process.env["CLAUDE_PLUGIN_DATA"] ?? "").trim();
|
|
26086
26357
|
if (env !== "") {
|
|
26087
|
-
candidates.push(
|
|
26358
|
+
candidates.push(path39.join(env, "state", segment));
|
|
26088
26359
|
}
|
|
26089
26360
|
candidates.push(
|
|
26090
|
-
|
|
26361
|
+
path39.join(claude_config_dir(), "plugins", "data", _CODEX_PLUGIN_DATA_DIRNAME, "state", segment)
|
|
26091
26362
|
);
|
|
26092
|
-
candidates.push(
|
|
26363
|
+
candidates.push(path39.join(os10.tmpdir(), "codex-companion", segment));
|
|
26093
26364
|
return candidates;
|
|
26094
26365
|
}
|
|
26095
26366
|
function upstream_gate_enabled(workspace_root) {
|
|
26096
26367
|
for (const dir of upstream_state_dir_candidates(workspace_root)) {
|
|
26097
26368
|
let parsed;
|
|
26098
26369
|
try {
|
|
26099
|
-
parsed = JSON.parse(fs40.readFileSync(
|
|
26370
|
+
parsed = JSON.parse(fs40.readFileSync(path39.join(dir, "state.json"), "utf-8"));
|
|
26100
26371
|
} catch {
|
|
26101
26372
|
continue;
|
|
26102
26373
|
}
|
|
@@ -26149,7 +26420,7 @@ var init_review_gate = __esm({
|
|
|
26149
26420
|
init_claude_plugin();
|
|
26150
26421
|
init_state_io();
|
|
26151
26422
|
init_config2();
|
|
26152
|
-
GATE_LEDGER_RELPATH =
|
|
26423
|
+
GATE_LEDGER_RELPATH = path39.join("agents", "runtime", "team", "events.log");
|
|
26153
26424
|
_CODEX_PLUGIN_DATA_DIRNAME = `${CODEX_PLUGIN_ID}-${CODEX_MARKETPLACE_NAME}`;
|
|
26154
26425
|
UPSTREAM_GATE_COST_WARNING = "The review gate can create a long-running Claude/Codex loop and may drain usage limits quickly.";
|
|
26155
26426
|
}
|
|
@@ -26220,7 +26491,7 @@ var init_ruleInScope = __esm({
|
|
|
26220
26491
|
|
|
26221
26492
|
// src/install/rule_scope.ts
|
|
26222
26493
|
import * as fs42 from "node:fs";
|
|
26223
|
-
import * as
|
|
26494
|
+
import * as path40 from "node:path";
|
|
26224
26495
|
function _list(value) {
|
|
26225
26496
|
if (Array.isArray(value) && value.length > 0) {
|
|
26226
26497
|
return value.map((v) => String(v));
|
|
@@ -26243,7 +26514,7 @@ function ruleFileArrives(sourcePath, scope) {
|
|
|
26243
26514
|
if (!sourcePath.endsWith(".md")) {
|
|
26244
26515
|
return true;
|
|
26245
26516
|
}
|
|
26246
|
-
const basename18 =
|
|
26517
|
+
const basename18 = path40.basename(sourcePath);
|
|
26247
26518
|
if (COMPAT_ALWAYS_EXCLUDED.includes(basename18)) {
|
|
26248
26519
|
return false;
|
|
26249
26520
|
}
|
|
@@ -26261,7 +26532,7 @@ function excludedRuleBasenames(rulesDir, scope) {
|
|
|
26261
26532
|
if (!name.endsWith(".md")) {
|
|
26262
26533
|
continue;
|
|
26263
26534
|
}
|
|
26264
|
-
const full =
|
|
26535
|
+
const full = path40.join(rulesDir, name);
|
|
26265
26536
|
try {
|
|
26266
26537
|
if (!fs42.statSync(full).isFile()) {
|
|
26267
26538
|
continue;
|
|
@@ -26355,13 +26626,13 @@ __export(cmd_doctor_exports, {
|
|
|
26355
26626
|
import * as crypto6 from "node:crypto";
|
|
26356
26627
|
import * as fs43 from "node:fs";
|
|
26357
26628
|
import * as os11 from "node:os";
|
|
26358
|
-
import * as
|
|
26629
|
+
import * as path41 from "node:path";
|
|
26359
26630
|
import process15 from "node:process";
|
|
26360
|
-
import { fileURLToPath as
|
|
26631
|
+
import { fileURLToPath as fileURLToPath24, pathToFileURL as pathToFileURL15 } from "node:url";
|
|
26361
26632
|
function expanduser5(p) {
|
|
26362
26633
|
if (p === "~") return os11.homedir();
|
|
26363
26634
|
if (p.startsWith("~/") || p.startsWith("~\\")) {
|
|
26364
|
-
return
|
|
26635
|
+
return path41.join(os11.homedir(), p.slice(2));
|
|
26365
26636
|
}
|
|
26366
26637
|
return p;
|
|
26367
26638
|
}
|
|
@@ -26389,9 +26660,9 @@ function isDir2(p) {
|
|
|
26389
26660
|
}
|
|
26390
26661
|
function resolvePath(p) {
|
|
26391
26662
|
try {
|
|
26392
|
-
return fs43.realpathSync(
|
|
26663
|
+
return fs43.realpathSync(path41.resolve(p));
|
|
26393
26664
|
} catch {
|
|
26394
|
-
return
|
|
26665
|
+
return path41.resolve(p);
|
|
26395
26666
|
}
|
|
26396
26667
|
}
|
|
26397
26668
|
function readText2(p) {
|
|
@@ -26502,7 +26773,7 @@ function _resolve_project_root(arg) {
|
|
|
26502
26773
|
return resolve_project_root(arg);
|
|
26503
26774
|
}
|
|
26504
26775
|
function _detect_install_mode(project_root) {
|
|
26505
|
-
const marker =
|
|
26776
|
+
const marker = path41.join(project_root, _INSTALL_MODE_MARKER_REL);
|
|
26506
26777
|
if (isFile3(marker)) {
|
|
26507
26778
|
let value;
|
|
26508
26779
|
try {
|
|
@@ -26514,9 +26785,9 @@ function _detect_install_mode(project_root) {
|
|
|
26514
26785
|
return [value, "marker-file"];
|
|
26515
26786
|
}
|
|
26516
26787
|
}
|
|
26517
|
-
const has_agents_md = pathExists(
|
|
26788
|
+
const has_agents_md = pathExists(path41.join(project_root, "AGENTS.md"));
|
|
26518
26789
|
const has_copilot = pathExists(
|
|
26519
|
-
|
|
26790
|
+
path41.join(project_root, ".github", "copilot-instructions.md")
|
|
26520
26791
|
);
|
|
26521
26792
|
if (has_agents_md && has_copilot) {
|
|
26522
26793
|
return ["full", "heuristic"];
|
|
@@ -26536,7 +26807,7 @@ function _settings_layer_chain(project_root) {
|
|
|
26536
26807
|
return layers;
|
|
26537
26808
|
}
|
|
26538
26809
|
function _detect_wrapper(project_root) {
|
|
26539
|
-
const wrapper =
|
|
26810
|
+
const wrapper = path41.join(project_root, "agent-config");
|
|
26540
26811
|
if (!pathExists(wrapper)) {
|
|
26541
26812
|
return { path: String(wrapper), exists: false, embedded_root: null };
|
|
26542
26813
|
}
|
|
@@ -26603,8 +26874,8 @@ function _emit_context_text(ctx) {
|
|
|
26603
26874
|
}
|
|
26604
26875
|
function _resolve_path(project_root, raw) {
|
|
26605
26876
|
let p = expanduser5(raw);
|
|
26606
|
-
if (!
|
|
26607
|
-
p =
|
|
26877
|
+
if (!path41.isAbsolute(p)) {
|
|
26878
|
+
p = path41.join(project_root, p);
|
|
26608
26879
|
}
|
|
26609
26880
|
return p;
|
|
26610
26881
|
}
|
|
@@ -26617,7 +26888,7 @@ function _sha256(p) {
|
|
|
26617
26888
|
}
|
|
26618
26889
|
}
|
|
26619
26890
|
function _read_inline_package_tag(p) {
|
|
26620
|
-
if (
|
|
26891
|
+
if (path41.extname(p) !== ".md") {
|
|
26621
26892
|
return NO_FRONTMATTER;
|
|
26622
26893
|
}
|
|
26623
26894
|
let text;
|
|
@@ -26752,7 +27023,7 @@ function rglob2(root) {
|
|
|
26752
27023
|
}
|
|
26753
27024
|
entries.sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0);
|
|
26754
27025
|
for (const ent of entries) {
|
|
26755
|
-
const full =
|
|
27026
|
+
const full = path41.join(dir, ent.name);
|
|
26756
27027
|
out.push(full);
|
|
26757
27028
|
let dirLike = ent.isDirectory();
|
|
26758
27029
|
if (ent.isSymbolicLink()) {
|
|
@@ -26827,19 +27098,19 @@ function _foreign_records(project_root, foreign) {
|
|
|
26827
27098
|
return out;
|
|
26828
27099
|
}
|
|
26829
27100
|
function relativeTo(p, base) {
|
|
26830
|
-
const rel =
|
|
27101
|
+
const rel = path41.relative(base, p);
|
|
26831
27102
|
if (rel === "") return rel;
|
|
26832
|
-
if (rel.startsWith("..") ||
|
|
27103
|
+
if (rel.startsWith("..") || path41.isAbsolute(rel)) {
|
|
26833
27104
|
return null;
|
|
26834
27105
|
}
|
|
26835
27106
|
return rel;
|
|
26836
27107
|
}
|
|
26837
27108
|
function _is_global_only_consumer(project_root) {
|
|
26838
|
-
return isFile3(
|
|
27109
|
+
return isFile3(path41.join(project_root, INSTALL_MODE_MARKER_RELATIVE)) || isDir2(path41.join(project_root, "agents", "overrides"));
|
|
26839
27110
|
}
|
|
26840
27111
|
function _check_scope(project_root) {
|
|
26841
27112
|
for (const marker of ["pnpm-workspace.yaml", "lerna.json"]) {
|
|
26842
|
-
if (pathExists(
|
|
27113
|
+
if (pathExists(path41.join(project_root, marker))) {
|
|
26843
27114
|
return {
|
|
26844
27115
|
id: "scope",
|
|
26845
27116
|
status: "warn",
|
|
@@ -26848,7 +27119,7 @@ function _check_scope(project_root) {
|
|
|
26848
27119
|
};
|
|
26849
27120
|
}
|
|
26850
27121
|
}
|
|
26851
|
-
const pkg =
|
|
27122
|
+
const pkg = path41.join(project_root, "package.json");
|
|
26852
27123
|
if (pathExists(pkg)) {
|
|
26853
27124
|
try {
|
|
26854
27125
|
const data = JSON.parse(readText2(pkg));
|
|
@@ -26871,23 +27142,23 @@ function _check_scope(project_root) {
|
|
|
26871
27142
|
};
|
|
26872
27143
|
}
|
|
26873
27144
|
function _git_config_path(project_root) {
|
|
26874
|
-
const gd =
|
|
27145
|
+
const gd = path41.join(project_root, ".git");
|
|
26875
27146
|
try {
|
|
26876
27147
|
const st = fs43.statSync(gd);
|
|
26877
27148
|
if (st.isDirectory()) {
|
|
26878
|
-
return
|
|
27149
|
+
return path41.join(gd, "config");
|
|
26879
27150
|
}
|
|
26880
27151
|
const m = readText2(gd).match(/^gitdir:\s*(.+)\s*$/m);
|
|
26881
27152
|
if (m === null) {
|
|
26882
27153
|
return null;
|
|
26883
27154
|
}
|
|
26884
|
-
const gdPath =
|
|
26885
|
-
const commondirFile =
|
|
27155
|
+
const gdPath = path41.resolve(project_root, m[1].trim());
|
|
27156
|
+
const commondirFile = path41.join(gdPath, "commondir");
|
|
26886
27157
|
if (pathExists(commondirFile)) {
|
|
26887
|
-
const common =
|
|
26888
|
-
return
|
|
27158
|
+
const common = path41.resolve(gdPath, readText2(commondirFile).trim());
|
|
27159
|
+
return path41.join(common, "config");
|
|
26889
27160
|
}
|
|
26890
|
-
return
|
|
27161
|
+
return path41.join(gdPath, "config");
|
|
26891
27162
|
} catch {
|
|
26892
27163
|
return null;
|
|
26893
27164
|
}
|
|
@@ -26920,7 +27191,7 @@ function _check_git_identity(project_root) {
|
|
|
26920
27191
|
}
|
|
26921
27192
|
let ident = _parse_git_user(readText2(cfgPath));
|
|
26922
27193
|
if (ident.name === null && ident.email === null) {
|
|
26923
|
-
const globalCfg =
|
|
27194
|
+
const globalCfg = path41.join(os11.homedir(), ".gitconfig");
|
|
26924
27195
|
if (pathExists(globalCfg)) {
|
|
26925
27196
|
ident = _parse_git_user(readText2(globalCfg));
|
|
26926
27197
|
}
|
|
@@ -26981,7 +27252,7 @@ function _package_root() {
|
|
|
26981
27252
|
}
|
|
26982
27253
|
function _current_package_version() {
|
|
26983
27254
|
try {
|
|
26984
|
-
const data = JSON.parse(readText2(
|
|
27255
|
+
const data = JSON.parse(readText2(path41.join(_package_root(), "package.json")));
|
|
26985
27256
|
const v = data["version"];
|
|
26986
27257
|
if (typeof v === "string" && v.trim()) {
|
|
26987
27258
|
return v.trim();
|
|
@@ -27025,7 +27296,7 @@ function _check_lockfile_freshness(manifest) {
|
|
|
27025
27296
|
};
|
|
27026
27297
|
}
|
|
27027
27298
|
function shutilWhich(name) {
|
|
27028
|
-
if (
|
|
27299
|
+
if (path41.dirname(name) !== "." && (name.includes("/") || name.includes("\\"))) {
|
|
27029
27300
|
return isExecutableFile(name) ? name : null;
|
|
27030
27301
|
}
|
|
27031
27302
|
const pathEnv = process15.env["PATH"] || "";
|
|
@@ -27038,12 +27309,12 @@ function shutilWhich(name) {
|
|
|
27038
27309
|
if (seenDirs.has(d)) continue;
|
|
27039
27310
|
seenDirs.add(d);
|
|
27040
27311
|
for (const ext of exts) {
|
|
27041
|
-
const candidate =
|
|
27312
|
+
const candidate = path41.join(d, name + (ext === "" ? "" : ext.toLowerCase() === ext ? ext : ext));
|
|
27042
27313
|
if (isExecutableFile(candidate)) {
|
|
27043
27314
|
return candidate;
|
|
27044
27315
|
}
|
|
27045
27316
|
if (ext !== "") {
|
|
27046
|
-
const upper =
|
|
27317
|
+
const upper = path41.join(d, name + ext);
|
|
27047
27318
|
if (isExecutableFile(upper)) return upper;
|
|
27048
27319
|
}
|
|
27049
27320
|
}
|
|
@@ -27119,7 +27390,7 @@ function _check_claude_plugin() {
|
|
|
27119
27390
|
remedy: ""
|
|
27120
27391
|
};
|
|
27121
27392
|
}
|
|
27122
|
-
const projection =
|
|
27393
|
+
const projection = path41.join(os11.homedir(), ".claude", "skills");
|
|
27123
27394
|
const projection_present = isDir2(projection);
|
|
27124
27395
|
if (projection_present) {
|
|
27125
27396
|
return {
|
|
@@ -27156,8 +27427,8 @@ function _check_claude_command_wrappers() {
|
|
|
27156
27427
|
remedy: ""
|
|
27157
27428
|
};
|
|
27158
27429
|
}
|
|
27159
|
-
const anchor =
|
|
27160
|
-
const commands_dir =
|
|
27430
|
+
const anchor = path41.join(os11.homedir(), ".claude");
|
|
27431
|
+
const commands_dir = path41.join(anchor, "commands");
|
|
27161
27432
|
if (!isDir2(commands_dir)) {
|
|
27162
27433
|
return {
|
|
27163
27434
|
id: "claude-command-wrappers",
|
|
@@ -27166,8 +27437,8 @@ function _check_claude_command_wrappers() {
|
|
|
27166
27437
|
remedy: ""
|
|
27167
27438
|
};
|
|
27168
27439
|
}
|
|
27169
|
-
const flat_probe = fs43.existsSync(
|
|
27170
|
-
const wrapper_probe = fs43.existsSync(
|
|
27440
|
+
const flat_probe = fs43.existsSync(path41.join(commands_dir, "commit.md"));
|
|
27441
|
+
const wrapper_probe = fs43.existsSync(path41.join(anchor, "skills", "commit", "SKILL.md"));
|
|
27171
27442
|
if (wrapper_probe) {
|
|
27172
27443
|
return {
|
|
27173
27444
|
id: "claude-command-wrappers",
|
|
@@ -27192,7 +27463,7 @@ function _check_claude_command_wrappers() {
|
|
|
27192
27463
|
};
|
|
27193
27464
|
}
|
|
27194
27465
|
function _check_surface_state() {
|
|
27195
|
-
const matrix_path =
|
|
27466
|
+
const matrix_path = path41.join(_package_root(), "src", "config", "surface-matrix.yml");
|
|
27196
27467
|
if (!isFile3(matrix_path)) {
|
|
27197
27468
|
return {
|
|
27198
27469
|
id: "surface-state",
|
|
@@ -27216,7 +27487,7 @@ function _check_surface_state() {
|
|
|
27216
27487
|
remedy: "agent-config upgrade (reinstalls the package data files)"
|
|
27217
27488
|
};
|
|
27218
27489
|
}
|
|
27219
|
-
const _expand = (p) => p.startsWith("~/") ?
|
|
27490
|
+
const _expand = (p) => p.startsWith("~/") ? path41.join(os11.homedir(), p.slice(2)) : path41.join(_package_root(), p);
|
|
27220
27491
|
const violations = [];
|
|
27221
27492
|
const remedies = [];
|
|
27222
27493
|
let checked = 0;
|
|
@@ -27274,11 +27545,11 @@ function _check_hook_wiring() {
|
|
|
27274
27545
|
remedy: ""
|
|
27275
27546
|
};
|
|
27276
27547
|
}
|
|
27277
|
-
const settings_path =
|
|
27548
|
+
const settings_path = path41.join(os11.homedir(), ".claude", "settings.json");
|
|
27278
27549
|
let missing;
|
|
27279
27550
|
try {
|
|
27280
27551
|
const matrix = build_claude_hook_matrix(
|
|
27281
|
-
|
|
27552
|
+
path41.join(_package_root(), "src", "scripts", "hook_manifest.yaml")
|
|
27282
27553
|
);
|
|
27283
27554
|
const settings = pathExists(settings_path) ? JSON.parse(fs43.readFileSync(settings_path, "utf8")) : {};
|
|
27284
27555
|
const hooks = (settings["hooks"] ?? {}) || {};
|
|
@@ -27355,7 +27626,7 @@ function _check_mcp_mode(project_root) {
|
|
|
27355
27626
|
];
|
|
27356
27627
|
const found = [];
|
|
27357
27628
|
for (const [rel, label] of candidates) {
|
|
27358
|
-
const p =
|
|
27629
|
+
const p = path41.join(project_root, rel);
|
|
27359
27630
|
if (!pathExists(p)) {
|
|
27360
27631
|
continue;
|
|
27361
27632
|
}
|
|
@@ -27387,7 +27658,7 @@ function _check_mcp_mode(project_root) {
|
|
|
27387
27658
|
};
|
|
27388
27659
|
}
|
|
27389
27660
|
function _check_offline_readiness() {
|
|
27390
|
-
const script =
|
|
27661
|
+
const script = path41.join(_package_root(), "src", "scripts", "hermetic-install.sh");
|
|
27391
27662
|
if (!pathExists(script)) {
|
|
27392
27663
|
return {
|
|
27393
27664
|
id: "offline-readiness",
|
|
@@ -27445,7 +27716,7 @@ function _check_stale_orphans() {
|
|
|
27445
27716
|
(a, b) => a < b ? -1 : a > b ? 1 : 0
|
|
27446
27717
|
);
|
|
27447
27718
|
for (const root_name of ownedSorted) {
|
|
27448
|
-
const root =
|
|
27719
|
+
const root = path41.join(anchor, root_name);
|
|
27449
27720
|
if (!isDir2(root)) {
|
|
27450
27721
|
continue;
|
|
27451
27722
|
}
|
|
@@ -27460,7 +27731,7 @@ function _check_stale_orphans() {
|
|
|
27460
27731
|
if (rel === null) {
|
|
27461
27732
|
continue;
|
|
27462
27733
|
}
|
|
27463
|
-
const relPosix2 = rel.split(
|
|
27734
|
+
const relPosix2 = rel.split(path41.sep).join("/");
|
|
27464
27735
|
if (recorded_set.has(relPosix2)) {
|
|
27465
27736
|
continue;
|
|
27466
27737
|
}
|
|
@@ -27509,14 +27780,14 @@ function _check_rule_scope_drift(project_root) {
|
|
|
27509
27780
|
let rules_dir = null;
|
|
27510
27781
|
let found = 0;
|
|
27511
27782
|
for (const rel of _RULE_PROJECTION_DIRS) {
|
|
27512
|
-
const cand =
|
|
27783
|
+
const cand = path41.join(project_root, rel);
|
|
27513
27784
|
if (!isDir2(cand)) {
|
|
27514
27785
|
continue;
|
|
27515
27786
|
}
|
|
27516
27787
|
let count = 0;
|
|
27517
27788
|
try {
|
|
27518
27789
|
for (const name of fs43.readdirSync(cand)) {
|
|
27519
|
-
if (name.endsWith(".md") && isFile3(
|
|
27790
|
+
if (name.endsWith(".md") && isFile3(path41.join(cand, name))) {
|
|
27520
27791
|
count += 1;
|
|
27521
27792
|
}
|
|
27522
27793
|
}
|
|
@@ -27570,14 +27841,14 @@ function _check_rule_scope_drift(project_root) {
|
|
|
27570
27841
|
};
|
|
27571
27842
|
}
|
|
27572
27843
|
function _check_duplicate_scope_rules(project_root, userRulesDirOverride) {
|
|
27573
|
-
const user_rules_dir = userRulesDirOverride ??
|
|
27844
|
+
const user_rules_dir = userRulesDirOverride ?? path41.join(os11.homedir(), ".claude", "rules");
|
|
27574
27845
|
let project_rules_dir = null;
|
|
27575
27846
|
if (_is_source_repo(project_root)) {
|
|
27576
|
-
const cand =
|
|
27847
|
+
const cand = path41.join(project_root, "dist", "agent-src", "rules");
|
|
27577
27848
|
if (isDir2(cand)) project_rules_dir = cand;
|
|
27578
27849
|
} else {
|
|
27579
27850
|
for (const rel of _RULE_PROJECTION_DIRS) {
|
|
27580
|
-
const cand =
|
|
27851
|
+
const cand = path41.join(project_root, rel);
|
|
27581
27852
|
if (isDir2(cand)) {
|
|
27582
27853
|
project_rules_dir = cand;
|
|
27583
27854
|
break;
|
|
@@ -27646,7 +27917,7 @@ function _check_mcp_beta_readiness(project_root) {
|
|
|
27646
27917
|
}
|
|
27647
27918
|
const pending = [];
|
|
27648
27919
|
for (const [gate_id, rel] of MCP_BETA_GATES) {
|
|
27649
|
-
if (!pathExists(
|
|
27920
|
+
if (!pathExists(path41.join(project_root, rel))) {
|
|
27650
27921
|
pending.push(`${gate_id} (${rel})`);
|
|
27651
27922
|
}
|
|
27652
27923
|
}
|
|
@@ -27667,7 +27938,7 @@ function _check_mcp_beta_readiness(project_root) {
|
|
|
27667
27938
|
}
|
|
27668
27939
|
function _check_tier_usage_readiness(project_root) {
|
|
27669
27940
|
const settings_file = project_settings_path(project_root);
|
|
27670
|
-
let log_path =
|
|
27941
|
+
let log_path = path41.join(project_root, ".agent-tier-usage.jsonl");
|
|
27671
27942
|
let enabled = false;
|
|
27672
27943
|
if (isFile3(settings_file)) {
|
|
27673
27944
|
let raw;
|
|
@@ -27686,7 +27957,7 @@ function _check_tier_usage_readiness(project_root) {
|
|
|
27686
27957
|
const outputRaw = tu["output"];
|
|
27687
27958
|
const output = typeof outputRaw === "object" && outputRaw !== null && !Array.isArray(outputRaw) ? outputRaw : {};
|
|
27688
27959
|
if (typeof output["path"] === "string" && output["path"].trim()) {
|
|
27689
|
-
log_path =
|
|
27960
|
+
log_path = path41.join(project_root, output["path"].trim());
|
|
27690
27961
|
}
|
|
27691
27962
|
const val = tu["enabled"];
|
|
27692
27963
|
if (typeof val === "boolean") {
|
|
@@ -27711,7 +27982,7 @@ function _check_tier_usage_readiness(project_root) {
|
|
|
27711
27982
|
return {
|
|
27712
27983
|
id: "tier-usage-readiness",
|
|
27713
27984
|
status: "warn",
|
|
27714
|
-
message: `tier-usage telemetry on but ${
|
|
27985
|
+
message: `tier-usage telemetry on but ${path41.basename(log_path)} not yet written \u2014 no signal accumulated`,
|
|
27715
27986
|
remedy: "run any tracked command to seed the log; the dispatcher writes one record per invocation"
|
|
27716
27987
|
};
|
|
27717
27988
|
}
|
|
@@ -27726,7 +27997,7 @@ function _check_tier_usage_readiness(project_root) {
|
|
|
27726
27997
|
return {
|
|
27727
27998
|
id: "tier-usage-readiness",
|
|
27728
27999
|
status: "fail",
|
|
27729
|
-
message: `cannot read ${
|
|
28000
|
+
message: `cannot read ${path41.basename(log_path)}: ${osErrorStr2(exc)}`,
|
|
27730
28001
|
remedy: "fix permissions on the tier-usage log"
|
|
27731
28002
|
};
|
|
27732
28003
|
}
|
|
@@ -27757,7 +28028,7 @@ function _check_tier_usage_readiness(project_root) {
|
|
|
27757
28028
|
return {
|
|
27758
28029
|
id: "tier-usage-readiness",
|
|
27759
28030
|
status: "fail",
|
|
27760
|
-
message: `${total} record(s) in ${
|
|
28031
|
+
message: `${total} record(s) in ${path41.basename(log_path)} but 0 passed the privacy floor \u2014 report would refuse to render`,
|
|
27761
28032
|
remedy: "inspect the log; the dispatcher is writing records the contract forbids (paths, argv, message bodies)"
|
|
27762
28033
|
};
|
|
27763
28034
|
}
|
|
@@ -27765,14 +28036,14 @@ function _check_tier_usage_readiness(project_root) {
|
|
|
27765
28036
|
return {
|
|
27766
28037
|
id: "tier-usage-readiness",
|
|
27767
28038
|
status: "warn",
|
|
27768
|
-
message: `${
|
|
28039
|
+
message: `${path41.basename(log_path)} present but empty \u2014 no signal yet`,
|
|
27769
28040
|
remedy: "run any tracked command to seed the log"
|
|
27770
28041
|
};
|
|
27771
28042
|
}
|
|
27772
28043
|
return {
|
|
27773
28044
|
id: "tier-usage-readiness",
|
|
27774
28045
|
status: "ok",
|
|
27775
|
-
message: `${valid} record(s) past the privacy floor in ${
|
|
28046
|
+
message: `${valid} record(s) past the privacy floor in ${path41.basename(log_path)} \u2014 retiering signal available`,
|
|
27776
28047
|
remedy: ""
|
|
27777
28048
|
};
|
|
27778
28049
|
}
|
|
@@ -28111,7 +28382,7 @@ function _check_team(project_root) {
|
|
|
28111
28382
|
if (binary_resolved === null) {
|
|
28112
28383
|
remedies.push("install the codex CLI: `npm install -g @openai/codex`");
|
|
28113
28384
|
}
|
|
28114
|
-
const auth_path =
|
|
28385
|
+
const auth_path = path41.join(_codex_home(), "auth.json");
|
|
28115
28386
|
const authed = pathExists(auth_path);
|
|
28116
28387
|
let auth_str;
|
|
28117
28388
|
if (!authed) {
|
|
@@ -28191,7 +28462,7 @@ function _check_unsupported_combos(manifest) {
|
|
|
28191
28462
|
};
|
|
28192
28463
|
}
|
|
28193
28464
|
function _wizard_state_path() {
|
|
28194
|
-
return
|
|
28465
|
+
return path41.join(event4u_root(), "state", "wizard-state.json");
|
|
28195
28466
|
}
|
|
28196
28467
|
function _check_wizard_state() {
|
|
28197
28468
|
const state_pth = _wizard_state_path();
|
|
@@ -28271,7 +28542,7 @@ function _check_wizard_state() {
|
|
|
28271
28542
|
};
|
|
28272
28543
|
}
|
|
28273
28544
|
function _check_settings_review_pending() {
|
|
28274
|
-
const delta_pth =
|
|
28545
|
+
const delta_pth = path41.join(event4u_root(), "state", "settings-delta.json");
|
|
28275
28546
|
if (!pathExists(delta_pth)) {
|
|
28276
28547
|
return {
|
|
28277
28548
|
id: "settings-review-pending",
|
|
@@ -28297,7 +28568,7 @@ function _check_settings_review_pending() {
|
|
|
28297
28568
|
}
|
|
28298
28569
|
function _check_memory_merge_union(project_root) {
|
|
28299
28570
|
const remedy = "run: npx tsx src/scripts/sync_gitattributes.ts (or `agent-config refresh --project`)";
|
|
28300
|
-
const target =
|
|
28571
|
+
const target = path41.join(project_root, DEFAULT_GITATTRIBUTES);
|
|
28301
28572
|
if (!pathExists(target)) {
|
|
28302
28573
|
return {
|
|
28303
28574
|
id: "memory-merge-union",
|
|
@@ -28859,13 +29130,13 @@ function _isCliEntry15() {
|
|
|
28859
29130
|
if (process15.argv[1] === void 0) {
|
|
28860
29131
|
return false;
|
|
28861
29132
|
}
|
|
28862
|
-
const argvUrl = pathToFileURL15(
|
|
29133
|
+
const argvUrl = pathToFileURL15(path41.resolve(process15.argv[1])).href;
|
|
28863
29134
|
if (import.meta.url === argvUrl) {
|
|
28864
29135
|
return true;
|
|
28865
29136
|
}
|
|
28866
29137
|
try {
|
|
28867
|
-
const here = fs43.realpathSync(
|
|
28868
|
-
const argv = fs43.realpathSync(
|
|
29138
|
+
const here = fs43.realpathSync(fileURLToPath24(import.meta.url));
|
|
29139
|
+
const argv = fs43.realpathSync(path41.resolve(process15.argv[1]));
|
|
28869
29140
|
return here === argv;
|
|
28870
29141
|
} catch {
|
|
28871
29142
|
return false;
|
|
@@ -28893,7 +29164,7 @@ var init_cmd_doctor = __esm({
|
|
|
28893
29164
|
init_review_gate();
|
|
28894
29165
|
init_package_root();
|
|
28895
29166
|
init_rule_scope();
|
|
28896
|
-
_HERE12 =
|
|
29167
|
+
_HERE12 = fileURLToPath24(import.meta.url);
|
|
28897
29168
|
ArgparseExit4 = class extends Error {
|
|
28898
29169
|
constructor(code) {
|
|
28899
29170
|
super(`argparse-exit-${code}`);
|
|
@@ -29073,9 +29344,9 @@ function detectToolPresence(root) {
|
|
|
29073
29344
|
agentsMd: existsSync20(join39(root, "AGENTS.md"))
|
|
29074
29345
|
};
|
|
29075
29346
|
}
|
|
29076
|
-
function isDir3(
|
|
29347
|
+
function isDir3(path50) {
|
|
29077
29348
|
try {
|
|
29078
|
-
return statSync28(
|
|
29349
|
+
return statSync28(path50).isDirectory();
|
|
29079
29350
|
} catch {
|
|
29080
29351
|
return false;
|
|
29081
29352
|
}
|
|
@@ -29108,10 +29379,10 @@ __export(cmd_conformance_exports, {
|
|
|
29108
29379
|
});
|
|
29109
29380
|
import * as fs44 from "node:fs";
|
|
29110
29381
|
import * as os12 from "node:os";
|
|
29111
|
-
import * as
|
|
29382
|
+
import * as path42 from "node:path";
|
|
29112
29383
|
import process16 from "node:process";
|
|
29113
|
-
import { spawnSync as
|
|
29114
|
-
import { fileURLToPath as
|
|
29384
|
+
import { spawnSync as spawnSync9 } from "node:child_process";
|
|
29385
|
+
import { fileURLToPath as fileURLToPath25, pathToFileURL as pathToFileURL16 } from "node:url";
|
|
29115
29386
|
function print2(s = "") {
|
|
29116
29387
|
process16.stdout.write(`${s}
|
|
29117
29388
|
`);
|
|
@@ -29125,14 +29396,14 @@ function conformanceLogPath() {
|
|
|
29125
29396
|
if (override && override.trim().length > 0) {
|
|
29126
29397
|
return override;
|
|
29127
29398
|
}
|
|
29128
|
-
return
|
|
29399
|
+
return path42.join(os12.homedir(), ".event4u", "agent-config", "conformance-log.jsonl");
|
|
29129
29400
|
}
|
|
29130
29401
|
function installLogPath() {
|
|
29131
29402
|
const override = process16.env["AGENT_CONFIG_INSTALL_LOG"];
|
|
29132
29403
|
if (override && override.trim().length > 0) {
|
|
29133
29404
|
return override;
|
|
29134
29405
|
}
|
|
29135
|
-
return
|
|
29406
|
+
return path42.join(os12.homedir(), ".event4u", "agent-config", "install-log.jsonl");
|
|
29136
29407
|
}
|
|
29137
29408
|
function _check_txlog_clean(logPath = installLogPath()) {
|
|
29138
29409
|
if (!fs44.existsSync(logPath)) {
|
|
@@ -29176,22 +29447,22 @@ function routeTargetPaths(target) {
|
|
|
29176
29447
|
if (!id) return [];
|
|
29177
29448
|
switch (kind) {
|
|
29178
29449
|
case "skill":
|
|
29179
|
-
return [
|
|
29450
|
+
return [path42.join("dist", "agent-src", "skills", id, "SKILL.md")];
|
|
29180
29451
|
case "command":
|
|
29181
|
-
return [
|
|
29452
|
+
return [path42.join("dist", "agent-src", "commands", `${id}.md`)];
|
|
29182
29453
|
case "guideline":
|
|
29183
|
-
return [
|
|
29454
|
+
return [path42.join("docs", "guidelines", `${id}.md`)];
|
|
29184
29455
|
case "contract":
|
|
29185
29456
|
return [
|
|
29186
|
-
|
|
29187
|
-
|
|
29457
|
+
path42.join("docs", "contracts", `${id}.md`),
|
|
29458
|
+
path42.join("dist", "agent-src", "contexts", "contracts", `${id}.md`)
|
|
29188
29459
|
];
|
|
29189
29460
|
default:
|
|
29190
29461
|
return [];
|
|
29191
29462
|
}
|
|
29192
29463
|
}
|
|
29193
29464
|
function _check_router_pointers(packageRoot = PACKAGE_ROOT2) {
|
|
29194
|
-
const routerPath =
|
|
29465
|
+
const routerPath = path42.join(packageRoot, "dist", "router.json");
|
|
29195
29466
|
if (!fs44.existsSync(routerPath)) {
|
|
29196
29467
|
return {
|
|
29197
29468
|
id: "router-pointers",
|
|
@@ -29211,13 +29482,13 @@ function _check_router_pointers(packageRoot = PACKAGE_ROOT2) {
|
|
|
29211
29482
|
remedy: "reinstall the package \u2014 dist/router.json is corrupt"
|
|
29212
29483
|
};
|
|
29213
29484
|
}
|
|
29214
|
-
const rulesDir =
|
|
29485
|
+
const rulesDir = path42.join(packageRoot, "dist", "agent-src", "rules");
|
|
29215
29486
|
const broken = [];
|
|
29216
29487
|
let ids = 0;
|
|
29217
29488
|
let targets = 0;
|
|
29218
29489
|
for (const kernelId of router["kernel"] ?? []) {
|
|
29219
29490
|
ids += 1;
|
|
29220
|
-
if (!fs44.existsSync(
|
|
29491
|
+
if (!fs44.existsSync(path42.join(rulesDir, `${kernelId}.md`))) {
|
|
29221
29492
|
broken.push(`kernel:${kernelId} \u2192 rules/${kernelId}.md missing`);
|
|
29222
29493
|
}
|
|
29223
29494
|
}
|
|
@@ -29225,7 +29496,7 @@ function _check_router_pointers(packageRoot = PACKAGE_ROOT2) {
|
|
|
29225
29496
|
for (const entry of router[tier] ?? []) {
|
|
29226
29497
|
const ruleId = String(entry["id"] ?? "");
|
|
29227
29498
|
ids += 1;
|
|
29228
|
-
if (!fs44.existsSync(
|
|
29499
|
+
if (!fs44.existsSync(path42.join(rulesDir, `${ruleId}.md`))) {
|
|
29229
29500
|
broken.push(`${tier}:${ruleId} \u2192 rules/${ruleId}.md missing`);
|
|
29230
29501
|
}
|
|
29231
29502
|
for (const target of entry["routes_to"] ?? []) {
|
|
@@ -29235,7 +29506,7 @@ function _check_router_pointers(packageRoot = PACKAGE_ROOT2) {
|
|
|
29235
29506
|
broken.push(`${ruleId} \u2192 unparseable routes_to ${JSON.stringify(target)}`);
|
|
29236
29507
|
continue;
|
|
29237
29508
|
}
|
|
29238
|
-
if (!candidates.some((rel) => fs44.existsSync(
|
|
29509
|
+
if (!candidates.some((rel) => fs44.existsSync(path42.join(packageRoot, rel)))) {
|
|
29239
29510
|
broken.push(`${ruleId} \u2192 ${target} (${candidates[0]} missing)`);
|
|
29240
29511
|
}
|
|
29241
29512
|
}
|
|
@@ -29267,8 +29538,8 @@ function detectSmokePlatform(projectRoot) {
|
|
|
29267
29538
|
return "claude";
|
|
29268
29539
|
}
|
|
29269
29540
|
function dispatcherRunner(packageRoot) {
|
|
29270
|
-
const localTsx =
|
|
29271
|
-
const script =
|
|
29541
|
+
const localTsx = path42.join(packageRoot, "node_modules", ".bin", "tsx");
|
|
29542
|
+
const script = path42.join(packageRoot, "src", "scripts", "hooks", "dispatch_hook.ts");
|
|
29272
29543
|
if (fs44.existsSync(localTsx)) {
|
|
29273
29544
|
return [localTsx, script];
|
|
29274
29545
|
}
|
|
@@ -29286,7 +29557,7 @@ function _check_hook_dispatcher(projectRoot, packageRoot = PACKAGE_ROOT2, opts =
|
|
|
29286
29557
|
...event === "stop" ? { stop_reason: "conformance-smoke" } : { source: "startup" }
|
|
29287
29558
|
});
|
|
29288
29559
|
const argv = [...runner, "--platform", platform, "--event", event];
|
|
29289
|
-
const proc =
|
|
29560
|
+
const proc = spawnSync9(argv[0], argv.slice(1), {
|
|
29290
29561
|
input: payload,
|
|
29291
29562
|
cwd: projectRoot,
|
|
29292
29563
|
encoding: "utf8",
|
|
@@ -29319,7 +29590,7 @@ function _check_hook_dispatcher(projectRoot, packageRoot = PACKAGE_ROOT2, opts =
|
|
|
29319
29590
|
};
|
|
29320
29591
|
}
|
|
29321
29592
|
function readSettingsMode(projectRoot) {
|
|
29322
|
-
const settingsPath =
|
|
29593
|
+
const settingsPath = path42.join(projectRoot, ".agent-settings.yml");
|
|
29323
29594
|
if (!fs44.existsSync(settingsPath)) {
|
|
29324
29595
|
return "eager-all";
|
|
29325
29596
|
}
|
|
@@ -29335,7 +29606,7 @@ function readSettingsMode(projectRoot) {
|
|
|
29335
29606
|
function kernelIdsFromRouter(packageRoot) {
|
|
29336
29607
|
try {
|
|
29337
29608
|
const router = JSON.parse(
|
|
29338
|
-
fs44.readFileSync(
|
|
29609
|
+
fs44.readFileSync(path42.join(packageRoot, "dist", "router.json"), "utf8")
|
|
29339
29610
|
);
|
|
29340
29611
|
return new Set((router["kernel"] ?? []).map(String));
|
|
29341
29612
|
} catch {
|
|
@@ -29352,7 +29623,7 @@ function _check_lean_projection(projectRoot, packageRoot = PACKAGE_ROOT2, projec
|
|
|
29352
29623
|
remedy: "set lean_projection.mode to 'eager-all' or 'thin' in .agent-settings.yml"
|
|
29353
29624
|
};
|
|
29354
29625
|
}
|
|
29355
|
-
const rulesDir = projectedRulesDir ??
|
|
29626
|
+
const rulesDir = projectedRulesDir ?? path42.join(projectRoot, ".augment", "rules");
|
|
29356
29627
|
if (!fs44.existsSync(rulesDir)) {
|
|
29357
29628
|
return {
|
|
29358
29629
|
id: "lean-projection",
|
|
@@ -29376,7 +29647,7 @@ function _check_lean_projection(projectRoot, packageRoot = PACKAGE_ROOT2, projec
|
|
|
29376
29647
|
for (const f of nonKernel) {
|
|
29377
29648
|
let text = "";
|
|
29378
29649
|
try {
|
|
29379
|
-
text = fs44.readFileSync(
|
|
29650
|
+
text = fs44.readFileSync(path42.join(rulesDir, f), "utf8");
|
|
29380
29651
|
} catch {
|
|
29381
29652
|
continue;
|
|
29382
29653
|
}
|
|
@@ -29407,7 +29678,7 @@ function _check_lean_projection(projectRoot, packageRoot = PACKAGE_ROOT2, projec
|
|
|
29407
29678
|
function _check_host_manifest(projectRoot) {
|
|
29408
29679
|
const detected = Object.entries(detectToolPresence(projectRoot)).filter(([, v]) => v === true).map(([k]) => k);
|
|
29409
29680
|
const detectedNote = detected.length > 0 ? `detected surfaces: ${detected.join(", ")}` : "no surfaces detected";
|
|
29410
|
-
const settingsPath =
|
|
29681
|
+
const settingsPath = path42.join(projectRoot, ".agent-settings.yml");
|
|
29411
29682
|
if (!fs44.existsSync(settingsPath)) {
|
|
29412
29683
|
return {
|
|
29413
29684
|
id: "host-manifest",
|
|
@@ -29615,13 +29886,13 @@ function _isCliEntry16() {
|
|
|
29615
29886
|
if (process16.argv[1] === void 0) {
|
|
29616
29887
|
return false;
|
|
29617
29888
|
}
|
|
29618
|
-
const argvUrl = pathToFileURL16(
|
|
29889
|
+
const argvUrl = pathToFileURL16(path42.resolve(process16.argv[1])).href;
|
|
29619
29890
|
if (import.meta.url === argvUrl) {
|
|
29620
29891
|
return true;
|
|
29621
29892
|
}
|
|
29622
29893
|
try {
|
|
29623
|
-
const here = fs44.realpathSync(
|
|
29624
|
-
const argv = fs44.realpathSync(
|
|
29894
|
+
const here = fs44.realpathSync(fileURLToPath25(import.meta.url));
|
|
29895
|
+
const argv = fs44.realpathSync(path42.resolve(process16.argv[1]));
|
|
29625
29896
|
return here === argv;
|
|
29626
29897
|
} catch {
|
|
29627
29898
|
return false;
|
|
@@ -29638,7 +29909,7 @@ var init_cmd_conformance = __esm({
|
|
|
29638
29909
|
init_detect();
|
|
29639
29910
|
init_package_root();
|
|
29640
29911
|
init_cmd_doctor();
|
|
29641
|
-
_HERE13 =
|
|
29912
|
+
_HERE13 = fileURLToPath25(import.meta.url);
|
|
29642
29913
|
PACKAGE_ROOT2 = resolvePackageRoot(import.meta.url);
|
|
29643
29914
|
CONFORMANCE_CHECK_IDS = [
|
|
29644
29915
|
"txlog-clean",
|
|
@@ -31514,7 +31785,7 @@ not. Cite the peer-reviewer label and the targeted response label
|
|
|
31514
31785
|
|
|
31515
31786
|
// src/scripts/ai_council/advisors.ts
|
|
31516
31787
|
import * as fs48 from "node:fs";
|
|
31517
|
-
import * as
|
|
31788
|
+
import * as path43 from "node:path";
|
|
31518
31789
|
function _split_frontmatter(raw) {
|
|
31519
31790
|
const match = _FRONTMATTER_RE2.exec(raw);
|
|
31520
31791
|
if (!match) {
|
|
@@ -31542,8 +31813,8 @@ function _display_name_from(advisor_name, frontmatter) {
|
|
|
31542
31813
|
}
|
|
31543
31814
|
function resolve_persona_text(persona_path, repo_root) {
|
|
31544
31815
|
const candidates = [
|
|
31545
|
-
|
|
31546
|
-
|
|
31816
|
+
path43.join(repo_root, "dist/agent-src", persona_path),
|
|
31817
|
+
path43.join(repo_root, ".agent-src.uncondensed", persona_path)
|
|
31547
31818
|
];
|
|
31548
31819
|
for (const candidate of candidates) {
|
|
31549
31820
|
if (fs48.existsSync(candidate)) {
|
|
@@ -33057,7 +33328,7 @@ var init_necessity = __esm({
|
|
|
33057
33328
|
|
|
33058
33329
|
// src/scripts/ai_council/budget_guard.ts
|
|
33059
33330
|
import * as fs50 from "node:fs";
|
|
33060
|
-
import * as
|
|
33331
|
+
import * as path44 from "node:path";
|
|
33061
33332
|
function _resolveLedgerPath(p) {
|
|
33062
33333
|
if (p !== null) {
|
|
33063
33334
|
return p;
|
|
@@ -33072,7 +33343,7 @@ function _nowUtcMs() {
|
|
|
33072
33343
|
return Date.now();
|
|
33073
33344
|
}
|
|
33074
33345
|
function _ensureLedgerDir(p) {
|
|
33075
|
-
const parent =
|
|
33346
|
+
const parent = path44.dirname(p);
|
|
33076
33347
|
try {
|
|
33077
33348
|
fs50.mkdirSync(parent, { recursive: true });
|
|
33078
33349
|
let mode;
|
|
@@ -33878,7 +34149,7 @@ __export(pricing_exports, {
|
|
|
33878
34149
|
CACHE_WRITE_MULTIPLIER_5M: () => CACHE_WRITE_MULTIPLIER_5M,
|
|
33879
34150
|
DEFAULT_PRICES: () => DEFAULT_PRICES,
|
|
33880
34151
|
PRICES_FILE: () => PRICES_FILE,
|
|
33881
|
-
REPO_ROOT: () =>
|
|
34152
|
+
REPO_ROOT: () => REPO_ROOT2,
|
|
33882
34153
|
_render_markdown: () => _render_markdown,
|
|
33883
34154
|
as_rows: () => as_rows,
|
|
33884
34155
|
bootstrap_from_defaults: () => bootstrap_from_defaults,
|
|
@@ -33893,10 +34164,10 @@ __export(pricing_exports, {
|
|
|
33893
34164
|
reprice_with_cache: () => reprice_with_cache
|
|
33894
34165
|
});
|
|
33895
34166
|
import * as fs51 from "node:fs";
|
|
33896
|
-
import * as
|
|
33897
|
-
import { fileURLToPath as
|
|
34167
|
+
import * as path45 from "node:path";
|
|
34168
|
+
import { fileURLToPath as fileURLToPath26 } from "node:url";
|
|
33898
34169
|
function prices_file_for(repo_root) {
|
|
33899
|
-
return
|
|
34170
|
+
return path45.join(repo_root, "agents", "runtime", ".agent-prices.md");
|
|
33900
34171
|
}
|
|
33901
34172
|
function lookup(table, provider, model) {
|
|
33902
34173
|
return table.prices.get(priceKey(provider, model)) ?? null;
|
|
@@ -33996,7 +34267,7 @@ function load_prices(p = PRICES_FILE) {
|
|
|
33996
34267
|
return _parse4(fs51.readFileSync(p, "utf-8"));
|
|
33997
34268
|
}
|
|
33998
34269
|
function bootstrap_from_defaults(p = PRICES_FILE) {
|
|
33999
|
-
fs51.mkdirSync(
|
|
34270
|
+
fs51.mkdirSync(path45.dirname(p), { recursive: true });
|
|
34000
34271
|
const rows = as_rows();
|
|
34001
34272
|
const body = _render_markdown(LAST_UPDATED, "shipped-default", rows);
|
|
34002
34273
|
fs51.writeFileSync(p, body, "utf-8");
|
|
@@ -34116,14 +34387,14 @@ function _pyFloat2(s) {
|
|
|
34116
34387
|
const n = Number(t);
|
|
34117
34388
|
return Number.isNaN(n) ? null : n;
|
|
34118
34389
|
}
|
|
34119
|
-
var _HERE14,
|
|
34390
|
+
var _HERE14, REPO_ROOT2, PRICES_FILE, _CHARS_PER_TOKEN, CACHE_READ_MULTIPLIER, CACHE_WRITE_MULTIPLIER_5M, CACHE_WRITE_MULTIPLIER_1H;
|
|
34120
34391
|
var init_pricing = __esm({
|
|
34121
34392
|
"src/scripts/ai_council/pricing.ts"() {
|
|
34122
34393
|
"use strict";
|
|
34123
34394
|
init_default_prices();
|
|
34124
|
-
_HERE14 =
|
|
34125
|
-
|
|
34126
|
-
PRICES_FILE =
|
|
34395
|
+
_HERE14 = fileURLToPath26(import.meta.url);
|
|
34396
|
+
REPO_ROOT2 = path45.resolve(path45.dirname(_HERE14), "..", "..", "..");
|
|
34397
|
+
PRICES_FILE = path45.join(REPO_ROOT2, "agents", "runtime", ".agent-prices.md");
|
|
34127
34398
|
_CHARS_PER_TOKEN = 4;
|
|
34128
34399
|
CACHE_READ_MULTIPLIER = 0.1;
|
|
34129
34400
|
CACHE_WRITE_MULTIPLIER_5M = 1.25;
|
|
@@ -34215,7 +34486,7 @@ function tally_stances(members) {
|
|
|
34215
34486
|
}
|
|
34216
34487
|
parsed.push({ member, ...p });
|
|
34217
34488
|
}
|
|
34218
|
-
const w_total = parsed.length;
|
|
34489
|
+
const w_total = parsed.length + needs_repair.length;
|
|
34219
34490
|
const threshold = CONSENSUS_FRACTION * w_total;
|
|
34220
34491
|
let abstain_count = 0;
|
|
34221
34492
|
const byLabel = /* @__PURE__ */ new Map();
|
|
@@ -34263,6 +34534,11 @@ function render_vote_tally(result) {
|
|
|
34263
34534
|
if (result.abstain_count > 0) {
|
|
34264
34535
|
lines.push(`- abstain \u2014 ${result.abstain_count} member(s) (raises the bar)`);
|
|
34265
34536
|
}
|
|
34537
|
+
if (result.needs_repair.length > 0) {
|
|
34538
|
+
lines.push(
|
|
34539
|
+
`- unparsed \u2014 ${result.needs_repair.length} member(s) responded without a readable stance (${result.needs_repair.join(", ")}); counted in the quorum, backing nothing`
|
|
34540
|
+
);
|
|
34541
|
+
}
|
|
34266
34542
|
lines.push(`Threshold: \u2154 \xD7 ${result.w_total} = ${result.threshold.toFixed(2)}`);
|
|
34267
34543
|
lines.push(
|
|
34268
34544
|
result.consensus !== null ? `Cleared: ${result.consensus.label} (${result.consensus.weight.toFixed(2)})` : "Escalated: no option cleared the threshold \u2014 the split is returned to the user, not forced."
|
|
@@ -35659,7 +35935,7 @@ __export(project_context_exports, {
|
|
|
35659
35935
|
detect_project_context: () => detect_project_context
|
|
35660
35936
|
});
|
|
35661
35937
|
import * as fs52 from "node:fs";
|
|
35662
|
-
import * as
|
|
35938
|
+
import * as path46 from "node:path";
|
|
35663
35939
|
function _isPlainObject11(v) {
|
|
35664
35940
|
return typeof v === "object" && v !== null && !Array.isArray(v);
|
|
35665
35941
|
}
|
|
@@ -35691,7 +35967,7 @@ function _name_from(composer, pkg, root) {
|
|
|
35691
35967
|
}
|
|
35692
35968
|
}
|
|
35693
35969
|
try {
|
|
35694
|
-
const base =
|
|
35970
|
+
const base = path46.basename(root);
|
|
35695
35971
|
return base || null;
|
|
35696
35972
|
} catch {
|
|
35697
35973
|
return null;
|
|
@@ -35849,13 +36125,13 @@ function _rfind(haystack, needle) {
|
|
|
35849
36125
|
return -1;
|
|
35850
36126
|
}
|
|
35851
36127
|
function detect_project_context(root) {
|
|
35852
|
-
const resolvedRoot =
|
|
35853
|
-
const composer = _read_json(
|
|
35854
|
-
const pkg = _read_json(
|
|
36128
|
+
const resolvedRoot = path46.resolve(root ?? process.cwd());
|
|
36129
|
+
const composer = _read_json(path46.join(resolvedRoot, "composer.json"));
|
|
36130
|
+
const pkg = _read_json(path46.join(resolvedRoot, "package.json"));
|
|
35855
36131
|
return new ProjectContext(
|
|
35856
36132
|
_name_from(composer, pkg, resolvedRoot),
|
|
35857
36133
|
_stack_from(composer, pkg),
|
|
35858
|
-
_purpose_from_readme(
|
|
36134
|
+
_purpose_from_readme(path46.join(resolvedRoot, "README.md"))
|
|
35859
36135
|
);
|
|
35860
36136
|
}
|
|
35861
36137
|
var REPO_PURPOSE_MAX_CHARS, _HEADING_RE, _BADGE_RE, _HTML_RE, ProjectContext;
|
|
@@ -37107,8 +37383,8 @@ __export(council_cli_exports, {
|
|
|
37107
37383
|
main: () => main17
|
|
37108
37384
|
});
|
|
37109
37385
|
import * as fs54 from "node:fs";
|
|
37110
|
-
import * as
|
|
37111
|
-
import { fileURLToPath as
|
|
37386
|
+
import * as path47 from "node:path";
|
|
37387
|
+
import { fileURLToPath as fileURLToPath27, pathToFileURL as pathToFileURL17 } from "node:url";
|
|
37112
37388
|
function _pyFixed6(x, ndigits) {
|
|
37113
37389
|
if (!Number.isFinite(x)) {
|
|
37114
37390
|
return String(x);
|
|
@@ -37835,8 +38111,8 @@ function _maybe_write_decision_replay(opts) {
|
|
|
37835
38111
|
include_member_arguments: include_args
|
|
37836
38112
|
})
|
|
37837
38113
|
);
|
|
37838
|
-
const target =
|
|
37839
|
-
fs54.mkdirSync(
|
|
38114
|
+
const target = path47.join(path47.dirname(opts.out_path), "decision-replay.md");
|
|
38115
|
+
fs54.mkdirSync(path47.dirname(target), { recursive: true });
|
|
37840
38116
|
fs54.writeFileSync(target, replay, { encoding: "utf-8" });
|
|
37841
38117
|
return target;
|
|
37842
38118
|
}
|
|
@@ -38028,7 +38304,7 @@ function cmd_estimate(args, opts = {}) {
|
|
|
38028
38304
|
settings = load_settings();
|
|
38029
38305
|
}
|
|
38030
38306
|
const ai_cfg = _isDict3(settings) ? settings["ai_council"] || {} : {};
|
|
38031
|
-
const advisor_plans = _build_advisor_plans(ai_cfg,
|
|
38307
|
+
const advisor_plans = _build_advisor_plans(ai_cfg, REPO_ROOT3);
|
|
38032
38308
|
const explicit_overrides = _parse_model_overrides(_getattr3(args, "model", null));
|
|
38033
38309
|
const skipped = [];
|
|
38034
38310
|
if (members === null) {
|
|
@@ -38040,7 +38316,7 @@ function cmd_estimate(args, opts = {}) {
|
|
|
38040
38316
|
});
|
|
38041
38317
|
}
|
|
38042
38318
|
if (table === null) {
|
|
38043
|
-
table = load_prices(prices_file_for(
|
|
38319
|
+
table = load_prices(prices_file_for(REPO_ROOT3));
|
|
38044
38320
|
}
|
|
38045
38321
|
const [question] = build_question({
|
|
38046
38322
|
input_path: args.question,
|
|
@@ -38048,7 +38324,7 @@ function cmd_estimate(args, opts = {}) {
|
|
|
38048
38324
|
max_tokens: _resolve_max_tokens(args, ai_cfg),
|
|
38049
38325
|
prompt_mode_override: _getattr3(args, "prompt_mode", null)
|
|
38050
38326
|
});
|
|
38051
|
-
const project = detect_project_context(
|
|
38327
|
+
const project = detect_project_context(REPO_ROOT3);
|
|
38052
38328
|
const billable = members.filter((m) => _getattr3(m, "billable", true));
|
|
38053
38329
|
const estimates = estimate(question, billable, table, {
|
|
38054
38330
|
project,
|
|
@@ -38507,7 +38783,7 @@ function cmd_run(args, opts = {}) {
|
|
|
38507
38783
|
_isDict3(settings) ? settings["ai_council"] || {} : {},
|
|
38508
38784
|
_resolved_chairman_override(_getattr3(args, "chairman", null))
|
|
38509
38785
|
);
|
|
38510
|
-
const advisor_plans = _build_advisor_plans(ai_cfg,
|
|
38786
|
+
const advisor_plans = _build_advisor_plans(ai_cfg, REPO_ROOT3);
|
|
38511
38787
|
const explicit_overrides = _parse_model_overrides(_getattr3(args, "model", null));
|
|
38512
38788
|
const skipped = [];
|
|
38513
38789
|
if (members === null) {
|
|
@@ -38527,7 +38803,7 @@ function cmd_run(args, opts = {}) {
|
|
|
38527
38803
|
_emit_shadow_slo_banner();
|
|
38528
38804
|
}
|
|
38529
38805
|
if (table === null) {
|
|
38530
|
-
table = load_prices(prices_file_for(
|
|
38806
|
+
table = load_prices(prices_file_for(REPO_ROOT3));
|
|
38531
38807
|
}
|
|
38532
38808
|
const [question, artefact] = build_question({
|
|
38533
38809
|
input_path: args.question,
|
|
@@ -38554,7 +38830,7 @@ function cmd_run(args, opts = {}) {
|
|
|
38554
38830
|
rounds: _getattr3(args, "rounds", 1),
|
|
38555
38831
|
price_table: table
|
|
38556
38832
|
});
|
|
38557
|
-
const project = detect_project_context(
|
|
38833
|
+
const project = detect_project_context(REPO_ROOT3);
|
|
38558
38834
|
const billable = members.filter((m) => _getattr3(m, "billable", true));
|
|
38559
38835
|
const estimates = estimate(question, billable, table, {
|
|
38560
38836
|
project,
|
|
@@ -38727,7 +39003,7 @@ function cmd_run(args, opts = {}) {
|
|
|
38727
39003
|
kind: "responses",
|
|
38728
39004
|
subcommand: "run"
|
|
38729
39005
|
});
|
|
38730
|
-
fs54.mkdirSync(
|
|
39006
|
+
fs54.mkdirSync(path47.dirname(_resolveTarget(out_path)), { recursive: true });
|
|
38731
39007
|
fs54.writeFileSync(_resolveTarget(out_path), _jsonDumpsIndent22(payload) + "\n", { encoding: "utf-8" });
|
|
38732
39008
|
_stdout2(
|
|
38733
39009
|
`
|
|
@@ -38777,7 +39053,7 @@ function _write_debate_round(out_dir, round_number, responses, opts) {
|
|
|
38777
39053
|
prompt_cache_round_gap_ms: opts.cache_gap_ms_since_previous_round ?? null,
|
|
38778
39054
|
responses: _serialise_responses(responses)
|
|
38779
39055
|
};
|
|
38780
|
-
const out_path =
|
|
39056
|
+
const out_path = path47.join(_resolveTarget(out_dir), _debate_round_filename(round_number));
|
|
38781
39057
|
fs54.writeFileSync(out_path, _jsonDumpsIndent22(payload) + "\n", { encoding: "utf-8" });
|
|
38782
39058
|
return out_path;
|
|
38783
39059
|
}
|
|
@@ -38845,7 +39121,7 @@ function cmd_debate(args, opts = {}) {
|
|
|
38845
39121
|
settings = load_settings();
|
|
38846
39122
|
}
|
|
38847
39123
|
const ai_cfg = _isDict3(settings) ? settings["ai_council"] || {} : {};
|
|
38848
|
-
const advisor_plans = _build_advisor_plans(ai_cfg,
|
|
39124
|
+
const advisor_plans = _build_advisor_plans(ai_cfg, REPO_ROOT3);
|
|
38849
39125
|
const explicit_overrides = _parse_model_overrides(_getattr3(args, "model", null));
|
|
38850
39126
|
const skipped = [];
|
|
38851
39127
|
if (members === null) {
|
|
@@ -38857,7 +39133,7 @@ function cmd_debate(args, opts = {}) {
|
|
|
38857
39133
|
});
|
|
38858
39134
|
}
|
|
38859
39135
|
if (table === null) {
|
|
38860
|
-
table = load_prices(prices_file_for(
|
|
39136
|
+
table = load_prices(prices_file_for(REPO_ROOT3));
|
|
38861
39137
|
}
|
|
38862
39138
|
const [question, artefact] = build_question({
|
|
38863
39139
|
input_path: args.question,
|
|
@@ -38877,7 +39153,7 @@ function cmd_debate(args, opts = {}) {
|
|
|
38877
39153
|
return gate_exit;
|
|
38878
39154
|
}
|
|
38879
39155
|
_size_fit_gate({ prompt: question.user_prompt, lens: "debate", members, ai_cfg });
|
|
38880
|
-
const project = detect_project_context(
|
|
39156
|
+
const project = detect_project_context(REPO_ROOT3);
|
|
38881
39157
|
const billable = members.filter((m) => _getattr3(m, "billable", true));
|
|
38882
39158
|
const max_rounds_cap = _pyInt6(ai_cfg["debate_max_rounds"] ?? 4, 4);
|
|
38883
39159
|
const requested = _getattr3(args, "rounds", null) !== null ? _pyInt6(args.rounds) : 2;
|
|
@@ -39083,7 +39359,7 @@ function cmd_render(args) {
|
|
|
39083
39359
|
kind: "sessions",
|
|
39084
39360
|
subcommand: "render"
|
|
39085
39361
|
});
|
|
39086
|
-
fs54.mkdirSync(
|
|
39362
|
+
fs54.mkdirSync(path47.dirname(_resolveTarget(out_path)), { recursive: true });
|
|
39087
39363
|
fs54.writeFileSync(_resolveTarget(out_path), body + "\n", { encoding: "utf-8" });
|
|
39088
39364
|
_stdout2(`council:render \xB7 wrote ${out_path}
|
|
39089
39365
|
`);
|
|
@@ -39095,7 +39371,7 @@ function cmd_render(args) {
|
|
|
39095
39371
|
function _cmd_replay_low_impact_stats(args) {
|
|
39096
39372
|
const li = low_impact_exports;
|
|
39097
39373
|
const responses_path = args.responses;
|
|
39098
|
-
const log_path =
|
|
39374
|
+
const log_path = path47.join(path47.dirname(responses_path), "low-impact-resolutions.md");
|
|
39099
39375
|
if (!fs54.existsSync(log_path)) {
|
|
39100
39376
|
_stdout2(
|
|
39101
39377
|
`council:replay \xB7 no low-impact-resolutions.md alongside ${responses_path} \u2014 session had no fast-path entries.
|
|
@@ -39111,7 +39387,7 @@ function _cmd_replay_low_impact_stats(args) {
|
|
|
39111
39387
|
kind: "sessions",
|
|
39112
39388
|
subcommand: "replay"
|
|
39113
39389
|
});
|
|
39114
|
-
fs54.mkdirSync(
|
|
39390
|
+
fs54.mkdirSync(path47.dirname(_resolveTarget(target)), { recursive: true });
|
|
39115
39391
|
fs54.writeFileSync(_resolveTarget(target), out, { encoding: "utf-8" });
|
|
39116
39392
|
_stdout2(`council:replay \xB7 wrote ${target}
|
|
39117
39393
|
`);
|
|
@@ -39149,7 +39425,7 @@ function cmd_replay(args) {
|
|
|
39149
39425
|
kind: "sessions",
|
|
39150
39426
|
subcommand: "replay"
|
|
39151
39427
|
});
|
|
39152
|
-
fs54.mkdirSync(
|
|
39428
|
+
fs54.mkdirSync(path47.dirname(_resolveTarget(out_path)), { recursive: true });
|
|
39153
39429
|
fs54.writeFileSync(_resolveTarget(out_path), body, { encoding: "utf-8" });
|
|
39154
39430
|
_stdout2(`council:replay \xB7 wrote ${out_path}
|
|
39155
39431
|
`);
|
|
@@ -39207,8 +39483,8 @@ function cmd_quota(args, opts = {}) {
|
|
|
39207
39483
|
}
|
|
39208
39484
|
function _validate_council_output_path(path_str, opts) {
|
|
39209
39485
|
const expected_rel = COUNCIL_CANONICAL_DIRS[opts.kind];
|
|
39210
|
-
const expected_abs = _resolveReal(
|
|
39211
|
-
const target =
|
|
39486
|
+
const expected_abs = _resolveReal(path47.join(REPO_ROOT3, expected_rel));
|
|
39487
|
+
const target = path47.isAbsolute(path_str) ? path_str : path47.join(REPO_ROOT3, path_str);
|
|
39212
39488
|
const target_resolved = _resolveReal(target);
|
|
39213
39489
|
if (!_isRelativeTo(target_resolved, expected_abs)) {
|
|
39214
39490
|
throw new ArgumentTypeError(
|
|
@@ -39218,10 +39494,10 @@ function _validate_council_output_path(path_str, opts) {
|
|
|
39218
39494
|
return path_str;
|
|
39219
39495
|
}
|
|
39220
39496
|
function _resolveTarget(path_str) {
|
|
39221
|
-
return
|
|
39497
|
+
return path47.isAbsolute(path_str) ? path_str : path47.join(REPO_ROOT3, path_str);
|
|
39222
39498
|
}
|
|
39223
39499
|
function _resolveReal(p) {
|
|
39224
|
-
const abs =
|
|
39500
|
+
const abs = path47.resolve(p);
|
|
39225
39501
|
try {
|
|
39226
39502
|
return fs54.realpathSync(abs);
|
|
39227
39503
|
} catch {
|
|
@@ -39232,8 +39508,8 @@ function _isRelativeTo(target, base) {
|
|
|
39232
39508
|
if (target === base) {
|
|
39233
39509
|
return true;
|
|
39234
39510
|
}
|
|
39235
|
-
const rel =
|
|
39236
|
-
return rel !== "" && !rel.startsWith("..") && !
|
|
39511
|
+
const rel = path47.relative(base, target);
|
|
39512
|
+
return rel !== "" && !rel.startsWith("..") && !path47.isAbsolute(rel);
|
|
39237
39513
|
}
|
|
39238
39514
|
function _topError(message) {
|
|
39239
39515
|
_stderr2(_TOP_USAGE2);
|
|
@@ -39594,19 +39870,19 @@ function _isCliEntry17() {
|
|
|
39594
39870
|
if (process.argv[1] === void 0) {
|
|
39595
39871
|
return false;
|
|
39596
39872
|
}
|
|
39597
|
-
const argvUrl = pathToFileURL17(
|
|
39873
|
+
const argvUrl = pathToFileURL17(path47.resolve(process.argv[1])).href;
|
|
39598
39874
|
if (import.meta.url === argvUrl) {
|
|
39599
39875
|
return true;
|
|
39600
39876
|
}
|
|
39601
39877
|
try {
|
|
39602
|
-
const here = fs54.realpathSync(
|
|
39603
|
-
const argv = fs54.realpathSync(
|
|
39878
|
+
const here = fs54.realpathSync(fileURLToPath27(import.meta.url));
|
|
39879
|
+
const argv = fs54.realpathSync(path47.resolve(process.argv[1]));
|
|
39604
39880
|
return here === argv;
|
|
39605
39881
|
} catch {
|
|
39606
39882
|
return false;
|
|
39607
39883
|
}
|
|
39608
39884
|
}
|
|
39609
|
-
var _ArgExit2, ArgumentTypeError, _PROG9, SCHEMA_VERSION8, _API_PROVIDERS, _CLI_PROVIDERS, _HERE15,
|
|
39885
|
+
var _ArgExit2, ArgumentTypeError, _PROG9, SCHEMA_VERSION8, _API_PROVIDERS, _CLI_PROVIDERS, _HERE15, REPO_ROOT3, SETTINGS_FILE2, AI_COUNCIL_FILE, COUNCIL_CANONICAL_DIRS, CouncilDisabledError, _CLI_FACTORY, ValueError4, FileNotFoundError3, _SUBCOMMANDS, _TOP_USAGE2;
|
|
39610
39886
|
var init_council_cli = __esm({
|
|
39611
39887
|
"src/scripts/council_cli.ts"() {
|
|
39612
39888
|
"use strict";
|
|
@@ -39652,10 +39928,10 @@ var init_council_cli = __esm({
|
|
|
39652
39928
|
"xai",
|
|
39653
39929
|
"perplexity"
|
|
39654
39930
|
]);
|
|
39655
|
-
_HERE15 =
|
|
39656
|
-
[
|
|
39657
|
-
SETTINGS_FILE2 = project_settings_path(
|
|
39658
|
-
AI_COUNCIL_FILE = resolve_config_path(
|
|
39931
|
+
_HERE15 = path47.dirname(fileURLToPath27(import.meta.url));
|
|
39932
|
+
[REPO_ROOT3] = resolve_project_root(null);
|
|
39933
|
+
SETTINGS_FILE2 = project_settings_path(REPO_ROOT3);
|
|
39934
|
+
AI_COUNCIL_FILE = resolve_config_path(REPO_ROOT3);
|
|
39659
39935
|
COUNCIL_CANONICAL_DIRS = {
|
|
39660
39936
|
responses: "agents/runtime/council/responses",
|
|
39661
39937
|
sessions: "agents/runtime/council/sessions",
|
|
@@ -39754,8 +40030,8 @@ var init_safety_envelope = __esm({
|
|
|
39754
40030
|
});
|
|
39755
40031
|
|
|
39756
40032
|
// src/scripts/mcp_server/__main__.ts
|
|
39757
|
-
import * as
|
|
39758
|
-
import { fileURLToPath as
|
|
40033
|
+
import * as path49 from "node:path";
|
|
40034
|
+
import { fileURLToPath as fileURLToPath29 } from "node:url";
|
|
39759
40035
|
|
|
39760
40036
|
// src/scripts/mcp_server/index.ts
|
|
39761
40037
|
var __version__ = "0.1.0";
|
|
@@ -39803,8 +40079,8 @@ init_resources();
|
|
|
39803
40079
|
|
|
39804
40080
|
// src/scripts/mcp_server/tools.ts
|
|
39805
40081
|
import * as fs55 from "node:fs";
|
|
39806
|
-
import * as
|
|
39807
|
-
import { fileURLToPath as
|
|
40082
|
+
import * as path48 from "node:path";
|
|
40083
|
+
import { fileURLToPath as fileURLToPath28 } from "node:url";
|
|
39808
40084
|
|
|
39809
40085
|
// src/scripts/chat_history.ts
|
|
39810
40086
|
init_memory_lookup();
|
|
@@ -42053,7 +42329,7 @@ function _resolvePath2(p) {
|
|
|
42053
42329
|
try {
|
|
42054
42330
|
return fs55.realpathSync(p);
|
|
42055
42331
|
} catch {
|
|
42056
|
-
return
|
|
42332
|
+
return path48.resolve(p);
|
|
42057
42333
|
}
|
|
42058
42334
|
}
|
|
42059
42335
|
function _resolveConsumerRoot(override) {
|
|
@@ -42063,14 +42339,14 @@ function _resolveConsumerRoot(override) {
|
|
|
42063
42339
|
return _resolvePath2(process.cwd());
|
|
42064
42340
|
}
|
|
42065
42341
|
function _relativeUnder(target, root) {
|
|
42066
|
-
const rel =
|
|
42342
|
+
const rel = path48.relative(root, target);
|
|
42067
42343
|
if (rel === "") {
|
|
42068
42344
|
return "";
|
|
42069
42345
|
}
|
|
42070
|
-
if (rel.startsWith("..") ||
|
|
42346
|
+
if (rel.startsWith("..") || path48.isAbsolute(rel)) {
|
|
42071
42347
|
return null;
|
|
42072
42348
|
}
|
|
42073
|
-
return rel.split(
|
|
42349
|
+
return rel.split(path48.sep).join("/");
|
|
42074
42350
|
}
|
|
42075
42351
|
function _reprStrList(values) {
|
|
42076
42352
|
return `[${values.map((v) => `'${v}'`).join(", ")}]`;
|
|
@@ -42079,11 +42355,11 @@ function _validateInTreePath(raw, consumerRoot) {
|
|
|
42079
42355
|
const root = _resolvePath2(consumerRoot);
|
|
42080
42356
|
let target;
|
|
42081
42357
|
if (raw === null || raw === void 0 || raw === "") {
|
|
42082
|
-
target =
|
|
42083
|
-
} else if (
|
|
42358
|
+
target = path48.join(root, "agents", "runtime", ".agent-chat-history");
|
|
42359
|
+
} else if (path48.isAbsolute(raw)) {
|
|
42084
42360
|
target = _resolvePath2(raw);
|
|
42085
42361
|
} else {
|
|
42086
|
-
target = _resolvePath2(
|
|
42362
|
+
target = _resolvePath2(path48.join(root, raw));
|
|
42087
42363
|
}
|
|
42088
42364
|
const rel = _relativeUnder(target, root);
|
|
42089
42365
|
if (rel === null) {
|
|
@@ -42121,7 +42397,7 @@ async function _lintSkillsHandler(args, consumerRoot) {
|
|
|
42121
42397
|
if (typeof raw !== "string") {
|
|
42122
42398
|
throw new Error("'paths' entries must be strings");
|
|
42123
42399
|
}
|
|
42124
|
-
const resolved =
|
|
42400
|
+
const resolved = path48.isAbsolute(raw) ? _resolvePath2(raw) : _resolvePath2(path48.join(root, raw));
|
|
42125
42401
|
if (_relativeUnder(resolved, root) === null) {
|
|
42126
42402
|
throw new Error(`path escapes consumer_root: ${resolved}`);
|
|
42127
42403
|
}
|
|
@@ -42178,7 +42454,7 @@ async function _chatHistoryAppendHandler(args, consumerRoot) {
|
|
|
42178
42454
|
};
|
|
42179
42455
|
}
|
|
42180
42456
|
if (!fs55.existsSync(target) || _chReadHeader(target) === null) {
|
|
42181
|
-
fs55.mkdirSync(
|
|
42457
|
+
fs55.mkdirSync(path48.dirname(target), { recursive: true });
|
|
42182
42458
|
_chInit(target);
|
|
42183
42459
|
}
|
|
42184
42460
|
_chAppend(entry, target, session ?? null);
|
|
@@ -42324,8 +42600,8 @@ async function _memoryStatusHandler(_args, consumerRoot) {
|
|
|
42324
42600
|
}
|
|
42325
42601
|
return result;
|
|
42326
42602
|
}
|
|
42327
|
-
var _PACKAGE_ROOT2 =
|
|
42328
|
-
|
|
42603
|
+
var _PACKAGE_ROOT2 = path48.resolve(
|
|
42604
|
+
path48.dirname(fileURLToPath28(import.meta.url)),
|
|
42329
42605
|
"..",
|
|
42330
42606
|
"..",
|
|
42331
42607
|
".."
|
|
@@ -42369,8 +42645,8 @@ async function _memorySignalHandler(args, consumerRoot) {
|
|
|
42369
42645
|
async function _roadmapProgressHandler(args, consumerRoot) {
|
|
42370
42646
|
const dryRun = _pyTruthy6(args.dry_run ?? false);
|
|
42371
42647
|
const root = _resolvePath2(consumerRoot);
|
|
42372
|
-
const roadmapRoot =
|
|
42373
|
-
const target =
|
|
42648
|
+
const roadmapRoot = path48.join(root, "agents", "roadmaps");
|
|
42649
|
+
const target = path48.join(root, "agents", "roadmaps-progress.md");
|
|
42374
42650
|
const urp = await Promise.resolve().then(() => (init_update_roadmap_progress(), update_roadmap_progress_exports));
|
|
42375
42651
|
if (!fs55.existsSync(roadmapRoot)) {
|
|
42376
42652
|
return {
|
|
@@ -42408,11 +42684,11 @@ async function _roadmapArchiveHandler(_args, consumerRoot) {
|
|
|
42408
42684
|
let dashboardRegenerated = false;
|
|
42409
42685
|
if (archived.length > 0) {
|
|
42410
42686
|
const urp = await Promise.resolve().then(() => (init_update_roadmap_progress(), update_roadmap_progress_exports));
|
|
42411
|
-
const roadmapRoot =
|
|
42687
|
+
const roadmapRoot = path48.join(root, "agents", "roadmaps");
|
|
42412
42688
|
if (fs55.existsSync(roadmapRoot)) {
|
|
42413
42689
|
const roadmaps = urp.collect(roadmapRoot);
|
|
42414
42690
|
fs55.writeFileSync(
|
|
42415
|
-
|
|
42691
|
+
path48.join(root, "agents", "roadmaps-progress.md"),
|
|
42416
42692
|
urp.render(roadmaps, urp.collect_bundles(root)),
|
|
42417
42693
|
"utf-8"
|
|
42418
42694
|
);
|
|
@@ -42428,7 +42704,7 @@ async function _roadmapArchiveHandler(_args, consumerRoot) {
|
|
|
42428
42704
|
async function _capabilitiesIndexHandler(args, consumerRoot) {
|
|
42429
42705
|
const check = _pyTruthy6(args.check ?? false);
|
|
42430
42706
|
const cap = await Promise.resolve().then(() => (init_generate_capabilities_index(), generate_capabilities_index_exports));
|
|
42431
|
-
const out =
|
|
42707
|
+
const out = path48.join(_PACKAGE_ROOT2, "CAPABILITIES.yaml");
|
|
42432
42708
|
const content = cap.build();
|
|
42433
42709
|
const onDisk = fs55.existsSync(out) ? fs55.readFileSync(out, "utf-8") : "";
|
|
42434
42710
|
const drift = onDisk !== content;
|
|
@@ -42541,7 +42817,7 @@ async function _councilEstimateHandler(args, consumerRoot) {
|
|
|
42541
42817
|
throw new Error("'depth' must be 'shallow' or 'deep' when provided");
|
|
42542
42818
|
}
|
|
42543
42819
|
const root = _resolvePath2(consumerRoot);
|
|
42544
|
-
const target =
|
|
42820
|
+
const target = path48.isAbsolute(inputRaw) ? _resolvePath2(inputRaw) : _resolvePath2(path48.join(root, inputRaw));
|
|
42545
42821
|
if (_relativeUnder(target, root) === null) {
|
|
42546
42822
|
throw new Error(`path escapes consumer_root: ${target}`);
|
|
42547
42823
|
}
|
|
@@ -42607,7 +42883,7 @@ async function _runTestsHandler(args, consumerRoot) {
|
|
|
42607
42883
|
if (typeof relPathRaw !== "string" || !_strip8(relPathRaw)) {
|
|
42608
42884
|
throw new Error("'path' must be a non-empty string when provided");
|
|
42609
42885
|
}
|
|
42610
|
-
const resolved =
|
|
42886
|
+
const resolved = path48.isAbsolute(relPathRaw) ? _resolvePath2(relPathRaw) : _resolvePath2(path48.join(root, relPathRaw));
|
|
42611
42887
|
const rel = _relativeUnder(resolved, root);
|
|
42612
42888
|
if (rel === null) {
|
|
42613
42889
|
throw new Error(`path escapes consumer_root: ${resolved}`);
|
|
@@ -42617,7 +42893,7 @@ async function _runTestsHandler(args, consumerRoot) {
|
|
|
42617
42893
|
}
|
|
42618
42894
|
relArg = rel;
|
|
42619
42895
|
}
|
|
42620
|
-
const vitestEntry =
|
|
42896
|
+
const vitestEntry = path48.join(root, "node_modules", "vitest", "vitest.mjs");
|
|
42621
42897
|
if (!fs55.existsSync(vitestEntry)) {
|
|
42622
42898
|
throw new Error(
|
|
42623
42899
|
"run_tests pilot supports vitest projects only \u2014 node_modules/vitest/vitest.mjs not found under consumer_root"
|
|
@@ -43224,8 +43500,8 @@ function _strCmp3(a, b) {
|
|
|
43224
43500
|
return a < b ? -1 : a > b ? 1 : 0;
|
|
43225
43501
|
}
|
|
43226
43502
|
function _pathlibCompare3(a, b) {
|
|
43227
|
-
const pa = a.split(
|
|
43228
|
-
const pb = b.split(
|
|
43503
|
+
const pa = a.split(path48.sep);
|
|
43504
|
+
const pb = b.split(path48.sep);
|
|
43229
43505
|
const n = Math.min(pa.length, pb.length);
|
|
43230
43506
|
for (let i = 0; i < n; i++) {
|
|
43231
43507
|
const c = _strCmp3(pa[i], pb[i]);
|
|
@@ -43449,8 +43725,8 @@ function main18() {
|
|
|
43449
43725
|
}
|
|
43450
43726
|
|
|
43451
43727
|
// src/scripts/mcp_server/__main__.ts
|
|
43452
|
-
var _selfPath =
|
|
43453
|
-
var _invokedDirectly2 = globalThis.__AC_MCP_BUNDLE_DIRECT === true || process.argv[1] !== void 0 &&
|
|
43728
|
+
var _selfPath = fileURLToPath29(import.meta.url);
|
|
43729
|
+
var _invokedDirectly2 = globalThis.__AC_MCP_BUNDLE_DIRECT === true || process.argv[1] !== void 0 && path49.resolve(process.argv[1]) === path49.resolve(_selfPath);
|
|
43454
43730
|
if (_invokedDirectly2) {
|
|
43455
43731
|
main18();
|
|
43456
43732
|
}
|