@cursor/july 0.1.79 → 0.1.82

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 (93) hide show
  1. package/AGENTS.md +0 -12
  2. package/dist/channels/github/api.d.ts.map +1 -1
  3. package/dist/channels/github/api.js +8 -1
  4. package/dist/channels/github/cursor-account.d.ts +28 -0
  5. package/dist/channels/github/cursor-account.d.ts.map +1 -1
  6. package/dist/channels/github/cursor-account.js +60 -0
  7. package/dist/channels/github/github-channel.d.ts.map +1 -1
  8. package/dist/channels/github/github-channel.js +29 -1
  9. package/dist/channels/github/types.d.ts +8 -0
  10. package/dist/channels/github/types.d.ts.map +1 -1
  11. package/dist/channels/origin/origin-channel.d.ts.map +1 -1
  12. package/dist/channels/origin/origin-channel.js +32 -10
  13. package/dist/channels/origin/types.d.ts +7 -0
  14. package/dist/channels/origin/types.d.ts.map +1 -1
  15. package/dist/channels/slack/cursor-account.d.ts.map +1 -1
  16. package/dist/channels/slack/cursor-account.js +2 -2
  17. package/dist/channels/slack/dispatch.d.ts +3 -0
  18. package/dist/channels/slack/dispatch.d.ts.map +1 -1
  19. package/dist/channels/slack/dispatch.js +18 -18
  20. package/dist/channels/slack/interactive.d.ts +2 -0
  21. package/dist/channels/slack/interactive.d.ts.map +1 -1
  22. package/dist/channels/slack/interactive.js +4 -16
  23. package/dist/channels/slack/slack-channel.d.ts +1 -1
  24. package/dist/channels/slack/slack-channel.d.ts.map +1 -1
  25. package/dist/channels/slack/slack-channel.js +21 -10
  26. package/dist/channels/slack/types.d.ts +7 -0
  27. package/dist/channels/slack/types.d.ts.map +1 -1
  28. package/dist/channels.d.ts.map +1 -1
  29. package/dist/channels.js +4 -0
  30. package/dist/continuation.d.ts +20 -0
  31. package/dist/continuation.d.ts.map +1 -0
  32. package/dist/continuation.js +18 -0
  33. package/dist/files.d.ts +9 -3
  34. package/dist/files.d.ts.map +1 -1
  35. package/dist/files.js +9 -3
  36. package/dist/index.d.ts +5 -1
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.js +4 -1
  39. package/dist/internal/continuation-channel.d.ts +29 -0
  40. package/dist/internal/continuation-channel.d.ts.map +1 -0
  41. package/dist/internal/continuation-channel.js +88 -0
  42. package/dist/internal/continuation-identity.d.ts +95 -0
  43. package/dist/internal/continuation-identity.d.ts.map +1 -0
  44. package/dist/internal/continuation-identity.js +445 -0
  45. package/dist/internal/deploy-manifest.d.ts +12 -2
  46. package/dist/internal/deploy-manifest.d.ts.map +1 -1
  47. package/dist/internal/deploy-manifest.js +15 -7
  48. package/dist/internal/discovery.d.ts.map +1 -1
  49. package/dist/internal/discovery.js +32 -5
  50. package/dist/internal/review-comments.d.ts +37 -7
  51. package/dist/internal/review-comments.d.ts.map +1 -1
  52. package/dist/internal/review-comments.js +209 -10
  53. package/dist/internal/server.d.ts.map +1 -1
  54. package/dist/internal/server.js +117 -55
  55. package/dist/internal/session-engine.d.ts +24 -0
  56. package/dist/internal/session-engine.d.ts.map +1 -1
  57. package/dist/internal/session-engine.js +104 -34
  58. package/dist/internal/session-store.d.ts.map +1 -1
  59. package/dist/internal/session-store.js +6 -0
  60. package/dist/internal/skills-sync.d.ts +25 -0
  61. package/dist/internal/skills-sync.d.ts.map +1 -0
  62. package/dist/internal/skills-sync.js +96 -0
  63. package/dist/playground/assets/{index-DJzcIeGt.css → index-ChETdG-_.css} +1 -1
  64. package/dist/playground/assets/{index-K3Sxyx0I.js → index-CkuIrhg4.js} +3 -3
  65. package/dist/playground/index.html +2 -2
  66. package/dist/types.d.ts +44 -0
  67. package/dist/types.d.ts.map +1 -1
  68. package/package.json +1 -1
  69. package/src/channels/github/api.ts +8 -0
  70. package/src/channels/github/cursor-account.ts +76 -0
  71. package/src/channels/github/github-channel.ts +52 -1
  72. package/src/channels/github/types.ts +8 -0
  73. package/src/channels/origin/origin-channel.ts +48 -10
  74. package/src/channels/origin/types.ts +7 -0
  75. package/src/channels/slack/cursor-account.ts +1 -0
  76. package/src/channels/slack/dispatch.ts +44 -2
  77. package/src/channels/slack/interactive.ts +5 -0
  78. package/src/channels/slack/slack-channel.ts +23 -2
  79. package/src/channels/slack/types.ts +7 -0
  80. package/src/channels.ts +7 -0
  81. package/src/continuation.ts +49 -0
  82. package/src/files.ts +10 -3
  83. package/src/index.ts +30 -1
  84. package/src/internal/continuation-channel.ts +129 -0
  85. package/src/internal/continuation-identity.ts +597 -0
  86. package/src/internal/deploy-manifest.ts +36 -3
  87. package/src/internal/discovery.ts +40 -2
  88. package/src/internal/review-comments.ts +257 -16
  89. package/src/internal/server.ts +146 -68
  90. package/src/internal/session-engine.ts +132 -37
  91. package/src/internal/session-store.ts +6 -0
  92. package/src/internal/skills-sync.ts +107 -0
  93. package/src/types.ts +55 -0
@@ -36,7 +36,7 @@ import { once } from "node:events";
36
36
  import { createServer, } from "node:http";
37
37
  import { join } from "node:path";
38
38
  import { dispatchDeploymentEvent, getDeploymentsChannelOptions, } from "../channels/deployments/deployments-channel.js";
39
- import { createCursorAccountGithubTokenResolver, getGithubCursorAccountRuntime, parseCursorGithubRepoScope, resolveCursorGithubPermissions, resolveCursorGithubProxyUrl, } from "../channels/github/cursor-account.js";
39
+ import { createCursorAccountGithubTokenResolver, createCursorGithubProxyHostResolver, cursorGithubPermissionsForChannel, getGithubCursorAccountRuntime, resolveCursorGithubCredentialScope, resolveCursorGithubPermissions, resolveCursorGithubProxyUrl, } from "../channels/github/cursor-account.js";
40
40
  import { findGitHubChannelTargets } from "../channels/github/forward.js";
41
41
  import { getOriginCursorAccountRuntime, parseCursorOriginRepoScope, } from "../channels/origin/cursor-account.js";
42
42
  import { findOriginChannelTargets } from "../channels/origin/origin-channel.js";
@@ -160,64 +160,103 @@ export function startServer(mounts_1) {
160
160
  ? undefined
161
161
  : requireCursorEventsAuth(effectiveCursorEvents, accountKey);
162
162
  let cursorGithubCredentials;
163
- if (cursorGithubConfig.scope !== undefined) {
164
- if (cursorEventsAuth === undefined) {
165
- throw new Error("githubChannel({ cursorAccount: true }) could not resolve Cursor event authentication.");
166
- }
167
- if (options.allowAnonymous === true) {
168
- if (options.allowAnonymousCursorGithub !== true) {
169
- throw new Error("githubChannel({ cursorAccount: true }) cannot be served with --allow-anonymous because admitted callers could use the signed-in account's GitHub access. If every admitted caller is trusted (e.g. behind an SSO proxy), opt in with --allow-anonymous-cursor-github.");
163
+ // Proxy-wired GitHub token resolver for `ctx.host.github` when no startup
164
+ // token mint runs (empty repo scope): host Octokit calls must route
165
+ // through github-proxy exactly like channel Octokit calls.
166
+ let hostGithubProxyResolver;
167
+ if (cursorGithubTargets.length > 0) {
168
+ const githubProxyRequested = options.cursorGithubProxy === true;
169
+ const needsGithubAuth = cursorGithubConfig.scope !== undefined || githubProxyRequested;
170
+ if (needsGithubAuth) {
171
+ const cursorGithubAuth = cursorEventsAuth !== null && cursorEventsAuth !== void 0 ? cursorEventsAuth : ((accountKey === null || accountKey === void 0 ? void 0 : accountKey.apiKey) !== undefined && accountKey.apiKey.trim() !== ""
172
+ ? {
173
+ apiKey: accountKey.apiKey.trim(),
174
+ baseUrl: cursorExternalApiUrl(),
175
+ }
176
+ : undefined);
177
+ if (cursorGithubAuth === undefined) {
178
+ throw new Error("githubChannel({ cursorAccount: true }) could not resolve Cursor event authentication.");
170
179
  }
171
- logger("[agent-sdk] warning: --allow-anonymous-cursor-github — every admitted HTTP caller can drive sessions holding the signed-in account's repo-scoped GitHub credential; serve this only behind a trusted boundary (e.g. an SSO proxy)");
172
- }
173
- if (cursorGithubConfig.scope.permissions === "contents-write") {
174
- logger('[agent-sdk] warning: Cursor GitHub credentials include contents:write — the host holds a push-capable token shared with model-driven tools and untrusted webhook content; prefer permissions: "pr-write" unless this agent must push code');
175
- }
176
- const provider = new CursorGithubCredentialProvider({
177
- client: new CursorBackendClient({
178
- backendUrl: cursorEventsAuth.baseUrl,
179
- apiKey: cursorEventsAuth.apiKey,
180
- logger,
181
- }),
182
- scope: cursorGithubConfig.scope,
183
- logger,
184
- });
185
- cursorGithubCredentials = provider;
186
- const githubProxyUrl = options.cursorGithubProxy === true
187
- ? resolveCursorGithubProxyUrl(cursorEventsAuth.baseUrl)
188
- : undefined;
189
- if (githubProxyUrl !== undefined) {
190
- // Proxy mode: channel Octokit calls carry the Cursor API key to the
191
- // backend forwarder, which swaps in the installation token server-side
192
- // and logs every call with per-deployment attribution. The provider
193
- // still runs so child `gh` processes get a `GH_TOKEN` lease (v1).
194
- const proxyTransport = {
195
- apiBaseUrl: githubProxyUrl,
196
- headers: {
197
- "x-cursor-github-repos": cursorGithubConfig.scope.repos.join(","),
198
- "x-cursor-github-permissions": cursorGithubConfig.scope.permissions,
199
- },
200
- };
201
- for (const target of cursorGithubTargets) {
202
- target.accountRuntime.credentials.bind(() => __awaiter(this, void 0, void 0, function* () { return cursorEventsAuth.apiKey; }));
203
- target.accountRuntime.credentials.bindProxyTransport(proxyTransport);
180
+ if (options.allowAnonymous === true) {
181
+ if (options.allowAnonymousCursorGithub !== true) {
182
+ throw new Error("githubChannel({ cursorAccount: true }) cannot be served with --allow-anonymous because admitted callers could use the signed-in account's GitHub access. If every admitted caller is trusted (e.g. behind an SSO proxy), opt in with --allow-anonymous-cursor-github.");
183
+ }
184
+ logger("[agent-sdk] warning: --allow-anonymous-cursor-github — every admitted HTTP caller can drive sessions holding the signed-in account's repo-scoped GitHub credential; serve this only behind a trusted boundary (e.g. an SSO proxy)");
204
185
  }
205
- logger(`[agent-sdk] GitHub auth: channel API calls route through ${githubProxyUrl}`);
206
- }
207
- else {
208
- for (const target of cursorGithubTargets) {
209
- target.accountRuntime.credentials.bind(() => provider.getToken());
186
+ if (cursorGithubConfig.permissions === "contents-write") {
187
+ logger('[agent-sdk] warning: Cursor GitHub credentials include contents:write — the host holds a push-capable token shared with model-driven tools and untrusted webhook content; prefer permissions: "pr-write" unless this agent must push code');
188
+ }
189
+ const githubProxyUrl = githubProxyRequested
190
+ ? resolveCursorGithubProxyUrl(cursorGithubAuth.baseUrl)
191
+ : undefined;
192
+ if (cursorGithubConfig.scope !== undefined) {
193
+ const provider = new CursorGithubCredentialProvider({
194
+ client: new CursorBackendClient({
195
+ backendUrl: cursorGithubAuth.baseUrl,
196
+ apiKey: cursorGithubAuth.apiKey,
197
+ logger,
198
+ }),
199
+ scope: cursorGithubConfig.scope,
200
+ logger,
201
+ });
202
+ cursorGithubCredentials = provider;
203
+ if (githubProxyUrl !== undefined) {
204
+ // Proxy mode: channel Octokit calls carry the Cursor API key to the
205
+ // backend forwarder, which swaps in the installation token server-side
206
+ // and logs every call with per-deployment attribution. The provider
207
+ // still runs so child `gh` processes get a `GH_TOKEN` lease (v1).
208
+ const proxyTransport = {
209
+ apiBaseUrl: githubProxyUrl,
210
+ headers: {
211
+ "x-cursor-github-repos": cursorGithubConfig.scope.repos.join(","),
212
+ "x-cursor-github-permissions": cursorGithubConfig.permissions,
213
+ },
214
+ };
215
+ for (const target of cursorGithubTargets) {
216
+ target.accountRuntime.credentials.bind(() => __awaiter(this, void 0, void 0, function* () { return cursorGithubAuth.apiKey; }));
217
+ target.accountRuntime.credentials.bindProxyTransport(proxyTransport);
218
+ }
219
+ logger(`[agent-sdk] GitHub auth: channel API calls route through ${githubProxyUrl}`);
220
+ }
221
+ else {
222
+ for (const target of cursorGithubTargets) {
223
+ target.accountRuntime.credentials.bind(() => provider.getToken());
224
+ }
225
+ }
226
+ }
227
+ else if (githubProxyUrl !== undefined) {
228
+ // `cursorAccount: true` with no `--repo`: skip the startup token mint
229
+ // (it requires a repo list) and let github-proxy take the repo from
230
+ // each Octokit call. Hosted multi-tenant uses this with the
231
+ // deployment event stream.
232
+ const proxyTransport = {
233
+ apiBaseUrl: githubProxyUrl,
234
+ headers: {
235
+ "x-cursor-github-permissions": cursorGithubConfig.permissions,
236
+ },
237
+ };
238
+ for (const target of cursorGithubTargets) {
239
+ target.accountRuntime.credentials.bind(() => __awaiter(this, void 0, void 0, function* () { return cursorGithubAuth.apiKey; }));
240
+ target.accountRuntime.credentials.bindProxyTransport(proxyTransport);
241
+ }
242
+ // `ctx.host.github` gets the same proxy transport; without this it
243
+ // would fall back to ambient auth (env token / `gh`) or an
244
+ // unauthenticated Octokit, and every host GitHub call would 404.
245
+ hostGithubProxyResolver = createCursorGithubProxyHostResolver({
246
+ getApiKey: () => __awaiter(this, void 0, void 0, function* () { return cursorGithubAuth.apiKey; }),
247
+ transport: proxyTransport,
248
+ });
249
+ logger(`[agent-sdk] GitHub auth: channel and host API calls route through ${githubProxyUrl} (repo scope per request)`);
210
250
  }
211
251
  }
212
252
  }
213
253
  const resolvedCursorGithubCredentials = cursorGithubCredentials;
214
- const hostPlatforms = createHostPlatforms(resolvedCursorGithubCredentials === undefined
254
+ const hostGithubToken = hostGithubProxyResolver !== null && hostGithubProxyResolver !== void 0 ? hostGithubProxyResolver : (resolvedCursorGithubCredentials === undefined
255
+ ? undefined
256
+ : createCursorAccountGithubTokenResolver(() => resolvedCursorGithubCredentials.getToken()));
257
+ const hostPlatforms = createHostPlatforms(hostGithubToken === undefined
215
258
  ? {}
216
- : {
217
- githubCredentials: {
218
- token: createCursorAccountGithubTokenResolver(() => resolvedCursorGithubCredentials.getToken()),
219
- },
220
- });
259
+ : { githubCredentials: { token: hostGithubToken } });
221
260
  if (playground) {
222
261
  // Auto-build dist/playground when missing (monorepo / source checkout).
223
262
  // Published installs already ship the bundle; vite may be absent there.
@@ -1543,11 +1582,23 @@ function collectCursorGithubTargets(mounts) {
1543
1582
  }
1544
1583
  return targets;
1545
1584
  }
1585
+ function cursorGithubPermissionsForTarget(target) {
1586
+ var _a;
1587
+ var _b;
1588
+ const authored = typeof target.accountRuntime.options.cursorAccount === "object"
1589
+ ? target.accountRuntime.options.cursorAccount.permissions
1590
+ : undefined;
1591
+ return ((_b = (_a = target.accountRuntime.scope) === null || _a === void 0 ? void 0 : _a.permissions) !== null && _b !== void 0 ? _b : cursorGithubPermissionsForChannel(target.accountRuntime.options, authored));
1592
+ }
1546
1593
  function resolveCursorGithubEventConfig(input) {
1547
1594
  var _a;
1548
1595
  var _b;
1549
1596
  if (input.targets.length === 0) {
1550
- return { cursorEvents: input.configured, scope: undefined };
1597
+ return {
1598
+ cursorEvents: input.configured,
1599
+ scope: undefined,
1600
+ permissions: "pr-write",
1601
+ };
1551
1602
  }
1552
1603
  const repos = [
1553
1604
  ...((_b = (_a = input.configured) === null || _a === void 0 ? void 0 : _a.repos) !== null && _b !== void 0 ? _b : []),
@@ -1555,11 +1606,19 @@ function resolveCursorGithubEventConfig(input) {
1555
1606
  ...((_b = (_a = target.accountRuntime.scope) === null || _a === void 0 ? void 0 : _a.repos) !== null && _b !== void 0 ? _b : []),
1556
1607
  ]; }),
1557
1608
  ];
1558
- const permissions = resolveCursorGithubPermissions(input.targets.map((target) => { var _a; var _b; return (_b = (_a = target.accountRuntime.scope) === null || _a === void 0 ? void 0 : _a.permissions) !== null && _b !== void 0 ? _b : "pr-write"; }));
1559
- const scope = parseCursorGithubRepoScope(repos, permissions);
1609
+ const permissions = resolveCursorGithubPermissions(input.targets.map(cursorGithubPermissionsForTarget));
1610
+ const scope = resolveCursorGithubCredentialScope(repos, permissions);
1611
+ if (scope === undefined) {
1612
+ return {
1613
+ cursorEvents: input.configured,
1614
+ scope: undefined,
1615
+ permissions,
1616
+ };
1617
+ }
1560
1618
  return {
1561
1619
  cursorEvents: Object.assign(Object.assign({}, input.configured), { repos: [...scope.repos] }),
1562
1620
  scope,
1621
+ permissions,
1563
1622
  };
1564
1623
  }
1565
1624
  function collectCursorOriginTargets(mounts) {
@@ -1591,6 +1650,9 @@ function resolveCursorOriginRepoScope(input) {
1591
1650
  ...(wantsHostRepos ? input.explicitRepos : []),
1592
1651
  ...input.targets.flatMap((target) => { var _a; var _b; return (_b = (_a = target.accountRuntime.scope) === null || _a === void 0 ? void 0 : _a.repos) !== null && _b !== void 0 ? _b : []; }),
1593
1652
  ];
1653
+ if (repos.length === 0) {
1654
+ return undefined;
1655
+ }
1594
1656
  return parseCursorOriginRepoScope(repos);
1595
1657
  }
1596
1658
  /**
@@ -121,6 +121,8 @@ export declare class SessionEngine {
121
121
  private readonly restoreInFlight;
122
122
  /** Once-per-process cache for the A/B snapshot backfill (see abSnapshot). */
123
123
  private restoredAbSnapshot;
124
+ /** In-flight skills → deployment store sync (see ensureCloudSkillsSynced). */
125
+ private cloudSkillsSync;
124
126
  private readonly runner;
125
127
  private readonly logger;
126
128
  private readonly logs;
@@ -260,6 +262,9 @@ export declare class SessionEngine {
260
262
  * Start or resume a session on a channel. When `continuationToken`
261
263
  * addresses an existing session this is a follow-up turn; otherwise a new
262
264
  * session is created (keyed by the provided token, or a fresh one).
265
+ *
266
+ * v2 (`/v2` selectors) refuses `continuationToken` and looks
267
+ * up `(agentId, cKey)` from a mailbox stamp or structured claim.
263
268
  */
264
269
  send(channelId: string, message: string, options?: EngineSendOptions): Promise<ChannelSession>;
265
270
  /** Whether a continuation token already maps to a session on this channel. */
@@ -367,6 +372,25 @@ export declare class SessionEngine {
367
372
  /** Directory that receives AGENTS.md / skills / agent tools. */
368
373
  private scaffoldDir;
369
374
  private executeTurn;
375
+ /**
376
+ * Sync authored skills onto the deployment store at `skills/<name>/…`
377
+ * before the first cloud prompt, so `--agent-store-skills-dir` and the
378
+ * first-turn S3 scan can discover them. False when the sync fails: the
379
+ * turn then runs without store skills rather than pointing discovery at
380
+ * paths that do not exist.
381
+ *
382
+ * With skills authored, every first cloud turn re-copies the authored
383
+ * bytes and the memo only dedupes concurrent first turns. The mount is
384
+ * writable from cloud sessions, so a once-per-process copy would let one
385
+ * session's edits masquerade as agent definition for every later session
386
+ * until the engine restarts; re-syncing keeps the store true to discovery
387
+ * the same way local materialization always rewrites skills. Without
388
+ * skills the sync is best-effort stale cleanup and one attempt per
389
+ * process is enough, success or not — a deployment without the files
390
+ * surface must not fail and log on every new session for a feature it
391
+ * does not use.
392
+ */
393
+ private ensureCloudSkillsSynced;
370
394
  private buildTurnRequest;
371
395
  /**
372
396
  * Connection names a cloud turn can only reach through the host connection
@@ -1 +1 @@
1
- {"version":3,"file":"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AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,SAAS,GAAG,SAAS,EAC9B,KAAK,EAAE,SAAS,GAAG,SAAS,GAC3B,SAAS,GAAG,SAAS,CAuBvB"}
@@ -22,7 +22,7 @@ import { SLACK_CHANNEL_ID } from "../channels/slack/constants.js";
22
22
  import { materializeSlackNudgeCarrier } from "../channels/slack/nudge-carrier.js";
23
23
  import { SlackAskDedupeStore, SlackNudgeStore, } from "../channels/slack/nudge-store.js";
24
24
  import { resolveDedicatedSlackHostBinding } from "../channels/slack/slack-channel.js";
25
- import { isCursorHostedFilesAvailable } from "../files-backends/cursor-hosted.js";
25
+ import { cursorHostedFiles, isCursorHostedFilesAvailable, } from "../files-backends/cursor-hosted.js";
26
26
  import { DEFAULT_MODEL, DIRECT_TOOL_CALL_CHANNEL_ID, isHostOauthConnectionTransport, isSymbolicConnectionTransport, } from "../types.js";
27
27
  import { ABCollector } from "./ab-collector.js";
28
28
  import { foldABStream } from "./ab-fold.js";
@@ -33,6 +33,8 @@ import { ArtifactsStore } from "./artifacts-store.js";
33
33
  import { SessionAuthError, samePrincipal } from "./auth.js";
34
34
  import { mergeCloudOptions, resolveSessionRuntime } from "./cloud-merge.js";
35
35
  import { applyCloudUsageToEvents, cloudSdkAgentIdFromEvents, isUnpricedCompletedTurn, mapSdkTokenUsage, } from "./cloud-turn-cost.js";
36
+ import { applyAgentContinuationDefaults, channelContinuationIdentity, httpContinuationIdentity, } from "./continuation-channel.js";
37
+ import { continuationSource, resolveV2Key, V2EngineError, } from "./continuation-identity.js";
36
38
  import { isDevMode } from "./dev-mode.js";
37
39
  import { EventLogStore } from "./event-log.js";
38
40
  import { TurnEventMapper } from "./event-mapper.js";
@@ -49,6 +51,7 @@ import { buildSessionContextBlock, SCHEDULE_CHANNEL_PREFIX, } from "./prompt-con
49
51
  import { assertCloudCanHonorAccountServersFilters } from "./resolved-connections.js";
50
52
  import { sessionExternalLinks } from "./session-links.js";
51
53
  import { SessionStore } from "./session-store.js";
54
+ import { syncSkillsToStore } from "./skills-sync.js";
52
55
  import { StorageCoordinator } from "./storage-coordinator.js";
53
56
  import { normalizeToolResult, toolCallErrorMessage } from "./tool-result.js";
54
57
  import { estimateTurnCostFromApi, roundCostUsd, } from "./turn-cost.js";
@@ -152,6 +155,7 @@ export class SessionEngine {
152
155
  /** Deduped in-flight cloud cost backfills, keyed by session id. */
153
156
  this.cloudCostBackfill = new Map();
154
157
  this.project = options.project;
158
+ applyAgentContinuationDefaults(this.project);
155
159
  this.stateRoot = options.stateRoot;
156
160
  this.runner = options.runner;
157
161
  this.logger = (_a = options.logger) !== null && _a !== void 0 ? _a : (() => { });
@@ -454,19 +458,37 @@ export class SessionEngine {
454
458
  * Start or resume a session on a channel. When `continuationToken`
455
459
  * addresses an existing session this is a follow-up turn; otherwise a new
456
460
  * session is created (keyed by the provided token, or a fresh one).
461
+ *
462
+ * v2 (`/v2` selectors) refuses `continuationToken` and looks
463
+ * up `(agentId, cKey)` from a mailbox stamp or structured claim.
457
464
  */
458
465
  send(channelId_1, message_1) {
459
466
  return __awaiter(this, arguments, void 0, function* (channelId, message, options = {}) {
460
467
  var _a;
461
468
  var _b, _c, _d, _e, _f;
462
- const auth = (_b = options.auth) !== null && _b !== void 0 ? _b : null;
463
- let existing = options.continuationToken === undefined
469
+ const identity = channelId === HTTP_CHANNEL_ID
470
+ ? httpContinuationIdentity(this.project.httpChannel)
471
+ : channelContinuationIdentity(this.channelsById.get(channelId));
472
+ let sendOptions = options;
473
+ let skipContinuationLookup = false;
474
+ if (continuationSource(identity) === "control-plane") {
475
+ if (options.continuationToken !== undefined) {
476
+ throw new V2EngineError("v2: do not pass continuationToken; use mailboxContinuation or claim");
477
+ }
478
+ const cKey = resolveV2Key(identity, options);
479
+ sendOptions = Object.assign(Object.assign({}, options), { continuationToken: cKey });
480
+ skipContinuationLookup = cKey.startsWith("evt:");
481
+ }
482
+ const auth = (_b = sendOptions.auth) !== null && _b !== void 0 ? _b : null;
483
+ let existing = skipContinuationLookup || sendOptions.continuationToken === undefined
464
484
  ? undefined
465
- : yield this.sessions.findByContinuation(channelId, options.continuationToken);
466
- if (existing === undefined && options.continuationToken !== undefined) {
485
+ : yield this.sessions.findByContinuation(channelId, sendOptions.continuationToken);
486
+ if (existing === undefined &&
487
+ !skipContinuationLookup &&
488
+ sendOptions.continuationToken !== undefined) {
467
489
  // Local miss: the session may live only in the storage sink (it
468
490
  // fell outside the startup restore window, or restore is lazy-only).
469
- existing = yield this.restoreSessionByContinuation(channelId, options.continuationToken);
491
+ existing = yield this.restoreSessionByContinuation(channelId, sendOptions.continuationToken);
470
492
  }
471
493
  if (existing !== undefined) {
472
494
  if (!samePrincipal(existing.auth, auth)) {
@@ -475,51 +497,52 @@ export class SessionEngine {
475
497
  // Refresh harness cwd when the caller supplies a newer worktree (e.g. PR
476
498
  // synchronize). Leave the durable continuation key unchanged.
477
499
  let record = existing;
478
- const refreshWorkspace = options.workspaceDir !== undefined &&
479
- options.workspaceDir !== existing.workspaceOverride;
500
+ const refreshWorkspace = sendOptions.workspaceDir !== undefined &&
501
+ sendOptions.workspaceDir !== existing.workspaceOverride;
480
502
  if (refreshWorkspace ||
481
- options.workspaceFiles !== undefined ||
482
- options.images !== undefined) {
503
+ sendOptions.workspaceFiles !== undefined ||
504
+ sendOptions.images !== undefined) {
483
505
  record = yield this.updateRecord(existing.sessionId, (current) => (Object.assign(Object.assign({}, current), { workspaceOverride: refreshWorkspace
484
- ? options.workspaceDir
485
- : current.workspaceOverride, pendingWorkspaceFiles: mergePendingWorkspaceFiles(current.pendingWorkspaceFiles, options.workspaceFiles), pendingImages: mergePendingImages(current.pendingImages, options.images) })));
506
+ ? sendOptions.workspaceDir
507
+ : current.workspaceOverride, pendingWorkspaceFiles: mergePendingWorkspaceFiles(current.pendingWorkspaceFiles, sendOptions.workspaceFiles), pendingImages: mergePendingImages(current.pendingImages, sendOptions.images) })));
486
508
  }
487
509
  // Refresh the cloud attach the same way: a follow-up send carries the
488
510
  // caller's CURRENT cloud options (e.g. a PR attach re-derived per wake),
489
511
  // and the first send's snapshot must not pin this session's turns to a
490
512
  // stale repo/prUrl for the session's lifetime.
491
- if (options.cloud !== undefined &&
492
- JSON.stringify(options.cloud) !== JSON.stringify(record.cloudOverride)) {
493
- record = yield this.updateRecord(record.sessionId, (current) => (Object.assign(Object.assign({}, current), { cloudOverride: options.cloud })));
513
+ if (sendOptions.cloud !== undefined &&
514
+ JSON.stringify(sendOptions.cloud) !==
515
+ JSON.stringify(record.cloudOverride)) {
516
+ record = yield this.updateRecord(record.sessionId, (current) => (Object.assign(Object.assign({}, current), { cloudOverride: sendOptions.cloud })));
494
517
  }
495
518
  // Refresh wake-derived channel state (GitHub headSha / refs) without
496
519
  // wiping sticky fields. Null patch values are skipped.
497
- if (options.refreshState !== undefined) {
498
- record = yield this.updateRecord(record.sessionId, (current) => (Object.assign(Object.assign({}, current), { channelState: mergeChannelStateSkipNull(current.channelState, options.refreshState) })));
520
+ if (sendOptions.refreshState !== undefined) {
521
+ record = yield this.updateRecord(record.sessionId, (current) => (Object.assign(Object.assign({}, current), { channelState: mergeChannelStateSkipNull(current.channelState, sendOptions.refreshState) })));
499
522
  }
500
523
  const since = (yield this.logs.get(record.sessionId)).count;
501
- const coalesced = yield this.startTurn(record.sessionId, message, Object.assign({ admission: (_c = options.admission) !== null && _c !== void 0 ? _c : "preempt" }, (options.coalesceSourceTs === undefined
524
+ const coalesced = yield this.startTurn(record.sessionId, message, Object.assign({ admission: (_c = sendOptions.admission) !== null && _c !== void 0 ? _c : "preempt" }, (sendOptions.coalesceSourceTs === undefined
502
525
  ? {}
503
- : { sourceTs: options.coalesceSourceTs })));
526
+ : { sourceTs: sendOptions.coalesceSourceTs })));
504
527
  return this.channelSession(record.sessionId, record, false, coalesced, since);
505
528
  }
506
529
  const now = new Date().toISOString();
507
- const channelState = this.initialChannelState(channelId, options.state);
508
- const purpose = options.purpose === "eval" ? "eval" : "live";
530
+ const channelState = this.initialChannelState(channelId, sendOptions.state);
531
+ const purpose = sendOptions.purpose === "eval" ? "eval" : "live";
509
532
  let record = {
510
533
  sessionId: newSessionId(),
511
534
  channelId,
512
- mode: (_d = options.mode) !== null && _d !== void 0 ? _d : "chat",
535
+ mode: (_d = sendOptions.mode) !== null && _d !== void 0 ? _d : "chat",
513
536
  purpose,
514
- continuationKey: (_e = options.continuationToken) !== null && _e !== void 0 ? _e : newContinuationKey(),
537
+ continuationKey: (_e = sendOptions.continuationToken) !== null && _e !== void 0 ? _e : newContinuationKey(),
515
538
  auth,
516
- title: options.title,
539
+ title: sendOptions.title,
517
540
  channelState,
518
- workspaceOverride: options.workspaceDir,
519
- pendingWorkspaceFiles: options.workspaceFiles,
520
- pendingImages: options.images,
521
- cloudOverride: options.cloud,
522
- sdkAgentId: options.sdkAgentId,
541
+ workspaceOverride: sendOptions.workspaceDir,
542
+ pendingWorkspaceFiles: sendOptions.workspaceFiles,
543
+ pendingImages: sendOptions.images,
544
+ cloudOverride: sendOptions.cloud,
545
+ sdkAgentId: sendOptions.sdkAgentId,
523
546
  turnCount: 0,
524
547
  createdAt: now,
525
548
  updatedAt: now,
@@ -532,9 +555,9 @@ export class SessionEngine {
532
555
  });
533
556
  record = yield this.enrollABs(record);
534
557
  const since = (yield this.logs.get(record.sessionId)).count;
535
- yield this.startTurn(record.sessionId, message, Object.assign({ admission: (_f = options.admission) !== null && _f !== void 0 ? _f : "preempt" }, (options.coalesceSourceTs === undefined
558
+ yield this.startTurn(record.sessionId, message, Object.assign({ admission: (_f = sendOptions.admission) !== null && _f !== void 0 ? _f : "preempt" }, (sendOptions.coalesceSourceTs === undefined
536
559
  ? {}
537
- : { sourceTs: options.coalesceSourceTs })));
560
+ : { sourceTs: sendOptions.coalesceSourceTs })));
538
561
  return this.channelSession(record.sessionId, record, true, false, since);
539
562
  });
540
563
  }
@@ -1270,6 +1293,45 @@ export class SessionEngine {
1270
1293
  return Object.assign(Object.assign(Object.assign({}, outcome), (finalResult === undefined ? {} : { result: finalResult })), (finalUsage === undefined ? {} : { usage: finalUsage }));
1271
1294
  });
1272
1295
  }
1296
+ /**
1297
+ * Sync authored skills onto the deployment store at `skills/<name>/…`
1298
+ * before the first cloud prompt, so `--agent-store-skills-dir` and the
1299
+ * first-turn S3 scan can discover them. False when the sync fails: the
1300
+ * turn then runs without store skills rather than pointing discovery at
1301
+ * paths that do not exist.
1302
+ *
1303
+ * With skills authored, every first cloud turn re-copies the authored
1304
+ * bytes and the memo only dedupes concurrent first turns. The mount is
1305
+ * writable from cloud sessions, so a once-per-process copy would let one
1306
+ * session's edits masquerade as agent definition for every later session
1307
+ * until the engine restarts; re-syncing keeps the store true to discovery
1308
+ * the same way local materialization always rewrites skills. Without
1309
+ * skills the sync is best-effort stale cleanup and one attempt per
1310
+ * process is enough, success or not — a deployment without the files
1311
+ * surface must not fail and log on every new session for a feature it
1312
+ * does not use.
1313
+ */
1314
+ ensureCloudSkillsSynced() {
1315
+ if (this.cloudSkillsSync !== undefined) {
1316
+ return this.cloudSkillsSync;
1317
+ }
1318
+ const skills = this.project.agent.skills;
1319
+ let sync = syncSkillsToStore({
1320
+ sink: cursorHostedFiles(),
1321
+ agentName: this.project.name,
1322
+ skills,
1323
+ }).then(() => true, (error) => {
1324
+ this.logger(`[skills] deployment store sync failed: ${error instanceof Error ? error.message : String(error)}`);
1325
+ return false;
1326
+ });
1327
+ if (skills.length > 0) {
1328
+ sync = sync.finally(() => {
1329
+ this.cloudSkillsSync = undefined;
1330
+ });
1331
+ }
1332
+ this.cloudSkillsSync = sync;
1333
+ return sync;
1334
+ }
1273
1335
  buildTurnRequest(record, agent, turnId, prompt, isFirstTurn, instructionsInvisibleToHarness, emit, onUpdate, signal, images) {
1274
1336
  return __awaiter(this, void 0, void 0, function* () {
1275
1337
  var _a, _b, _c;
@@ -1315,8 +1377,9 @@ export class SessionEngine {
1315
1377
  if (isFirstTurn) {
1316
1378
  if (runtime === "cloud") {
1317
1379
  // Cloud VMs have no materialized workspace: ship the full context,
1318
- // including agent tool script bodies. On hosted deployments the
1319
- // shared memory journal is on the store mount say where. When the
1380
+ // including agent tool script bodies. On hosted deployments authored
1381
+ // skills land on the store mount for native discovery, and the
1382
+ // shared memory journal is on that mount too — say where. When the
1320
1383
  // turn carries the session-bound server-tool MCP endpoint, the
1321
1384
  // preamble catalogs server tools under that MCP server name *before*
1322
1385
  // the agent-tool "write the script if missing" recipe, so a model
@@ -1327,7 +1390,14 @@ export class SessionEngine {
1327
1390
  ? undefined
1328
1391
  : SERVER_TOOLS_MCP_SERVER_NAME,
1329
1392
  });
1330
- const memorySection = isCursorHostedFilesAvailable()
1393
+ const hosted = isCursorHostedFilesAvailable();
1394
+ // Synced whenever hosted, not just when skills exist: removing the
1395
+ // last skill has to delete its store copies too. Discovery is native
1396
+ // (`--agent-store-skills-dir`); this only has to land the bytes.
1397
+ if (hosted) {
1398
+ yield this.ensureCloudSkillsSynced();
1399
+ }
1400
+ const memorySection = hosted
1331
1401
  ? `\n\n${buildCloudMemorySection(this.project.name)}`
1332
1402
  : "";
1333
1403
  turnPrompt = `${preamble}${memorySection}\n\n${turnPrompt}`;
@@ -1 +1 @@
1
- {"version":3,"file":"session-store.d.ts","sourceRoot":"","sources":["../../src/internal/session-store.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,qBAAa,YAAY;IAKX,OAAO,CAAC,QAAQ,CAAC,WAAW;IAJxC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAoC;IAC1D,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAA6B;IAC/D,OAAO,CAAC,QAAQ,CAA4B;IAE5C,YAA6B,WAAW,EAAE,MAAM,EAAI;IAEpD,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAKpC;IAED,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEtC;IAED,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEvC;I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AEK,kBAAkB,CACtB,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAMpC;IAEK,IAAI,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAoB/C;CACF"}
@@ -18,6 +18,7 @@ import { randomBytes } from "node:crypto";
18
18
  import { mkdir, readdir, readFile, rename, writeFile } from "node:fs/promises";
19
19
  import { join } from "node:path";
20
20
  import { isSafeSessionId } from "./auth.js";
21
+ import { isV2DurableContinuationKey } from "./continuation-identity.js";
21
22
  export class SessionStore {
22
23
  constructor(sessionsDir) {
23
24
  this.sessionsDir = sessionsDir;
@@ -40,6 +41,11 @@ export class SessionStore {
40
41
  return join(this.sessionDir(sessionId), "session.json");
41
42
  }
42
43
  continuationKeyOf(channelId, key) {
44
+ // v2 index is (agentId, cKey). This store is already per-agent, so drop
45
+ // channelId for `cont:` / `evt:` keys. v1 stays `{channelId}\n{token}`.
46
+ if (isV2DurableContinuationKey(key)) {
47
+ return `\0v2\n${key}`;
48
+ }
43
49
  return `${channelId}\n${key}`;
44
50
  }
45
51
  hydrate() {
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Sync authored skills into the deployment's Agent Store so cloud-runtime
3
+ * turns discover them natively. The engine writes through the hosted sink
4
+ * at store-root `skills/<name>/…`; the cloud VM is launched with
5
+ * `--agent-store-skills-dir /cursor/stores/deployment/skills` and walks that
6
+ * directory the same way it walks a user store.
7
+ */
8
+ import { type FileSink } from "../files.js";
9
+ import type { DiscoveredSkill } from "../types.js";
10
+ /**
11
+ * Mirror the agent's skills onto the store: write every SKILL.md (with the
12
+ * same generated frontmatter local materialization uses) plus sibling files,
13
+ * and delete keys no authored skill claims so redeploys drop removed skills.
14
+ *
15
+ * Everything loads and validates before the store is touched, and writes
16
+ * land before stale deletes, so a failed sync never leaves a gap a
17
+ * concurrent cloud reader could see.
18
+ */
19
+ export declare function syncSkillsToStore(args: {
20
+ sink: FileSink;
21
+ /** Sweeps leftover keys from the pre-native `agentkit/v1/{agent}/skills/` prefix. */
22
+ agentName: string;
23
+ skills: readonly DiscoveredSkill[];
24
+ }): Promise<void>;
25
+ //# sourceMappingURL=skills-sync.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skills-sync.d.ts","sourceRoot":"","sources":["../../src/internal/skills-sync.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAqC,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE/E,OAAO,KAAK,EAAE,eAAe,EAAmB,MAAM,aAAa,CAAC;AAQpE;;;;;;;;GAQG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,IAAI,EAAE,QAAQ,CAAC;IACf,qFAAqF;IACrF,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,SAAS,eAAe,EAAE,CAAC;CACpC,GAAG,OAAO,CAAC,IAAI,CAAC,CAsBhB"}