@cursor/july 0.1.45 → 0.1.47

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 (149) hide show
  1. package/AGENTS.md +4 -2
  2. package/README.md +3 -1
  3. package/dist/channels/github/api.d.ts +25 -0
  4. package/dist/channels/github/api.d.ts.map +1 -1
  5. package/dist/channels/github/api.js +48 -0
  6. package/dist/channels/github/cursor-account.d.ts +7 -0
  7. package/dist/channels/github/cursor-account.d.ts.map +1 -1
  8. package/dist/channels/github/cursor-account.js +18 -0
  9. package/dist/channels/github/defaults.d.ts +1 -1
  10. package/dist/channels/github/defaults.js +1 -1
  11. package/dist/channels/github/github-channel.d.ts.map +1 -1
  12. package/dist/channels/github/github-channel.js +2 -2
  13. package/dist/channels/github/progress.d.ts +6 -5
  14. package/dist/channels/github/progress.d.ts.map +1 -1
  15. package/dist/channels/github/progress.js +58 -16
  16. package/dist/channels/github/state.d.ts +11 -0
  17. package/dist/channels/github/state.d.ts.map +1 -1
  18. package/dist/channels/github/state.js +1 -1
  19. package/dist/channels/github/types.d.ts +3 -3
  20. package/dist/docs/404.html +2 -2
  21. package/dist/docs/ab.html +3 -3
  22. package/dist/docs/assets/{app.fHnNXEJ6.js → app.IEXEim5m.js} +1 -1
  23. package/dist/docs/assets/chunks/@localSearchIndexroot.D7w61u6Y.js +1 -0
  24. package/dist/docs/assets/chunks/{VPLocalSearchBox.Cf6ghfFY.js → VPLocalSearchBox.78s6nqsH.js} +1 -1
  25. package/dist/docs/assets/chunks/{theme.B_5-VLe8.js → theme.DroGdz_Q.js} +2 -2
  26. package/dist/docs/assets/{guides_github.md.DSg0j9qj.js → guides_github.md.B8QKtIpw.js} +7 -6
  27. package/dist/docs/assets/{guides_github.md.DSg0j9qj.lean.js → guides_github.md.B8QKtIpw.lean.js} +1 -1
  28. package/dist/docs/assets/{reference_agent-config.md.XRpxctsA.js → reference_agent-config.md.DHkkvcEZ.js} +4 -4
  29. package/dist/docs/assets/{reference_agent-config.md.XRpxctsA.lean.js → reference_agent-config.md.DHkkvcEZ.lean.js} +1 -1
  30. package/dist/docs/assets/{reference_hooks.md.4cbRRIIu.js → reference_hooks.md.DJE5DXcT.js} +1 -1
  31. package/dist/docs/assets/{storage.md.DcGSnIxX.js → storage.md.CJYd5YmN.js} +2 -2
  32. package/dist/docs/assets/{storage.md.DcGSnIxX.lean.js → storage.md.CJYd5YmN.lean.js} +1 -1
  33. package/dist/docs/building-with-agents.html +3 -3
  34. package/dist/docs/concepts.html +3 -3
  35. package/dist/docs/deployment.html +3 -3
  36. package/dist/docs/evals.html +3 -3
  37. package/dist/docs/example-agents/approval-buddy.html +3 -3
  38. package/dist/docs/example-agents/benny.html +3 -3
  39. package/dist/docs/example-agents/bugbot.html +3 -3
  40. package/dist/docs/example-agents/codebase-wiki.html +3 -3
  41. package/dist/docs/example-agents/codeowners-review.html +3 -3
  42. package/dist/docs/example-agents/concierge.html +3 -3
  43. package/dist/docs/example-agents/fsd.html +3 -3
  44. package/dist/docs/example-agents/index.html +3 -3
  45. package/dist/docs/example-agents/knowledge-base.html +3 -3
  46. package/dist/docs/example-agents/oncall.html +3 -3
  47. package/dist/docs/example-agents/security-reviewer.html +3 -3
  48. package/dist/docs/example-agents/slack-agent.html +3 -3
  49. package/dist/docs/example-agents/weather-agent.html +3 -3
  50. package/dist/docs/guides/agent-to-agent.html +3 -3
  51. package/dist/docs/guides/cloud-runtime.html +3 -3
  52. package/dist/docs/guides/github.html +10 -9
  53. package/dist/docs/guides/human-in-the-loop.html +3 -3
  54. package/dist/docs/guides/mcp-oauth.html +3 -3
  55. package/dist/docs/guides/opentelemetry.html +3 -3
  56. package/dist/docs/guides/slack.html +3 -3
  57. package/dist/docs/guides/webhooks.html +3 -3
  58. package/dist/docs/hashmap.json +1 -1
  59. package/dist/docs/hillclimbing.html +3 -3
  60. package/dist/docs/index.html +3 -3
  61. package/dist/docs/quickstart.html +3 -3
  62. package/dist/docs/reference/agent-config.html +6 -6
  63. package/dist/docs/reference/artifacts.html +3 -3
  64. package/dist/docs/reference/channels.html +3 -3
  65. package/dist/docs/reference/cli.html +3 -3
  66. package/dist/docs/reference/connections.html +3 -3
  67. package/dist/docs/reference/hooks.html +5 -5
  68. package/dist/docs/reference/http-api.html +3 -3
  69. package/dist/docs/reference/instructions.html +3 -3
  70. package/dist/docs/reference/playground.html +3 -3
  71. package/dist/docs/reference/project-layout.html +3 -3
  72. package/dist/docs/reference/prompt.html +3 -3
  73. package/dist/docs/reference/schedules.html +3 -3
  74. package/dist/docs/reference/sessions.html +3 -3
  75. package/dist/docs/reference/skills.html +3 -3
  76. package/dist/docs/reference/subagents.html +3 -3
  77. package/dist/docs/reference/tools.html +3 -3
  78. package/dist/docs/scaffolding-agents.html +3 -3
  79. package/dist/docs/storage.html +5 -5
  80. package/dist/docs/templates/triage.html +3 -3
  81. package/dist/docs/troubleshooting.html +3 -3
  82. package/dist/index.d.ts +1 -1
  83. package/dist/index.d.ts.map +1 -1
  84. package/dist/index.js +1 -1
  85. package/dist/internal/auth.d.ts +4 -0
  86. package/dist/internal/auth.d.ts.map +1 -1
  87. package/dist/internal/auth.js +7 -0
  88. package/dist/internal/durable-session-store.d.ts +35 -23
  89. package/dist/internal/durable-session-store.d.ts.map +1 -1
  90. package/dist/internal/durable-session-store.js +71 -26
  91. package/dist/internal/ledger-serving.d.ts +135 -67
  92. package/dist/internal/ledger-serving.d.ts.map +1 -1
  93. package/dist/internal/ledger-serving.js +326 -107
  94. package/dist/internal/sdk-runner.d.ts +21 -0
  95. package/dist/internal/sdk-runner.d.ts.map +1 -1
  96. package/dist/internal/sdk-runner.js +34 -1
  97. package/dist/internal/server.d.ts.map +1 -1
  98. package/dist/internal/server.js +9 -4
  99. package/dist/internal/session-engine.d.ts +18 -17
  100. package/dist/internal/session-engine.d.ts.map +1 -1
  101. package/dist/internal/session-engine.js +60 -27
  102. package/dist/kv/memory-kv.d.ts +8 -0
  103. package/dist/kv/memory-kv.d.ts.map +1 -1
  104. package/dist/kv/memory-kv.js +8 -0
  105. package/dist/ledger/janitor.d.ts +60 -0
  106. package/dist/ledger/janitor.d.ts.map +1 -0
  107. package/dist/ledger/janitor.js +137 -0
  108. package/dist/ledger/session-ledger.d.ts +132 -43
  109. package/dist/ledger/session-ledger.d.ts.map +1 -1
  110. package/dist/ledger/session-ledger.js +282 -50
  111. package/dist/ledger.d.ts +9 -8
  112. package/dist/ledger.d.ts.map +1 -1
  113. package/dist/ledger.js +7 -7
  114. package/dist/playground/assets/{index-Dces8BDp.js → index-BgUHfe3L.js} +32 -32
  115. package/dist/playground/assets/index-uFaeqVZS.css +1 -0
  116. package/dist/playground/index.html +2 -2
  117. package/dist/storage-backends/cursor-hosted.d.ts +5 -0
  118. package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
  119. package/dist/storage-backends/cursor-hosted.js +6 -0
  120. package/dist/types.d.ts +19 -8
  121. package/dist/types.d.ts.map +1 -1
  122. package/docs/guides/github.md +23 -18
  123. package/docs/reference/agent-config.md +31 -36
  124. package/docs/reference/hooks.md +1 -1
  125. package/docs/storage.md +26 -9
  126. package/package.json +1 -1
  127. package/src/channels/github/api.ts +122 -0
  128. package/src/channels/github/cursor-account.ts +23 -0
  129. package/src/channels/github/defaults.ts +1 -1
  130. package/src/channels/github/github-channel.ts +5 -1
  131. package/src/channels/github/progress.ts +84 -19
  132. package/src/channels/github/state.ts +14 -0
  133. package/src/channels/github/types.ts +3 -3
  134. package/src/index.ts +1 -0
  135. package/src/internal/auth.ts +10 -0
  136. package/src/internal/durable-session-store.ts +66 -27
  137. package/src/internal/ledger-serving.ts +439 -148
  138. package/src/internal/sdk-runner.ts +46 -1
  139. package/src/internal/server.ts +17 -3
  140. package/src/internal/session-engine.ts +95 -37
  141. package/src/kv/memory-kv.ts +8 -0
  142. package/src/ledger/janitor.ts +193 -0
  143. package/src/ledger/session-ledger.ts +372 -68
  144. package/src/ledger.ts +21 -6
  145. package/src/storage-backends/cursor-hosted.ts +17 -2
  146. package/src/types.ts +19 -8
  147. package/dist/docs/assets/chunks/@localSearchIndexroot.BMT0xM4I.js +0 -1
  148. package/dist/playground/assets/index-CZH9EFvO.css +0 -1
  149. /package/dist/docs/assets/{reference_hooks.md.4cbRRIIu.lean.js → reference_hooks.md.DJE5DXcT.lean.js} +0 -0
package/AGENTS.md CHANGED
@@ -253,8 +253,10 @@ calls can reuse the signed-in Cursor connection with
253
253
  `githubChannel({ cursorAccount: { repos: ["owner/repo"] } })`; this supplies
254
254
  events plus a refreshing repo-scoped credential to `ctx.github`,
255
255
  `ctx.host.github`, and child `gh` commands in dev and hosted deployments.
256
- Default `permissions: "pr-write"`; opt up to `"contents-write"` only to push.
257
- Without `cursorAccount`, calls prefer App installation tokens (`GITHUB_APP_ID` +
256
+ Default `permissions: "pr-write"`; opt up to `"contents-write"` to push or
257
+ post merge-box checks. Enabling `progress.commitStatus` opts hosted
258
+ `cursorAccount` up to that tier (`checks:write`). Without `cursorAccount`, calls prefer
259
+ App installation tokens (`GITHUB_APP_ID` +
258
260
  `GITHUB_APP_PRIVATE_KEY` + webhook `installation.id` or
259
261
  `GITHUB_APP_INSTALLATION_ID`); serve warmup also exports that token as
260
262
  `GH_TOKEN` for tools that shell out to `gh`. For local testing, omit App
package/README.md CHANGED
@@ -1003,7 +1003,9 @@ under `serve --dev`, which admits unsigned loopback deliveries so
1003
1003
  for both Cursor SCM events and a refreshing repo-scoped GitHub credential used
1004
1004
  by `ctx.github`, `ctx.host.github`, and child `gh` commands. Default
1005
1005
  `permissions: "pr-write"` covers comments without `contents:write`; opt up to
1006
- `"contents-write"` only when the agent must push. Without `cursorAccount`, API
1006
+ `"contents-write"` when the agent must push or post merge-box checks.
1007
+ Enabling `progress.commitStatus` opts hosted `cursorAccount` up to that
1008
+ tier so github-proxy mints `checks:write`. Without `cursorAccount`, API
1007
1009
  auth prefers GitHub App installation tokens when `GITHUB_APP_ID` /
1008
1010
  `GITHUB_APP_PRIVATE_KEY` (and an installation id) are set, then falls back to
1009
1011
  `GITHUB_TOKEN` / `GH_TOKEN` or `gh auth login`. The channel publishes the
@@ -102,5 +102,30 @@ export declare function createGitHubCommitStatus(input: GitHubResourceInput & {
102
102
  description?: string;
103
103
  targetUrl?: string;
104
104
  }): Promise<GitHubApiResponse>;
105
+ export type GitHubCheckRunStatus = "queued" | "in_progress" | "completed";
106
+ export type GitHubCheckRunConclusion = "action_required" | "cancelled" | "failure" | "neutral" | "skipped" | "success" | "timed_out";
107
+ export interface GitHubCheckRun {
108
+ htmlUrl: string | undefined;
109
+ id: number;
110
+ raw: unknown;
111
+ }
112
+ export interface GitHubCheckRunWriteInput {
113
+ conclusion?: GitHubCheckRunConclusion;
114
+ detailsUrl?: string;
115
+ name: string;
116
+ output?: {
117
+ summary: string;
118
+ title: string;
119
+ };
120
+ status: GitHubCheckRunStatus;
121
+ }
122
+ /** Create a check run (Checks API). */
123
+ export declare function createGitHubCheckRun(input: GitHubResourceInput & GitHubCheckRunWriteInput & {
124
+ sha: string;
125
+ }): Promise<GitHubCheckRun>;
126
+ /** Update a check run (Checks API). */
127
+ export declare function updateGitHubCheckRun(input: GitHubResourceInput & GitHubCheckRunWriteInput & {
128
+ checkRunId: number;
129
+ }): Promise<GitHubCheckRun>;
105
130
  export {};
106
131
  //# sourceMappingURL=api.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/channels/github/api.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EACL,KAAK,oBAAoB,EAO1B,MAAM,WAAW,CAAC;AAMnB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAE3D,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACvD,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,KA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AAE,MAAM,CAAC;CACpB,GACA,OAAO,CAAC,iBAAiB,CAAC,CA0B5B;AAED,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GAAG,aAAa,GAAG,WAAW,CAAC;AAC1E,MAAM,MAAM,wBAAwB,GAChC,iBAAiB,GACjB,WAAW,GACX,SAAS,GACT,SAAS,GACT,SAAS,GACT,SAAS,GACT,WAAW,CAAC;AAEhB,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,OAAO,CAAC;CACd;AAED,MAAM,WAAW,wBAAwB;IACvC,UAAU,CAAC,EAAE,wBAAwB,CAAC;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5C,MAAM,EAAE,oBAAoB,CAAC;CAC9B;AAED,uCAAuC;AACvC,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,mBAAmB,GACxB,wBAAwB,GAAG;IACzB,GAAG,EAAE,MAAM,CAAC;CACb,GACF,OAAO,CAAC,cAAc,CAAC,CAuBzB;AAED,uCAAuC;AACvC,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,mBAAmB,GACxB,wBAAwB,GAAG;IACzB,UAAU,EAAE,MAAM,CAAC;CACpB,GACF,OAAO,CAAC,cAAc,CAAC,CAqBzB"}
@@ -240,6 +240,54 @@ export function createGitHubCommitStatus(input) {
240
240
  }
241
241
  });
242
242
  }
243
+ /** Create a check run (Checks API). */
244
+ export function createGitHubCheckRun(input) {
245
+ return __awaiter(this, void 0, void 0, function* () {
246
+ const octokit = yield createGitHubOctokit(input);
247
+ const now = new Date().toISOString();
248
+ try {
249
+ const response = yield octokit.rest.checks.create(Object.assign(Object.assign(Object.assign({ owner: input.owner, repo: input.repo, name: input.name, head_sha: input.sha, status: input.status, started_at: now }, checkRunCompletionFields(input, now)), checkRunDetailsUrl(input)), checkRunOutput(input)));
250
+ return toCheckRun(response.data);
251
+ }
252
+ catch (error) {
253
+ throw wrapOctokitError(error, "POST", `/repos/${input.owner}/${input.repo}/check-runs`);
254
+ }
255
+ });
256
+ }
257
+ /** Update a check run (Checks API). */
258
+ export function updateGitHubCheckRun(input) {
259
+ return __awaiter(this, void 0, void 0, function* () {
260
+ const octokit = yield createGitHubOctokit(input);
261
+ try {
262
+ const response = yield octokit.rest.checks.update(Object.assign(Object.assign(Object.assign({ owner: input.owner, repo: input.repo, check_run_id: input.checkRunId, name: input.name, status: input.status }, checkRunCompletionFields(input, new Date().toISOString())), checkRunDetailsUrl(input)), checkRunOutput(input)));
263
+ return toCheckRun(response.data);
264
+ }
265
+ catch (error) {
266
+ throw wrapOctokitError(error, "PATCH", `/repos/${input.owner}/${input.repo}/check-runs/${input.checkRunId}`);
267
+ }
268
+ });
269
+ }
270
+ function checkRunCompletionFields(input, completedAt) {
271
+ if (input.status !== "completed" || input.conclusion === undefined) {
272
+ return {};
273
+ }
274
+ return { completed_at: completedAt, conclusion: input.conclusion };
275
+ }
276
+ function checkRunDetailsUrl(input) {
277
+ return input.detailsUrl === undefined
278
+ ? {}
279
+ : { details_url: input.detailsUrl };
280
+ }
281
+ function checkRunOutput(input) {
282
+ return input.output === undefined ? {} : { output: input.output };
283
+ }
284
+ function toCheckRun(raw) {
285
+ return {
286
+ htmlUrl: typeof raw.html_url === "string" ? raw.html_url : undefined,
287
+ id: typeof raw.id === "number" ? raw.id : 0,
288
+ raw,
289
+ };
290
+ }
243
291
  function toPostedComment(raw) {
244
292
  return {
245
293
  htmlUrl: typeof raw.html_url === "string" ? raw.html_url : undefined,
@@ -45,6 +45,13 @@ export interface GithubCursorAccountRuntime {
45
45
  }
46
46
  export declare function parseCursorGithubPermissions(value: unknown, fallback?: CursorGithubPermissions): CursorGithubPermissions;
47
47
  export declare function parseCursorGithubRepoScope(values: readonly string[], permissions?: CursorGithubPermissions): CursorGithubRepoScope;
48
+ /**
49
+ * Hosted `cursorAccount` mints `checks:write` on the `contents-write` tier.
50
+ * Enabling `progress.commitStatus` opts a `pr-write` (or omitted) channel up
51
+ * to that tier so github-proxy / `/github-token` can post Checks API runs.
52
+ * `"read"` cannot post merge-box checks.
53
+ */
54
+ export declare function cursorGithubPermissionsForChannel(options: Pick<GitHubChannelOptions, "progress">, authored?: CursorGithubPermissions | undefined): CursorGithubPermissions;
48
55
  /** One host credential: the most privileged requested tier wins. */
49
56
  export declare function resolveCursorGithubPermissions(values: readonly CursorGithubPermissions[]): CursorGithubPermissions;
50
57
  export declare function createCursorAccountGithubTokenResolver(getToken: () => Promise<string>, pending?: PendingCursorGithubCredentials): CursorAccountGithubTokenResolver;
@@ -1 +1 @@
1
- {"version":3,"file":"cursor-account.d.ts","sourceRoot":"","sources":["../../../src/channels/github/cursor-account.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAI1C,8EAA8E;AAC9E,eAAO,MAAM,yBAAyB,YACpC,MAAM,EACN,UAAU,EACV,gBAAgB,CACR,CAAC;AAEX,MAAM,MAAM,uBAAuB,GACjC,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7C,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,WAAW,EAAE,uBAAuB,CAAC;CACtC;AAED,MAAM,MAAM,gCAAgC,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;AAErE;;;;;GAKG;AACH,MAAM,WAAW,0BAA0B;IACzC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA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,CAAC;IAC5C;;;OAGG;IACH,KAAK,EAAE,qBAAqB,GAAG,SAAS,CAAC;CAC1C;AAID,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,OAAO,EACd,QAAQ,GAAE,uBAAoC,GAC7C,uBAAuB,CAUzB;AAED,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,WAAW,GAAE,uBAAoC,GAChD,qBAAqB,CAmCvB;AAED;;;;;GAKG;AACH,wBAAgB,iCAAiC,CAC/C,OAAO,EAAE,IAAI,CAAC,oBAAoB,EAAE,UAAU,CAAC,EAC/C,QAAQ,GAAE,uBAAuB,GAAG,SAAsB,GACzD,uBAAuB,CAYzB;AAED,oEAAoE;AACpE,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,SAAS,uBAAuB,EAAE,GACzC,uBAAuB,CAWzB;AAED,wBAAgB,sCAAsC,CACpD,QAAQ,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,EAC/B,OAAO,CAAC,EAAE,8BAA8B,GACvC,gCAAgC,CAOlC;AAED,6EAA6E;AAC7E,wBAAgB,oCAAoC,CAClD,QAAQ,EAAE,gCAAgC,GACzC,0BAA0B,GAAG,SAAS,CAExC;AAOD;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAO1E;AAED,wBAAgB,kCAAkC,CAChD,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,gCAAgC,CAE3C;AAED,wBAAgB,oCAAoC,IAAI,8BAA8B,CAsBrF;AAED,wBAAgB,kCAAkC,CAChD,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,0BAA0B,GAClC,IAAI,CAEN;AAED,wBAAgB,6BAA6B,CAC3C,UAAU,EAAE,MAAM,GACjB,0BAA0B,GAAG,SAAS,CAExC"}
@@ -54,6 +54,24 @@ export function parseCursorGithubRepoScope(values, permissions = "pr-write") {
54
54
  permissions: parseCursorGithubPermissions(permissions),
55
55
  };
56
56
  }
57
+ /**
58
+ * Hosted `cursorAccount` mints `checks:write` on the `contents-write` tier.
59
+ * Enabling `progress.commitStatus` opts a `pr-write` (or omitted) channel up
60
+ * to that tier so github-proxy / `/github-token` can post Checks API runs.
61
+ * `"read"` cannot post merge-box checks.
62
+ */
63
+ export function cursorGithubPermissionsForChannel(options, authored = "pr-write") {
64
+ var _a;
65
+ const base = authored !== null && authored !== void 0 ? authored : "pr-write";
66
+ const commitStatus = (_a = options.progress) === null || _a === void 0 ? void 0 : _a.commitStatus;
67
+ if (commitStatus === undefined || commitStatus === false) {
68
+ return base;
69
+ }
70
+ if (base === "read") {
71
+ throw new Error('progress.commitStatus needs checks:write; cursorAccount permissions: "read" cannot post merge-box checks. Use "pr-write" or "contents-write".');
72
+ }
73
+ return "contents-write";
74
+ }
57
75
  /** One host credential: the most privileged requested tier wins. */
58
76
  export function resolveCursorGithubPermissions(values) {
59
77
  let max = "read";
@@ -15,7 +15,7 @@ export interface BuildDefaultGitHubEventsOptions extends GitHubBindingConfig {
15
15
  deliverReplies?: boolean;
16
16
  }
17
17
  /**
18
- * Built-in delivery: eyes reaction on turn start, optional commit status /
18
+ * Built-in delivery: eyes reaction on turn start, optional Checks API run /
19
19
  * sticky banner via {@link GitHubProgressConfig}, post assistant text on
20
20
  * `message.completed`, and a short error comment on turn/session failure.
21
21
  */
@@ -13,7 +13,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
13
13
  import { buildGitHubBinding, formatGitHubOutboundComment } from "./binding.js";
14
14
  import { applyGitHubProgress } from "./progress.js";
15
15
  /**
16
- * Built-in delivery: eyes reaction on turn start, optional commit status /
16
+ * Built-in delivery: eyes reaction on turn start, optional Checks API run /
17
17
  * sticky banner via {@link GitHubProgressConfig}, post assistant text on
18
18
  * `message.completed`, and a short error comment on turn/session failure.
19
19
  */
@@ -1 +1 @@
1
- {"version":3,"file":"github-channel.d.ts","sourceRoot":"","sources":["../../../src/channels/github/github-channel.ts"],"names":[],"mappings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C;IACzB,mEAAmE;IACnE,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAiCpB;AAQD;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,MAAM,GACjB,oBAAoB,GAAG,SAAS,CAElC;AAED,wBAAgB,aAAa,CAC3B,OAAO,GAAE,oBAAyB,GACjC,iBAAiB,CAAC,kBAAkB,CAAC,CAqGvC;AAk0BD,wEAAwE;AACxE,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,UAAU,GAAG,SAAS,EAC9B,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,OAAO,CAeT"}
1
+ {"version":3,"file":"github-channel.d.ts","sourceRoot":"","sources":["../../../src/channels/github/github-channel.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAGV,WAAW,EACX,iBAAiB,EAEjB,kBAAkB,EAGnB,MAAM,gBAAgB,CAAC;AAiBxB,OAAO,EAEL,KAAK,kBAAkB,EAExB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EACV,oBAAoB,EAKpB,aAAa,EAEb,qBAAqB,EAErB,kBAAkB,EAGlB,sBAAsB,EAMtB,kBAAkB,EAClB,UAAU,EAEX,MAAM,YAAY,CAAC;AAEpB;;;;GAIG;AACH,KAAK,mBAAmB,GAAG,IAAI,CAC7B,kBAAkB,EAClB,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,CAC3C,CAAC;AA2EF;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,mBAAmB,GAAG,WAAW,CA2BvE;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,mBAAmB,GAAG,MAAM,CAGtE;AAED,wDAAwD;AACxD,wBAAgB,gCAAgC,CAC9C,GAAG,EAAE,mBAAmB,GACvB,MAAM,CAER;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,mBAAmB,GAAG,MAAM,CAEnE;AAED,qDAAqD;AACrD,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,UAAU,CAAC,CAc5E;AAwBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH;;;;GAIG;AACH,wBAAsB,qBAAqB,CAAC,KAAK,EAAE;IACjD,OAAO,EAAE,oBAAoB,CAAC;IAC9B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,kBAAkB,CAAC;CAC1B,GAAG,OAAO,CAAC,QAAQ,CAAC,CAiGpB;AAED;;;GAGG;AACH,wBAAsB,0BAA0B,CAAC,KAAK,EAAE;IACtD,OAAO,EAAE,oBAAoB,CAAC;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,kBAAkB,CAAC;IACzB,mEAAmE;IACnE,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAiCpB;AAQD;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,MAAM,GACjB,oBAAoB,GAAG,SAAS,CAElC;AAED,wBAAgB,aAAa,CAC3B,OAAO,GAAE,oBAAyB,GACjC,iBAAiB,CAAC,kBAAkB,CAAC,CAwGvC;AAk0BD,wEAAwE;AACxE,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,UAAU,GAAG,SAAS,EAC9B,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,OAAO,CAeT"}
@@ -13,7 +13,7 @@ import { allowAll, defineChannel, localDevStrict, loopbackGitHubDev, POST, } fro
13
13
  import { isDevMode } from "../../internal/dev-mode.js";
14
14
  import { resolveCredentialValue } from "./auth.js";
15
15
  import { buildGitHubBinding, } from "./binding.js";
16
- import { createCursorAccountGithubTokenResolver, createPendingCursorGithubCredentials, parseCursorGithubRepoScope, registerGithubCursorAccountRuntime, } from "./cursor-account.js";
16
+ import { createCursorAccountGithubTokenResolver, createPendingCursorGithubCredentials, cursorGithubPermissionsForChannel, parseCursorGithubRepoScope, registerGithubCursorAccountRuntime, } from "./cursor-account.js";
17
17
  import { buildDefaultGitHubEvents } from "./defaults.js";
18
18
  import { deriveGitHubWebhookEvents, GITHUB_CHANNEL_KIND } from "./events.js";
19
19
  import { emptyGitHubChannelState, githubBindingStateForEvent, } from "./state.js";
@@ -442,7 +442,7 @@ export function githubChannel(options = {}) {
442
442
  // Normalized scope lives on the private runtime — never rewrite authored
443
443
  // `cursorAccount` on the options object the author passed in.
444
444
  const cursorScope = typeof options.cursorAccount === "object"
445
- ? parseCursorGithubRepoScope(options.cursorAccount.repos, options.cursorAccount.permissions)
445
+ ? parseCursorGithubRepoScope(options.cursorAccount.repos, cursorGithubPermissionsForChannel(options, options.cursorAccount.permissions))
446
446
  : undefined;
447
447
  let cursorCredentials;
448
448
  let credentials = options.credentials;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Opt-in PR progress surfaces: commit status + sticky banner comment.
2
+ * Opt-in PR progress surfaces: Checks API run + sticky banner comment.
3
3
  */
4
4
  import type { GitHubBindingConfig } from "./binding.js";
5
5
  import type { GitHubChannelState } from "./state.js";
@@ -10,7 +10,7 @@ export interface GitHubProgressPhaseCopy {
10
10
  failure?: string;
11
11
  }
12
12
  export interface GitHubCommitStatusProgress extends GitHubProgressPhaseCopy {
13
- /** Commit status context (unique per check in the merge box). */
13
+ /** Check run name (unique per check in the merge box). */
14
14
  context: string;
15
15
  }
16
16
  export type GitHubBannerProgress = GitHubProgressPhaseCopy;
@@ -18,9 +18,10 @@ export interface GitHubProgressConfig {
18
18
  /** When false, skip the eyes reaction on turn.started. Defaults to true. */
19
19
  reactions?: boolean;
20
20
  /**
21
- * Opt-in commit status on the PR head. Omit or `false` keeps today's
22
- * behavior (no statuses from default events). With `cursorAccount`,
23
- * needs `permissions: "contents-write"` (push-equivalent).
21
+ * Opt-in Checks API run on the PR head. Omit or `false` keeps today's
22
+ * behavior (no check from default events). With `cursorAccount`, enabling
23
+ * this opts the minted token up to `permissions: "contents-write"` so the
24
+ * hosted github-proxy lease includes `checks:write`.
24
25
  */
25
26
  commitStatus?: false | GitHubCommitStatusProgress;
26
27
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/channels/github/progress.ts"],"names":[],"mappings":"AAAA;;GAEG;AAQH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAExD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAKrD,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;AAEpE,MAAM,WAAW,uBAAuB;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,0BAA2B,SAAQ,uBAAuB;IACzE,iEAAiE;IACjE,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,oBAAoB,GAAG,uBAAuB,CAAC;AAE3D,MAAM,WAAW,oBAAoB;IACnC,4EAA4E;IAC5E,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,YAAY,CAAC,EAAE,KAAK,GAAG,0BAA0B,CAAC;IAClD;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,GAAG,oBAAoB,CAAC;CACvC;AAED,MAAM,WAAW,qBAAsB,SAAQ,mBAAmB;IAChE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,oBAAoB,CAAC;CACjC;AAED,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,oBAAoB,GAAG,SAAS,GACzC,0BAA0B,GAAG,IAAI,CAKnC;AAED,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,oBAAoB,GAAG,SAAS,GACzC,oBAAoB,GAAG,IAAI,CAK7B;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE;IAC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oBAAoB,CAAC;CACjC;AAED,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,oBAAoB,GAAG,SAAS,GACzC,0BAA0B,GAAG,IAAI,CAKnC;AAED,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,oBAAoB,GAAG,SAAS,GACzC,oBAAoB,GAAG,IAAI,CAK7B;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE;IACvC,IAAI,EAAE,uBAAuB,GAAG,SAAS,CAAC;IAC1C,KAAK,EAAE,mBAAmB,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,MAAM,CAaT;AAuBD;;;GAGG;AACH,wBAAsB,mBAAmB,CAAC,KAAK,EAAE;IAC/C,KAAK,EAAE,mBAAmB,CAAC;IAC3B,OAAO,EAAE;QAAE,KAAK,EAAE,kBAAkB,CAAA;KAAE,CAAC;IACvC,OAAO,EAAE,qBAAqB,CAAC;CAChC,GAAG,OAAO,CAAC,IAAI,CAAC,CA8BhB"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Opt-in PR progress surfaces: commit status + sticky banner comment.
2
+ * Opt-in PR progress surfaces: Checks API run + sticky banner comment.
3
3
  */
4
4
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
5
5
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
@@ -10,9 +10,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  step((generator = generator.apply(thisArg, _arguments || [])).next());
11
11
  });
12
12
  };
13
- import { createGitHubCommitStatus, createGitHubIssueComment, GitHubApiError, updateGitHubIssueComment, } from "./api.js";
13
+ import { createGitHubCheckRun, createGitHubIssueComment, GitHubApiError, updateGitHubCheckRun, updateGitHubIssueComment, } from "./api.js";
14
14
  import { formatGitHubOutboundComment } from "./binding.js";
15
- /** GitHub commit-status descriptions are capped at 140 characters. */
15
+ /** Merge-box check titles stay short; GitHub allows 1024, we clip to 140. */
16
16
  const STATUS_DESCRIPTION_MAX = 140;
17
17
  export function resolveCommitStatusProgress(progress) {
18
18
  if ((progress === null || progress === void 0 ? void 0 : progress.commitStatus) === undefined || progress.commitStatus === false) {
@@ -71,7 +71,7 @@ export function applyGitHubProgress(input) {
71
71
  }
72
72
  const tasks = [];
73
73
  if (commitStatus !== null) {
74
- tasks.push(postCommitStatus({
74
+ tasks.push(postProgressCheckRun({
75
75
  phase: input.phase,
76
76
  channel: input.channel,
77
77
  options: input.options,
@@ -90,7 +90,7 @@ export function applyGitHubProgress(input) {
90
90
  yield Promise.all(tasks);
91
91
  });
92
92
  }
93
- function postCommitStatus(input) {
93
+ function postProgressCheckRun(input) {
94
94
  return __awaiter(this, void 0, void 0, function* () {
95
95
  var _a;
96
96
  const state = input.channel.state;
@@ -100,29 +100,71 @@ function postCommitStatus(input) {
100
100
  state.headSha === "") {
101
101
  return;
102
102
  }
103
+ const sha = state.headSha;
103
104
  const description = clipStatusDescription(progressPhaseCopy({
104
105
  copy: input.commitStatus,
105
106
  phase: input.phase,
106
107
  label: progressLabel(input.options, input.commitStatus.context),
107
108
  }));
109
+ const write = Object.assign(Object.assign({ name: input.commitStatus.context }, checkRunPhaseFields(input.phase)), { output: { title: description, summary: description } });
110
+ const resource = {
111
+ api: input.options.api,
112
+ credentials: input.options.credentials,
113
+ installationId: (_a = state.installationId) !== null && _a !== void 0 ? _a : undefined,
114
+ owner: state.owner,
115
+ repo: state.repo,
116
+ };
117
+ const reuseId = state.progressCheckRunId !== null && state.progressCheckRunSha === sha
118
+ ? state.progressCheckRunId
119
+ : null;
120
+ // Completed runs cannot go back to in_progress. GitHub often 200s and
121
+ // leaves the run completed (sometimes 422). Create a new run so a later
122
+ // turn on the same SHA shows pending again.
123
+ const completedBlocksReuse = write.status === "in_progress" && state.progressCheckRunCompleted === true;
108
124
  try {
109
- yield createGitHubCommitStatus({
110
- api: input.options.api,
111
- credentials: input.options.credentials,
112
- installationId: (_a = state.installationId) !== null && _a !== void 0 ? _a : undefined,
113
- owner: state.owner,
114
- repo: state.repo,
115
- sha: state.headSha,
116
- state: input.phase,
117
- context: input.commitStatus.context,
118
- description,
119
- });
125
+ if (reuseId !== null && !completedBlocksReuse) {
126
+ try {
127
+ yield updateGitHubCheckRun(Object.assign(Object.assign(Object.assign({}, resource), write), { checkRunId: reuseId }));
128
+ state.progressCheckRunCompleted = write.status === "completed";
129
+ return;
130
+ }
131
+ catch (error) {
132
+ if (!shouldRecreateCheckRun(error, write.status)) {
133
+ return;
134
+ }
135
+ state.progressCheckRunId = null;
136
+ state.progressCheckRunSha = null;
137
+ state.progressCheckRunCompleted = false;
138
+ }
139
+ }
140
+ const created = yield createGitHubCheckRun(Object.assign(Object.assign(Object.assign({}, resource), write), { sha }));
141
+ state.progressCheckRunId = created.id;
142
+ state.progressCheckRunSha = sha;
143
+ state.progressCheckRunCompleted = write.status === "completed";
120
144
  }
121
145
  catch (_b) {
122
146
  // Soft-fail: missing token / permission is fine.
123
147
  }
124
148
  });
125
149
  }
150
+ function shouldRecreateCheckRun(error, status) {
151
+ if (!(error instanceof GitHubApiError)) {
152
+ return false;
153
+ }
154
+ if (error.status === 404) {
155
+ return true;
156
+ }
157
+ return error.status === 422 && status === "in_progress";
158
+ }
159
+ function checkRunPhaseFields(phase) {
160
+ if (phase === "pending") {
161
+ return { status: "in_progress" };
162
+ }
163
+ return {
164
+ status: "completed",
165
+ conclusion: phase === "success" ? "success" : "failure",
166
+ };
167
+ }
126
168
  function upsertBanner(input) {
127
169
  return __awaiter(this, void 0, void 0, function* () {
128
170
  var _a, _b;
@@ -11,6 +11,17 @@ export interface GitHubChannelState extends GitHubBindingState {
11
11
  headRef: string | null;
12
12
  /** Sticky progress banner comment id (issue/PR timeline). */
13
13
  progressBannerCommentId: number | null;
14
+ /** Latest Checks API run id for `progress.commitStatus`. */
15
+ progressCheckRunId: number | null;
16
+ /** Head SHA the latest check run was created against. */
17
+ progressCheckRunSha: string | null;
18
+ /**
19
+ * Whether that run is already `completed`. `null` means unknown (wake
20
+ * patches omit this so merge keeps the persisted value). GitHub rejects
21
+ * PATCH back to `in_progress`, so a later pending turn on the same SHA
22
+ * must create a new run.
23
+ */
24
+ progressCheckRunCompleted: boolean | null;
14
25
  }
15
26
  export declare function emptyGitHubChannelState(overrides?: Partial<GitHubChannelState>): GitHubChannelState;
16
27
  /** Build binding fields for an inbound conversation. */
@@ -1 +1 @@
1
- {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../src/channels/github/state.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEzD,MAAM,WAAW,kBAAmB,SAAQ,kBAAkB;IAC5D,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,6DAA6D;IAC7D,uBAAuB,EAAE,MAAM,GAAG,IAAI,CAAC;CACxC;AAED,wBAAgB,uBAAuB,CACrC,SAAS,GAAE,OAAO,CAAC,kBAAkB,CAAM,GAC1C,kBAAkB,CAoBpB;AAED,wDAAwD;AACxD,wBAAgB,0BAA0B,CAAC,KAAK,EAAE;IAChD,IAAI,EAAE,sBAAsB,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,yBAAyB,CAAC,EAAE,MAAM,CAAC;CACpC,GAAG,kBAAkB,CA6CrB"}
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../src/channels/github/state.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEzD,MAAM,WAAW,kBAAmB,SAAQ,kBAAkB;IAC5D,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,6DAA6D;IAC7D,uBAAuB,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,4DAA4D;IAC5D,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,yDAAyD;IACzD,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC;;;;;OAKG;IACH,yBAAyB,EAAE,OAAO,GAAG,IAAI,CAAC;CAC3C;AAED,wBAAgB,uBAAuB,CACrC,SAAS,GAAE,OAAO,CAAC,kBAAkB,CAAM,GAC1C,kBAAkB,CAuBpB;AAED,wDAAwD;AACxD,wBAAgB,0BAA0B,CAAC,KAAK,EAAE;IAChD,IAAI,EAAE,sBAAsB,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,yBAAyB,CAAC,EAAE,MAAM,CAAC;CACpC,GAAG,kBAAkB,CA6CrB"}
@@ -2,7 +2,7 @@
2
2
  * Durable per-session GitHub channel state.
3
3
  */
4
4
  export function emptyGitHubChannelState(overrides = {}) {
5
- return Object.assign({ conversationKind: "pull_request", installationId: null, issueNumber: null, owner: "", pullRequestNumber: null, repo: "", repositoryId: null, reviewCommentId: null, reviewThreadRootCommentId: null, triggeringCommentId: null, deliveryId: null, eventName: null, headSha: null, baseRef: null, headRef: null, progressBannerCommentId: null }, overrides);
5
+ return Object.assign({ conversationKind: "pull_request", installationId: null, issueNumber: null, owner: "", pullRequestNumber: null, repo: "", repositoryId: null, reviewCommentId: null, reviewThreadRootCommentId: null, triggeringCommentId: null, deliveryId: null, eventName: null, headSha: null, baseRef: null, headRef: null, progressBannerCommentId: null, progressCheckRunId: null, progressCheckRunSha: null, progressCheckRunCompleted: null }, overrides);
6
6
  }
7
7
  /** Build binding fields for an inbound conversation. */
8
8
  export function githubBindingStateForEvent(input) {
@@ -347,7 +347,7 @@ export interface GitHubChannelOptions {
347
347
  * Token capability tier:
348
348
  * - `"read"` — PR/issue/status read
349
349
  * - `"pr-write"` (default) — comments / PR+issue write, no `contents:write`
350
- * - `"contents-write"` — push code and create commit statuses (host-held)
350
+ * - `"contents-write"` — push code and post merge-box check runs (host-held)
351
351
  */
352
352
  permissions?: "read" | "pr-write" | "contents-write";
353
353
  };
@@ -399,12 +399,12 @@ export interface GitHubChannelOptions {
399
399
  onEvent?: GitHubEventHook;
400
400
  /**
401
401
  * Override / extend default stream-event handlers (eyes reaction, reply
402
- * posting, opt-in commit status / banner). Handlers you provide replace
402
+ * posting, opt-in check run / banner). Handlers you provide replace
403
403
  * the matching defaults.
404
404
  */
405
405
  events?: ChannelEventHandlers<GitHubChannelState>;
406
406
  /**
407
- * Acknowledgement progress surfaces. Reactions default on; commit status
407
+ * Acknowledgement progress surfaces. Reactions default on; merge-box check
408
408
  * and sticky banner are opt-in via `commitStatus` / `banner`.
409
409
  */
410
410
  progress?: GitHubProgressConfig;
@@ -9,14 +9,14 @@
9
9
  <link rel="preload stylesheet" href="/docs/assets/style.CK3hwt6q.css" as="style">
10
10
  <link rel="preload stylesheet" href="/docs/vp-icons.css" as="style">
11
11
 
12
- <script type="module" src="/docs/assets/app.fHnNXEJ6.js"></script>
12
+ <script type="module" src="/docs/assets/app.IEXEim5m.js"></script>
13
13
  <link rel="preload" href="/docs/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
14
14
  <script id="check-dark-mode">(()=>{const e=localStorage.getItem("vitepress-theme-appearance")||"auto",a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a:e==="dark")&&document.documentElement.classList.add("dark")})();</script>
15
15
  <script id="check-mac-os">document.documentElement.classList.toggle("mac",/Mac|iPhone|iPod|iPad/i.test(navigator.platform));</script>
16
16
  </head>
17
17
  <body>
18
18
  <div id="app"></div>
19
- <script>window.__VP_HASH_MAP__=JSON.parse("{\"ab.md\":\"hdxsvX5M\",\"building-with-agents.md\":\"PeZaZA1P\",\"concepts.md\":\"CqOsxbMU\",\"deployment.md\":\"Cdp4rTE4\",\"evals.md\":\"qeoGgPw0\",\"example-agents_approval-buddy.md\":\"CIiZ9coo\",\"example-agents_benny.md\":\"l7JTmm8X\",\"example-agents_bugbot.md\":\"Dp5JqHSQ\",\"example-agents_codebase-wiki.md\":\"D-lteFf0\",\"example-agents_codeowners-review.md\":\"BU2ZXLf-\",\"example-agents_concierge.md\":\"DA2al_NK\",\"example-agents_fsd.md\":\"DPz9ezO4\",\"example-agents_index.md\":\"xmJ87d_3\",\"example-agents_knowledge-base.md\":\"IneynQSR\",\"example-agents_oncall.md\":\"ZE0n6ZFN\",\"example-agents_security-reviewer.md\":\"Dkf1gyo6\",\"example-agents_slack-agent.md\":\"06jQXTAI\",\"example-agents_weather-agent.md\":\"DC3lINjo\",\"guides_agent-to-agent.md\":\"Bmbxy-FA\",\"guides_cloud-runtime.md\":\"V5igN4Sq\",\"guides_github.md\":\"DSg0j9qj\",\"guides_human-in-the-loop.md\":\"BWvT7UqY\",\"guides_mcp-oauth.md\":\"C7G7IykG\",\"guides_opentelemetry.md\":\"Csn7ZI25\",\"guides_slack.md\":\"zriQpU_9\",\"guides_webhooks.md\":\"DB-r_er9\",\"hillclimbing.md\":\"yXqdlv2R\",\"index.md\":\"COeoSkcF\",\"quickstart.md\":\"DZxBu44y\",\"reference_agent-config.md\":\"XRpxctsA\",\"reference_artifacts.md\":\"BGG4bZo-\",\"reference_channels.md\":\"MN8iDy8V\",\"reference_cli.md\":\"BDmjPPAm\",\"reference_connections.md\":\"CSQiNzre\",\"reference_hooks.md\":\"4cbRRIIu\",\"reference_http-api.md\":\"DGrw_wOu\",\"reference_instructions.md\":\"CgoV-YEb\",\"reference_playground.md\":\"CPZhfYaO\",\"reference_project-layout.md\":\"D3MdHM2z\",\"reference_prompt.md\":\"BaiweQxE\",\"reference_schedules.md\":\"gmfYzf_I\",\"reference_sessions.md\":\"DBVFi2Sx\",\"reference_skills.md\":\"B_jHN7JL\",\"reference_subagents.md\":\"DSrGLIuB\",\"reference_tools.md\":\"kJfJAP2m\",\"scaffolding-agents.md\":\"mkc3B_ZW\",\"storage.md\":\"DcGSnIxX\",\"templates_triage.md\":\"CConZt1z\",\"troubleshooting.md\":\"CkgwmVI0\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"en-US\",\"dir\":\"ltr\",\"title\":\"Agent SDK\",\"description\":\"Filesystem-first framework for building and serving Cursor agents.\",\"base\":\"/docs/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"nav\":[{\"text\":\"Quickstart\",\"link\":\"/quickstart\"},{\"text\":\"Guides\",\"link\":\"/guides/webhooks\"},{\"text\":\"Examples\",\"link\":\"/example-agents/\"},{\"text\":\"Reference\",\"link\":\"/reference/project-layout\"}],\"search\":{\"provider\":\"local\"},\"outline\":{\"level\":[2,3]},\"sidebar\":[{\"text\":\"Getting started\",\"items\":[{\"text\":\"Overview\",\"link\":\"/\"},{\"text\":\"Quickstart\",\"link\":\"/quickstart\"},{\"text\":\"Scaffold an agent with Cursor\",\"link\":\"/scaffolding-agents\"},{\"text\":\"Concepts\",\"link\":\"/concepts\"}]},{\"text\":\"Templates\",\"items\":[{\"text\":\"Triage agent\",\"link\":\"/templates/triage\"}]},{\"text\":\"Improving agents\",\"items\":[{\"text\":\"Building agents with agents\",\"link\":\"/building-with-agents\"},{\"text\":\"Evals\",\"link\":\"/evals\"},{\"text\":\"Live A/B metrics\",\"link\":\"/ab\"},{\"text\":\"Storage\",\"link\":\"/storage\"},{\"text\":\"Hillclimbing\",\"link\":\"/hillclimbing\"}]},{\"text\":\"Guides\",\"items\":[{\"text\":\"Webhooks & custom channels\",\"link\":\"/guides/webhooks\"},{\"text\":\"GitHub\",\"link\":\"/guides/github\"},{\"text\":\"Slack\",\"link\":\"/guides/slack\"},{\"text\":\"Human-in-the-loop approvals\",\"link\":\"/guides/human-in-the-loop\"},{\"text\":\"Agent-to-agent\",\"link\":\"/guides/agent-to-agent\"},{\"text\":\"Host MCP OAuth\",\"link\":\"/guides/mcp-oauth\"},{\"text\":\"Cloud runtime\",\"link\":\"/guides/cloud-runtime\"},{\"text\":\"OpenTelemetry\",\"link\":\"/guides/opentelemetry\"}]},{\"text\":\"Example agents\",\"items\":[{\"text\":\"Choose an example\",\"link\":\"/example-agents/\"},{\"text\":\"Weather agent\",\"link\":\"/example-agents/weather-agent\"},{\"text\":\"Slack agent\",\"link\":\"/example-agents/slack-agent\"},{\"text\":\"Concierge\",\"link\":\"/example-agents/concierge\"},{\"text\":\"Playbook router\",\"link\":\"/example-agents/benny\"},{\"text\":\"Alert investigator\",\"link\":\"/example-agents/oncall\"},{\"text\":\"PR evidence reviewer\",\"link\":\"/example-agents/bugbot\"},{\"text\":\"Approval Buddy\",\"link\":\"/example-agents/approval-buddy\"},{\"text\":\"Security Reviewer\",\"link\":\"/example-agents/security-reviewer\"},{\"text\":\"Remote PR coordinator\",\"link\":\"/example-agents/fsd\"},{\"text\":\"Knowledge base\",\"link\":\"/example-agents/knowledge-base\"},{\"text\":\"Codebase wiki\",\"link\":\"/example-agents/codebase-wiki\"},{\"text\":\"Codeowners review\",\"link\":\"/example-agents/codeowners-review\"}]},{\"text\":\"Operating\",\"items\":[{\"text\":\"Deployment\",\"link\":\"/deployment\"},{\"text\":\"Fix common problems\",\"link\":\"/troubleshooting\"}]},{\"text\":\"Reference\",\"collapsed\":false,\"items\":[{\"text\":\"Project layout\",\"link\":\"/reference/project-layout\"},{\"text\":\"Agent config\",\"link\":\"/reference/agent-config\"},{\"text\":\"Instructions\",\"link\":\"/reference/instructions\"},{\"text\":\"Tools\",\"link\":\"/reference/tools\"},{\"text\":\"prompt\",\"link\":\"/reference/prompt\"},{\"text\":\"Skills\",\"link\":\"/reference/skills\"},{\"text\":\"MCP Connections\",\"link\":\"/reference/connections\"},{\"text\":\"Subagents\",\"link\":\"/reference/subagents\"},{\"text\":\"Channels\",\"link\":\"/reference/channels\"},{\"text\":\"Schedules & reminders\",\"link\":\"/reference/schedules\"},{\"text\":\"Hooks\",\"link\":\"/reference/hooks\"},{\"text\":\"Artifacts\",\"link\":\"/reference/artifacts\"},{\"text\":\"Sessions & streaming\",\"link\":\"/reference/sessions\"},{\"text\":\"Playground\",\"link\":\"/reference/playground\"},{\"text\":\"CLI\",\"link\":\"/reference/cli\"},{\"text\":\"HTTP API\",\"link\":\"/reference/http-api\"}]}]},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
19
+ <script>window.__VP_HASH_MAP__=JSON.parse("{\"ab.md\":\"hdxsvX5M\",\"building-with-agents.md\":\"PeZaZA1P\",\"concepts.md\":\"CqOsxbMU\",\"deployment.md\":\"Cdp4rTE4\",\"evals.md\":\"qeoGgPw0\",\"example-agents_approval-buddy.md\":\"CIiZ9coo\",\"example-agents_benny.md\":\"l7JTmm8X\",\"example-agents_bugbot.md\":\"Dp5JqHSQ\",\"example-agents_codebase-wiki.md\":\"D-lteFf0\",\"example-agents_codeowners-review.md\":\"BU2ZXLf-\",\"example-agents_concierge.md\":\"DA2al_NK\",\"example-agents_fsd.md\":\"DPz9ezO4\",\"example-agents_index.md\":\"xmJ87d_3\",\"example-agents_knowledge-base.md\":\"IneynQSR\",\"example-agents_oncall.md\":\"ZE0n6ZFN\",\"example-agents_security-reviewer.md\":\"Dkf1gyo6\",\"example-agents_slack-agent.md\":\"06jQXTAI\",\"example-agents_weather-agent.md\":\"DC3lINjo\",\"guides_agent-to-agent.md\":\"Bmbxy-FA\",\"guides_cloud-runtime.md\":\"V5igN4Sq\",\"guides_github.md\":\"B8QKtIpw\",\"guides_human-in-the-loop.md\":\"BWvT7UqY\",\"guides_mcp-oauth.md\":\"C7G7IykG\",\"guides_opentelemetry.md\":\"Csn7ZI25\",\"guides_slack.md\":\"zriQpU_9\",\"guides_webhooks.md\":\"DB-r_er9\",\"hillclimbing.md\":\"yXqdlv2R\",\"index.md\":\"COeoSkcF\",\"quickstart.md\":\"DZxBu44y\",\"reference_agent-config.md\":\"DHkkvcEZ\",\"reference_artifacts.md\":\"BGG4bZo-\",\"reference_channels.md\":\"MN8iDy8V\",\"reference_cli.md\":\"BDmjPPAm\",\"reference_connections.md\":\"CSQiNzre\",\"reference_hooks.md\":\"DJE5DXcT\",\"reference_http-api.md\":\"DGrw_wOu\",\"reference_instructions.md\":\"CgoV-YEb\",\"reference_playground.md\":\"CPZhfYaO\",\"reference_project-layout.md\":\"D3MdHM2z\",\"reference_prompt.md\":\"BaiweQxE\",\"reference_schedules.md\":\"gmfYzf_I\",\"reference_sessions.md\":\"DBVFi2Sx\",\"reference_skills.md\":\"B_jHN7JL\",\"reference_subagents.md\":\"DSrGLIuB\",\"reference_tools.md\":\"kJfJAP2m\",\"scaffolding-agents.md\":\"mkc3B_ZW\",\"storage.md\":\"CJYd5YmN\",\"templates_triage.md\":\"CConZt1z\",\"troubleshooting.md\":\"CkgwmVI0\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"en-US\",\"dir\":\"ltr\",\"title\":\"Agent SDK\",\"description\":\"Filesystem-first framework for building and serving Cursor agents.\",\"base\":\"/docs/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"nav\":[{\"text\":\"Quickstart\",\"link\":\"/quickstart\"},{\"text\":\"Guides\",\"link\":\"/guides/webhooks\"},{\"text\":\"Examples\",\"link\":\"/example-agents/\"},{\"text\":\"Reference\",\"link\":\"/reference/project-layout\"}],\"search\":{\"provider\":\"local\"},\"outline\":{\"level\":[2,3]},\"sidebar\":[{\"text\":\"Getting started\",\"items\":[{\"text\":\"Overview\",\"link\":\"/\"},{\"text\":\"Quickstart\",\"link\":\"/quickstart\"},{\"text\":\"Scaffold an agent with Cursor\",\"link\":\"/scaffolding-agents\"},{\"text\":\"Concepts\",\"link\":\"/concepts\"}]},{\"text\":\"Templates\",\"items\":[{\"text\":\"Triage agent\",\"link\":\"/templates/triage\"}]},{\"text\":\"Improving agents\",\"items\":[{\"text\":\"Building agents with agents\",\"link\":\"/building-with-agents\"},{\"text\":\"Evals\",\"link\":\"/evals\"},{\"text\":\"Live A/B metrics\",\"link\":\"/ab\"},{\"text\":\"Storage\",\"link\":\"/storage\"},{\"text\":\"Hillclimbing\",\"link\":\"/hillclimbing\"}]},{\"text\":\"Guides\",\"items\":[{\"text\":\"Webhooks & custom channels\",\"link\":\"/guides/webhooks\"},{\"text\":\"GitHub\",\"link\":\"/guides/github\"},{\"text\":\"Slack\",\"link\":\"/guides/slack\"},{\"text\":\"Human-in-the-loop approvals\",\"link\":\"/guides/human-in-the-loop\"},{\"text\":\"Agent-to-agent\",\"link\":\"/guides/agent-to-agent\"},{\"text\":\"Host MCP OAuth\",\"link\":\"/guides/mcp-oauth\"},{\"text\":\"Cloud runtime\",\"link\":\"/guides/cloud-runtime\"},{\"text\":\"OpenTelemetry\",\"link\":\"/guides/opentelemetry\"}]},{\"text\":\"Example agents\",\"items\":[{\"text\":\"Choose an example\",\"link\":\"/example-agents/\"},{\"text\":\"Weather agent\",\"link\":\"/example-agents/weather-agent\"},{\"text\":\"Slack agent\",\"link\":\"/example-agents/slack-agent\"},{\"text\":\"Concierge\",\"link\":\"/example-agents/concierge\"},{\"text\":\"Playbook router\",\"link\":\"/example-agents/benny\"},{\"text\":\"Alert investigator\",\"link\":\"/example-agents/oncall\"},{\"text\":\"PR evidence reviewer\",\"link\":\"/example-agents/bugbot\"},{\"text\":\"Approval Buddy\",\"link\":\"/example-agents/approval-buddy\"},{\"text\":\"Security Reviewer\",\"link\":\"/example-agents/security-reviewer\"},{\"text\":\"Remote PR coordinator\",\"link\":\"/example-agents/fsd\"},{\"text\":\"Knowledge base\",\"link\":\"/example-agents/knowledge-base\"},{\"text\":\"Codebase wiki\",\"link\":\"/example-agents/codebase-wiki\"},{\"text\":\"Codeowners review\",\"link\":\"/example-agents/codeowners-review\"}]},{\"text\":\"Operating\",\"items\":[{\"text\":\"Deployment\",\"link\":\"/deployment\"},{\"text\":\"Fix common problems\",\"link\":\"/troubleshooting\"}]},{\"text\":\"Reference\",\"collapsed\":false,\"items\":[{\"text\":\"Project layout\",\"link\":\"/reference/project-layout\"},{\"text\":\"Agent config\",\"link\":\"/reference/agent-config\"},{\"text\":\"Instructions\",\"link\":\"/reference/instructions\"},{\"text\":\"Tools\",\"link\":\"/reference/tools\"},{\"text\":\"prompt\",\"link\":\"/reference/prompt\"},{\"text\":\"Skills\",\"link\":\"/reference/skills\"},{\"text\":\"MCP Connections\",\"link\":\"/reference/connections\"},{\"text\":\"Subagents\",\"link\":\"/reference/subagents\"},{\"text\":\"Channels\",\"link\":\"/reference/channels\"},{\"text\":\"Schedules & reminders\",\"link\":\"/reference/schedules\"},{\"text\":\"Hooks\",\"link\":\"/reference/hooks\"},{\"text\":\"Artifacts\",\"link\":\"/reference/artifacts\"},{\"text\":\"Sessions & streaming\",\"link\":\"/reference/sessions\"},{\"text\":\"Playground\",\"link\":\"/reference/playground\"},{\"text\":\"CLI\",\"link\":\"/reference/cli\"},{\"text\":\"HTTP API\",\"link\":\"/reference/http-api\"}]}]},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
20
20
 
21
21
  </body>
22
22
  </html>
package/dist/docs/ab.html CHANGED
@@ -9,9 +9,9 @@
9
9
  <link rel="preload stylesheet" href="/docs/assets/style.CK3hwt6q.css" as="style">
10
10
  <link rel="preload stylesheet" href="/docs/vp-icons.css" as="style">
11
11
 
12
- <script type="module" src="/docs/assets/app.fHnNXEJ6.js"></script>
12
+ <script type="module" src="/docs/assets/app.IEXEim5m.js"></script>
13
13
  <link rel="preload" href="/docs/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
14
- <link rel="modulepreload" href="/docs/assets/chunks/theme.B_5-VLe8.js">
14
+ <link rel="modulepreload" href="/docs/assets/chunks/theme.DroGdz_Q.js">
15
15
  <link rel="modulepreload" href="/docs/assets/chunks/framework.CAZyNGu9.js">
16
16
  <link rel="modulepreload" href="/docs/assets/ab.md.hdxsvX5M.lean.js">
17
17
  <script id="check-dark-mode">(()=>{const e=localStorage.getItem("vitepress-theme-appearance")||"auto",a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a:e==="dark")&&document.documentElement.classList.add("dark")})();</script>
@@ -72,7 +72,7 @@
72
72
  <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // Optional — defaults to 200. Only affects GET /v1/abs / A/Bs tab.</span></span>
73
73
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> maxPlaygroundSessions: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">500</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
74
74
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p><code>maxPlaygroundSessions</code> keeps the newest sessions in the fold. It does not prune session logs or change assignment. For export to S3, a DB, or your metrics vendor, send samples from <code>onSample</code> or declare a storage <code>abs</code> table.</p><h2 id="keep-assignments-durable" tabindex="-1">Keep assignments durable <a class="header-anchor" href="#keep-assignments-durable" aria-label="Permalink to &quot;Keep assignments durable&quot;">​</a></h2><p>The append-only <code>events.ndjson</code> stream is the source of truth. Each <code>ab.assigned</code> event persists a variant key or null skip. Built-in metrics come from the turn and tool events that follow it.</p><p>After a server restart or a parked session resumes, the live collector replays the stream to rebuild cumulative counters. Replay does not call <code>onSample</code> (or write to the storage <code>abs</code> table) for historical turns. Only a new completed or failed turn emits another sample.</p><p>The snapshot API also replays <code>derive</code> across the full stream, so custom totals match the current extractor. Changing a derive function can change historical snapshot totals. Treat metric definitions as versioned experiment code.</p><h2 id="keep-eval-traffic-separate" tabindex="-1">Keep eval traffic separate <a class="header-anchor" href="#keep-eval-traffic-separate" aria-label="Permalink to &quot;Keep eval traffic separate&quot;">​</a></h2><p>Sessions created by <code>agent-sdk eval</code> and the playground Evals runner use <code>purpose: &quot;eval&quot;</code>. They skip A/B enrollment entirely:</p><ul><li>No split function runs.</li><li>No <code>ab.assigned</code> event is recorded.</li><li>No <code>onSample</code> callback fires.</li><li>The session is omitted from <code>GET /v1/abs</code>.</li></ul><p>Ordinary chat, <code>agent-sdk run</code>, Slack, GitHub, and other channel sessions use the live purpose. You do not need <code>splitIf</code> to exclude eval traffic.</p><h2 id="know-the-boundaries" tabindex="-1">Know the boundaries <a class="header-anchor" href="#know-the-boundaries" aria-label="Permalink to &quot;Know the boundaries&quot;">​</a></h2><p><code>defineAB</code> provides sticky assignment, variant instructions, <code>session.abs</code> for tools, cumulative metrics, and local inspection. It does not provide:</p><ul><li>A test command, assertion API, or pass/fail result</li><li>Statistical significance calculations</li><li>An experiment rollout or lifecycle service</li><li>Per-variant model or runtime configuration</li><li>A built-in analytics warehouse (bring your own via <code>onSample</code> or the storage <code>abs</code> table)</li></ul><p>Use <a href="./evals.html">evals</a> to protect known behavior. Use <code>onSample</code> or a storage <code>abs</code> table when you need sample/snapshot exports beyond the session event log.</p><h2 id="what-s-next" tabindex="-1">What&#39;s next <a class="header-anchor" href="#what-s-next" aria-label="Permalink to &quot;What&#39;s next&quot;">​</a></h2><p>Continue with these pages:</p><ul><li><a href="./evals.html">Evals</a>: pass/fail regression checks on fixed inputs</li><li><a href="./hillclimbing.html">Hillclimbing</a>: improve an agent against fixed fixtures</li><li><a href="./reference/hooks.html">Hooks</a>: other event-stream consumers</li><li><a href="./reference/sessions.html">Sessions and streaming</a>: the <code>ab.assigned</code> event and durable log</li><li><a href="./reference/playground.html">Playground</a>: the A/Bs tab</li><li><a href="./reference/http-api.html">HTTP API</a>: <code>GET /v1/abs</code></li><li><a href="./../skills/ab/SKILL.html">Live A/B metrics skill</a>: have a coding agent wire an experiment</li></ul></div></div></main><footer class="VPDocFooter" data-v-d5d7ccd1 data-v-a5908b0f><!--[--><!--]--><!----><nav class="prev-next" aria-labelledby="doc-footer-aria-label" data-v-a5908b0f><span class="visually-hidden" id="doc-footer-aria-label" data-v-a5908b0f>Pager</span><div class="pager" data-v-a5908b0f><a class="VPLink link pager-link prev" href="/docs/evals.html" data-v-a5908b0f><!--[--><span class="desc" data-v-a5908b0f>Previous page</span><span class="title" data-v-a5908b0f>Evals</span><!--]--></a></div><div class="pager" data-v-a5908b0f><a class="VPLink link pager-link next" href="/docs/storage.html" data-v-a5908b0f><!--[--><span class="desc" data-v-a5908b0f>Next page</span><span class="title" data-v-a5908b0f>Storage</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><!----><!--[--><!--]--></div></div>
75
- <script>window.__VP_HASH_MAP__=JSON.parse("{\"ab.md\":\"hdxsvX5M\",\"building-with-agents.md\":\"PeZaZA1P\",\"concepts.md\":\"CqOsxbMU\",\"deployment.md\":\"Cdp4rTE4\",\"evals.md\":\"qeoGgPw0\",\"example-agents_approval-buddy.md\":\"CIiZ9coo\",\"example-agents_benny.md\":\"l7JTmm8X\",\"example-agents_bugbot.md\":\"Dp5JqHSQ\",\"example-agents_codebase-wiki.md\":\"D-lteFf0\",\"example-agents_codeowners-review.md\":\"BU2ZXLf-\",\"example-agents_concierge.md\":\"DA2al_NK\",\"example-agents_fsd.md\":\"DPz9ezO4\",\"example-agents_index.md\":\"xmJ87d_3\",\"example-agents_knowledge-base.md\":\"IneynQSR\",\"example-agents_oncall.md\":\"ZE0n6ZFN\",\"example-agents_security-reviewer.md\":\"Dkf1gyo6\",\"example-agents_slack-agent.md\":\"06jQXTAI\",\"example-agents_weather-agent.md\":\"DC3lINjo\",\"guides_agent-to-agent.md\":\"Bmbxy-FA\",\"guides_cloud-runtime.md\":\"V5igN4Sq\",\"guides_github.md\":\"DSg0j9qj\",\"guides_human-in-the-loop.md\":\"BWvT7UqY\",\"guides_mcp-oauth.md\":\"C7G7IykG\",\"guides_opentelemetry.md\":\"Csn7ZI25\",\"guides_slack.md\":\"zriQpU_9\",\"guides_webhooks.md\":\"DB-r_er9\",\"hillclimbing.md\":\"yXqdlv2R\",\"index.md\":\"COeoSkcF\",\"quickstart.md\":\"DZxBu44y\",\"reference_agent-config.md\":\"XRpxctsA\",\"reference_artifacts.md\":\"BGG4bZo-\",\"reference_channels.md\":\"MN8iDy8V\",\"reference_cli.md\":\"BDmjPPAm\",\"reference_connections.md\":\"CSQiNzre\",\"reference_hooks.md\":\"4cbRRIIu\",\"reference_http-api.md\":\"DGrw_wOu\",\"reference_instructions.md\":\"CgoV-YEb\",\"reference_playground.md\":\"CPZhfYaO\",\"reference_project-layout.md\":\"D3MdHM2z\",\"reference_prompt.md\":\"BaiweQxE\",\"reference_schedules.md\":\"gmfYzf_I\",\"reference_sessions.md\":\"DBVFi2Sx\",\"reference_skills.md\":\"B_jHN7JL\",\"reference_subagents.md\":\"DSrGLIuB\",\"reference_tools.md\":\"kJfJAP2m\",\"scaffolding-agents.md\":\"mkc3B_ZW\",\"storage.md\":\"DcGSnIxX\",\"templates_triage.md\":\"CConZt1z\",\"troubleshooting.md\":\"CkgwmVI0\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"en-US\",\"dir\":\"ltr\",\"title\":\"Agent SDK\",\"description\":\"Filesystem-first framework for building and serving Cursor agents.\",\"base\":\"/docs/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"nav\":[{\"text\":\"Quickstart\",\"link\":\"/quickstart\"},{\"text\":\"Guides\",\"link\":\"/guides/webhooks\"},{\"text\":\"Examples\",\"link\":\"/example-agents/\"},{\"text\":\"Reference\",\"link\":\"/reference/project-layout\"}],\"search\":{\"provider\":\"local\"},\"outline\":{\"level\":[2,3]},\"sidebar\":[{\"text\":\"Getting started\",\"items\":[{\"text\":\"Overview\",\"link\":\"/\"},{\"text\":\"Quickstart\",\"link\":\"/quickstart\"},{\"text\":\"Scaffold an agent with Cursor\",\"link\":\"/scaffolding-agents\"},{\"text\":\"Concepts\",\"link\":\"/concepts\"}]},{\"text\":\"Templates\",\"items\":[{\"text\":\"Triage agent\",\"link\":\"/templates/triage\"}]},{\"text\":\"Improving agents\",\"items\":[{\"text\":\"Building agents with agents\",\"link\":\"/building-with-agents\"},{\"text\":\"Evals\",\"link\":\"/evals\"},{\"text\":\"Live A/B metrics\",\"link\":\"/ab\"},{\"text\":\"Storage\",\"link\":\"/storage\"},{\"text\":\"Hillclimbing\",\"link\":\"/hillclimbing\"}]},{\"text\":\"Guides\",\"items\":[{\"text\":\"Webhooks & custom channels\",\"link\":\"/guides/webhooks\"},{\"text\":\"GitHub\",\"link\":\"/guides/github\"},{\"text\":\"Slack\",\"link\":\"/guides/slack\"},{\"text\":\"Human-in-the-loop approvals\",\"link\":\"/guides/human-in-the-loop\"},{\"text\":\"Agent-to-agent\",\"link\":\"/guides/agent-to-agent\"},{\"text\":\"Host MCP OAuth\",\"link\":\"/guides/mcp-oauth\"},{\"text\":\"Cloud runtime\",\"link\":\"/guides/cloud-runtime\"},{\"text\":\"OpenTelemetry\",\"link\":\"/guides/opentelemetry\"}]},{\"text\":\"Example agents\",\"items\":[{\"text\":\"Choose an example\",\"link\":\"/example-agents/\"},{\"text\":\"Weather agent\",\"link\":\"/example-agents/weather-agent\"},{\"text\":\"Slack agent\",\"link\":\"/example-agents/slack-agent\"},{\"text\":\"Concierge\",\"link\":\"/example-agents/concierge\"},{\"text\":\"Playbook router\",\"link\":\"/example-agents/benny\"},{\"text\":\"Alert investigator\",\"link\":\"/example-agents/oncall\"},{\"text\":\"PR evidence reviewer\",\"link\":\"/example-agents/bugbot\"},{\"text\":\"Approval Buddy\",\"link\":\"/example-agents/approval-buddy\"},{\"text\":\"Security Reviewer\",\"link\":\"/example-agents/security-reviewer\"},{\"text\":\"Remote PR coordinator\",\"link\":\"/example-agents/fsd\"},{\"text\":\"Knowledge base\",\"link\":\"/example-agents/knowledge-base\"},{\"text\":\"Codebase wiki\",\"link\":\"/example-agents/codebase-wiki\"},{\"text\":\"Codeowners review\",\"link\":\"/example-agents/codeowners-review\"}]},{\"text\":\"Operating\",\"items\":[{\"text\":\"Deployment\",\"link\":\"/deployment\"},{\"text\":\"Fix common problems\",\"link\":\"/troubleshooting\"}]},{\"text\":\"Reference\",\"collapsed\":false,\"items\":[{\"text\":\"Project layout\",\"link\":\"/reference/project-layout\"},{\"text\":\"Agent config\",\"link\":\"/reference/agent-config\"},{\"text\":\"Instructions\",\"link\":\"/reference/instructions\"},{\"text\":\"Tools\",\"link\":\"/reference/tools\"},{\"text\":\"prompt\",\"link\":\"/reference/prompt\"},{\"text\":\"Skills\",\"link\":\"/reference/skills\"},{\"text\":\"MCP Connections\",\"link\":\"/reference/connections\"},{\"text\":\"Subagents\",\"link\":\"/reference/subagents\"},{\"text\":\"Channels\",\"link\":\"/reference/channels\"},{\"text\":\"Schedules & reminders\",\"link\":\"/reference/schedules\"},{\"text\":\"Hooks\",\"link\":\"/reference/hooks\"},{\"text\":\"Artifacts\",\"link\":\"/reference/artifacts\"},{\"text\":\"Sessions & streaming\",\"link\":\"/reference/sessions\"},{\"text\":\"Playground\",\"link\":\"/reference/playground\"},{\"text\":\"CLI\",\"link\":\"/reference/cli\"},{\"text\":\"HTTP API\",\"link\":\"/reference/http-api\"}]}]},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
75
+ <script>window.__VP_HASH_MAP__=JSON.parse("{\"ab.md\":\"hdxsvX5M\",\"building-with-agents.md\":\"PeZaZA1P\",\"concepts.md\":\"CqOsxbMU\",\"deployment.md\":\"Cdp4rTE4\",\"evals.md\":\"qeoGgPw0\",\"example-agents_approval-buddy.md\":\"CIiZ9coo\",\"example-agents_benny.md\":\"l7JTmm8X\",\"example-agents_bugbot.md\":\"Dp5JqHSQ\",\"example-agents_codebase-wiki.md\":\"D-lteFf0\",\"example-agents_codeowners-review.md\":\"BU2ZXLf-\",\"example-agents_concierge.md\":\"DA2al_NK\",\"example-agents_fsd.md\":\"DPz9ezO4\",\"example-agents_index.md\":\"xmJ87d_3\",\"example-agents_knowledge-base.md\":\"IneynQSR\",\"example-agents_oncall.md\":\"ZE0n6ZFN\",\"example-agents_security-reviewer.md\":\"Dkf1gyo6\",\"example-agents_slack-agent.md\":\"06jQXTAI\",\"example-agents_weather-agent.md\":\"DC3lINjo\",\"guides_agent-to-agent.md\":\"Bmbxy-FA\",\"guides_cloud-runtime.md\":\"V5igN4Sq\",\"guides_github.md\":\"B8QKtIpw\",\"guides_human-in-the-loop.md\":\"BWvT7UqY\",\"guides_mcp-oauth.md\":\"C7G7IykG\",\"guides_opentelemetry.md\":\"Csn7ZI25\",\"guides_slack.md\":\"zriQpU_9\",\"guides_webhooks.md\":\"DB-r_er9\",\"hillclimbing.md\":\"yXqdlv2R\",\"index.md\":\"COeoSkcF\",\"quickstart.md\":\"DZxBu44y\",\"reference_agent-config.md\":\"DHkkvcEZ\",\"reference_artifacts.md\":\"BGG4bZo-\",\"reference_channels.md\":\"MN8iDy8V\",\"reference_cli.md\":\"BDmjPPAm\",\"reference_connections.md\":\"CSQiNzre\",\"reference_hooks.md\":\"DJE5DXcT\",\"reference_http-api.md\":\"DGrw_wOu\",\"reference_instructions.md\":\"CgoV-YEb\",\"reference_playground.md\":\"CPZhfYaO\",\"reference_project-layout.md\":\"D3MdHM2z\",\"reference_prompt.md\":\"BaiweQxE\",\"reference_schedules.md\":\"gmfYzf_I\",\"reference_sessions.md\":\"DBVFi2Sx\",\"reference_skills.md\":\"B_jHN7JL\",\"reference_subagents.md\":\"DSrGLIuB\",\"reference_tools.md\":\"kJfJAP2m\",\"scaffolding-agents.md\":\"mkc3B_ZW\",\"storage.md\":\"CJYd5YmN\",\"templates_triage.md\":\"CConZt1z\",\"troubleshooting.md\":\"CkgwmVI0\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"en-US\",\"dir\":\"ltr\",\"title\":\"Agent SDK\",\"description\":\"Filesystem-first framework for building and serving Cursor agents.\",\"base\":\"/docs/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"nav\":[{\"text\":\"Quickstart\",\"link\":\"/quickstart\"},{\"text\":\"Guides\",\"link\":\"/guides/webhooks\"},{\"text\":\"Examples\",\"link\":\"/example-agents/\"},{\"text\":\"Reference\",\"link\":\"/reference/project-layout\"}],\"search\":{\"provider\":\"local\"},\"outline\":{\"level\":[2,3]},\"sidebar\":[{\"text\":\"Getting started\",\"items\":[{\"text\":\"Overview\",\"link\":\"/\"},{\"text\":\"Quickstart\",\"link\":\"/quickstart\"},{\"text\":\"Scaffold an agent with Cursor\",\"link\":\"/scaffolding-agents\"},{\"text\":\"Concepts\",\"link\":\"/concepts\"}]},{\"text\":\"Templates\",\"items\":[{\"text\":\"Triage agent\",\"link\":\"/templates/triage\"}]},{\"text\":\"Improving agents\",\"items\":[{\"text\":\"Building agents with agents\",\"link\":\"/building-with-agents\"},{\"text\":\"Evals\",\"link\":\"/evals\"},{\"text\":\"Live A/B metrics\",\"link\":\"/ab\"},{\"text\":\"Storage\",\"link\":\"/storage\"},{\"text\":\"Hillclimbing\",\"link\":\"/hillclimbing\"}]},{\"text\":\"Guides\",\"items\":[{\"text\":\"Webhooks & custom channels\",\"link\":\"/guides/webhooks\"},{\"text\":\"GitHub\",\"link\":\"/guides/github\"},{\"text\":\"Slack\",\"link\":\"/guides/slack\"},{\"text\":\"Human-in-the-loop approvals\",\"link\":\"/guides/human-in-the-loop\"},{\"text\":\"Agent-to-agent\",\"link\":\"/guides/agent-to-agent\"},{\"text\":\"Host MCP OAuth\",\"link\":\"/guides/mcp-oauth\"},{\"text\":\"Cloud runtime\",\"link\":\"/guides/cloud-runtime\"},{\"text\":\"OpenTelemetry\",\"link\":\"/guides/opentelemetry\"}]},{\"text\":\"Example agents\",\"items\":[{\"text\":\"Choose an example\",\"link\":\"/example-agents/\"},{\"text\":\"Weather agent\",\"link\":\"/example-agents/weather-agent\"},{\"text\":\"Slack agent\",\"link\":\"/example-agents/slack-agent\"},{\"text\":\"Concierge\",\"link\":\"/example-agents/concierge\"},{\"text\":\"Playbook router\",\"link\":\"/example-agents/benny\"},{\"text\":\"Alert investigator\",\"link\":\"/example-agents/oncall\"},{\"text\":\"PR evidence reviewer\",\"link\":\"/example-agents/bugbot\"},{\"text\":\"Approval Buddy\",\"link\":\"/example-agents/approval-buddy\"},{\"text\":\"Security Reviewer\",\"link\":\"/example-agents/security-reviewer\"},{\"text\":\"Remote PR coordinator\",\"link\":\"/example-agents/fsd\"},{\"text\":\"Knowledge base\",\"link\":\"/example-agents/knowledge-base\"},{\"text\":\"Codebase wiki\",\"link\":\"/example-agents/codebase-wiki\"},{\"text\":\"Codeowners review\",\"link\":\"/example-agents/codeowners-review\"}]},{\"text\":\"Operating\",\"items\":[{\"text\":\"Deployment\",\"link\":\"/deployment\"},{\"text\":\"Fix common problems\",\"link\":\"/troubleshooting\"}]},{\"text\":\"Reference\",\"collapsed\":false,\"items\":[{\"text\":\"Project layout\",\"link\":\"/reference/project-layout\"},{\"text\":\"Agent config\",\"link\":\"/reference/agent-config\"},{\"text\":\"Instructions\",\"link\":\"/reference/instructions\"},{\"text\":\"Tools\",\"link\":\"/reference/tools\"},{\"text\":\"prompt\",\"link\":\"/reference/prompt\"},{\"text\":\"Skills\",\"link\":\"/reference/skills\"},{\"text\":\"MCP Connections\",\"link\":\"/reference/connections\"},{\"text\":\"Subagents\",\"link\":\"/reference/subagents\"},{\"text\":\"Channels\",\"link\":\"/reference/channels\"},{\"text\":\"Schedules & reminders\",\"link\":\"/reference/schedules\"},{\"text\":\"Hooks\",\"link\":\"/reference/hooks\"},{\"text\":\"Artifacts\",\"link\":\"/reference/artifacts\"},{\"text\":\"Sessions & streaming\",\"link\":\"/reference/sessions\"},{\"text\":\"Playground\",\"link\":\"/reference/playground\"},{\"text\":\"CLI\",\"link\":\"/reference/cli\"},{\"text\":\"HTTP API\",\"link\":\"/reference/http-api\"}]}]},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
76
76
 
77
77
  </body>
78
78
  </html>