@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/package.json
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const BRANCH_NAMING = `
|
|
2
|
+
# Branch Naming
|
|
3
|
+
|
|
4
|
+
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.
|
|
5
|
+
`;
|
|
6
|
+
|
|
7
|
+
const PLAN_MODE = `
|
|
8
|
+
# Plan Mode
|
|
9
|
+
|
|
10
|
+
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:
|
|
11
|
+
- Confirmations or approvals ("yes", "looks good", "continue", "go ahead")
|
|
12
|
+
- Minor clarifications or small adjustments
|
|
13
|
+
- Answers to questions you asked (unless you are still in the initial planning phase and have not yet started executing)
|
|
14
|
+
- Feedback that does not require replanning
|
|
15
|
+
|
|
16
|
+
When in doubt, continue executing and incorporate the feedback inline.
|
|
17
|
+
`;
|
|
18
|
+
|
|
19
|
+
export const APPENDED_INSTRUCTIONS = BRANCH_NAMING + PLAN_MODE;
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
} from "../hooks";
|
|
19
19
|
import type { CodeExecutionMode } from "../tools";
|
|
20
20
|
import type { EffortLevel } from "../types";
|
|
21
|
+
import { APPENDED_INSTRUCTIONS } from "./instructions";
|
|
21
22
|
import { DEFAULT_MODEL } from "./models";
|
|
22
23
|
import type { SettingsManager } from "./settings";
|
|
23
24
|
|
|
@@ -47,19 +48,13 @@ export interface BuildOptionsParams {
|
|
|
47
48
|
effort?: EffortLevel;
|
|
48
49
|
}
|
|
49
50
|
|
|
50
|
-
const BRANCH_NAMING_INSTRUCTIONS = `
|
|
51
|
-
# Branch Naming
|
|
52
|
-
|
|
53
|
-
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.
|
|
54
|
-
`;
|
|
55
|
-
|
|
56
51
|
export function buildSystemPrompt(
|
|
57
52
|
customPrompt?: unknown,
|
|
58
53
|
): Options["systemPrompt"] {
|
|
59
54
|
const defaultPrompt: Options["systemPrompt"] = {
|
|
60
55
|
type: "preset",
|
|
61
56
|
preset: "claude_code",
|
|
62
|
-
append:
|
|
57
|
+
append: APPENDED_INSTRUCTIONS,
|
|
63
58
|
};
|
|
64
59
|
|
|
65
60
|
if (!customPrompt) {
|
|
@@ -67,7 +62,7 @@ export function buildSystemPrompt(
|
|
|
67
62
|
}
|
|
68
63
|
|
|
69
64
|
if (typeof customPrompt === "string") {
|
|
70
|
-
return customPrompt +
|
|
65
|
+
return customPrompt + APPENDED_INSTRUCTIONS;
|
|
71
66
|
}
|
|
72
67
|
|
|
73
68
|
if (
|
|
@@ -78,7 +73,7 @@ export function buildSystemPrompt(
|
|
|
78
73
|
) {
|
|
79
74
|
return {
|
|
80
75
|
...defaultPrompt,
|
|
81
|
-
append: customPrompt.append +
|
|
76
|
+
append: customPrompt.append + APPENDED_INSTRUCTIONS,
|
|
82
77
|
};
|
|
83
78
|
}
|
|
84
79
|
|