@posthog/agent 2.3.92 → 2.3.104

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.
package/dist/agent.js CHANGED
@@ -371,7 +371,7 @@ import { v7 as uuidv7 } from "uuid";
371
371
  // package.json
372
372
  var package_default = {
373
373
  name: "@posthog/agent",
374
- version: "2.3.92",
374
+ version: "2.3.104",
375
375
  repository: "https://github.com/PostHog/code",
376
376
  description: "TypeScript agent framework wrapping Claude Agent SDK with Git-based task execution for PostHog",
377
377
  exports: {
@@ -2570,7 +2570,6 @@ async function canUseTool(context) {
2570
2570
 
2571
2571
  // src/adapters/claude/session/commands.ts
2572
2572
  var UNSUPPORTED_COMMANDS = [
2573
- "clear",
2574
2573
  "context",
2575
2574
  "cost",
2576
2575
  "keybindings-help",
@@ -4705,6 +4704,7 @@ var SessionLogWriter = class _SessionLogWriter {
4705
4704
  lastFlushAttemptTime = /* @__PURE__ */ new Map();
4706
4705
  retryCounts = /* @__PURE__ */ new Map();
4707
4706
  sessions = /* @__PURE__ */ new Map();
4707
+ flushQueues = /* @__PURE__ */ new Map();
4708
4708
  logger;
4709
4709
  localCachePath;
4710
4710
  constructor(options = {}) {
@@ -4798,6 +4798,18 @@ var SessionLogWriter = class _SessionLogWriter {
4798
4798
  }
4799
4799
  }
4800
4800
  async flush(sessionId) {
4801
+ const prev = this.flushQueues.get(sessionId) ?? Promise.resolve();
4802
+ const next = prev.catch(() => {
4803
+ }).then(() => this._doFlush(sessionId));
4804
+ this.flushQueues.set(sessionId, next);
4805
+ next.finally(() => {
4806
+ if (this.flushQueues.get(sessionId) === next) {
4807
+ this.flushQueues.delete(sessionId);
4808
+ }
4809
+ });
4810
+ return next;
4811
+ }
4812
+ async _doFlush(sessionId) {
4801
4813
  const session = this.sessions.get(sessionId);
4802
4814
  if (!session) {
4803
4815
  this.logger.warn("flush: no session found", { sessionId });