@codedrifters/configulator 0.0.275 → 0.0.277
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/lib/index.d.mts +251 -319
- package/lib/index.d.ts +252 -320
- package/lib/index.js +454 -594
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +448 -584
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.mjs
CHANGED
|
@@ -936,7 +936,7 @@ var agendaBundle = {
|
|
|
936
936
|
{
|
|
937
937
|
name: "agenda:finalize",
|
|
938
938
|
color: "BFDADC",
|
|
939
|
-
description: "Phase 2:
|
|
939
|
+
description: "Phase 2: register in meetings index, cross-link related docs, and lock the agenda before the meeting"
|
|
940
940
|
}
|
|
941
941
|
]
|
|
942
942
|
};
|
|
@@ -2783,442 +2783,6 @@ function assertValidProductContextPath(value) {
|
|
|
2783
2783
|
}
|
|
2784
2784
|
}
|
|
2785
2785
|
|
|
2786
|
-
// src/agent/bundles/workflow-diagrams.ts
|
|
2787
|
-
var DEFAULT_WORKFLOW_DIAGRAMS_ENABLED = true;
|
|
2788
|
-
var DEFAULT_WORKFLOW_DIAGRAMS_PATH = "docs/src/content/docs/agents/workflows.md";
|
|
2789
|
-
var DEFAULT_WORKFLOW_DIAGRAMS_BUNDLE_PATH_PATTERNS = [
|
|
2790
|
-
"packages/@codedrifters/configulator/src/agent/bundles/**/*.ts",
|
|
2791
|
-
".claude/agents/**/*.md",
|
|
2792
|
-
".claude/skills/**/*.md"
|
|
2793
|
-
];
|
|
2794
|
-
var DEFAULT_WORKFLOW_DIAGRAMS_EMIT_STARTER = false;
|
|
2795
|
-
var DEFAULT_WORKFLOW_DIAGRAMS_EMIT_CHECKER = false;
|
|
2796
|
-
var DEFAULT_WORKFLOW_DIAGRAMS_REQUIRE_UPDATE = true;
|
|
2797
|
-
function resolveWorkflowDiagrams(config) {
|
|
2798
|
-
const diagramsPath = config?.diagramsPath ?? DEFAULT_WORKFLOW_DIAGRAMS_PATH;
|
|
2799
|
-
assertValidDiagramsPath(diagramsPath);
|
|
2800
|
-
const bundlePathPatterns = config?.bundlePathPatterns ?? DEFAULT_WORKFLOW_DIAGRAMS_BUNDLE_PATH_PATTERNS;
|
|
2801
|
-
assertValidBundlePathPatterns2(bundlePathPatterns);
|
|
2802
|
-
return {
|
|
2803
|
-
enabled: config?.enabled ?? DEFAULT_WORKFLOW_DIAGRAMS_ENABLED,
|
|
2804
|
-
diagramsPath,
|
|
2805
|
-
bundlePathPatterns,
|
|
2806
|
-
emitStarterDiagram: config?.emitStarterDiagram ?? DEFAULT_WORKFLOW_DIAGRAMS_EMIT_STARTER,
|
|
2807
|
-
emitChecker: config?.emitChecker ?? DEFAULT_WORKFLOW_DIAGRAMS_EMIT_CHECKER,
|
|
2808
|
-
requireDiagramUpdate: config?.requireDiagramUpdate ?? DEFAULT_WORKFLOW_DIAGRAMS_REQUIRE_UPDATE
|
|
2809
|
-
};
|
|
2810
|
-
}
|
|
2811
|
-
function validateWorkflowDiagramsConfig(config) {
|
|
2812
|
-
return resolveWorkflowDiagrams(config);
|
|
2813
|
-
}
|
|
2814
|
-
function renderWorkflowDiagramsRuleContent(wd) {
|
|
2815
|
-
if (!wd.enabled) {
|
|
2816
|
-
return [
|
|
2817
|
-
"# Workflow Diagrams",
|
|
2818
|
-
"",
|
|
2819
|
-
"**The workflow-diagrams convention is disabled in this project.**",
|
|
2820
|
-
"Agents may change bundle or agent source files without updating",
|
|
2821
|
-
"any diagrams page. When diagrams fall behind the prose, humans",
|
|
2822
|
-
"must reconcile them manually.",
|
|
2823
|
-
"",
|
|
2824
|
-
"Enable the convention via",
|
|
2825
|
-
"`AgentConfigOptions.workflowDiagrams.enabled = true`."
|
|
2826
|
-
].join("\n");
|
|
2827
|
-
}
|
|
2828
|
-
const requirementVerb = wd.requireDiagramUpdate ? "MUST" : "SHOULD";
|
|
2829
|
-
const lines = [
|
|
2830
|
-
"# Workflow Diagrams",
|
|
2831
|
-
"",
|
|
2832
|
-
"This project maintains a single hand-authored workflow-diagrams",
|
|
2833
|
-
"page that visualises every agent's phases, its decision points,",
|
|
2834
|
-
"and every cross-agent handoff. Prose scattered across rule files",
|
|
2835
|
-
"and agent prompts describes each handoff in isolation; the",
|
|
2836
|
-
"diagrams page is the single visual reference that shows the",
|
|
2837
|
-
"whole pipeline at once.",
|
|
2838
|
-
"",
|
|
2839
|
-
"Diagrams are **hand-authored for readability**, not",
|
|
2840
|
-
"auto-generated. A machine-generated graph of bundle dependencies",
|
|
2841
|
-
"would technically stay in sync, but would not communicate the",
|
|
2842
|
-
"intent behind each handoff \u2014 so the convention trades",
|
|
2843
|
-
"auto-sync for editorial clarity and enforces sync via the rule",
|
|
2844
|
-
"below.",
|
|
2845
|
-
"",
|
|
2846
|
-
"## Diagrams Page",
|
|
2847
|
-
"",
|
|
2848
|
-
`The workflow-diagrams page lives at \`${wd.diagramsPath}\`. It`,
|
|
2849
|
-
"follows a stable structure so the sync rule can mechanically",
|
|
2850
|
-
"identify which section matches which bundle:",
|
|
2851
|
-
"",
|
|
2852
|
-
"1. **Master cross-agent diagram** \u2014 one top-level Mermaid",
|
|
2853
|
-
" flowchart showing every agent as a node and every",
|
|
2854
|
-
" cross-agent issue-creation or file-consumption handoff as an",
|
|
2855
|
-
" edge.",
|
|
2856
|
-
"2. **One section per agent / bundle** \u2014 a `## N. <agent-name>`",
|
|
2857
|
-
" heading followed by a single Mermaid `flowchart TD` diagram",
|
|
2858
|
-
" that depicts the agent's phase graph (nodes = phases /",
|
|
2859
|
-
" decisions, edges = transitions, styled end-nodes = commit /",
|
|
2860
|
-
" PR / done terminals).",
|
|
2861
|
-
"3. **Legend** \u2014 a short table mapping colours and arrow styles",
|
|
2862
|
-
" to their meanings (dispatcher vs agent vs skill; solid vs",
|
|
2863
|
-
" dashed arrows for issue-creation vs file-consumption).",
|
|
2864
|
-
"",
|
|
2865
|
-
"Each agent section is independent. Changing one agent's phase",
|
|
2866
|
-
"graph touches only that section; cross-agent handoff changes",
|
|
2867
|
-
"touch the master diagram plus any affected agent sections.",
|
|
2868
|
-
"",
|
|
2869
|
-
"## Diagram-Touched-When-Bundle-Touched Rule",
|
|
2870
|
-
"",
|
|
2871
|
-
`Every change that modifies a bundle's phase graph ${requirementVerb}`,
|
|
2872
|
-
`also update \`${wd.diagramsPath}\` in the same change set. The`,
|
|
2873
|
-
"rule applies when **any** staged file in a commit or PR matches",
|
|
2874
|
-
"one of the bundle-path patterns below:",
|
|
2875
|
-
"",
|
|
2876
|
-
...wd.bundlePathPatterns.map((p) => `- \`${p}\``),
|
|
2877
|
-
"",
|
|
2878
|
-
"Mechanically: when a change set includes a file matching one of",
|
|
2879
|
-
`the patterns above, it ${requirementVerb} also include a`,
|
|
2880
|
-
`modification to \`${wd.diagramsPath}\`.`,
|
|
2881
|
-
"",
|
|
2882
|
-
"### What counts as a phase-graph change",
|
|
2883
|
-
"",
|
|
2884
|
-
"The rule targets edits that change **what the agent does**, not",
|
|
2885
|
-
"stylistic tweaks. Concretely:",
|
|
2886
|
-
"",
|
|
2887
|
-
"- Adding, removing, or renaming a phase label.",
|
|
2888
|
-
"- Changing a phase's inputs, outputs, or decision branches.",
|
|
2889
|
-
"- Adding or removing a cross-agent handoff (an issue-creation",
|
|
2890
|
-
" or file-consumption edge between two bundles).",
|
|
2891
|
-
"- Changing the sort order or priority logic that drives",
|
|
2892
|
-
" dispatcher routing between tiers.",
|
|
2893
|
-
"",
|
|
2894
|
-
"Edits that do **not** require a diagram update:",
|
|
2895
|
-
"",
|
|
2896
|
-
"- Typo fixes, comment tweaks, wording polish in rule prose.",
|
|
2897
|
-
"- Refactors that preserve the exact phase / handoff graph",
|
|
2898
|
-
" (extracting a helper, renaming an internal variable,",
|
|
2899
|
-
" reordering imports).",
|
|
2900
|
-
"- Updates to supporting metadata (permissions lists, default",
|
|
2901
|
-
" paths) that do not change the visible phase flow.",
|
|
2902
|
-
"",
|
|
2903
|
-
"When a change is borderline \u2014 the phase graph is unchanged but",
|
|
2904
|
-
"the diagram's caption or annotation would be more accurate \u2014",
|
|
2905
|
-
"err on the side of updating the diagram. The convention favours",
|
|
2906
|
-
"over-updating over silent drift.",
|
|
2907
|
-
"",
|
|
2908
|
-
"## Authoring Checklist",
|
|
2909
|
-
"",
|
|
2910
|
-
"Authors and reviewers walk the following checklist before",
|
|
2911
|
-
"merging any PR that touches a bundle path:",
|
|
2912
|
-
"",
|
|
2913
|
-
`1. **Did the phase graph change?** If yes, update \`${wd.diagramsPath}\``,
|
|
2914
|
-
" in the same PR \u2014 both the affected agent section and, if the",
|
|
2915
|
-
" change added or removed a cross-agent handoff, the master",
|
|
2916
|
-
" diagram.",
|
|
2917
|
-
"2. **Did the diagram render?** Preview the Mermaid block locally",
|
|
2918
|
-
" (or via the docs site's dev server) and confirm it renders",
|
|
2919
|
-
" without syntax errors.",
|
|
2920
|
-
`3. **Is the section heading stable?** Each agent section uses a`,
|
|
2921
|
-
" `## N. <agent-name>` heading where `<agent-name>` matches the",
|
|
2922
|
-
" bundle name / agent prompt filename. Keep the headings stable",
|
|
2923
|
-
" \u2014 downstream tooling may match on them.",
|
|
2924
|
-
"4. **Does the legend still apply?** If a new arrow style or node",
|
|
2925
|
-
" colour was introduced, document it in the legend.",
|
|
2926
|
-
""
|
|
2927
|
-
];
|
|
2928
|
-
if (wd.emitChecker) {
|
|
2929
|
-
lines.push(
|
|
2930
|
-
"## Automated Check",
|
|
2931
|
-
"",
|
|
2932
|
-
`The bundled \`.claude/procedures/check-workflow-diagrams.sh\``,
|
|
2933
|
-
"helper enforces the rule mechanically. Given a set of changed",
|
|
2934
|
-
"files (as a newline-separated list on stdin, or positional",
|
|
2935
|
-
`arguments), it fails non-zero when any file matches a`,
|
|
2936
|
-
`bundle-path pattern and \`${wd.diagramsPath}\` is not also in`,
|
|
2937
|
-
"the list. Wire it into a pre-commit hook or CI job as needed:",
|
|
2938
|
-
"",
|
|
2939
|
-
"```bash",
|
|
2940
|
-
"# Pre-commit (staged files):",
|
|
2941
|
-
"git diff --cached --name-only \\",
|
|
2942
|
-
" | .claude/procedures/check-workflow-diagrams.sh",
|
|
2943
|
-
"",
|
|
2944
|
-
"# CI (branch-vs-base):",
|
|
2945
|
-
"git diff --name-only origin/main...HEAD \\",
|
|
2946
|
-
" | .claude/procedures/check-workflow-diagrams.sh",
|
|
2947
|
-
"```",
|
|
2948
|
-
"",
|
|
2949
|
-
"The helper exits with a descriptive diagnostic on failure, so",
|
|
2950
|
-
"it plugs directly into any hook framework without further",
|
|
2951
|
-
"glue. It exits `0` when no bundle files were touched or when",
|
|
2952
|
-
"the diagrams file is also present in the change set.",
|
|
2953
|
-
""
|
|
2954
|
-
);
|
|
2955
|
-
}
|
|
2956
|
-
lines.push(
|
|
2957
|
-
"## Out of Scope",
|
|
2958
|
-
"",
|
|
2959
|
-
"The convention intentionally does not:",
|
|
2960
|
-
"",
|
|
2961
|
-
"- Auto-generate the diagrams \u2014 readability is the point.",
|
|
2962
|
-
"- Enforce a specific Mermaid sub-grammar beyond `flowchart TD`",
|
|
2963
|
-
" for per-agent sections. Sequence diagrams, state diagrams, or",
|
|
2964
|
-
" class diagrams are fine for bespoke sections as long as they",
|
|
2965
|
-
" render.",
|
|
2966
|
-
"- Gate every unrelated cleanup PR on a diagram touch. The rule",
|
|
2967
|
-
" targets phase-graph-affecting edits; pure cleanups documented",
|
|
2968
|
-
" as such are exempt."
|
|
2969
|
-
);
|
|
2970
|
-
return lines.join("\n");
|
|
2971
|
-
}
|
|
2972
|
-
function renderWorkflowDiagramsBundleHook(wd, bundleLabel) {
|
|
2973
|
-
if (!wd.enabled) {
|
|
2974
|
-
return "";
|
|
2975
|
-
}
|
|
2976
|
-
const verb = wd.requireDiagramUpdate ? "must" : "should";
|
|
2977
|
-
return [
|
|
2978
|
-
"## Workflow Diagram",
|
|
2979
|
-
"",
|
|
2980
|
-
`Every ${bundleLabel} change that modifies the phase graph,`,
|
|
2981
|
-
"decision branches, or cross-agent handoffs documented by this",
|
|
2982
|
-
`bundle ${verb} also update the matching section in`,
|
|
2983
|
-
`\`${wd.diagramsPath}\` in the same PR. See the`,
|
|
2984
|
-
"`workflow-diagrams-convention` rule for the full authoring",
|
|
2985
|
-
"checklist, the path patterns the rule covers, and what counts",
|
|
2986
|
-
"as a phase-graph change vs. a cosmetic edit."
|
|
2987
|
-
].join("\n");
|
|
2988
|
-
}
|
|
2989
|
-
function renderWorkflowDiagramsStarterPage(_wd) {
|
|
2990
|
-
return [
|
|
2991
|
-
"---",
|
|
2992
|
-
"title: Agent Workflows",
|
|
2993
|
-
"description: Hand-authored Mermaid diagrams for every agent pipeline and every cross-agent handoff.",
|
|
2994
|
-
"---",
|
|
2995
|
-
"",
|
|
2996
|
-
"# Agent Workflows",
|
|
2997
|
-
"",
|
|
2998
|
-
"Each diagram shows every input, decision point, output path, and",
|
|
2999
|
-
"downstream issue created by the agent. Solid arrows are issue-",
|
|
3000
|
-
"creation handoffs; dashed arrows are file-consumption handoffs.",
|
|
3001
|
-
"",
|
|
3002
|
-
"Update this page in the same PR that changes a bundle's phase",
|
|
3003
|
-
"graph \u2014 see the `workflow-diagrams-convention` rule for the full",
|
|
3004
|
-
"contract.",
|
|
3005
|
-
"",
|
|
3006
|
-
"## Master Cross-Agent Diagram",
|
|
3007
|
-
"",
|
|
3008
|
-
"```mermaid",
|
|
3009
|
-
"flowchart TB",
|
|
3010
|
-
" %% Replace the placeholder below with the real agent ecosystem.",
|
|
3011
|
-
" DISPATCHER[Dispatcher]",
|
|
3012
|
-
" AGENT_A[Agent A]",
|
|
3013
|
-
" AGENT_B[Agent B]",
|
|
3014
|
-
" DISPATCHER --> AGENT_A",
|
|
3015
|
-
" DISPATCHER --> AGENT_B",
|
|
3016
|
-
" AGENT_A -->|issue-creation| AGENT_B",
|
|
3017
|
-
" AGENT_B -.->|file-consumption| AGENT_A",
|
|
3018
|
-
"```",
|
|
3019
|
-
"",
|
|
3020
|
-
"## 1. Example Agent",
|
|
3021
|
-
"",
|
|
3022
|
-
"```mermaid",
|
|
3023
|
-
"flowchart TD",
|
|
3024
|
-
" START([Session Start]) --> CLAIM[Claim issue]",
|
|
3025
|
-
" CLAIM --> PHASE{Phase label?}",
|
|
3026
|
-
" PHASE -->|phase:a| A1[Phase A work]",
|
|
3027
|
-
" PHASE -->|phase:b| B1[Phase B work]",
|
|
3028
|
-
" A1 --> COMMIT[Commit & PR]",
|
|
3029
|
-
" B1 --> COMMIT",
|
|
3030
|
-
" COMMIT --> STOP([Stop])",
|
|
3031
|
-
" style STOP fill:#e8f5e9,stroke:#2e7d32",
|
|
3032
|
-
"```",
|
|
3033
|
-
"",
|
|
3034
|
-
"## Legend",
|
|
3035
|
-
"",
|
|
3036
|
-
"| Style | Meaning |",
|
|
3037
|
-
"|-------|---------|",
|
|
3038
|
-
"| Solid arrow | Issue-creation handoff (agent A creates an issue for agent B) |",
|
|
3039
|
-
"| Dashed arrow | File-consumption handoff (agent A reads files produced by agent B) |",
|
|
3040
|
-
"| Green end-node | Terminal state (session complete) |"
|
|
3041
|
-
].join("\n");
|
|
3042
|
-
}
|
|
3043
|
-
function renderWorkflowDiagramsCheckerScript(wd) {
|
|
3044
|
-
const patternsLiteral = wd.bundlePathPatterns.map((p) => ` ${JSON.stringify(p)}`).join("\n");
|
|
3045
|
-
return [
|
|
3046
|
-
"#!/usr/bin/env bash",
|
|
3047
|
-
"# check-workflow-diagrams.sh \u2014 Enforce the diagram-touched-when-bundle-touched rule.",
|
|
3048
|
-
"#",
|
|
3049
|
-
"# Usage:",
|
|
3050
|
-
"# .claude/procedures/check-workflow-diagrams.sh <file>...",
|
|
3051
|
-
"# git diff --name-only HEAD | .claude/procedures/check-workflow-diagrams.sh",
|
|
3052
|
-
"#",
|
|
3053
|
-
"# Exits 0 when the workflow-diagrams page was touched alongside any",
|
|
3054
|
-
"# bundle file in the change set, or when no bundle files were touched.",
|
|
3055
|
-
"# Exits non-zero with a descriptive diagnostic on failure.",
|
|
3056
|
-
"#",
|
|
3057
|
-
"# The bundle-path patterns and diagrams path are rendered from the",
|
|
3058
|
-
"# consumer's WorkflowDiagramsConfig at synth time \u2014 do not edit by",
|
|
3059
|
-
"# hand; regenerate via `pnpm exec projen`.",
|
|
3060
|
-
"#",
|
|
3061
|
-
"# Patterns support the `**` recursive-segment wildcard even though",
|
|
3062
|
-
"# bash's native `[[ $file == $glob ]]` pattern matching does not:",
|
|
3063
|
-
"# each glob is converted to a POSIX-extended regex internally and",
|
|
3064
|
-
"# matched with `=~`, so the script works uniformly on bash 3.2",
|
|
3065
|
-
"# (macOS default) and bash 4+ (Linux / CI) without depending on",
|
|
3066
|
-
"# `shopt -s globstar` (which only affects pathname expansion, not",
|
|
3067
|
-
"# `[[ ]]` pattern matching).",
|
|
3068
|
-
"",
|
|
3069
|
-
"set -uo pipefail",
|
|
3070
|
-
"",
|
|
3071
|
-
"err() {",
|
|
3072
|
-
' printf "check-workflow-diagrams.sh: %s\\n" "$*" >&2',
|
|
3073
|
-
"}",
|
|
3074
|
-
"",
|
|
3075
|
-
`diagrams_path=${JSON.stringify(wd.diagramsPath)}`,
|
|
3076
|
-
"",
|
|
3077
|
-
"# Bundle-path glob patterns. Translated to anchored POSIX-extended",
|
|
3078
|
-
"# regexes at runtime by `glob_to_regex` below so `**` matches",
|
|
3079
|
-
"# recursively across path segments.",
|
|
3080
|
-
"bundle_patterns=(",
|
|
3081
|
-
patternsLiteral,
|
|
3082
|
-
")",
|
|
3083
|
-
"",
|
|
3084
|
-
"# Convert a bash-style glob into an anchored POSIX-extended regex:",
|
|
3085
|
-
"# **/ \u2192 (.+/)? (zero or more path segments plus trailing slash)",
|
|
3086
|
-
"# ** \u2192 .* (anywhere, including `/`)",
|
|
3087
|
-
"# * \u2192 [^/]* (single path segment)",
|
|
3088
|
-
"# ? \u2192 [^/] (single non-slash char)",
|
|
3089
|
-
"# Every other char is passed through, with regex metacharacters",
|
|
3090
|
-
"# backslash-escaped so literal `.` / `+` / `(` etc. match themselves.",
|
|
3091
|
-
"glob_to_regex() {",
|
|
3092
|
-
' local glob="$1"',
|
|
3093
|
-
' local regex=""',
|
|
3094
|
-
" local i=0",
|
|
3095
|
-
" local len=${#glob}",
|
|
3096
|
-
" while (( i < len )); do",
|
|
3097
|
-
' local c="${glob:i:1}"',
|
|
3098
|
-
' if [[ "$c" == "*" ]]; then',
|
|
3099
|
-
' local next="${glob:i+1:1}"',
|
|
3100
|
-
' if [[ "$next" == "*" ]]; then',
|
|
3101
|
-
" # `**` \u2014 recursive segment wildcard.",
|
|
3102
|
-
' local after="${glob:i+2:1}"',
|
|
3103
|
-
' if [[ "$after" == "/" ]]; then',
|
|
3104
|
-
' regex+="(.+/)?"',
|
|
3105
|
-
" i=$(( i + 3 ))",
|
|
3106
|
-
" else",
|
|
3107
|
-
' regex+=".*"',
|
|
3108
|
-
" i=$(( i + 2 ))",
|
|
3109
|
-
" fi",
|
|
3110
|
-
" else",
|
|
3111
|
-
' regex+="[^/]*"',
|
|
3112
|
-
" i=$(( i + 1 ))",
|
|
3113
|
-
" fi",
|
|
3114
|
-
' elif [[ "$c" == "?" ]]; then',
|
|
3115
|
-
' regex+="[^/]"',
|
|
3116
|
-
" i=$(( i + 1 ))",
|
|
3117
|
-
" else",
|
|
3118
|
-
' case "$c" in',
|
|
3119
|
-
" # Regex metacharacters \u2014 escape to match literally.",
|
|
3120
|
-
" '.'|'+'|'^'|'$'|'('|')'|'{'|'}'|'|'|'['|']'|'\\\\')",
|
|
3121
|
-
' regex+="\\\\$c"',
|
|
3122
|
-
" ;;",
|
|
3123
|
-
" *)",
|
|
3124
|
-
' regex+="$c"',
|
|
3125
|
-
" ;;",
|
|
3126
|
-
" esac",
|
|
3127
|
-
" i=$(( i + 1 ))",
|
|
3128
|
-
" fi",
|
|
3129
|
-
" done",
|
|
3130
|
-
' printf "^%s$" "$regex"',
|
|
3131
|
-
"}",
|
|
3132
|
-
"",
|
|
3133
|
-
"# Collect the input file list: positional args override stdin.",
|
|
3134
|
-
"if [[ $# -gt 0 ]]; then",
|
|
3135
|
-
' files=("$@")',
|
|
3136
|
-
"else",
|
|
3137
|
-
" files=()",
|
|
3138
|
-
" while IFS= read -r line; do",
|
|
3139
|
-
' [[ -z "$line" ]] && continue',
|
|
3140
|
-
' files+=("$line")',
|
|
3141
|
-
" done",
|
|
3142
|
-
"fi",
|
|
3143
|
-
"",
|
|
3144
|
-
"if [[ ${#files[@]} -eq 0 ]]; then",
|
|
3145
|
-
" # No input \u2014 nothing to check.",
|
|
3146
|
-
" exit 0",
|
|
3147
|
-
"fi",
|
|
3148
|
-
"",
|
|
3149
|
-
"# Precompile each bundle pattern to a regex once.",
|
|
3150
|
-
"bundle_regexes=()",
|
|
3151
|
-
'for pattern in "${bundle_patterns[@]}"; do',
|
|
3152
|
-
' bundle_regexes+=("$(glob_to_regex "$pattern")")',
|
|
3153
|
-
"done",
|
|
3154
|
-
"",
|
|
3155
|
-
"bundle_touched=0",
|
|
3156
|
-
"matched_bundle=''",
|
|
3157
|
-
"diagrams_touched=0",
|
|
3158
|
-
"",
|
|
3159
|
-
'for file in "${files[@]}"; do',
|
|
3160
|
-
' if [[ "$file" == "$diagrams_path" ]]; then',
|
|
3161
|
-
" diagrams_touched=1",
|
|
3162
|
-
" continue",
|
|
3163
|
-
" fi",
|
|
3164
|
-
' for regex in "${bundle_regexes[@]}"; do',
|
|
3165
|
-
' if [[ "$file" =~ $regex ]]; then',
|
|
3166
|
-
" bundle_touched=1",
|
|
3167
|
-
' matched_bundle="$file"',
|
|
3168
|
-
" break",
|
|
3169
|
-
" fi",
|
|
3170
|
-
" done",
|
|
3171
|
-
"done",
|
|
3172
|
-
"",
|
|
3173
|
-
'if [[ "$bundle_touched" -eq 1 && "$diagrams_touched" -eq 0 ]]; then',
|
|
3174
|
-
` err "bundle file '$matched_bundle' was modified but '$diagrams_path' was not"`,
|
|
3175
|
-
' err "update the workflow-diagrams page in the same change set (see workflow-diagrams-convention rule)"',
|
|
3176
|
-
" exit 1",
|
|
3177
|
-
"fi",
|
|
3178
|
-
"",
|
|
3179
|
-
"exit 0"
|
|
3180
|
-
].join("\n");
|
|
3181
|
-
}
|
|
3182
|
-
function assertValidDiagramsPath(value) {
|
|
3183
|
-
if (typeof value !== "string" || value.trim().length === 0) {
|
|
3184
|
-
throw new Error(
|
|
3185
|
-
`WorkflowDiagramsConfig.diagramsPath must be a non-empty string; got ${JSON.stringify(
|
|
3186
|
-
value
|
|
3187
|
-
)}`
|
|
3188
|
-
);
|
|
3189
|
-
}
|
|
3190
|
-
if (value.startsWith("/")) {
|
|
3191
|
-
throw new Error(
|
|
3192
|
-
`WorkflowDiagramsConfig.diagramsPath must be a repo-relative path (no leading '/'); got ${JSON.stringify(
|
|
3193
|
-
value
|
|
3194
|
-
)}`
|
|
3195
|
-
);
|
|
3196
|
-
}
|
|
3197
|
-
}
|
|
3198
|
-
function assertValidBundlePathPatterns2(value) {
|
|
3199
|
-
if (!Array.isArray(value)) {
|
|
3200
|
-
throw new Error(
|
|
3201
|
-
`WorkflowDiagramsConfig.bundlePathPatterns must be an array; got ${JSON.stringify(
|
|
3202
|
-
value
|
|
3203
|
-
)}`
|
|
3204
|
-
);
|
|
3205
|
-
}
|
|
3206
|
-
if (value.length === 0) {
|
|
3207
|
-
throw new Error(
|
|
3208
|
-
"WorkflowDiagramsConfig.bundlePathPatterns must not be empty \u2014 supply at least one pattern or omit the field to use the defaults"
|
|
3209
|
-
);
|
|
3210
|
-
}
|
|
3211
|
-
for (const entry of value) {
|
|
3212
|
-
if (typeof entry !== "string" || entry.trim().length === 0) {
|
|
3213
|
-
throw new Error(
|
|
3214
|
-
`WorkflowDiagramsConfig.bundlePathPatterns entries must be non-empty strings; got ${JSON.stringify(
|
|
3215
|
-
entry
|
|
3216
|
-
)}`
|
|
3217
|
-
);
|
|
3218
|
-
}
|
|
3219
|
-
}
|
|
3220
|
-
}
|
|
3221
|
-
|
|
3222
2786
|
// src/agent/bundles/base.ts
|
|
3223
2787
|
var createPackageSkill = {
|
|
3224
2788
|
name: "create-package",
|
|
@@ -4296,16 +3860,6 @@ function buildBaseBundle(paths = DEFAULT_AGENT_PATHS) {
|
|
|
4296
3860
|
},
|
|
4297
3861
|
tags: ["workflow"]
|
|
4298
3862
|
},
|
|
4299
|
-
{
|
|
4300
|
-
name: "workflow-diagrams-convention",
|
|
4301
|
-
description: `Workflow-diagrams convention: hand-authored Mermaid page under \`${paths.docsRoot}/agents/workflows.md\` with one diagram per agent plus a master cross-agent diagram, and the diagram-touched-when-bundle-touched rule that keeps the page in sync with every phase-graph or cross-agent-handoff change.`,
|
|
4302
|
-
scope: AGENT_RULE_SCOPE.ALWAYS,
|
|
4303
|
-
content: renderWorkflowDiagramsRuleContent(resolveWorkflowDiagrams()),
|
|
4304
|
-
platforms: {
|
|
4305
|
-
cursor: { exclude: true }
|
|
4306
|
-
},
|
|
4307
|
-
tags: ["workflow"]
|
|
4308
|
-
},
|
|
4309
3863
|
{
|
|
4310
3864
|
name: "issue-templates-convention",
|
|
4311
3865
|
description: `Issue-templates convention: a single hand-authored reference page under \`${paths.docsRoot}/agents/issue-templates.md\` that carries one canonical \`gh issue create\` recipe per downstream phase label, and the reference-don't-inline rule that keeps bundle rules and agent prompts citing that page instead of duplicating full template invocations.`,
|
|
@@ -5045,12 +4599,12 @@ function buildBcmWriterBundle(paths = DEFAULT_AGENT_PATHS) {
|
|
|
5045
4599
|
{
|
|
5046
4600
|
name: "bcm:context",
|
|
5047
4601
|
color: "D4C5F9",
|
|
5048
|
-
description: "Phase 3: fill Project Relevance, Value Stream Mapping,
|
|
4602
|
+
description: "Phase 3: fill Project Relevance, Value Stream Mapping, Software Systems, Roles, and Company Size"
|
|
5049
4603
|
},
|
|
5050
4604
|
{
|
|
5051
4605
|
name: "bcm:connect",
|
|
5052
4606
|
color: "FEF2C0",
|
|
5053
|
-
description: "Phase 4: cross-link
|
|
4607
|
+
description: "Phase 4: cross-link parent/siblings, update registry and capability-map, open downstream issues"
|
|
5054
4608
|
}
|
|
5055
4609
|
]
|
|
5056
4610
|
};
|
|
@@ -6045,7 +5599,7 @@ function buildBusinessModelsBundle(paths = DEFAULT_AGENT_PATHS) {
|
|
|
6045
5599
|
{
|
|
6046
5600
|
name: "type:business-model",
|
|
6047
5601
|
color: "5319E7",
|
|
6048
|
-
description: "
|
|
5602
|
+
description: "Authors or updates a Business Model Canvas plus BIZBOK value streams for an industry segment"
|
|
6049
5603
|
},
|
|
6050
5604
|
{
|
|
6051
5605
|
name: "business-models:scan",
|
|
@@ -8384,22 +7938,22 @@ function buildCustomerProfileBundle(paths = DEFAULT_AGENT_PATHS) {
|
|
|
8384
7938
|
{
|
|
8385
7939
|
name: "type:customer-profile",
|
|
8386
7940
|
color: "5319E7",
|
|
8387
|
-
description: "
|
|
7941
|
+
description: "Researches a customer archetype: discovery, deep profile, or competitor analysis"
|
|
8388
7942
|
},
|
|
8389
7943
|
{
|
|
8390
7944
|
name: "customer:discover",
|
|
8391
7945
|
color: "C5DEF5",
|
|
8392
|
-
description: "Phase 1: scan
|
|
7946
|
+
description: "Phase 1: scan docs for archetype candidates, write discovery report, create profile issues"
|
|
8393
7947
|
},
|
|
8394
7948
|
{
|
|
8395
7949
|
name: "customer:profile",
|
|
8396
7950
|
color: "BFDADC",
|
|
8397
|
-
description: "Phase 2: research one archetype
|
|
7951
|
+
description: "Phase 2: deep-research one archetype: segment, goals, JTBD, constraints, buying process, tech"
|
|
8398
7952
|
},
|
|
8399
7953
|
{
|
|
8400
7954
|
name: "customer:competitors",
|
|
8401
7955
|
color: "D4C5F9",
|
|
8402
|
-
description: "Phase 3: map
|
|
7956
|
+
description: "Phase 3: map feature-matrix rows to archetype needs and hand off req:scan seeds"
|
|
8403
7957
|
}
|
|
8404
7958
|
]
|
|
8405
7959
|
};
|
|
@@ -9266,22 +8820,22 @@ function buildDocsSyncBundle(paths = DEFAULT_AGENT_PATHS) {
|
|
|
9266
8820
|
{
|
|
9267
8821
|
name: "docs-sync:scan",
|
|
9268
8822
|
color: "C5DEF5",
|
|
9269
|
-
description: "Phase 1: scan
|
|
8823
|
+
description: "Phase 1: scan for drift (API diff, TSDoc coverage, references, links, sample compilation)"
|
|
9270
8824
|
},
|
|
9271
8825
|
{
|
|
9272
8826
|
name: "docs-sync:fix",
|
|
9273
8827
|
color: "BFDADC",
|
|
9274
|
-
description: "Phase 2: apply mechanical
|
|
8828
|
+
description: "Phase 2: apply mechanical fixes and file docs:write follow-ups for conceptual changes"
|
|
9275
8829
|
},
|
|
9276
8830
|
{
|
|
9277
8831
|
name: "docs-sync:advisory",
|
|
9278
8832
|
color: "FBCA04",
|
|
9279
|
-
description: "Drift detected by docs-sync but does not block the PR; surfaced as a
|
|
8833
|
+
description: "Drift detected by docs-sync but does not block the PR; surfaced as a sticky-comment note"
|
|
9280
8834
|
},
|
|
9281
8835
|
{
|
|
9282
8836
|
name: "docs-sync:blocking",
|
|
9283
8837
|
color: "B60205",
|
|
9284
|
-
description: "Drift
|
|
8838
|
+
description: "Drift blocks the PR; applied with review:human-required so pr-reviewer owns the merge gate"
|
|
9285
8839
|
}
|
|
9286
8840
|
]
|
|
9287
8841
|
};
|
|
@@ -10876,7 +10430,7 @@ function buildMaintenanceAuditBundle(paths = DEFAULT_AGENT_PATHS) {
|
|
|
10876
10430
|
{
|
|
10877
10431
|
name: "maint:verify",
|
|
10878
10432
|
color: "D4C5F9",
|
|
10879
|
-
description: "Phase 3: re-run
|
|
10433
|
+
description: "Phase 3: re-run scan checks scoped to fix-phase paths, compare findings, close or re-queue scan"
|
|
10880
10434
|
}
|
|
10881
10435
|
]
|
|
10882
10436
|
};
|
|
@@ -15415,7 +14969,7 @@ function buildPeopleProfileBundle(paths = DEFAULT_AGENT_PATHS) {
|
|
|
15415
14969
|
{
|
|
15416
14970
|
name: "people:followup",
|
|
15417
14971
|
color: "D4C5F9",
|
|
15418
|
-
description: "Phase 3: cross-link
|
|
14972
|
+
description: "Phase 3: cross-link profile to companies/software/meetings; enqueue follow-up research issues"
|
|
15419
14973
|
},
|
|
15420
14974
|
{
|
|
15421
14975
|
name: "people:refresh",
|
|
@@ -18215,22 +17769,22 @@ function buildRegulatoryResearchBundle(paths = DEFAULT_AGENT_PATHS) {
|
|
|
18215
17769
|
{
|
|
18216
17770
|
name: "type:regulatory-research",
|
|
18217
17771
|
color: "5319E7",
|
|
18218
|
-
description: "
|
|
17772
|
+
description: "Researches a regulatory obligation: jurisdictional scan, deep-dive, or impact analysis"
|
|
18219
17773
|
},
|
|
18220
17774
|
{
|
|
18221
17775
|
name: "regulatory:scan",
|
|
18222
17776
|
color: "C5DEF5",
|
|
18223
|
-
description: "Phase 1: enumerate regulations
|
|
17777
|
+
description: "Phase 1: enumerate regulations for an industry/jurisdiction/scope; create research issues"
|
|
18224
17778
|
},
|
|
18225
17779
|
{
|
|
18226
17780
|
name: "regulatory:research",
|
|
18227
17781
|
color: "BFDADC",
|
|
18228
|
-
description: "Phase 2: research one regulation in depth
|
|
17782
|
+
description: "Phase 2: research one regulation in depth (scope, triggers, requirements, enforcement)"
|
|
18229
17783
|
},
|
|
18230
17784
|
{
|
|
18231
17785
|
name: "regulatory:impact",
|
|
18232
17786
|
color: "D4C5F9",
|
|
18233
|
-
description: "Phase 3: assess product impact
|
|
17787
|
+
description: "Phase 3: assess product impact and hand off SEC req:scan seeds to requirements-analyst"
|
|
18234
17788
|
}
|
|
18235
17789
|
]
|
|
18236
17790
|
};
|
|
@@ -21507,7 +21061,7 @@ function buildRequirementsWriterBundle(paths = DEFAULT_AGENT_PATHS) {
|
|
|
21507
21061
|
{
|
|
21508
21062
|
name: "tier:customer-workflow",
|
|
21509
21063
|
color: "EDEDED",
|
|
21510
|
-
description: "Architectural tier: customer-configured workflow (business logic tenants configure
|
|
21064
|
+
description: "Architectural tier: customer-configured workflow (business logic tenants configure)"
|
|
21511
21065
|
},
|
|
21512
21066
|
{
|
|
21513
21067
|
name: "tier:consumer-app",
|
|
@@ -22907,7 +22461,7 @@ function buildRequirementsReviewerBundle(paths = DEFAULT_AGENT_PATHS) {
|
|
|
22907
22461
|
{
|
|
22908
22462
|
name: "req:deprecate",
|
|
22909
22463
|
color: "D93F0B",
|
|
22910
|
-
description: "Phase: transition
|
|
22464
|
+
description: "Phase: transition requirement docs to Deprecated/Superseded via the requirements-reviewer"
|
|
22911
22465
|
}
|
|
22912
22466
|
]
|
|
22913
22467
|
};
|
|
@@ -24561,7 +24115,7 @@ function buildSoftwareProfileBundle(paths = DEFAULT_AGENT_PATHS) {
|
|
|
24561
24115
|
{
|
|
24562
24116
|
name: "type:software-profile",
|
|
24563
24117
|
color: "0E8A16",
|
|
24564
|
-
description: "
|
|
24118
|
+
description: "Produces a software profile, research notes, feature-matrix rows, or capability mappings"
|
|
24565
24119
|
},
|
|
24566
24120
|
{
|
|
24567
24121
|
name: "software:research",
|
|
@@ -24581,12 +24135,12 @@ function buildSoftwareProfileBundle(paths = DEFAULT_AGENT_PATHS) {
|
|
|
24581
24135
|
{
|
|
24582
24136
|
name: "software:map",
|
|
24583
24137
|
color: "A2EEEF",
|
|
24584
|
-
description: "Phase 4: map
|
|
24138
|
+
description: "Phase 4: map features to the BCM model and enqueue bcm:outline issues for unmapped features"
|
|
24585
24139
|
},
|
|
24586
24140
|
{
|
|
24587
24141
|
name: "software:followup",
|
|
24588
24142
|
color: "FBCA04",
|
|
24589
|
-
description: "Phase 5: enqueue follow-up research
|
|
24143
|
+
description: "Phase 5: enqueue follow-up research for adjacent products, vendor company, and key people"
|
|
24590
24144
|
}
|
|
24591
24145
|
]
|
|
24592
24146
|
};
|
|
@@ -25913,32 +25467,32 @@ function buildStandardsResearchBundle(paths = DEFAULT_AGENT_PATHS) {
|
|
|
25913
25467
|
{
|
|
25914
25468
|
name: "type:standards-research",
|
|
25915
25469
|
color: "5319E7",
|
|
25916
|
-
description: "
|
|
25470
|
+
description: "Researches an interoperability standard: versions, comparison, extension, or org profile"
|
|
25917
25471
|
},
|
|
25918
25472
|
{
|
|
25919
25473
|
name: "standards:scope",
|
|
25920
25474
|
color: "C5DEF5",
|
|
25921
|
-
description: "Phase 1: plan
|
|
25475
|
+
description: "Phase 1: plan a standard's research campaign; write query plan; create downstream issues"
|
|
25922
25476
|
},
|
|
25923
25477
|
{
|
|
25924
25478
|
name: "standards:research",
|
|
25925
25479
|
color: "BFDADC",
|
|
25926
|
-
description: "Phase 2: research one version
|
|
25480
|
+
description: "Phase 2: research one version (status, key changes, resources, adoption, governance)"
|
|
25927
25481
|
},
|
|
25928
25482
|
{
|
|
25929
25483
|
name: "standards:compare",
|
|
25930
25484
|
color: "D4C5F9",
|
|
25931
|
-
description: "Phase 3: synthesize
|
|
25485
|
+
description: "Phase 3: synthesize cross-version comparison: timeline, maturity, breaking changes, migration"
|
|
25932
25486
|
},
|
|
25933
25487
|
{
|
|
25934
25488
|
name: "standards:extension",
|
|
25935
25489
|
color: "FBCA04",
|
|
25936
|
-
description: "Phase 4: analyze
|
|
25490
|
+
description: "Phase 4: analyze extension for one Partial/Gap entity; hand off Proposed ADR to requirements"
|
|
25937
25491
|
},
|
|
25938
25492
|
{
|
|
25939
25493
|
name: "standards:organizations",
|
|
25940
25494
|
color: "0E8A16",
|
|
25941
|
-
description: "Phase 5: profile one standards-body organization
|
|
25495
|
+
description: "Phase 5: profile one standards-body organization; hand off company/people profile issues"
|
|
25942
25496
|
}
|
|
25943
25497
|
]
|
|
25944
25498
|
};
|
|
@@ -27000,8 +26554,8 @@ var FALLBACKS = {
|
|
|
27000
26554
|
monorepoLayoutSeedBlock: ""
|
|
27001
26555
|
};
|
|
27002
26556
|
var TEMPLATE_RE = /\{\{(\w+(?:\.\w+)*)\}\}/g;
|
|
27003
|
-
function getNestedValue(obj,
|
|
27004
|
-
const parts =
|
|
26557
|
+
function getNestedValue(obj, path8) {
|
|
26558
|
+
const parts = path8.split(".");
|
|
27005
26559
|
let current = obj;
|
|
27006
26560
|
for (const part of parts) {
|
|
27007
26561
|
if (current == null || typeof current !== "object") {
|
|
@@ -27696,26 +27250,6 @@ var SKILL_EVALS_BUNDLE_HOOKS = [
|
|
|
27696
27250
|
["requirements-analyst-workflow", "requirements-analyst"],
|
|
27697
27251
|
["requirements-writer-workflow", "write-requirement"]
|
|
27698
27252
|
];
|
|
27699
|
-
var WORKFLOW_DIAGRAMS_BUNDLE_HOOKS = [
|
|
27700
|
-
["bcm-writer-workflow", "bcm-writer"],
|
|
27701
|
-
["business-models-workflow", "business-models"],
|
|
27702
|
-
["company-profile-workflow", "company-profile"],
|
|
27703
|
-
["customer-profile-workflow", "customer-profile"],
|
|
27704
|
-
["industry-discovery-workflow", "industry-discovery"],
|
|
27705
|
-
["maintenance-audit-workflow", "maintenance-audit"],
|
|
27706
|
-
["meeting-agenda-workflow", "agenda"],
|
|
27707
|
-
["meeting-processing-workflow", "meeting-analysis"],
|
|
27708
|
-
["orchestrator-conventions", "orchestrator"],
|
|
27709
|
-
["people-profile-workflow", "people-profile"],
|
|
27710
|
-
["pr-review-workflow", "pr-review"],
|
|
27711
|
-
["regulatory-research-workflow", "regulatory-research"],
|
|
27712
|
-
["requirements-analyst-workflow", "requirements-analyst"],
|
|
27713
|
-
["requirements-reviewer-workflow", "requirements-reviewer"],
|
|
27714
|
-
["requirements-writer-workflow", "requirements-writer"],
|
|
27715
|
-
["research-pipeline-workflow", "research-pipeline"],
|
|
27716
|
-
["software-profile-workflow", "software-profile"],
|
|
27717
|
-
["standards-research-workflow", "standards-research"]
|
|
27718
|
-
];
|
|
27719
27253
|
var ISSUE_TEMPLATES_BUNDLE_HOOKS = [
|
|
27720
27254
|
["bcm-writer-workflow", "bcm-writer"],
|
|
27721
27255
|
["business-models-workflow", "business-models"],
|
|
@@ -27887,24 +27421,6 @@ var AgentConfig = class _AgentConfig extends Component8 {
|
|
|
27887
27421
|
executable: true
|
|
27888
27422
|
});
|
|
27889
27423
|
}
|
|
27890
|
-
const resolvedWorkflowDiagrams = validateWorkflowDiagramsConfig(
|
|
27891
|
-
this.options.workflowDiagrams
|
|
27892
|
-
);
|
|
27893
|
-
if (resolvedWorkflowDiagrams.enabled) {
|
|
27894
|
-
if (resolvedWorkflowDiagrams.emitChecker) {
|
|
27895
|
-
new TextFile4(this, ".claude/procedures/check-workflow-diagrams.sh", {
|
|
27896
|
-
lines: renderWorkflowDiagramsCheckerScript(
|
|
27897
|
-
resolvedWorkflowDiagrams
|
|
27898
|
-
).split("\n"),
|
|
27899
|
-
executable: true
|
|
27900
|
-
});
|
|
27901
|
-
}
|
|
27902
|
-
if (resolvedWorkflowDiagrams.emitStarterDiagram) {
|
|
27903
|
-
new SampleFile(this.project, resolvedWorkflowDiagrams.diagramsPath, {
|
|
27904
|
-
contents: renderWorkflowDiagramsStarterPage(resolvedWorkflowDiagrams)
|
|
27905
|
-
});
|
|
27906
|
-
}
|
|
27907
|
-
}
|
|
27908
27424
|
const resolvedIssueTemplates = validateIssueTemplatesConfig(
|
|
27909
27425
|
this.options.issueTemplates
|
|
27910
27426
|
);
|
|
@@ -28217,46 +27733,6 @@ ${hook}`
|
|
|
28217
27733
|
|
|
28218
27734
|
---
|
|
28219
27735
|
|
|
28220
|
-
${hook}`
|
|
28221
|
-
});
|
|
28222
|
-
}
|
|
28223
|
-
}
|
|
28224
|
-
const resolvedWorkflowDiagramsForRules = resolveWorkflowDiagrams(
|
|
28225
|
-
this.options.workflowDiagrams
|
|
28226
|
-
);
|
|
28227
|
-
if (this.options.workflowDiagrams) {
|
|
28228
|
-
const workflowDiagramsRule = ruleMap.get("workflow-diagrams-convention");
|
|
28229
|
-
if (workflowDiagramsRule) {
|
|
28230
|
-
const workflowDiagramsContent = renderWorkflowDiagramsRuleContent(
|
|
28231
|
-
resolvedWorkflowDiagramsForRules
|
|
28232
|
-
);
|
|
28233
|
-
if (workflowDiagramsContent !== workflowDiagramsRule.content) {
|
|
28234
|
-
ruleMap.set("workflow-diagrams-convention", {
|
|
28235
|
-
...workflowDiagramsRule,
|
|
28236
|
-
content: workflowDiagramsContent
|
|
28237
|
-
});
|
|
28238
|
-
}
|
|
28239
|
-
}
|
|
28240
|
-
}
|
|
28241
|
-
if (resolvedWorkflowDiagramsForRules.enabled) {
|
|
28242
|
-
for (const [ruleName, label] of WORKFLOW_DIAGRAMS_BUNDLE_HOOKS) {
|
|
28243
|
-
const existing = ruleMap.get(ruleName);
|
|
28244
|
-
if (!existing) {
|
|
28245
|
-
continue;
|
|
28246
|
-
}
|
|
28247
|
-
const hook = renderWorkflowDiagramsBundleHook(
|
|
28248
|
-
resolvedWorkflowDiagramsForRules,
|
|
28249
|
-
label
|
|
28250
|
-
);
|
|
28251
|
-
if (hook.length === 0) {
|
|
28252
|
-
continue;
|
|
28253
|
-
}
|
|
28254
|
-
ruleMap.set(ruleName, {
|
|
28255
|
-
...existing,
|
|
28256
|
-
content: `${existing.content}
|
|
28257
|
-
|
|
28258
|
-
---
|
|
28259
|
-
|
|
28260
27736
|
${hook}`
|
|
28261
27737
|
});
|
|
28262
27738
|
}
|
|
@@ -29688,9 +29164,388 @@ function auditReportJsonSchema() {
|
|
|
29688
29164
|
};
|
|
29689
29165
|
}
|
|
29690
29166
|
|
|
29167
|
+
// src/docs-sync/scan/checks/api-diff-check.ts
|
|
29168
|
+
function parseApiRollup(rollup) {
|
|
29169
|
+
const fenceContents = extractFirstTsFence(rollup);
|
|
29170
|
+
if (fenceContents === void 0) {
|
|
29171
|
+
return [];
|
|
29172
|
+
}
|
|
29173
|
+
const lines = fenceContents.split("\n");
|
|
29174
|
+
const entries = [];
|
|
29175
|
+
let i = 0;
|
|
29176
|
+
while (i < lines.length) {
|
|
29177
|
+
const line = lines[i];
|
|
29178
|
+
const trimmed = line.trim();
|
|
29179
|
+
if (!trimmed.startsWith("export ")) {
|
|
29180
|
+
i += 1;
|
|
29181
|
+
continue;
|
|
29182
|
+
}
|
|
29183
|
+
const startIndex = i;
|
|
29184
|
+
let buffer = trimmed;
|
|
29185
|
+
let braceDepth = countBraceDelta(trimmed);
|
|
29186
|
+
let endsWithSemicolon = trimmed.endsWith(";");
|
|
29187
|
+
i += 1;
|
|
29188
|
+
while (i < lines.length && !isComplete(buffer, braceDepth, endsWithSemicolon)) {
|
|
29189
|
+
const next = lines[i];
|
|
29190
|
+
const nextTrimmed = next.trim();
|
|
29191
|
+
if (nextTrimmed.length === 0 || nextTrimmed.startsWith("//")) {
|
|
29192
|
+
i += 1;
|
|
29193
|
+
continue;
|
|
29194
|
+
}
|
|
29195
|
+
buffer = `${buffer} ${nextTrimmed}`;
|
|
29196
|
+
braceDepth += countBraceDelta(nextTrimmed);
|
|
29197
|
+
endsWithSemicolon = nextTrimmed.endsWith(";");
|
|
29198
|
+
i += 1;
|
|
29199
|
+
}
|
|
29200
|
+
const normalized = normalizeWhitespace(buffer);
|
|
29201
|
+
const name = extractDeclarationName(normalized);
|
|
29202
|
+
if (name) {
|
|
29203
|
+
entries.push({ name, signature: normalized });
|
|
29204
|
+
}
|
|
29205
|
+
if (name && normalized.startsWith("export {")) {
|
|
29206
|
+
const names = extractExportListNames(normalized);
|
|
29207
|
+
if (names.length > 1) {
|
|
29208
|
+
entries.pop();
|
|
29209
|
+
for (const exportName of names) {
|
|
29210
|
+
entries.push({ name: exportName, signature: normalized });
|
|
29211
|
+
}
|
|
29212
|
+
}
|
|
29213
|
+
}
|
|
29214
|
+
if (i === startIndex) {
|
|
29215
|
+
i += 1;
|
|
29216
|
+
}
|
|
29217
|
+
}
|
|
29218
|
+
const dedup = /* @__PURE__ */ new Map();
|
|
29219
|
+
for (const entry of entries) {
|
|
29220
|
+
if (!dedup.has(entry.name)) {
|
|
29221
|
+
dedup.set(entry.name, entry);
|
|
29222
|
+
}
|
|
29223
|
+
}
|
|
29224
|
+
return Array.from(dedup.values()).sort(
|
|
29225
|
+
(a, b) => a.name.localeCompare(b.name)
|
|
29226
|
+
);
|
|
29227
|
+
}
|
|
29228
|
+
function diffApiRollups(baselineRollup, currentRollup) {
|
|
29229
|
+
const baseline = /* @__PURE__ */ new Map();
|
|
29230
|
+
for (const entry of parseApiRollup(baselineRollup)) {
|
|
29231
|
+
baseline.set(entry.name, entry);
|
|
29232
|
+
}
|
|
29233
|
+
const current = /* @__PURE__ */ new Map();
|
|
29234
|
+
for (const entry of parseApiRollup(currentRollup)) {
|
|
29235
|
+
current.set(entry.name, entry);
|
|
29236
|
+
}
|
|
29237
|
+
const added = [];
|
|
29238
|
+
const removed = [];
|
|
29239
|
+
const changed = [];
|
|
29240
|
+
for (const [name, entry] of current.entries()) {
|
|
29241
|
+
const before = baseline.get(name);
|
|
29242
|
+
if (!before) {
|
|
29243
|
+
added.push(entry);
|
|
29244
|
+
continue;
|
|
29245
|
+
}
|
|
29246
|
+
if (before.signature !== entry.signature) {
|
|
29247
|
+
changed.push(entry);
|
|
29248
|
+
}
|
|
29249
|
+
}
|
|
29250
|
+
for (const [name, entry] of baseline.entries()) {
|
|
29251
|
+
if (!current.has(name)) {
|
|
29252
|
+
removed.push(entry);
|
|
29253
|
+
}
|
|
29254
|
+
}
|
|
29255
|
+
added.sort((a, b) => a.name.localeCompare(b.name));
|
|
29256
|
+
removed.sort((a, b) => a.name.localeCompare(b.name));
|
|
29257
|
+
changed.sort((a, b) => a.name.localeCompare(b.name));
|
|
29258
|
+
return { added, removed, changed };
|
|
29259
|
+
}
|
|
29260
|
+
function createApiDiffCheck(options) {
|
|
29261
|
+
const baseline = options.baselineRollup;
|
|
29262
|
+
const current = options.currentRollup;
|
|
29263
|
+
const rollupPath = options.rollupPath ?? "";
|
|
29264
|
+
return {
|
|
29265
|
+
name: options.name ?? "apiDiff",
|
|
29266
|
+
run(_context) {
|
|
29267
|
+
const diff = diffApiRollups(baseline, current);
|
|
29268
|
+
const findings = [];
|
|
29269
|
+
for (const entry of diff.added) {
|
|
29270
|
+
findings.push({
|
|
29271
|
+
category: AuditCategory.ApiDiff,
|
|
29272
|
+
severity: AuditSeverity.Mechanical,
|
|
29273
|
+
location: { file: rollupPath, line: 0 },
|
|
29274
|
+
subject: entry.name,
|
|
29275
|
+
details: `New public export \`${entry.name}\` not present in baseline rollup.`,
|
|
29276
|
+
change: "added",
|
|
29277
|
+
symbol: entry.name,
|
|
29278
|
+
fixHint: "stub-tsdoc"
|
|
29279
|
+
});
|
|
29280
|
+
}
|
|
29281
|
+
for (const entry of diff.removed) {
|
|
29282
|
+
findings.push({
|
|
29283
|
+
category: AuditCategory.ApiDiff,
|
|
29284
|
+
severity: AuditSeverity.Advisory,
|
|
29285
|
+
location: { file: rollupPath, line: 0 },
|
|
29286
|
+
subject: entry.name,
|
|
29287
|
+
details: `Public export \`${entry.name}\` was present in baseline rollup but is gone in the current rollup.`,
|
|
29288
|
+
change: "removed",
|
|
29289
|
+
symbol: entry.name
|
|
29290
|
+
});
|
|
29291
|
+
}
|
|
29292
|
+
for (const entry of diff.changed) {
|
|
29293
|
+
findings.push({
|
|
29294
|
+
category: AuditCategory.ApiDiff,
|
|
29295
|
+
severity: AuditSeverity.Advisory,
|
|
29296
|
+
location: { file: rollupPath, line: 0 },
|
|
29297
|
+
subject: entry.name,
|
|
29298
|
+
details: `Public export \`${entry.name}\` signature changed since baseline rollup.`,
|
|
29299
|
+
change: "changed",
|
|
29300
|
+
symbol: entry.name
|
|
29301
|
+
});
|
|
29302
|
+
}
|
|
29303
|
+
return findings;
|
|
29304
|
+
}
|
|
29305
|
+
};
|
|
29306
|
+
}
|
|
29307
|
+
function extractFirstTsFence(rollup) {
|
|
29308
|
+
const lines = rollup.split("\n");
|
|
29309
|
+
let start = -1;
|
|
29310
|
+
for (let i = 0; i < lines.length; i++) {
|
|
29311
|
+
const line = lines[i].trim();
|
|
29312
|
+
if (line === "```ts" || line === "```typescript") {
|
|
29313
|
+
start = i + 1;
|
|
29314
|
+
break;
|
|
29315
|
+
}
|
|
29316
|
+
}
|
|
29317
|
+
if (start < 0) {
|
|
29318
|
+
return void 0;
|
|
29319
|
+
}
|
|
29320
|
+
for (let j = start; j < lines.length; j++) {
|
|
29321
|
+
if (lines[j].trim() === "```") {
|
|
29322
|
+
return lines.slice(start, j).join("\n");
|
|
29323
|
+
}
|
|
29324
|
+
}
|
|
29325
|
+
return lines.slice(start).join("\n");
|
|
29326
|
+
}
|
|
29327
|
+
function countBraceDelta(line) {
|
|
29328
|
+
let delta = 0;
|
|
29329
|
+
for (const ch of line) {
|
|
29330
|
+
if (ch === "{") {
|
|
29331
|
+
delta += 1;
|
|
29332
|
+
} else if (ch === "}") {
|
|
29333
|
+
delta -= 1;
|
|
29334
|
+
}
|
|
29335
|
+
}
|
|
29336
|
+
return delta;
|
|
29337
|
+
}
|
|
29338
|
+
function isComplete(buffer, braceDepth, endsWithSemicolon) {
|
|
29339
|
+
if (braceDepth > 0) {
|
|
29340
|
+
return false;
|
|
29341
|
+
}
|
|
29342
|
+
if (endsWithSemicolon) {
|
|
29343
|
+
return true;
|
|
29344
|
+
}
|
|
29345
|
+
return buffer.trimEnd().endsWith("}");
|
|
29346
|
+
}
|
|
29347
|
+
function normalizeWhitespace(s) {
|
|
29348
|
+
return s.replace(/\s+/g, " ").replace(/\(\s+/g, "(").replace(/\s+\)/g, ")").replace(/\[\s+/g, "[").replace(/\s+\]/g, "]").replace(/\{\s+/g, "{").replace(/\s+\}/g, "}").replace(/\s+,/g, ",").replace(/\s+;/g, ";").replace(/\s+:/g, ":").trim();
|
|
29349
|
+
}
|
|
29350
|
+
var DECLARATION_KEYWORDS = [
|
|
29351
|
+
"function",
|
|
29352
|
+
"class",
|
|
29353
|
+
"interface",
|
|
29354
|
+
"type",
|
|
29355
|
+
"enum",
|
|
29356
|
+
"const",
|
|
29357
|
+
"let",
|
|
29358
|
+
"var",
|
|
29359
|
+
"namespace",
|
|
29360
|
+
"abstract",
|
|
29361
|
+
"default",
|
|
29362
|
+
"async"
|
|
29363
|
+
];
|
|
29364
|
+
function extractDeclarationName(declaration) {
|
|
29365
|
+
const tokens = declaration.split(/\s+/);
|
|
29366
|
+
if (tokens.length === 0 || tokens[0] !== "export") {
|
|
29367
|
+
return void 0;
|
|
29368
|
+
}
|
|
29369
|
+
let cursor = 1;
|
|
29370
|
+
while (cursor < tokens.length && DECLARATION_KEYWORDS.includes(tokens[cursor])) {
|
|
29371
|
+
cursor += 1;
|
|
29372
|
+
}
|
|
29373
|
+
if (cursor >= tokens.length) {
|
|
29374
|
+
return void 0;
|
|
29375
|
+
}
|
|
29376
|
+
const candidate = tokens[cursor];
|
|
29377
|
+
if (candidate.startsWith("{")) {
|
|
29378
|
+
const stripped = candidate.replace(/^\{/, "").replace(/[},].*$/, "");
|
|
29379
|
+
return stripped || void 0;
|
|
29380
|
+
}
|
|
29381
|
+
const cleaned = candidate.replace(/[<(:;].*$/, "");
|
|
29382
|
+
return cleaned || void 0;
|
|
29383
|
+
}
|
|
29384
|
+
function extractExportListNames(declaration) {
|
|
29385
|
+
const open = declaration.indexOf("{");
|
|
29386
|
+
const close = declaration.indexOf("}", open);
|
|
29387
|
+
if (open < 0 || close < 0) {
|
|
29388
|
+
return [];
|
|
29389
|
+
}
|
|
29390
|
+
const inside = declaration.slice(open + 1, close);
|
|
29391
|
+
const names = [];
|
|
29392
|
+
for (const part of inside.split(",")) {
|
|
29393
|
+
const token = part.trim();
|
|
29394
|
+
if (!token) {
|
|
29395
|
+
continue;
|
|
29396
|
+
}
|
|
29397
|
+
const asMatch = token.match(/\sas\s+(\S+)$/);
|
|
29398
|
+
if (asMatch) {
|
|
29399
|
+
names.push(asMatch[1]);
|
|
29400
|
+
} else {
|
|
29401
|
+
names.push(token);
|
|
29402
|
+
}
|
|
29403
|
+
}
|
|
29404
|
+
return names;
|
|
29405
|
+
}
|
|
29406
|
+
|
|
29407
|
+
// src/docs-sync/scan/checks/reference-mismatch-check.ts
|
|
29408
|
+
function referenceRecordToFinding(record, signatureChangedSymbols) {
|
|
29409
|
+
if (signatureChangedSymbols.has(record.symbol)) {
|
|
29410
|
+
return {
|
|
29411
|
+
category: AuditCategory.ReferenceMismatches,
|
|
29412
|
+
severity: AuditSeverity.Advisory,
|
|
29413
|
+
location: { file: record.docPath, line: record.line },
|
|
29414
|
+
subject: record.symbol,
|
|
29415
|
+
details: `Inline reference \`${record.symbol}\` resolves to a symbol whose signature has changed; review the surrounding prose.`,
|
|
29416
|
+
mismatch: "signature-changed",
|
|
29417
|
+
symbol: record.symbol
|
|
29418
|
+
};
|
|
29419
|
+
}
|
|
29420
|
+
if (!record.isKnown) {
|
|
29421
|
+
return {
|
|
29422
|
+
category: AuditCategory.ReferenceMismatches,
|
|
29423
|
+
severity: AuditSeverity.Advisory,
|
|
29424
|
+
location: { file: record.docPath, line: record.line },
|
|
29425
|
+
subject: record.symbol,
|
|
29426
|
+
details: `Inline reference \`${record.symbol}\` does not match any known public export.`,
|
|
29427
|
+
mismatch: "unknown-symbol",
|
|
29428
|
+
symbol: record.symbol
|
|
29429
|
+
};
|
|
29430
|
+
}
|
|
29431
|
+
return void 0;
|
|
29432
|
+
}
|
|
29433
|
+
function createReferenceMismatchCheck(options) {
|
|
29434
|
+
const records = options.records;
|
|
29435
|
+
const signatureChangedSymbols = new Set(
|
|
29436
|
+
options.signatureChangedSymbols ?? []
|
|
29437
|
+
);
|
|
29438
|
+
return {
|
|
29439
|
+
name: options.name ?? "referenceMismatches",
|
|
29440
|
+
run(_context) {
|
|
29441
|
+
const findings = [];
|
|
29442
|
+
for (const record of records) {
|
|
29443
|
+
const finding = referenceRecordToFinding(
|
|
29444
|
+
record,
|
|
29445
|
+
signatureChangedSymbols
|
|
29446
|
+
);
|
|
29447
|
+
if (finding !== void 0) {
|
|
29448
|
+
findings.push(finding);
|
|
29449
|
+
}
|
|
29450
|
+
}
|
|
29451
|
+
return findings;
|
|
29452
|
+
}
|
|
29453
|
+
};
|
|
29454
|
+
}
|
|
29455
|
+
|
|
29456
|
+
// src/docs-sync/scan/checks/tsdoc-coverage-check.ts
|
|
29457
|
+
import * as path5 from "path";
|
|
29458
|
+
function tsdocRecordToFindings(record, context) {
|
|
29459
|
+
const findings = [];
|
|
29460
|
+
const file = relativizeFile(record.location.file, context.repoRoot);
|
|
29461
|
+
const line = record.location.line;
|
|
29462
|
+
const symbol = record.symbol;
|
|
29463
|
+
if (!record.hasSummary) {
|
|
29464
|
+
findings.push({
|
|
29465
|
+
category: AuditCategory.TsdocCoverage,
|
|
29466
|
+
severity: AuditSeverity.Mechanical,
|
|
29467
|
+
location: { file, line },
|
|
29468
|
+
subject: symbol,
|
|
29469
|
+
details: `Public export \`${symbol}\` is missing a TSDoc summary.`,
|
|
29470
|
+
shortfall: "missing-summary",
|
|
29471
|
+
symbol,
|
|
29472
|
+
fixHint: "stub-tsdoc"
|
|
29473
|
+
});
|
|
29474
|
+
return findings;
|
|
29475
|
+
}
|
|
29476
|
+
if (record.hasThinSummary) {
|
|
29477
|
+
findings.push({
|
|
29478
|
+
category: AuditCategory.TsdocCoverage,
|
|
29479
|
+
severity: AuditSeverity.Advisory,
|
|
29480
|
+
location: { file, line },
|
|
29481
|
+
subject: symbol,
|
|
29482
|
+
details: `Public export \`${symbol}\` carries a thin TSDoc summary; consider expanding it.`,
|
|
29483
|
+
shortfall: "thin-summary",
|
|
29484
|
+
symbol
|
|
29485
|
+
});
|
|
29486
|
+
}
|
|
29487
|
+
if (!record.hasParams && isParamCarryingKind(record)) {
|
|
29488
|
+
findings.push({
|
|
29489
|
+
category: AuditCategory.TsdocCoverage,
|
|
29490
|
+
severity: AuditSeverity.Advisory,
|
|
29491
|
+
location: { file, line },
|
|
29492
|
+
subject: symbol,
|
|
29493
|
+
details: `Public export \`${symbol}\` has parameters with no \`@param\` block tag.`,
|
|
29494
|
+
shortfall: "missing-params",
|
|
29495
|
+
symbol
|
|
29496
|
+
});
|
|
29497
|
+
}
|
|
29498
|
+
if (!record.hasReturns && isReturnCarryingKind(record)) {
|
|
29499
|
+
findings.push({
|
|
29500
|
+
category: AuditCategory.TsdocCoverage,
|
|
29501
|
+
severity: AuditSeverity.Advisory,
|
|
29502
|
+
location: { file, line },
|
|
29503
|
+
subject: symbol,
|
|
29504
|
+
details: `Public export \`${symbol}\` has a return value with no \`@returns\` block tag.`,
|
|
29505
|
+
shortfall: "missing-returns",
|
|
29506
|
+
symbol
|
|
29507
|
+
});
|
|
29508
|
+
}
|
|
29509
|
+
return findings;
|
|
29510
|
+
}
|
|
29511
|
+
function createTsdocCoverageCheck(options) {
|
|
29512
|
+
const records = options.records;
|
|
29513
|
+
return {
|
|
29514
|
+
name: options.name ?? "tsdocCoverage",
|
|
29515
|
+
run(context) {
|
|
29516
|
+
const findings = [];
|
|
29517
|
+
for (const record of records) {
|
|
29518
|
+
for (const finding of tsdocRecordToFindings(record, context)) {
|
|
29519
|
+
findings.push(finding);
|
|
29520
|
+
}
|
|
29521
|
+
}
|
|
29522
|
+
return findings;
|
|
29523
|
+
}
|
|
29524
|
+
};
|
|
29525
|
+
}
|
|
29526
|
+
function isParamCarryingKind(record) {
|
|
29527
|
+
return record.kind === "Function";
|
|
29528
|
+
}
|
|
29529
|
+
function isReturnCarryingKind(record) {
|
|
29530
|
+
return record.kind === "Function";
|
|
29531
|
+
}
|
|
29532
|
+
function relativizeFile(file, repoRoot) {
|
|
29533
|
+
if (!file) {
|
|
29534
|
+
return "";
|
|
29535
|
+
}
|
|
29536
|
+
if (!path5.isAbsolute(file)) {
|
|
29537
|
+
return toPosix3(file);
|
|
29538
|
+
}
|
|
29539
|
+
const rel = path5.relative(repoRoot, file);
|
|
29540
|
+
return toPosix3(rel);
|
|
29541
|
+
}
|
|
29542
|
+
function toPosix3(p) {
|
|
29543
|
+
return p.split(path5.sep).join("/");
|
|
29544
|
+
}
|
|
29545
|
+
|
|
29691
29546
|
// src/docs-sync/scan/run-scan.ts
|
|
29692
29547
|
import * as fs3 from "fs";
|
|
29693
|
-
import * as
|
|
29548
|
+
import * as path6 from "path";
|
|
29694
29549
|
var DEFAULT_AUDIT_REPORT_DIR = ".claude/state/docs-sync";
|
|
29695
29550
|
var SEVERITY_RANK = {
|
|
29696
29551
|
blocking: 0,
|
|
@@ -29705,7 +29560,7 @@ var AUDIT_CATEGORY_ORDER = [
|
|
|
29705
29560
|
AuditCategory.SampleFailures
|
|
29706
29561
|
];
|
|
29707
29562
|
function runScan(options) {
|
|
29708
|
-
const repoRoot =
|
|
29563
|
+
const repoRoot = path6.resolve(options.repoRoot);
|
|
29709
29564
|
const mode = options.mode;
|
|
29710
29565
|
const scope = options.scope ?? "";
|
|
29711
29566
|
const issueNumber = options.issueNumber;
|
|
@@ -29780,11 +29635,11 @@ function buildReport(args) {
|
|
|
29780
29635
|
};
|
|
29781
29636
|
}
|
|
29782
29637
|
function persistAuditReport(args) {
|
|
29783
|
-
const repoRoot =
|
|
29638
|
+
const repoRoot = path6.resolve(args.repoRoot);
|
|
29784
29639
|
const reportDir = args.reportDir ?? DEFAULT_AUDIT_REPORT_DIR;
|
|
29785
|
-
const targetDir =
|
|
29640
|
+
const targetDir = path6.resolve(repoRoot, reportDir);
|
|
29786
29641
|
fs3.mkdirSync(targetDir, { recursive: true });
|
|
29787
|
-
const targetFile =
|
|
29642
|
+
const targetFile = path6.join(
|
|
29788
29643
|
targetDir,
|
|
29789
29644
|
`${args.report.issueNumber}-audit.json`
|
|
29790
29645
|
);
|
|
@@ -29847,7 +29702,7 @@ function compareFindings(a, b) {
|
|
|
29847
29702
|
}
|
|
29848
29703
|
|
|
29849
29704
|
// src/docs-sync/tsdoc-coverage/coverage.ts
|
|
29850
|
-
import * as
|
|
29705
|
+
import * as path7 from "path";
|
|
29851
29706
|
import { TSDocParser } from "@microsoft/tsdoc";
|
|
29852
29707
|
import * as ts2 from "typescript";
|
|
29853
29708
|
var TsDocCoverageKind = {
|
|
@@ -29865,8 +29720,8 @@ var DEFAULT_THIN_SUMMARY_WORD_THRESHOLD = 4;
|
|
|
29865
29720
|
var DEFAULT_ENTRY_POINT = "src/index.ts";
|
|
29866
29721
|
function analyzeTsDocCoverage(options) {
|
|
29867
29722
|
const resolvedOptions = typeof options === "string" ? { packageRoot: options } : options;
|
|
29868
|
-
const packageRoot =
|
|
29869
|
-
const entryPoint =
|
|
29723
|
+
const packageRoot = path7.resolve(resolvedOptions.packageRoot);
|
|
29724
|
+
const entryPoint = path7.resolve(
|
|
29870
29725
|
packageRoot,
|
|
29871
29726
|
resolvedOptions.entryPoint ?? DEFAULT_ENTRY_POINT
|
|
29872
29727
|
);
|
|
@@ -29929,7 +29784,7 @@ function analyzeTsDocCoverage(options) {
|
|
|
29929
29784
|
}
|
|
29930
29785
|
function resolveCompilerOptions(packageRoot, tsconfigPath) {
|
|
29931
29786
|
if (tsconfigPath) {
|
|
29932
|
-
const absoluteTsconfig =
|
|
29787
|
+
const absoluteTsconfig = path7.resolve(packageRoot, tsconfigPath);
|
|
29933
29788
|
const configFile = ts2.readConfigFile(absoluteTsconfig, ts2.sys.readFile);
|
|
29934
29789
|
if (configFile.error) {
|
|
29935
29790
|
throw new Error(
|
|
@@ -29939,7 +29794,7 @@ function resolveCompilerOptions(packageRoot, tsconfigPath) {
|
|
|
29939
29794
|
const parsed = ts2.parseJsonConfigFileContent(
|
|
29940
29795
|
configFile.config,
|
|
29941
29796
|
ts2.sys,
|
|
29942
|
-
|
|
29797
|
+
path7.dirname(absoluteTsconfig)
|
|
29943
29798
|
);
|
|
29944
29799
|
return { ...parsed.options, noEmit: true };
|
|
29945
29800
|
}
|
|
@@ -30248,14 +30103,14 @@ var LAYOUT_ROOT_BY_PROJECT_TYPE = {
|
|
|
30248
30103
|
};
|
|
30249
30104
|
function validateMonorepoLayout(root) {
|
|
30250
30105
|
const violations = [];
|
|
30251
|
-
const rootOutdir =
|
|
30106
|
+
const rootOutdir = toPosix4(root.outdir);
|
|
30252
30107
|
for (const sub of root.subprojects) {
|
|
30253
30108
|
const className = sub.constructor.name;
|
|
30254
30109
|
const expectedRoot = expectedRootFor(sub, className);
|
|
30255
30110
|
if (expectedRoot === void 0) {
|
|
30256
30111
|
continue;
|
|
30257
30112
|
}
|
|
30258
|
-
const relOutdir = relativeOutdir(rootOutdir,
|
|
30113
|
+
const relOutdir = relativeOutdir(rootOutdir, toPosix4(sub.outdir));
|
|
30259
30114
|
if (!outdirMatchesRoot(relOutdir, expectedRoot)) {
|
|
30260
30115
|
violations.push({
|
|
30261
30116
|
projectName: sub.name,
|
|
@@ -30314,7 +30169,7 @@ function outdirMatchesRoot(relOutdir, expectedRoot) {
|
|
|
30314
30169
|
}
|
|
30315
30170
|
return segments.length >= 2;
|
|
30316
30171
|
}
|
|
30317
|
-
function
|
|
30172
|
+
function toPosix4(p) {
|
|
30318
30173
|
return p.replace(/\\/g, "/");
|
|
30319
30174
|
}
|
|
30320
30175
|
function relativeOutdir(rootOutdir, subOutdir) {
|
|
@@ -30403,8 +30258,8 @@ var ResetTask = class _ResetTask extends Component14 {
|
|
|
30403
30258
|
const resetTask = this.project.tasks.addTask(this.taskName, {
|
|
30404
30259
|
description: "Delete build artifacts specified by pathsToRemove option, or artifactsDirectory if pathsToRemove is empty"
|
|
30405
30260
|
});
|
|
30406
|
-
this.pathsToRemove.forEach((
|
|
30407
|
-
resetTask.exec(`[ -e "${
|
|
30261
|
+
this.pathsToRemove.forEach((path8) => {
|
|
30262
|
+
resetTask.exec(`[ -e "${path8}" ] && rm -rf ${path8} || true`);
|
|
30408
30263
|
});
|
|
30409
30264
|
const rootHasTurbo = TurboRepo.of(this.project.root) !== void 0;
|
|
30410
30265
|
const isSubproject = this.project !== this.project.root;
|
|
@@ -30746,6 +30601,7 @@ var DEFAULT_TYPE_LABELS = [
|
|
|
30746
30601
|
];
|
|
30747
30602
|
var DEFAULT_WORKFLOW_NAME2 = "sync-labels";
|
|
30748
30603
|
var LABELS_CONFIG_PATH = ".github/labels.yml";
|
|
30604
|
+
var MAX_LABEL_DESCRIPTION_LENGTH = 100;
|
|
30749
30605
|
function addSyncLabelsWorkflow(project, options) {
|
|
30750
30606
|
const workflowName = options.workflowName ?? DEFAULT_WORKFLOW_NAME2;
|
|
30751
30607
|
const deleteOtherLabels = options.deleteOtherLabels ?? true;
|
|
@@ -30768,6 +30624,18 @@ function addSyncLabelsWorkflow(project, options) {
|
|
|
30768
30624
|
labelMap.set(label.name, label);
|
|
30769
30625
|
}
|
|
30770
30626
|
const allLabels = [...labelMap.values()];
|
|
30627
|
+
const overlength = allLabels.filter(
|
|
30628
|
+
(l) => (l.description ?? "").length > MAX_LABEL_DESCRIPTION_LENGTH
|
|
30629
|
+
);
|
|
30630
|
+
if (overlength.length > 0) {
|
|
30631
|
+
const offenders = overlength.map(
|
|
30632
|
+
(l) => ` - ${l.name} (${(l.description ?? "").length} chars): ${l.description}`
|
|
30633
|
+
).join("\n");
|
|
30634
|
+
throw new Error(
|
|
30635
|
+
`The following label descriptions exceed GitHub's ${MAX_LABEL_DESCRIPTION_LENGTH}-char limit and would break the sync-labels workflow:
|
|
30636
|
+
${offenders}`
|
|
30637
|
+
);
|
|
30638
|
+
}
|
|
30771
30639
|
new LabelsFile(project, allLabels);
|
|
30772
30640
|
const workflow = project.github?.addWorkflow(workflowName);
|
|
30773
30641
|
if (!workflow) {
|
|
@@ -32312,7 +32180,7 @@ export const collections = {
|
|
|
32312
32180
|
`;
|
|
32313
32181
|
|
|
32314
32182
|
// src/typescript/typescript-config.ts
|
|
32315
|
-
import { relative as
|
|
32183
|
+
import { relative as relative7 } from "path";
|
|
32316
32184
|
import { Component as Component19 } from "projen";
|
|
32317
32185
|
import { ensureRelativePathStartsWithDot } from "projen/lib/util/path";
|
|
32318
32186
|
var TypeScriptConfig = class extends Component19 {
|
|
@@ -32331,7 +32199,7 @@ var TypeScriptConfig = class extends Component19 {
|
|
|
32331
32199
|
...tsPaths,
|
|
32332
32200
|
[dep.name]: [
|
|
32333
32201
|
ensureRelativePathStartsWithDot(
|
|
32334
|
-
|
|
32202
|
+
relative7(project.outdir, subproject.outdir)
|
|
32335
32203
|
)
|
|
32336
32204
|
]
|
|
32337
32205
|
};
|
|
@@ -32412,16 +32280,11 @@ export {
|
|
|
32412
32280
|
DEFAULT_TYPE_LABELS,
|
|
32413
32281
|
DEFAULT_UNBLOCK_COMMENT_TEMPLATE,
|
|
32414
32282
|
DEFAULT_UNBLOCK_DEPENDENTS_ENABLED,
|
|
32415
|
-
DEFAULT_WORKFLOW_DIAGRAMS_BUNDLE_PATH_PATTERNS,
|
|
32416
|
-
DEFAULT_WORKFLOW_DIAGRAMS_EMIT_CHECKER,
|
|
32417
|
-
DEFAULT_WORKFLOW_DIAGRAMS_EMIT_STARTER,
|
|
32418
|
-
DEFAULT_WORKFLOW_DIAGRAMS_ENABLED,
|
|
32419
|
-
DEFAULT_WORKFLOW_DIAGRAMS_PATH,
|
|
32420
|
-
DEFAULT_WORKFLOW_DIAGRAMS_REQUIRE_UPDATE,
|
|
32421
32283
|
DOCS_SYNC_AUDIT_SCHEMA_VERSION,
|
|
32422
32284
|
JsiiFaker,
|
|
32423
32285
|
LAYOUT_ENFORCEMENT,
|
|
32424
32286
|
LAYOUT_ROOT_BY_PROJECT_TYPE,
|
|
32287
|
+
MAX_LABEL_DESCRIPTION_LENGTH,
|
|
32425
32288
|
MCP_TRANSPORT,
|
|
32426
32289
|
MERGE_METHODS,
|
|
32427
32290
|
MIMIMUM_RELEASE_AGE,
|
|
@@ -32492,7 +32355,11 @@ export {
|
|
|
32492
32355
|
classifyRun,
|
|
32493
32356
|
companyProfileBundle,
|
|
32494
32357
|
compileFencedSamples,
|
|
32358
|
+
createApiDiffCheck,
|
|
32359
|
+
createReferenceMismatchCheck,
|
|
32360
|
+
createTsdocCoverageCheck,
|
|
32495
32361
|
customerProfileBundle,
|
|
32362
|
+
diffApiRollups,
|
|
32496
32363
|
docsSyncBundle,
|
|
32497
32364
|
emptyCategoryBuckets,
|
|
32498
32365
|
extractApiProcedure,
|
|
@@ -32507,11 +32374,13 @@ export {
|
|
|
32507
32374
|
maintenanceAuditBundle,
|
|
32508
32375
|
meetingAnalysisBundle,
|
|
32509
32376
|
orchestratorBundle,
|
|
32377
|
+
parseApiRollup,
|
|
32510
32378
|
peopleProfileBundle,
|
|
32511
32379
|
persistAuditReport,
|
|
32512
32380
|
pnpmBundle,
|
|
32513
32381
|
prReviewBundle,
|
|
32514
32382
|
projenBundle,
|
|
32383
|
+
referenceRecordToFinding,
|
|
32515
32384
|
regulatoryResearchBundle,
|
|
32516
32385
|
renderAgentTierCaseStatement,
|
|
32517
32386
|
renderAgentTierSection,
|
|
@@ -32548,10 +32417,6 @@ export {
|
|
|
32548
32417
|
renderSourceTierExamples,
|
|
32549
32418
|
renderUnblockDependentsScript,
|
|
32550
32419
|
renderUnblockDependentsSection,
|
|
32551
|
-
renderWorkflowDiagramsBundleHook,
|
|
32552
|
-
renderWorkflowDiagramsCheckerScript,
|
|
32553
|
-
renderWorkflowDiagramsRuleContent,
|
|
32554
|
-
renderWorkflowDiagramsStarterPage,
|
|
32555
32420
|
requirementsAnalystBundle,
|
|
32556
32421
|
requirementsReviewerBundle,
|
|
32557
32422
|
requirementsWriterBundle,
|
|
@@ -32574,11 +32439,11 @@ export {
|
|
|
32574
32439
|
resolveTemplateVariables,
|
|
32575
32440
|
resolveTypeScriptProjectOutdir,
|
|
32576
32441
|
resolveUnblockDependents,
|
|
32577
|
-
resolveWorkflowDiagrams,
|
|
32578
32442
|
runScan,
|
|
32579
32443
|
slackBundle,
|
|
32580
32444
|
softwareProfileBundle,
|
|
32581
32445
|
standardsResearchBundle,
|
|
32446
|
+
tsdocRecordToFindings,
|
|
32582
32447
|
turborepoBundle,
|
|
32583
32448
|
typescriptBundle,
|
|
32584
32449
|
validateAgentTierConfig,
|
|
@@ -32593,7 +32458,6 @@ export {
|
|
|
32593
32458
|
validateSkillEvalsConfig,
|
|
32594
32459
|
validateStarlightSingleton,
|
|
32595
32460
|
validateUnblockDependentsConfig,
|
|
32596
|
-
validateWorkflowDiagramsConfig,
|
|
32597
32461
|
vitestBundle
|
|
32598
32462
|
};
|
|
32599
32463
|
//# sourceMappingURL=index.mjs.map
|