@rallycry/conveyor-agent 11.0.32 → 11.0.33
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-Q2E2TM3J.js → chunk-A73WZJ4Y.js} +25 -9
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -2112,11 +2112,19 @@ function userRecordText(record) {
|
|
|
2112
2112
|
if (content.some((b) => isRecord3(b) && b.type === "tool_result")) return void 0;
|
|
2113
2113
|
return content.filter((b) => isRecord3(b) && b.type === "text").map((b) => typeof b.text === "string" ? b.text : "").filter((t) => t.length > 0).join("\n");
|
|
2114
2114
|
}
|
|
2115
|
-
function
|
|
2116
|
-
if (!isRecord3(raw) || raw.
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2115
|
+
function backgroundTaskCompletion(raw) {
|
|
2116
|
+
if (!isRecord3(raw) || raw.isSidechain === true || raw.isMeta === true) return null;
|
|
2117
|
+
const text = notificationText(raw);
|
|
2118
|
+
if (text === void 0 || !text.trimStart().startsWith(TASK_NOTIFICATION_PREFIX)) return null;
|
|
2119
|
+
const taskId = /<task-id>([^<]+)<\/task-id>/.exec(text)?.[1]?.trim();
|
|
2120
|
+
return { taskId: taskId || null };
|
|
2121
|
+
}
|
|
2122
|
+
function notificationText(record) {
|
|
2123
|
+
if (record.type === "user") return userRecordText(record);
|
|
2124
|
+
if (record.type !== "attachment") return void 0;
|
|
2125
|
+
const attachment = record.attachment;
|
|
2126
|
+
if (!isRecord3(attachment) || attachment.commandMode !== "task-notification") return void 0;
|
|
2127
|
+
return typeof attachment.prompt === "string" ? attachment.prompt : void 0;
|
|
2120
2128
|
}
|
|
2121
2129
|
function mapSystem2(record) {
|
|
2122
2130
|
if (record.subtype === "init") {
|
|
@@ -3666,7 +3674,8 @@ var PtySession = class {
|
|
|
3666
3674
|
* backgrounded gate/subagent just finished) and the chat-proxy projection.
|
|
3667
3675
|
*/
|
|
3668
3676
|
handleRawRecord(raw) {
|
|
3669
|
-
|
|
3677
|
+
const completion = backgroundTaskCompletion(raw);
|
|
3678
|
+
if (completion) this.bridge?.notifyBackgroundTaskDone?.(completion.taskId);
|
|
3670
3679
|
if (typeof this.bridge?.sendChatEvent === "function") this.relayChatRecord(raw);
|
|
3671
3680
|
}
|
|
3672
3681
|
/**
|
|
@@ -13916,7 +13925,7 @@ var QueryBridge = class {
|
|
|
13916
13925
|
let bridge;
|
|
13917
13926
|
if (harnessKind === "pty") {
|
|
13918
13927
|
this.directStream = wrapBridgeWithDirectStream(
|
|
13919
|
-
buildPtyBridge(connection, () => this.onBackgroundTaskDone?.()),
|
|
13928
|
+
buildPtyBridge(connection, (taskId) => this.onBackgroundTaskDone?.(taskId)),
|
|
13920
13929
|
connection
|
|
13921
13930
|
);
|
|
13922
13931
|
bridge = this.directStream.bridge;
|
|
@@ -14641,6 +14650,8 @@ function isBackgroundLaunch(tool2, input) {
|
|
|
14641
14650
|
var BackgroundWorkTracker = class {
|
|
14642
14651
|
/** Absolute expiry (epoch ms) of each outstanding launch, oldest first. */
|
|
14643
14652
|
deadlines = [];
|
|
14653
|
+
/** CLI task ids already counted as complete. */
|
|
14654
|
+
completedTaskIds = /* @__PURE__ */ new Set();
|
|
14644
14655
|
maxMs;
|
|
14645
14656
|
onChange;
|
|
14646
14657
|
log;
|
|
@@ -14669,7 +14680,11 @@ var BackgroundWorkTracker = class {
|
|
|
14669
14680
|
* runner never saw, a re-injected record) must be a no-op, never a negative
|
|
14670
14681
|
* balance that would keep the pod awake after the real work finished.
|
|
14671
14682
|
*/
|
|
14672
|
-
noteCompletion(now = Date.now()) {
|
|
14683
|
+
noteCompletion(now = Date.now(), taskId = null) {
|
|
14684
|
+
if (taskId !== null) {
|
|
14685
|
+
if (this.completedTaskIds.has(taskId)) return;
|
|
14686
|
+
this.completedTaskIds.add(taskId);
|
|
14687
|
+
}
|
|
14673
14688
|
this.prune(now);
|
|
14674
14689
|
if (this.deadlines.length === 0) return;
|
|
14675
14690
|
this.deadlines.shift();
|
|
@@ -14689,6 +14704,7 @@ var BackgroundWorkTracker = class {
|
|
|
14689
14704
|
}
|
|
14690
14705
|
/** Drop everything (shutdown / session teardown). */
|
|
14691
14706
|
clear() {
|
|
14707
|
+
this.completedTaskIds.clear();
|
|
14692
14708
|
if (this.deadlines.length === 0) return;
|
|
14693
14709
|
this.deadlines.length = 0;
|
|
14694
14710
|
this.onChange?.();
|
|
@@ -16057,7 +16073,7 @@ var SessionRunner = class _SessionRunner {
|
|
|
16057
16073
|
onUserQuestion: (signal) => this.handleUserQuestionSignal(signal)
|
|
16058
16074
|
});
|
|
16059
16075
|
bridge.isParentTask = this.fullContext?.isParentTask ?? false;
|
|
16060
|
-
bridge.onBackgroundTaskDone = () => this.backgroundWork.noteCompletion();
|
|
16076
|
+
bridge.onBackgroundTaskDone = (taskId) => this.backgroundWork.noteCompletion(Date.now(), taskId ?? null);
|
|
16061
16077
|
bridge.onSoftStop = () => {
|
|
16062
16078
|
process.stderr.write("[conveyor-agent] Soft stop requested (discovery ExitPlanMode)\n");
|
|
16063
16079
|
this.softStop();
|
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rallycry/conveyor-agent",
|
|
3
|
-
"version": "11.0.
|
|
3
|
+
"version": "11.0.33",
|
|
4
4
|
"description": "Conveyor Agent Runner v10 - PTY harness for the task chat (SDK harness for audit/project-chat). Agent-as-User architecture with BaseService patterns. Works locally too.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent",
|