@cursor/july 0.1.10 → 0.1.12

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 (197) hide show
  1. package/AGENTS.md +1 -0
  2. package/dist/bin/agent-serve.js +17 -3
  3. package/dist/channels/github/github-channel.d.ts.map +1 -1
  4. package/dist/channels/github/github-channel.js +2 -1
  5. package/dist/channels/github/types.d.ts +4 -0
  6. package/dist/channels/github/types.d.ts.map +1 -1
  7. package/dist/channels/slack/cursor-account.d.ts.map +1 -1
  8. package/dist/channels/slack/cursor-account.js +1 -1
  9. package/dist/channels/slack/dispatch.d.ts +13 -0
  10. package/dist/channels/slack/dispatch.d.ts.map +1 -1
  11. package/dist/channels/slack/dispatch.js +36 -11
  12. package/dist/channels/slack/eval-directive.d.ts +63 -0
  13. package/dist/channels/slack/eval-directive.d.ts.map +1 -0
  14. package/dist/channels/slack/eval-directive.js +283 -0
  15. package/dist/channels/slack/index.d.ts +1 -0
  16. package/dist/channels/slack/index.d.ts.map +1 -1
  17. package/dist/channels/slack/index.js +1 -0
  18. package/dist/channels/slack/slack-channel.d.ts.map +1 -1
  19. package/dist/channels/slack/slack-channel.js +4 -2
  20. package/dist/channels/slack/types.d.ts +7 -0
  21. package/dist/channels/slack/types.d.ts.map +1 -1
  22. package/dist/connections.d.ts +10 -5
  23. package/dist/connections.d.ts.map +1 -1
  24. package/dist/connections.js +10 -5
  25. package/dist/docs/404.html +2 -2
  26. package/dist/docs/ab.html +4 -4
  27. package/dist/docs/assets/{app.CY2buaEE.js → app.Dh_JkJjI.js} +1 -1
  28. package/dist/docs/assets/chunks/@localSearchIndexroot.Er_R50vY.js +1 -0
  29. package/dist/docs/assets/chunks/{VPLocalSearchBox.Ix954SFJ.js → VPLocalSearchBox.CptQNLkR.js} +1 -1
  30. package/dist/docs/assets/chunks/{theme.PDwuJbyi.js → theme.DWflH-LQ.js} +2 -2
  31. package/dist/docs/assets/{deployment.md.DC5-ImcM.js → deployment.md.TecHo0_2.js} +3 -3
  32. package/dist/docs/assets/{deployment.md.DC5-ImcM.lean.js → deployment.md.TecHo0_2.lean.js} +1 -1
  33. package/dist/docs/assets/guides_mcp-oauth.md.DqmEOQY1.js +29 -0
  34. package/dist/docs/assets/guides_mcp-oauth.md.DqmEOQY1.lean.js +1 -0
  35. package/dist/docs/assets/{index.md.COiu-1jL.js → index.md.t0TM2Qzz.js} +3 -3
  36. package/dist/docs/assets/{index.md.COiu-1jL.lean.js → index.md.t0TM2Qzz.lean.js} +1 -1
  37. package/dist/docs/assets/{reference_cli.md.CjfiV2Q-.js → reference_cli.md.B74NrVzb.js} +3 -3
  38. package/dist/docs/assets/{reference_cli.md.CjfiV2Q-.lean.js → reference_cli.md.B74NrVzb.lean.js} +1 -1
  39. package/dist/docs/assets/{reference_connections.md.FbWupyzW.js → reference_connections.md.CsSr3rDz.js} +8 -3
  40. package/dist/docs/assets/{reference_connections.md.FbWupyzW.lean.js → reference_connections.md.CsSr3rDz.lean.js} +1 -1
  41. package/dist/docs/assets/reference_prompt.md.BaiweQxE.js +1 -0
  42. package/dist/docs/assets/reference_prompt.md.BaiweQxE.lean.js +1 -0
  43. package/dist/docs/assets/{reference_tools.md.CqgJroI0.js → reference_tools.md.BRSDnTbN.js} +16 -3
  44. package/dist/docs/assets/{reference_tools.md.CqgJroI0.lean.js → reference_tools.md.BRSDnTbN.lean.js} +1 -1
  45. package/dist/docs/assets/{troubleshooting.md.DkovjS7h.js → troubleshooting.md.CmQkmnzC.js} +1 -1
  46. package/dist/docs/assets/{troubleshooting.md.DkovjS7h.lean.js → troubleshooting.md.CmQkmnzC.lean.js} +1 -1
  47. package/dist/docs/building-with-agents.html +4 -4
  48. package/dist/docs/concepts.html +4 -4
  49. package/dist/docs/deployment.html +7 -7
  50. package/dist/docs/evals.html +4 -4
  51. package/dist/docs/example-agents/approval-buddy.html +4 -4
  52. package/dist/docs/example-agents/benny.html +4 -4
  53. package/dist/docs/example-agents/bugbot.html +4 -4
  54. package/dist/docs/example-agents/codebase-wiki.html +4 -4
  55. package/dist/docs/example-agents/codeowners-review.html +4 -4
  56. package/dist/docs/example-agents/concierge.html +4 -4
  57. package/dist/docs/example-agents/fsd.html +4 -4
  58. package/dist/docs/example-agents/index.html +4 -4
  59. package/dist/docs/example-agents/knowledge-base.html +4 -4
  60. package/dist/docs/example-agents/oncall.html +4 -4
  61. package/dist/docs/example-agents/security-reviewer.html +4 -4
  62. package/dist/docs/example-agents/slack-agent.html +4 -4
  63. package/dist/docs/example-agents/weather-agent.html +4 -4
  64. package/dist/docs/guides/agent-to-agent.html +4 -4
  65. package/dist/docs/guides/cloud-runtime.html +4 -4
  66. package/dist/docs/guides/github.html +4 -4
  67. package/dist/docs/guides/human-in-the-loop.html +4 -4
  68. package/dist/docs/guides/mcp-oauth.html +53 -0
  69. package/dist/docs/guides/slack.html +4 -4
  70. package/dist/docs/guides/webhooks.html +4 -4
  71. package/dist/docs/hashmap.json +1 -1
  72. package/dist/docs/hillclimbing.html +4 -4
  73. package/dist/docs/index.html +6 -6
  74. package/dist/docs/quickstart.html +4 -4
  75. package/dist/docs/reference/agent-config.html +4 -4
  76. package/dist/docs/reference/channels.html +4 -4
  77. package/dist/docs/reference/cli.html +6 -6
  78. package/dist/docs/reference/connections.html +12 -7
  79. package/dist/docs/reference/hooks.html +4 -4
  80. package/dist/docs/reference/http-api.html +4 -4
  81. package/dist/docs/reference/instructions.html +4 -4
  82. package/dist/docs/reference/playground.html +4 -4
  83. package/dist/docs/reference/project-layout.html +4 -4
  84. package/dist/docs/reference/prompt.html +33 -0
  85. package/dist/docs/reference/schedules.html +4 -4
  86. package/dist/docs/reference/sessions.html +4 -4
  87. package/dist/docs/reference/skills.html +5 -5
  88. package/dist/docs/reference/subagents.html +4 -4
  89. package/dist/docs/reference/tools.html +20 -7
  90. package/dist/docs/scaffolding-agents.html +4 -4
  91. package/dist/docs/storage.html +4 -4
  92. package/dist/docs/troubleshooting.html +5 -5
  93. package/dist/evals.d.ts +39 -0
  94. package/dist/evals.d.ts.map +1 -1
  95. package/dist/index.d.ts +3 -1
  96. package/dist/index.d.ts.map +1 -1
  97. package/dist/index.js +2 -1
  98. package/dist/internal/cli-mcp-oauth.d.ts +16 -0
  99. package/dist/internal/cli-mcp-oauth.d.ts.map +1 -0
  100. package/dist/internal/cli-mcp-oauth.js +194 -0
  101. package/dist/internal/cli-mcp.d.ts +4 -1
  102. package/dist/internal/cli-mcp.d.ts.map +1 -1
  103. package/dist/internal/cli-mcp.js +19 -1
  104. package/dist/internal/cursor/account-mcp.d.ts +17 -4
  105. package/dist/internal/cursor/account-mcp.d.ts.map +1 -1
  106. package/dist/internal/cursor/account-mcp.js +105 -17
  107. package/dist/internal/cursor-event-relay.d.ts +2 -0
  108. package/dist/internal/cursor-event-relay.d.ts.map +1 -1
  109. package/dist/internal/cursor-event-relay.js +3 -0
  110. package/dist/internal/discovery.d.ts.map +1 -1
  111. package/dist/internal/discovery.js +64 -10
  112. package/dist/internal/distribution.d.ts.map +1 -1
  113. package/dist/internal/distribution.js +1 -0
  114. package/dist/internal/json-dir-store.js +100 -0
  115. package/dist/internal/logs-client.js +1 -1
  116. package/dist/internal/mcp-host.d.ts.map +1 -1
  117. package/dist/internal/mcp-host.js +49 -26
  118. package/dist/internal/mcp-oauth.d.ts +88 -0
  119. package/dist/internal/mcp-oauth.d.ts.map +1 -0
  120. package/dist/internal/mcp-oauth.js +385 -0
  121. package/dist/internal/resolved-connections.d.ts.map +1 -1
  122. package/dist/internal/resolved-connections.js +4 -1
  123. package/dist/internal/sdk-runner.d.ts +9 -0
  124. package/dist/internal/sdk-runner.d.ts.map +1 -1
  125. package/dist/internal/sdk-runner.js +28 -2
  126. package/dist/internal/server.d.ts.map +1 -1
  127. package/dist/internal/server.js +13 -5
  128. package/dist/internal/session-engine.d.ts +7 -9
  129. package/dist/internal/session-engine.d.ts.map +1 -1
  130. package/dist/internal/session-engine.js +96 -64
  131. package/dist/internal/sessions-client.d.ts.map +1 -1
  132. package/dist/internal/sessions-client.js +2 -1
  133. package/dist/internal/stream-progress.d.ts.map +1 -1
  134. package/dist/internal/stream-progress.js +8 -4
  135. package/dist/internal/turn-governor.d.ts +54 -0
  136. package/dist/internal/turn-governor.d.ts.map +1 -0
  137. package/dist/internal/turn-governor.js +111 -0
  138. package/dist/playground/assets/index-1dzluIcW.js +86 -0
  139. package/dist/playground/assets/index-kZjeJs1v.css +1 -0
  140. package/dist/playground/index.html +2 -2
  141. package/dist/prompt.d.ts +39 -0
  142. package/dist/prompt.d.ts.map +1 -0
  143. package/dist/prompt.js +70 -0
  144. package/dist/types.d.ts +78 -5
  145. package/dist/types.d.ts.map +1 -1
  146. package/dist/types.js +6 -0
  147. package/docs/README.md +4 -0
  148. package/docs/deployment.md +6 -1
  149. package/docs/guides/mcp-oauth.md +157 -0
  150. package/docs/reference/cli.md +28 -0
  151. package/docs/reference/connections.md +28 -0
  152. package/docs/reference/prompt.md +47 -0
  153. package/docs/reference/tools.md +21 -0
  154. package/docs/troubleshooting.md +11 -0
  155. package/package.json +9 -2
  156. package/skills/create-agent/SKILL.md +7 -3
  157. package/skills/framework-map/SKILL.md +1 -0
  158. package/skills/mcp-auth/SKILL.md +138 -0
  159. package/src/bin/agent-serve.ts +20 -3
  160. package/src/channels/github/github-channel.ts +2 -0
  161. package/src/channels/github/types.ts +4 -0
  162. package/src/channels/slack/cursor-account.ts +2 -0
  163. package/src/channels/slack/dispatch.ts +49 -0
  164. package/src/channels/slack/eval-directive.ts +348 -0
  165. package/src/channels/slack/index.ts +1 -0
  166. package/src/channels/slack/slack-channel.ts +3 -0
  167. package/src/channels/slack/types.ts +7 -0
  168. package/src/connections.ts +10 -5
  169. package/src/evals.ts +43 -0
  170. package/src/index.ts +3 -0
  171. package/src/internal/cli-mcp-oauth.ts +254 -0
  172. package/src/internal/cli-mcp.ts +25 -2
  173. package/src/internal/cursor/account-mcp.ts +153 -41
  174. package/src/internal/cursor-event-relay.ts +5 -0
  175. package/src/internal/discovery.ts +70 -8
  176. package/src/internal/distribution.ts +1 -0
  177. package/src/internal/logs-client.ts +1 -1
  178. package/src/internal/mcp-host.ts +33 -9
  179. package/src/internal/mcp-oauth.ts +496 -0
  180. package/src/internal/resolved-connections.ts +6 -1
  181. package/src/internal/sdk-runner.ts +37 -1
  182. package/src/internal/server.ts +13 -5
  183. package/src/internal/session-engine.ts +115 -74
  184. package/src/internal/sessions-client.ts +2 -1
  185. package/src/internal/stream-progress.ts +8 -0
  186. package/src/internal/turn-governor.ts +145 -0
  187. package/src/prompt.ts +83 -0
  188. package/src/types.ts +76 -6
  189. package/dist/channels/slack/post-update-delivery.d.ts +0 -85
  190. package/dist/channels/slack/post-update-delivery.d.ts.map +0 -1
  191. package/dist/docs/assets/chunks/@localSearchIndexroot.OfDZ5CXg.js +0 -1
  192. package/dist/internal/persistence-coordinator.d.ts +0 -127
  193. package/dist/internal/persistence-coordinator.d.ts.map +0 -1
  194. package/dist/persistence.d.ts +0 -184
  195. package/dist/persistence.d.ts.map +0 -1
  196. package/dist/playground/assets/index-C0-QEG4O.js +0 -86
  197. package/dist/playground/assets/index-z3JY9O2x.css +0 -1
@@ -0,0 +1,194 @@
1
+ /**
2
+ * `agentkit mcp oauth <connection> [--store]` for `defineConnection({ url, oauth: true })`.
3
+ */
4
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
5
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
6
+ return new (P || (P = Promise))(function (resolve, reject) {
7
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
8
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
9
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
10
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
11
+ });
12
+ };
13
+ import { UnauthorizedError } from "@modelcontextprotocol/sdk/client/auth.js";
14
+ import { Client } from "@modelcontextprotocol/sdk/client/index.js";
15
+ import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
16
+ import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
17
+ import { resolveDeployAuth } from "./cli-deploy.js";
18
+ import { loadAgentProject } from "./discovery.js";
19
+ import { CLI_COMMAND_NAME as CLI, LOG_PREFIX } from "./distribution.js";
20
+ import { createHostMcpOAuthProvider, MCP_OAUTH_CALLBACK_URL, mcpOauthSecretNames, openBrowser, waitForMcpOAuthCallback, } from "./mcp-oauth.js";
21
+ import { resolveProdSlug } from "./resolve-prod-target.js";
22
+ function describe(error) {
23
+ if (!(error instanceof Error)) {
24
+ return String(error);
25
+ }
26
+ const cause = error.cause;
27
+ if (!(cause instanceof Error)) {
28
+ return error.message;
29
+ }
30
+ const code = "code" in cause && typeof cause.code === "string" ? cause.code : undefined;
31
+ const detail = code === undefined ? cause.message : `${cause.message} (${code})`;
32
+ return `${error.message}: ${detail}`;
33
+ }
34
+ export function cmdMcpOauth(options) {
35
+ return __awaiter(this, void 0, void 0, function* () {
36
+ var _a;
37
+ var _b, _c;
38
+ const err = (_b = options.err) !== null && _b !== void 0 ? _b : ((text) => process.stderr.write(text));
39
+ const out = (_c = options.out) !== null && _c !== void 0 ? _c : ((text) => process.stdout.write(text));
40
+ const project = yield loadAgentProject(options.dir);
41
+ const connection = project.agent.connections.find((entry) => entry.name === options.connection);
42
+ if (connection === undefined) {
43
+ const known = project.agent.connections.map((entry) => entry.name).join(", ") ||
44
+ "(none)";
45
+ err(`${LOG_PREFIX} Unknown MCP connection "${options.connection}". Authored: ${known}.\n`);
46
+ return 1;
47
+ }
48
+ const transport = connection.transport;
49
+ if (!("url" in transport) || transport.oauth !== true) {
50
+ err(`${LOG_PREFIX} "${options.connection}" must be defineConnection({ url, oauth: true }).\n`);
51
+ return 1;
52
+ }
53
+ out(`${LOG_PREFIX} Authorizing "${options.connection}" (${transport.url})…\n`);
54
+ let authorizationUrl;
55
+ const provider = yield createHostMcpOAuthProvider({
56
+ identifier: options.connection,
57
+ resourceUrl: transport.url,
58
+ onRedirect: (url) => {
59
+ authorizationUrl = url;
60
+ },
61
+ });
62
+ const client = new Client({ name: "agentkit-mcp-oauth", version: "0.1.0" });
63
+ const url = new URL(transport.url);
64
+ const requestInit = transport.headers === undefined
65
+ ? undefined
66
+ : { headers: transport.headers };
67
+ const makeTransport = () => {
68
+ if (transport.type === "sse") {
69
+ return new SSEClientTransport(url, {
70
+ authProvider: provider,
71
+ requestInit,
72
+ });
73
+ }
74
+ return new StreamableHTTPClientTransport(url, {
75
+ authProvider: provider,
76
+ requestInit,
77
+ });
78
+ };
79
+ let mcpTransport = makeTransport();
80
+ let authorized = false;
81
+ try {
82
+ yield client.connect(mcpTransport);
83
+ out(`${LOG_PREFIX} "${options.connection}" already authorized.\n`);
84
+ yield client.close().catch(() => undefined);
85
+ authorized = true;
86
+ }
87
+ catch (error) {
88
+ if (!(error instanceof UnauthorizedError)) {
89
+ err(`${LOG_PREFIX} Failed to connect to "${options.connection}": ${describe(error)}\n`);
90
+ return 1;
91
+ }
92
+ }
93
+ if (!authorized) {
94
+ const redirect = authorizationUrl !== null && authorizationUrl !== void 0 ? authorizationUrl : provider.lastRedirectUrl;
95
+ if (redirect === undefined) {
96
+ err(`${LOG_PREFIX} Auth required but no authorization URL was provided.\n`);
97
+ return 1;
98
+ }
99
+ out(`${LOG_PREFIX} Open if needed:\n ${redirect.toString()}\n`);
100
+ out(`${LOG_PREFIX} Waiting on ${MCP_OAUTH_CALLBACK_URL}…\n`);
101
+ openBrowser(redirect.toString());
102
+ let callback;
103
+ try {
104
+ callback = yield waitForMcpOAuthCallback();
105
+ }
106
+ catch (error) {
107
+ err(`${LOG_PREFIX} OAuth callback failed: ${describe(error)}\n`);
108
+ return 1;
109
+ }
110
+ try {
111
+ yield mcpTransport.finishAuth(callback.code);
112
+ }
113
+ catch (error) {
114
+ err(`${LOG_PREFIX} Token exchange failed: ${describe(error)}\n`);
115
+ return 1;
116
+ }
117
+ mcpTransport = makeTransport();
118
+ try {
119
+ yield client.connect(mcpTransport);
120
+ const tools = yield client.listTools();
121
+ out(`${LOG_PREFIX} Authorized "${options.connection}" (${tools.tools.length} tools). Local tokens in the agent-serve config dir.\n`);
122
+ yield client.close().catch(() => undefined);
123
+ }
124
+ catch (error) {
125
+ err(`${LOG_PREFIX} Reconnect failed: ${describe(error)}. Re-run \`${CLI} mcp oauth ${options.connection}\`.\n`);
126
+ return 1;
127
+ }
128
+ }
129
+ if (options.store !== true) {
130
+ return 0;
131
+ }
132
+ return storeOauthSecrets({
133
+ connection: options.connection,
134
+ dir: options.dir,
135
+ slug: options.slug,
136
+ team: options.team,
137
+ apiKey: options.apiKey,
138
+ tokens: provider.tokens(),
139
+ clientId: (_a = provider.clientInformation()) === null || _a === void 0 ? void 0 : _a.client_id,
140
+ err,
141
+ out,
142
+ });
143
+ });
144
+ }
145
+ function storeOauthSecrets(args) {
146
+ return __awaiter(this, void 0, void 0, function* () {
147
+ const tokens = args.tokens;
148
+ if (tokens === undefined || tokens.access_token.trim() === "") {
149
+ args.err(`${LOG_PREFIX} No access token to store for "${args.connection}".\n`);
150
+ return 1;
151
+ }
152
+ let slug;
153
+ try {
154
+ slug = resolveProdSlug({ dir: args.dir, slug: args.slug });
155
+ }
156
+ catch (error) {
157
+ args.err(`${LOG_PREFIX} ${describe(error)}\n`);
158
+ return 1;
159
+ }
160
+ const auth = yield resolveDeployAuth({
161
+ team: args.team,
162
+ apiKey: args.apiKey,
163
+ err: args.err,
164
+ });
165
+ if (typeof auth === "number") {
166
+ return auth;
167
+ }
168
+ const names = mcpOauthSecretNames(args.connection);
169
+ const secrets = [
170
+ { name: names.accessToken, value: tokens.access_token },
171
+ ];
172
+ if (tokens.refresh_token !== undefined &&
173
+ tokens.refresh_token.trim() !== "") {
174
+ secrets.push({ name: names.refreshToken, value: tokens.refresh_token });
175
+ }
176
+ if (args.clientId !== undefined && args.clientId.trim() !== "") {
177
+ secrets.push({ name: names.clientId, value: args.clientId });
178
+ }
179
+ try {
180
+ const secretNames = yield auth.client.setSecrets({
181
+ teamId: auth.teamId,
182
+ slug,
183
+ secrets,
184
+ });
185
+ args.out(`${LOG_PREFIX} Stored on ${slug}: ${secrets.map((s) => s.name).join(", ")}.\n` +
186
+ `${LOG_PREFIX} Secrets now: ${secretNames.join(", ")}. Next deploy picks them up.\n`);
187
+ return 0;
188
+ }
189
+ catch (error) {
190
+ args.err(`${LOG_PREFIX} Failed to store secrets on ${slug}: ${describe(error)}\n`);
191
+ return 1;
192
+ }
193
+ });
194
+ }
@@ -54,7 +54,10 @@ export interface McpCliOptions {
54
54
  now?: () => number;
55
55
  sleep?: (ms: number) => Promise<void>;
56
56
  }
57
- export declare function cmdMcp(subcommand: string | undefined, options: McpCliOptions): Promise<number>;
57
+ export declare function cmdMcp(subcommand: string | undefined, options: McpCliOptions & {
58
+ oauthConnection?: string;
59
+ store?: boolean;
60
+ }): Promise<number>;
58
61
  export declare function cmdMcpServe(options: McpCliOptions): Promise<number>;
59
62
  export declare function cmdMcpInstall(options: McpCliOptions): Promise<number>;
60
63
  /** `~/.cursor/mcp.json` — the user-level Cursor MCP config. */
@@ -1 +1 @@
1
- {"version":3,"file":"cli-mcp.d.ts","sourceRoot":"","sources":["../../src/internal/cli-mcp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAMH,OAAO,EAGL,iBAAiB,EAClB,MAAM,0BAA0B,CAAC;AA0BlC,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,gFAAgF;IAChF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sEAAsE;IACtE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;I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OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAqG3E;AAED,+DAA+D;AAC/D,wBAAgB,iBAAiB,CAC/B,IAAI,GAAE,MAAsC,GAC3C,MAAM,CAGR;AAqED,iFAAiF;AACjF,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAQnD"}
@@ -68,8 +68,26 @@ export function cmdMcp(subcommand, options) {
68
68
  if (subcommand === "install") {
69
69
  return cmdMcpInstall(options);
70
70
  }
71
+ if (subcommand === "oauth") {
72
+ const connection = options.oauthConnection;
73
+ if (connection === undefined || connection.trim() === "") {
74
+ err(`Usage: ${CLI} mcp oauth <connection> [--dir .] [--store] [--slug <slug>] [--team <id>]\n` +
75
+ `Authorize defineConnection({ url, oauth: true }) (host PKCE).\n` +
76
+ `--store upserts MCP_OAUTH_<NAME>_* secrets on the hosted deployment.\n`);
77
+ return 1;
78
+ }
79
+ const { cmdMcpOauth } = yield import("./cli-mcp-oauth.js");
80
+ return cmdMcpOauth({
81
+ dir: options.dir,
82
+ connection,
83
+ store: options.store,
84
+ slug: options.slug,
85
+ team: options.team,
86
+ apiKey: options.apiKey,
87
+ });
88
+ }
71
89
  err(`Unknown mcp subcommand "${subcommand}".\n` +
72
- `Usage: ${CLI} mcp [install] --prod [--slug <slug>] | --url <baseUrl>\n`);
90
+ `Usage: ${CLI} mcp [install|oauth <connection>] --prod [--slug <slug>] | --url <baseUrl>\n`);
73
91
  return 1;
74
92
  });
75
93
  }
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import type { AgentProject, AuthPolicy } from "../../types.js";
17
17
  import type { EngineResolvedConnection } from "../session-engine.js";
18
- import type { CursorBackendClient } from "./backend-client.js";
18
+ import type { AccountMcpServer, CursorBackendClient } from "./backend-client.js";
19
19
  export interface CursorAccountConnectionRef {
20
20
  /** Connection (MCP server) name — the filename under `agent/mcp-connections/`. */
21
21
  name: string;
@@ -78,10 +78,15 @@ export declare class CursorAccountMcpBridge {
78
78
  handle(request: Request, ref: CursorAccountConnectionRef): Promise<Response>;
79
79
  /**
80
80
  * Startup DX: log the account's connector statuses for `refs` without
81
- * blocking serve startup. Surfaces "needsAuth" connectors (authorize in
82
- * Cursor) and filters that matched nothing (typo'd connector names).
81
+ * blocking serve startup. Surfaces "needsAuth" / "error" connectors with
82
+ * remediation hints (and a backend probe detail for `error`), and filters
83
+ * that matched nothing (typo'd connector names).
84
+ *
85
+ * Returns a promise that settles when every ref's log lines are written —
86
+ * callers may ignore it; tests can await it.
83
87
  */
84
- logPreflight(refs: CursorAccountConnectionRef[]): void;
88
+ logPreflight(refs: CursorAccountConnectionRef[]): Promise<void>;
89
+ private runPreflight;
85
90
  private buildServer;
86
91
  /** Resolve a tool by exposed name, refreshing once when it is unknown. */
87
92
  private findTool;
@@ -92,4 +97,12 @@ export declare class CursorAccountMcpBridge {
92
97
  */
93
98
  private getCatalog;
94
99
  }
100
+ /** One-line status for the preflight summary (`name (12 tools)` / `name (error: …)`). */
101
+ export declare function formatServerStatusSummary(server: AccountMcpServer, errorDetail?: string): string;
102
+ /**
103
+ * Best-effort detail for an `error`-status connector. ListSandMcpTools only
104
+ * returns the status enum today, so probe ExecuteSandMcpTool (ping) and surface
105
+ * the backend failure text (e.g. `HTTP MCP tool execution failed: fetch failed`).
106
+ */
107
+ export declare function diagnoseConnectorError(client: Pick<CursorBackendClient, "executeAccountMcpTool">, serverIdentifier: string): Promise<string | undefined>;
95
108
  //# sourceMappingURL=account-mcp.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"account-mcp.d.ts","sourceRoot":"","sources":["../../../src/internal/cursor/account-mcp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AASH,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAI/D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,KAAK,EAEV,mBAAmB,EACpB,MAAM,qBAAqB,C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
@@ -129,32 +129,60 @@ export class CursorAccountMcpBridge {
129
129
  }
130
130
  /**
131
131
  * Startup DX: log the account's connector statuses for `refs` without
132
- * blocking serve startup. Surfaces "needsAuth" connectors (authorize in
133
- * Cursor) and filters that matched nothing (typo'd connector names).
132
+ * blocking serve startup. Surfaces "needsAuth" / "error" connectors with
133
+ * remediation hints (and a backend probe detail for `error`), and filters
134
+ * that matched nothing (typo'd connector names).
135
+ *
136
+ * Returns a promise that settles when every ref's log lines are written —
137
+ * callers may ignore it; tests can await it.
134
138
  */
135
139
  logPreflight(refs) {
136
- for (const ref of refs) {
137
- void this.getCatalog(ref)
138
- .then((catalog) => {
140
+ return Promise.all(refs.map((ref) => this.runPreflight(ref))).then(() => undefined);
141
+ }
142
+ runPreflight(ref) {
143
+ return __awaiter(this, void 0, void 0, function* () {
144
+ try {
145
+ const catalog = yield this.getCatalog(ref);
146
+ if (catalog.servers.length === 0) {
147
+ this.logger(`[agentkit] Cursor account MCP connection "${ref.name}": no matching connectors on this account — connect servers in Cursor (dashboard → MCP) or fix the \`servers\` filter`);
148
+ return;
149
+ }
150
+ const errorDetails = new Map();
151
+ yield Promise.all(catalog.servers
152
+ .filter((server) => server.status === "error")
153
+ .map((server) => __awaiter(this, void 0, void 0, function* () {
154
+ const detail = yield diagnoseConnectorError(this.client, server.serverIdentifier);
155
+ if (detail !== undefined) {
156
+ errorDetails.set(server.serverIdentifier, detail);
157
+ }
158
+ })));
139
159
  const summary = catalog.servers
140
- .map((server) => `${server.serverIdentifier} (${server.status === "connected"
141
- ? `${server.tools.length} tools`
142
- : server.status})`)
160
+ .map((server) => formatServerStatusSummary(server, errorDetails.get(server.serverIdentifier)))
143
161
  .join(", ");
144
- this.logger(`[agentkit] Cursor account MCP connection "${ref.name}": ${catalog.servers.length === 0
145
- ? "no matching connectors on this account — connect servers in Cursor (dashboard → MCP) or fix the `servers` filter"
146
- : summary}`);
162
+ this.logger(`[agentkit] Cursor account MCP connection "${ref.name}": ${summary}`);
147
163
  const needsAuth = catalog.servers.filter((server) => server.status === "needsAuth");
148
164
  if (needsAuth.length > 0) {
149
165
  this.logger(`[agentkit] Cursor account MCP connection "${ref.name}": ${needsAuth
150
166
  .map((server) => server.serverIdentifier)
151
- .join(", ")} need re-authorization in Cursor before their tools appear`);
167
+ .join(", ")} need re-authorization in Cursor (dashboard → MCP / Settings → MCP) before their tools appear`);
152
168
  }
153
- })
154
- .catch((error) => {
169
+ const errored = catalog.servers.filter((server) => server.status === "error");
170
+ if (errored.length > 0) {
171
+ const details = errored
172
+ .map((server) => {
173
+ const detail = errorDetails.get(server.serverIdentifier);
174
+ return detail === undefined
175
+ ? server.serverIdentifier
176
+ : `${server.serverIdentifier} (${detail})`;
177
+ })
178
+ .join("; ");
179
+ this.logger(`[agentkit] Cursor account MCP connection "${ref.name}": ${details} — Cursor backend could not use this connector (not a missing agentkit login). Re-check the server in Cursor dashboard → MCP, confirm the URL is healthy, and retry after the backend can reach it`);
180
+ }
181
+ }
182
+ catch (error) {
155
183
  this.logger(`[agentkit] Cursor account MCP connection "${ref.name}" preflight failed: ${describeError(error)}`);
156
- });
157
- }
184
+ }
185
+ });
158
186
  }
159
187
  buildServer(ref) {
160
188
  const server = new Server({ name: `cursor-account:${ref.name}`, version: "0.1.0" }, {
@@ -176,11 +204,17 @@ export class CursorAccountMcpBridge {
176
204
  const tool = yield this.findTool(ref, request.params.name);
177
205
  if (tool === undefined) {
178
206
  const catalog = yield this.getCatalog(ref);
207
+ const unhealthy = catalog.servers.filter((server) => server.status !== "connected");
208
+ const statusHint = unhealthy.length === 0
209
+ ? ""
210
+ : ` Unhealthy connectors: ${unhealthy
211
+ .map((server) => `${server.serverIdentifier}=${server.status}`)
212
+ .join(", ")}.`;
179
213
  return {
180
214
  content: [
181
215
  {
182
216
  type: "text",
183
- text: `Unknown tool "${request.params.name}". Available: ${catalog.tools.map((t) => t.exposedName).join(", ") || "(none)"}.`,
217
+ text: `Unknown tool "${request.params.name}". Available: ${catalog.tools.map((t) => t.exposedName).join(", ") || "(none)"}.${statusHint}`,
184
218
  },
185
219
  ],
186
220
  isError: true,
@@ -340,3 +374,57 @@ function trimTrailingSlash(url) {
340
374
  function describeError(error) {
341
375
  return error instanceof Error ? error.message : String(error);
342
376
  }
377
+ /** One-line status for the preflight summary (`name (12 tools)` / `name (error: …)`). */
378
+ export function formatServerStatusSummary(server, errorDetail) {
379
+ switch (server.status) {
380
+ case "connected":
381
+ return `${server.serverIdentifier} (${server.tools.length} tools)`;
382
+ case "needsAuth":
383
+ return `${server.serverIdentifier} (needsAuth — re-authorize in Cursor)`;
384
+ case "loading":
385
+ return `${server.serverIdentifier} (loading)`;
386
+ case "error": {
387
+ const detail = errorDetail === undefined || errorDetail.trim() === ""
388
+ ? "backend could not reach connector"
389
+ : errorDetail.trim();
390
+ return `${server.serverIdentifier} (error: ${detail})`;
391
+ }
392
+ default:
393
+ return `${server.serverIdentifier} (${server.status})`;
394
+ }
395
+ }
396
+ /**
397
+ * Best-effort detail for an `error`-status connector. ListSandMcpTools only
398
+ * returns the status enum today, so probe ExecuteSandMcpTool (ping) and surface
399
+ * the backend failure text (e.g. `HTTP MCP tool execution failed: fetch failed`).
400
+ */
401
+ export function diagnoseConnectorError(client, serverIdentifier) {
402
+ return __awaiter(this, void 0, void 0, function* () {
403
+ try {
404
+ const result = yield client.executeAccountMcpTool({
405
+ serverIdentifier,
406
+ // Conventional health tool; even a tool-not-found path usually still
407
+ // surfaces the same transport failure when the connector is down.
408
+ toolName: `${serverIdentifier}-ping`,
409
+ args: {},
410
+ });
411
+ const text = result.content
412
+ .filter((part) => part.type === "text")
413
+ .map((part) => part.text.trim())
414
+ .filter((part) => part.length > 0)
415
+ .join(" ");
416
+ if (result.isError) {
417
+ return text.length > 0
418
+ ? text
419
+ : "backend reported an error with no detail";
420
+ }
421
+ // Listing said error but ping succeeded — surface that inconsistency.
422
+ return text.length > 0
423
+ ? `listing reported error but probe succeeded: ${text}`
424
+ : "listing reported error but probe succeeded";
425
+ }
426
+ catch (error) {
427
+ return describeError(error);
428
+ }
429
+ });
430
+ }
@@ -18,6 +18,8 @@ export type CursorScmPullRequestMeta = {
18
18
  title?: string;
19
19
  body?: string | null;
20
20
  draft?: boolean;
21
+ /** True when the PR was merged — required by closed+merged channel hooks. */
22
+ merged?: boolean;
21
23
  authorLogin?: string;
22
24
  headRef?: string;
23
25
  headSha?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"cursor-event-relay.d.ts","sourceRoot":"","sources":["../../src/internal/cursor-event-relay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAGL,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B,8EAA8E;AAC9E,MAAM,MAAM,wBAAwB,GAAG;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,mEAAmE;AACnE,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,qCAAqC;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gDAAgD;IAChD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mCAAmC;IACnC,KAAK,CAAC,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MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,wBAAwB,CAAC;CACxC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAuE1B;AAED;;;GAGG;AACH,qBAAa,gBAAgB;IAUf,OAAO,CAAC,QAAQ,CAAC,OAAO;IATpC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAkC;IACvD;;;;OAIG;IACH,OAAO,CAAC,eAAe,CAAqB;IAC5C,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAqB;IAExD,YAA6B,OAAO,EAAE,uBAAuB,EAwD5D;IAED;;;;;OAKG;IACH,OAAO,CAAC,cAAc;IAatB,KAAK,IAAI,IAAI,CAEZ;IAEK,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAE1B;CACF"}
@@ -79,6 +79,9 @@ export function scmMetadataToGitHubPayload(event) {
79
79
  head: { ref: headRef, sha: headSha },
80
80
  base: { ref: baseRef, sha: prMeta === null || prMeta === void 0 ? void 0 : prMeta.baseSha },
81
81
  };
82
+ if ((prMeta === null || prMeta === void 0 ? void 0 : prMeta.merged) !== undefined) {
83
+ pullRequest.merged = prMeta.merged;
84
+ }
82
85
  if ((prMeta === null || prMeta === void 0 ? void 0 : prMeta.authorLogin) !== undefined) {
83
86
  pullRequest.user = { login: prMeta.authorLogin };
84
87
  }
@@ -1 +1 @@
1
- {"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../src/internal/discovery.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAgBH,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,gBAAgB,EAKrB,KAAK,UAAU,EAmBhB,MAAM,aAAa,CAAC;AAoBrB,MAAM,WAAW,uBAAuB;IACtC,sDAAsD;IACtD,YAAY,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OA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cAAc,EAAE,GAAG,CAAC,MAAM,CAIrC,CAAC;AAEH,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,YAAY,CAAC,CA8DvB;AAED,qEAAqE;AACrE,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAElE;AAED,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,MAAM,CAOnE;AAmnBD;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAiB3E;AAmlBD,wBAAgB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,gBAAgB,CAoInE"}
@@ -30,8 +30,9 @@ import { basename, extname, isAbsolute, join, relative, resolve, } from "node:pa
30
30
  import { pathToFileURL } from "node:url";
31
31
  import { resolveABMaxPlaygroundSessions } from "../ab.js";
32
32
  import { httpChannel } from "../channels.js";
33
- import { DEFAULT_MODEL, toPublicCloudInfo, } from "../types.js";
33
+ import { DEFAULT_MODEL, MAX_RUNNING_TURNS_LIMIT, toPublicCloudInfo, } from "../types.js";
34
34
  import { registerAuthoredModuleLoaders } from "./authored-loaders.js";
35
+ import { normalizePositiveInt } from "./bounded-int.js";
35
36
  import { getDefinitionKind } from "./brand.js";
36
37
  import { isValidCron } from "./cron.js";
37
38
  import { parseFrontmatter } from "./frontmatter.js";
@@ -272,6 +273,7 @@ function loadAgent(ctx, agentDir, options) {
272
273
  cwd: localCwd,
273
274
  };
274
275
  const hosting = resolveHosting(ctx, agentDir, config === null || config === void 0 ? void 0 : config.hosting);
276
+ const concurrency = resolveConcurrency(ctx, agentDir, config === null || config === void 0 ? void 0 : config.concurrency);
275
277
  if (runtime === "cloud") {
276
278
  warnCloudRuntimeLimitations(ctx, agentDir, {
277
279
  serverTools: tools.filter((tool) => tool.execution === "server").length,
@@ -291,6 +293,7 @@ function loadAgent(ctx, agentDir, options) {
291
293
  cloud,
292
294
  local,
293
295
  hosting,
296
+ concurrency,
294
297
  tools,
295
298
  skills,
296
299
  connections,
@@ -350,6 +353,33 @@ function resolveHosting(ctx, agentDir, hosting) {
350
353
  ? {}
351
354
  : { secretNames: [...hosting.secretNames] }));
352
355
  }
356
+ /**
357
+ * Validate the authored `concurrency` block. Invalid values are **error**
358
+ * diagnostics (serve refuses to start): silently dropping a turn ceiling
359
+ * would fail open to unlimited parallelism, the opposite of what the
360
+ * author asked for.
361
+ */
362
+ function resolveConcurrency(ctx, agentDir, concurrency) {
363
+ if (concurrency === undefined || concurrency.maxRunningTurns === undefined) {
364
+ return undefined;
365
+ }
366
+ try {
367
+ return {
368
+ maxRunningTurns: normalizePositiveInt(concurrency.maxRunningTurns, {
369
+ label: "concurrency.maxRunningTurns",
370
+ max: MAX_RUNNING_TURNS_LIMIT,
371
+ }),
372
+ };
373
+ }
374
+ catch (error) {
375
+ ctx.diagnostics.push({
376
+ severity: "error",
377
+ path: displayPath(ctx, join(agentDir, "agent.ts")),
378
+ message: error instanceof Error ? error.message : String(error),
379
+ });
380
+ return undefined;
381
+ }
382
+ }
353
383
  function loadAgentConfig(ctx, agentDir, isRoot) {
354
384
  return __awaiter(this, void 0, void 0, function* () {
355
385
  const configPath = yield findModuleFile(agentDir, "agent");
@@ -666,10 +696,18 @@ function connectionTransportLabel(transport) {
666
696
  return `agent:${transport.agent}`;
667
697
  }
668
698
  if ("url" in transport) {
669
- return transport.url;
699
+ return transport.oauth === true
700
+ ? `${transport.url} (oauth)`
701
+ : transport.url;
670
702
  }
671
703
  return transport.command;
672
704
  }
705
+ function hasAuthorizationHeader(headers) {
706
+ if (headers === undefined) {
707
+ return false;
708
+ }
709
+ return Object.keys(headers).some((key) => key.toLowerCase() === "authorization");
710
+ }
673
711
  function connectionTransport(connection) {
674
712
  if ("cursorAccount" in connection && connection.cursorAccount === true) {
675
713
  return Object.assign({ cursorAccount: true }, (connection.servers === undefined
@@ -680,9 +718,12 @@ function connectionTransport(connection) {
680
718
  return { agent: connection.agent };
681
719
  }
682
720
  if ("url" in connection && !isBlank(connection.url)) {
683
- return Object.assign(Object.assign(Object.assign({}, (connection.type === undefined ? {} : { type: connection.type })), { url: connection.url }), (connection.headers === undefined
684
- ? {}
685
- : { headers: connection.headers }));
721
+ return {
722
+ type: connection.type,
723
+ url: connection.url,
724
+ headers: connection.headers,
725
+ oauth: connection.oauth === true ? true : undefined,
726
+ };
686
727
  }
687
728
  if ("command" in connection && !isBlank(connection.command)) {
688
729
  return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (connection.type === undefined ? {} : { type: connection.type })), { command: connection.command }), (connection.args === undefined ? {} : { args: connection.args })), (connection.env === undefined ? {} : { env: connection.env })), (connection.cwd === undefined ? {} : { cwd: connection.cwd }));
@@ -779,6 +820,16 @@ function loadConnections(ctx, connectionsDir) {
779
820
  continue;
780
821
  }
781
822
  const connection = definition;
823
+ if ("url" in connection &&
824
+ connection.oauth === true &&
825
+ hasAuthorizationHeader(connection.headers)) {
826
+ ctx.diagnostics.push({
827
+ severity: "error",
828
+ path: displayPath(ctx, entryPath),
829
+ message: "MCP connection `oauth: true` cannot set an Authorization header. Drop the header or remove `oauth`.",
830
+ });
831
+ continue;
832
+ }
782
833
  const transport = connectionTransport(connection);
783
834
  if (transport === undefined) {
784
835
  ctx.diagnostics.push({
@@ -807,10 +858,12 @@ function loadConnections(ctx, connectionsDir) {
807
858
  });
808
859
  continue;
809
860
  }
810
- connections.push(Object.assign({ name,
811
- transport }, (connection.description === undefined
812
- ? {}
813
- : { description: connection.description })));
861
+ connections.push({
862
+ name,
863
+ transport,
864
+ description: connection.description,
865
+ hostOnly: connection.hostOnly,
866
+ });
814
867
  }
815
868
  return connections;
816
869
  });
@@ -1256,7 +1309,7 @@ export function projectInfo(project) {
1256
1309
  url: "/v1/session/:sessionId/approvals/:callId",
1257
1310
  },
1258
1311
  ];
1259
- return Object.assign(Object.assign({ name: project.name, model: agent.model, runtime: agent.runtime, cloud: agent.cloud === undefined ? undefined : toPublicCloudInfo(agent.cloud), local: agent.local, hosting: agent.hosting, mcp: { path: MCP_ENDPOINT_PATH, tools: mcpEndpointToolNames(project) }, instructions: agent.instructions === undefined
1312
+ return Object.assign(Object.assign({ name: project.name, model: agent.model, runtime: agent.runtime, cloud: agent.cloud === undefined ? undefined : toPublicCloudInfo(agent.cloud), local: agent.local, hosting: agent.hosting, concurrency: agent.concurrency, mcp: { path: MCP_ENDPOINT_PATH, tools: mcpEndpointToolNames(project) }, instructions: agent.instructions === undefined
1260
1313
  ? undefined
1261
1314
  : {
1262
1315
  chars: agent.instructions.length,
@@ -1275,6 +1328,7 @@ export function projectInfo(project) {
1275
1328
  })), connections: agent.connections.map((connection) => ({
1276
1329
  name: connection.name,
1277
1330
  transport: connectionTransportLabel(connection.transport),
1331
+ hostOnly: connection.hostOnly,
1278
1332
  })), subagents: agent.subagents.map((subagent) => ({
1279
1333
  name: subagent.name,
1280
1334
  description: subagent.description,
@@ -1 +1 @@
1
- {"version":3,"file":"distribution.d.ts","sourceRoot":"","sources":["../../src/internal/distribution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,qEAAqE;AACrE,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAE3C,6EAA6E;AAC7E,eAAO,MAAM,mBAAmB,2BAA2B,CAAC;AAE5D;;;GAGG;AACH,eAAO,MAAM,qBAAqB,qBAAqB,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,WAAW,aAAa,CAAC;AACtC,eAAO,MAAM,UAAU,EAAE,MAA2B,CAAC;AACrD,eAAO,MAAM,gBAAgB,EAAE,MAAiC,CAAC;AAEjE;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAA+B,CAAC;AAc/D;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAGhD;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED,kEAAkE;AAClE,wBAAgB,cAAc,I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