@base44-preview/cli 0.0.21-pr.126.43cda65 → 0.0.22-pr.134.259538d
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 +305 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5818,6 +5818,97 @@ function handleTupleResult(result, final, index) {
|
|
|
5818
5818
|
if (result.issues.length) final.issues.push(...prefixIssues(index, result.issues));
|
|
5819
5819
|
final.value[index] = result.value;
|
|
5820
5820
|
}
|
|
5821
|
+
const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
5822
|
+
$ZodType.init(inst, def);
|
|
5823
|
+
inst._zod.parse = (payload, ctx) => {
|
|
5824
|
+
const input = payload.value;
|
|
5825
|
+
if (!isPlainObject$1(input)) {
|
|
5826
|
+
payload.issues.push({
|
|
5827
|
+
expected: "record",
|
|
5828
|
+
code: "invalid_type",
|
|
5829
|
+
input,
|
|
5830
|
+
inst
|
|
5831
|
+
});
|
|
5832
|
+
return payload;
|
|
5833
|
+
}
|
|
5834
|
+
const proms = [];
|
|
5835
|
+
const values = def.keyType._zod.values;
|
|
5836
|
+
if (values) {
|
|
5837
|
+
payload.value = {};
|
|
5838
|
+
const recordKeys = /* @__PURE__ */ new Set();
|
|
5839
|
+
for (const key of values) if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
|
|
5840
|
+
recordKeys.add(typeof key === "number" ? key.toString() : key);
|
|
5841
|
+
const result = def.valueType._zod.run({
|
|
5842
|
+
value: input[key],
|
|
5843
|
+
issues: []
|
|
5844
|
+
}, ctx);
|
|
5845
|
+
if (result instanceof Promise) proms.push(result.then((result$1) => {
|
|
5846
|
+
if (result$1.issues.length) payload.issues.push(...prefixIssues(key, result$1.issues));
|
|
5847
|
+
payload.value[key] = result$1.value;
|
|
5848
|
+
}));
|
|
5849
|
+
else {
|
|
5850
|
+
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
5851
|
+
payload.value[key] = result.value;
|
|
5852
|
+
}
|
|
5853
|
+
}
|
|
5854
|
+
let unrecognized;
|
|
5855
|
+
for (const key in input) if (!recordKeys.has(key)) {
|
|
5856
|
+
unrecognized = unrecognized ?? [];
|
|
5857
|
+
unrecognized.push(key);
|
|
5858
|
+
}
|
|
5859
|
+
if (unrecognized && unrecognized.length > 0) payload.issues.push({
|
|
5860
|
+
code: "unrecognized_keys",
|
|
5861
|
+
input,
|
|
5862
|
+
inst,
|
|
5863
|
+
keys: unrecognized
|
|
5864
|
+
});
|
|
5865
|
+
} else {
|
|
5866
|
+
payload.value = {};
|
|
5867
|
+
for (const key of Reflect.ownKeys(input)) {
|
|
5868
|
+
if (key === "__proto__") continue;
|
|
5869
|
+
let keyResult = def.keyType._zod.run({
|
|
5870
|
+
value: key,
|
|
5871
|
+
issues: []
|
|
5872
|
+
}, ctx);
|
|
5873
|
+
if (keyResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
|
|
5874
|
+
if (typeof key === "string" && number$1.test(key) && keyResult.issues.length && keyResult.issues.some((iss) => iss.code === "invalid_type" && iss.expected === "number")) {
|
|
5875
|
+
const retryResult = def.keyType._zod.run({
|
|
5876
|
+
value: Number(key),
|
|
5877
|
+
issues: []
|
|
5878
|
+
}, ctx);
|
|
5879
|
+
if (retryResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
|
|
5880
|
+
if (retryResult.issues.length === 0) keyResult = retryResult;
|
|
5881
|
+
}
|
|
5882
|
+
if (keyResult.issues.length) {
|
|
5883
|
+
if (def.mode === "loose") payload.value[key] = input[key];
|
|
5884
|
+
else payload.issues.push({
|
|
5885
|
+
code: "invalid_key",
|
|
5886
|
+
origin: "record",
|
|
5887
|
+
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
|
|
5888
|
+
input: key,
|
|
5889
|
+
path: [key],
|
|
5890
|
+
inst
|
|
5891
|
+
});
|
|
5892
|
+
continue;
|
|
5893
|
+
}
|
|
5894
|
+
const result = def.valueType._zod.run({
|
|
5895
|
+
value: input[key],
|
|
5896
|
+
issues: []
|
|
5897
|
+
}, ctx);
|
|
5898
|
+
if (result instanceof Promise) proms.push(result.then((result$1) => {
|
|
5899
|
+
if (result$1.issues.length) payload.issues.push(...prefixIssues(key, result$1.issues));
|
|
5900
|
+
payload.value[keyResult.value] = result$1.value;
|
|
5901
|
+
}));
|
|
5902
|
+
else {
|
|
5903
|
+
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
5904
|
+
payload.value[keyResult.value] = result.value;
|
|
5905
|
+
}
|
|
5906
|
+
}
|
|
5907
|
+
}
|
|
5908
|
+
if (proms.length) return Promise.all(proms).then(() => payload);
|
|
5909
|
+
return payload;
|
|
5910
|
+
};
|
|
5911
|
+
});
|
|
5821
5912
|
const $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
|
|
5822
5913
|
$ZodType.init(inst, def);
|
|
5823
5914
|
const values = getEnumValues(def.entries);
|
|
@@ -7108,6 +7199,39 @@ const tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
7108
7199
|
if (typeof minimum === "number") json.minItems = minimum;
|
|
7109
7200
|
if (typeof maximum === "number") json.maxItems = maximum;
|
|
7110
7201
|
};
|
|
7202
|
+
const recordProcessor = (schema, ctx, _json, params) => {
|
|
7203
|
+
const json = _json;
|
|
7204
|
+
const def = schema._zod.def;
|
|
7205
|
+
json.type = "object";
|
|
7206
|
+
const keyType = def.keyType;
|
|
7207
|
+
const patterns = keyType._zod.bag?.patterns;
|
|
7208
|
+
if (def.mode === "loose" && patterns && patterns.size > 0) {
|
|
7209
|
+
const valueSchema = process$3(def.valueType, ctx, {
|
|
7210
|
+
...params,
|
|
7211
|
+
path: [
|
|
7212
|
+
...params.path,
|
|
7213
|
+
"patternProperties",
|
|
7214
|
+
"*"
|
|
7215
|
+
]
|
|
7216
|
+
});
|
|
7217
|
+
json.patternProperties = {};
|
|
7218
|
+
for (const pattern of patterns) json.patternProperties[pattern.source] = valueSchema;
|
|
7219
|
+
} else {
|
|
7220
|
+
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") json.propertyNames = process$3(def.keyType, ctx, {
|
|
7221
|
+
...params,
|
|
7222
|
+
path: [...params.path, "propertyNames"]
|
|
7223
|
+
});
|
|
7224
|
+
json.additionalProperties = process$3(def.valueType, ctx, {
|
|
7225
|
+
...params,
|
|
7226
|
+
path: [...params.path, "additionalProperties"]
|
|
7227
|
+
});
|
|
7228
|
+
}
|
|
7229
|
+
const keyValues = keyType._zod.values;
|
|
7230
|
+
if (keyValues) {
|
|
7231
|
+
const validKeyValues = [...keyValues].filter((v$1) => typeof v$1 === "string" || typeof v$1 === "number");
|
|
7232
|
+
if (validKeyValues.length > 0) json.required = validKeyValues;
|
|
7233
|
+
}
|
|
7234
|
+
};
|
|
7111
7235
|
const nullableProcessor = (schema, ctx, json, params) => {
|
|
7112
7236
|
const def = schema._zod.def;
|
|
7113
7237
|
const inner = process$3(def.innerType, ctx, params);
|
|
@@ -7637,6 +7761,21 @@ function tuple(items, _paramsOrRest, _params) {
|
|
|
7637
7761
|
...normalizeParams(params)
|
|
7638
7762
|
});
|
|
7639
7763
|
}
|
|
7764
|
+
const ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => {
|
|
7765
|
+
$ZodRecord.init(inst, def);
|
|
7766
|
+
ZodType.init(inst, def);
|
|
7767
|
+
inst._zod.processJSONSchema = (ctx, json, params) => recordProcessor(inst, ctx, json, params);
|
|
7768
|
+
inst.keyType = def.keyType;
|
|
7769
|
+
inst.valueType = def.valueType;
|
|
7770
|
+
});
|
|
7771
|
+
function record(keyType, valueType, params) {
|
|
7772
|
+
return new ZodRecord({
|
|
7773
|
+
type: "record",
|
|
7774
|
+
keyType,
|
|
7775
|
+
valueType,
|
|
7776
|
+
...normalizeParams(params)
|
|
7777
|
+
});
|
|
7778
|
+
}
|
|
7640
7779
|
const ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
|
|
7641
7780
|
$ZodEnum.init(inst, def);
|
|
7642
7781
|
ZodType.init(inst, def);
|
|
@@ -7903,6 +8042,7 @@ var AuthValidationError = class extends Error {
|
|
|
7903
8042
|
//#endregion
|
|
7904
8043
|
//#region src/core/consts.ts
|
|
7905
8044
|
const PROJECT_SUBDIR = "base44";
|
|
8045
|
+
const CONFIG_FILE_EXTENSION = "jsonc";
|
|
7906
8046
|
const CONFIG_FILE_EXTENSION_GLOB = "{json,jsonc}";
|
|
7907
8047
|
const FUNCTION_CONFIG_FILE = `function.${CONFIG_FILE_EXTENSION_GLOB}`;
|
|
7908
8048
|
const APP_CONFIG_PATTERN = `**/.app.${CONFIG_FILE_EXTENSION_GLOB}`;
|
|
@@ -16537,9 +16677,7 @@ const SyncEntitiesResponseSchema = object({
|
|
|
16537
16677
|
//#region src/core/resources/entity/config.ts
|
|
16538
16678
|
async function readEntityFile(entityPath) {
|
|
16539
16679
|
const parsed = await readJsonFile(entityPath);
|
|
16540
|
-
|
|
16541
|
-
if (!result.success) throw new Error(`Invalid entity configuration in ${entityPath}: ${result.error.issues.map((e$1) => e$1.message).join(", ")}`);
|
|
16542
|
-
return result.data;
|
|
16680
|
+
return EntitySchema.parse(parsed);
|
|
16543
16681
|
}
|
|
16544
16682
|
async function readAllEntities(entitiesDir) {
|
|
16545
16683
|
if (!await pathExists(entitiesDir)) return [];
|
|
@@ -16561,8 +16699,8 @@ async function syncEntities(entities) {
|
|
|
16561
16699
|
});
|
|
16562
16700
|
if (!response.ok) {
|
|
16563
16701
|
const errorJson = await response.json();
|
|
16564
|
-
if (response.status === 428) throw new Error(`Failed to delete entity: ${errorJson
|
|
16565
|
-
throw new Error(`Error occurred while syncing entities ${errorJson
|
|
16702
|
+
if (response.status === 428) throw new Error(`Failed to delete entity: ${formatApiError(errorJson)}`);
|
|
16703
|
+
throw new Error(`Error occurred while syncing entities: ${formatApiError(errorJson)}`);
|
|
16566
16704
|
}
|
|
16567
16705
|
return SyncEntitiesResponseSchema.parse(await response.json());
|
|
16568
16706
|
}
|
|
@@ -16684,6 +16822,87 @@ const functionResource = {
|
|
|
16684
16822
|
push: pushFunctions
|
|
16685
16823
|
};
|
|
16686
16824
|
|
|
16825
|
+
//#endregion
|
|
16826
|
+
//#region src/core/resources/agent/schema.ts
|
|
16827
|
+
const AgentConfigSchema = looseObject({ name: string().regex(/^[a-z0-9_]+$/, "Agent name must be lowercase alphanumeric with underscores").min(1).max(100) });
|
|
16828
|
+
const SyncAgentsResponseSchema = object({
|
|
16829
|
+
created: array(string()),
|
|
16830
|
+
updated: array(string()),
|
|
16831
|
+
deleted: array(string())
|
|
16832
|
+
});
|
|
16833
|
+
const AgentConfigApiResponseSchema = looseObject({ name: string() });
|
|
16834
|
+
const ListAgentsResponseSchema = object({
|
|
16835
|
+
items: array(AgentConfigApiResponseSchema),
|
|
16836
|
+
total: number()
|
|
16837
|
+
});
|
|
16838
|
+
|
|
16839
|
+
//#endregion
|
|
16840
|
+
//#region src/core/resources/agent/config.ts
|
|
16841
|
+
async function readAgentFile(agentPath) {
|
|
16842
|
+
const parsed = await readJsonFile(agentPath);
|
|
16843
|
+
return AgentConfigSchema.parse(parsed);
|
|
16844
|
+
}
|
|
16845
|
+
async function readAllAgents(agentsDir) {
|
|
16846
|
+
if (!await pathExists(agentsDir)) return [];
|
|
16847
|
+
const files = await globby(`*.${CONFIG_FILE_EXTENSION_GLOB}`, {
|
|
16848
|
+
cwd: agentsDir,
|
|
16849
|
+
absolute: true
|
|
16850
|
+
});
|
|
16851
|
+
const agents = await Promise.all(files.map((filePath) => readAgentFile(filePath)));
|
|
16852
|
+
const names = /* @__PURE__ */ new Set();
|
|
16853
|
+
for (const agent of agents) {
|
|
16854
|
+
if (names.has(agent.name)) throw new Error(`Duplicate agent name "${agent.name}"`);
|
|
16855
|
+
names.add(agent.name);
|
|
16856
|
+
}
|
|
16857
|
+
return agents;
|
|
16858
|
+
}
|
|
16859
|
+
async function writeAgents(agentsDir, remoteAgents) {
|
|
16860
|
+
const existingAgents = await readAllAgents(agentsDir);
|
|
16861
|
+
const newNames = new Set(remoteAgents.map((a$1) => a$1.name));
|
|
16862
|
+
const toDelete = existingAgents.filter((a$1) => !newNames.has(a$1.name));
|
|
16863
|
+
for (const agent of toDelete) {
|
|
16864
|
+
const files = await globby(`${agent.name}.${CONFIG_FILE_EXTENSION_GLOB}`, {
|
|
16865
|
+
cwd: agentsDir,
|
|
16866
|
+
absolute: true
|
|
16867
|
+
});
|
|
16868
|
+
for (const filePath of files) await deleteFile(filePath);
|
|
16869
|
+
}
|
|
16870
|
+
for (const agent of remoteAgents) await writeJsonFile(join(agentsDir, `${agent.name}.${CONFIG_FILE_EXTENSION}`), agent);
|
|
16871
|
+
return {
|
|
16872
|
+
written: remoteAgents.map((a$1) => a$1.name),
|
|
16873
|
+
deleted: toDelete.map((a$1) => a$1.name)
|
|
16874
|
+
};
|
|
16875
|
+
}
|
|
16876
|
+
|
|
16877
|
+
//#endregion
|
|
16878
|
+
//#region src/core/resources/agent/api.ts
|
|
16879
|
+
async function pushAgents(agents) {
|
|
16880
|
+
const response = await getAppClient().put("agent-configs", {
|
|
16881
|
+
json: agents,
|
|
16882
|
+
throwHttpErrors: false
|
|
16883
|
+
});
|
|
16884
|
+
if (!response.ok) {
|
|
16885
|
+
const errorJson = await response.json();
|
|
16886
|
+
throw new Error(`Error occurred while syncing agents: ${formatApiError(errorJson)}`);
|
|
16887
|
+
}
|
|
16888
|
+
return SyncAgentsResponseSchema.parse(await response.json());
|
|
16889
|
+
}
|
|
16890
|
+
async function fetchAgents() {
|
|
16891
|
+
const response = await getAppClient().get("agent-configs", { throwHttpErrors: false });
|
|
16892
|
+
if (!response.ok) {
|
|
16893
|
+
const errorJson = await response.json();
|
|
16894
|
+
throw new Error(`Error occurred while fetching agents: ${formatApiError(errorJson)}`);
|
|
16895
|
+
}
|
|
16896
|
+
return ListAgentsResponseSchema.parse(await response.json());
|
|
16897
|
+
}
|
|
16898
|
+
|
|
16899
|
+
//#endregion
|
|
16900
|
+
//#region src/core/resources/agent/resource.ts
|
|
16901
|
+
const agentResource = {
|
|
16902
|
+
readAll: readAllAgents,
|
|
16903
|
+
push: pushAgents
|
|
16904
|
+
};
|
|
16905
|
+
|
|
16687
16906
|
//#endregion
|
|
16688
16907
|
//#region src/core/project/schema.ts
|
|
16689
16908
|
const TemplateSchema = object({
|
|
@@ -16704,7 +16923,8 @@ const ProjectConfigSchema = object({
|
|
|
16704
16923
|
description: string().optional(),
|
|
16705
16924
|
site: SiteConfigSchema.optional(),
|
|
16706
16925
|
entitiesDir: string().optional().default("entities"),
|
|
16707
|
-
functionsDir: string().optional().default("functions")
|
|
16926
|
+
functionsDir: string().optional().default("functions"),
|
|
16927
|
+
agentsDir: string().optional().default("agents")
|
|
16708
16928
|
});
|
|
16709
16929
|
const AppConfigSchema = object({ id: string().min(1, "id cannot be empty") });
|
|
16710
16930
|
const CreateProjectResponseSchema = looseObject({ id: string() });
|
|
@@ -16776,7 +16996,11 @@ async function readProjectConfig(projectRoot) {
|
|
|
16776
16996
|
if (!result.success) throw new Error(`Invalid project configuration: ${result.error.message}`);
|
|
16777
16997
|
const project = result.data;
|
|
16778
16998
|
const configDir = dirname(configPath);
|
|
16779
|
-
const [entities, functions] = await Promise.all([
|
|
16999
|
+
const [entities, functions, agents] = await Promise.all([
|
|
17000
|
+
entityResource.readAll(join(configDir, project.entitiesDir)),
|
|
17001
|
+
functionResource.readAll(join(configDir, project.functionsDir)),
|
|
17002
|
+
agentResource.readAll(join(configDir, project.agentsDir))
|
|
17003
|
+
]);
|
|
16780
17004
|
return {
|
|
16781
17005
|
project: {
|
|
16782
17006
|
...project,
|
|
@@ -16784,7 +17008,8 @@ async function readProjectConfig(projectRoot) {
|
|
|
16784
17008
|
configPath
|
|
16785
17009
|
},
|
|
16786
17010
|
entities,
|
|
16787
|
-
functions
|
|
17011
|
+
functions,
|
|
17012
|
+
agents
|
|
16788
17013
|
};
|
|
16789
17014
|
}
|
|
16790
17015
|
|
|
@@ -30469,6 +30694,11 @@ async function readAppConfig(projectRoot) {
|
|
|
30469
30694
|
* Authenticated HTTP client for Base44 API.
|
|
30470
30695
|
* Automatically handles token refresh and retry on 401 responses.
|
|
30471
30696
|
*/
|
|
30697
|
+
function formatApiError(errorJson) {
|
|
30698
|
+
const error = errorJson;
|
|
30699
|
+
const content = error?.message ?? error?.detail ?? errorJson;
|
|
30700
|
+
return typeof content === "string" ? content : JSON.stringify(content, null, 2);
|
|
30701
|
+
}
|
|
30472
30702
|
const retriedRequests = /* @__PURE__ */ new WeakSet();
|
|
30473
30703
|
/**
|
|
30474
30704
|
* Handles 401 responses by refreshing the token and retrying the request.
|
|
@@ -30522,6 +30752,19 @@ function getAppClient() {
|
|
|
30522
30752
|
return base44Client.extend({ prefixUrl: new URL(`/api/apps/${id}/`, getBase44ApiUrl()).href });
|
|
30523
30753
|
}
|
|
30524
30754
|
|
|
30755
|
+
//#endregion
|
|
30756
|
+
//#region src/core/clients/schemas.ts
|
|
30757
|
+
const ApiErrorSchema = object({
|
|
30758
|
+
error_type: string().optional(),
|
|
30759
|
+
message: union([string(), record(string(), unknown())]).optional(),
|
|
30760
|
+
detail: union([
|
|
30761
|
+
string(),
|
|
30762
|
+
record(string(), unknown()),
|
|
30763
|
+
array(unknown())
|
|
30764
|
+
]).optional(),
|
|
30765
|
+
traceback: string().optional()
|
|
30766
|
+
});
|
|
30767
|
+
|
|
30525
30768
|
//#endregion
|
|
30526
30769
|
//#region src/core/auth/api.ts
|
|
30527
30770
|
async function generateDeviceCode() {
|
|
@@ -31349,12 +31592,62 @@ async function pushEntitiesAction() {
|
|
|
31349
31592
|
if (result.created.length > 0) M.success(`Created: ${result.created.join(", ")}`);
|
|
31350
31593
|
if (result.updated.length > 0) M.success(`Updated: ${result.updated.join(", ")}`);
|
|
31351
31594
|
if (result.deleted.length > 0) M.warn(`Deleted: ${result.deleted.join(", ")}`);
|
|
31352
|
-
return {};
|
|
31595
|
+
return { outroMessage: "Entities pushed to Base44" };
|
|
31353
31596
|
}
|
|
31354
31597
|
const entitiesPushCommand = new Command("entities").description("Manage project entities").addCommand(new Command("push").description("Push local entities to Base44").action(async () => {
|
|
31355
31598
|
await runCommand(pushEntitiesAction, { requireAuth: true });
|
|
31356
31599
|
}));
|
|
31357
31600
|
|
|
31601
|
+
//#endregion
|
|
31602
|
+
//#region src/cli/commands/agents/push.ts
|
|
31603
|
+
async function pushAgentsAction() {
|
|
31604
|
+
const { agents } = await readProjectConfig();
|
|
31605
|
+
M.info(agents.length === 0 ? "No local agents found - this will delete all remote agents" : `Found ${agents.length} agents to push`);
|
|
31606
|
+
const result = await runTask("Pushing agents to Base44", async () => {
|
|
31607
|
+
return await pushAgents(agents);
|
|
31608
|
+
}, {
|
|
31609
|
+
successMessage: "Agents pushed successfully",
|
|
31610
|
+
errorMessage: "Failed to push agents"
|
|
31611
|
+
});
|
|
31612
|
+
if (result.created.length > 0) M.success(`Created: ${result.created.join(", ")}`);
|
|
31613
|
+
if (result.updated.length > 0) M.success(`Updated: ${result.updated.join(", ")}`);
|
|
31614
|
+
if (result.deleted.length > 0) M.warn(`Deleted: ${result.deleted.join(", ")}`);
|
|
31615
|
+
return { outroMessage: "Agents pushed to Base44" };
|
|
31616
|
+
}
|
|
31617
|
+
const agentsPushCommand = new Command("push").description("Push local agents to Base44 (replaces all remote agent configs)").action(async () => {
|
|
31618
|
+
await runCommand(pushAgentsAction, { requireAuth: true });
|
|
31619
|
+
});
|
|
31620
|
+
|
|
31621
|
+
//#endregion
|
|
31622
|
+
//#region src/cli/commands/agents/pull.ts
|
|
31623
|
+
async function pullAgentsAction() {
|
|
31624
|
+
const { project } = await readProjectConfig();
|
|
31625
|
+
const agentsDir = join(dirname(project.configPath), project.agentsDir);
|
|
31626
|
+
const remoteAgents = await runTask("Fetching agents from Base44", async () => {
|
|
31627
|
+
return await fetchAgents();
|
|
31628
|
+
}, {
|
|
31629
|
+
successMessage: "Agents fetched successfully",
|
|
31630
|
+
errorMessage: "Failed to fetch agents"
|
|
31631
|
+
});
|
|
31632
|
+
if (remoteAgents.items.length === 0) return { outroMessage: "No agents found on Base44" };
|
|
31633
|
+
const { written, deleted } = await runTask("Writing agent files", async () => {
|
|
31634
|
+
return await writeAgents(agentsDir, remoteAgents.items);
|
|
31635
|
+
}, {
|
|
31636
|
+
successMessage: "Agent files written successfully",
|
|
31637
|
+
errorMessage: "Failed to write agent files"
|
|
31638
|
+
});
|
|
31639
|
+
if (written.length > 0) M.success(`Written: ${written.join(", ")}`);
|
|
31640
|
+
if (deleted.length > 0) M.warn(`Deleted: ${deleted.join(", ")}`);
|
|
31641
|
+
return { outroMessage: `Pulled ${remoteAgents.total} agents to ${agentsDir}` };
|
|
31642
|
+
}
|
|
31643
|
+
const agentsPullCommand = new Command("pull").description("Pull agents from Base44 to local files (replaces all local agent configs)").action(async () => {
|
|
31644
|
+
await runCommand(pullAgentsAction, { requireAuth: true });
|
|
31645
|
+
});
|
|
31646
|
+
|
|
31647
|
+
//#endregion
|
|
31648
|
+
//#region src/cli/commands/agents/index.ts
|
|
31649
|
+
const agentsCommand = new Command("agents").description("Manage project agents").addCommand(agentsPushCommand).addCommand(agentsPullCommand);
|
|
31650
|
+
|
|
31358
31651
|
//#endregion
|
|
31359
31652
|
//#region src/cli/commands/functions/deploy.ts
|
|
31360
31653
|
async function deployFunctionsAction() {
|
|
@@ -31373,7 +31666,7 @@ async function deployFunctionsAction() {
|
|
|
31373
31666
|
const errorMessages = result.errors.map((e$1) => `'${e$1.name}' function: ${e$1.message}`).join("\n");
|
|
31374
31667
|
throw new Error(`Function deployment errors:\n${errorMessages}`);
|
|
31375
31668
|
}
|
|
31376
|
-
return {};
|
|
31669
|
+
return { outroMessage: "Functions deployed to Base44" };
|
|
31377
31670
|
}
|
|
31378
31671
|
const functionsDeployCommand = new Command("functions").description("Manage project functions").addCommand(new Command("deploy").description("Deploy local functions to Base44").action(async () => {
|
|
31379
31672
|
await runCommand(deployFunctionsAction, { requireAuth: true });
|
|
@@ -38931,7 +39224,7 @@ const siteDeployCommand = new Command("site").description("Manage site deploymen
|
|
|
38931
39224
|
|
|
38932
39225
|
//#endregion
|
|
38933
39226
|
//#region package.json
|
|
38934
|
-
var version = "0.0.
|
|
39227
|
+
var version = "0.0.22";
|
|
38935
39228
|
|
|
38936
39229
|
//#endregion
|
|
38937
39230
|
//#region src/cli/program.ts
|
|
@@ -38946,6 +39239,7 @@ program.addCommand(dashboardCommand);
|
|
|
38946
39239
|
program.addCommand(deployCommand);
|
|
38947
39240
|
program.addCommand(linkCommand);
|
|
38948
39241
|
program.addCommand(entitiesPushCommand);
|
|
39242
|
+
program.addCommand(agentsCommand);
|
|
38949
39243
|
program.addCommand(functionsDeployCommand);
|
|
38950
39244
|
program.addCommand(siteDeployCommand);
|
|
38951
39245
|
|