hilos-agent 0.1.3 → 0.1.4
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/package.json +1 -1
- package/src/handler.mjs +10 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hilos-agent",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Run your own coding agent (Claude Code / Codex / Cursor) as an autonomous teammate in a hilos channel. Picks up @mentions, proposes a diff, and pushes only after a human approves — your code and credentials never leave your machine.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/src/handler.mjs
CHANGED
|
@@ -170,12 +170,15 @@ async function respondConversationally({ message, channelId, tool, me, cfg }) {
|
|
|
170
170
|
`Conversation so far:\n${transcript}`;
|
|
171
171
|
|
|
172
172
|
const parts = cfg.codingCmd.split(" ").filter(Boolean);
|
|
173
|
+
console.log(` chat → running \`${cfg.codingCmd}\`…`);
|
|
173
174
|
const run = spawnSync(parts[0], [...parts.slice(1), prompt], {
|
|
174
175
|
encoding: "utf8",
|
|
175
176
|
timeout: cfg.runTimeoutMs,
|
|
176
177
|
maxBuffer: 50 * 1024 * 1024,
|
|
177
178
|
});
|
|
178
179
|
const reply = (run.stdout || "").trim();
|
|
180
|
+
if (run.error) console.log(` ! ${parts[0]} failed to start: ${run.error.message}`);
|
|
181
|
+
console.log(` chat → ${reply ? `replied (${reply.length} chars)` : "no output"}; posting`);
|
|
179
182
|
await tool("post_message", {
|
|
180
183
|
channelId,
|
|
181
184
|
body: reply || `(my CLI returned nothing — is \`${cfg.codingCmd}\` installed and on PATH?)`,
|
|
@@ -248,15 +251,21 @@ export async function handleTask({ message, channelId, tool, me }, cfg, depsOver
|
|
|
248
251
|
|
|
249
252
|
const parts = cfg.codingCmd.split(" ").filter(Boolean);
|
|
250
253
|
const proposeRound = async (promptText) => {
|
|
254
|
+
console.log(` code → running \`${cfg.codingCmd}\` in ${repoPath}…`);
|
|
251
255
|
const run = spawnSync(parts[0], [...parts.slice(1), promptText], {
|
|
252
256
|
cwd: repoPath,
|
|
253
257
|
encoding: "utf8",
|
|
254
258
|
timeout: cfg.runTimeoutMs,
|
|
255
259
|
maxBuffer: 50 * 1024 * 1024,
|
|
256
260
|
});
|
|
261
|
+
if (run.error) console.log(` ! ${parts[0]} failed to start: ${run.error.message}`);
|
|
257
262
|
git(repoPath, ["add", "-A"]);
|
|
258
263
|
const diff = git(repoPath, ["diff", "--cached"]).stdout || "";
|
|
259
|
-
if (!diff.trim())
|
|
264
|
+
if (!diff.trim()) {
|
|
265
|
+
console.log(" code → no changes produced");
|
|
266
|
+
return { empty: true };
|
|
267
|
+
}
|
|
268
|
+
console.log(" code → diff captured; posting proposal");
|
|
260
269
|
const stat = parseShortstat(git(repoPath, ["diff", "--cached", "--shortstat"]).stdout);
|
|
261
270
|
const { text: diffText, truncated, omittedLines } = truncateDiff(diff);
|
|
262
271
|
const report = buildProposalReport({
|