@sideboard-ai/core 0.1.15 → 0.1.22
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/dist/{agents-RO3AJ76Q.js → agents-RYOW25YJ.js} +1 -1
- package/dist/{chunk-TNIAXABV.js → chunk-BMB7WCGF.js} +9 -10
- package/dist/{chunk-MGSJQMJA.js → chunk-PER4N6LS.js} +7 -3
- package/dist/{chunk-L44AX7IG.js → chunk-UFWEANLU.js} +489 -35
- package/dist/{chunk-MAWKQA2Y.js → chunk-ULFES3M5.js} +36 -55
- package/dist/{chunk-MEI4AXV4.js → chunk-V54GKKCI.js} +21 -3
- package/dist/{chunk-3OJG4LP4.js → chunk-Y2EWQ4TL.js} +2 -2
- package/dist/{coordinator-prompt-G6T7ORT3.js → coordinator-prompt-QH35ES7Y.js} +2 -2
- package/dist/{global-workspace-H642B5OI.js → global-workspace-LM4AA4RO.js} +3 -3
- package/dist/index.cjs +615 -93
- package/dist/index.d.cts +50 -11
- package/dist/index.d.ts +50 -11
- package/dist/index.js +64 -6
- package/dist/mcp/run-stdio.cjs +3069 -2606
- package/dist/mcp/run-stdio.js +6 -6
- package/dist/{workspaces-4EREGLB7.js → workspaces-23GHLR7I.js} +4 -4
- package/dist/{worktree-ZDHZMLSJ.js → worktree-RYTBDHHP.js} +11 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -899,13 +899,383 @@ var init_cloud_connect_constants = __esm({
|
|
|
899
899
|
}
|
|
900
900
|
});
|
|
901
901
|
|
|
902
|
+
// src/git/team-meta.ts
|
|
903
|
+
var SOCCER_TEAM_META;
|
|
904
|
+
var init_team_meta = __esm({
|
|
905
|
+
"src/git/team-meta.ts"() {
|
|
906
|
+
"use strict";
|
|
907
|
+
SOCCER_TEAM_META = {
|
|
908
|
+
"aalborg": { location: "Aalborg, Denmark", league: "Danish Superliga" },
|
|
909
|
+
"aalesund": { location: "\xC5lesund, Norway", league: "Norwegian First Division" },
|
|
910
|
+
"aarhus": { location: "Aarhus, Denmark", league: "Danish Superliga" },
|
|
911
|
+
"aberdeen": { location: "Aberdeen, Scotland", league: "Scottish Premiership" },
|
|
912
|
+
"ac-milan": { location: "Milan, Italy", league: "Serie A" },
|
|
913
|
+
"ado-den-haag": { location: "The Hague, Netherlands", league: "Eerste Divisie" },
|
|
914
|
+
"aik": { location: "Stockholm, Sweden", league: "Allsvenskan" },
|
|
915
|
+
"ajaccio": { location: "Ajaccio, France", league: "Ligue 2" },
|
|
916
|
+
"ajax": { location: "Amsterdam, Netherlands", league: "Eredivisie" },
|
|
917
|
+
"al-ahly": { location: "Cairo, Egypt", league: "Egyptian Premier League" },
|
|
918
|
+
"al-hilal": { location: "Riyadh, Saudi Arabia", league: "Saudi Pro League" },
|
|
919
|
+
"alajuelense": { location: "Alajuela, Costa Rica", league: "Liga FPD" },
|
|
920
|
+
"almere-city": { location: "Almere, Netherlands", league: "Eredivisie" },
|
|
921
|
+
"amiens": { location: "Amiens, France", league: "Ligue 2" },
|
|
922
|
+
"angers": { location: "Angers, France", league: "Ligue 1" },
|
|
923
|
+
"anyang": { location: "Anyang, South Korea", league: "K League 1" },
|
|
924
|
+
"argentinos-juniors": { location: "Buenos Aires, Argentina", league: "Argentine Primera Divisi\xF3n" },
|
|
925
|
+
"arsenal": { location: "London, England", league: "Premier League" },
|
|
926
|
+
"aston-villa": { location: "Birmingham, England", league: "Premier League" },
|
|
927
|
+
"athletico-paranaense": { location: "Curitiba, Brazil", league: "Brasileir\xE3o S\xE9rie A" },
|
|
928
|
+
"atlanta-united": { location: "Atlanta, USA", league: "MLS" },
|
|
929
|
+
"atlas": { location: "Guadalajara, Mexico", league: "Liga MX" },
|
|
930
|
+
"atletico-madrid": { location: "Madrid, Spain", league: "La Liga" },
|
|
931
|
+
"atletico-mineiro": { location: "Belo Horizonte, Brazil", league: "Brasileir\xE3o S\xE9rie A" },
|
|
932
|
+
"atletico-san-luis": { location: "San Luis Potos\xED, Mexico", league: "Liga MX" },
|
|
933
|
+
"augsburg": { location: "Augsburg, Germany", league: "Bundesliga" },
|
|
934
|
+
"austin-fc": { location: "Austin, USA", league: "MLS" },
|
|
935
|
+
"auxerre": { location: "Auxerre, France", league: "Ligue 1" },
|
|
936
|
+
"avispa-fukuoka": { location: "Fukuoka, Japan", league: "J1 League" },
|
|
937
|
+
"az": { location: "Alkmaar, Netherlands", league: "Eredivisie" },
|
|
938
|
+
"bahia": { location: "Salvador, Brazil", league: "Brasileir\xE3o S\xE9rie A" },
|
|
939
|
+
"banfield": { location: "Banfield, Argentina", league: "Argentine Primera Divisi\xF3n" },
|
|
940
|
+
"barcelona": { location: "Barcelona, Spain", league: "La Liga" },
|
|
941
|
+
"bayer-leverkusen": { location: "Leverkusen, Germany", league: "Bundesliga" },
|
|
942
|
+
"bayern-munich": { location: "Munich, Germany", league: "Bundesliga" },
|
|
943
|
+
"belgrano": { location: "C\xF3rdoba, Argentina", league: "Argentine Primera Divisi\xF3n" },
|
|
944
|
+
"benfica": { location: "Lisbon, Portugal", league: "Primeira Liga" },
|
|
945
|
+
"birmingham-legion": { location: "Birmingham, USA", league: "USL Championship" },
|
|
946
|
+
"boca-juniors": { location: "Buenos Aires, Argentina", league: "Argentine Primera Divisi\xF3n" },
|
|
947
|
+
"bodo-glimt": { location: "Bod\xF8, Norway", league: "Eliteserien" },
|
|
948
|
+
"bordeaux": { location: "Bordeaux, France", league: "Championnat National" },
|
|
949
|
+
"borussia-dortmund": { location: "Dortmund, Germany", league: "Bundesliga" },
|
|
950
|
+
"botafogo": { location: "Rio de Janeiro, Brazil", league: "Brasileir\xE3o S\xE9rie A" },
|
|
951
|
+
"bragantino": { location: "Bragan\xE7a Paulista, Brazil", league: "Brasileir\xE3o S\xE9rie A" },
|
|
952
|
+
"brann": { location: "Bergen, Norway", league: "Eliteserien" },
|
|
953
|
+
"brest": { location: "Brest, France", league: "Ligue 1" },
|
|
954
|
+
"brommapojkarna": { location: "Stockholm, Sweden", league: "Allsvenskan" },
|
|
955
|
+
"brondby": { location: "Br\xF8ndby, Denmark", league: "Danish Superliga" },
|
|
956
|
+
"brooklyn-fc": { location: "Brooklyn, USA", league: "USL Championship" },
|
|
957
|
+
"bucheon": { location: "Bucheon, South Korea", league: "K League 2" },
|
|
958
|
+
"caen": { location: "Caen, France", league: "Ligue 2" },
|
|
959
|
+
"cambuur": { location: "Leeuwarden, Netherlands", league: "Eerste Divisie" },
|
|
960
|
+
"carmelita": { location: "Alajuela, Costa Rica", league: "Liga de Ascenso" },
|
|
961
|
+
"cartagines": { location: "Cartago, Costa Rica", league: "Liga FPD" },
|
|
962
|
+
"ceara": { location: "Fortaleza, Brazil", league: "Brasileir\xE3o S\xE9rie A" },
|
|
963
|
+
"celtic": { location: "Glasgow, Scotland", league: "Scottish Premiership" },
|
|
964
|
+
"central-cordoba": { location: "Santiago del Estero, Argentina", league: "Argentine Primera Divisi\xF3n" },
|
|
965
|
+
"cerezo-osaka": { location: "Osaka, Japan", league: "J1 League" },
|
|
966
|
+
"cf-montreal": { location: "Montreal, Canada", league: "MLS" },
|
|
967
|
+
"charleston-battery": { location: "Charleston, USA", league: "USL Championship" },
|
|
968
|
+
"charlotte-fc": { location: "Charlotte, USA", league: "MLS" },
|
|
969
|
+
"chelsea": { location: "London, England", league: "Premier League" },
|
|
970
|
+
"chicago-fire": { location: "Chicago, USA", league: "MLS" },
|
|
971
|
+
"chivas": { location: "Guadalajara, Mexico", league: "Liga MX" },
|
|
972
|
+
"clermont": { location: "Clermont-Ferrand, France", league: "Ligue 2" },
|
|
973
|
+
"club-america": { location: "Mexico City, Mexico", league: "Liga MX" },
|
|
974
|
+
"cologne": { location: "Cologne, Germany", league: "Bundesliga" },
|
|
975
|
+
"colorado-rapids": { location: "Commerce City, USA", league: "MLS" },
|
|
976
|
+
"columbus-crew": { location: "Columbus, USA", league: "MLS" },
|
|
977
|
+
"corinthians": { location: "S\xE3o Paulo, Brazil", league: "Brasileir\xE3o S\xE9rie A" },
|
|
978
|
+
"cruz-azul": { location: "Mexico City, Mexico", league: "Liga MX" },
|
|
979
|
+
"cruzeiro": { location: "Belo Horizonte, Brazil", league: "Brasileir\xE3o S\xE9rie A" },
|
|
980
|
+
"daejeon": { location: "Daejeon, South Korea", league: "K League 1" },
|
|
981
|
+
"dc-united": { location: "Washington, D.C., USA", league: "MLS" },
|
|
982
|
+
"defensa-y-justicia": { location: "Florencio Varela, Argentina", league: "Argentine Primera Divisi\xF3n" },
|
|
983
|
+
"degerfors": { location: "Degerfors, Sweden", league: "Allsvenskan" },
|
|
984
|
+
"detroit-city": { location: "Detroit, USA", league: "USL Championship" },
|
|
985
|
+
"dijon": { location: "Dijon, France", league: "Championnat National" },
|
|
986
|
+
"djurgarden": { location: "Stockholm, Sweden", league: "Allsvenskan" },
|
|
987
|
+
"dundee": { location: "Dundee, Scotland", league: "Scottish Premiership" },
|
|
988
|
+
"dundee-united": { location: "Dundee, Scotland", league: "Scottish Premiership" },
|
|
989
|
+
"dynamo-kyiv": { location: "Kyiv, Ukraine", league: "Ukrainian Premier League" },
|
|
990
|
+
"eintracht-frankfurt": { location: "Frankfurt, Germany", league: "Bundesliga" },
|
|
991
|
+
"el-paso-locomotive": { location: "El Paso, USA", league: "USL Championship" },
|
|
992
|
+
"elfsborg": { location: "Bor\xE5s, Sweden", league: "Allsvenskan" },
|
|
993
|
+
"emmen": { location: "Emmen, Netherlands", league: "Eerste Divisie" },
|
|
994
|
+
"esbjerg": { location: "Esbjerg, Denmark", league: "Danish 1st Division" },
|
|
995
|
+
"estudiantes": { location: "La Plata, Argentina", league: "Argentine Primera Divisi\xF3n" },
|
|
996
|
+
"everton": { location: "Liverpool, England", league: "Premier League" },
|
|
997
|
+
"excelsior": { location: "Rotterdam, Netherlands", league: "Eerste Divisie" },
|
|
998
|
+
"fagiano-okayama": { location: "Okayama, Japan", league: "J1 League" },
|
|
999
|
+
"falkirk": { location: "Falkirk, Scotland", league: "Scottish Championship" },
|
|
1000
|
+
"fc-cincinnati": { location: "Cincinnati, USA", league: "MLS" },
|
|
1001
|
+
"fc-copenhagen": { location: "Copenhagen, Denmark", league: "Danish Superliga" },
|
|
1002
|
+
"fc-dallas": { location: "Frisco, USA", league: "MLS" },
|
|
1003
|
+
"fc-seoul": { location: "Seoul, South Korea", league: "K League 1" },
|
|
1004
|
+
"fc-tokyo": { location: "Tokyo, Japan", league: "J1 League" },
|
|
1005
|
+
"fc-tulsa": { location: "Tulsa, USA", league: "USL Championship" },
|
|
1006
|
+
"feyenoord": { location: "Rotterdam, Netherlands", league: "Eredivisie" },
|
|
1007
|
+
"flamengo": { location: "Rio de Janeiro, Brazil", league: "Brasileir\xE3o S\xE9rie A" },
|
|
1008
|
+
"fluminense": { location: "Rio de Janeiro, Brazil", league: "Brasileir\xE3o S\xE9rie A" },
|
|
1009
|
+
"fortaleza": { location: "Fortaleza, Brazil", league: "Brasileir\xE3o S\xE9rie A" },
|
|
1010
|
+
"fortuna-sittard": { location: "Sittard, Netherlands", league: "Eredivisie" },
|
|
1011
|
+
"fredrikstad": { location: "Fredrikstad, Norway", league: "Eliteserien" },
|
|
1012
|
+
"freiburg": { location: "Freiburg, Germany", league: "Bundesliga" },
|
|
1013
|
+
"gais": { location: "Gothenburg, Sweden", league: "Allsvenskan" },
|
|
1014
|
+
"galatasaray": { location: "Istanbul, Turkey", league: "S\xFCper Lig" },
|
|
1015
|
+
"gamba-osaka": { location: "Osaka, Japan", league: "J1 League" },
|
|
1016
|
+
"gangwon": { location: "Gangneung, South Korea", league: "K League 1" },
|
|
1017
|
+
"gimcheon-sangmu": { location: "Gimcheon, South Korea", league: "K League 1" },
|
|
1018
|
+
"gimnasia": { location: "La Plata, Argentina", league: "Argentine Primera Divisi\xF3n" },
|
|
1019
|
+
"gladbach": { location: "M\xF6nchengladbach, Germany", league: "Bundesliga" },
|
|
1020
|
+
"go-ahead-eagles": { location: "Deventer, Netherlands", league: "Eredivisie" },
|
|
1021
|
+
"godoy-cruz": { location: "Mendoza, Argentina", league: "Argentine Primera Divisi\xF3n" },
|
|
1022
|
+
"gremio": { location: "Porto Alegre, Brazil", league: "Brasileir\xE3o S\xE9rie A" },
|
|
1023
|
+
"groningen": { location: "Groningen, Netherlands", league: "Eredivisie" },
|
|
1024
|
+
"guadalupe": { location: "Goicoechea, Costa Rica", league: "Liga de Ascenso" },
|
|
1025
|
+
"guanacasteca": { location: "Nicoya, Costa Rica", league: "Liga FPD" },
|
|
1026
|
+
"guingamp": { location: "Guingamp, France", league: "Ligue 2" },
|
|
1027
|
+
"gwangju": { location: "Gwangju, South Korea", league: "K League 1" },
|
|
1028
|
+
"hacken": { location: "Gothenburg, Sweden", league: "Allsvenskan" },
|
|
1029
|
+
"halmstad": { location: "Halmstad, Sweden", league: "Allsvenskan" },
|
|
1030
|
+
"hamburg": { location: "Hamburg, Germany", league: "2. Bundesliga" },
|
|
1031
|
+
"hammarby": { location: "Stockholm, Sweden", league: "Allsvenskan" },
|
|
1032
|
+
"hartford-athletic": { location: "Hartford, USA", league: "USL Championship" },
|
|
1033
|
+
"haugesund": { location: "Haugesund, Norway", league: "Eliteserien" },
|
|
1034
|
+
"hearts": { location: "Edinburgh, Scotland", league: "Scottish Premiership" },
|
|
1035
|
+
"heerenveen": { location: "Heerenveen, Netherlands", league: "Eredivisie" },
|
|
1036
|
+
"heidenheim": { location: "Heidenheim, Germany", league: "Bundesliga" },
|
|
1037
|
+
"helsingborg": { location: "Helsingborg, Sweden", league: "Superettan" },
|
|
1038
|
+
"heracles": { location: "Almelo, Netherlands", league: "Eredivisie" },
|
|
1039
|
+
"herediano": { location: "Heredia, Costa Rica", league: "Liga FPD" },
|
|
1040
|
+
"hibernian": { location: "Edinburgh, Scotland", league: "Scottish Premiership" },
|
|
1041
|
+
"hoffenheim": { location: "Sinsheim, Germany", league: "Bundesliga" },
|
|
1042
|
+
"horsens": { location: "Horsens, Denmark", league: "Danish 1st Division" },
|
|
1043
|
+
"houston-dynamo": { location: "Houston, USA", league: "MLS" },
|
|
1044
|
+
"huracan": { location: "Buenos Aires, Argentina", league: "Argentine Primera Divisi\xF3n" },
|
|
1045
|
+
"ifk-goteborg": { location: "Gothenburg, Sweden", league: "Allsvenskan" },
|
|
1046
|
+
"norrkoping": { location: "Norrk\xF6ping, Sweden", league: "Allsvenskan" },
|
|
1047
|
+
"incheon-united": { location: "Incheon, South Korea", league: "K League 1" },
|
|
1048
|
+
"independiente": { location: "Avellaneda, Argentina", league: "Argentine Primera Divisi\xF3n" },
|
|
1049
|
+
"indy-eleven": { location: "Indianapolis, USA", league: "USL Championship" },
|
|
1050
|
+
"instituto": { location: "C\xF3rdoba, Argentina", league: "Argentine Primera Divisi\xF3n" },
|
|
1051
|
+
"inter-miami": { location: "Fort Lauderdale, USA", league: "MLS" },
|
|
1052
|
+
"inter-milan": { location: "Milan, Italy", league: "Serie A" },
|
|
1053
|
+
"internacional": { location: "Porto Alegre, Brazil", league: "Brasileir\xE3o S\xE9rie A" },
|
|
1054
|
+
"jef-united": { location: "Chiba, Japan", league: "J2 League" },
|
|
1055
|
+
"jeju-sk": { location: "Jeju, South Korea", league: "K League 1" },
|
|
1056
|
+
"jeonbuk": { location: "Jeonju, South Korea", league: "K League 1" },
|
|
1057
|
+
"juarez": { location: "Ciudad Ju\xE1rez, Mexico", league: "Liga MX" },
|
|
1058
|
+
"juventude": { location: "Caxias do Sul, Brazil", league: "Brasileir\xE3o S\xE9rie A" },
|
|
1059
|
+
"juventus": { location: "Turin, Italy", league: "Serie A" },
|
|
1060
|
+
"kalmar": { location: "Kalmar, Sweden", league: "Superettan" },
|
|
1061
|
+
"kashima-antlers": { location: "Kashima, Japan", league: "J1 League" },
|
|
1062
|
+
"kashiwa-reysol": { location: "Kashiwa, Japan", league: "J1 League" },
|
|
1063
|
+
"kawasaki-frontale": { location: "Kawasaki, Japan", league: "J1 League" },
|
|
1064
|
+
"kfum-oslo": { location: "Oslo, Norway", league: "Eliteserien" },
|
|
1065
|
+
"kilmarnock": { location: "Kilmarnock, Scotland", league: "Scottish Premiership" },
|
|
1066
|
+
"kristiansund": { location: "Kristiansund, Norway", league: "Eliteserien" },
|
|
1067
|
+
"kyoto-sanga": { location: "Kyoto, Japan", league: "J1 League" },
|
|
1068
|
+
"la-galaxy": { location: "Carson, USA", league: "MLS" },
|
|
1069
|
+
"lafc": { location: "Los Angeles, USA", league: "MLS" },
|
|
1070
|
+
"lanus": { location: "Lan\xFAs, Argentina", league: "Argentine Primera Divisi\xF3n" },
|
|
1071
|
+
"las-vegas-lights": { location: "Las Vegas, USA", league: "USL Championship" },
|
|
1072
|
+
"lazio": { location: "Rome, Italy", league: "Serie A" },
|
|
1073
|
+
"le-havre": { location: "Le Havre, France", league: "Ligue 1" },
|
|
1074
|
+
"le-mans": { location: "Le Mans, France", league: "Ligue 2" },
|
|
1075
|
+
"leeds-united": { location: "Leeds, England", league: "Premier League" },
|
|
1076
|
+
"leicester-city": { location: "Leicester, England", league: "Championship" },
|
|
1077
|
+
"lens": { location: "Lens, France", league: "Ligue 1" },
|
|
1078
|
+
"leon": { location: "Le\xF3n, Mexico", league: "Liga MX" },
|
|
1079
|
+
"lexington-sc": { location: "Lexington, USA", league: "USL Championship" },
|
|
1080
|
+
"liberia": { location: "Liberia, Costa Rica", league: "Liga FPD" },
|
|
1081
|
+
"lille": { location: "Lille, France", league: "Ligue 1" },
|
|
1082
|
+
"lillestrom": { location: "Lillestr\xF8m, Norway", league: "Eliteserien" },
|
|
1083
|
+
"limon": { location: "Lim\xF3n, Costa Rica", league: "Liga de Ascenso" },
|
|
1084
|
+
"liverpool": { location: "Liverpool, England", league: "Premier League" },
|
|
1085
|
+
"livingston": { location: "Livingston, Scotland", league: "Scottish Championship" },
|
|
1086
|
+
"lorient": { location: "Lorient, France", league: "Ligue 1" },
|
|
1087
|
+
"loudoun-united": { location: "Leesburg, USA", league: "USL Championship" },
|
|
1088
|
+
"louisville-city": { location: "Louisville, USA", league: "USL Championship" },
|
|
1089
|
+
"lyngby": { location: "Kongens Lyngby, Denmark", league: "Danish Superliga" },
|
|
1090
|
+
"lyon": { location: "Lyon, France", league: "Ligue 1" },
|
|
1091
|
+
"machida-zelvia": { location: "Machida, Japan", league: "J1 League" },
|
|
1092
|
+
"mainz": { location: "Mainz, Germany", league: "Bundesliga" },
|
|
1093
|
+
"malmo": { location: "Malm\xF6, Sweden", league: "Allsvenskan" },
|
|
1094
|
+
"manchester-city": { location: "Manchester, England", league: "Premier League" },
|
|
1095
|
+
"manchester-united": { location: "Manchester, England", league: "Premier League" },
|
|
1096
|
+
"marseille": { location: "Marseille, France", league: "Ligue 1" },
|
|
1097
|
+
"mazatlan": { location: "Mazatl\xE1n, Mexico", league: "Liga MX" },
|
|
1098
|
+
"metz": { location: "Metz, France", league: "Ligue 1" },
|
|
1099
|
+
"miami-fc": { location: "Miami, USA", league: "USL Championship" },
|
|
1100
|
+
"midtjylland": { location: "Herning, Denmark", league: "Danish Superliga" },
|
|
1101
|
+
"minnesota-united": { location: "Saint Paul, USA", league: "MLS" },
|
|
1102
|
+
"mirassol": { location: "Mirassol, Brazil", league: "Brasileir\xE3o S\xE9rie A" },
|
|
1103
|
+
"mito-hollyhock": { location: "Mito, Japan", league: "J2 League" },
|
|
1104
|
+
"mjallby": { location: "H\xE4llevik, Sweden", league: "Allsvenskan" },
|
|
1105
|
+
"molde": { location: "Molde, Norway", league: "Eliteserien" },
|
|
1106
|
+
"monaco": { location: "Monaco", league: "Ligue 1" },
|
|
1107
|
+
"monterey-bay": { location: "Monterey, USA", league: "USL Championship" },
|
|
1108
|
+
"monterrey": { location: "Monterrey, Mexico", league: "Liga MX" },
|
|
1109
|
+
"montpellier": { location: "Montpellier, France", league: "Ligue 2" },
|
|
1110
|
+
"motherwell": { location: "Motherwell, Scotland", league: "Scottish Premiership" },
|
|
1111
|
+
"grecia": { location: "Grecia, Costa Rica", league: "Liga de Ascenso" },
|
|
1112
|
+
"nac-breda": { location: "Breda, Netherlands", league: "Eredivisie" },
|
|
1113
|
+
"nagoya-grampus": { location: "Nagoya, Japan", league: "J1 League" },
|
|
1114
|
+
"nancy": { location: "Nancy, France", league: "Ligue 2" },
|
|
1115
|
+
"nantes": { location: "Nantes, France", league: "Ligue 1" },
|
|
1116
|
+
"napoli": { location: "Naples, Italy", league: "Serie A" },
|
|
1117
|
+
"nashville-sc": { location: "Nashville, USA", league: "MLS" },
|
|
1118
|
+
"nec": { location: "Nijmegen, Netherlands", league: "Eredivisie" },
|
|
1119
|
+
"necaxa": { location: "Aguascalientes, Mexico", league: "Liga MX" },
|
|
1120
|
+
"new-england": { location: "Foxborough, USA", league: "MLS" },
|
|
1121
|
+
"new-mexico-united": { location: "Albuquerque, USA", league: "USL Championship" },
|
|
1122
|
+
"newcastle": { location: "Newcastle, England", league: "Premier League" },
|
|
1123
|
+
"newells": { location: "Rosario, Argentina", league: "Argentine Primera Divisi\xF3n" },
|
|
1124
|
+
"nice": { location: "Nice, France", league: "Ligue 1" },
|
|
1125
|
+
"nimes": { location: "N\xEEmes, France", league: "Championnat National" },
|
|
1126
|
+
"nordsjaelland": { location: "Farum, Denmark", league: "Danish Superliga" },
|
|
1127
|
+
"ny-red-bulls": { location: "Harrison, USA", league: "MLS" },
|
|
1128
|
+
"nycfc": { location: "New York City, USA", league: "MLS" },
|
|
1129
|
+
"oakland-roots": { location: "Oakland, USA", league: "USL Championship" },
|
|
1130
|
+
"ob-odense": { location: "Odense, Denmark", league: "Danish Superliga" },
|
|
1131
|
+
"odd": { location: "Skien, Norway", league: "Norwegian First Division" },
|
|
1132
|
+
"olympiacos": { location: "Piraeus, Greece", league: "Super League Greece" },
|
|
1133
|
+
"orange-county-sc": { location: "Irvine, USA", league: "USL Championship" },
|
|
1134
|
+
"orebro": { location: "\xD6rebro, Sweden", league: "Superettan" },
|
|
1135
|
+
"orlando-city": { location: "Orlando, USA", league: "MLS" },
|
|
1136
|
+
"pachuca": { location: "Pachuca, Mexico", league: "Liga MX" },
|
|
1137
|
+
"palmeiras": { location: "S\xE3o Paulo, Brazil", league: "Brasileir\xE3o S\xE9rie A" },
|
|
1138
|
+
"paris-fc": { location: "Paris, France", league: "Ligue 1" },
|
|
1139
|
+
"psg": { location: "Paris, France", league: "Ligue 1" },
|
|
1140
|
+
"pec-zwolle": { location: "Zwolle, Netherlands", league: "Eredivisie" },
|
|
1141
|
+
"perez-zeledon": { location: "San Isidro, Costa Rica", league: "Liga FPD" },
|
|
1142
|
+
"philadelphia-union": { location: "Chester, USA", league: "MLS" },
|
|
1143
|
+
"phoenix-rising": { location: "Phoenix, USA", league: "USL Championship" },
|
|
1144
|
+
"pittsburgh-riverhounds": { location: "Pittsburgh, USA", league: "USL Championship" },
|
|
1145
|
+
"platense": { location: "Florida, Argentina", league: "Argentine Primera Divisi\xF3n" },
|
|
1146
|
+
"pohang-steelers": { location: "Pohang, South Korea", league: "K League 1" },
|
|
1147
|
+
"portland-timbers": { location: "Portland, USA", league: "MLS" },
|
|
1148
|
+
"porto": { location: "Porto, Portugal", league: "Primeira Liga" },
|
|
1149
|
+
"psv": { location: "Eindhoven, Netherlands", league: "Eredivisie" },
|
|
1150
|
+
"puebla": { location: "Puebla, Mexico", league: "Liga MX" },
|
|
1151
|
+
"pumas": { location: "Mexico City, Mexico", league: "Liga MX" },
|
|
1152
|
+
"puntarenas": { location: "Puntarenas, Costa Rica", league: "Liga FPD" },
|
|
1153
|
+
"queretaro": { location: "Quer\xE9taro, Mexico", league: "Liga MX" },
|
|
1154
|
+
"racing": { location: "Avellaneda, Argentina", league: "Argentine Primera Divisi\xF3n" },
|
|
1155
|
+
"randers": { location: "Randers, Denmark", league: "Danish Superliga" },
|
|
1156
|
+
"rangers": { location: "Glasgow, Scotland", league: "Scottish Premiership" },
|
|
1157
|
+
"rb-leipzig": { location: "Leipzig, Germany", league: "Bundesliga" },
|
|
1158
|
+
"real-madrid": { location: "Madrid, Spain", league: "La Liga" },
|
|
1159
|
+
"real-salt-lake": { location: "Sandy, USA", league: "MLS" },
|
|
1160
|
+
"red-star": { location: "Saint-Ouen, France", league: "Ligue 2" },
|
|
1161
|
+
"reims": { location: "Reims, France", league: "Ligue 2" },
|
|
1162
|
+
"rennes": { location: "Rennes, France", league: "Ligue 1" },
|
|
1163
|
+
"rhode-island-fc": { location: "Pawtucket, USA", league: "USL Championship" },
|
|
1164
|
+
"river-plate": { location: "Buenos Aires, Argentina", league: "Argentine Primera Divisi\xF3n" },
|
|
1165
|
+
"rkc": { location: "Waalwijk, Netherlands", league: "Eredivisie" },
|
|
1166
|
+
"roma": { location: "Rome, Italy", league: "Serie A" },
|
|
1167
|
+
"rosario-central": { location: "Rosario, Argentina", league: "Argentine Primera Divisi\xF3n" },
|
|
1168
|
+
"rosenborg": { location: "Trondheim, Norway", league: "Eliteserien" },
|
|
1169
|
+
"sacramento-republic": { location: "Sacramento, USA", league: "USL Championship" },
|
|
1170
|
+
"saint-etienne": { location: "Saint-\xC9tienne, France", league: "Ligue 2" },
|
|
1171
|
+
"san-antonio-fc": { location: "San Antonio, USA", league: "USL Championship" },
|
|
1172
|
+
"san-carlos": { location: "Quesada, Costa Rica", league: "Liga FPD" },
|
|
1173
|
+
"san-diego-fc": { location: "San Diego, USA", league: "MLS" },
|
|
1174
|
+
"san-jose-earthquakes": { location: "San Jose, USA", league: "MLS" },
|
|
1175
|
+
"san-lorenzo": { location: "Buenos Aires, Argentina", league: "Argentine Primera Divisi\xF3n" },
|
|
1176
|
+
"sanfrecce-hiroshima": { location: "Hiroshima, Japan", league: "J1 League" },
|
|
1177
|
+
"santos": { location: "Santos, Brazil", league: "Brasileir\xE3o S\xE9rie A" },
|
|
1178
|
+
"santos-guapiles": { location: "Gu\xE1piles, Costa Rica", league: "Liga FPD" },
|
|
1179
|
+
"santos-laguna": { location: "Torre\xF3n, Mexico", league: "Liga MX" },
|
|
1180
|
+
"sao-paulo": { location: "S\xE3o Paulo, Brazil", league: "Brasileir\xE3o S\xE9rie A" },
|
|
1181
|
+
"saprissa": { location: "San Jos\xE9, Costa Rica", league: "Liga FPD" },
|
|
1182
|
+
"sarpsborg": { location: "Sarpsborg, Norway", league: "Eliteserien" },
|
|
1183
|
+
"schalke": { location: "Gelsenkirchen, Germany", league: "2. Bundesliga" },
|
|
1184
|
+
"seattle-sounders": { location: "Seattle, USA", league: "MLS" },
|
|
1185
|
+
"sevilla": { location: "Seville, Spain", league: "La Liga" },
|
|
1186
|
+
"shakhtar": { location: "Donetsk, Ukraine", league: "Ukrainian Premier League" },
|
|
1187
|
+
"shimizu-s-pulse": { location: "Shizuoka, Japan", league: "J1 League" },
|
|
1188
|
+
"silkeborg": { location: "Silkeborg, Denmark", league: "Danish Superliga" },
|
|
1189
|
+
"sirius": { location: "Uppsala, Sweden", league: "Allsvenskan" },
|
|
1190
|
+
"sochaux": { location: "Montb\xE9liard, France", league: "Championnat National" },
|
|
1191
|
+
"sonderjyske": { location: "Haderslev, Denmark", league: "Danish Superliga" },
|
|
1192
|
+
"sparta-rotterdam": { location: "Rotterdam, Netherlands", league: "Eredivisie" },
|
|
1193
|
+
"sport-recife": { location: "Recife, Brazil", league: "Brasileir\xE3o S\xE9rie A" },
|
|
1194
|
+
"sporting": { location: "Lisbon, Portugal", league: "Primeira Liga" },
|
|
1195
|
+
"sporting-jax": { location: "Jacksonville, USA", league: "MLS Next Pro" },
|
|
1196
|
+
"sporting-kc": { location: "Kansas City, USA", league: "MLS" },
|
|
1197
|
+
"sporting-san-jose": { location: "San Jos\xE9, Costa Rica", league: "Liga FPD" },
|
|
1198
|
+
"st-mirren": { location: "Paisley, Scotland", league: "Scottish Premiership" },
|
|
1199
|
+
"st-louis-city": { location: "St. Louis, USA", league: "MLS" },
|
|
1200
|
+
"st-pauli": { location: "Hamburg, Germany", league: "Bundesliga" },
|
|
1201
|
+
"stabaek": { location: "B\xE6rum, Norway", league: "Norwegian First Division" },
|
|
1202
|
+
"strasbourg": { location: "Strasbourg, France", league: "Ligue 1" },
|
|
1203
|
+
"stromsgodset": { location: "Drammen, Norway", league: "Eliteserien" },
|
|
1204
|
+
"stuttgart": { location: "Stuttgart, Germany", league: "Bundesliga" },
|
|
1205
|
+
"switchbacks": { location: "Colorado Springs, USA", league: "USL Championship" },
|
|
1206
|
+
"talleres": { location: "C\xF3rdoba, Argentina", league: "Argentine Primera Divisi\xF3n" },
|
|
1207
|
+
"tampa-bay-rowdies": { location: "St. Petersburg, USA", league: "USL Championship" },
|
|
1208
|
+
"tigre": { location: "Victoria, Argentina", league: "Argentine Primera Divisi\xF3n" },
|
|
1209
|
+
"tigres": { location: "San Nicol\xE1s de los Garza, Mexico", league: "Liga MX" },
|
|
1210
|
+
"tijuana": { location: "Tijuana, Mexico", league: "Liga MX" },
|
|
1211
|
+
"tokyo-verdy": { location: "Tokyo, Japan", league: "J1 League" },
|
|
1212
|
+
"toluca": { location: "Toluca, Mexico", league: "Liga MX" },
|
|
1213
|
+
"toronto-fc": { location: "Toronto, Canada", league: "MLS" },
|
|
1214
|
+
"tottenham": { location: "London, England", league: "Premier League" },
|
|
1215
|
+
"toulouse": { location: "Toulouse, France", league: "Ligue 1" },
|
|
1216
|
+
"tromso": { location: "Troms\xF8, Norway", league: "Eliteserien" },
|
|
1217
|
+
"troyes": { location: "Troyes, France", league: "Ligue 2" },
|
|
1218
|
+
"twente": { location: "Enschede, Netherlands", league: "Eredivisie" },
|
|
1219
|
+
"ulsan-hd": { location: "Ulsan, South Korea", league: "K League 1" },
|
|
1220
|
+
"union": { location: "Santa Fe, Argentina", league: "Argentine Primera Divisi\xF3n" },
|
|
1221
|
+
"union-berlin": { location: "Berlin, Germany", league: "Bundesliga" },
|
|
1222
|
+
"urawa-reds": { location: "Saitama, Japan", league: "J1 League" },
|
|
1223
|
+
"utrecht": { location: "Utrecht, Netherlands", league: "Eredivisie" },
|
|
1224
|
+
"v-varen-nagasaki": { location: "Nagasaki, Japan", league: "J2 League" },
|
|
1225
|
+
"valencia": { location: "Valencia, Spain", league: "La Liga" },
|
|
1226
|
+
"valerenga": { location: "Oslo, Norway", league: "Eliteserien" },
|
|
1227
|
+
"vancouver-whitecaps": { location: "Vancouver, Canada", league: "MLS" },
|
|
1228
|
+
"varnamo": { location: "V\xE4rnamo, Sweden", league: "Allsvenskan" },
|
|
1229
|
+
"vasco": { location: "Rio de Janeiro, Brazil", league: "Brasileir\xE3o S\xE9rie A" },
|
|
1230
|
+
"vejle": { location: "Vejle, Denmark", league: "Danish Superliga" },
|
|
1231
|
+
"velez": { location: "Buenos Aires, Argentina", league: "Argentine Primera Divisi\xF3n" },
|
|
1232
|
+
"viborg": { location: "Viborg, Denmark", league: "Danish Superliga" },
|
|
1233
|
+
"viking": { location: "Stavanger, Norway", league: "Eliteserien" },
|
|
1234
|
+
"vissel-kobe": { location: "Kobe, Japan", league: "J1 League" },
|
|
1235
|
+
"vitesse": { location: "Arnhem, Netherlands", league: "Eerste Divisie" },
|
|
1236
|
+
"vitoria": { location: "Salvador, Brazil", league: "Brasileir\xE3o S\xE9rie A" },
|
|
1237
|
+
"volendam": { location: "Volendam, Netherlands", league: "Eredivisie" },
|
|
1238
|
+
"werder-bremen": { location: "Bremen, Germany", league: "Bundesliga" },
|
|
1239
|
+
"west-ham": { location: "London, England", league: "Premier League" },
|
|
1240
|
+
"willem-ii": { location: "Tilburg, Netherlands", league: "Eerste Divisie" },
|
|
1241
|
+
"wolfsburg": { location: "Wolfsburg, Germany", league: "Bundesliga" },
|
|
1242
|
+
"yokohama-marinos": { location: "Yokohama, Japan", league: "J1 League" }
|
|
1243
|
+
};
|
|
1244
|
+
}
|
|
1245
|
+
});
|
|
1246
|
+
|
|
902
1247
|
// src/git/teams.ts
|
|
1248
|
+
function withMeta(seed) {
|
|
1249
|
+
const baseSlug = seed.slug.replace(/-\d+$/, "");
|
|
1250
|
+
const meta = SOCCER_TEAM_META[baseSlug];
|
|
1251
|
+
return {
|
|
1252
|
+
name: seed.name,
|
|
1253
|
+
slug: seed.slug,
|
|
1254
|
+
location: meta?.location ?? "Unknown",
|
|
1255
|
+
league: meta?.league ?? "Unknown league"
|
|
1256
|
+
};
|
|
1257
|
+
}
|
|
1258
|
+
function lookupSoccerTeam(titleOrSlug) {
|
|
1259
|
+
const trimmed = titleOrSlug.trim();
|
|
1260
|
+
if (!trimmed) return null;
|
|
1261
|
+
const fromName = teamSlugFromName(trimmed);
|
|
1262
|
+
const slug = fromName ?? normalizeTakenSlug(trimmed);
|
|
1263
|
+
const baseSlug = slug.replace(/-\d+$/, "");
|
|
1264
|
+
const seed = FAMOUS_SOCCER_TEAM_SEEDS.find((t) => t.slug === baseSlug);
|
|
1265
|
+
if (!seed) return null;
|
|
1266
|
+
const suffixMatch = slug.match(/-(\d+)$/) || trimmed.match(/\s+(\d+)$/);
|
|
1267
|
+
const suffix = suffixMatch?.[1];
|
|
1268
|
+
return withMeta({
|
|
1269
|
+
name: suffix ? `${seed.name} ${suffix}` : seed.name,
|
|
1270
|
+
slug: suffix ? `${seed.slug}-${suffix}` : seed.slug
|
|
1271
|
+
});
|
|
1272
|
+
}
|
|
903
1273
|
function teamNameFromSlug(slug) {
|
|
904
1274
|
const normalized = slug.toLowerCase().replace(/^thread\//, "");
|
|
905
1275
|
const suffixMatch = normalized.match(/^(.+)-(\d+)$/);
|
|
906
1276
|
const base = suffixMatch?.[1] ?? normalized;
|
|
907
1277
|
const suffix = suffixMatch?.[2];
|
|
908
|
-
const team =
|
|
1278
|
+
const team = FAMOUS_SOCCER_TEAM_SEEDS.find((t) => t.slug === base);
|
|
909
1279
|
if (team) return suffix ? `${team.name} ${suffix}` : team.name;
|
|
910
1280
|
return normalized.split("-").filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(" ");
|
|
911
1281
|
}
|
|
@@ -915,7 +1285,7 @@ function teamSlugFromName(name) {
|
|
|
915
1285
|
const suffixMatch = trimmed.match(/^(.+?)\s+(\d+)$/);
|
|
916
1286
|
const baseName = suffixMatch?.[1] ?? trimmed;
|
|
917
1287
|
const suffix = suffixMatch?.[2];
|
|
918
|
-
const team =
|
|
1288
|
+
const team = FAMOUS_SOCCER_TEAM_SEEDS.find(
|
|
919
1289
|
(t) => t.name.toLowerCase() === baseName.toLowerCase()
|
|
920
1290
|
);
|
|
921
1291
|
if (!team) return null;
|
|
@@ -943,26 +1313,27 @@ function allocateTeamName(taken, random = Math.random) {
|
|
|
943
1313
|
const takenSet = new Set(
|
|
944
1314
|
[...taken].map((s) => normalizeTakenSlug(s)).filter(Boolean)
|
|
945
1315
|
);
|
|
946
|
-
const available =
|
|
1316
|
+
const available = FAMOUS_SOCCER_TEAM_SEEDS.filter((t) => !takenSet.has(t.slug));
|
|
947
1317
|
if (available.length > 0) {
|
|
948
1318
|
const idx = Math.floor(random() * available.length);
|
|
949
|
-
return available[idx];
|
|
1319
|
+
return withMeta(available[idx]);
|
|
950
1320
|
}
|
|
951
1321
|
for (let n = 2; n < 1e3; n++) {
|
|
952
|
-
for (const t of
|
|
1322
|
+
for (const t of FAMOUS_SOCCER_TEAM_SEEDS) {
|
|
953
1323
|
const slug = `${t.slug}-${n}`;
|
|
954
1324
|
if (!takenSet.has(slug)) {
|
|
955
|
-
return { name: `${t.name} ${n}`, slug };
|
|
1325
|
+
return withMeta({ name: `${t.name} ${n}`, slug });
|
|
956
1326
|
}
|
|
957
1327
|
}
|
|
958
1328
|
}
|
|
959
1329
|
throw new Error("No available soccer team names left");
|
|
960
1330
|
}
|
|
961
|
-
var FAMOUS_SOCCER_TEAMS;
|
|
1331
|
+
var FAMOUS_SOCCER_TEAM_SEEDS, FAMOUS_SOCCER_TEAMS;
|
|
962
1332
|
var init_teams = __esm({
|
|
963
1333
|
"src/git/teams.ts"() {
|
|
964
1334
|
"use strict";
|
|
965
|
-
|
|
1335
|
+
init_team_meta();
|
|
1336
|
+
FAMOUS_SOCCER_TEAM_SEEDS = [
|
|
966
1337
|
{ name: "Aalborg", slug: "aalborg" },
|
|
967
1338
|
{ name: "Aalesund", slug: "aalesund" },
|
|
968
1339
|
{ name: "Aarhus", slug: "aarhus" },
|
|
@@ -1299,6 +1670,7 @@ var init_teams = __esm({
|
|
|
1299
1670
|
{ name: "Wolfsburg", slug: "wolfsburg" },
|
|
1300
1671
|
{ name: "Yokohama Marinos", slug: "yokohama-marinos" }
|
|
1301
1672
|
];
|
|
1673
|
+
FAMOUS_SOCCER_TEAMS = FAMOUS_SOCCER_TEAM_SEEDS.map(withMeta);
|
|
1302
1674
|
}
|
|
1303
1675
|
});
|
|
1304
1676
|
|
|
@@ -1390,6 +1762,16 @@ function formatGhLandError(raw, opts) {
|
|
|
1390
1762
|
return trimmed;
|
|
1391
1763
|
}
|
|
1392
1764
|
const detail = extractGhErrorDetail(raw);
|
|
1765
|
+
if (/Head ref must be a branch|No commits between|Head sha can't be blank/i.test(
|
|
1766
|
+
raw
|
|
1767
|
+
) || /Head ref must be a branch|No commits between|Head sha can't be blank/i.test(
|
|
1768
|
+
detail
|
|
1769
|
+
)) {
|
|
1770
|
+
const target = opts?.targetedRepo ? ` Targeted ${opts.targetedRepo}` : "";
|
|
1771
|
+
const head = opts?.headRef ? ` with head ${opts.headRef}` : "";
|
|
1772
|
+
const hint = opts?.targetedRepo ? ` Branch was pushed to origin \u2014 confirm it exists on GitHub and differs from the base branch.${target}${head}.` : " Often `gh` targeted upstream instead of origin. Branch was pushed \u2014 retry in the latest Sideboard, or run: gh pr create -R <owner/name> --base main --head <branch>.";
|
|
1773
|
+
return `Could not create the pull request.${hint}`;
|
|
1774
|
+
}
|
|
1393
1775
|
if (isGhRateLimitError(raw) || isGhRateLimitError(detail)) {
|
|
1394
1776
|
const when = opts?.resetAt ? ` Try again ${formatRateLimitResetHint(opts.resetAt, opts.nowMs)}.` : " Wait a few minutes and try again.";
|
|
1395
1777
|
const pushNote = opts?.pushed === false ? "" : " Your branch was already pushed.";
|
|
@@ -1600,18 +1982,23 @@ __export(worktree_exports, {
|
|
|
1600
1982
|
createThreadWorktree: () => createThreadWorktree,
|
|
1601
1983
|
currentBranch: () => currentBranch,
|
|
1602
1984
|
detectLocalMergeConflicts: () => detectLocalMergeConflicts,
|
|
1985
|
+
ensureGhPreferOrigin: () => ensureGhPreferOrigin,
|
|
1603
1986
|
fetchPrHead: () => fetchPrHead,
|
|
1604
1987
|
getPr: () => getPr,
|
|
1605
1988
|
getPrChecks: () => getPrChecks,
|
|
1606
1989
|
getPrDetails: () => getPrDetails,
|
|
1607
1990
|
getPrMeta: () => getPrMeta,
|
|
1991
|
+
ghHeadRef: () => ghHeadRef,
|
|
1992
|
+
ghRepoSelectArgs: () => ghRepoSelectArgs,
|
|
1608
1993
|
isDirty: () => isDirty,
|
|
1609
1994
|
isPlaceholderBranch: () => isPlaceholderBranch,
|
|
1610
1995
|
listBranches: () => listBranches,
|
|
1611
1996
|
listPrs: () => listPrs,
|
|
1612
1997
|
listWorktrees: () => listWorktrees,
|
|
1998
|
+
lookupSoccerTeam: () => lookupSoccerTeam,
|
|
1613
1999
|
mergePr: () => mergePr,
|
|
1614
2000
|
normalizeWorktreePath: () => normalizeWorktreePath,
|
|
2001
|
+
originGhRepoEnv: () => originGhRepoEnv,
|
|
1615
2002
|
parseGithubSlugFromRemoteUrl: () => parseGithubSlugFromRemoteUrl,
|
|
1616
2003
|
pushBranch: () => pushBranch,
|
|
1617
2004
|
removeWorktree: () => removeWorktree,
|
|
@@ -1639,12 +2026,19 @@ async function lookupGithubGraphqlReset(cwd) {
|
|
|
1639
2026
|
return void 0;
|
|
1640
2027
|
}
|
|
1641
2028
|
}
|
|
1642
|
-
async function formatPrCreateFailure(raw, cwd) {
|
|
2029
|
+
async function formatPrCreateFailure(raw, cwd, ctx) {
|
|
1643
2030
|
if (!isGhRateLimitError(raw)) {
|
|
1644
|
-
return formatGhLandError(raw
|
|
2031
|
+
return formatGhLandError(raw, {
|
|
2032
|
+
targetedRepo: ctx?.slug,
|
|
2033
|
+
headRef: ctx?.head
|
|
2034
|
+
});
|
|
1645
2035
|
}
|
|
1646
2036
|
const resetAt = await lookupGithubGraphqlReset(cwd);
|
|
1647
|
-
return formatGhLandError(raw, {
|
|
2037
|
+
return formatGhLandError(raw, {
|
|
2038
|
+
resetAt,
|
|
2039
|
+
targetedRepo: ctx?.slug,
|
|
2040
|
+
headRef: ctx?.head
|
|
2041
|
+
});
|
|
1648
2042
|
}
|
|
1649
2043
|
function slugify(input) {
|
|
1650
2044
|
return input.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 48);
|
|
@@ -1654,10 +2048,13 @@ async function resolveRepoRoot(cwd) {
|
|
|
1654
2048
|
return stdout.trim();
|
|
1655
2049
|
}
|
|
1656
2050
|
function parseGithubSlugFromRemoteUrl(url) {
|
|
1657
|
-
const trimmed = url.trim();
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
return `${
|
|
2051
|
+
const trimmed = url.trim().replace(/\.git$/i, "");
|
|
2052
|
+
if (!trimmed) return null;
|
|
2053
|
+
const github = trimmed.match(/github\.com[:/]([^/]+)\/([^/]+)$/i);
|
|
2054
|
+
if (github?.[1] && github[2]) return `${github[1]}/${github[2]}`;
|
|
2055
|
+
const sshAlias = trimmed.match(/^git@[^:]+:([^/]+)\/([^/]+)$/i);
|
|
2056
|
+
if (sshAlias?.[1] && sshAlias[2]) return `${sshAlias[1]}/${sshAlias[2]}`;
|
|
2057
|
+
return null;
|
|
1661
2058
|
}
|
|
1662
2059
|
async function slugFromGitRemote(repoPath, remote) {
|
|
1663
2060
|
const result = await git(["remote", "get-url", remote], repoPath, {
|
|
@@ -1669,13 +2066,16 @@ async function slugFromGitRemote(repoPath, remote) {
|
|
|
1669
2066
|
async function resolveGithubRepoSlug(repoPath) {
|
|
1670
2067
|
const fromOrigin = await slugFromGitRemote(repoPath, "origin");
|
|
1671
2068
|
if (fromOrigin) return fromOrigin;
|
|
1672
|
-
const
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
2069
|
+
const hasAlt = Boolean(await slugFromGitRemote(repoPath, "upstream")) || Boolean(await slugFromGitRemote(repoPath, "github"));
|
|
2070
|
+
if (!hasAlt) {
|
|
2071
|
+
const viaGh = await gh(
|
|
2072
|
+
["repo", "view", "--json", "nameWithOwner", "--jq", ".nameWithOwner"],
|
|
2073
|
+
repoPath,
|
|
2074
|
+
{ reject: false }
|
|
2075
|
+
);
|
|
2076
|
+
if (viaGh.exitCode === 0 && viaGh.stdout.trim()) {
|
|
2077
|
+
return viaGh.stdout.trim();
|
|
2078
|
+
}
|
|
1679
2079
|
}
|
|
1680
2080
|
for (const remote of ["upstream", "github"]) {
|
|
1681
2081
|
const slug = await slugFromGitRemote(repoPath, remote);
|
|
@@ -1683,15 +2083,35 @@ async function resolveGithubRepoSlug(repoPath) {
|
|
|
1683
2083
|
}
|
|
1684
2084
|
return null;
|
|
1685
2085
|
}
|
|
2086
|
+
function ghRepoSelectArgs(slug) {
|
|
2087
|
+
return ["-R", slug];
|
|
2088
|
+
}
|
|
2089
|
+
function ghHeadRef(slug, branch) {
|
|
2090
|
+
const owner = slug.split("/")[0];
|
|
2091
|
+
const head = branch.trim().replace(/^refs\/heads\//, "");
|
|
2092
|
+
if (!owner || !head) return head || branch;
|
|
2093
|
+
if (head.includes(":")) return head;
|
|
2094
|
+
return `${owner}:${head}`;
|
|
2095
|
+
}
|
|
2096
|
+
async function ensureGhPreferOrigin(cwd) {
|
|
2097
|
+
const originSlug = await slugFromGitRemote(cwd, "origin");
|
|
2098
|
+
if (!originSlug) return;
|
|
2099
|
+
const hasAlt = Boolean(await slugFromGitRemote(cwd, "upstream")) || Boolean(await slugFromGitRemote(cwd, "github"));
|
|
2100
|
+
if (!hasAlt) return;
|
|
2101
|
+
const view = await gh(["repo", "set-default", "--view"], cwd, {
|
|
2102
|
+
reject: false
|
|
2103
|
+
});
|
|
2104
|
+
const current = `${view.stdout}
|
|
2105
|
+
${view.stderr}`;
|
|
2106
|
+
if (view.exitCode === 0 && current.includes(originSlug)) return;
|
|
2107
|
+
await gh(["repo", "set-default", "origin"], cwd, { reject: false });
|
|
2108
|
+
}
|
|
2109
|
+
async function originGhRepoEnv(cwd) {
|
|
2110
|
+
await ensureGhPreferOrigin(cwd);
|
|
2111
|
+
const slug = await resolveGithubRepoSlug(cwd);
|
|
2112
|
+
return slug ? { GH_REPO: slug } : {};
|
|
2113
|
+
}
|
|
1686
2114
|
async function resolveDefaultBranch(repoPath) {
|
|
1687
|
-
const viaGh = await gh(
|
|
1688
|
-
["repo", "view", "--json", "defaultBranchRef", "--jq", ".defaultBranchRef.name"],
|
|
1689
|
-
repoPath,
|
|
1690
|
-
{ reject: false }
|
|
1691
|
-
);
|
|
1692
|
-
if (viaGh.exitCode === 0 && viaGh.stdout.trim()) {
|
|
1693
|
-
return viaGh.stdout.trim();
|
|
1694
|
-
}
|
|
1695
2115
|
const viaOrigin = await git(
|
|
1696
2116
|
["symbolic-ref", "refs/remotes/origin/HEAD"],
|
|
1697
2117
|
repoPath,
|
|
@@ -1700,6 +2120,31 @@ async function resolveDefaultBranch(repoPath) {
|
|
|
1700
2120
|
if (viaOrigin.exitCode === 0 && viaOrigin.stdout.trim()) {
|
|
1701
2121
|
return viaOrigin.stdout.trim().replace(/^refs\/remotes\/origin\//, "");
|
|
1702
2122
|
}
|
|
2123
|
+
const slug = await resolveGithubRepoSlug(repoPath);
|
|
2124
|
+
const viaGh = await gh(
|
|
2125
|
+
[
|
|
2126
|
+
"repo",
|
|
2127
|
+
"view",
|
|
2128
|
+
...slug ? ["--repo", slug] : [],
|
|
2129
|
+
"--json",
|
|
2130
|
+
"defaultBranchRef",
|
|
2131
|
+
"--jq",
|
|
2132
|
+
".defaultBranchRef.name"
|
|
2133
|
+
],
|
|
2134
|
+
repoPath,
|
|
2135
|
+
{ reject: false }
|
|
2136
|
+
);
|
|
2137
|
+
if (viaGh.exitCode === 0 && viaGh.stdout.trim()) {
|
|
2138
|
+
return viaGh.stdout.trim();
|
|
2139
|
+
}
|
|
2140
|
+
for (const candidate of ["main", "master"]) {
|
|
2141
|
+
const check = await git(
|
|
2142
|
+
["show-ref", "--verify", "--quiet", `refs/remotes/origin/${candidate}`],
|
|
2143
|
+
repoPath,
|
|
2144
|
+
{ reject: false }
|
|
2145
|
+
);
|
|
2146
|
+
if (check.exitCode === 0) return candidate;
|
|
2147
|
+
}
|
|
1703
2148
|
for (const candidate of ["main", "master"]) {
|
|
1704
2149
|
const check = await git(
|
|
1705
2150
|
["show-ref", "--verify", "--quiet", `refs/heads/${candidate}`],
|
|
@@ -2105,6 +2550,7 @@ async function createThreadWorktree(opts) {
|
|
|
2105
2550
|
if ((0, import_node_fs5.existsSync)(worktreePath)) {
|
|
2106
2551
|
throw new Error(`Worktree already exists at ${worktreePath}`);
|
|
2107
2552
|
}
|
|
2553
|
+
await ensureGhPreferOrigin(opts.repoPath);
|
|
2108
2554
|
await git(["fetch", "origin", "--prune"], opts.repoPath, { reject: false });
|
|
2109
2555
|
if (!opts.sourceRef.startsWith("origin/") && !opts.sourceRef.startsWith("refs/")) {
|
|
2110
2556
|
await git(["fetch", "origin", opts.sourceRef], opts.repoPath, {
|
|
@@ -2133,6 +2579,7 @@ ${add.stdout}`;
|
|
|
2133
2579
|
);
|
|
2134
2580
|
if (retry.exitCode === 0) {
|
|
2135
2581
|
branchName = alt;
|
|
2582
|
+
await ensureGhPreferOrigin(worktreePath);
|
|
2136
2583
|
return { branchName, worktreePath };
|
|
2137
2584
|
}
|
|
2138
2585
|
}
|
|
@@ -2141,6 +2588,7 @@ ${add.stdout}`;
|
|
|
2141
2588
|
`Failed to create worktree: ${add.stderr.trim() || add.stdout.trim() || `exit ${add.exitCode}`}`
|
|
2142
2589
|
);
|
|
2143
2590
|
}
|
|
2591
|
+
await ensureGhPreferOrigin(worktreePath);
|
|
2144
2592
|
return { branchName, worktreePath };
|
|
2145
2593
|
}
|
|
2146
2594
|
async function removeWorktree(repoPath, worktreePath, opts) {
|
|
@@ -2241,8 +2689,18 @@ async function mergePr(cwd, selector, opts) {
|
|
|
2241
2689
|
return { url, state: "MERGED" };
|
|
2242
2690
|
}
|
|
2243
2691
|
async function createOrUpdatePr(worktreePath, opts) {
|
|
2692
|
+
await ensureGhPreferOrigin(worktreePath);
|
|
2693
|
+
const slug = await resolveGithubRepoSlug(worktreePath);
|
|
2694
|
+
if (!slug) {
|
|
2695
|
+
throw new Error(
|
|
2696
|
+
"Could not resolve the origin GitHub repo (owner/name) for this worktree. Check that `git remote get-url origin` points at github.com."
|
|
2697
|
+
);
|
|
2698
|
+
}
|
|
2699
|
+
const repoArgs = ghRepoSelectArgs(slug);
|
|
2700
|
+
const headRef = ghHeadRef(slug, opts.head);
|
|
2701
|
+
const branchOnly = opts.head.trim().replace(/^refs\/heads\//, "");
|
|
2244
2702
|
const existing = await gh(
|
|
2245
|
-
["pr", "view",
|
|
2703
|
+
[...repoArgs, "pr", "view", branchOnly, "--json", "url", "--jq", ".url"],
|
|
2246
2704
|
worktreePath,
|
|
2247
2705
|
{ reject: false }
|
|
2248
2706
|
);
|
|
@@ -2250,9 +2708,10 @@ async function createOrUpdatePr(worktreePath, opts) {
|
|
|
2250
2708
|
const url2 = existing.stdout.trim();
|
|
2251
2709
|
await gh(
|
|
2252
2710
|
[
|
|
2711
|
+
...repoArgs,
|
|
2253
2712
|
"pr",
|
|
2254
2713
|
"edit",
|
|
2255
|
-
|
|
2714
|
+
branchOnly,
|
|
2256
2715
|
"--title",
|
|
2257
2716
|
opts.title,
|
|
2258
2717
|
"--body",
|
|
@@ -2265,6 +2724,7 @@ async function createOrUpdatePr(worktreePath, opts) {
|
|
|
2265
2724
|
}
|
|
2266
2725
|
if (opts.web) {
|
|
2267
2726
|
const args2 = [
|
|
2727
|
+
...repoArgs,
|
|
2268
2728
|
"pr",
|
|
2269
2729
|
"create",
|
|
2270
2730
|
"--web",
|
|
@@ -2275,18 +2735,19 @@ async function createOrUpdatePr(worktreePath, opts) {
|
|
|
2275
2735
|
"--base",
|
|
2276
2736
|
opts.base,
|
|
2277
2737
|
"--head",
|
|
2278
|
-
|
|
2738
|
+
headRef
|
|
2279
2739
|
];
|
|
2280
2740
|
if (opts.draft) args2.push("--draft");
|
|
2281
2741
|
await gh(args2, worktreePath, { reject: false });
|
|
2282
2742
|
const again = await gh(
|
|
2283
|
-
["pr", "view",
|
|
2743
|
+
[...repoArgs, "pr", "view", branchOnly, "--json", "url", "--jq", ".url"],
|
|
2284
2744
|
worktreePath,
|
|
2285
2745
|
{ reject: false }
|
|
2286
2746
|
);
|
|
2287
2747
|
return again.stdout.trim() || "";
|
|
2288
2748
|
}
|
|
2289
2749
|
const args = [
|
|
2750
|
+
...repoArgs,
|
|
2290
2751
|
"pr",
|
|
2291
2752
|
"create",
|
|
2292
2753
|
"--title",
|
|
@@ -2296,13 +2757,13 @@ async function createOrUpdatePr(worktreePath, opts) {
|
|
|
2296
2757
|
"--base",
|
|
2297
2758
|
opts.base,
|
|
2298
2759
|
"--head",
|
|
2299
|
-
|
|
2760
|
+
headRef
|
|
2300
2761
|
];
|
|
2301
2762
|
if (opts.draft) args.push("--draft");
|
|
2302
2763
|
const created = await gh(args, worktreePath, { reject: false });
|
|
2303
2764
|
if (created.exitCode !== 0) {
|
|
2304
2765
|
const raw = created.stderr.trim() || created.stdout.trim() || "gh pr create failed";
|
|
2305
|
-
throw new Error(await formatPrCreateFailure(raw, worktreePath));
|
|
2766
|
+
throw new Error(await formatPrCreateFailure(raw, worktreePath, { slug, head: headRef }));
|
|
2306
2767
|
}
|
|
2307
2768
|
const url = created.stdout.trim().split("\n").find((l) => l.startsWith("http")) ?? created.stdout.trim();
|
|
2308
2769
|
return url;
|
|
@@ -2406,7 +2867,8 @@ function coordinatorGreenfieldPlaybook(reposDir) {
|
|
|
2406
2867
|
"- Examples:",
|
|
2407
2868
|
` - Clone: \`git clone <url> ${reposDir}/<name>\``,
|
|
2408
2869
|
` - New GitHub repo: \`gh repo create <owner>/<name> --private --clone -- ${reposDir}/<name>\` (or mkdir + git init + gh repo create + remote add + push)`,
|
|
2409
|
-
"- Then: add_workspace with that absolute path \u2192 create_thread (repoPath + parentThreadId) \u2192 send_to_thread (build) \u2192 wait_for_turn \u2192 send_to_thread (`gh pr create --draft
|
|
2870
|
+
"- Then: add_workspace with that absolute path \u2192 create_thread (repoPath + parentThreadId) \u2192 send_to_thread (build) \u2192 wait_for_turn \u2192 send_to_thread (`gh pr create --draft -R <origin-owner/name>`).",
|
|
2871
|
+
"- Always target the child worktree's **origin** (`github:` slug from list_workspaces / `git remote get-url origin` in that worktree). Never open PRs against `upstream`.",
|
|
2410
2872
|
"- Do coding work in the child worktree thread, not by editing files in this home cwd."
|
|
2411
2873
|
].join("\n");
|
|
2412
2874
|
}
|
|
@@ -2445,8 +2907,8 @@ function ensureGlobalCoordinatorCwd() {
|
|
|
2445
2907
|
"",
|
|
2446
2908
|
"When creating threads, pass `repoPath` from `list_workspaces` (or the path you just registered) and `parentThreadId` for children.",
|
|
2447
2909
|
"Typical flow (existing): list_workspaces \u2192 list_branches|list_prs|list_issues \u2192 create_thread \u2192 send_to_thread \u2192 wait_for_turn.",
|
|
2448
|
-
"Typical flow (new app): Bash create/clone under repos dir \u2192 add_workspace \u2192 create_thread \u2192 send_to_thread (implement) \u2192 wait_for_turn \u2192 draft PR.",
|
|
2449
|
-
"
|
|
2910
|
+
"Typical flow (new app): Bash create/clone under repos dir \u2192 add_workspace \u2192 create_thread \u2192 send_to_thread (implement) \u2192 wait_for_turn \u2192 draft PR via worktree agent.",
|
|
2911
|
+
"Always ask worktree agents to open draft PRs (`send_to_thread` + `gh pr create --draft -R <origin>`); never open PRs from the orchestrator."
|
|
2450
2912
|
].join("\n");
|
|
2451
2913
|
(0, import_node_fs6.writeFileSync)((0, import_node_path7.join)(dir, "CLAUDE.md"), `${body}
|
|
2452
2914
|
`, "utf8");
|
|
@@ -2471,8 +2933,8 @@ function coordinatorSystemPrompt(opts) {
|
|
|
2471
2933
|
COORDINATOR_TOOL_PLAYBOOK,
|
|
2472
2934
|
coordinatorGreenfieldPlaybook(reposDir),
|
|
2473
2935
|
"When creating threads, pass the correct repoPath for the target workspace and parentThreadId for children.",
|
|
2474
|
-
"Typical flow (existing): list_workspaces \u2192 list_branches|list_prs|list_issues \u2192 create_thread \u2192 send_to_thread (implement) \u2192 wait_for_turn \u2192 send_to_thread (ask for `gh pr create --draft
|
|
2475
|
-
"Typical flow (new app): Bash under repos dir (clone or gh repo create) \u2192 add_workspace \u2192 create_thread \u2192 send_to_thread \u2192 wait_for_turn \u2192 draft PR.",
|
|
2936
|
+
"Typical flow (existing): list_workspaces \u2192 list_branches|list_prs|list_issues \u2192 create_thread \u2192 send_to_thread (implement) \u2192 wait_for_turn \u2192 send_to_thread (ask for `gh pr create --draft -R <origin-owner/name>` using the workspace github slug) \u2192 wait_for_turn. Never target upstream. Never open PRs from the orchestrator.",
|
|
2937
|
+
"Typical flow (new app): Bash under repos dir (clone or gh repo create) \u2192 add_workspace \u2192 create_thread \u2192 send_to_thread \u2192 wait_for_turn \u2192 draft PR via worktree agent.",
|
|
2476
2938
|
`Goal: ${opts.goal}`,
|
|
2477
2939
|
`Parent thread id (pass as parentThreadId when creating children): ${opts.parentId}`,
|
|
2478
2940
|
"Registered workspaces:",
|
|
@@ -2507,10 +2969,8 @@ var init_coordinator_prompt = __esm({
|
|
|
2507
2969
|
"- list_run_scripts / run_dev_script / stop_dev_script \u2014 start/stop named run scripts",
|
|
2508
2970
|
"Inspect / PRs:",
|
|
2509
2971
|
"- get_diff \u2014 compact diff summary",
|
|
2510
|
-
"-
|
|
2511
|
-
"-
|
|
2512
|
-
"- create_draft_pr \u2014 fallback: commit (if dirty), push, open/update a DRAFT PR from the orchestrator",
|
|
2513
|
-
"Human-only (do not attempt): ready-for-review confirm_land, purge_thread.",
|
|
2972
|
+
"- Ask the worktree agent via send_to_thread to open a draft PR with `gh pr create --draft -R <origin-owner/name>` (workspace `github:` slug / that worktree's origin \u2014 never upstream). Do not open PRs from the orchestrator yourself.",
|
|
2973
|
+
"Human-only (do not attempt): merge, ready-for-review land, purge_thread.",
|
|
2514
2974
|
"Thread links in replies: when mentioning a chat/thread for the user, include a markdown link `[Title](sideboard://thread/<id>)` using the full id (or the link field from create_thread / list_threads). Sideboard renders these as clickable opens.",
|
|
2515
2975
|
"Bash / Read / etc: allowed for (1) inspecting target worktrees / registered repo paths from MCP, and (2) greenfield setup under ~/sideboard/repos (git clone, gh repo create, git init+remote). Never git init/clone *inside* this synthetic home cwd \u2014 emptiness here is expected, not a bug."
|
|
2516
2976
|
].join("\n");
|
|
@@ -2729,7 +3189,9 @@ function forgetRemoved(repoPath) {
|
|
|
2729
3189
|
}
|
|
2730
3190
|
function listWorkspaces() {
|
|
2731
3191
|
const all = readAll();
|
|
2732
|
-
const valid = all.filter(
|
|
3192
|
+
const valid = all.filter(
|
|
3193
|
+
(w) => Boolean(w.path) && w.path !== "/" && w.path !== "." && !isGlobalRepoPath(w.path)
|
|
3194
|
+
);
|
|
2733
3195
|
if (valid.length !== all.length) writeAll(valid);
|
|
2734
3196
|
return valid.sort((a, b) => a.name.localeCompare(b.name));
|
|
2735
3197
|
}
|
|
@@ -2738,6 +3200,7 @@ async function addWorkspace(repoPath) {
|
|
|
2738
3200
|
if (!root || root === "/") throw new Error(`Invalid repo path: ${repoPath}`);
|
|
2739
3201
|
if (!(0, import_node_fs7.existsSync)(root)) throw new Error(`Repo not found: ${root}`);
|
|
2740
3202
|
forgetRemoved(root);
|
|
3203
|
+
await ensureGhPreferOrigin(root);
|
|
2741
3204
|
const current = readAll();
|
|
2742
3205
|
const existing = current.find((w) => w.path === root);
|
|
2743
3206
|
if (existing) return existing;
|
|
@@ -3819,7 +4282,7 @@ function parseIssuesJson(raw) {
|
|
|
3819
4282
|
}
|
|
3820
4283
|
return [];
|
|
3821
4284
|
}
|
|
3822
|
-
var import_node_fs11, BASE_ALLOWED_TOOLS, CLAUDE_PROMPT_ARG_MAX, claudeAdapter;
|
|
4285
|
+
var import_node_fs11, BASE_ALLOWED_TOOLS, CLAUDE_CHROME_ALLOWED_TOOLS, CLAUDE_PROMPT_ARG_MAX, claudeAdapter;
|
|
3823
4286
|
var init_claude = __esm({
|
|
3824
4287
|
"src/agents/claude.ts"() {
|
|
3825
4288
|
"use strict";
|
|
@@ -3830,7 +4293,21 @@ var init_claude = __esm({
|
|
|
3830
4293
|
init_injected_mcp();
|
|
3831
4294
|
init_turn_input();
|
|
3832
4295
|
init_types();
|
|
3833
|
-
BASE_ALLOWED_TOOLS = [
|
|
4296
|
+
BASE_ALLOWED_TOOLS = [
|
|
4297
|
+
"Edit",
|
|
4298
|
+
"Write",
|
|
4299
|
+
"Bash",
|
|
4300
|
+
"Read",
|
|
4301
|
+
"Glob",
|
|
4302
|
+
"Grep",
|
|
4303
|
+
"WebFetch",
|
|
4304
|
+
"WebSearch"
|
|
4305
|
+
];
|
|
4306
|
+
CLAUDE_CHROME_ALLOWED_TOOLS = [
|
|
4307
|
+
"mcp__claude-in-chrome",
|
|
4308
|
+
"mcp__claude-in-chrome__*",
|
|
4309
|
+
"Skill(claude-in-chrome)"
|
|
4310
|
+
];
|
|
3834
4311
|
CLAUDE_PROMPT_ARG_MAX = 2e5;
|
|
3835
4312
|
claudeAdapter = {
|
|
3836
4313
|
kind: "claude",
|
|
@@ -3895,6 +4372,7 @@ var init_claude = __esm({
|
|
|
3895
4372
|
includeBrightsy: isBrightsyConnected()
|
|
3896
4373
|
});
|
|
3897
4374
|
const injectedBrightsyNames = injectedServers.filter((s) => s.name === "brightsy" || s.name.startsWith("brightsy_")).map((s) => s.name);
|
|
4375
|
+
const chromeOn = claudeChromeEnabled();
|
|
3898
4376
|
let allowedTools;
|
|
3899
4377
|
if (isOrchestrator) {
|
|
3900
4378
|
allowedTools = [
|
|
@@ -3910,6 +4388,9 @@ var init_claude = __esm({
|
|
|
3910
4388
|
...brightsyMcpAllowedTools(injectedBrightsyNames)
|
|
3911
4389
|
];
|
|
3912
4390
|
}
|
|
4391
|
+
if (chromeOn) {
|
|
4392
|
+
allowedTools = [...allowedTools, ...CLAUDE_CHROME_ALLOWED_TOOLS];
|
|
4393
|
+
}
|
|
3913
4394
|
const args = [
|
|
3914
4395
|
"-p",
|
|
3915
4396
|
...useStdin ? [] : [promptText],
|
|
@@ -3924,7 +4405,7 @@ var init_claude = __esm({
|
|
|
3924
4405
|
if (mcpConfigPath) {
|
|
3925
4406
|
args.push("--mcp-config", mcpConfigPath);
|
|
3926
4407
|
}
|
|
3927
|
-
if (
|
|
4408
|
+
if (chromeOn) {
|
|
3928
4409
|
args.push("--chrome");
|
|
3929
4410
|
}
|
|
3930
4411
|
if (useStdin) {
|
|
@@ -4766,6 +5247,7 @@ __export(index_exports, {
|
|
|
4766
5247
|
brightsyMcpServerName: () => brightsyMcpServerName,
|
|
4767
5248
|
buildCachedUserContent: () => buildCachedUserContent,
|
|
4768
5249
|
buildClaudeStreamJsonUserMessage: () => buildClaudeStreamJsonUserMessage,
|
|
5250
|
+
buildDiffCommentAttachment: () => buildDiffCommentAttachment,
|
|
4769
5251
|
buildForkTranscriptAttachment: () => buildForkTranscriptAttachment,
|
|
4770
5252
|
buildSessionSeed: () => buildSessionSeed,
|
|
4771
5253
|
buildWorkspaceScriptEnv: () => buildWorkspaceScriptEnv,
|
|
@@ -4809,6 +5291,7 @@ __export(index_exports, {
|
|
|
4809
5291
|
enrichWorkspacesWithGithub: () => enrichWorkspacesWithGithub,
|
|
4810
5292
|
ensureAgentPath: () => ensureAgentPath,
|
|
4811
5293
|
ensureCloudCoordinator: () => ensureCloudCoordinator,
|
|
5294
|
+
ensureGhPreferOrigin: () => ensureGhPreferOrigin,
|
|
4812
5295
|
ensureGlobalCoordinatorCwd: () => ensureGlobalCoordinatorCwd,
|
|
4813
5296
|
ensureWorkspace: () => ensureWorkspace,
|
|
4814
5297
|
estimateMessageChars: () => estimateMessageChars,
|
|
@@ -4852,6 +5335,8 @@ __export(index_exports, {
|
|
|
4852
5335
|
getRunMode: () => getRunMode,
|
|
4853
5336
|
getRunScript: () => getRunScript,
|
|
4854
5337
|
gh: () => gh,
|
|
5338
|
+
ghHeadRef: () => ghHeadRef,
|
|
5339
|
+
ghRepoSelectArgs: () => ghRepoSelectArgs,
|
|
4855
5340
|
git: () => git,
|
|
4856
5341
|
globalAgentCwd: () => globalAgentCwd,
|
|
4857
5342
|
harnessEnvKey: () => harnessEnvKey,
|
|
@@ -4898,6 +5383,7 @@ __export(index_exports, {
|
|
|
4898
5383
|
loadRepoSettings: () => loadRepoSettings,
|
|
4899
5384
|
loadWorkspaceSettings: () => loadWorkspaceSettings,
|
|
4900
5385
|
locksDir: () => locksDir,
|
|
5386
|
+
lookupSoccerTeam: () => lookupSoccerTeam,
|
|
4901
5387
|
maxConcurrentAgents: () => maxConcurrentAgents,
|
|
4902
5388
|
maybeCompactContext: () => maybeCompactContext,
|
|
4903
5389
|
mcpAllowTools: () => mcpAllowTools,
|
|
@@ -4911,6 +5397,7 @@ __export(index_exports, {
|
|
|
4911
5397
|
opencodeAdapter: () => opencodeAdapter,
|
|
4912
5398
|
orchestrationTitleNeedsSoccerNickname: () => orchestrationTitleNeedsSoccerNickname,
|
|
4913
5399
|
orchestratorSessionPoisonedByBuiltins: () => orchestratorSessionPoisonedByBuiltins,
|
|
5400
|
+
originGhRepoEnv: () => originGhRepoEnv,
|
|
4914
5401
|
parseCursorRunnerLine: () => parseCursorRunnerLine,
|
|
4915
5402
|
parseForceStopMessage: () => parseForceStopMessage,
|
|
4916
5403
|
parseGithubSlugFromRemoteUrl: () => parseGithubSlugFromRemoteUrl,
|
|
@@ -5186,7 +5673,9 @@ init_agents();
|
|
|
5186
5673
|
// src/agents/spawn.ts
|
|
5187
5674
|
var import_node_readline = require("readline");
|
|
5188
5675
|
var import_execa2 = require("execa");
|
|
5676
|
+
init_worktree();
|
|
5189
5677
|
init_app_settings();
|
|
5678
|
+
init_global_workspace();
|
|
5190
5679
|
init_brightsy();
|
|
5191
5680
|
init_agents();
|
|
5192
5681
|
|
|
@@ -5420,9 +5909,14 @@ async function spawnAgentTurn(thread, input, onEvent) {
|
|
|
5420
5909
|
`Agent cwd must be the thread worktree (got ${cmd.cwd}, expected ${thread.worktreePath})`
|
|
5421
5910
|
);
|
|
5422
5911
|
}
|
|
5912
|
+
const env = childEnvWithAppSettings(cmd.env);
|
|
5913
|
+
if (!isOrchestratorThread(thread)) {
|
|
5914
|
+
const originEnv = await originGhRepoEnv(thread.worktreePath).catch(() => ({}));
|
|
5915
|
+
Object.assign(env, originEnv);
|
|
5916
|
+
}
|
|
5423
5917
|
const child = (0, import_execa2.execa)(cmd.file, cmd.args, {
|
|
5424
5918
|
cwd: cmd.cwd,
|
|
5425
|
-
env
|
|
5919
|
+
env,
|
|
5426
5920
|
reject: false,
|
|
5427
5921
|
stdout: "pipe",
|
|
5428
5922
|
stderr: "pipe",
|
|
@@ -5529,7 +6023,7 @@ function formatRenameBranchDirective(thread, opts) {
|
|
|
5529
6023
|
}
|
|
5530
6024
|
return lines.join("\n");
|
|
5531
6025
|
}
|
|
5532
|
-
function formatWorktreeDirective(thread) {
|
|
6026
|
+
function formatWorktreeDirective(thread, opts) {
|
|
5533
6027
|
const worktree = normPath2(thread.worktreePath);
|
|
5534
6028
|
const repo = normPath2(thread.repoPath);
|
|
5535
6029
|
const dir = worktreeNameFromPath(thread.worktreePath);
|
|
@@ -5550,7 +6044,13 @@ function formatWorktreeDirective(thread) {
|
|
|
5550
6044
|
);
|
|
5551
6045
|
}
|
|
5552
6046
|
lines.push("");
|
|
5553
|
-
lines.push("
|
|
6047
|
+
lines.push("Git remotes + pull requests (when the work is ready to share):");
|
|
6048
|
+
lines.push(
|
|
6049
|
+
"- Always use this worktree's `origin` remote (`git remote get-url origin` from this cwd). Never push to or open PRs against `upstream` (template remotes)."
|
|
6050
|
+
);
|
|
6051
|
+
lines.push(
|
|
6052
|
+
"- Push with `git push -u origin HEAD` (or the current branch name). Do not `git push upstream`."
|
|
6053
|
+
);
|
|
5554
6054
|
lines.push(
|
|
5555
6055
|
"- Derive the PR title and body from what the changes actually do and why \u2014 inspect the diff/commits and the user request. Do not use the soccer-team worktree nickname or placeholder branch as the PR title."
|
|
5556
6056
|
);
|
|
@@ -5564,9 +6064,13 @@ function formatWorktreeDirective(thread) {
|
|
|
5564
6064
|
lines.push(
|
|
5565
6065
|
`- A PR already exists (${thread.prUrl}). Update it (push + edit title/body if the purpose drifted) instead of opening a duplicate.`
|
|
5566
6066
|
);
|
|
6067
|
+
} else if (opts?.githubSlug) {
|
|
6068
|
+
lines.push(
|
|
6069
|
+
`- Prefer a draft PR first: \`gh pr create --draft -R ${opts.githubSlug}\` (or update via \`gh pr edit -R ${opts.githubSlug}\`) once the change set is coherent. Always pass \`-R ${opts.githubSlug}\` (this worktree's origin). Bare \`gh pr create\` may target upstream instead of origin on dual-remote checkouts. Mark ready for review only when asked. Title/body must reflect the change purpose, not the worktree name.`
|
|
6070
|
+
);
|
|
5567
6071
|
} else {
|
|
5568
6072
|
lines.push(
|
|
5569
|
-
"- Prefer a draft PR first: `gh pr create --draft
|
|
6073
|
+
"- Prefer a draft PR first: `gh pr create --draft -R <origin-owner/name>` (or update via `gh pr edit -R \u2026`) once the change set is coherent. Resolve `<origin-owner/name>` with `git remote get-url origin` in this worktree \u2014 never from `upstream`. Mark ready for review only when asked. Title/body must reflect the change purpose, not the worktree name."
|
|
5570
6074
|
);
|
|
5571
6075
|
}
|
|
5572
6076
|
return lines.join("\n");
|
|
@@ -6734,6 +7238,53 @@ function expandComposerPrompt(worktreePath, prompt, opts) {
|
|
|
6734
7238
|
};
|
|
6735
7239
|
}
|
|
6736
7240
|
|
|
7241
|
+
// src/composer/diff-comment.ts
|
|
7242
|
+
function lineRangeLabel(lines) {
|
|
7243
|
+
const nos = lines.map((l) => l.lineNo);
|
|
7244
|
+
const start = Math.min(...nos);
|
|
7245
|
+
const end = Math.max(...nos);
|
|
7246
|
+
return start === end ? `L${start}` : `L${start}-${end}`;
|
|
7247
|
+
}
|
|
7248
|
+
function formatDiffBody(lines) {
|
|
7249
|
+
return lines.map((l) => {
|
|
7250
|
+
const prefix = l.side === "add" ? "+" : l.side === "del" ? "-" : " ";
|
|
7251
|
+
return `${prefix}${l.text}`;
|
|
7252
|
+
}).join("\n");
|
|
7253
|
+
}
|
|
7254
|
+
function buildDiffCommentAttachment(input) {
|
|
7255
|
+
const comment = input.comment.trim();
|
|
7256
|
+
if (!input.path.trim()) {
|
|
7257
|
+
throw new Error("diff comment requires a file path");
|
|
7258
|
+
}
|
|
7259
|
+
if (!comment) {
|
|
7260
|
+
throw new Error("diff comment requires a note");
|
|
7261
|
+
}
|
|
7262
|
+
if (input.lines.length === 0) {
|
|
7263
|
+
throw new Error("diff comment requires at least one cited line");
|
|
7264
|
+
}
|
|
7265
|
+
const range = lineRangeLabel(input.lines);
|
|
7266
|
+
const name = `${input.path}:${range}`;
|
|
7267
|
+
const content = [
|
|
7268
|
+
`Diff review comment on \`${input.path}\` (${range}).`,
|
|
7269
|
+
"",
|
|
7270
|
+
"Address this feedback on the cited lines. Prefer a precise fix over rewriting unrelated code.",
|
|
7271
|
+
"",
|
|
7272
|
+
"### Reviewer comment",
|
|
7273
|
+
comment,
|
|
7274
|
+
"",
|
|
7275
|
+
"### Cited diff",
|
|
7276
|
+
"```diff",
|
|
7277
|
+
formatDiffBody(input.lines),
|
|
7278
|
+
"```"
|
|
7279
|
+
].join("\n");
|
|
7280
|
+
return {
|
|
7281
|
+
id: input.id ?? `diff-comment-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
|
|
7282
|
+
name,
|
|
7283
|
+
kind: "diff-comment",
|
|
7284
|
+
content
|
|
7285
|
+
};
|
|
7286
|
+
}
|
|
7287
|
+
|
|
6737
7288
|
// src/composer/summarize.ts
|
|
6738
7289
|
init_run();
|
|
6739
7290
|
init_path();
|
|
@@ -8212,7 +8763,11 @@ var Orchestrator = class {
|
|
|
8212
8763
|
}
|
|
8213
8764
|
const isBrightsy = fresh.agent === "brightsy";
|
|
8214
8765
|
const isOrchestration = isOrchestratorThread(fresh);
|
|
8215
|
-
const worktreeDirective = isBrightsy || isOrchestration ? null : formatWorktreeDirective(fresh
|
|
8766
|
+
const worktreeDirective = isBrightsy || isOrchestration ? null : formatWorktreeDirective(fresh, {
|
|
8767
|
+
githubSlug: await resolveGithubRepoSlug(fresh.worktreePath).catch(
|
|
8768
|
+
() => null
|
|
8769
|
+
)
|
|
8770
|
+
});
|
|
8216
8771
|
const settings = loadWorkspaceSettings(fresh.worktreePath, fresh.repoPath);
|
|
8217
8772
|
const { autoRenameBranchEnabled: autoRenameBranchEnabled2 } = await Promise.resolve().then(() => (init_app_settings(), app_settings_exports));
|
|
8218
8773
|
const renameBranchDirective = !isBrightsy && !isOrchestration && autoRenameBranchEnabled2() ? formatRenameBranchDirective(fresh, {
|
|
@@ -9382,45 +9937,6 @@ async function startMcpServer() {
|
|
|
9382
9937
|
};
|
|
9383
9938
|
}
|
|
9384
9939
|
);
|
|
9385
|
-
server.tool(
|
|
9386
|
-
"preview_land",
|
|
9387
|
-
"Preview push+PR land (does NOT push). Use before create_draft_pr.",
|
|
9388
|
-
{ ref: import_zod.z.string() },
|
|
9389
|
-
async ({ ref }) => {
|
|
9390
|
-
const preview = await orch.previewLand(ref);
|
|
9391
|
-
return { content: [{ type: "text", text: JSON.stringify(preview, null, 2) }] };
|
|
9392
|
-
}
|
|
9393
|
-
);
|
|
9394
|
-
server.tool(
|
|
9395
|
-
"create_draft_pr",
|
|
9396
|
-
"Commit dirty changes if needed, push the thread branch, and create/update a DRAFT GitHub PR. Ready-for-review / non-draft land stays human-only (CLI/app confirm_land). Prefer this when the orchestrator should open a PR itself; alternatively send_to_thread asking the worktree agent to run `gh pr create --draft`.",
|
|
9397
|
-
{ ref: import_zod.z.string() },
|
|
9398
|
-
async ({ ref }) => {
|
|
9399
|
-
try {
|
|
9400
|
-
const result = await orch.confirmLand(ref, { draft: true });
|
|
9401
|
-
return {
|
|
9402
|
-
content: [
|
|
9403
|
-
{
|
|
9404
|
-
type: "text",
|
|
9405
|
-
text: JSON.stringify(
|
|
9406
|
-
{
|
|
9407
|
-
prUrl: result.prUrl,
|
|
9408
|
-
pushed: result.pushed,
|
|
9409
|
-
committed: result.committed,
|
|
9410
|
-
draft: true
|
|
9411
|
-
},
|
|
9412
|
-
null,
|
|
9413
|
-
2
|
|
9414
|
-
)
|
|
9415
|
-
}
|
|
9416
|
-
]
|
|
9417
|
-
};
|
|
9418
|
-
} catch (err) {
|
|
9419
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
9420
|
-
return { content: [{ type: "text", text: message }], isError: true };
|
|
9421
|
-
}
|
|
9422
|
-
}
|
|
9423
|
-
);
|
|
9424
9940
|
server.tool(
|
|
9425
9941
|
"list_branches",
|
|
9426
9942
|
"List git branches in a registered workspace. Pass repoPath from list_workspaces (unmerged into the default branch by default \u2014 for create_thread sourceType=branch).",
|
|
@@ -9876,6 +10392,7 @@ init_injected_mcp();
|
|
|
9876
10392
|
brightsyMcpServerName,
|
|
9877
10393
|
buildCachedUserContent,
|
|
9878
10394
|
buildClaudeStreamJsonUserMessage,
|
|
10395
|
+
buildDiffCommentAttachment,
|
|
9879
10396
|
buildForkTranscriptAttachment,
|
|
9880
10397
|
buildSessionSeed,
|
|
9881
10398
|
buildWorkspaceScriptEnv,
|
|
@@ -9919,6 +10436,7 @@ init_injected_mcp();
|
|
|
9919
10436
|
enrichWorkspacesWithGithub,
|
|
9920
10437
|
ensureAgentPath,
|
|
9921
10438
|
ensureCloudCoordinator,
|
|
10439
|
+
ensureGhPreferOrigin,
|
|
9922
10440
|
ensureGlobalCoordinatorCwd,
|
|
9923
10441
|
ensureWorkspace,
|
|
9924
10442
|
estimateMessageChars,
|
|
@@ -9962,6 +10480,8 @@ init_injected_mcp();
|
|
|
9962
10480
|
getRunMode,
|
|
9963
10481
|
getRunScript,
|
|
9964
10482
|
gh,
|
|
10483
|
+
ghHeadRef,
|
|
10484
|
+
ghRepoSelectArgs,
|
|
9965
10485
|
git,
|
|
9966
10486
|
globalAgentCwd,
|
|
9967
10487
|
harnessEnvKey,
|
|
@@ -10008,6 +10528,7 @@ init_injected_mcp();
|
|
|
10008
10528
|
loadRepoSettings,
|
|
10009
10529
|
loadWorkspaceSettings,
|
|
10010
10530
|
locksDir,
|
|
10531
|
+
lookupSoccerTeam,
|
|
10011
10532
|
maxConcurrentAgents,
|
|
10012
10533
|
maybeCompactContext,
|
|
10013
10534
|
mcpAllowTools,
|
|
@@ -10021,6 +10542,7 @@ init_injected_mcp();
|
|
|
10021
10542
|
opencodeAdapter,
|
|
10022
10543
|
orchestrationTitleNeedsSoccerNickname,
|
|
10023
10544
|
orchestratorSessionPoisonedByBuiltins,
|
|
10545
|
+
originGhRepoEnv,
|
|
10024
10546
|
parseCursorRunnerLine,
|
|
10025
10547
|
parseForceStopMessage,
|
|
10026
10548
|
parseGithubSlugFromRemoteUrl,
|