@rallycry/conveyor-agent 7.0.10 → 7.0.12
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/{chunk-BOFWZIL6.js → chunk-5CBPSIEV.js} +85 -56
- package/dist/chunk-5CBPSIEV.js.map +1 -0
- package/dist/cli.js +4 -2
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-BOFWZIL6.js.map +0 -1
|
@@ -501,23 +501,17 @@ var ModeController = class {
|
|
|
501
501
|
this._mode = "code-review";
|
|
502
502
|
return this._mode;
|
|
503
503
|
}
|
|
504
|
-
if (this._mode === "auto") {
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
this.transitionToBuilding(context);
|
|
508
|
-
return this._mode;
|
|
509
|
-
}
|
|
504
|
+
if (this._mode === "auto" && this.canBypassPlanning(context)) {
|
|
505
|
+
this.transitionToBuilding(context);
|
|
506
|
+
return this._mode;
|
|
510
507
|
}
|
|
511
508
|
return this._mode;
|
|
512
509
|
}
|
|
513
510
|
/** Check if auto-mode can bypass planning (task already has plan + properties) */
|
|
514
511
|
canBypassPlanning(context) {
|
|
515
512
|
if (this._mode !== "auto") return false;
|
|
516
|
-
|
|
517
|
-
if (
|
|
518
|
-
if (context.status === "Planning" && context.plan?.trim() && context.storyPointId) {
|
|
519
|
-
return true;
|
|
520
|
-
}
|
|
513
|
+
if (context.status !== "Planning") return true;
|
|
514
|
+
if (context.plan?.trim() && context.storyPointId) return true;
|
|
521
515
|
return false;
|
|
522
516
|
}
|
|
523
517
|
// ── Mode transitions ───────────────────────────────────────────────
|
|
@@ -963,7 +957,8 @@ var GetSuggestionsRequestSchema = z.object({
|
|
|
963
957
|
sessionId: z.string()
|
|
964
958
|
});
|
|
965
959
|
var GetTaskIncidentsRequestSchema = z.object({
|
|
966
|
-
sessionId: z.string()
|
|
960
|
+
sessionId: z.string(),
|
|
961
|
+
taskId: z.string().optional()
|
|
967
962
|
});
|
|
968
963
|
var CreatePullRequestRequestSchema = CreatePRInputSchema.extend({ sessionId: z.string() });
|
|
969
964
|
var UpdateTaskStatusRequestSchema = z.object({
|
|
@@ -1044,7 +1039,8 @@ var UpdateTaskPropertiesRequestSchema = z.object({
|
|
|
1044
1039
|
sessionId: z.string(),
|
|
1045
1040
|
title: z.string().optional(),
|
|
1046
1041
|
storyPointValue: z.number().int().positive().optional(),
|
|
1047
|
-
tagIds: z.array(z.string()).optional()
|
|
1042
|
+
tagIds: z.array(z.string()).optional(),
|
|
1043
|
+
githubPRUrl: z.string().url().optional()
|
|
1048
1044
|
});
|
|
1049
1045
|
var ListIconsRequestSchema = z.object({
|
|
1050
1046
|
sessionId: z.string()
|
|
@@ -1798,8 +1794,8 @@ function buildAutoPrompt(context) {
|
|
|
1798
1794
|
`### Transitioning to Building:`,
|
|
1799
1795
|
`When your plan is complete and all required properties are set, call the **ExitPlanMode** tool.`,
|
|
1800
1796
|
`- If any required properties are missing, ExitPlanMode will be denied with details on what's missing`,
|
|
1801
|
-
`- Once ExitPlanMode succeeds,
|
|
1802
|
-
`-
|
|
1797
|
+
`- Once ExitPlanMode succeeds, you will seamlessly transition to full build access within the same session`,
|
|
1798
|
+
`- Continue directly with implementation \u2014 no restart or waiting is needed`,
|
|
1803
1799
|
``,
|
|
1804
1800
|
`### Subtask Plan Requirements`,
|
|
1805
1801
|
`When creating subtasks, each MUST include a detailed \`plan\` field:`,
|
|
@@ -2330,6 +2326,33 @@ async function resolveTaskTagContext(context) {
|
|
|
2330
2326
|
);
|
|
2331
2327
|
return injectedSection || null;
|
|
2332
2328
|
}
|
|
2329
|
+
function formatRepoRefs(repoRefs) {
|
|
2330
|
+
const parts = [];
|
|
2331
|
+
parts.push(`
|
|
2332
|
+
## Repository References`);
|
|
2333
|
+
for (const ref of repoRefs) {
|
|
2334
|
+
const icon = ref.refType === "folder" ? "folder" : "file";
|
|
2335
|
+
parts.push(`- [${icon}] \`${ref.path}\``);
|
|
2336
|
+
}
|
|
2337
|
+
return parts;
|
|
2338
|
+
}
|
|
2339
|
+
function formatIncidents(incidents) {
|
|
2340
|
+
const parts = [];
|
|
2341
|
+
parts.push(`
|
|
2342
|
+
## Linked Incidents`);
|
|
2343
|
+
parts.push(
|
|
2344
|
+
`This task has linked incidents. Review them for context on the problem being addressed.
|
|
2345
|
+
`
|
|
2346
|
+
);
|
|
2347
|
+
for (const inc of incidents) {
|
|
2348
|
+
const severity = inc.severity ? ` [${inc.severity}]` : "";
|
|
2349
|
+
const status = inc.status ? ` (${inc.status})` : "";
|
|
2350
|
+
parts.push(`### ${inc.title}${severity}${status}`);
|
|
2351
|
+
if (inc.description) parts.push(inc.description);
|
|
2352
|
+
if (inc.source) parts.push(`Source: ${inc.source}`);
|
|
2353
|
+
}
|
|
2354
|
+
return parts;
|
|
2355
|
+
}
|
|
2333
2356
|
async function buildTaskBody(context) {
|
|
2334
2357
|
const parts = [];
|
|
2335
2358
|
parts.push(`# Task: ${context.title}`);
|
|
@@ -2357,15 +2380,13 @@ ${context.plan}`);
|
|
|
2357
2380
|
}
|
|
2358
2381
|
}
|
|
2359
2382
|
if (context.repoRefs && context.repoRefs.length > 0) {
|
|
2360
|
-
parts.push(
|
|
2361
|
-
## Repository References`);
|
|
2362
|
-
for (const ref of context.repoRefs) {
|
|
2363
|
-
const icon = ref.refType === "folder" ? "folder" : "file";
|
|
2364
|
-
parts.push(`- [${icon}] \`${ref.path}\``);
|
|
2365
|
-
}
|
|
2383
|
+
parts.push(...formatRepoRefs(context.repoRefs));
|
|
2366
2384
|
}
|
|
2367
2385
|
const tagSection = await resolveTaskTagContext(context);
|
|
2368
2386
|
if (tagSection) parts.push(tagSection);
|
|
2387
|
+
if (context.incidents && context.incidents.length > 0) {
|
|
2388
|
+
parts.push(...formatIncidents(context.incidents));
|
|
2389
|
+
}
|
|
2369
2390
|
if (context.chatHistory.length > 0) {
|
|
2370
2391
|
parts.push(...formatChatHistory(context.chatHistory));
|
|
2371
2392
|
}
|
|
@@ -3447,21 +3468,24 @@ function buildDiscoveryTools(connection) {
|
|
|
3447
3468
|
{
|
|
3448
3469
|
title: z4.string().optional().describe("The new task title"),
|
|
3449
3470
|
storyPointValue: z4.number().optional().describe(SP_DESCRIPTION2),
|
|
3450
|
-
tagIds: z4.array(z4.string()).optional().describe("Array of tag IDs to assign")
|
|
3471
|
+
tagIds: z4.array(z4.string()).optional().describe("Array of tag IDs to assign"),
|
|
3472
|
+
githubPRUrl: z4.string().url().optional().describe("GitHub pull request URL to link to this task")
|
|
3451
3473
|
},
|
|
3452
|
-
async ({ title, storyPointValue, tagIds }) => {
|
|
3474
|
+
async ({ title, storyPointValue, tagIds, githubPRUrl }) => {
|
|
3453
3475
|
try {
|
|
3454
3476
|
await connection.call("updateTaskProperties", {
|
|
3455
3477
|
sessionId: connection.sessionId,
|
|
3456
3478
|
title,
|
|
3457
3479
|
storyPointValue,
|
|
3458
|
-
tagIds
|
|
3480
|
+
tagIds,
|
|
3481
|
+
githubPRUrl
|
|
3459
3482
|
});
|
|
3460
3483
|
const updatedFields = [];
|
|
3461
3484
|
if (title !== void 0) updatedFields.push(`title to "${title}"`);
|
|
3462
3485
|
if (storyPointValue !== void 0)
|
|
3463
3486
|
updatedFields.push(`story points to ${storyPointValue}`);
|
|
3464
3487
|
if (tagIds !== void 0) updatedFields.push(`tags (${tagIds.length} tag(s))`);
|
|
3488
|
+
if (githubPRUrl !== void 0) updatedFields.push(`PR link to "${githubPRUrl}"`);
|
|
3465
3489
|
return textResult(`Task properties updated: ${updatedFields.join(", ")}`);
|
|
3466
3490
|
} catch (error) {
|
|
3467
3491
|
return textResult(
|
|
@@ -5380,16 +5404,13 @@ async function handleExitPlanMode(host, input) {
|
|
|
5380
5404
|
host.connection.postChatMessage(
|
|
5381
5405
|
"Plan complete. Running identification \u2014 icon and agent assignment will be set automatically."
|
|
5382
5406
|
);
|
|
5383
|
-
host.requestSoftStop();
|
|
5384
5407
|
return { behavior: "allow", updatedInput: input };
|
|
5385
5408
|
}
|
|
5386
5409
|
await host.connection.triggerIdentification();
|
|
5387
5410
|
host.hasExitedPlanMode = true;
|
|
5388
5411
|
const newMode = host.isParentTask ? "review" : "building";
|
|
5389
|
-
host.
|
|
5390
|
-
|
|
5391
|
-
host.onModeTransition(newMode);
|
|
5392
|
-
}
|
|
5412
|
+
host.connection.sendEvent({ type: "mode_transition", from: "auto", to: newMode });
|
|
5413
|
+
host.connection.emitModeChanged(newMode);
|
|
5393
5414
|
return { behavior: "allow", updatedInput: input };
|
|
5394
5415
|
} catch (err) {
|
|
5395
5416
|
return {
|
|
@@ -6032,6 +6053,27 @@ var QueryBridge = class {
|
|
|
6032
6053
|
};
|
|
6033
6054
|
|
|
6034
6055
|
// src/runner/session-runner.ts
|
|
6056
|
+
function mapChatHistory(messages) {
|
|
6057
|
+
if (!messages) return [];
|
|
6058
|
+
return messages.map((m) => ({
|
|
6059
|
+
role: m.role ?? "user",
|
|
6060
|
+
content: m.content ?? "",
|
|
6061
|
+
userId: m.userId,
|
|
6062
|
+
userName: m.user?.name ?? void 0,
|
|
6063
|
+
createdAt: m.createdAt,
|
|
6064
|
+
...m.files && m.files.length > 0 ? {
|
|
6065
|
+
files: m.files.map((f) => ({
|
|
6066
|
+
fileId: f.id,
|
|
6067
|
+
fileName: f.fileName,
|
|
6068
|
+
mimeType: f.mimeType,
|
|
6069
|
+
fileSize: f.fileSize,
|
|
6070
|
+
downloadUrl: f.downloadUrl ?? "",
|
|
6071
|
+
content: f.content,
|
|
6072
|
+
contentEncoding: f.contentEncoding
|
|
6073
|
+
}))
|
|
6074
|
+
} : {}
|
|
6075
|
+
}));
|
|
6076
|
+
}
|
|
6035
6077
|
var SessionRunner = class _SessionRunner {
|
|
6036
6078
|
connection;
|
|
6037
6079
|
mode;
|
|
@@ -6148,8 +6190,8 @@ var SessionRunner = class _SessionRunner {
|
|
|
6148
6190
|
this.queryBridge = this.createQueryBridge();
|
|
6149
6191
|
this.logInitialization();
|
|
6150
6192
|
const staleMessageCount = this.pendingMessages.length;
|
|
6151
|
-
await this.executeInitialMode();
|
|
6152
|
-
if (staleMessageCount > 0) {
|
|
6193
|
+
const didExecuteInitialQuery = await this.executeInitialMode();
|
|
6194
|
+
if (staleMessageCount > 0 && didExecuteInitialQuery) {
|
|
6153
6195
|
this.pendingMessages.splice(0, staleMessageCount);
|
|
6154
6196
|
}
|
|
6155
6197
|
if (!this.stopped && this._state !== "error") {
|
|
@@ -6244,15 +6286,16 @@ var SessionRunner = class _SessionRunner {
|
|
|
6244
6286
|
}
|
|
6245
6287
|
}
|
|
6246
6288
|
// ── Initial mode execution ─────────────────────────────────────────
|
|
6289
|
+
/** Returns true if an initial query was executed, false otherwise. */
|
|
6247
6290
|
async executeInitialMode() {
|
|
6248
|
-
if (!this.taskContext || !this.fullContext) return;
|
|
6291
|
+
if (!this.taskContext || !this.fullContext) return false;
|
|
6249
6292
|
const effectiveMode = this.mode.effectiveMode;
|
|
6250
6293
|
if (effectiveMode === "code-review") {
|
|
6251
6294
|
await this.setState("running");
|
|
6252
6295
|
await this.callbacks.onEvent({ type: "execute_mode", mode: effectiveMode });
|
|
6253
6296
|
await this.executeQuery();
|
|
6254
6297
|
this.stopped = true;
|
|
6255
|
-
return;
|
|
6298
|
+
return true;
|
|
6256
6299
|
}
|
|
6257
6300
|
const shouldRun = effectiveMode === "building" || effectiveMode === "auto" || effectiveMode === "review" && this.mode.isPackRunner(this.taskContext);
|
|
6258
6301
|
if (shouldRun) {
|
|
@@ -6260,9 +6303,10 @@ var SessionRunner = class _SessionRunner {
|
|
|
6260
6303
|
await this.callbacks.onEvent({ type: "execute_mode", mode: effectiveMode });
|
|
6261
6304
|
await this.executeQuery();
|
|
6262
6305
|
if (!this.stopped) await this.setState("idle");
|
|
6263
|
-
|
|
6264
|
-
await this.setState("idle");
|
|
6306
|
+
return true;
|
|
6265
6307
|
}
|
|
6308
|
+
await this.setState("idle");
|
|
6309
|
+
return false;
|
|
6266
6310
|
}
|
|
6267
6311
|
// ── Message waiting ────────────────────────────────────────────────
|
|
6268
6312
|
waitForMessage() {
|
|
@@ -6379,24 +6423,7 @@ var SessionRunner = class _SessionRunner {
|
|
|
6379
6423
|
}
|
|
6380
6424
|
// ── Context & bridge construction ────────────────────────────────
|
|
6381
6425
|
buildFullContext(ctx) {
|
|
6382
|
-
const chatHistory = (ctx.chatHistory
|
|
6383
|
-
role: m.role ?? "user",
|
|
6384
|
-
content: m.content ?? "",
|
|
6385
|
-
userId: m.userId,
|
|
6386
|
-
userName: m.user?.name ?? void 0,
|
|
6387
|
-
createdAt: m.createdAt,
|
|
6388
|
-
...m.files && m.files.length > 0 ? {
|
|
6389
|
-
files: m.files.map((f) => ({
|
|
6390
|
-
fileId: f.id,
|
|
6391
|
-
fileName: f.fileName,
|
|
6392
|
-
mimeType: f.mimeType,
|
|
6393
|
-
fileSize: f.fileSize,
|
|
6394
|
-
downloadUrl: f.downloadUrl ?? "",
|
|
6395
|
-
content: f.content,
|
|
6396
|
-
contentEncoding: f.contentEncoding
|
|
6397
|
-
}))
|
|
6398
|
-
} : {}
|
|
6399
|
-
}));
|
|
6426
|
+
const chatHistory = mapChatHistory(ctx.chatHistory);
|
|
6400
6427
|
return {
|
|
6401
6428
|
taskId: ctx.id,
|
|
6402
6429
|
projectId: ctx.projectId ?? "",
|
|
@@ -6405,7 +6432,8 @@ var SessionRunner = class _SessionRunner {
|
|
|
6405
6432
|
plan: ctx.plan,
|
|
6406
6433
|
status: ctx.status,
|
|
6407
6434
|
chatHistory,
|
|
6408
|
-
agentId: null,
|
|
6435
|
+
agentId: ctx.agentId ?? null,
|
|
6436
|
+
_runnerSessionId: this.sessionId,
|
|
6409
6437
|
agentInstructions: ctx.agentInstructions ?? "",
|
|
6410
6438
|
model: ctx.model,
|
|
6411
6439
|
githubBranch: ctx.githubBranch ?? "",
|
|
@@ -6419,7 +6447,8 @@ var SessionRunner = class _SessionRunner {
|
|
|
6419
6447
|
projectAgents: ctx.projectAgents ?? void 0,
|
|
6420
6448
|
projectTags: ctx.projectTags ?? void 0,
|
|
6421
6449
|
taskTagIds: ctx.taskTagIds ?? void 0,
|
|
6422
|
-
projectObjectives: ctx.projectObjectives ?? void 0
|
|
6450
|
+
projectObjectives: ctx.projectObjectives ?? void 0,
|
|
6451
|
+
incidents: ctx.incidents ?? void 0
|
|
6423
6452
|
};
|
|
6424
6453
|
}
|
|
6425
6454
|
createQueryBridge() {
|
|
@@ -7927,4 +7956,4 @@ export {
|
|
|
7927
7956
|
loadForwardPorts,
|
|
7928
7957
|
loadConveyorConfig
|
|
7929
7958
|
};
|
|
7930
|
-
//# sourceMappingURL=chunk-
|
|
7959
|
+
//# sourceMappingURL=chunk-5CBPSIEV.js.map
|