aglio-worker 0.107.0 → 0.110.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agent.js +775 -16
- package/package.json +1 -1
package/agent.js
CHANGED
|
@@ -50229,7 +50229,8 @@ var NOTIFICATION_TYPES = [
|
|
|
50229
50229
|
"pr_ready",
|
|
50230
50230
|
"pr_merged",
|
|
50231
50231
|
"mention",
|
|
50232
|
-
"comment"
|
|
50232
|
+
"comment",
|
|
50233
|
+
"invite"
|
|
50233
50234
|
];
|
|
50234
50235
|
var CREDENTIAL_SCOPES = ["workspace", "user"];
|
|
50235
50236
|
var CREDENTIAL_AUTH_TYPES = ["api_key", "oauth_token", "session_bundle"];
|
|
@@ -70158,7 +70159,8 @@ var DEFAULT_IN_APP_NOTIFICATION_TYPES = {
|
|
|
70158
70159
|
pr_ready: true,
|
|
70159
70160
|
pr_merged: false,
|
|
70160
70161
|
mention: true,
|
|
70161
|
-
comment: true
|
|
70162
|
+
comment: true,
|
|
70163
|
+
invite: true
|
|
70162
70164
|
};
|
|
70163
70165
|
var inAppNotificationTypesSchema = external_exports.object({
|
|
70164
70166
|
question: external_exports.boolean().default(DEFAULT_IN_APP_NOTIFICATION_TYPES.question),
|
|
@@ -70169,7 +70171,8 @@ var inAppNotificationTypesSchema = external_exports.object({
|
|
|
70169
70171
|
pr_ready: external_exports.boolean().default(DEFAULT_IN_APP_NOTIFICATION_TYPES.pr_ready),
|
|
70170
70172
|
pr_merged: external_exports.boolean().default(DEFAULT_IN_APP_NOTIFICATION_TYPES.pr_merged),
|
|
70171
70173
|
mention: external_exports.boolean().default(DEFAULT_IN_APP_NOTIFICATION_TYPES.mention),
|
|
70172
|
-
comment: external_exports.boolean().default(DEFAULT_IN_APP_NOTIFICATION_TYPES.comment)
|
|
70174
|
+
comment: external_exports.boolean().default(DEFAULT_IN_APP_NOTIFICATION_TYPES.comment),
|
|
70175
|
+
invite: external_exports.boolean().default(DEFAULT_IN_APP_NOTIFICATION_TYPES.invite)
|
|
70173
70176
|
});
|
|
70174
70177
|
var DIGEST_FREQUENCIES = ["1h", "4h", "12h", "24h"];
|
|
70175
70178
|
var DEFAULT_DIGEST_FREQUENCY = "4h";
|
|
@@ -70213,6 +70216,106 @@ function isSlackWebhookUrl(value) {
|
|
|
70213
70216
|
}
|
|
70214
70217
|
}
|
|
70215
70218
|
|
|
70219
|
+
// ../../packages/shared/src/runner-images.ts
|
|
70220
|
+
var RUNNER_IMAGE_DEFAULT_TAG = "latest";
|
|
70221
|
+
var RUNNER_VARIANT_LABEL_PREFIX = "runner:";
|
|
70222
|
+
var RUNNER_VARIANT_IDS = ["general", "node", "python", "rust", "go"];
|
|
70223
|
+
var RUNNER_VARIANTS = [
|
|
70224
|
+
{
|
|
70225
|
+
id: "general",
|
|
70226
|
+
label: "General",
|
|
70227
|
+
description: "The full image with every agent CLI and the common build tools.",
|
|
70228
|
+
imageSuffix: ""
|
|
70229
|
+
},
|
|
70230
|
+
{
|
|
70231
|
+
id: "node",
|
|
70232
|
+
label: "Node.js",
|
|
70233
|
+
description: "Node, pnpm, TypeScript and browser tooling for web apps.",
|
|
70234
|
+
imageSuffix: "node"
|
|
70235
|
+
},
|
|
70236
|
+
{
|
|
70237
|
+
id: "python",
|
|
70238
|
+
label: "Python",
|
|
70239
|
+
description: "Python, uv, pipx and the usual native build headers.",
|
|
70240
|
+
imageSuffix: "python"
|
|
70241
|
+
},
|
|
70242
|
+
{
|
|
70243
|
+
id: "rust",
|
|
70244
|
+
label: "Rust",
|
|
70245
|
+
description: "Rustup, cargo and a native toolchain for Rust workspaces.",
|
|
70246
|
+
imageSuffix: "rust"
|
|
70247
|
+
},
|
|
70248
|
+
{
|
|
70249
|
+
id: "go",
|
|
70250
|
+
label: "Go",
|
|
70251
|
+
description: "The Go toolchain and common CGO build dependencies.",
|
|
70252
|
+
imageSuffix: "go"
|
|
70253
|
+
}
|
|
70254
|
+
];
|
|
70255
|
+
var DEFAULT_RUNNER_VARIANT = "general";
|
|
70256
|
+
function isRunnerVariantId(value) {
|
|
70257
|
+
return typeof value === "string" && RUNNER_VARIANT_IDS.includes(value);
|
|
70258
|
+
}
|
|
70259
|
+
function normalizeRunnerVariant(value, fallback = DEFAULT_RUNNER_VARIANT) {
|
|
70260
|
+
return isRunnerVariantId(value) ? value : fallback;
|
|
70261
|
+
}
|
|
70262
|
+
function runnerVariantLabel(value) {
|
|
70263
|
+
return `${RUNNER_VARIANT_LABEL_PREFIX}${normalizeRunnerVariant(value)}`;
|
|
70264
|
+
}
|
|
70265
|
+
function normalizeRunnerVariants(values, fallback = DEFAULT_RUNNER_VARIANT) {
|
|
70266
|
+
const raw = Array.isArray(values) ? values : values == null ? [] : [values];
|
|
70267
|
+
const selected = /* @__PURE__ */ new Set();
|
|
70268
|
+
for (const value of raw) {
|
|
70269
|
+
if (isRunnerVariantId(value)) selected.add(value);
|
|
70270
|
+
}
|
|
70271
|
+
if (selected.size === 0) selected.add(normalizeRunnerVariant(fallback));
|
|
70272
|
+
return RUNNER_VARIANTS.filter((variant) => selected.has(variant.id)).map(
|
|
70273
|
+
(variant) => variant.id
|
|
70274
|
+
);
|
|
70275
|
+
}
|
|
70276
|
+
function runnerVariantsFromLabels(labels) {
|
|
70277
|
+
const values = Array.isArray(labels) ? labels : typeof labels === "string" ? labels.split(/[\s,]+/) : [];
|
|
70278
|
+
const selected = /* @__PURE__ */ new Set();
|
|
70279
|
+
for (const raw of values) {
|
|
70280
|
+
if (typeof raw !== "string") continue;
|
|
70281
|
+
const label = raw.trim();
|
|
70282
|
+
if (!label.startsWith(RUNNER_VARIANT_LABEL_PREFIX)) continue;
|
|
70283
|
+
const id = label.slice(RUNNER_VARIANT_LABEL_PREFIX.length);
|
|
70284
|
+
if (isRunnerVariantId(id)) selected.add(id);
|
|
70285
|
+
}
|
|
70286
|
+
return RUNNER_VARIANTS.filter((variant) => selected.has(variant.id)).map(
|
|
70287
|
+
(variant) => variant.id
|
|
70288
|
+
);
|
|
70289
|
+
}
|
|
70290
|
+
function runnerVariantFromLabels(labels) {
|
|
70291
|
+
return runnerVariantsFromLabels(labels)[0] ?? null;
|
|
70292
|
+
}
|
|
70293
|
+
function allRunnerVariantLabels() {
|
|
70294
|
+
return RUNNER_VARIANTS.map((variant) => runnerVariantLabel(variant.id));
|
|
70295
|
+
}
|
|
70296
|
+
function runnerImagesFromBase(image) {
|
|
70297
|
+
const digestAt = image.indexOf("@");
|
|
70298
|
+
const withoutDigest = digestAt >= 0 ? image.slice(0, digestAt) : image;
|
|
70299
|
+
const digest = digestAt >= 0 ? image.slice(digestAt) : "";
|
|
70300
|
+
const lastSlash = withoutDigest.lastIndexOf("/");
|
|
70301
|
+
const lastColon = withoutDigest.lastIndexOf(":");
|
|
70302
|
+
const hasTag = lastColon > lastSlash;
|
|
70303
|
+
const repository = hasTag ? withoutDigest.slice(0, lastColon) : withoutDigest;
|
|
70304
|
+
const tag = hasTag ? withoutDigest.slice(lastColon + 1) : RUNNER_IMAGE_DEFAULT_TAG;
|
|
70305
|
+
const suffix = digest || `:${tag}`;
|
|
70306
|
+
return Object.fromEntries(
|
|
70307
|
+
RUNNER_VARIANTS.map((variant) => [
|
|
70308
|
+
variant.id,
|
|
70309
|
+
`${variant.imageSuffix ? `${repository}-${variant.imageSuffix}` : repository}${suffix}`
|
|
70310
|
+
])
|
|
70311
|
+
);
|
|
70312
|
+
}
|
|
70313
|
+
function resolveRunnerImage(input2) {
|
|
70314
|
+
const variant = runnerVariantFromLabels(input2.requiredLabels);
|
|
70315
|
+
if (!variant) return input2.fallback;
|
|
70316
|
+
return input2.images?.[variant] ?? input2.fallback;
|
|
70317
|
+
}
|
|
70318
|
+
|
|
70216
70319
|
// ../../packages/shared/src/routing.ts
|
|
70217
70320
|
var ROUTING_OS_VALUES = ["linux", "macos"];
|
|
70218
70321
|
var ROUTING_MODE_VALUES = ["docker", "host"];
|
|
@@ -70228,7 +70331,8 @@ var ROUTING_LABEL_SUGGESTIONS = {
|
|
|
70228
70331
|
size: ROUTING_SIZE_VALUES,
|
|
70229
70332
|
gpu: ROUTING_GPU_VALUES,
|
|
70230
70333
|
arch: ROUTING_ARCH_VALUES,
|
|
70231
|
-
region: ROUTING_REGION_VALUES
|
|
70334
|
+
region: ROUTING_REGION_VALUES,
|
|
70335
|
+
runner: RUNNER_VARIANT_IDS
|
|
70232
70336
|
};
|
|
70233
70337
|
var ROUTING_LABEL_SUGGESTION_LIST = Object.entries(
|
|
70234
70338
|
ROUTING_LABEL_SUGGESTIONS
|
|
@@ -70410,7 +70514,13 @@ function normalizePoolSize(value, fallback = DEFAULT_POOL_SIZE) {
|
|
|
70410
70514
|
return isPoolSize(value) ? value : fallback;
|
|
70411
70515
|
}
|
|
70412
70516
|
function poolWorkerLabels(size) {
|
|
70413
|
-
return [
|
|
70517
|
+
return [
|
|
70518
|
+
"os:linux",
|
|
70519
|
+
"mode:docker",
|
|
70520
|
+
`size:${size}`,
|
|
70521
|
+
POOL_REGION_LABEL,
|
|
70522
|
+
...allRunnerVariantLabels()
|
|
70523
|
+
];
|
|
70414
70524
|
}
|
|
70415
70525
|
var POOL_HOST_RESERVE_BYTES = 1024 ** 3;
|
|
70416
70526
|
var MEMORY_UNITS = {
|
|
@@ -70628,6 +70738,7 @@ var cardPlanningOverridesSchema = external_exports.object({
|
|
|
70628
70738
|
planningRunnerTarget: external_exports.enum(JOB_TARGETS).nullable(),
|
|
70629
70739
|
planningPoolSize: external_exports.enum(POOL_SIZES).nullable()
|
|
70630
70740
|
});
|
|
70741
|
+
var promptSetSelectionsSchema = external_exports.record(external_exports.string(), external_exports.string().nullable());
|
|
70631
70742
|
var projectSettingsSchema = external_exports.object({
|
|
70632
70743
|
/** Demo projects are sandbox rows: the worker never claims them and no model runs. */
|
|
70633
70744
|
demoMode: external_exports.boolean().default(false),
|
|
@@ -70638,6 +70749,26 @@ var projectSettingsSchema = external_exports.object({
|
|
|
70638
70749
|
autoClaimSchedule: autoClaimScheduleSchema,
|
|
70639
70750
|
/** Goal-driven project automation. Off by default for every existing project. */
|
|
70640
70751
|
autoMode: autoModeSettingsSchema.default(defaultAutoMode),
|
|
70752
|
+
/**
|
|
70753
|
+
* Hidden project AI metadata. `initializedAt` is set once the agent has
|
|
70754
|
+
* assessed the repository and classified the project. Jobs are optional, so
|
|
70755
|
+
* it does not depend on the template catalogue. It is per project, not per
|
|
70756
|
+
* repository commit, so imported projects are initialized too, while an
|
|
70757
|
+
* empty or docs-only repo is retried on a later run.
|
|
70758
|
+
*/
|
|
70759
|
+
projectAi: external_exports.object({
|
|
70760
|
+
initializedAt: external_exports.string().nullable().default(null),
|
|
70761
|
+
/**
|
|
70762
|
+
* Force-inject a suggestion prompt into build and overseer runs so agents
|
|
70763
|
+
* propose cards for gaps and stale dependencies. On by default.
|
|
70764
|
+
*/
|
|
70765
|
+
suggestedCardsEnabled: external_exports.boolean().default(true),
|
|
70766
|
+
/**
|
|
70767
|
+
* Force-inject a job suggestion prompt into build and overseer runs so
|
|
70768
|
+
* agents propose recurring jobs for gaps they notice. On by default.
|
|
70769
|
+
*/
|
|
70770
|
+
suggestedJobsEnabled: external_exports.boolean().default(true)
|
|
70771
|
+
}).default(() => ({ initializedAt: null, suggestedCardsEnabled: true, suggestedJobsEnabled: true })),
|
|
70641
70772
|
/** Build-like run cap: build, consult and review. Planning has its own cap. */
|
|
70642
70773
|
maxParallelRuns: external_exports.number().int().min(1).max(8).default(2),
|
|
70643
70774
|
/** Planning run cap per project. Independent from maxParallelRuns. */
|
|
@@ -70702,7 +70833,13 @@ var projectSettingsSchema = external_exports.object({
|
|
|
70702
70833
|
* Default pool size for cloud runs started from this project. Projects saved while
|
|
70703
70834
|
* auto was selectable still carry "auto", so retired values fall back to the default.
|
|
70704
70835
|
*/
|
|
70705
|
-
cloudRunnerSize: external_exports.enum(POOL_SIZES).catch("small").default("small")
|
|
70836
|
+
cloudRunnerSize: external_exports.enum(POOL_SIZES).catch("small").default("small"),
|
|
70837
|
+
/**
|
|
70838
|
+
* Default prompt set per agent kind, as prompt set ids owned by this project.
|
|
70839
|
+
* Missing or null falls back to the project's undeletable default set, which
|
|
70840
|
+
* itself starts from the prompts bundled with the app.
|
|
70841
|
+
*/
|
|
70842
|
+
promptSets: external_exports.record(external_exports.string(), external_exports.string().nullable()).default({})
|
|
70706
70843
|
});
|
|
70707
70844
|
var jobTargetSchema = external_exports.enum(JOB_TARGETS);
|
|
70708
70845
|
var defaultProjectSettings = {
|
|
@@ -70718,6 +70855,7 @@ var defaultProjectSettings = {
|
|
|
70718
70855
|
maxParallelRuns: 2,
|
|
70719
70856
|
maxPlanningRuns: 2,
|
|
70720
70857
|
autoMode: defaultAutoMode,
|
|
70858
|
+
projectAi: { initializedAt: null, suggestedCardsEnabled: true, suggestedJobsEnabled: true },
|
|
70721
70859
|
defaultAgentConfigId: null,
|
|
70722
70860
|
defaultReviewerAgentConfigId: null,
|
|
70723
70861
|
defaultRepoId: null,
|
|
@@ -70743,7 +70881,8 @@ var defaultProjectSettings = {
|
|
|
70743
70881
|
slackWebhookUrl: null,
|
|
70744
70882
|
requiredWorkerLabels: [],
|
|
70745
70883
|
planningRequiredWorkerLabels: [],
|
|
70746
|
-
cloudRunnerSize: "small"
|
|
70884
|
+
cloudRunnerSize: "small",
|
|
70885
|
+
promptSets: {}
|
|
70747
70886
|
};
|
|
70748
70887
|
var repoConfigSchema = external_exports.object({
|
|
70749
70888
|
id: external_exports.string(),
|
|
@@ -70945,6 +71084,140 @@ var MAX_SCAN_MINUTES = 8 * 24 * 60;
|
|
|
70945
71084
|
var MINUTE_MS = 6e4;
|
|
70946
71085
|
var DAY_MS = 24 * 60 * MINUTE_MS;
|
|
70947
71086
|
|
|
71087
|
+
// ../../packages/shared/src/job-templates.ts
|
|
71088
|
+
var JOB_TEMPLATES = [
|
|
71089
|
+
{
|
|
71090
|
+
id: "security-audit",
|
|
71091
|
+
title: "Weekly security audit",
|
|
71092
|
+
description: "Audit dependency vulnerabilities and report only, never auto-fix.",
|
|
71093
|
+
cron: "0 8 * * 1",
|
|
71094
|
+
timezone: "UTC",
|
|
71095
|
+
category: "security",
|
|
71096
|
+
tags: ["security", "dependencies", "any"],
|
|
71097
|
+
body: `Run a read-only security audit of this project.
|
|
71098
|
+
|
|
71099
|
+
1. Detect the package managers in use from the lockfiles (pnpm/npm/yarn, pip/poetry/uv, go, cargo).
|
|
71100
|
+
2. Run the matching audit command for each ecosystem that exists, for example:
|
|
71101
|
+
- \`pnpm audit --prod\` or \`npm audit --omit=dev\`
|
|
71102
|
+
- \`pip-audit\` when available
|
|
71103
|
+
- \`govulncheck ./...\` when available
|
|
71104
|
+
- \`cargo audit\` when available
|
|
71105
|
+
3. If a command is unavailable, say so and fall back to checking the lockfile for known-vulnerable direct dependencies when that is practical.
|
|
71106
|
+
4. Group findings by severity and name the affected package, installed version and fixed version when known.
|
|
71107
|
+
5. Report the result in your final message. Do not upgrade packages, commit, push or open a pull request.`
|
|
71108
|
+
},
|
|
71109
|
+
{
|
|
71110
|
+
id: "outdated-dependencies",
|
|
71111
|
+
title: "Weekly dependency freshness check",
|
|
71112
|
+
description: "List outdated npm and other dependencies with major/minor/patch impact.",
|
|
71113
|
+
cron: "0 8 * * 2",
|
|
71114
|
+
timezone: "UTC",
|
|
71115
|
+
category: "dependencies",
|
|
71116
|
+
tags: ["dependencies", "node", "python", "go", "rust", "android", "any"],
|
|
71117
|
+
body: `Check how far this project's dependencies are behind.
|
|
71118
|
+
|
|
71119
|
+
1. Detect the package managers from the lockfiles.
|
|
71120
|
+
2. Run the matching outdated command per ecosystem, for example:
|
|
71121
|
+
- \`pnpm outdated --format json\` or \`npm outdated --json\`
|
|
71122
|
+
- \`pip list --outdated\`
|
|
71123
|
+
- \`go list -u -m all\`
|
|
71124
|
+
- \`cargo outdated\` when available
|
|
71125
|
+
3. Summarise the direct dependencies that are behind, split into patch, minor and major groups.
|
|
71126
|
+
4. Call out packages that are unmaintained, deprecated or more than one major version behind.
|
|
71127
|
+
5. Report the result in your final message. Do not upgrade dependencies, commit, push or open a pull request.`
|
|
71128
|
+
},
|
|
71129
|
+
{
|
|
71130
|
+
id: "typescript-typecheck",
|
|
71131
|
+
title: "Weekly TypeScript typecheck",
|
|
71132
|
+
description: "Run the repository typecheck and report new type errors.",
|
|
71133
|
+
cron: "0 8 * * 3",
|
|
71134
|
+
timezone: "UTC",
|
|
71135
|
+
category: "quality",
|
|
71136
|
+
tags: ["typescript", "quality"],
|
|
71137
|
+
body: `Verify the TypeScript types in this project.
|
|
71138
|
+
|
|
71139
|
+
1. Find the typecheck script in package.json (\`typecheck\`, \`tsc --noEmit\`, \`tsc -b\`) or the tsconfig files.
|
|
71140
|
+
2. Use the repository package manager and its existing lockfile. Install dependencies only when node_modules is missing.
|
|
71141
|
+
3. Run the typecheck command with a bounded timeout.
|
|
71142
|
+
4. Report the exact failing files and error codes, or state clearly that the typecheck passed.
|
|
71143
|
+
5. Report the result in your final message. Do not edit code, commit, push or open a pull request.`
|
|
71144
|
+
},
|
|
71145
|
+
{
|
|
71146
|
+
id: "test-suite-health",
|
|
71147
|
+
title: "Weekly test suite health",
|
|
71148
|
+
description: "Run the existing test suite and report failures and flakes.",
|
|
71149
|
+
cron: "0 8 * * 5",
|
|
71150
|
+
timezone: "UTC",
|
|
71151
|
+
category: "quality",
|
|
71152
|
+
tags: ["tests", "quality", "android", "web", "any"],
|
|
71153
|
+
body: `Check the health of this project's test suite.
|
|
71154
|
+
|
|
71155
|
+
1. Find the test command in package.json, Makefile or the repository README.
|
|
71156
|
+
2. Install dependencies only when they are missing, using the existing lockfile.
|
|
71157
|
+
3. Run the suite with a bounded timeout. Do not retry a full suite more than once.
|
|
71158
|
+
4. Report failing tests, failing files and any test that only failed on the second run (possible flake).
|
|
71159
|
+
5. Report the result in your final message. Do not change tests or production code, commit, push or open a pull request.`
|
|
71160
|
+
},
|
|
71161
|
+
{
|
|
71162
|
+
id: "lint-format-check",
|
|
71163
|
+
title: "Weekly lint and format check",
|
|
71164
|
+
description: "Run the configured linter and formatter in check mode.",
|
|
71165
|
+
cron: "0 8 * * 4",
|
|
71166
|
+
timezone: "UTC",
|
|
71167
|
+
category: "quality",
|
|
71168
|
+
tags: ["quality", "typescript", "android", "web", "any"],
|
|
71169
|
+
body: `Check lint and formatting without changing files.
|
|
71170
|
+
|
|
71171
|
+
1. Find the lint and format-check commands in package.json or the repo config (eslint, biome, prettier --check, ruff, gofmt -l, cargo fmt --check).
|
|
71172
|
+
2. Run only the check variants. Never pass a write or fix flag.
|
|
71173
|
+
3. Report the files and rule ids that fail, or state that both checks passed.
|
|
71174
|
+
4. Report the result in your final message. Do not edit code, commit, push or open a pull request.`
|
|
71175
|
+
},
|
|
71176
|
+
{
|
|
71177
|
+
id: "build-health",
|
|
71178
|
+
title: "Weekly build check",
|
|
71179
|
+
description: "Run the project's own build command and report breakage.",
|
|
71180
|
+
cron: "0 8 * * 6",
|
|
71181
|
+
timezone: "UTC",
|
|
71182
|
+
category: "build",
|
|
71183
|
+
tags: ["build", "quality", "node", "python", "go", "rust", "android", "web", "any"],
|
|
71184
|
+
body: `Run the build for this project and report whether it still succeeds.
|
|
71185
|
+
|
|
71186
|
+
1. Detect the project type from the manifests, wrappers and CI config before choosing a command:
|
|
71187
|
+
- Android or JVM app: the Gradle wrapper task the repo documents, for example \`./gradlew assembleDebug\`.
|
|
71188
|
+
- Node or web app: the build script in package.json (\`pnpm build\`, \`npm run build\`, \`yarn build\`).
|
|
71189
|
+
- Python package or service: \`python -m build\` or the documented check or compile command.
|
|
71190
|
+
- Go: \`go build ./...\`.
|
|
71191
|
+
- Rust: \`cargo build\`.
|
|
71192
|
+
- Anything else: the build command the README or CI workflow documents.
|
|
71193
|
+
2. Use the repository package manager and its existing lockfile. Install dependencies only when they are missing.
|
|
71194
|
+
3. Run the build only. Do not sign, package or upload a release, and do not deploy.
|
|
71195
|
+
4. Report the exact failing file and error, or state clearly that the build passed.
|
|
71196
|
+
5. Report the result in your final message. Do not edit code, commit, push or open a pull request.`
|
|
71197
|
+
},
|
|
71198
|
+
{
|
|
71199
|
+
id: "release-readiness",
|
|
71200
|
+
title: "Weekly release readiness check",
|
|
71201
|
+
description: "Verify the release or deploy configuration without deploying.",
|
|
71202
|
+
cron: "0 9 * * 6",
|
|
71203
|
+
timezone: "UTC",
|
|
71204
|
+
category: "release",
|
|
71205
|
+
tags: ["deploy", "build", "android", "web", "node", "docker", "any"],
|
|
71206
|
+
body: `Check that this project is ready to release or deploy, and report only.
|
|
71207
|
+
|
|
71208
|
+
1. Detect the release target from the repository, for example:
|
|
71209
|
+
- Android app: Play Store bundle or APK config, versioning and signing references.
|
|
71210
|
+
- Website: the hosting config (Vercel, Netlify, Cloudflare, static export) and its build output.
|
|
71211
|
+
- Service: a container image, a server deploy script or a CI release workflow.
|
|
71212
|
+
- Library: the package registry publish config.
|
|
71213
|
+
2. Verify that the matching configuration exists and is coherent: version rules, signing or keystore references, required environment variable names, build output paths, deploy scripts and CI release steps.
|
|
71214
|
+
3. Use read-only checks only. Never build, sign, upload, publish or deploy anything, and never read secret values.
|
|
71215
|
+
4. Report missing or stale release configuration with the exact files, and name what a human must supply. If the project has no release or deploy target, say so and finish.
|
|
71216
|
+
5. Report the result in your final message. Do not edit code, commit, push or open a pull request.`
|
|
71217
|
+
}
|
|
71218
|
+
];
|
|
71219
|
+
var JOB_TEMPLATE_BY_ID = new Map(JOB_TEMPLATES.map((template) => [template.id, template]));
|
|
71220
|
+
|
|
70948
71221
|
// ../../packages/shared/src/workers.ts
|
|
70949
71222
|
import { createHash, randomBytes } from "node:crypto";
|
|
70950
71223
|
|
|
@@ -71694,6 +71967,386 @@ var workspaceSettingsSchema = external_exports.object({
|
|
|
71694
71967
|
inviteExpiryDays: external_exports.number().int().min(1).max(MAX_INVITE_EXPIRY_DAYS).catch(WORKSPACE_SETTINGS_DEFAULTS.inviteExpiryDays)
|
|
71695
71968
|
}).passthrough();
|
|
71696
71969
|
|
|
71970
|
+
// ../../packages/shared/src/prompt-chunks.ts
|
|
71971
|
+
var BUILD_RULES_DEFAULT = `You are an autonomous engineering teammate working on one card in a project board.
|
|
71972
|
+
|
|
71973
|
+
Rules:
|
|
71974
|
+
- Board tools are MCP tools from the client. Use the matching board tool for writes.
|
|
71975
|
+
- The card title and body are the spec and the contract. Do not rewrite them yourself. If the spec is wrong or incomplete, propose a spec and wait for a human decision.
|
|
71976
|
+
- Work only on this card. Do not start unrelated refactors.
|
|
71977
|
+
- Prefer one pull request. Split into more only when the change is genuinely large.
|
|
71978
|
+
- Never push to the base branch. Never merge a pull request. Never delete a card.
|
|
71979
|
+
- Commit on an aglio/card-* branch. Force-push only your own branch.
|
|
71980
|
+
- Fetch and rebase onto the base branch before building. Resolve clear conflicts; ask when unclear.
|
|
71981
|
+
- Record progress in the work log. Keep summaries to one or two short sentences; put detail in details.
|
|
71982
|
+
- Recurring job cards can be read and triggered with the board tools. A job run opens no pull request; its result stays on the job card.
|
|
71983
|
+
- Ask the human only when the answer changes what you build and you cannot infer it from the card or repo. Otherwise pick the safest default, say so, and continue.
|
|
71984
|
+
- Batch related questions, most important first. Never repeat an open question.
|
|
71985
|
+
- Prefer two to five concrete options and mark the recommended one. Use free text only when needed.
|
|
71986
|
+
- Mark a question required only when you cannot continue. Optional questions never block the resume.
|
|
71987
|
+
- Do not ask for permission, for facts you can check yourself, or for a decision the card already makes.
|
|
71988
|
+
- Read the repo before editing. Follow existing patterns and style.
|
|
71989
|
+
- Attach screenshots, recordings, logs and files as evidence.
|
|
71990
|
+
- When done, verified and pushed, open the pull request. That moves the card to review.
|
|
71991
|
+
- If the card says no code change or no pull request, skip verification and stop after the work log. Do not run installs, tests or builds.
|
|
71992
|
+
- Keep the PR body short: summary, changes, verification. Put long output in a txt artifact and summarize it.
|
|
71993
|
+
`;
|
|
71994
|
+
var VERIFICATION_RULES_DEFAULTS = {
|
|
71995
|
+
standard: `- Build speed is Standard. {{verificationRequirement}}
|
|
71996
|
+
- Test budget: at most two scoped passes on the files you touched, then exactly one full suite {{verificationDeadline}}. Do not re-run the full suite.
|
|
71997
|
+
- Typecheck, lint and build: one pass {{verificationDeadline}} when code changed.
|
|
71998
|
+
- Record evidence with mcp__aglio__verification_record {{verificationDeadline}}. Screenshots are required for UI changes.
|
|
71999
|
+
- If nothing can be run, record not_applicable with a reason.`,
|
|
72000
|
+
fast: `- Build speed is Fast. Keep verification lean and stop when the change is covered.
|
|
72001
|
+
- Test budget: do not run the full suite. At most one scoped pass on the files you touched.
|
|
72002
|
+
- Typecheck, lint and build: one pass {{verificationDeadline}} when code changed.
|
|
72003
|
+
- Evidence is optional. Record it with mcp__aglio__verification_record, or state "checks skipped (fast)" in {{reportTarget}}.
|
|
72004
|
+
- Screenshots for UI changes only when cheap.`,
|
|
72005
|
+
ultra_fast: `- Build speed is Ultra fast. Skip verification by default and {{completionAction}}.
|
|
72006
|
+
- Test budget: no test runs.
|
|
72007
|
+
- Typecheck, lint and build: skip. Run at most one quick check when the change risks breaking types or the build.
|
|
72008
|
+
- Evidence is optional. Record it with mcp__aglio__verification_record, or state "checks skipped (ultra fast)" in {{reportTarget}}.
|
|
72009
|
+
- Screenshots for UI changes only when cheap.`,
|
|
72010
|
+
yolo: `- Build speed is Yolo. Skip verification entirely and {{completionAction}}.
|
|
72011
|
+
- Test budget: no test runs.
|
|
72012
|
+
- Typecheck, lint and build: skip, even when the change touches types or the build.
|
|
72013
|
+
- Do not run verification commands to check the work. State "checks skipped (yolo)" in {{reportTarget}}. Evidence is optional.
|
|
72014
|
+
- Screenshots for UI changes only when cheap.`,
|
|
72015
|
+
detailed: `- Build speed is Detailed. {{verificationRequirement}} Run the configured tests, lint and build when they exist, exercise the change, and record evidence with mcp__aglio__verification_record.
|
|
72016
|
+
- Run the full suite after meaningful changes. Scoped tests are fine while iterating, and one full pass is not enough after further edits.
|
|
72017
|
+
- mcp__aglio__pr_open is blocked until a verification_record exists for this run. Do not open a PR before recording evidence.
|
|
72018
|
+
- Screenshots or recordings are required for UI changes, and exercise the changed flow.
|
|
72019
|
+
- If nothing can be run, record not_applicable with a reason.`
|
|
72020
|
+
};
|
|
72021
|
+
var SCREENSHOT_RULES_DEFAULT = `- This project requires screenshot evidence before a pull request opens, even at Yolo, Ultra fast or Fast build speed.
|
|
72022
|
+
- Capture the changed flow after the change, attach the image with mcp__aglio__artifact_attach, then call mcp__aglio__verification_record with kind screenshot.
|
|
72023
|
+
- If the change has no visual surface, record kind not_applicable with a clear reason instead.`;
|
|
72024
|
+
var VERBOSITY_RULES_DEFAULTS = {
|
|
72025
|
+
caveman: `- Agent verbosity is Caveman. Reply in short fragments, no filler. Give the answer and stop.`,
|
|
72026
|
+
concise: `- Agent verbosity is Concise. Answer in short direct sentences. Skip pleasantries and restated context.`,
|
|
72027
|
+
verbose: `- Agent verbosity is Verbose. Explain the reasoning and the steps behind the change.
|
|
72028
|
+
- Cover tradeoffs and anything a reviewer should check. Keep work log summaries short and put detail in details.`
|
|
72029
|
+
};
|
|
72030
|
+
var AGENT_RULES_DEFAULT = `You are a general-purpose agent with this card as context. The card, its repositories and its pull requests are the topic you can talk about; they are not a task you have to advance.
|
|
72031
|
+
|
|
72032
|
+
- Answer the human's latest message first. A greeting, thanks or short question gets a short answer with no tools and no card work.
|
|
72033
|
+
- Never resume, continue or finish the card's work on your own initiative. Do not move cards, propose specs or start runs.
|
|
72034
|
+
- Use board and repository tools only when they help answer what the human asked, and keep it to a few targeted calls before you reply.
|
|
72035
|
+
- If the human asks for a change, do it and report the result. Do not commit, push or open a pull request unless they ask for it.
|
|
72036
|
+
- If the request is ambiguous, ask one short clarifying question instead of guessing.`;
|
|
72037
|
+
var PLANNING_RULES_DEFAULT = `You are planning a card. You are NOT building it. Do not edit code, commit or push. You may read the repositories and pull requests.
|
|
72038
|
+
|
|
72039
|
+
Your job: turn the card into a clear, testable spec. Ask the human short, specific questions only when the answer changes the plan. Keep answers grilling style: numbered, concrete, with one recommended option marked. Do not ask what the card or repo already answers.`;
|
|
72040
|
+
var PLANNING_LIMITS_DEFAULT = `Planning limits:
|
|
72041
|
+
- Use at most 8 tool calls before you answer.
|
|
72042
|
+
- Read the smallest useful set of files. Use read and rg. Do not install packages, run the app, run tests, start servers, or run long commands.
|
|
72043
|
+
- Do not try to edit files. The planning workspace is read-only.
|
|
72044
|
+
- Once you have enough context, ask questions or call spec_propose. Do not keep exploring.
|
|
72045
|
+
- The human may attach images and files to a planning message. They are copied into the workspace; inspect them when useful.`;
|
|
72046
|
+
var PLANNING_SPEC_DEFAULT = `When ready, call the spec_propose board tool (mcp__aglio__spec_propose or the client's equivalent) with the full proposed card title and body. If the work should be split into cards, include split entries in delivery order. When a ticket depends on an existing card, set blockedBy (or blocks) on it with that card ref such as PROJ-123; unresolved refs come back as warnings. Do not call mcp__aglio__spec_propose until the plan is concrete and complete.
|
|
72047
|
+
|
|
72048
|
+
Dependencies:
|
|
72049
|
+
- Auto mode and auto-claim use card blocks to decide what is built and merged first. If work must happen in an order, say so with blocks instead of relying on the order of the split array.
|
|
72050
|
+
- When a later split entry needs an earlier one, set blockedBy on the later entry to that entry's 1-based split ref, for example "split:1". split refs point at entries in the same proposal.
|
|
72051
|
+
- When a split entry must land before a later one, set blocks on the earlier entry to the later entry's split ref, for example "split:3".
|
|
72052
|
+
- Keep the current card's blocks honest: blockedBy cards must finish before this card, and blocks cards wait for this card. Do not plan work that contradicts them.`;
|
|
72053
|
+
var REVIEW_RULES_DEFAULT = `You are reviewing a pull request for this card. Read the diff and the review feedback. Do not push, commit, or merge. You may run tests locally. Post review findings in the card comments and work log. Be specific about defects, risks and missing verification. If the change is acceptable, say so plainly.`;
|
|
72054
|
+
var CONSULT_RULES_DEFAULT = `You are consulting on this card. You may read code, run tests, and comment. You may edit and push the existing card branch when the human explicitly asks you to fix the PR, resolve conflicts, or change code. A clear human indication that they want it is enough, even when indirect. Never merge or push a base branch. Do not move the card unless you open or update the PR.
|
|
72055
|
+
|
|
72056
|
+
Stay in the comments. Do not use the Questions section for a consult; ask any follow-up in your comment reply. Post your final answer as a comment in the thread; the final run message is only a fallback.`;
|
|
72057
|
+
var JOB_RULES_DEFAULT = `You are running one pass of a recurring job card. The card body is the instruction for this run.
|
|
72058
|
+
|
|
72059
|
+
Rules:
|
|
72060
|
+
- This is a job run: never create a branch, commit, push, or open a pull request.
|
|
72061
|
+
- Work on the checked-out base branch and leave the worktree clean.
|
|
72062
|
+
- Do not ask questions. If something is ambiguous, make the safest call and explain it in your final message.
|
|
72063
|
+
- Do not move the card, mark it done, or post a build reply.
|
|
72064
|
+
- Put the run result in your final message; it is kept on the run.`;
|
|
72065
|
+
var OVERSEER_RULES_DEFAULT = `You are the auto mode overseer for this goal epic. You are a senior delivery lead with the full workspace: the repositories are checked out, you have shell and file tools, and you have the board tools. You own delivery end to end without waiting for a human.
|
|
72066
|
+
|
|
72067
|
+
How you work:
|
|
72068
|
+
- Read before you decide. card_get with cardId (or cardNumber) reads any ticket in this goal: body, comments, work log and linked PRs. pr_get with repoId and number reads that PR, its reviews, comments and checks. Run repository commands and tests when a decision needs proof.
|
|
72069
|
+
- Act with the board tools instead of describing what you would do. Put a comment on the ticket you decided about with comment_add and its cardId, and add one short worklog_add line per action.
|
|
72070
|
+
- Never push a base branch and never open a pull request from this run. Delivery happens through ticket build runs; your decisions are plan, retry, merge, comment and close.
|
|
72071
|
+
|
|
72072
|
+
Planning:
|
|
72073
|
+
- A goal without tickets gets 3 to 8 PR-sized tickets in delivery order. Call spec_propose once with the goal title, body and one split entry per ticket. Auto mode approves the split itself.
|
|
72074
|
+
- Chain dependencies with blockedBy split refs such as "split:1". Do not rely on array order.
|
|
72075
|
+
- Do not repeat tickets that are already Done or re-plan while open tickets are still building.
|
|
72076
|
+
|
|
72077
|
+
Delivery:
|
|
72078
|
+
- A ticket whose PR is green and matches what the ticket asked: call pr_merge with its cardId. The merge deletes the branch and closes the ticket. Do not wait for human approval on that step.
|
|
72079
|
+
- A green PR with a real defect, missing verification or work outside the ticket: do not merge. Comment the defect on the ticket and call card_retry when another attempt can fix it.
|
|
72080
|
+
- A ticket whose last run failed or was cancelled: read the run error with card_get, comment the concrete cause on the ticket, then call card_retry when another attempt is right.
|
|
72081
|
+
- A ticket still building, queued or blocked on a human: leave it alone. Do not comment to fill space.
|
|
72082
|
+
- A goal that explicitly asks to run a job card: find it with job_list and trigger it with job_run. Do not trigger jobs the goal did not ask for.
|
|
72083
|
+
- Goal delivered end to end: call goal_complete with a short reason naming what you checked. If the goal body explicitly asks to deploy, release or tag, follow the repository release convention first: create the requested version tag on the base branch and push it. Do not invent a version. Without that ask, never create a tag.
|
|
72084
|
+
|
|
72085
|
+
Autonomy:
|
|
72086
|
+
- Do not create human blocker cards and do not pause auto mode. Decide with the safest default and record the assumption in the ticket body.
|
|
72087
|
+
- Ask a question only when a real secret or external access blocks progress. Use question_ask on this epic; it appears in the auto mode live window. Do not ask what the card, repo or tools can answer.
|
|
72088
|
+
- Keep questions in one small batch, with concrete options and one recommendation.`;
|
|
72089
|
+
var WORKSPACE_CONSULT_RULES_DEFAULT = `You are the workspace consultant for {{workspaceName}}: a full board operator and overseer. You help people use the product end to end, with read and write access to every project and ticket in this workspace.
|
|
72090
|
+
|
|
72091
|
+
Your job:
|
|
72092
|
+
- Answer questions about any project and ticket. Use project_list, board_overview, card_list, card_get, card_search, project_history and card_history to read the board. Never guess about a ticket or activity you have not read.
|
|
72093
|
+
- Read code when it helps. The project's repositories are cloned below the workspace; use your file and search tools to inspect them. Use repo_list to find a project's repositories and pr_get to read linked pull requests or one PR with its reviews, comments and checks.
|
|
72094
|
+
- Create cards with card_create or card_bulk_create, in any column you need. Propose a new top-level card with card_propose when it needs human approval. Add and update subtickets with subtask_create and subtask_update.
|
|
72095
|
+
- Update any card with card_update: title, body, priority or column (backlog, todo, doing, review, done).
|
|
72096
|
+
- Assign cards with assign_card to an agent (agent_list) or a workspace member (member_list), or release them back to the queue.
|
|
72097
|
+
- Comment on any ticket, add work log entries with worklog_add, answer pending questions, and archive cards with card_delete when asked.
|
|
72098
|
+
- Attach a file or screenshot to any card with artifact_attach, then reference its artifactId from worklog_add when it is evidence.
|
|
72099
|
+
- Read and change dependencies with card_block_list, card_block_add and card_block_remove.
|
|
72100
|
+
- Ask for a human secret, access or decision with request_human_action on the card that is blocked.
|
|
72101
|
+
- Propose a spec for any card with spec_propose. A human still approves it.
|
|
72102
|
+
- Start work with run_start: build for code changes, consult for a card discussion, review for a pull request. Pick the agent from agent_list, or let it default to the card assignee, the consultant agent, or the first active agent.
|
|
72103
|
+
- Read recurring job cards with job_list and trigger one with job_run on request. Job runs open no pull request; the result is kept on the job card.
|
|
72104
|
+
- Keep answers short and concrete. Use card numbers and project keys.
|
|
72105
|
+
|
|
72106
|
+
Limits:
|
|
72107
|
+
- Pushing code, opening pull requests and merging pull requests stay in build runs. Start one with run_start instead of trying to do that work here.
|
|
72108
|
+
- Deleting a card archives it and its subtickets. Confirm the intent before archiving many cards at once.
|
|
72109
|
+
- Do not dump every ticket into the prompt. Read what you need with the tools.`;
|
|
72110
|
+
var PROMPT_KINDS = [
|
|
72111
|
+
{
|
|
72112
|
+
id: "build",
|
|
72113
|
+
label: "Build",
|
|
72114
|
+
description: "Implements a card on a branch, records progress and opens the pull request."
|
|
72115
|
+
},
|
|
72116
|
+
{
|
|
72117
|
+
id: "planning",
|
|
72118
|
+
label: "Planning",
|
|
72119
|
+
description: "Turns a card into a clear spec, asks only the questions that change the plan, and proposes split tickets with their dependencies."
|
|
72120
|
+
},
|
|
72121
|
+
{
|
|
72122
|
+
id: "review",
|
|
72123
|
+
label: "Review",
|
|
72124
|
+
description: "Reads a pull request and its feedback, then reports defects, risks and missing verification without pushing or merging."
|
|
72125
|
+
},
|
|
72126
|
+
{
|
|
72127
|
+
id: "consult",
|
|
72128
|
+
label: "Consult",
|
|
72129
|
+
description: "Answers in a card comment thread. It can push fixes to the existing card branch when a human asks for that."
|
|
72130
|
+
},
|
|
72131
|
+
{
|
|
72132
|
+
id: "agent",
|
|
72133
|
+
label: "Agent chat",
|
|
72134
|
+
description: "A general card chat that answers questions and helps when asked. It does not take over the card's work on its own."
|
|
72135
|
+
},
|
|
72136
|
+
{
|
|
72137
|
+
id: "job",
|
|
72138
|
+
label: "Jobs",
|
|
72139
|
+
description: "Runs one pass of a recurring job card, leaves the worktree clean and reports the result without opening a pull request."
|
|
72140
|
+
},
|
|
72141
|
+
{
|
|
72142
|
+
id: "overseer",
|
|
72143
|
+
label: "Auto mode",
|
|
72144
|
+
description: "Oversees a goal end to end: plans tickets, merges ready pull requests, retries failures and closes the goal when it is delivered."
|
|
72145
|
+
},
|
|
72146
|
+
{
|
|
72147
|
+
id: "workspace_consult",
|
|
72148
|
+
label: "Workspace consultant",
|
|
72149
|
+
description: "Works across every project in this workspace, reads the board on demand and can create, update and assign cards."
|
|
72150
|
+
}
|
|
72151
|
+
];
|
|
72152
|
+
var SPEED_VARIANTS = [
|
|
72153
|
+
{ key: "standard", label: "Standard" },
|
|
72154
|
+
{ key: "fast", label: "Fast" },
|
|
72155
|
+
{ key: "ultra_fast", label: "Ultra fast" },
|
|
72156
|
+
{ key: "yolo", label: "Yolo" },
|
|
72157
|
+
{ key: "detailed", label: "Detailed" }
|
|
72158
|
+
];
|
|
72159
|
+
var VERBOSITY_VARIANTS = [
|
|
72160
|
+
{ key: "concise", label: "Concise" },
|
|
72161
|
+
{ key: "caveman", label: "Caveman" },
|
|
72162
|
+
{ key: "verbose", label: "Verbose" }
|
|
72163
|
+
];
|
|
72164
|
+
var VERIFICATION_KINDS2 = ["build", "review", "consult", "job"];
|
|
72165
|
+
var SCREENSHOT_KINDS = ["build", "consult"];
|
|
72166
|
+
var ALL_KINDS = PROMPT_KINDS.map((kind) => kind.id);
|
|
72167
|
+
function isVerificationKind(kind) {
|
|
72168
|
+
return VERIFICATION_KINDS2.includes(kind);
|
|
72169
|
+
}
|
|
72170
|
+
function isScreenshotKind(kind) {
|
|
72171
|
+
return SCREENSHOT_KINDS.includes(kind);
|
|
72172
|
+
}
|
|
72173
|
+
var CARD_CONTEXT_TEMPLATE = `{{environmentSection}}Project: {{projectName}} ({{projectKey}})
|
|
72174
|
+
Card: #{{cardNumber}} {{cardTitle}} [{{cardColumn}}]
|
|
72175
|
+
|
|
72176
|
+
Card content:
|
|
72177
|
+
{{cardBody}}
|
|
72178
|
+
|
|
72179
|
+
{{repositoriesSection}}{{projectConventionsSection}}{{subtasksSection}}{{blocksSection}}{{autoManagedSection}}{{pullRequestsSection}}{{feedbackSection}}{{answersSection}}{{attachmentsSection}}`;
|
|
72180
|
+
var BUILD_TEMPLATE_DEFAULT = `${BUILD_RULES_DEFAULT}
|
|
72181
|
+
{{verificationRules}}
|
|
72182
|
+
{{screenshotRules}}
|
|
72183
|
+
{{replyStyleRules}}
|
|
72184
|
+
${CARD_CONTEXT_TEMPLATE}{{projectAiSetupSection}}{{suggestedCardsSection}}{{suggestedJobsSection}}
|
|
72185
|
+
Your task for this run:
|
|
72186
|
+
{{instruction}}`;
|
|
72187
|
+
var PLANNING_TEMPLATE_DEFAULT = `${PLANNING_RULES_DEFAULT}
|
|
72188
|
+
{{replyStyleRules}}
|
|
72189
|
+
${PLANNING_LIMITS_DEFAULT}
|
|
72190
|
+
|
|
72191
|
+
${PLANNING_SPEC_DEFAULT}
|
|
72192
|
+
|
|
72193
|
+
Card:
|
|
72194
|
+
#{{cardNumber}} {{cardTitle}}
|
|
72195
|
+
{{cardBody}}
|
|
72196
|
+
|
|
72197
|
+
{{blocksSectionWithNone}}
|
|
72198
|
+
Project: {{projectName}}
|
|
72199
|
+
{{projectConventionsSection}}Repositories:
|
|
72200
|
+
{{repositories}}
|
|
72201
|
+
|
|
72202
|
+
Attached files:
|
|
72203
|
+
{{attachmentsList}}
|
|
72204
|
+
|
|
72205
|
+
Conversation so far:
|
|
72206
|
+
{{conversationHistory}}
|
|
72207
|
+
|
|
72208
|
+
Human message:
|
|
72209
|
+
{{instruction}}`;
|
|
72210
|
+
var REVIEW_TEMPLATE_DEFAULT = `${REVIEW_RULES_DEFAULT}
|
|
72211
|
+
{{verificationRules}}
|
|
72212
|
+
{{replyStyleRules}}
|
|
72213
|
+
${CARD_CONTEXT_TEMPLATE}
|
|
72214
|
+
Review request:
|
|
72215
|
+
{{instruction}}`;
|
|
72216
|
+
var CONSULT_TEMPLATE_DEFAULT = `${CONSULT_RULES_DEFAULT}
|
|
72217
|
+
{{verificationRules}}
|
|
72218
|
+
{{replyStyleRules}}
|
|
72219
|
+
{{screenshotRules}}
|
|
72220
|
+
${CARD_CONTEXT_TEMPLATE}
|
|
72221
|
+
Human message:
|
|
72222
|
+
{{instruction}}`;
|
|
72223
|
+
var AGENT_TEMPLATE_DEFAULT = `${AGENT_RULES_DEFAULT}
|
|
72224
|
+
|
|
72225
|
+
{{replyStyleRules}}
|
|
72226
|
+
${CARD_CONTEXT_TEMPLATE}
|
|
72227
|
+
Conversation so far:
|
|
72228
|
+
{{conversationHistory}}
|
|
72229
|
+
|
|
72230
|
+
Human message:
|
|
72231
|
+
{{instruction}}`;
|
|
72232
|
+
var JOB_TEMPLATE_DEFAULT = `${JOB_RULES_DEFAULT}
|
|
72233
|
+
{{verificationRules}}
|
|
72234
|
+
{{replyStyleRules}}
|
|
72235
|
+
${CARD_CONTEXT_TEMPLATE}
|
|
72236
|
+
Run this job now:
|
|
72237
|
+
{{instruction}}`;
|
|
72238
|
+
var OVERSEER_TEMPLATE_DEFAULT = `${OVERSEER_RULES_DEFAULT}
|
|
72239
|
+
{{replyStyleRules}}
|
|
72240
|
+
${CARD_CONTEXT_TEMPLATE}{{projectAiSetupSection}}{{suggestedCardsSection}}{{suggestedJobsSection}}
|
|
72241
|
+
Goal instruction:
|
|
72242
|
+
{{instruction}}`;
|
|
72243
|
+
var WORKSPACE_CONSULT_TEMPLATE_DEFAULT = `${WORKSPACE_CONSULT_RULES_DEFAULT}
|
|
72244
|
+
{{replyStyleRules}}
|
|
72245
|
+
Workspace: {{workspaceName}}
|
|
72246
|
+
Projects:
|
|
72247
|
+
{{workspaceProjects}}
|
|
72248
|
+
|
|
72249
|
+
Code repositories (read-only, from the latest card mentioned in this thread):
|
|
72250
|
+
{{repositories}}
|
|
72251
|
+
|
|
72252
|
+
{{selectedCard}}
|
|
72253
|
+
|
|
72254
|
+
Attached files for this thread:
|
|
72255
|
+
{{attachmentsList}}
|
|
72256
|
+
|
|
72257
|
+
Conversation so far:
|
|
72258
|
+
{{conversationHistory}}
|
|
72259
|
+
|
|
72260
|
+
Human message:
|
|
72261
|
+
{{instruction}}`;
|
|
72262
|
+
function fillTemplate(text, vars) {
|
|
72263
|
+
return text.replace(/\{\{(\w+)\}\}/g, (match, name2) => vars[name2] ?? match);
|
|
72264
|
+
}
|
|
72265
|
+
function verificationDefault(speed, pulls) {
|
|
72266
|
+
return fillTemplate(VERIFICATION_RULES_DEFAULTS[speed], {
|
|
72267
|
+
completionAction: pulls ? "open the PR as soon as the change is done" : "stop as soon as the work is done",
|
|
72268
|
+
reportTarget: pulls ? "the PR body" : "your reply",
|
|
72269
|
+
verificationDeadline: pulls ? "before the PR" : "before you report",
|
|
72270
|
+
verificationRequirement: pulls ? "Verification is mandatory before opening a PR." : "Verification is mandatory before you report a code change."
|
|
72271
|
+
});
|
|
72272
|
+
}
|
|
72273
|
+
var TEMPLATE_DEFAULTS = {
|
|
72274
|
+
build: BUILD_TEMPLATE_DEFAULT,
|
|
72275
|
+
planning: PLANNING_TEMPLATE_DEFAULT,
|
|
72276
|
+
review: REVIEW_TEMPLATE_DEFAULT,
|
|
72277
|
+
consult: CONSULT_TEMPLATE_DEFAULT,
|
|
72278
|
+
agent: AGENT_TEMPLATE_DEFAULT,
|
|
72279
|
+
job: JOB_TEMPLATE_DEFAULT,
|
|
72280
|
+
overseer: OVERSEER_TEMPLATE_DEFAULT,
|
|
72281
|
+
workspace_consult: WORKSPACE_CONSULT_TEMPLATE_DEFAULT
|
|
72282
|
+
};
|
|
72283
|
+
var TEMPLATE_DESCRIPTIONS = {
|
|
72284
|
+
build: "The full prompt for a build run. Edit any text or move a placeholder to change what the agent sees.",
|
|
72285
|
+
planning: "The full planning prompt, including limits, spec rules and the card context.",
|
|
72286
|
+
review: "The full review prompt, including the review rules and card context.",
|
|
72287
|
+
consult: "The full consult prompt, including the thread rules and card context.",
|
|
72288
|
+
agent: "The full card-chat prompt, including the conversation and card context.",
|
|
72289
|
+
job: "The full recurring job prompt, including the job limits and card context.",
|
|
72290
|
+
overseer: "The full auto mode prompt, including planning, delivery and autonomy rules.",
|
|
72291
|
+
workspace_consult: "The full workspace consultant prompt, including projects, code access and the selected card."
|
|
72292
|
+
};
|
|
72293
|
+
function chunksForKind(kind) {
|
|
72294
|
+
const defs = [
|
|
72295
|
+
{
|
|
72296
|
+
id: `${kind}.template`,
|
|
72297
|
+
kind,
|
|
72298
|
+
section: "Prompt",
|
|
72299
|
+
title: "Prompt template",
|
|
72300
|
+
description: TEMPLATE_DESCRIPTIONS[kind],
|
|
72301
|
+
defaultContent: TEMPLATE_DEFAULTS[kind]
|
|
72302
|
+
}
|
|
72303
|
+
];
|
|
72304
|
+
const label = PROMPT_KINDS.find((item) => item.id === kind)?.label.toLowerCase() ?? kind;
|
|
72305
|
+
if (isVerificationKind(kind)) {
|
|
72306
|
+
for (const speed of SPEED_VARIANTS) {
|
|
72307
|
+
defs.push({
|
|
72308
|
+
id: `${kind}.verification.${speed.key}`,
|
|
72309
|
+
kind,
|
|
72310
|
+
section: "Verification",
|
|
72311
|
+
title: `${speed.label} verification`,
|
|
72312
|
+
description: `What ${label} runs verify at ${speed.label} build speed.`,
|
|
72313
|
+
defaultContent: verificationDefault(speed.key, kind === "build"),
|
|
72314
|
+
variant: { group: "speed", key: speed.key, label: speed.label }
|
|
72315
|
+
});
|
|
72316
|
+
}
|
|
72317
|
+
}
|
|
72318
|
+
if (isScreenshotKind(kind)) {
|
|
72319
|
+
defs.push({
|
|
72320
|
+
id: `${kind}.screenshot.rules`,
|
|
72321
|
+
kind,
|
|
72322
|
+
section: "Screenshot evidence",
|
|
72323
|
+
title: "Required screenshot rules",
|
|
72324
|
+
description: "Added when this project requires screenshot evidence before a pull request.",
|
|
72325
|
+
defaultContent: SCREENSHOT_RULES_DEFAULT
|
|
72326
|
+
});
|
|
72327
|
+
}
|
|
72328
|
+
for (const style of VERBOSITY_VARIANTS) {
|
|
72329
|
+
defs.push({
|
|
72330
|
+
id: `${kind}.verbosity.${style.key}`,
|
|
72331
|
+
kind,
|
|
72332
|
+
section: "Reply style",
|
|
72333
|
+
title: `${style.label} replies`,
|
|
72334
|
+
description: `Reply style when this agent is set to ${style.label}.`,
|
|
72335
|
+
defaultContent: VERBOSITY_RULES_DEFAULTS[style.key],
|
|
72336
|
+
variant: { group: "verbosity", key: style.key, label: style.label }
|
|
72337
|
+
});
|
|
72338
|
+
}
|
|
72339
|
+
return defs;
|
|
72340
|
+
}
|
|
72341
|
+
var PROMPT_CHUNKS = PROMPT_KINDS.flatMap(
|
|
72342
|
+
(kind) => chunksForKind(kind.id)
|
|
72343
|
+
);
|
|
72344
|
+
var PROMPT_CHUNK_IDS = PROMPT_CHUNKS.map((chunk) => chunk.id);
|
|
72345
|
+
var PROJECT_PROMPT_KINDS = PROMPT_KINDS.map((kind) => kind.id).filter(
|
|
72346
|
+
(kind) => kind !== "workspace_consult"
|
|
72347
|
+
);
|
|
72348
|
+
var PROMPT_CHUNK_BY_ID = new Map(PROMPT_CHUNKS.map((chunk) => [chunk.id, chunk]));
|
|
72349
|
+
|
|
71697
72350
|
// ../../packages/shared/src/theme.ts
|
|
71698
72351
|
var THEME_ACCENT_IDS = ["default", "violet", "emerald", "amber", "rose"];
|
|
71699
72352
|
var THEME_SCALES = ["compact", "default", "large"];
|
|
@@ -71745,6 +72398,38 @@ var cardOpenModeSchema = external_exports.enum(CARD_OPEN_MODES);
|
|
|
71745
72398
|
var CARD_OPEN_SIZES = ["default", "large", "fullscreen"];
|
|
71746
72399
|
var cardOpenSizeSchema = external_exports.enum(CARD_OPEN_SIZES);
|
|
71747
72400
|
|
|
72401
|
+
// ../../packages/shared/src/run-context.ts
|
|
72402
|
+
var PROJECT_AI_SETUP_TOOLS = [
|
|
72403
|
+
"job_templates_list",
|
|
72404
|
+
"job_create_from_template",
|
|
72405
|
+
"project_ai_initialize"
|
|
72406
|
+
];
|
|
72407
|
+
var REMOTE_RUN_TOOLS = [
|
|
72408
|
+
"card_get",
|
|
72409
|
+
"repo_list",
|
|
72410
|
+
"pr_get",
|
|
72411
|
+
"comment_add",
|
|
72412
|
+
"worklog_add",
|
|
72413
|
+
"artifact_attach",
|
|
72414
|
+
"verification_record",
|
|
72415
|
+
"subtask_create",
|
|
72416
|
+
"subtask_update",
|
|
72417
|
+
"card_block_list",
|
|
72418
|
+
"card_block_add",
|
|
72419
|
+
"card_block_remove",
|
|
72420
|
+
"job_list",
|
|
72421
|
+
"job_run",
|
|
72422
|
+
"card_propose",
|
|
72423
|
+
"job_propose",
|
|
72424
|
+
"spec_propose",
|
|
72425
|
+
"goal_complete",
|
|
72426
|
+
"question_ask",
|
|
72427
|
+
"pr_open",
|
|
72428
|
+
"pr_merge",
|
|
72429
|
+
"card_retry",
|
|
72430
|
+
"request_human_action"
|
|
72431
|
+
];
|
|
72432
|
+
|
|
71748
72433
|
// ../../packages/shared/src/retention.ts
|
|
71749
72434
|
var RETENTION_DEFAULTS = {
|
|
71750
72435
|
handoffEventDays: 30,
|
|
@@ -72627,16 +73312,22 @@ async function cleanupDockerDisk(input2) {
|
|
|
72627
73312
|
result.errors.push(`build cache: ${errorMessage(error63)}`);
|
|
72628
73313
|
}
|
|
72629
73314
|
}
|
|
72630
|
-
|
|
73315
|
+
const configuredImages = (input2.runnerImages?.length ? input2.runnerImages : input2.runnerImage ? [input2.runnerImage] : []).filter((image) => Boolean(image));
|
|
73316
|
+
if (underPressure && configuredImages.length > 0) {
|
|
72631
73317
|
const nowMs = input2.nowMs ?? Date.now();
|
|
72632
73318
|
try {
|
|
72633
73319
|
const images = await client.listImages({ all: false });
|
|
72634
|
-
const stale =
|
|
72635
|
-
|
|
72636
|
-
|
|
72637
|
-
|
|
72638
|
-
|
|
72639
|
-
|
|
73320
|
+
const stale = /* @__PURE__ */ new Set();
|
|
73321
|
+
for (const configured of configuredImages) {
|
|
73322
|
+
for (const id of selectStaleRunnerImages(images, {
|
|
73323
|
+
repository: runnerImageRepository(configured),
|
|
73324
|
+
keepImage: configured,
|
|
73325
|
+
nowMs,
|
|
73326
|
+
retentionDays: input2.policy.runnerImageRetentionDays
|
|
73327
|
+
})) {
|
|
73328
|
+
stale.add(id);
|
|
73329
|
+
}
|
|
73330
|
+
}
|
|
72640
73331
|
for (const id of stale) {
|
|
72641
73332
|
try {
|
|
72642
73333
|
await client.getImage(id).remove({ force: false });
|
|
@@ -86147,6 +86838,7 @@ async function runRemoteCardJob(deps) {
|
|
|
86147
86838
|
workspace,
|
|
86148
86839
|
runRoot,
|
|
86149
86840
|
kind: context.run.kind,
|
|
86841
|
+
allowedTools: context.run.allowedTools,
|
|
86150
86842
|
card: context.card,
|
|
86151
86843
|
repos: context.repos,
|
|
86152
86844
|
callTool: (input2) => deps.api.callTool({ ...lease, ...input2 }),
|
|
@@ -87861,6 +88553,9 @@ async function runRemoteWorker(config2, deps = {}) {
|
|
|
87861
88553
|
policy: diskPolicy,
|
|
87862
88554
|
disk: config2.workspaceRoot ? await measureDiskSpace(config2.workspaceRoot) : null,
|
|
87863
88555
|
runnerImage: config2.runnerImage ?? "",
|
|
88556
|
+
runnerImages: Object.values(config2.runnerImages ?? {}).filter(
|
|
88557
|
+
(image) => Boolean(image)
|
|
88558
|
+
),
|
|
87864
88559
|
socketPath: config2.dockerSocket,
|
|
87865
88560
|
log
|
|
87866
88561
|
});
|
|
@@ -87927,7 +88622,11 @@ async function runRemoteWorker(config2, deps = {}) {
|
|
|
87927
88622
|
...input2,
|
|
87928
88623
|
workspaceRoot: config2.workspaceRoot ?? input2.workspace,
|
|
87929
88624
|
hostWorkspaceRoot: config2.hostWorkspaceRoot ?? config2.workspaceRoot ?? input2.workspace,
|
|
87930
|
-
image:
|
|
88625
|
+
image: resolveRunnerImage({
|
|
88626
|
+
requiredLabels: result.job.requiredLabels,
|
|
88627
|
+
images: config2.runnerImages,
|
|
88628
|
+
fallback: config2.runnerImage ?? "ghcr.io/h4kbas/aglio-runner:latest"
|
|
88629
|
+
}),
|
|
87931
88630
|
socketPath: config2.dockerSocket,
|
|
87932
88631
|
extraHosts: config2.extraHosts,
|
|
87933
88632
|
api: workerProviderLoginApi(
|
|
@@ -100307,6 +101006,41 @@ function createServerForRun(run) {
|
|
|
100307
101006
|
},
|
|
100308
101007
|
async (input2) => forward("job_run", input2)
|
|
100309
101008
|
);
|
|
101009
|
+
if (run.allowedTools?.includes("job_templates_list")) {
|
|
101010
|
+
server.registerTool(
|
|
101011
|
+
"job_templates_list",
|
|
101012
|
+
{
|
|
101013
|
+
description: "Read the recurring job template catalogue: categories, stack tags, default schedules and what each check does. Categorized menu only: no template is required for setup.",
|
|
101014
|
+
inputSchema: {}
|
|
101015
|
+
},
|
|
101016
|
+
async () => forward("job_templates_list", {})
|
|
101017
|
+
);
|
|
101018
|
+
server.registerTool(
|
|
101019
|
+
"job_create_from_template",
|
|
101020
|
+
{
|
|
101021
|
+
description: "Create a recurring job card in this project from a catalogue template. Returns the job card and the project setup state. Reusing the same title returns the existing job.",
|
|
101022
|
+
inputSchema: {
|
|
101023
|
+
templateId: external_exports.string().min(1).max(100),
|
|
101024
|
+
title: external_exports.string().min(1).max(300).optional(),
|
|
101025
|
+
body: external_exports.string().max(5e4).optional(),
|
|
101026
|
+
cron: external_exports.string().max(200).nullable().optional(),
|
|
101027
|
+
timezone: external_exports.string().min(1).max(100).optional(),
|
|
101028
|
+
scheduleEnabled: external_exports.boolean().optional()
|
|
101029
|
+
}
|
|
101030
|
+
},
|
|
101031
|
+
async (input2) => forward("job_create_from_template", input2)
|
|
101032
|
+
);
|
|
101033
|
+
server.registerTool(
|
|
101034
|
+
"project_ai_initialize",
|
|
101035
|
+
{
|
|
101036
|
+
description: "Mark this project as AI initialized after assessing the repository and its project type. Jobs are optional; no template may fit and suggestions may be used instead. Never call it for an empty or docs-only repo; setup will be injected again on a later run.",
|
|
101037
|
+
inputSchema: {
|
|
101038
|
+
summary: external_exports.string().min(1).max(1e3)
|
|
101039
|
+
}
|
|
101040
|
+
},
|
|
101041
|
+
async (input2) => forward("project_ai_initialize", input2)
|
|
101042
|
+
);
|
|
101043
|
+
}
|
|
100310
101044
|
server.registerTool(
|
|
100311
101045
|
"request_human_action",
|
|
100312
101046
|
{
|
|
@@ -100332,6 +101066,20 @@ function createServerForRun(run) {
|
|
|
100332
101066
|
},
|
|
100333
101067
|
async (input2) => forward("card_propose", input2)
|
|
100334
101068
|
);
|
|
101069
|
+
server.registerTool(
|
|
101070
|
+
"job_propose",
|
|
101071
|
+
{
|
|
101072
|
+
description: "Propose a new recurring job for this project with a cron schedule. Requires human approval; nothing runs until it is approved.",
|
|
101073
|
+
inputSchema: {
|
|
101074
|
+
title: external_exports.string().min(1).max(300),
|
|
101075
|
+
body: external_exports.string().min(1).max(5e4),
|
|
101076
|
+
reason: external_exports.string().min(1).max(1e3),
|
|
101077
|
+
cron: external_exports.string().min(1).max(200),
|
|
101078
|
+
timezone: external_exports.string().min(1).max(100).optional()
|
|
101079
|
+
}
|
|
101080
|
+
},
|
|
101081
|
+
async (input2) => forward("job_propose", input2)
|
|
101082
|
+
);
|
|
100335
101083
|
server.registerTool(
|
|
100336
101084
|
"spec_propose",
|
|
100337
101085
|
{
|
|
@@ -100509,6 +101257,7 @@ function createRemoteMcpHost(options) {
|
|
|
100509
101257
|
}
|
|
100510
101258
|
};
|
|
100511
101259
|
}
|
|
101260
|
+
var REMOTE_MCP_TOOL_NAMES = [...REMOTE_RUN_TOOLS, ...PROJECT_AI_SETUP_TOOLS];
|
|
100512
101261
|
|
|
100513
101262
|
// src/remote-agent.ts
|
|
100514
101263
|
function required2(name2) {
|
|
@@ -100562,6 +101311,11 @@ async function main() {
|
|
|
100562
101311
|
const workspaceRoot = process.env.AGLIO_WORKER_WORKSPACE?.trim() || defaultWorkspaceRoot();
|
|
100563
101312
|
const hostWorkspaceRoot = process.env.AGLIO_WORKER_HOST_WORKSPACE?.trim() || workspaceRoot;
|
|
100564
101313
|
const runnerImage = defaultRunnerImage();
|
|
101314
|
+
const selectedVariants = normalizeRunnerVariants(runnerVariantsFromLabels(labels));
|
|
101315
|
+
const variantImages = runnerImagesFromBase(runnerImage);
|
|
101316
|
+
const runnerImages = poolBoot ? variantImages : selectedVariants.length > 1 ? Object.fromEntries(
|
|
101317
|
+
selectedVariants.map((variant) => [variant, variantImages[variant]])
|
|
101318
|
+
) : { [selectedVariants[0]]: runnerImage };
|
|
100565
101319
|
const dockerSocket = process.env.AGLIO_WORKER_DOCKER_SOCKET?.trim() || "/var/run/docker.sock";
|
|
100566
101320
|
const mcpPort = Number(process.env.AGLIO_WORKER_MCP_PORT ?? 4310);
|
|
100567
101321
|
const claimTimeoutRaw = Number(process.env.AGLIO_WORKER_CLAIM_TIMEOUT_SECONDS);
|
|
@@ -100603,6 +101357,7 @@ async function main() {
|
|
|
100603
101357
|
workspaceRoot,
|
|
100604
101358
|
hostWorkspaceRoot,
|
|
100605
101359
|
runnerImage,
|
|
101360
|
+
runnerImages,
|
|
100606
101361
|
dockerSocket,
|
|
100607
101362
|
extraHosts: runnerExtraHosts,
|
|
100608
101363
|
diskPolicy: resolveDiskGuardPolicy(process.env)
|
|
@@ -100642,7 +101397,11 @@ async function main() {
|
|
|
100642
101397
|
workspace,
|
|
100643
101398
|
workspaceRoot,
|
|
100644
101399
|
hostWorkspaceRoot,
|
|
100645
|
-
image:
|
|
101400
|
+
image: resolveRunnerImage({
|
|
101401
|
+
requiredLabels: job.requiredLabels,
|
|
101402
|
+
images: runnerImages,
|
|
101403
|
+
fallback: runnerImage
|
|
101404
|
+
}),
|
|
100646
101405
|
socketPath: dockerSocket,
|
|
100647
101406
|
networkMode: runnerNetwork,
|
|
100648
101407
|
// Only the bridge fallback needs a host gateway. Docker Desktop
|