@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.
@@ -904,7 +904,7 @@ var import_hono = require("hono");
904
904
  // package.json
905
905
  var package_default = {
906
906
  name: "@posthog/agent",
907
- version: "2.3.92",
907
+ version: "2.3.104",
908
908
  repository: "https://github.com/PostHog/code",
909
909
  description: "TypeScript agent framework wrapping Claude Agent SDK with Git-based task execution for PostHog",
910
910
  exports: {
@@ -3434,7 +3434,6 @@ async function canUseTool(context) {
3434
3434
 
3435
3435
  // src/adapters/claude/session/commands.ts
3436
3436
  var UNSUPPORTED_COMMANDS = [
3437
- "clear",
3438
3437
  "context",
3439
3438
  "cost",
3440
3439
  "keybindings-help",
@@ -11332,6 +11331,7 @@ var SessionLogWriter = class _SessionLogWriter {
11332
11331
  lastFlushAttemptTime = /* @__PURE__ */ new Map();
11333
11332
  retryCounts = /* @__PURE__ */ new Map();
11334
11333
  sessions = /* @__PURE__ */ new Map();
11334
+ flushQueues = /* @__PURE__ */ new Map();
11335
11335
  logger;
11336
11336
  localCachePath;
11337
11337
  constructor(options = {}) {
@@ -11425,6 +11425,18 @@ var SessionLogWriter = class _SessionLogWriter {
11425
11425
  }
11426
11426
  }
11427
11427
  async flush(sessionId) {
11428
+ const prev = this.flushQueues.get(sessionId) ?? Promise.resolve();
11429
+ const next = prev.catch(() => {
11430
+ }).then(() => this._doFlush(sessionId));
11431
+ this.flushQueues.set(sessionId, next);
11432
+ next.finally(() => {
11433
+ if (this.flushQueues.get(sessionId) === next) {
11434
+ this.flushQueues.delete(sessionId);
11435
+ }
11436
+ });
11437
+ return next;
11438
+ }
11439
+ async _doFlush(sessionId) {
11428
11440
  const session = this.sessions.get(sessionId);
11429
11441
  if (!session) {
11430
11442
  this.logger.warn("flush: no session found", { sessionId });