@cursor/july 0.1.97 → 0.1.99

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 (179) hide show
  1. package/AGENTS.md +1 -1
  2. package/dist/bin/agent-serve.js +6 -7
  3. package/dist/channels/github/github-channel.d.ts.map +1 -1
  4. package/dist/channels/github/github-channel.js +16 -0
  5. package/dist/channels/origin/origin-channel.d.ts +2 -0
  6. package/dist/channels/origin/origin-channel.d.ts.map +1 -1
  7. package/dist/channels/origin/origin-channel.js +37 -4
  8. package/dist/channels/slack/defaults.d.ts.map +1 -1
  9. package/dist/channels/slack/defaults.js +76 -55
  10. package/dist/channels/slack/dispatch.d.ts.map +1 -1
  11. package/dist/channels/slack/dispatch.js +1 -1
  12. package/dist/channels/slack/live-delivery.d.ts +1 -1
  13. package/dist/channels/slack/live-delivery.d.ts.map +1 -1
  14. package/dist/channels/slack/live-delivery.js +4 -2
  15. package/dist/channels/slack/progress-delivery.d.ts +28 -0
  16. package/dist/channels/slack/progress-delivery.d.ts.map +1 -0
  17. package/dist/channels/slack/progress-delivery.js +115 -0
  18. package/dist/channels/slack/types.d.ts +9 -1
  19. package/dist/channels/slack/types.d.ts.map +1 -1
  20. package/dist/docs/404.html +2 -2
  21. package/dist/docs/ab.html +4 -4
  22. package/dist/docs/assets/{app.B3rWNYE1.js → app.BplEAZ3S.js} +1 -1
  23. package/dist/docs/assets/chunks/@localSearchIndexroot.DpuI4i7Z.js +1 -0
  24. package/dist/docs/assets/chunks/{VPLocalSearchBox.C1lhqJJR.js → VPLocalSearchBox.CHXyv4wP.js} +1 -1
  25. package/dist/docs/assets/chunks/{theme.B40_SXuv.js → theme.BTcsZmjQ.js} +2 -2
  26. package/dist/docs/assets/{reference_cli.md.RyZf5OTE.js → reference_cli.md.DfoeyvL0.js} +4 -4
  27. package/dist/docs/assets/{reference_cli.md.RyZf5OTE.lean.js → reference_cli.md.DfoeyvL0.lean.js} +1 -1
  28. package/dist/docs/assets/{reference_http-api.md.5zOAbV86.js → reference_http-api.md.BEJx9XVj.js} +1 -1
  29. package/dist/docs/assets/{reference_tools.md.B84gw9Ii.js → reference_tools.md.CvAHsdSp.js} +10 -2
  30. package/dist/docs/assets/{reference_tools.md.B84gw9Ii.lean.js → reference_tools.md.CvAHsdSp.lean.js} +1 -1
  31. package/dist/docs/building-with-agents.html +4 -4
  32. package/dist/docs/concepts.html +4 -4
  33. package/dist/docs/deployment.html +4 -4
  34. package/dist/docs/design/runtime-abstraction.md +1757 -0
  35. package/dist/docs/evals.html +4 -4
  36. package/dist/docs/guides/agent-to-agent.html +4 -4
  37. package/dist/docs/guides/cloud-runtime.html +4 -4
  38. package/dist/docs/guides/convert-automation.html +4 -4
  39. package/dist/docs/guides/github.html +4 -4
  40. package/dist/docs/guides/human-in-the-loop.html +4 -4
  41. package/dist/docs/guides/mcp-oauth.html +4 -4
  42. package/dist/docs/guides/opentelemetry.html +4 -4
  43. package/dist/docs/guides/slack.html +4 -4
  44. package/dist/docs/guides/webhooks.html +4 -4
  45. package/dist/docs/hashmap.json +1 -1
  46. package/dist/docs/hillclimbing.html +4 -4
  47. package/dist/docs/index.html +4 -4
  48. package/dist/docs/llms-full.txt +1789 -7
  49. package/dist/docs/llms.txt +1 -0
  50. package/dist/docs/quickstart.html +4 -4
  51. package/dist/docs/reference/agent-config.html +4 -4
  52. package/dist/docs/reference/artifacts.html +4 -4
  53. package/dist/docs/reference/channels.html +4 -4
  54. package/dist/docs/reference/cli.html +7 -7
  55. package/dist/docs/reference/cli.md +1 -7
  56. package/dist/docs/reference/connections.html +4 -4
  57. package/dist/docs/reference/hooks.html +4 -4
  58. package/dist/docs/reference/http-api.html +6 -6
  59. package/dist/docs/reference/http-api.md +1 -0
  60. package/dist/docs/reference/instructions.html +4 -4
  61. package/dist/docs/reference/playground.html +4 -4
  62. package/dist/docs/reference/project-layout.html +4 -4
  63. package/dist/docs/reference/prompt.html +4 -4
  64. package/dist/docs/reference/schedules.html +4 -4
  65. package/dist/docs/reference/sessions.html +4 -4
  66. package/dist/docs/reference/skills.html +4 -4
  67. package/dist/docs/reference/subagents.html +4 -4
  68. package/dist/docs/reference/tools.html +14 -6
  69. package/dist/docs/reference/tools.md +25 -0
  70. package/dist/docs/scaffolding-agents.html +4 -4
  71. package/dist/docs/storage.html +4 -4
  72. package/dist/docs/templates/agentic-owners.html +4 -4
  73. package/dist/docs/templates/agents-md.html +4 -4
  74. package/dist/docs/templates/code-wiki.html +4 -4
  75. package/dist/docs/templates/demo.html +4 -4
  76. package/dist/docs/templates/pr-autofixer.html +4 -4
  77. package/dist/docs/templates/security-help.html +4 -4
  78. package/dist/docs/templates/security-reviewer.html +4 -4
  79. package/dist/docs/templates/triage.html +4 -4
  80. package/dist/docs/troubleshooting.html +4 -4
  81. package/dist/files-backends/cursor-hosted.d.ts +3 -2
  82. package/dist/files-backends/cursor-hosted.d.ts.map +1 -1
  83. package/dist/files-backends/cursor-hosted.js +3 -2
  84. package/dist/index.d.ts +1 -0
  85. package/dist/index.d.ts.map +1 -1
  86. package/dist/index.js +1 -0
  87. package/dist/internal/as-of.d.ts +19 -0
  88. package/dist/internal/as-of.d.ts.map +1 -0
  89. package/dist/internal/as-of.js +82 -0
  90. package/dist/internal/cli-deploy.d.ts +2 -1
  91. package/dist/internal/cli-deploy.d.ts.map +1 -1
  92. package/dist/internal/cli-deploy.js +100 -5
  93. package/dist/internal/cursor-event-relay.d.ts.map +1 -1
  94. package/dist/internal/cursor-event-relay.js +5 -6
  95. package/dist/internal/framework-file-storage.d.ts +10 -16
  96. package/dist/internal/framework-file-storage.d.ts.map +1 -1
  97. package/dist/internal/framework-file-storage.js +11 -40
  98. package/dist/internal/framework-storage-selection.d.ts +13 -11
  99. package/dist/internal/framework-storage-selection.d.ts.map +1 -1
  100. package/dist/internal/framework-storage-selection.js +37 -26
  101. package/dist/internal/hosted-admission-adapter.d.ts +28 -0
  102. package/dist/internal/hosted-admission-adapter.d.ts.map +1 -0
  103. package/dist/internal/hosted-admission-adapter.js +7 -0
  104. package/dist/internal/hosted-delivery-protocol.d.ts +6 -1
  105. package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
  106. package/dist/internal/hosted-delivery-protocol.js +1 -1
  107. package/dist/internal/hosted-delivery.d.ts +15 -1
  108. package/dist/internal/hosted-delivery.d.ts.map +1 -1
  109. package/dist/internal/hosted-delivery.js +47 -21
  110. package/dist/internal/hosted-execution-diag.d.ts +11 -0
  111. package/dist/internal/hosted-execution-diag.d.ts.map +1 -1
  112. package/dist/internal/hosted-execution-diag.js +39 -2
  113. package/dist/internal/http-channel.d.ts.map +1 -1
  114. package/dist/internal/http-channel.js +4 -1
  115. package/dist/internal/null-kv-storage.d.ts +48 -0
  116. package/dist/internal/null-kv-storage.d.ts.map +1 -0
  117. package/dist/internal/null-kv-storage.js +58 -0
  118. package/dist/internal/server.d.ts +3 -0
  119. package/dist/internal/server.d.ts.map +1 -1
  120. package/dist/internal/server.js +82 -19
  121. package/dist/internal/session-engine.d.ts.map +1 -1
  122. package/dist/internal/session-engine.js +24 -4
  123. package/dist/internal/session-run-log.d.ts +120 -0
  124. package/dist/internal/session-run-log.d.ts.map +1 -0
  125. package/dist/internal/session-run-log.js +359 -0
  126. package/dist/internal/storage-coordinator.d.ts +6 -0
  127. package/dist/internal/storage-coordinator.d.ts.map +1 -1
  128. package/dist/internal/storage-coordinator.js +9 -1
  129. package/dist/internal/tool-policy.d.ts +20 -8
  130. package/dist/internal/tool-policy.d.ts.map +1 -1
  131. package/dist/internal/tool-policy.js +11 -0
  132. package/dist/playground/assets/index-D7rGZNjy.css +1 -0
  133. package/dist/playground/assets/index-jzNbJENa.js +69 -0
  134. package/dist/playground/index.html +2 -2
  135. package/dist/storage-protocol.d.ts +8 -0
  136. package/dist/storage-protocol.d.ts.map +1 -1
  137. package/dist/storage-protocol.js +8 -0
  138. package/dist/tools.d.ts +12 -2
  139. package/dist/tools.d.ts.map +1 -1
  140. package/dist/types.d.ts +25 -0
  141. package/dist/types.d.ts.map +1 -1
  142. package/docs/design/runtime-abstraction.md +1757 -0
  143. package/docs/reference/cli.md +1 -7
  144. package/docs/reference/http-api.md +1 -0
  145. package/docs/reference/tools.md +25 -0
  146. package/package.json +1 -1
  147. package/src/bin/agent-serve.ts +6 -7
  148. package/src/channels/github/github-channel.ts +17 -0
  149. package/src/channels/origin/origin-channel.ts +74 -10
  150. package/src/channels/slack/defaults.ts +91 -63
  151. package/src/channels/slack/dispatch.ts +2 -0
  152. package/src/channels/slack/live-delivery.ts +5 -3
  153. package/src/channels/slack/progress-delivery.ts +133 -0
  154. package/src/channels/slack/types.ts +9 -1
  155. package/src/files-backends/cursor-hosted.ts +3 -2
  156. package/src/index.ts +4 -0
  157. package/src/internal/as-of.ts +107 -0
  158. package/src/internal/cli-deploy.ts +128 -8
  159. package/src/internal/cursor-event-relay.ts +5 -6
  160. package/src/internal/framework-file-storage.ts +11 -45
  161. package/src/internal/framework-storage-selection.ts +41 -25
  162. package/src/internal/hosted-admission-adapter.ts +42 -0
  163. package/src/internal/hosted-delivery-protocol.ts +7 -2
  164. package/src/internal/hosted-delivery.ts +88 -36
  165. package/src/internal/hosted-execution-diag.ts +45 -0
  166. package/src/internal/http-channel.ts +8 -0
  167. package/src/internal/null-kv-storage.ts +74 -0
  168. package/src/internal/server.ts +100 -2
  169. package/src/internal/session-engine.ts +32 -1
  170. package/src/internal/session-run-log.ts +584 -0
  171. package/src/internal/storage-coordinator.ts +11 -1
  172. package/src/internal/tool-policy.ts +31 -9
  173. package/src/storage-protocol.ts +10 -0
  174. package/src/tools.ts +12 -2
  175. package/src/types.ts +25 -0
  176. package/dist/docs/assets/chunks/@localSearchIndexroot.BU9nHdnQ.js +0 -1
  177. package/dist/playground/assets/index-DrkI6y5O.js +0 -88
  178. package/dist/playground/assets/index-DzNGwm7q.css +0 -1
  179. /package/dist/docs/assets/{reference_http-api.md.5zOAbV86.lean.js → reference_http-api.md.BEJx9XVj.lean.js} +0 -0
@@ -34,6 +34,8 @@ import { deployProgressLabel, sanitizeCustomerError } from "./logs-client.js";
34
34
  import { stderrPalette } from "./terminal-style.js";
35
35
  const DEFAULT_POLL_INTERVAL_MS = 3000;
36
36
  const DEFAULT_DEPLOY_TIMEOUT_MS = 10 * 60 * 1000;
37
+ /** `--multi-tenant` HTTP deploy is Anysphere-only (team id 1). */
38
+ const MULTI_TENANT_HTTP_DEPLOY_TEAM_ID = 1;
37
39
  /**
38
40
  * Credentials → deploy client → team id. Shared by deploy commands and
39
41
  * `--prod` AX routing. Returns an exit code (error already rendered) on
@@ -135,6 +137,11 @@ export function cmdDeploy(options) {
135
137
  if (typeof ctx === "number") {
136
138
  return ctx;
137
139
  }
140
+ if (options.multiTenant === true &&
141
+ ctx.teamId !== MULTI_TENANT_HTTP_DEPLOY_TEAM_ID) {
142
+ ctx.err("--multi-tenant is not available for this team.\n");
143
+ return 1;
144
+ }
138
145
  const targets = yield resolveDeployTargets(options, ctx);
139
146
  if (typeof targets === "number") {
140
147
  return targets;
@@ -672,7 +679,10 @@ function deployOneAgentsdk(ctx, extras, args) {
672
679
  accepted = yield ctx.client.deployAgentkit(Object.assign({ teamId: ctx.teamId, slug, gitRepoUrl: args.gitRepoUrl, gitRef: args.gitRef, agentPath: args.agentPath, components: args.components, repositories: args.repositories }, (args.multiTenant ? { multiTenant: true } : {})));
673
680
  }
674
681
  catch (error) {
675
- return renderApiError(error, ctx.err);
682
+ return renderApiError(error, ctx.err, {
683
+ multiTenant: args.multiTenant,
684
+ teamId: ctx.teamId,
685
+ });
676
686
  }
677
687
  if (ctx.noWait) {
678
688
  if ((extras === null || extras === void 0 ? void 0 : extras.jsonCollect) !== undefined) {
@@ -892,6 +902,22 @@ export function cmdDeploymentStatus(slug, options) {
892
902
  if (typeof ctx === "number") {
893
903
  return ctx;
894
904
  }
905
+ // Same dispatch as `stop`: v1 409s architecture-v2 slugs, so the v2
906
+ // GET goes first. A v2 404 (missing slug, or an older backend) falls
907
+ // through to the v1 agent-serve detail.
908
+ try {
909
+ const detail = yield ctx.client.getAgentkitDeploy({
910
+ teamId: ctx.teamId,
911
+ slug,
912
+ });
913
+ renderAgentkitDeploymentStatus(ctx, detail);
914
+ return 0;
915
+ }
916
+ catch (error) {
917
+ if (!(error instanceof DeployApiError) || error.status !== 404) {
918
+ return renderApiError(error, ctx.err);
919
+ }
920
+ }
895
921
  let detail;
896
922
  try {
897
923
  detail = yield ctx.client.getDeployment({ teamId: ctx.teamId, slug });
@@ -966,6 +992,32 @@ export function cmdDeploymentStatus(slug, options) {
966
992
  return 0;
967
993
  });
968
994
  }
995
+ function renderAgentkitDeploymentStatus(ctx, detail) {
996
+ if (ctx.json) {
997
+ ctx.out(`${JSON.stringify(detail, null, 2)}\n`);
998
+ return;
999
+ }
1000
+ const lines = [
1001
+ `${detail.slug} (team ${detail.teamId})`,
1002
+ ` status: ${detail.status}`,
1003
+ ` architecture: v2`,
1004
+ ` application: ${detail.applicationId}`,
1005
+ ` release: ${detail.releaseId}`,
1006
+ ` progress: ${detail.progress}`,
1007
+ ];
1008
+ if (detail.statusMessage !== null && detail.statusMessage.trim() !== "") {
1009
+ lines.push(` step: ${detail.statusMessage}`);
1010
+ }
1011
+ if (detail.repositories !== undefined) {
1012
+ lines.push(` watching: ${detail.repositories.length === 0
1013
+ ? "(nothing)"
1014
+ : detail.repositories.join(", ")}`);
1015
+ }
1016
+ if (detail.lastError !== null && detail.lastError !== undefined) {
1017
+ lines.push(` last error: ${sanitizeCustomerError(detail.lastError)}`);
1018
+ }
1019
+ ctx.out(`${lines.join("\n")}\n`);
1020
+ }
969
1021
  // ============================================================================
970
1022
  // stop <slug>
971
1023
  // ============================================================================
@@ -1406,10 +1458,35 @@ function pollUntil(ctx, slug, terminal, fetchDetail) {
1406
1458
  }
1407
1459
  };
1408
1460
  for (;;) {
1409
- const detail = yield fetchDetail().catch((error) => {
1461
+ let detail;
1462
+ try {
1463
+ detail = yield fetchDetail();
1464
+ }
1465
+ catch (error) {
1466
+ // Capacity / rate-limit on GET is not a bake failure. The v2 accept
1467
+ // already started freeze; keep polling until the wait budget expires.
1468
+ if (isTransientDeployStatusError(error) &&
1469
+ Date.now() - startedAt < ctx.timeoutMs) {
1470
+ if (!ctx.json) {
1471
+ const elapsed = Math.round((Date.now() - startedAt) / 1000);
1472
+ const label = "Waiting for status (server busy)";
1473
+ if (tty) {
1474
+ ctx.err(`\r\x1b[2K${slug}: ${label} (${elapsed}s)`);
1475
+ sawProgress = true;
1476
+ }
1477
+ else if (label !== lastLabel) {
1478
+ ctx.err(`${slug}: ${label}\n`);
1479
+ }
1480
+ lastLabel = label;
1481
+ }
1482
+ const waitMs = transientDeployStatusWaitMs(error, ctx.pollIntervalMs);
1483
+ const remaining = ctx.timeoutMs - (Date.now() - startedAt);
1484
+ yield sleep(Math.max(0, Math.min(waitMs, remaining)));
1485
+ continue;
1486
+ }
1410
1487
  finishProgressLine();
1411
1488
  throw error;
1412
- });
1489
+ }
1413
1490
  report(detail);
1414
1491
  if (terminal.has(detail.status)) {
1415
1492
  finishProgressLine();
@@ -1424,6 +1501,19 @@ function pollUntil(ctx, slug, terminal, fetchDetail) {
1424
1501
  }
1425
1502
  });
1426
1503
  }
1504
+ /** Load-shed / rate-limit on status GET — the deploy itself may still be baking. */
1505
+ function isTransientDeployStatusError(error) {
1506
+ return (error instanceof DeployApiError &&
1507
+ (error.status === 503 || error.status === 429));
1508
+ }
1509
+ function transientDeployStatusWaitMs(error, pollIntervalMs) {
1510
+ if (error.status === 429 &&
1511
+ error.retryAfterSeconds !== undefined &&
1512
+ error.retryAfterSeconds > 0) {
1513
+ return Math.max(pollIntervalMs, error.retryAfterSeconds * 1000);
1514
+ }
1515
+ return pollIntervalMs;
1516
+ }
1427
1517
  /**
1428
1518
  * Wait until GET 404s (the delete reconciler purged the record). Treats
1429
1519
  * other errors as failures. Throws DeployApiError on timeout.
@@ -1491,12 +1581,17 @@ function deployFailureDetail(lastError) {
1491
1581
  }
1492
1582
  return `: ${sanitizeCustomerError(lastError.trim())}`;
1493
1583
  }
1494
- function renderApiError(error, err) {
1584
+ function renderApiError(error, err, context) {
1495
1585
  if (error instanceof DeployApiError) {
1496
1586
  err(`${error.message}\n`);
1497
1587
  if (error.status === 409 &&
1498
1588
  error.message.includes("application multiTenant does not match")) {
1499
- err("This slug is a Cursor-managed (multi-tenant) product. Redeploy it with --multi-tenant.\n");
1589
+ if ((context === null || context === void 0 ? void 0 : context.multiTenant) === true) {
1590
+ err("This slug is a single-tenant application. Redeploy it without --multi-tenant.\n");
1591
+ }
1592
+ else if ((context === null || context === void 0 ? void 0 : context.teamId) === MULTI_TENANT_HTTP_DEPLOY_TEAM_ID) {
1593
+ err("This slug is a Cursor-managed (multi-tenant) product. Redeploy it with --multi-tenant.\n");
1594
+ }
1500
1595
  }
1501
1596
  return 1;
1502
1597
  }
@@ -1 +1 @@
1
- {"version":3,"file":"cursor-event-relay.d.ts","sourceRoot":"","sources":["../../src/internal/cursor-event-relay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAGL,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4BAA4B;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,8EAA8E;AAC9E,MAAM,MAAM,wBAAwB,GAAG;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,KAA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  }),
367
- // Empty subscriptions drop this consumer's registration on clean stop
368
- // instead of leaving it to lapse by TTL.
369
- buildDeregistrationBody: (consumerId) => ({
370
- consumerId,
371
- subscriptions: [],
372
- }),
367
+ // No deregistration on stop: the backend only records events for a
368
+ // repo that some consumer is subscribed to, so dropping the
369
+ // registration leaves a hole in the log until the next process
370
+ // registers, and the durable offset cannot replay what was never
371
+ // written. A consumer that does not come back lapses by TTL.
373
372
  applyRegistrationResponse: (json) => {
374
373
  var _a, _b, _c;
375
374
  const result = json;
@@ -8,15 +8,16 @@
8
8
  * is browsable from the dashboard and mountable on cloud-runtime VMs;
9
9
  * - the **framework-level** store (`AGENT_SERVE_FRAMEWORK_STORE_SOURCE_ID`)
10
10
  * holds engine-owned session state — session records, event transcripts,
11
- * the continuation index, and the SDK conversation mirror — and is never
12
- * exposed to authors or models.
11
+ * hosted-execution run logs, the continuation index, and the SDK
12
+ * conversation mirror — and is never exposed to authors or models.
13
13
  *
14
14
  * This module puts framework session state on the framework store. The
15
15
  * {@link storageKeys} scheme was designed for exactly this: keys are a
16
16
  * stable versioned contract that sinks may route on, so
17
17
  * {@link composeFrameworkStorage} splits one {@link StorageConfig} by key
18
- * kind — `session` / `session-events` / `continuation` go to the framework
19
- * file store (file-shaped; the store accepts values up to 64 MiB per
18
+ * kind — `session` / `session-events` / `session-runs` / `continuation`
19
+ * go to the framework file store (file-shaped; the store accepts values
20
+ * up to 64 MiB per
20
21
  * object without chunking, versus the KV proxy's 1 MiB row cap), while
21
22
  * author `kv`, eval runs, A/B samples, and conditional writes stay on the
22
23
  * control-plane KV proxy (the dashboard reads them there, and CAS needs a
@@ -41,21 +42,14 @@ export declare function fileSinkStorageCore(sink: FileSink): FileSinkStorageCore
41
42
  * Split one storage core by key kind: framework session state to `files`,
42
43
  * everything else to `kv`. Spread over the KV backend when building the
43
44
  * full definition so its `evals` / `abs` groups (and the cursor-hosted
44
- * marker) ride along untouched; wrap the KV `cas` group with
45
- * {@link frameworkGuardedCas} rather than spreading it as-is.
45
+ * marker) ride along untouched. A KV `cas` group must not be spread as-is:
46
+ * conditional writes run on a KV database row, so one over a `session/` or
47
+ * `continuation/` key would read and write a different store than the
48
+ * routed plain core — silent split-brain. Nothing in the package CASes
49
+ * those kinds today.
46
50
  */
47
51
  export declare function composeFrameworkStorage(input: {
48
52
  kv: FileSinkStorageCore;
49
53
  files: FileSinkStorageCore;
50
54
  }): FileSinkStorageCore & Pick<StorageConfig, "listNewest">;
51
- /**
52
- * The KV backend's conditional writes, refusing framework-file keys.
53
- *
54
- * CAS runs on the KV proxy (a database row version); the plain core routes
55
- * framework session state to the file store. A future coordination path
56
- * that CASes a `session/` or `continuation/` key would otherwise read and
57
- * write a different store than the plain path — silent split-brain. Fail
58
- * loudly instead; nothing in the package CASes those kinds today.
59
- */
60
- export declare function frameworkGuardedCas(cas: NonNullable<StorageConfig["cas"]>): NonNullable<StorageConfig["cas"]>;
61
55
  //# sourceMappingURL=framework-file-storage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"framework-file-storage.d.ts","sourceRoot":"","sources":["../../src/internal/framework-file-storage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAgB,MAAM,eAAe,CAAC;AAejE;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAavD;AAED,sEAAsE;AACtE,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CACxC,IAAI,CAAC,aAAa,EAAE,KAAK,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC,CACvD,CAAC;AA0BF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,QAAQ,GAAG,mBAAmB,CAuDvE;AAcD;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE;IAC7C,EAAE,EAAE,mBAAmB,CAAC;IACxB,KAAK,EAAE,mBAAmB,CAAC;CAC5B,GAAG,mBAAmB,GAAG,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,CAe1D;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,WAAW,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,GACrC,WAAW,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CA0BnC"}
1
+ {"version":3,"file":"framework-file-storage.d.ts","sourceRoot":"","sources":["../../src/internal/framework-file-storage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAgB,MAAM,eAAe,CAAC;AAgBjE;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAavD;AAED,sEAAsE;AACtE,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CACxC,IAAI,CAAC,aAAa,EAAE,KAAK,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC,CACvD,CAAC;AA0BF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,QAAQ,GAAG,mBAAmB,CAuDvE;AAcD;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE;IAC7C,EAAE,EAAE,mBAAmB,CAAC;IACxB,KAAK,EAAE,mBAAmB,CAAC;CAC5B,GAAG,mBAAmB,GAAG,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,CAe1D"}
@@ -8,15 +8,16 @@
8
8
  * is browsable from the dashboard and mountable on cloud-runtime VMs;
9
9
  * - the **framework-level** store (`AGENT_SERVE_FRAMEWORK_STORE_SOURCE_ID`)
10
10
  * holds engine-owned session state — session records, event transcripts,
11
- * the continuation index, and the SDK conversation mirror — and is never
12
- * exposed to authors or models.
11
+ * hosted-execution run logs, the continuation index, and the SDK
12
+ * conversation mirror — and is never exposed to authors or models.
13
13
  *
14
14
  * This module puts framework session state on the framework store. The
15
15
  * {@link storageKeys} scheme was designed for exactly this: keys are a
16
16
  * stable versioned contract that sinks may route on, so
17
17
  * {@link composeFrameworkStorage} splits one {@link StorageConfig} by key
18
- * kind — `session` / `session-events` / `continuation` go to the framework
19
- * file store (file-shaped; the store accepts values up to 64 MiB per
18
+ * kind — `session` / `session-events` / `session-runs` / `continuation`
19
+ * go to the framework file store (file-shaped; the store accepts values
20
+ * up to 64 MiB per
20
21
  * object without chunking, versus the KV proxy's 1 MiB row cap), while
21
22
  * author `kv`, eval runs, A/B samples, and conditional writes stay on the
22
23
  * control-plane KV proxy (the dashboard reads them there, and CAS needs a
@@ -44,6 +45,7 @@ import { mapBounded } from "./bounded.js";
44
45
  const FRAMEWORK_FILE_KINDS = new Set([
45
46
  "session",
46
47
  "session-events",
48
+ "session-runs",
47
49
  "continuation",
48
50
  ]);
49
51
  /**
@@ -156,8 +158,11 @@ function decodeDocument(key, bytes) {
156
158
  * Split one storage core by key kind: framework session state to `files`,
157
159
  * everything else to `kv`. Spread over the KV backend when building the
158
160
  * full definition so its `evals` / `abs` groups (and the cursor-hosted
159
- * marker) ride along untouched; wrap the KV `cas` group with
160
- * {@link frameworkGuardedCas} rather than spreading it as-is.
161
+ * marker) ride along untouched. A KV `cas` group must not be spread as-is:
162
+ * conditional writes run on a KV database row, so one over a `session/` or
163
+ * `continuation/` key would read and write a different store than the
164
+ * routed plain core — silent split-brain. Nothing in the package CASes
165
+ * those kinds today.
161
166
  */
162
167
  export function composeFrameworkStorage(input) {
163
168
  const route = (key) => isFrameworkFileKey(key) ? input.files : input.kv;
@@ -174,37 +179,3 @@ export function composeFrameworkStorage(input) {
174
179
  listNewest: undefined,
175
180
  };
176
181
  }
177
- /**
178
- * The KV backend's conditional writes, refusing framework-file keys.
179
- *
180
- * CAS runs on the KV proxy (a database row version); the plain core routes
181
- * framework session state to the file store. A future coordination path
182
- * that CASes a `session/` or `continuation/` key would otherwise read and
183
- * write a different store than the plain path — silent split-brain. Fail
184
- * loudly instead; nothing in the package CASes those kinds today.
185
- */
186
- export function frameworkGuardedCas(cas) {
187
- const refuse = (key) => {
188
- if (isFrameworkFileKey(key)) {
189
- throw new Error(`framework file storage: conditional writes are KV-only, but "${key}" routes to the framework file store`);
190
- }
191
- };
192
- return {
193
- getWithVersion: (key, ctx) => {
194
- refuse(key);
195
- return cas.getWithVersion(key, ctx);
196
- },
197
- putIfAbsent: (key, value, ctx) => {
198
- refuse(key);
199
- return cas.putIfAbsent(key, value, ctx);
200
- },
201
- putIfVersion: (key, value, expectedVersion, ctx) => {
202
- refuse(key);
203
- return cas.putIfVersion(key, value, expectedVersion, ctx);
204
- },
205
- listKeys: (prefix, ctx) => {
206
- refuse(prefix);
207
- return cas.listKeys(prefix, ctx);
208
- },
209
- };
210
- }
@@ -17,17 +17,19 @@
17
17
  *
18
18
  * - **Cursor-managed hosting** (the deployment-generation environment
19
19
  * variable is set, same signal that registers `GET /v1/manifest`):
20
- * the Cursor-hosted backend. When the deployment carries a
21
- * **framework-level file store**
22
- * (`AGENT_SERVE_FRAMEWORK_STORE_SOURCE_ID`), session records, event
23
- * transcripts, and the continuation index live there — file-shaped state
24
- * on file storage, apart from the author-facing user store while
25
- * `host.kv`, eval runs, A/B samples, and conditional writes stay on the
26
- * control-plane KV proxy (see framework-file-storage.ts). Without one
27
- * (a deploy predating framework-store provisioning), everything goes to
28
- * the KV proxy as before. The API key resolves through the full
29
- * credential chain on every call because hosted freeze snapshots listen
30
- * unsigned and the binder drops the key file after restore.
20
+ * the deployment's **framework-level file store**
21
+ * (`AGENT_SERVE_FRAMEWORK_STORE_SOURCE_ID`) holds session records, event
22
+ * transcripts, and the continuation index — file-shaped state on file
23
+ * storage, apart from the author-facing user store. The control-plane KV
24
+ * proxy is *not* used: it authorizes by mapping a pod service account to
25
+ * a v1 deployment row, which no v2 deployment has, so every call 403s and
26
+ * fails the delivery that read it. The KV half is inert until the proxy
27
+ * resolves v2 deployments (see null-kv-storage.ts). Without a framework
28
+ * store (a deploy predating framework-store provisioning) there is
29
+ * nothing left to mirror to, so the state root is again the only copy.
30
+ * The API key resolves through the full credential chain on every call
31
+ * because hosted freeze snapshots listen unsigned and the binder drops
32
+ * the key file after restore.
31
33
  * - **Self-hosted**: no mirror. `--state-root` is the durable copy, which
32
34
  * is correct when the operator owns the disk.
33
35
  *
@@ -1 +1 @@
1
- {"version":3,"file":"framework-storage-selection.d.ts","sourceRoot":"","sources":["../../src/internal/framework-storage-selection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAMH,OAAO,EAAiB,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AASrD,MAAM,WAAW,8BAA8B;IAC7C,2FAA2F;IAC3F,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,GAAG,SAAS,CAAC;IACjD,0DAA0D;IAC1D,QAAQ,CAAC,YAAY,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAC;IACtD,iEAAiE;IACjE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;CACnD;AAED;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,8BAA8B,GACpC,iBAAiB,GAAG,SAAS,CAoD/B"}
1
+ {"version":3,"file":"framework-storage-selection.d.ts","sourceRoot":"","sources":["../../src/internal/framework-storage-selection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAMH,OAAO,EAAiB,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAWrD,MAAM,WAAW,8BAA8B;IAC7C,2FAA2F;IAC3F,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,GAAG,SAAS,CAAC;IACjD,0DAA0D;IAC1D,QAAQ,CAAC,YAAY,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAC;IACtD,iEAAiE;IACjE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;CACnD;AAED;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,8BAA8B,GACpC,iBAAiB,GAAG,SAAS,CAgE/B"}
@@ -17,17 +17,19 @@
17
17
  *
18
18
  * - **Cursor-managed hosting** (the deployment-generation environment
19
19
  * variable is set, same signal that registers `GET /v1/manifest`):
20
- * the Cursor-hosted backend. When the deployment carries a
21
- * **framework-level file store**
22
- * (`AGENT_SERVE_FRAMEWORK_STORE_SOURCE_ID`), session records, event
23
- * transcripts, and the continuation index live there — file-shaped state
24
- * on file storage, apart from the author-facing user store while
25
- * `host.kv`, eval runs, A/B samples, and conditional writes stay on the
26
- * control-plane KV proxy (see framework-file-storage.ts). Without one
27
- * (a deploy predating framework-store provisioning), everything goes to
28
- * the KV proxy as before. The API key resolves through the full
29
- * credential chain on every call because hosted freeze snapshots listen
30
- * unsigned and the binder drops the key file after restore.
20
+ * the deployment's **framework-level file store**
21
+ * (`AGENT_SERVE_FRAMEWORK_STORE_SOURCE_ID`) holds session records, event
22
+ * transcripts, and the continuation index — file-shaped state on file
23
+ * storage, apart from the author-facing user store. The control-plane KV
24
+ * proxy is *not* used: it authorizes by mapping a pod service account to
25
+ * a v1 deployment row, which no v2 deployment has, so every call 403s and
26
+ * fails the delivery that read it. The KV half is inert until the proxy
27
+ * resolves v2 deployments (see null-kv-storage.ts). Without a framework
28
+ * store (a deploy predating framework-store provisioning) there is
29
+ * nothing left to mirror to, so the state root is again the only copy.
30
+ * The API key resolves through the full credential chain on every call
31
+ * because hosted freeze snapshots listen unsigned and the binder drops
32
+ * the key file after restore.
31
33
  * - **Self-hosted**: no mirror. `--state-root` is the durable copy, which
32
34
  * is correct when the operator owns the disk.
33
35
  *
@@ -41,10 +43,12 @@
41
43
  */
42
44
  import { cursorFrameworkStoreSourceId, cursorHostedFiles, } from "../files-backends/cursor-hosted.js";
43
45
  import { defineStorage } from "../storage.js";
44
- import { cursorHostedStorage } from "../storage-backends/cursor-hosted.js";
46
+ import { CURSOR_HOSTED_STORAGE } from "../storage-backends/cursor-hosted.js";
45
47
  import { resolveApiKeySync } from "./cursor/credentials.js";
46
48
  import { AGENT_SERVE_GENERATION_ENV_VAR } from "./cursor-relay-core.js";
47
- import { composeFrameworkStorage, fileSinkStorageCore, frameworkGuardedCas, } from "./framework-file-storage.js";
49
+ import { composeFrameworkStorage, fileSinkStorageCore, } from "./framework-file-storage.js";
50
+ import { nullKvStorage } from "./null-kv-storage.js";
51
+ const cursorHostedMarker = { [CURSOR_HOSTED_STORAGE]: true };
48
52
  /**
49
53
  * Pick the backend for framework session state.
50
54
  *
@@ -74,23 +78,30 @@ export function selectFrameworkStorageDefinition(input) {
74
78
  // comes up). Follow-ups restore lazily by continuation or session id;
75
79
  // GET /v1/sessions lists from the sink either way.
76
80
  const policy = { restore: "off" };
81
+ const frameworkStoreId = cursorFrameworkStoreSourceId(env);
82
+ if (frameworkStoreId === undefined) {
83
+ // Nothing to mirror to: the KV proxy rejects v2 service accounts, so a
84
+ // definition over it would fail every delivery that reads it. The state
85
+ // root is the durable copy, as when self-hosted.
86
+ return undefined;
87
+ }
77
88
  // Full chain (env → key file → stored login): frozen engines listen
78
89
  // unsigned and bind CURSOR_API_KEY_FILE at task time, after this
79
90
  // definition is constructed.
80
91
  const resolveApiKey = () => { var _a; return (_a = resolveApiKeySync()) === null || _a === void 0 ? void 0 : _a.apiKey; };
81
- const kv = cursorHostedStorage({ resolveApiKey });
82
- const frameworkStoreId = cursorFrameworkStoreSourceId(env);
83
- if (frameworkStoreId === undefined) {
84
- return defineStorage(Object.assign({ name: "cursor-hosted", policy }, kv));
85
- }
86
- // Framework session state on the framework-level file store; author kv,
87
- // evals, and A/B tables stay on the KV proxy (spread from `kv`, which
88
- // also carries the cursor-hosted marker for GET /v1/sessions).
89
- return defineStorage(Object.assign(Object.assign(Object.assign({ name: "cursor-hosted (framework files)", policy }, kv), composeFrameworkStorage({
92
+ // Framework session state on the framework-level file store, which
93
+ // authorizes by store source id and so works for v2. Everything the KV
94
+ // proxy used to serve — author kv, eval runs, A/B samples, conditional
95
+ // writes — is inert; `defineStorage` derives the eval/A/B tables over the
96
+ // core, which means that bookkeeping reads back empty rather than 403ing.
97
+ //
98
+ // Restoring `cursorHostedStorage()` here once the proxy resolves v2
99
+ // deployments also means restoring the guard its `cas` group needs: a
100
+ // conditional write over a `session/` or `continuation/` key would run on
101
+ // the KV database while the plain core routes that key to the file store.
102
+ const kv = nullKvStorage();
103
+ return defineStorage(Object.assign(Object.assign(Object.assign({ name: "cursor-hosted (framework files)", policy }, cursorHostedMarker), kv), composeFrameworkStorage({
90
104
  kv,
91
105
  files: fileSinkStorageCore(cursorHostedFiles({ storeSourceId: frameworkStoreId, resolveApiKey })),
92
- })), {
93
- // CAS stays on the KV proxy but must refuse framework-file keys, or a
94
- // future coordination path would split-brain against the plain core.
95
- cas: frameworkGuardedCas(kv.cas) }));
106
+ })));
96
107
  }
@@ -0,0 +1,28 @@
1
+ import type { ChannelHandlerArgs } from "../types.js";
2
+ /**
3
+ * Hosted-admission hook a channel pack attaches to its definition.
4
+ *
5
+ * Hosted delivery looks this up from the mounted definition — it does not
6
+ * switch on `channelKind`. A new forge implements `dispatch` / `getOutcome`
7
+ * next to its webhook handler and calls {@link attachHostedAdmissionAdapter}
8
+ * from the channel constructor.
9
+ */
10
+ export type HostedAdmissionDispatchOutcome = "skip" | "task";
11
+ export type HostedAdmissionAdapter = {
12
+ kind: string;
13
+ /**
14
+ * Optional wrap of the capturing `send` / `waitUntil` args (GitHub uses
15
+ * this to propagate background-task errors). Identity when omitted.
16
+ */
17
+ prepareArgs?(args: ChannelHandlerArgs): ChannelHandlerArgs;
18
+ dispatch(input: {
19
+ eventType: string;
20
+ payload: unknown;
21
+ deliveryId: string;
22
+ args: ChannelHandlerArgs;
23
+ }): Promise<Response>;
24
+ getOutcome(response: Response): HostedAdmissionDispatchOutcome | undefined;
25
+ };
26
+ export declare function attachHostedAdmissionAdapter(definition: object, adapter: HostedAdmissionAdapter): void;
27
+ export declare function getHostedAdmissionAdapter(definition: object): HostedAdmissionAdapter | undefined;
28
+ //# sourceMappingURL=hosted-admission-adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hosted-admission-adapter.d.ts","sourceRoot":"","sources":["../../src/internal/hosted-admission-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEtD;;;;;;;GAOG;AACH,MAAM,MAAM,8BAA8B,GAAG,MAAM,GAAG,MAAM,CAAC;AAE7D,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,WAAW,CAAC,CAAC,IAAI,EAAE,kBAAkB,GAAG,kBAAkB,CAAC;IAC3D,QAAQ,CAAC,KAAK,EAAE;QACd,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,OAAO,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;QACnB,IAAI,EAAE,kBAAkB,CAAC;KAC1B,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IACtB,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,8BAA8B,GAAG,SAAS,CAAC;CAC5E,CAAC;AAIF,wBAAgB,4BAA4B,CAC1C,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,sBAAsB,GAC9B,IAAI,CAEN;AAED,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,MAAM,GACjB,sBAAsB,GAAG,SAAS,CAEpC"}
@@ -0,0 +1,7 @@
1
+ const adapters = new WeakMap();
2
+ export function attachHostedAdmissionAdapter(definition, adapter) {
3
+ adapters.set(definition, adapter);
4
+ }
5
+ export function getHostedAdmissionAdapter(definition) {
6
+ return adapters.get(definition);
7
+ }
@@ -16,7 +16,12 @@ export type HostedAdmissionManagedAutomation = {
16
16
  export type HostedAdmission = {
17
17
  v: 2;
18
18
  channelId: string;
19
- channelKind: "github";
19
+ /**
20
+ * Mailbox / subscription channel kind (`github`, `origin`, …). The guest
21
+ * resolves dispatch from the mounted definition's hosted-admission
22
+ * adapter; this field is not an allowlist.
23
+ */
24
+ channelKind: string;
20
25
  eventType: string;
21
26
  deliveryId: string;
22
27
  sessionMode: "event" | "continuation";
@@ -1 +1 @@
1
- {"version":3,"file":"hosted-delivery-protocol.d.ts","sourceRoot":"","sources":["../../src/internal/hosted-delivery-protocol.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gCAAgC,IAAI,CAAC;AAClD,eAAO,MAAM,sBAAsB,gCAAgC,CAAC;AACpE,eAAO,MAAM,qBAAqB,kCAAkC,CAAC;AACrE,eAAO,MAAM,qBAAqB,kCAAkC,CAAC;AACrE;;;;;GAKG;AACH,eAAO,MAAM,8BAA8B,0BAA0B,CAAC;AAEtE,MAAM,MAAM,gCAAgC,GAAG;IAC7C,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,CAAC,EAAE,CAAC,CAAC;IACL,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,QAAQ,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,OAAO,GAAG,cAAc,CAAC;IACtC,sBAAsB,EAAE,MAAM,CAAC;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,iBAAiB,CAAC,EAAE,gCAAgC,CAAC;CACtD,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAC9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C,CAAC;IACL,SAAS,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,OAAO,GAAG,cAAc,CAAC;IACtC,sBAAsB,EAAE,MAAM,CAAC;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,iBAAiB,CAAC,EAAE,gCAAgC,CAAC;CACtD,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAC9B;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,CAAC,EAAE,CAAC,CAAC;IAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,GAC5C;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,CAAC,EAAE,CAAC,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhE,MAAM,MAAM,eAAe,GAAG;IAC5B,CAAC,EAAE,CAAC,CAAC;IACL,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,EAAE,EAAE,IAAI,CAAC;IACT,CAAC,EAAE,CAAC,CAAC;IACL,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAsDF,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,OAAO,GACb,eAAe,GAAG,SAAS,CAuB7B;AAED,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,OAAO,GACb,eAAe,GAAG,SAAS,CAe7B;AAED,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,OAAO,GACb,sBAAsB,GAAG,SAAS,CAkBpC"}
@@ -63,7 +63,7 @@ export function parseHostedAdmission(value) {
63
63
  !Object.hasOwn(body, "payload") ||
64
64
  body.v !== HOSTED_DELIVERY_PROTOCOL_VERSION ||
65
65
  !boundedString(body.channelId, 128) ||
66
- body.channelKind !== "github" ||
66
+ !boundedString(body.channelKind, 128) ||
67
67
  !boundedString(body.eventType, 128) ||
68
68
  !boundedString(body.deliveryId, 256) ||
69
69
  (body.sessionMode !== "event" && body.sessionMode !== "continuation") ||
@@ -1,6 +1,8 @@
1
1
  import type { ChannelHandlerArgs, SendMessageOptions } from "../types.js";
2
2
  import { type HostedAdmission } from "./hosted-delivery-protocol.js";
3
+ import type { LogRingEntry } from "./log-ring.js";
3
4
  import type { Router } from "./router.js";
5
+ import { type SessionRunExecutionWrite } from "./session-run-log.js";
4
6
  type DispatchInput = {
5
7
  delivery: HostedAdmission;
6
8
  definition: object;
@@ -17,11 +19,14 @@ type AdmissionDispatch = {
17
19
  pendingSend?: PendingSend;
18
20
  };
19
21
  /**
20
- * Run authored admission without creating a framework session. V1 GitHub
22
+ * Run authored admission without creating a framework session. Authored
21
23
  * `task` callbacks execute as sessionless work; the first `send` is captured
22
24
  * and executed only after the control plane allocates `ses_…`. Capturing
23
25
  * does not terminate the caller — `send` returns an inert deferred handle so
24
26
  * a task body runs to completion before the admission response is computed.
27
+ *
28
+ * Dispatch is the adapter the mounted channel attached. Hosted delivery
29
+ * does not switch on `channelKind`.
25
30
  */
26
31
  export declare function dispatchHostedAdmission(input: DispatchInput): Promise<AdmissionDispatch>;
27
32
  export declare function registerHostedDeliveryRoute(input: {
@@ -45,6 +50,15 @@ export declare function registerHostedDeliveryRoute(input: {
45
50
  * `hosted-execution.json` from that path after the POST returns.
46
51
  */
47
52
  stateRoot?: string;
53
+ /**
54
+ * Upsert this execution into the v2 session-level framework-store log.
55
+ * Called for the pre-turn `running` claim and every terminal outcome so
56
+ * a dead Node process still leaves a leftover. Soft-fail inside the
57
+ * store; this path still awaits so a parked pod cannot shed the write.
58
+ */
59
+ persistSessionRun?(write: SessionRunExecutionWrite): Promise<void>;
60
+ /** Snapshot of the process log ring at persist time. */
61
+ snapshotLogs?(): LogRingEntry[];
48
62
  }): void;
49
63
  export {};
50
64
  //# sourceMappingURL=h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