@cursor/july 0.1.19 → 0.1.21
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/AGENTS.md +10 -0
- package/dist/bin/agent-serve.js +0 -0
- package/dist/channels/github/instrument.d.ts +20 -0
- package/dist/channels/github/instrument.d.ts.map +1 -0
- package/dist/channels/slack/api.d.ts +2 -0
- package/dist/channels/slack/api.d.ts.map +1 -1
- package/dist/channels/slack/api.js +3 -0
- package/dist/channels/slack/bot-mentions.d.ts +106 -0
- package/dist/channels/slack/bot-mentions.d.ts.map +1 -0
- package/dist/channels/slack/bot-mentions.js +243 -0
- package/dist/channels/slack/dispatch.d.ts +6 -0
- package/dist/channels/slack/dispatch.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.js +24 -3
- package/dist/channels/slack/inbound.d.ts +10 -1
- package/dist/channels/slack/inbound.d.ts.map +1 -1
- package/dist/channels/slack/inbound.js +12 -4
- package/dist/channels/slack/index.d.ts +1 -0
- package/dist/channels/slack/index.d.ts.map +1 -1
- package/dist/channels/slack/index.js +1 -0
- package/dist/channels/slack/slack-channel.d.ts.map +1 -1
- package/dist/channels/slack/slack-channel.js +61 -22
- package/dist/channels/slack/types.d.ts +58 -0
- package/dist/channels/slack/types.d.ts.map +1 -1
- package/dist/docs/404.html +1 -1
- package/dist/docs/ab.html +2 -2
- package/dist/docs/assets/{app.CrsWMchO.js → app.jDxLzWv4.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.DoJHJjqF.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.D1JqzSh8.js → VPLocalSearchBox.Y6bDR1-a.js} +1 -1
- package/dist/docs/assets/chunks/{theme.DaBvZYwl.js → theme.CLazCWlJ.js} +2 -2
- package/dist/docs/building-with-agents.html +2 -2
- package/dist/docs/concepts.html +2 -2
- package/dist/docs/deployment.html +2 -2
- package/dist/docs/evals.html +2 -2
- package/dist/docs/example-agents/approval-buddy.html +2 -2
- package/dist/docs/example-agents/benny.html +2 -2
- package/dist/docs/example-agents/bugbot.html +2 -2
- package/dist/docs/example-agents/codebase-wiki.html +2 -2
- package/dist/docs/example-agents/codeowners-review.html +2 -2
- package/dist/docs/example-agents/concierge.html +2 -2
- package/dist/docs/example-agents/fsd.html +2 -2
- package/dist/docs/example-agents/index.html +2 -2
- package/dist/docs/example-agents/knowledge-base.html +2 -2
- package/dist/docs/example-agents/oncall.html +2 -2
- package/dist/docs/example-agents/security-reviewer.html +2 -2
- package/dist/docs/example-agents/slack-agent.html +2 -2
- package/dist/docs/example-agents/weather-agent.html +2 -2
- package/dist/docs/guides/agent-to-agent.html +2 -2
- package/dist/docs/guides/cloud-runtime.html +2 -2
- package/dist/docs/guides/github.html +2 -2
- package/dist/docs/guides/human-in-the-loop.html +2 -2
- package/dist/docs/guides/mcp-oauth.html +2 -2
- package/dist/docs/guides/slack.html +2 -2
- package/dist/docs/guides/webhooks.html +2 -2
- package/dist/docs/hillclimbing.html +2 -2
- package/dist/docs/index.html +2 -2
- package/dist/docs/quickstart.html +2 -2
- package/dist/docs/reference/agent-config.html +2 -2
- package/dist/docs/reference/channels.html +2 -2
- package/dist/docs/reference/cli.html +2 -2
- package/dist/docs/reference/connections.html +2 -2
- package/dist/docs/reference/hooks.html +2 -2
- package/dist/docs/reference/http-api.html +2 -2
- package/dist/docs/reference/instructions.html +2 -2
- package/dist/docs/reference/playground.html +2 -2
- package/dist/docs/reference/project-layout.html +2 -2
- package/dist/docs/reference/prompt.html +2 -2
- package/dist/docs/reference/schedules.html +2 -2
- package/dist/docs/reference/sessions.html +2 -2
- package/dist/docs/reference/skills.html +2 -2
- package/dist/docs/reference/subagents.html +2 -2
- package/dist/docs/reference/tools.html +2 -2
- package/dist/docs/scaffolding-agents.html +2 -2
- package/dist/docs/storage.html +2 -2
- package/dist/docs/troubleshooting.html +2 -2
- package/dist/internal/json-dir-store.d.ts +32 -0
- package/dist/internal/json-dir-store.d.ts.map +1 -0
- package/dist/internal/json-dir-store.js +100 -0
- package/dist/internal/resolved-connections.d.ts +1 -1
- package/dist/internal/resolved-connections.d.ts.map +1 -1
- package/dist/internal/resolved-connections.js +10 -0
- package/dist/internal/session-engine.d.ts +4 -1
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +13 -2
- package/dist/playground/assets/index-CjOQ4hN9.css +1 -0
- package/dist/playground/assets/{index-C2SU2xV5.js → index-dshZQJCp.js} +46 -46
- package/dist/playground/index.html +2 -2
- package/dist/types.d.ts +7 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +9 -0
- package/package.json +25 -25
- package/skills/create-agent/SKILL.md +36 -4
- package/skills/evals/SKILL.md +3 -0
- package/skills/framework-map/SKILL.md +14 -0
- package/skills/github/SKILL.md +6 -1
- package/skills/hillclimb/SKILL.md +28 -7
- package/src/bin/agent-serve.version.test.ts +62 -0
- package/src/channels/github/api.test.ts +64 -0
- package/src/channels/github/auth.test.ts +105 -0
- package/src/channels/github/cursor-account.test.ts +204 -0
- package/src/channels/github/forward.test.ts +457 -0
- package/src/channels/github/github.test.ts +937 -0
- package/src/channels/github/replay.test.ts +179 -0
- package/src/channels/slack/api.post-message.test.ts +148 -0
- package/src/channels/slack/api.ts +5 -0
- package/src/channels/slack/approvals.test.ts +328 -0
- package/src/channels/slack/block-actions.test.ts +452 -0
- package/src/channels/slack/bot-mentions.test.ts +217 -0
- package/src/channels/slack/bot-mentions.ts +315 -0
- package/src/channels/slack/channel-watch.test.ts +363 -0
- package/src/channels/slack/cursor-account.test.ts +253 -0
- package/src/channels/slack/defaults.final-post.test.ts +182 -0
- package/src/channels/slack/dispatch.test.ts +795 -0
- package/src/channels/slack/dispatch.ts +27 -1
- package/src/channels/slack/eval-directive.test.ts +273 -0
- package/src/channels/slack/inbound.ts +25 -4
- package/src/channels/slack/index.ts +1 -0
- package/src/channels/slack/message-body.test.ts +54 -0
- package/src/channels/slack/nudge-store.test.ts +143 -0
- package/src/channels/slack/slack-channel.ts +66 -8
- package/src/channels/slack/slack.test.ts +391 -0
- package/src/channels/slack/stop.test.ts +23 -0
- package/src/channels/slack/thread-context.test.ts +202 -0
- package/src/channels/slack/types.ts +60 -0
- package/src/evals/assertions.test.ts +580 -0
- package/src/evals/expect.test.ts +144 -0
- package/src/evals/judge.test.ts +181 -0
- package/src/evals/loaders.test.ts +132 -0
- package/src/evals/matchers.test.ts +95 -0
- package/src/evals/reporters.test.ts +303 -0
- package/src/evals/run-facts.test.ts +259 -0
- package/src/internal/ab-snapshot.test.ts +325 -0
- package/src/internal/approval-gate.test.ts +49 -0
- package/src/internal/approvals.integration.test.ts +383 -0
- package/src/internal/authored-loaders.test.ts +31 -0
- package/src/internal/builtin-tools/reminders.test.ts +201 -0
- package/src/internal/channel-route-schema.test.ts +294 -0
- package/src/internal/chat-attach.test.ts +262 -0
- package/src/internal/cli-deploy.test.ts +1991 -0
- package/src/internal/cli-mcp.test.ts +789 -0
- package/src/internal/cli-skills.test.ts +133 -0
- package/src/internal/cli-slack.test.ts +1647 -0
- package/src/internal/cloud-merge.test.ts +74 -0
- package/src/internal/cron.test.ts +22 -0
- package/src/internal/cursor/account-mcp.test.ts +807 -0
- package/src/internal/cursor/backend-client.test.ts +591 -0
- package/src/internal/cursor/credentials.test.ts +351 -0
- package/src/internal/cursor/github-credentials.test.ts +136 -0
- package/src/internal/cursor-account-mcp-auth.test.ts +310 -0
- package/src/internal/cursor-account.integration.test.ts +441 -0
- package/src/internal/cursor-event-relay.test.ts +746 -0
- package/src/internal/cursor-github-credentials.integration.test.ts +271 -0
- package/src/internal/cursor-slack-relay.test.ts +525 -0
- package/src/internal/deploy-source.test.ts +111 -0
- package/src/internal/discovery.builtin-tools.test.ts +94 -0
- package/src/internal/discovery.concurrency.test.ts +60 -0
- package/src/internal/discovery.cursor-account.test.ts +133 -0
- package/src/internal/discovery.cwd.test.ts +83 -0
- package/src/internal/discovery.hosting.test.ts +80 -0
- package/src/internal/discovery.identity.test.ts +44 -0
- package/src/internal/docs-site.test.ts +66 -0
- package/src/internal/duration.test.ts +29 -0
- package/src/internal/eval-judge-model.test.ts +187 -0
- package/src/internal/eval-run-store.cancel.test.ts +142 -0
- package/src/internal/eval-run-store.storage.test.ts +211 -0
- package/src/internal/eval-runner.http.test.ts +403 -0
- package/src/internal/eval-runner.run.test.ts +928 -0
- package/src/internal/evals-client.test.ts +307 -0
- package/src/internal/event-mapper.test.ts +243 -0
- package/src/internal/github-fanout.test.ts +213 -0
- package/src/internal/handleAgentServeTrigger.test.ts +179 -0
- package/src/internal/host-kv.test.ts +82 -0
- package/src/internal/host-platforms.test.ts +126 -0
- package/src/internal/http-channel.test.ts +402 -0
- package/src/internal/init-project.test.ts +269 -0
- package/src/internal/install-cursor-skills.test.ts +262 -0
- package/src/internal/local-env.test.ts +100 -0
- package/src/internal/log-ring.test.ts +31 -0
- package/src/internal/logs-client.test.ts +350 -0
- package/src/internal/mcp-endpoint.test.ts +436 -0
- package/src/internal/mcp-host.test.ts +298 -0
- package/src/internal/mcp-oauth.test.ts +148 -0
- package/src/internal/net.test.ts +17 -0
- package/src/internal/peer-connections.test.ts +128 -0
- package/src/internal/peer-mcp.integration.test.ts +289 -0
- package/src/internal/playground/toolchain.test.ts +53 -0
- package/src/internal/playground-cli.test.ts +187 -0
- package/src/internal/playground-proxy.test.ts +376 -0
- package/src/internal/prompt-context.integration.test.ts +232 -0
- package/src/internal/prompt-context.test.ts +127 -0
- package/src/internal/reminder-runner.test.ts +390 -0
- package/src/internal/reminder-store.test.ts +53 -0
- package/src/internal/request-headers.test.ts +27 -0
- package/src/internal/resolve-prod-target.test.ts +787 -0
- package/src/internal/resolved-connections.test.ts +295 -0
- package/src/internal/resolved-connections.ts +18 -1
- package/src/internal/router.test.ts +57 -0
- package/src/internal/sdk-runner.test.ts +290 -0
- package/src/internal/session-engine.coalesce.test.ts +169 -0
- package/src/internal/session-engine.concurrency.test.ts +250 -0
- package/src/internal/session-engine.host-oauth-mcp.test.ts +110 -0
- package/src/internal/session-engine.interrupt.test.ts +577 -0
- package/src/internal/session-engine.storage.test.ts +547 -0
- package/src/internal/session-engine.ts +15 -1
- package/src/internal/session-urls.test.ts +28 -0
- package/src/internal/sessions-client.test.ts +518 -0
- package/src/internal/storage-coordinator.test.ts +517 -0
- package/src/internal/tool-call.test.ts +458 -0
- package/src/internal/tool-result.test.ts +52 -0
- package/src/internal/trajectory.approvals.test.ts +83 -0
- package/src/internal/trajectory.subagents.test.ts +198 -0
- package/src/internal/turn-governor.test.ts +137 -0
- package/src/internal/update-check.test.ts +485 -0
- package/src/internal/workspace.test.ts +81 -0
- package/src/storage-backends/cursor-hosted.test.ts +121 -0
- package/src/types.ts +12 -0
- package/dist/docs/assets/chunks/@localSearchIndexroot.BnHRjfoe.js +0 -1
- package/dist/playground/assets/index-CidizGZv.css +0 -1
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import { describe, expect, it, vi } from "vitest";
|
|
2
|
+
import { httpChannel } from "../channels.js";
|
|
3
|
+
import type { AgentProject, DiscoveredConnection } from "../types.js";
|
|
4
|
+
import { CursorAccountMcpBridge } from "./cursor/account-mcp.js";
|
|
5
|
+
import { CursorBackendClient } from "./cursor/backend-client.js";
|
|
6
|
+
import {
|
|
7
|
+
assertAccountConnectionsNotAnonymous,
|
|
8
|
+
assertCloudCanHonorAccountServersFilters,
|
|
9
|
+
resolveMountConnections,
|
|
10
|
+
validateMountConnectionsConfig,
|
|
11
|
+
} from "./resolved-connections.js";
|
|
12
|
+
|
|
13
|
+
function makeProject(
|
|
14
|
+
overrides: Partial<AgentProject["agent"]> = {},
|
|
15
|
+
connections: DiscoveredConnection[] = []
|
|
16
|
+
): AgentProject {
|
|
17
|
+
return {
|
|
18
|
+
rootDir: "/tmp/resolved-connections-fixture",
|
|
19
|
+
agentDir: "/tmp/resolved-connections-fixture/agent",
|
|
20
|
+
name: "fixture",
|
|
21
|
+
agent: {
|
|
22
|
+
name: "fixture",
|
|
23
|
+
runtime: "local",
|
|
24
|
+
tools: [],
|
|
25
|
+
skills: [],
|
|
26
|
+
connections,
|
|
27
|
+
subagents: [],
|
|
28
|
+
seedFiles: [],
|
|
29
|
+
...overrides,
|
|
30
|
+
},
|
|
31
|
+
httpChannel: httpChannel(),
|
|
32
|
+
channels: [],
|
|
33
|
+
schedules: [],
|
|
34
|
+
hooks: [],
|
|
35
|
+
abs: [],
|
|
36
|
+
diagnostics: [],
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function stubBridge(): CursorAccountMcpBridge {
|
|
41
|
+
const fetchImpl = vi.fn(async () =>
|
|
42
|
+
Response.json({ accessToken: "token", refreshToken: "refresh" })
|
|
43
|
+
);
|
|
44
|
+
return new CursorAccountMcpBridge({
|
|
45
|
+
client: new CursorBackendClient({
|
|
46
|
+
backendUrl: "http://127.0.0.1:9",
|
|
47
|
+
apiKey: "crsr_test",
|
|
48
|
+
fetchImpl,
|
|
49
|
+
}),
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
describe("resolveMountConnections", () => {
|
|
54
|
+
it("refuses cloud-capable agents with filtered account MCP connections and no publicUrl", () => {
|
|
55
|
+
const project = makeProject({ runtime: "cloud" }, [
|
|
56
|
+
{
|
|
57
|
+
name: "cursor",
|
|
58
|
+
transport: { cursorAccount: true, servers: ["Linear"] },
|
|
59
|
+
},
|
|
60
|
+
]);
|
|
61
|
+
expect(() =>
|
|
62
|
+
validateMountConnectionsConfig({
|
|
63
|
+
slug: "",
|
|
64
|
+
project,
|
|
65
|
+
accountRefs: [{ name: "cursor", servers: ["Linear"] }],
|
|
66
|
+
})
|
|
67
|
+
).toThrow(/servers.*filters.*no --public-url/);
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it("allows cloud-capable agents with unfiltered account MCP connections and no publicUrl", () => {
|
|
71
|
+
const project = makeProject({ runtime: "cloud" }, [
|
|
72
|
+
{ name: "cursor", transport: { cursorAccount: true } },
|
|
73
|
+
]);
|
|
74
|
+
const warnings: string[] = [];
|
|
75
|
+
const resolved = resolveMountConnections({
|
|
76
|
+
slug: "",
|
|
77
|
+
project,
|
|
78
|
+
serverUrl: "http://127.0.0.1:4100",
|
|
79
|
+
accountRefs: [{ name: "cursor" }],
|
|
80
|
+
accountBridge: stubBridge(),
|
|
81
|
+
logger: (line) => {
|
|
82
|
+
warnings.push(line);
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
expect(resolved).toHaveLength(1);
|
|
86
|
+
expect(resolved[0]?.cloudUrl).toBeUndefined();
|
|
87
|
+
expect(
|
|
88
|
+
warnings.some((line) => line.includes("omit the account bridge"))
|
|
89
|
+
).toBe(true);
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
it("resolves cloudUrl for filtered account MCP connections when publicUrl is set", () => {
|
|
93
|
+
const project = makeProject({ runtime: "cloud" }, [
|
|
94
|
+
{
|
|
95
|
+
name: "cursor",
|
|
96
|
+
transport: { cursorAccount: true, servers: ["Linear"] },
|
|
97
|
+
},
|
|
98
|
+
]);
|
|
99
|
+
const resolved = resolveMountConnections({
|
|
100
|
+
slug: "",
|
|
101
|
+
project,
|
|
102
|
+
serverUrl: "http://127.0.0.1:4100",
|
|
103
|
+
publicUrl: "https://agents.example.com",
|
|
104
|
+
accountRefs: [{ name: "cursor", servers: ["Linear"] }],
|
|
105
|
+
accountBridge: stubBridge(),
|
|
106
|
+
logger: () => {},
|
|
107
|
+
});
|
|
108
|
+
expect(resolved[0]?.cloudUrl).toBe(
|
|
109
|
+
"https://agents.example.com/v1/cursor-account/cursor/mcp"
|
|
110
|
+
);
|
|
111
|
+
expect(resolved[0]?.accountServersFilter).toEqual(["Linear"]);
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
it("exempts hostOnly filtered account connections from the publicUrl requirement", () => {
|
|
115
|
+
// A host-only bridge never reaches the model, so cloud turns have no
|
|
116
|
+
// `servers` filter to honor — host-side calls always use loopback.
|
|
117
|
+
const project = makeProject({ runtime: "cloud" }, [
|
|
118
|
+
{
|
|
119
|
+
name: "anytool",
|
|
120
|
+
transport: { cursorAccount: true, servers: ["anytool"] },
|
|
121
|
+
hostOnly: true,
|
|
122
|
+
},
|
|
123
|
+
]);
|
|
124
|
+
expect(() =>
|
|
125
|
+
validateMountConnectionsConfig({
|
|
126
|
+
slug: "",
|
|
127
|
+
project,
|
|
128
|
+
accountRefs: [{ name: "anytool", servers: ["anytool"] }],
|
|
129
|
+
})
|
|
130
|
+
).not.toThrow();
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
it("still refuses when a filtered account connection is not hostOnly", () => {
|
|
134
|
+
const project = makeProject({ runtime: "cloud" }, [
|
|
135
|
+
{
|
|
136
|
+
name: "anytool",
|
|
137
|
+
transport: { cursorAccount: true, servers: ["anytool"] },
|
|
138
|
+
hostOnly: true,
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
name: "cursor",
|
|
142
|
+
transport: { cursorAccount: true, servers: ["Linear"] },
|
|
143
|
+
},
|
|
144
|
+
]);
|
|
145
|
+
expect(() =>
|
|
146
|
+
validateMountConnectionsConfig({
|
|
147
|
+
slug: "",
|
|
148
|
+
project,
|
|
149
|
+
accountRefs: [
|
|
150
|
+
{ name: "anytool", servers: ["anytool"] },
|
|
151
|
+
{ name: "cursor", servers: ["Linear"] },
|
|
152
|
+
],
|
|
153
|
+
})
|
|
154
|
+
).toThrow(/servers.*filters.*no --public-url/);
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
it("warns that cloud turns omit host-OAuth connections", () => {
|
|
158
|
+
const project = makeProject({ runtime: "cloud" }, [
|
|
159
|
+
{
|
|
160
|
+
name: "anytool",
|
|
161
|
+
transport: { url: "https://anytool.example.com/mcp", oauth: true },
|
|
162
|
+
},
|
|
163
|
+
]);
|
|
164
|
+
const warnings: string[] = [];
|
|
165
|
+
resolveMountConnections({
|
|
166
|
+
slug: "",
|
|
167
|
+
project,
|
|
168
|
+
serverUrl: "http://127.0.0.1:4100",
|
|
169
|
+
logger: (line) => {
|
|
170
|
+
warnings.push(line);
|
|
171
|
+
},
|
|
172
|
+
});
|
|
173
|
+
expect(
|
|
174
|
+
warnings.some(
|
|
175
|
+
(line) =>
|
|
176
|
+
line.includes("host-OAuth MCP connections (anytool)") &&
|
|
177
|
+
line.includes("cloud-runtime turns omit them")
|
|
178
|
+
)
|
|
179
|
+
).toBe(true);
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
it("does not warn about host-OAuth connections on local agents or hostOnly ones", () => {
|
|
183
|
+
const warnings: string[] = [];
|
|
184
|
+
const logger = (line: string): void => {
|
|
185
|
+
warnings.push(line);
|
|
186
|
+
};
|
|
187
|
+
resolveMountConnections({
|
|
188
|
+
slug: "",
|
|
189
|
+
project: makeProject({ runtime: "local" }, [
|
|
190
|
+
{
|
|
191
|
+
name: "anytool",
|
|
192
|
+
transport: { url: "https://anytool.example.com/mcp", oauth: true },
|
|
193
|
+
},
|
|
194
|
+
]),
|
|
195
|
+
serverUrl: "http://127.0.0.1:4100",
|
|
196
|
+
logger,
|
|
197
|
+
});
|
|
198
|
+
resolveMountConnections({
|
|
199
|
+
slug: "",
|
|
200
|
+
project: makeProject({ runtime: "cloud" }, [
|
|
201
|
+
{
|
|
202
|
+
name: "anytool",
|
|
203
|
+
transport: { url: "https://anytool.example.com/mcp", oauth: true },
|
|
204
|
+
hostOnly: true,
|
|
205
|
+
},
|
|
206
|
+
]),
|
|
207
|
+
serverUrl: "http://127.0.0.1:4100",
|
|
208
|
+
logger,
|
|
209
|
+
});
|
|
210
|
+
expect(warnings.some((line) => line.includes("host-OAuth"))).toBe(false);
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
it("allows local-default agents with filtered account MCP connections at startup", () => {
|
|
214
|
+
const project = makeProject({ runtime: "local" }, [
|
|
215
|
+
{
|
|
216
|
+
name: "cursor",
|
|
217
|
+
transport: { cursorAccount: true, servers: ["Linear"] },
|
|
218
|
+
},
|
|
219
|
+
]);
|
|
220
|
+
const resolved = resolveMountConnections({
|
|
221
|
+
slug: "",
|
|
222
|
+
project,
|
|
223
|
+
serverUrl: "http://127.0.0.1:4100",
|
|
224
|
+
accountRefs: [{ name: "cursor", servers: ["Linear"] }],
|
|
225
|
+
accountBridge: stubBridge(),
|
|
226
|
+
logger: () => {},
|
|
227
|
+
});
|
|
228
|
+
expect(resolved).toHaveLength(1);
|
|
229
|
+
expect(resolved[0]?.cloudUrl).toBeUndefined();
|
|
230
|
+
});
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
describe("assertCloudCanHonorAccountServersFilters", () => {
|
|
234
|
+
it("refuses cloud turns when a filtered account bridge lacks cloudUrl", () => {
|
|
235
|
+
expect(() =>
|
|
236
|
+
assertCloudCanHonorAccountServersFilters({
|
|
237
|
+
runtime: "cloud",
|
|
238
|
+
resolvedConnections: [
|
|
239
|
+
{
|
|
240
|
+
name: "cursor",
|
|
241
|
+
localUrl: "http://127.0.0.1:4100/v1/cursor-account/cursor/mcp",
|
|
242
|
+
accountServersFilter: ["Linear"],
|
|
243
|
+
},
|
|
244
|
+
],
|
|
245
|
+
})
|
|
246
|
+
).toThrow(/cannot honor Cursor account `servers` filters/);
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
it("allows local turns without a public bridge URL", () => {
|
|
250
|
+
expect(() =>
|
|
251
|
+
assertCloudCanHonorAccountServersFilters({
|
|
252
|
+
runtime: "local",
|
|
253
|
+
resolvedConnections: [
|
|
254
|
+
{
|
|
255
|
+
name: "cursor",
|
|
256
|
+
localUrl: "http://127.0.0.1:4100/v1/cursor-account/cursor/mcp",
|
|
257
|
+
accountServersFilter: ["Linear"],
|
|
258
|
+
},
|
|
259
|
+
],
|
|
260
|
+
})
|
|
261
|
+
).not.toThrow();
|
|
262
|
+
});
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
describe("assertAccountConnectionsNotAnonymous", () => {
|
|
266
|
+
it("refuses anonymous admission when account MCP connections are configured", () => {
|
|
267
|
+
expect(() =>
|
|
268
|
+
assertAccountConnectionsNotAnonymous({
|
|
269
|
+
allowAnonymous: true,
|
|
270
|
+
hasAccountConnections: true,
|
|
271
|
+
})
|
|
272
|
+
).toThrow(
|
|
273
|
+
/--allow-anonymous cannot be used with Cursor account MCP connections/
|
|
274
|
+
);
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
it("allows anonymous admission without account MCP connections", () => {
|
|
278
|
+
expect(() =>
|
|
279
|
+
assertAccountConnectionsNotAnonymous({
|
|
280
|
+
allowAnonymous: true,
|
|
281
|
+
hasAccountConnections: false,
|
|
282
|
+
})
|
|
283
|
+
).not.toThrow();
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
it("allows anonymous admission when allowAnonymousCursorAccountMcp opts in", () => {
|
|
287
|
+
expect(() =>
|
|
288
|
+
assertAccountConnectionsNotAnonymous({
|
|
289
|
+
allowAnonymous: true,
|
|
290
|
+
allowAnonymousCursorAccountMcp: true,
|
|
291
|
+
hasAccountConnections: true,
|
|
292
|
+
})
|
|
293
|
+
).not.toThrow();
|
|
294
|
+
});
|
|
295
|
+
});
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* connectors instead of the bridge.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import type
|
|
10
|
+
import { type AgentProject, isHostOauthConnectionTransport } from "../types.js";
|
|
11
11
|
import {
|
|
12
12
|
type CursorAccountConnectionRef,
|
|
13
13
|
type CursorAccountMcpBridge,
|
|
@@ -118,6 +118,23 @@ export function resolveMountConnections(args: {
|
|
|
118
118
|
const label = args.slug === "" ? args.project.name : args.slug;
|
|
119
119
|
const resolved: EngineResolvedConnection[] = [];
|
|
120
120
|
|
|
121
|
+
if (cloudCapable) {
|
|
122
|
+
const hostOauthNames = agent.connections
|
|
123
|
+
.filter(
|
|
124
|
+
(connection) =>
|
|
125
|
+
connection.hostOnly !== true &&
|
|
126
|
+
isHostOauthConnectionTransport(connection.transport)
|
|
127
|
+
)
|
|
128
|
+
.map((connection) => connection.name);
|
|
129
|
+
if (hostOauthNames.length > 0) {
|
|
130
|
+
args.logger(
|
|
131
|
+
`[agentkit] warning: agent "${label}" has host-OAuth MCP connections (${hostOauthNames.join(
|
|
132
|
+
", "
|
|
133
|
+
)}) whose tokens live on this serve host; cloud-runtime turns omit them. Mark them \`hostOnly: true\` and call them from host tools, or drop \`oauth\` and authorize the server another way.`
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
121
138
|
if (args.peerRefs !== undefined && args.peerRefs.length > 0) {
|
|
122
139
|
const peers = resolvePeerConnections({
|
|
123
140
|
refs: args.peerRefs,
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { Router, type ServerRoute } from "./router.js";
|
|
3
|
+
|
|
4
|
+
function route(pattern: string): ServerRoute {
|
|
5
|
+
return {
|
|
6
|
+
method: "GET",
|
|
7
|
+
pattern,
|
|
8
|
+
auth: "none",
|
|
9
|
+
handler: () => new Response("ok"),
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
describe("Router catch-all segments", () => {
|
|
14
|
+
it("matches zero or more trailing segments", () => {
|
|
15
|
+
const router = new Router();
|
|
16
|
+
router.add(route("/docs/*path"));
|
|
17
|
+
|
|
18
|
+
expect(router.match("GET", "/docs")?.params.path).toBe("");
|
|
19
|
+
expect(router.match("GET", "/docs/")?.params.path).toBe("");
|
|
20
|
+
expect(router.match("GET", "/docs/quickstart")?.params.path).toBe(
|
|
21
|
+
"quickstart"
|
|
22
|
+
);
|
|
23
|
+
expect(router.match("GET", "/docs/guides/slack")?.params.path).toBe(
|
|
24
|
+
"guides/slack"
|
|
25
|
+
);
|
|
26
|
+
expect(router.match("GET", "/docs/assets/chunks/app.js")?.params.path).toBe(
|
|
27
|
+
"assets/chunks/app.js"
|
|
28
|
+
);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it("decodes each captured segment", () => {
|
|
32
|
+
const router = new Router();
|
|
33
|
+
router.add(route("/docs/*path"));
|
|
34
|
+
expect(router.match("GET", "/docs/a%20b/c")?.params.path).toBe("a b/c");
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it("does not shadow unrelated prefixes", () => {
|
|
38
|
+
const router = new Router();
|
|
39
|
+
router.add(route("/docs/*path"));
|
|
40
|
+
expect(router.match("GET", "/v1/health")).toBeUndefined();
|
|
41
|
+
expect(router.match("GET", "/docsx")).toBeUndefined();
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it("still matches fixed segments before the catch-all", () => {
|
|
45
|
+
const router = new Router();
|
|
46
|
+
router.add(route("/a/:id/*rest"));
|
|
47
|
+
const match = router.match("GET", "/a/42/x/y");
|
|
48
|
+
expect(match?.params.id).toBe("42");
|
|
49
|
+
expect(match?.params.rest).toBe("x/y");
|
|
50
|
+
expect(router.match("GET", "/a")).toBeUndefined();
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it("rejects non-trailing catch-alls at registration", () => {
|
|
54
|
+
const router = new Router();
|
|
55
|
+
expect(() => router.add(route("/a/*rest/b"))).toThrow(/last segment/);
|
|
56
|
+
});
|
|
57
|
+
});
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
import { mkdtemp } from "node:fs/promises";
|
|
2
|
+
import { tmpdir } from "node:os";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
5
|
+
import type { RunnerTurnRequest } from "../types.js";
|
|
6
|
+
import { CursorSdkRunner } from "./sdk-runner.js";
|
|
7
|
+
|
|
8
|
+
const { createAgent, resumeAgent } = vi.hoisted(() => ({
|
|
9
|
+
createAgent: vi.fn(),
|
|
10
|
+
resumeAgent: vi.fn(),
|
|
11
|
+
}));
|
|
12
|
+
|
|
13
|
+
vi.mock("@cursor/sdk", () => ({
|
|
14
|
+
Agent: {
|
|
15
|
+
create: createAgent,
|
|
16
|
+
resume: resumeAgent,
|
|
17
|
+
},
|
|
18
|
+
JsonlLocalAgentStore: class JsonlLocalAgentStore {
|
|
19
|
+
constructor(readonly path: string) {}
|
|
20
|
+
},
|
|
21
|
+
}));
|
|
22
|
+
|
|
23
|
+
describe("CursorSdkRunner", () => {
|
|
24
|
+
beforeEach(() => {
|
|
25
|
+
createAgent.mockReset();
|
|
26
|
+
resumeAgent.mockReset();
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
afterEach(() => {
|
|
30
|
+
delete process.env.CURSOR_API_KEY;
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it("creates a local SDK agent when no SDK id was ever bound", async () => {
|
|
34
|
+
process.env.CURSOR_API_KEY = "test-key";
|
|
35
|
+
const agent = fakeAgent("ses_retry");
|
|
36
|
+
createAgent.mockResolvedValue(agent);
|
|
37
|
+
const runner = new CursorSdkRunner();
|
|
38
|
+
const stateRoot = await mkdtemp(join(tmpdir(), "agent-serve-sdk-runner-"));
|
|
39
|
+
const onSdkAgentId = vi.fn();
|
|
40
|
+
|
|
41
|
+
await runner.runTurn({
|
|
42
|
+
...baseRequest(stateRoot),
|
|
43
|
+
isFirstTurn: false,
|
|
44
|
+
onSdkAgentId,
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
expect(createAgent).toHaveBeenCalledExactlyOnceWith(
|
|
48
|
+
expect.objectContaining({ agentId: "ses_retry" })
|
|
49
|
+
);
|
|
50
|
+
expect(resumeAgent).not.toHaveBeenCalled();
|
|
51
|
+
expect(onSdkAgentId).toHaveBeenCalledExactlyOnceWith("ses_retry");
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it("falls back to a fresh conversation when resume finds no stored agent", async () => {
|
|
55
|
+
process.env.CURSOR_API_KEY = "test-key";
|
|
56
|
+
resumeAgent.mockRejectedValue(new Error("Agent ses_retry not found"));
|
|
57
|
+
createAgent.mockResolvedValue(fakeAgent("ses_retry"));
|
|
58
|
+
const lines: string[] = [];
|
|
59
|
+
const runner = new CursorSdkRunner({ logger: (line) => lines.push(line) });
|
|
60
|
+
const stateRoot = await mkdtemp(join(tmpdir(), "agent-serve-sdk-runner-"));
|
|
61
|
+
|
|
62
|
+
const outcome = await runner.runTurn({
|
|
63
|
+
...baseRequest(stateRoot),
|
|
64
|
+
isFirstTurn: false,
|
|
65
|
+
sdkAgentId: "ses_retry",
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
expect(outcome.status).toBe("finished");
|
|
69
|
+
expect(resumeAgent).toHaveBeenCalledOnce();
|
|
70
|
+
expect(createAgent).toHaveBeenCalledExactlyOnceWith(
|
|
71
|
+
expect.objectContaining({ agentId: "ses_retry" })
|
|
72
|
+
);
|
|
73
|
+
expect(lines.join("\n")).toContain("fresh");
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it("propagates resume failures that are not a store miss", async () => {
|
|
77
|
+
process.env.CURSOR_API_KEY = "test-key";
|
|
78
|
+
resumeAgent.mockRejectedValue(new Error("transport exploded"));
|
|
79
|
+
const runner = new CursorSdkRunner();
|
|
80
|
+
const stateRoot = await mkdtemp(join(tmpdir(), "agent-serve-sdk-runner-"));
|
|
81
|
+
|
|
82
|
+
await expect(
|
|
83
|
+
runner.runTurn({
|
|
84
|
+
...baseRequest(stateRoot),
|
|
85
|
+
isFirstTurn: false,
|
|
86
|
+
sdkAgentId: "ses_retry",
|
|
87
|
+
})
|
|
88
|
+
).rejects.toThrow("transport exploded");
|
|
89
|
+
expect(createAgent).not.toHaveBeenCalled();
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
it("surfaces the SDK RunResult error message on failed turns", async () => {
|
|
93
|
+
process.env.CURSOR_API_KEY = "test-key";
|
|
94
|
+
const agent = {
|
|
95
|
+
agentId: "ses_retry",
|
|
96
|
+
send: vi.fn(async () => ({
|
|
97
|
+
wait: async () => ({
|
|
98
|
+
status: "error" as const,
|
|
99
|
+
error: {
|
|
100
|
+
message:
|
|
101
|
+
"Authentication error If you are logged in, try logging out and back in.",
|
|
102
|
+
},
|
|
103
|
+
}),
|
|
104
|
+
})),
|
|
105
|
+
};
|
|
106
|
+
createAgent.mockResolvedValue(agent);
|
|
107
|
+
const runner = new CursorSdkRunner();
|
|
108
|
+
const stateRoot = await mkdtemp(join(tmpdir(), "agent-serve-sdk-runner-"));
|
|
109
|
+
|
|
110
|
+
const outcome = await runner.runTurn(baseRequest(stateRoot));
|
|
111
|
+
|
|
112
|
+
expect(outcome.status).toBe("error");
|
|
113
|
+
expect(outcome.errorMessage).toBe(
|
|
114
|
+
"Authentication error If you are logged in, try logging out and back in."
|
|
115
|
+
);
|
|
116
|
+
// First turns never retry in place: their token was exchanged moments
|
|
117
|
+
// ago, so the credential itself is bad and a fresh handle cannot help.
|
|
118
|
+
expect(agent.send).toHaveBeenCalledTimes(1);
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
it("evicts the cached agent after an error result so the next turn reopens", async () => {
|
|
122
|
+
process.env.CURSOR_API_KEY = "test-key";
|
|
123
|
+
const broken = fakeErrorAgent("ses_retry", "model exploded");
|
|
124
|
+
const healthy = fakeAgent("ses_retry");
|
|
125
|
+
resumeAgent.mockResolvedValueOnce(broken).mockResolvedValueOnce(healthy);
|
|
126
|
+
const runner = new CursorSdkRunner();
|
|
127
|
+
const stateRoot = await mkdtemp(join(tmpdir(), "agent-serve-sdk-runner-"));
|
|
128
|
+
const request = {
|
|
129
|
+
...baseRequest(stateRoot),
|
|
130
|
+
isFirstTurn: false,
|
|
131
|
+
sdkAgentId: "ses_retry",
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
const first = await runner.runTurn(request);
|
|
135
|
+
expect(first.status).toBe("error");
|
|
136
|
+
// Not an auth failure, so no in-place retry.
|
|
137
|
+
expect(resumeAgent).toHaveBeenCalledTimes(1);
|
|
138
|
+
|
|
139
|
+
const second = await runner.runTurn(request);
|
|
140
|
+
expect(second.status).toBe("finished");
|
|
141
|
+
expect(resumeAgent).toHaveBeenCalledTimes(2);
|
|
142
|
+
expect(broken.close).toHaveBeenCalled();
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
it("retries once on a fresh handle when an auth failure precedes any output", async () => {
|
|
146
|
+
process.env.CURSOR_API_KEY = "test-key";
|
|
147
|
+
const broken = fakeErrorAgent("ses_retry", AUTH_ERROR_MESSAGE);
|
|
148
|
+
const healthy = fakeAgent("ses_retry");
|
|
149
|
+
resumeAgent.mockResolvedValueOnce(broken).mockResolvedValueOnce(healthy);
|
|
150
|
+
const lines: string[] = [];
|
|
151
|
+
const runner = new CursorSdkRunner({ logger: (line) => lines.push(line) });
|
|
152
|
+
const stateRoot = await mkdtemp(join(tmpdir(), "agent-serve-sdk-runner-"));
|
|
153
|
+
|
|
154
|
+
const outcome = await runner.runTurn({
|
|
155
|
+
...baseRequest(stateRoot),
|
|
156
|
+
isFirstTurn: false,
|
|
157
|
+
sdkAgentId: "ses_retry",
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
expect(outcome.status).toBe("finished");
|
|
161
|
+
expect(resumeAgent).toHaveBeenCalledTimes(2);
|
|
162
|
+
expect(broken.close).toHaveBeenCalled();
|
|
163
|
+
expect(lines.join("\n")).toContain("retrying the turn");
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
it("does not retry an auth failure once the turn has streamed output", async () => {
|
|
167
|
+
process.env.CURSOR_API_KEY = "test-key";
|
|
168
|
+
const broken = {
|
|
169
|
+
agentId: "ses_retry",
|
|
170
|
+
close: vi.fn(),
|
|
171
|
+
send: vi.fn(
|
|
172
|
+
async (
|
|
173
|
+
_prompt: string,
|
|
174
|
+
options: { onDelta: (event: { update: unknown }) => Promise<void> }
|
|
175
|
+
) => {
|
|
176
|
+
await options.onDelta({ update: { kind: "assistant" } });
|
|
177
|
+
return {
|
|
178
|
+
wait: async () => ({
|
|
179
|
+
status: "error" as const,
|
|
180
|
+
error: { message: AUTH_ERROR_MESSAGE },
|
|
181
|
+
}),
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
),
|
|
185
|
+
};
|
|
186
|
+
resumeAgent.mockResolvedValue(broken);
|
|
187
|
+
const runner = new CursorSdkRunner();
|
|
188
|
+
const stateRoot = await mkdtemp(join(tmpdir(), "agent-serve-sdk-runner-"));
|
|
189
|
+
|
|
190
|
+
const outcome = await runner.runTurn({
|
|
191
|
+
...baseRequest(stateRoot),
|
|
192
|
+
isFirstTurn: false,
|
|
193
|
+
sdkAgentId: "ses_retry",
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
expect(outcome.status).toBe("error");
|
|
197
|
+
expect(outcome.errorMessage).toBe(AUTH_ERROR_MESSAGE);
|
|
198
|
+
expect(resumeAgent).toHaveBeenCalledTimes(1);
|
|
199
|
+
expect(broken.send).toHaveBeenCalledTimes(1);
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
it("recycles a handle older than the age budget onto a fresh open", async () => {
|
|
203
|
+
process.env.CURSOR_API_KEY = "test-key";
|
|
204
|
+
vi.useFakeTimers({
|
|
205
|
+
now: new Date("2026-07-28T00:00:00Z"),
|
|
206
|
+
toFake: ["Date"],
|
|
207
|
+
});
|
|
208
|
+
try {
|
|
209
|
+
const early = fakeAgent("ses_retry");
|
|
210
|
+
const late = fakeAgent("ses_retry");
|
|
211
|
+
resumeAgent.mockResolvedValueOnce(early).mockResolvedValueOnce(late);
|
|
212
|
+
const runner = new CursorSdkRunner();
|
|
213
|
+
const stateRoot = await mkdtemp(
|
|
214
|
+
join(tmpdir(), "agent-serve-sdk-runner-")
|
|
215
|
+
);
|
|
216
|
+
const request = {
|
|
217
|
+
...baseRequest(stateRoot),
|
|
218
|
+
isFirstTurn: false,
|
|
219
|
+
sdkAgentId: "ses_retry",
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
await runner.runTurn(request);
|
|
223
|
+
// Within the budget the handle is reused.
|
|
224
|
+
vi.setSystemTime(new Date("2026-07-28T00:30:00Z"));
|
|
225
|
+
await runner.runTurn(request);
|
|
226
|
+
expect(resumeAgent).toHaveBeenCalledTimes(1);
|
|
227
|
+
expect(early.send).toHaveBeenCalledTimes(2);
|
|
228
|
+
|
|
229
|
+
// Past the budget (45 min) the handle is retired before the send, so
|
|
230
|
+
// the exchanged access token (60 min lifetime) can never expire
|
|
231
|
+
// mid-session.
|
|
232
|
+
vi.setSystemTime(new Date("2026-07-28T00:46:00Z"));
|
|
233
|
+
await runner.runTurn(request);
|
|
234
|
+
expect(resumeAgent).toHaveBeenCalledTimes(2);
|
|
235
|
+
expect(late.send).toHaveBeenCalledTimes(1);
|
|
236
|
+
expect(early.close).toHaveBeenCalled();
|
|
237
|
+
} finally {
|
|
238
|
+
vi.useRealTimers();
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
const AUTH_ERROR_MESSAGE =
|
|
244
|
+
"Authentication error If you are logged in, try logging out and back in.";
|
|
245
|
+
|
|
246
|
+
function fakeAgent(agentId: string): {
|
|
247
|
+
agentId: string;
|
|
248
|
+
send: ReturnType<typeof vi.fn>;
|
|
249
|
+
close: ReturnType<typeof vi.fn>;
|
|
250
|
+
} {
|
|
251
|
+
return {
|
|
252
|
+
agentId,
|
|
253
|
+
send: vi.fn(async () => ({
|
|
254
|
+
wait: async () => ({ status: "finished", result: "ok" }),
|
|
255
|
+
})),
|
|
256
|
+
close: vi.fn(),
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
function fakeErrorAgent(
|
|
261
|
+
agentId: string,
|
|
262
|
+
message: string
|
|
263
|
+
): {
|
|
264
|
+
agentId: string;
|
|
265
|
+
send: ReturnType<typeof vi.fn>;
|
|
266
|
+
close: ReturnType<typeof vi.fn>;
|
|
267
|
+
} {
|
|
268
|
+
return {
|
|
269
|
+
agentId,
|
|
270
|
+
send: vi.fn(async () => ({
|
|
271
|
+
wait: async () => ({ status: "error", error: { message } }),
|
|
272
|
+
})),
|
|
273
|
+
close: vi.fn(),
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
function baseRequest(stateRoot: string): RunnerTurnRequest {
|
|
278
|
+
return {
|
|
279
|
+
sessionId: "ses_retry",
|
|
280
|
+
workspaceDir: stateRoot,
|
|
281
|
+
runnerStateDir: join(stateRoot, "runner"),
|
|
282
|
+
prompt: "hello",
|
|
283
|
+
isFirstTurn: true,
|
|
284
|
+
runtime: "local",
|
|
285
|
+
customTools: {},
|
|
286
|
+
mcpServers: {},
|
|
287
|
+
subagents: [],
|
|
288
|
+
onUpdate: () => {},
|
|
289
|
+
};
|
|
290
|
+
}
|