aglio-worker 0.70.2 → 0.72.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agent.js +139 -22
- package/package.json +1 -1
package/agent.js
CHANGED
|
@@ -50180,9 +50180,10 @@ var RUN_STATUSES_FOR_SCHEMA = [
|
|
|
50180
50180
|
"awaiting_input",
|
|
50181
50181
|
"completed",
|
|
50182
50182
|
"failed",
|
|
50183
|
-
"cancelled"
|
|
50183
|
+
"cancelled",
|
|
50184
|
+
"skipped"
|
|
50184
50185
|
];
|
|
50185
|
-
var RUN_KINDS = ["planning", "build", "consult", "review", "workspace_consult"];
|
|
50186
|
+
var RUN_KINDS = ["planning", "build", "consult", "review", "workspace_consult", "job"];
|
|
50186
50187
|
var AGENT_DRIVERS = ["pi", "claude", "codex", "gemini", "cursor", "opencode"];
|
|
50187
50188
|
var QUESTION_TYPES = ["single", "multi", "text"];
|
|
50188
50189
|
var VERIFICATION_KINDS = ["test_output", "screenshot", "recording", "not_applicable"];
|
|
@@ -50205,7 +50206,8 @@ var RUN_TRIGGERS = [
|
|
|
50205
50206
|
"review_poll",
|
|
50206
50207
|
"planning_chat",
|
|
50207
50208
|
"followup",
|
|
50208
|
-
"workspace_chat"
|
|
50209
|
+
"workspace_chat",
|
|
50210
|
+
"schedule"
|
|
50209
50211
|
];
|
|
50210
50212
|
var NOTIFICATION_TYPES = [
|
|
50211
50213
|
"question",
|
|
@@ -70697,13 +70699,41 @@ var repoConfigSchema = external_exports.object({
|
|
|
70697
70699
|
devCommand: external_exports.string().nullish(),
|
|
70698
70700
|
port: external_exports.number().int().nullish()
|
|
70699
70701
|
});
|
|
70702
|
+
var createJobCardSchema = external_exports.object({
|
|
70703
|
+
projectId: external_exports.string().min(1),
|
|
70704
|
+
title: external_exports.string().trim().min(1).max(300),
|
|
70705
|
+
body: external_exports.string().max(5e4).default(""),
|
|
70706
|
+
cron: external_exports.string().trim().min(1).max(200),
|
|
70707
|
+
timezone: external_exports.string().trim().min(1).max(100).default("UTC"),
|
|
70708
|
+
schedulePreset: external_exports.union([
|
|
70709
|
+
external_exports.object({ id: external_exports.literal("minutes"), every: external_exports.number().int() }),
|
|
70710
|
+
external_exports.object({ id: external_exports.literal("hours"), every: external_exports.number().int() }),
|
|
70711
|
+
external_exports.object({ id: external_exports.literal("daily"), hour: external_exports.number().int(), minute: external_exports.number().int() }),
|
|
70712
|
+
external_exports.object({ id: external_exports.literal("weekdays"), hour: external_exports.number().int(), minute: external_exports.number().int() }),
|
|
70713
|
+
external_exports.object({
|
|
70714
|
+
id: external_exports.literal("weekly"),
|
|
70715
|
+
weekday: external_exports.number().int(),
|
|
70716
|
+
hour: external_exports.number().int(),
|
|
70717
|
+
minute: external_exports.number().int()
|
|
70718
|
+
})
|
|
70719
|
+
]).nullish().default(null),
|
|
70720
|
+
scheduleEnabled: external_exports.boolean().default(false)
|
|
70721
|
+
});
|
|
70722
|
+
var updateJobScheduleSchema = external_exports.object({
|
|
70723
|
+
cardId: external_exports.string().min(1),
|
|
70724
|
+
cron: external_exports.string().trim().min(1).max(200),
|
|
70725
|
+
timezone: external_exports.string().trim().min(1).max(100).default("UTC"),
|
|
70726
|
+
schedulePreset: external_exports.unknown().nullish(),
|
|
70727
|
+
scheduleEnabled: external_exports.boolean().optional()
|
|
70728
|
+
});
|
|
70700
70729
|
var createCardSchema = external_exports.object({
|
|
70701
70730
|
projectId: external_exports.string().min(1),
|
|
70702
70731
|
title: external_exports.string().trim().min(1).max(300),
|
|
70703
70732
|
body: external_exports.string().max(5e4).default(""),
|
|
70704
70733
|
column: cardColumnSchema.default("backlog"),
|
|
70705
70734
|
parentId: external_exports.string().nullish(),
|
|
70706
|
-
priority: external_exports.number().int().min(-100).max(100).default(0)
|
|
70735
|
+
priority: external_exports.number().int().min(-100).max(100).default(0),
|
|
70736
|
+
kind: external_exports.enum(["work", "job"]).default("work")
|
|
70707
70737
|
});
|
|
70708
70738
|
var updateCardSchema = external_exports.object({
|
|
70709
70739
|
cardId: external_exports.string().min(1),
|
|
@@ -70818,6 +70848,10 @@ var mcpHeaderTemplateSchema = external_exports.object({
|
|
|
70818
70848
|
// ../../packages/shared/src/auto-claim-schedule.ts
|
|
70819
70849
|
var MAX_SCAN_MINUTES = 8 * 24 * 60;
|
|
70820
70850
|
|
|
70851
|
+
// ../../packages/shared/src/job-schedule.ts
|
|
70852
|
+
var MINUTE_MS = 6e4;
|
|
70853
|
+
var DAY_MS = 24 * 60 * MINUTE_MS;
|
|
70854
|
+
|
|
70821
70855
|
// ../../packages/shared/src/workers.ts
|
|
70822
70856
|
import { createHash, randomBytes } from "node:crypto";
|
|
70823
70857
|
|
|
@@ -70926,19 +70960,51 @@ function parseWorkerLabels(input2) {
|
|
|
70926
70960
|
}
|
|
70927
70961
|
|
|
70928
70962
|
// ../../packages/shared/src/agent-presets.ts
|
|
70929
|
-
|
|
70930
|
-
|
|
70931
|
-
|
|
70932
|
-
|
|
70933
|
-
|
|
70934
|
-
|
|
70935
|
-
|
|
70936
|
-
|
|
70937
|
-
|
|
70938
|
-
|
|
70939
|
-
careful: presetValues("detailed", "high", "verbose"),
|
|
70940
|
-
yolo: presetValues("yolo", "off", "caveman")
|
|
70963
|
+
var AGENT_PRESETS = ["yolo", "quick", "balanced", "careful"];
|
|
70964
|
+
var PRESET_DIALS = {
|
|
70965
|
+
quick: { buildSpeed: "fast", thinking: "low", verbosity: "concise" },
|
|
70966
|
+
balanced: {
|
|
70967
|
+
buildSpeed: DEFAULT_BUILD_SPEED,
|
|
70968
|
+
thinking: DEFAULT_THINKING_LEVEL,
|
|
70969
|
+
verbosity: DEFAULT_VERBOSITY
|
|
70970
|
+
},
|
|
70971
|
+
careful: { buildSpeed: "detailed", thinking: "high", verbosity: "verbose" },
|
|
70972
|
+
yolo: { buildSpeed: "yolo", thinking: "off", verbosity: "caveman" }
|
|
70941
70973
|
};
|
|
70974
|
+
var AGENT_PRESET_BUILD_SPEEDS = AGENT_PRESETS.reduce(
|
|
70975
|
+
(all2, preset) => {
|
|
70976
|
+
all2[preset] = PRESET_DIALS[preset].buildSpeed;
|
|
70977
|
+
return all2;
|
|
70978
|
+
},
|
|
70979
|
+
{}
|
|
70980
|
+
);
|
|
70981
|
+
var AGENT_PRESET_ROLE_VALUES = AGENT_PRESETS.reduce(
|
|
70982
|
+
(all2, preset) => {
|
|
70983
|
+
const { thinking, verbosity } = PRESET_DIALS[preset];
|
|
70984
|
+
all2[preset] = PROJECT_AGENT_ROLES.reduce((roles, role) => {
|
|
70985
|
+
roles[role] = { thinking, verbosity };
|
|
70986
|
+
return roles;
|
|
70987
|
+
}, {});
|
|
70988
|
+
return all2;
|
|
70989
|
+
},
|
|
70990
|
+
{}
|
|
70991
|
+
);
|
|
70992
|
+
var AGENT_PRESET_VALUES = AGENT_PRESETS.reduce(
|
|
70993
|
+
(all2, preset) => {
|
|
70994
|
+
const { buildSpeed, thinking, verbosity } = PRESET_DIALS[preset];
|
|
70995
|
+
all2[preset] = {
|
|
70996
|
+
buildSpeed,
|
|
70997
|
+
thinking,
|
|
70998
|
+
verbosity,
|
|
70999
|
+
roles: PROJECT_AGENT_ROLES.reduce((roles, role) => {
|
|
71000
|
+
roles[role] = { ...AGENT_PRESET_ROLE_VALUES[preset][role] };
|
|
71001
|
+
return roles;
|
|
71002
|
+
}, {})
|
|
71003
|
+
};
|
|
71004
|
+
return all2;
|
|
71005
|
+
},
|
|
71006
|
+
{}
|
|
71007
|
+
);
|
|
70942
71008
|
|
|
70943
71009
|
// ../../packages/shared/src/events.ts
|
|
70944
71010
|
var appEventSchema = external_exports.object({
|
|
@@ -71494,6 +71560,12 @@ var boardListMoveSchema = external_exports.object({
|
|
|
71494
71560
|
insertAfter: external_exports.boolean().default(false)
|
|
71495
71561
|
});
|
|
71496
71562
|
|
|
71563
|
+
// ../../packages/shared/src/project-sections.ts
|
|
71564
|
+
var PROJECT_SECTION_NAME_MAX = 40;
|
|
71565
|
+
var projectSectionInputSchema = external_exports.object({
|
|
71566
|
+
name: external_exports.string().trim().min(1).max(PROJECT_SECTION_NAME_MAX)
|
|
71567
|
+
});
|
|
71568
|
+
|
|
71497
71569
|
// ../../packages/shared/src/password-reset.ts
|
|
71498
71570
|
var PASSWORD_RESET_TTL_SECONDS = 60 * 60;
|
|
71499
71571
|
|
|
@@ -73632,7 +73704,8 @@ function stripAnsi(value) {
|
|
|
73632
73704
|
return value.replace(ANSI, "").replace(/\r/g, "");
|
|
73633
73705
|
}
|
|
73634
73706
|
function trimLoginOutput(value) {
|
|
73635
|
-
|
|
73707
|
+
const clean = value.replace(/\u0000/g, "");
|
|
73708
|
+
return clean.length > LOGIN_OUTPUT_LIMIT ? clean.slice(-LOGIN_OUTPUT_LIMIT) : clean;
|
|
73636
73709
|
}
|
|
73637
73710
|
function withoutUrls(value) {
|
|
73638
73711
|
return value.replace(/https?:\/\/\S+/g, " ");
|
|
@@ -85419,6 +85492,9 @@ async function runRemoteCardJob(deps) {
|
|
|
85419
85492
|
log: (message) => deps.log?.(message)
|
|
85420
85493
|
});
|
|
85421
85494
|
const repoPaths = await cloneRepos();
|
|
85495
|
+
if (context.run.kind === "workspace_consult") {
|
|
85496
|
+
await rm2(gitConfigPath, { force: true }).catch(() => void 0);
|
|
85497
|
+
}
|
|
85422
85498
|
const env = await agentEnv();
|
|
85423
85499
|
for (const command2 of driverSetupCommands(context.agent.driver, mcpUrl, extraServers)) {
|
|
85424
85500
|
const code = await exec(command2, workspace, env, { log: false });
|
|
@@ -85552,6 +85628,20 @@ async function runRemoteCardJob(deps) {
|
|
|
85552
85628
|
);
|
|
85553
85629
|
const branch = context.run.branch;
|
|
85554
85630
|
const base = repo.baseBranch || "main";
|
|
85631
|
+
if (context.run.kind === "workspace_consult") {
|
|
85632
|
+
if (hasGit) {
|
|
85633
|
+
write(`[aglio] updating ${repo.name} (${base}) for read-only access
|
|
85634
|
+
`);
|
|
85635
|
+
const repoCommands = await repoGit(targetRun);
|
|
85636
|
+
await fetchBranch(repoCommands, base, { depth: 1 });
|
|
85637
|
+
await git(["-C", targetRun, "checkout", "-B", base, `origin/${base}`], workspace);
|
|
85638
|
+
} else {
|
|
85639
|
+
write(`[aglio] cloning ${repo.owner}/${repo.repo} (${base}) for read-only access
|
|
85640
|
+
`);
|
|
85641
|
+
await git(["clone", "--depth", "1", "--branch", base, repo.cloneUrl, targetRun], workspace);
|
|
85642
|
+
}
|
|
85643
|
+
continue;
|
|
85644
|
+
}
|
|
85555
85645
|
let baseAlreadyFetched = false;
|
|
85556
85646
|
if (hasGit) {
|
|
85557
85647
|
write(`[aglio] updating ${repo.name} (${base})
|
|
@@ -85562,6 +85652,13 @@ async function runRemoteCardJob(deps) {
|
|
|
85562
85652
|
await git(["clone", "--depth", "1", "--branch", base, repo.cloneUrl, targetRun], workspace);
|
|
85563
85653
|
baseAlreadyFetched = true;
|
|
85564
85654
|
}
|
|
85655
|
+
if (context.run.kind === "job") {
|
|
85656
|
+
if (!baseAlreadyFetched) await git(["fetch", "origin", base], workspace);
|
|
85657
|
+
await git(["checkout", "-B", base, `origin/${base}`], workspace);
|
|
85658
|
+
write(`[aglio] ${repo.name} starts from origin/${base} (job run)
|
|
85659
|
+
`);
|
|
85660
|
+
continue;
|
|
85661
|
+
}
|
|
85565
85662
|
const start = await prepareBranchCheckout(await repoGit(targetRun), {
|
|
85566
85663
|
branch,
|
|
85567
85664
|
base,
|
|
@@ -85597,7 +85694,7 @@ async function runRemoteCardJob(deps) {
|
|
|
85597
85694
|
GIT_CONFIG_GLOBAL: containerPath(runRoot, workspace, gitConfigPath),
|
|
85598
85695
|
...context.secrets
|
|
85599
85696
|
};
|
|
85600
|
-
if (context.git.token) {
|
|
85697
|
+
if (context.run.kind !== "workspace_consult" && context.git.token) {
|
|
85601
85698
|
env.GIT_TOKEN = context.git.token;
|
|
85602
85699
|
if (context.git.providerId === "github") {
|
|
85603
85700
|
env.GITHUB_TOKEN = context.git.token;
|
|
@@ -98769,13 +98866,23 @@ function createConsultServer(run) {
|
|
|
98769
98866
|
server.registerTool(
|
|
98770
98867
|
"spec_propose",
|
|
98771
98868
|
{
|
|
98772
|
-
description: "Propose a spec for a card created in this consultant thread. A human still approves it.",
|
|
98869
|
+
description: "Propose a spec for a card created in this consultant thread. Optional blocks/blockedBy (top-level or split entries) accept AGLIO-123, #123 or card ids. A human still approves it.",
|
|
98773
98870
|
inputSchema: {
|
|
98774
98871
|
cardId: external_exports.string().min(1),
|
|
98775
98872
|
title: external_exports.string().min(1).max(300),
|
|
98776
98873
|
body: external_exports.string().min(1).max(5e4),
|
|
98777
98874
|
reason: external_exports.string().min(1).max(1e3),
|
|
98778
|
-
|
|
98875
|
+
blocks: external_exports.array(external_exports.string().min(1)).max(50).optional(),
|
|
98876
|
+
blockedBy: external_exports.array(external_exports.string().min(1)).max(50).optional(),
|
|
98877
|
+
split: external_exports.array(
|
|
98878
|
+
external_exports.object({
|
|
98879
|
+
title: external_exports.string().min(1).max(300),
|
|
98880
|
+
body: external_exports.string().min(1).max(5e4),
|
|
98881
|
+
blocks: external_exports.array(external_exports.string().min(1)).max(50).optional(),
|
|
98882
|
+
blockedBy: external_exports.array(external_exports.string().min(1)).max(50).optional(),
|
|
98883
|
+
priority: external_exports.number().int().min(-100).max(100).optional()
|
|
98884
|
+
})
|
|
98885
|
+
).optional()
|
|
98779
98886
|
}
|
|
98780
98887
|
},
|
|
98781
98888
|
async (input2) => forward("spec_propose", input2)
|
|
@@ -98969,12 +99076,22 @@ function createServerForRun(run) {
|
|
|
98969
99076
|
server.registerTool(
|
|
98970
99077
|
"spec_propose",
|
|
98971
99078
|
{
|
|
98972
|
-
description: "Propose a new card spec. In planning this is the main output. During build it suspends the run until a human decides.",
|
|
99079
|
+
description: "Propose a new card spec. In planning this is the main output. During build it suspends the run until a human decides. Optional blocks/blockedBy (top-level or split entries) accept AGLIO-123, #123 or card ids; unresolved refs come back as warnings.",
|
|
98973
99080
|
inputSchema: {
|
|
98974
99081
|
title: external_exports.string().min(1).max(300),
|
|
98975
99082
|
body: external_exports.string().min(1).max(5e4),
|
|
98976
99083
|
reason: external_exports.string().min(1).max(1e3),
|
|
98977
|
-
|
|
99084
|
+
blocks: external_exports.array(external_exports.string().min(1)).max(50).optional(),
|
|
99085
|
+
blockedBy: external_exports.array(external_exports.string().min(1)).max(50).optional(),
|
|
99086
|
+
split: external_exports.array(
|
|
99087
|
+
external_exports.object({
|
|
99088
|
+
title: external_exports.string().min(1).max(300),
|
|
99089
|
+
body: external_exports.string().min(1).max(5e4),
|
|
99090
|
+
blocks: external_exports.array(external_exports.string().min(1)).max(50).optional(),
|
|
99091
|
+
blockedBy: external_exports.array(external_exports.string().min(1)).max(50).optional(),
|
|
99092
|
+
priority: external_exports.number().int().min(-100).max(100).optional()
|
|
99093
|
+
})
|
|
99094
|
+
).optional()
|
|
98978
99095
|
}
|
|
98979
99096
|
},
|
|
98980
99097
|
async (input2) => forward("spec_propose", input2)
|