@pantheon.ai/agents 0.0.1 → 0.0.2
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/index.js +10 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -178,9 +178,10 @@ var TaskListTidbProvider = class extends TaskListProvider {
|
|
|
178
178
|
if (config == null) return null;
|
|
179
179
|
return config;
|
|
180
180
|
}
|
|
181
|
-
async setAgentConfig(config) {
|
|
181
|
+
async setAgentConfig({ skills, ...config }) {
|
|
182
182
|
await this.db.insertInto("agent_project_config").values({
|
|
183
183
|
agent: this.agentName,
|
|
184
|
+
skills: JSON.stringify(skills),
|
|
184
185
|
...config
|
|
185
186
|
}).execute();
|
|
186
187
|
}
|
|
@@ -1498,13 +1499,17 @@ async function configAgent(name, options) {
|
|
|
1498
1499
|
branchId: options.rootBranchId,
|
|
1499
1500
|
agent: "codex",
|
|
1500
1501
|
prompt: `You must follow these instructions to setup base branch for role "${options.role}":
|
|
1502
|
+
0. Configure Git credentials via ~/.setup-git.sh
|
|
1501
1503
|
1. Clone the main branch from https://github.com/pingcap-inc/pantheon-agents to a temporary directory.
|
|
1502
1504
|
2. Copy the pantheon-agents/roles/${options.role}/AGENTS.md to \`<workspace>/AGENTS.md\`.
|
|
1503
|
-
3. Copy the pantheon-agents/skills directory to \`<workspace>/.codex
|
|
1505
|
+
3. Copy the pantheon-agents/roles/${options.role}/skills directory to \`<workspace>/.codex/skills\` if exists.
|
|
1506
|
+
${options.skills.length > 0 ? `4. Copy the pantheon-agents/skills/\{${options.skills.join(",")}} directory to \`<workspace>/.codex/\`` : ""}
|
|
1504
1507
|
|
|
1505
1508
|
Validate <workspace>: check if files and directorys exists:
|
|
1506
1509
|
- AGENTS.md
|
|
1507
1510
|
- .codex/skills
|
|
1511
|
+
|
|
1512
|
+
**You MUST NOT generate AGENTS.md and skills by yourself if clone failed.**
|
|
1508
1513
|
`
|
|
1509
1514
|
});
|
|
1510
1515
|
let retried = 0;
|
|
@@ -1545,6 +1550,7 @@ Validate <workspace>: check if files and directorys exists:
|
|
|
1545
1550
|
base_branch_id: branchId,
|
|
1546
1551
|
execute_agent: options.executeAgent,
|
|
1547
1552
|
role: options.role,
|
|
1553
|
+
skills: options.skills,
|
|
1548
1554
|
prototype_url: "https://github.com/pingcap-inc/pantheon-agents"
|
|
1549
1555
|
});
|
|
1550
1556
|
} else await provider.setAgentConfig({
|
|
@@ -1552,6 +1558,7 @@ Validate <workspace>: check if files and directorys exists:
|
|
|
1552
1558
|
base_branch_id: options.rootBranchId,
|
|
1553
1559
|
execute_agent: options.executeAgent,
|
|
1554
1560
|
role: options.role,
|
|
1561
|
+
skills: options.skills,
|
|
1555
1562
|
prototype_url: "https://github.com/pingcap-inc/pantheon-agents"
|
|
1556
1563
|
});
|
|
1557
1564
|
console.log(`Agent ${name} configured successfully.`);
|
|
@@ -1967,7 +1974,7 @@ var version = "0.0.1";
|
|
|
1967
1974
|
//#region index.ts
|
|
1968
1975
|
if (!process$1.env.PANTHEON_API_KEY) console.error("PANTHEON_API_KEY environment variable is not set.");
|
|
1969
1976
|
if (!process$1.env.DATABASE_URL) console.error("DATABASE_URL environment variable is not set.");
|
|
1970
|
-
const configAgentCommand = createCommand("pantheon-agents config").version(version).description("Configure agent for pantheon project").argument("<name>", "The name of the agent.").argument("<role>", "The role of the agent.").argument("<project-id>", "The project id of the agent.").option("--execute-agent <agent>", "The execute agent of the agent.", "codex").option("--root-branch-id <branchId>", "The root branch id of the agent. Default to project root branch id.").option("--no-bootstrap", "Prevent bootstrap base branch for agent. Use the root branch as base branch.").action(async function() {
|
|
1977
|
+
const configAgentCommand = createCommand("pantheon-agents config").version(version).description("Configure agent for pantheon project").argument("<name>", "The name of the agent.").argument("<role>", "The role of the agent.").argument("<project-id>", "The project id of the agent.").option("--skills <skills>", "The skills of the agent. Multiple values are separated by comma.", (val) => val.split(",").map((s) => s.trim()).filter((s) => s !== ""), []).option("--execute-agent <agent>", "The execute agent of the agent.", "codex").option("--root-branch-id <branchId>", "The root branch id of the agent. Default to project root branch id.").option("--no-bootstrap", "Prevent bootstrap base branch for agent. Use the root branch as base branch.").action(async function() {
|
|
1971
1978
|
const [name, role, projectId] = this.args;
|
|
1972
1979
|
await configAgent(name, {
|
|
1973
1980
|
role,
|