chatroom-cli 1.42.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 +93 -48
- package/dist/index.js.map +9 -8
- 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();
|
|
@@ -73961,8 +74002,8 @@ async function pushSingleWorkspaceGitSummaryForObserved(ctx, workingDir, reason
|
|
|
73961
74002
|
const now = Date.now();
|
|
73962
74003
|
const lastFull = lastFullPushMs.get(stateKey) ?? 0;
|
|
73963
74004
|
if (now - lastFull >= OBSERVED_FULL_PUSH_INTERVAL_MS) {
|
|
73964
|
-
lastFullPushMs.set(stateKey, now);
|
|
73965
74005
|
await pushSingleWorkspaceGitState(ctx, workingDir);
|
|
74006
|
+
lastFullPushMs.set(stateKey, now);
|
|
73966
74007
|
console.log(`[${formatTimestamp()}] \uD83D\uDC41️ Observed full git state pushed: ${workingDir} (${branch})${reason === "refresh" ? " [refresh]" : ""}`);
|
|
73967
74008
|
return;
|
|
73968
74009
|
}
|
|
@@ -79322,6 +79363,10 @@ contextCommand.command("inspect").description("View a specific context with stal
|
|
|
79322
79363
|
const { inspectContext: inspectContext2 } = await Promise.resolve().then(() => (init_context2(), exports_context2));
|
|
79323
79364
|
await inspectContext2(options.chatroomId, options);
|
|
79324
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
|
+
});
|
|
79325
79370
|
var guidelinesCommand = program2.command("guidelines").description("View review guidelines by type");
|
|
79326
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) => {
|
|
79327
79372
|
await maybeRequireAuth();
|
|
@@ -79401,5 +79446,5 @@ program2.hook("preAction", async (_thisCommand, actionCommand) => {
|
|
|
79401
79446
|
});
|
|
79402
79447
|
program2.parse();
|
|
79403
79448
|
|
|
79404
|
-
//# debugId=
|
|
79449
|
+
//# debugId=1151E4B582DED8E964756E2164756E21
|
|
79405
79450
|
//# sourceMappingURL=index.js.map
|