@cursor/july 0.1.51 → 0.1.53

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 (119) hide show
  1. package/AGENTS.md +1 -0
  2. package/README.md +4 -2
  3. package/dist/bin/agent-serve.js +2 -0
  4. package/dist/channels/slack/init.d.ts +16 -3
  5. package/dist/channels/slack/init.d.ts.map +1 -1
  6. package/dist/channels/slack/init.js +92 -18
  7. package/dist/channels/slack/manifest.d.ts +8 -0
  8. package/dist/channels/slack/manifest.d.ts.map +1 -1
  9. package/dist/channels/slack/manifest.js +17 -0
  10. package/dist/channels/slack/setup.d.ts +26 -1
  11. package/dist/channels/slack/setup.d.ts.map +1 -1
  12. package/dist/channels/slack/setup.js +107 -25
  13. package/dist/docs/404.html +3 -3
  14. package/dist/docs/ab.html +6 -6
  15. package/dist/docs/assets/{app.C51TX1Bw.js → app.DAKcDclS.js} +1 -1
  16. package/dist/docs/assets/chunks/@localSearchIndexroot.C4uxzYEU.js +1 -0
  17. package/dist/docs/assets/chunks/{VPLocalSearchBox.BB9HCJPq.js → VPLocalSearchBox.BNIaCSfG.js} +2 -2
  18. package/dist/docs/assets/chunks/{theme.Dp-0SZcu.js → theme.B47GzJjc.js} +2 -2
  19. package/dist/docs/assets/{guides_slack.md.D2nTRu9M.js → guides_slack.md.DP4H75WP.js} +8 -6
  20. package/dist/docs/assets/guides_slack.md.DP4H75WP.lean.js +1 -0
  21. package/dist/docs/assets/{reference_cli.md.CGKfz_Yj.js → reference_cli.md.-V6J7Cl8.js} +7 -3
  22. package/dist/docs/assets/{reference_cli.md.CGKfz_Yj.lean.js → reference_cli.md.-V6J7Cl8.lean.js} +1 -1
  23. package/dist/docs/assets/{style.CK3hwt6q.css → style.kTsvp4pE.css} +1 -1
  24. package/dist/docs/assets/{troubleshooting.md.C6n3wCr6.js → troubleshooting.md.CuVztCKs.js} +1 -1
  25. package/dist/docs/building-with-agents.html +6 -6
  26. package/dist/docs/concepts.html +6 -6
  27. package/dist/docs/deployment.html +6 -6
  28. package/dist/docs/evals.html +6 -6
  29. package/dist/docs/example-agents/approval-buddy.html +6 -6
  30. package/dist/docs/example-agents/benny.html +6 -6
  31. package/dist/docs/example-agents/bugbot.html +6 -6
  32. package/dist/docs/example-agents/codebase-wiki.html +6 -6
  33. package/dist/docs/example-agents/codeowners-review.html +6 -6
  34. package/dist/docs/example-agents/concierge.html +6 -6
  35. package/dist/docs/example-agents/fsd.html +6 -6
  36. package/dist/docs/example-agents/index.html +6 -6
  37. package/dist/docs/example-agents/knowledge-base.html +6 -6
  38. package/dist/docs/example-agents/oncall.html +6 -6
  39. package/dist/docs/example-agents/security-reviewer.html +6 -6
  40. package/dist/docs/example-agents/slack-agent.html +6 -6
  41. package/dist/docs/example-agents/weather-agent.html +6 -6
  42. package/dist/docs/guides/agent-to-agent.html +6 -6
  43. package/dist/docs/guides/cloud-runtime.html +6 -6
  44. package/dist/docs/guides/github.html +6 -6
  45. package/dist/docs/guides/human-in-the-loop.html +6 -6
  46. package/dist/docs/guides/mcp-oauth.html +6 -6
  47. package/dist/docs/guides/opentelemetry.html +6 -6
  48. package/dist/docs/guides/slack.html +14 -12
  49. package/dist/docs/guides/webhooks.html +6 -6
  50. package/dist/docs/hashmap.json +1 -1
  51. package/dist/docs/hillclimbing.html +6 -6
  52. package/dist/docs/index.html +6 -6
  53. package/dist/docs/quickstart.html +6 -6
  54. package/dist/docs/reference/agent-config.html +6 -6
  55. package/dist/docs/reference/artifacts.html +6 -6
  56. package/dist/docs/reference/channels.html +6 -6
  57. package/dist/docs/reference/cli.html +13 -9
  58. package/dist/docs/reference/connections.html +6 -6
  59. package/dist/docs/reference/hooks.html +6 -6
  60. package/dist/docs/reference/http-api.html +6 -6
  61. package/dist/docs/reference/instructions.html +6 -6
  62. package/dist/docs/reference/playground.html +5 -5
  63. package/dist/docs/reference/project-layout.html +6 -6
  64. package/dist/docs/reference/prompt.html +6 -6
  65. package/dist/docs/reference/schedules.html +6 -6
  66. package/dist/docs/reference/sessions.html +6 -6
  67. package/dist/docs/reference/skills.html +6 -6
  68. package/dist/docs/reference/subagents.html +6 -6
  69. package/dist/docs/reference/tools.html +6 -6
  70. package/dist/docs/scaffolding-agents.html +5 -5
  71. package/dist/docs/storage.html +6 -6
  72. package/dist/docs/templates/triage.html +6 -6
  73. package/dist/docs/troubleshooting.html +6 -6
  74. package/dist/internal/cli-deploy.d.ts.map +1 -1
  75. package/dist/internal/cli-deploy.js +8 -18
  76. package/dist/internal/cli-slack-manual.d.ts +20 -0
  77. package/dist/internal/cli-slack-manual.d.ts.map +1 -0
  78. package/dist/internal/cli-slack-manual.js +106 -0
  79. package/dist/internal/cli-slack.d.ts +5 -2
  80. package/dist/internal/cli-slack.d.ts.map +1 -1
  81. package/dist/internal/cli-slack.js +18 -69
  82. package/dist/internal/deploy-client.d.ts +7 -10
  83. package/dist/internal/deploy-client.d.ts.map +1 -1
  84. package/dist/internal/deploy-client.js +1 -3
  85. package/dist/internal/deploy-source.d.ts +1 -1
  86. package/dist/internal/deploy-source.js +1 -1
  87. package/dist/internal/event-log.d.ts +37 -17
  88. package/dist/internal/event-log.d.ts.map +1 -1
  89. package/dist/internal/event-log.js +189 -55
  90. package/dist/internal/process-memory-telemetry.d.ts +3 -4
  91. package/dist/internal/process-memory-telemetry.d.ts.map +1 -1
  92. package/dist/internal/process-memory-telemetry.js +4 -17
  93. package/dist/internal/session-engine.d.ts.map +1 -1
  94. package/dist/internal/session-engine.js +2 -2
  95. package/dist/playground/assets/{index-BKMz70wx.js → index-BHAPd9KT.js} +31 -31
  96. package/dist/playground/assets/index-DpKH0HcT.css +1 -0
  97. package/dist/playground/index.html +2 -2
  98. package/docs/guides/slack.md +52 -7
  99. package/docs/reference/cli.md +29 -6
  100. package/docs/troubleshooting.md +1 -1
  101. package/package.json +1 -1
  102. package/skills/create-agent/SKILL.md +1 -0
  103. package/skills/setup-slack/SKILL.md +99 -7
  104. package/src/bin/agent-serve.ts +2 -0
  105. package/src/channels/slack/init.ts +130 -20
  106. package/src/channels/slack/manifest.ts +27 -0
  107. package/src/channels/slack/setup.ts +124 -23
  108. package/src/internal/cli-deploy.ts +8 -22
  109. package/src/internal/cli-slack-manual.ts +127 -0
  110. package/src/internal/cli-slack.ts +18 -70
  111. package/src/internal/deploy-client.ts +8 -13
  112. package/src/internal/deploy-source.ts +1 -1
  113. package/src/internal/event-log.ts +167 -52
  114. package/src/internal/process-memory-telemetry.ts +5 -24
  115. package/src/internal/session-engine.ts +4 -2
  116. package/dist/docs/assets/chunks/@localSearchIndexroot.D2DpXdZN.js +0 -1
  117. package/dist/docs/assets/guides_slack.md.D2nTRu9M.lean.js +0 -1
  118. package/dist/playground/assets/index-BmMrulSc.css +0 -1
  119. /package/dist/docs/assets/{troubleshooting.md.C6n3wCr6.lean.js → troubleshooting.md.CuVztCKs.lean.js} +0 -0
@@ -1,6 +1,7 @@
1
1
  /**
2
- * `agent-serve slack …` CLI — doctor, destroy/icon, and `create` as a
3
- * dashboard-wizard launcher (`slack-provision-client.ts`).
2
+ * `agent-serve slack …` CLI — doctor, destroy/icon, `create` as a
3
+ * dashboard-wizard launcher (`slack-provision-client.ts`), and
4
+ * `init --manual` for hand-imported manifests.
4
5
  */
5
6
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
6
7
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
@@ -11,10 +12,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
12
  step((generator = generator.apply(thisArg, _arguments || [])).next());
12
13
  });
13
14
  };
14
- import { access, chmod, mkdir, readFile, writeFile } from "node:fs/promises";
15
+ import { access, chmod, readFile, writeFile } from "node:fs/promises";
15
16
  import { basename, extname, join, resolve as resolvePath } from "node:path";
16
- import { buildSlackManifestPair, envPrefixFromName, formatSlackSetupGuide, initSlackChannel, runSlackDoctor, slackEnvKeys, } from "../channels/slack/index.js";
17
+ import { envPrefixFromName, formatSlackSetupGuide, initSlackChannel, runSlackDoctor, slackEnvKeys, } from "../channels/slack/index.js";
17
18
  import { resolveDeployAuth } from "./cli-deploy.js";
19
+ import { cmdSlackInit, runSlackManifest } from "./cli-slack-manual.js";
18
20
  import { cursorExternalApiUrl } from "./cursor/credentials.js";
19
21
  import { slugFromDirectoryName } from "./deploy-client.js";
20
22
  import { inferDeployGitSource } from "./deploy-source.js";
@@ -34,6 +36,10 @@ Usage:
34
36
  [--team <id>] [--json]
35
37
  ${CLI} slack icon <URL-or-FILE> [--dir .] [--slack-team T0123ABCD]
36
38
  [--prod] [--team <id>] [--json]
39
+ ${CLI} slack init --manual [--dir .] [--name NAME]
40
+ [--prefix PREFIX | --no-prefix] [--channel-posts]
41
+ ${CLI} slack manifest --env dev|prod|both [--dir .] [--name NAME]
42
+ [--print]
37
43
  ${CLI} slack doctor [--dir .] [--prefix PREFIX | --no-prefix] [--json]
38
44
 
39
45
  create/destroy/icon — dedicated Socket Mode app via the Cursor dashboard:
@@ -47,13 +53,14 @@ create/destroy/icon — dedicated Socket Mode app via the Cursor dashboard:
47
53
  icon Set the provisioned app's icon: an https image URL or a local
48
54
  png/jpg/gif file (at most 512KB).
49
55
 
50
- \`slack init\` is removed. Use \`slack create\`. Do not paste a manifest
51
- at api.slack.com.
56
+ \`slack init\` without --manual is not the first-run path. Use \`slack create\`.
57
+ \`slack init --manual\` writes the channel file, manifests to paste at
58
+ api.slack.com, env.example, and setup-status.json.
52
59
 
53
60
  Env tokens:
54
61
  single agent: SLACK_BOT_TOKEN + SLACK_APP_TOKEN
55
62
  multi-agent: <PREFIX>_SLACK_BOT_TOKEN + <PREFIX>_SLACK_APP_TOKEN
56
- (create default PREFIX from the directory name;
63
+ (create / init --manual default PREFIX from the directory name;
57
64
  doctor defaults to it too when those keys are set)
58
65
 
59
66
  See also: skills/setup-slack/SKILL.md
@@ -79,7 +86,7 @@ export function cmdSlack(subcommand, options) {
79
86
  case "init":
80
87
  return cmdSlackInit(options);
81
88
  case "manifest":
82
- return runManifest(options);
89
+ return runSlackManifest(options);
83
90
  case "doctor":
84
91
  return runDoctor(options);
85
92
  default:
@@ -89,57 +96,6 @@ export function cmdSlack(subcommand, options) {
89
96
  }
90
97
  });
91
98
  }
92
- function cmdSlackInit(options) {
93
- return __awaiter(this, void 0, void 0, function* () {
94
- errStream(options)(`\`slack init\` is removed. Socket Mode apps are created with:
95
-
96
- ${CLI} slack create --dir .
97
-
98
- That opens the Cursor dashboard wizard. Do not paste a manifest at api.slack.com.
99
- `);
100
- return 1;
101
- });
102
- }
103
- function runManifest(options) {
104
- return __awaiter(this, void 0, void 0, function* () {
105
- var _a, _b;
106
- const env = (_a = options.env) !== null && _a !== void 0 ? _a : "both";
107
- const dir = resolvePath(options.dir);
108
- const name = (_b = options.name) !== null && _b !== void 0 ? _b : basename(dir);
109
- const pair = buildSlackManifestPair({
110
- name,
111
- managedByCursor: false,
112
- channelPosts: options.channelPosts === true ? true : undefined,
113
- });
114
- if (options.print) {
115
- if (env === "dev" || env === "both") {
116
- process.stdout.write(`${JSON.stringify(pair.dev, null, 2)}\n`);
117
- }
118
- if (env === "prod" || env === "both") {
119
- if (env === "both") {
120
- process.stdout.write("--- prod ---\n");
121
- }
122
- process.stdout.write(`${JSON.stringify(pair.prod, null, 2)}\n`);
123
- }
124
- return 0;
125
- }
126
- const outDir = join(dir, ".agent-serve/slack");
127
- yield mkdir(outDir, { recursive: true });
128
- const written = [];
129
- if (env === "dev" || env === "both") {
130
- const path = join(outDir, "manifest.dev.json");
131
- yield writeFile(path, `${JSON.stringify(pair.dev, null, 2)}\n`);
132
- written.push(path);
133
- }
134
- if (env === "prod" || env === "both") {
135
- const path = join(outDir, "manifest.prod.json");
136
- yield writeFile(path, `${JSON.stringify(pair.prod, null, 2)}\n`);
137
- written.push(path);
138
- }
139
- process.stdout.write(`${JSON.stringify({ ok: true, written }, null, 2)}\n`);
140
- return 0;
141
- });
142
- }
143
99
  function runDoctor(options) {
144
100
  return __awaiter(this, void 0, void 0, function* () {
145
101
  var _a;
@@ -335,7 +291,7 @@ export function cmdSlackCreate(options) {
335
291
  }
336
292
  let wrote;
337
293
  try {
338
- wrote = yield scaffoldSlackChannelFiles(options, target);
294
+ wrote = yield scaffoldSlackChannelFiles(target);
339
295
  }
340
296
  catch (error) {
341
297
  ctx.err(`${describeError(error)}\n`);
@@ -597,7 +553,7 @@ function formatAppList(apps) {
597
553
  * Scaffold `agent/channels/slack.ts` when absent. Existing files are
598
554
  * never overwritten: initSlackChannel writes with `wx`.
599
555
  */
600
- function scaffoldSlackChannelFiles(options, target) {
556
+ function scaffoldSlackChannelFiles(target) {
601
557
  return __awaiter(this, void 0, void 0, function* () {
602
558
  var _a;
603
559
  const channelFile = "agent/channels/slack.ts";
@@ -605,23 +561,16 @@ function scaffoldSlackChannelFiles(options, target) {
605
561
  return [];
606
562
  }
607
563
  try {
608
- // Pass the resolved name/prefix so the channel file and the env keys
609
- // share one derivation.
610
564
  const result = yield initSlackChannel({
611
565
  dir: target.dir,
612
566
  name: target.name,
613
567
  envPrefix: (_a = target.envPrefix) !== null && _a !== void 0 ? _a : "",
614
- channelPosts: options.channelPosts,
615
568
  });
616
569
  return result.files;
617
570
  }
618
571
  catch (error) {
619
572
  if (isErrnoException(error) && error.code === "EEXIST") {
620
- // The channel file is written first, so it exists by the time a
621
- // later pre-existing file aborts the scaffold.
622
- return (yield fileExists(join(target.dir, channelFile)))
623
- ? [channelFile]
624
- : [];
573
+ return [channelFile];
625
574
  }
626
575
  throw error;
627
576
  }
@@ -15,29 +15,26 @@ export type DeploymentProgress = "queued" | "preparing" | "creating" | "building
15
15
  export declare const TERMINAL_DEPLOY_STATUSES: ReadonlySet<DeploymentStatus>;
16
16
  /**
17
17
  * What gets deployed. Today the control plane builds the engine itself from
18
- * a git ref (or serves the static placeholder when no repo is given), so the
19
- * only member is the slug/git-ref shape. When artifact-based deploys ship
20
- * ("build locally + upload"), add an `{ kind: "artifact", ... }` member here
21
- * and a branch in {@link AgentServeDeployClient.deploy} — the command
22
- * surface and everything downstream stays unchanged.
18
+ * a git ref, so the only member is the slug/git-ref shape. When
19
+ * artifact-based deploys ship ("build locally + upload"), add an
20
+ * `{ kind: "artifact", ... }` member here and a branch in
21
+ * {@link AgentServeDeployClient.deploy} — the command surface and everything
22
+ * downstream stays unchanged.
23
23
  */
24
24
  export type DeploySource = {
25
25
  kind: "git-ref";
26
- /** Omit for the control-plane static engine (`static-http-200`). */
27
- gitRepoUrl?: string;
26
+ gitRepoUrl: string;
28
27
  gitRef?: string;
29
28
  agentPath?: string;
30
29
  /** Repos whose SCM events the deployed engine pulls (`owner/name`). */
31
30
  cursorEventRepos?: string[];
32
31
  /**
33
- * Egress allowlist for the engine pod. Only valid on repo-backed
34
- * deploys — the backend 400s when set on a static deploy.
32
+ * Egress allowlist for the engine pod.
35
33
  */
36
34
  egressAllowedDomains?: string[];
37
35
  /**
38
36
  * `/v1/channels/…` subtrees the stable alias serves WITHOUT
39
37
  * `X-Agent-Alias-Token` (channels authored with `publicEndpoint()`).
40
- * Only valid on repo-backed deploys.
41
38
  */
42
39
  publicRoutePaths?: string[];
43
40
  };
@@ -1 +1 @@
1
- {"version":3,"file":"deploy-client.d.ts","sourceRoot":"","sources":["../../src/internal/deploy-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAUH,MAAM,MAAM,gBAAgB,GACxB,SAAS,GACT,WAAW,GACX,SAAS,GACT,UAAU,GACV,QAAQ,GACR,UAAU,GACV,SAAS,GACT,UAAU,CAAC;AAEf,sEAAsE;AACtE,MAAM,MAAM,kBAAkB,GAC1B,QAAQ,GACR,WAAW,GACX,UAAU,GACV,UAAU,GACV,UAAU,GACV,YAAY,GACZ,SAAS,GACT,QAAQ,GACR,UAAU,GACV,SAAS,GACT,UAAU,GACV,UAAU,CAAC;AAEf,eAAO,MAAM,wBAAwB,EAAE,WAAW,CAAC,gBAAgB,CAKjE,CAAC;AAEH;;;;;;;GAOG;AACH,MAAM,MAAM,YAAY,GAAG;IACz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CAAC,CA0BpB;IAED,gEAAgE;IAC1D,WAAW,CAAC,IAAI,EAAE;QACtB,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;KACd,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAOxB;IAED,yDAAyD;IACnD,YAAY,CAAC,IAAI,EAAE;QACvB,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KACd,GAAG,OAAO,CAAC,IAAI,CAAC,CAUhB;IAED;;;;OAIG;IACG,mBAAmB,CAAC,IAAI,EAAE;QAC9B,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;KACd,GAAG,OAAO,CAAC,MAAM,CAAC,CAOlB;IAED;;;;;OAKG;IACG,gBAAgB,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAsBxE;IAED,4DAA4D;IAC5D,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEpC;IAED;;;;;OAKG;IACH,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAElD;YAEa,OAAO;CAyCtB"}
1
+ {"version":3,"file":"deploy-client.d.ts","sourceRoot":"","sources":["../../src/internal/deploy-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAUH,MAAM,MAAM,gBAAgB,GACxB,SAAS,GACT,WAAW,GACX,SAAS,GACT,UAAU,GACV,QAAQ,GACR,UAAU,GACV,SAAS,GACT,UAAU,CAAC;AAEf,sEAAsE;AACtE,MAAM,MAAM,kBAAkB,GAC1B,QAAQ,GACR,WAAW,GACX,UAAU,GACV,UAAU,GACV,UAAU,GACV,YAAY,GACZ,SAAS,GACT,QAAQ,GACR,UAAU,GACV,SAAS,GACT,UAAU,GACV,UAAU,CAAC;AAEf,eAAO,MAAM,wBAAwB,E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,MAAM,CAAA;SAAE,CAAC,CAAC;KACjD,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CA0BpB;IAED,gEAAgE;IAC1D,WAAW,CAAC,IAAI,EAAE;QACtB,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;KACd,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAOxB;IAED,yDAAyD;IACnD,YAAY,CAAC,IAAI,EAAE;QACvB,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KACd,GAAG,OAAO,CAAC,IAAI,CAAC,CAUhB;IAED;;;;OAIG;IACG,mBAAmB,CAAC,IAAI,EAAE;QAC9B,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;KACd,GAAG,OAAO,CAAC,MAAM,CAAC,CAOlB;IAED;;;;;OAKG;IACG,gBAAgB,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAsBxE;IAED,4DAA4D;IAC5D,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEpC;IAED;;;;;OAKG;IACH,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAElD;YAEa,OAAO;CAyCtB"}
@@ -227,9 +227,7 @@ export class AgentServeDeployClient {
227
227
  }
228
228
  // Only the git-ref member exists today; a future artifact member would
229
229
  // upload the build first and post a different body from this branch.
230
- const body = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ teamId: args.teamId, slug: args.slug }, (args.source.gitRepoUrl === undefined
231
- ? {}
232
- : { gitRepoUrl: args.source.gitRepoUrl })), (args.source.gitRef === undefined
230
+ const body = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ teamId: args.teamId, slug: args.slug, gitRepoUrl: args.source.gitRepoUrl }, (args.source.gitRef === undefined
233
231
  ? {}
234
232
  : { gitRef: args.source.gitRef })), (args.source.agentPath === undefined
235
233
  ? {}
@@ -30,7 +30,7 @@ export declare function httpsGitRepoUrlFromRemote(remote: string): string | unde
30
30
  export declare function agentPathRelativeToGitRoot(dir: string, gitRoot: string): string | undefined;
31
31
  /**
32
32
  * Probe the git checkout containing `dir` for deploy source fields.
33
- * Missing pieces stay undefined (static deploy / server defaults).
33
+ * Missing pieces stay undefined.
34
34
  */
35
35
  export declare function inferDeployGitSource(dir: string, options?: {
36
36
  git?: GitRunner;
@@ -103,7 +103,7 @@ export function agentPathRelativeToGitRoot(dir, gitRoot) {
103
103
  }
104
104
  /**
105
105
  * Probe the git checkout containing `dir` for deploy source fields.
106
- * Missing pieces stay undefined (static deploy / server defaults).
106
+ * Missing pieces stay undefined.
107
107
  */
108
108
  export function inferDeployGitSource(dir, options) {
109
109
  return __awaiter(this, void 0, void 0, function* () {
@@ -1,8 +1,12 @@
1
1
  /**
2
- * Durable, replayable per-session event log. Events are held in memory for
3
- * live fan-out and appended to `events.ndjson` for durability; on process
4
- * restart the file is hydrated back so streams can replay from any
5
- * `startIndex`.
2
+ * Durable, replayable per-session event log. `events.ndjson` is the source
3
+ * of truth. The process keeps `nextIndex`, live subscribers, and a short
4
+ * unflushed tail not a cache of the full transcript. Replay reads the
5
+ * file on demand; live streams subscribe first, then catch up by index.
6
+ *
7
+ * Hosted engines mint thousands of sessions (one per PR under
8
+ * agentic-owners). Retaining every streamed tool output in RAM for the
9
+ * process lifetime is what OOM'd those engines at the ~4 GB heap cap.
6
10
  */
7
11
  import type { SessionEvent, SessionEventPayload } from "../types.js";
8
12
  export type AppendableEvent = SessionEventPayload & {
@@ -12,46 +16,62 @@ export declare class SessionEventLog {
12
16
  private readonly sessionId;
13
17
  private readonly filePath;
14
18
  private readonly onPersistError;
15
- private readonly events;
19
+ private nextIndex;
16
20
  private readonly listeners;
17
21
  private persistChain;
22
+ /** Appended events whose `appendFile` has not finished. */
23
+ private readonly inflight;
24
+ /**
25
+ * In-process patches (cloud cost backfill) that are not rewritten to
26
+ * `events.ndjson`. Applied on read.
27
+ */
28
+ private readonly replacements;
18
29
  private constructor();
19
30
  static open(args: {
20
31
  sessionId: string;
21
32
  filePath: string;
22
33
  onPersistError?: (error: unknown) => void;
23
34
  }): Promise<SessionEventLog>;
24
- private hydrate;
35
+ private readNextIndex;
25
36
  get count(): number;
26
37
  /**
27
- * In-process residency vs recorded length. Today those are the same
28
- * (`events` is the cache). A later change can drop the cache and keep
29
- * `eventsTotal` as the durable count while `eventsRetained` shrinks to
30
- * the unflushed tail.
38
+ * In-process residency vs recorded length. `eventsTotal` is the durable
39
+ * count (`nextIndex`). `eventsRetained` is the unflushed tail the
40
+ * transcript is not cached after `appendFile` lands.
31
41
  */
32
42
  memoryStats(): {
33
43
  eventsRetained: number;
34
44
  eventsTotal: number;
35
45
  };
36
46
  /**
37
- * Assign the next index, record the event, and fan out to live
38
- * subscribers. Ordering is synchronous; file persistence is chained in
39
- * the background and awaited by {@link flush}.
47
+ * Assign the next index and fan out to live subscribers. Ordering is
48
+ * synchronous; file persistence is chained in the background and awaited
49
+ * by {@link flush}. The event is not retained after the write lands.
40
50
  */
41
51
  append(payload: AppendableEvent): SessionEvent;
52
+ private dropInflight;
42
53
  /** Wait for pending file writes (used on close). */
43
54
  flush(): Promise<void>;
44
- snapshot(startIndex?: number): SessionEvent[];
45
55
  /**
46
- * Replace one already-recorded event in memory. Used to backfill usage/cost
47
- * onto historical `turn.completed` rows without rewriting `events.ndjson`.
48
- * Live subscribers are not notified — patch before opening a replay stream.
56
+ * Read recorded events from `startIndex`. Does not retain the result on
57
+ * the log; callers own the returned array.
58
+ */
59
+ snapshot(startIndex?: number): Promise<SessionEvent[]>;
60
+ /**
61
+ * Replace one already-recorded event in this process. Used to backfill
62
+ * usage/cost onto historical `turn.completed` rows without rewriting
63
+ * `events.ndjson`. Live subscribers are not notified — patch before
64
+ * opening a replay stream.
49
65
  */
50
66
  replace(index: number, event: SessionEvent): boolean;
51
67
  subscribe(listener: (event: SessionEvent) => void): () => void;
52
68
  /**
53
69
  * NDJSON stream: replays recorded events from `startIndex`, then follows
54
70
  * live events until the consumer cancels.
71
+ *
72
+ * Subscribe first (buffer live events), then read the file, then drain
73
+ * the buffer by index so an async file read cannot drop or duplicate
74
+ * events that arrive during catch-up.
55
75
  */
56
76
  stream(startIndex?: number): ReadableStream<Uint8Array>;
57
77
  }
@@ -1 +1 @@
1
- {"version":3,"file":"event-log.d.ts","sourceRoot":"","sources":["../../src/internal/event-log.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAErE,MAAM,MAAM,eAAe,GAAG,mBAAmB,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAExE,qBAAa,eAAe;IAMxB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,cAAc;IAPjC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsB;IAC7C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA4C;IACtE,OAAO,CAAC,YAAY,CAAoC;IAExD,OAAO,eAIH;IAEJ,OAAa,IAAI,CAAC,IAAI,EAAE;QACtB,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;KAC3C,GAAG,OAAO,CAAC,eAAe,CAAC,CAQ3B;YAEa,OAAO;IAmBrB,IAAI,KAAK,IAAI,MAAM,CAElB;IAED;;;;;OAKG;IACH,WAAW,IAAI;QAAE,cAAc,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAG7D;IAED;;;;OAIG;IACH,MAAM,CAAC,OAAO,EAAE,eAAe,GAAG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