chatroom-cli 1.41.0 → 1.43.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 +109 -49
- package/dist/index.js.map +10 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -26575,6 +26575,7 @@ var init_cursor_agent_service = __esm(() => {
|
|
|
26575
26575
|
"grok",
|
|
26576
26576
|
"kimi-k2.5",
|
|
26577
26577
|
"auto",
|
|
26578
|
+
"composer-2.5",
|
|
26578
26579
|
"composer-2",
|
|
26579
26580
|
"composer-1.5",
|
|
26580
26581
|
"composer-1"
|
|
@@ -71741,6 +71742,71 @@ var init_workflow = __esm(() => {
|
|
|
71741
71742
|
VALID_CHATROOM_SKILLS = ["backlog", "software-engineering", "code-review", "workflow"];
|
|
71742
71743
|
});
|
|
71743
71744
|
|
|
71745
|
+
// src/commands/task/read/render.ts
|
|
71746
|
+
function detectBacklogDivergence(contextContent, attachedIds) {
|
|
71747
|
+
if (!contextContent || attachedIds.length === 0) {
|
|
71748
|
+
return [];
|
|
71749
|
+
}
|
|
71750
|
+
return attachedIds.filter((id3) => !contextContent.includes(id3));
|
|
71751
|
+
}
|
|
71752
|
+
function renderTaskPrompt(input) {
|
|
71753
|
+
const { taskId, status: status3, content, chatroomId, role } = input;
|
|
71754
|
+
const lines = [];
|
|
71755
|
+
lines.push(`✅ Task content:`);
|
|
71756
|
+
lines.push(` Task ID: ${taskId}`);
|
|
71757
|
+
lines.push(` Status: ${status3}`);
|
|
71758
|
+
if (input.context) {
|
|
71759
|
+
lines.push("On conflict, the message wins over background context.");
|
|
71760
|
+
}
|
|
71761
|
+
if (input.context && input.attachedBacklogItems && input.attachedBacklogItems.length > 0) {
|
|
71762
|
+
const attachedIds = input.attachedBacklogItems.map((i2) => i2._id);
|
|
71763
|
+
const divergentIds = detectBacklogDivergence(input.context.content, attachedIds);
|
|
71764
|
+
for (const id3 of divergentIds) {
|
|
71765
|
+
lines.push(`⚠ Backlog ${id3} diverges from context — confirm scope.`);
|
|
71766
|
+
}
|
|
71767
|
+
}
|
|
71768
|
+
lines.push(`
|
|
71769
|
+
${content}`);
|
|
71770
|
+
if (input.attachedBacklogItems && input.attachedBacklogItems.length > 0) {
|
|
71771
|
+
lines.push("");
|
|
71772
|
+
lines.push("<attachments>");
|
|
71773
|
+
for (const item of input.attachedBacklogItems) {
|
|
71774
|
+
lines.push(` <attachment type="backlog-item">`);
|
|
71775
|
+
lines.push(` - [${item.status.toUpperCase()}] ${item.content}`);
|
|
71776
|
+
lines.push(` ID: ${item._id}`);
|
|
71777
|
+
lines.push(` <hint>Work on this item. When done: chatroom backlog mark-for-review --chatroom-id="${chatroomId}" --role="${role}" --backlog-item-id=${item._id}</hint>`);
|
|
71778
|
+
lines.push(` </attachment>`);
|
|
71779
|
+
}
|
|
71780
|
+
lines.push("</attachments>");
|
|
71781
|
+
}
|
|
71782
|
+
if (input.context) {
|
|
71783
|
+
lines.push("");
|
|
71784
|
+
lines.push("Background context (may be stale)");
|
|
71785
|
+
lines.push("<context>");
|
|
71786
|
+
lines.push(input.context.content);
|
|
71787
|
+
lines.push("</context>");
|
|
71788
|
+
if (input.context.triggerMessageContent) {
|
|
71789
|
+
lines.push("in response to");
|
|
71790
|
+
const senderTag = input.context.triggerMessageSenderRole ?? "unknown";
|
|
71791
|
+
lines.push(`<${senderTag}-message>`);
|
|
71792
|
+
lines.push(input.context.triggerMessageContent);
|
|
71793
|
+
lines.push(`</${senderTag}-message>`);
|
|
71794
|
+
}
|
|
71795
|
+
const hoursAgo = Math.round(input.context.elapsedHours);
|
|
71796
|
+
const msgsSince = input.context.messagesSinceContext;
|
|
71797
|
+
const isStale = hoursAgo >= 24 || msgsSince >= 50;
|
|
71798
|
+
if (isStale) {
|
|
71799
|
+
const ageLabel = hoursAgo >= 48 ? `${Math.round(hoursAgo / 24)}d old` : hoursAgo >= 24 ? `${hoursAgo}h old` : `${msgsSince} messages old`;
|
|
71800
|
+
lines.push(`<system-notice>`);
|
|
71801
|
+
lines.push(`⚠️ Context is ${ageLabel}.`);
|
|
71802
|
+
lines.push(` Entry point role will update when needed.`);
|
|
71803
|
+
lines.push(`</system-notice>`);
|
|
71804
|
+
}
|
|
71805
|
+
}
|
|
71806
|
+
return lines.join(`
|
|
71807
|
+
`);
|
|
71808
|
+
}
|
|
71809
|
+
|
|
71744
71810
|
// src/commands/task/read/index.ts
|
|
71745
71811
|
var exports_read = {};
|
|
71746
71812
|
__export(exports_read, {
|
|
@@ -71798,52 +71864,15 @@ async function taskRead(chatroomId, options, deps) {
|
|
|
71798
71864
|
role,
|
|
71799
71865
|
taskId
|
|
71800
71866
|
});
|
|
71801
|
-
console.log(
|
|
71802
|
-
|
|
71803
|
-
|
|
71804
|
-
|
|
71805
|
-
|
|
71806
|
-
|
|
71807
|
-
|
|
71808
|
-
|
|
71809
|
-
|
|
71810
|
-
console.log("</context>");
|
|
71811
|
-
if (result.context.triggerMessageContent) {
|
|
71812
|
-
console.log("in response to");
|
|
71813
|
-
const senderTag = result.context.triggerMessageSenderRole ?? "unknown";
|
|
71814
|
-
console.log(`<${senderTag}-message>`);
|
|
71815
|
-
console.log(result.context.triggerMessageContent);
|
|
71816
|
-
console.log(`</${senderTag}-message>`);
|
|
71817
|
-
}
|
|
71818
|
-
const hoursAgo = Math.round(result.context.elapsedHours);
|
|
71819
|
-
const msgsSince = result.context.messagesSinceContext;
|
|
71820
|
-
const isStale = hoursAgo >= 24 || msgsSince >= 50;
|
|
71821
|
-
if (isStale) {
|
|
71822
|
-
const ageLabel = hoursAgo >= 48 ? `${Math.round(hoursAgo / 24)}d old` : hoursAgo >= 24 ? `${hoursAgo}h old` : `${msgsSince} messages old`;
|
|
71823
|
-
console.log(`<system-notice>`);
|
|
71824
|
-
console.log(`⚠️ Context is ${ageLabel}.`);
|
|
71825
|
-
console.log(` Entry point role will update when needed.`);
|
|
71826
|
-
console.log(`</system-notice>`);
|
|
71827
|
-
}
|
|
71828
|
-
console.log("---");
|
|
71829
|
-
}
|
|
71830
|
-
console.log(`
|
|
71831
|
-
${result.content}`);
|
|
71832
|
-
if (result.attachedBacklogItems && result.attachedBacklogItems.length > 0) {
|
|
71833
|
-
console.log("");
|
|
71834
|
-
console.log("<attachments>");
|
|
71835
|
-
for (const item of result.attachedBacklogItems) {
|
|
71836
|
-
console.log(` <attachment type="backlog-item">`);
|
|
71837
|
-
console.log(` - [${item.status.toUpperCase()}] ${item.content}`);
|
|
71838
|
-
console.log(` ID: ${item._id}`);
|
|
71839
|
-
console.log(` <hint>`);
|
|
71840
|
-
console.log(` If you have completed work on a backlog item and it is ready for review, run:`);
|
|
71841
|
-
console.log(` chatroom backlog mark-for-review --chatroom-id="${chatroomId}" --role="${role}" --backlog-item-id=${item._id}`);
|
|
71842
|
-
console.log(` </hint>`);
|
|
71843
|
-
console.log(` </attachment>`);
|
|
71844
|
-
}
|
|
71845
|
-
console.log("</attachments>");
|
|
71846
|
-
}
|
|
71867
|
+
console.log(renderTaskPrompt({
|
|
71868
|
+
taskId: result.taskId,
|
|
71869
|
+
status: result.status,
|
|
71870
|
+
content: result.content,
|
|
71871
|
+
chatroomId,
|
|
71872
|
+
role,
|
|
71873
|
+
context: result.context ?? undefined,
|
|
71874
|
+
attachedBacklogItems: result.attachedBacklogItems ?? undefined
|
|
71875
|
+
}));
|
|
71847
71876
|
} catch (error) {
|
|
71848
71877
|
const err = error;
|
|
71849
71878
|
console.error(`❌ Failed to read task`);
|
|
@@ -72105,6 +72134,7 @@ var init_messages = __esm(() => {
|
|
|
72105
72134
|
// src/commands/context/index.ts
|
|
72106
72135
|
var exports_context2 = {};
|
|
72107
72136
|
__export(exports_context2, {
|
|
72137
|
+
viewTemplate: () => viewTemplate,
|
|
72108
72138
|
readContext: () => readContext,
|
|
72109
72139
|
newContext: () => newContext,
|
|
72110
72140
|
listContexts: () => listContexts,
|
|
@@ -72343,6 +72373,17 @@ async function listContexts(chatroomId, options, deps) {
|
|
|
72343
72373
|
return;
|
|
72344
72374
|
}
|
|
72345
72375
|
}
|
|
72376
|
+
function viewTemplate() {
|
|
72377
|
+
return `## Goal
|
|
72378
|
+
<user-centric goal: what the user wants>
|
|
72379
|
+
<development-centric goal: what we are building/changing>
|
|
72380
|
+
|
|
72381
|
+
## Requirements
|
|
72382
|
+
- <outcome or requirement>
|
|
72383
|
+
|
|
72384
|
+
## Avoid
|
|
72385
|
+
- <thing to not do / out of scope>`;
|
|
72386
|
+
}
|
|
72346
72387
|
async function inspectContext(chatroomId, options, deps) {
|
|
72347
72388
|
const d = deps ?? await createDefaultDeps16();
|
|
72348
72389
|
const sessionId = await d.session.getSessionId();
|
|
@@ -72833,7 +72874,10 @@ var init_featureFlags = __esm(() => {
|
|
|
72833
72874
|
});
|
|
72834
72875
|
|
|
72835
72876
|
// ../../services/backend/config/reliability.ts
|
|
72836
|
-
var DAEMON_HEARTBEAT_INTERVAL_MS = 30000, AGENT_REQUEST_DEADLINE_MS = 120000, OBSERVATION_TTL_MS = 60000, OBSERVED_SAFETY_POLL_MS = 30000;
|
|
72877
|
+
var DAEMON_HEARTBEAT_INTERVAL_MS = 30000, AGENT_REQUEST_DEADLINE_MS = 120000, OBSERVATION_TTL_MS = 60000, OBSERVED_FULL_PUSH_INTERVAL_MS, OBSERVED_SAFETY_POLL_MS = 30000;
|
|
72878
|
+
var init_reliability = __esm(() => {
|
|
72879
|
+
OBSERVED_FULL_PUSH_INTERVAL_MS = 5 * 60000;
|
|
72880
|
+
});
|
|
72837
72881
|
|
|
72838
72882
|
// src/commands/machine/daemon-start/capabilities-snapshot.ts
|
|
72839
72883
|
function harnessCapabilitiesFingerprint(harnesses, versions) {
|
|
@@ -73955,6 +73999,14 @@ async function pushSingleWorkspaceGitSummaryForObserved(ctx, workingDir, reason
|
|
|
73955
73999
|
return;
|
|
73956
74000
|
}
|
|
73957
74001
|
const branch = branchResult.branch;
|
|
74002
|
+
const now = Date.now();
|
|
74003
|
+
const lastFull = lastFullPushMs.get(stateKey) ?? 0;
|
|
74004
|
+
if (now - lastFull >= OBSERVED_FULL_PUSH_INTERVAL_MS) {
|
|
74005
|
+
await pushSingleWorkspaceGitState(ctx, workingDir);
|
|
74006
|
+
lastFullPushMs.set(stateKey, now);
|
|
74007
|
+
console.log(`[${formatTimestamp()}] \uD83D\uDC41️ Observed full git state pushed: ${workingDir} (${branch})${reason === "refresh" ? " [refresh]" : ""}`);
|
|
74008
|
+
return;
|
|
74009
|
+
}
|
|
73958
74010
|
const slimFields = [
|
|
73959
74011
|
branchField,
|
|
73960
74012
|
...GIT_STATE_FIELDS.filter((f) => f.includeInSlim),
|
|
@@ -73977,12 +74029,14 @@ async function pushSingleWorkspaceGitSummaryForObserved(ctx, workingDir, reason
|
|
|
73977
74029
|
ctx.lastPushedGitState.set(stateKey, hash2);
|
|
73978
74030
|
console.log(`[${formatTimestamp()}] \uD83D\uDC41️ Observed git summary pushed: ${workingDir} (${branch}${values3.get("isDirty") ? ", dirty" : ", clean"})${reason === "refresh" ? " [refresh]" : ""}`);
|
|
73979
74031
|
}
|
|
73980
|
-
var branchField, GIT_STATE_FIELDS;
|
|
74032
|
+
var lastFullPushMs, branchField, GIT_STATE_FIELDS;
|
|
73981
74033
|
var init_git_heartbeat = __esm(() => {
|
|
74034
|
+
init_reliability();
|
|
73982
74035
|
init_api3();
|
|
73983
74036
|
init_git_reader();
|
|
73984
74037
|
init_git_state_pipeline();
|
|
73985
74038
|
init_convex_error();
|
|
74039
|
+
lastFullPushMs = new Map;
|
|
73986
74040
|
branchField = {
|
|
73987
74041
|
key: "branch",
|
|
73988
74042
|
includeInSlim: true,
|
|
@@ -77443,6 +77497,7 @@ function startObservedSyncSubscription(ctx, wsClient2) {
|
|
|
77443
77497
|
}
|
|
77444
77498
|
}
|
|
77445
77499
|
var init_observed_sync = __esm(() => {
|
|
77500
|
+
init_reliability();
|
|
77446
77501
|
init_command_sync_heartbeat();
|
|
77447
77502
|
init_git_heartbeat();
|
|
77448
77503
|
init_api3();
|
|
@@ -78261,6 +78316,7 @@ Listening for commands...`);
|
|
|
78261
78316
|
}
|
|
78262
78317
|
var init_command_loop = __esm(() => {
|
|
78263
78318
|
init_featureFlags();
|
|
78319
|
+
init_reliability();
|
|
78264
78320
|
init_command_sync_heartbeat();
|
|
78265
78321
|
init_on_request_start_agent();
|
|
78266
78322
|
init_on_request_stop_agent();
|
|
@@ -79307,6 +79363,10 @@ contextCommand.command("inspect").description("View a specific context with stal
|
|
|
79307
79363
|
const { inspectContext: inspectContext2 } = await Promise.resolve().then(() => (init_context2(), exports_context2));
|
|
79308
79364
|
await inspectContext2(options.chatroomId, options);
|
|
79309
79365
|
});
|
|
79366
|
+
contextCommand.command("view-template").description("Print a template for `chatroom context new` content.").action(async () => {
|
|
79367
|
+
const { viewTemplate: viewTemplate2 } = await Promise.resolve().then(() => (init_context2(), exports_context2));
|
|
79368
|
+
console.log(viewTemplate2());
|
|
79369
|
+
});
|
|
79310
79370
|
var guidelinesCommand = program2.command("guidelines").description("View review guidelines by type");
|
|
79311
79371
|
guidelinesCommand.command("view").description("View guidelines for a specific review type").requiredOption("--type <type>", "Guideline type (coding|security|design|performance|all)").action(async (options) => {
|
|
79312
79372
|
await maybeRequireAuth();
|
|
@@ -79386,5 +79446,5 @@ program2.hook("preAction", async (_thisCommand, actionCommand) => {
|
|
|
79386
79446
|
});
|
|
79387
79447
|
program2.parse();
|
|
79388
79448
|
|
|
79389
|
-
//# debugId=
|
|
79449
|
+
//# debugId=1151E4B582DED8E964756E2164756E21
|
|
79390
79450
|
//# sourceMappingURL=index.js.map
|