monoban 1.12.0 → 1.14.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/dist/index.mjs +113 -17
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -6495,6 +6495,15 @@ function formatDuration(ms) {
|
|
|
6495
6495
|
}
|
|
6496
6496
|
/** A question's id, as agentpipe names it (`plan-2`): never an option (the check on task_run_answers.question_id). */
|
|
6497
6497
|
const QUESTION_ID = /^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$/;
|
|
6498
|
+
/**
|
|
6499
|
+
* What came of an answer you sent (an `answer` event, MON-259): it reached the run; it came after the run stopped
|
|
6500
|
+
* waiting for it (agentpipe decided it on its own); or agentpipe refused it.
|
|
6501
|
+
*/
|
|
6502
|
+
const ANSWER_OUTCOMES = [
|
|
6503
|
+
"reached",
|
|
6504
|
+
"too_late",
|
|
6505
|
+
"refused"
|
|
6506
|
+
];
|
|
6498
6507
|
/** A step's mark in a list: ✓ ok, ● running, ✗ failed, – skipped, ■ cancelled, ? needs you. */
|
|
6499
6508
|
const STEP_MARKS = {
|
|
6500
6509
|
running: "●",
|
|
@@ -7216,13 +7225,19 @@ const TaskRunSchema = object({
|
|
|
7216
7225
|
costUsd: number$1().nullable(),
|
|
7217
7226
|
/** Someone asked it to stop; it will at its next checkpoint. */
|
|
7218
7227
|
cancelRequested: boolean(),
|
|
7228
|
+
/**
|
|
7229
|
+
* While it waits for your answer to a question only you can settle (its loop's `askMinutes`, MON-258): until when.
|
|
7230
|
+
* Null when it doesn't wait (its last word is something else, it's not running, or its runner went quiet); it
|
|
7231
|
+
* stops waiting at that time even if this still says it does. `POST …/questions/{questionId}/answer` takes an
|
|
7232
|
+
* answer only while this is in the future.
|
|
7233
|
+
*/
|
|
7234
|
+
waitingUntil: Timestamp.nullable(),
|
|
7219
7235
|
version: Version,
|
|
7220
7236
|
createdAt: Timestamp,
|
|
7221
7237
|
startedAt: Timestamp.nullable(),
|
|
7222
7238
|
finishedAt: Timestamp.nullable(),
|
|
7223
7239
|
updatedAt: Timestamp
|
|
7224
7240
|
}).meta({ id: "TaskRun" });
|
|
7225
|
-
TaskRunSchema.extend({ steps: array(RunStepSchema) }).meta({ id: "TaskRunDetail" });
|
|
7226
7241
|
/** A run for a runner to start: with what it needs to check the folder (the project's key and repo). */
|
|
7227
7242
|
/** A run's project, for the runner to check the folder against (its key, and the repository it's linked to). */
|
|
7228
7243
|
const RunProjectSchema = object({
|
|
@@ -7240,6 +7255,19 @@ const RunAnswerSchema = object({
|
|
|
7240
7255
|
text: string().nullable(),
|
|
7241
7256
|
createdAt: Timestamp
|
|
7242
7257
|
}).meta({ id: "RunAnswer" });
|
|
7258
|
+
/**
|
|
7259
|
+
* An answer you sent, as the run shows it: with what its runner said came of it (its `answer` event): `reached` the
|
|
7260
|
+
* run, `too_late`, or `refused` (with agentpipe's words, in `said`); null until the runner has handed it on.
|
|
7261
|
+
*/
|
|
7262
|
+
const RunAnswerOnRunSchema = RunAnswerSchema.extend({
|
|
7263
|
+
outcome: _enum(ANSWER_OUTCOMES).nullable(),
|
|
7264
|
+
/** The runner's words for it (English), or null. */
|
|
7265
|
+
said: string().nullable()
|
|
7266
|
+
}).meta({ id: "RunAnswerOnRun" });
|
|
7267
|
+
TaskRunSchema.extend({
|
|
7268
|
+
steps: array(RunStepSchema),
|
|
7269
|
+
answers: array(RunAnswerOnRunSchema).max(RUN_LIMITS.answersPerRun)
|
|
7270
|
+
}).meta({ id: "TaskRunDetail" });
|
|
7243
7271
|
/** Run an agent on a task, on one of your runners. */
|
|
7244
7272
|
/** An absolute path on a runner's machine. */
|
|
7245
7273
|
const Workdir = string().trim().min(1, "Required").max(RUN_LIMITS.workdir).refine(isAbsolutePath, "An absolute path, like /Users/you/code/project").meta({ pattern: "^/" });
|
|
@@ -8177,7 +8205,7 @@ function archivedByTime(task, archiveAfterDays, now = Date.now()) {
|
|
|
8177
8205
|
}
|
|
8178
8206
|
// src/version.ts
|
|
8179
8207
|
/** This CLI's version, from package.json (set at build time by tsdown, and by vitest in tests). */
|
|
8180
|
-
const VERSION = "1.
|
|
8208
|
+
const VERSION = "1.14.0";
|
|
8181
8209
|
/** Sent as X-Monoban-Client, and shown in Settings › CLI sessions. */
|
|
8182
8210
|
const CLIENT = `cli/${VERSION}`;
|
|
8183
8211
|
// src/api.ts
|
|
@@ -11722,8 +11750,8 @@ const RELEASES = `https://github.com/thiagodmont/homebrew-tap/releases`;
|
|
|
11722
11750
|
* agentpipe comes with a new monoban: change these three lines (from the release's checksums.txt) and release.
|
|
11723
11751
|
*/
|
|
11724
11752
|
const AGENTPIPE = {
|
|
11725
|
-
version: "0.
|
|
11726
|
-
wheelSha256: "
|
|
11753
|
+
version: "0.12.0",
|
|
11754
|
+
wheelSha256: "09dcfd3b571c5d66ec600dcff0db19dfb715ec90200dbd7e2b9c88e2b36eb1cc",
|
|
11727
11755
|
requirementsSha256: "41a8d073b0087efb80efafeb6a2b4750340d0f64920159cd4c723ed9167d0a98"
|
|
11728
11756
|
};
|
|
11729
11757
|
const agentpipeWheel = (version) => `agentpipe-${version}-py3-none-any.whl`;
|
|
@@ -11837,7 +11865,7 @@ async function latestVersion(ctx) {
|
|
|
11837
11865
|
async function upgrade(ctx, options, kind = thisInstall()) {
|
|
11838
11866
|
const latest = await latestVersion(ctx);
|
|
11839
11867
|
const { how, command } = UPGRADE[kind];
|
|
11840
|
-
const outdated = latest !== null && newer(latest, "1.
|
|
11868
|
+
const outdated = latest !== null && newer(latest, "1.14.0");
|
|
11841
11869
|
if (options.json) {
|
|
11842
11870
|
ctx.out(JSON.stringify({
|
|
11843
11871
|
version: VERSION,
|
|
@@ -12422,7 +12450,10 @@ const str = (v) => typeof v === "string" && v.trim() ? v.trim() : null;
|
|
|
12422
12450
|
const num = (v) => typeof v === "number" && Number.isFinite(v) ? v : null;
|
|
12423
12451
|
/** A message the API takes: one line or more, at most 2000 characters. */
|
|
12424
12452
|
const clip$1 = (text) => text.length > 2e3 ? `${text.slice(0, 1999)}…` : text;
|
|
12425
|
-
/**
|
|
12453
|
+
/**
|
|
12454
|
+
* `merge.blocked`'s decisions (and `merge.completed`'s `accepted`): each with its id, question id, category and answer;
|
|
12455
|
+
* anything else is left out.
|
|
12456
|
+
*/
|
|
12426
12457
|
function decisionsOf(value) {
|
|
12427
12458
|
if (!Array.isArray(value)) return [];
|
|
12428
12459
|
return value.flatMap((x) => {
|
|
@@ -12809,6 +12840,19 @@ function agentpipeMapper(report) {
|
|
|
12809
12840
|
status: "succeeded",
|
|
12810
12841
|
reason: sha ? `Merged (${sha.slice(0, 7)}).` : "Merged."
|
|
12811
12842
|
};
|
|
12843
|
+
for (const decision of decisionsOf(d.accepted)) report.event({
|
|
12844
|
+
kind: "question",
|
|
12845
|
+
...step && { step },
|
|
12846
|
+
message: clip$1(decision.question ?? decision.answer),
|
|
12847
|
+
data: {
|
|
12848
|
+
decisionId: decision.decisionId,
|
|
12849
|
+
questionId: decision.questionId,
|
|
12850
|
+
category: decision.category,
|
|
12851
|
+
answer: decision.answer.slice(0, 2e3),
|
|
12852
|
+
accepted: "setting"
|
|
12853
|
+
},
|
|
12854
|
+
...at && { at }
|
|
12855
|
+
});
|
|
12812
12856
|
return;
|
|
12813
12857
|
}
|
|
12814
12858
|
case "merge.blocked": {
|
|
@@ -18036,6 +18080,11 @@ var en_US_default = {
|
|
|
18036
18080
|
"help": "Back to task",
|
|
18037
18081
|
"keywords": "run runs orchestrator agent progress steps watch"
|
|
18038
18082
|
},
|
|
18083
|
+
"answer": {
|
|
18084
|
+
"label": "Answer the question {id}'s run asks",
|
|
18085
|
+
"help": "Answer the question task's run asks",
|
|
18086
|
+
"keywords": "answer question run agent loop decide reply"
|
|
18087
|
+
},
|
|
18039
18088
|
"undo": { "label": "Undo" }
|
|
18040
18089
|
},
|
|
18041
18090
|
move: {
|
|
@@ -18247,9 +18296,9 @@ var en_US_default = {
|
|
|
18247
18296
|
"help": "Run loop now"
|
|
18248
18297
|
},
|
|
18249
18298
|
"continue": {
|
|
18250
|
-
"label": "
|
|
18299
|
+
"label": "{step, select, checks {Fix CI on {ref}'s pull request and mark it ready} feedback {Answer the review comments on {ref}'s pull request} merge {Merge {ref}'s pull request} other {Continue {ref}'s pull request}}",
|
|
18251
18300
|
"help": "Continue a run's pull request",
|
|
18252
|
-
"keywords": "continue resume retry pull request merge checks feedback"
|
|
18301
|
+
"keywords": "continue resume retry pull request merge checks ci fix ready feedback review comments answer"
|
|
18253
18302
|
},
|
|
18254
18303
|
"delete": {
|
|
18255
18304
|
"label": "Delete {name}",
|
|
@@ -18350,7 +18399,9 @@ var en_US_default = {
|
|
|
18350
18399
|
"waits": "<pr>{ref}'s pull request</pr> is ready for you to merge: merge is off for this loop.",
|
|
18351
18400
|
"waitsOpen": "<pr>{ref}'s pull request</pr> waits for you.",
|
|
18352
18401
|
"continue": "Continue {ref}'s pull request",
|
|
18353
|
-
"continueHint": "A run
|
|
18402
|
+
"continueHint": "A run starts from the step you choose at the runner's next check-in.",
|
|
18403
|
+
"stopped": "{at, select, implement {It stopped while writing the change.} review {It stopped while reviewing the change.} checks {It stopped while getting CI green.} feedback {It stopped while answering the review comments.} merge {Its merge didn't go through.} beforeMerge {It did every step before merge.} other {}}",
|
|
18404
|
+
"suggested": "suggested"
|
|
18354
18405
|
},
|
|
18355
18406
|
runs: {
|
|
18356
18407
|
"heading": "Runs",
|
|
@@ -18447,8 +18498,7 @@ var en_US_default = {
|
|
|
18447
18498
|
"pause": "Pause",
|
|
18448
18499
|
"resume": "Resume",
|
|
18449
18500
|
"edit": "Edit",
|
|
18450
|
-
"delete": "Delete"
|
|
18451
|
-
"continueFrom": "From {step}"
|
|
18501
|
+
"delete": "Delete"
|
|
18452
18502
|
},
|
|
18453
18503
|
toast: {
|
|
18454
18504
|
"created": "Created {name}.",
|
|
@@ -18458,7 +18508,7 @@ var en_US_default = {
|
|
|
18458
18508
|
"queued": "{name} runs at its runner's next check-in.",
|
|
18459
18509
|
"deleted": "Deleted {name}.",
|
|
18460
18510
|
"failed": "That didn't work: try again.",
|
|
18461
|
-
"continued": "{ref}
|
|
18511
|
+
"continued": "{step, select, checks {A run fixes {ref}'s CI at its runner's next check-in.} feedback {A run answers {ref}'s review comments at its runner's next check-in.} merge {A run merges {ref}'s pull request at its runner's next check-in.} other {A run continues {ref}'s pull request at its runner's next check-in.}}",
|
|
18462
18512
|
"accepted": "{ref} merges at its runner's next check-in, with {count, plural, one {the decision} other {the # decisions}} accepted."
|
|
18463
18513
|
},
|
|
18464
18514
|
decisions: {
|
|
@@ -18469,6 +18519,20 @@ var en_US_default = {
|
|
|
18469
18519
|
"paused": "The loop is paused: resume it, then accept them here.",
|
|
18470
18520
|
"hint": "A run continues from merge at the runner's next check-in: it accepts them with agentpipe ratify, then merges. If the branch moved since, it waits for you again.",
|
|
18471
18521
|
"accepting": "It accepts {count, plural, one {# decision} other {# decisions}} read at {commit}, then merges."
|
|
18522
|
+
},
|
|
18523
|
+
continueStep: {
|
|
18524
|
+
"checks": {
|
|
18525
|
+
"label": "Fix CI and mark it ready",
|
|
18526
|
+
"does": "Watches CI, repairs what fails and takes the pull request out of draft, then answers the review comments{merges, select, yes { and merges} other {}}."
|
|
18527
|
+
},
|
|
18528
|
+
"feedback": {
|
|
18529
|
+
"label": "Answer review comments",
|
|
18530
|
+
"does": "Answers the review comments, then sees CI green again{merges, select, yes { and merges} other {}}."
|
|
18531
|
+
},
|
|
18532
|
+
"merge": {
|
|
18533
|
+
"label": "Merge it",
|
|
18534
|
+
"does": "Merges it as it is: no model runs, so it costs nothing."
|
|
18535
|
+
}
|
|
18472
18536
|
}
|
|
18473
18537
|
},
|
|
18474
18538
|
notes: {
|
|
@@ -18917,7 +18981,8 @@ var en_US_default = {
|
|
|
18917
18981
|
"board": "board",
|
|
18918
18982
|
"question": "question",
|
|
18919
18983
|
"warning": "warning",
|
|
18920
|
-
"error": "error"
|
|
18984
|
+
"error": "error",
|
|
18985
|
+
"accepted": "accepted"
|
|
18921
18986
|
},
|
|
18922
18987
|
"earlierRuns": "earlier runs",
|
|
18923
18988
|
"earlierRun": "{date} · {status}",
|
|
@@ -18929,7 +18994,36 @@ var en_US_default = {
|
|
|
18929
18994
|
"cancelled": "cancelled:",
|
|
18930
18995
|
"needs_human": "needs human:"
|
|
18931
18996
|
},
|
|
18932
|
-
"attempt": "(attempt {n})"
|
|
18997
|
+
"attempt": "(attempt {n})",
|
|
18998
|
+
"questions": {
|
|
18999
|
+
"label": "Questions waiting for you",
|
|
19000
|
+
"answered": "Your answers",
|
|
19001
|
+
"heading": "your answers",
|
|
19002
|
+
"closes": "It waits for you until {time}, then decides on its own.",
|
|
19003
|
+
"unknown": "Question {id} (its text isn't among the latest events)",
|
|
19004
|
+
"field": "Your answer to {id}",
|
|
19005
|
+
"placeholder": "Your answer: it reaches the agent as you write it",
|
|
19006
|
+
"send": "Send",
|
|
19007
|
+
"sending": "Sending…",
|
|
19008
|
+
"skip": "You decide",
|
|
19009
|
+
"skipHint": "“You decide” tells it to decide this one on its own, as if no answer came.",
|
|
19010
|
+
"yours": "You answered: {text}",
|
|
19011
|
+
"yoursSkip": "You left it to the run.",
|
|
19012
|
+
"sent": "Sent: its runner hands it on at its next check-in.",
|
|
19013
|
+
"reached": "It reached the run.",
|
|
19014
|
+
"tooLate": "Too late: the run had stopped waiting, so it decided on its own. If a decision only you can make holds its merge, accept it on the run.",
|
|
19015
|
+
"refused": "agentpipe didn't take it: {said}",
|
|
19016
|
+
"unsent": "The run ended before its runner handed this on.",
|
|
19017
|
+
"tooLateNow": "Too late: the run no longer waits for this answer, so it decides on its own. If a decision only you can make holds its merge, accept it on the run.",
|
|
19018
|
+
"answeredAlready": "It was answered already.",
|
|
19019
|
+
"failed": "Couldn't send it."
|
|
19020
|
+
},
|
|
19021
|
+
"accepted": {
|
|
19022
|
+
"label": "{count, plural, one {# decision} other {# decisions}} the repository's setting accepted",
|
|
19023
|
+
"why": "The agent decided on its own, and the merge went ahead without anyone reading what it decided: agentpipe's setting for this repository (<code>ship.accept_provisional</code>, on the runner's machine, not in monoban or in the repository) accepts decisions of these kinds. Read them against the <pr>pull request</pr>.",
|
|
19024
|
+
"answer": "Its answer:",
|
|
19025
|
+
"authority": "only you could decide this, and nobody read it"
|
|
19026
|
+
}
|
|
18933
19027
|
},
|
|
18934
19028
|
runners: {
|
|
18935
19029
|
"title": "Runners",
|
|
@@ -19053,6 +19147,7 @@ var en_US_default = {
|
|
|
19053
19147
|
"status": {
|
|
19054
19148
|
"queued": "waiting for the runner",
|
|
19055
19149
|
"running": "running",
|
|
19150
|
+
"waiting": "waiting for your answer",
|
|
19056
19151
|
"cancelling": "cancelling",
|
|
19057
19152
|
"succeeded": "done",
|
|
19058
19153
|
"failed": "failed",
|
|
@@ -19914,8 +20009,9 @@ function eventAge(iso, words, now = Date.now()) {
|
|
|
19914
20009
|
}
|
|
19915
20010
|
// ../../packages/i18n/src/runs.ts
|
|
19916
20011
|
/** A run's status in a few words. */
|
|
19917
|
-
function describeRunStatus(run, { t }) {
|
|
20012
|
+
function describeRunStatus(run, { t }, now = Date.now()) {
|
|
19918
20013
|
if (run.status === "running" && run.cancelRequested) return t("run.status.cancelling");
|
|
20014
|
+
if (run.status === "running" && run.waitingUntil && Date.parse(run.waitingUntil) > now) return t("run.status.waiting");
|
|
19919
20015
|
return t(`run.status.${run.status}`);
|
|
19920
20016
|
}
|
|
19921
20017
|
/** "$0.31", "$0.004": what a run or step cost, in US dollars, to a cent once it's a cent or more. */
|
|
@@ -23508,7 +23604,7 @@ function describe({ state, running }, board, now) {
|
|
|
23508
23604
|
const seenAgo = `checked in ${since(board.lastSeenAt, now)} ago (every ${board.pollSeconds}s)`;
|
|
23509
23605
|
row("board", `${board.online ? "online" : "offline"} · ${seenAgo}`);
|
|
23510
23606
|
} else if (!state.runnerId) row("board", "not on the board yet: it's starting");
|
|
23511
|
-
if (state.version !== "1.
|
|
23607
|
+
if (state.version !== "1.14.0") {
|
|
23512
23608
|
const again = state.background ? "`monoban runner restart`" : "start it again in its terminal";
|
|
23513
23609
|
row("update", `it runs monoban ${state.version}, this is ${VERSION}: ${again}`);
|
|
23514
23610
|
}
|
|
@@ -23946,7 +24042,7 @@ async function checks(ctx, deps = {}) {
|
|
|
23946
24042
|
const found = [];
|
|
23947
24043
|
const latest = await (deps.latest ?? latestVersion)(ctx);
|
|
23948
24044
|
const upgrade = UPGRADE[thisInstall()].command;
|
|
23949
|
-
found.push(latest && newer(latest, "1.
|
|
24045
|
+
found.push(latest && newer(latest, "1.14.0") ? {
|
|
23950
24046
|
name: "monoban",
|
|
23951
24047
|
status: "warn",
|
|
23952
24048
|
detail: `${VERSION}; ${latest} is out`,
|
package/package.json
CHANGED