@posthog/agent 2.3.727 → 2.3.735
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 +21 -3
- package/dist/agent.js.map +1 -1
- package/dist/posthog-api.js +1 -1
- package/dist/posthog-api.js.map +1 -1
- package/dist/server/agent-server.js +21 -3
- package/dist/server/agent-server.js.map +1 -1
- package/dist/server/bin.cjs +21 -3
- package/dist/server/bin.cjs.map +1 -1
- package/package.json +3 -3
- package/src/adapters/claude/UPSTREAM.md +1 -0
- package/src/adapters/claude/claude-agent.slash-command.test.ts +22 -2
- package/src/adapters/claude/claude-agent.ts +31 -1
- package/src/adapters/claude/types.ts +7 -0
package/dist/agent.js
CHANGED
|
@@ -4674,7 +4674,7 @@ import { v7 as uuidv7 } from "uuid";
|
|
|
4674
4674
|
// package.json
|
|
4675
4675
|
var package_default = {
|
|
4676
4676
|
name: "@posthog/agent",
|
|
4677
|
-
version: "2.3.
|
|
4677
|
+
version: "2.3.735",
|
|
4678
4678
|
repository: "https://github.com/PostHog/code",
|
|
4679
4679
|
description: "TypeScript agent framework wrapping Claude Agent SDK with Git-based task execution for PostHog",
|
|
4680
4680
|
exports: {
|
|
@@ -18193,6 +18193,14 @@ function readClaudeMdQuietly(cwd, logger) {
|
|
|
18193
18193
|
return void 0;
|
|
18194
18194
|
}
|
|
18195
18195
|
}
|
|
18196
|
+
function collectKnownSlashCommands(commands) {
|
|
18197
|
+
const names = /* @__PURE__ */ new Set();
|
|
18198
|
+
if (!commands) return names;
|
|
18199
|
+
for (const cmd of commands) {
|
|
18200
|
+
if (cmd.name) names.add(cmd.name);
|
|
18201
|
+
}
|
|
18202
|
+
return names;
|
|
18203
|
+
}
|
|
18196
18204
|
function sanitizeTitle(text2) {
|
|
18197
18205
|
const sanitized = text2.replace(/[\r\n]+/g, " ").replace(/\s+/g, " ").trim();
|
|
18198
18206
|
if (sanitized.length <= MAX_TITLE_LENGTH) {
|
|
@@ -18458,7 +18466,9 @@ var ClaudeAcpAgent = class extends BaseAcpAgent {
|
|
|
18458
18466
|
}
|
|
18459
18467
|
if (message.subtype === "session_state_changed" && message.state === "idle") {
|
|
18460
18468
|
if (!promptReplayed) {
|
|
18461
|
-
|
|
18469
|
+
const cmdName = commandMatch?.[1].slice(1);
|
|
18470
|
+
const known = cmdName !== void 0 && this.session.knownSlashCommands?.has(cmdName) === true;
|
|
18471
|
+
if (commandMatch && !known) {
|
|
18462
18472
|
const cmd = commandMatch[1];
|
|
18463
18473
|
this.logger.warn(
|
|
18464
18474
|
"Slash command produced no output; treating as unsupported",
|
|
@@ -18477,7 +18487,9 @@ var ClaudeAcpAgent = class extends BaseAcpAgent {
|
|
|
18477
18487
|
return { stopReason: "end_turn" };
|
|
18478
18488
|
}
|
|
18479
18489
|
this.logger.debug("Skipping idle state before prompt replay", {
|
|
18480
|
-
sessionId: params.sessionId
|
|
18490
|
+
sessionId: params.sessionId,
|
|
18491
|
+
command: commandMatch?.[1],
|
|
18492
|
+
known
|
|
18481
18493
|
});
|
|
18482
18494
|
break;
|
|
18483
18495
|
}
|
|
@@ -19027,6 +19039,9 @@ var ClaudeAcpAgent = class extends BaseAcpAgent {
|
|
|
19027
19039
|
`Session ${forkSession ? "fork" : "resumption"} timed out for sessionId=${sessionId}`
|
|
19028
19040
|
);
|
|
19029
19041
|
}
|
|
19042
|
+
session.knownSlashCommands = collectKnownSlashCommands(
|
|
19043
|
+
result.value.commands
|
|
19044
|
+
);
|
|
19030
19045
|
} catch (err2) {
|
|
19031
19046
|
settingsManager.dispose();
|
|
19032
19047
|
if (err2 instanceof Error && err2.message === "Query closed before response received") {
|
|
@@ -19066,6 +19081,9 @@ var ClaudeAcpAgent = class extends BaseAcpAgent {
|
|
|
19066
19081
|
`Session initialization timed out for sessionId=${sessionId}`
|
|
19067
19082
|
);
|
|
19068
19083
|
}
|
|
19084
|
+
session.knownSlashCommands = collectKnownSlashCommands(
|
|
19085
|
+
initResult.value.commands
|
|
19086
|
+
);
|
|
19069
19087
|
} catch (err2) {
|
|
19070
19088
|
settingsManager.dispose();
|
|
19071
19089
|
this.logger.error("Session initialization failed", {
|