chatroom-cli 1.86.2 → 1.87.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 +221 -54
- package/dist/index.js.map +19 -18
- package/dist/node-launch.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -30071,10 +30071,25 @@ function closeCursorAgentOnFailure(agent, session2, exitCode, force = false) {
|
|
|
30071
30071
|
} catch {}
|
|
30072
30072
|
}
|
|
30073
30073
|
|
|
30074
|
+
// src/infrastructure/services/remote-agents/cursor-sdk/cursor-sdk-stream-fallback.ts
|
|
30075
|
+
function truncateJson(value) {
|
|
30076
|
+
const raw = JSON.stringify(value);
|
|
30077
|
+
return raw.length <= MAX_LOG_CHARS ? raw : `${raw.slice(0, MAX_LOG_CHARS)}…`;
|
|
30078
|
+
}
|
|
30079
|
+
function logUnhandledSdkMessage(logPrefix, message, writeLine) {
|
|
30080
|
+
writeLine(formatAgentLogLine(logPrefix, "stream:unhandled", `${message.type}: ${truncateJson(message)}`));
|
|
30081
|
+
}
|
|
30082
|
+
function logUnhandledInteractionDelta(logPrefix, update5, writeLine) {
|
|
30083
|
+
writeLine(formatAgentLogLine(logPrefix, "delta:unhandled", `${update5.type}: ${truncateJson(update5)}`));
|
|
30084
|
+
}
|
|
30085
|
+
var MAX_LOG_CHARS = 500;
|
|
30086
|
+
var init_cursor_sdk_stream_fallback = () => {};
|
|
30087
|
+
|
|
30074
30088
|
// src/infrastructure/services/remote-agents/cursor-sdk/cursor-sdk-stream-adapter.ts
|
|
30075
30089
|
var CursorSdkStreamAdapter;
|
|
30076
30090
|
var init_cursor_sdk_stream_adapter = __esm(() => {
|
|
30077
30091
|
init_native_stream_adapter_base();
|
|
30092
|
+
init_cursor_sdk_stream_fallback();
|
|
30078
30093
|
CursorSdkStreamAdapter = class CursorSdkStreamAdapter extends NativeStreamAdapterBase {
|
|
30079
30094
|
textBuffer = "";
|
|
30080
30095
|
handleMessage(message) {
|
|
@@ -30116,13 +30131,48 @@ var init_cursor_sdk_stream_adapter = __esm(() => {
|
|
|
30116
30131
|
break;
|
|
30117
30132
|
case "usage":
|
|
30118
30133
|
break;
|
|
30119
|
-
|
|
30120
|
-
|
|
30121
|
-
|
|
30122
|
-
this.writeLine(formatAgentLogLine(this.logPrefix, "stream", `unhandled type: ${unknown.type}`));
|
|
30123
|
-
}
|
|
30134
|
+
case "user":
|
|
30135
|
+
case "request":
|
|
30136
|
+
logUnhandledSdkMessage(this.logPrefix, message, (line) => this.writeLine(line));
|
|
30124
30137
|
break;
|
|
30125
|
-
|
|
30138
|
+
default:
|
|
30139
|
+
logUnhandledSdkMessage(this.logPrefix, message, (line) => this.writeLine(line));
|
|
30140
|
+
break;
|
|
30141
|
+
}
|
|
30142
|
+
}
|
|
30143
|
+
handleInteractionDelta(update5) {
|
|
30144
|
+
this.notifyOutput();
|
|
30145
|
+
switch (update5.type) {
|
|
30146
|
+
case "text-delta":
|
|
30147
|
+
this.appendAssistantText(update5.text);
|
|
30148
|
+
break;
|
|
30149
|
+
case "thinking-delta":
|
|
30150
|
+
this.writeLine(formatAgentLogLine(this.logPrefix, "thinking", update5.text));
|
|
30151
|
+
break;
|
|
30152
|
+
case "tool-call-started":
|
|
30153
|
+
this.flushText();
|
|
30154
|
+
this.logToolCallStarted(update5);
|
|
30155
|
+
break;
|
|
30156
|
+
case "tool-call-completed":
|
|
30157
|
+
this.flushText();
|
|
30158
|
+
break;
|
|
30159
|
+
case "tool-call-delta":
|
|
30160
|
+
this.handleToolCallDelta(update5);
|
|
30161
|
+
break;
|
|
30162
|
+
case "turn-ended":
|
|
30163
|
+
case "thinking-completed":
|
|
30164
|
+
case "token-delta":
|
|
30165
|
+
case "summary-started":
|
|
30166
|
+
case "summary-completed":
|
|
30167
|
+
case "summary":
|
|
30168
|
+
case "user-message-appended":
|
|
30169
|
+
case "partial-tool-call":
|
|
30170
|
+
case "shell-output-delta":
|
|
30171
|
+
case "step-started":
|
|
30172
|
+
case "step-completed":
|
|
30173
|
+
break;
|
|
30174
|
+
default:
|
|
30175
|
+
logUnhandledInteractionDelta(this.logPrefix, update5, (line) => this.writeLine(line));
|
|
30126
30176
|
}
|
|
30127
30177
|
}
|
|
30128
30178
|
flushPendingOutput() {
|
|
@@ -30135,15 +30185,47 @@ var init_cursor_sdk_stream_adapter = __esm(() => {
|
|
|
30135
30185
|
handleAssistant(message) {
|
|
30136
30186
|
for (const block of message.message.content) {
|
|
30137
30187
|
if (block.type === "text") {
|
|
30138
|
-
this.
|
|
30139
|
-
this.assistantTextCapture.captureAssistantText(block.text);
|
|
30140
|
-
if (this.textBuffer.includes(`
|
|
30141
|
-
`)) {
|
|
30142
|
-
this.flushText();
|
|
30143
|
-
}
|
|
30188
|
+
this.appendAssistantText(block.text);
|
|
30144
30189
|
}
|
|
30145
30190
|
}
|
|
30146
30191
|
}
|
|
30192
|
+
appendAssistantText(text) {
|
|
30193
|
+
this.textBuffer += text;
|
|
30194
|
+
this.assistantTextCapture.captureAssistantText(text);
|
|
30195
|
+
if (this.textBuffer.includes(`
|
|
30196
|
+
`))
|
|
30197
|
+
this.flushText();
|
|
30198
|
+
}
|
|
30199
|
+
handleToolCallDelta(update5) {
|
|
30200
|
+
const nested2 = update5.taskUpdate;
|
|
30201
|
+
switch (nested2.type) {
|
|
30202
|
+
case "text-delta":
|
|
30203
|
+
this.appendAssistantText(nested2.text);
|
|
30204
|
+
break;
|
|
30205
|
+
case "tool-call-started":
|
|
30206
|
+
this.flushText();
|
|
30207
|
+
this.logToolCallStarted(nested2);
|
|
30208
|
+
break;
|
|
30209
|
+
case "tool-call-completed":
|
|
30210
|
+
case "thinking-delta":
|
|
30211
|
+
case "thinking-completed":
|
|
30212
|
+
case "partial-tool-call":
|
|
30213
|
+
case "step-started":
|
|
30214
|
+
case "step-completed":
|
|
30215
|
+
break;
|
|
30216
|
+
default:
|
|
30217
|
+
logUnhandledInteractionDelta(this.logPrefix, nested2, (line) => this.writeLine(line));
|
|
30218
|
+
}
|
|
30219
|
+
}
|
|
30220
|
+
logToolCallStarted(update5) {
|
|
30221
|
+
const toolCall = update5.toolCall;
|
|
30222
|
+
const command = toolCall.type === "shell" ? toolCall.args?.command : undefined;
|
|
30223
|
+
if (command) {
|
|
30224
|
+
this.writeLine(formatAgentLogLine(this.logPrefix, BASH_TOOL_KIND, formatBashRunningPayload(command)));
|
|
30225
|
+
return;
|
|
30226
|
+
}
|
|
30227
|
+
this.writeLine(formatAgentLogLine(this.logPrefix, `tool: ${update5.callId} ${toolCall.type}`, JSON.stringify(toolCall.args ?? {})));
|
|
30228
|
+
}
|
|
30147
30229
|
flushText() {
|
|
30148
30230
|
if (!this.textBuffer)
|
|
30149
30231
|
return;
|
|
@@ -30533,13 +30615,17 @@ ${deferredResume}` : deferredResume;
|
|
|
30533
30615
|
};
|
|
30534
30616
|
const restoreStreamTap = tapProcessStreamWrites(notifyHarnessOutput);
|
|
30535
30617
|
try {
|
|
30618
|
+
let adapter;
|
|
30536
30619
|
const run3 = await withTimeout(agent.send(nextPrompt, {
|
|
30537
30620
|
local: { force: isFirstTurn },
|
|
30538
|
-
idempotencyKey: randomUUID2()
|
|
30621
|
+
idempotencyKey: randomUUID2(),
|
|
30622
|
+
onDelta: ({ update: update5 }) => {
|
|
30623
|
+
adapter?.handleInteractionDelta(update5);
|
|
30624
|
+
}
|
|
30539
30625
|
}), SEND_TIMEOUT_MS, "agent.send");
|
|
30540
30626
|
session2.run = run3;
|
|
30541
30627
|
isFirstTurn = false;
|
|
30542
|
-
|
|
30628
|
+
adapter = new CursorSdkStreamAdapter(logPrefix, emitLogLine);
|
|
30543
30629
|
wireNativeStreamAdapter({
|
|
30544
30630
|
adapter,
|
|
30545
30631
|
assistantTextCallbacks,
|
|
@@ -77279,6 +77365,10 @@ function renderWebappUxHandoffReference() {
|
|
|
77279
77365
|
"2. **Patterns** — matches existing components? recommend one if multiple. mobile vs desktop (md: variants vs separate mobile UI)?",
|
|
77280
77366
|
"3. **Layout** — compact title+menu row, description, trailing end-aligned CTA? unnecessary wrappers?",
|
|
77281
77367
|
"4. **Shortcuts** — consistent with catalog below? gaps or conflicts?",
|
|
77368
|
+
"5. **States** — loading spinners/skeletons for async data? error messages on failure? empty states?",
|
|
77369
|
+
"6. **Error boundaries** — risky subtrees wrapped so a throw does not crash the whole app? failure isolated from the dashboard?",
|
|
77370
|
+
"7. **Alignment** — traced parent layout before leaf styles? position/height match siblings? snapshot test to map hierarchy?",
|
|
77371
|
+
'8. **Feedback** — immediate pending state on async actions (e.g. ⌘Enter save → button "Saving...")?',
|
|
77282
77372
|
"",
|
|
77283
77373
|
"### Flow complexity",
|
|
77284
77374
|
"- Primary action ≤3 clicks from entry point",
|
|
@@ -77310,6 +77400,30 @@ function renderWebappUxHandoffReference() {
|
|
|
77310
77400
|
"- Reuse `CardHeader` + `CardAction` grid (`grid-cols-[1fr_auto]`) or equivalent flex `justify-between`",
|
|
77311
77401
|
"- Flag multi-row chrome that could collapse (menu on its own row, CTA left-aligned when end-aligned matches existing cards)",
|
|
77312
77402
|
"",
|
|
77403
|
+
"### Error & loading states",
|
|
77404
|
+
"- Initial fetch: `ChatroomLoader` centered (see `ChatroomTimelineFeed`, `ConversationSlicePanel`)",
|
|
77405
|
+
"- Pagination: `isLoadingOlder` / `isLoadingMore` inline loader at scroll edge",
|
|
77406
|
+
"- Save mutations: inline success/error text beside button (`AgentSettingsModal` `saveResult` pattern)",
|
|
77407
|
+
"- Never leave blank panels on fetch failure — show error message or retry affordance",
|
|
77408
|
+
"- Disable interactive controls while `isLoading` / `isPending`",
|
|
77409
|
+
"",
|
|
77410
|
+
"### Error boundaries",
|
|
77411
|
+
"- Wrap data-dependent or third-party subtrees with `ErrorBoundary` (chatroom) or rely on `SentryErrorBoundary` (root) / `AuthErrorBoundary` (app shell)",
|
|
77412
|
+
"- A single component throw must not unmount the entire dashboard — scope boundaries to the failing panel/section",
|
|
77413
|
+
"- Provide fallback UI with recovery action (reload button pattern in `ErrorBoundary.tsx`)",
|
|
77414
|
+
"",
|
|
77415
|
+
"### Alignment & component hierarchy",
|
|
77416
|
+
"- Before styling a leaf component, trace parent flex/grid — sticky headers, `grid-cols-[1fr_auto_1fr]` timeline nav, `items-center` vs `items-start`",
|
|
77417
|
+
"- Match sibling heights and vertical rhythm (`h-7 md:h-9` density pattern)",
|
|
77418
|
+
"- Flag absolute positioning or fixed heights that fight parent layout",
|
|
77419
|
+
"- **Planner/builder shortcut:** when hierarchy is unclear, write a vitest inline snapshot (`render` + `toMatchInlineSnapshot`, the repo convention in backend prompt tests) to inspect the full component tree before deciding leaf styles — remove or keep the snapshot based on team preference. Webapp currently has no snapshot-test precedent, so treat this as a diagnostic tool, not a convention to mandate.",
|
|
77420
|
+
"",
|
|
77421
|
+
"### Fast user feedback",
|
|
77422
|
+
"- Async actions triggered by keyboard (`⌘Enter` via `isModEnterKey`) or click must show **immediate** UI response",
|
|
77423
|
+
"- Canonical pattern: `isSaving` / `isPending` local state → button label `Saving...`, `disabled` while in flight (`AgentSettingsModal`)",
|
|
77424
|
+
"- Show inline error on failure; brief success confirmation optional",
|
|
77425
|
+
'- Pair shortcut hints with pending state ("Press ⌘Enter to save" only when save shows pending feedback)',
|
|
77426
|
+
"",
|
|
77313
77427
|
"### Keyboard shortcuts (reference)",
|
|
77314
77428
|
"| Shortcut | Action |",
|
|
77315
77429
|
"|----------|--------|",
|
|
@@ -77356,6 +77470,10 @@ function getEnhancerFeedbackTemplateBody() {
|
|
|
77356
77470
|
- **Patterns:** <which existing pattern fits; recommend one if multiple; mobile vs desktop>
|
|
77357
77471
|
- **Layout:** <compact rows, trailing CTAs, unnecessary wrappers>
|
|
77358
77472
|
- **Shortcuts:** <alignment with catalog; gaps or conflicts>
|
|
77473
|
+
- **States:** <loading/error/empty coverage for async surfaces>
|
|
77474
|
+
- **Error boundaries:** <error boundary placement; failure isolated from the whole app>
|
|
77475
|
+
- **Alignment:** <hierarchy traced; position/height issues; inline snapshot consideration>
|
|
77476
|
+
- **Feedback:** <immediate pending state on async actions; ⌘Enter + button state>
|
|
77359
77477
|
</handoff-ux>
|
|
77360
77478
|
|
|
77361
77479
|
<handoff-notes>
|
|
@@ -78109,9 +78227,6 @@ var init_classification_guide = __esm(() => {
|
|
|
78109
78227
|
init_utils3();
|
|
78110
78228
|
});
|
|
78111
78229
|
|
|
78112
|
-
// ../../services/backend/prompts/sections/current-classification.ts
|
|
78113
|
-
var init_current_classification = () => {};
|
|
78114
|
-
|
|
78115
78230
|
// ../../services/backend/prompts/sections/getting-started.ts
|
|
78116
78231
|
var init_getting_started = __esm(() => {
|
|
78117
78232
|
init_getting_started_content();
|
|
@@ -78379,7 +78494,6 @@ var init_generator = __esm(() => {
|
|
|
78379
78494
|
init_system_prompt();
|
|
78380
78495
|
init_classification_guide();
|
|
78381
78496
|
init_commands_reference();
|
|
78382
|
-
init_current_classification();
|
|
78383
78497
|
init_getting_started();
|
|
78384
78498
|
init_glossary();
|
|
78385
78499
|
init_handoff_options();
|
|
@@ -80200,9 +80314,8 @@ async function createDefaultDeps14() {
|
|
|
80200
80314
|
};
|
|
80201
80315
|
}
|
|
80202
80316
|
function formatBadges(message) {
|
|
80203
|
-
const classification = message.classification ? ` [${message.classification.toUpperCase()}]` : "";
|
|
80204
80317
|
const status3 = message.taskStatus ? ` (${message.taskStatus})` : "";
|
|
80205
|
-
return `${
|
|
80318
|
+
return `${status3}`;
|
|
80206
80319
|
}
|
|
80207
80320
|
function logMessageContent(content, full) {
|
|
80208
80321
|
if (full) {
|
|
@@ -80291,9 +80404,6 @@ var listBySenderRoleEffect = (chatroomId, options) => exports_Effect.gen(functio
|
|
|
80291
80404
|
if (message.targetRole) {
|
|
80292
80405
|
console.log(` Target: ${message.targetRole}`);
|
|
80293
80406
|
}
|
|
80294
|
-
if (message.featureTitle) {
|
|
80295
|
-
console.log(` Title: ${message.featureTitle}`);
|
|
80296
|
-
}
|
|
80297
80407
|
logMessageContent(message.content, options.full ?? false);
|
|
80298
80408
|
}
|
|
80299
80409
|
console.log(`
|
|
@@ -80336,9 +80446,6 @@ ${roleIndicator} ${message.senderRole}${message.targetRole ? ` → ${message.tar
|
|
|
80336
80446
|
console.log(` ID: ${message._id}`);
|
|
80337
80447
|
console.log(` Time: ${timestamp}`);
|
|
80338
80448
|
console.log(` Type: ${message.type}${badges}`);
|
|
80339
|
-
if (message.featureTitle) {
|
|
80340
|
-
console.log(` Title: ${message.featureTitle}`);
|
|
80341
|
-
}
|
|
80342
80449
|
logMessageContent(message.content, options.full ?? false);
|
|
80343
80450
|
}
|
|
80344
80451
|
console.log(`
|
|
@@ -80458,7 +80565,10 @@ var readContextEffect = (chatroomId, options) => exports_Effect.gen(function* ()
|
|
|
80458
80565
|
sessionId,
|
|
80459
80566
|
chatroomId,
|
|
80460
80567
|
role: options.role
|
|
80461
|
-
}).pipe(exports_Effect.mapError((cause3) => ({
|
|
80568
|
+
}).pipe(exports_Effect.mapError((cause3) => ({
|
|
80569
|
+
_tag: "ReadContextFailed",
|
|
80570
|
+
cause: cause3
|
|
80571
|
+
})));
|
|
80462
80572
|
yield* exports_Effect.sync(() => {
|
|
80463
80573
|
if (context5.messages.length === 0 && !context5.currentContext) {
|
|
80464
80574
|
console.log(`<context role="${options.role}">`);
|
|
@@ -80488,12 +80598,6 @@ var readContextEffect = (chatroomId, options) => exports_Effect.gen(function* ()
|
|
|
80488
80598
|
\uD83C\uDFAF Origin Message:`);
|
|
80489
80599
|
console.log(` ID: ${context5.originMessage._id}`);
|
|
80490
80600
|
console.log(` Time: ${new Date(context5.originMessage._creationTime).toLocaleString()}`);
|
|
80491
|
-
if (context5.classification) {
|
|
80492
|
-
console.log(` Classification: ${context5.classification.toUpperCase()}`);
|
|
80493
|
-
}
|
|
80494
|
-
if (context5.originMessage.featureTitle) {
|
|
80495
|
-
console.log(` Feature: ${context5.originMessage.featureTitle}`);
|
|
80496
|
-
}
|
|
80497
80601
|
}
|
|
80498
80602
|
console.log(`
|
|
80499
80603
|
\uD83D\uDCCA Status:`);
|
|
@@ -80504,11 +80608,7 @@ var readContextEffect = (chatroomId, options) => exports_Effect.gen(function* ()
|
|
|
80504
80608
|
console.log("─".repeat(60));
|
|
80505
80609
|
for (const message of context5.messages) {
|
|
80506
80610
|
const toAttr = message.targetRole ? ` to="${message.targetRole}"` : "";
|
|
80507
|
-
|
|
80508
|
-
console.log(`<message id="${message._id}" from="${message.senderRole}"${toAttr} type="${message.type}"${classAttr}>`);
|
|
80509
|
-
if (message.featureTitle) {
|
|
80510
|
-
console.log(` Feature: ${sanitizeForTerminal(message.featureTitle)}`);
|
|
80511
|
-
}
|
|
80611
|
+
console.log(`<message id="${message._id}" from="${message.senderRole}"${toAttr} type="${message.type}">`);
|
|
80512
80612
|
if (message.taskId) {
|
|
80513
80613
|
console.log(` Task:`);
|
|
80514
80614
|
console.log(` ID: ${message.taskId}`);
|
|
@@ -80595,7 +80695,10 @@ var readContextEffect = (chatroomId, options) => exports_Effect.gen(function* ()
|
|
|
80595
80695
|
sessionId,
|
|
80596
80696
|
chatroomId,
|
|
80597
80697
|
limit: options.limit ?? 10
|
|
80598
|
-
}).pipe(exports_Effect.mapError((cause3) => ({
|
|
80698
|
+
}).pipe(exports_Effect.mapError((cause3) => ({
|
|
80699
|
+
_tag: "ListContextsFailed",
|
|
80700
|
+
cause: cause3
|
|
80701
|
+
})));
|
|
80599
80702
|
yield* exports_Effect.sync(() => {
|
|
80600
80703
|
if (contexts.length === 0) {
|
|
80601
80704
|
console.log(`
|
|
@@ -80632,7 +80735,10 @@ var readContextEffect = (chatroomId, options) => exports_Effect.gen(function* ()
|
|
|
80632
80735
|
const context5 = yield* backend2.query(api.contexts.getContext, {
|
|
80633
80736
|
sessionId,
|
|
80634
80737
|
contextId: options.contextId
|
|
80635
|
-
}).pipe(exports_Effect.mapError((cause3) => ({
|
|
80738
|
+
}).pipe(exports_Effect.mapError((cause3) => ({
|
|
80739
|
+
_tag: "InspectContextFailed",
|
|
80740
|
+
cause: cause3
|
|
80741
|
+
})));
|
|
80636
80742
|
yield* exports_Effect.sync(() => {
|
|
80637
80743
|
console.log(`
|
|
80638
80744
|
\uD83D\uDCCB CONTEXT DETAILS`);
|
|
@@ -81793,6 +81899,9 @@ var init_claude_sdk2 = __esm(() => {
|
|
|
81793
81899
|
|
|
81794
81900
|
// src/infrastructure/harnesses/cursor-sdk/cursor-session.ts
|
|
81795
81901
|
import { randomUUID as randomUUID6 } from "node:crypto";
|
|
81902
|
+
function warnWriteLine(line) {
|
|
81903
|
+
console.warn(line);
|
|
81904
|
+
}
|
|
81796
81905
|
|
|
81797
81906
|
class CursorSdkSession {
|
|
81798
81907
|
opencodeSessionId;
|
|
@@ -81826,7 +81935,10 @@ class CursorSdkSession {
|
|
|
81826
81935
|
const run3 = await withTimeout(this.agent.send(text, {
|
|
81827
81936
|
local: { force: isFirstTurn },
|
|
81828
81937
|
idempotencyKey: randomUUID6(),
|
|
81829
|
-
...modelId ? { model: { id: modelId } } : {}
|
|
81938
|
+
...modelId ? { model: { id: modelId } } : {},
|
|
81939
|
+
onDelta: ({ update: update6 }) => {
|
|
81940
|
+
this.handleInteractionDelta(messageId, update6);
|
|
81941
|
+
}
|
|
81830
81942
|
}), SEND_TIMEOUT_MS2, "agent.send");
|
|
81831
81943
|
for await (const message of run3.stream()) {
|
|
81832
81944
|
if (this.closed)
|
|
@@ -81870,6 +81982,38 @@ class CursorSdkSession {
|
|
|
81870
81982
|
timestamp: Date.now()
|
|
81871
81983
|
});
|
|
81872
81984
|
}
|
|
81985
|
+
handleInteractionDelta(messageId, update6) {
|
|
81986
|
+
switch (update6.type) {
|
|
81987
|
+
case "text-delta":
|
|
81988
|
+
this.emitDelta(messageId, update6.text, "text");
|
|
81989
|
+
break;
|
|
81990
|
+
case "thinking-delta":
|
|
81991
|
+
this.emitDelta(messageId, update6.text, "reasoning");
|
|
81992
|
+
break;
|
|
81993
|
+
case "tool-call-delta":
|
|
81994
|
+
if (update6.taskUpdate.type === "text-delta") {
|
|
81995
|
+
this.emitDelta(messageId, update6.taskUpdate.text, "text");
|
|
81996
|
+
}
|
|
81997
|
+
break;
|
|
81998
|
+
case "token-delta":
|
|
81999
|
+
case "tool-call-started":
|
|
82000
|
+
case "tool-call-completed":
|
|
82001
|
+
case "turn-ended":
|
|
82002
|
+
case "thinking-completed":
|
|
82003
|
+
case "summary-started":
|
|
82004
|
+
case "summary-completed":
|
|
82005
|
+
case "summary":
|
|
82006
|
+
case "user-message-appended":
|
|
82007
|
+
case "partial-tool-call":
|
|
82008
|
+
case "shell-output-delta":
|
|
82009
|
+
case "step-started":
|
|
82010
|
+
case "step-completed":
|
|
82011
|
+
break;
|
|
82012
|
+
default:
|
|
82013
|
+
logUnhandledInteractionDelta(HARNESS_LOG_PREFIX, update6, warnWriteLine);
|
|
82014
|
+
break;
|
|
82015
|
+
}
|
|
82016
|
+
}
|
|
81873
82017
|
emitFromSdkMessage(message, messageId) {
|
|
81874
82018
|
switch (message.type) {
|
|
81875
82019
|
case "assistant":
|
|
@@ -81884,7 +82028,16 @@ class CursorSdkSession {
|
|
|
81884
82028
|
this.emitDelta(messageId, message.text, "reasoning");
|
|
81885
82029
|
}
|
|
81886
82030
|
break;
|
|
82031
|
+
case "status":
|
|
82032
|
+
case "system":
|
|
82033
|
+
case "task":
|
|
82034
|
+
case "tool_call":
|
|
82035
|
+
case "usage":
|
|
82036
|
+
case "user":
|
|
82037
|
+
case "request":
|
|
82038
|
+
break;
|
|
81887
82039
|
default:
|
|
82040
|
+
logUnhandledSdkMessage(HARNESS_LOG_PREFIX, message, warnWriteLine);
|
|
81888
82041
|
break;
|
|
81889
82042
|
}
|
|
81890
82043
|
}
|
|
@@ -81894,8 +82047,10 @@ function resolveModelFromPrompt(providerID, modelID) {
|
|
|
81894
82047
|
return resolveCursorSdkModel(modelID);
|
|
81895
82048
|
return resolveCursorSdkModel(`${providerID}/${modelID}`);
|
|
81896
82049
|
}
|
|
81897
|
-
var SEND_TIMEOUT_MS2 = 60000, RUN_WAIT_TIMEOUT_MS2 = 3600000;
|
|
81898
|
-
var init_cursor_session = () => {
|
|
82050
|
+
var SEND_TIMEOUT_MS2 = 60000, RUN_WAIT_TIMEOUT_MS2 = 3600000, HARNESS_LOG_PREFIX = "[cursor-sdk-harness";
|
|
82051
|
+
var init_cursor_session = __esm(() => {
|
|
82052
|
+
init_cursor_sdk_stream_fallback();
|
|
82053
|
+
});
|
|
81899
82054
|
|
|
81900
82055
|
// src/infrastructure/harnesses/cursor-sdk/cursor-harness.ts
|
|
81901
82056
|
async function loadSdk5() {
|
|
@@ -92514,6 +92669,9 @@ function getExecutionKindForRole(role) {
|
|
|
92514
92669
|
function isTeamAgentRole(role) {
|
|
92515
92670
|
return getExecutionKindForRole(role) === "team_agent";
|
|
92516
92671
|
}
|
|
92672
|
+
function isDaemonWorkerRole(role) {
|
|
92673
|
+
return getExecutionKindForRole(role) === "daemon_worker";
|
|
92674
|
+
}
|
|
92517
92675
|
var DAEMON_WORKER_ROLES;
|
|
92518
92676
|
var init_execution_kind = __esm(() => {
|
|
92519
92677
|
DAEMON_WORKER_ROLES = new Set(["enhancer"]);
|
|
@@ -111601,6 +111759,8 @@ async function nudgeStuckTasks(tasks, now, cooldown, runtime4, effectContext2, a
|
|
|
111601
111759
|
if (isNativeHarness(row.agentConfig.agentHarness)) {
|
|
111602
111760
|
const { chatroomId, agentConfig } = row;
|
|
111603
111761
|
const { role } = agentConfig;
|
|
111762
|
+
if (!isTeamAgentRole(role))
|
|
111763
|
+
continue;
|
|
111604
111764
|
const deliveryState = getRoleDeliveryState();
|
|
111605
111765
|
const failures3 = deliveryState.recordNativeNudgeFailure(chatroomId, role);
|
|
111606
111766
|
if (shouldEscalateNativeNudgeToRestart(chatroomId, role, failures3)) {
|
|
@@ -111649,28 +111809,28 @@ async function reviveNativeTasks(tasks, localHealth, now, cooldown, runtime4, ef
|
|
|
111649
111809
|
}
|
|
111650
111810
|
}
|
|
111651
111811
|
async function processTasksUpdate(tasks, runtime4, effectContext2, cooldown, agentMgr, sessionDeps, machineId, _pass) {
|
|
111652
|
-
|
|
111653
|
-
if (
|
|
111812
|
+
const filteredTasks = filterSnapshotsExcludingRestartInFlight(tasks);
|
|
111813
|
+
if (filteredTasks.length === 0)
|
|
111654
111814
|
return;
|
|
111655
111815
|
const now = Date.now();
|
|
111656
111816
|
const localHealth = {
|
|
111657
111817
|
getSlot: (chatroomId, role) => agentMgr.getSlot(chatroomId, role),
|
|
111658
111818
|
isPidAlive: (pid) => isProcessAlive((p) => process.kill(p, 0), pid)
|
|
111659
111819
|
};
|
|
111660
|
-
await reviveNativeTasks(
|
|
111661
|
-
if (
|
|
111662
|
-
const first =
|
|
111820
|
+
await reviveNativeTasks(filteredTasks, localHealth, now, cooldown, runtime4, effectContext2, agentMgr, sessionDeps, machineId);
|
|
111821
|
+
if (filteredTasks.length > 0) {
|
|
111822
|
+
const first = filteredTasks[0];
|
|
111663
111823
|
logNativeDeliveryFallback("signal-presence", first.agentConfig.role, first.chatroomId, first.taskId);
|
|
111664
111824
|
}
|
|
111665
111825
|
getNativeTaskDeliveryCoordinator().reconcileAssignedTasks({
|
|
111666
|
-
tasks,
|
|
111826
|
+
tasks: filteredTasks,
|
|
111667
111827
|
runtime: runtime4,
|
|
111668
111828
|
effectContext: effectContext2,
|
|
111669
111829
|
agentMgr,
|
|
111670
111830
|
sessionDeps,
|
|
111671
111831
|
machineId
|
|
111672
111832
|
});
|
|
111673
|
-
await nudgeStuckTasks(
|
|
111833
|
+
await nudgeStuckTasks(filteredTasks, now, cooldown, runtime4, effectContext2, agentMgr, sessionDeps, machineId);
|
|
111674
111834
|
}
|
|
111675
111835
|
function listDeliverablePendingFromStore(agentMgr) {
|
|
111676
111836
|
if (!hasAssignedTaskSnapshot())
|
|
@@ -111829,12 +111989,13 @@ var init_task_monitor = __esm(() => {
|
|
|
111829
111989
|
init_esm();
|
|
111830
111990
|
init_daemon_services();
|
|
111831
111991
|
init_native_ready_invariant();
|
|
111832
|
-
init_restart_orchestrator_in_flight();
|
|
111833
111992
|
init_native_task_delivery_coordinator();
|
|
111834
111993
|
init_native_task_injector_logic();
|
|
111994
|
+
init_restart_orchestrator_in_flight();
|
|
111835
111995
|
init_task_monitor_logic();
|
|
111836
111996
|
init_task_monitor_snapshot();
|
|
111837
111997
|
init_api3();
|
|
111998
|
+
init_execution_kind();
|
|
111838
111999
|
init_feed_runtime();
|
|
111839
112000
|
init_assigned_task_presence();
|
|
111840
112001
|
init_assigned_task_signals();
|
|
@@ -111938,6 +112099,8 @@ async function waitForHarnessSessionId(deps, event, pid) {
|
|
|
111938
112099
|
return null;
|
|
111939
112100
|
}
|
|
111940
112101
|
async function forceNativeWaiting(deps, event) {
|
|
112102
|
+
if (!isTeamAgentRole(event.role))
|
|
112103
|
+
return;
|
|
111941
112104
|
await deps.session.backend.mutation(api.participants.join, {
|
|
111942
112105
|
sessionId: deps.session.sessionId,
|
|
111943
112106
|
chatroomId: event.chatroomId,
|
|
@@ -112075,9 +112238,10 @@ var init_restart_orchestrator = __esm(() => {
|
|
|
112075
112238
|
init_native_task_delivery_coordinator();
|
|
112076
112239
|
init_native_task_injector_logic();
|
|
112077
112240
|
init_native_task_injector();
|
|
112241
|
+
init_restart_orchestrator_in_flight();
|
|
112078
112242
|
init_api3();
|
|
112243
|
+
init_execution_kind();
|
|
112079
112244
|
init_convex_error();
|
|
112080
|
-
init_restart_orchestrator_in_flight();
|
|
112081
112245
|
});
|
|
112082
112246
|
|
|
112083
112247
|
// src/events/daemon/agent/on-request-restart-agent.ts
|
|
@@ -113538,6 +113702,8 @@ __export(exports_lifecycle_heartbeat, {
|
|
|
113538
113702
|
sendLifecycleHeartbeat: () => sendLifecycleHeartbeat
|
|
113539
113703
|
});
|
|
113540
113704
|
function sendLifecycleHeartbeat(client4, opts) {
|
|
113705
|
+
if (isDaemonWorkerRole(opts.role))
|
|
113706
|
+
return;
|
|
113541
113707
|
withRetry(() => client4.mutation(api.participants.join, {
|
|
113542
113708
|
sessionId: opts.sessionId,
|
|
113543
113709
|
chatroomId: opts.chatroomId,
|
|
@@ -113546,8 +113712,9 @@ function sendLifecycleHeartbeat(client4, opts) {
|
|
|
113546
113712
|
})).catch(() => {});
|
|
113547
113713
|
}
|
|
113548
113714
|
var init_lifecycle_heartbeat = __esm(() => {
|
|
113549
|
-
init_api3();
|
|
113550
113715
|
init_retry_queue();
|
|
113716
|
+
init_api3();
|
|
113717
|
+
init_execution_kind();
|
|
113551
113718
|
});
|
|
113552
113719
|
|
|
113553
113720
|
// ../../node_modules/.pnpm/commander@14.0.3/node_modules/commander/esm.mjs
|
|
@@ -114077,4 +114244,4 @@ program2.hook("preAction", async (_thisCommand, actionCommand) => {
|
|
|
114077
114244
|
});
|
|
114078
114245
|
program2.parse();
|
|
114079
114246
|
|
|
114080
|
-
//# debugId=
|
|
114247
|
+
//# debugId=2F3B7F5A59140F3B64756E2164756E21
|