@integrity-labs/agt-cli 0.15.1 → 0.15.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/dist/bin/agt.js +3 -3
- package/dist/{chunk-7QE6SJQB.js → chunk-IQI7XAQ6.js} +1 -11
- package/dist/chunk-IQI7XAQ6.js.map +1 -0
- package/dist/lib/manager-worker.js +2 -57
- package/dist/lib/manager-worker.js.map +1 -1
- package/mcp/index.js +55 -14
- package/mcp/slack-channel.js +16 -15
- package/package.json +1 -1
- package/dist/chunk-7QE6SJQB.js.map +0 -1
|
@@ -6,14 +6,12 @@ import {
|
|
|
6
6
|
exchangeApiKey,
|
|
7
7
|
extractCommandNotFound,
|
|
8
8
|
extractFrontmatter,
|
|
9
|
-
formatActorId,
|
|
10
9
|
getApiKey,
|
|
11
10
|
getFramework,
|
|
12
11
|
getHostId,
|
|
13
12
|
getIntegration,
|
|
14
13
|
isParseError,
|
|
15
14
|
isResolveError,
|
|
16
|
-
isSelfCompletion,
|
|
17
15
|
parseDeliveryTarget,
|
|
18
16
|
provision,
|
|
19
17
|
provisionIsolationHook,
|
|
@@ -22,7 +20,7 @@ import {
|
|
|
22
20
|
resolveChannels,
|
|
23
21
|
resolveDmTarget,
|
|
24
22
|
wrapScheduledTaskPrompt
|
|
25
|
-
} from "../chunk-
|
|
23
|
+
} from "../chunk-IQI7XAQ6.js";
|
|
26
24
|
import {
|
|
27
25
|
findTaskByTemplate,
|
|
28
26
|
getProjectDir,
|
|
@@ -1044,21 +1042,8 @@ function startRealtimeConfig(config2) {
|
|
|
1044
1042
|
});
|
|
1045
1043
|
log2(`[realtime] Subscribing to agents table for ${agentIds.length} agent(s)`);
|
|
1046
1044
|
}
|
|
1047
|
-
var METRICS_WINDOW = 200;
|
|
1048
|
-
var kanbanMetrics = {
|
|
1049
|
-
delivered: 0,
|
|
1050
|
-
suppressedSelfActor: 0,
|
|
1051
|
-
dropped: 0,
|
|
1052
|
-
latencies: []
|
|
1053
|
-
};
|
|
1054
|
-
function recordLatency(ms) {
|
|
1055
|
-
kanbanMetrics.latencies.push(ms);
|
|
1056
|
-
if (kanbanMetrics.latencies.length > METRICS_WINDOW) {
|
|
1057
|
-
kanbanMetrics.latencies.shift();
|
|
1058
|
-
}
|
|
1059
|
-
}
|
|
1060
1045
|
function startRealtimeKanban(config2) {
|
|
1061
|
-
const { agentIds, onTodayItem,
|
|
1046
|
+
const { agentIds, onTodayItem, log: log2 } = config2;
|
|
1062
1047
|
if (agentIds.length === 0) return;
|
|
1063
1048
|
const sb = ensureClient(config2);
|
|
1064
1049
|
const filterStr = agentIds.length === 1 ? `agent_id=eq.${agentIds[0]}` : `agent_id=in.(${agentIds.join(",")})`;
|
|
@@ -1085,33 +1070,6 @@ function startRealtimeKanban(config2) {
|
|
|
1085
1070
|
log2(`[realtime] Kanban item moved to 'today': "${item.title}" for agent ${item.agent_id}`);
|
|
1086
1071
|
onTodayItem(item);
|
|
1087
1072
|
}
|
|
1088
|
-
if (onCompletion && (item.status === "done" || item.status === "failed") && old.status !== item.status) {
|
|
1089
|
-
const event = {
|
|
1090
|
-
agent_id: item.agent_id,
|
|
1091
|
-
item_id: item.id,
|
|
1092
|
-
status: item.status,
|
|
1093
|
-
last_actor_id: item.last_actor_id ?? null,
|
|
1094
|
-
completed_at: item.completed_at ?? null,
|
|
1095
|
-
title: item.title
|
|
1096
|
-
};
|
|
1097
|
-
if (isSelfCompletion(event)) {
|
|
1098
|
-
kanbanMetrics.suppressedSelfActor++;
|
|
1099
|
-
return;
|
|
1100
|
-
}
|
|
1101
|
-
const commitTs = payload.commit_timestamp;
|
|
1102
|
-
const latencyMs = commitTs ? Math.max(0, Date.now() - new Date(commitTs).getTime()) : 0;
|
|
1103
|
-
try {
|
|
1104
|
-
onCompletion(event);
|
|
1105
|
-
recordLatency(latencyMs);
|
|
1106
|
-
kanbanMetrics.delivered++;
|
|
1107
|
-
log2(
|
|
1108
|
-
`[realtime] Kanban completion: agent=${item.agent_id} item=${item.id} status=${item.status} actor=${item.last_actor_id ?? "unknown"} latency_ms=${latencyMs}`
|
|
1109
|
-
);
|
|
1110
|
-
} catch (err) {
|
|
1111
|
-
kanbanMetrics.dropped++;
|
|
1112
|
-
log2(`[realtime] Kanban completion handler error: ${err.message}`);
|
|
1113
|
-
}
|
|
1114
|
-
}
|
|
1115
1073
|
}).subscribe((status) => {
|
|
1116
1074
|
if (status === "SUBSCRIBED") {
|
|
1117
1075
|
log2("[realtime] Kanban channel connected");
|
|
@@ -1120,7 +1078,6 @@ function startRealtimeKanban(config2) {
|
|
|
1120
1078
|
}
|
|
1121
1079
|
});
|
|
1122
1080
|
log2(`[realtime] Subscribing to agent_kanban_items for ${agentIds.length} agent(s)`);
|
|
1123
|
-
void formatActorId;
|
|
1124
1081
|
}
|
|
1125
1082
|
function startRealtimePluginContext(config2) {
|
|
1126
1083
|
const { agentIds, onContextChange, log: log2 } = config2;
|
|
@@ -4030,18 +3987,6 @@ function ensureRealtimeKanbanStarted(agentStates) {
|
|
|
4030
3987
|
}
|
|
4031
3988
|
}
|
|
4032
3989
|
},
|
|
4033
|
-
// ENG-4507: kanban completion notification — surfaces user-driven
|
|
4034
|
-
// closures to the daemon log + telemetry surface. The agent-runtime
|
|
4035
|
-
// ingestion path is the kanban_list `closed_by` annotation (no live
|
|
4036
|
-
// injection in this slice — the agent reads its board between turns
|
|
4037
|
-
// and sees the new state naturally).
|
|
4038
|
-
onCompletion: (event) => {
|
|
4039
|
-
const agent = agentStates.find((a) => a.agentId === event.agent_id);
|
|
4040
|
-
const codeName = agent?.codeName ?? event.agent_id;
|
|
4041
|
-
log(
|
|
4042
|
-
`[realtime] Kanban completion forwarded for '${codeName}': item=${event.item_id} status=${event.status} actor=${event.last_actor_id ?? "unknown"}`
|
|
4043
|
-
);
|
|
4044
|
-
},
|
|
4045
3990
|
log
|
|
4046
3991
|
});
|
|
4047
3992
|
realtimeKanbanStarted = true;
|