@pantheon.ai/agents 0.0.1 → 0.0.3
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 +12 -4
- 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
|
}
|
|
@@ -1471,6 +1472,7 @@ async function configAgent(name, options) {
|
|
|
1471
1472
|
if (previousConfig) if (previousConfig.role === options.role) {
|
|
1472
1473
|
console.log(`Agent ${name} already configured as ${options.role} for project ${options.projectId}.`);
|
|
1473
1474
|
console.log(`Base branch id: ${previousConfig.base_branch_id}`);
|
|
1475
|
+
await provider.close();
|
|
1474
1476
|
return;
|
|
1475
1477
|
} else {
|
|
1476
1478
|
console.error(`Agent ${name} already configured as ${previousConfig.role} for project ${options.projectId}.`);
|
|
@@ -1498,13 +1500,17 @@ async function configAgent(name, options) {
|
|
|
1498
1500
|
branchId: options.rootBranchId,
|
|
1499
1501
|
agent: "codex",
|
|
1500
1502
|
prompt: `You must follow these instructions to setup base branch for role "${options.role}":
|
|
1503
|
+
0. Configure Git credentials via ~/.setup-git.sh
|
|
1501
1504
|
1. Clone the main branch from https://github.com/pingcap-inc/pantheon-agents to a temporary directory.
|
|
1502
1505
|
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
|
|
1506
|
+
3. Copy the pantheon-agents/roles/${options.role}/skills directory to \`<workspace>/.codex/skills\` if exists.
|
|
1507
|
+
${options.skills.length > 0 ? `4. Copy the pantheon-agents/skills/\{${options.skills.join(",")}} directory to \`<workspace>/.codex/\`` : ""}
|
|
1504
1508
|
|
|
1505
1509
|
Validate <workspace>: check if files and directorys exists:
|
|
1506
1510
|
- AGENTS.md
|
|
1507
1511
|
- .codex/skills
|
|
1512
|
+
|
|
1513
|
+
**You MUST NOT generate AGENTS.md and skills by yourself if clone failed.**
|
|
1508
1514
|
`
|
|
1509
1515
|
});
|
|
1510
1516
|
let retried = 0;
|
|
@@ -1545,6 +1551,7 @@ Validate <workspace>: check if files and directorys exists:
|
|
|
1545
1551
|
base_branch_id: branchId,
|
|
1546
1552
|
execute_agent: options.executeAgent,
|
|
1547
1553
|
role: options.role,
|
|
1554
|
+
skills: options.skills,
|
|
1548
1555
|
prototype_url: "https://github.com/pingcap-inc/pantheon-agents"
|
|
1549
1556
|
});
|
|
1550
1557
|
} else await provider.setAgentConfig({
|
|
@@ -1552,6 +1559,7 @@ Validate <workspace>: check if files and directorys exists:
|
|
|
1552
1559
|
base_branch_id: options.rootBranchId,
|
|
1553
1560
|
execute_agent: options.executeAgent,
|
|
1554
1561
|
role: options.role,
|
|
1562
|
+
skills: options.skills,
|
|
1555
1563
|
prototype_url: "https://github.com/pingcap-inc/pantheon-agents"
|
|
1556
1564
|
});
|
|
1557
1565
|
console.log(`Agent ${name} configured successfully.`);
|
|
@@ -1961,13 +1969,13 @@ var require_cli_options = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1961
1969
|
|
|
1962
1970
|
//#endregion
|
|
1963
1971
|
//#region package.json
|
|
1964
|
-
var version = "0.0.
|
|
1972
|
+
var version = "0.0.3";
|
|
1965
1973
|
|
|
1966
1974
|
//#endregion
|
|
1967
1975
|
//#region index.ts
|
|
1968
1976
|
if (!process$1.env.PANTHEON_API_KEY) console.error("PANTHEON_API_KEY environment variable is not set.");
|
|
1969
1977
|
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() {
|
|
1978
|
+
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
1979
|
const [name, role, projectId] = this.args;
|
|
1972
1980
|
await configAgent(name, {
|
|
1973
1981
|
role,
|