aglio-worker 0.108.0 → 0.110.2

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.
Files changed (2) hide show
  1. package/agent.js +400 -18
  2. 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 ["os:linux", "mode:docker", `size:${size}`, POOL_REGION_LABEL];
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
 
@@ -71908,7 +72181,7 @@ var BUILD_TEMPLATE_DEFAULT = `${BUILD_RULES_DEFAULT}
71908
72181
  {{verificationRules}}
71909
72182
  {{screenshotRules}}
71910
72183
  {{replyStyleRules}}
71911
- ${CARD_CONTEXT_TEMPLATE}
72184
+ ${CARD_CONTEXT_TEMPLATE}{{projectAiSetupSection}}{{suggestedCardsSection}}{{suggestedJobsSection}}
71912
72185
  Your task for this run:
71913
72186
  {{instruction}}`;
71914
72187
  var PLANNING_TEMPLATE_DEFAULT = `${PLANNING_RULES_DEFAULT}
@@ -71964,7 +72237,7 @@ Run this job now:
71964
72237
  {{instruction}}`;
71965
72238
  var OVERSEER_TEMPLATE_DEFAULT = `${OVERSEER_RULES_DEFAULT}
71966
72239
  {{replyStyleRules}}
71967
- ${CARD_CONTEXT_TEMPLATE}
72240
+ ${CARD_CONTEXT_TEMPLATE}{{projectAiSetupSection}}{{suggestedCardsSection}}{{suggestedJobsSection}}
71968
72241
  Goal instruction:
71969
72242
  {{instruction}}`;
71970
72243
  var WORKSPACE_CONSULT_TEMPLATE_DEFAULT = `${WORKSPACE_CONSULT_RULES_DEFAULT}
@@ -72069,6 +72342,9 @@ var PROMPT_CHUNKS = PROMPT_KINDS.flatMap(
72069
72342
  (kind) => chunksForKind(kind.id)
72070
72343
  );
72071
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
+ );
72072
72348
  var PROMPT_CHUNK_BY_ID = new Map(PROMPT_CHUNKS.map((chunk) => [chunk.id, chunk]));
72073
72349
 
72074
72350
  // ../../packages/shared/src/theme.ts
@@ -72122,6 +72398,38 @@ var cardOpenModeSchema = external_exports.enum(CARD_OPEN_MODES);
72122
72398
  var CARD_OPEN_SIZES = ["default", "large", "fullscreen"];
72123
72399
  var cardOpenSizeSchema = external_exports.enum(CARD_OPEN_SIZES);
72124
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
+
72125
72433
  // ../../packages/shared/src/retention.ts
72126
72434
  var RETENTION_DEFAULTS = {
72127
72435
  handoffEventDays: 30,
@@ -73004,16 +73312,22 @@ async function cleanupDockerDisk(input2) {
73004
73312
  result.errors.push(`build cache: ${errorMessage(error63)}`);
73005
73313
  }
73006
73314
  }
73007
- if (underPressure && input2.runnerImage) {
73315
+ const configuredImages = (input2.runnerImages?.length ? input2.runnerImages : input2.runnerImage ? [input2.runnerImage] : []).filter((image) => Boolean(image));
73316
+ if (underPressure && configuredImages.length > 0) {
73008
73317
  const nowMs = input2.nowMs ?? Date.now();
73009
73318
  try {
73010
73319
  const images = await client.listImages({ all: false });
73011
- const stale = selectStaleRunnerImages(images, {
73012
- repository: runnerImageRepository(input2.runnerImage),
73013
- keepImage: input2.runnerImage,
73014
- nowMs,
73015
- retentionDays: input2.policy.runnerImageRetentionDays
73016
- });
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
+ }
73017
73331
  for (const id of stale) {
73018
73332
  try {
73019
73333
  await client.getImage(id).remove({ force: false });
@@ -86524,6 +86838,7 @@ async function runRemoteCardJob(deps) {
86524
86838
  workspace,
86525
86839
  runRoot,
86526
86840
  kind: context.run.kind,
86841
+ allowedTools: context.run.allowedTools,
86527
86842
  card: context.card,
86528
86843
  repos: context.repos,
86529
86844
  callTool: (input2) => deps.api.callTool({ ...lease, ...input2 }),
@@ -88238,6 +88553,9 @@ async function runRemoteWorker(config2, deps = {}) {
88238
88553
  policy: diskPolicy,
88239
88554
  disk: config2.workspaceRoot ? await measureDiskSpace(config2.workspaceRoot) : null,
88240
88555
  runnerImage: config2.runnerImage ?? "",
88556
+ runnerImages: Object.values(config2.runnerImages ?? {}).filter(
88557
+ (image) => Boolean(image)
88558
+ ),
88241
88559
  socketPath: config2.dockerSocket,
88242
88560
  log
88243
88561
  });
@@ -88304,7 +88622,11 @@ async function runRemoteWorker(config2, deps = {}) {
88304
88622
  ...input2,
88305
88623
  workspaceRoot: config2.workspaceRoot ?? input2.workspace,
88306
88624
  hostWorkspaceRoot: config2.hostWorkspaceRoot ?? config2.workspaceRoot ?? input2.workspace,
88307
- image: config2.runnerImage ?? "ghcr.io/h4kbas/aglio-runner:latest",
88625
+ image: resolveRunnerImage({
88626
+ requiredLabels: result.job.requiredLabels,
88627
+ images: config2.runnerImages,
88628
+ fallback: config2.runnerImage ?? "ghcr.io/h4kbas/aglio-runner:latest"
88629
+ }),
88308
88630
  socketPath: config2.dockerSocket,
88309
88631
  extraHosts: config2.extraHosts,
88310
88632
  api: workerProviderLoginApi(
@@ -100684,6 +101006,41 @@ function createServerForRun(run) {
100684
101006
  },
100685
101007
  async (input2) => forward("job_run", input2)
100686
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
+ }
100687
101044
  server.registerTool(
100688
101045
  "request_human_action",
100689
101046
  {
@@ -100709,6 +101066,20 @@ function createServerForRun(run) {
100709
101066
  },
100710
101067
  async (input2) => forward("card_propose", input2)
100711
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
+ );
100712
101083
  server.registerTool(
100713
101084
  "spec_propose",
100714
101085
  {
@@ -100886,6 +101257,7 @@ function createRemoteMcpHost(options) {
100886
101257
  }
100887
101258
  };
100888
101259
  }
101260
+ var REMOTE_MCP_TOOL_NAMES = [...REMOTE_RUN_TOOLS, ...PROJECT_AI_SETUP_TOOLS];
100889
101261
 
100890
101262
  // src/remote-agent.ts
100891
101263
  function required2(name2) {
@@ -100939,6 +101311,11 @@ async function main() {
100939
101311
  const workspaceRoot = process.env.AGLIO_WORKER_WORKSPACE?.trim() || defaultWorkspaceRoot();
100940
101312
  const hostWorkspaceRoot = process.env.AGLIO_WORKER_HOST_WORKSPACE?.trim() || workspaceRoot;
100941
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 };
100942
101319
  const dockerSocket = process.env.AGLIO_WORKER_DOCKER_SOCKET?.trim() || "/var/run/docker.sock";
100943
101320
  const mcpPort = Number(process.env.AGLIO_WORKER_MCP_PORT ?? 4310);
100944
101321
  const claimTimeoutRaw = Number(process.env.AGLIO_WORKER_CLAIM_TIMEOUT_SECONDS);
@@ -100980,6 +101357,7 @@ async function main() {
100980
101357
  workspaceRoot,
100981
101358
  hostWorkspaceRoot,
100982
101359
  runnerImage,
101360
+ runnerImages,
100983
101361
  dockerSocket,
100984
101362
  extraHosts: runnerExtraHosts,
100985
101363
  diskPolicy: resolveDiskGuardPolicy(process.env)
@@ -101019,7 +101397,11 @@ async function main() {
101019
101397
  workspace,
101020
101398
  workspaceRoot,
101021
101399
  hostWorkspaceRoot,
101022
- image: runnerImage,
101400
+ image: resolveRunnerImage({
101401
+ requiredLabels: job.requiredLabels,
101402
+ images: runnerImages,
101403
+ fallback: runnerImage
101404
+ }),
101023
101405
  socketPath: dockerSocket,
101024
101406
  networkMode: runnerNetwork,
101025
101407
  // Only the bridge fallback needs a host gateway. Docker Desktop
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aglio-worker",
3
- "version": "0.108.0",
3
+ "version": "0.110.2",
4
4
  "description": "Host machine agent for Aglio: claims jobs over the API and starts aglio-runner containers.",
5
5
  "type": "module",
6
6
  "bin": {