chatroom-cli 1.2.7 → 1.3.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.js +32 -31
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11387,24 +11387,23 @@ Two requirements:
|
|
|
11387
11387
|
|
|
11388
11388
|
⚠️ WHEN THE PROCESS IS TERMINATED OR TIMED OUT
|
|
11389
11389
|
|
|
11390
|
-
\`\`\`
|
|
11391
|
-
|
|
11392
|
-
|
|
11393
|
-
|
|
11394
|
-
|
|
11395
|
-
|
|
11396
|
-
|
|
11397
|
-
|
|
11398
|
-
:Reconnect immediately;
|
|
11399
|
-
note right: Team cannot reach you without it
|
|
11400
|
-
endif
|
|
11401
|
-
stop
|
|
11402
|
-
@enduml
|
|
11390
|
+
\`\`\`mermaid
|
|
11391
|
+
flowchart TD
|
|
11392
|
+
A([Start]) --> B[Command terminated unexpectedly]
|
|
11393
|
+
B --> C{Urgent pending work?}
|
|
11394
|
+
C -->|yes| D[Finish urgent work]
|
|
11395
|
+
D --> E[Reconnect with get-next-task]
|
|
11396
|
+
C -->|no| E
|
|
11397
|
+
E --> F([Stop])
|
|
11403
11398
|
\`\`\`
|
|
11404
11399
|
|
|
11405
11400
|
\uD83D\uDCCB BACKLOG TASKS
|
|
11406
11401
|
chatroom backlog list --chatroom-id=<chatroomId> --role=<role> --status=backlog
|
|
11407
|
-
chatroom backlog --help
|
|
11402
|
+
chatroom backlog --help
|
|
11403
|
+
|
|
11404
|
+
\uD83D\uDCCB CONTEXT RECOVERY (after compaction/summarization)
|
|
11405
|
+
If your context was compacted, run: chatroom get-system-prompt --chatroom-id=<id> --role=<role>
|
|
11406
|
+
to reload your full system and role prompt.`;
|
|
11408
11407
|
}
|
|
11409
11408
|
var init_reminder = () => {};
|
|
11410
11409
|
// ../../services/backend/prompts/config/index.ts
|
|
@@ -11454,6 +11453,7 @@ var init_utils = __esm(() => {
|
|
|
11454
11453
|
// ../../services/backend/prompts/base/shared/getting-started-content.ts
|
|
11455
11454
|
var init_getting_started_content = __esm(() => {
|
|
11456
11455
|
init_utils();
|
|
11456
|
+
init_reminder();
|
|
11457
11457
|
});
|
|
11458
11458
|
|
|
11459
11459
|
// ../../services/backend/prompts/cli/index.ts
|
|
@@ -11791,18 +11791,6 @@ async function getNextTask(chatroomId, options) {
|
|
|
11791
11791
|
harnessVersions: machineInfo.harnessVersions,
|
|
11792
11792
|
availableModels
|
|
11793
11793
|
});
|
|
11794
|
-
const agentType = options.agentType ?? (machineInfo.availableHarnesses.length > 0 ? machineInfo.availableHarnesses[0] : undefined);
|
|
11795
|
-
if (agentType) {
|
|
11796
|
-
const workingDir = process.cwd();
|
|
11797
|
-
await client2.mutation(api.machines.updateAgentConfig, {
|
|
11798
|
-
sessionId,
|
|
11799
|
-
machineId: machineInfo.machineId,
|
|
11800
|
-
chatroomId,
|
|
11801
|
-
role,
|
|
11802
|
-
agentType,
|
|
11803
|
-
workingDir
|
|
11804
|
-
});
|
|
11805
|
-
}
|
|
11806
11794
|
} catch (machineError) {
|
|
11807
11795
|
if (!silent) {
|
|
11808
11796
|
console.warn(`⚠️ Machine registration failed: ${sanitizeUnknownForTerminal(machineError.message)}`);
|
|
@@ -12484,7 +12472,6 @@ async function listBacklog(chatroomId, options, deps) {
|
|
|
12484
12472
|
"pending",
|
|
12485
12473
|
"acknowledged",
|
|
12486
12474
|
"in_progress",
|
|
12487
|
-
"queued",
|
|
12488
12475
|
"backlog",
|
|
12489
12476
|
"backlog_acknowledged",
|
|
12490
12477
|
"completed",
|
|
@@ -12845,8 +12832,6 @@ function getStatusEmoji(status) {
|
|
|
12845
12832
|
return "\uD83D\uDCEC";
|
|
12846
12833
|
case "in_progress":
|
|
12847
12834
|
return "\uD83D\uDD35";
|
|
12848
|
-
case "queued":
|
|
12849
|
-
return "\uD83D\uDFE1";
|
|
12850
12835
|
case "backlog":
|
|
12851
12836
|
return "⚪";
|
|
12852
12837
|
case "backlog_acknowledged":
|
|
@@ -13791,6 +13776,17 @@ var init_on_daemon_shutdown = __esm(() => {
|
|
|
13791
13776
|
init_api3();
|
|
13792
13777
|
});
|
|
13793
13778
|
|
|
13779
|
+
// src/infrastructure/machine/stop-reason.ts
|
|
13780
|
+
function resolveStopReason(code2, signal, wasIntentional) {
|
|
13781
|
+
if (wasIntentional)
|
|
13782
|
+
return "intentional_stop";
|
|
13783
|
+
if (signal !== null)
|
|
13784
|
+
return "process_terminated_with_signal";
|
|
13785
|
+
if (code2 === 0)
|
|
13786
|
+
return "process_exited_with_success";
|
|
13787
|
+
return "process_terminated_unexpectedly";
|
|
13788
|
+
}
|
|
13789
|
+
|
|
13794
13790
|
// src/commands/machine/daemon-start/handlers/start-agent.ts
|
|
13795
13791
|
async function executeStartAgent(ctx, args) {
|
|
13796
13792
|
const { chatroomId, role, agentHarness, model, workingDir, reason } = args;
|
|
@@ -13905,12 +13901,14 @@ async function executeStartAgent(ctx, args) {
|
|
|
13905
13901
|
});
|
|
13906
13902
|
spawnResult.onExit(({ code: code2, signal }) => {
|
|
13907
13903
|
const wasIntentional = ctx.deps.stops.consume(chatroomId, role);
|
|
13904
|
+
const stopReason = resolveStopReason(code2, signal, wasIntentional);
|
|
13908
13905
|
ctx.events.emit("agent:exited", {
|
|
13909
13906
|
chatroomId,
|
|
13910
13907
|
role,
|
|
13911
13908
|
pid,
|
|
13912
13909
|
code: code2,
|
|
13913
13910
|
signal,
|
|
13911
|
+
stopReason,
|
|
13914
13912
|
intentional: wasIntentional
|
|
13915
13913
|
});
|
|
13916
13914
|
});
|
|
@@ -14337,8 +14335,9 @@ class DaemonEventBus {
|
|
|
14337
14335
|
|
|
14338
14336
|
// src/events/daemon/agent/on-agent-exited.ts
|
|
14339
14337
|
function onAgentExited(ctx, payload) {
|
|
14340
|
-
const { chatroomId, role, pid, code: code2, signal, intentional } = payload;
|
|
14338
|
+
const { chatroomId, role, pid, code: code2, signal, stopReason, intentional } = payload;
|
|
14341
14339
|
const ts = formatTimestamp();
|
|
14340
|
+
console.log(`[${ts}] Agent stopped: ${stopReason} (${role})`);
|
|
14342
14341
|
if (intentional) {
|
|
14343
14342
|
console.log(`[${ts}] ℹ️ Agent process exited after intentional stop ` + `(PID: ${pid}, role: ${role}, code: ${code2}, signal: ${signal})`);
|
|
14344
14343
|
} else {
|
|
@@ -14351,6 +14350,8 @@ function onAgentExited(ctx, payload) {
|
|
|
14351
14350
|
role,
|
|
14352
14351
|
pid,
|
|
14353
14352
|
intentional,
|
|
14353
|
+
stopReason,
|
|
14354
|
+
stopSignal: stopReason === "process_terminated_with_signal" ? signal ?? undefined : undefined,
|
|
14354
14355
|
exitCode: code2 ?? undefined,
|
|
14355
14356
|
signal: signal ?? undefined
|
|
14356
14357
|
}).catch((err) => {
|
|
@@ -15292,7 +15293,7 @@ program2.command("report-progress").description("Report progress on current task
|
|
|
15292
15293
|
});
|
|
15293
15294
|
});
|
|
15294
15295
|
var backlogCommand = program2.command("backlog").description("Manage task queue and backlog");
|
|
15295
|
-
backlogCommand.command("list").description("List tasks in a chatroom").requiredOption("--chatroom-id <id>", "Chatroom identifier").requiredOption("--role <role>", "Your role").requiredOption("--status <status>", "Filter by status (pending|in_progress|
|
|
15296
|
+
backlogCommand.command("list").description("List tasks in a chatroom").requiredOption("--chatroom-id <id>", "Chatroom identifier").requiredOption("--role <role>", "Your role").requiredOption("--status <status>", "Filter by status (pending|in_progress|backlog|completed|cancelled|active|pending_review|archived|all)").option("--limit <n>", "Maximum number of tasks to show (required for --status=all)").option("--full", "Show full task content without truncation").action(async (options) => {
|
|
15296
15297
|
if (options.status === "all" && !options.limit) {
|
|
15297
15298
|
console.error("❌ When using --status=all, you must specify --limit=<n>");
|
|
15298
15299
|
console.error(" Example: chatroom backlog list --chatroom-id=<id> --role=builder --status=all --limit=50");
|