@posthog/agent 2.3.709 → 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/handoff-checkpoint.js.map +1 -1
- package/dist/posthog-api.d.ts +1 -1
- package/dist/posthog-api.js +1 -1
- package/dist/posthog-api.js.map +1 -1
- package/dist/resume.js.map +1 -1
- package/dist/server/agent-server.js +24 -3
- package/dist/server/agent-server.js.map +1 -1
- package/dist/server/bin.cjs +24 -3
- package/dist/server/bin.cjs.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js.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/src/server/agent-server.configure-environment.test.ts +39 -1
- package/src/server/agent-server.ts +2 -1
- package/src/types.ts +2 -1
- package/src/utils/gateway.ts +8 -1
package/dist/server/bin.cjs
CHANGED
|
@@ -9471,7 +9471,7 @@ var import_zod4 = require("zod");
|
|
|
9471
9471
|
// package.json
|
|
9472
9472
|
var package_default = {
|
|
9473
9473
|
name: "@posthog/agent",
|
|
9474
|
-
version: "2.3.
|
|
9474
|
+
version: "2.3.735",
|
|
9475
9475
|
repository: "https://github.com/PostHog/code",
|
|
9476
9476
|
description: "TypeScript agent framework wrapping Claude Agent SDK with Git-based task execution for PostHog",
|
|
9477
9477
|
exports: {
|
|
@@ -18401,6 +18401,14 @@ function readClaudeMdQuietly(cwd, logger) {
|
|
|
18401
18401
|
return void 0;
|
|
18402
18402
|
}
|
|
18403
18403
|
}
|
|
18404
|
+
function collectKnownSlashCommands(commands) {
|
|
18405
|
+
const names = /* @__PURE__ */ new Set();
|
|
18406
|
+
if (!commands) return names;
|
|
18407
|
+
for (const cmd of commands) {
|
|
18408
|
+
if (cmd.name) names.add(cmd.name);
|
|
18409
|
+
}
|
|
18410
|
+
return names;
|
|
18411
|
+
}
|
|
18404
18412
|
function sanitizeTitle(text2) {
|
|
18405
18413
|
const sanitized = text2.replace(/[\r\n]+/g, " ").replace(/\s+/g, " ").trim();
|
|
18406
18414
|
if (sanitized.length <= MAX_TITLE_LENGTH) {
|
|
@@ -18666,7 +18674,9 @@ var ClaudeAcpAgent = class extends BaseAcpAgent {
|
|
|
18666
18674
|
}
|
|
18667
18675
|
if (message.subtype === "session_state_changed" && message.state === "idle") {
|
|
18668
18676
|
if (!promptReplayed) {
|
|
18669
|
-
|
|
18677
|
+
const cmdName = commandMatch?.[1].slice(1);
|
|
18678
|
+
const known = cmdName !== void 0 && this.session.knownSlashCommands?.has(cmdName) === true;
|
|
18679
|
+
if (commandMatch && !known) {
|
|
18670
18680
|
const cmd = commandMatch[1];
|
|
18671
18681
|
this.logger.warn(
|
|
18672
18682
|
"Slash command produced no output; treating as unsupported",
|
|
@@ -18685,7 +18695,9 @@ var ClaudeAcpAgent = class extends BaseAcpAgent {
|
|
|
18685
18695
|
return { stopReason: "end_turn" };
|
|
18686
18696
|
}
|
|
18687
18697
|
this.logger.debug("Skipping idle state before prompt replay", {
|
|
18688
|
-
sessionId: params.sessionId
|
|
18698
|
+
sessionId: params.sessionId,
|
|
18699
|
+
command: commandMatch?.[1],
|
|
18700
|
+
known
|
|
18689
18701
|
});
|
|
18690
18702
|
break;
|
|
18691
18703
|
}
|
|
@@ -19235,6 +19247,9 @@ var ClaudeAcpAgent = class extends BaseAcpAgent {
|
|
|
19235
19247
|
`Session ${forkSession ? "fork" : "resumption"} timed out for sessionId=${sessionId}`
|
|
19236
19248
|
);
|
|
19237
19249
|
}
|
|
19250
|
+
session.knownSlashCommands = collectKnownSlashCommands(
|
|
19251
|
+
result.value.commands
|
|
19252
|
+
);
|
|
19238
19253
|
} catch (err2) {
|
|
19239
19254
|
settingsManager.dispose();
|
|
19240
19255
|
if (err2 instanceof Error && err2.message === "Query closed before response received") {
|
|
@@ -19274,6 +19289,9 @@ var ClaudeAcpAgent = class extends BaseAcpAgent {
|
|
|
19274
19289
|
`Session initialization timed out for sessionId=${sessionId}`
|
|
19275
19290
|
);
|
|
19276
19291
|
}
|
|
19292
|
+
session.knownSlashCommands = collectKnownSlashCommands(
|
|
19293
|
+
initResult.value.commands
|
|
19294
|
+
);
|
|
19277
19295
|
} catch (err2) {
|
|
19278
19296
|
settingsManager.dispose();
|
|
19279
19297
|
this.logger.error("Session initialization failed", {
|
|
@@ -21763,6 +21781,9 @@ function resolveGatewayProduct({
|
|
|
21763
21781
|
isInternal,
|
|
21764
21782
|
originProduct
|
|
21765
21783
|
} = {}) {
|
|
21784
|
+
if (originProduct === "slack") {
|
|
21785
|
+
return "slack_app";
|
|
21786
|
+
}
|
|
21766
21787
|
if (isInternal) {
|
|
21767
21788
|
return originProduct === "signal_report" ? "signals" : "background_agents";
|
|
21768
21789
|
}
|