@code-yeongyu/senpi 2026.8.21 → 2026.8.22-2

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.
Files changed (88) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/dist/bun-runtime.d.ts +58 -0
  3. package/dist/bun-runtime.d.ts.map +1 -0
  4. package/dist/bun-runtime.js +163 -0
  5. package/dist/bun-runtime.js.map +1 -0
  6. package/dist/cli.js +45 -2
  7. package/dist/cli.js.map +1 -1
  8. package/dist/core/agent-session.d.ts +7 -2
  9. package/dist/core/agent-session.d.ts.map +1 -1
  10. package/dist/core/agent-session.js +81 -26
  11. package/dist/core/agent-session.js.map +1 -1
  12. package/dist/core/agent-settled-delivery.d.ts +13 -1
  13. package/dist/core/agent-settled-delivery.d.ts.map +1 -1
  14. package/dist/core/agent-settled-delivery.js +33 -2
  15. package/dist/core/agent-settled-delivery.js.map +1 -1
  16. package/dist/core/auth-storage.d.ts.map +1 -1
  17. package/dist/core/auth-storage.js +5 -4
  18. package/dist/core/auth-storage.js.map +1 -1
  19. package/dist/core/extensions/builtin/goal/cache-warm-renderer.d.ts.map +1 -1
  20. package/dist/core/extensions/builtin/goal/cache-warm-renderer.js +2 -3
  21. package/dist/core/extensions/builtin/goal/cache-warm-renderer.js.map +1 -1
  22. package/dist/core/extensions/builtin/goal/cache-warm.d.ts +6 -0
  23. package/dist/core/extensions/builtin/goal/cache-warm.d.ts.map +1 -1
  24. package/dist/core/extensions/builtin/goal/cache-warm.js +43 -0
  25. package/dist/core/extensions/builtin/goal/cache-warm.js.map +1 -1
  26. package/dist/core/extensions/builtin/permission-system/index.d.ts.map +1 -1
  27. package/dist/core/extensions/builtin/permission-system/index.js +7 -11
  28. package/dist/core/extensions/builtin/permission-system/index.js.map +1 -1
  29. package/dist/core/model-resolver.js +2 -2
  30. package/dist/core/model-resolver.js.map +1 -1
  31. package/dist/core/session-work-barrier.d.ts.map +1 -1
  32. package/dist/core/session-work-barrier.js +38 -1
  33. package/dist/core/session-work-barrier.js.map +1 -1
  34. package/dist/modes/interactive/components/status-indicator.d.ts +3 -0
  35. package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
  36. package/dist/modes/interactive/components/status-indicator.js +7 -1
  37. package/dist/modes/interactive/components/status-indicator.js.map +1 -1
  38. package/dist/modes/interactive/interactive-mode.d.ts +4 -1
  39. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  40. package/dist/modes/interactive/interactive-mode.js +118 -38
  41. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  42. package/dist/senpi +45 -2
  43. package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +58 -0
  44. package/node_modules/@code-yeongyu/senpi-codemode/README.md +5 -0
  45. package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -4
  46. package/node_modules/@code-yeongyu/senpi-codemode/src/extension/runtime-factory.ts +4 -1
  47. package/node_modules/@code-yeongyu/senpi-codemode/src/extension/runtime-info.ts +41 -0
  48. package/node_modules/@code-yeongyu/senpi-codemode/src/extension/session-manager.ts +8 -3
  49. package/node_modules/@code-yeongyu/senpi-codemode/src/index.ts +4 -1
  50. package/node_modules/@code-yeongyu/senpi-codemode/src/interpreters/detect.ts +17 -4
  51. package/node_modules/@code-yeongyu/senpi-codemode/src/interpreters/resolve-command.ts +68 -0
  52. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/shared/subprocess-kernel.ts +15 -1
  53. package/node_modules/@code-yeongyu/senpi-codemode/src/timeouts/idle-timeout.ts +33 -4
  54. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/cell-runtime.ts +5 -1
  55. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool-options.ts +3 -0
  56. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool.ts +2 -0
  57. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/render.ts +60 -3
  58. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/runtime-label.ts +49 -0
  59. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/types.ts +13 -0
  60. package/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
  61. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/stream-retry.d.ts +21 -0
  62. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/stream-retry.d.ts.map +1 -0
  63. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/stream-retry.js +36 -0
  64. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/stream-retry.js.map +1 -0
  65. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/types.d.ts +10 -0
  66. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/types.d.ts.map +1 -1
  67. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/types.js.map +1 -1
  68. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.d.ts +6 -0
  69. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.d.ts.map +1 -1
  70. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.js +166 -26
  71. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.js.map +1 -1
  72. package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
  73. package/node_modules/@earendil-works/pi-ai/dist/providers/data/github-copilot.json +1 -1
  74. package/node_modules/@earendil-works/pi-ai/dist/providers/data/google.json +1 -1
  75. package/node_modules/@earendil-works/pi-ai/dist/providers/data/nvidia.json +1 -1
  76. package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -1
  77. package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
  78. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
  79. package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
  80. package/node_modules/@earendil-works/pi-ai/package.json +2 -2
  81. package/node_modules/@earendil-works/pi-pty/package.json +1 -1
  82. package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
  83. package/node_modules/@earendil-works/pi-tui/package.json +1 -1
  84. package/package.json +7 -7
  85. package/dist/modes/interactive/split-trailing-assistant-text.d.ts +0 -7
  86. package/dist/modes/interactive/split-trailing-assistant-text.d.ts.map +0 -1
  87. package/dist/modes/interactive/split-trailing-assistant-text.js +0 -19
  88. package/dist/modes/interactive/split-trailing-assistant-text.js.map +0 -1
@@ -19,6 +19,7 @@ import {
19
19
  JSON_TREE_SCALAR_LEN_EXPANDED,
20
20
  renderJsonTreeLines,
21
21
  } from "./json-tree.ts";
22
+ import { formatRuntimeBadge } from "./runtime-label.ts";
22
23
  import { codePointPrefix, formatDuration, renderToolCallWidget } from "./tool-widgets.ts";
23
24
  import type {
24
25
  EvalCellResult,
@@ -69,14 +70,38 @@ const TOOL_CALL_PREVIEW_COUNT = 5;
69
70
  const TOOL_CALL_COLLAPSED_VISUAL_LINES = 4;
70
71
  const TOOL_CALL_COLLAPSED_ERROR_CODE_POINTS = 512;
71
72
  const TOOL_ERROR_OMISSION_MARKER = "[tool error omitted]";
73
+ const LIVE_ELAPSED_TICK_MS = 1_000;
72
74
 
73
75
  class PlainTextComponent implements EvalRenderComponent {
74
76
  #blocks: readonly RenderBlock[] = [];
77
+ #ticker: ReturnType<typeof setInterval> | undefined;
75
78
 
76
79
  setBlocks(blocks: readonly RenderBlock[]): void {
77
80
  this.#blocks = blocks;
78
81
  }
79
82
 
83
+ /**
84
+ * The host only animates tool rows for streaming args, `task`, and results carrying
85
+ * `details.progress`; an eval row matches none of them, so nothing repaints it between
86
+ * update events. While a cell is non-terminal this drives the repaint itself so the
87
+ * header's elapsed time advances, and it emits no tool updates or RPC traffic.
88
+ */
89
+ syncLiveTicker(isLive: boolean, invalidate: () => void): void {
90
+ if (!isLive) {
91
+ this.stopLiveTicker();
92
+ return;
93
+ }
94
+ if (this.#ticker !== undefined) return;
95
+ this.#ticker = setInterval(invalidate, LIVE_ELAPSED_TICK_MS);
96
+ this.#ticker.unref?.();
97
+ }
98
+
99
+ stopLiveTicker(): void {
100
+ if (this.#ticker === undefined) return;
101
+ clearInterval(this.#ticker);
102
+ this.#ticker = undefined;
103
+ }
104
+
80
105
  render(width: number): string[] {
81
106
  const lines: string[] = [];
82
107
  for (const block of this.#blocks) {
@@ -109,6 +134,16 @@ function componentFor(context: RenderContext | ResultRenderContext): PlainTextCo
109
134
  return new PlainTextComponent();
110
135
  }
111
136
 
137
+ /** Render-time clock; tests inject a fixed value so elapsed output never depends on wall time. */
138
+ function renderNow(context: RenderContext | ResultRenderContext): number {
139
+ const injected: unknown = Reflect.get(context, "now");
140
+ return typeof injected === "number" && Number.isFinite(injected) ? injected : Date.now();
141
+ }
142
+
143
+ function hasLiveCell(details: EvalToolDetails | undefined): boolean {
144
+ return (details?.cells ?? []).some((cell) => isLiveCellStatus(cell.status) && cell.startedAt !== undefined);
145
+ }
146
+
112
147
  function style(theme: Theme | undefined, color: ThemeColor, text: string): string {
113
148
  return theme ? theme.fg(color, text) : text;
114
149
  }
@@ -187,6 +222,8 @@ type RenderEnvironment = {
187
222
  readonly spinnerFrame: number | undefined;
188
223
  readonly width: number;
189
224
  readonly meta: TruncationMeta | undefined;
225
+ /** Render-time clock, injected so elapsed time is deterministic under test. */
226
+ readonly now: number;
190
227
  };
191
228
  type CellBadges = {
192
229
  readonly reset: boolean;
@@ -231,6 +268,10 @@ function spinner(frame: number | undefined): string {
231
268
  return SPINNER_FRAMES.at((frame ?? 0) % SPINNER_FRAMES.length) ?? SPINNER_FRAMES[0];
232
269
  }
233
270
 
271
+ function isLiveCellStatus(status: CellStatus): boolean {
272
+ return status === "pending" || status === "running" || status === "detached";
273
+ }
274
+
234
275
  function cellPresentation(status: CellStatus, spinnerFrame: number | undefined): StatusPresentation {
235
276
  switch (status) {
236
277
  case "pending":
@@ -259,12 +300,21 @@ function renderPrefixed(text: string, environment: RenderEnvironment, prefixStyl
259
300
  );
260
301
  }
261
302
 
303
+ // A running cell only receives updates on output/status events, so a stored duration
304
+ // freezes between them. Non-terminal cells therefore derive elapsed time from the
305
+ // render-time clock; terminal cells keep their settled duration verbatim.
306
+ function cellElapsedMs(cell: EvalCellResult, environment: RenderEnvironment): number | undefined {
307
+ if (!isLiveCellStatus(cell.status) || cell.startedAt === undefined) return cell.durationMs;
308
+ return Math.max(0, environment.now - cell.startedAt);
309
+ }
310
+
262
311
  function cellHeader(cell: EvalCellResult, environment: RenderEnvironment, badges: CellBadges): string {
263
312
  const presentation = cellPresentation(cell.status, environment.spinnerFrame);
264
- let header = `eval ${cell.language} ${presentation.label} ${presentation.icon}`;
313
+ const runtimeBadge = cell.runtime === undefined ? "" : ` (${formatRuntimeBadge(cell.language, cell.runtime)})`;
314
+ let header = `eval ${cell.language}${runtimeBadge} ${presentation.label} ${presentation.icon}`;
265
315
  const throughputBadge = badges.throughput === undefined ? undefined : formatThroughputBadge(badges.throughput);
266
316
  if (throughputBadge !== undefined) header += ` · ${throughputBadge}`;
267
- const elapsedMs = badges.throughput?.wallDurationMs ?? cell.durationMs;
317
+ const elapsedMs = badges.throughput?.wallDurationMs ?? cellElapsedMs(cell, environment);
268
318
  if (elapsedMs !== undefined) header += ` · ${formatDuration(elapsedMs)}`;
269
319
  if (badges.reset) header += " · reset";
270
320
  if (badges.timeout !== undefined) header += ` · timeout ${badges.timeout}s`;
@@ -780,7 +830,9 @@ function resultHeader(
780
830
  color = "error";
781
831
  break;
782
832
  }
783
- return style(theme, color, `eval ${details?.language ?? "?"} ${status}`);
833
+ const runtimeBadge =
834
+ details?.runtime === undefined ? "" : ` (${formatRuntimeBadge(details.language, details.runtime)})`;
835
+ return style(theme, color, `eval ${details?.language ?? "?"}${runtimeBadge} ${status}`);
784
836
  }
785
837
 
786
838
  function resultMetadata(
@@ -843,6 +895,7 @@ export function renderEvalCall(
843
895
  spinnerFrame: context.spinnerFrame,
844
896
  width,
845
897
  meta: undefined,
898
+ now: renderNow(context),
846
899
  };
847
900
  const cell: EvalCellResult = {
848
901
  index: 0,
@@ -873,6 +926,7 @@ export function renderEvalResult(
873
926
  const details = result.details;
874
927
  const expanded = options.expanded || context.expanded;
875
928
  const imageProtocol = context.imageProtocol ?? null;
929
+ component.syncLiveTicker(hasLiveCell(details), context.invalidate);
876
930
  if (details?.cells !== undefined && details.cells.length > 0) {
877
931
  const blocks: RenderBlock[] = [
878
932
  {
@@ -885,6 +939,7 @@ export function renderEvalResult(
885
939
  spinnerFrame: context.spinnerFrame,
886
940
  width,
887
941
  meta: details.meta,
942
+ now: renderNow(context),
888
943
  },
889
944
  args: context.args,
890
945
  showImageFallback: context.showImages && imageProtocol === null,
@@ -936,6 +991,7 @@ export function renderEvalResult(
936
991
  spinnerFrame: context.spinnerFrame,
937
992
  width,
938
993
  meta: details?.meta,
994
+ now: renderNow(context),
939
995
  };
940
996
  return [
941
997
  ...renderStatusEvents(nonAgentEvents, environment),
@@ -957,6 +1013,7 @@ export function renderEvalResult(
957
1013
  spinnerFrame: context.spinnerFrame,
958
1014
  width,
959
1015
  meta: details?.meta,
1016
+ now: renderNow(context),
960
1017
  }),
961
1018
  },
962
1019
  );
@@ -0,0 +1,49 @@
1
+ import { homedir } from "node:os";
2
+ import type { EvalLanguage, EvalRuntimeInfo } from "./types.ts";
3
+
4
+ const MAX_BADGE_PATH_CODE_POINTS = 40;
5
+ const ELLIPSIS = "\u2026";
6
+
7
+ /**
8
+ * One-line runtime badge for eval headers, e.g. "3.14.7, ~/.venv/bin/python3"
9
+ * or "node 26.7.0, /opt/…/bin/node". The js language always carries the
10
+ * runtime name because node and bun are otherwise indistinguishable.
11
+ */
12
+ export function formatRuntimeBadge(language: EvalLanguage, runtime: EvalRuntimeInfo, home: string = homedir()): string {
13
+ const label = language === "js" ? `${runtime.name} ${runtime.version}` : runtime.version;
14
+ if (runtime.path === undefined || runtime.path.length === 0) return label;
15
+ return `${label}, ${minifyPath(runtime.path, home)}`;
16
+ }
17
+
18
+ /** Home-contracts and middle-truncates a path so header badges stay short. */
19
+ export function minifyPath(path: string, home: string = homedir()): string {
20
+ const contracted = contractHome(path, home);
21
+ if (codePointLength(contracted) <= MAX_BADGE_PATH_CODE_POINTS) return contracted;
22
+ const separator = contracted.includes("/") ? "/" : "\\";
23
+ const segments = contracted.split(separator).filter((segment) => segment.length > 0);
24
+ const head = contracted.startsWith(separator) ? `${separator}${segments[0] ?? ""}` : (segments[0] ?? "");
25
+ const tail: string[] = [];
26
+ for (let index = segments.length - 1; index >= 1; index -= 1) {
27
+ const attempt = joinTruncated(head, [segments[index] ?? "", ...tail], separator);
28
+ if (codePointLength(attempt) > MAX_BADGE_PATH_CODE_POINTS) break;
29
+ tail.unshift(segments[index] ?? "");
30
+ }
31
+ if (tail.length > 0) return joinTruncated(head, tail, separator);
32
+ const suffix = [...contracted].slice(-(MAX_BADGE_PATH_CODE_POINTS - 1)).join("");
33
+ return `${ELLIPSIS}${suffix}`;
34
+ }
35
+
36
+ function joinTruncated(head: string, tail: readonly string[], separator: string): string {
37
+ return `${head}${separator}${ELLIPSIS}${separator}${tail.join(separator)}`;
38
+ }
39
+
40
+ function contractHome(path: string, home: string): string {
41
+ if (home.length === 0) return path;
42
+ if (path === home) return "~";
43
+ if (path.startsWith(`${home}/`) || path.startsWith(`${home}\\`)) return `~${path.slice(home.length)}`;
44
+ return path;
45
+ }
46
+
47
+ function codePointLength(text: string): number {
48
+ return [...text].length;
49
+ }
@@ -140,6 +140,15 @@ export interface EvalToolCallSummary {
140
140
 
141
141
  export type EvalStatusEvent = { readonly op: string } & Readonly<Record<string, unknown>>;
142
142
 
143
+ /** Identity of the runtime executing a kernel: interpreter or JS host. */
144
+ export interface EvalRuntimeInfo {
145
+ readonly name: string;
146
+ readonly version: string;
147
+ readonly path?: string;
148
+ }
149
+
150
+ export type EvalRuntimes = Readonly<Partial<Record<EvalLanguage, EvalRuntimeInfo>>>;
151
+
143
152
  export type EvalDisplayOutput =
144
153
  | { readonly type: "json"; readonly data: unknown }
145
154
  | { readonly type: "image"; readonly data: string; readonly mimeType: string }
@@ -152,9 +161,12 @@ export type EvalCellResult = {
152
161
  readonly code: string;
153
162
  readonly language: EvalLanguage;
154
163
  readonly output: string;
164
+ readonly runtime?: EvalRuntimeInfo;
155
165
  readonly status: "pending" | "running" | "detached" | "complete" | "error" | "cancelled";
156
166
  readonly exitCode?: number;
157
167
  readonly durationMs?: number;
168
+ /** Epoch ms when the cell started; lets renderers tick elapsed time between update events. */
169
+ readonly startedAt?: number;
158
170
  readonly statusEvents?: readonly EvalStatusEvent[];
159
171
  readonly hasMarkdown?: boolean;
160
172
  };
@@ -162,6 +174,7 @@ export type EvalCellResult = {
162
174
  export interface EvalToolDetails {
163
175
  readonly language: EvalLanguage;
164
176
  readonly languages?: readonly EvalLanguage[];
177
+ readonly runtime?: EvalRuntimeInfo;
165
178
  readonly summary?: string;
166
179
  readonly durationMs: number;
167
180
  /** True wall-clock elapsed time since the cell started; `durationMs` stays kernel-reported. */
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@earendil-works/pi-agent-core",
3
3
  "private": true,
4
- "version": "2026.8.21",
4
+ "version": "2026.8.22-2",
5
5
  "description": "General-purpose agent with transport abstraction, state management, and attachment support",
6
6
  "type": "module",
7
7
  "main": "./dist/index.js",
@@ -36,8 +36,8 @@
36
36
  "prepublishOnly": "npm run build"
37
37
  },
38
38
  "dependencies": {
39
- "@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.8.21",
40
- "@earendil-works/pi-telemetry": "npm:@code-yeongyu/senpi-telemetry@2026.8.21",
39
+ "@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.8.22-2",
40
+ "@earendil-works/pi-telemetry": "npm:@code-yeongyu/senpi-telemetry@2026.8.22-2",
41
41
  "diff": "9.0.0",
42
42
  "ignore": "7.0.6",
43
43
  "typebox": "1.3.16",
@@ -0,0 +1,21 @@
1
+ export type CursorStreamRetryCause = "stall" | "transport" | "clean-end";
2
+ export declare class CursorRetryableStreamError extends Error {
3
+ readonly retryCause: CursorStreamRetryCause;
4
+ constructor(message: string, retryCause: CursorStreamRetryCause, options?: ErrorOptions);
5
+ }
6
+ export declare function isCursorRetryableStreamError(error: unknown): error is CursorRetryableStreamError;
7
+ export declare function cursorStreamRetryDelayMs(options: {
8
+ attempt: number;
9
+ baseDelayMs?: number;
10
+ fixedDelayMs?: number;
11
+ random?: () => number;
12
+ }): number;
13
+ export declare function shouldRetryCursorStream(options: {
14
+ error: unknown;
15
+ retries: number;
16
+ maxRetries: number;
17
+ sawTurnEnded: boolean;
18
+ aborted: boolean;
19
+ }): boolean;
20
+ export declare function waitForCursorStreamRetry(delayMs: number, signal?: AbortSignal): Promise<void>;
21
+ //# sourceMappingURL=stream-retry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stream-retry.d.ts","sourceRoot":"","sources":["../../../src/api/cursor-agent/stream-retry.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,sBAAsB,GAAG,OAAO,GAAG,WAAW,GAAG,WAAW,CAAC;AAEzE,qBAAa,0BAA2B,SAAQ,KAAK;IACpD,QAAQ,CAAC,UAAU,EAAE,sBAAsB,CAAC;gBAEhC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,YAAY;CAKvF;AAED,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,0BAA0B,CAEhG;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE;IACjD,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,MAAM,CAAC;CACtB,GAAG,MAAM,CAMT;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE;IAChD,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;CACjB,GAAG,OAAO,CAOV;AAED,wBAAsB,wBAAwB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAanG"}
@@ -0,0 +1,36 @@
1
+ export class CursorRetryableStreamError extends Error {
2
+ constructor(message, retryCause, options) {
3
+ super(message, options);
4
+ this.name = "CursorRetryableStreamError";
5
+ this.retryCause = retryCause;
6
+ }
7
+ }
8
+ export function isCursorRetryableStreamError(error) {
9
+ return error instanceof CursorRetryableStreamError;
10
+ }
11
+ export function cursorStreamRetryDelayMs(options) {
12
+ if (options.fixedDelayMs !== undefined)
13
+ return Math.max(0, options.fixedDelayMs);
14
+ const baseDelayMs = options.baseDelayMs ?? 1000;
15
+ const backoffMs = Math.min(baseDelayMs * 2 ** options.attempt, 60_000);
16
+ const jitter = Math.floor(backoffMs * 0.2 * (options.random ?? Math.random)());
17
+ return backoffMs + jitter;
18
+ }
19
+ export function shouldRetryCursorStream(options) {
20
+ return (!options.sawTurnEnded &&
21
+ !options.aborted &&
22
+ options.retries < options.maxRetries &&
23
+ isCursorRetryableStreamError(options.error));
24
+ }
25
+ export async function waitForCursorStreamRetry(delayMs, signal) {
26
+ if (delayMs <= 0 || signal?.aborted)
27
+ return;
28
+ await new Promise((resolve) => {
29
+ const timer = setTimeout(resolve, delayMs);
30
+ signal?.addEventListener("abort", () => {
31
+ clearTimeout(timer);
32
+ resolve();
33
+ }, { once: true });
34
+ });
35
+ }
36
+ //# sourceMappingURL=stream-retry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stream-retry.js","sourceRoot":"","sources":["../../../src/api/cursor-agent/stream-retry.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,0BAA2B,SAAQ,KAAK;IAGpD,YAAY,OAAe,EAAE,UAAkC,EAAE,OAAsB;QACtF,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,GAA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AAY,CAAC,KAAK,CAAC,CAAC;YACpB,OAAO,EAAE,CAAC;QACX,CAAC,EACD,EAAE,IAAI,EAAE,IAAI,EAAE,CACd,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["export type CursorStreamRetryCause = \"stall\" | \"transport\" | \"clean-end\";\n\nexport class CursorRetryableStreamError extends Error {\n\treadonly retryCause: CursorStreamRetryCause;\n\n\tconstructor(message: string, retryCause: CursorStreamRetryCause, options?: ErrorOptions) {\n\t\tsuper(message, options);\n\t\tthis.name = \"CursorRetryableStreamError\";\n\t\tthis.retryCause = retryCause;\n\t}\n}\n\nexport function isCursorRetryableStreamError(error: unknown): error is CursorRetryableStreamError {\n\treturn error instanceof CursorRetryableStreamError;\n}\n\nexport function cursorStreamRetryDelayMs(options: {\n\tattempt: number;\n\tbaseDelayMs?: number;\n\tfixedDelayMs?: number;\n\trandom?: () => number;\n}): number {\n\tif (options.fixedDelayMs !== undefined) return Math.max(0, options.fixedDelayMs);\n\tconst baseDelayMs = options.baseDelayMs ?? 1000;\n\tconst backoffMs = Math.min(baseDelayMs * 2 ** options.attempt, 60_000);\n\tconst jitter = Math.floor(backoffMs * 0.2 * (options.random ?? Math.random)());\n\treturn backoffMs + jitter;\n}\n\nexport function shouldRetryCursorStream(options: {\n\terror: unknown;\n\tretries: number;\n\tmaxRetries: number;\n\tsawTurnEnded: boolean;\n\taborted: boolean;\n}): boolean {\n\treturn (\n\t\t!options.sawTurnEnded &&\n\t\t!options.aborted &&\n\t\toptions.retries < options.maxRetries &&\n\t\tisCursorRetryableStreamError(options.error)\n\t);\n}\n\nexport async function waitForCursorStreamRetry(delayMs: number, signal?: AbortSignal): Promise<void> {\n\tif (delayMs <= 0 || signal?.aborted) return;\n\tawait new Promise<void>((resolve) => {\n\t\tconst timer = setTimeout(resolve, delayMs);\n\t\tsignal?.addEventListener(\n\t\t\t\"abort\",\n\t\t\t() => {\n\t\t\t\tclearTimeout(timer);\n\t\t\t\tresolve();\n\t\t\t},\n\t\t\t{ once: true },\n\t\t);\n\t});\n}\n"]}
@@ -118,5 +118,15 @@ export interface CursorAgentOptions extends StreamOptions {
118
118
  * variant request shape.
119
119
  */
120
120
  thinkingSelection?: ThinkingSelection;
121
+ /** Override stream health bounds for deterministic provider integration tests. */
122
+ streamHealthFailThresholdMs?: number;
123
+ /** @deprecated Accepted for compatibility; heartbeat/checkpoint frames are always liveness. */
124
+ streamHealthHeartbeatOnlyThresholdMs?: number;
125
+ /** Maximum pre-completion stall/transport retries (default 10). */
126
+ streamStallMaxRetries?: number;
127
+ /** Fixed retry delay for tests; production uses exponential backoff plus jitter. */
128
+ streamStallRetryDelayMs?: number;
129
+ /** Override the post-turn exec drain bound for deterministic tests. */
130
+ turnEndDrainTimeoutMs?: number;
121
131
  }
122
132
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/api/cursor-agent/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC1F,OAAO,KAAK,EACX,UAAU,EACV,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,QAAQ,EACR,UAAU,EACV,MAAM,EACN,QAAQ,EACR,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,QAAQ,EACR,UAAU,EACV,SAAS,EACT,WAAW,EACX,SAAS,EACT,WAAW,EACX,MAAM,mBAAmB,CAAC;AAE3B;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,CAAC,CAAC,IAAI;IAAE,MAAM,EAAE,CAAC,CAAC;IAAC,UAAU,CAAC,EAAE,iBA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AC;IAC/B,oFAAoF;IACpF,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,uEAAuE;IACvE,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAC/B"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/api/cursor-agent/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG","sourcesContent":["/**\n * Cursor exec-channel handler contracts.\n *\n * The Cursor agent protocol is server-driven: mid-turn, the server sends\n * `ExecServerMessage` frames asking the CLIENT to run a tool and blocks until\n * the reply arrives on the same stream. The host (coding-agent) supplies\n * these handlers; the `cursor-agent` API dispatches frames onto them, sends\n * their protobuf answers back on the wire, synthesizes already-resolved\n * `toolCall` blocks into the assistant message, and pairs each with a\n * `ToolResultMessage` delivered through {@link CursorToolResultHandler}.\n *\n * Everything here is type-only over the generated protobuf shapes, so it is\n * safe to import from browser-reachable modules.\n */\n\nimport type { StreamOptions, ThinkingSelection, ToolResultMessage } from \"../../types.ts\";\nimport type {\n\tDeleteArgs,\n\tDeleteResult,\n\tDiagnosticsArgs,\n\tDiagnosticsResult,\n\tGrepArgs,\n\tGrepResult,\n\tLsArgs,\n\tLsResult,\n\tMcpResult,\n\tPiBashExecArgs,\n\tPiBashExecResult,\n\tPiEditExecArgs,\n\tPiEditExecResult,\n\tPiFindExecArgs,\n\tPiFindExecResult,\n\tPiGrepExecArgs,\n\tPiGrepExecResult,\n\tPiLsExecArgs,\n\tPiLsExecResult,\n\tPiReadExecArgs,\n\tPiReadExecResult,\n\tPiWriteExecArgs,\n\tPiWriteExecResult,\n\tReadArgs,\n\tReadResult,\n\tShellArgs,\n\tShellResult,\n\tWriteArgs,\n\tWriteResult,\n} from \"./gen/agent_pb.ts\";\n\n/**\n * The three return forms an exec handler may use: a wire result with an\n * optional transcript pairing, a bare wire result, or a bare\n * `ToolResultMessage` from which the wire result is derived.\n */\nexport type CursorExecHandlerResult<T> = { result: T; toolResult?: ToolResultMessage } | T | ToolResultMessage;\n\n/**\n * Optional rewrite of a Cursor exec-channel tool result.\n * May return a Promise. Returning `undefined` keeps the original result.\n */\nexport type CursorToolResultHandler = (\n\tresult: ToolResultMessage,\n) => ToolResultMessage | undefined | Promise<ToolResultMessage | undefined>;\n\n/**\n * Identifies the synthesized assistant block a Cursor exec call was filed\n * under, so paths that produce no handler `toolResult` can still pair one.\n */\nexport interface CursorExecPairing {\n\ttoolCallId: string;\n\ttoolName: string;\n}\n\nexport interface CursorMcpCall {\n\tname: string;\n\tproviderIdentifier: string;\n\ttoolName: string;\n\ttoolCallId: string;\n\targs: Record<string, unknown>;\n\trawArgs: Record<string, Uint8Array>;\n\t/**\n\t * The frame asks only whether this call would be permitted — it must not\n\t * run. The server sends it to resolve a smart-mode approval decision ahead\n\t * of the real invocation; executing here would fire a side-effecting tool\n\t * the user has not yet been asked about (and fire it twice once the real\n\t * call arrives).\n\t */\n\tapprovalOnly?: boolean;\n}\n\nexport interface CursorShellStreamCallbacks {\n\tonStdout(data: string): void;\n\tonStderr(data: string): void;\n}\n\n/**\n * A modern Pi exec frame plus the call id the dispatcher minted for it.\n *\n * Unlike the legacy exec args (`ReadArgs`, `ShellArgs`, ...), the Pi frames\n * carry no `tool_call_id` field: the id rides the streamed `ToolCall`\n * envelope instead. The exec channel has no access to that envelope, so the\n * dispatcher mints an id and hands it to the handler, keeping the synthesized\n * transcript block and its paired `toolResult` on the same key.\n */\nexport interface CursorPiCall<TArgs> {\n\targs: TArgs;\n\ttoolCallId: string;\n}\n\nexport interface CursorExecHandlers {\n\tread?: (args: ReadArgs) => Promise<CursorExecHandlerResult<ReadResult>>;\n\tls?: (args: LsArgs) => Promise<CursorExecHandlerResult<LsResult>>;\n\tgrep?: (args: GrepArgs) => Promise<CursorExecHandlerResult<GrepResult>>;\n\twrite?: (args: WriteArgs) => Promise<CursorExecHandlerResult<WriteResult>>;\n\tdelete?: (args: DeleteArgs) => Promise<CursorExecHandlerResult<DeleteResult>>;\n\tshell?: (args: ShellArgs) => Promise<CursorExecHandlerResult<ShellResult>>;\n\tshellStream?: (\n\t\targs: ShellArgs,\n\t\tcallbacks: CursorShellStreamCallbacks,\n\t) => Promise<CursorExecHandlerResult<ShellResult>>;\n\tdiagnostics?: (args: DiagnosticsArgs) => Promise<CursorExecHandlerResult<DiagnosticsResult>>;\n\tmcp?: (call: CursorMcpCall) => Promise<CursorExecHandlerResult<McpResult>>;\n\t/**\n\t * Answers \"would this MCP call be permitted\", without running it.\n\t *\n\t * `true` only when the host's policy resolves to a definite allow. A\n\t * pending prompt is `false`: it can only be answered interactively at\n\t * execution time. When no handler is registered the provider refuses,\n\t * since it cannot decide.\n\t */\n\tmcpApprovalPreflight?: (call: CursorMcpCall) => Promise<boolean>;\n\t/**\n\t * Modern Cursor CLI Pi tool frames (`ExecServerMessage` 45-51). They are a\n\t * distinct frame family from the legacy `readArgs`/`shellArgs`/... set:\n\t * different args, different result oneofs, and no `tool_call_id`.\n\t */\n\tpiRead?: (call: CursorPiCall<PiReadExecArgs>) => Promise<CursorExecHandlerResult<PiReadExecResult>>;\n\tpiBash?: (call: CursorPiCall<PiBashExecArgs>) => Promise<CursorExecHandlerResult<PiBashExecResult>>;\n\tpiEdit?: (call: CursorPiCall<PiEditExecArgs>) => Promise<CursorExecHandlerResult<PiEditExecResult>>;\n\tpiWrite?: (call: CursorPiCall<PiWriteExecArgs>) => Promise<CursorExecHandlerResult<PiWriteExecResult>>;\n\tpiGrep?: (call: CursorPiCall<PiGrepExecArgs>) => Promise<CursorExecHandlerResult<PiGrepExecResult>>;\n\tpiFind?: (call: CursorPiCall<PiFindExecArgs>) => Promise<CursorExecHandlerResult<PiFindExecResult>>;\n\tpiLs?: (call: CursorPiCall<PiLsExecArgs>) => Promise<CursorExecHandlerResult<PiLsExecResult>>;\n\tonToolResult?: CursorToolResultHandler;\n}\n\n/** Stream options accepted by the `cursor-agent` API. */\nexport interface CursorAgentOptions extends StreamOptions {\n\t/** Optional server-side system prompt override (RunRequest.customSystemPrompt). */\n\tcustomSystemPrompt?: string;\n\t/** Conversation id override; defaults to `sessionId`, else a random UUID per stream. */\n\tconversationId?: string;\n\t/** Cursor exec/MCP tool handlers supplied by the host. */\n\texecHandlers?: CursorExecHandlers;\n\t/** Receives every exec-channel tool result for transcript pairing. */\n\tonToolResult?: CursorToolResultHandler;\n\t/**\n\t * Provenance-bearing thinking selection rendered into\n\t * `RequestedModel.parameters`; absent selections keep the representative\n\t * variant request shape.\n\t */\n\tthinkingSelection?: ThinkingSelection;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/api/cursor-agent/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG","sourcesContent":["/**\n * Cursor exec-channel handler contracts.\n *\n * The Cursor agent protocol is server-driven: mid-turn, the server sends\n * `ExecServerMessage` frames asking the CLIENT to run a tool and blocks until\n * the reply arrives on the same stream. The host (coding-agent) supplies\n * these handlers; the `cursor-agent` API dispatches frames onto them, sends\n * their protobuf answers back on the wire, synthesizes already-resolved\n * `toolCall` blocks into the assistant message, and pairs each with a\n * `ToolResultMessage` delivered through {@link CursorToolResultHandler}.\n *\n * Everything here is type-only over the generated protobuf shapes, so it is\n * safe to import from browser-reachable modules.\n */\n\nimport type { StreamOptions, ThinkingSelection, ToolResultMessage } from \"../../types.ts\";\nimport type {\n\tDeleteArgs,\n\tDeleteResult,\n\tDiagnosticsArgs,\n\tDiagnosticsResult,\n\tGrepArgs,\n\tGrepResult,\n\tLsArgs,\n\tLsResult,\n\tMcpResult,\n\tPiBashExecArgs,\n\tPiBashExecResult,\n\tPiEditExecArgs,\n\tPiEditExecResult,\n\tPiFindExecArgs,\n\tPiFindExecResult,\n\tPiGrepExecArgs,\n\tPiGrepExecResult,\n\tPiLsExecArgs,\n\tPiLsExecResult,\n\tPiReadExecArgs,\n\tPiReadExecResult,\n\tPiWriteExecArgs,\n\tPiWriteExecResult,\n\tReadArgs,\n\tReadResult,\n\tShellArgs,\n\tShellResult,\n\tWriteArgs,\n\tWriteResult,\n} from \"./gen/agent_pb.ts\";\n\n/**\n * The three return forms an exec handler may use: a wire result with an\n * optional transcript pairing, a bare wire result, or a bare\n * `ToolResultMessage` from which the wire result is derived.\n */\nexport type CursorExecHandlerResult<T> = { result: T; toolResult?: ToolResultMessage } | T | ToolResultMessage;\n\n/**\n * Optional rewrite of a Cursor exec-channel tool result.\n * May return a Promise. Returning `undefined` keeps the original result.\n */\nexport type CursorToolResultHandler = (\n\tresult: ToolResultMessage,\n) => ToolResultMessage | undefined | Promise<ToolResultMessage | undefined>;\n\n/**\n * Identifies the synthesized assistant block a Cursor exec call was filed\n * under, so paths that produce no handler `toolResult` can still pair one.\n */\nexport interface CursorExecPairing {\n\ttoolCallId: string;\n\ttoolName: string;\n}\n\nexport interface CursorMcpCall {\n\tname: string;\n\tproviderIdentifier: string;\n\ttoolName: string;\n\ttoolCallId: string;\n\targs: Record<string, unknown>;\n\trawArgs: Record<string, Uint8Array>;\n\t/**\n\t * The frame asks only whether this call would be permitted — it must not\n\t * run. The server sends it to resolve a smart-mode approval decision ahead\n\t * of the real invocation; executing here would fire a side-effecting tool\n\t * the user has not yet been asked about (and fire it twice once the real\n\t * call arrives).\n\t */\n\tapprovalOnly?: boolean;\n}\n\nexport interface CursorShellStreamCallbacks {\n\tonStdout(data: string): void;\n\tonStderr(data: string): void;\n}\n\n/**\n * A modern Pi exec frame plus the call id the dispatcher minted for it.\n *\n * Unlike the legacy exec args (`ReadArgs`, `ShellArgs`, ...), the Pi frames\n * carry no `tool_call_id` field: the id rides the streamed `ToolCall`\n * envelope instead. The exec channel has no access to that envelope, so the\n * dispatcher mints an id and hands it to the handler, keeping the synthesized\n * transcript block and its paired `toolResult` on the same key.\n */\nexport interface CursorPiCall<TArgs> {\n\targs: TArgs;\n\ttoolCallId: string;\n}\n\nexport interface CursorExecHandlers {\n\tread?: (args: ReadArgs) => Promise<CursorExecHandlerResult<ReadResult>>;\n\tls?: (args: LsArgs) => Promise<CursorExecHandlerResult<LsResult>>;\n\tgrep?: (args: GrepArgs) => Promise<CursorExecHandlerResult<GrepResult>>;\n\twrite?: (args: WriteArgs) => Promise<CursorExecHandlerResult<WriteResult>>;\n\tdelete?: (args: DeleteArgs) => Promise<CursorExecHandlerResult<DeleteResult>>;\n\tshell?: (args: ShellArgs) => Promise<CursorExecHandlerResult<ShellResult>>;\n\tshellStream?: (\n\t\targs: ShellArgs,\n\t\tcallbacks: CursorShellStreamCallbacks,\n\t) => Promise<CursorExecHandlerResult<ShellResult>>;\n\tdiagnostics?: (args: DiagnosticsArgs) => Promise<CursorExecHandlerResult<DiagnosticsResult>>;\n\tmcp?: (call: CursorMcpCall) => Promise<CursorExecHandlerResult<McpResult>>;\n\t/**\n\t * Answers \"would this MCP call be permitted\", without running it.\n\t *\n\t * `true` only when the host's policy resolves to a definite allow. A\n\t * pending prompt is `false`: it can only be answered interactively at\n\t * execution time. When no handler is registered the provider refuses,\n\t * since it cannot decide.\n\t */\n\tmcpApprovalPreflight?: (call: CursorMcpCall) => Promise<boolean>;\n\t/**\n\t * Modern Cursor CLI Pi tool frames (`ExecServerMessage` 45-51). They are a\n\t * distinct frame family from the legacy `readArgs`/`shellArgs`/... set:\n\t * different args, different result oneofs, and no `tool_call_id`.\n\t */\n\tpiRead?: (call: CursorPiCall<PiReadExecArgs>) => Promise<CursorExecHandlerResult<PiReadExecResult>>;\n\tpiBash?: (call: CursorPiCall<PiBashExecArgs>) => Promise<CursorExecHandlerResult<PiBashExecResult>>;\n\tpiEdit?: (call: CursorPiCall<PiEditExecArgs>) => Promise<CursorExecHandlerResult<PiEditExecResult>>;\n\tpiWrite?: (call: CursorPiCall<PiWriteExecArgs>) => Promise<CursorExecHandlerResult<PiWriteExecResult>>;\n\tpiGrep?: (call: CursorPiCall<PiGrepExecArgs>) => Promise<CursorExecHandlerResult<PiGrepExecResult>>;\n\tpiFind?: (call: CursorPiCall<PiFindExecArgs>) => Promise<CursorExecHandlerResult<PiFindExecResult>>;\n\tpiLs?: (call: CursorPiCall<PiLsExecArgs>) => Promise<CursorExecHandlerResult<PiLsExecResult>>;\n\tonToolResult?: CursorToolResultHandler;\n}\n\n/** Stream options accepted by the `cursor-agent` API. */\nexport interface CursorAgentOptions extends StreamOptions {\n\t/** Optional server-side system prompt override (RunRequest.customSystemPrompt). */\n\tcustomSystemPrompt?: string;\n\t/** Conversation id override; defaults to `sessionId`, else a random UUID per stream. */\n\tconversationId?: string;\n\t/** Cursor exec/MCP tool handlers supplied by the host. */\n\texecHandlers?: CursorExecHandlers;\n\t/** Receives every exec-channel tool result for transcript pairing. */\n\tonToolResult?: CursorToolResultHandler;\n\t/**\n\t * Provenance-bearing thinking selection rendered into\n\t * `RequestedModel.parameters`; absent selections keep the representative\n\t * variant request shape.\n\t */\n\tthinkingSelection?: ThinkingSelection;\n\t/** Override stream health bounds for deterministic provider integration tests. */\n\tstreamHealthFailThresholdMs?: number;\n\t/** @deprecated Accepted for compatibility; heartbeat/checkpoint frames are always liveness. */\n\tstreamHealthHeartbeatOnlyThresholdMs?: number;\n\t/** Maximum pre-completion stall/transport retries (default 10). */\n\tstreamStallMaxRetries?: number;\n\t/** Fixed retry delay for tests; production uses exponential backoff plus jitter. */\n\tstreamStallRetryDelayMs?: number;\n\t/** Override the post-turn exec drain bound for deterministic tests. */\n\tturnEndDrainTimeoutMs?: number;\n}\n"]}
@@ -24,6 +24,12 @@ import type { CursorAgentOptions, CursorExecHandlerResult, CursorExecHandlers, C
24
24
  export type { CursorAgentOptions, CursorExecHandlerResult, CursorExecHandlers, CursorExecPairing, CursorMcpCall, CursorPiCall, CursorShellStreamCallbacks, CursorToolResultHandler, } from "./cursor-agent/types.ts";
25
25
  export declare const CURSOR_API_URL = "https://api2.cursor.sh";
26
26
  export declare const CURSOR_CLIENT_VERSION = "cli-2026.07.23-e383d2b";
27
+ /** Maximum inbound silence before a Cursor turn without turnEnded is failed. */
28
+ export declare const CURSOR_STREAM_HEALTH_FAIL_THRESHOLD_MS = 30000;
29
+ /** @deprecated Heartbeats and checkpoints count as inbound liveness without a separate deadline. */
30
+ export declare const CURSOR_STREAM_HEALTH_HEARTBEAT_ONLY_THRESHOLD_MS: number;
31
+ /** Maximum time allowed to drain exec handlers after turnEnded. */
32
+ export declare const CURSOR_TURN_END_DRAIN_TIMEOUT_MS = 5000;
27
33
  /** Reduce caller-supplied headers to what this HTTP/2 request can legally carry. */
28
34
  export declare function sanitizeCursorCallerHeaders(headers: Record<string, string> | undefined): Record<string, string>;
29
35
  export declare function frameConnectMessage(data: Uint8Array, flags?: number): Buffer;
@@ -1 +1 @@
1
- {"version":3,"file":"cursor-agent.d.ts","sourceRoot":"","sources":["../../src/api/cursor-agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AAIpC,OAAO,KAAK,EAEX,gBAAgB,EAGhB,OAAO,EAEP,mBAAmB,EACnB,cAAc,EACd,WAAW,EACX,eAAe,EACf,IAAI,EACJ,QAAQ,EACR,iBAAiB,EACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAGN,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AA0BvE,OAAO,EAIN,KAAK,kBAAkB,EAcvB,KAAK,0BAA0B,EA+D/B,KAAK,iBAAiB,EAoDtB,MAAM,gCAAgC,CAAC;AAUxC,OAAO,KAAK,EACX,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,EAClB,iBAAiB,EAGjB,uBAAuB,EACvB,MAAM,yBAAyB,CAAC;AASjC,YAAY,EACX,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,EAClB,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,0BAA0B,EAC1B,uBAAuB,GACvB,MAAM,yBAAyB,CAAC;AAEjC,eA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