aglio-worker 0.113.2 → 0.115.3
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 +598 -397
- package/package.json +1 -1
package/agent.js
CHANGED
|
@@ -50193,7 +50193,7 @@ var RUN_KINDS = [
|
|
|
50193
50193
|
"workspace_consult",
|
|
50194
50194
|
"job"
|
|
50195
50195
|
];
|
|
50196
|
-
var AGENT_DRIVERS = ["pi", "claude", "codex", "cursor", "opencode", "antigravity"
|
|
50196
|
+
var AGENT_DRIVERS = ["pi", "claude", "codex", "cursor", "opencode", "antigravity"];
|
|
50197
50197
|
var QUESTION_TYPES = ["single", "multi", "text"];
|
|
50198
50198
|
var VERIFICATION_KINDS = ["test_output", "screenshot", "recording", "not_applicable"];
|
|
50199
50199
|
var ARTIFACT_KINDS = ["image", "log", "file", "recording", "canvas", "context"];
|
|
@@ -70175,37 +70175,12 @@ var inAppNotificationTypesSchema = external_exports.object({
|
|
|
70175
70175
|
comment: external_exports.boolean().default(DEFAULT_IN_APP_NOTIFICATION_TYPES.comment),
|
|
70176
70176
|
invite: external_exports.boolean().default(DEFAULT_IN_APP_NOTIFICATION_TYPES.invite)
|
|
70177
70177
|
});
|
|
70178
|
-
var
|
|
70179
|
-
var DEFAULT_DIGEST_FREQUENCY = "4h";
|
|
70178
|
+
var DIGEST_INTERVAL_MS = 24 * 60 * 60 * 1e3;
|
|
70180
70179
|
var DEFAULT_NOTIFICATION_PREFERENCES = {
|
|
70181
|
-
emailDigest: true
|
|
70182
|
-
digestFrequency: DEFAULT_DIGEST_FREQUENCY,
|
|
70183
|
-
telegramEnabled: false,
|
|
70184
|
-
telegramChatId: "",
|
|
70185
|
-
telegramBotConfigured: false,
|
|
70186
|
-
telegramBotUsername: "",
|
|
70187
|
-
telegramLinked: false,
|
|
70188
|
-
telegramChatLabel: "",
|
|
70189
|
-
telegramLinkCode: "",
|
|
70190
|
-
telegramLinkCodeExpiresAt: ""
|
|
70180
|
+
emailDigest: true
|
|
70191
70181
|
};
|
|
70192
|
-
var TELEGRAM_LINK_CODE_TTL_MS = 10 * 60 * 1e3;
|
|
70193
70182
|
var notificationPreferencesSchema = external_exports.object({
|
|
70194
|
-
emailDigest: external_exports.boolean().catch(DEFAULT_NOTIFICATION_PREFERENCES.emailDigest)
|
|
70195
|
-
digestFrequency: external_exports.enum(DIGEST_FREQUENCIES).catch(DEFAULT_NOTIFICATION_PREFERENCES.digestFrequency),
|
|
70196
|
-
telegramEnabled: external_exports.boolean().catch(DEFAULT_NOTIFICATION_PREFERENCES.telegramEnabled),
|
|
70197
|
-
telegramChatId: external_exports.string().trim().max(64).catch(DEFAULT_NOTIFICATION_PREFERENCES.telegramChatId),
|
|
70198
|
-
telegramBotConfigured: external_exports.boolean().catch(DEFAULT_NOTIFICATION_PREFERENCES.telegramBotConfigured),
|
|
70199
|
-
telegramBotUsername: external_exports.string().trim().max(64).catch(DEFAULT_NOTIFICATION_PREFERENCES.telegramBotUsername),
|
|
70200
|
-
telegramLinked: external_exports.boolean().catch(DEFAULT_NOTIFICATION_PREFERENCES.telegramLinked),
|
|
70201
|
-
telegramChatLabel: external_exports.string().trim().max(64).catch(DEFAULT_NOTIFICATION_PREFERENCES.telegramChatLabel),
|
|
70202
|
-
telegramLinkCode: external_exports.string().trim().max(64).catch(DEFAULT_NOTIFICATION_PREFERENCES.telegramLinkCode),
|
|
70203
|
-
telegramLinkCodeExpiresAt: external_exports.string().trim().max(64).catch(DEFAULT_NOTIFICATION_PREFERENCES.telegramLinkCodeExpiresAt)
|
|
70204
|
-
});
|
|
70205
|
-
var storedNotificationPreferencesSchema = notificationPreferencesSchema.extend({
|
|
70206
|
-
telegramBotToken: external_exports.string().trim().max(4096).catch(""),
|
|
70207
|
-
telegramUpdateOffset: external_exports.number().int().nonnegative().catch(0),
|
|
70208
|
-
telegramLinkedAt: external_exports.string().trim().max(64).catch("")
|
|
70183
|
+
emailDigest: external_exports.boolean().catch(DEFAULT_NOTIFICATION_PREFERENCES.emailDigest)
|
|
70209
70184
|
});
|
|
70210
70185
|
function isSlackWebhookUrl(value) {
|
|
70211
70186
|
if (typeof value !== "string" || !value.trim()) return false;
|
|
@@ -70220,7 +70195,29 @@ function isSlackWebhookUrl(value) {
|
|
|
70220
70195
|
// ../../packages/shared/src/runner-images.ts
|
|
70221
70196
|
var RUNNER_IMAGE_DEFAULT_TAG = "latest";
|
|
70222
70197
|
var RUNNER_VARIANT_LABEL_PREFIX = "runner:";
|
|
70223
|
-
var
|
|
70198
|
+
var RUNNER_IMAGE_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._/:@-]*$/;
|
|
70199
|
+
function normalizeRunnerImage(value) {
|
|
70200
|
+
if (typeof value !== "string") return null;
|
|
70201
|
+
const image = value.trim();
|
|
70202
|
+
if (!image || image.length > 500) return null;
|
|
70203
|
+
if (!RUNNER_IMAGE_PATTERN.test(image)) return null;
|
|
70204
|
+
if (image.includes("://")) return null;
|
|
70205
|
+
return image;
|
|
70206
|
+
}
|
|
70207
|
+
function isValidRunnerImage(value) {
|
|
70208
|
+
return normalizeRunnerImage(value) === value;
|
|
70209
|
+
}
|
|
70210
|
+
var RUNNER_VARIANT_IDS = [
|
|
70211
|
+
"general",
|
|
70212
|
+
"node",
|
|
70213
|
+
"python",
|
|
70214
|
+
"rust",
|
|
70215
|
+
"go",
|
|
70216
|
+
"java",
|
|
70217
|
+
"ruby",
|
|
70218
|
+
"php",
|
|
70219
|
+
"dotnet"
|
|
70220
|
+
];
|
|
70224
70221
|
var RUNNER_VARIANTS = [
|
|
70225
70222
|
{
|
|
70226
70223
|
id: "general",
|
|
@@ -70230,8 +70227,8 @@ var RUNNER_VARIANTS = [
|
|
|
70230
70227
|
},
|
|
70231
70228
|
{
|
|
70232
70229
|
id: "node",
|
|
70233
|
-
label: "Node.js",
|
|
70234
|
-
description: "Node, pnpm, TypeScript and browser tooling for web apps.",
|
|
70230
|
+
label: "Node.js + Bun",
|
|
70231
|
+
description: "Node, Bun, pnpm, TypeScript and browser tooling for web apps.",
|
|
70235
70232
|
imageSuffix: "node"
|
|
70236
70233
|
},
|
|
70237
70234
|
{
|
|
@@ -70251,6 +70248,30 @@ var RUNNER_VARIANTS = [
|
|
|
70251
70248
|
label: "Go",
|
|
70252
70249
|
description: "The Go toolchain and common CGO build dependencies.",
|
|
70253
70250
|
imageSuffix: "go"
|
|
70251
|
+
},
|
|
70252
|
+
{
|
|
70253
|
+
id: "java",
|
|
70254
|
+
label: "Java",
|
|
70255
|
+
description: "OpenJDK, Maven and the Gradle wrapper for JVM projects.",
|
|
70256
|
+
imageSuffix: "java"
|
|
70257
|
+
},
|
|
70258
|
+
{
|
|
70259
|
+
id: "ruby",
|
|
70260
|
+
label: "Ruby",
|
|
70261
|
+
description: "Ruby, Bundler and the native build headers for gems.",
|
|
70262
|
+
imageSuffix: "ruby"
|
|
70263
|
+
},
|
|
70264
|
+
{
|
|
70265
|
+
id: "php",
|
|
70266
|
+
label: "PHP",
|
|
70267
|
+
description: "PHP CLI, Composer and the common extension packages.",
|
|
70268
|
+
imageSuffix: "php"
|
|
70269
|
+
},
|
|
70270
|
+
{
|
|
70271
|
+
id: "dotnet",
|
|
70272
|
+
label: ".NET",
|
|
70273
|
+
description: "The .NET 8 SDK for C#, F# and ASP.NET projects.",
|
|
70274
|
+
imageSuffix: "dotnet"
|
|
70254
70275
|
}
|
|
70255
70276
|
];
|
|
70256
70277
|
var DEFAULT_RUNNER_VARIANT = "general";
|
|
@@ -70318,6 +70339,8 @@ function resolveRunnerImage(input2) {
|
|
|
70318
70339
|
}
|
|
70319
70340
|
|
|
70320
70341
|
// ../../packages/shared/src/routing.ts
|
|
70342
|
+
var ROUTING_TARGET_LABEL_KEYS = ["os", "mode", "tools"];
|
|
70343
|
+
var TARGET_OWNED_KEYS = new Set(ROUTING_TARGET_LABEL_KEYS);
|
|
70321
70344
|
var ROUTING_OS_VALUES = ["linux", "macos"];
|
|
70322
70345
|
var ROUTING_MODE_VALUES = ["docker", "host"];
|
|
70323
70346
|
var ROUTING_TOOL_VALUES = ["ios", "xcode", "android", "gpu"];
|
|
@@ -70473,36 +70496,36 @@ var POOL_SIZE_CONFIG = {
|
|
|
70473
70496
|
capacity: 1,
|
|
70474
70497
|
cpuLimit: 2,
|
|
70475
70498
|
memoryLimit: "2560m",
|
|
70476
|
-
instanceType: "
|
|
70499
|
+
instanceType: "c7g.large",
|
|
70477
70500
|
vcpu: 2,
|
|
70478
|
-
hourlyUsd: 0.
|
|
70501
|
+
hourlyUsd: 0.0725,
|
|
70479
70502
|
maxInstances: 8
|
|
70480
70503
|
},
|
|
70481
70504
|
medium: {
|
|
70482
70505
|
capacity: 2,
|
|
70483
70506
|
cpuLimit: 2,
|
|
70484
70507
|
memoryLimit: "2560m",
|
|
70485
|
-
instanceType: "
|
|
70508
|
+
instanceType: "c7g.xlarge",
|
|
70486
70509
|
vcpu: 4,
|
|
70487
|
-
hourlyUsd: 0.
|
|
70510
|
+
hourlyUsd: 0.145,
|
|
70488
70511
|
maxInstances: 4
|
|
70489
70512
|
},
|
|
70490
70513
|
large: {
|
|
70491
70514
|
capacity: 4,
|
|
70492
70515
|
cpuLimit: 2,
|
|
70493
70516
|
memoryLimit: "2560m",
|
|
70494
|
-
instanceType: "
|
|
70517
|
+
instanceType: "c7g.2xlarge",
|
|
70495
70518
|
vcpu: 8,
|
|
70496
|
-
hourlyUsd: 0.
|
|
70519
|
+
hourlyUsd: 0.29,
|
|
70497
70520
|
maxInstances: 2
|
|
70498
70521
|
},
|
|
70499
70522
|
xlarge: {
|
|
70500
70523
|
capacity: 8,
|
|
70501
70524
|
cpuLimit: 2,
|
|
70502
70525
|
memoryLimit: "2560m",
|
|
70503
|
-
instanceType: "
|
|
70526
|
+
instanceType: "c7g.4xlarge",
|
|
70504
70527
|
vcpu: 16,
|
|
70505
|
-
hourlyUsd: 0.
|
|
70528
|
+
hourlyUsd: 0.58,
|
|
70506
70529
|
// Documented only: the controller provisions small, medium and large hosts.
|
|
70507
70530
|
maxInstances: 0
|
|
70508
70531
|
}
|
|
@@ -70691,6 +70714,52 @@ var defaultAutoMode = {
|
|
|
70691
70714
|
state: defaultAutoModeState
|
|
70692
70715
|
};
|
|
70693
70716
|
|
|
70717
|
+
// ../../packages/shared/src/review-overseer.ts
|
|
70718
|
+
var reviewOverseerStateSchema = external_exports.object({
|
|
70719
|
+
/** Ticket/PR digest seen by the last review overseer wake. */
|
|
70720
|
+
signature: external_exports.string().nullable().default(null),
|
|
70721
|
+
/** When the review overseer last woke, so the board can show it is watching. */
|
|
70722
|
+
lastOverseerAt: external_exports.string().datetime().nullable().default(null)
|
|
70723
|
+
});
|
|
70724
|
+
var defaultReviewOverseerState = {
|
|
70725
|
+
signature: null,
|
|
70726
|
+
lastOverseerAt: null
|
|
70727
|
+
};
|
|
70728
|
+
var reviewOverseerSettingsSchema = external_exports.object({
|
|
70729
|
+
enabled: external_exports.boolean().default(false),
|
|
70730
|
+
/** Reviewer agent. Null uses the project default agent. */
|
|
70731
|
+
agentConfigId: external_exports.string().uuid().nullable().default(null),
|
|
70732
|
+
/** Worker labels for the review overseer. Null inherits the project build labels. */
|
|
70733
|
+
requiredWorkerLabels: external_exports.array(external_exports.string().trim().min(1).max(100)).max(20).nullable().default(null),
|
|
70734
|
+
/** Where the review overseer runs. Null follows the project runner target. */
|
|
70735
|
+
runnerTarget: external_exports.enum(JOB_TARGETS).nullable().default(null),
|
|
70736
|
+
/** Cloud size for the review overseer. Null follows the project cloud size. */
|
|
70737
|
+
poolSize: external_exports.enum(POOL_SIZES).nullable().default(null),
|
|
70738
|
+
/** Runtime wake state. Never edited by the settings form. */
|
|
70739
|
+
state: reviewOverseerStateSchema.default(defaultReviewOverseerState)
|
|
70740
|
+
});
|
|
70741
|
+
var defaultReviewOverseer = {
|
|
70742
|
+
enabled: false,
|
|
70743
|
+
agentConfigId: null,
|
|
70744
|
+
requiredWorkerLabels: null,
|
|
70745
|
+
runnerTarget: null,
|
|
70746
|
+
poolSize: null,
|
|
70747
|
+
state: defaultReviewOverseerState
|
|
70748
|
+
};
|
|
70749
|
+
|
|
70750
|
+
// ../../packages/shared/src/job-artifacts.ts
|
|
70751
|
+
var JOB_LOG_ARTIFACT_MODES = ["off", "failures", "all"];
|
|
70752
|
+
var jobLogArtifactModeSchema = external_exports.enum(JOB_LOG_ARTIFACT_MODES);
|
|
70753
|
+
var DEFAULT_JOB_LOG_ARTIFACTS = "off";
|
|
70754
|
+
var DEFAULT_ARTIFACT_RETENTION_DAYS = 0;
|
|
70755
|
+
var MAX_ARTIFACT_RETENTION_DAYS = 3650;
|
|
70756
|
+
var artifactRetentionDaysSchema = external_exports.number().int().min(0).max(MAX_ARTIFACT_RETENTION_DAYS);
|
|
70757
|
+
|
|
70758
|
+
// ../../packages/shared/src/image-upload-quality.ts
|
|
70759
|
+
var IMAGE_UPLOAD_QUALITY_LEVELS = ["lowest", "low", "medium", "high"];
|
|
70760
|
+
var imageUploadQualitySchema = external_exports.enum(IMAGE_UPLOAD_QUALITY_LEVELS);
|
|
70761
|
+
var DEFAULT_IMAGE_UPLOAD_QUALITY = "medium";
|
|
70762
|
+
|
|
70694
70763
|
// ../../packages/shared/src/schemas.ts
|
|
70695
70764
|
var cardColumnSchema = external_exports.enum(CARD_COLUMNS);
|
|
70696
70765
|
var runStatusSchema = external_exports.enum(RUN_STATUSES_FOR_SCHEMA);
|
|
@@ -70756,6 +70825,8 @@ var projectSettingsSchema = external_exports.object({
|
|
|
70756
70825
|
autoClaimSchedule: autoClaimScheduleSchema,
|
|
70757
70826
|
/** Goal-driven project automation. Off by default for every existing project. */
|
|
70758
70827
|
autoMode: autoModeSettingsSchema.default(defaultAutoMode),
|
|
70828
|
+
/** Review column overseer: review, merge or send back cards in Review. */
|
|
70829
|
+
reviewOverseer: reviewOverseerSettingsSchema.default(defaultReviewOverseer),
|
|
70759
70830
|
/**
|
|
70760
70831
|
* Hidden project AI metadata. `initializedAt` is set once the agent has
|
|
70761
70832
|
* assessed the repository and classified the project. Jobs are optional, so
|
|
@@ -70766,13 +70837,13 @@ var projectSettingsSchema = external_exports.object({
|
|
|
70766
70837
|
projectAi: external_exports.object({
|
|
70767
70838
|
initializedAt: external_exports.string().nullable().default(null),
|
|
70768
70839
|
/**
|
|
70769
|
-
*
|
|
70840
|
+
* Inject a suggestion prompt into build and overseer runs so agents
|
|
70770
70841
|
* propose cards for gaps and stale dependencies. On by default.
|
|
70771
70842
|
*/
|
|
70772
70843
|
suggestedCardsEnabled: external_exports.boolean().default(true),
|
|
70773
70844
|
/**
|
|
70774
|
-
*
|
|
70775
|
-
*
|
|
70845
|
+
* Inject a job suggestion prompt into build and overseer runs so agents
|
|
70846
|
+
* propose recurring jobs for gaps they notice. On by default.
|
|
70776
70847
|
*/
|
|
70777
70848
|
suggestedJobsEnabled: external_exports.boolean().default(true)
|
|
70778
70849
|
}).default(() => ({ initializedAt: null, suggestedCardsEnabled: true, suggestedJobsEnabled: true })),
|
|
@@ -70820,12 +70891,36 @@ var projectSettingsSchema = external_exports.object({
|
|
|
70820
70891
|
repoConnection: repoConnectionReportSchema.nullish(),
|
|
70821
70892
|
/** Build, consult and review job labels. Empty means any worker. */
|
|
70822
70893
|
requiredWorkerLabels: routingLabelsSchema.default([]),
|
|
70894
|
+
/**
|
|
70895
|
+
* Project-level runner image. The worker pulls and runs this repository plus
|
|
70896
|
+
* tag or digest for this project's jobs, instead of its stock variant image.
|
|
70897
|
+
* Null keeps the worker image, so old projects behave exactly as before.
|
|
70898
|
+
*/
|
|
70899
|
+
runnerImage: external_exports.string().trim().max(500).nullable().default(null).superRefine((value, ctx) => {
|
|
70900
|
+
if (value === null) return;
|
|
70901
|
+
if (!isValidRunnerImage(value)) {
|
|
70902
|
+
ctx.addIssue({
|
|
70903
|
+
code: "custom",
|
|
70904
|
+
message: "Use a container image reference such as ghcr.io/acme/runner-web:2026-06."
|
|
70905
|
+
});
|
|
70906
|
+
}
|
|
70907
|
+
}).transform((value) => value === null ? null : normalizeRunnerImage(value)),
|
|
70908
|
+
/** When the image reference last changed. Older than the last green run is a warning. */
|
|
70909
|
+
runnerImageUpdatedAt: external_exports.string().nullable().default(null),
|
|
70910
|
+
/** A human dismissed the repeated-install hint for this project. */
|
|
70911
|
+
runnerImageHintDismissedAt: external_exports.string().nullable().default(null),
|
|
70823
70912
|
/** Planning job labels. Empty means any online worker, so planning never waits on a build machine. */
|
|
70824
70913
|
planningRequiredWorkerLabels: routingLabelsSchema.default([]),
|
|
70825
70914
|
/** Post the agent's final build message as a card comment. */
|
|
70826
70915
|
postBuildReply: external_exports.boolean().default(true),
|
|
70827
70916
|
/** Require screenshot evidence, or an explicit N/A reason, before a pull request opens. */
|
|
70828
70917
|
requireScreenshots: external_exports.boolean().default(false),
|
|
70918
|
+
/** Days this project keeps uploaded run files. 0 keeps them forever. */
|
|
70919
|
+
artifactRetentionDays: artifactRetentionDaysSchema.default(DEFAULT_ARTIFACT_RETENTION_DAYS),
|
|
70920
|
+
/** Store a log archive for every run, only failed runs, or never. */
|
|
70921
|
+
jobLogArtifacts: jobLogArtifactModeSchema.default(DEFAULT_JOB_LOG_ARTIFACTS),
|
|
70922
|
+
/** Pictures uploaded to this project are re-encoded at this preset. */
|
|
70923
|
+
imageUploadQuality: imageUploadQualitySchema.default(DEFAULT_IMAGE_UPLOAD_QUALITY),
|
|
70829
70924
|
/** Start a fix run when a human comments on or requests changes in a linked PR. */
|
|
70830
70925
|
followPrComments: external_exports.boolean().default(true),
|
|
70831
70926
|
/** Start a fix run when checks fail on the linked PR head. */
|
|
@@ -70862,6 +70957,7 @@ var defaultProjectSettings = {
|
|
|
70862
70957
|
maxParallelRuns: 2,
|
|
70863
70958
|
maxPlanningRuns: 2,
|
|
70864
70959
|
autoMode: defaultAutoMode,
|
|
70960
|
+
reviewOverseer: defaultReviewOverseer,
|
|
70865
70961
|
projectAi: { initializedAt: null, suggestedCardsEnabled: true, suggestedJobsEnabled: true },
|
|
70866
70962
|
defaultAgentConfigId: null,
|
|
70867
70963
|
defaultReviewerAgentConfigId: null,
|
|
@@ -70880,6 +70976,9 @@ var defaultProjectSettings = {
|
|
|
70880
70976
|
roles: {},
|
|
70881
70977
|
postBuildReply: true,
|
|
70882
70978
|
requireScreenshots: false,
|
|
70979
|
+
artifactRetentionDays: DEFAULT_ARTIFACT_RETENTION_DAYS,
|
|
70980
|
+
jobLogArtifacts: DEFAULT_JOB_LOG_ARTIFACTS,
|
|
70981
|
+
imageUploadQuality: DEFAULT_IMAGE_UPLOAD_QUALITY,
|
|
70883
70982
|
followPrComments: true,
|
|
70884
70983
|
followPrChecks: true,
|
|
70885
70984
|
maxCheckFixAttempts: 3,
|
|
@@ -70888,6 +70987,9 @@ var defaultProjectSettings = {
|
|
|
70888
70987
|
slackWebhookUrl: null,
|
|
70889
70988
|
requiredWorkerLabels: [],
|
|
70890
70989
|
planningRequiredWorkerLabels: [],
|
|
70990
|
+
runnerImage: null,
|
|
70991
|
+
runnerImageUpdatedAt: null,
|
|
70992
|
+
runnerImageHintDismissedAt: null,
|
|
70891
70993
|
cloudRunnerSize: "small",
|
|
70892
70994
|
promptSets: {}
|
|
70893
70995
|
};
|
|
@@ -71265,6 +71367,7 @@ function isHostLocalSigningArtifact(name2) {
|
|
|
71265
71367
|
return HOST_LOCAL_SIGNING_EXTENSIONS.some((extension) => base.endsWith(extension));
|
|
71266
71368
|
}
|
|
71267
71369
|
var REMOTE_CONSULT_READ_TOOLS = [
|
|
71370
|
+
"conversation_history",
|
|
71268
71371
|
"project_list",
|
|
71269
71372
|
"board_overview",
|
|
71270
71373
|
"card_list",
|
|
@@ -71275,6 +71378,7 @@ var REMOTE_CONSULT_READ_TOOLS = [
|
|
|
71275
71378
|
"agent_list",
|
|
71276
71379
|
"member_list",
|
|
71277
71380
|
"job_list",
|
|
71381
|
+
"proposal_list",
|
|
71278
71382
|
"repo_list",
|
|
71279
71383
|
"pr_get"
|
|
71280
71384
|
];
|
|
@@ -71369,53 +71473,6 @@ function parseWorkerLabels(input2) {
|
|
|
71369
71473
|
}
|
|
71370
71474
|
}
|
|
71371
71475
|
|
|
71372
|
-
// ../../packages/shared/src/agent-presets.ts
|
|
71373
|
-
var AGENT_PRESETS = ["yolo", "quick", "balanced", "careful"];
|
|
71374
|
-
var PRESET_DIALS = {
|
|
71375
|
-
quick: { buildSpeed: "fast", thinking: "low", verbosity: "concise" },
|
|
71376
|
-
balanced: {
|
|
71377
|
-
buildSpeed: DEFAULT_BUILD_SPEED,
|
|
71378
|
-
thinking: DEFAULT_THINKING_LEVEL,
|
|
71379
|
-
verbosity: DEFAULT_VERBOSITY
|
|
71380
|
-
},
|
|
71381
|
-
careful: { buildSpeed: "detailed", thinking: "high", verbosity: "verbose" },
|
|
71382
|
-
yolo: { buildSpeed: "yolo", thinking: "off", verbosity: "caveman" }
|
|
71383
|
-
};
|
|
71384
|
-
var AGENT_PRESET_BUILD_SPEEDS = AGENT_PRESETS.reduce(
|
|
71385
|
-
(all2, preset) => {
|
|
71386
|
-
all2[preset] = PRESET_DIALS[preset].buildSpeed;
|
|
71387
|
-
return all2;
|
|
71388
|
-
},
|
|
71389
|
-
{}
|
|
71390
|
-
);
|
|
71391
|
-
var AGENT_PRESET_ROLE_VALUES = AGENT_PRESETS.reduce(
|
|
71392
|
-
(all2, preset) => {
|
|
71393
|
-
const { thinking, verbosity } = PRESET_DIALS[preset];
|
|
71394
|
-
all2[preset] = PROJECT_AGENT_ROLES.reduce((roles, role) => {
|
|
71395
|
-
roles[role] = { thinking, verbosity };
|
|
71396
|
-
return roles;
|
|
71397
|
-
}, {});
|
|
71398
|
-
return all2;
|
|
71399
|
-
},
|
|
71400
|
-
{}
|
|
71401
|
-
);
|
|
71402
|
-
var AGENT_PRESET_VALUES = AGENT_PRESETS.reduce(
|
|
71403
|
-
(all2, preset) => {
|
|
71404
|
-
const { buildSpeed, thinking, verbosity } = PRESET_DIALS[preset];
|
|
71405
|
-
all2[preset] = {
|
|
71406
|
-
buildSpeed,
|
|
71407
|
-
thinking,
|
|
71408
|
-
verbosity,
|
|
71409
|
-
roles: PROJECT_AGENT_ROLES.reduce((roles, role) => {
|
|
71410
|
-
roles[role] = { ...AGENT_PRESET_ROLE_VALUES[preset][role] };
|
|
71411
|
-
return roles;
|
|
71412
|
-
}, {})
|
|
71413
|
-
};
|
|
71414
|
-
return all2;
|
|
71415
|
-
},
|
|
71416
|
-
{}
|
|
71417
|
-
);
|
|
71418
|
-
|
|
71419
71476
|
// ../../packages/shared/src/events.ts
|
|
71420
71477
|
var appEventSchema = external_exports.object({
|
|
71421
71478
|
id: external_exports.number(),
|
|
@@ -71475,11 +71532,11 @@ var PROVIDERS = [
|
|
|
71475
71532
|
{
|
|
71476
71533
|
id: "anthropic",
|
|
71477
71534
|
label: "Anthropic Claude",
|
|
71478
|
-
drivers: ["claude", "pi"
|
|
71535
|
+
drivers: ["claude", "pi"],
|
|
71479
71536
|
models: ["claude-sonnet-4-5", "claude-opus-4-1", "claude-haiku-4-5", "claude-sonnet-4", "claude-3-7-sonnet-latest"],
|
|
71480
71537
|
connection: { baseUrl: "https://api.anthropic.com/v1" },
|
|
71481
71538
|
authOptions: [
|
|
71482
|
-
apiKey("ANTHROPIC_API_KEY", ["claude", "pi"
|
|
71539
|
+
apiKey("ANTHROPIC_API_KEY", ["claude", "pi"]),
|
|
71483
71540
|
{
|
|
71484
71541
|
type: "oauth_token",
|
|
71485
71542
|
label: "Claude subscription token",
|
|
@@ -71492,11 +71549,11 @@ var PROVIDERS = [
|
|
|
71492
71549
|
{
|
|
71493
71550
|
id: "openai",
|
|
71494
71551
|
label: "OpenAI / Codex",
|
|
71495
|
-
drivers: ["codex", "pi"
|
|
71552
|
+
drivers: ["codex", "pi"],
|
|
71496
71553
|
models: ["gpt-5", "gpt-5-codex", "gpt-5-mini", "gpt-4.1", "o3", "o4-mini"],
|
|
71497
71554
|
connection: { baseUrl: "https://api.openai.com/v1" },
|
|
71498
71555
|
authOptions: [
|
|
71499
|
-
apiKey("OPENAI_API_KEY", ["codex", "pi"
|
|
71556
|
+
apiKey("OPENAI_API_KEY", ["codex", "pi"]),
|
|
71500
71557
|
sessionBundle(
|
|
71501
71558
|
".codex/auth.json",
|
|
71502
71559
|
"Requires a ChatGPT subscription.",
|
|
@@ -71514,10 +71571,10 @@ var PROVIDERS = [
|
|
|
71514
71571
|
{
|
|
71515
71572
|
id: "google",
|
|
71516
71573
|
label: "Google Gemini",
|
|
71517
|
-
drivers: ["pi"
|
|
71574
|
+
drivers: ["pi"],
|
|
71518
71575
|
models: ["gemini-2.5-pro", "gemini-2.5-flash", "gemini-2.0-flash"],
|
|
71519
71576
|
connection: { baseUrl: "https://generativelanguage.googleapis.com/v1beta/openai" },
|
|
71520
|
-
authOptions: [apiKey("GEMINI_API_KEY", ["pi"
|
|
71577
|
+
authOptions: [apiKey("GEMINI_API_KEY", ["pi"])]
|
|
71521
71578
|
},
|
|
71522
71579
|
{
|
|
71523
71580
|
id: "cursor",
|
|
@@ -71626,26 +71683,26 @@ var PROVIDERS = [
|
|
|
71626
71683
|
{
|
|
71627
71684
|
id: "deepseek",
|
|
71628
71685
|
label: "DeepSeek",
|
|
71629
|
-
drivers: ["pi"
|
|
71686
|
+
drivers: ["pi"],
|
|
71630
71687
|
models: ["deepseek-flash", "deepseek-chat", "deepseek-reasoner"],
|
|
71631
71688
|
connection: { baseUrl: "https://api.deepseek.com/v1" },
|
|
71632
|
-
authOptions: [apiKey("DEEPSEEK_API_KEY", ["pi"
|
|
71689
|
+
authOptions: [apiKey("DEEPSEEK_API_KEY", ["pi"])]
|
|
71633
71690
|
},
|
|
71634
71691
|
{
|
|
71635
71692
|
id: "openrouter",
|
|
71636
71693
|
label: "OpenRouter",
|
|
71637
|
-
drivers: ["pi"
|
|
71694
|
+
drivers: ["pi"],
|
|
71638
71695
|
models: ["openrouter/auto", "anthropic/claude-sonnet-4.5", "openai/gpt-5", "google/gemini-2.5-pro", "deepseek/deepseek-chat-v3.1"],
|
|
71639
71696
|
connection: { baseUrl: "https://openrouter.ai/api/v1" },
|
|
71640
|
-
authOptions: [apiKey("OPENROUTER_API_KEY", ["pi"
|
|
71697
|
+
authOptions: [apiKey("OPENROUTER_API_KEY", ["pi"])]
|
|
71641
71698
|
},
|
|
71642
71699
|
{
|
|
71643
71700
|
id: "xai",
|
|
71644
71701
|
label: "xAI",
|
|
71645
|
-
drivers: ["pi"
|
|
71702
|
+
drivers: ["pi"],
|
|
71646
71703
|
models: ["grok-4", "grok-3", "grok-3-mini"],
|
|
71647
71704
|
connection: { baseUrl: "https://api.x.ai/v1" },
|
|
71648
|
-
authOptions: [apiKey("XAI_API_KEY", ["pi"
|
|
71705
|
+
authOptions: [apiKey("XAI_API_KEY", ["pi"])]
|
|
71649
71706
|
},
|
|
71650
71707
|
{
|
|
71651
71708
|
id: "groq",
|
|
@@ -71698,10 +71755,10 @@ var PROVIDERS = [
|
|
|
71698
71755
|
{
|
|
71699
71756
|
id: "zai",
|
|
71700
71757
|
label: "Z.ai",
|
|
71701
|
-
drivers: ["pi"
|
|
71758
|
+
drivers: ["pi"],
|
|
71702
71759
|
models: ["glm-4.6", "glm-4.5", "glm-4.5-air"],
|
|
71703
71760
|
connection: { baseUrl: "https://api.z.ai/api/paas/v4" },
|
|
71704
|
-
authOptions: [apiKey("ZAI_API_KEY", ["pi"
|
|
71761
|
+
authOptions: [apiKey("ZAI_API_KEY", ["pi"])]
|
|
71705
71762
|
}
|
|
71706
71763
|
];
|
|
71707
71764
|
|
|
@@ -71944,21 +72001,10 @@ var INVITE_TTL_MS = INVITE_TTL_DAYS * 24 * 60 * 60 * 1e3;
|
|
|
71944
72001
|
var DEFAULT_INVITE_EXPIRY_DAYS = INVITE_TTL_DAYS;
|
|
71945
72002
|
var MAX_INVITE_EXPIRY_DAYS = 90;
|
|
71946
72003
|
|
|
71947
|
-
// ../../packages/shared/src/image-upload-quality.ts
|
|
71948
|
-
var IMAGE_UPLOAD_QUALITY_LEVELS = ["lowest", "low", "medium", "high"];
|
|
71949
|
-
var imageUploadQualitySchema = external_exports.enum(IMAGE_UPLOAD_QUALITY_LEVELS);
|
|
71950
|
-
var DEFAULT_IMAGE_UPLOAD_QUALITY = "medium";
|
|
71951
|
-
|
|
71952
72004
|
// ../../packages/shared/src/workspace-settings.ts
|
|
71953
72005
|
var WORKSPACE_SETTINGS_DEFAULTS = {
|
|
71954
72006
|
allowMemberInvites: true,
|
|
71955
72007
|
defaultAgentConfigId: null,
|
|
71956
|
-
/** 0 means keep artifacts forever. */
|
|
71957
|
-
artifactRetentionDays: 0,
|
|
71958
|
-
/** Job logs are infra noise. Only write an artifact when a workspace opts in. */
|
|
71959
|
-
jobLogArtifacts: "off",
|
|
71960
|
-
/** Uploaded pictures are always re-encoded. Everyone starts at Medium. */
|
|
71961
|
-
imageUploadQuality: DEFAULT_IMAGE_UPLOAD_QUALITY,
|
|
71962
72008
|
/** The shared workspace consultant is opt-out. Disabled hides every entry point. */
|
|
71963
72009
|
consultantEnabled: true,
|
|
71964
72010
|
/** Workspace consultant reasoning budget. Independent of every project. */
|
|
@@ -71968,14 +72014,9 @@ var WORKSPACE_SETTINGS_DEFAULTS = {
|
|
|
71968
72014
|
/** How long new invite links stay valid. Existing invites keep their own date. */
|
|
71969
72015
|
inviteExpiryDays: DEFAULT_INVITE_EXPIRY_DAYS
|
|
71970
72016
|
};
|
|
71971
|
-
var JOB_LOG_ARTIFACT_MODES = ["off", "failures", "all"];
|
|
71972
|
-
var jobLogArtifactModeSchema = external_exports.enum(JOB_LOG_ARTIFACT_MODES);
|
|
71973
72017
|
var workspaceSettingsSchema = external_exports.object({
|
|
71974
72018
|
allowMemberInvites: external_exports.boolean().catch(WORKSPACE_SETTINGS_DEFAULTS.allowMemberInvites),
|
|
71975
72019
|
defaultAgentConfigId: external_exports.string().trim().min(1).nullable().catch(null),
|
|
71976
|
-
artifactRetentionDays: external_exports.number().int().min(0).max(3650).catch(WORKSPACE_SETTINGS_DEFAULTS.artifactRetentionDays),
|
|
71977
|
-
jobLogArtifacts: jobLogArtifactModeSchema.catch(WORKSPACE_SETTINGS_DEFAULTS.jobLogArtifacts),
|
|
71978
|
-
imageUploadQuality: imageUploadQualitySchema.catch(WORKSPACE_SETTINGS_DEFAULTS.imageUploadQuality),
|
|
71979
72020
|
consultantEnabled: external_exports.boolean().catch(WORKSPACE_SETTINGS_DEFAULTS.consultantEnabled),
|
|
71980
72021
|
consultantThinking: thinkingLevelSchema.catch(WORKSPACE_SETTINGS_DEFAULTS.consultantThinking),
|
|
71981
72022
|
consultantVerbosity: verbositySchema.catch(WORKSPACE_SETTINGS_DEFAULTS.consultantVerbosity),
|
|
@@ -71983,6 +72024,7 @@ var workspaceSettingsSchema = external_exports.object({
|
|
|
71983
72024
|
}).passthrough();
|
|
71984
72025
|
|
|
71985
72026
|
// ../../packages/shared/src/prompt-chunks.ts
|
|
72027
|
+
var CONTEXT_LOOKUP_RULE = `Use the board MCP tools when the prompt is missing detail: conversation_history for earlier messages in this planning, agent chat or consultant thread; card_get for this card's comments, work log, attempts, runs and attachments; pr_get for linked PR reviews and checks; job_list for recurring jobs; and repo_list for repository settings. Never guess about data a tool can read.`;
|
|
71986
72028
|
var BUILD_RULES_DEFAULT = `You are an autonomous engineering teammate working on one card in a project board.
|
|
71987
72029
|
|
|
71988
72030
|
Rules:
|
|
@@ -72001,6 +72043,7 @@ Rules:
|
|
|
72001
72043
|
- Mark a question required only when you cannot continue. Optional questions never block the resume.
|
|
72002
72044
|
- Do not ask for permission, for facts you can check yourself, or for a decision the card already makes.
|
|
72003
72045
|
- Read the repo before editing. Follow existing patterns and style.
|
|
72046
|
+
- ${CONTEXT_LOOKUP_RULE}
|
|
72004
72047
|
- Aglio product docs are available through the aglio_docs tool. Call it without a topic for the index, or with a topic id for workers and custom runner images, prompts, jobs, auto mode and releases.
|
|
72005
72048
|
- Attach screenshots, recordings, logs and files as evidence.
|
|
72006
72049
|
- When done, verified and pushed, open the pull request. That moves the card to review.
|
|
@@ -72043,15 +72086,17 @@ var VERBOSITY_RULES_DEFAULTS = {
|
|
|
72043
72086
|
verbose: `- Agent verbosity is Verbose. Explain the reasoning and the steps behind the change.
|
|
72044
72087
|
- Cover tradeoffs and anything a reviewer should check. Keep work log summaries short and put detail in details.`
|
|
72045
72088
|
};
|
|
72046
|
-
var AGENT_RULES_DEFAULT = `You are a
|
|
72089
|
+
var AGENT_RULES_DEFAULT = `You are a discussion partner for this card. A human opened the Agent tab to talk the card through, not to advance it.
|
|
72047
72090
|
|
|
72048
|
-
-
|
|
72049
|
-
-
|
|
72050
|
-
-
|
|
72051
|
-
- If the human asks for a change,
|
|
72052
|
-
- If the request is ambiguous, ask one short
|
|
72091
|
+
- Reply to the human's latest message and stop. A greeting, thanks or short question gets a short answer with no tools.
|
|
72092
|
+
- The card, its repositories and its pull requests are the topic. They are not a task to advance, so never edit files, run commands, commit, push, open or merge pull requests, or write to the board.
|
|
72093
|
+
- Read only when the reply needs it, with a few read-only calls: conversation_history for earlier messages, card_get for the card, pr_get for pull requests, repo_list for repositories, aglio_docs for how Aglio works. Do not use more than a few tools per message.
|
|
72094
|
+
- If the human asks for a change, say to use Planning or a build run instead of starting it here.
|
|
72095
|
+
- If the request is ambiguous, ask one short question in the chat. Never suspend this chat with question_ask or spec_propose, and never create human blocker cards.`;
|
|
72053
72096
|
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.
|
|
72054
72097
|
|
|
72098
|
+
- ${CONTEXT_LOOKUP_RULE}
|
|
72099
|
+
|
|
72055
72100
|
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.
|
|
72056
72101
|
|
|
72057
72102
|
Aglio product context: call the aglio_docs tool when the plan touches workers, custom runner images, prompts, jobs or releases. No topic returns the index.`;
|
|
@@ -72068,9 +72113,33 @@ Dependencies:
|
|
|
72068
72113
|
- 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.
|
|
72069
72114
|
- 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".
|
|
72070
72115
|
- 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.`;
|
|
72071
|
-
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
|
|
72116
|
+
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.
|
|
72117
|
+
|
|
72118
|
+
- ${CONTEXT_LOOKUP_RULE}`;
|
|
72119
|
+
var REVIEW_OVERSEER_RULES_DEFAULT = `You are the review column overseer. You watch every card in the Review column and decide whether its pull request is ready to merge, needs a fix on the same card, or needs a separate follow-up card.
|
|
72120
|
+
|
|
72121
|
+
How you work:
|
|
72122
|
+
- Read before you decide. Use card_get with cardId or cardNumber to read the card body, comments, work log and linked PRs. Use pr_get with repoId and number to read the diff, reviews, comments and checks. Run repository commands and tests when a decision needs proof.
|
|
72123
|
+
- Act with the board tools instead of describing what you would do. Add one short worklog_add line for every action, and comment on the card you decided about with comment_add.
|
|
72124
|
+
- Never push a base branch and never open a pull request from this run. Builders own branches and pull requests.
|
|
72125
|
+
|
|
72126
|
+
Decisions:
|
|
72127
|
+
- Pull request is green, matches the card and has no real defect: call pr_merge with the cardId. Do not ask a human for a normal merge.
|
|
72128
|
+
- Pull request has a real defect, missing verification or work outside the card: do not merge. Comment the concrete defect with comment_add, then call card_retry when the latest run failed or was cancelled and another attempt can fix it.
|
|
72129
|
+
- The change is acceptable but the gap belongs in separate work: call card_propose with a precise title, body and reason. Do not create the card directly.
|
|
72130
|
+
- Card has an open human question, an active run or a merge that is still pending: leave it alone. Do not comment to fill space.
|
|
72131
|
+
- A card whose already-linked pull request was merged: leave it for the normal board close; do not reopen or duplicate work.
|
|
72132
|
+
|
|
72133
|
+
Scope:
|
|
72134
|
+
- Only touch cards in this project's Review column. Never merge or retry a card outside Review.
|
|
72135
|
+
- Do not close the project, plan a goal or start unrelated work.
|
|
72136
|
+
- If nothing needs action, answer in one short line naming what you checked and stop.
|
|
72137
|
+
|
|
72138
|
+
- ${CONTEXT_LOOKUP_RULE}`;
|
|
72072
72139
|
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.
|
|
72073
72140
|
|
|
72141
|
+
- ${CONTEXT_LOOKUP_RULE}
|
|
72142
|
+
|
|
72074
72143
|
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.`;
|
|
72075
72144
|
var JOB_RULES_DEFAULT = `You are running one pass of a recurring job card. The card body is the instruction for this run.
|
|
72076
72145
|
|
|
@@ -72078,12 +72147,13 @@ Rules:
|
|
|
72078
72147
|
- This is a job run: never create a branch, commit, push, or open a pull request.
|
|
72079
72148
|
- Work on the checked-out base branch and leave the worktree clean.
|
|
72080
72149
|
- Do not ask questions. If something is ambiguous, make the safest call and explain it in your final message.
|
|
72150
|
+
- ${CONTEXT_LOOKUP_RULE}
|
|
72081
72151
|
- Do not move the card, mark it done, or post a build reply.
|
|
72082
72152
|
- Put the run result in your final message; it is kept on the run.`;
|
|
72083
72153
|
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.
|
|
72084
72154
|
|
|
72085
72155
|
How you work:
|
|
72086
|
-
- 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.
|
|
72156
|
+
- 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. job_list lists recurring jobs and repo_list lists repository settings. Run repository commands and tests when a decision needs proof.
|
|
72087
72157
|
- 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.
|
|
72088
72158
|
- 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.
|
|
72089
72159
|
|
|
@@ -72104,28 +72174,19 @@ Autonomy:
|
|
|
72104
72174
|
- 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.
|
|
72105
72175
|
- 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.
|
|
72106
72176
|
- Keep questions in one small batch, with concrete options and one recommendation.`;
|
|
72107
|
-
var WORKSPACE_CONSULT_RULES_DEFAULT = `You are the workspace consultant
|
|
72108
|
-
|
|
72109
|
-
|
|
72110
|
-
-
|
|
72111
|
-
-
|
|
72112
|
-
-
|
|
72113
|
-
-
|
|
72114
|
-
-
|
|
72115
|
-
- Comment on any ticket, add work log entries with worklog_add, answer pending questions, and archive cards with card_delete when asked.
|
|
72116
|
-
- Attach a file or screenshot to any card with artifact_attach, then reference its artifactId from worklog_add when it is evidence.
|
|
72117
|
-
- Read and change dependencies with card_block_list, card_block_add and card_block_remove.
|
|
72118
|
-
- Ask for a human secret, access or decision with request_human_action on the card that is blocked.
|
|
72119
|
-
- Propose a spec for any card with spec_propose. A human still approves it.
|
|
72120
|
-
- 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.
|
|
72121
|
-
- 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.
|
|
72122
|
-
- Answer Aglio product questions from the aglio_docs tool. No topic returns the index; a topic id returns setup notes for workers, custom runner images, prompts, jobs, auto mode and releases. Prefer it over guessing how the product works.
|
|
72123
|
-
- Keep answers short and concrete. Use card numbers and project keys.
|
|
72177
|
+
var WORKSPACE_CONSULT_RULES_DEFAULT = `You are the workspace consultant: a full board operator and overseer with read and write access to every project and ticket in this workspace.
|
|
72178
|
+
|
|
72179
|
+
How you work:
|
|
72180
|
+
- Read before you answer. Use project_list, board_overview, card_list, card_get, card_search, project_history and card_history. Never guess about a ticket or activity you have not read.
|
|
72181
|
+
- Act with the board tools instead of describing what you would do. Create, update, assign, comment, log work, manage blocks and attach evidence with the matching tool, then say what changed.
|
|
72182
|
+
- Read code when it helps. The repositories of the card discussed in this thread are cloned under the workspace; repo_list, pr_get and your file tools cover the rest.
|
|
72183
|
+
- Use aglio_docs for how Aglio works instead of guessing. job_list lists recurring jobs and job_run triggers one; a job run opens no pull request.
|
|
72184
|
+
- Ask a human with request_human_action only for a secret, access or decision you cannot get yourself.
|
|
72124
72185
|
|
|
72125
72186
|
Limits:
|
|
72126
|
-
- Pushing code, opening pull requests and merging pull requests
|
|
72187
|
+
- Pushing code, opening pull requests and merging pull requests belong to build runs. Start one with run_start instead of trying to do that work here.
|
|
72127
72188
|
- Deleting a card archives it and its subtickets. Confirm the intent before archiving many cards at once.
|
|
72128
|
-
-
|
|
72189
|
+
- Keep answers short and concrete, with card numbers and project keys.`;
|
|
72129
72190
|
var PROMPT_KINDS = [
|
|
72130
72191
|
{
|
|
72131
72192
|
id: "build",
|
|
@@ -72150,7 +72211,7 @@ var PROMPT_KINDS = [
|
|
|
72150
72211
|
{
|
|
72151
72212
|
id: "agent",
|
|
72152
72213
|
label: "Agent chat",
|
|
72153
|
-
description: "A
|
|
72214
|
+
description: "A discussion-only card chat. It answers questions and briefs the human on the card without taking over the work."
|
|
72154
72215
|
},
|
|
72155
72216
|
{
|
|
72156
72217
|
id: "job",
|
|
@@ -72162,6 +72223,11 @@ var PROMPT_KINDS = [
|
|
|
72162
72223
|
label: "Auto mode",
|
|
72163
72224
|
description: "Oversees a goal end to end: plans tickets, merges ready pull requests, retries failures and closes the goal when it is delivered."
|
|
72164
72225
|
},
|
|
72226
|
+
{
|
|
72227
|
+
id: "review_overseer",
|
|
72228
|
+
label: "Review overseer",
|
|
72229
|
+
description: "Watches the Review column: reviews each pull request, merges ready work, sends defects back to the card and proposes separate follow-ups."
|
|
72230
|
+
},
|
|
72165
72231
|
{
|
|
72166
72232
|
id: "workspace_consult",
|
|
72167
72233
|
label: "Workspace consultant",
|
|
@@ -72189,93 +72255,87 @@ function isVerificationKind(kind) {
|
|
|
72189
72255
|
function isScreenshotKind(kind) {
|
|
72190
72256
|
return SCREENSHOT_KINDS.includes(kind);
|
|
72191
72257
|
}
|
|
72192
|
-
var
|
|
72193
|
-
|
|
72258
|
+
var PROJECT_CONTEXT_TEMPLATE = `Project: {{projectName}} ({{projectKey}})
|
|
72259
|
+
{{repositoriesSection}}{{projectConventionsSection}}`;
|
|
72260
|
+
var CARD_CONTEXT_TEMPLATE = `Card: #{{cardNumber}} {{cardTitle}} [{{cardColumn}}]
|
|
72194
72261
|
|
|
72195
72262
|
Card content:
|
|
72196
72263
|
{{cardBody}}
|
|
72197
72264
|
|
|
72198
|
-
{{
|
|
72199
|
-
var
|
|
72200
|
-
{{verificationRules}}
|
|
72265
|
+
{{subtasksSection}}{{blocksSection}}{{autoManagedSection}}`;
|
|
72266
|
+
var RUN_CONTEXT_TEMPLATE = `{{verificationRules}}
|
|
72201
72267
|
{{screenshotRules}}
|
|
72202
72268
|
{{replyStyleRules}}
|
|
72203
|
-
|
|
72269
|
+
{{projectAiSetupSection}}{{suggestedCardsSection}}{{suggestedJobsSection}}{{pullRequestsSection}}{{feedbackSection}}{{answersSection}}{{attachmentsSection}}{{environmentSection}}`;
|
|
72270
|
+
var BUILD_TEMPLATE_DEFAULT = `${BUILD_RULES_DEFAULT}
|
|
72271
|
+
${PROJECT_CONTEXT_TEMPLATE}${CARD_CONTEXT_TEMPLATE}
|
|
72272
|
+
${RUN_CONTEXT_TEMPLATE}
|
|
72204
72273
|
Your task for this run:
|
|
72205
72274
|
{{instruction}}`;
|
|
72206
72275
|
var PLANNING_TEMPLATE_DEFAULT = `${PLANNING_RULES_DEFAULT}
|
|
72207
|
-
{{replyStyleRules}}
|
|
72208
72276
|
${PLANNING_LIMITS_DEFAULT}
|
|
72209
72277
|
|
|
72210
72278
|
${PLANNING_SPEC_DEFAULT}
|
|
72211
72279
|
|
|
72280
|
+
Project: {{projectName}}
|
|
72281
|
+
{{projectConventionsSection}}Repositories:
|
|
72282
|
+
{{repositories}}
|
|
72283
|
+
|
|
72212
72284
|
Card:
|
|
72213
72285
|
#{{cardNumber}} {{cardTitle}}
|
|
72214
72286
|
{{cardBody}}
|
|
72215
72287
|
|
|
72216
72288
|
{{blocksSectionWithNone}}
|
|
72217
|
-
Project: {{projectName}}
|
|
72218
|
-
{{projectConventionsSection}}Repositories:
|
|
72219
|
-
{{repositories}}
|
|
72220
|
-
|
|
72221
72289
|
Attached files:
|
|
72222
72290
|
{{attachmentsList}}
|
|
72223
72291
|
|
|
72224
|
-
|
|
72225
|
-
{{conversationHistory}}
|
|
72226
|
-
|
|
72292
|
+
{{replyStyleRules}}
|
|
72227
72293
|
Human message:
|
|
72228
72294
|
{{instruction}}`;
|
|
72229
72295
|
var REVIEW_TEMPLATE_DEFAULT = `${REVIEW_RULES_DEFAULT}
|
|
72230
|
-
{{
|
|
72231
|
-
{
|
|
72232
|
-
${CARD_CONTEXT_TEMPLATE}
|
|
72296
|
+
${PROJECT_CONTEXT_TEMPLATE}${CARD_CONTEXT_TEMPLATE}
|
|
72297
|
+
${RUN_CONTEXT_TEMPLATE}
|
|
72233
72298
|
Review request:
|
|
72234
72299
|
{{instruction}}`;
|
|
72235
72300
|
var CONSULT_TEMPLATE_DEFAULT = `${CONSULT_RULES_DEFAULT}
|
|
72236
|
-
{{
|
|
72237
|
-
{
|
|
72238
|
-
{{screenshotRules}}
|
|
72239
|
-
${CARD_CONTEXT_TEMPLATE}
|
|
72301
|
+
${PROJECT_CONTEXT_TEMPLATE}${CARD_CONTEXT_TEMPLATE}
|
|
72302
|
+
${RUN_CONTEXT_TEMPLATE}
|
|
72240
72303
|
Human message:
|
|
72241
72304
|
{{instruction}}`;
|
|
72242
72305
|
var AGENT_TEMPLATE_DEFAULT = `${AGENT_RULES_DEFAULT}
|
|
72243
72306
|
|
|
72244
|
-
{{
|
|
72245
|
-
${
|
|
72246
|
-
Conversation so far:
|
|
72247
|
-
{{conversationHistory}}
|
|
72248
|
-
|
|
72307
|
+
${PROJECT_CONTEXT_TEMPLATE}${CARD_CONTEXT_TEMPLATE}
|
|
72308
|
+
${RUN_CONTEXT_TEMPLATE}
|
|
72249
72309
|
Human message:
|
|
72250
72310
|
{{instruction}}`;
|
|
72251
72311
|
var JOB_TEMPLATE_DEFAULT = `${JOB_RULES_DEFAULT}
|
|
72252
|
-
{{
|
|
72253
|
-
{
|
|
72254
|
-
${CARD_CONTEXT_TEMPLATE}
|
|
72312
|
+
${PROJECT_CONTEXT_TEMPLATE}${CARD_CONTEXT_TEMPLATE}
|
|
72313
|
+
${RUN_CONTEXT_TEMPLATE}
|
|
72255
72314
|
Run this job now:
|
|
72256
72315
|
{{instruction}}`;
|
|
72257
72316
|
var OVERSEER_TEMPLATE_DEFAULT = `${OVERSEER_RULES_DEFAULT}
|
|
72258
|
-
{{
|
|
72259
|
-
${
|
|
72317
|
+
${PROJECT_CONTEXT_TEMPLATE}${CARD_CONTEXT_TEMPLATE}
|
|
72318
|
+
${RUN_CONTEXT_TEMPLATE}
|
|
72260
72319
|
Goal instruction:
|
|
72261
72320
|
{{instruction}}`;
|
|
72321
|
+
var REVIEW_OVERSEER_TEMPLATE_DEFAULT = `${REVIEW_OVERSEER_RULES_DEFAULT}
|
|
72322
|
+
${PROJECT_CONTEXT_TEMPLATE}${CARD_CONTEXT_TEMPLATE}
|
|
72323
|
+
${RUN_CONTEXT_TEMPLATE}
|
|
72324
|
+
Review pass instruction:
|
|
72325
|
+
{{instruction}}`;
|
|
72262
72326
|
var WORKSPACE_CONSULT_TEMPLATE_DEFAULT = `${WORKSPACE_CONSULT_RULES_DEFAULT}
|
|
72263
|
-
{{replyStyleRules}}
|
|
72264
72327
|
Workspace: {{workspaceName}}
|
|
72265
72328
|
Projects:
|
|
72266
72329
|
{{workspaceProjects}}
|
|
72267
72330
|
|
|
72268
|
-
Code repositories (read-only, from the latest card mentioned in this thread):
|
|
72269
|
-
{{repositories}}
|
|
72270
|
-
|
|
72271
72331
|
{{selectedCard}}
|
|
72272
72332
|
|
|
72333
|
+
Code repositories (read-only, scoped to the selected card):
|
|
72334
|
+
{{repositories}}
|
|
72335
|
+
|
|
72273
72336
|
Attached files for this thread:
|
|
72274
72337
|
{{attachmentsList}}
|
|
72275
72338
|
|
|
72276
|
-
Conversation so far:
|
|
72277
|
-
{{conversationHistory}}
|
|
72278
|
-
|
|
72279
72339
|
Human message:
|
|
72280
72340
|
{{instruction}}`;
|
|
72281
72341
|
function fillTemplate(text, vars) {
|
|
@@ -72297,6 +72357,7 @@ var TEMPLATE_DEFAULTS = {
|
|
|
72297
72357
|
agent: AGENT_TEMPLATE_DEFAULT,
|
|
72298
72358
|
job: JOB_TEMPLATE_DEFAULT,
|
|
72299
72359
|
overseer: OVERSEER_TEMPLATE_DEFAULT,
|
|
72360
|
+
review_overseer: REVIEW_OVERSEER_TEMPLATE_DEFAULT,
|
|
72300
72361
|
workspace_consult: WORKSPACE_CONSULT_TEMPLATE_DEFAULT
|
|
72301
72362
|
};
|
|
72302
72363
|
var TEMPLATE_DESCRIPTIONS = {
|
|
@@ -72307,6 +72368,7 @@ var TEMPLATE_DESCRIPTIONS = {
|
|
|
72307
72368
|
agent: "The full card-chat prompt, including the conversation and card context.",
|
|
72308
72369
|
job: "The full recurring job prompt, including the job limits and card context.",
|
|
72309
72370
|
overseer: "The full auto mode prompt, including planning, delivery and autonomy rules.",
|
|
72371
|
+
review_overseer: "The full review column prompt: review each pull request, merge ready work and send defects back.",
|
|
72310
72372
|
workspace_consult: "The full workspace consultant prompt, including projects, code access and the selected card."
|
|
72311
72373
|
};
|
|
72312
72374
|
function chunksForKind(kind) {
|
|
@@ -72365,6 +72427,10 @@ var PROJECT_PROMPT_KINDS = PROMPT_KINDS.map((kind) => kind.id).filter(
|
|
|
72365
72427
|
(kind) => kind !== "workspace_consult"
|
|
72366
72428
|
);
|
|
72367
72429
|
var PROMPT_CHUNK_BY_ID = new Map(PROMPT_CHUNKS.map((chunk) => [chunk.id, chunk]));
|
|
72430
|
+
var SHARED_RUN_CONTEXT_TOKENS = Array.from(
|
|
72431
|
+
RUN_CONTEXT_TEMPLATE.matchAll(/\{\{\w+\}\}/g),
|
|
72432
|
+
(match) => match[0]
|
|
72433
|
+
);
|
|
72368
72434
|
|
|
72369
72435
|
// ../../packages/shared/src/theme.ts
|
|
72370
72436
|
var THEME_ACCENT_IDS = ["default", "violet", "emerald", "amber", "rose"];
|
|
@@ -72428,6 +72494,7 @@ var PROJECT_AI_SETUP_TOOLS = [
|
|
|
72428
72494
|
];
|
|
72429
72495
|
var REMOTE_RUN_TOOLS = [
|
|
72430
72496
|
"card_get",
|
|
72497
|
+
"conversation_history",
|
|
72431
72498
|
"repo_list",
|
|
72432
72499
|
"pr_get",
|
|
72433
72500
|
"comment_add",
|
|
@@ -72441,6 +72508,7 @@ var REMOTE_RUN_TOOLS = [
|
|
|
72441
72508
|
"card_block_remove",
|
|
72442
72509
|
"job_list",
|
|
72443
72510
|
"job_run",
|
|
72511
|
+
"proposal_list",
|
|
72444
72512
|
"card_propose",
|
|
72445
72513
|
"job_propose",
|
|
72446
72514
|
"spec_propose",
|
|
@@ -72449,7 +72517,8 @@ var REMOTE_RUN_TOOLS = [
|
|
|
72449
72517
|
"pr_open",
|
|
72450
72518
|
"pr_merge",
|
|
72451
72519
|
"card_retry",
|
|
72452
|
-
"request_human_action"
|
|
72520
|
+
"request_human_action",
|
|
72521
|
+
"project_runner_image_set"
|
|
72453
72522
|
];
|
|
72454
72523
|
|
|
72455
72524
|
// ../../packages/shared/src/retention.ts
|
|
@@ -72635,28 +72704,102 @@ var inFlight = /* @__PURE__ */ new Map();
|
|
|
72635
72704
|
async function waitForImagePulls() {
|
|
72636
72705
|
await Promise.allSettled([...inFlight.values()]);
|
|
72637
72706
|
}
|
|
72638
|
-
|
|
72707
|
+
var PLATFORM_MISMATCH = /no matching manifest|does not match the specified platform|no matching entries in manifest/i;
|
|
72708
|
+
function pullStreamError(line) {
|
|
72709
|
+
try {
|
|
72710
|
+
const parsed = JSON.parse(line);
|
|
72711
|
+
if (typeof parsed.errorDetail?.message === "string" && parsed.errorDetail.message) {
|
|
72712
|
+
return parsed.errorDetail.message;
|
|
72713
|
+
}
|
|
72714
|
+
if (typeof parsed.error === "string" && parsed.error) return parsed.error;
|
|
72715
|
+
} catch {
|
|
72716
|
+
}
|
|
72717
|
+
return null;
|
|
72718
|
+
}
|
|
72719
|
+
function readPullStream(stream) {
|
|
72720
|
+
return new Promise((resolve7, reject) => {
|
|
72721
|
+
let settled = false;
|
|
72722
|
+
let buffer3 = "";
|
|
72723
|
+
const fail2 = (error63) => {
|
|
72724
|
+
if (settled) return;
|
|
72725
|
+
settled = true;
|
|
72726
|
+
reject(error63);
|
|
72727
|
+
};
|
|
72728
|
+
const readLine = (line) => {
|
|
72729
|
+
if (settled || !line.trim()) return;
|
|
72730
|
+
const message = pullStreamError(line);
|
|
72731
|
+
if (message) fail2(new Error(message));
|
|
72732
|
+
};
|
|
72733
|
+
stream.on("data", (chunk) => {
|
|
72734
|
+
buffer3 += chunk.toString();
|
|
72735
|
+
let newline = buffer3.indexOf("\n");
|
|
72736
|
+
while (!settled && newline >= 0) {
|
|
72737
|
+
readLine(buffer3.slice(0, newline));
|
|
72738
|
+
buffer3 = buffer3.slice(newline + 1);
|
|
72739
|
+
newline = buffer3.indexOf("\n");
|
|
72740
|
+
}
|
|
72741
|
+
});
|
|
72742
|
+
stream.on("end", () => {
|
|
72743
|
+
readLine(buffer3);
|
|
72744
|
+
if (!settled) {
|
|
72745
|
+
settled = true;
|
|
72746
|
+
resolve7();
|
|
72747
|
+
}
|
|
72748
|
+
});
|
|
72749
|
+
stream.on("error", (error63) => fail2(error63));
|
|
72750
|
+
});
|
|
72751
|
+
}
|
|
72752
|
+
async function pullOnce(client, image, platform2) {
|
|
72753
|
+
const stream = await client.pull(image, {
|
|
72754
|
+
authconfig: dockerAuthFor(image),
|
|
72755
|
+
...platform2 ? { platform: platform2 } : {}
|
|
72756
|
+
});
|
|
72757
|
+
await readPullStream(stream);
|
|
72758
|
+
}
|
|
72759
|
+
function abortable(work, signal) {
|
|
72760
|
+
if (!signal) return work;
|
|
72761
|
+
if (signal.aborted) return Promise.reject(new Error("Runner image pull cancelled"));
|
|
72762
|
+
return new Promise((resolve7, reject) => {
|
|
72763
|
+
const onAbort = () => reject(new Error("Runner image pull cancelled"));
|
|
72764
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
72765
|
+
work.then(
|
|
72766
|
+
(value) => {
|
|
72767
|
+
signal.removeEventListener("abort", onAbort);
|
|
72768
|
+
resolve7(value);
|
|
72769
|
+
},
|
|
72770
|
+
(error63) => {
|
|
72771
|
+
signal.removeEventListener("abort", onAbort);
|
|
72772
|
+
reject(error63);
|
|
72773
|
+
}
|
|
72774
|
+
);
|
|
72775
|
+
});
|
|
72776
|
+
}
|
|
72777
|
+
async function pullDockerImage(client, image, options = {}) {
|
|
72639
72778
|
if (!isRegistryImage(image)) {
|
|
72640
72779
|
throw new Error(
|
|
72641
72780
|
`Runner image ${image} is not registry-qualified. Build it with: pnpm runner:build`
|
|
72642
72781
|
);
|
|
72643
72782
|
}
|
|
72644
72783
|
const existing = inFlight.get(image);
|
|
72645
|
-
if (existing) return existing;
|
|
72784
|
+
if (existing) return abortable(existing, options.signal);
|
|
72646
72785
|
const pull = (async () => {
|
|
72647
|
-
|
|
72648
|
-
|
|
72649
|
-
|
|
72650
|
-
|
|
72651
|
-
|
|
72652
|
-
|
|
72786
|
+
try {
|
|
72787
|
+
await pullOnce(client, image);
|
|
72788
|
+
} catch (error63) {
|
|
72789
|
+
const reason = error63 instanceof Error ? error63.message : String(error63);
|
|
72790
|
+
if (!PLATFORM_MISMATCH.test(reason)) throw error63;
|
|
72791
|
+
options.log?.("runner image has no native build, retrying as amd64", {
|
|
72792
|
+
image,
|
|
72793
|
+
reason
|
|
72794
|
+
});
|
|
72795
|
+
await pullOnce(client, image, "linux/amd64");
|
|
72796
|
+
}
|
|
72653
72797
|
})();
|
|
72654
72798
|
inFlight.set(image, pull);
|
|
72655
|
-
|
|
72656
|
-
|
|
72657
|
-
}
|
|
72658
|
-
|
|
72659
|
-
}
|
|
72799
|
+
void pull.finally(() => {
|
|
72800
|
+
if (inFlight.get(image) === pull) inFlight.delete(image);
|
|
72801
|
+
}).catch(() => void 0);
|
|
72802
|
+
await abortable(pull, options.signal);
|
|
72660
72803
|
}
|
|
72661
72804
|
async function ensureDockerImage(input2) {
|
|
72662
72805
|
try {
|
|
@@ -72671,8 +72814,12 @@ async function ensureDockerImage(input2) {
|
|
|
72671
72814
|
}
|
|
72672
72815
|
input2.log?.("runner image missing, pulling", { image: input2.image });
|
|
72673
72816
|
try {
|
|
72674
|
-
await pullDockerImage(input2.client, input2.image
|
|
72817
|
+
await pullDockerImage(input2.client, input2.image, {
|
|
72818
|
+
log: input2.log,
|
|
72819
|
+
signal: input2.signal
|
|
72820
|
+
});
|
|
72675
72821
|
} catch (error63) {
|
|
72822
|
+
if (input2.signal?.aborted) throw error63;
|
|
72676
72823
|
const reason = error63 instanceof Error ? error63.message : String(error63);
|
|
72677
72824
|
throw new Error(
|
|
72678
72825
|
`Runner image ${input2.image} not found and could not be pulled: ${reason}. Check registry access or docker login, then retry: docker pull ${input2.image}`
|
|
@@ -72789,6 +72936,47 @@ function agentHostResources(resources) {
|
|
|
72789
72936
|
return { Memory: resources.memoryBytes, NanoCpus: resources.nanoCpus };
|
|
72790
72937
|
}
|
|
72791
72938
|
|
|
72939
|
+
// src/runner-cache.ts
|
|
72940
|
+
var RUNNER_CACHE_ENTRIES = [
|
|
72941
|
+
{ id: "npm", containerPath: "/root/.npm", description: "npm and Yarn classic metadata" },
|
|
72942
|
+
{ id: "pnpm", containerPath: "/root/.local/share/pnpm/store", description: "pnpm content-addressable store" },
|
|
72943
|
+
{ id: "yarn", containerPath: "/root/.yarn/berry/cache", description: "Yarn Berry cache" },
|
|
72944
|
+
{ id: "bun", containerPath: "/root/.bun/install/cache", description: "Bun install cache" },
|
|
72945
|
+
{ id: "pip", containerPath: "/root/.cache/pip", description: "pip wheel and HTTP cache" },
|
|
72946
|
+
{ id: "uv", containerPath: "/root/.cache/uv", description: "uv cache" },
|
|
72947
|
+
{ id: "cargo-registry", containerPath: "/root/.cargo/registry", description: "Cargo crate registry" },
|
|
72948
|
+
{ id: "cargo-git", containerPath: "/root/.cargo/git", description: "Cargo git checkouts" },
|
|
72949
|
+
{ id: "go-mod", containerPath: "/root/go/pkg/mod", description: "Go module cache" },
|
|
72950
|
+
{ id: "go-build", containerPath: "/root/.cache/go-build", description: "Go build cache" },
|
|
72951
|
+
{ id: "composer", containerPath: "/root/.cache/composer", description: "Composer package cache" },
|
|
72952
|
+
{ id: "maven", containerPath: "/root/.m2/repository", description: "Maven local repository" },
|
|
72953
|
+
{ id: "gradle", containerPath: "/root/.gradle/caches", description: "Gradle dependency cache" },
|
|
72954
|
+
// Browser builds are directory-per-revision, so two jobs running different
|
|
72955
|
+
// Playwright versions on this host never write the same files.
|
|
72956
|
+
{ id: "playwright", containerPath: "/root/.cache/ms-playwright", description: "Playwright browser builds" }
|
|
72957
|
+
// apt is not cached: its archive lock file sits inside the directory, so two
|
|
72958
|
+
// concurrent jobs sharing it fail with "Could not get lock", and a killed
|
|
72959
|
+
// job leaves the lock behind for the next one.
|
|
72960
|
+
];
|
|
72961
|
+
var RUNNER_CACHE_VOLUME_PREFIX = "aglio-runner-cache-";
|
|
72962
|
+
function runnerCacheEnabled(env = process.env) {
|
|
72963
|
+
const raw = env.AGLIO_WORKER_CACHE?.trim().toLowerCase();
|
|
72964
|
+
if (!raw) return true;
|
|
72965
|
+
return !["0", "false", "off", "no", "disabled"].includes(raw);
|
|
72966
|
+
}
|
|
72967
|
+
function runnerCacheVolumeName(id) {
|
|
72968
|
+
return `${RUNNER_CACHE_VOLUME_PREFIX}${id}`;
|
|
72969
|
+
}
|
|
72970
|
+
function runnerCacheBinds(env = process.env) {
|
|
72971
|
+
if (!runnerCacheEnabled(env)) return [];
|
|
72972
|
+
return RUNNER_CACHE_ENTRIES.map(
|
|
72973
|
+
(entry) => `${runnerCacheVolumeName(entry.id)}:${entry.containerPath}`
|
|
72974
|
+
);
|
|
72975
|
+
}
|
|
72976
|
+
function describeRunnerCache(binds) {
|
|
72977
|
+
return binds.length > 0 ? `${binds.length} shared package caches (disable with AGLIO_WORKER_CACHE=off)` : "off (AGLIO_WORKER_CACHE)";
|
|
72978
|
+
}
|
|
72979
|
+
|
|
72792
72980
|
// src/remote-docker.ts
|
|
72793
72981
|
async function resolveRemoteAgentResources(client, log, overrides = readAgentResourceOverrides()) {
|
|
72794
72982
|
const needsDetection = overrides.cpu == null || overrides.memory == null;
|
|
@@ -72875,7 +73063,13 @@ function remoteDockerClient(socketPath) {
|
|
|
72875
73063
|
}
|
|
72876
73064
|
async function createDockerJobExecutor(input2) {
|
|
72877
73065
|
const client = input2.client ?? remoteDockerClient(input2.socketPath ?? "/var/run/docker.sock");
|
|
72878
|
-
await ensureDockerImage({
|
|
73066
|
+
await ensureDockerImage({
|
|
73067
|
+
client,
|
|
73068
|
+
image: input2.image,
|
|
73069
|
+
signal: input2.signal,
|
|
73070
|
+
log: input2.log
|
|
73071
|
+
});
|
|
73072
|
+
if (input2.signal?.aborted) throw new Error("Job cancelled before the runner container started");
|
|
72879
73073
|
const { hostPath } = mapDockerWorkspace({
|
|
72880
73074
|
workspaceRoot: input2.workspaceRoot,
|
|
72881
73075
|
hostWorkspaceRoot: input2.hostWorkspaceRoot,
|
|
@@ -72899,8 +73093,9 @@ async function createDockerJobExecutor(input2) {
|
|
|
72899
73093
|
}
|
|
72900
73094
|
const networkMode = input2.networkMode?.trim() || "bridge";
|
|
72901
73095
|
const resources = input2.resources ?? await resolveRemoteAgentResources(client, input2.log);
|
|
73096
|
+
const cacheBinds = input2.cacheBinds ?? runnerCacheBinds();
|
|
72902
73097
|
const hostConfig = {
|
|
72903
|
-
Binds: [`${hostPath}:${CONTAINER_WORKSPACE}
|
|
73098
|
+
Binds: [`${hostPath}:${CONTAINER_WORKSPACE}`, ...cacheBinds],
|
|
72904
73099
|
NetworkMode: networkMode,
|
|
72905
73100
|
...agentHostResources(resources),
|
|
72906
73101
|
PidsLimit: 1024,
|
|
@@ -72927,7 +73122,8 @@ async function createDockerJobExecutor(input2) {
|
|
|
72927
73122
|
jobId: input2.jobId,
|
|
72928
73123
|
image: input2.image,
|
|
72929
73124
|
name: name2,
|
|
72930
|
-
networkMode
|
|
73125
|
+
networkMode,
|
|
73126
|
+
cacheVolumes: cacheBinds.length
|
|
72931
73127
|
});
|
|
72932
73128
|
const runCommand = async (command) => {
|
|
72933
73129
|
if (command.signal?.aborted) return 130;
|
|
@@ -72993,7 +73189,7 @@ async function prefetchRunnerImage(input2) {
|
|
|
72993
73189
|
const client = input2.client ?? remoteDockerClient(input2.socketPath ?? "/var/run/docker.sock");
|
|
72994
73190
|
try {
|
|
72995
73191
|
if (isRegistryImage(input2.image) && input2.refresh !== false) {
|
|
72996
|
-
await pullDockerImage(client, input2.image);
|
|
73192
|
+
await pullDockerImage(client, input2.image, { log: input2.log });
|
|
72997
73193
|
input2.log?.("runner image refreshed", { image: input2.image });
|
|
72998
73194
|
return true;
|
|
72999
73195
|
}
|
|
@@ -73717,8 +73913,12 @@ async function executeRemoteJob(job, deps) {
|
|
|
73717
73913
|
const leaseAbort = new AbortController();
|
|
73718
73914
|
const leaseTimer = setInterval(
|
|
73719
73915
|
() => {
|
|
73916
|
+
if (cancelRequested || leaseLost) {
|
|
73917
|
+
clearInterval(leaseTimer);
|
|
73918
|
+
return;
|
|
73919
|
+
}
|
|
73720
73920
|
void deps.api.heartbeatLease({ jobId: job.id, leaseId: job.lease.id, token: job.lease.token }).then((result) => {
|
|
73721
|
-
if (result && result.cancelled) {
|
|
73921
|
+
if (result && result.cancelled && !cancelRequested) {
|
|
73722
73922
|
cancelRequested = true;
|
|
73723
73923
|
leaseAbort.abort();
|
|
73724
73924
|
log("cancel requested", { jobId: job.id });
|
|
@@ -73740,6 +73940,12 @@ async function executeRemoteJob(job, deps) {
|
|
|
73740
73940
|
try {
|
|
73741
73941
|
write(`[aglio] job ${job.type} ${job.id} attempt ${job.attempts}
|
|
73742
73942
|
`);
|
|
73943
|
+
if (job.runnerImage) {
|
|
73944
|
+
write(
|
|
73945
|
+
`[aglio] runner image: ${job.runnerImage} (${job.runnerImageCustom ? "custom" : "stock"})
|
|
73946
|
+
`
|
|
73947
|
+
);
|
|
73948
|
+
}
|
|
73743
73949
|
if (job.instructions?.trim()) {
|
|
73744
73950
|
write(`[aglio] worker instructions:
|
|
73745
73951
|
${job.instructions.trim()}
|
|
@@ -73760,7 +73966,7 @@ ${job.instructions.trim()}
|
|
|
73760
73966
|
}
|
|
73761
73967
|
if (deps.createExecutor) {
|
|
73762
73968
|
try {
|
|
73763
|
-
executor = await deps.createExecutor({ job, workspace });
|
|
73969
|
+
executor = await deps.createExecutor({ job, workspace, signal: leaseAbort.signal });
|
|
73764
73970
|
} catch (error63) {
|
|
73765
73971
|
write(`[aglio] executor failed: ${errorText(error63)}
|
|
73766
73972
|
`);
|
|
@@ -73834,6 +74040,10 @@ $ ${step.command}
|
|
|
73834
74040
|
if (error63 instanceof JobLeaseLostError || leaseLost) {
|
|
73835
74041
|
throw new JobLeaseLostError(errorText(error63));
|
|
73836
74042
|
}
|
|
74043
|
+
if (cancelRequested) {
|
|
74044
|
+
await finish(deps, job, "cancelled", "Cancelled from the board").catch(() => void 0);
|
|
74045
|
+
return "cancelled";
|
|
74046
|
+
}
|
|
73837
74047
|
if (error63 instanceof JobAbortedError || deps.signal?.aborted) throw new JobAbortedError();
|
|
73838
74048
|
await finish(deps, job, "failed", errorText(error63)).catch(() => void 0);
|
|
73839
74049
|
return "failed";
|
|
@@ -74033,7 +74243,6 @@ var CLAUDE_EFFORTS = ["low", "medium", "high", "xhigh", "max"];
|
|
|
74033
74243
|
var CODEX_EFFORTS = ["minimal", "low", "medium", "high", "xhigh", "max"];
|
|
74034
74244
|
var OPENCODE_VARIANTS = ["minimal", "low", "medium", "high", "max"];
|
|
74035
74245
|
var ANTIGRAVITY_EFFORTS = ["low", "medium", "high", "xhigh", "max"];
|
|
74036
|
-
var HERMES_EFFORTS = ["off", "minimal", "low", "medium", "high", "xhigh", "max"];
|
|
74037
74246
|
function driverThinkingArgs(driver, thinking) {
|
|
74038
74247
|
if (!thinking) return [];
|
|
74039
74248
|
if (driver === "pi") return ["--thinking", thinking];
|
|
@@ -74049,21 +74258,12 @@ function driverThinkingArgs(driver, thinking) {
|
|
|
74049
74258
|
if (driver === "antigravity") {
|
|
74050
74259
|
return ANTIGRAVITY_EFFORTS.includes(thinking) ? ["--effort", thinking] : [];
|
|
74051
74260
|
}
|
|
74052
|
-
if (driver === "hermes") {
|
|
74053
|
-
return HERMES_EFFORTS.includes(thinking) ? ["--reasoning", thinking === "off" ? "none" : thinking] : [];
|
|
74054
|
-
}
|
|
74055
74261
|
return [];
|
|
74056
74262
|
}
|
|
74057
|
-
function hermesProvider(provider) {
|
|
74058
|
-
const normalized = provider.toLowerCase();
|
|
74059
|
-
if (normalized === "openai") return "openai-api";
|
|
74060
|
-
if (normalized === "google") return "gemini";
|
|
74061
|
-
return normalized;
|
|
74062
|
-
}
|
|
74063
74263
|
function buildDriverCommand(input2) {
|
|
74064
74264
|
const prompt = withSystemPrompt(input2.prompt, input2.systemPromptAppend);
|
|
74065
74265
|
if (input2.driver === "pi") {
|
|
74066
|
-
const
|
|
74266
|
+
const args = [
|
|
74067
74267
|
"pi",
|
|
74068
74268
|
"--print",
|
|
74069
74269
|
"--mode",
|
|
@@ -74074,19 +74274,19 @@ function buildDriverCommand(input2) {
|
|
|
74074
74274
|
"--model",
|
|
74075
74275
|
input2.model
|
|
74076
74276
|
];
|
|
74077
|
-
|
|
74078
|
-
if (input2.tools && input2.tools.length > 0)
|
|
74079
|
-
if (input2.systemPromptAppend)
|
|
74277
|
+
args.push(...driverThinkingArgs("pi", input2.thinking));
|
|
74278
|
+
if (input2.tools && input2.tools.length > 0) args.push("--tools", input2.tools.join(","));
|
|
74279
|
+
if (input2.systemPromptAppend) args.push("--append-system-prompt", input2.systemPromptAppend);
|
|
74080
74280
|
if (input2.resume && input2.sessionId) {
|
|
74081
|
-
|
|
74281
|
+
args.push("--fork", input2.sessionId);
|
|
74082
74282
|
} else if (input2.sessionId) {
|
|
74083
|
-
|
|
74283
|
+
args.push("--session-id", input2.sessionId);
|
|
74084
74284
|
}
|
|
74085
|
-
|
|
74086
|
-
return
|
|
74285
|
+
args.push(input2.prompt);
|
|
74286
|
+
return args;
|
|
74087
74287
|
}
|
|
74088
74288
|
if (input2.driver === "claude") {
|
|
74089
|
-
const
|
|
74289
|
+
const args = [
|
|
74090
74290
|
"claude",
|
|
74091
74291
|
"-p",
|
|
74092
74292
|
"--output-format",
|
|
@@ -74099,28 +74299,28 @@ function buildDriverCommand(input2) {
|
|
|
74099
74299
|
input2.mcpConfigPath,
|
|
74100
74300
|
"--strict-mcp-config"
|
|
74101
74301
|
];
|
|
74102
|
-
|
|
74103
|
-
if (input2.systemPromptAppend)
|
|
74302
|
+
args.push(...driverThinkingArgs("claude", input2.thinking));
|
|
74303
|
+
if (input2.systemPromptAppend) args.push("--append-system-prompt", input2.systemPromptAppend);
|
|
74104
74304
|
if (input2.resume && input2.sessionId) {
|
|
74105
|
-
|
|
74305
|
+
args.push("--resume", input2.sessionId);
|
|
74106
74306
|
} else if (input2.sessionId) {
|
|
74107
|
-
|
|
74307
|
+
args.push("--session-id", input2.sessionId);
|
|
74108
74308
|
}
|
|
74109
|
-
|
|
74110
|
-
return
|
|
74309
|
+
args.push(input2.prompt);
|
|
74310
|
+
return args;
|
|
74111
74311
|
}
|
|
74112
74312
|
if (input2.driver === "codex") {
|
|
74113
|
-
const
|
|
74114
|
-
if (input2.resume && input2.sessionId)
|
|
74115
|
-
|
|
74116
|
-
|
|
74117
|
-
if (input2.workingDirectory)
|
|
74118
|
-
|
|
74119
|
-
|
|
74120
|
-
return
|
|
74313
|
+
const args = ["codex", "exec"];
|
|
74314
|
+
if (input2.resume && input2.sessionId) args.push("resume", input2.sessionId);
|
|
74315
|
+
args.push("--json", "--dangerously-bypass-approvals-and-sandbox", "--skip-git-repo-check");
|
|
74316
|
+
args.push(...driverThinkingArgs("codex", input2.thinking));
|
|
74317
|
+
if (input2.workingDirectory) args.push("-C", input2.workingDirectory);
|
|
74318
|
+
args.push("-m", input2.model);
|
|
74319
|
+
args.push(prompt);
|
|
74320
|
+
return args;
|
|
74121
74321
|
}
|
|
74122
74322
|
if (input2.driver === "cursor") {
|
|
74123
|
-
const
|
|
74323
|
+
const args = [
|
|
74124
74324
|
"cursor-agent",
|
|
74125
74325
|
"-p",
|
|
74126
74326
|
prompt,
|
|
@@ -74132,12 +74332,12 @@ function buildDriverCommand(input2) {
|
|
|
74132
74332
|
"--model",
|
|
74133
74333
|
input2.model
|
|
74134
74334
|
];
|
|
74135
|
-
if (input2.workingDirectory)
|
|
74136
|
-
if (input2.resume && input2.sessionId)
|
|
74137
|
-
return
|
|
74335
|
+
if (input2.workingDirectory) args.push("--workspace", input2.workingDirectory);
|
|
74336
|
+
if (input2.resume && input2.sessionId) args.push("--resume", input2.sessionId);
|
|
74337
|
+
return args;
|
|
74138
74338
|
}
|
|
74139
74339
|
if (input2.driver === "antigravity") {
|
|
74140
|
-
const
|
|
74340
|
+
const args = [
|
|
74141
74341
|
"agy",
|
|
74142
74342
|
"-p",
|
|
74143
74343
|
prompt,
|
|
@@ -74151,37 +74351,20 @@ function buildDriverCommand(input2) {
|
|
|
74151
74351
|
JSON.stringify({ modelProvider: "gemini" })
|
|
74152
74352
|
];
|
|
74153
74353
|
if (!/-(low|medium|high|xhigh|max)$/.test(input2.model)) {
|
|
74154
|
-
|
|
74155
|
-
}
|
|
74156
|
-
if (input2.workingDirectory)
|
|
74157
|
-
if (input2.resume && input2.sessionId)
|
|
74158
|
-
return
|
|
74159
|
-
}
|
|
74160
|
-
if (input2.driver === "
|
|
74161
|
-
const
|
|
74162
|
-
|
|
74163
|
-
|
|
74164
|
-
|
|
74165
|
-
|
|
74166
|
-
|
|
74167
|
-
|
|
74168
|
-
"stream-json",
|
|
74169
|
-
"--yolo",
|
|
74170
|
-
"--provider",
|
|
74171
|
-
hermesProvider(input2.provider),
|
|
74172
|
-
"--model",
|
|
74173
|
-
input2.model
|
|
74174
|
-
];
|
|
74175
|
-
args2.push(...driverThinkingArgs("hermes", input2.thinking));
|
|
74176
|
-
if (input2.workingDirectory) args2.push("--in", input2.workingDirectory);
|
|
74177
|
-
if (input2.resume && input2.sessionId) args2.push("--resume", input2.sessionId);
|
|
74178
|
-
return args2;
|
|
74179
|
-
}
|
|
74180
|
-
const args = ["opencode", "run", prompt, "--format", "json", "--auto", "-m", input2.model];
|
|
74181
|
-
args.push(...driverThinkingArgs("opencode", input2.thinking));
|
|
74182
|
-
if (input2.workingDirectory) args.push("--dir", input2.workingDirectory);
|
|
74183
|
-
if (input2.resume && input2.sessionId) args.push("--session", input2.sessionId);
|
|
74184
|
-
return args;
|
|
74354
|
+
args.push(...driverThinkingArgs("antigravity", input2.thinking));
|
|
74355
|
+
}
|
|
74356
|
+
if (input2.workingDirectory) args.push("--add-dir", input2.workingDirectory);
|
|
74357
|
+
if (input2.resume && input2.sessionId) args.push("--conversation", input2.sessionId);
|
|
74358
|
+
return args;
|
|
74359
|
+
}
|
|
74360
|
+
if (input2.driver === "opencode") {
|
|
74361
|
+
const args = ["opencode", "run", prompt, "--format", "json", "--auto", "-m", input2.model];
|
|
74362
|
+
args.push(...driverThinkingArgs("opencode", input2.thinking));
|
|
74363
|
+
if (input2.workingDirectory) args.push("--dir", input2.workingDirectory);
|
|
74364
|
+
if (input2.resume && input2.sessionId) args.push("--session", input2.sessionId);
|
|
74365
|
+
return args;
|
|
74366
|
+
}
|
|
74367
|
+
throw new Error(`Unsupported agent driver: ${input2.driver}`);
|
|
74185
74368
|
}
|
|
74186
74369
|
function agentHomeEnv(driver, toolDir) {
|
|
74187
74370
|
const home = `${toolDir}/home`;
|
|
@@ -74199,9 +74382,6 @@ function agentHomeEnv(driver, toolDir) {
|
|
|
74199
74382
|
if (driver === "antigravity") {
|
|
74200
74383
|
return { HOME: home, AGY_CLI_DISABLE_AUTO_UPDATE: "true" };
|
|
74201
74384
|
}
|
|
74202
|
-
if (driver === "hermes") {
|
|
74203
|
-
return { HOME: home, HERMES_HOME: toolDir, HERMES_CONFIG_BACKEND: "file" };
|
|
74204
|
-
}
|
|
74205
74385
|
return { HOME: home };
|
|
74206
74386
|
}
|
|
74207
74387
|
function mcpConfigRelativePath(driver) {
|
|
@@ -74209,7 +74389,6 @@ function mcpConfigRelativePath(driver) {
|
|
|
74209
74389
|
if (driver === "cursor") return "home/.cursor/mcp.json";
|
|
74210
74390
|
if (driver === "opencode") return "home/.config/opencode/opencode.json";
|
|
74211
74391
|
if (driver === "antigravity") return "home/.gemini/config/mcp_config.json";
|
|
74212
|
-
if (driver === "hermes") return "config.yaml";
|
|
74213
74392
|
return null;
|
|
74214
74393
|
}
|
|
74215
74394
|
function mcpConfigFor(driver, url2, token3, extraServers = []) {
|
|
@@ -74247,18 +74426,6 @@ function mcpConfigFor(driver, url2, token3, extraServers = []) {
|
|
|
74247
74426
|
for (const server of extraServers) servers[server.name] = extraMcpConfig(driver, server);
|
|
74248
74427
|
return JSON.stringify({ mcpServers: servers }, null, 2);
|
|
74249
74428
|
}
|
|
74250
|
-
if (driver === "hermes") {
|
|
74251
|
-
const servers = {
|
|
74252
|
-
aglio: {
|
|
74253
|
-
url: url2,
|
|
74254
|
-
headers: { Authorization: `Bearer ${token3}` },
|
|
74255
|
-
timeout: 300,
|
|
74256
|
-
trust: "full"
|
|
74257
|
-
}
|
|
74258
|
-
};
|
|
74259
|
-
for (const server of extraServers) servers[server.name] = extraMcpConfig(driver, server);
|
|
74260
|
-
return JSON.stringify({ mcp_servers: servers }, null, 2);
|
|
74261
|
-
}
|
|
74262
74429
|
if (driver === "opencode") {
|
|
74263
74430
|
const servers = {
|
|
74264
74431
|
aglio: {
|
|
@@ -74289,7 +74456,6 @@ function extraMcpConfig(driver, server) {
|
|
|
74289
74456
|
if (driver === "antigravity") {
|
|
74290
74457
|
return { serverUrl: server.url, headers, timeoutSeconds: 300 };
|
|
74291
74458
|
}
|
|
74292
|
-
if (driver === "hermes") return { url: server.url, headers, timeout: 300, trust: "full" };
|
|
74293
74459
|
return { type: "remote", url: server.url, headers, enabled: true };
|
|
74294
74460
|
}
|
|
74295
74461
|
function codexBearerToken(server) {
|
|
@@ -74908,64 +75074,6 @@ function parseAntigravityLine(raw) {
|
|
|
74908
75074
|
}
|
|
74909
75075
|
return { type: event, at: at3 };
|
|
74910
75076
|
}
|
|
74911
|
-
function parseHermesLine(raw) {
|
|
74912
|
-
const type = String(raw.type ?? "");
|
|
74913
|
-
const at3 = timestampOf(raw.timestamp);
|
|
74914
|
-
if (type === "system") {
|
|
74915
|
-
return { type, sessionId: raw.session_id ? String(raw.session_id) : void 0, at: at3 };
|
|
74916
|
-
}
|
|
74917
|
-
if (type === "text") {
|
|
74918
|
-
const text = typeof raw.text === "string" ? raw.text : void 0;
|
|
74919
|
-
return { type, assistantText: text || void 0, assistantDelta: true, at: at3 };
|
|
74920
|
-
}
|
|
74921
|
-
if (type === "tool_use") {
|
|
74922
|
-
return {
|
|
74923
|
-
type,
|
|
74924
|
-
toolName: typeof raw.name === "string" ? raw.name : "tool",
|
|
74925
|
-
toolArgs: raw.input,
|
|
74926
|
-
toolCallId: toolCallIdOf(raw),
|
|
74927
|
-
toolStart: true,
|
|
74928
|
-
toolPartial: false,
|
|
74929
|
-
at: at3
|
|
74930
|
-
};
|
|
74931
|
-
}
|
|
74932
|
-
if (type === "tool_result") {
|
|
74933
|
-
return {
|
|
74934
|
-
type,
|
|
74935
|
-
toolName: typeof raw.name === "string" ? raw.name : void 0,
|
|
74936
|
-
toolResult: raw,
|
|
74937
|
-
detail: toolDetailText(raw.output),
|
|
74938
|
-
toolCallId: toolCallIdOf(raw),
|
|
74939
|
-
toolStart: false,
|
|
74940
|
-
toolPartial: false,
|
|
74941
|
-
at: at3
|
|
74942
|
-
};
|
|
74943
|
-
}
|
|
74944
|
-
if (type === "result") {
|
|
74945
|
-
const tokens3 = asRecord(raw.tokens);
|
|
74946
|
-
const number4 = (value) => {
|
|
74947
|
-
const parsed = Number(value);
|
|
74948
|
-
return Number.isFinite(parsed) && parsed > 0 ? parsed : void 0;
|
|
74949
|
-
};
|
|
74950
|
-
const input2 = number4(tokens3?.input);
|
|
74951
|
-
const output2 = number4(tokens3?.output);
|
|
74952
|
-
const cacheRead = number4(tokens3?.cache_read);
|
|
74953
|
-
const cacheWrite = number4(tokens3?.cache_write);
|
|
74954
|
-
const exitCode = typeof raw.exit_code === "number" ? raw.exit_code : void 0;
|
|
74955
|
-
const failure2 = typeof raw.error === "string" && raw.error ? raw.error : exitCode !== void 0 && exitCode !== 0 ? `Hermes run ended with exit code ${exitCode}` : void 0;
|
|
74956
|
-
return {
|
|
74957
|
-
type,
|
|
74958
|
-
sessionId: raw.session_id ? String(raw.session_id) : void 0,
|
|
74959
|
-
resultText: typeof raw.text === "string" ? raw.text : void 0,
|
|
74960
|
-
error: failure2,
|
|
74961
|
-
usage: input2 || output2 || cacheRead || cacheWrite ? { input: input2, output: output2, cacheRead, cacheWrite } : void 0,
|
|
74962
|
-
done: true,
|
|
74963
|
-
final: !failure2,
|
|
74964
|
-
at: at3
|
|
74965
|
-
};
|
|
74966
|
-
}
|
|
74967
|
-
return { type, at: at3 };
|
|
74968
|
-
}
|
|
74969
75077
|
function parseStructuredLine(raw) {
|
|
74970
75078
|
const type = String(raw.type ?? raw.event ?? raw.kind ?? "");
|
|
74971
75079
|
const tool = extractTool(raw);
|
|
@@ -74994,7 +75102,6 @@ function parseDriverLine(driver, line) {
|
|
|
74994
75102
|
if (driver === "codex") return parseCodexLine(raw);
|
|
74995
75103
|
if (driver === "opencode") return parseOpencodeLine(raw);
|
|
74996
75104
|
if (driver === "antigravity") return parseAntigravityLine(raw);
|
|
74997
|
-
if (driver === "hermes") return parseHermesLine(raw);
|
|
74998
75105
|
return parseStructuredLine(raw);
|
|
74999
75106
|
}
|
|
75000
75107
|
|
|
@@ -87288,7 +87395,6 @@ async function runRemoteCardJob(deps) {
|
|
|
87288
87395
|
if (driver === "cursor") return ["home/.cursor/chats"];
|
|
87289
87396
|
if (driver === "opencode") return ["home/.local/share/opencode/storage"];
|
|
87290
87397
|
if (driver === "antigravity") return ["home/.gemini/tmp"];
|
|
87291
|
-
if (driver === "hermes") return ["sessions"];
|
|
87292
87398
|
return [];
|
|
87293
87399
|
}
|
|
87294
87400
|
async function uploadRunContext(repoPaths, current, sessionId, baseHeads) {
|
|
@@ -87791,6 +87897,14 @@ async function runRemoteCardJob(deps) {
|
|
|
87791
87897
|
usage: usagePatch
|
|
87792
87898
|
});
|
|
87793
87899
|
}
|
|
87900
|
+
if ((isChat || isConsult) && !error63 && !assistantTextSeen && !finalMessage) {
|
|
87901
|
+
return complete({
|
|
87902
|
+
error: stderr.trim().slice(-2e3) || "Agent exited without a reply",
|
|
87903
|
+
sessionId,
|
|
87904
|
+
finalMessage,
|
|
87905
|
+
usage: usagePatch
|
|
87906
|
+
});
|
|
87907
|
+
}
|
|
87794
87908
|
return complete({ error: null, sessionId, finalMessage, usage: usagePatch });
|
|
87795
87909
|
}
|
|
87796
87910
|
}
|
|
@@ -88624,6 +88738,13 @@ async function runRemoteWorker(config2, deps = {}) {
|
|
|
88624
88738
|
activeJobIds.add(activeJob.id);
|
|
88625
88739
|
activeWorkspaceIds.add(activeJob.runId ?? activeJob.id);
|
|
88626
88740
|
log("job claimed", { jobId: activeJob.id, type: activeJob.type, attempt: activeJob.attempts });
|
|
88741
|
+
const projectRunnerImage = normalizeRunnerImage(activeJob.projectRunnerImage);
|
|
88742
|
+
activeJob.runnerImage = projectRunnerImage ?? resolveRunnerImage({
|
|
88743
|
+
requiredLabels: activeJob.requiredLabels,
|
|
88744
|
+
images: config2.runnerImages,
|
|
88745
|
+
fallback: config2.runnerImage ?? "ghcr.io/h4kbas/aglio-runner:latest"
|
|
88746
|
+
});
|
|
88747
|
+
activeJob.runnerImageCustom = Boolean(projectRunnerImage);
|
|
88627
88748
|
try {
|
|
88628
88749
|
const cardApi = deps.cardApi ?? workerCardApi(config2, fetchImpl, controller.signal);
|
|
88629
88750
|
const state2 = await executeRemoteJob(result.job, {
|
|
@@ -88644,7 +88765,7 @@ async function runRemoteWorker(config2, deps = {}) {
|
|
|
88644
88765
|
...input2,
|
|
88645
88766
|
workspaceRoot: config2.workspaceRoot ?? input2.workspace,
|
|
88646
88767
|
hostWorkspaceRoot: config2.hostWorkspaceRoot ?? config2.workspaceRoot ?? input2.workspace,
|
|
88647
|
-
image: resolveRunnerImage({
|
|
88768
|
+
image: result.job.runnerImage ?? resolveRunnerImage({
|
|
88648
88769
|
requiredLabels: result.job.requiredLabels,
|
|
88649
88770
|
images: config2.runnerImages,
|
|
88650
88771
|
fallback: config2.runnerImage ?? "ghcr.io/h4kbas/aglio-runner:latest"
|
|
@@ -100430,7 +100551,7 @@ project.
|
|
|
100430
100551
|
- apps/worker: the machine agent. It claims jobs, starts runner containers,
|
|
100431
100552
|
hosts the per-run MCP server, polls GitHub and uploads artifacts.
|
|
100432
100553
|
- runner/Dockerfile: the agent container image (pi, Claude Code, Codex, Cursor,
|
|
100433
|
-
OpenCode, Antigravity,
|
|
100554
|
+
OpenCode, Antigravity, Node, Python).
|
|
100434
100555
|
- packages/core: domain rules (claims, transitions, runs, specs, jobs).
|
|
100435
100556
|
- packages/db: Drizzle schema and migrations.
|
|
100436
100557
|
- packages/agents: driver interface, prompts and context builder.
|
|
@@ -100516,10 +100637,15 @@ AGLIO_SECRET_KEY. It talks to the control plane over outbound HTTPS.
|
|
|
100516
100637
|
|
|
100517
100638
|
## Stock runner images
|
|
100518
100639
|
|
|
100519
|
-
The runner Dockerfile builds one general image and the node, python, rust
|
|
100520
|
-
variants.
|
|
100521
|
-
|
|
100522
|
-
|
|
100640
|
+
The runner Dockerfile builds one general image and the node, python, rust, go,
|
|
100641
|
+
java, ruby, php and dotnet variants. The node variant includes both Node.js and Bun; \`runner:node\` is still
|
|
100642
|
+
the label for that image, so existing worker and project labels need no change.
|
|
100643
|
+
A worker advertises one runner:<type> label per image it serves. The agent pulls
|
|
100644
|
+
the configured image automatically; the default is
|
|
100645
|
+
ghcr.io/h4kbas/aglio-runner:latest. A local build is pnpm runner:build. The
|
|
100646
|
+
stock images do not include a browser; a browser-dependent job installs
|
|
100647
|
+
Playwright and Chromium itself, for example with
|
|
100648
|
+
\`pnpm exec playwright install --with-deps chromium\`.
|
|
100523
100649
|
|
|
100524
100650
|
## Custom runner image
|
|
100525
100651
|
|
|
@@ -100532,13 +100658,23 @@ Extend the official image, do not fork the agent contract:
|
|
|
100532
100658
|
never bake registry tokens or API keys into the image.
|
|
100533
100659
|
3. Publish to a registry the worker can pull from, with an immutable tag such as
|
|
100534
100660
|
a date or commit SHA.
|
|
100535
|
-
4.
|
|
100536
|
-
|
|
100537
|
-
|
|
100538
|
-
|
|
100539
|
-
|
|
100540
|
-
|
|
100541
|
-
|
|
100661
|
+
4. Save it on the project: Project settings -> Workers -> Runner image, or call
|
|
100662
|
+
project_runner_image_set with the full reference after publishing. The worker
|
|
100663
|
+
pulls it for that project only; another project on the same worker keeps its
|
|
100664
|
+
own image. Clearing the field returns to the worker's stock image.
|
|
100665
|
+
5. The Create custom runner image action opens a card that adds
|
|
100666
|
+
docker/runner/Dockerfile, publishes the image, verifies it and writes the
|
|
100667
|
+
reference back with project_runner_image_set.
|
|
100668
|
+
6. Keep the advertised runner:<type> label aligned with the image that actually
|
|
100669
|
+
runs. Project images are not reset by Run again; an AGLIO_WORKER_RUNNER_IMAGE
|
|
100670
|
+
fallback is.
|
|
100671
|
+
|
|
100672
|
+
A cloud run ignores a project image and keeps the pool image. Private registries
|
|
100673
|
+
need docker login on the worker host for the user that runs the agent. The agent
|
|
100674
|
+
reads the host Docker config through the socket.
|
|
100675
|
+
|
|
100676
|
+
Put system packages, pinned runtimes, browser binaries and internal CAs in the
|
|
100677
|
+
image. Keep lockfile installs and application dependencies in the repository.
|
|
100542
100678
|
|
|
100543
100679
|
## Troubleshooting
|
|
100544
100680
|
|
|
@@ -100560,10 +100696,10 @@ has to enroll the machine, set the image on it and confirm the first job.`
|
|
|
100560
100696
|
},
|
|
100561
100697
|
{
|
|
100562
100698
|
id: "prompts",
|
|
100563
|
-
title: "Agent prompts
|
|
100564
|
-
summary: "Prompt sets, placeholders,
|
|
100565
|
-
tags: ["prompt", "
|
|
100566
|
-
body: `# Agent prompts
|
|
100699
|
+
title: "Agent prompts and build speed",
|
|
100700
|
+
summary: "Prompt sets, placeholders, build speed and evidence gates.",
|
|
100701
|
+
tags: ["prompt", "build speed", "thinking", "verbosity", "verification"],
|
|
100702
|
+
body: `# Agent prompts and build speed
|
|
100567
100703
|
|
|
100568
100704
|
## Prompt composition
|
|
100569
100705
|
|
|
@@ -100578,24 +100714,26 @@ Dynamic values use placeholders such as {{cardTitle}}, {{projectName}},
|
|
|
100578
100714
|
{{instruction}}. The editor lists every supported placeholder and MCP tool, and
|
|
100579
100715
|
unknown tokens stay visible so a typo is obvious.
|
|
100580
100716
|
|
|
100581
|
-
The
|
|
100582
|
-
|
|
100583
|
-
|
|
100584
|
-
|
|
100585
|
-
|
|
100586
|
-
|
|
100587
|
-
|
|
100588
|
-
|
|
100589
|
-
|
|
100590
|
-
|
|
100591
|
-
|
|
100592
|
-
|
|
100593
|
-
|
|
100594
|
-
|
|
100595
|
-
|
|
100596
|
-
|
|
100597
|
-
|
|
100598
|
-
|
|
100717
|
+
The default prompt is deliberately lean and cache-friendly: static rules come
|
|
100718
|
+
first, then project and card facts, then run state and the instruction. It
|
|
100719
|
+
carries the card spec, blocks, repositories, conventions, linked pull request
|
|
100720
|
+
lines, the newest review feedback, this run's answers and a capped attachment
|
|
100721
|
+
list. Comments, work log, attempts and earlier thread messages are not injected
|
|
100722
|
+
by default; call card_get for the wider card view and conversation_history for
|
|
100723
|
+
an earlier planning, agent chat or consultant message. Optional
|
|
100724
|
+
{{commentsSection}}, {{workLogSection}}, {{agentAttemptsSection}} and
|
|
100725
|
+
{{conversationHistory}} placeholders remain available in prompt sets. Prompt
|
|
100726
|
+
set chunks are stored in project_prompt_sets.chunks; an empty value or the
|
|
100727
|
+
current bundled default is not stored, so a reset follows upgrades.
|
|
100728
|
+
|
|
100729
|
+
## Agent dials
|
|
100730
|
+
|
|
100731
|
+
Project settings show the build and planning dials directly. Build has build
|
|
100732
|
+
speed, thinking level and verbosity; planning has thinking level and verbosity.
|
|
100733
|
+
Each role without its own value inherits the project default. A card can
|
|
100734
|
+
override the speed, thinking and verbosity it inherits, and Reset to defaults
|
|
100735
|
+
returns both roles and build speed to Standard. The workspace consultant dial
|
|
100736
|
+
lives on Settings -> Agents because it is workspace-wide.
|
|
100599
100737
|
|
|
100600
100738
|
## Build speed
|
|
100601
100739
|
|
|
@@ -100618,8 +100756,8 @@ evidence or not_applicable with a reason.
|
|
|
100618
100756
|
Build speed reaches build, fix, review, card consult and job runs. Planning keeps
|
|
100619
100757
|
its own card dial; the workspace consultant has no build speed.
|
|
100620
100758
|
|
|
100621
|
-
Canonical detail: docs/prompt-context.md, docs/build-speed-dial.md
|
|
100622
|
-
|
|
100759
|
+
Canonical detail: docs/prompt-context.md, docs/build-speed-dial.md
|
|
100760
|
+
and docs/thinking-levels.md.`
|
|
100623
100761
|
},
|
|
100624
100762
|
{
|
|
100625
100763
|
id: "jobs",
|
|
@@ -100659,8 +100797,9 @@ being enforced. A proposal is not a job and never runs until a human approves it
|
|
|
100659
100797
|
Build and overseer runs also get short sections asking for missing cards
|
|
100660
100798
|
(card_propose) and missing recurring checks (job_propose). Suggestions go to
|
|
100661
100799
|
the Todo or Jobs proposal tiles, never onto the source card. Proposals never
|
|
100662
|
-
block the current card and must not be executed in the same run.
|
|
100663
|
-
|
|
100800
|
+
block the current card and must not be executed in the same run. Read earlier
|
|
100801
|
+
suggestions, including approved and rejected ones, with proposal_list before
|
|
100802
|
+
proposing; re-proposing an earlier title is refused. Project settings -> AI
|
|
100664
100803
|
features -> Suggested work turns either section off.
|
|
100665
100804
|
|
|
100666
100805
|
## Auto mode
|
|
@@ -100688,10 +100827,14 @@ docs/build-speed-dial.md.`
|
|
|
100688
100827
|
## Version and changelog
|
|
100689
100828
|
|
|
100690
100829
|
CHANGELOG.md at the repository root is canonical. The web app serves a copy at
|
|
100691
|
-
apps/web/public/changelog.md
|
|
100692
|
-
pnpm changelog:
|
|
100830
|
+
apps/web/public/changelog.md. Run pnpm changelog:sync after a changelog edit;
|
|
100831
|
+
pnpm changelog:check fails on drift.
|
|
100693
100832
|
Release tags match vX.Y.Z on master.
|
|
100694
100833
|
|
|
100834
|
+
docs/self-host.md is canonical for the self-host guide. The web app serves a
|
|
100835
|
+
copy at apps/web/public/self-host.md. Run pnpm selfhost:sync after a guide edit;
|
|
100836
|
+
pnpm selfhost:check fails on drift.
|
|
100837
|
+
|
|
100695
100838
|
## Published images
|
|
100696
100839
|
|
|
100697
100840
|
CI builds and publishes these to GHCR for every v* tag:
|
|
@@ -100704,6 +100847,10 @@ CI builds and publishes these to GHCR for every v* tag:
|
|
|
100704
100847
|
- ghcr.io/h4kbas/aglio-runner-python
|
|
100705
100848
|
- ghcr.io/h4kbas/aglio-runner-rust
|
|
100706
100849
|
- ghcr.io/h4kbas/aglio-runner-go
|
|
100850
|
+
- ghcr.io/h4kbas/aglio-runner-java
|
|
100851
|
+
- ghcr.io/h4kbas/aglio-runner-ruby
|
|
100852
|
+
- ghcr.io/h4kbas/aglio-runner-php
|
|
100853
|
+
- ghcr.io/h4kbas/aglio-runner-dotnet
|
|
100707
100854
|
|
|
100708
100855
|
Self-hosters pin vX.Y.Z or an immutable digest. Do not document the internal
|
|
100709
100856
|
master, sha-, latest or input-hash tags for outside use. scripts/docker-image-hash.mjs
|
|
@@ -100873,6 +101020,14 @@ function createConsultServer(run) {
|
|
|
100873
101020
|
},
|
|
100874
101021
|
async (input2) => forward("card_get", input2)
|
|
100875
101022
|
);
|
|
101023
|
+
server.registerTool(
|
|
101024
|
+
"conversation_history",
|
|
101025
|
+
{
|
|
101026
|
+
description: "Read earlier messages in this consultant thread, oldest first. Read-only. Use it instead of expecting the thread to be replayed in the prompt.",
|
|
101027
|
+
inputSchema: { limit: external_exports.number().int().min(1).max(200).optional() }
|
|
101028
|
+
},
|
|
101029
|
+
async (input2) => forward("conversation_history", input2)
|
|
101030
|
+
);
|
|
100876
101031
|
server.registerTool(
|
|
100877
101032
|
"card_search",
|
|
100878
101033
|
{
|
|
@@ -100942,6 +101097,19 @@ function createConsultServer(run) {
|
|
|
100942
101097
|
},
|
|
100943
101098
|
async (input2) => forward("job_list", input2)
|
|
100944
101099
|
);
|
|
101100
|
+
server.registerTool(
|
|
101101
|
+
"proposal_list",
|
|
101102
|
+
{
|
|
101103
|
+
description: "List earlier card and job suggestions in every state, including approved and rejected ones. Read-only.",
|
|
101104
|
+
inputSchema: {
|
|
101105
|
+
projectId: external_exports.string().optional(),
|
|
101106
|
+
kind: external_exports.enum(["card", "job"]).optional(),
|
|
101107
|
+
status: external_exports.enum(["pending", "approved", "separated", "rejected"]).optional(),
|
|
101108
|
+
limit: external_exports.number().int().min(1).max(200).optional()
|
|
101109
|
+
}
|
|
101110
|
+
},
|
|
101111
|
+
async (input2) => forward("proposal_list", input2)
|
|
101112
|
+
);
|
|
100945
101113
|
server.registerTool(
|
|
100946
101114
|
"repo_list",
|
|
100947
101115
|
{
|
|
@@ -101136,6 +101304,16 @@ function createConsultServer(run) {
|
|
|
101136
101304
|
},
|
|
101137
101305
|
async (input2) => forward("card_propose", input2)
|
|
101138
101306
|
);
|
|
101307
|
+
server.registerTool(
|
|
101308
|
+
"project_runner_image_set",
|
|
101309
|
+
{
|
|
101310
|
+
description: "Save the published custom runner image on this project. The worker pulls and runs this image for the project's jobs instead of its stock image. Pass null to clear it. Use after the image is published and verified.",
|
|
101311
|
+
inputSchema: {
|
|
101312
|
+
image: external_exports.string().trim().min(1).max(500).nullable().describe("Full image reference, for example ghcr.io/acme/aglio-runner-web:2026-06.")
|
|
101313
|
+
}
|
|
101314
|
+
},
|
|
101315
|
+
async (input2) => forward("project_runner_image_set", input2)
|
|
101316
|
+
);
|
|
101139
101317
|
server.registerTool(
|
|
101140
101318
|
"request_human_action",
|
|
101141
101319
|
{
|
|
@@ -101259,6 +101437,14 @@ function createServerForRun(run) {
|
|
|
101259
101437
|
},
|
|
101260
101438
|
async (input2) => forward("card_get", input2)
|
|
101261
101439
|
);
|
|
101440
|
+
server.registerTool(
|
|
101441
|
+
"conversation_history",
|
|
101442
|
+
{
|
|
101443
|
+
description: "Read earlier messages in this planning or agent chat session, oldest first. Read-only. Build, review, consult and job runs have no chat session; use card_get for their comments and work log.",
|
|
101444
|
+
inputSchema: { limit: external_exports.number().int().min(1).max(200).optional() }
|
|
101445
|
+
},
|
|
101446
|
+
async (input2) => forward("conversation_history", input2)
|
|
101447
|
+
);
|
|
101262
101448
|
server.registerTool(
|
|
101263
101449
|
"repo_list",
|
|
101264
101450
|
{ description: "List configured repositories, base branches and verification commands.", inputSchema: {} },
|
|
@@ -101405,6 +101591,18 @@ function createServerForRun(run) {
|
|
|
101405
101591
|
},
|
|
101406
101592
|
async (input2) => forward("job_list", input2)
|
|
101407
101593
|
);
|
|
101594
|
+
server.registerTool(
|
|
101595
|
+
"proposal_list",
|
|
101596
|
+
{
|
|
101597
|
+
description: "List earlier card and job suggestions for this project in every state, including approved and rejected ones. Read-only.",
|
|
101598
|
+
inputSchema: {
|
|
101599
|
+
kind: external_exports.enum(["card", "job"]).optional(),
|
|
101600
|
+
status: external_exports.enum(["pending", "approved", "separated", "rejected"]).optional(),
|
|
101601
|
+
limit: external_exports.number().int().min(1).max(200).optional()
|
|
101602
|
+
}
|
|
101603
|
+
},
|
|
101604
|
+
async (input2) => forward("proposal_list", input2)
|
|
101605
|
+
);
|
|
101408
101606
|
server.registerTool(
|
|
101409
101607
|
"job_run",
|
|
101410
101608
|
{
|
|
@@ -101746,6 +101944,7 @@ async function main() {
|
|
|
101746
101944
|
override: process.env.AGLIO_WORKER_MCP_URL
|
|
101747
101945
|
});
|
|
101748
101946
|
const runnerExtraHosts = sharesAgentNetwork(runnerNetwork) ? [] : process.platform === "linux" ? ["host.docker.internal:host-gateway"] : [];
|
|
101947
|
+
const cacheBinds = mode === "docker" ? runnerCacheBinds() : [];
|
|
101749
101948
|
let mcpHost = null;
|
|
101750
101949
|
try {
|
|
101751
101950
|
mcpHost = createRemoteMcpHost({ port: mcpPort, baseUrl: containerMcpUrl });
|
|
@@ -101779,7 +101978,7 @@ async function main() {
|
|
|
101779
101978
|
process.on("SIGINT", stop);
|
|
101780
101979
|
process.on("SIGTERM", stop);
|
|
101781
101980
|
console.log(
|
|
101782
|
-
`[worker-agent] executor ${mode}${mode === "docker" ? ` image=${runnerImage} socket=${dockerSocket}` : ""} network=${runnerNetwork} workspace=${workspaceRoot} hostWorkspace=${hostWorkspaceRoot} capacity=${config2.capacity} mcp=${containerMcpUrl}`
|
|
101981
|
+
`[worker-agent] executor ${mode}${mode === "docker" ? ` image=${runnerImage} socket=${dockerSocket}` : ""} network=${runnerNetwork} workspace=${workspaceRoot} hostWorkspace=${hostWorkspaceRoot} capacity=${config2.capacity} mcp=${containerMcpUrl} cache=${describeRunnerCache(cacheBinds)}`
|
|
101783
101982
|
);
|
|
101784
101983
|
const hostTools = await verifyHostRuntime({ mode, labels, platform: process.platform });
|
|
101785
101984
|
if (hostTools.length > 0) console.log(`[worker-agent] host tools ${hostTools.join(" | ")}`);
|
|
@@ -101810,12 +102009,13 @@ async function main() {
|
|
|
101810
102009
|
signal: controller.signal,
|
|
101811
102010
|
mcpHost: mcpHost ?? void 0,
|
|
101812
102011
|
runRoot: (workspace) => mode === "docker" ? "/workspace" : workspace,
|
|
101813
|
-
createExecutor: mode === "docker" ? ({ job, workspace }) => createDockerJobExecutor({
|
|
102012
|
+
createExecutor: mode === "docker" ? ({ job, workspace, signal }) => createDockerJobExecutor({
|
|
101814
102013
|
jobId: job.id,
|
|
101815
102014
|
workspace,
|
|
101816
102015
|
workspaceRoot,
|
|
101817
102016
|
hostWorkspaceRoot,
|
|
101818
|
-
|
|
102017
|
+
signal,
|
|
102018
|
+
image: job.runnerImage ?? resolveRunnerImage({
|
|
101819
102019
|
requiredLabels: job.requiredLabels,
|
|
101820
102020
|
images: runnerImages,
|
|
101821
102021
|
fallback: runnerImage
|
|
@@ -101826,6 +102026,7 @@ async function main() {
|
|
|
101826
102026
|
// resolves host.docker.internal already; Linux needs the entry.
|
|
101827
102027
|
extraHosts: runnerExtraHosts,
|
|
101828
102028
|
resources: agentResources,
|
|
102029
|
+
cacheBinds,
|
|
101829
102030
|
log: (message, extra) => console.log(`[worker-agent] ${message}`, extra ?? "")
|
|
101830
102031
|
}) : void 0
|
|
101831
102032
|
});
|