@codedrifters/configulator 0.0.403 → 0.0.404
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 +110 -4
- package/lib/index.d.ts +111 -5
- package/lib/index.js +666 -604
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +672 -614
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -222,6 +222,7 @@ __export(index_exports, {
|
|
|
222
222
|
DEFAULT_API_EXTRACTOR_REPORT_FILENAME: () => DEFAULT_API_EXTRACTOR_REPORT_FILENAME,
|
|
223
223
|
DEFAULT_API_EXTRACTOR_REPORT_FOLDER: () => DEFAULT_API_EXTRACTOR_REPORT_FOLDER,
|
|
224
224
|
DEFAULT_AUDIT_REPORT_DIR: () => DEFAULT_AUDIT_REPORT_DIR,
|
|
225
|
+
DEFAULT_BUILD_POLICY: () => DEFAULT_BUILD_POLICY,
|
|
225
226
|
DEFAULT_BUNDLE_OVERRIDES: () => DEFAULT_BUNDLE_OVERRIDES,
|
|
226
227
|
DEFAULT_DECOMPOSITION_TEMPLATE: () => DEFAULT_DECOMPOSITION_TEMPLATE,
|
|
227
228
|
DEFAULT_DISPATCH_MODEL: () => DEFAULT_DISPATCH_MODEL,
|
|
@@ -342,6 +343,7 @@ __export(index_exports, {
|
|
|
342
343
|
buildCompanyProfileBundle: () => buildCompanyProfileBundle,
|
|
343
344
|
buildCustomerProfileBundle: () => buildCustomerProfileBundle,
|
|
344
345
|
buildDocsSyncBundle: () => buildDocsSyncBundle,
|
|
346
|
+
buildGithubWorkflowBundle: () => buildGithubWorkflowBundle,
|
|
345
347
|
buildIndustryDiscoveryBundle: () => buildIndustryDiscoveryBundle,
|
|
346
348
|
buildMaintenanceAuditBundle: () => buildMaintenanceAuditBundle,
|
|
347
349
|
buildMeetingAnalysisBundle: () => buildMeetingAnalysisBundle,
|
|
@@ -356,6 +358,7 @@ __export(index_exports, {
|
|
|
356
358
|
buildResearchPipelineBundle: () => buildResearchPipelineBundle,
|
|
357
359
|
buildSoftwareProfileBundle: () => buildSoftwareProfileBundle,
|
|
358
360
|
buildStandardsResearchBundle: () => buildStandardsResearchBundle,
|
|
361
|
+
buildTurborepoBundle: () => buildTurborepoBundle,
|
|
359
362
|
buildUnblockDependentsProcedure: () => buildUnblockDependentsProcedure,
|
|
360
363
|
bundleNameForWorkflowRule: () => bundleNameForWorkflowRule,
|
|
361
364
|
businessModelsBundle: () => businessModelsBundle,
|
|
@@ -473,6 +476,7 @@ __export(index_exports, {
|
|
|
473
476
|
resolveAgentTiers: () => resolveAgentTiers,
|
|
474
477
|
resolveAstroProjectOutdir: () => resolveAstroProjectOutdir,
|
|
475
478
|
resolveAwsCdkProjectOutdir: () => resolveAwsCdkProjectOutdir,
|
|
479
|
+
resolveBuildPolicy: () => resolveBuildPolicy,
|
|
476
480
|
resolveBundleAgentTiers: () => resolveBundleAgentTiers,
|
|
477
481
|
resolveDefaultAgentTier: () => resolveDefaultAgentTier,
|
|
478
482
|
resolveIssueDefaults: () => resolveIssueDefaults,
|
|
@@ -5904,6 +5908,403 @@ function buildBcmWriterBundle(paths = DEFAULT_AGENT_PATHS, issueDefaults = DEFAU
|
|
|
5904
5908
|
}
|
|
5905
5909
|
var bcmWriterBundle = buildBcmWriterBundle();
|
|
5906
5910
|
|
|
5911
|
+
// src/turbo/turbo-repo.ts
|
|
5912
|
+
var import_lib2 = require("projen/lib");
|
|
5913
|
+
var import_workflows_model = require("projen/lib/github/workflows-model");
|
|
5914
|
+
|
|
5915
|
+
// src/turbo/turbo-repo-task.ts
|
|
5916
|
+
var import_lib = require("projen/lib");
|
|
5917
|
+
var TurboRepoTask = class extends import_lib.Component {
|
|
5918
|
+
constructor(project, options) {
|
|
5919
|
+
super(project);
|
|
5920
|
+
this.project = project;
|
|
5921
|
+
this.name = options.name;
|
|
5922
|
+
this.dependsOn = options.dependsOn ?? [];
|
|
5923
|
+
this.env = options.env ?? [];
|
|
5924
|
+
this.passThroughEnv = options.passThroughEnv ?? [];
|
|
5925
|
+
this.outputs = options.outputs ?? [];
|
|
5926
|
+
this.cache = options.cache ?? true;
|
|
5927
|
+
this.inputs = [
|
|
5928
|
+
...options.inputs ?? [],
|
|
5929
|
+
// rerun if projen config changes
|
|
5930
|
+
".projen/**",
|
|
5931
|
+
// ignore mac files
|
|
5932
|
+
"!.DS_Store",
|
|
5933
|
+
"!**/.DS_Store"
|
|
5934
|
+
];
|
|
5935
|
+
this.outputLogs = options.outputLogs ?? "new-only";
|
|
5936
|
+
this.persistent = options.persistent ?? false;
|
|
5937
|
+
this.interactive = options.interactive ?? false;
|
|
5938
|
+
this.isActive = true;
|
|
5939
|
+
}
|
|
5940
|
+
taskConfig() {
|
|
5941
|
+
return {
|
|
5942
|
+
dependsOn: this.dependsOn,
|
|
5943
|
+
env: this.env,
|
|
5944
|
+
passThroughEnv: this.passThroughEnv,
|
|
5945
|
+
outputs: this.outputs,
|
|
5946
|
+
cache: this.cache,
|
|
5947
|
+
inputs: this.inputs,
|
|
5948
|
+
outputLogs: this.outputLogs,
|
|
5949
|
+
persistent: this.persistent,
|
|
5950
|
+
interactive: this.interactive
|
|
5951
|
+
};
|
|
5952
|
+
}
|
|
5953
|
+
};
|
|
5954
|
+
|
|
5955
|
+
// src/turbo/turbo-repo.ts
|
|
5956
|
+
var ROOT_TURBO_TASK_NAME = "turbo:build";
|
|
5957
|
+
var ROOT_CI_TASK_NAME = "build:all";
|
|
5958
|
+
var _TurboRepo = class _TurboRepo extends import_lib2.Component {
|
|
5959
|
+
constructor(project, options = {}) {
|
|
5960
|
+
super(project);
|
|
5961
|
+
this.project = project;
|
|
5962
|
+
/**
|
|
5963
|
+
* Sub-Tasks to run
|
|
5964
|
+
*/
|
|
5965
|
+
this.tasks = [];
|
|
5966
|
+
this.turboVersion = options.turboVersion ?? "catalog:";
|
|
5967
|
+
this.isRootProject = project === project.root;
|
|
5968
|
+
if (this.isRootProject) {
|
|
5969
|
+
project.addDevDeps(`turbo@${this.turboVersion}`);
|
|
5970
|
+
}
|
|
5971
|
+
project.gitignore.addPatterns("/.turbo");
|
|
5972
|
+
project.npmignore?.addPatterns("/.turbo/");
|
|
5973
|
+
this.extends = options.extends ?? (this.isRootProject ? [] : ["//"]);
|
|
5974
|
+
this.globalDependencies = options.globalDependencies ?? [];
|
|
5975
|
+
this.globalEnv = options.globalEnv ?? [];
|
|
5976
|
+
this.globalPassThroughEnv = options.globalPassThroughEnv ?? [];
|
|
5977
|
+
this.ui = options.ui ?? "stream";
|
|
5978
|
+
this.dangerouslyDisablePackageManagerCheck = options.dangerouslyDisablePackageManagerCheck ?? false;
|
|
5979
|
+
this.cacheDir = options.cacheDir ?? ".turbo/cache";
|
|
5980
|
+
this.daemon = options.daemon ?? true;
|
|
5981
|
+
this.envMode = options.envMode ?? "strict";
|
|
5982
|
+
this.runOptions = {
|
|
5983
|
+
...options.runOptions,
|
|
5984
|
+
summarize: options.runOptions?.summarize ?? true,
|
|
5985
|
+
concurrency: options.runOptions?.concurrency ?? 10
|
|
5986
|
+
};
|
|
5987
|
+
this.remoteCacheOptions = options.remoteCacheOptions;
|
|
5988
|
+
this.buildAllTaskEnvVars = options.buildAllTaskEnvVars ?? {};
|
|
5989
|
+
this.buildTask = new TurboRepoTask(this.project, {
|
|
5990
|
+
name: ROOT_TURBO_TASK_NAME,
|
|
5991
|
+
dependsOn: this.isRootProject ? [`^${ROOT_TURBO_TASK_NAME}`] : []
|
|
5992
|
+
});
|
|
5993
|
+
if (this.isRootProject) {
|
|
5994
|
+
this.buildAllTask = this.project.tasks.addTask(ROOT_CI_TASK_NAME, {
|
|
5995
|
+
description: "Root build followed by sub-project builds. Mimics the CI build process in one step."
|
|
5996
|
+
});
|
|
5997
|
+
this.buildAllTask.exec("turbo telemetry disable");
|
|
5998
|
+
if (this.buildAllTaskEnvVars) {
|
|
5999
|
+
Object.entries(this.buildAllTaskEnvVars).forEach(([name, value]) => {
|
|
6000
|
+
this.addGlobalEnvVar(name, value);
|
|
6001
|
+
});
|
|
6002
|
+
}
|
|
6003
|
+
if (!this.remoteCacheOptions) {
|
|
6004
|
+
this.buildAllTask.exec(
|
|
6005
|
+
`turbo ${ROOT_TURBO_TASK_NAME} ${this.renderRunArgs(false)}`
|
|
6006
|
+
);
|
|
6007
|
+
} else {
|
|
6008
|
+
this.buildAllTask.exec(
|
|
6009
|
+
`turbo ${ROOT_TURBO_TASK_NAME} ${this.renderRunArgs(true)}`,
|
|
6010
|
+
{
|
|
6011
|
+
condition: '[ ! -n "$CI" ]',
|
|
6012
|
+
env: {
|
|
6013
|
+
TURBO_ENDPOINT: `$(aws ssm get-parameter --name ${this.remoteCacheOptions.endpointParamName} --query Parameter.Value --output text --profile ${this.remoteCacheOptions.profileName})`,
|
|
6014
|
+
TURBO_TOKEN: `$(aws ssm get-parameter --name ${this.remoteCacheOptions.tokenParamName} --query Parameter.Value --output text --profile ${this.remoteCacheOptions.profileName})`
|
|
6015
|
+
}
|
|
6016
|
+
}
|
|
6017
|
+
);
|
|
6018
|
+
this.buildAllTask.exec(
|
|
6019
|
+
`turbo ${ROOT_TURBO_TASK_NAME} ${this.renderRunArgs(true)}`,
|
|
6020
|
+
{
|
|
6021
|
+
condition: '[ -n "$CI" ]',
|
|
6022
|
+
env: {
|
|
6023
|
+
TURBO_ENDPOINT: `$(aws ssm get-parameter --name ${this.remoteCacheOptions.endpointParamName} --query Parameter.Value --output text)`,
|
|
6024
|
+
TURBO_TOKEN: `$(aws ssm get-parameter --name ${this.remoteCacheOptions.tokenParamName} --query Parameter.Value --output text)`
|
|
6025
|
+
}
|
|
6026
|
+
}
|
|
6027
|
+
);
|
|
6028
|
+
}
|
|
6029
|
+
}
|
|
6030
|
+
if (!this.isRootProject) {
|
|
6031
|
+
this.preCompileTask = new TurboRepoTask(project, {
|
|
6032
|
+
name: options.preCompileTask?.name ?? "pre-compile",
|
|
6033
|
+
inputs: ["src/**"]
|
|
6034
|
+
});
|
|
6035
|
+
this.compileTask = new TurboRepoTask(project, {
|
|
6036
|
+
name: options.compileTask?.name ?? "compile",
|
|
6037
|
+
inputs: ["src/**"]
|
|
6038
|
+
});
|
|
6039
|
+
this.postCompileTask = new TurboRepoTask(project, {
|
|
6040
|
+
name: options.postCompileTask?.name ?? "post-compile",
|
|
6041
|
+
inputs: ["src/**"]
|
|
6042
|
+
});
|
|
6043
|
+
this.testTask = new TurboRepoTask(project, {
|
|
6044
|
+
name: options.testTask?.name ?? "test"
|
|
6045
|
+
});
|
|
6046
|
+
this.packageTask = new TurboRepoTask(project, {
|
|
6047
|
+
name: options.packageTask?.name ?? "package",
|
|
6048
|
+
inputs: [".npmignore"]
|
|
6049
|
+
});
|
|
6050
|
+
this.tasks.push(
|
|
6051
|
+
this.preCompileTask,
|
|
6052
|
+
this.compileTask,
|
|
6053
|
+
this.postCompileTask,
|
|
6054
|
+
this.testTask,
|
|
6055
|
+
this.packageTask
|
|
6056
|
+
);
|
|
6057
|
+
}
|
|
6058
|
+
}
|
|
6059
|
+
/**
|
|
6060
|
+
* Static method to discovert turbo in a project.
|
|
6061
|
+
*/
|
|
6062
|
+
static of(project) {
|
|
6063
|
+
const isDefined = (c) => c instanceof _TurboRepo;
|
|
6064
|
+
return project.components.find(isDefined);
|
|
6065
|
+
}
|
|
6066
|
+
/**
|
|
6067
|
+
* Render the `turbo run` CLI flag string for the `build:all` / `reset:all`
|
|
6068
|
+
* task commands from {@link runOptions}. With no `runOptions` configured the
|
|
6069
|
+
* output matches the historically hard-coded flags exactly.
|
|
6070
|
+
*
|
|
6071
|
+
* @param remote - when `true`, also emit the remote-cache flags
|
|
6072
|
+
* (`--cache=remote:rw` plus `--api` / `--token` / `--team` derived from
|
|
6073
|
+
* {@link remoteCacheOptions}). The remote-cache `build:all` variant passes
|
|
6074
|
+
* `true`; `reset:all` and the local `build:all` variant pass `false`.
|
|
6075
|
+
*/
|
|
6076
|
+
renderRunArgs(remote) {
|
|
6077
|
+
const run = this.runOptions;
|
|
6078
|
+
const args = [];
|
|
6079
|
+
if (run.summarize) {
|
|
6080
|
+
args.push("--summarize");
|
|
6081
|
+
}
|
|
6082
|
+
args.push(`--concurrency=${run.concurrency}`);
|
|
6083
|
+
if (run.force) {
|
|
6084
|
+
args.push("--force");
|
|
6085
|
+
}
|
|
6086
|
+
if (run.noCache) {
|
|
6087
|
+
args.push("--no-cache");
|
|
6088
|
+
}
|
|
6089
|
+
if (run.only) {
|
|
6090
|
+
args.push("--only");
|
|
6091
|
+
}
|
|
6092
|
+
if (run.affected) {
|
|
6093
|
+
args.push("--affected");
|
|
6094
|
+
}
|
|
6095
|
+
if (run.cacheWorkers !== void 0) {
|
|
6096
|
+
args.push(`--cache-workers=${run.cacheWorkers}`);
|
|
6097
|
+
}
|
|
6098
|
+
if (run.continueOn !== void 0) {
|
|
6099
|
+
args.push(`--continue=${run.continueOn}`);
|
|
6100
|
+
}
|
|
6101
|
+
if (run.frameworkInference !== void 0) {
|
|
6102
|
+
args.push(`--framework-inference=${run.frameworkInference}`);
|
|
6103
|
+
}
|
|
6104
|
+
for (const filter of run.filter ?? []) {
|
|
6105
|
+
args.push(`--filter=${filter}`);
|
|
6106
|
+
}
|
|
6107
|
+
if (run.outputLogs !== void 0) {
|
|
6108
|
+
args.push(`--output-logs=${run.outputLogs}`);
|
|
6109
|
+
}
|
|
6110
|
+
if (run.logOrder !== void 0) {
|
|
6111
|
+
args.push(`--log-order=${run.logOrder}`);
|
|
6112
|
+
}
|
|
6113
|
+
if (run.logPrefix !== void 0) {
|
|
6114
|
+
args.push(`--log-prefix=${run.logPrefix}`);
|
|
6115
|
+
}
|
|
6116
|
+
if (run.dryRun !== void 0) {
|
|
6117
|
+
args.push(`--dry-run=${run.dryRun}`);
|
|
6118
|
+
}
|
|
6119
|
+
const cache = run.cache ?? (remote ? "remote:rw" : void 0);
|
|
6120
|
+
if (cache !== void 0) {
|
|
6121
|
+
args.push(`--cache=${cache}`);
|
|
6122
|
+
}
|
|
6123
|
+
if (remote && this.remoteCacheOptions) {
|
|
6124
|
+
args.push(
|
|
6125
|
+
"--api=$TURBO_ENDPOINT",
|
|
6126
|
+
"--token=$TURBO_TOKEN",
|
|
6127
|
+
`--team=${this.remoteCacheOptions.teamName}`
|
|
6128
|
+
);
|
|
6129
|
+
}
|
|
6130
|
+
if (run.additionalArgs) {
|
|
6131
|
+
args.push(...run.additionalArgs);
|
|
6132
|
+
}
|
|
6133
|
+
return args.join(" ");
|
|
6134
|
+
}
|
|
6135
|
+
/**
|
|
6136
|
+
* Add an env var to the global env vars for all tasks.
|
|
6137
|
+
* This will also become an input for the build:all task cache at the root.
|
|
6138
|
+
*/
|
|
6139
|
+
addGlobalEnvVar(name, value) {
|
|
6140
|
+
this.buildAllTask?.env(name, value);
|
|
6141
|
+
if (this.isRootProject) {
|
|
6142
|
+
this.globalEnv.push(name);
|
|
6143
|
+
}
|
|
6144
|
+
}
|
|
6145
|
+
activateBranchNameEnvVar(options) {
|
|
6146
|
+
const value = '$([ -n "$GIT_BRANCH_NAME" ] && echo "$GIT_BRANCH_NAME" || git rev-parse --abbrev-ref HEAD)';
|
|
6147
|
+
if (options === void 0) {
|
|
6148
|
+
this.project.logger.warn(
|
|
6149
|
+
"TurboRepo.activateBranchNameEnvVar() with no arguments is deprecated. It writes GIT_BRANCH_NAME to the root `globalEnv`, which forces every task in the monorepo to miss cache on every branch switch. Pass `{ tasks: [...] }` and name only the tasks that actually consume the branch (e.g. CDK synth/package) to preserve cross-branch cache hits for everything else."
|
|
6150
|
+
);
|
|
6151
|
+
this.addGlobalEnvVar("GIT_BRANCH_NAME", value);
|
|
6152
|
+
return;
|
|
6153
|
+
}
|
|
6154
|
+
const knownTaskNames = this.tasks.map((task) => task.name);
|
|
6155
|
+
const unknown = options.tasks.filter(
|
|
6156
|
+
(name) => !knownTaskNames.includes(name)
|
|
6157
|
+
);
|
|
6158
|
+
if (unknown.length > 0) {
|
|
6159
|
+
throw new Error(
|
|
6160
|
+
`TurboRepo.activateBranchNameEnvVar: unknown task name(s) ${JSON.stringify(
|
|
6161
|
+
unknown
|
|
6162
|
+
)}. Known tasks on this TurboRepo: ${JSON.stringify(knownTaskNames)}.`
|
|
6163
|
+
);
|
|
6164
|
+
}
|
|
6165
|
+
for (const name of options.tasks) {
|
|
6166
|
+
const task = this.tasks.find((t) => t.name === name);
|
|
6167
|
+
if (task && !task.env.includes("GIT_BRANCH_NAME")) {
|
|
6168
|
+
task.env.push("GIT_BRANCH_NAME");
|
|
6169
|
+
}
|
|
6170
|
+
}
|
|
6171
|
+
}
|
|
6172
|
+
/**
|
|
6173
|
+
* Paths of all generated files in the project, deduped, for use as task
|
|
6174
|
+
* inputs so the compile cache invalidates when they change. Includes
|
|
6175
|
+
* projen-managed `FileBase` files plus generated-once `SampleFile` /
|
|
6176
|
+
* `SampleDir` — whose paths projen keeps private, so they are read defensively
|
|
6177
|
+
* and skipped if that internal shape ever changes. Computed at synth time so
|
|
6178
|
+
* files added after this component (e.g. a subclass's SampleFiles) are seen.
|
|
6179
|
+
*/
|
|
6180
|
+
generatedFileInputs() {
|
|
6181
|
+
const inputs = /* @__PURE__ */ new Set();
|
|
6182
|
+
for (const component of this.project.components) {
|
|
6183
|
+
if (component instanceof import_lib2.FileBase) {
|
|
6184
|
+
inputs.add(component.path);
|
|
6185
|
+
} else if (component instanceof import_lib2.SampleFile) {
|
|
6186
|
+
const filePath = component.filePath;
|
|
6187
|
+
if (typeof filePath === "string") {
|
|
6188
|
+
inputs.add(filePath);
|
|
6189
|
+
}
|
|
6190
|
+
} else if (component instanceof import_lib2.SampleDir) {
|
|
6191
|
+
const dir = component.dir;
|
|
6192
|
+
if (typeof dir === "string") {
|
|
6193
|
+
inputs.add(`${dir}/**`);
|
|
6194
|
+
}
|
|
6195
|
+
}
|
|
6196
|
+
}
|
|
6197
|
+
return Array.from(inputs);
|
|
6198
|
+
}
|
|
6199
|
+
preSynthesize() {
|
|
6200
|
+
let nextDependsOn = this.project.deps.all.filter((d) => d.version === "workspace:*").map((d) => [d.name, ROOT_TURBO_TASK_NAME].join("#"));
|
|
6201
|
+
if (!this.isRootProject) {
|
|
6202
|
+
[
|
|
6203
|
+
[this.project.preCompileTask, this.preCompileTask],
|
|
6204
|
+
[this.project.compileTask, this.compileTask],
|
|
6205
|
+
[this.project.postCompileTask, this.postCompileTask],
|
|
6206
|
+
[this.project.testTask, this.testTask],
|
|
6207
|
+
[this.project.packageTask, this.packageTask]
|
|
6208
|
+
].forEach(([pjTask, turboTask]) => {
|
|
6209
|
+
if (pjTask && turboTask && pjTask.steps.length > 0) {
|
|
6210
|
+
if (nextDependsOn.length > 0) {
|
|
6211
|
+
turboTask.dependsOn.push(...nextDependsOn);
|
|
6212
|
+
}
|
|
6213
|
+
nextDependsOn = [turboTask.name];
|
|
6214
|
+
} else {
|
|
6215
|
+
turboTask.isActive = false;
|
|
6216
|
+
}
|
|
6217
|
+
});
|
|
6218
|
+
this.buildTask.dependsOn.push(...nextDependsOn);
|
|
6219
|
+
}
|
|
6220
|
+
const generatedInputs = this.generatedFileInputs();
|
|
6221
|
+
const appendGeneratedInputs = (task) => {
|
|
6222
|
+
if (!task) {
|
|
6223
|
+
return;
|
|
6224
|
+
}
|
|
6225
|
+
for (const input of generatedInputs) {
|
|
6226
|
+
if (!task.inputs.includes(input)) {
|
|
6227
|
+
task.inputs.push(input);
|
|
6228
|
+
}
|
|
6229
|
+
}
|
|
6230
|
+
};
|
|
6231
|
+
if (this.isRootProject) {
|
|
6232
|
+
appendGeneratedInputs(this.buildTask);
|
|
6233
|
+
} else {
|
|
6234
|
+
appendGeneratedInputs(this.preCompileTask);
|
|
6235
|
+
appendGeneratedInputs(this.compileTask);
|
|
6236
|
+
appendGeneratedInputs(this.postCompileTask);
|
|
6237
|
+
}
|
|
6238
|
+
const fileName = "turbo.json";
|
|
6239
|
+
this.project.addPackageIgnore(fileName);
|
|
6240
|
+
new import_lib2.JsonFile(this.project, fileName, {
|
|
6241
|
+
obj: {
|
|
6242
|
+
extends: this.extends.length ? this.extends : void 0,
|
|
6243
|
+
globalDependencies: this.isRootProject && this.globalDependencies.length ? this.globalDependencies : void 0,
|
|
6244
|
+
globalEnv: this.isRootProject && this.globalEnv.length ? this.globalEnv : void 0,
|
|
6245
|
+
globalPassThroughEnv: this.isRootProject && this.globalPassThroughEnv.length ? this.globalPassThroughEnv : void 0,
|
|
6246
|
+
ui: this.isRootProject ? this.ui : void 0,
|
|
6247
|
+
dangerouslyDisablePackageManagerCheck: this.isRootProject ? this.dangerouslyDisablePackageManagerCheck : void 0,
|
|
6248
|
+
cacheDir: this.isRootProject ? this.cacheDir : void 0,
|
|
6249
|
+
envMode: this.isRootProject ? this.envMode : void 0,
|
|
6250
|
+
/**
|
|
6251
|
+
* All tasks
|
|
6252
|
+
*/
|
|
6253
|
+
tasks: this.tasks.filter((task) => task.isActive).reduce(
|
|
6254
|
+
(acc, task) => {
|
|
6255
|
+
acc[task.name] = {
|
|
6256
|
+
...task.taskConfig()
|
|
6257
|
+
};
|
|
6258
|
+
return acc;
|
|
6259
|
+
},
|
|
6260
|
+
{
|
|
6261
|
+
[this.buildTask.name]: { ...this.buildTask.taskConfig() }
|
|
6262
|
+
}
|
|
6263
|
+
)
|
|
6264
|
+
}
|
|
6265
|
+
});
|
|
6266
|
+
super.preSynthesize();
|
|
6267
|
+
}
|
|
6268
|
+
};
|
|
6269
|
+
_TurboRepo.buildWorkflowOptions = (remoteCacheOptions) => {
|
|
6270
|
+
return {
|
|
6271
|
+
env: {
|
|
6272
|
+
GIT_BRANCH_NAME: "${{ github.head_ref || github.ref_name }}"
|
|
6273
|
+
},
|
|
6274
|
+
permissions: {
|
|
6275
|
+
contents: import_workflows_model.JobPermission.WRITE,
|
|
6276
|
+
idToken: import_workflows_model.JobPermission.WRITE
|
|
6277
|
+
},
|
|
6278
|
+
preBuildSteps: [
|
|
6279
|
+
{
|
|
6280
|
+
name: "AWS Creds for SSM",
|
|
6281
|
+
uses: "aws-actions/configure-aws-credentials@v6",
|
|
6282
|
+
with: {
|
|
6283
|
+
["role-to-assume"]: remoteCacheOptions.oidcRole,
|
|
6284
|
+
["aws-region"]: "us-east-1",
|
|
6285
|
+
["role-duration-seconds"]: "900"
|
|
6286
|
+
}
|
|
6287
|
+
}
|
|
6288
|
+
]
|
|
6289
|
+
};
|
|
6290
|
+
};
|
|
6291
|
+
var TurboRepo = _TurboRepo;
|
|
6292
|
+
|
|
6293
|
+
// src/agent/bundles/build-policy.ts
|
|
6294
|
+
var DEFAULT_BUILD_POLICY = {
|
|
6295
|
+
remoteCacheEnabled: false
|
|
6296
|
+
};
|
|
6297
|
+
function resolveBuildPolicy(project) {
|
|
6298
|
+
const remoteCacheOptions = TurboRepo.of(project)?.remoteCacheOptions;
|
|
6299
|
+
if (!remoteCacheOptions) {
|
|
6300
|
+
return DEFAULT_BUILD_POLICY;
|
|
6301
|
+
}
|
|
6302
|
+
return {
|
|
6303
|
+
remoteCacheEnabled: true,
|
|
6304
|
+
awsProfileName: remoteCacheOptions.profileName
|
|
6305
|
+
};
|
|
6306
|
+
}
|
|
6307
|
+
|
|
5907
6308
|
// src/agent/bundles/business-models.ts
|
|
5908
6309
|
var TEMPLATE_CANVAS = `---
|
|
5909
6310
|
title: "Business Model: <Segment Name>"
|
|
@@ -10842,188 +11243,210 @@ var cleanMergedBranchesSkill = {
|
|
|
10842
11243
|
}
|
|
10843
11244
|
]
|
|
10844
11245
|
};
|
|
10845
|
-
|
|
10846
|
-
|
|
10847
|
-
|
|
10848
|
-
|
|
10849
|
-
|
|
10850
|
-
|
|
10851
|
-
|
|
10852
|
-
|
|
10853
|
-
|
|
10854
|
-
|
|
10855
|
-
|
|
10856
|
-
|
|
10857
|
-
|
|
10858
|
-
|
|
10859
|
-
|
|
10860
|
-
|
|
10861
|
-
|
|
10862
|
-
|
|
10863
|
-
|
|
10864
|
-
|
|
10865
|
-
|
|
10866
|
-
|
|
10867
|
-
|
|
10868
|
-
|
|
10869
|
-
|
|
10870
|
-
|
|
10871
|
-
|
|
10872
|
-
"
|
|
10873
|
-
|
|
10874
|
-
|
|
10875
|
-
|
|
10876
|
-
|
|
10877
|
-
|
|
10878
|
-
|
|
10879
|
-
|
|
10880
|
-
"
|
|
10881
|
-
|
|
10882
|
-
|
|
10883
|
-
|
|
10884
|
-
"
|
|
10885
|
-
"
|
|
10886
|
-
|
|
10887
|
-
|
|
10888
|
-
|
|
10889
|
-
|
|
10890
|
-
|
|
10891
|
-
|
|
10892
|
-
|
|
10893
|
-
|
|
10894
|
-
|
|
10895
|
-
|
|
10896
|
-
|
|
10897
|
-
|
|
10898
|
-
|
|
10899
|
-
|
|
10900
|
-
|
|
10901
|
-
|
|
10902
|
-
|
|
10903
|
-
|
|
10904
|
-
|
|
10905
|
-
|
|
10906
|
-
|
|
10907
|
-
|
|
10908
|
-
|
|
10909
|
-
|
|
10910
|
-
|
|
10911
|
-
|
|
10912
|
-
|
|
10913
|
-
|
|
10914
|
-
|
|
10915
|
-
|
|
10916
|
-
|
|
10917
|
-
|
|
10918
|
-
|
|
10919
|
-
|
|
10920
|
-
|
|
10921
|
-
|
|
10922
|
-
|
|
10923
|
-
|
|
10924
|
-
|
|
10925
|
-
|
|
10926
|
-
|
|
10927
|
-
|
|
10928
|
-
|
|
10929
|
-
|
|
10930
|
-
|
|
10931
|
-
|
|
10932
|
-
|
|
10933
|
-
|
|
10934
|
-
|
|
10935
|
-
|
|
10936
|
-
|
|
10937
|
-
|
|
10938
|
-
|
|
10939
|
-
|
|
10940
|
-
|
|
10941
|
-
|
|
10942
|
-
|
|
10943
|
-
|
|
10944
|
-
|
|
10945
|
-
|
|
10946
|
-
|
|
10947
|
-
|
|
10948
|
-
|
|
10949
|
-
|
|
10950
|
-
|
|
10951
|
-
|
|
10952
|
-
|
|
10953
|
-
|
|
10954
|
-
|
|
10955
|
-
|
|
10956
|
-
|
|
10957
|
-
|
|
10958
|
-
|
|
10959
|
-
|
|
10960
|
-
|
|
10961
|
-
|
|
10962
|
-
|
|
10963
|
-
|
|
10964
|
-
|
|
10965
|
-
|
|
10966
|
-
|
|
10967
|
-
|
|
10968
|
-
|
|
10969
|
-
|
|
10970
|
-
|
|
10971
|
-
|
|
10972
|
-
|
|
10973
|
-
|
|
10974
|
-
|
|
10975
|
-
"",
|
|
10976
|
-
|
|
10977
|
-
|
|
10978
|
-
|
|
10979
|
-
|
|
10980
|
-
|
|
10981
|
-
|
|
10982
|
-
|
|
10983
|
-
|
|
10984
|
-
|
|
10985
|
-
|
|
10986
|
-
|
|
10987
|
-
|
|
10988
|
-
|
|
10989
|
-
|
|
10990
|
-
|
|
10991
|
-
|
|
10992
|
-
|
|
10993
|
-
|
|
10994
|
-
|
|
10995
|
-
|
|
10996
|
-
|
|
10997
|
-
|
|
10998
|
-
|
|
10999
|
-
|
|
11000
|
-
|
|
11001
|
-
|
|
11002
|
-
|
|
11003
|
-
|
|
11004
|
-
|
|
11005
|
-
|
|
11006
|
-
|
|
11007
|
-
|
|
11008
|
-
|
|
11009
|
-
|
|
11010
|
-
|
|
11011
|
-
|
|
11012
|
-
|
|
11013
|
-
|
|
11014
|
-
|
|
11015
|
-
|
|
11016
|
-
|
|
11017
|
-
|
|
11018
|
-
"
|
|
11019
|
-
"
|
|
11020
|
-
|
|
11021
|
-
|
|
11022
|
-
|
|
11023
|
-
|
|
11024
|
-
|
|
11025
|
-
|
|
11026
|
-
|
|
11246
|
+
function renderPrWorkflowBuildStep(policy) {
|
|
11247
|
+
const lines = [
|
|
11248
|
+
"2. **Run the build \u2014 scoped to what changed.**",
|
|
11249
|
+
"",
|
|
11250
|
+
" - **Documentation-only changes** \u2014 a diff confined to documentation content (markdown pages, no source, config, or projen inputs) does **not** require `pnpm build:all`. There is nothing to compile, and CI is the authoritative content gate. Commit the content and proceed to the next step.",
|
|
11251
|
+
" - **Everything else** \u2014 when the change touches build inputs (source code, `.projenrc.ts`, `projenrc/**`, or any other projen-generated config), run `pnpm build:all` to compile, lint, and test all packages (mirrors the CI pipeline). If the build produces changes to turbo inputs (typically snapshot files or ESLint auto-fixes), commit those changes and run `pnpm build:all` again \u2014 the build must complete cleanly with no uncommitted changes."
|
|
11252
|
+
];
|
|
11253
|
+
if (policy.remoteCacheEnabled && policy.awsProfileName) {
|
|
11254
|
+
lines.push(
|
|
11255
|
+
"",
|
|
11256
|
+
` \`pnpm build:all\` uses the Turborepo **remote cache**, which requires the user to be authenticated to AWS on the \`${policy.awsProfileName}\` profile. If the command fails due to AWS credentials, ask the user to authenticate first.`
|
|
11257
|
+
);
|
|
11258
|
+
}
|
|
11259
|
+
lines.push(
|
|
11260
|
+
"",
|
|
11261
|
+
" **Never background a long build and end the turn.** If you run a build, run it in the **foreground** to completion before committing, pushing, or opening the PR. Launching `pnpm build:all` as a background process and ending your turn while it is still running strands the deliverable uncommitted \u2014 that work is lost. This is the documented root cause of autonomous worker-stall incidents."
|
|
11262
|
+
);
|
|
11263
|
+
return lines;
|
|
11264
|
+
}
|
|
11265
|
+
function buildGithubWorkflowBundle(buildPolicy = DEFAULT_BUILD_POLICY) {
|
|
11266
|
+
return {
|
|
11267
|
+
name: "github-workflow",
|
|
11268
|
+
description: "GitHub issue and PR workflow automation patterns",
|
|
11269
|
+
appliesWhen: (project) => hasComponent(project, import_github.GitHub),
|
|
11270
|
+
rules: [
|
|
11271
|
+
{
|
|
11272
|
+
name: "issue-workflow",
|
|
11273
|
+
description: "Automated workflow for starting work on a GitHub issue",
|
|
11274
|
+
scope: AGENT_RULE_SCOPE.ALWAYS,
|
|
11275
|
+
content: [
|
|
11276
|
+
"# Issue Workflow",
|
|
11277
|
+
"",
|
|
11278
|
+
'## "Work on issue X" Automation',
|
|
11279
|
+
"",
|
|
11280
|
+
"When the user says **work on issue X** (or similar), invoke the `issue-worker` agent in interactive mode, passing the issue number in the prompt. Do not perform the branch creation, issue fetching, or planning steps yourself \u2014 the agent handles the full workflow (claim, branch, plan, implement, PR) and will pause for your approval at the appropriate checkpoints."
|
|
11281
|
+
].join("\n"),
|
|
11282
|
+
tags: ["workflow"]
|
|
11283
|
+
},
|
|
11284
|
+
{
|
|
11285
|
+
name: "create-issue-workflow",
|
|
11286
|
+
description: "Automated workflow for creating a new GitHub issue",
|
|
11287
|
+
// ALWAYS scope: users invoke "create an issue" from any
|
|
11288
|
+
// context, not only when editing agent / skill / bundle source.
|
|
11289
|
+
// Consumers that want to narrow the load can override via
|
|
11290
|
+
// `agentConfig.additionalRulePaths` or `excludeRules`.
|
|
11291
|
+
scope: AGENT_RULE_SCOPE.ALWAYS,
|
|
11292
|
+
content: [
|
|
11293
|
+
"# Create Issue Workflow",
|
|
11294
|
+
"",
|
|
11295
|
+
'## "Create an issue" Automation',
|
|
11296
|
+
"",
|
|
11297
|
+
"When the user says **create an issue** (or similar), follow these steps exactly:",
|
|
11298
|
+
"",
|
|
11299
|
+
"1. **Determine the issue type prefix** from the user's description:",
|
|
11300
|
+
" - `epic:` \u2014 Large initiatives spanning multiple child issues",
|
|
11301
|
+
" - `feat:` \u2014 New features or functionality",
|
|
11302
|
+
" - `fix:` \u2014 Bug fixes",
|
|
11303
|
+
" - `chore:` \u2014 Maintenance: deps, tooling, config",
|
|
11304
|
+
" - `docs:` \u2014 Documentation-only work",
|
|
11305
|
+
" - `refactor:` \u2014 Code restructure, no behavior change",
|
|
11306
|
+
" - `release:` \u2014 Release preparation, version bumps",
|
|
11307
|
+
" - `hotfix:` \u2014 Urgent production fixes",
|
|
11308
|
+
" - If unclear, ask the user which type applies",
|
|
11309
|
+
"2. **Compose the issue title** in the format: `<type>: <short description>`",
|
|
11310
|
+
"3. **Determine the GitHub issue type** based on the prefix:",
|
|
11311
|
+
" - `epic:` \u2192 Epic",
|
|
11312
|
+
" - `feat:` \u2192 Feature",
|
|
11313
|
+
" - `fix:` \u2192 Bug",
|
|
11314
|
+
" - `chore:`, `docs:`, `refactor:`, `release:`, `hotfix:` \u2192 Task",
|
|
11315
|
+
"4. **Identify prerequisite issues** \u2014 if the user mentions dependencies or blockers, include a **Dependencies** section in the body with `Depends on: #<issue-number>`",
|
|
11316
|
+
"5. **Determine labels** \u2014 every issue must be created with the following labels:",
|
|
11317
|
+
" - **`type:*`** \u2014 derived from the issue title prefix:",
|
|
11318
|
+
" - `epic:` \u2192 `type:feat`",
|
|
11319
|
+
" - `feat:` \u2192 `type:feat`",
|
|
11320
|
+
" - `fix:` \u2192 `type:fix`",
|
|
11321
|
+
" - `chore:` \u2192 `type:chore`",
|
|
11322
|
+
" - `docs:` \u2192 `type:docs`",
|
|
11323
|
+
" - `refactor:` \u2192 `type:refactor`",
|
|
11324
|
+
" - `release:` \u2192 `type:release`",
|
|
11325
|
+
" - `hotfix:` \u2192 `type:hotfix`",
|
|
11326
|
+
' - **`priority:*`** \u2014 infer from the user\'s description when possible (e.g., "urgent"/"critical" \u2192 `priority:critical`, "important" \u2192 `priority:high`, "minor"/"low priority" \u2192 `priority:low`). If the priority is unclear, ask the user before creating the issue. Valid values: `priority:critical`, `priority:high`, `priority:medium`, `priority:low`, `priority:trivial`',
|
|
11327
|
+
" - **`status:ready`** \u2014 always add unless the issue has dependencies or blockers, in which case use `status:blocked`",
|
|
11328
|
+
"6. **Create the issue** using `gh issue create`:",
|
|
11329
|
+
" - `--title '<type>: <description>'`",
|
|
11330
|
+
" - `--body '<issue body>'`",
|
|
11331
|
+
" - `--label '<type-label>' --label '<priority-label>' --label '<status-label>'`",
|
|
11332
|
+
"7. **Set the GitHub issue type** by invoking the `set-issue-type.sh` helper (shipped with this bundle):",
|
|
11333
|
+
"",
|
|
11334
|
+
" ```sh",
|
|
11335
|
+
" .claude/procedures/set-issue-type.sh <issue-number> <Feature|Task|Epic|Bug>",
|
|
11336
|
+
" ```",
|
|
11337
|
+
"",
|
|
11338
|
+
" The helper resolves owner/repo, looks up the issue type node ID, looks up the issue node ID, and applies the `updateIssueIssueType` mutation in one step. It exits non-zero with a clear diagnostic on any error and lists available types if the type name is not recognised.",
|
|
11339
|
+
"",
|
|
11340
|
+
" **Under the hood** (documented fallback if the helper is unavailable): the helper performs a two-step GraphQL flow \u2014 first a `repository(...).issueTypes` query to map the human-readable type name to a node ID, then the `updateIssueIssueType` mutation. The canonical queries are:",
|
|
11341
|
+
"",
|
|
11342
|
+
" ```sh",
|
|
11343
|
+
" gh api graphql -f query='query($owner:String!,$repo:String!){repository(owner:$owner,name:$repo){issueTypes(first:50){nodes{id name}}}}' -f owner=<owner> -f repo=<repo>",
|
|
11344
|
+
" gh api graphql -f query='mutation($issueId:ID!,$typeId:ID!){updateIssueIssueType(input:{issueId:$issueId,issueTypeId:$typeId}){issue{number issueType{name}}}}' -f issueId=<issue-node-id> -f typeId=<issue-type-node-id>",
|
|
11345
|
+
" ```",
|
|
11346
|
+
"",
|
|
11347
|
+
"### Issue Body Template",
|
|
11348
|
+
"",
|
|
11349
|
+
"```markdown",
|
|
11350
|
+
"## Summary",
|
|
11351
|
+
"",
|
|
11352
|
+
"<1-3 sentences describing the issue>",
|
|
11353
|
+
"",
|
|
11354
|
+
"## Details",
|
|
11355
|
+
"",
|
|
11356
|
+
"<Detailed description, acceptance criteria, or reproduction steps as appropriate>",
|
|
11357
|
+
"",
|
|
11358
|
+
"## Dependencies",
|
|
11359
|
+
"",
|
|
11360
|
+
"Depends on: #<issue-number> (if any, otherwise omit this section)",
|
|
11361
|
+
"```",
|
|
11362
|
+
"",
|
|
11363
|
+
"### Important",
|
|
11364
|
+
"",
|
|
11365
|
+
"- Always use the conventional prefix in the issue title",
|
|
11366
|
+
"- Always assign the correct GitHub issue type via the `set-issue-type.sh` helper (step 7) \u2014 never via `gh issue create --type`",
|
|
11367
|
+
"- Always include `type:*`, `priority:*`, and `status:*` labels",
|
|
11368
|
+
"- If the user does not specify a type, ask before creating the issue",
|
|
11369
|
+
"- If the priority cannot be inferred from the description, ask the user before creating the issue",
|
|
11370
|
+
"- Keep titles concise and descriptive"
|
|
11371
|
+
].join("\n"),
|
|
11372
|
+
tags: ["workflow"]
|
|
11373
|
+
},
|
|
11374
|
+
{
|
|
11375
|
+
name: "pr-workflow",
|
|
11376
|
+
description: "Automated workflow for opening a pull request",
|
|
11377
|
+
scope: AGENT_RULE_SCOPE.ALWAYS,
|
|
11378
|
+
content: [
|
|
11379
|
+
"# PR Workflow",
|
|
11380
|
+
"",
|
|
11381
|
+
'## "Open a PR" Automation',
|
|
11382
|
+
"",
|
|
11383
|
+
"When the user says **open a PR** (or similar), follow these steps exactly:",
|
|
11384
|
+
"",
|
|
11385
|
+
"1. **Regenerate project files** \u2014 run the three-step regen sequence (`pnpm i`, then `pnpm exec projen`, then `pnpm i` again) to ensure all generated files are up to date. The leading `pnpm i` is required because `pnpm exec projen` synthesises against whatever version of configulator (and projen, and any projen plugins) is currently resolved in `node_modules`; if the lockfile has moved past `node_modules` (typically right after `git pull` lands a dependency upgrade, or on a fresh checkout), synth runs against stale templates and produces phantom drift in `.claude/`, `.github/labels.yml`, `CLAUDE.md`, and other generated files. The trailing `pnpm i` picks up any dependency changes projen wrote into `package.json` during synth. Check `git diff` after the third step \u2014 if there are changes, commit them before proceeding.",
|
|
11386
|
+
...renderPrWorkflowBuildStep(buildPolicy),
|
|
11387
|
+
"3. **Check for uncommitted changes** \u2014 if any exist, commit them with a conventional commit message",
|
|
11388
|
+
"4. **Pull and rebase from the default branch** \u2014 run `git pull origin {{repository.defaultBranch}} --rebase` to incorporate the latest changes and resolve any conflicts before pushing",
|
|
11389
|
+
"5. **Push the branch** to origin: `git push -u origin <branch>`",
|
|
11390
|
+
"6. **Create the PR** using `gh pr create`:",
|
|
11391
|
+
" - **Title**: use a conventional commit style title (e.g., `feat(scope): short description`)",
|
|
11392
|
+
" - **Body**: include `Closes #<issue-number>` (derived from the branch name) and a brief summary of changes",
|
|
11393
|
+
"7. **Delegate review and merge to the `pr-reviewer` sub-agent.** After the PR is created, invoke the `/review-pr <pr-number>` skill (or otherwise hand the new PR number to the `pr-reviewer` sub-agent). The reviewer verifies the diff against the linked issue's acceptance criteria and enables squash auto-merge when all checks pass. Do **not** run `gh pr merge --auto` yourself \u2014 review/merge policy lives solely in the `pr-reviewer` agent.",
|
|
11394
|
+
"",
|
|
11395
|
+
"### PR Body Template",
|
|
11396
|
+
"",
|
|
11397
|
+
"```markdown",
|
|
11398
|
+
"## Summary",
|
|
11399
|
+
"",
|
|
11400
|
+
"<1-3 bullet points describing what changed and why>",
|
|
11401
|
+
"",
|
|
11402
|
+
"Closes #<issue-number>",
|
|
11403
|
+
"",
|
|
11404
|
+
"## Test Plan",
|
|
11405
|
+
"",
|
|
11406
|
+
"- [ ] Tests pass locally",
|
|
11407
|
+
"- [ ] Relevant changes have been reviewed",
|
|
11408
|
+
"```",
|
|
11409
|
+
"",
|
|
11410
|
+
"### Important",
|
|
11411
|
+
"",
|
|
11412
|
+
"- Always derive the issue number from the branch name (e.g., `feat/42-add-login` \u2192 `#42`)",
|
|
11413
|
+
"- Use conventional commit format for the PR title",
|
|
11414
|
+
"- Delegate merge to the `pr-reviewer` sub-agent \u2014 do not merge manually and do not enable auto-merge directly"
|
|
11415
|
+
].join("\n"),
|
|
11416
|
+
tags: ["workflow"]
|
|
11417
|
+
},
|
|
11418
|
+
{
|
|
11419
|
+
name: "branch-cleanup",
|
|
11420
|
+
description: "Local-branch hygiene helpers shipped with the github-workflow bundle, including the /clean-merged-branches skill for safely force-deleting branches whose content has already merged into the base (handles squash merges).",
|
|
11421
|
+
scope: AGENT_RULE_SCOPE.ALWAYS,
|
|
11422
|
+
content: [
|
|
11423
|
+
"# Branch Cleanup",
|
|
11424
|
+
"",
|
|
11425
|
+
"Local branches accumulate after every merged PR. In squash-merge",
|
|
11426
|
+
"repositories `git branch -d` refuses to delete them because the",
|
|
11427
|
+
"commit hash on the base differs, even when the branch content is",
|
|
11428
|
+
"fully merged. The `github-workflow` bundle ships two affordances",
|
|
11429
|
+
"that use content-equality (not commit-graph reachability) to",
|
|
11430
|
+
"identify branches safe to force-delete:",
|
|
11431
|
+
"",
|
|
11432
|
+
"- `/clean-merged-branches` \u2014 interactive slash-command skill that",
|
|
11433
|
+
" classifies every local branch, prompts for confirmation, then",
|
|
11434
|
+
" runs `git branch -D` on the confirmed list. See",
|
|
11435
|
+
" `.claude/skills/clean-merged-branches/SKILL.md` for usage,",
|
|
11436
|
+
" output format, and the squash-merge verification algorithm.",
|
|
11437
|
+
"- `.claude/procedures/clean-merged-branches.sh` \u2014 analysis-only",
|
|
11438
|
+
" procedure for non-interactive agent use (orchestrator,",
|
|
11439
|
+
" maintenance-audit). NEVER deletes \u2014 only reports `MERGED` /",
|
|
11440
|
+
" `UNMERGED` / `EMPTY` / `SKIP_WORKTREE` lines."
|
|
11441
|
+
].join("\n"),
|
|
11442
|
+
tags: ["workflow"]
|
|
11443
|
+
}
|
|
11444
|
+
],
|
|
11445
|
+
skills: [cleanMergedBranchesSkill],
|
|
11446
|
+
procedures: [setIssueTypeProcedure, cleanMergedBranchesProcedure]
|
|
11447
|
+
};
|
|
11448
|
+
}
|
|
11449
|
+
var githubWorkflowBundle = buildGithubWorkflowBundle();
|
|
11027
11450
|
|
|
11028
11451
|
// src/agent/bundles/industry-discovery.ts
|
|
11029
11452
|
function buildIndustryDiscoveryAnalystSubAgent(paths, issueDefaults) {
|
|
@@ -31525,429 +31948,56 @@ function buildStandardsResearchBundle(paths = DEFAULT_AGENT_PATHS, issueDefaults
|
|
|
31525
31948
|
}
|
|
31526
31949
|
var standardsResearchBundle = buildStandardsResearchBundle();
|
|
31527
31950
|
|
|
31528
|
-
// src/
|
|
31529
|
-
|
|
31530
|
-
|
|
31531
|
-
|
|
31532
|
-
// src/turbo/turbo-repo-task.ts
|
|
31533
|
-
var import_lib = require("projen/lib");
|
|
31534
|
-
var TurboRepoTask = class extends import_lib.Component {
|
|
31535
|
-
constructor(project, options) {
|
|
31536
|
-
super(project);
|
|
31537
|
-
this.project = project;
|
|
31538
|
-
this.name = options.name;
|
|
31539
|
-
this.dependsOn = options.dependsOn ?? [];
|
|
31540
|
-
this.env = options.env ?? [];
|
|
31541
|
-
this.passThroughEnv = options.passThroughEnv ?? [];
|
|
31542
|
-
this.outputs = options.outputs ?? [];
|
|
31543
|
-
this.cache = options.cache ?? true;
|
|
31544
|
-
this.inputs = [
|
|
31545
|
-
...options.inputs ?? [],
|
|
31546
|
-
// rerun if projen config changes
|
|
31547
|
-
".projen/**",
|
|
31548
|
-
// ignore mac files
|
|
31549
|
-
"!.DS_Store",
|
|
31550
|
-
"!**/.DS_Store"
|
|
31551
|
-
];
|
|
31552
|
-
this.outputLogs = options.outputLogs ?? "new-only";
|
|
31553
|
-
this.persistent = options.persistent ?? false;
|
|
31554
|
-
this.interactive = options.interactive ?? false;
|
|
31555
|
-
this.isActive = true;
|
|
31556
|
-
}
|
|
31557
|
-
taskConfig() {
|
|
31558
|
-
return {
|
|
31559
|
-
dependsOn: this.dependsOn,
|
|
31560
|
-
env: this.env,
|
|
31561
|
-
passThroughEnv: this.passThroughEnv,
|
|
31562
|
-
outputs: this.outputs,
|
|
31563
|
-
cache: this.cache,
|
|
31564
|
-
inputs: this.inputs,
|
|
31565
|
-
outputLogs: this.outputLogs,
|
|
31566
|
-
persistent: this.persistent,
|
|
31567
|
-
interactive: this.interactive
|
|
31568
|
-
};
|
|
31569
|
-
}
|
|
31570
|
-
};
|
|
31571
|
-
|
|
31572
|
-
// src/turbo/turbo-repo.ts
|
|
31573
|
-
var ROOT_TURBO_TASK_NAME = "turbo:build";
|
|
31574
|
-
var ROOT_CI_TASK_NAME = "build:all";
|
|
31575
|
-
var _TurboRepo = class _TurboRepo extends import_lib2.Component {
|
|
31576
|
-
constructor(project, options = {}) {
|
|
31577
|
-
super(project);
|
|
31578
|
-
this.project = project;
|
|
31579
|
-
/**
|
|
31580
|
-
* Sub-Tasks to run
|
|
31581
|
-
*/
|
|
31582
|
-
this.tasks = [];
|
|
31583
|
-
this.turboVersion = options.turboVersion ?? "catalog:";
|
|
31584
|
-
this.isRootProject = project === project.root;
|
|
31585
|
-
if (this.isRootProject) {
|
|
31586
|
-
project.addDevDeps(`turbo@${this.turboVersion}`);
|
|
31587
|
-
}
|
|
31588
|
-
project.gitignore.addPatterns("/.turbo");
|
|
31589
|
-
project.npmignore?.addPatterns("/.turbo/");
|
|
31590
|
-
this.extends = options.extends ?? (this.isRootProject ? [] : ["//"]);
|
|
31591
|
-
this.globalDependencies = options.globalDependencies ?? [];
|
|
31592
|
-
this.globalEnv = options.globalEnv ?? [];
|
|
31593
|
-
this.globalPassThroughEnv = options.globalPassThroughEnv ?? [];
|
|
31594
|
-
this.ui = options.ui ?? "stream";
|
|
31595
|
-
this.dangerouslyDisablePackageManagerCheck = options.dangerouslyDisablePackageManagerCheck ?? false;
|
|
31596
|
-
this.cacheDir = options.cacheDir ?? ".turbo/cache";
|
|
31597
|
-
this.daemon = options.daemon ?? true;
|
|
31598
|
-
this.envMode = options.envMode ?? "strict";
|
|
31599
|
-
this.runOptions = {
|
|
31600
|
-
...options.runOptions,
|
|
31601
|
-
summarize: options.runOptions?.summarize ?? true,
|
|
31602
|
-
concurrency: options.runOptions?.concurrency ?? 10
|
|
31603
|
-
};
|
|
31604
|
-
this.remoteCacheOptions = options.remoteCacheOptions;
|
|
31605
|
-
this.buildAllTaskEnvVars = options.buildAllTaskEnvVars ?? {};
|
|
31606
|
-
this.buildTask = new TurboRepoTask(this.project, {
|
|
31607
|
-
name: ROOT_TURBO_TASK_NAME,
|
|
31608
|
-
dependsOn: this.isRootProject ? [`^${ROOT_TURBO_TASK_NAME}`] : []
|
|
31609
|
-
});
|
|
31610
|
-
if (this.isRootProject) {
|
|
31611
|
-
this.buildAllTask = this.project.tasks.addTask(ROOT_CI_TASK_NAME, {
|
|
31612
|
-
description: "Root build followed by sub-project builds. Mimics the CI build process in one step."
|
|
31613
|
-
});
|
|
31614
|
-
this.buildAllTask.exec("turbo telemetry disable");
|
|
31615
|
-
if (this.buildAllTaskEnvVars) {
|
|
31616
|
-
Object.entries(this.buildAllTaskEnvVars).forEach(([name, value]) => {
|
|
31617
|
-
this.addGlobalEnvVar(name, value);
|
|
31618
|
-
});
|
|
31619
|
-
}
|
|
31620
|
-
if (!this.remoteCacheOptions) {
|
|
31621
|
-
this.buildAllTask.exec(
|
|
31622
|
-
`turbo ${ROOT_TURBO_TASK_NAME} ${this.renderRunArgs(false)}`
|
|
31623
|
-
);
|
|
31624
|
-
} else {
|
|
31625
|
-
this.buildAllTask.exec(
|
|
31626
|
-
`turbo ${ROOT_TURBO_TASK_NAME} ${this.renderRunArgs(true)}`,
|
|
31627
|
-
{
|
|
31628
|
-
condition: '[ ! -n "$CI" ]',
|
|
31629
|
-
env: {
|
|
31630
|
-
TURBO_ENDPOINT: `$(aws ssm get-parameter --name ${this.remoteCacheOptions.endpointParamName} --query Parameter.Value --output text --profile ${this.remoteCacheOptions.profileName})`,
|
|
31631
|
-
TURBO_TOKEN: `$(aws ssm get-parameter --name ${this.remoteCacheOptions.tokenParamName} --query Parameter.Value --output text --profile ${this.remoteCacheOptions.profileName})`
|
|
31632
|
-
}
|
|
31633
|
-
}
|
|
31634
|
-
);
|
|
31635
|
-
this.buildAllTask.exec(
|
|
31636
|
-
`turbo ${ROOT_TURBO_TASK_NAME} ${this.renderRunArgs(true)}`,
|
|
31637
|
-
{
|
|
31638
|
-
condition: '[ -n "$CI" ]',
|
|
31639
|
-
env: {
|
|
31640
|
-
TURBO_ENDPOINT: `$(aws ssm get-parameter --name ${this.remoteCacheOptions.endpointParamName} --query Parameter.Value --output text)`,
|
|
31641
|
-
TURBO_TOKEN: `$(aws ssm get-parameter --name ${this.remoteCacheOptions.tokenParamName} --query Parameter.Value --output text)`
|
|
31642
|
-
}
|
|
31643
|
-
}
|
|
31644
|
-
);
|
|
31645
|
-
}
|
|
31646
|
-
}
|
|
31647
|
-
if (!this.isRootProject) {
|
|
31648
|
-
this.preCompileTask = new TurboRepoTask(project, {
|
|
31649
|
-
name: options.preCompileTask?.name ?? "pre-compile",
|
|
31650
|
-
inputs: ["src/**"]
|
|
31651
|
-
});
|
|
31652
|
-
this.compileTask = new TurboRepoTask(project, {
|
|
31653
|
-
name: options.compileTask?.name ?? "compile",
|
|
31654
|
-
inputs: ["src/**"]
|
|
31655
|
-
});
|
|
31656
|
-
this.postCompileTask = new TurboRepoTask(project, {
|
|
31657
|
-
name: options.postCompileTask?.name ?? "post-compile",
|
|
31658
|
-
inputs: ["src/**"]
|
|
31659
|
-
});
|
|
31660
|
-
this.testTask = new TurboRepoTask(project, {
|
|
31661
|
-
name: options.testTask?.name ?? "test"
|
|
31662
|
-
});
|
|
31663
|
-
this.packageTask = new TurboRepoTask(project, {
|
|
31664
|
-
name: options.packageTask?.name ?? "package",
|
|
31665
|
-
inputs: [".npmignore"]
|
|
31666
|
-
});
|
|
31667
|
-
this.tasks.push(
|
|
31668
|
-
this.preCompileTask,
|
|
31669
|
-
this.compileTask,
|
|
31670
|
-
this.postCompileTask,
|
|
31671
|
-
this.testTask,
|
|
31672
|
-
this.packageTask
|
|
31673
|
-
);
|
|
31674
|
-
}
|
|
31675
|
-
}
|
|
31676
|
-
/**
|
|
31677
|
-
* Static method to discovert turbo in a project.
|
|
31678
|
-
*/
|
|
31679
|
-
static of(project) {
|
|
31680
|
-
const isDefined = (c) => c instanceof _TurboRepo;
|
|
31681
|
-
return project.components.find(isDefined);
|
|
31682
|
-
}
|
|
31683
|
-
/**
|
|
31684
|
-
* Render the `turbo run` CLI flag string for the `build:all` / `reset:all`
|
|
31685
|
-
* task commands from {@link runOptions}. With no `runOptions` configured the
|
|
31686
|
-
* output matches the historically hard-coded flags exactly.
|
|
31687
|
-
*
|
|
31688
|
-
* @param remote - when `true`, also emit the remote-cache flags
|
|
31689
|
-
* (`--cache=remote:rw` plus `--api` / `--token` / `--team` derived from
|
|
31690
|
-
* {@link remoteCacheOptions}). The remote-cache `build:all` variant passes
|
|
31691
|
-
* `true`; `reset:all` and the local `build:all` variant pass `false`.
|
|
31692
|
-
*/
|
|
31693
|
-
renderRunArgs(remote) {
|
|
31694
|
-
const run = this.runOptions;
|
|
31695
|
-
const args = [];
|
|
31696
|
-
if (run.summarize) {
|
|
31697
|
-
args.push("--summarize");
|
|
31698
|
-
}
|
|
31699
|
-
args.push(`--concurrency=${run.concurrency}`);
|
|
31700
|
-
if (run.force) {
|
|
31701
|
-
args.push("--force");
|
|
31702
|
-
}
|
|
31703
|
-
if (run.noCache) {
|
|
31704
|
-
args.push("--no-cache");
|
|
31705
|
-
}
|
|
31706
|
-
if (run.only) {
|
|
31707
|
-
args.push("--only");
|
|
31708
|
-
}
|
|
31709
|
-
if (run.affected) {
|
|
31710
|
-
args.push("--affected");
|
|
31711
|
-
}
|
|
31712
|
-
if (run.cacheWorkers !== void 0) {
|
|
31713
|
-
args.push(`--cache-workers=${run.cacheWorkers}`);
|
|
31714
|
-
}
|
|
31715
|
-
if (run.continueOn !== void 0) {
|
|
31716
|
-
args.push(`--continue=${run.continueOn}`);
|
|
31717
|
-
}
|
|
31718
|
-
if (run.frameworkInference !== void 0) {
|
|
31719
|
-
args.push(`--framework-inference=${run.frameworkInference}`);
|
|
31720
|
-
}
|
|
31721
|
-
for (const filter of run.filter ?? []) {
|
|
31722
|
-
args.push(`--filter=${filter}`);
|
|
31723
|
-
}
|
|
31724
|
-
if (run.outputLogs !== void 0) {
|
|
31725
|
-
args.push(`--output-logs=${run.outputLogs}`);
|
|
31726
|
-
}
|
|
31727
|
-
if (run.logOrder !== void 0) {
|
|
31728
|
-
args.push(`--log-order=${run.logOrder}`);
|
|
31729
|
-
}
|
|
31730
|
-
if (run.logPrefix !== void 0) {
|
|
31731
|
-
args.push(`--log-prefix=${run.logPrefix}`);
|
|
31732
|
-
}
|
|
31733
|
-
if (run.dryRun !== void 0) {
|
|
31734
|
-
args.push(`--dry-run=${run.dryRun}`);
|
|
31735
|
-
}
|
|
31736
|
-
const cache = run.cache ?? (remote ? "remote:rw" : void 0);
|
|
31737
|
-
if (cache !== void 0) {
|
|
31738
|
-
args.push(`--cache=${cache}`);
|
|
31739
|
-
}
|
|
31740
|
-
if (remote && this.remoteCacheOptions) {
|
|
31741
|
-
args.push(
|
|
31742
|
-
"--api=$TURBO_ENDPOINT",
|
|
31743
|
-
"--token=$TURBO_TOKEN",
|
|
31744
|
-
`--team=${this.remoteCacheOptions.teamName}`
|
|
31745
|
-
);
|
|
31746
|
-
}
|
|
31747
|
-
if (run.additionalArgs) {
|
|
31748
|
-
args.push(...run.additionalArgs);
|
|
31749
|
-
}
|
|
31750
|
-
return args.join(" ");
|
|
31751
|
-
}
|
|
31752
|
-
/**
|
|
31753
|
-
* Add an env var to the global env vars for all tasks.
|
|
31754
|
-
* This will also become an input for the build:all task cache at the root.
|
|
31755
|
-
*/
|
|
31756
|
-
addGlobalEnvVar(name, value) {
|
|
31757
|
-
this.buildAllTask?.env(name, value);
|
|
31758
|
-
if (this.isRootProject) {
|
|
31759
|
-
this.globalEnv.push(name);
|
|
31760
|
-
}
|
|
31761
|
-
}
|
|
31762
|
-
activateBranchNameEnvVar(options) {
|
|
31763
|
-
const value = '$([ -n "$GIT_BRANCH_NAME" ] && echo "$GIT_BRANCH_NAME" || git rev-parse --abbrev-ref HEAD)';
|
|
31764
|
-
if (options === void 0) {
|
|
31765
|
-
this.project.logger.warn(
|
|
31766
|
-
"TurboRepo.activateBranchNameEnvVar() with no arguments is deprecated. It writes GIT_BRANCH_NAME to the root `globalEnv`, which forces every task in the monorepo to miss cache on every branch switch. Pass `{ tasks: [...] }` and name only the tasks that actually consume the branch (e.g. CDK synth/package) to preserve cross-branch cache hits for everything else."
|
|
31767
|
-
);
|
|
31768
|
-
this.addGlobalEnvVar("GIT_BRANCH_NAME", value);
|
|
31769
|
-
return;
|
|
31770
|
-
}
|
|
31771
|
-
const knownTaskNames = this.tasks.map((task) => task.name);
|
|
31772
|
-
const unknown = options.tasks.filter(
|
|
31773
|
-
(name) => !knownTaskNames.includes(name)
|
|
31774
|
-
);
|
|
31775
|
-
if (unknown.length > 0) {
|
|
31776
|
-
throw new Error(
|
|
31777
|
-
`TurboRepo.activateBranchNameEnvVar: unknown task name(s) ${JSON.stringify(
|
|
31778
|
-
unknown
|
|
31779
|
-
)}. Known tasks on this TurboRepo: ${JSON.stringify(knownTaskNames)}.`
|
|
31780
|
-
);
|
|
31781
|
-
}
|
|
31782
|
-
for (const name of options.tasks) {
|
|
31783
|
-
const task = this.tasks.find((t) => t.name === name);
|
|
31784
|
-
if (task && !task.env.includes("GIT_BRANCH_NAME")) {
|
|
31785
|
-
task.env.push("GIT_BRANCH_NAME");
|
|
31786
|
-
}
|
|
31787
|
-
}
|
|
31788
|
-
}
|
|
31789
|
-
/**
|
|
31790
|
-
* Paths of all generated files in the project, deduped, for use as task
|
|
31791
|
-
* inputs so the compile cache invalidates when they change. Includes
|
|
31792
|
-
* projen-managed `FileBase` files plus generated-once `SampleFile` /
|
|
31793
|
-
* `SampleDir` — whose paths projen keeps private, so they are read defensively
|
|
31794
|
-
* and skipped if that internal shape ever changes. Computed at synth time so
|
|
31795
|
-
* files added after this component (e.g. a subclass's SampleFiles) are seen.
|
|
31796
|
-
*/
|
|
31797
|
-
generatedFileInputs() {
|
|
31798
|
-
const inputs = /* @__PURE__ */ new Set();
|
|
31799
|
-
for (const component of this.project.components) {
|
|
31800
|
-
if (component instanceof import_lib2.FileBase) {
|
|
31801
|
-
inputs.add(component.path);
|
|
31802
|
-
} else if (component instanceof import_lib2.SampleFile) {
|
|
31803
|
-
const filePath = component.filePath;
|
|
31804
|
-
if (typeof filePath === "string") {
|
|
31805
|
-
inputs.add(filePath);
|
|
31806
|
-
}
|
|
31807
|
-
} else if (component instanceof import_lib2.SampleDir) {
|
|
31808
|
-
const dir = component.dir;
|
|
31809
|
-
if (typeof dir === "string") {
|
|
31810
|
-
inputs.add(`${dir}/**`);
|
|
31811
|
-
}
|
|
31812
|
-
}
|
|
31813
|
-
}
|
|
31814
|
-
return Array.from(inputs);
|
|
31815
|
-
}
|
|
31816
|
-
preSynthesize() {
|
|
31817
|
-
let nextDependsOn = this.project.deps.all.filter((d) => d.version === "workspace:*").map((d) => [d.name, ROOT_TURBO_TASK_NAME].join("#"));
|
|
31818
|
-
if (!this.isRootProject) {
|
|
31819
|
-
[
|
|
31820
|
-
[this.project.preCompileTask, this.preCompileTask],
|
|
31821
|
-
[this.project.compileTask, this.compileTask],
|
|
31822
|
-
[this.project.postCompileTask, this.postCompileTask],
|
|
31823
|
-
[this.project.testTask, this.testTask],
|
|
31824
|
-
[this.project.packageTask, this.packageTask]
|
|
31825
|
-
].forEach(([pjTask, turboTask]) => {
|
|
31826
|
-
if (pjTask && turboTask && pjTask.steps.length > 0) {
|
|
31827
|
-
if (nextDependsOn.length > 0) {
|
|
31828
|
-
turboTask.dependsOn.push(...nextDependsOn);
|
|
31829
|
-
}
|
|
31830
|
-
nextDependsOn = [turboTask.name];
|
|
31831
|
-
} else {
|
|
31832
|
-
turboTask.isActive = false;
|
|
31833
|
-
}
|
|
31834
|
-
});
|
|
31835
|
-
this.buildTask.dependsOn.push(...nextDependsOn);
|
|
31836
|
-
}
|
|
31837
|
-
const generatedInputs = this.generatedFileInputs();
|
|
31838
|
-
const appendGeneratedInputs = (task) => {
|
|
31839
|
-
if (!task) {
|
|
31840
|
-
return;
|
|
31841
|
-
}
|
|
31842
|
-
for (const input of generatedInputs) {
|
|
31843
|
-
if (!task.inputs.includes(input)) {
|
|
31844
|
-
task.inputs.push(input);
|
|
31845
|
-
}
|
|
31846
|
-
}
|
|
31847
|
-
};
|
|
31848
|
-
if (this.isRootProject) {
|
|
31849
|
-
appendGeneratedInputs(this.buildTask);
|
|
31850
|
-
} else {
|
|
31851
|
-
appendGeneratedInputs(this.preCompileTask);
|
|
31852
|
-
appendGeneratedInputs(this.compileTask);
|
|
31853
|
-
appendGeneratedInputs(this.postCompileTask);
|
|
31854
|
-
}
|
|
31855
|
-
const fileName = "turbo.json";
|
|
31856
|
-
this.project.addPackageIgnore(fileName);
|
|
31857
|
-
new import_lib2.JsonFile(this.project, fileName, {
|
|
31858
|
-
obj: {
|
|
31859
|
-
extends: this.extends.length ? this.extends : void 0,
|
|
31860
|
-
globalDependencies: this.isRootProject && this.globalDependencies.length ? this.globalDependencies : void 0,
|
|
31861
|
-
globalEnv: this.isRootProject && this.globalEnv.length ? this.globalEnv : void 0,
|
|
31862
|
-
globalPassThroughEnv: this.isRootProject && this.globalPassThroughEnv.length ? this.globalPassThroughEnv : void 0,
|
|
31863
|
-
ui: this.isRootProject ? this.ui : void 0,
|
|
31864
|
-
dangerouslyDisablePackageManagerCheck: this.isRootProject ? this.dangerouslyDisablePackageManagerCheck : void 0,
|
|
31865
|
-
cacheDir: this.isRootProject ? this.cacheDir : void 0,
|
|
31866
|
-
envMode: this.isRootProject ? this.envMode : void 0,
|
|
31867
|
-
/**
|
|
31868
|
-
* All tasks
|
|
31869
|
-
*/
|
|
31870
|
-
tasks: this.tasks.filter((task) => task.isActive).reduce(
|
|
31871
|
-
(acc, task) => {
|
|
31872
|
-
acc[task.name] = {
|
|
31873
|
-
...task.taskConfig()
|
|
31874
|
-
};
|
|
31875
|
-
return acc;
|
|
31876
|
-
},
|
|
31877
|
-
{
|
|
31878
|
-
[this.buildTask.name]: { ...this.buildTask.taskConfig() }
|
|
31879
|
-
}
|
|
31880
|
-
)
|
|
31881
|
-
}
|
|
31882
|
-
});
|
|
31883
|
-
super.preSynthesize();
|
|
31951
|
+
// src/agent/bundles/turborepo.ts
|
|
31952
|
+
function renderCachingBullet(policy) {
|
|
31953
|
+
if (policy.remoteCacheEnabled && policy.awsProfileName) {
|
|
31954
|
+
return `- Uses remote caching (requires AWS credentials on the \`${policy.awsProfileName}\` profile)`;
|
|
31884
31955
|
}
|
|
31885
|
-
|
|
31886
|
-
|
|
31956
|
+
return "- Local caching only \u2014 no remote cache is configured, so no AWS credentials are required";
|
|
31957
|
+
}
|
|
31958
|
+
function buildTurborepoBundle(buildPolicy = DEFAULT_BUILD_POLICY) {
|
|
31887
31959
|
return {
|
|
31888
|
-
|
|
31889
|
-
|
|
31890
|
-
|
|
31891
|
-
|
|
31892
|
-
contents: import_workflows_model.JobPermission.WRITE,
|
|
31893
|
-
idToken: import_workflows_model.JobPermission.WRITE
|
|
31894
|
-
},
|
|
31895
|
-
preBuildSteps: [
|
|
31960
|
+
name: "turborepo",
|
|
31961
|
+
description: "Turborepo workspace rules and task pipeline conventions",
|
|
31962
|
+
appliesWhen: (project) => hasComponent(project, TurboRepo),
|
|
31963
|
+
rules: [
|
|
31896
31964
|
{
|
|
31897
|
-
name: "
|
|
31898
|
-
|
|
31899
|
-
|
|
31900
|
-
|
|
31901
|
-
|
|
31902
|
-
|
|
31903
|
-
|
|
31965
|
+
name: "turborepo-conventions",
|
|
31966
|
+
description: "Turborepo build system and task pipeline conventions",
|
|
31967
|
+
scope: AGENT_RULE_SCOPE.FILE_PATTERN,
|
|
31968
|
+
filePatterns: ["turbo.json", "package.json"],
|
|
31969
|
+
content: [
|
|
31970
|
+
"# Turborepo Conventions",
|
|
31971
|
+
"",
|
|
31972
|
+
"## Build System",
|
|
31973
|
+
"",
|
|
31974
|
+
"- **Build**: `pnpm build:all` (uses Turborepo)",
|
|
31975
|
+
"- **Test**: `pnpm test` or `pnpm test:watch`",
|
|
31976
|
+
"- **Lint**: `pnpm eslint`",
|
|
31977
|
+
"",
|
|
31978
|
+
"## Task Pipeline",
|
|
31979
|
+
"",
|
|
31980
|
+
renderCachingBullet(buildPolicy),
|
|
31981
|
+
"- Only rebuilds changed packages",
|
|
31982
|
+
"- Cache key based on file hashes and dependency graph",
|
|
31983
|
+
"- Configured in `turbo.json`",
|
|
31984
|
+
"",
|
|
31985
|
+
"## Workspace Rules",
|
|
31986
|
+
"",
|
|
31987
|
+
"- Source files: `src/` directory",
|
|
31988
|
+
"- Tests: Co-located with source files (`.spec.ts` or `.test.ts`)",
|
|
31989
|
+
"- Exports: Use `index.ts` files for clean public APIs",
|
|
31990
|
+
"- Configuration: Managed by Projen (edit `.projenrc.ts` or `projenrc/*.ts`)"
|
|
31991
|
+
].join("\n"),
|
|
31992
|
+
tags: ["workflow"]
|
|
31904
31993
|
}
|
|
31905
|
-
]
|
|
31906
|
-
|
|
31907
|
-
|
|
31908
|
-
var TurboRepo = _TurboRepo;
|
|
31909
|
-
|
|
31910
|
-
// src/agent/bundles/turborepo.ts
|
|
31911
|
-
var turborepoBundle = {
|
|
31912
|
-
name: "turborepo",
|
|
31913
|
-
description: "Turborepo workspace rules and task pipeline conventions",
|
|
31914
|
-
appliesWhen: (project) => hasComponent(project, TurboRepo),
|
|
31915
|
-
rules: [
|
|
31916
|
-
{
|
|
31917
|
-
name: "turborepo-conventions",
|
|
31918
|
-
description: "Turborepo build system and task pipeline conventions",
|
|
31919
|
-
scope: AGENT_RULE_SCOPE.FILE_PATTERN,
|
|
31920
|
-
filePatterns: ["turbo.json", "package.json"],
|
|
31921
|
-
content: [
|
|
31922
|
-
"# Turborepo Conventions",
|
|
31923
|
-
"",
|
|
31924
|
-
"## Build System",
|
|
31925
|
-
"",
|
|
31926
|
-
"- **Build**: `pnpm build:all` (uses Turborepo)",
|
|
31927
|
-
"- **Test**: `pnpm test` or `pnpm test:watch`",
|
|
31928
|
-
"- **Lint**: `pnpm eslint`",
|
|
31929
|
-
"",
|
|
31930
|
-
"## Task Pipeline",
|
|
31931
|
-
"",
|
|
31932
|
-
"- Uses remote caching (requires AWS credentials)",
|
|
31933
|
-
"- Only rebuilds changed packages",
|
|
31934
|
-
"- Cache key based on file hashes and dependency graph",
|
|
31935
|
-
"- Configured in `turbo.json`",
|
|
31936
|
-
"",
|
|
31937
|
-
"## Workspace Rules",
|
|
31938
|
-
"",
|
|
31939
|
-
"- Source files: `src/` directory",
|
|
31940
|
-
"- Tests: Co-located with source files (`.spec.ts` or `.test.ts`)",
|
|
31941
|
-
"- Exports: Use `index.ts` files for clean public APIs",
|
|
31942
|
-
"- Configuration: Managed by Projen (edit `.projenrc.ts` or `projenrc/*.ts`)"
|
|
31943
|
-
].join("\n"),
|
|
31944
|
-
tags: ["workflow"]
|
|
31994
|
+
],
|
|
31995
|
+
claudePermissions: {
|
|
31996
|
+
allow: ["Bash(npx turbo:*)"]
|
|
31945
31997
|
}
|
|
31946
|
-
|
|
31947
|
-
|
|
31948
|
-
|
|
31949
|
-
}
|
|
31950
|
-
};
|
|
31998
|
+
};
|
|
31999
|
+
}
|
|
32000
|
+
var turborepoBundle = buildTurborepoBundle();
|
|
31951
32001
|
|
|
31952
32002
|
// src/agent/bundles/typescript.ts
|
|
31953
32003
|
var typescriptBundle = {
|
|
@@ -33162,7 +33212,7 @@ function renderPriorityRulesSection(rules) {
|
|
|
33162
33212
|
}
|
|
33163
33213
|
|
|
33164
33214
|
// src/agent/bundles/index.ts
|
|
33165
|
-
function buildBuiltInBundles(paths = DEFAULT_AGENT_PATHS, issueDefaults = DEFAULT_RESOLVED_ISSUE_DEFAULTS, defaultAgentTier = AGENT_MODEL.BALANCED, bundleAgentTiers = /* @__PURE__ */ new Map(), prReviewPolicy = resolvePrReviewPolicy()) {
|
|
33215
|
+
function buildBuiltInBundles(paths = DEFAULT_AGENT_PATHS, issueDefaults = DEFAULT_RESOLVED_ISSUE_DEFAULTS, defaultAgentTier = AGENT_MODEL.BALANCED, bundleAgentTiers = /* @__PURE__ */ new Map(), prReviewPolicy = resolvePrReviewPolicy(), buildPolicy = DEFAULT_BUILD_POLICY) {
|
|
33166
33216
|
const tierFor = (bundle) => bundleAgentTiers.get(bundle) ?? defaultAgentTier;
|
|
33167
33217
|
return [
|
|
33168
33218
|
buildBaseBundle(paths),
|
|
@@ -33170,11 +33220,11 @@ function buildBuiltInBundles(paths = DEFAULT_AGENT_PATHS, issueDefaults = DEFAUL
|
|
|
33170
33220
|
typescriptBundle,
|
|
33171
33221
|
vitestBundle,
|
|
33172
33222
|
jestBundle,
|
|
33173
|
-
|
|
33223
|
+
buildTurborepoBundle(buildPolicy),
|
|
33174
33224
|
pnpmBundle,
|
|
33175
33225
|
awsCdkBundle,
|
|
33176
33226
|
projenBundle,
|
|
33177
|
-
|
|
33227
|
+
buildGithubWorkflowBundle(buildPolicy),
|
|
33178
33228
|
slackBundle,
|
|
33179
33229
|
buildMeetingAnalysisBundle(tierFor("meeting-analysis")),
|
|
33180
33230
|
agendaBundle,
|
|
@@ -34259,6 +34309,13 @@ var AgentConfig = class _AgentConfig extends import_projen8.Component {
|
|
|
34259
34309
|
* their rendered rule content reflects any consumer override.
|
|
34260
34310
|
* Bundles that do not read agent paths are passed through as-is
|
|
34261
34311
|
* from their default const exports.
|
|
34312
|
+
*
|
|
34313
|
+
* The build policy is auto-detected from the project's `TurboRepo`
|
|
34314
|
+
* component here rather than configured, so build guidance in the
|
|
34315
|
+
* `github-workflow` and `turborepo` rules only claims an AWS
|
|
34316
|
+
* credential requirement when a remote cache actually exists. The
|
|
34317
|
+
* getter is lazy by design — `TurboRepo` must already be attached
|
|
34318
|
+
* to the project when the bundles are first read.
|
|
34262
34319
|
*/
|
|
34263
34320
|
get pathAwareBundles() {
|
|
34264
34321
|
if (!this.cachedBundles) {
|
|
@@ -34267,7 +34324,8 @@ var AgentConfig = class _AgentConfig extends import_projen8.Component {
|
|
|
34267
34324
|
resolveIssueDefaults(this.options.issueDefaults),
|
|
34268
34325
|
resolveDefaultAgentTier(this.options),
|
|
34269
34326
|
resolveBundleAgentTiers(this.options),
|
|
34270
|
-
resolvePrReviewPolicy(this.options.prReviewPolicy)
|
|
34327
|
+
resolvePrReviewPolicy(this.options.prReviewPolicy),
|
|
34328
|
+
resolveBuildPolicy(this.project)
|
|
34271
34329
|
);
|
|
34272
34330
|
}
|
|
34273
34331
|
return this.cachedBundles;
|
|
@@ -40973,6 +41031,7 @@ export const collections = {
|
|
|
40973
41031
|
DEFAULT_API_EXTRACTOR_REPORT_FILENAME,
|
|
40974
41032
|
DEFAULT_API_EXTRACTOR_REPORT_FOLDER,
|
|
40975
41033
|
DEFAULT_AUDIT_REPORT_DIR,
|
|
41034
|
+
DEFAULT_BUILD_POLICY,
|
|
40976
41035
|
DEFAULT_BUNDLE_OVERRIDES,
|
|
40977
41036
|
DEFAULT_DECOMPOSITION_TEMPLATE,
|
|
40978
41037
|
DEFAULT_DISPATCH_MODEL,
|
|
@@ -41093,6 +41152,7 @@ export const collections = {
|
|
|
41093
41152
|
buildCompanyProfileBundle,
|
|
41094
41153
|
buildCustomerProfileBundle,
|
|
41095
41154
|
buildDocsSyncBundle,
|
|
41155
|
+
buildGithubWorkflowBundle,
|
|
41096
41156
|
buildIndustryDiscoveryBundle,
|
|
41097
41157
|
buildMaintenanceAuditBundle,
|
|
41098
41158
|
buildMeetingAnalysisBundle,
|
|
@@ -41107,6 +41167,7 @@ export const collections = {
|
|
|
41107
41167
|
buildResearchPipelineBundle,
|
|
41108
41168
|
buildSoftwareProfileBundle,
|
|
41109
41169
|
buildStandardsResearchBundle,
|
|
41170
|
+
buildTurborepoBundle,
|
|
41110
41171
|
buildUnblockDependentsProcedure,
|
|
41111
41172
|
bundleNameForWorkflowRule,
|
|
41112
41173
|
businessModelsBundle,
|
|
@@ -41224,6 +41285,7 @@ export const collections = {
|
|
|
41224
41285
|
resolveAgentTiers,
|
|
41225
41286
|
resolveAstroProjectOutdir,
|
|
41226
41287
|
resolveAwsCdkProjectOutdir,
|
|
41288
|
+
resolveBuildPolicy,
|
|
41227
41289
|
resolveBundleAgentTiers,
|
|
41228
41290
|
resolveDefaultAgentTier,
|
|
41229
41291
|
resolveIssueDefaults,
|