@posthog/agent 2.1.156 → 2.1.157
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 +1 -1
- 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.d.ts +1 -0
- package/dist/server/agent-server.js +2 -2
- package/dist/server/agent-server.js.map +1 -1
- package/dist/server/bin.cjs +5 -4
- package/dist/server/bin.cjs.map +1 -1
- package/package.json +1 -1
- package/src/server/agent-server.test.ts +28 -0
- package/src/server/agent-server.ts +1 -1
- package/src/server/bin.ts +2 -0
- package/src/server/types.ts +1 -0
package/package.json
CHANGED
|
@@ -384,5 +384,33 @@ describe("AgentServer HTTP Mode", () => {
|
|
|
384
384
|
expect(prompt).toContain("Create a draft pull request");
|
|
385
385
|
expect(prompt).toContain("gh pr create --draft");
|
|
386
386
|
});
|
|
387
|
+
|
|
388
|
+
it("includes --base flag when baseBranch is configured", () => {
|
|
389
|
+
server = new AgentServer({
|
|
390
|
+
port,
|
|
391
|
+
jwtPublicKey: TEST_PUBLIC_KEY,
|
|
392
|
+
repositoryPath: repo.path,
|
|
393
|
+
apiUrl: "http://localhost:8000",
|
|
394
|
+
apiKey: "test-api-key",
|
|
395
|
+
projectId: 1,
|
|
396
|
+
mode: "interactive",
|
|
397
|
+
taskId: "test-task-id",
|
|
398
|
+
runId: "test-run-id",
|
|
399
|
+
baseBranch: "add-yolo-to-readme",
|
|
400
|
+
});
|
|
401
|
+
const prompt = (
|
|
402
|
+
server as unknown as TestableServer
|
|
403
|
+
).buildCloudSystemPrompt();
|
|
404
|
+
expect(prompt).toContain(
|
|
405
|
+
"gh pr create --draft --base add-yolo-to-readme",
|
|
406
|
+
);
|
|
407
|
+
});
|
|
408
|
+
|
|
409
|
+
it("omits --base flag when baseBranch is not configured", () => {
|
|
410
|
+
const s = createServer();
|
|
411
|
+
const prompt = (s as unknown as TestableServer).buildCloudSystemPrompt();
|
|
412
|
+
expect(prompt).toContain("gh pr create --draft`");
|
|
413
|
+
expect(prompt).not.toContain("--base");
|
|
414
|
+
});
|
|
387
415
|
});
|
|
388
416
|
});
|
|
@@ -747,7 +747,7 @@ After completing the requested changes:
|
|
|
747
747
|
1. Create a new branch with a descriptive name based on the work done
|
|
748
748
|
2. Stage and commit all changes with a clear commit message
|
|
749
749
|
3. Push the branch to origin
|
|
750
|
-
4. Create a draft pull request using \`gh pr create --draft\` with a descriptive title and body
|
|
750
|
+
4. Create a draft pull request using \`gh pr create --draft${this.config.baseBranch ? ` --base ${this.config.baseBranch}` : ""}\` with a descriptive title and body
|
|
751
751
|
|
|
752
752
|
Important:
|
|
753
753
|
- Always create the PR as a draft. Do not ask for confirmation.
|
package/src/server/bin.ts
CHANGED
|
@@ -50,6 +50,7 @@ program
|
|
|
50
50
|
"--mcpServers <json>",
|
|
51
51
|
"MCP servers config as JSON array (ACP McpServer[] format)",
|
|
52
52
|
)
|
|
53
|
+
.option("--baseBranch <branch>", "Base branch for PR creation")
|
|
53
54
|
.action(async (options) => {
|
|
54
55
|
const envResult = envSchema.safeParse(process.env);
|
|
55
56
|
|
|
@@ -99,6 +100,7 @@ program
|
|
|
99
100
|
taskId: options.taskId,
|
|
100
101
|
runId: options.runId,
|
|
101
102
|
mcpServers,
|
|
103
|
+
baseBranch: options.baseBranch,
|
|
102
104
|
});
|
|
103
105
|
|
|
104
106
|
process.on("SIGINT", async () => {
|