@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,403 +0,0 @@
1
- /**
2
- * Runs the eval runner against a real HTTP agent stub.
3
- *
4
- * `eval-runner.run.test.ts` mocks the session transport to cover grading logic;
5
- * this file keeps the transport real, so the assertions are graded from events
6
- * that actually arrived over the NDJSON session stream. That is the part a mock
7
- * cannot prove.
8
- */
9
-
10
- import { createServer, type Server } from "node:http";
11
- import type { AddressInfo } from "node:net";
12
- import { afterEach, describe, expect, it } from "vitest";
13
- import type { EvalDefinition, EvalRunResult } from "../evals.js";
14
- import { defineEval, includes } from "../evals.js";
15
- import type { SessionEvent } from "../types.js";
16
- import { expandEvalModule, runDiscoveredEvals } from "./eval-runner.js";
17
-
18
- interface StubAgent {
19
- url: string;
20
- /** Messages the runner sent, in order. */
21
- received: string[];
22
- close(): Promise<void>;
23
- }
24
-
25
- /** One scripted turn: the events the stub streams back for that message. */
26
- type TurnScript = (message: string, turnId: string) => ScriptedEvent[];
27
-
28
- /**
29
- * A scripted event without its envelope cursor; `appendTurn` fills in
30
- * `sessionId` and `index`. Loosely typed on purpose: the stub composes events
31
- * generically, which the `type`/`data` discriminated union cannot express.
32
- */
33
- interface ScriptedEvent {
34
- at: string;
35
- turnId?: string;
36
- type: string;
37
- data: unknown;
38
- }
39
-
40
- async function startStubAgent(script: TurnScript): Promise<StubAgent> {
41
- const received: string[] = [];
42
- const sessions = new Map<string, SessionEvent[]>();
43
- let nextSession = 0;
44
- let nextTurn = 0;
45
-
46
- const appendTurn = (sessionId: string, message: string): void => {
47
- const events = sessions.get(sessionId)!;
48
- nextTurn++;
49
- for (const event of script(message, `turn_${nextTurn}`)) {
50
- // `index` is the monotonic per-session cursor a client reconnects with
51
- // via `?startIndex=`, so it must be the event's position in this session.
52
- events.push({
53
- ...event,
54
- sessionId,
55
- index: events.length,
56
- } as SessionEvent);
57
- }
58
- };
59
-
60
- const server: Server = createServer((req, res) => {
61
- const url = new URL(req.url ?? "/", "http://127.0.0.1");
62
- const chunks: Buffer[] = [];
63
- req.on("data", (chunk: Buffer) => chunks.push(chunk));
64
- req.on("end", () => {
65
- const body =
66
- chunks.length === 0
67
- ? {}
68
- : (JSON.parse(Buffer.concat(chunks).toString("utf8")) as {
69
- message?: string;
70
- });
71
- const streamMatch = /^\/v1\/session\/([^/]+)\/stream$/.exec(url.pathname);
72
- if (streamMatch !== null) {
73
- const events = sessions.get(streamMatch[1]!) ?? [];
74
- const startIndex = Number(url.searchParams.get("startIndex") ?? "0");
75
- res.writeHead(200, { "content-type": "application/x-ndjson" });
76
- for (const event of events.slice(startIndex)) {
77
- res.write(`${JSON.stringify(event)}\n`);
78
- }
79
- res.end();
80
- return;
81
- }
82
- if (url.pathname === "/v1/session") {
83
- nextSession++;
84
- const sessionId = `ses_${nextSession}`;
85
- sessions.set(sessionId, []);
86
- received.push(body.message ?? "");
87
- appendTurn(sessionId, body.message ?? "");
88
- res.writeHead(200, { "content-type": "application/json" });
89
- res.end(
90
- JSON.stringify({ ok: true, sessionId, continuationToken: "tok_1" })
91
- );
92
- return;
93
- }
94
- const followUp = /^\/v1\/session\/([^/]+)$/.exec(url.pathname);
95
- if (followUp !== null) {
96
- received.push(body.message ?? "");
97
- appendTurn(followUp[1]!, body.message ?? "");
98
- res.writeHead(200, { "content-type": "application/json" });
99
- res.end(JSON.stringify({ ok: true, continuationToken: "tok_2" }));
100
- return;
101
- }
102
- res.writeHead(404).end();
103
- });
104
- });
105
-
106
- await new Promise<void>((resolve) => server.listen(0, "127.0.0.1", resolve));
107
- const { port } = server.address() as AddressInfo;
108
- return {
109
- url: `http://127.0.0.1:${port}`,
110
- received,
111
- close: () =>
112
- new Promise<void>((resolve) => {
113
- server.close(() => resolve());
114
- }),
115
- };
116
- }
117
-
118
- function event(
119
- type: string,
120
- data: unknown,
121
- turnId: string | undefined
122
- ): ScriptedEvent {
123
- return { at: new Date().toISOString(), turnId, type, data };
124
- }
125
-
126
- /** A weather turn: one completed tool call, one reply, then park. */
127
- const weatherScript: TurnScript = (message, turnId) => [
128
- event("message.received", { text: message }, turnId),
129
- event(
130
- "actions.requested",
131
- {
132
- calls: [
133
- {
134
- callId: `${turnId}_c1`,
135
- toolName: "get_weather",
136
- args: { city: "NYC" },
137
- },
138
- ],
139
- },
140
- turnId
141
- ),
142
- event(
143
- "action.result",
144
- {
145
- callId: `${turnId}_c1`,
146
- toolName: "get_weather",
147
- output: { tempF: 72 },
148
- isError: false,
149
- },
150
- turnId
151
- ),
152
- event(
153
- "message.completed",
154
- { text: "Sunny, 72F in NYC.", finishReason: "stop" },
155
- turnId
156
- ),
157
- event("turn.completed", {}, turnId),
158
- event("session.waiting", {}, undefined),
159
- ];
160
-
161
- let stub: StubAgent | undefined;
162
-
163
- afterEach(async () => {
164
- await stub?.close();
165
- stub = undefined;
166
- });
167
-
168
- async function run(
169
- definition: EvalDefinition,
170
- baseUrl: string
171
- ): Promise<EvalRunResult[]> {
172
- return runDiscoveredEvals({
173
- projectRoot: "/unused",
174
- baseUrl,
175
- discovered: {
176
- evals: expandEvalModule("http", definition).map((e) => ({
177
- id: e.id,
178
- fileId: "http",
179
- path: "/repo/evals/http.eval.ts",
180
- definition: e.definition,
181
- })),
182
- config: { maxConcurrency: 2 },
183
- },
184
- });
185
- }
186
-
187
- describe("runner over a real session stream", () => {
188
- it("grades assertions from events that arrived over HTTP", async () => {
189
- stub = await startStubAgent(weatherScript);
190
- const [result] = await run(
191
- defineEval({
192
- async test(t) {
193
- await t.send("What is the weather in NYC?");
194
- t.succeeded();
195
- t.calledTool("get_weather", {
196
- input: { city: "NYC" },
197
- output: { tempF: 72 },
198
- status: "completed",
199
- count: 1,
200
- });
201
- t.noFailedActions();
202
- t.messageIncludes("Sunny");
203
- t.check(t.reply, includes("72F"));
204
- t.maxToolCalls(1);
205
- },
206
- }),
207
- stub.url
208
- );
209
- expect(result?.verdict).toBe("passed");
210
- expect(result?.assertions.every((a) => a.passed)).toBe(true);
211
- expect(stub.received).toEqual(["What is the weather in NYC?"]);
212
- // The transport-derived views the CLI and playground print.
213
- expect(result?.tools).toEqual(["get_weather"]);
214
- expect(result?.toolCalls).toEqual([
215
- {
216
- toolName: "get_weather",
217
- args: { city: "NYC" },
218
- output: { tempF: 72 },
219
- isError: false,
220
- },
221
- ]);
222
- expect(result?.finalText).toBe("Sunny, 72F in NYC.");
223
- expect(result?.sessionId).toBe("ses_1");
224
- });
225
-
226
- it("resumes the stream so a second send reads the second turn", async () => {
227
- // Each turn replies with the message it received and calls a distinct tool,
228
- // so a send that replayed the earlier turn would be unmistakable. The
229
- // stream replays from an index and stops at the first terminal event, so
230
- // this is the regression test for resuming at the right cursor.
231
- stub = await startStubAgent((message, turnId) => [
232
- event("message.received", { text: message }, turnId),
233
- event(
234
- "actions.requested",
235
- {
236
- calls: [
237
- { callId: `${turnId}_c1`, toolName: `tool_${message}`, args: {} },
238
- ],
239
- },
240
- turnId
241
- ),
242
- event(
243
- "action.result",
244
- {
245
- callId: `${turnId}_c1`,
246
- toolName: `tool_${message}`,
247
- output: "ok",
248
- isError: false,
249
- },
250
- turnId
251
- ),
252
- event(
253
- "message.completed",
254
- { text: `reply to ${message}`, finishReason: "stop" },
255
- turnId
256
- ),
257
- event("turn.completed", {}, turnId),
258
- event("session.waiting", {}, undefined),
259
- ]);
260
-
261
- const [result] = await run(
262
- defineEval({
263
- async test(t) {
264
- const first = await t.send("first");
265
- t.check(first.message, includes("reply to first"));
266
-
267
- const second = await t.send("second");
268
- t.check(second.message, includes("reply to second"));
269
- t.check(t.reply, includes("reply to second"));
270
-
271
- // Each turn sees only its own tool call.
272
- first.calledTool("tool_first", { count: 1 });
273
- first.notCalledTool("tool_second");
274
- second.calledTool("tool_second", { count: 1 });
275
- second.notCalledTool("tool_first");
276
-
277
- // The run sees both, exactly once each.
278
- t.calledTool("tool_first", { count: 1 });
279
- t.calledTool("tool_second", { count: 1 });
280
- t.maxToolCalls(2);
281
- t.toolOrder(["tool_first", "tool_second"]);
282
- t.check(second.sessionId, includes(first.sessionId));
283
- },
284
- }),
285
- stub.url
286
- );
287
- expect(result?.verdict).toBe("passed");
288
- const failed = result!.assertions.filter((a) => !a.passed);
289
- expect(failed).toEqual([]);
290
- expect(stub.received).toEqual(["first", "second"]);
291
- expect(result?.inputs).toEqual(["first", "second"]);
292
- expect(result?.finalText).toBe("reply to second");
293
- });
294
-
295
- it("fails a run whose turn failed on the wire", async () => {
296
- stub = await startStubAgent((message, turnId) => [
297
- event("message.received", { text: message }, turnId),
298
- event("turn.failed", { message: "provider unavailable" }, turnId),
299
- event("session.waiting", {}, undefined),
300
- ]);
301
- const [result] = await run(
302
- defineEval({
303
- async test(t) {
304
- await t.send("hello");
305
- t.succeeded();
306
- },
307
- }),
308
- stub.url
309
- );
310
- expect(result?.verdict).toBe("failed");
311
- expect(result?.assertions[0]).toMatchObject({
312
- name: "succeeded",
313
- passed: false,
314
- detail: "provider unavailable",
315
- });
316
- });
317
-
318
- it("detects a run parked on an unanswered approval request", async () => {
319
- stub = await startStubAgent((message, turnId) => [
320
- event("message.received", { text: message }, turnId),
321
- event(
322
- "actions.requested",
323
- {
324
- calls: [{ callId: "c1", toolName: "deploy", args: { env: "prod" } }],
325
- },
326
- turnId
327
- ),
328
- event(
329
- "action.approval_requested",
330
- { callId: "c1", toolName: "deploy", args: { env: "prod" } },
331
- turnId
332
- ),
333
- event("session.waiting", {}, undefined),
334
- ]);
335
- const [result] = await run(
336
- defineEval({
337
- async test(t) {
338
- await t.send("deploy to prod");
339
- t.parked();
340
- const request = t.requireInputRequest({ toolName: "deploy" });
341
- t.check(request.args, includes("prod"));
342
- t.calledTool("deploy", { status: "pending", count: 1 });
343
- },
344
- }),
345
- stub.url
346
- );
347
- expect(result?.verdict).toBe("passed");
348
- expect(result?.assertions.map((a) => a.passed)).toEqual([
349
- true,
350
- true,
351
- true,
352
- true,
353
- ]);
354
- });
355
-
356
- it("records a failed tool call without failing the turn", async () => {
357
- stub = await startStubAgent((message, turnId) => [
358
- event("message.received", { text: message }, turnId),
359
- event(
360
- "actions.requested",
361
- {
362
- calls: [
363
- { callId: "c1", toolName: "bash", args: { command: "false" } },
364
- ],
365
- },
366
- turnId
367
- ),
368
- event(
369
- "action.result",
370
- { callId: "c1", toolName: "bash", output: "exit 1", isError: true },
371
- turnId
372
- ),
373
- event(
374
- "message.completed",
375
- { text: "That command failed.", finishReason: "stop" },
376
- turnId
377
- ),
378
- event("turn.completed", {}, turnId),
379
- event("session.waiting", {}, undefined),
380
- ]);
381
- const [result] = await run(
382
- defineEval({
383
- async test(t) {
384
- await t.send("run false");
385
- t.succeeded();
386
- t.calledTool("bash", { status: "failed", count: 1 });
387
- t.noFailedActions();
388
- },
389
- }),
390
- stub.url
391
- );
392
- expect(result?.verdict).toBe("failed");
393
- const byName = new Map(result!.assertions.map((a) => [a.name, a]));
394
- expect(byName.get("succeeded")?.passed).toBe(true);
395
- expect(
396
- byName.get("calledTool(bash, {status=failed, count=1})")?.passed
397
- ).toBe(true);
398
- expect(byName.get("noFailedActions")).toMatchObject({
399
- passed: false,
400
- detail: "bash",
401
- });
402
- });
403
- });