@posthog/agent 2.3.15 → 2.3.18
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 -5
- 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 -5
- package/dist/server/agent-server.js.map +1 -1
- package/dist/server/bin.cjs +21 -5
- package/dist/server/bin.cjs.map +1 -1
- package/package.json +1 -1
- package/src/adapters/claude/session/instructions.ts +19 -0
- package/src/adapters/claude/session/options.ts +4 -9
package/dist/server/bin.cjs
CHANGED
|
@@ -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.
|
|
907
|
+
version: "2.3.18",
|
|
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: {
|
|
@@ -3437,27 +3437,43 @@ var import_node_child_process = require("child_process");
|
|
|
3437
3437
|
var fs = __toESM(require("fs"), 1);
|
|
3438
3438
|
var os2 = __toESM(require("os"), 1);
|
|
3439
3439
|
var path3 = __toESM(require("path"), 1);
|
|
3440
|
-
|
|
3440
|
+
|
|
3441
|
+
// src/adapters/claude/session/instructions.ts
|
|
3442
|
+
var BRANCH_NAMING = `
|
|
3441
3443
|
# Branch Naming
|
|
3442
3444
|
|
|
3443
3445
|
When working in a detached HEAD state, create a descriptive branch name based on the work being done before committing. Do this automatically without asking the user.
|
|
3444
3446
|
`;
|
|
3447
|
+
var PLAN_MODE = `
|
|
3448
|
+
# Plan Mode
|
|
3449
|
+
|
|
3450
|
+
Only enter plan mode (EnterPlanMode) when the user is requesting a significant change in approach or direction mid-task. Do NOT enter plan mode for:
|
|
3451
|
+
- Confirmations or approvals ("yes", "looks good", "continue", "go ahead")
|
|
3452
|
+
- Minor clarifications or small adjustments
|
|
3453
|
+
- Answers to questions you asked (unless you are still in the initial planning phase and have not yet started executing)
|
|
3454
|
+
- Feedback that does not require replanning
|
|
3455
|
+
|
|
3456
|
+
When in doubt, continue executing and incorporate the feedback inline.
|
|
3457
|
+
`;
|
|
3458
|
+
var APPENDED_INSTRUCTIONS = BRANCH_NAMING + PLAN_MODE;
|
|
3459
|
+
|
|
3460
|
+
// src/adapters/claude/session/options.ts
|
|
3445
3461
|
function buildSystemPrompt(customPrompt) {
|
|
3446
3462
|
const defaultPrompt = {
|
|
3447
3463
|
type: "preset",
|
|
3448
3464
|
preset: "claude_code",
|
|
3449
|
-
append:
|
|
3465
|
+
append: APPENDED_INSTRUCTIONS
|
|
3450
3466
|
};
|
|
3451
3467
|
if (!customPrompt) {
|
|
3452
3468
|
return defaultPrompt;
|
|
3453
3469
|
}
|
|
3454
3470
|
if (typeof customPrompt === "string") {
|
|
3455
|
-
return customPrompt +
|
|
3471
|
+
return customPrompt + APPENDED_INSTRUCTIONS;
|
|
3456
3472
|
}
|
|
3457
3473
|
if (typeof customPrompt === "object" && customPrompt !== null && "append" in customPrompt && typeof customPrompt.append === "string") {
|
|
3458
3474
|
return {
|
|
3459
3475
|
...defaultPrompt,
|
|
3460
|
-
append: customPrompt.append +
|
|
3476
|
+
append: customPrompt.append + APPENDED_INSTRUCTIONS
|
|
3461
3477
|
};
|
|
3462
3478
|
}
|
|
3463
3479
|
return defaultPrompt;
|