@cursor/july 0.1.23 → 0.1.24

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 (174) hide show
  1. package/dist/bin/agent-serve.js +0 -0
  2. package/dist/docs/404.html +1 -1
  3. package/dist/docs/ab.html +2 -2
  4. package/dist/docs/assets/{app.DYcC9FY-.js → app.CvSGaAxk.js} +1 -1
  5. package/dist/docs/assets/chunks/@localSearchIndexroot.CL2Y0Zmh.js +1 -0
  6. package/dist/docs/assets/chunks/{VPLocalSearchBox.o4N_knTV.js → VPLocalSearchBox.J1jJbCvs.js} +1 -1
  7. package/dist/docs/assets/chunks/{theme.DQ-njyo0.js → theme.C7vfzr7h.js} +2 -2
  8. package/dist/docs/building-with-agents.html +2 -2
  9. package/dist/docs/concepts.html +2 -2
  10. package/dist/docs/deployment.html +2 -2
  11. package/dist/docs/evals.html +2 -2
  12. package/dist/docs/example-agents/approval-buddy.html +2 -2
  13. package/dist/docs/example-agents/benny.html +2 -2
  14. package/dist/docs/example-agents/bugbot.html +2 -2
  15. package/dist/docs/example-agents/codebase-wiki.html +2 -2
  16. package/dist/docs/example-agents/codeowners-review.html +2 -2
  17. package/dist/docs/example-agents/concierge.html +2 -2
  18. package/dist/docs/example-agents/fsd.html +2 -2
  19. package/dist/docs/example-agents/index.html +2 -2
  20. package/dist/docs/example-agents/knowledge-base.html +2 -2
  21. package/dist/docs/example-agents/oncall.html +2 -2
  22. package/dist/docs/example-agents/security-reviewer.html +2 -2
  23. package/dist/docs/example-agents/slack-agent.html +2 -2
  24. package/dist/docs/example-agents/weather-agent.html +2 -2
  25. package/dist/docs/guides/agent-to-agent.html +2 -2
  26. package/dist/docs/guides/cloud-runtime.html +2 -2
  27. package/dist/docs/guides/github.html +2 -2
  28. package/dist/docs/guides/human-in-the-loop.html +2 -2
  29. package/dist/docs/guides/mcp-oauth.html +2 -2
  30. package/dist/docs/guides/slack.html +2 -2
  31. package/dist/docs/guides/webhooks.html +2 -2
  32. package/dist/docs/hillclimbing.html +2 -2
  33. package/dist/docs/index.html +2 -2
  34. package/dist/docs/quickstart.html +2 -2
  35. package/dist/docs/reference/agent-config.html +2 -2
  36. package/dist/docs/reference/channels.html +2 -2
  37. package/dist/docs/reference/cli.html +2 -2
  38. package/dist/docs/reference/connections.html +2 -2
  39. package/dist/docs/reference/hooks.html +2 -2
  40. package/dist/docs/reference/http-api.html +2 -2
  41. package/dist/docs/reference/instructions.html +2 -2
  42. package/dist/docs/reference/playground.html +2 -2
  43. package/dist/docs/reference/project-layout.html +2 -2
  44. package/dist/docs/reference/prompt.html +2 -2
  45. package/dist/docs/reference/schedules.html +2 -2
  46. package/dist/docs/reference/sessions.html +2 -2
  47. package/dist/docs/reference/skills.html +2 -2
  48. package/dist/docs/reference/subagents.html +2 -2
  49. package/dist/docs/reference/tools.html +2 -2
  50. package/dist/docs/scaffolding-agents.html +2 -2
  51. package/dist/docs/storage.html +2 -2
  52. package/dist/docs/troubleshooting.html +2 -2
  53. package/dist/playground/assets/index-CidizGZv.css +1 -0
  54. package/dist/playground/assets/{index-DqXdAFGa.js → index-DTG9OsPV.js} +41 -41
  55. package/dist/playground/index.html +2 -2
  56. package/package.json +24 -24
  57. package/dist/channels/github/instrument.d.ts +0 -20
  58. package/dist/channels/github/instrument.d.ts.map +0 -1
  59. package/dist/docs/assets/chunks/@localSearchIndexroot.BQTzJjR_.js +0 -1
  60. package/dist/internal/json-dir-store.d.ts +0 -32
  61. package/dist/internal/json-dir-store.d.ts.map +0 -1
  62. package/dist/internal/json-dir-store.js +0 -100
  63. package/dist/playground/assets/index-CjOQ4hN9.css +0 -1
  64. package/src/bin/agent-serve.version.test.ts +0 -64
  65. package/src/channels/github/api.test.ts +0 -64
  66. package/src/channels/github/auth.test.ts +0 -105
  67. package/src/channels/github/cursor-account.test.ts +0 -204
  68. package/src/channels/github/forward.test.ts +0 -457
  69. package/src/channels/github/github.test.ts +0 -937
  70. package/src/channels/github/replay.test.ts +0 -179
  71. package/src/channels/slack/api.post-message.test.ts +0 -148
  72. package/src/channels/slack/approvals.test.ts +0 -328
  73. package/src/channels/slack/block-actions.test.ts +0 -452
  74. package/src/channels/slack/bot-mentions.test.ts +0 -267
  75. package/src/channels/slack/channel-watch.test.ts +0 -363
  76. package/src/channels/slack/cursor-account.test.ts +0 -253
  77. package/src/channels/slack/defaults.final-post.test.ts +0 -182
  78. package/src/channels/slack/dispatch.test.ts +0 -795
  79. package/src/channels/slack/eval-directive.test.ts +0 -273
  80. package/src/channels/slack/message-body.test.ts +0 -54
  81. package/src/channels/slack/nudge-store.test.ts +0 -143
  82. package/src/channels/slack/slack.test.ts +0 -391
  83. package/src/channels/slack/stop.test.ts +0 -23
  84. package/src/channels/slack/thread-context.test.ts +0 -202
  85. package/src/evals/assertions.test.ts +0 -580
  86. package/src/evals/expect.test.ts +0 -144
  87. package/src/evals/judge.test.ts +0 -181
  88. package/src/evals/loaders.test.ts +0 -132
  89. package/src/evals/matchers.test.ts +0 -95
  90. package/src/evals/reporters.test.ts +0 -303
  91. package/src/evals/run-facts.test.ts +0 -259
  92. package/src/internal/ab-snapshot.test.ts +0 -325
  93. package/src/internal/approval-gate.test.ts +0 -49
  94. package/src/internal/approvals.integration.test.ts +0 -383
  95. package/src/internal/authored-loaders.test.ts +0 -31
  96. package/src/internal/builtin-tools/reminders.test.ts +0 -201
  97. package/src/internal/channel-route-schema.test.ts +0 -294
  98. package/src/internal/chat-attach.test.ts +0 -262
  99. package/src/internal/cli-deploy.test.ts +0 -1991
  100. package/src/internal/cli-docs.test.ts +0 -161
  101. package/src/internal/cli-mcp.test.ts +0 -789
  102. package/src/internal/cli-skills.test.ts +0 -133
  103. package/src/internal/cli-slack.test.ts +0 -1647
  104. package/src/internal/cloud-merge.test.ts +0 -74
  105. package/src/internal/cron.test.ts +0 -22
  106. package/src/internal/cursor/account-mcp.test.ts +0 -807
  107. package/src/internal/cursor/backend-client.test.ts +0 -591
  108. package/src/internal/cursor/credentials.test.ts +0 -351
  109. package/src/internal/cursor/github-credentials.test.ts +0 -136
  110. package/src/internal/cursor-account-mcp-auth.test.ts +0 -310
  111. package/src/internal/cursor-account.integration.test.ts +0 -441
  112. package/src/internal/cursor-event-relay.test.ts +0 -746
  113. package/src/internal/cursor-github-credentials.integration.test.ts +0 -271
  114. package/src/internal/cursor-slack-relay.test.ts +0 -525
  115. package/src/internal/deploy-source.test.ts +0 -111
  116. package/src/internal/discovery.builtin-tools.test.ts +0 -94
  117. package/src/internal/discovery.concurrency.test.ts +0 -60
  118. package/src/internal/discovery.cursor-account.test.ts +0 -133
  119. package/src/internal/discovery.cwd.test.ts +0 -83
  120. package/src/internal/discovery.hosting.test.ts +0 -80
  121. package/src/internal/discovery.identity.test.ts +0 -44
  122. package/src/internal/docs-site.test.ts +0 -66
  123. package/src/internal/duration.test.ts +0 -29
  124. package/src/internal/eval-judge-model.test.ts +0 -187
  125. package/src/internal/eval-run-store.cancel.test.ts +0 -142
  126. package/src/internal/eval-run-store.storage.test.ts +0 -211
  127. package/src/internal/eval-runner.http.test.ts +0 -403
  128. package/src/internal/eval-runner.run.test.ts +0 -928
  129. package/src/internal/evals-client.test.ts +0 -307
  130. package/src/internal/event-mapper.test.ts +0 -243
  131. package/src/internal/github-fanout.test.ts +0 -213
  132. package/src/internal/handleAgentServeTrigger.test.ts +0 -179
  133. package/src/internal/host-kv.test.ts +0 -82
  134. package/src/internal/host-platforms.test.ts +0 -126
  135. package/src/internal/http-channel.test.ts +0 -402
  136. package/src/internal/init-project.test.ts +0 -270
  137. package/src/internal/install-cursor-skills.test.ts +0 -262
  138. package/src/internal/local-env.test.ts +0 -120
  139. package/src/internal/log-ring.test.ts +0 -31
  140. package/src/internal/logs-client.test.ts +0 -350
  141. package/src/internal/mcp-endpoint.test.ts +0 -436
  142. package/src/internal/mcp-host.test.ts +0 -298
  143. package/src/internal/mcp-oauth.test.ts +0 -148
  144. package/src/internal/net.test.ts +0 -17
  145. package/src/internal/peer-connections.test.ts +0 -128
  146. package/src/internal/peer-mcp.integration.test.ts +0 -289
  147. package/src/internal/playground/toolchain.test.ts +0 -53
  148. package/src/internal/playground-cli.test.ts +0 -187
  149. package/src/internal/playground-proxy.test.ts +0 -376
  150. package/src/internal/prompt-context.integration.test.ts +0 -232
  151. package/src/internal/prompt-context.test.ts +0 -127
  152. package/src/internal/reminder-runner.test.ts +0 -390
  153. package/src/internal/reminder-store.test.ts +0 -53
  154. package/src/internal/request-headers.test.ts +0 -27
  155. package/src/internal/resolve-prod-target.test.ts +0 -787
  156. package/src/internal/resolved-connections.test.ts +0 -295
  157. package/src/internal/router.test.ts +0 -57
  158. package/src/internal/sdk-runner.test.ts +0 -290
  159. package/src/internal/session-engine.coalesce.test.ts +0 -169
  160. package/src/internal/session-engine.concurrency.test.ts +0 -250
  161. package/src/internal/session-engine.host-oauth-mcp.test.ts +0 -110
  162. package/src/internal/session-engine.interrupt.test.ts +0 -577
  163. package/src/internal/session-engine.storage.test.ts +0 -547
  164. package/src/internal/session-urls.test.ts +0 -28
  165. package/src/internal/sessions-client.test.ts +0 -518
  166. package/src/internal/storage-coordinator.test.ts +0 -517
  167. package/src/internal/tool-call.test.ts +0 -458
  168. package/src/internal/tool-result.test.ts +0 -52
  169. package/src/internal/trajectory.approvals.test.ts +0 -83
  170. package/src/internal/trajectory.subagents.test.ts +0 -198
  171. package/src/internal/turn-governor.test.ts +0 -137
  172. package/src/internal/update-check.test.ts +0 -485
  173. package/src/internal/workspace.test.ts +0 -207
  174. package/src/storage-backends/cursor-hosted.test.ts +0 -121
@@ -1,198 +0,0 @@
1
- import { describe, expect, it } from "vitest";
2
- import type { SessionEvent } from "../types.js";
3
- import { buildTrajectory, formatTrajectoryText } from "./trajectory.js";
4
-
5
- function ev(
6
- partial: Omit<SessionEvent, "index" | "sessionId" | "at"> & {
7
- index?: number;
8
- }
9
- ): SessionEvent {
10
- return {
11
- index: partial.index ?? 0,
12
- sessionId: "sess_1",
13
- at: "2026-01-01T00:00:00.000Z",
14
- ...partial,
15
- } as SessionEvent;
16
- }
17
-
18
- describe("buildTrajectory subagent progress", () => {
19
- it("keeps bare top-level task in toolCalls for calledTool evals", () => {
20
- const traj = buildTrajectory([
21
- ev({ type: "session.started", data: { channelId: "http" } }),
22
- ev({
23
- type: "message.received",
24
- turnId: "turn_1",
25
- data: { text: "review this" },
26
- }),
27
- ev({
28
- type: "actions.requested",
29
- turnId: "turn_1",
30
- data: {
31
- calls: [
32
- {
33
- callId: "task-1",
34
- toolName: "task",
35
- args: { description: "deep review" },
36
- },
37
- ],
38
- },
39
- }),
40
- ev({
41
- type: "subagent.called",
42
- turnId: "turn_1",
43
- data: {
44
- callId: "task-1",
45
- name: "reviewer",
46
- description: "deep review",
47
- },
48
- }),
49
- ev({
50
- type: "actions.requested",
51
- turnId: "turn_1",
52
- data: {
53
- parentCallId: "task-1",
54
- calls: [
55
- {
56
- callId: "shell-1",
57
- toolName: "shell",
58
- args: { command: "ls" },
59
- parentCallId: "task-1",
60
- },
61
- ],
62
- },
63
- }),
64
- ev({
65
- type: "action.result",
66
- turnId: "turn_1",
67
- data: {
68
- callId: "shell-1",
69
- toolName: "shell",
70
- output: "ok",
71
- isError: false,
72
- parentCallId: "task-1",
73
- },
74
- }),
75
- ev({
76
- type: "subagent.completed",
77
- turnId: "turn_1",
78
- data: { callId: "task-1", name: "reviewer" },
79
- }),
80
- ev({
81
- type: "action.result",
82
- turnId: "turn_1",
83
- data: {
84
- callId: "task-1",
85
- toolName: "task",
86
- output: { done: true },
87
- isError: false,
88
- },
89
- }),
90
- ev({
91
- type: "message.completed",
92
- turnId: "turn_1",
93
- data: { text: "Parent reply.", finishReason: "stop" },
94
- }),
95
- ev({ type: "turn.completed", turnId: "turn_1", data: {} }),
96
- ]);
97
-
98
- const turn = traj.turns[0]!;
99
- expect(turn.toolCalls.map((c) => c.toolName)).toContain("task");
100
- expect(turn.toolCalls.find((c) => c.toolName === "task")).toMatchObject({
101
- callId: "task-1",
102
- output: { done: true },
103
- });
104
- expect(turn.subagents).toHaveLength(1);
105
- expect(turn.subagents[0]?.toolCalls.map((c) => c.toolName)).toEqual([
106
- "shell",
107
- ]);
108
- expect(turn.assistantText).toBe("Parent reply.");
109
- expect(traj.finalText).toBe("Parent reply.");
110
- });
111
-
112
- it("does not let nested message.completed overwrite parent assistantText", () => {
113
- const traj = buildTrajectory([
114
- ev({
115
- type: "message.received",
116
- turnId: "turn_1",
117
- data: { text: "hi" },
118
- }),
119
- ev({
120
- type: "subagent.called",
121
- turnId: "turn_1",
122
- data: { callId: "task-1", name: "worker" },
123
- }),
124
- ev({
125
- type: "message.completed",
126
- turnId: "turn_1",
127
- data: {
128
- text: "Nested says hi.",
129
- finishReason: "stop",
130
- parentCallId: "task-1",
131
- },
132
- }),
133
- ev({
134
- type: "message.completed",
135
- turnId: "turn_1",
136
- data: { text: "Parent final.", finishReason: "stop" },
137
- }),
138
- ev({ type: "turn.completed", turnId: "turn_1", data: {} }),
139
- ]);
140
-
141
- expect(traj.turns[0]?.assistantText).toBe("Parent final.");
142
- expect(traj.finalText).toBe("Parent final.");
143
- });
144
-
145
- it("does not let nested reasoning.appended overwrite parent reasoningText", () => {
146
- const traj = buildTrajectory([
147
- ev({
148
- type: "reasoning.appended",
149
- turnId: "turn_1",
150
- data: {
151
- delta: "parent think",
152
- text: "parent think",
153
- },
154
- }),
155
- ev({
156
- type: "reasoning.appended",
157
- turnId: "turn_1",
158
- data: {
159
- delta: "nested think",
160
- text: "nested think",
161
- parentCallId: "task-1",
162
- },
163
- }),
164
- ev({ type: "turn.completed", turnId: "turn_1", data: {} }),
165
- ]);
166
-
167
- expect(traj.turns[0]?.reasoningText).toBe("parent think");
168
- });
169
-
170
- it("formatTrajectoryText includes nested subagent tools", () => {
171
- const traj = buildTrajectory([
172
- ev({
173
- type: "subagent.called",
174
- turnId: "turn_1",
175
- data: { callId: "task-1", name: "worker", description: "do work" },
176
- }),
177
- ev({
178
- type: "actions.requested",
179
- turnId: "turn_1",
180
- data: {
181
- calls: [
182
- {
183
- callId: "read-1",
184
- toolName: "read",
185
- args: { path: "a.ts" },
186
- parentCallId: "task-1",
187
- },
188
- ],
189
- },
190
- }),
191
- ev({ type: "turn.completed", turnId: "turn_1", data: {} }),
192
- ]);
193
-
194
- const text = formatTrajectoryText(traj);
195
- expect(text).toContain("task worker");
196
- expect(text).toContain("read");
197
- });
198
- });
@@ -1,137 +0,0 @@
1
- import { describe, expect, it } from "vitest";
2
- import { TurnGovernor, type TurnPermit } from "./turn-governor.js";
3
-
4
- describe("TurnGovernor", () => {
5
- it("grants immediately with no limit configured", async () => {
6
- const governor = new TurnGovernor(undefined);
7
- expect(governor.limited).toBe(false);
8
- const permit = await governor.acquire({ sessionId: "s1" });
9
- expect(permit).toBeDefined();
10
- expect(governor.queuedCount).toBe(0);
11
- permit?.release();
12
- });
13
-
14
- it("queues FIFO beyond the limit and wakes waiters in order", async () => {
15
- const governor = new TurnGovernor({ maxRunningTurns: 2 });
16
- const first = await governor.acquire({ sessionId: "s1" });
17
- const second = await governor.acquire({ sessionId: "s2" });
18
- expect(governor.runningCount).toBe(2);
19
-
20
- const positions: Array<{ sessionId: string; position: number }> = [];
21
- const grants: string[] = [];
22
- const third = governor
23
- .acquire({
24
- sessionId: "s3",
25
- onQueued: (position) => positions.push({ sessionId: "s3", position }),
26
- })
27
- .then((permit) => {
28
- grants.push("s3");
29
- return permit;
30
- });
31
- const fourth = governor
32
- .acquire({
33
- sessionId: "s4",
34
- onQueued: (position) => positions.push({ sessionId: "s4", position }),
35
- })
36
- .then((permit) => {
37
- grants.push("s4");
38
- return permit;
39
- });
40
-
41
- expect(positions).toEqual([
42
- { sessionId: "s3", position: 1 },
43
- { sessionId: "s4", position: 2 },
44
- ]);
45
- expect(governor.queuedCount).toBe(2);
46
- expect(governor.isQueued("s3")).toBe(true);
47
- expect(governor.isQueued("s4")).toBe(true);
48
-
49
- first?.release();
50
- const thirdPermit = await third;
51
- expect(grants).toEqual(["s3"]);
52
- expect(governor.isQueued("s3")).toBe(false);
53
- expect(governor.runningCount).toBe(2);
54
-
55
- second?.release();
56
- const fourthPermit = await fourth;
57
- expect(grants).toEqual(["s3", "s4"]);
58
- expect(governor.queuedCount).toBe(0);
59
-
60
- thirdPermit?.release();
61
- fourthPermit?.release();
62
- expect(governor.runningCount).toBe(0);
63
- });
64
-
65
- it("resolves undefined when the signal aborts while waiting", async () => {
66
- const governor = new TurnGovernor({ maxRunningTurns: 1 });
67
- const holder = await governor.acquire({ sessionId: "s1" });
68
-
69
- const abort = new AbortController();
70
- const waiting = governor.acquire({
71
- sessionId: "s2",
72
- signal: abort.signal,
73
- });
74
- expect(governor.isQueued("s2")).toBe(true);
75
-
76
- abort.abort();
77
- expect(await waiting).toBeUndefined();
78
- expect(governor.isQueued("s2")).toBe(false);
79
- expect(governor.queuedCount).toBe(0);
80
-
81
- // The abandoned wait must not consume the slot when it frees.
82
- holder?.release();
83
- const next = await governor.acquire({ sessionId: "s3" });
84
- expect(next).toBeDefined();
85
- next?.release();
86
- });
87
-
88
- it("resolves undefined without enqueuing when already aborted", async () => {
89
- const governor = new TurnGovernor({ maxRunningTurns: 1 });
90
- const holder = await governor.acquire({ sessionId: "s1" });
91
- const abort = new AbortController();
92
- abort.abort();
93
- let queued = false;
94
- const permit = await governor.acquire({
95
- sessionId: "s2",
96
- signal: abort.signal,
97
- onQueued: () => {
98
- queued = true;
99
- },
100
- });
101
- expect(permit).toBeUndefined();
102
- expect(queued).toBe(false);
103
- holder?.release();
104
- });
105
-
106
- it("release is idempotent", async () => {
107
- const governor = new TurnGovernor({ maxRunningTurns: 1 });
108
- const first = (await governor.acquire({ sessionId: "s1" })) as TurnPermit;
109
- first.release();
110
- first.release();
111
- expect(governor.runningCount).toBe(0);
112
- const second = await governor.acquire({ sessionId: "s2" });
113
- expect(second).toBeDefined();
114
- expect(governor.runningCount).toBe(1);
115
- second?.release();
116
- });
117
-
118
- it("keeps FIFO order over grants freed by aborted waiters", async () => {
119
- const governor = new TurnGovernor({ maxRunningTurns: 1 });
120
- const holder = await governor.acquire({ sessionId: "s1" });
121
- const abortSecond = new AbortController();
122
- const second = governor.acquire({
123
- sessionId: "s2",
124
- signal: abortSecond.signal,
125
- });
126
- const third = governor.acquire({ sessionId: "s3" });
127
-
128
- abortSecond.abort();
129
- expect(await second).toBeUndefined();
130
-
131
- holder?.release();
132
- const thirdPermit = await third;
133
- expect(thirdPermit).toBeDefined();
134
- expect(governor.queuedCount).toBe(0);
135
- thirdPermit?.release();
136
- });
137
- });