@base44-preview/cli 0.0.31-pr.229.9e308e0 → 0.0.31-pr.231.44bfbb1
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/cli/index.js +9 -4
- package/dist/cli/index.js.map +4 -4
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -160528,7 +160528,7 @@ var ToolConfigSchema = exports_external.union([
|
|
|
160528
160528
|
BackendFunctionToolConfigSchema
|
|
160529
160529
|
]);
|
|
160530
160530
|
var AgentConfigSchema = exports_external.looseObject({
|
|
160531
|
-
name: exports_external.string().
|
|
160531
|
+
name: exports_external.string().trim().min(1).max(100),
|
|
160532
160532
|
description: exports_external.string().trim().min(1, "Description is required"),
|
|
160533
160533
|
instructions: exports_external.string().trim().min(1, "Instructions are required"),
|
|
160534
160534
|
tool_configs: exports_external.array(ToolConfigSchema).optional().default([]),
|
|
@@ -160583,6 +160583,9 @@ async function fetchAgents() {
|
|
|
160583
160583
|
}
|
|
160584
160584
|
// src/core/resources/agent/config.ts
|
|
160585
160585
|
import { join as join3 } from "node:path";
|
|
160586
|
+
function toFileSlug(name2) {
|
|
160587
|
+
return name2.toLowerCase().replace(/[^a-z0-9_]/g, "_").replace(/_+/g, "_").replace(/^_|_$/g, "");
|
|
160588
|
+
}
|
|
160586
160589
|
async function readAgentFile(agentPath) {
|
|
160587
160590
|
const parsed = await readJsonFile(agentPath);
|
|
160588
160591
|
const result = AgentConfigSchema.safeParse(parsed);
|
|
@@ -160614,7 +160617,8 @@ async function writeAgents(agentsDir, remoteAgents) {
|
|
|
160614
160617
|
const newNames = new Set(remoteAgents.map((a) => a.name));
|
|
160615
160618
|
const toDelete = existingAgents.filter((a) => !newNames.has(a.name));
|
|
160616
160619
|
for (const agent of toDelete) {
|
|
160617
|
-
const
|
|
160620
|
+
const slug = toFileSlug(agent.name);
|
|
160621
|
+
const files = await globby(`${slug}.${CONFIG_FILE_EXTENSION_GLOB}`, {
|
|
160618
160622
|
cwd: agentsDir,
|
|
160619
160623
|
absolute: true
|
|
160620
160624
|
});
|
|
@@ -160623,7 +160627,8 @@ async function writeAgents(agentsDir, remoteAgents) {
|
|
|
160623
160627
|
}
|
|
160624
160628
|
}
|
|
160625
160629
|
for (const agent of remoteAgents) {
|
|
160626
|
-
const
|
|
160630
|
+
const slug = toFileSlug(agent.name);
|
|
160631
|
+
const filePath = join3(agentsDir, `${slug}.${CONFIG_FILE_EXTENSION}`);
|
|
160627
160632
|
await writeJsonFile(filePath, agent);
|
|
160628
160633
|
}
|
|
160629
160634
|
const written = remoteAgents.map((a) => a.name);
|
|
@@ -174653,4 +174658,4 @@ export {
|
|
|
174653
174658
|
CLIExitError
|
|
174654
174659
|
};
|
|
174655
174660
|
|
|
174656
|
-
//# debugId=
|
|
174661
|
+
//# debugId=248DB7D899D5395564756E2164756E21
|